@acedatacloud/nexior 3.329.39 → 3.329.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ApiCodeButton-BuAXokaf.js → ApiCodeButton-BeFKoVdS.js} +1 -1
- package/dist/assets/{Artifacts-C_ScvWGC.js → Artifacts-Norflr8E.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BgMBQkQ1.js → AskUserQuestionCard-B2Q3pcP-.js} +1 -1
- package/dist/assets/{AudioPreview-UZ5qR4-4.js → AudioPreview-Cnfin0he.js} +1 -1
- package/dist/assets/{Auth-Scu_-6vi.js → Auth-COY0V6qa.js} +1 -1
- package/dist/assets/{Bare-BklIgjvU.js → Bare-C7FUtEWf.js} +1 -1
- package/dist/assets/{BotPlaceholder-DrMa4leC.js → BotPlaceholder-DSEljO8x.js} +1 -1
- package/dist/assets/{BottomFooter-95nzDKMZ.js → BottomFooter-Cgd2LX0_.js} +1 -1
- package/dist/assets/{Callback-Beh4v6eb.js → Callback-V5HX0ZMQ.js} +1 -1
- package/dist/assets/{CodeSnippet-BjKN570c.js → CodeSnippet-DjV1z26c.js} +1 -1
- package/dist/assets/{Console-Cd3P1A21.js → Console-BuU9taI1.js} +1 -1
- package/dist/assets/{Consumption-BNM0d3BL.js → Consumption-BUcyYr1r.js} +1 -1
- package/dist/assets/{Conversation-DDeKXrRR.js → Conversation-CBFMLxLx.js} +1 -1
- package/dist/assets/{Conversation-CJs41Kc-.js → Conversation-OwI0zyMh.js} +1 -1
- package/dist/assets/{CopyToClipboard-CZA6WQWP.js → CopyToClipboard-CdZHnA6f.js} +1 -1
- package/dist/assets/{Detail-DiPWoB2s.js → Detail-CkZcsSoK.js} +2 -2
- package/dist/assets/{Extra-D25qV1lg.js → Extra-Bp6nSjLa.js} +1 -1
- package/dist/assets/{FilePreview-DrpFw-4j.js → FilePreview-CBmcA81-.js} +1 -1
- package/dist/assets/{Hailuo-DyffmeCo.js → Hailuo-CNWEzoB6.js} +1 -1
- package/dist/assets/{History-DpKO0bsE.js → History-BBN8acoY.js} +1 -1
- package/dist/assets/{ImagePreview-Cegc7Kc9.js → ImagePreview-C-RPL05t.js} +1 -1
- package/dist/assets/{ImageWrapper-hjcr_HZW.js → ImageWrapper-BBNTd2c0.js} +1 -1
- package/dist/assets/{Index-BQi4Ibhl.js → Index-B4PPT3vn.js} +1 -1
- package/dist/assets/{Index-jIbp_A6c.js → Index-B6akY-bn.js} +1 -1
- package/dist/assets/{Index-Bw2-9tdT.js → Index-BJ-Saipm.js} +1 -1
- package/dist/assets/{Index-DpLiKGhi.js → Index-BRHhWWIP.js} +1 -1
- package/dist/assets/{Index-WuAShMJl.js → Index-BS0E0RfB.js} +1 -1
- package/dist/assets/{Index-BSErpN9e.js → Index-BfU7-3Of.js} +1 -1
- package/dist/assets/{Index-D0SPUkT9.js → Index-C3zv9OSB.js} +1 -1
- package/dist/assets/{Index-Bh8ixOJX.js → Index-CBskKafo.js} +1 -1
- package/dist/assets/{Index-D7BDo-b9.js → Index-CIjgS6fi.js} +1 -1
- package/dist/assets/{Index-CnyeH_9w.js → Index-CS8-nA_o.js} +1 -1
- package/dist/assets/{Index-D_kggTLc.js → Index-CThBMMOH.js} +1 -1
- package/dist/assets/{Index-BQ8Z9SPM.js → Index-CXFhzrig.js} +1 -1
- package/dist/assets/{Index-Ddgg1D5S.js → Index-CXmobUGY.js} +1 -1
- package/dist/assets/{Index-wt9gxcJX.js → Index-CY-ummV-.js} +1 -1
- package/dist/assets/{Index-DpRUOhpv.js → Index-Cg-04wem.js} +1 -1
- package/dist/assets/{Index-S7_VI00E.js → Index-CtvhekRd.js} +1 -1
- package/dist/assets/{Index-DnTTV7kF.js → Index-Cve3rnAK.js} +1 -1
- package/dist/assets/{Index-2yKdqfjL.js → Index-DO5lhQft.js} +1 -1
- package/dist/assets/{Index-D7df7jMb.js → Index-DOldx3ff.js} +1 -1
- package/dist/assets/{Index-CWGHoBNO.js → Index-DQLjYsOv.js} +1 -1
- package/dist/assets/{Index-rcZfLP8q.js → Index-DSW3mla3.js} +1 -1
- package/dist/assets/{Index-CPnZI5Ip.js → Index-DVcCiKZi.js} +1 -1
- package/dist/assets/{Index-C_A6EuF8.js → Index-DYi_q9ni.js} +1 -1
- package/dist/assets/{Index-BPBBjoUQ.js → Index-Dje-rlw9.js} +1 -1
- package/dist/assets/{Index-CAVtjGzp.js → Index-FCdtdiBa.js} +1 -1
- package/dist/assets/{Index-BziNJIYk.js → Index-ZDQhZDTq.js} +1 -1
- package/dist/assets/{Index-DQI6AhRg.js → Index-cvhV9_tk.js} +1 -1
- package/dist/assets/{Index-8hxmZLEo.js → Index-sDU2Iccm.js} +1 -1
- package/dist/assets/{Index-bBF9gQIC.js → Index-u2Ki3vsc.js} +1 -1
- package/dist/assets/{Invitees-BjmGIzyW.js → Invitees-DTmK3qd1.js} +1 -1
- package/dist/assets/{List-DY_uBDOU.js → List-BoiZNLdK.js} +1 -1
- package/dist/assets/{List-jCr_3xxr.js → List-NhjPzhE1.js} +1 -1
- package/dist/assets/{List-CNsZdFsU.js → List-nAMaX7et.js} +1 -1
- package/dist/assets/{LocalTools-DTuKyWpl.js → LocalTools-CdNzspUZ.js} +1 -1
- package/dist/assets/{LocalTools-C8Kp14hS.js → LocalTools-TqX0-O7S.js} +1 -1
- package/dist/assets/{Main-DhnHqDHL.js → Main-DDEFZnND.js} +1 -1
- package/dist/assets/{Message-DcWcy4WT.js → Message-D7o6mFb7.js} +1 -1
- package/dist/assets/{Model-D12WLuuu.js → Model-DpkFCUeF.js} +1 -1
- package/dist/assets/{Navigator-7RDEpA4f.js → Navigator-CeJDlOal.js} +3 -3
- package/dist/assets/{NotFound-BBertoyE.js → NotFound-CcWv0ANK.js} +1 -1
- package/dist/assets/{Pay-D5g__Bcv.js → Pay-CdjTYUiT.js} +1 -1
- package/dist/assets/{Player-VQ1ihHfF.js → Player-DbW0kz_j.js} +1 -1
- package/dist/assets/{PromptTextarea-Bdpc7bLs.js → PromptTextarea-D64KucTj.js} +1 -1
- package/dist/assets/{RealtimeCall-DvGIysM1.js → RealtimeCall-BnQX1KOK.js} +1 -1
- package/dist/assets/{ScheduledTasks-0enf4zs0.js → ScheduledTasks-DBfC4Xeu.js} +1 -1
- package/dist/assets/{Status-9JYM_YYi.js → Status-DNzBKlh6.js} +1 -1
- package/dist/assets/{Subscribe-BJ9TzS2H.js → Subscribe-3fSD46l_.js} +1 -1
- package/dist/assets/{TabSwitcher-Dc2ee1pS.js → TabSwitcher-zegVZenS.js} +1 -1
- package/dist/assets/{Tts-JKdRzrkr.js → Tts-Cx5np_uK.js} +1 -1
- package/dist/assets/{VideoPlayer-B7-ByfsD.js → VideoPlayer-Dt-ZkZ7-.js} +1 -1
- package/dist/assets/{alert-Dd3pcgZr.js → alert-B2CVhm_j.js} +1 -1
- package/dist/assets/arrow-down-DB6kszvp.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-BaRHxbNJ.js → arrow-down-wide-narrow-BuHYSd9y.js} +1 -1
- package/dist/assets/arrow-left-DSwyqZnY.js +1 -0
- package/dist/assets/arrow-right-CHPX_N2y.js +1 -0
- package/dist/assets/arrow-up-DVVmqNgu.js +1 -0
- package/dist/assets/{avatar-L9MQHvwq.js → avatar-DzWyTzrb.js} +1 -1
- package/dist/assets/{basic-CJByVeYk.js → basic-CEk1hGrn.js} +1 -1
- package/dist/assets/{box-BNgmySYi.js → box-3oU0nJj7.js} +1 -1
- package/dist/assets/{boxes-D3iyMhpE.js → boxes-C7QoAhqw.js} +1 -1
- package/dist/assets/{brain-DIO_FYaz.js → brain-BKa5En2o.js} +1 -1
- package/dist/assets/{chart-no-axes-combined--MOMNF5_.js → chart-no-axes-combined-GHSfYt41.js} +1 -1
- package/dist/assets/{chat-l4obLcWq.js → chat-CaFdenKr.js} +1 -1
- package/dist/assets/check-aLE5ztPJ.js +1 -0
- package/dist/assets/chevron-down-vuPAq13O.js +1 -0
- package/dist/assets/chevron-right-DpHaUDEn.js +1 -0
- package/dist/assets/circle-check-DSgptsGK.js +1 -0
- package/dist/assets/clock-DBA92Mpf.js +1 -0
- package/dist/assets/{codingBridge-CNCAGBZ0.js → codingBridge-DAjXFdeq.js} +1 -1
- package/dist/assets/{codingBridgeNotify-BAkwB4Sh.js → codingBridgeNotify-oVzEv0f4.js} +2 -2
- package/dist/assets/{coins-DKcM60Q6.js → coins-9-aPnI2X.js} +1 -1
- package/dist/assets/{collapse-BhMaU5Zx.js → collapse-DA6Wawv5.js} +1 -1
- package/dist/assets/{createTaskActions-DP5rzSmh.js → createTaskActions-3GlYVBJ_.js} +1 -1
- package/dist/assets/{digitalhuman-DGLxr77A.js → digitalhuman-Bg332ODT.js} +1 -1
- package/dist/assets/{dollar-sign-DGBglg_W.js → dollar-sign-CFS9WzpA.js} +1 -1
- package/dist/assets/{download-DVU6oOkC.js → download-DaUWS-Bd.js} +1 -1
- package/dist/assets/{drawer-anvkTtti.js → drawer-BTb568QE.js} +1 -1
- package/dist/assets/{dropdown-BZLB3S0N.js → dropdown-D_F9a5m3.js} +1 -1
- package/dist/assets/{dropdown-Dn5Hextn.js → dropdown-xd9DYGqT.js} +1 -1
- package/dist/assets/{ellipsis-wz3p-GZ2.js → ellipsis-CeKAUsOj.js} +1 -1
- package/dist/assets/{esm-BB947M9B.js → esm-BLdpHY_F.js} +2 -2
- package/dist/assets/{esm-6PmU3KpF.js → esm-BdoKnR--.js} +1 -1
- package/dist/assets/{esm-BhtjOBvO.js → esm-CYoG29Gp.js} +2 -2
- package/dist/assets/{esm-BgqIn2yW.js → esm-ChgFCapd.js} +1 -1
- package/dist/assets/{esm-5HhMFf9I.js → esm-DCXotMX3.js} +1 -1
- package/dist/assets/{esm-DVKqrnL_.js → esm-DM9Fxltm.js} +3 -3
- package/dist/assets/esm-ZyhXDEFa.js +1 -0
- package/dist/assets/{external-link-DpG3vEdE.js → external-link-b0HsOZxw.js} +1 -1
- package/dist/assets/{eye-BIfEjJFV.js → eye-YAISnHSQ.js} +1 -1
- package/dist/assets/{file-output-DH97iOje.js → file-output-BqkyEnv-.js} +1 -1
- package/dist/assets/{file-text-CSbvyzIm.js → file-text-DsgjIpdF.js} +1 -1
- package/dist/assets/{fish-bYPGpKO3.js → fish-DBkKcosM.js} +1 -1
- package/dist/assets/{flux-DDK7FsA8.js → flux-ChrhQbIG.js} +1 -1
- package/dist/assets/{folder-DytMwKnG.js → folder-FhmDBUBS.js} +1 -1
- package/dist/assets/gauge-DegSoIN2.js +1 -0
- package/dist/assets/{globe-DkpQWUKq.js → globe-Bmloh9mt.js} +1 -1
- package/dist/assets/{grokvideo-C-lDTab7.js → grokvideo-D73qbq_i.js} +1 -1
- package/dist/assets/{hailuo-7Eje19xk.js → hailuo-D32O85q_.js} +1 -1
- package/dist/assets/{headphones-CFEVoRGH.js → headphones-ByWmiVQB.js} +1 -1
- package/dist/assets/{history-Bpoyg9PI.js → history-DhPnMvMV.js} +1 -1
- package/dist/assets/{image-Ba6DqjQ8.js → image-wpaPNlv3.js} +1 -1
- package/dist/assets/{index-D2ugFcRR.js → index-BxHiLpHH.js} +3 -3
- package/dist/assets/{index.browser.esm-IHXO0Qn5.js → index.browser.esm-DScAFw7a.js} +1 -1
- package/dist/assets/{index.es-C7Z-tC9B.js → index.es-Bw74sJPg.js} +1 -1
- package/dist/assets/{info-DhKCbyPk.js → info-CIky8Wbu.js} +1 -1
- package/dist/assets/{input-number-DFySdlyu.js → input-number-BR2Mu5ij.js} +1 -1
- package/dist/assets/{key-round-Bpo_BFv-.js → key-round-CixzZJn_.js} +1 -1
- package/dist/assets/{kling-BOzdQsBG.js → kling-B6POq-m8.js} +1 -1
- package/dist/assets/{languages-Cr5vLlEK.js → languages-DOseCPxD.js} +1 -1
- package/dist/assets/{laptop-llu3yX1o.js → laptop-Be6kvy0C.js} +1 -1
- package/dist/assets/{lightbulb-BjylYVln.js → lightbulb-rIlVCufE.js} +1 -1
- package/dist/assets/{link-DNn-Vrqh.js → link-D1M-24Rw.js} +1 -1
- package/dist/assets/loader-circle-Dgp1CZjS.js +1 -0
- package/dist/assets/{luma-3MJudKx7.js → luma-CfWUgpVJ.js} +1 -1
- package/dist/assets/{maestro-C7DGfQzn.js → maestro-COSVFt8c.js} +1 -1
- package/dist/assets/{mail-CZzTnC--.js → mail-B23BCE03.js} +1 -1
- package/dist/assets/{message-circle-B2Ogr05P.js → message-circle-B7rH-YAI.js} +1 -1
- package/dist/assets/{mic-rW_ChD67.js → mic-D2PbMdWj.js} +1 -1
- package/dist/assets/{midjourney-DAwbbNh2.js → midjourney-Du-XPbhQ.js} +1 -1
- package/dist/assets/{mobileLocalExec-CKus95h2.js → mobileLocalExec-CDEDXJXu.js} +2 -2
- package/dist/assets/{mouse-pointer-2-DFSbcb0W.js → mouse-pointer-2-BXyHemtD.js} +1 -1
- package/dist/assets/music-2-CaUyBRYJ.js +1 -0
- package/dist/assets/{nanobanana-D4Gy2-Nv.js → nanobanana-CIieo2fN.js} +1 -1
- package/dist/assets/{omni-K1Uk6LoW.js → omni-DG7YP-Gm.js} +1 -1
- package/dist/assets/{openaiimage-BX3dYCUU.js → openaiimage-uzC9DGgH.js} +1 -1
- package/dist/assets/{pagination-B0NnI5zw.js → pagination-5PZxIWWU.js} +1 -1
- package/dist/assets/{pagination-DdsSvKkV.js → pagination-BYV_3jrR.js} +1 -1
- package/dist/assets/{palette-oClr90sr.js → palette-CEZXScvS.js} +1 -1
- package/dist/assets/{paperclip-oXc2BFvc.js → paperclip-KXEt0oS7.js} +1 -1
- package/dist/assets/{pause-Bq9JCMIo.js → pause-Bue2vqD4.js} +1 -1
- package/dist/assets/{pencil-Yrfa0b1p.js → pencil-BhBxDtfe.js} +1 -1
- package/dist/assets/{pika-6-xurNNm.js → pika-C6CYRPxL.js} +1 -1
- package/dist/assets/{pixverse-DYTE6_nK.js → pixverse-CkAOOUn3.js} +1 -1
- package/dist/assets/play-eiM_z56b.js +1 -0
- package/dist/assets/plus-BmJw3Aio.js +1 -0
- package/dist/assets/{popover-DSTJp5Cr.js → popover-DWXLmzVN.js} +1 -1
- package/dist/assets/{producer-65nXoXpa.js → producer-BhKowXx8.js} +1 -1
- package/dist/assets/{qrart-CAeYMrba.js → qrart-DY5zdnNJ.js} +1 -1
- package/dist/assets/{realtime-CH5vjNue.js → realtime-Cza4iKah.js} +1 -1
- package/dist/assets/{refresh-cw-aDmtppBJ.js → refresh-cw-DS7gxhHJ.js} +1 -1
- package/dist/assets/rotate-ccw-CwK8kfa-.js +1 -0
- package/dist/assets/rotate-cw-CDHuoduF.js +1 -0
- package/dist/assets/{row-MIrnxpN3.js → row-B0OfQnxx.js} +1 -1
- package/dist/assets/search-DQWgN4hZ.js +1 -0
- package/dist/assets/{seedance-Hn9ocI6A.js → seedance-Bbfapnwk.js} +1 -1
- package/dist/assets/{seedream-D49_VDnJ.js → seedream-CHAcYMtI.js} +1 -1
- package/dist/assets/{select-BLM0v92m.js → select-DUVlT9hf.js} +1 -1
- package/dist/assets/{serp-64GruYbw.js → serp-CnWdo1Kw.js} +1 -1
- package/dist/assets/{shield-CYJpqJPB.js → shield-C8WMDq57.js} +1 -1
- package/dist/assets/{shuffle-CmK9qICx.js → shuffle-ciT9HB3I.js} +1 -1
- package/dist/assets/{slider-BqxpYCLY.js → slider-BtWk6ssI.js} +1 -1
- package/dist/assets/{sliders-horizontal-BVxEasbo.js → sliders-horizontal-BrbLPoUJ.js} +1 -1
- package/dist/assets/{solana-wallets-Bt6Xh5VB.js → solana-wallets-Br_Gl0A-.js} +2 -2
- package/dist/assets/{solana-wallets-vue-o4t4wDHw.js → solana-wallets-vue-r8bhz8g7.js} +1 -1
- package/dist/assets/{sora-ClMzh50a.js → sora-B-_lOCvv.js} +1 -1
- package/dist/assets/square-sxcwzAnL.js +1 -0
- package/dist/assets/{suno-VLNVgNuR.js → suno-hd1kV9am.js} +1 -1
- package/dist/assets/{switch-CzEQE2DH.js → switch-CCuW_1N4.js} +1 -1
- package/dist/assets/{table-BYj2mLeB.js → table-10S0N7Lq.js} +1 -1
- package/dist/assets/{tabs-lcFoTVMT.js → tabs-HUWpQrx0.js} +1 -1
- package/dist/assets/{tag-DpGMo9Ys.js → tag--d1uiCpB.js} +1 -1
- package/dist/assets/{taskDrawerMixin-Bsm_pfmZ.js → taskDrawerMixin-7tqZnehJ.js} +1 -1
- package/dist/assets/terminal-CL0T5eV2.js +1 -0
- package/dist/assets/{time-picker-C3lVX0v3.js → time-picker-DIaCK7uQ.js} +1 -1
- package/dist/assets/{tooltip-CaHCcyJq.js → tooltip-Gx4jPHlO.js} +1 -1
- package/dist/assets/{trash-2-C9z6HAJ5.js → trash-2-CYODcd1K.js} +1 -1
- package/dist/assets/{triangle-alert-vfYvzN9x.js → triangle-alert-DjbquHLH.js} +1 -1
- package/dist/assets/{upload-25kqK9dU.js → upload-B9ekoGFH.js} +1 -1
- package/dist/assets/{upload-dOdEM0mX.js → upload-BWf23oQa.js} +1 -1
- package/dist/assets/user-OnR_DaXa.js +1 -0
- package/dist/assets/{veo-BpQovylx.js → veo-dwg2bowY.js} +1 -1
- package/dist/assets/{video-CXyjFmts.js → video-Bu_CmK1e.js} +1 -1
- package/dist/assets/{volume-2-C05cqKlS.js → volume-2-BJIylI2W.js} +1 -1
- package/dist/assets/{wallet-1hdAbKHb.js → wallet-CIDNjlIu.js} +1 -1
- package/dist/assets/{wan-9u7vGHI6.js → wan-WAx9LSVV.js} +1 -1
- package/dist/assets/{wand-sparkles-C2tZqsJR.js → wand-sparkles-CiQpHMMP.js} +1 -1
- package/dist/assets/{web-CR4Od62x.js → web-CDfWGNCh.js} +1 -1
- package/dist/assets/{web-BGkThKPE.js → web-CVLQ26Fp.js} +1 -1
- package/dist/assets/{web-CRO88HEi.js → web-CusVhh7v.js} +1 -1
- package/dist/assets/{web-Cx58U-5S.js → web-DIublOSG.js} +1 -1
- package/dist/assets/{web-BIo0zoS8.js → web-Df2PJCGO.js} +1 -1
- package/dist/assets/{webextrator-D0CfIdjK.js → webextrator-DdXnI9Vg.js} +1 -1
- package/dist/assets/{zap-T3F5bwrg.js → zap-CcogLrun.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/arrow-down-j7nSyZ4M.js +0 -1
- package/dist/assets/arrow-left-DVpFd5jw.js +0 -1
- package/dist/assets/arrow-right-3fwfmhvM.js +0 -1
- package/dist/assets/arrow-up-BKl4Vbl7.js +0 -1
- package/dist/assets/check-Cc02Y3ax.js +0 -1
- package/dist/assets/chevron-down-BA-bCfF8.js +0 -1
- package/dist/assets/chevron-right-Zj6yHMSB.js +0 -1
- package/dist/assets/circle-check-DQepOQOd.js +0 -1
- package/dist/assets/clock-CWEF1y39.js +0 -1
- package/dist/assets/esm-DC_cszHZ.js +0 -1
- package/dist/assets/gauge-B9FwpRZA.js +0 -1
- package/dist/assets/loader-circle-Ccv7sDWk.js +0 -1
- package/dist/assets/music-2-D-TcLLg4.js +0 -1
- package/dist/assets/play-yRXwqcYt.js +0 -1
- package/dist/assets/plus-DqHwKrUU.js +0 -1
- package/dist/assets/rotate-ccw-CirseUef.js +0 -1
- package/dist/assets/rotate-cw-BRu0_G2r.js +0 -1
- package/dist/assets/search-BlPlwyB8.js +0 -1
- package/dist/assets/square-XwzVLVKy.js +0 -1
- package/dist/assets/terminal-D7Fyyun9.js +0 -1
- package/dist/assets/user-JE9H71yP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as f}from"./table-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as f}from"./table-10S0N7Lq.js";import{t as ee}from"./tooltip-Gx4jPHlO.js";import{t as p}from"./card-D-4S-l7a.js";import{n as m,t as h}from"./row-B0OfQnxx.js";import{t as g}from"./divider-BNWJAaA2.js";import{t as _}from"./progress-BeEbKKvj.js";import{t as v}from"./skeleton-BVbQKb45.js";import{t as y}from"./coins-9-aPnI2X.js";import{t as b}from"./CopyToClipboard-CdZHnA6f.js";import{t as x}from"./link-D1M-24Rw.js";import{t as S}from"./user-OnR_DaXa.js";import{t as C}from"./wallet-CIDNjlIu.js";import{Ai as w,E as T,Ft as E,Gt as D,Jn as O,Q as k,X as A,Xn as j,Yn as M,in as N,mi as P,or as F}from"./index-BxHiLpHH.js";var I=u({name:`ConsoleDistributionList`,components:{CreditsIcon:y,LinkIcon:x,PercentIcon:P(`percent`,[[`line`,{x1:`19`,x2:`5`,y1:`5`,y2:`19`,key:`1x9vlm`}],[`circle`,{cx:`6.5`,cy:`6.5`,r:`2.5`,key:`4mh3h7`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`2.5`,key:`1mdrzq`}]]),UserIcon:S,WalletIcon:C,CopyToClipboard:b,QrCode:E,ElProgress:_,ElRow:h,ElCol:m,ElButton:w,ElDivider:g,ElCard:p,ElTooltip:ee,ElTable:f,ElTableColumn:d,ElSkeleton:v},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||`1`)},qrColor(){let e=document.documentElement.classList.contains(`dark`);return{dark:e?`#ffffff`:`#000000`,light:e?`#1e1e1e`:`#ffffff`}},distributionLevelMap(){let e={};return this.distributionLevels.forEach(t=>{e[t.level]=t}),e}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:D,goHistory(){this.$router.push({name:A})},goInvitees(){this.$router.push({name:k})},onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{page:e}})},getPercentageForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level]?.threshold,t=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor((this.distributionStatus?.price-e)/(t-e)*100)},getDeltaForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor(e-this.distributionStatus?.price)},async onFetchData(){this.loading=!0,await M.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){let e=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{let t=(await j.create(e))?.data?.data?.url||e;this.distributionLink=N()?t.replace(`surl.id`,`share.acedata.cloud`):t}catch{this.distributionLink=e}},async onFetchDistributionStatus(){let{data:e}=await M.getAll({user_id:this.$store.getters.user.id});e.items&&e.items.length>0&&(this.distributionStatus=e.items[0])},async onFetchDistributionLevels(){let{data:e}=await O.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=e.items},async onFetchInvitees(){let{data:e}=await F.getInvitees({});this.invitees=e.items,this.inviteesCount=e.count}}}),L={class:`title`},R={key:1},z={class:`icon-wrapper`},B={class:`text-left`},V={class:`description`},H={class:`value`},U={key:1},W={class:`icon-wrapper`},G={class:`text-left`},K={class:`description`},q={class:`value`},J={key:1},Y={class:`icon-wrapper`},X={class:`text-left`},Z={class:`description`},te={class:`value`},Q={key:1},ne={class:`icon-wrapper`},re={class:`text-left`},ie={class:`description`},ae={class:`value`},oe={key:1},se={class:`title`},ce={class:`clear-both overflow-hidden`},le={class:`float-left description`},ue={class:`float-right description`},de={class:`description`},fe={class:`level`},pe={class:`level`},$={class:`level`},me={key:1},he={class:`title`},ge={class:`link-wrapper text-center`},_e=[`href`],ve={class:`qr-wrapper ml-auto mr-auto`},ye={class:`mt-0`},be={class:`description`},xe={class:`more`};function Se(u,d,f,ee,p,m){let h=o(`el-col`),g=o(`el-row`),_=o(`el-skeleton`),v=o(`wallet-icon`),y=o(`el-button`),b=o(`el-card`),x=o(`credits-icon`),S=o(`el-tooltip`),C=o(`percent-icon`),w=o(`user-icon`),T=o(`el-progress`),E=o(`el-divider`),D=o(`el-table-column`),O=o(`el-table`);o(`link-icon`);let k=o(`copy-to-clipboard`),A=o(`qr-code`);return l(),s(g,{class:`panel`},{default:c(()=>[r(h,{span:24},{default:c(()=>[r(g,null,{default:c(()=>[r(h,{span:24},{default:c(()=>[e(`h2`,L,n(u.$t(`common.title.distribution`)),1)]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,R,[e(`div`,z,[r(v,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,B,[e(`p`,V,n(u.$t(`distribution.title.price`)),1),e(`p`,H,n(u.getPriceString({value:u.distributionStatus?.price})),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goHistory},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,U,[e(`div`,W,[r(x,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,G,[e(`p`,K,n(u.$t(`distribution.title.reward`)),1),e(`p`,q,n(u.getPriceString({value:u.distributionStatus?.reward})),1)]),r(S,{effect:`dark`,content:u.$t(`distribution.message.developingWithDrawal`),placement:`top`},{default:c(()=>[r(y,{type:`primary`,round:``,size:`small`,class:`btn`},{default:c(()=>[t(n(u.$t(`distribution.button.withdrawal`)),1)]),_:1})]),_:1},8,[`content`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,J,[e(`div`,Y,[r(C,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,X,[e(`p`,Z,n(u.$t(`distribution.title.percentage`)),1),e(`p`,te,n(u.distributionStatus?.level?.percentage)+`%`,1)])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,Q,[e(`div`,ne,[r(w,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,re,[e(`p`,ie,n(u.$t(`distribution.title.inviteesCount`)),1),e(`p`,ae,n(u.inviteesCount),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goInvitees},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`level-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,oe,[e(`h4`,se,n(u.$t(`distribution.title.levelInfo`)),1),e(`div`,ce,[e(`div`,le,[e(`p`,null,n(u.$t(`distribution.title.currentLevel`))+`: L`+n(u.distributionStatus?.level?.level),1),e(`p`,null,n(u.$t(`distribution.title.currentPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level]?.percentage)+`% `,1)]),e(`div`,ue,[e(`p`,null,n(u.$t(`distribution.title.nextLevel`))+`: L`+n(u.distributionStatus?.level?.level+1),1),e(`p`,null,n(u.$t(`distribution.title.nextPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level+1]?.percentage)+`% `,1)])]),r(T,{"text-inside":!0,"stroke-width":20,percentage:u.getPercentageForNextLevel(),class:`mb-2`},null,8,[`percentage`]),e(`p`,de,n(u.$t(`distribution.message.deltaPriceForNextLevel`))+`: $`+n(u.getDeltaForNextLevel()),1),r(E),u.distributionLevels?(l(),s(O,{key:0,data:u.distributionLevels,stripe:``},{default:c(()=>[r(D,{label:u.$t(`distribution.field.level`)},{default:c(t=>[e(`span`,fe,`L`+n(t.row?.level),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.threshold`)},{default:c(t=>[e(`span`,pe,`$`+n(t.row?.threshold),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.percentage`)},{default:c(t=>[e(`span`,$,n(t.row?.percentage)+`%`,1)]),_:1},8,[`label`])]),_:1},8,[`data`])):i(``,!0)]))]),_:1})]),_:1}),r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`distribution-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,me,[e(`h4`,he,n(u.$t(`distribution.title.distributionLink`)),1),r(E),e(`div`,ge,[i(``,!0),e(`a`,{href:u.distributionLink,class:`link`},n(u.distributionLink),9,_e),r(k,{content:u.distributionLink},null,8,[`content`])]),e(`div`,ve,[u.distributionLink?(l(),s(A,{key:0,value:u.distributionLink,size:180,margin:2,class:`block mb-2 ml-auto mr-auto`,type:`image/png`,color:u.qrColor},null,8,[`value`,`color`])):i(``,!0),e(`p`,ye,n(u.$t(`distribution.message.distributionQrDescription`)),1)]),e(`p`,be,[t(n(u.$t(`distribution.message.distributionLinkDescription`))+` `,1),e(`span`,xe,[r(S,{effect:`dark`,content:u.$t(`distribution.message.distributionLinkDescription2`),placement:`top`},{default:c(()=>[t(n(u.$t(`distribution.message.technicalDetail`)),1)]),_:1},8,[`content`])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Ce=T(I,[[`render`,Se],[`__scopeId`,`data-v-3657f823`]]);export{Ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-dOdEM0mX.js";import{t as y}from"./tooltip-CaHCcyJq.js";import{t as b}from"./alert-Dd3pcgZr.js";import{t as x}from"./drawer-anvkTtti.js";import{t as S}from"./switch-CzEQE2DH.js";import{n as C}from"./taskDrawerMixin-Bsm_pfmZ.js";import{t as w}from"./clock-CWEF1y39.js";import{t as T}from"./CopyToClipboard-CZA6WQWP.js";import{r as E,t as D}from"./PromptTextarea-Bdpc7bLs.js";import{t as O}from"./info-DhKCbyPk.js";import{t as ee}from"./triangle-alert-vfYvzN9x.js";import{t as k}from"./upload-25kqK9dU.js";import{t as A}from"./wand-sparkles-C2tZqsJR.js";import"./constants-Bq6v7ZuS.js";import{$t as te,Ai as j,Bt as M,E as N,Ht as P,Un as F,Vt as I,Wt as L,ei as R,gi as z,mr as B,ri as V,zt as H}from"./index-D2ugFcRR.js";import{t as U}from"./FilePreview-DrpFw-4j.js";import{t as W}from"./ImagePreview-Cegc7Kc9.js";import{t as G}from"./Consumption-BNM0d3BL.js";import{a as K,n as q,r as J,t as Y}from"./pagination-DdsSvKkV.js";import{t as X}from"./VideoPlayer-B7-ByfsD.js";import{t as Z}from"./ApiCodeButton-BuAXokaf.js";import{t as Q}from"./BotPlaceholder-DrMa4leC.js";var ne=_({name:`LayoutLuma`,components:{MagicIcon:A,ElDrawer:x,ElButton:j},mixins:[C]}),re={class:`main flex flex-row flex-1`},ie={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ae={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function oe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,re,[e(`div`,ie,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ae,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var se=N(ne,[[`render`,oe],[`__scopeId`,`data-v-d13d43a9`]]),ce=_({name:`EnhancementSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),le={class:`relative`},ue={class:`flex justify-between`},de={class:`flex justify-start items-center`},fe={class:`text-sm font-bold`},pe={class:`flex justify-end items-center`};function me(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,le,[e(`div`,ue,[e(`div`,de,[e(`span`,fe,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var he=N(ce,[[`render`,me]]),ge=_({name:`CustomSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),_e={class:`relative`},ve={class:`flex justify-between`},ye={class:`flex justify-start items-center`},be={class:`text-sm font-bold`},xe={class:`flex justify-end items-center`};function Se(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,_e,[e(`div`,ve,[e(`div`,ye,[e(`span`,be,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,xe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ce=N(ge,[[`render`,Se]]),we=_({name:`LoopSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Te={class:`relative`},Ee={class:`flex justify-between`},De={class:`flex justify-start items-center`},Oe={class:`text-sm font-bold`},ke={class:`flex justify-end items-center`};function Ae(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,Oe,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,ke,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var je=N(we,[[`render`,Ae]]),Me=_({name:`EndImage`,components:{UploadIcon:k,ElUpload:v,ElButton:j,ImagePreview:W,InfoIcon:K},mixins:[P,M],data(){return{fileList:[],uploadUrl:V()+`/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?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){z.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){z.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Ne={class:`relative`},Pe={class:`flex justify-between`},Fe={class:`flex justify-start items-center`},Ie={class:`text-sm font-bold`};function Le(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ne,[e(`div`,Pe,[e(`div`,Fe,[e(`span`,Ie,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Re=N(Me,[[`render`,Le],[`__scopeId`,`data-v-e2470a75`]]),ze=_({name:`StartImage`,components:{UploadIcon:k,ElUpload:v,ElButton:j,ImagePreview:W,InfoIcon:K},mixins:[P,M],data(){return{fileList:[],uploadUrl:V()+`/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?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){z.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){z.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Be={class:`relative`},Ve={class:`flex justify-between`},He={class:`flex justify-start items-center`},Ue={class:`text-sm font-bold`};function We(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Be,[e(`div`,Ve,[e(`div`,He,[e(`span`,Ue,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ge=N(ze,[[`render`,We],[`__scopeId`,`data-v-122aced6`]]),Ke=_({name:`UploadVideo`,components:{UploadIcon:k,ElUpload:v,ElButton:j,InfoIcon:K,FilePreview:U},mixins:[M],data(){return{fileList:[],uploadUrl:V()+`/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.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){z.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){z.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(z.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(z.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),qe={class:`relative`},Je={class:`flex justify-between`},Ye={class:`flex justify-start items-center`},Xe={class:`text-sm font-bold`};function Ze(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Qe=N(Ke,[[`render`,Ze],[`__scopeId`,`data-v-8d27905e`]]),$e=_({name:`PromptInput`,components:{PromptTextarea:D},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function et(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var tt=N($e,[[`render`,et]]),nt=_({name:`ExtendFromInput`,components:{VideoPlayer:X},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),rt={class:`relative`},it={class:`flex mb-2`},at={class:`text-sm font-bold`};function ot(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,rt,[e(`div`,it,[e(`span`,at,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var st=_({name:`ConfigPanel`,components:{MagicIcon:A,LoopSelector:je,StartImageInput:Ge,EndImageInput:Re,EnhancementSelector:he,ElButton:j,PromptInput:tt,ExtendFromInput:N(nt,[[`render`,ot]]),CustomSelector:Ce,UploadVideo:Qe,Consumption:G},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return L(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ct={class:`flex flex-col h-full`},lt={class:`flex-1 overflow-y-auto p-5`},ut={class:`flex flex-col items-center justify-center px-5 pb-5`};function dt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,ct,[e(`div`,lt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ut,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var ft=N(st,[[`render`,dt]]),pt=_({name:`TaskPreview`,components:{ChannelIcon:E,InfoIcon:O,MagicIcon:A,TimeIcon:w,WarningIcon:ee,CopyToClipboard:T,ElAlert:b,VideoPlayer:X,ElTooltip:y,ElButton:j,ApiCodeButton:Z},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),mt={class:`preview`},ht={class:`left`},gt={class:`main`},_t={class:`bot`},vt={class:`datetime`},yt={class:`info`},bt={key:0,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0,failed:!0})},wt={key:0,class:`mb-4`},Tt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Dt={key:1,class:n({content:!0})},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Mt={key:2,class:n({content:!0})},Nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`video-player`),v=l(`el-button`),y=l(`el-tooltip`),b=l(`api-code-button`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`time-icon`),w=l(`el-alert`),T=l(`warning-icon`),E=l(`info-icon`),D=l(`channel-icon`);return h(),s(`div`,mt,[e(`div`,ht,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,gt,[e(`div`,_t,[a(g,{capability:`luma`,part:`name`}),e(`span`,vt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,yt,[n.modelValue?.request?.prompt?(h(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,St,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ct,[n.modelValue.response.video_url?(h(),s(`div`,wt,[a(_,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,Tt,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(b,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(w,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Et,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,Dt,[a(w,{closable:!1,class:`failure`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Ot,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,kt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,At,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,jt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Mt,[a(w,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Nt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Ft=_({name:`RecentPanel`,components:{BotPlaceholder:Q,TaskPreview:N(pt,[[`render`,Pt],[`__scopeId`,`data-v-f22952e3`]]),NoTasks:J,ScrollList:q},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),It={key:0},Lt={key:2,class:`w-full h-full flex items-center justify-center`};function Rt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,It,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Lt,[a(v)])):o(``,!0)],64)}var zt=_({name:`LumaIndex`,components:{ConfigPanel:ft,Layout:se,RecentPanel:N(Ft,[[`render`,Rt]])},mixins:[I],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===R.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===R.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.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 Y({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(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!H(this.uploadTracker,e=>this.$t(e),e=>z.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){z.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!te())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}z.info(this.$t(`luma.message.startingTask`)),B(`luma`,F.generate(e,{token:t})).then(()=>{z.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?z.error(this.$t(`luma.message.usedUp`)):z.error(this.$t(`luma.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Bt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var Vt=N(zt,[[`render`,Bt]]);export{Vt as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-BWf23oQa.js";import{t as y}from"./tooltip-Gx4jPHlO.js";import{t as b}from"./alert-B2CVhm_j.js";import{t as x}from"./drawer-BTb568QE.js";import{t as S}from"./switch-CCuW_1N4.js";import{n as C}from"./taskDrawerMixin-7tqZnehJ.js";import{t as w}from"./clock-DBA92Mpf.js";import{t as T}from"./CopyToClipboard-CdZHnA6f.js";import{r as E,t as D}from"./PromptTextarea-D64KucTj.js";import{t as O}from"./info-CIky8Wbu.js";import{t as ee}from"./triangle-alert-DjbquHLH.js";import{t as k}from"./upload-B9ekoGFH.js";import{t as A}from"./wand-sparkles-CiQpHMMP.js";import"./constants-Bq6v7ZuS.js";import{$t as te,Ai as j,Bt as M,E as N,Ht as P,Un as F,Vt as I,Wt as L,ei as R,gi as z,mr as B,ri as V,zt as H}from"./index-BxHiLpHH.js";import{t as U}from"./FilePreview-CBmcA81-.js";import{t as W}from"./ImagePreview-C-RPL05t.js";import{t as G}from"./Consumption-BUcyYr1r.js";import{a as K,n as q,r as J,t as Y}from"./pagination-BYV_3jrR.js";import{t as X}from"./VideoPlayer-Dt-ZkZ7-.js";import{t as Z}from"./ApiCodeButton-BeFKoVdS.js";import{t as Q}from"./BotPlaceholder-DSEljO8x.js";var ne=_({name:`LayoutLuma`,components:{MagicIcon:A,ElDrawer:x,ElButton:j},mixins:[C]}),re={class:`main flex flex-row flex-1`},ie={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ae={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function oe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,re,[e(`div`,ie,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ae,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var se=N(ne,[[`render`,oe],[`__scopeId`,`data-v-d13d43a9`]]),ce=_({name:`EnhancementSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),le={class:`relative`},ue={class:`flex justify-between`},de={class:`flex justify-start items-center`},fe={class:`text-sm font-bold`},pe={class:`flex justify-end items-center`};function me(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,le,[e(`div`,ue,[e(`div`,de,[e(`span`,fe,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var he=N(ce,[[`render`,me]]),ge=_({name:`CustomSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),_e={class:`relative`},ve={class:`flex justify-between`},ye={class:`flex justify-start items-center`},be={class:`text-sm font-bold`},xe={class:`flex justify-end items-center`};function Se(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,_e,[e(`div`,ve,[e(`div`,ye,[e(`span`,be,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,xe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ce=N(ge,[[`render`,Se]]),we=_({name:`LoopSelector`,components:{ElSwitch:S,InfoIcon:K},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Te={class:`relative`},Ee={class:`flex justify-between`},De={class:`flex justify-start items-center`},Oe={class:`text-sm font-bold`},ke={class:`flex justify-end items-center`};function Ae(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,Oe,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,ke,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var je=N(we,[[`render`,Ae]]),Me=_({name:`EndImage`,components:{UploadIcon:k,ElUpload:v,ElButton:j,ImagePreview:W,InfoIcon:K},mixins:[P,M],data(){return{fileList:[],uploadUrl:V()+`/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?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){z.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){z.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Ne={class:`relative`},Pe={class:`flex justify-between`},Fe={class:`flex justify-start items-center`},Ie={class:`text-sm font-bold`};function Le(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ne,[e(`div`,Pe,[e(`div`,Fe,[e(`span`,Ie,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Re=N(Me,[[`render`,Le],[`__scopeId`,`data-v-e2470a75`]]),ze=_({name:`StartImage`,components:{UploadIcon:k,ElUpload:v,ElButton:j,ImagePreview:W,InfoIcon:K},mixins:[P,M],data(){return{fileList:[],uploadUrl:V()+`/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?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){z.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){z.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Be={class:`relative`},Ve={class:`flex justify-between`},He={class:`flex justify-start items-center`},Ue={class:`text-sm font-bold`};function We(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Be,[e(`div`,Ve,[e(`div`,He,[e(`span`,Ue,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ge=N(ze,[[`render`,We],[`__scopeId`,`data-v-122aced6`]]),Ke=_({name:`UploadVideo`,components:{UploadIcon:k,ElUpload:v,ElButton:j,InfoIcon:K,FilePreview:U},mixins:[M],data(){return{fileList:[],uploadUrl:V()+`/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.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){z.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){z.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(z.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(z.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),qe={class:`relative`},Je={class:`flex justify-between`},Ye={class:`flex justify-start items-center`},Xe={class:`text-sm font-bold`};function Ze(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Qe=N(Ke,[[`render`,Ze],[`__scopeId`,`data-v-8d27905e`]]),$e=_({name:`PromptInput`,components:{PromptTextarea:D},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function et(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var tt=N($e,[[`render`,et]]),nt=_({name:`ExtendFromInput`,components:{VideoPlayer:X},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),rt={class:`relative`},it={class:`flex mb-2`},at={class:`text-sm font-bold`};function ot(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,rt,[e(`div`,it,[e(`span`,at,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var st=_({name:`ConfigPanel`,components:{MagicIcon:A,LoopSelector:je,StartImageInput:Ge,EndImageInput:Re,EnhancementSelector:he,ElButton:j,PromptInput:tt,ExtendFromInput:N(nt,[[`render`,ot]]),CustomSelector:Ce,UploadVideo:Qe,Consumption:G},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return L(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ct={class:`flex flex-col h-full`},lt={class:`flex-1 overflow-y-auto p-5`},ut={class:`flex flex-col items-center justify-center px-5 pb-5`};function dt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,ct,[e(`div`,lt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ut,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var ft=N(st,[[`render`,dt]]),pt=_({name:`TaskPreview`,components:{ChannelIcon:E,InfoIcon:O,MagicIcon:A,TimeIcon:w,WarningIcon:ee,CopyToClipboard:T,ElAlert:b,VideoPlayer:X,ElTooltip:y,ElButton:j,ApiCodeButton:Z},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),mt={class:`preview`},ht={class:`left`},gt={class:`main`},_t={class:`bot`},vt={class:`datetime`},yt={class:`info`},bt={key:0,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0,failed:!0})},wt={key:0,class:`mb-4`},Tt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Dt={key:1,class:n({content:!0})},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Mt={key:2,class:n({content:!0})},Nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`video-player`),v=l(`el-button`),y=l(`el-tooltip`),b=l(`api-code-button`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`time-icon`),w=l(`el-alert`),T=l(`warning-icon`),E=l(`info-icon`),D=l(`channel-icon`);return h(),s(`div`,mt,[e(`div`,ht,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,gt,[e(`div`,_t,[a(g,{capability:`luma`,part:`name`}),e(`span`,vt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,yt,[n.modelValue?.request?.prompt?(h(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,xt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,St,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Ct,[n.modelValue.response.video_url?(h(),s(`div`,wt,[a(_,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,Tt,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(y,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(v,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(b,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(w,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Et,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,Dt,[a(w,{closable:!1,class:`failure`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Ot,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,kt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,At,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,jt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Mt,[a(w,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Nt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Ft=_({name:`RecentPanel`,components:{BotPlaceholder:Q,TaskPreview:N(pt,[[`render`,Pt],[`__scopeId`,`data-v-f22952e3`]]),NoTasks:J,ScrollList:q},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),It={key:0},Lt={key:2,class:`w-full h-full flex items-center justify-center`};function Rt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,It,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Lt,[a(v)])):o(``,!0)],64)}var zt=_({name:`LumaIndex`,components:{ConfigPanel:ft,Layout:se,RecentPanel:N(Ft,[[`render`,Rt]])},mixins:[I],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===R.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===R.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.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 Y({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(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!H(this.uploadTracker,e=>this.$t(e),e=>z.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){z.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!te())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}z.info(this.$t(`luma.message.startingTask`)),B(`luma`,F.generate(e,{token:t})).then(()=>{z.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?z.error(this.$t(`luma.message.usedUp`)):z.error(this.$t(`luma.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Bt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var Vt=N(zt,[[`render`,Bt]]);export{Vt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-3fwfmhvM.js";import{t as h}from"./check-Cc02Y3ax.js";import{t as g}from"./external-link-DpG3vEdE.js";import{t as ee}from"./globe-DkpQWUKq.js";import{t as te}from"./wand-sparkles-C2tZqsJR.js";import{A as _,Ai as v,E as y,i as b,r as x,rn as S}from"./index-D2ugFcRR.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:v,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||S()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:x[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-CHPX_N2y.js";import{t as h}from"./check-aLE5ztPJ.js";import{t as g}from"./external-link-b0HsOZxw.js";import{t as ee}from"./globe-Bmloh9mt.js";import{t as te}from"./wand-sparkles-CiQpHMMP.js";import{A as _,Ai as v,E as y,i as b,r as x,rn as S}from"./index-BxHiLpHH.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:v,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||S()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:x[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-BLM0v92m.js";import{t as x}from"./upload-dOdEM0mX.js";import{t as S}from"./tooltip-CaHCcyJq.js";import{t as C}from"./alert-Dd3pcgZr.js";import{t as w}from"./drawer-anvkTtti.js";import{t as T}from"./input-number-DFySdlyu.js";import{t as E}from"./switch-CzEQE2DH.js";import{n as D}from"./taskDrawerMixin-Bsm_pfmZ.js";import{t as O}from"./box-BNgmySYi.js";import{t as k}from"./clock-CWEF1y39.js";import{t as A}from"./CopyToClipboard-CZA6WQWP.js";import{n as j,r as M,t as N}from"./PromptTextarea-Bdpc7bLs.js";import{t as P}from"./info-DhKCbyPk.js";import{t as F}from"./triangle-alert-vfYvzN9x.js";import{t as I}from"./upload-25kqK9dU.js";import{t as L}from"./volume-2-C05cqKlS.js";import{t as R}from"./wand-sparkles-C2tZqsJR.js";import{$t as ee,Gt as te,Kt as ne,Qt as re,Xt as ie,Yt as ae,Zt as oe,an as se,cn as z,en as ce,fn as B,in as le,ln as V,nn as ue,on as de,rn as fe,sn as pe,tn as me,un as H}from"./constants-Bq6v7ZuS.js";import{$t as he,Ai as U,Bt as W,E as G,Ht as K,Sn as ge,Vt as _e,Wt as ve,ei as q,gi as J,mr as ye,ri as Y,zt as be}from"./index-D2ugFcRR.js";import{t as X}from"./ImagePreview-Cegc7Kc9.js";import{t as xe}from"./Consumption-BNM0d3BL.js";import{a as Z,n as Se,r as Ce,t as we}from"./pagination-DdsSvKkV.js";import{t as Te}from"./VideoPlayer-B7-ByfsD.js";import{t as Ee}from"./ApiCodeButton-BuAXokaf.js";import{t as De}from"./BotPlaceholder-DrMa4leC.js";import{t as Oe}from"./ImageWrapper-hjcr_HZW.js";import{n as ke,t as Ae}from"./AudioPreview-UZ5qR4-4.js";var je=v({name:`LayoutSeedance`,components:{MagicIcon:R,ElDrawer:w,ElButton:U},mixins:[D]}),Me={class:`main flex flex-row flex-1`},Ne={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Pe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Fe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Me,[e(`div`,Ne,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Pe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ie=G(je,[[`render`,Fe],[`__scopeId`,`data-v-ff53dce1`]]),Le=v({name:`SeedancePromptInput`,components:{PromptTextarea:N},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||=``}});function Re(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ze=G(Le,[[`render`,Re]]),Be=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ce,label:this.$t(`seedance.model.seedance20`)},{value:me,label:this.$t(`seedance.model.seedance20Fast`)},{value:ue,label:this.$t(`seedance.model.seedance20Mini`)},{value:ee,label:this.$t(`seedance.model.seedance15pro`)},{value:oe,label:this.$t(`seedance.model.seedance10pro`)},{value:re,label:this.$t(`seedance.model.seedance10proFast`)},{value:ie,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:ae,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||=te}}),Ve={class:`field`},He={class:`label`},Ue={class:`box`},We={class:`title font-bold`};function Ge(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ve,[e(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ke=G(Be,[[`render`,Ge],[`__scopeId`,`data-v-deb4c429`]]),qe=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),Je={class:`field`},Ye={class:`label`},Xe={class:`box`},Ze={class:`title font-bold`};function Qe(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Je,[e(`div`,Ye,[e(`div`,Xe,[e(`h2`,Ze,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var $e=G(qe,[[`render`,Qe],[`__scopeId`,`data-v-d61cc21b`]]),Q={[V]:0,[H]:1,[z]:2,"4k":3},et=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Z,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[{value:V,label:`480p`},{value:H,label:`720p`},{value:z,label:`1080p`},{value:`4k`,label:`4k`}],t=Q[this.capability.maxResolution]??Q[`1080p`];return e.map(e=>({...e,disabled:Q[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),tt={class:`resolution`},nt={class:`header`},rt={class:`title font-bold`},it={class:`items`},at=[`onClick`];function ot(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,tt,[e(`div`,nt,[e(`h2`,rt,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,it,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,at)]),_:2},1032,[`content`,`disabled`]))),128))])])}var st=G(et,[[`render`,ot],[`__scopeId`,`data-v-db7e8aff`]]),ct=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Z},computed:{options(){return[{value:le,label:`16:9`,w:32,h:18},{value:de,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:se,label:`21:9`,w:34,h:14},{value:pe,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=ne}}),lt={class:`ratio`},ut={class:`header`},dt={class:`title font-bold`},ft={class:`items`},pt=[`onClick`],mt={class:`preview`},ht={key:1,class:`rect rect-auto`},gt={class:`name`};function _t(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ft,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,mt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,ht,`A`))]),e(`div`,gt,i(r.label),1)],10,pt))),128))])])}var vt=G(ct,[[`render`,_t],[`__scopeId`,`data-v-8ddec2dd`]]),yt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:E,InfoIcon:Z},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return B(e).acceptsAudio},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=!1)}}),bt={key:0,class:`field`},xt={class:`label`},St={class:`box`},Ct={class:`title font-bold`},wt={class:`value`};function Tt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,bt,[e(`div`,xt,[e(`div`,St,[e(`h2`,Ct,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,wt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Et=G(yt,[[`render`,Tt],[`__scopeId`,`data-v-df51dfbd`]]),Dt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:E,InfoIcon:Z},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),Ot={class:`field`},kt={class:`label`},At={class:`box`},jt={class:`title font-bold`},Mt={class:`value`};function Nt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ot,[e(`div`,kt,[e(`div`,At,[e(`h2`,jt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Mt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var Pt=G(Dt,[[`render`,Nt],[`__scopeId`,`data-v-ae777d61`]]),Ft=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:I,ElUpload:x,ElButton:U,InfoIcon:Z,ImagePreview:X},mixins:[K,W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),It={key:0,class:`relative`},Lt={class:`flex min-h-8 items-center pr-20`},Rt={class:`flex justify-start items-center`},zt={class:`text-sm font-bold`},Bt={key:0,class:`required-badge`};function Vt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,It,[e(`div`,Lt,[e(`div`,Rt,[e(`span`,zt,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Bt,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ht=G(Ft,[[`render`,Vt],[`__scopeId`,`data-v-580c8fd6`]]),Ut=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:I,ElUpload:x,ElButton:U,ImagePreview:X,InfoIcon:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Wt={key:0,class:`relative`},Gt={class:`flex min-h-8 items-center pr-20`},Kt={class:`flex justify-start items-center`},qt={class:`text-sm font-bold`};function Jt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Wt,[e(`div`,Gt,[e(`div`,Kt,[e(`span`,qt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Yt=G(Ut,[[`render`,Jt],[`__scopeId`,`data-v-cfc723b2`]]),Xt=v({name:`SeedanceReferenceImage`,components:{UploadIcon:I,ElUpload:x,ElButton:U,InfoIcon:Z,ImagePreview:X},mixins:[K,W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),Zt={key:0,class:`relative`},Qt={class:`flex min-h-8 items-center pr-20`},$t={class:`flex justify-start items-center`},en={class:`text-sm font-bold`};function tn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,Zt,[e(`div`,Qt,[e(`div`,$t,[e(`span`,en,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var nn=G(Xt,[[`render`,tn],[`__scopeId`,`data-v-37c817a4`]]),rn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:I,ElUpload:x,ElButton:U,InfoIcon:Z},mixins:[W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),an={key:0,class:`relative`},on={class:`flex min-h-8 items-center pr-20`},sn={class:`flex justify-start items-center`},cn={class:`text-sm font-bold`};function ln(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,an,[e(`div`,on,[e(`div`,sn,[e(`span`,cn,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var un=G(rn,[[`render`,ln],[`__scopeId`,`data-v-e8a1ca2b`]]),dn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:I,ElUpload:x,ElButton:U,InfoIcon:Z},mixins:[W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),fn={key:0,class:`relative`},pn={class:`flex min-h-8 items-center pr-20`},mn={class:`flex justify-start items-center`},hn={class:`text-sm font-bold`};function gn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,fn,[e(`div`,pn,[e(`div`,mn,[e(`span`,hn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var _n=G(dn,[[`render`,gn],[`__scopeId`,`data-v-123c4f63`]]),vn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:E,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return B(this.model).acceptsReturnLastFrame},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})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),yn={key:0,class:`field`},bn={class:`label`},xn={class:`box`},Sn={class:`title font-bold`},Cn={class:`value`};function wn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,yn,[e(`div`,bn,[e(`div`,xn,[e(`h2`,Sn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Cn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Tn=G(vn,[[`render`,wn],[`__scopeId`,`data-v-edea5451`]]),En=v({name:`SeedanceSeedInput`,components:{ElInputNumber:T,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),Dn={class:`field`},On={class:`label`},kn={class:`box`},An={class:`title font-bold`},jn={class:`value`};function Mn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,Dn,[e(`div`,On,[e(`div`,kn,[e(`h2`,An,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,jn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Nn=v({name:`SeedanceConfigPanel`,components:{MagicIcon:R,ElButton:U,PromptInput:ze,ModelSelector:Ke,DurationSelector:$e,ResolutionSelector:st,RatioSelector:vt,GenerateAudioSwitch:Et,CameraFixedSwitch:Pt,ReturnLastFrameSwitch:Tn,SeedInput:G(En,[[`render`,Mn],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:Ht,LastFrameImage:Yt,ReferenceImage:nn,ReferenceAudio:un,ReferenceVideo:_n,Consumption:xe},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ve(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Pn={class:`flex flex-col h-full`},Fn={class:`flex-1 overflow-y-auto p-5`},In={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ln(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`generate-audio-switch`),b=l(`camera-fixed-switch`),x=l(`return-last-frame-switch`),S=l(`seed-input`),C=l(`first-frame-image`),w=l(`last-frame-image`),T=l(`reference-image`),E=l(`reference-audio`),D=l(`reference-video`),O=l(`consumption`),k=l(`magic-icon`),A=l(`el-button`);return g(),s(`div`,Pn,[e(`div`,Fn,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(D,{class:`mb-4`})]),e(`div`,In,[a(O,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Rn=G(Nn,[[`render`,Ln]]),zn=v({name:`SeedanceTaskPreview`,components:{ApplicationIcon:O,ChannelIcon:M,FullscreenIcon:j,InfoIcon:P,MagicIcon:R,TimeIcon:k,VolumeIcon:L,WarningIcon:F,CopyToClipboard:A,ElAlert:C,VideoPlayer:Te,ElTooltip:S,ElButton:U,ImageWrapper:Oe,ImagePreview:X,AudioPreview:Ae,VideoPreview:ke,ApiCodeButton:Ee},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Bn={class:`preview`},Vn={class:`left`},Hn={class:`main`},Un={class:`bot`},Wn={class:`datetime`},Gn={class:`info`},Kn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},qn={key:1,class:`prompt mt-2`},Jn={key:0},Yn={key:1},Xn={key:0,class:n({content:!0})},Zn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Qn={key:1,class:n({content:!0})},$n={key:0,class:`mb-4`},er={key:1,class:`mb-4`},tr={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},nr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ir={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ar={key:0},or={key:1},sr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},lr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ur={key:2,class:n({content:!0})},dr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},hr={key:3,class:n({content:!0})},gr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_r={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function vr(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`image-preview`),x=l(`audio-preview`),S=l(`video-preview`),C=l(`time-icon`),w=l(`magic-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`),D=l(`video-player`),O=l(`image-wrapper`),k=l(`el-button`),A=l(`el-tooltip`),j=l(`api-code-button`),M=l(`application-icon`),N=l(`fullscreen-icon`),P=l(`volume-icon`),F=l(`channel-icon`),I=l(`warning-icon`),L=l(`info-icon`);return g(),s(`div`,Bn,[e(`div`,Vn,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Hn,[e(`div`,Un,[a(y,{capability:`seedance`,part:`name`}),e(`span`,Wn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Gn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Kn,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(b,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(S,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,qn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Yn,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Jn,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Qn,[n.video?.video_url?(g(),s(`div`,$n,[a(D,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,er,[a(O,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,tr,[a(A,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(k,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(j,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,nr,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,rr,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,ir,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,ar,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,or,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,sr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,$,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,cr,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,lr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,ur,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,dr,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,fr,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,pr,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,mr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,hr,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,gr,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,_r,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Xn,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,Zn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var yr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:G(zn,[[`render`,vr],[`__scopeId`,`data-v-af17440b`]]),BotPlaceholder:De,NoTasks:Ce,ScrollList:Se},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?.()}}}),br={key:0},xr={key:2,class:`w-full h-full flex items-center justify-center`};function Sr(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,br,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,xr,[a(v)])):o(``,!0)],64)}var Cr=v({name:`SeedanceIndex`,components:{ConfigPanel:Rn,Layout:Ie,RecentPanel:G(yr,[[`render`,Sr]])},mixins:[_e],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===q.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 we({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();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!be(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let 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(e=>!!e?.url);let t=e.images.some(e=>e?.role===`first_frame`),n=e.images.some(e=>e?.role===`last_frame`);!t&&n&&(e.images=e.images.map(e=>e?.role===`last_frame`?{...e,role:`first_frame`}:e))}let t=Array.isArray(e?.images)&&e.images.length>0;if(!t&&`images`in e&&delete e.images,`service_tier`in e&&delete e.service_tier,e?.model&&!fe[e.model]){J.warning(this.$t(`seedance.message.modelUnsupported`));return}let n=B(e?.model);if(n.requiresImage&&!t){J.warning(this.$t(`seedance.message.modelRequiresImage`));return}if(!n.acceptsImage&&t){J.warning(this.$t(`seedance.message.modelRejectsImage`));return}if(!n.acceptsText&&!t){J.warning(this.$t(`seedance.message.modelRequiresImage`));return}!n.acceptsAudio&&e.generate_audio&&(e.generate_audio=!1),!n.acceptsReturnLastFrame&&e.return_last_frame&&(e.return_last_frame=!1),!n.acceptsLastFrame&&t&&(e.images=e.images.filter(e=>e?.role!==`last_frame`)),n.acceptsReferenceAudio&&Array.isArray(e?.audios)&&(e.audios=e.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(e?.audios)||e.audios.length===0)&&delete e.audios,n.acceptsReferenceVideo&&Array.isArray(e?.videos)&&(e.videos=e.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(e?.videos)||e.videos.length===0)&&delete e.videos,!n.acceptsReferenceImage&&Array.isArray(e?.images)&&(e.images=e.images.filter(e=>e?.role!==`reference_image`),e.images.length===0&&delete e.images);let r=Array.isArray(e?.images)&&e.images.some(e=>e?.role===`reference_image`);if(Array.isArray(e?.audios)&&e.audios.length>0&&!r){J.warning(this.$t(`seedance.message.audioRequiresReferenceImage`));return}let i={...e,async:!0};if(!he())return;let a=this.credential?.token;if(!a){console.error(`no token specified`);return}J.info(this.$t(`seedance.message.startingTask`)),ye(`seedance`,ge.generate(i,{token:a})).then(()=>{J.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`seedance.message.usedUp`)):J.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function wr(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Tr=G(Cr,[[`render`,wr]]);export{Tr as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-DUVlT9hf.js";import{t as x}from"./upload-BWf23oQa.js";import{t as S}from"./tooltip-Gx4jPHlO.js";import{t as C}from"./alert-B2CVhm_j.js";import{t as w}from"./drawer-BTb568QE.js";import{t as T}from"./input-number-BR2Mu5ij.js";import{t as E}from"./switch-CCuW_1N4.js";import{n as D}from"./taskDrawerMixin-7tqZnehJ.js";import{t as O}from"./box-3oU0nJj7.js";import{t as k}from"./clock-DBA92Mpf.js";import{t as A}from"./CopyToClipboard-CdZHnA6f.js";import{n as j,r as M,t as N}from"./PromptTextarea-D64KucTj.js";import{t as P}from"./info-CIky8Wbu.js";import{t as F}from"./triangle-alert-DjbquHLH.js";import{t as I}from"./upload-B9ekoGFH.js";import{t as L}from"./volume-2-BJIylI2W.js";import{t as R}from"./wand-sparkles-CiQpHMMP.js";import{$t as ee,Gt as te,Kt as ne,Qt as re,Xt as ie,Yt as ae,Zt as oe,an as se,cn as z,en as ce,fn as B,in as le,ln as V,nn as ue,on as de,rn as fe,sn as pe,tn as me,un as H}from"./constants-Bq6v7ZuS.js";import{$t as he,Ai as U,Bt as W,E as G,Ht as K,Sn as ge,Vt as _e,Wt as ve,ei as q,gi as J,mr as ye,ri as Y,zt as be}from"./index-BxHiLpHH.js";import{t as X}from"./ImagePreview-C-RPL05t.js";import{t as xe}from"./Consumption-BUcyYr1r.js";import{a as Z,n as Se,r as Ce,t as we}from"./pagination-BYV_3jrR.js";import{t as Te}from"./VideoPlayer-Dt-ZkZ7-.js";import{t as Ee}from"./ApiCodeButton-BeFKoVdS.js";import{t as De}from"./BotPlaceholder-DSEljO8x.js";import{t as Oe}from"./ImageWrapper-BBNTd2c0.js";import{n as ke,t as Ae}from"./AudioPreview-Cnfin0he.js";var je=v({name:`LayoutSeedance`,components:{MagicIcon:R,ElDrawer:w,ElButton:U},mixins:[D]}),Me={class:`main flex flex-row flex-1`},Ne={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Pe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Fe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Me,[e(`div`,Ne,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Pe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ie=G(je,[[`render`,Fe],[`__scopeId`,`data-v-ff53dce1`]]),Le=v({name:`SeedancePromptInput`,components:{PromptTextarea:N},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||=``}});function Re(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ze=G(Le,[[`render`,Re]]),Be=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:ce,label:this.$t(`seedance.model.seedance20`)},{value:me,label:this.$t(`seedance.model.seedance20Fast`)},{value:ue,label:this.$t(`seedance.model.seedance20Mini`)},{value:ee,label:this.$t(`seedance.model.seedance15pro`)},{value:oe,label:this.$t(`seedance.model.seedance10pro`)},{value:re,label:this.$t(`seedance.model.seedance10proFast`)},{value:ie,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:ae,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||=te}}),Ve={class:`field`},He={class:`label`},Ue={class:`box`},We={class:`title font-bold`};function Ge(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ve,[e(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ke=G(Be,[[`render`,Ge],[`__scopeId`,`data-v-deb4c429`]]),qe=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),Je={class:`field`},Ye={class:`label`},Xe={class:`box`},Ze={class:`title font-bold`};function Qe(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Je,[e(`div`,Ye,[e(`div`,Xe,[e(`h2`,Ze,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var $e=G(qe,[[`render`,Qe],[`__scopeId`,`data-v-d61cc21b`]]),Q={[V]:0,[H]:1,[z]:2,"4k":3},et=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Z,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[{value:V,label:`480p`},{value:H,label:`720p`},{value:z,label:`1080p`},{value:`4k`,label:`4k`}],t=Q[this.capability.maxResolution]??Q[`1080p`];return e.map(e=>({...e,disabled:Q[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),tt={class:`resolution`},nt={class:`header`},rt={class:`title font-bold`},it={class:`items`},at=[`onClick`];function ot(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,tt,[e(`div`,nt,[e(`h2`,rt,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,it,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,at)]),_:2},1032,[`content`,`disabled`]))),128))])])}var st=G(et,[[`render`,ot],[`__scopeId`,`data-v-db7e8aff`]]),ct=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Z},computed:{options(){return[{value:le,label:`16:9`,w:32,h:18},{value:de,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:se,label:`21:9`,w:34,h:14},{value:pe,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=ne}}),lt={class:`ratio`},ut={class:`header`},dt={class:`title font-bold`},ft={class:`items`},pt=[`onClick`],mt={class:`preview`},ht={key:1,class:`rect rect-auto`},gt={class:`name`};function _t(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ft,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,mt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,ht,`A`))]),e(`div`,gt,i(r.label),1)],10,pt))),128))])])}var vt=G(ct,[[`render`,_t],[`__scopeId`,`data-v-8ddec2dd`]]),yt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:E,InfoIcon:Z},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return B(e).acceptsAudio},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=!1)}}),bt={key:0,class:`field`},xt={class:`label`},St={class:`box`},Ct={class:`title font-bold`},wt={class:`value`};function Tt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,bt,[e(`div`,xt,[e(`div`,St,[e(`h2`,Ct,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,wt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Et=G(yt,[[`render`,Tt],[`__scopeId`,`data-v-df51dfbd`]]),Dt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:E,InfoIcon:Z},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),Ot={class:`field`},kt={class:`label`},At={class:`box`},jt={class:`title font-bold`},Mt={class:`value`};function Nt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ot,[e(`div`,kt,[e(`div`,At,[e(`h2`,jt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Mt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var Pt=G(Dt,[[`render`,Nt],[`__scopeId`,`data-v-ae777d61`]]),Ft=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:I,ElUpload:x,ElButton:U,InfoIcon:Z,ImagePreview:X},mixins:[K,W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),It={key:0,class:`relative`},Lt={class:`flex min-h-8 items-center pr-20`},Rt={class:`flex justify-start items-center`},zt={class:`text-sm font-bold`},Bt={key:0,class:`required-badge`};function Vt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,It,[e(`div`,Lt,[e(`div`,Rt,[e(`span`,zt,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Bt,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ht=G(Ft,[[`render`,Vt],[`__scopeId`,`data-v-580c8fd6`]]),Ut=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:I,ElUpload:x,ElButton:U,ImagePreview:X,InfoIcon:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Wt={key:0,class:`relative`},Gt={class:`flex min-h-8 items-center pr-20`},Kt={class:`flex justify-start items-center`},qt={class:`text-sm font-bold`};function Jt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Wt,[e(`div`,Gt,[e(`div`,Kt,[e(`span`,qt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Yt=G(Ut,[[`render`,Jt],[`__scopeId`,`data-v-cfc723b2`]]),Xt=v({name:`SeedanceReferenceImage`,components:{UploadIcon:I,ElUpload:x,ElButton:U,InfoIcon:Z,ImagePreview:X},mixins:[K,W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),Zt={key:0,class:`relative`},Qt={class:`flex min-h-8 items-center pr-20`},$t={class:`flex justify-start items-center`},en={class:`text-sm font-bold`};function tn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,Zt,[e(`div`,Qt,[e(`div`,$t,[e(`span`,en,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var nn=G(Xt,[[`render`,tn],[`__scopeId`,`data-v-37c817a4`]]),rn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:I,ElUpload:x,ElButton:U,InfoIcon:Z},mixins:[W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),an={key:0,class:`relative`},on={class:`flex min-h-8 items-center pr-20`},sn={class:`flex justify-start items-center`},cn={class:`text-sm font-bold`};function ln(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,an,[e(`div`,on,[e(`div`,sn,[e(`span`,cn,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var un=G(rn,[[`render`,ln],[`__scopeId`,`data-v-e8a1ca2b`]]),dn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:I,ElUpload:x,ElButton:U,InfoIcon:Z},mixins:[W],data(){return{fileList:[],uploadUrl:Y()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),fn={key:0,class:`relative`},pn={class:`flex min-h-8 items-center pr-20`},mn={class:`flex justify-start items-center`},hn={class:`text-sm font-bold`};function gn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,fn,[e(`div`,pn,[e(`div`,mn,[e(`span`,hn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var _n=G(dn,[[`render`,gn],[`__scopeId`,`data-v-123c4f63`]]),vn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:E,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return B(this.model).acceptsReturnLastFrame},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})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),yn={key:0,class:`field`},bn={class:`label`},xn={class:`box`},Sn={class:`title font-bold`},Cn={class:`value`};function wn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,yn,[e(`div`,bn,[e(`div`,xn,[e(`h2`,Sn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Cn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Tn=G(vn,[[`render`,wn],[`__scopeId`,`data-v-edea5451`]]),En=v({name:`SeedanceSeedInput`,components:{ElInputNumber:T,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),Dn={class:`field`},On={class:`label`},kn={class:`box`},An={class:`title font-bold`},jn={class:`value`};function Mn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,Dn,[e(`div`,On,[e(`div`,kn,[e(`h2`,An,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,jn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Nn=v({name:`SeedanceConfigPanel`,components:{MagicIcon:R,ElButton:U,PromptInput:ze,ModelSelector:Ke,DurationSelector:$e,ResolutionSelector:st,RatioSelector:vt,GenerateAudioSwitch:Et,CameraFixedSwitch:Pt,ReturnLastFrameSwitch:Tn,SeedInput:G(En,[[`render`,Mn],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:Ht,LastFrameImage:Yt,ReferenceImage:nn,ReferenceAudio:un,ReferenceVideo:_n,Consumption:xe},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ve(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Pn={class:`flex flex-col h-full`},Fn={class:`flex-1 overflow-y-auto p-5`},In={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ln(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`generate-audio-switch`),b=l(`camera-fixed-switch`),x=l(`return-last-frame-switch`),S=l(`seed-input`),C=l(`first-frame-image`),w=l(`last-frame-image`),T=l(`reference-image`),E=l(`reference-audio`),D=l(`reference-video`),O=l(`consumption`),k=l(`magic-icon`),A=l(`el-button`);return g(),s(`div`,Pn,[e(`div`,Fn,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(D,{class:`mb-4`})]),e(`div`,In,[a(O,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Rn=G(Nn,[[`render`,Ln]]),zn=v({name:`SeedanceTaskPreview`,components:{ApplicationIcon:O,ChannelIcon:M,FullscreenIcon:j,InfoIcon:P,MagicIcon:R,TimeIcon:k,VolumeIcon:L,WarningIcon:F,CopyToClipboard:A,ElAlert:C,VideoPlayer:Te,ElTooltip:S,ElButton:U,ImageWrapper:Oe,ImagePreview:X,AudioPreview:Ae,VideoPreview:ke,ApiCodeButton:Ee},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Bn={class:`preview`},Vn={class:`left`},Hn={class:`main`},Un={class:`bot`},Wn={class:`datetime`},Gn={class:`info`},Kn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},qn={key:1,class:`prompt mt-2`},Jn={key:0},Yn={key:1},Xn={key:0,class:n({content:!0})},Zn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Qn={key:1,class:n({content:!0})},$n={key:0,class:`mb-4`},er={key:1,class:`mb-4`},tr={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},nr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ir={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ar={key:0},or={key:1},sr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},lr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ur={key:2,class:n({content:!0})},dr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},hr={key:3,class:n({content:!0})},gr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_r={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function vr(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`image-preview`),x=l(`audio-preview`),S=l(`video-preview`),C=l(`time-icon`),w=l(`magic-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`),D=l(`video-player`),O=l(`image-wrapper`),k=l(`el-button`),A=l(`el-tooltip`),j=l(`api-code-button`),M=l(`application-icon`),N=l(`fullscreen-icon`),P=l(`volume-icon`),F=l(`channel-icon`),I=l(`warning-icon`),L=l(`info-icon`);return g(),s(`div`,Bn,[e(`div`,Vn,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Hn,[e(`div`,Un,[a(y,{capability:`seedance`,part:`name`}),e(`span`,Wn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Gn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Kn,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(b,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(S,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,qn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Yn,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Jn,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Qn,[n.video?.video_url?(g(),s(`div`,$n,[a(D,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,er,[a(O,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,tr,[a(A,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(k,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(j,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,nr,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,rr,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,ir,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,ar,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,or,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,sr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,$,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,cr,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,lr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,ur,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,dr,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,fr,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,pr,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,mr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,hr,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,gr,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,_r,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Xn,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,Zn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var yr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:G(zn,[[`render`,vr],[`__scopeId`,`data-v-af17440b`]]),BotPlaceholder:De,NoTasks:Ce,ScrollList:Se},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?.()}}}),br={key:0},xr={key:2,class:`w-full h-full flex items-center justify-center`};function Sr(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,br,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,xr,[a(v)])):o(``,!0)],64)}var Cr=v({name:`SeedanceIndex`,components:{ConfigPanel:Rn,Layout:Ie,RecentPanel:G(yr,[[`render`,Sr]])},mixins:[_e],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===q.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 we({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();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!be(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let 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(e=>!!e?.url);let t=e.images.some(e=>e?.role===`first_frame`),n=e.images.some(e=>e?.role===`last_frame`);!t&&n&&(e.images=e.images.map(e=>e?.role===`last_frame`?{...e,role:`first_frame`}:e))}let t=Array.isArray(e?.images)&&e.images.length>0;if(!t&&`images`in e&&delete e.images,`service_tier`in e&&delete e.service_tier,e?.model&&!fe[e.model]){J.warning(this.$t(`seedance.message.modelUnsupported`));return}let n=B(e?.model);if(n.requiresImage&&!t){J.warning(this.$t(`seedance.message.modelRequiresImage`));return}if(!n.acceptsImage&&t){J.warning(this.$t(`seedance.message.modelRejectsImage`));return}if(!n.acceptsText&&!t){J.warning(this.$t(`seedance.message.modelRequiresImage`));return}!n.acceptsAudio&&e.generate_audio&&(e.generate_audio=!1),!n.acceptsReturnLastFrame&&e.return_last_frame&&(e.return_last_frame=!1),!n.acceptsLastFrame&&t&&(e.images=e.images.filter(e=>e?.role!==`last_frame`)),n.acceptsReferenceAudio&&Array.isArray(e?.audios)&&(e.audios=e.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(e?.audios)||e.audios.length===0)&&delete e.audios,n.acceptsReferenceVideo&&Array.isArray(e?.videos)&&(e.videos=e.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(e?.videos)||e.videos.length===0)&&delete e.videos,!n.acceptsReferenceImage&&Array.isArray(e?.images)&&(e.images=e.images.filter(e=>e?.role!==`reference_image`),e.images.length===0&&delete e.images);let r=Array.isArray(e?.images)&&e.images.some(e=>e?.role===`reference_image`);if(Array.isArray(e?.audios)&&e.audios.length>0&&!r){J.warning(this.$t(`seedance.message.audioRequiresReferenceImage`));return}let i={...e,async:!0};if(!he())return;let a=this.credential?.token;if(!a){console.error(`no token specified`);return}J.info(this.$t(`seedance.message.startingTask`)),ye(`seedance`,ge.generate(i,{token:a})).then(()=>{J.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`seedance.message.usedUp`)):J.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function wr(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Tr=G(Cr,[[`render`,wr]]);export{Tr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as e,tt as t,z as n}from"./vendor-chart-Dw-P17PN.js";import{E as r}from"./index-
|
|
1
|
+
import{N as e,tt as t,z as n}from"./vendor-chart-Dw-P17PN.js";import{E as r}from"./index-BxHiLpHH.js";var i=n({name:`SettingsIndex`,mounted(){let e=this.$route.query.tab||``;window.dispatchEvent(new CustomEvent(`open-user-settings`,{detail:{tab:e}}))}}),a={class:`settings-page`};function o(n,r,i,o,s,c){return t(),e(`div`,a)}var s=r(i,[[`render`,o]]);export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-BLM0v92m.js";import{t as x}from"./upload-dOdEM0mX.js";import{t as S}from"./tooltip-CaHCcyJq.js";import{t as C}from"./alert-Dd3pcgZr.js";import{t as w}from"./drawer-anvkTtti.js";import{n as T}from"./taskDrawerMixin-Bsm_pfmZ.js";import{t as E}from"./box-BNgmySYi.js";import{t as D}from"./clock-CWEF1y39.js";import{t as O}from"./CopyToClipboard-CZA6WQWP.js";import{n as k,r as A,t as j}from"./PromptTextarea-Bdpc7bLs.js";import{t as M}from"./info-DhKCbyPk.js";import{t as N}from"./triangle-alert-vfYvzN9x.js";import{t as P}from"./upload-25kqK9dU.js";import{t as F}from"./wand-sparkles-C2tZqsJR.js";import{At as I,Bt as L,Ft as ee,Ht as te,It as ne,Lt as re,Mt as ie,Pt as ae,Rt as oe,Ut as R,jt as z,kt as B,zt as V}from"./constants-Bq6v7ZuS.js";import{$t as H,Ai as U,Bt as W,E as G,Ht as K,Vt as q,Wt as se,ei as J,gi as Y,mr as ce,ri as X,xn as le,zt as ue}from"./index-D2ugFcRR.js";import{t as Z}from"./ImagePreview-Cegc7Kc9.js";import{t as de}from"./Consumption-BNM0d3BL.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-DdsSvKkV.js";import{t as he}from"./VideoPlayer-B7-ByfsD.js";import{t as ge}from"./ApiCodeButton-BuAXokaf.js";import{t as _e}from"./BotPlaceholder-DrMa4leC.js";var ve=v({name:`LayoutGrokVideo`,components:{MagicIcon:F,ElDrawer:w,ElButton:U},mixins:[T]}),ye={class:`main flex flex-row flex-1`},be={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ce=G(ve,[[`render`,Se],[`__scopeId`,`data-v-cdd6b8f3`]]),we=v({name:`GrokVideoPromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.grokvideo?.config?.prompt},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`grokvideo.name.prompt`),info:e.$t(`grokvideo.description.prompt`),placeholder:e.$t(`grokvideo.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=G(we,[[`render`,Te]]),De=v({name:`GrokVideoModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:ee,label:this.$t(`grokvideo.model.default`)},{value:ae,label:this.$t(`grokvideo.model.preview15`)}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.model},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,model:e})}}},mounted(){this.value||=B}}),Oe={class:`field`},ke={class:`label`},Ae={class:`box`},je={class:`title font-bold`};function Me(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`div`,Ae,[e(`h2`,je,i(t.$t(`grokvideo.name.model`)),1),a(m,{content:t.$t(`grokvideo.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`grokvideo.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ne=G(De,[[`render`,Me],[`__scopeId`,`data-v-291d93fb`]]),Pe=v({name:`GrokVideoDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.grokvideo?.config?.model},maxDuration(){return te(this.model)},options(){return ie.filter(e=>e<=this.maxDuration).map(e=>({value:e,label:`${e}s`}))},value:{get(){return this.$store.state.grokvideo?.config?.duration},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,duration:e})}}},watch:{maxDuration(e){this.value&&this.value>e&&(this.value=e)}},mounted(){this.value||=6}}),Fe={class:`field`},Ie={class:`label`},Le={class:`box`},Re={class:`title font-bold`};function ze(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`grokvideo.name.duration`)),1),a(m,{content:t.$t(`grokvideo.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`grokvideo.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Be=G(Pe,[[`render`,ze],[`__scopeId`,`data-v-9c711686`]]),Ve=v({name:`GrokVideoResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:V,label:`480p`},{value:L,label:`720p`},{value:oe,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.resolution},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,resolution:e})}}},mounted(){this.value||=z}}),He={class:`resolution`},Ue={class:`header`},We={class:`title font-bold`},Ge={class:`items`},Ke=[`onClick`];function qe(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`grokvideo.name.resolution`)),1),a(p,{content:t.$t(`grokvideo.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Ge,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Ke))),128))])])}var Je=G(Ve,[[`render`,qe],[`__scopeId`,`data-v-54f22a22`]]),Ye=v({name:`GrokVideoRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:ne,label:`16:9`,w:32,h:18},{value:re,label:`9:16`,w:18,h:32},{value:`1:1`,label:`1:1`,w:24,h:24},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`3:2`,label:`3:2`,w:30,h:20},{value:`2:3`,label:`2:3`,w:20,h:30}]},value:{get(){return this.$store.state.grokvideo?.config?.aspect_ratio},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,aspect_ratio:e})}}},mounted(){this.value||=I}}),Xe={class:`ratio`},Ze={class:`header`},Qe={class:`title font-bold`},$e={class:`items`},et=[`onClick`],tt={class:`preview`},nt={class:`name`};function rt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,i(t.$t(`grokvideo.name.ratio`)),1),a(p,{content:t.$t(`grokvideo.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,$e,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,tt,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,nt,i(r.label),1)],10,et))),128))])])}var it=G(Ye,[[`render`,rt],[`__scopeId`,`data-v-70115284`]]),at=v({name:`GrokVideoImageInput`,components:{UploadIcon:P,ElUpload:x,ElButton:U,InfoIcon:Q,ImagePreview:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},required(){return R(this.$store.state.grokvideo?.config?.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){Y.warning(this.$t(`grokvideo.message.uploadExceed`))},onError(){Y.error(this.$t(`grokvideo.message.uploadError`))},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,image_url:e||void 0})},async onSuccess(){this.onSetImageUrl()},async onRemove(){this.onSetImageUrl()}}}),ot={class:`relative`},st={class:`flex justify-between`},ct={class:`flex justify-start items-center`},lt={class:`text-sm font-bold`},ut={key:0,class:`required-badge`};function dt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,ot,[e(`div`,st,[e(`div`,ct,[e(`span`,lt,i(t.$t(`grokvideo.name.image`)),1),t.required?(g(),s(`span`,ut,i(t.$t(`grokvideo.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`grokvideo.description.image`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])}var ft=G(at,[[`render`,dt],[`__scopeId`,`data-v-38306c67`]]),pt=4,mt=v({name:`GrokVideoReferenceImagesInput`,components:{UploadIcon:P,ElUpload:x,ElButton:U,InfoIcon:Q,ImagePreview:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`,limit:pt,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)||[]},value(){return this.$store.state.grokvideo?.config?.reference_image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetReferenceImages()},onExceed(){Y.warning(this.$t(`grokvideo.message.uploadReferenceExceed`))},onError(){Y.error(this.$t(`grokvideo.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,reference_image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetReferenceImages()}}}),ht={class:`field mb-[10px] flex items-center justify-between`},gt={class:`title m-0 text-[14px] font-bold`},_t={class:`upload-wrapper flex flex-col items-start gap-[8px]`},vt={class:`controls flex items-center`},yt={class:`file-list flex flex-wrap gap-[10px]`};function bt(t,n,o,u,d,m){let _=l(`upload-icon`),v=l(`el-button`),y=l(`el-upload`),b=l(`info-icon`),x=l(`image-preview`);return g(),s(c,null,[e(`div`,ht,[e(`h2`,gt,i(t.$t(`grokvideo.name.referenceImages`)),1),e(`div`,_t,[e(`div`,vt,[a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:t.limit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(_,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),a(b,{content:t.$t(`grokvideo.description.referenceImages`)},null,8,[`content`])])])]),e(`div`,yt,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])],64)}var xt=v({name:`GrokVideoConfigPanel`,components:{MagicIcon:F,ElButton:U,PromptInput:Ee,ModelSelector:Ne,DurationSelector:Be,ResolutionSelector:Je,RatioSelector:it,ImageInput:ft,ReferenceImagesInput:G(mt,[[`render`,bt]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.grokvideo?.config},supportsReferenceImages(){return!R(this.$store.state.grokvideo?.config?.model)},consumption(){return se(this.config,this.service?.cost)},service(){return this.$store.state.grokvideo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),St={class:`flex flex-col h-full`},Ct={class:`flex-1 overflow-y-auto p-5`},wt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Tt(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`image-input`),S=l(`reference-images-input`),C=l(`consumption`),w=l(`magic-icon`),T=l(`el-button`);return g(),s(`div`,St,[e(`div`,Ct,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),t.supportsReferenceImages?(g(),f(S,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,wt,[a(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Et=G(xt,[[`render`,Tt]]),Dt=v({name:`GrokVideoTaskPreview`,components:{ApplicationIcon:E,ChannelIcon:A,FullscreenIcon:k,InfoIcon:M,MagicIcon:F,TimeIcon:D,WarningIcon:N,CopyToClipboard:O,ElAlert:C,VideoPlayer:he,ElTooltip:S,ElButton:U,ImagePreview:Z,ApiCodeButton:ge},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_url},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),Ot={class:`preview`},kt={class:`left`},At={class:`main`},jt={class:`bot`},Mt={class:`datetime`},Nt={class:`info`},Pt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Ft={key:1,class:`prompt mt-2`},It={key:0},Lt={key:1},Rt={key:0,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vt={key:1,class:n({content:!0})},Ht={key:0,class:`mb-4`},Ut={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Wt={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-2`},Kt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:0},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xt={key:2,class:n({content:!0})},Zt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$t={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},en={key:3,class:n({content:!0})},tn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function nn(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`image-preview`),v=l(`time-icon`),y=l(`magic-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`application-icon`),D=l(`fullscreen-icon`),O=l(`channel-icon`),k=l(`warning-icon`),A=l(`info-icon`);return g(),s(`div`,Ot,[e(`div`,kt,[a(h,{capability:`grokvideo`,part:`avatar`,class:`avatar`})]),e(`div`,At,[e(`div`,jt,[a(h,{capability:`grokvideo`,part:`name`}),e(`span`,Mt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Nt,[n.inputImage?(g(),s(`div`,Pt,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Ft,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,Lt,` - (`+i(n.$t(`grokvideo.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,It,` - (`+i(n.$t(`grokvideo.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Vt,[n.video?.video_url?(g(),s(`div`,Ht,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ut,[a(w,{class:`box-item`,effect:`dark`,content:n.$t(`grokvideo.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(C,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`grokvideo.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/grok/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(x,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Wt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Gt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,Kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,qt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,$,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Jt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Yt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Xt,[a(x,{closable:!1,class:`failure`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failure`)),1)]),default:p(()=>[e(`p`,Zt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Qt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(b,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$t,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,en,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.status`)),1)]),default:p(()=>[e(`p`,tn,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Rt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Bt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var rn=v({name:`GrokVideoRecentPanel`,components:{TaskPreview:G(Dt,[[`render`,nn],[`__scopeId`,`data-v-714ce001`]]),BotPlaceholder:_e,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.grokvideo?.tasks,items:this.$store.state.grokvideo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),an={key:0},on={key:2,class:`w-full h-full flex items-center justify-center`};function sn(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,an,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,on,[a(v)])):o(``,!0)],64)}var cn=v({name:`GrokVideoIndex`,components:{ConfigPanel:Et,Layout:Ce,RecentPanel:G(rn,[[`render`,sn]])},mixins:[q],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.grokvideo?.status?.getApplications===J.Request},tasksLoading(){return this.$store.state.grokvideo?.status?.getTasks===J.Request||this.fetchingTasks},credential(){return this.$store.state.grokvideo?.credential},config(){return this.$store.state.grokvideo?.config},tasks(){return this.$store.state.grokvideo?.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 me({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`grokvideo/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`grokvideo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ue(this.uploadTracker,e=>this.$t(e),e=>Y.warning(e)))return;let e={...this.config||{}};typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),typeof e?.image_url==`string`&&!e.image_url.trim()&&delete e.image_url,(R(e?.model)||!(Array.isArray(e?.reference_image_urls)&&e.reference_image_urls.length))&&delete e.reference_image_urls;let t=!!e?.image_url;if(R(e?.model)&&!t){Y.warning(this.$t(`grokvideo.message.modelRequiresImage`));return}if(!t&&!e?.prompt){Y.warning(this.$t(`grokvideo.message.promptOrImageRequired`));return}let n={...e,async:!0};if(!H())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}Y.info(this.$t(`grokvideo.message.startingTask`)),ce(`grokvideo`,le.generate(n,{token:r})).then(()=>{Y.success(this.$t(`grokvideo.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?Y.error(this.$t(`grokvideo.message.usedUp`)):Y.error(this.$t(`grokvideo.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ln(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var un=G(cn,[[`render`,ln]]);export{un as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-DUVlT9hf.js";import{t as x}from"./upload-BWf23oQa.js";import{t as S}from"./tooltip-Gx4jPHlO.js";import{t as C}from"./alert-B2CVhm_j.js";import{t as w}from"./drawer-BTb568QE.js";import{n as T}from"./taskDrawerMixin-7tqZnehJ.js";import{t as E}from"./box-3oU0nJj7.js";import{t as D}from"./clock-DBA92Mpf.js";import{t as O}from"./CopyToClipboard-CdZHnA6f.js";import{n as k,r as A,t as j}from"./PromptTextarea-D64KucTj.js";import{t as M}from"./info-CIky8Wbu.js";import{t as N}from"./triangle-alert-DjbquHLH.js";import{t as P}from"./upload-B9ekoGFH.js";import{t as F}from"./wand-sparkles-CiQpHMMP.js";import{At as I,Bt as L,Ft as ee,Ht as te,It as ne,Lt as re,Mt as ie,Pt as ae,Rt as oe,Ut as R,jt as z,kt as B,zt as V}from"./constants-Bq6v7ZuS.js";import{$t as H,Ai as U,Bt as W,E as G,Ht as K,Vt as q,Wt as se,ei as J,gi as Y,mr as ce,ri as X,xn as le,zt as ue}from"./index-BxHiLpHH.js";import{t as Z}from"./ImagePreview-C-RPL05t.js";import{t as de}from"./Consumption-BUcyYr1r.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-BYV_3jrR.js";import{t as he}from"./VideoPlayer-Dt-ZkZ7-.js";import{t as ge}from"./ApiCodeButton-BeFKoVdS.js";import{t as _e}from"./BotPlaceholder-DSEljO8x.js";var ve=v({name:`LayoutGrokVideo`,components:{MagicIcon:F,ElDrawer:w,ElButton:U},mixins:[T]}),ye={class:`main flex flex-row flex-1`},be={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ce=G(ve,[[`render`,Se],[`__scopeId`,`data-v-cdd6b8f3`]]),we=v({name:`GrokVideoPromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.grokvideo?.config?.prompt},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`grokvideo.name.prompt`),info:e.$t(`grokvideo.description.prompt`),placeholder:e.$t(`grokvideo.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=G(we,[[`render`,Te]]),De=v({name:`GrokVideoModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:ee,label:this.$t(`grokvideo.model.default`)},{value:ae,label:this.$t(`grokvideo.model.preview15`)}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.model},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,model:e})}}},mounted(){this.value||=B}}),Oe={class:`field`},ke={class:`label`},Ae={class:`box`},je={class:`title font-bold`};function Me(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`div`,Ae,[e(`h2`,je,i(t.$t(`grokvideo.name.model`)),1),a(m,{content:t.$t(`grokvideo.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`grokvideo.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ne=G(De,[[`render`,Me],[`__scopeId`,`data-v-291d93fb`]]),Pe=v({name:`GrokVideoDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.grokvideo?.config?.model},maxDuration(){return te(this.model)},options(){return ie.filter(e=>e<=this.maxDuration).map(e=>({value:e,label:`${e}s`}))},value:{get(){return this.$store.state.grokvideo?.config?.duration},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,duration:e})}}},watch:{maxDuration(e){this.value&&this.value>e&&(this.value=e)}},mounted(){this.value||=6}}),Fe={class:`field`},Ie={class:`label`},Le={class:`box`},Re={class:`title font-bold`};function ze(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`grokvideo.name.duration`)),1),a(m,{content:t.$t(`grokvideo.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`grokvideo.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Be=G(Pe,[[`render`,ze],[`__scopeId`,`data-v-9c711686`]]),Ve=v({name:`GrokVideoResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:V,label:`480p`},{value:L,label:`720p`},{value:oe,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.grokvideo?.config?.resolution},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,resolution:e})}}},mounted(){this.value||=z}}),He={class:`resolution`},Ue={class:`header`},We={class:`title font-bold`},Ge={class:`items`},Ke=[`onClick`];function qe(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`grokvideo.name.resolution`)),1),a(p,{content:t.$t(`grokvideo.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Ge,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Ke))),128))])])}var Je=G(Ve,[[`render`,qe],[`__scopeId`,`data-v-54f22a22`]]),Ye=v({name:`GrokVideoRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:ne,label:`16:9`,w:32,h:18},{value:re,label:`9:16`,w:18,h:32},{value:`1:1`,label:`1:1`,w:24,h:24},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`3:2`,label:`3:2`,w:30,h:20},{value:`2:3`,label:`2:3`,w:20,h:30}]},value:{get(){return this.$store.state.grokvideo?.config?.aspect_ratio},set(e){this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,aspect_ratio:e})}}},mounted(){this.value||=I}}),Xe={class:`ratio`},Ze={class:`header`},Qe={class:`title font-bold`},$e={class:`items`},et=[`onClick`],tt={class:`preview`},nt={class:`name`};function rt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`h2`,Qe,i(t.$t(`grokvideo.name.ratio`)),1),a(p,{content:t.$t(`grokvideo.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,$e,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,tt,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,nt,i(r.label),1)],10,et))),128))])])}var it=G(Ye,[[`render`,rt],[`__scopeId`,`data-v-70115284`]]),at=v({name:`GrokVideoImageInput`,components:{UploadIcon:P,ElUpload:x,ElButton:U,InfoIcon:Q,ImagePreview:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},required(){return R(this.$store.state.grokvideo?.config?.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){Y.warning(this.$t(`grokvideo.message.uploadExceed`))},onError(){Y.error(this.$t(`grokvideo.message.uploadError`))},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,image_url:e||void 0})},async onSuccess(){this.onSetImageUrl()},async onRemove(){this.onSetImageUrl()}}}),ot={class:`relative`},st={class:`flex justify-between`},ct={class:`flex justify-start items-center`},lt={class:`text-sm font-bold`},ut={key:0,class:`required-badge`};function dt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,ot,[e(`div`,st,[e(`div`,ct,[e(`span`,lt,i(t.$t(`grokvideo.name.image`)),1),t.required?(g(),s(`span`,ut,i(t.$t(`grokvideo.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`grokvideo.description.image`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])}var ft=G(at,[[`render`,dt],[`__scopeId`,`data-v-38306c67`]]),pt=4,mt=v({name:`GrokVideoReferenceImagesInput`,components:{UploadIcon:P,ElUpload:x,ElButton:U,InfoIcon:Q,ImagePreview:Z},mixins:[K,W],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`,limit:pt,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)||[]},value(){return this.$store.state.grokvideo?.config?.reference_image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetReferenceImages()},onExceed(){Y.warning(this.$t(`grokvideo.message.uploadReferenceExceed`))},onError(){Y.error(this.$t(`grokvideo.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`grokvideo/setConfig`,{...this.$store.state.grokvideo?.config,reference_image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetReferenceImages()}}}),ht={class:`field mb-[10px] flex items-center justify-between`},gt={class:`title m-0 text-[14px] font-bold`},_t={class:`upload-wrapper flex flex-col items-start gap-[8px]`},vt={class:`controls flex items-center`},yt={class:`file-list flex flex-wrap gap-[10px]`};function bt(t,n,o,u,d,m){let _=l(`upload-icon`),v=l(`el-button`),y=l(`el-upload`),b=l(`info-icon`),x=l(`image-preview`);return g(),s(c,null,[e(`div`,ht,[e(`h2`,gt,i(t.$t(`grokvideo.name.referenceImages`)),1),e(`div`,_t,[e(`div`,vt,[a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:t.limit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(_,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),a(b,{content:t.$t(`grokvideo.description.referenceImages`)},null,8,[`content`])])])]),e(`div`,yt,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])],64)}var xt=v({name:`GrokVideoConfigPanel`,components:{MagicIcon:F,ElButton:U,PromptInput:Ee,ModelSelector:Ne,DurationSelector:Be,ResolutionSelector:Je,RatioSelector:it,ImageInput:ft,ReferenceImagesInput:G(mt,[[`render`,bt]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.grokvideo?.config},supportsReferenceImages(){return!R(this.$store.state.grokvideo?.config?.model)},consumption(){return se(this.config,this.service?.cost)},service(){return this.$store.state.grokvideo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),St={class:`flex flex-col h-full`},Ct={class:`flex-1 overflow-y-auto p-5`},wt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Tt(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`image-input`),S=l(`reference-images-input`),C=l(`consumption`),w=l(`magic-icon`),T=l(`el-button`);return g(),s(`div`,St,[e(`div`,Ct,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),t.supportsReferenceImages?(g(),f(S,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,wt,[a(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`grokvideo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Et=G(xt,[[`render`,Tt]]),Dt=v({name:`GrokVideoTaskPreview`,components:{ApplicationIcon:E,ChannelIcon:A,FullscreenIcon:k,InfoIcon:M,MagicIcon:F,TimeIcon:D,WarningIcon:N,CopyToClipboard:O,ElAlert:C,VideoPlayer:he,ElTooltip:S,ElButton:U,ImagePreview:Z,ApiCodeButton:ge},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_url},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),Ot={class:`preview`},kt={class:`left`},At={class:`main`},jt={class:`bot`},Mt={class:`datetime`},Nt={class:`info`},Pt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Ft={key:1,class:`prompt mt-2`},It={key:0},Lt={key:1},Rt={key:0,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vt={key:1,class:n({content:!0})},Ht={key:0,class:`mb-4`},Ut={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Wt={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-2`},Kt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:0},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xt={key:2,class:n({content:!0})},Zt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$t={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},en={key:3,class:n({content:!0})},tn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function nn(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`image-preview`),v=l(`time-icon`),y=l(`magic-icon`),b=l(`copy-to-clipboard`),x=l(`el-alert`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`application-icon`),D=l(`fullscreen-icon`),O=l(`channel-icon`),k=l(`warning-icon`),A=l(`info-icon`);return g(),s(`div`,Ot,[e(`div`,kt,[a(h,{capability:`grokvideo`,part:`avatar`,class:`avatar`})]),e(`div`,At,[e(`div`,jt,[a(h,{capability:`grokvideo`,part:`name`}),e(`span`,Mt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Nt,[n.inputImage?(g(),s(`div`,Pt,[a(_,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Ft,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,Lt,` - (`+i(n.$t(`grokvideo.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,It,` - (`+i(n.$t(`grokvideo.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Vt,[n.video?.video_url?(g(),s(`div`,Ht,[a(S,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ut,[a(w,{class:`box-item`,effect:`dark`,content:n.$t(`grokvideo.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(C,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`grokvideo.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/grok/videos`,body:n.modelValue?.request},null,8,[`body`])])):o(``,!0),a(x,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Wt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Gt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,Kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,qt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,$,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Jt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Yt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Xt,[a(x,{closable:!1,class:`failure`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failure`)),1)]),default:p(()=>[e(`p`,Zt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Qt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(b,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$t,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(b,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,en,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.status`)),1)]),default:p(()=>[e(`p`,tn,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Rt,[a(x,{closable:!1,class:`info`},{template:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(b,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Bt,[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`grokvideo.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var rn=v({name:`GrokVideoRecentPanel`,components:{TaskPreview:G(Dt,[[`render`,nn],[`__scopeId`,`data-v-714ce001`]]),BotPlaceholder:_e,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.grokvideo?.tasks,items:this.$store.state.grokvideo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),an={key:0},on={key:2,class:`w-full h-full flex items-center justify-center`};function sn(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,an,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,on,[a(v)])):o(``,!0)],64)}var cn=v({name:`GrokVideoIndex`,components:{ConfigPanel:Et,Layout:Ce,RecentPanel:G(rn,[[`render`,sn]])},mixins:[q],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.grokvideo?.status?.getApplications===J.Request},tasksLoading(){return this.$store.state.grokvideo?.status?.getTasks===J.Request||this.fetchingTasks},credential(){return this.$store.state.grokvideo?.credential},config(){return this.$store.state.grokvideo?.config},tasks(){return this.$store.state.grokvideo?.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 me({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`grokvideo/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`grokvideo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ue(this.uploadTracker,e=>this.$t(e),e=>Y.warning(e)))return;let e={...this.config||{}};typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),typeof e?.image_url==`string`&&!e.image_url.trim()&&delete e.image_url,(R(e?.model)||!(Array.isArray(e?.reference_image_urls)&&e.reference_image_urls.length))&&delete e.reference_image_urls;let t=!!e?.image_url;if(R(e?.model)&&!t){Y.warning(this.$t(`grokvideo.message.modelRequiresImage`));return}if(!t&&!e?.prompt){Y.warning(this.$t(`grokvideo.message.promptOrImageRequired`));return}let n={...e,async:!0};if(!H())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}Y.info(this.$t(`grokvideo.message.startingTask`)),ce(`grokvideo`,le.generate(n,{token:r})).then(()=>{Y.success(this.$t(`grokvideo.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?Y.error(this.$t(`grokvideo.message.usedUp`)):Y.error(this.$t(`grokvideo.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ln(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var un=G(cn,[[`render`,ln]]);export{un as default};
|