@acedatacloud/nexior 3.380.8 → 3.381.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ApiCodeButton-C5tBSXac.js → ApiCodeButton-C7SPMZJ4.js} +1 -1
- package/dist/assets/{ApiCodeDialog-tzrLt7MW.js → ApiCodeDialog-B0m5_btu.js} +2 -2
- package/dist/assets/{Artifacts-Bq-ESji9.js → Artifacts-C935GA3p.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BHRutjE4.js → AskUserQuestionCard-Qi57dVV7.js} +1 -1
- package/dist/assets/{AudioPreview-fEc2Zd45.js → AudioPreview-h4P2x5TL.js} +1 -1
- package/dist/assets/{Auth-D0qonxcj.js → Auth-DW29k_jE.js} +1 -1
- package/dist/assets/{Bare-gBTQBYOF.js → Bare-DvCKQeEu.js} +1 -1
- package/dist/assets/{BotPlaceholder-7Rci0gLD.js → BotPlaceholder-BBI_oSgE.js} +1 -1
- package/dist/assets/{BottomFooter-CXfDJs6K.js → BottomFooter-afn-jz6v.js} +1 -1
- package/dist/assets/{BrowseConnectors-jbUHMESo.js → BrowseConnectors-G0r_jByZ.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-BLbseBCp.js → BrowserPairingDialog-BJgs6qLU.js} +1 -1
- package/dist/assets/{Callback-DQ7s2YUT.js → Callback-DveJm8vT.js} +1 -1
- package/dist/assets/{CodeSnippet-DtFkobrj.js → CodeSnippet-BFdyqpEG.js} +1 -1
- package/dist/assets/{Console-DqcMlqeQ.js → Console-C21WF1jP.js} +1 -1
- package/dist/assets/{Conversation-CxIjxIV3.js → Conversation-D0W5uzHA.js} +1 -1
- package/dist/assets/Conversation-E2vMcQr8.js +2 -0
- package/dist/assets/{CopyToClipboard-CIB9LY9Y.js → CopyToClipboard-CdXnxkau.js} +1 -1
- package/dist/assets/Detail-DDl6m0vE.js +2 -0
- package/dist/assets/{Detail-CgTGSka5.css → Detail-DixHmQzJ.css} +1 -1
- package/dist/assets/Extra-C6que9Av.js +1 -0
- package/dist/assets/{FilePreview-_7yUZ2m8.js → FilePreview-BpPQ5OAR.js} +1 -1
- package/dist/assets/{Hailuo-Gr9P4KZh.js → Hailuo-BeRIbNr2.js} +1 -1
- package/dist/assets/{History-BdECMOXE.js → History-BsN3wekq.js} +1 -1
- package/dist/assets/{ImagePreview-Dq6UkYX8.js → ImagePreview-BOxOkmuq.js} +1 -1
- package/dist/assets/{ImageWrapper-C9nEUyQX.js → ImageWrapper-vYpJPO89.js} +1 -1
- package/dist/assets/{Index-DF_YSy5V.js → Index-0oHw41Oc.js} +1 -1
- package/dist/assets/{Index-FNGDlXFq.js → Index-1U2bTpbF.js} +1 -1
- package/dist/assets/{Index-CWWsa0Lz.js → Index-7IkF_rpP.js} +1 -1
- package/dist/assets/{Index-CGU29OIG.js → Index-B-Mkt2ur.js} +1 -1
- package/dist/assets/Index-BPh5XDKu.js +1 -0
- package/dist/assets/{Index-DxgRmJSg.js → Index-BWgi01SX.js} +1 -1
- package/dist/assets/{Index-EYQ1NKQW.js → Index-Ba4WWol0.js} +2 -2
- package/dist/assets/{Index-BS1nLceI.js → Index-BdjKyfS1.js} +1 -1
- package/dist/assets/Index-BiHjCG2i.js +1 -0
- package/dist/assets/{Index-DfJKnw20.js → Index-CB-KJcln.js} +1 -1
- package/dist/assets/{Index-DN7liprI.js → Index-CI-2_oM6.js} +2 -2
- package/dist/assets/Index-CI8i6hTW.js +1 -0
- package/dist/assets/{Index-DCSPk7nn.js → Index-CJ7hChmF.js} +1 -1
- package/dist/assets/{Index-SDzpl-Jc2.js → Index-CJtxYaZ02.js} +1 -1
- package/dist/assets/{Index-B7WKuXER.js → Index-CPrqWc5U.js} +1 -1
- package/dist/assets/{Index-CmrcDBzZ2.js → Index-CUsRTBAy2.js} +1 -1
- package/dist/assets/{Index-B3fIj3yi.js → Index-CVwMDW-A.js} +2 -2
- package/dist/assets/{Index-BinkgTmw.js → Index-CZS8iQGD.js} +1 -1
- package/dist/assets/{Index-D5VNzG82.js → Index-CetGJnpB.js} +1 -1
- package/dist/assets/{Index-AbcXPxs0.js → Index-CnYc0oJ8.js} +1 -1
- package/dist/assets/Index-D4x9T8au.js +1 -0
- package/dist/assets/Index-D5Ul2doi.js +1 -0
- package/dist/assets/{Index-Drdb9P_r.js → Index-DRVWr0MK.js} +1 -1
- package/dist/assets/{Index-DeYrbAvW.js → Index-D_y7v_Gn.js} +1 -1
- package/dist/assets/Index-DcVducNv.js +1 -0
- package/dist/assets/{Index-DLjlVvNI.js → Index-DeZs_u7x.js} +1 -1
- package/dist/assets/{Index-BhPsqs3d.js → Index-Dfg2U97G.js} +1 -1
- package/dist/assets/Index-O_CrvytF.js +1 -0
- package/dist/assets/Index-U68d2uZj.js +1 -0
- package/dist/assets/{Index-DAF6Fi1i.js → Index-_De5KqLp.js} +2 -2
- package/dist/assets/{Index-BDfNqyi8.js → Index-hhTRG2BF.js} +1 -1
- package/dist/assets/{Index-Bi_F3a9E.js → Index-iVjZH5W4.js} +1 -1
- package/dist/assets/Index-j-bMmKiW.js +1 -0
- package/dist/assets/Index-jMFiTGzQ2.js +1 -0
- package/dist/assets/Index-pButqdV7.js +1 -0
- package/dist/assets/{Index-DgC9uvAK.js → Index-wIXSyIsm.js} +1 -1
- package/dist/assets/{Invitees-DyGmUv2R.js → Invitees-NIBmPbQA.js} +1 -1
- package/dist/assets/List-BRxaXLPy.js +1 -0
- package/dist/assets/List-D-zLjR6q.js +1 -0
- package/dist/assets/List-wiwQQloc.js +1 -0
- package/dist/assets/LocalTools-BC90IHHk.js +5 -0
- package/dist/assets/{LocalTools-BPDI9e-z.js → LocalTools-CEjkt2l2.js} +1 -1
- package/dist/assets/{Logo-6qSswnm2.js → Logo-C6NJezpt.js} +1 -1
- package/dist/assets/{Main-gLvuSjN6.js → Main-B0EVjP0H.js} +1 -1
- package/dist/assets/{Message-BtE8gWlu.js → Message-BAL7WOXJ.js} +2 -2
- package/dist/assets/{Model-CeOYezTT.js → Model-j4_EX-gG.js} +2 -2
- package/dist/assets/{Navigator-DqokGio8.js → Navigator-CERVgrJV.js} +5 -5
- package/dist/assets/{NotFound-D3Q4GfiQ.js → NotFound-l7IoxBXr.js} +1 -1
- package/dist/assets/{PageHeader-DOWQjC3H.js → PageHeader-Cer1mYPv.js} +1 -1
- package/dist/assets/Pay-o3xo2mqm.js +1 -0
- package/dist/assets/{Player-B3iX2KLl.js → Player-UOjqiG5R.js} +1 -1
- package/dist/assets/{Poivelle-DKlkQB2c.js → Poivelle-BKRPVdM1.js} +1 -1
- package/dist/assets/{RealtimeCall-XAJLDR6Q.js → RealtimeCall-Cs8cbkOK.js} +2 -2
- package/dist/assets/{ReportButton-D3eba7A1.js → ReportButton-CpSn2HJv.js} +1 -1
- package/dist/assets/{ReportDialog-tMrdW_fU.js → ReportDialog-BoKKjM7J.js} +1 -1
- package/dist/assets/{ScenarioPaymentMode-BwoqFZco.js → ScenarioPaymentMode-Bfxf8Ufv.js} +1 -1
- package/dist/assets/{ScheduledTasks-CMcU7GEK.js → ScheduledTasks-iixEy1Ye.js} +2 -2
- package/dist/assets/{ServicePricingSummary-N2X5DfKj.js → ServicePricingSummary-D4J-WJ1t.js} +1 -1
- package/dist/assets/{SharedMarkdown-B8a4sQ0t.js → SharedMarkdown-BDyd2eGz.js} +1 -1
- package/dist/assets/{ShowcaseGrid-DFAlG_5F.js → ShowcaseGrid-DPrNdkyb.js} +1 -1
- package/dist/assets/{ShowcaseResultTabs-Bx16-8QM.js → ShowcaseResultTabs-Di_5PzXP.js} +1 -1
- package/dist/assets/{SolanaWalletPickerDialog-DpiM35uj.js → SolanaWalletPickerDialog-JUe0BzI8.js} +1 -1
- package/dist/assets/Status-C8r33_t6.js +1 -0
- package/dist/assets/{Status-CJdLn3iI.css → Status-Ck9ha4jD.css} +1 -1
- package/dist/assets/{Subscribe-BN32hXrS.js → Subscribe-z4lsK-Pw.js} +1 -1
- package/dist/assets/{TabSwitcher-6c6JSS4_.js → TabSwitcher-DJsQU_kt.js} +1 -1
- package/dist/assets/{Tts-Dio3pSmI.js → Tts-CvIT5Y3Q.js} +1 -1
- package/dist/assets/{VideoPlayer-BNtDhrpR.js → VideoPlayer-B43pPHVA.js} +1 -1
- package/dist/assets/{VideoPreview-K60Fueap.js → VideoPreview-DxrhYEOD.js} +1 -1
- package/dist/assets/{VueMarkdown-ktB0s_p4.js → VueMarkdown-Cm2HOlvG.js} +2 -2
- package/dist/assets/WriteSkillDialog-_mcGlQJv.js +1 -0
- package/dist/assets/{airwallexCheckout--o-YoruN.js → airwallexCheckout-DfA_t-KL.js} +1 -1
- package/dist/assets/arrow-down-D2NapJz3.js +1 -0
- package/dist/assets/arrow-left-DylqoAP7.js +1 -0
- package/dist/assets/arrow-right-J1XoxSVH.js +1 -0
- package/dist/assets/arrow-up-DO1r6z0s.js +1 -0
- package/dist/assets/{authorizeFlow-D30X2Lyo.js → authorizeFlow-De8qROX8.js} +1 -1
- package/dist/assets/{avatar--_Ho4k0C.js → avatar-CFr7Npbl.js} +1 -1
- package/dist/assets/{back-navigation-D-lHpBnE.js → back-navigation-CBmABnbg.js} +1 -1
- package/dist/assets/{basic-C8xJ8MvR.js → basic-BFxUUMy1.js} +1 -1
- package/dist/assets/{book-open-BH4GaBn5.js → book-open-pud407AJ.js} +1 -1
- package/dist/assets/{box-3_e2nW7_.js → box-BzqbI4wX.js} +1 -1
- package/dist/assets/{boxes-DQGNW64d.js → boxes-x-qEQ-LI.js} +1 -1
- package/dist/assets/{brain-DMDAedtO.js → brain-DJFZK1UE.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-N5HL2gKV.js → chart-no-axes-combined-D35CqiRR.js} +1 -1
- package/dist/assets/{chat-C3QlZeo1.js → chat-Cbq_zDLN.js} +1 -1
- package/dist/assets/check-CHq--2kK.js +1 -0
- package/dist/assets/chevron-down-BI4tJ27m.js +1 -0
- package/dist/assets/chevron-right-CHuS6TXO.js +1 -0
- package/dist/assets/{circle-alert-C-PFf-1o.js → circle-alert-CHxD-85L.js} +1 -1
- package/dist/assets/circle-check-D_FoW3dP.js +1 -0
- package/dist/assets/{circle-question-mark-iFkJm6Cg.js → circle-question-mark-BGXCIlnz.js} +1 -1
- package/dist/assets/{clipboard-list-Cvngrayq.js → clipboard-list-BxI8Nmie.js} +1 -1
- package/dist/assets/clock-CvHl_Vd7.js +1 -0
- package/dist/assets/code-NL9LxNiy.js +1 -0
- package/dist/assets/codingBridge-DW94cI81.js +2 -0
- package/dist/assets/{codingBridgeNotify-BoMwcUhd.js → codingBridgeNotify-CokX8Ia4.js} +2 -2
- package/dist/assets/{coins-D0M4bX5f.js → coins-PK6Ps1X2.js} +1 -1
- package/dist/assets/{connection-CaarfcXm.js → connection-D1Ih6dQd.js} +1 -1
- package/dist/assets/{copy-CUk5HyqT.js → copy-D7lHzTGA.js} +1 -1
- package/dist/assets/{createTaskActions-DQEdc5ib.js → createTaskActions-BZPCtPLs.js} +1 -1
- package/dist/assets/{date-picker-C9cLRv2A.js → date-picker-B72Rk5Dt.js} +1 -1
- package/dist/assets/{digitalhuman-C7ZvYqCi.js → digitalhuman-BvEYnRvw.js} +1 -1
- package/dist/assets/{dollar-sign-C1s1LGmE.js → dollar-sign-CKl6b5bP.js} +1 -1
- package/dist/assets/{download-BmQLXojU.js → download-pMsno2DA.js} +1 -1
- package/dist/assets/{drawer-VaJhlwVr.js → drawer-BaqojTRQ.js} +1 -1
- package/dist/assets/{dropdown-iF_atr6i.js → dropdown-CuUYnMXP.js} +1 -1
- package/dist/assets/{dropdown-DBipAigc.js → dropdown-j3EEj4Tp.js} +1 -1
- package/dist/assets/{ellipsis-BqkKsvF-.js → ellipsis-BlYmih11.js} +1 -1
- package/dist/assets/{esm-DrVDihqw.js → esm-BmncEOyb.js} +2 -2
- package/dist/assets/{esm-Cbxht914.js → esm-CXE577Fh.js} +2 -2
- package/dist/assets/esm-qenNKkbC.js +1 -0
- package/dist/assets/{external-link-C9bruFod.js → external-link-BIUuevwA.js} +1 -1
- package/dist/assets/{eye-CFHeQVx8.js → eye-BFgFlWNS.js} +1 -1
- package/dist/assets/{file-CR75F95u.js → file-DmSI4aV7.js} +1 -1
- package/dist/assets/{file-output-CfzTcR2_.js → file-output-DncNlmtQ.js} +1 -1
- package/dist/assets/{file-text-DBotrbYk.js → file-text-DcI2reu5.js} +1 -1
- package/dist/assets/{fish-B1s1UOus.js → fish-DGdFCanw.js} +1 -1
- package/dist/assets/{flux-CVzCQ6JR.js → flux-CzW311tV.js} +1 -1
- package/dist/assets/{folder-C9cnY4AN.js → folder-uXRfk1mZ.js} +1 -1
- package/dist/assets/gauge-BTPC0rXL.js +1 -0
- package/dist/assets/{globe-BKX021RY.js → globe-BPuLsDjR.js} +1 -1
- package/dist/assets/{nanobanana-BPGCIia_.js → grokvideo-CSAs2I4j.js} +1 -1
- package/dist/assets/{hailuo-CP8PTXG3.js → hailuo-D87_m-0U.js} +1 -1
- package/dist/assets/{hash-B61j4cgz.js → hash-yia5yLmV.js} +1 -1
- package/dist/assets/{headphones-SI1F4r-k.js → headphones-B8rBVQdH.js} +1 -1
- package/dist/assets/{history-_iIOa-KW.js → history-BNTxRkBy.js} +1 -1
- package/dist/assets/{house-C3am4krm.js → house-CbbGN4zL.js} +1 -1
- package/dist/assets/{image-DNGAwErV.js → image-CS6hThMg.js} +1 -1
- package/dist/assets/{index-Bk9SKIXV.js → index-C8uXmX2U.js} +17 -17
- package/dist/assets/{index.es-xc1wwztg.js → index.es-5Phodjqa.js} +1 -1
- package/dist/assets/{info-CDi6ZfZf.js → info-DVNsJvAI.js} +1 -1
- package/dist/assets/{input-number-BwJ2QIsY.js → input-number-BmFOlu3s.js} +1 -1
- package/dist/assets/{kling-BxsNl9_b.js → kling-BDMU0ncE.js} +1 -1
- package/dist/assets/{languages-p0PeYqme.js → languages-DX-qFZ5y.js} +1 -1
- package/dist/assets/{laptop-B7PBJgxD.js → laptop-DxflGBrU.js} +1 -1
- package/dist/assets/{lightbulb-ByXvOBwJ.js → lightbulb-CvqLaOvJ.js} +1 -1
- package/dist/assets/{link-f8tGCmjZ.js → link-BmCk0KSR.js} +1 -1
- package/dist/assets/loader-circle-VDhzM6Nn.js +1 -0
- package/dist/assets/{luma-D_7feexJ.js → luma-Cc-i1JLx.js} +1 -1
- package/dist/assets/{maestro-BO062bai.js → maestro-BSM6rSzW.js} +1 -1
- package/dist/assets/{mail-Cu6rYS5J.js → mail-BCkjos6i.js} +1 -1
- package/dist/assets/{message-circle-DQGqX_tb.js → message-circle-BmBmlsGF.js} +1 -1
- package/dist/assets/{mic-Duo8uJFA.js → mic-UcSG54_q.js} +1 -1
- package/dist/assets/{midjourney-DgbyQQt4.js → midjourney-CuMTiD4G.js} +1 -1
- package/dist/assets/minimax-kQU1Q46c.js +1 -0
- package/dist/assets/{mobileLocalExec-BAoyTFxs.js → mobileLocalExec-CwMOa_zQ.js} +2 -2
- package/dist/assets/{monitor-BY7a2lSu.js → monitor-VOFjSWYN.js} +1 -1
- package/dist/assets/{mouse-pointer-2-BBBdRKNG.js → mouse-pointer-2-DAKfL4eZ.js} +1 -1
- package/dist/assets/music-2-CKgTqNZ9.js +1 -0
- package/dist/assets/{grokvideo-IjeySWKZ.js → nanobanana-BARcP081.js} +1 -1
- package/dist/assets/{omni-DRmYijL5.js → omni-BdZjSEzD.js} +1 -1
- package/dist/assets/openaiimage-sQHUP0bq.js +1 -0
- package/dist/assets/{pagination-Srdjt7tL.js → pagination-C4oGiE57.js} +1 -1
- package/dist/assets/{pagination-Bxloie8Z.js → pagination-CoQKuK4D.js} +1 -1
- package/dist/assets/{pagination-BodQ3KsQ.js → pagination-uSk2V2K7.js} +1 -1
- package/dist/assets/{palette-CBVqiEiY.js → palette-Cw-HJS5z.js} +1 -1
- package/dist/assets/{paperclip-C5ucVDdU.js → paperclip-CSMkIW0R.js} +1 -1
- package/dist/assets/{pause-DEsHu_JX.js → pause-BYsZ80n3.js} +1 -1
- package/dist/assets/{pencil-zCR4E3gn.js → pencil-D6KQdtCj.js} +1 -1
- package/dist/assets/{pixverse-Br13_G7h.js → pika-a8YZxfOY.js} +1 -1
- package/dist/assets/pixverse-B7na9cqk.js +1 -0
- package/dist/assets/play-PlISts4C.js +1 -0
- package/dist/assets/{plug-BuLs05P4.js → plug-BlxHQPiR.js} +1 -1
- package/dist/assets/plus-8qHkLr4t.js +1 -0
- package/dist/assets/{poivelle-CmbgX8cH.js → poivelle-C_aJhNN6.js} +1 -1
- package/dist/assets/{popover-B0GxuFgb.js → popover-BqK-ErPr.js} +1 -1
- package/dist/assets/{producer-CtomnQQP.js → producer-a3I8ulbm.js} +1 -1
- package/dist/assets/{qrart-D4w0rqYS.js → qrart-B0UCUS7O.js} +1 -1
- package/dist/assets/{qwenimage-DL9zIyXV.js → qwenimage-BKtsaJIJ.js} +1 -1
- package/dist/assets/{realtime-DMwjvq1k.js → realtime-D-W5frEc.js} +1 -1
- package/dist/assets/{refresh-cw-CcOH8EPk.js → refresh-cw-B-RuE_6C.js} +1 -1
- package/dist/assets/rotate-ccw-DafhIXvS.js +1 -0
- package/dist/assets/rotate-cw-DIM3zleO.js +1 -0
- package/dist/assets/{scheduledTasks-BatLQ_gR.js → scheduledTasks-B7bwGGDF.js} +1 -1
- package/dist/assets/{scroll-text-BTS-NpZu.js → scroll-text-o74NoTP2.js} +1 -1
- package/dist/assets/search-Bh1-kl2_.js +1 -0
- package/dist/assets/{seedance-Bou-k6BW.js → seedance-CWwgV8jO.js} +1 -1
- package/dist/assets/{seedream-C9Rua-7B.js → seedream-fbaMKMDO.js} +1 -1
- package/dist/assets/{select-Dv7ZrvnE.js → select-Ctt4vMla.js} +1 -1
- package/dist/assets/{serp-B8GBsdPs.js → serp-CxyE8Wg6.js} +1 -1
- package/dist/assets/{shield-D-mmPu1n.js → shield-CNEip5QK.js} +1 -1
- package/dist/assets/{showcase-Cq0oPoIV.js → showcase-B3x-XIzn.js} +1 -1
- package/dist/assets/{showcaseRecreateMixin-C0UnaxsG.js → showcaseRecreateMixin-1te_SCEr.js} +1 -1
- package/dist/assets/{shuffle-D5K8vZCN.js → shuffle-XCkaDWwW.js} +1 -1
- package/dist/assets/{siteHome-Ds14_RM3.js → siteHome-DAuiSeoD.js} +1 -1
- package/dist/assets/{slider-C4ifUfAq.js → slider-DgU-R1_f.js} +1 -1
- package/dist/assets/{solana-wallets-B_mKv7o5.js → solana-wallets-v9HM0phx.js} +2 -2
- package/dist/assets/{sora-CO4yLi7O.js → sora-EYl03Tg1.js} +1 -1
- package/dist/assets/{sparkles-BI5Fg4u8.js → sparkles-BWT6yPWj.js} +1 -1
- package/dist/assets/square-VQwp91bM.js +1 -0
- package/dist/assets/{suno-BPJ6ThLW.js → suno-nHiDCtV6.js} +1 -1
- package/dist/assets/{switch-CFUCWNgM.js → switch-DfKiiyLD.js} +1 -1
- package/dist/assets/{table-GjLQgxzP.js → table-B3Y40ujp.js} +1 -1
- package/dist/assets/{tag-A8kAprsR.js → tag-DeoG4_K6.js} +1 -1
- package/dist/assets/{taskPolling-C9KHdhtK.js → taskPolling-ed3DvCWh.js} +1 -1
- package/dist/assets/terminal-CoZlBFes.js +1 -0
- package/dist/assets/{time-picker-D4M2msCX.js → time-picker-Dw67yBu1.js} +1 -1
- package/dist/assets/{tooltip-L2G5ntVi.js → tooltip-Co_mOTlo.js} +1 -1
- package/dist/assets/{trash-2-CUcSh2xz.js → trash-2-2Il_x-4b.js} +1 -1
- package/dist/assets/{triangle-alert-fl0O4ttl.js → triangle-alert-Dc39dkq0.js} +1 -1
- package/dist/assets/{upload-ClpzRFqM.js → upload-RXQqkOuq.js} +1 -1
- package/dist/assets/user-CRuiuJ_x.js +1 -0
- package/dist/assets/{veo-DzVF-9VO.js → veo-CP7MEHUu.js} +1 -1
- package/dist/assets/{video-D2H2yrK5.js → video-6ckJHXgu.js} +1 -1
- package/dist/assets/{volume-2-DuPw1i4l.js → volume-2-NeRUKB9t.js} +1 -1
- package/dist/assets/{wallet-BoMayNFZ.js → wallet-DqsH6oxz.js} +1 -1
- package/dist/assets/{wan-Div7QNhT.js → wan-BD9moAq4.js} +1 -1
- package/dist/assets/{wand-sparkles-C9xUdsPZ.js → wand-sparkles-CdzPtG8R.js} +1 -1
- package/dist/assets/{web-CxmWSgKl.js → web-B-lQxU2R.js} +1 -1
- package/dist/assets/{web-NUACo-ru.js → web-BV1Sidqw.js} +1 -1
- package/dist/assets/{web-CXqpsAgb.js → web-Bg9dBHiL.js} +1 -1
- package/dist/assets/{web-CMUsrooq.js → web-CeF7asFe.js} +1 -1
- package/dist/assets/{web-onuv9tHs.js → web-RYS5ytss.js} +1 -1
- package/dist/assets/{webextrator-Di-ibQB9.js → webextrator-DxlqCl-G.js} +1 -1
- package/dist/assets/{zap-B0eAEhqX.js → zap-BjEPcYjV.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Conversation-BdtH_RD0.js +0 -2
- package/dist/assets/Detail-Cwhh5P9b.js +0 -2
- package/dist/assets/Extra-C2rM0X0l.js +0 -1
- package/dist/assets/Index-BHFcy6tF.js +0 -1
- package/dist/assets/Index-Bo60hgY3.js +0 -1
- package/dist/assets/Index-Bx9XT7ii.js +0 -1
- package/dist/assets/Index-C8oOUtOA.js +0 -1
- package/dist/assets/Index-CGSt7zKV.js +0 -1
- package/dist/assets/Index-DE4Uanlv.js +0 -1
- package/dist/assets/Index-DUFd5F6p2.js +0 -1
- package/dist/assets/Index-DVhN8ZAF.js +0 -1
- package/dist/assets/Index-DeOmC_Q0.js +0 -1
- package/dist/assets/Index-Dkc39b3K.js +0 -1
- package/dist/assets/Index-Vz7Mw5xh.js +0 -1
- package/dist/assets/List-0tPShY4u.js +0 -1
- package/dist/assets/List-5Z5tELQE.js +0 -1
- package/dist/assets/List-lPxHfTDQ.js +0 -1
- package/dist/assets/LocalTools-CWWIjS6k.js +0 -5
- package/dist/assets/Pay-O5Qlb6UW.js +0 -1
- package/dist/assets/Status-CVUE2QYX.js +0 -1
- package/dist/assets/WriteSkillDialog-Bw-u8hlH.js +0 -1
- package/dist/assets/arrow-down-DCMjRdO_.js +0 -1
- package/dist/assets/arrow-left-DFXx6UvA.js +0 -1
- package/dist/assets/arrow-right-BBcVYEm1.js +0 -1
- package/dist/assets/arrow-up-BAfO-War.js +0 -1
- package/dist/assets/check-kkIqx5X1.js +0 -1
- package/dist/assets/chevron-down-vUO0pCAt.js +0 -1
- package/dist/assets/chevron-right-CHPHpC1T.js +0 -1
- package/dist/assets/circle-check-1eqJK_BD.js +0 -1
- package/dist/assets/clock-DIjv9Rh6.js +0 -1
- package/dist/assets/code-Bm4SQ3yq.js +0 -1
- package/dist/assets/codingBridge-CeVcO4fE.js +0 -2
- package/dist/assets/esm-fbzVLLeD.js +0 -1
- package/dist/assets/gauge-BdSNWC_w.js +0 -1
- package/dist/assets/loader-circle-BWTf1Yce.js +0 -1
- package/dist/assets/minimax-C_26yfUG.js +0 -1
- package/dist/assets/music-2-BmtV50Q3.js +0 -1
- package/dist/assets/openaiimage-DMLO-tzp.js +0 -1
- package/dist/assets/pika-CpXs-W0u.js +0 -1
- package/dist/assets/play-XZGUGKIJ.js +0 -1
- package/dist/assets/plus-Bz8tjapX.js +0 -1
- package/dist/assets/rotate-ccw-S9qsO1Sd.js +0 -1
- package/dist/assets/rotate-cw-DZrl6qQ6.js +0 -1
- package/dist/assets/search-K-yhv6oC.js +0 -1
- package/dist/assets/square-_e71CHtO.js +0 -1
- package/dist/assets/terminal-fyhUEvgw.js +0 -1
- package/dist/assets/user-3UxB-6FB.js +0 -1
|
@@ -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,S as c,T as l,at as u,bt as d,ht as f,it as p,j as m,mt as h,qt as g,rt as _,st as v,tt as y,x as ee,z as b}from"./vendor-chart-Dw-P17PN.js";import{F as x}from"./icon-CDmWyIgD.js";import{r as S,t as C}from"./select-Dv7ZrvnE.js";import{t as w}from"./upload-BG3x_JWJ.js";import{t as T}from"./tooltip-L2G5ntVi.js";import{t as E}from"./alert-BprQRUmf.js";import{_ as D,v as O}from"./vuex.esm-bundler-C-5WV-ta.js";import{t as k}from"./drawer-VaJhlwVr.js";import{t as A}from"./input-number-BwJ2QIsY.js";import{t as j}from"./switch-CFUCWNgM.js";import{t as M}from"./check-kkIqx5X1.js";import{t as N}from"./clock-DIjv9Rh6.js";import{t as P}from"./download-BmQLXojU.js";import{t as F}from"./hash-B61j4cgz.js";import{t as I}from"./info-CDi6ZfZf.js";import{t as L}from"./languages-p0PeYqme.js";import{t as R}from"./loader-circle-BWTf1Yce.js";import{a as z,i as B,n as V,o as te,r as ne,t as re}from"./pagination-BodQ3KsQ.js";import{t as ie}from"./palette-CBVqiEiY.js";import{t as ae}from"./paperclip-C5ucVDdU.js";import{t as oe}from"./pause-DEsHu_JX.js";import{t as se}from"./play-XZGUGKIJ.js";import{t as ce}from"./rotate-cw-DZrl6qQ6.js";import{t as le}from"./trash-2-CUcSh2xz.js";import{t as ue}from"./triangle-alert-fl0O4ttl.js";import{t as de}from"./video-D2H2yrK5.js";import{t as H}from"./wand-sparkles-C9xUdsPZ.js";import{$r as fe,Ga as U,Ja as W,Wa as pe,ci as me,fi as he,ii as ge,mi as _e,ni as ve,oi as ye,ri as be,ti as xe,ui as Se}from"./constants-CspFM8fh.js";import{Cr as G,D as K,Dr as q,Er as Ce,Fi as we,Ha as Te,Ia as Ee,Li as J,Or as De,Sr as Y,T as Oe,Xi as ke,ct as Ae,ia as je,li as Me,oi as Ne,to as X,tt as Pe,wr as Fe}from"./index-Bk9SKIXV.js";import{t as Ie}from"./CopyToClipboard-CIB9LY9Y.js";import{t as Le}from"./ReportButton-D3eba7A1.js";import{t as Re}from"./FilePreview-_7yUZ2m8.js";import{t as ze}from"./ImagePreview-Dq6UkYX8.js";import{n as Be}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ve}from"./ServicePricingSummary-N2X5DfKj.js";import{t as He}from"./AudioPreview-fEc2Zd45.js";import{t as Ue}from"./VideoPlayer-BNtDhrpR.js";import{t as We}from"./VideoPreview-K60Fueap.js";import{t as Ge}from"./ScenarioPaymentMode-BwoqFZco.js";import{t as Ke}from"./ApiCodeButton-C5tBSXac.js";import{t as qe}from"./BotPlaceholder-7Rci0gLD.js";import{t as Je}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ye}from"./ShowcaseResultTabs-Bx16-8QM.js";import{t as Xe}from"./showcaseRecreateMixin-C0UnaxsG.js";import{n as Ze,t as Qe}from"./generationInput-VbA_cpqx.js";var $e=b({name:`LayoutMaestro`,components:{MagicIcon:H,ElDrawer:k,ElButton:X},mixins:[Be]}),et={class:`main flex flex-row flex-1`},tt={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)]`},nt={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function rt(t,n,r,i,o,c){let l=u(`magic-icon`),d=u(`el-button`),m=u(`el-drawer`);return y(),s(`div`,et,[e(`div`,tt,[p(t.$slots,`config`,{},void 0,!0)]),e(`div`,nt,[p(t.$slots,`result`,{},void 0,!0)]),f(a(d,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:h(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[ee,!t.tasksEmpty]]),a(m,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:h(()=>[p(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var it=K($e,[[`render`,rt],[`__scopeId`,`data-v-43f3f7f4`]]),at=b({name:`MaestroFileUrlsInput`,components:{AttachmentIcon:ae,ElUpload:w,ElButton:X},mixins:[Ae,Pe],data(){return{fileList:[],uploadUrl:Ee()+`/api/v1/files/`,MAESTRO_FILE_ACCEPT:Se,MAESTRO_FILE_LIMIT:20}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},value(){return this.$store.state.maestro?.config?.file_urls||[]}},watch:{value:{immediate:!0,handler(e){let t=new Map(this.fileList.map(e=>[e?.response?.file_url||e.url,e])),n=e.map(e=>t.get(e)||{name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}}),r=this.fileList.filter(e=>!(e?.response?.file_url||e.url));this.fileList=[...n,...r]}}},methods:{onExceed(){O.warning(this.$t(`maestro.message.uploadExceed`))},onError(){O.error(this.$t(`maestro.message.uploadError`))},onChange(){let e=this.fileList.map(e=>e?.response?.file_url||e.url).filter(e=>!!e);this.$store.commit(`maestro/setConfig`,{...this.$store.state.maestro?.config,file_urls:e})}}});function ot(e,t,n,o,c,l){let d=u(`attachment-icon`),f=u(`el-button`),p=u(`el-upload`);return y(),s(`div`,null,[a(p,{ref:`uploader`,"file-list":e.fileList,"onUpdate:fileList":t[0]||=t=>e.fileList=t,accept:e.MAESTRO_FILE_ACCEPT,name:`file`,class:`w-full`,limit:e.MAESTRO_FILE_LIMIT,multiple:!0,"before-upload":e.beforeUploadSizeGuard,action:e.uploadUrl,headers:e.headers,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onChange,"on-remove":e.onChange},{default:h(()=>[a(f,{size:`small`,round:``},{default:h(()=>[a(d,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`maestro.button.uploadFiles`)),1)]),_:1})]),_:1},8,[`file-list`,`accept`,`limit`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])])}var st=K(at,[[`render`,ot]]),ct=.7;function Z(e){return Math.min(300,Math.max(5,typeof e==`number`&&Number.isFinite(e)?Math.round(e):30))}function lt(e){return Number((Z(e)*ct).toFixed(2))}var ut={"9:16":{width:15,height:26},"16:9":{width:26,height:15},"1:1":{width:20,height:20}},dt=b({name:`ConfigPanel`,components:{MagicIcon:H,ElButton:X,ElSelect:S,ElOption:C,ElInputNumber:A,ElAlert:E,ElSwitch:j,InfoIcon:z,PauseIcon:oe,PlayIcon:se,PromptTextarea:B,FileUrlsInput:st,ScenarioPaymentMode:Ge,ServicePricingSummary:Ve},emits:[`generate`],data(){return{MAESTRO_MIN_DURATION:5,MAESTRO_MAX_DURATION:300,MAESTRO_ALLOWED_SCENARIOS:xe,MAESTRO_SCENARIO_THUMBNAILS:he,MAESTRO_ALLOWED_STYLES:ve,MAESTRO_ALLOWED_VOICES:be,playing:!1,audioEl:null,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.maestro?.config},service(){return this.$store.state.maestro?.service},ratioOptions(){return fe.map(e=>({value:e,...ut[e]??{width:20,height:20}}))},isRemixing(){let e=this.config?.action;return!!e&&e!==`generate`&&!!this.config?.ref_task_id},refTaskId(){return this.config?.ref_task_id},needsRequiredUpload(){if(!this.scenarioCustomizationEnabled)return!1;let e=this.config?.scenario;if(!e||!_e.includes(e))return!1;let t=this.config?.file_urls||[];return e===`captions`?!t.some(e=>W(e)):!t.some(e=>U(e))},canGenerate(){return Qe(`maestro`,Y(this.config))&&!this.needsRequiredUpload},prompt:{get(){return this.config?.prompt},set(e){this.update({prompt:e})}},langs:{get(){return q(this.config?.langs)},set(e){this.update({langs:q(e)})}},languageOptions(){return Ce(this.$i18n.locale)},primaryLanguage:{get(){return this.langs[0]||ye[0]},set(e){this.update({langs:De(this.langs,e)})}},estimatedCredits(){return lt(this.duration||30)},aspect:{get(){return this.config?.aspect},set(e){this.update({aspect:e})}},duration:{get(){return this.config?.duration},set(e){this.update({duration:Z(e)})}},scenarioCustomizationEnabled:{get(){return this.config?.scenario_customization_enabled??!1},set(e){this.update({scenario_customization_enabled:e})}},styleCustomizationEnabled:{get(){return this.config?.style_customization_enabled??!1},set(e){this.update({style_customization_enabled:e})}},voiceCustomizationEnabled:{get(){return this.config?.voice_customization_enabled??!1},set(e){e||this.stopSample(),this.update({voice_customization_enabled:e})}},scenario:{get(){return this.config?.scenario},set(e){this.update({scenario:e})}},style:{get(){return this.config?.style},set(e){let t=e?.trim();this.update({style:!t||t.toLowerCase()===`auto`?me:t})}},voice:{get(){return this.config?.voice},set(e){this.stopSample(),this.update({voice:e||`warm-female`})}},currentSample(){return be.find(e=>e.key===this.voice)?.sample},walletMode(){return we()&&J(`maestro`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},voiceCustomizationEnabled(e){e||this.stopSample()},voice(){this.stopSample()}},mounted(){let e=q(this.config?.langs);this.update({action:this.config?.action??`generate`,langs:e,aspect:this.config?.aspect??`9:16`,duration:Z(this.config?.duration),scenario:this.config?.scenario||`narrated`})},beforeUnmount(){this.stopSample(),window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=J(`maestro`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=J(`maestro`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await G.quote(Y(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},update(e){this.$store.commit(`maestro/setConfig`,{...this.config,...e})},onClearRemix(){this.update({action:ge,ref_task_id:void 0})},onToggleSample(){let e=this.currentSample;if(e){if(this.audioEl||(this.audioEl=d(new Audio),this.audioEl.addEventListener(`ended`,()=>{this.playing=!1})),this.playing){this.audioEl.pause(),this.playing=!1;return}this.audioEl.src!==e&&(this.audioEl.src=e),this.audioEl.currentTime=0,this.audioEl.play().then(()=>{this.playing=!0}).catch(()=>{this.playing=!1})}},stopSample(){this.audioEl&&(this.audioEl.pause(),this.audioEl.currentTime=0),this.playing=!1},onGenerate(){this.$emit(`generate`)}}}),ft={class:`flex flex-col h-full`},pt={class:`flex-1 overflow-y-auto p-5`},mt={class:`text-xs mb-1`},ht={class:`field-block mb-5`},gt={class:`field-head`},_t={class:`field-title font-bold`},vt={class:`field-block mb-5`},yt={class:`field-head`},bt={class:`field-title font-bold`},xt={class:`field-block mb-5`},St={class:`field-head`},Ct={class:`field-title font-bold`},wt=[`aria-label`],Tt=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],Et={class:`ratio-preview`},Dt={class:`ratio-name`},Ot={class:`field-row mb-4`},kt={class:`field-head`},At={class:`field-title font-bold`},jt={class:`custom-field`},Mt={class:`custom-field-header mb-2`},Nt={class:`field-head`},Pt={class:`field-title font-bold`},Ft=[`aria-label`,`aria-disabled`],It=[`aria-checked`,`aria-disabled`,`aria-label`,`tabindex`,`onClick`,`onKeydown`],Lt={class:`scenario-thumb`},Rt=[`src`,`alt`],zt={class:`scenario-name`},Bt={class:`custom-field`},Vt={class:`custom-field-header mb-2`},Ht={class:`field-head`},Ut={class:`field-title font-bold`},Wt={class:`custom-field`},Gt={class:`custom-field-header mb-2`},Kt={class:`field-head`},qt={class:`field-title font-bold`},Jt={class:`voice-row`},Yt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Xt(d,f,p,v,ee,b){let x=u(`magic-icon`),S=u(`el-button`),C=u(`el-alert`),w=u(`prompt-textarea`),T=u(`info-icon`),E=u(`file-urls-input`),D=u(`el-option`),O=u(`el-select`),k=u(`el-input-number`),A=u(`el-switch`),j=u(`pause-icon`),M=u(`play-icon`),N=u(`scenario-payment-mode`),P=u(`service-pricing-summary`);return y(),s(`div`,ft,[e(`div`,pt,[d.isRemixing?(y(),m(C,{key:0,closable:!1,type:`info`,class:`mb-5`},{default:h(()=>[e(`p`,mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`maestro.name.remixing`))+`: `+i(d.refTaskId),1)]),a(S,{size:`small`,text:``,onClick:d.onClearRemix},{default:h(()=>[r(i(d.$t(`maestro.button.cancelRemix`)),1)]),_:1},8,[`onClick`])]),_:1})):o(``,!0),a(w,{modelValue:d.prompt,"onUpdate:modelValue":f[0]||=e=>d.prompt=e,class:`mb-5`,title:d.$t(`maestro.name.prompt`),info:d.$t(`maestro.description.prompt`),placeholder:d.$t(`maestro.placeholder.prompt`),"min-rows":6},null,8,[`modelValue`,`title`,`info`,`placeholder`]),e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(d.$t(`maestro.name.files`)),1),a(T,{content:d.$t(`maestro.description.files`),class:`ml-1`},null,8,[`content`])]),a(E)]),e(`div`,vt,[e(`div`,yt,[e(`h2`,bt,i(d.$t(`maestro.name.langs`)),1),a(T,{content:d.$t(`maestro.description.langs`),class:`ml-1`},null,8,[`content`])]),a(O,{modelValue:d.primaryLanguage,"onUpdate:modelValue":f[1]||=e=>d.primaryLanguage=e,class:`w-full`,"aria-label":d.$t(`maestro.name.langs`)},{default:h(()=>[(y(!0),s(l,null,_(d.languageOptions,e=>(y(),m(D,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`aria-label`])]),e(`div`,xt,[e(`div`,St,[e(`h2`,Ct,i(d.$t(`maestro.name.aspect`)),1)]),e(`div`,{class:`ratio-items`,role:`radiogroup`,"aria-label":d.$t(`maestro.name.aspect`)},[(y(!0),s(l,null,_(d.ratioOptions,r=>(y(),s(`div`,{key:r.value,class:n([`ratio-item`,{active:d.aspect===r.value}]),role:`radio`,"aria-checked":d.aspect===r.value,"aria-label":r.value,tabindex:`0`,onClick:e=>d.aspect=r.value,onKeydown:[c(t(e=>d.aspect=r.value,[`prevent`]),[`enter`]),c(t(e=>d.aspect=r.value,[`prevent`]),[`space`])]},[e(`div`,Et,[e(`div`,{class:`ratio-rect`,style:g({width:r.width+`px`,height:r.height+`px`})},null,4)]),e(`p`,Dt,i(r.value),1)],42,Tt))),128))],8,wt)]),e(`div`,Ot,[e(`div`,kt,[e(`h2`,At,i(d.$t(`maestro.name.duration`)),1),a(T,{content:d.$t(`maestro.description.duration`),class:`ml-1`},null,8,[`content`])]),a(k,{modelValue:d.duration,"onUpdate:modelValue":f[2]||=e=>d.duration=e,class:`field-control`,min:d.MAESTRO_MIN_DURATION,max:d.MAESTRO_MAX_DURATION,step:5,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`])]),e(`div`,jt,[e(`div`,Mt,[e(`div`,Nt,[e(`h2`,Pt,i(d.$t(`maestro.name.customizeScenario`)),1),a(T,{content:d.$t(`maestro.description.scenario`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.scenarioCustomizationEnabled,"onUpdate:modelValue":f[3]||=e=>d.scenarioCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeScenario`)},null,8,[`modelValue`,`aria-label`])]),e(`div`,{class:n([`scenario-cards`,{"is-disabled":!d.scenarioCustomizationEnabled}]),role:`radiogroup`,"aria-label":d.$t(`maestro.name.scenario`),"aria-disabled":!d.scenarioCustomizationEnabled},[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_SCENARIOS,r=>(y(),s(`div`,{key:r,class:n([`scenario-card`,{active:d.scenarioCustomizationEnabled&&d.scenario===r,disabled:!d.scenarioCustomizationEnabled}]),role:`radio`,"aria-checked":d.scenarioCustomizationEnabled&&d.scenario===r,"aria-disabled":!d.scenarioCustomizationEnabled,"aria-label":d.$t(`maestro.option.scenario.${r}`),tabindex:d.scenarioCustomizationEnabled?0:-1,onClick:e=>d.scenarioCustomizationEnabled&&(d.scenario=r),onKeydown:[c(t(e=>d.scenarioCustomizationEnabled&&(d.scenario=r),[`prevent`]),[`enter`]),c(t(e=>d.scenarioCustomizationEnabled&&(d.scenario=r),[`prevent`]),[`space`])]},[e(`div`,Lt,[e(`img`,{src:d.MAESTRO_SCENARIO_THUMBNAILS[r],alt:d.$t(`maestro.option.scenario.${r}`),loading:`lazy`},null,8,Rt)]),e(`p`,zt,i(d.$t(`maestro.option.scenario.${r}`)),1)],42,It))),128))],10,Ft),d.needsRequiredUpload?(y(),m(C,{key:0,title:d.$t(d.scenario===`avatar`?`maestro.message.avatarNeedsImage`:`maestro.message.captionsNeedVideo`),type:`warning`,closable:!1,"show-icon":``,class:`mt-2`},null,8,[`title`])):o(``,!0)]),e(`div`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`h2`,Ut,i(d.$t(`maestro.name.customizeStyle`)),1),a(T,{content:d.$t(`maestro.description.style`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.styleCustomizationEnabled,"onUpdate:modelValue":f[4]||=e=>d.styleCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeStyle`)},null,8,[`modelValue`,`aria-label`])]),a(O,{modelValue:d.style,"onUpdate:modelValue":f[5]||=e=>d.style=e,class:`w-full`,filterable:``,"allow-create":``,"default-first-option":``,disabled:!d.styleCustomizationEnabled,"aria-label":d.$t(`maestro.name.customizeStyle`),placeholder:d.$t(`maestro.placeholder.select`)},{default:h(()=>[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_STYLES,e=>(y(),m(D,{key:e,label:d.$t(`maestro.option.style.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`disabled`,`aria-label`,`placeholder`])]),e(`div`,Wt,[e(`div`,Gt,[e(`div`,Kt,[e(`h2`,qt,i(d.$t(`maestro.name.customizeVoice`)),1),a(T,{content:d.$t(`maestro.description.voice`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.voiceCustomizationEnabled,"onUpdate:modelValue":f[6]||=e=>d.voiceCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeVoice`)},null,8,[`modelValue`,`aria-label`])]),e(`div`,Jt,[a(O,{modelValue:d.voice,"onUpdate:modelValue":f[7]||=e=>d.voice=e,class:`voice-select`,disabled:!d.voiceCustomizationEnabled,"aria-label":d.$t(`maestro.name.customizeVoice`),placeholder:d.$t(`maestro.placeholder.select`)},{default:h(()=>[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_VOICES,e=>(y(),m(D,{key:e.key,label:d.$t(`maestro.option.voice.${e.key}`),value:e.key},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`disabled`,`aria-label`,`placeholder`]),a(S,{class:`voice-play`,disabled:!d.voiceCustomizationEnabled||!d.currentSample,title:d.$t(`maestro.button.preview`),"aria-label":d.$t(`maestro.button.preview`),onClick:d.onToggleSample},{default:h(()=>[d.playing?(y(),m(j,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(y(),m(M,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])])])]),e(`div`,Yt,[a(N,{scenario:`maestro`}),d.walletMode?o(``,!0):(y(),m(P,{key:0,value:d.estimatedCredits,service:d.service},null,8,[`value`,`service`])),a(S,{type:`primary`,class:`btn w-full`,round:``,disabled:!d.canGenerate,onClick:d.onGenerate},{default:h(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`maestro.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Zt=K(dt,[[`render`,Xt],[`__scopeId`,`data-v-d9acbf89`]]),Qt=50,$t=1e4,Q=new Map,$=new Map,en=(e,t)=>{if(Q.set(e,t),Q.size>Qt){let e=Q.keys().next().value;e&&Q.delete(e)}};async function tn(e,t){let n=`${t.credentialKey}:${e}`,r=Q.get(n);if(r)return r;let i=$.get(n);if(i)return i.promise;let a=new AbortController,o,s={controller:a,promise:void 0},c=G.task(e,{token:t.token,signal:a.signal}).then(({data:e})=>{if(!a.signal.aborted)return en(n,e),e}).catch(t=>{a.signal.aborted||console.warn(`failed to load maestro remix reference task`,e,t)}),l=new Promise(e=>{o=window.setTimeout(()=>{a.abort(),e(void 0)},$t)});return s.promise=Promise.race([c,l]).finally(()=>{o!==void 0&&window.clearTimeout(o),$.get(n)===s&&$.delete(n)}),$.set(n,s),s.promise}var nn=[`plan`,`source`,`voice`,`compose`,`render`,`deliver`];function rn(e){if(!e)return-1;let t=e.toLowerCase(),n=nn.indexOf(t);return n>=0?n:/plan|storyboard|script|brief/.test(t)?0:/source|search|image|photo|asset|media/.test(t)?1:/voice|tts|audio|narrat/.test(t)?2:/compose|composit|build|layout|scene/.test(t)?3:/render|encode/.test(t)?4:/deliver|upload|cdn|complete|done|finish/.test(t)?5:-1}var an=b({name:`ProgressSteps`,components:{ElIcon:x,Loading:R,Check:M},props:{modelValue:{type:Object,required:!0}},computed:{currentIndex(){let e=this.modelValue?.response?.data?.progress||[],t=-1;for(let n of e)t=Math.max(t,rn(n?.stage));return t=Math.max(t,rn(this.modelValue?.response?.data?.stage)),Math.max(t,0)},detail(){let e=this.modelValue?.response?.data;if(e?.activity)return e.activity;let t=e?.progress||[];for(let e=t.length-1;e>=0;e--)if(t[e]?.message)return t[e]?.message},steps(){return nn.map(e=>({key:e}))}},methods:{stateOf(e){let t=this.currentIndex;return e<t?`done`:e===t?`active`:`pending`}}}),on={class:`progress-steps`,"aria-live":`polite`},sn=[`aria-current`],cn={class:`ico`},ln={class:`txt`},un={key:0,class:`detail`};function dn(t,r,c,d,f,p){let g=u(`loading`),v=u(`el-icon`),ee=u(`check`);return y(),s(`div`,on,[(y(!0),s(l,null,_(t.steps,(r,c)=>(y(),s(`div`,{key:r.key,class:n([`step`,t.stateOf(c)]),"aria-current":c===t.currentIndex?`step`:void 0},[e(`span`,cn,[c===t.currentIndex?(y(),m(v,{key:0,class:`is-loading`,"aria-label":t.$t(`maestro.step.${r.key}`)},{default:h(()=>[a(g,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`])):c<t.currentIndex?(y(),m(v,{key:1},{default:h(()=>[a(ee,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):o(``,!0)]),e(`span`,ln,i(t.$t(`maestro.step.${r.key}`)),1)],10,sn))),128)),t.detail?(y(),s(`p`,un,i(t.detail),1)):o(``,!0)])}var fn=K(an,[[`render`,dn],[`__scopeId`,`data-v-8a883977`]]),pn=[`succeeded`,`failed`],mn=[1e3,3e3],hn=b({name:`TaskPreview`,components:{DeleteIcon:le,ElTooltip:T,ChannelIcon:F,DownloadIcon:P,InfoIcon:I,LanguageIcon:L,MagicIcon:H,RedoIcon:ce,TimeIcon:N,WarningIcon:ue,CopyToClipboard:Ie,ElAlert:E,VideoPlayer:Ue,ElButton:X,ApiCodeButton:Ke,ReportButton:Le,ImagePreview:ze,AudioPreview:He,VideoPreview:We,FilePreview:Re,ProgressSteps:fn},props:{modelValue:{type:Object,required:!0}},data(){return{fetchedReferenceTask:void 0,fetchedReferenceKey:void 0,referenceLoadAttempt:0,referenceLoadFailed:!1,referenceLoadTimer:void 0,referenceLoadVersion:0}},computed:{variants(){return this.modelValue?.response?.data?.variants||[]},files(){let e=[...this.modelValue?.request?.file_urls||[]];if(this.referenceTaskId)for(let t of this.referenceTask?.response?.data?.variants||[])t.output_url&&e.push(t.output_url);return[...new Set(e)].filter(e=>!!e).map(e=>{let t=e.split(`?`)[0].split(`#`)[0],n=U(t)?`image`:W(t)?`video`:pe(t)?`audio`:`file`;return{url:e,name:this.fileName(t),kind:n}})},referenceTaskId(){let e=this.modelValue?.request;return e?.action===`remix`?e?.ref_task_id:void 0},referenceLoadKey(){let e=this.$store.state.maestro?.credential,t=e?.token;if(!(!this.referenceTaskId||!t))return JSON.stringify([this.referenceTaskId,e?.id||e?.user_id||t,t])},referenceTask(){if(this.referenceTaskId)return this.$store.state.maestro?.tasks?.items?.find(e=>e.id===this.referenceTaskId)||(this.fetchedReferenceKey===this.referenceLoadKey?this.fetchedReferenceTask:void 0)},isTerminal(){return pn.includes(this.modelValue?.status||``)},traceId(){return this.modelValue?.trace_id||this.modelValue?.response?.trace_id},progressPct(){let e=this.modelValue?.response?.data?.progress,t=e?.length?e[e.length-1]:void 0;return typeof t?.pct==`number`?t.pct:void 0},progressText(){return this.progressPct===void 0?this.statusLabel:`${this.progressPct}%`},statusLabel(){let e=`maestro.status.${this.modelValue?.status||`pending`}`,t=this.$t(e);return t===e?this.$t(`maestro.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message},requestParams(){let e=this.modelValue?.request;if(!e)return[];let t=[];return e.action&&t.push({icon:d(H),label:this.$t(`maestro.name.mode`),value:this.optionLabel(`maestro.option.action`,e.action)}),e.scenario&&t.push({icon:d(de),label:this.$t(`maestro.name.scenario`),value:this.optionLabel(`maestro.option.scenario`,e.scenario)}),e.style&&t.push({icon:d(ie),label:this.$t(`maestro.name.style`),value:this.optionLabel(`maestro.option.style`,e.style)}),e.aspect&&t.push({icon:d(te),label:this.$t(`maestro.name.aspect`),value:e.aspect}),e.duration&&t.push({icon:d(N),label:this.$t(`maestro.name.duration`),value:`${e.duration}s`}),e.langs?.length&&t.push({icon:d(L),label:this.$t(`maestro.name.langs`),value:e.langs.join(` · `)}),t}},watch:{referenceLoadKey:{immediate:!0,handler(e){this.resetReferenceLoad(),e&&!this.referenceTask&&this.loadReferenceTask(e)}}},beforeUnmount(){this.resetReferenceLoad()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Te.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`maestro/deleteTask`,{id:e}),O.success(this.$t(`common.message.deleteTaskSuccess`))}catch{O.error(this.$t(`common.message.deleteTaskFailed`))}}},resetReferenceLoad(){this.referenceLoadTimer!==void 0&&window.clearTimeout(this.referenceLoadTimer),this.referenceLoadTimer=void 0,this.referenceLoadVersion+=1,this.referenceLoadAttempt=0,this.referenceLoadFailed=!1,this.fetchedReferenceTask=void 0,this.fetchedReferenceKey=void 0},async loadReferenceTask(e){if(e!==this.referenceLoadKey||this.referenceTask)return;let t=this.$store.state.maestro?.credential,n=t?.token,r=this.referenceTaskId;if(!r||!n)return;let i=t?.id||t?.user_id||n,a=this.referenceLoadVersion;this.referenceLoadAttempt+=1;let o=await tn(r,{token:n,credentialKey:i});if(a!==this.referenceLoadVersion||e!==this.referenceLoadKey)return;if(o){this.fetchedReferenceTask=o,this.fetchedReferenceKey=e,this.referenceLoadFailed=!1;return}let s=mn[this.referenceLoadAttempt-1];s===void 0?this.referenceLoadFailed=!0:this.referenceLoadTimer=window.setTimeout(()=>{this.referenceLoadTimer=void 0,this.loadReferenceTask(e)},s)},retryReferenceTask(){let e=this.referenceLoadKey;this.resetReferenceLoad(),e&&this.loadReferenceTask(e)},optionLabel(e,t){let n=`${e}.${t}`,r=this.$t(n);return r===n?t:r},fileName(e){let t=e.substring(e.lastIndexOf(`/`)+1);try{return decodeURIComponent(t)||e}catch{return t||e}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)},onRemix(){if(!this.modelValue)return;let e=Fe(this.$store.state.maestro?.config,this.modelValue);this.$store.commit(`maestro/setConfig`,e),O.info(this.$t(`maestro.message.remixLoaded`))}}}),gn={class:`preview`},_n={class:`left`},vn={class:`main`},yn={class:`bot`},bn={class:`datetime`},xn=[`aria-label`],Sn={class:`info`},Cn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},wn=[`href`,`title`],Tn={key:1,class:`reference-load-failed flex items-center gap-1 mt-2 text-xs text-[var(--el-text-color-secondary)]`},En={key:2,class:`prompt mt-2`},Dn={key:0,class:`progress-pct`},On={key:0,class:`content`},kn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},An={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},jn={key:1,class:`content`},Mn={class:`text-xs text-[var(--el-text-color-secondary)] mb-1`},Nn={key:0},Pn={class:`operations`},Fn={key:0},In={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ln={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},zn={key:2,class:`content`},Bn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Hn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Un={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Wn(c,d,f,p,g,ee){let b=u(`capability-presentation`),x=u(`delete-icon`),S=u(`el-tooltip`),C=u(`image-preview`),w=u(`video-preview`),T=u(`audio-preview`),E=u(`file-preview`),D=u(`info-icon`),O=u(`redo-icon`),k=u(`el-button`),A=u(`progress-steps`),j=u(`magic-icon`),M=u(`copy-to-clipboard`),N=u(`channel-icon`),P=u(`el-alert`),F=u(`language-icon`),I=u(`video-player`),L=u(`download-icon`),R=u(`api-code-button`),z=u(`report-button`),B=u(`time-icon`),V=u(`warning-icon`);return y(),s(`div`,gn,[e(`div`,_n,[a(b,{capability:`maestro`,part:`avatar`,class:`avatar`})]),e(`div`,vn,[e(`div`,yn,[a(b,{capability:`maestro`,part:`name`}),e(`span`,bn,i(c.$dayjs.format(``+new Date(parseFloat((c.modelValue?.created_at||``).toString())*1e3))),1),a(S,{effect:`dark`,content:c.$t(`common.button.delete`),placement:`top`},{default:h(()=>[c.modelValue?.id?(y(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":c.$t(`common.button.delete`),onClick:d[0]||=t((...e)=>c.onDelete&&c.onDelete(...e),[`stop`])},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,xn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Sn,[c.files.length?(y(),s(`div`,Cn,[(y(!0),s(l,null,_(c.files,(e,t)=>(y(),s(l,{key:t},[e.kind===`image`?(y(),m(C,{key:0,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`])):e.kind===`video`?(y(),m(w,{key:1,url:e.url,name:e.name},null,8,[`url`,`name`])):e.kind===`audio`?(y(),m(T,{key:2,url:e.url,name:e.name},null,8,[`url`,`name`])):(y(),s(`a`,{key:3,href:e.url,title:e.name,target:`_blank`,rel:`noopener noreferrer`,class:`shrink-0 no-underline`},[a(E,{name:e.name,closable:!1},null,8,[`name`])],8,wn))],64))),128))])):o(``,!0),c.referenceLoadFailed&&c.referenceTaskId&&!c.referenceTask?(y(),s(`div`,Tn,[a(D,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(c.$t(`maestro.name.files`))+`: `+i(c.$t(`maestro.name.failure`)),1),a(k,{class:`reference-retry`,size:`small`,text:``,circle:``,title:c.$t(`codingBridge.session.retry`),"aria-label":c.$t(`codingBridge.session.retry`),onClick:c.retryReferenceTask},{default:h(()=>[a(O,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`aria-label`,`onClick`])])):o(``,!0),c.modelValue?.request?.prompt?(y(),s(`p`,En,[r(i(c.modelValue?.request?.prompt)+` `,1),c.isTerminal?o(``,!0):(y(),s(`span`,Dn,` · `+i(c.progressText),1))])):o(``,!0)]),c.isTerminal?o(``,!0):(y(),s(`div`,On,[a(P,{closable:!1,class:`mt-2 processing`},{default:h(()=>[a(A,{"model-value":c.modelValue},null,8,[`model-value`]),(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:n([`text-[var(--el-text-color-regular)] text-xs mb-2`,{"mt-3":t===0}])},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)],2))),128)),e(`p`,kn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(M,{content:c.modelValue?.id},null,8,[`content`])]),c.traceId?(y(),s(`p`,An,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(M,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])),c.modelValue?.response?.success===!0&&c.variants.length?(y(),s(`div`,jn,[(y(!0),s(l,null,_(c.variants,(t,n)=>(y(),s(`div`,{key:n,class:`mb-4`},[e(`p`,Mn,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.lang),1),t.title?(y(),s(`span`,Nn,` · `+i(t.title),1)):o(``,!0)]),t.output_url?(y(),m(I,{key:0,src:t.output_url},null,8,[`src`])):o(``,!0)]))),128)),e(`div`,Pn,[(y(!0),s(l,null,_(c.variants,(e,t)=>(y(),s(l,{key:t},[e.output_url?(y(),m(k,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:t=>c.onDownload(t,e.output_url)},{default:h(()=>[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.button.download`)),1),c.variants.length>1?(y(),s(`span`,Fn,` · `+i(e.lang),1)):o(``,!0)]),_:2},1032,[`onClick`])):o(``,!0)],64))),128)),a(k,{size:`small`,type:`primary`,class:`btn-action`,onClick:c.onRemix},{default:h(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.button.remix`)),1)]),_:1},8,[`onClick`]),a(R,{path:`/maestro/videos`,body:c.modelValue?.request},null,8,[`body`]),a(z,{service:`maestro`,"target-id":c.modelValue?.id,snapshot:{prompt:c.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(P,{closable:!1,class:`mt-2 success`},{default:h(()=>[(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)]))),128)),e(`p`,In,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(M,{content:c.modelValue?.id},null,8,[`content`])]),c.modelValue?.elapsed?(y(),s(`p`,Ln,[a(B,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.elapsed`))+`: `+i(c.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),c.traceId?(y(),s(`p`,Rn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(M,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),c.modelValue?.response?.success===!1?(y(),s(`div`,zn,[a(P,{closable:!1,class:`failure`},{template:h(()=>[a(V,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.failure`)),1)]),default:h(()=>[(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)]))),128)),e(`p`,Bn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(M,{content:c.modelValue?.id},null,8,[`content`])]),c.failureReason?(y(),s(`p`,Vn,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.failureReason`))+`: `+i(c.failureReason),1)])):o(``,!0),c.modelValue?.elapsed?(y(),s(`p`,Hn,[a(B,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.elapsed`))+`: `+i(c.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),c.traceId?(y(),s(`p`,Un,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(M,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Gn=b({name:`RecentPanel`,components:{TaskPreview:K(hn,[[`render`,Wn],[`__scopeId`,`data-v-ef9ae897`]]),NoTasks:ne,BotPlaceholder:qe,ScrollList:V},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.maestro?.tasks,items:this.$store.state.maestro?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Kn={key:0},qn={key:2,class:`w-full h-full flex items-center justify-center`};function Jn(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),p=u(`scroll-list`),g=u(`no-tasks`);return y(),s(l,null,[e.tasks?.items===void 0?(y(),s(`div`,Kn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(y(),m(p,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:h(()=>[(y(!0),s(l,null,_(e.tasks?.items,(e,t)=>(y(),m(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(y(),s(`div`,qn,[a(g)])):o(``,!0)],64)}var Yn=b({name:`MaestroIndex`,components:{ConfigPanel:Zt,Layout:it,RecentPanel:K(Gn,[[`render`,Jn]]),ShowcaseResultTabs:Ye},mixins:[Xe(`maestro`),Je(`maestro`,!1)],inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.maestro?.status?.getApplications===D.Request},tasksLoading(){return this.$store.state.maestro?.status?.getTasks===D.Request||this.fetchingTasks},credential(){return this.$store.state.maestro.credential},config(){return this.$store.state.maestro.config},tasks(){return this.$store.state.maestro.tasks},walletMode(){return we()&&J(`maestro`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`maestro/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await re({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.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(`maestro/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(`maestro/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=Y(this.config),t=Ze(`maestro`,e);if(t){O.error(this.$t(`common.message.${t}`));return}let n;if(this.walletMode){let t=this.getWalletContext();if(!t){O.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=G.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!je())return;let t=this.credential?.token;if(!t)return;n=G.generate(e,{token:t})}O.info(this.$t(`maestro.message.startingTask`)),ke(`maestro`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),O.success(this.$t(`maestro.message.startTaskSuccess`))}).catch(e=>{e instanceof Ne||Oe(e,`maestro`)||(this.walletMode?O.error(this.$t(`common.x402Scenario.paymentFailed`)):O.error(this.$t(`maestro.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Me(this.$wallet)},async confirmWalletPayment(e){return Te.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Xn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`showcase-result-tabs`),d=u(`layout`);return y(),m(d,null,{config:h(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:h(()=>[a(l,{service:`maestro`},{tasks:h(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Zn=K(Yn,[[`render`,Xn]]);export{Zn 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,S as c,T as l,at as u,bt as d,ht as f,it as p,j as m,mt as h,qt as g,rt as _,st as v,tt as y,x as ee,z as b}from"./vendor-chart-Dw-P17PN.js";import{F as x}from"./icon-CDmWyIgD.js";import{r as S,t as C}from"./select-Ctt4vMla.js";import{t as w}from"./upload-BG3x_JWJ.js";import{t as T}from"./tooltip-Co_mOTlo.js";import{t as E}from"./alert-BprQRUmf.js";import{_ as D,v as O}from"./vuex.esm-bundler-C-5WV-ta.js";import{t as k}from"./drawer-BaqojTRQ.js";import{t as A}from"./input-number-BmFOlu3s.js";import{t as j}from"./switch-DfKiiyLD.js";import{t as M}from"./check-CHq--2kK.js";import{t as N}from"./clock-CvHl_Vd7.js";import{t as P}from"./download-pMsno2DA.js";import{t as F}from"./hash-yia5yLmV.js";import{t as I}from"./info-DVNsJvAI.js";import{t as L}from"./languages-DX-qFZ5y.js";import{t as R}from"./loader-circle-VDhzM6Nn.js";import{a as z,i as B,n as V,o as te,r as ne,t as re}from"./pagination-uSk2V2K7.js";import{t as ie}from"./palette-Cw-HJS5z.js";import{t as ae}from"./paperclip-CSMkIW0R.js";import{t as oe}from"./pause-BYsZ80n3.js";import{t as se}from"./play-PlISts4C.js";import{t as ce}from"./rotate-cw-DIM3zleO.js";import{t as le}from"./trash-2-2Il_x-4b.js";import{t as ue}from"./triangle-alert-Dc39dkq0.js";import{t as de}from"./video-6ckJHXgu.js";import{t as H}from"./wand-sparkles-CdzPtG8R.js";import{$r as fe,Ga as U,Ja as W,Wa as pe,ci as me,fi as he,ii as ge,mi as _e,ni as ve,oi as ye,ri as be,ti as xe,ui as Se}from"./constants-CspFM8fh.js";import{Cr as G,D as K,Dr as q,Er as Ce,Hi as we,Or as Te,Sr as J,T as Ee,Ua as De,Wi as Y,Ya as Oe,co as X,ct as ke,da as Ae,li as je,oi as Me,ra as Ne,tt as Pe,wr as Fe}from"./index-C8uXmX2U.js";import{t as Ie}from"./CopyToClipboard-CdXnxkau.js";import{t as Le}from"./ReportButton-CpSn2HJv.js";import{t as Re}from"./FilePreview-BpPQ5OAR.js";import{t as ze}from"./ImagePreview-BOxOkmuq.js";import{n as Be}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ve}from"./ServicePricingSummary-D4J-WJ1t.js";import{t as He}from"./AudioPreview-h4P2x5TL.js";import{t as Ue}from"./VideoPlayer-B43pPHVA.js";import{t as We}from"./VideoPreview-DxrhYEOD.js";import{t as Ge}from"./ScenarioPaymentMode-Bfxf8Ufv.js";import{t as Ke}from"./ApiCodeButton-C7SPMZJ4.js";import{t as qe}from"./BotPlaceholder-BBI_oSgE.js";import{t as Je}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ye}from"./ShowcaseResultTabs-Di_5PzXP.js";import{t as Xe}from"./showcaseRecreateMixin-1te_SCEr.js";import{n as Ze,t as Qe}from"./generationInput-VbA_cpqx.js";var $e=b({name:`LayoutMaestro`,components:{MagicIcon:H,ElDrawer:k,ElButton:X},mixins:[Be]}),et={class:`main flex flex-row flex-1`},tt={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)]`},nt={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function rt(t,n,r,i,o,c){let l=u(`magic-icon`),d=u(`el-button`),m=u(`el-drawer`);return y(),s(`div`,et,[e(`div`,tt,[p(t.$slots,`config`,{},void 0,!0)]),e(`div`,nt,[p(t.$slots,`result`,{},void 0,!0)]),f(a(d,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:h(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[ee,!t.tasksEmpty]]),a(m,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:h(()=>[p(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var it=K($e,[[`render`,rt],[`__scopeId`,`data-v-43f3f7f4`]]),at=b({name:`MaestroFileUrlsInput`,components:{AttachmentIcon:ae,ElUpload:w,ElButton:X},mixins:[ke,Pe],data(){return{fileList:[],uploadUrl:De()+`/api/v1/files/`,MAESTRO_FILE_ACCEPT:Se,MAESTRO_FILE_LIMIT:20}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},value(){return this.$store.state.maestro?.config?.file_urls||[]}},watch:{value:{immediate:!0,handler(e){let t=new Map(this.fileList.map(e=>[e?.response?.file_url||e.url,e])),n=e.map(e=>t.get(e)||{name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}}),r=this.fileList.filter(e=>!(e?.response?.file_url||e.url));this.fileList=[...n,...r]}}},methods:{onExceed(){O.warning(this.$t(`maestro.message.uploadExceed`))},onError(){O.error(this.$t(`maestro.message.uploadError`))},onChange(){let e=this.fileList.map(e=>e?.response?.file_url||e.url).filter(e=>!!e);this.$store.commit(`maestro/setConfig`,{...this.$store.state.maestro?.config,file_urls:e})}}});function ot(e,t,n,o,c,l){let d=u(`attachment-icon`),f=u(`el-button`),p=u(`el-upload`);return y(),s(`div`,null,[a(p,{ref:`uploader`,"file-list":e.fileList,"onUpdate:fileList":t[0]||=t=>e.fileList=t,accept:e.MAESTRO_FILE_ACCEPT,name:`file`,class:`w-full`,limit:e.MAESTRO_FILE_LIMIT,multiple:!0,"before-upload":e.beforeUploadSizeGuard,action:e.uploadUrl,headers:e.headers,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onChange,"on-remove":e.onChange},{default:h(()=>[a(f,{size:`small`,round:``},{default:h(()=>[a(d,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`maestro.button.uploadFiles`)),1)]),_:1})]),_:1},8,[`file-list`,`accept`,`limit`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])])}var st=K(at,[[`render`,ot]]),ct=.7;function Z(e){return Math.min(300,Math.max(5,typeof e==`number`&&Number.isFinite(e)?Math.round(e):30))}function lt(e){return Number((Z(e)*ct).toFixed(2))}var ut={"9:16":{width:15,height:26},"16:9":{width:26,height:15},"1:1":{width:20,height:20}},dt=b({name:`ConfigPanel`,components:{MagicIcon:H,ElButton:X,ElSelect:S,ElOption:C,ElInputNumber:A,ElAlert:E,ElSwitch:j,InfoIcon:z,PauseIcon:oe,PlayIcon:se,PromptTextarea:B,FileUrlsInput:st,ScenarioPaymentMode:Ge,ServicePricingSummary:Ve},emits:[`generate`],data(){return{MAESTRO_MIN_DURATION:5,MAESTRO_MAX_DURATION:300,MAESTRO_ALLOWED_SCENARIOS:xe,MAESTRO_SCENARIO_THUMBNAILS:he,MAESTRO_ALLOWED_STYLES:ve,MAESTRO_ALLOWED_VOICES:be,playing:!1,audioEl:null,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.maestro?.config},service(){return this.$store.state.maestro?.service},ratioOptions(){return fe.map(e=>({value:e,...ut[e]??{width:20,height:20}}))},isRemixing(){let e=this.config?.action;return!!e&&e!==`generate`&&!!this.config?.ref_task_id},refTaskId(){return this.config?.ref_task_id},needsRequiredUpload(){if(!this.scenarioCustomizationEnabled)return!1;let e=this.config?.scenario;if(!e||!_e.includes(e))return!1;let t=this.config?.file_urls||[];return e===`captions`?!t.some(e=>W(e)):!t.some(e=>U(e))},canGenerate(){return Qe(`maestro`,J(this.config))&&!this.needsRequiredUpload},prompt:{get(){return this.config?.prompt},set(e){this.update({prompt:e})}},langs:{get(){return q(this.config?.langs)},set(e){this.update({langs:q(e)})}},languageOptions(){return Ce(this.$i18n.locale)},primaryLanguage:{get(){return this.langs[0]||ye[0]},set(e){this.update({langs:Te(this.langs,e)})}},estimatedCredits(){return lt(this.duration||30)},aspect:{get(){return this.config?.aspect},set(e){this.update({aspect:e})}},duration:{get(){return this.config?.duration},set(e){this.update({duration:Z(e)})}},scenarioCustomizationEnabled:{get(){return this.config?.scenario_customization_enabled??!1},set(e){this.update({scenario_customization_enabled:e})}},styleCustomizationEnabled:{get(){return this.config?.style_customization_enabled??!1},set(e){this.update({style_customization_enabled:e})}},voiceCustomizationEnabled:{get(){return this.config?.voice_customization_enabled??!1},set(e){e||this.stopSample(),this.update({voice_customization_enabled:e})}},scenario:{get(){return this.config?.scenario},set(e){this.update({scenario:e})}},style:{get(){return this.config?.style},set(e){let t=e?.trim();this.update({style:!t||t.toLowerCase()===`auto`?me:t})}},voice:{get(){return this.config?.voice},set(e){this.stopSample(),this.update({voice:e||`warm-female`})}},currentSample(){return be.find(e=>e.key===this.voice)?.sample},walletMode(){return we()&&Y(`maestro`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},voiceCustomizationEnabled(e){e||this.stopSample()},voice(){this.stopSample()}},mounted(){let e=q(this.config?.langs);this.update({action:this.config?.action??`generate`,langs:e,aspect:this.config?.aspect??`9:16`,duration:Z(this.config?.duration),scenario:this.config?.scenario||`narrated`})},beforeUnmount(){this.stopSample(),window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=Y(`maestro`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=Y(`maestro`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await G.quote(J(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},update(e){this.$store.commit(`maestro/setConfig`,{...this.config,...e})},onClearRemix(){this.update({action:ge,ref_task_id:void 0})},onToggleSample(){let e=this.currentSample;if(e){if(this.audioEl||(this.audioEl=d(new Audio),this.audioEl.addEventListener(`ended`,()=>{this.playing=!1})),this.playing){this.audioEl.pause(),this.playing=!1;return}this.audioEl.src!==e&&(this.audioEl.src=e),this.audioEl.currentTime=0,this.audioEl.play().then(()=>{this.playing=!0}).catch(()=>{this.playing=!1})}},stopSample(){this.audioEl&&(this.audioEl.pause(),this.audioEl.currentTime=0),this.playing=!1},onGenerate(){this.$emit(`generate`)}}}),ft={class:`flex flex-col h-full`},pt={class:`flex-1 overflow-y-auto p-5`},mt={class:`text-xs mb-1`},ht={class:`field-block mb-5`},gt={class:`field-head`},_t={class:`field-title font-bold`},vt={class:`field-block mb-5`},yt={class:`field-head`},bt={class:`field-title font-bold`},xt={class:`field-block mb-5`},St={class:`field-head`},Ct={class:`field-title font-bold`},wt=[`aria-label`],Tt=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],Et={class:`ratio-preview`},Dt={class:`ratio-name`},Ot={class:`field-row mb-4`},kt={class:`field-head`},At={class:`field-title font-bold`},jt={class:`custom-field`},Mt={class:`custom-field-header mb-2`},Nt={class:`field-head`},Pt={class:`field-title font-bold`},Ft=[`aria-label`,`aria-disabled`],It=[`aria-checked`,`aria-disabled`,`aria-label`,`tabindex`,`onClick`,`onKeydown`],Lt={class:`scenario-thumb`},Rt=[`src`,`alt`],zt={class:`scenario-name`},Bt={class:`custom-field`},Vt={class:`custom-field-header mb-2`},Ht={class:`field-head`},Ut={class:`field-title font-bold`},Wt={class:`custom-field`},Gt={class:`custom-field-header mb-2`},Kt={class:`field-head`},qt={class:`field-title font-bold`},Jt={class:`voice-row`},Yt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Xt(d,f,p,v,ee,b){let x=u(`magic-icon`),S=u(`el-button`),C=u(`el-alert`),w=u(`prompt-textarea`),T=u(`info-icon`),E=u(`file-urls-input`),D=u(`el-option`),O=u(`el-select`),k=u(`el-input-number`),A=u(`el-switch`),j=u(`pause-icon`),M=u(`play-icon`),N=u(`scenario-payment-mode`),P=u(`service-pricing-summary`);return y(),s(`div`,ft,[e(`div`,pt,[d.isRemixing?(y(),m(C,{key:0,closable:!1,type:`info`,class:`mb-5`},{default:h(()=>[e(`p`,mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`maestro.name.remixing`))+`: `+i(d.refTaskId),1)]),a(S,{size:`small`,text:``,onClick:d.onClearRemix},{default:h(()=>[r(i(d.$t(`maestro.button.cancelRemix`)),1)]),_:1},8,[`onClick`])]),_:1})):o(``,!0),a(w,{modelValue:d.prompt,"onUpdate:modelValue":f[0]||=e=>d.prompt=e,class:`mb-5`,title:d.$t(`maestro.name.prompt`),info:d.$t(`maestro.description.prompt`),placeholder:d.$t(`maestro.placeholder.prompt`),"min-rows":6},null,8,[`modelValue`,`title`,`info`,`placeholder`]),e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(d.$t(`maestro.name.files`)),1),a(T,{content:d.$t(`maestro.description.files`),class:`ml-1`},null,8,[`content`])]),a(E)]),e(`div`,vt,[e(`div`,yt,[e(`h2`,bt,i(d.$t(`maestro.name.langs`)),1),a(T,{content:d.$t(`maestro.description.langs`),class:`ml-1`},null,8,[`content`])]),a(O,{modelValue:d.primaryLanguage,"onUpdate:modelValue":f[1]||=e=>d.primaryLanguage=e,class:`w-full`,"aria-label":d.$t(`maestro.name.langs`)},{default:h(()=>[(y(!0),s(l,null,_(d.languageOptions,e=>(y(),m(D,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`aria-label`])]),e(`div`,xt,[e(`div`,St,[e(`h2`,Ct,i(d.$t(`maestro.name.aspect`)),1)]),e(`div`,{class:`ratio-items`,role:`radiogroup`,"aria-label":d.$t(`maestro.name.aspect`)},[(y(!0),s(l,null,_(d.ratioOptions,r=>(y(),s(`div`,{key:r.value,class:n([`ratio-item`,{active:d.aspect===r.value}]),role:`radio`,"aria-checked":d.aspect===r.value,"aria-label":r.value,tabindex:`0`,onClick:e=>d.aspect=r.value,onKeydown:[c(t(e=>d.aspect=r.value,[`prevent`]),[`enter`]),c(t(e=>d.aspect=r.value,[`prevent`]),[`space`])]},[e(`div`,Et,[e(`div`,{class:`ratio-rect`,style:g({width:r.width+`px`,height:r.height+`px`})},null,4)]),e(`p`,Dt,i(r.value),1)],42,Tt))),128))],8,wt)]),e(`div`,Ot,[e(`div`,kt,[e(`h2`,At,i(d.$t(`maestro.name.duration`)),1),a(T,{content:d.$t(`maestro.description.duration`),class:`ml-1`},null,8,[`content`])]),a(k,{modelValue:d.duration,"onUpdate:modelValue":f[2]||=e=>d.duration=e,class:`field-control`,min:d.MAESTRO_MIN_DURATION,max:d.MAESTRO_MAX_DURATION,step:5,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`])]),e(`div`,jt,[e(`div`,Mt,[e(`div`,Nt,[e(`h2`,Pt,i(d.$t(`maestro.name.customizeScenario`)),1),a(T,{content:d.$t(`maestro.description.scenario`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.scenarioCustomizationEnabled,"onUpdate:modelValue":f[3]||=e=>d.scenarioCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeScenario`)},null,8,[`modelValue`,`aria-label`])]),e(`div`,{class:n([`scenario-cards`,{"is-disabled":!d.scenarioCustomizationEnabled}]),role:`radiogroup`,"aria-label":d.$t(`maestro.name.scenario`),"aria-disabled":!d.scenarioCustomizationEnabled},[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_SCENARIOS,r=>(y(),s(`div`,{key:r,class:n([`scenario-card`,{active:d.scenarioCustomizationEnabled&&d.scenario===r,disabled:!d.scenarioCustomizationEnabled}]),role:`radio`,"aria-checked":d.scenarioCustomizationEnabled&&d.scenario===r,"aria-disabled":!d.scenarioCustomizationEnabled,"aria-label":d.$t(`maestro.option.scenario.${r}`),tabindex:d.scenarioCustomizationEnabled?0:-1,onClick:e=>d.scenarioCustomizationEnabled&&(d.scenario=r),onKeydown:[c(t(e=>d.scenarioCustomizationEnabled&&(d.scenario=r),[`prevent`]),[`enter`]),c(t(e=>d.scenarioCustomizationEnabled&&(d.scenario=r),[`prevent`]),[`space`])]},[e(`div`,Lt,[e(`img`,{src:d.MAESTRO_SCENARIO_THUMBNAILS[r],alt:d.$t(`maestro.option.scenario.${r}`),loading:`lazy`},null,8,Rt)]),e(`p`,zt,i(d.$t(`maestro.option.scenario.${r}`)),1)],42,It))),128))],10,Ft),d.needsRequiredUpload?(y(),m(C,{key:0,title:d.$t(d.scenario===`avatar`?`maestro.message.avatarNeedsImage`:`maestro.message.captionsNeedVideo`),type:`warning`,closable:!1,"show-icon":``,class:`mt-2`},null,8,[`title`])):o(``,!0)]),e(`div`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`h2`,Ut,i(d.$t(`maestro.name.customizeStyle`)),1),a(T,{content:d.$t(`maestro.description.style`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.styleCustomizationEnabled,"onUpdate:modelValue":f[4]||=e=>d.styleCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeStyle`)},null,8,[`modelValue`,`aria-label`])]),a(O,{modelValue:d.style,"onUpdate:modelValue":f[5]||=e=>d.style=e,class:`w-full`,filterable:``,"allow-create":``,"default-first-option":``,disabled:!d.styleCustomizationEnabled,"aria-label":d.$t(`maestro.name.customizeStyle`),placeholder:d.$t(`maestro.placeholder.select`)},{default:h(()=>[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_STYLES,e=>(y(),m(D,{key:e,label:d.$t(`maestro.option.style.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`disabled`,`aria-label`,`placeholder`])]),e(`div`,Wt,[e(`div`,Gt,[e(`div`,Kt,[e(`h2`,qt,i(d.$t(`maestro.name.customizeVoice`)),1),a(T,{content:d.$t(`maestro.description.voice`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.voiceCustomizationEnabled,"onUpdate:modelValue":f[6]||=e=>d.voiceCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeVoice`)},null,8,[`modelValue`,`aria-label`])]),e(`div`,Jt,[a(O,{modelValue:d.voice,"onUpdate:modelValue":f[7]||=e=>d.voice=e,class:`voice-select`,disabled:!d.voiceCustomizationEnabled,"aria-label":d.$t(`maestro.name.customizeVoice`),placeholder:d.$t(`maestro.placeholder.select`)},{default:h(()=>[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_VOICES,e=>(y(),m(D,{key:e.key,label:d.$t(`maestro.option.voice.${e.key}`),value:e.key},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`disabled`,`aria-label`,`placeholder`]),a(S,{class:`voice-play`,disabled:!d.voiceCustomizationEnabled||!d.currentSample,title:d.$t(`maestro.button.preview`),"aria-label":d.$t(`maestro.button.preview`),onClick:d.onToggleSample},{default:h(()=>[d.playing?(y(),m(j,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(y(),m(M,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])])])]),e(`div`,Yt,[a(N,{scenario:`maestro`}),d.walletMode?o(``,!0):(y(),m(P,{key:0,value:d.estimatedCredits,service:d.service},null,8,[`value`,`service`])),a(S,{type:`primary`,class:`btn w-full`,round:``,disabled:!d.canGenerate,onClick:d.onGenerate},{default:h(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`maestro.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Zt=K(dt,[[`render`,Xt],[`__scopeId`,`data-v-d9acbf89`]]),Qt=50,$t=1e4,Q=new Map,$=new Map,en=(e,t)=>{if(Q.set(e,t),Q.size>Qt){let e=Q.keys().next().value;e&&Q.delete(e)}};async function tn(e,t){let n=`${t.credentialKey}:${e}`,r=Q.get(n);if(r)return r;let i=$.get(n);if(i)return i.promise;let a=new AbortController,o,s={controller:a,promise:void 0},c=G.task(e,{token:t.token,signal:a.signal}).then(({data:e})=>{if(!a.signal.aborted)return en(n,e),e}).catch(t=>{a.signal.aborted||console.warn(`failed to load maestro remix reference task`,e,t)}),l=new Promise(e=>{o=window.setTimeout(()=>{a.abort(),e(void 0)},$t)});return s.promise=Promise.race([c,l]).finally(()=>{o!==void 0&&window.clearTimeout(o),$.get(n)===s&&$.delete(n)}),$.set(n,s),s.promise}var nn=[`plan`,`source`,`voice`,`compose`,`render`,`deliver`];function rn(e){if(!e)return-1;let t=e.toLowerCase(),n=nn.indexOf(t);return n>=0?n:/plan|storyboard|script|brief/.test(t)?0:/source|search|image|photo|asset|media/.test(t)?1:/voice|tts|audio|narrat/.test(t)?2:/compose|composit|build|layout|scene/.test(t)?3:/render|encode/.test(t)?4:/deliver|upload|cdn|complete|done|finish/.test(t)?5:-1}var an=b({name:`ProgressSteps`,components:{ElIcon:x,Loading:R,Check:M},props:{modelValue:{type:Object,required:!0}},computed:{currentIndex(){let e=this.modelValue?.response?.data?.progress||[],t=-1;for(let n of e)t=Math.max(t,rn(n?.stage));return t=Math.max(t,rn(this.modelValue?.response?.data?.stage)),Math.max(t,0)},detail(){let e=this.modelValue?.response?.data;if(e?.activity)return e.activity;let t=e?.progress||[];for(let e=t.length-1;e>=0;e--)if(t[e]?.message)return t[e]?.message},steps(){return nn.map(e=>({key:e}))}},methods:{stateOf(e){let t=this.currentIndex;return e<t?`done`:e===t?`active`:`pending`}}}),on={class:`progress-steps`,"aria-live":`polite`},sn=[`aria-current`],cn={class:`ico`},ln={class:`txt`},un={key:0,class:`detail`};function dn(t,r,c,d,f,p){let g=u(`loading`),v=u(`el-icon`),ee=u(`check`);return y(),s(`div`,on,[(y(!0),s(l,null,_(t.steps,(r,c)=>(y(),s(`div`,{key:r.key,class:n([`step`,t.stateOf(c)]),"aria-current":c===t.currentIndex?`step`:void 0},[e(`span`,cn,[c===t.currentIndex?(y(),m(v,{key:0,class:`is-loading`,"aria-label":t.$t(`maestro.step.${r.key}`)},{default:h(()=>[a(g,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`])):c<t.currentIndex?(y(),m(v,{key:1},{default:h(()=>[a(ee,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):o(``,!0)]),e(`span`,ln,i(t.$t(`maestro.step.${r.key}`)),1)],10,sn))),128)),t.detail?(y(),s(`p`,un,i(t.detail),1)):o(``,!0)])}var fn=K(an,[[`render`,dn],[`__scopeId`,`data-v-8a883977`]]),pn=[`succeeded`,`failed`],mn=[1e3,3e3],hn=b({name:`TaskPreview`,components:{DeleteIcon:le,ElTooltip:T,ChannelIcon:F,DownloadIcon:P,InfoIcon:I,LanguageIcon:L,MagicIcon:H,RedoIcon:ce,TimeIcon:N,WarningIcon:ue,CopyToClipboard:Ie,ElAlert:E,VideoPlayer:Ue,ElButton:X,ApiCodeButton:Ke,ReportButton:Le,ImagePreview:ze,AudioPreview:He,VideoPreview:We,FilePreview:Re,ProgressSteps:fn},props:{modelValue:{type:Object,required:!0}},data(){return{fetchedReferenceTask:void 0,fetchedReferenceKey:void 0,referenceLoadAttempt:0,referenceLoadFailed:!1,referenceLoadTimer:void 0,referenceLoadVersion:0}},computed:{variants(){return this.modelValue?.response?.data?.variants||[]},files(){let e=[...this.modelValue?.request?.file_urls||[]];if(this.referenceTaskId)for(let t of this.referenceTask?.response?.data?.variants||[])t.output_url&&e.push(t.output_url);return[...new Set(e)].filter(e=>!!e).map(e=>{let t=e.split(`?`)[0].split(`#`)[0],n=U(t)?`image`:W(t)?`video`:pe(t)?`audio`:`file`;return{url:e,name:this.fileName(t),kind:n}})},referenceTaskId(){let e=this.modelValue?.request;return e?.action===`remix`?e?.ref_task_id:void 0},referenceLoadKey(){let e=this.$store.state.maestro?.credential,t=e?.token;if(!(!this.referenceTaskId||!t))return JSON.stringify([this.referenceTaskId,e?.id||e?.user_id||t,t])},referenceTask(){if(this.referenceTaskId)return this.$store.state.maestro?.tasks?.items?.find(e=>e.id===this.referenceTaskId)||(this.fetchedReferenceKey===this.referenceLoadKey?this.fetchedReferenceTask:void 0)},isTerminal(){return pn.includes(this.modelValue?.status||``)},traceId(){return this.modelValue?.trace_id||this.modelValue?.response?.trace_id},progressPct(){let e=this.modelValue?.response?.data?.progress,t=e?.length?e[e.length-1]:void 0;return typeof t?.pct==`number`?t.pct:void 0},progressText(){return this.progressPct===void 0?this.statusLabel:`${this.progressPct}%`},statusLabel(){let e=`maestro.status.${this.modelValue?.status||`pending`}`,t=this.$t(e);return t===e?this.$t(`maestro.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message},requestParams(){let e=this.modelValue?.request;if(!e)return[];let t=[];return e.action&&t.push({icon:d(H),label:this.$t(`maestro.name.mode`),value:this.optionLabel(`maestro.option.action`,e.action)}),e.scenario&&t.push({icon:d(de),label:this.$t(`maestro.name.scenario`),value:this.optionLabel(`maestro.option.scenario`,e.scenario)}),e.style&&t.push({icon:d(ie),label:this.$t(`maestro.name.style`),value:this.optionLabel(`maestro.option.style`,e.style)}),e.aspect&&t.push({icon:d(te),label:this.$t(`maestro.name.aspect`),value:e.aspect}),e.duration&&t.push({icon:d(N),label:this.$t(`maestro.name.duration`),value:`${e.duration}s`}),e.langs?.length&&t.push({icon:d(L),label:this.$t(`maestro.name.langs`),value:e.langs.join(` · `)}),t}},watch:{referenceLoadKey:{immediate:!0,handler(e){this.resetReferenceLoad(),e&&!this.referenceTask&&this.loadReferenceTask(e)}}},beforeUnmount(){this.resetReferenceLoad()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Oe.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`maestro/deleteTask`,{id:e}),O.success(this.$t(`common.message.deleteTaskSuccess`))}catch{O.error(this.$t(`common.message.deleteTaskFailed`))}}},resetReferenceLoad(){this.referenceLoadTimer!==void 0&&window.clearTimeout(this.referenceLoadTimer),this.referenceLoadTimer=void 0,this.referenceLoadVersion+=1,this.referenceLoadAttempt=0,this.referenceLoadFailed=!1,this.fetchedReferenceTask=void 0,this.fetchedReferenceKey=void 0},async loadReferenceTask(e){if(e!==this.referenceLoadKey||this.referenceTask)return;let t=this.$store.state.maestro?.credential,n=t?.token,r=this.referenceTaskId;if(!r||!n)return;let i=t?.id||t?.user_id||n,a=this.referenceLoadVersion;this.referenceLoadAttempt+=1;let o=await tn(r,{token:n,credentialKey:i});if(a!==this.referenceLoadVersion||e!==this.referenceLoadKey)return;if(o){this.fetchedReferenceTask=o,this.fetchedReferenceKey=e,this.referenceLoadFailed=!1;return}let s=mn[this.referenceLoadAttempt-1];s===void 0?this.referenceLoadFailed=!0:this.referenceLoadTimer=window.setTimeout(()=>{this.referenceLoadTimer=void 0,this.loadReferenceTask(e)},s)},retryReferenceTask(){let e=this.referenceLoadKey;this.resetReferenceLoad(),e&&this.loadReferenceTask(e)},optionLabel(e,t){let n=`${e}.${t}`,r=this.$t(n);return r===n?t:r},fileName(e){let t=e.substring(e.lastIndexOf(`/`)+1);try{return decodeURIComponent(t)||e}catch{return t||e}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)},onRemix(){if(!this.modelValue)return;let e=Fe(this.$store.state.maestro?.config,this.modelValue);this.$store.commit(`maestro/setConfig`,e),O.info(this.$t(`maestro.message.remixLoaded`))}}}),gn={class:`preview`},_n={class:`left`},vn={class:`main`},yn={class:`bot`},bn={class:`datetime`},xn=[`aria-label`],Sn={class:`info`},Cn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},wn=[`href`,`title`],Tn={key:1,class:`reference-load-failed flex items-center gap-1 mt-2 text-xs text-[var(--el-text-color-secondary)]`},En={key:2,class:`prompt mt-2`},Dn={key:0,class:`progress-pct`},On={key:0,class:`content`},kn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},An={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},jn={key:1,class:`content`},Mn={class:`text-xs text-[var(--el-text-color-secondary)] mb-1`},Nn={key:0},Pn={class:`operations`},Fn={key:0},In={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ln={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},zn={key:2,class:`content`},Bn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Hn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Un={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Wn(c,d,f,p,g,ee){let b=u(`capability-presentation`),x=u(`delete-icon`),S=u(`el-tooltip`),C=u(`image-preview`),w=u(`video-preview`),T=u(`audio-preview`),E=u(`file-preview`),D=u(`info-icon`),O=u(`redo-icon`),k=u(`el-button`),A=u(`progress-steps`),j=u(`magic-icon`),M=u(`copy-to-clipboard`),N=u(`channel-icon`),P=u(`el-alert`),F=u(`language-icon`),I=u(`video-player`),L=u(`download-icon`),R=u(`api-code-button`),z=u(`report-button`),B=u(`time-icon`),V=u(`warning-icon`);return y(),s(`div`,gn,[e(`div`,_n,[a(b,{capability:`maestro`,part:`avatar`,class:`avatar`})]),e(`div`,vn,[e(`div`,yn,[a(b,{capability:`maestro`,part:`name`}),e(`span`,bn,i(c.$dayjs.format(``+new Date(parseFloat((c.modelValue?.created_at||``).toString())*1e3))),1),a(S,{effect:`dark`,content:c.$t(`common.button.delete`),placement:`top`},{default:h(()=>[c.modelValue?.id?(y(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":c.$t(`common.button.delete`),onClick:d[0]||=t((...e)=>c.onDelete&&c.onDelete(...e),[`stop`])},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,xn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Sn,[c.files.length?(y(),s(`div`,Cn,[(y(!0),s(l,null,_(c.files,(e,t)=>(y(),s(l,{key:t},[e.kind===`image`?(y(),m(C,{key:0,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`])):e.kind===`video`?(y(),m(w,{key:1,url:e.url,name:e.name},null,8,[`url`,`name`])):e.kind===`audio`?(y(),m(T,{key:2,url:e.url,name:e.name},null,8,[`url`,`name`])):(y(),s(`a`,{key:3,href:e.url,title:e.name,target:`_blank`,rel:`noopener noreferrer`,class:`shrink-0 no-underline`},[a(E,{name:e.name,closable:!1},null,8,[`name`])],8,wn))],64))),128))])):o(``,!0),c.referenceLoadFailed&&c.referenceTaskId&&!c.referenceTask?(y(),s(`div`,Tn,[a(D,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(c.$t(`maestro.name.files`))+`: `+i(c.$t(`maestro.name.failure`)),1),a(k,{class:`reference-retry`,size:`small`,text:``,circle:``,title:c.$t(`codingBridge.session.retry`),"aria-label":c.$t(`codingBridge.session.retry`),onClick:c.retryReferenceTask},{default:h(()=>[a(O,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`aria-label`,`onClick`])])):o(``,!0),c.modelValue?.request?.prompt?(y(),s(`p`,En,[r(i(c.modelValue?.request?.prompt)+` `,1),c.isTerminal?o(``,!0):(y(),s(`span`,Dn,` · `+i(c.progressText),1))])):o(``,!0)]),c.isTerminal?o(``,!0):(y(),s(`div`,On,[a(P,{closable:!1,class:`mt-2 processing`},{default:h(()=>[a(A,{"model-value":c.modelValue},null,8,[`model-value`]),(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:n([`text-[var(--el-text-color-regular)] text-xs mb-2`,{"mt-3":t===0}])},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)],2))),128)),e(`p`,kn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(M,{content:c.modelValue?.id},null,8,[`content`])]),c.traceId?(y(),s(`p`,An,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(M,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])),c.modelValue?.response?.success===!0&&c.variants.length?(y(),s(`div`,jn,[(y(!0),s(l,null,_(c.variants,(t,n)=>(y(),s(`div`,{key:n,class:`mb-4`},[e(`p`,Mn,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.lang),1),t.title?(y(),s(`span`,Nn,` · `+i(t.title),1)):o(``,!0)]),t.output_url?(y(),m(I,{key:0,src:t.output_url},null,8,[`src`])):o(``,!0)]))),128)),e(`div`,Pn,[(y(!0),s(l,null,_(c.variants,(e,t)=>(y(),s(l,{key:t},[e.output_url?(y(),m(k,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:t=>c.onDownload(t,e.output_url)},{default:h(()=>[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.button.download`)),1),c.variants.length>1?(y(),s(`span`,Fn,` · `+i(e.lang),1)):o(``,!0)]),_:2},1032,[`onClick`])):o(``,!0)],64))),128)),a(k,{size:`small`,type:`primary`,class:`btn-action`,onClick:c.onRemix},{default:h(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.button.remix`)),1)]),_:1},8,[`onClick`]),a(R,{path:`/maestro/videos`,body:c.modelValue?.request},null,8,[`body`]),a(z,{service:`maestro`,"target-id":c.modelValue?.id,snapshot:{prompt:c.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(P,{closable:!1,class:`mt-2 success`},{default:h(()=>[(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)]))),128)),e(`p`,In,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(M,{content:c.modelValue?.id},null,8,[`content`])]),c.modelValue?.elapsed?(y(),s(`p`,Ln,[a(B,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.elapsed`))+`: `+i(c.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),c.traceId?(y(),s(`p`,Rn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(M,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),c.modelValue?.response?.success===!1?(y(),s(`div`,zn,[a(P,{closable:!1,class:`failure`},{template:h(()=>[a(V,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.failure`)),1)]),default:h(()=>[(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)]))),128)),e(`p`,Bn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(M,{content:c.modelValue?.id},null,8,[`content`])]),c.failureReason?(y(),s(`p`,Vn,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.failureReason`))+`: `+i(c.failureReason),1)])):o(``,!0),c.modelValue?.elapsed?(y(),s(`p`,Hn,[a(B,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.elapsed`))+`: `+i(c.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),c.traceId?(y(),s(`p`,Un,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(M,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Gn=b({name:`RecentPanel`,components:{TaskPreview:K(hn,[[`render`,Wn],[`__scopeId`,`data-v-ef9ae897`]]),NoTasks:ne,BotPlaceholder:qe,ScrollList:V},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.maestro?.tasks,items:this.$store.state.maestro?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Kn={key:0},qn={key:2,class:`w-full h-full flex items-center justify-center`};function Jn(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),p=u(`scroll-list`),g=u(`no-tasks`);return y(),s(l,null,[e.tasks?.items===void 0?(y(),s(`div`,Kn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(y(),m(p,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:h(()=>[(y(!0),s(l,null,_(e.tasks?.items,(e,t)=>(y(),m(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(y(),s(`div`,qn,[a(g)])):o(``,!0)],64)}var Yn=b({name:`MaestroIndex`,components:{ConfigPanel:Zt,Layout:it,RecentPanel:K(Gn,[[`render`,Jn]]),ShowcaseResultTabs:Ye},mixins:[Xe(`maestro`),Je(`maestro`,!1)],inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.maestro?.status?.getApplications===D.Request},tasksLoading(){return this.$store.state.maestro?.status?.getTasks===D.Request||this.fetchingTasks},credential(){return this.$store.state.maestro.credential},config(){return this.$store.state.maestro.config},tasks(){return this.$store.state.maestro.tasks},walletMode(){return we()&&Y(`maestro`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`maestro/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await re({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.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(`maestro/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(`maestro/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=J(this.config),t=Ze(`maestro`,e);if(t){O.error(this.$t(`common.message.${t}`));return}let n;if(this.walletMode){let t=this.getWalletContext();if(!t){O.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=G.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Ae())return;let t=this.credential?.token;if(!t)return;n=G.generate(e,{token:t})}O.info(this.$t(`maestro.message.startingTask`)),Ne(`maestro`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),O.success(this.$t(`maestro.message.startTaskSuccess`))}).catch(e=>{e instanceof Me||Ee(e,`maestro`)||(this.walletMode?O.error(this.$t(`common.x402Scenario.paymentFailed`)):O.error(this.$t(`maestro.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return je(this.$wallet)},async confirmWalletPayment(e){return Oe.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Xn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`showcase-result-tabs`),d=u(`layout`);return y(),m(d,null,{config:h(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:h(()=>[a(l,{service:`maestro`},{tasks:h(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Zn=K(Yn,[[`render`,Xn]]);export{Zn as default};
|
|
@@ -0,0 +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-Ctt4vMla.js";import{n as x,t as S}from"./tabs-BpSLc2Is.js";import{t as C}from"./upload-BG3x_JWJ.js";import{t as w}from"./tooltip-Co_mOTlo.js";import{t as T}from"./alert-BprQRUmf.js";import{_ as E,v as D}from"./vuex.esm-bundler-C-5WV-ta.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-BaqojTRQ.js";import{t as j}from"./input-number-BmFOlu3s.js";import{t as M}from"./slider-DgU-R1_f.js";import{t as N}from"./switch-DfKiiyLD.js";import{t as ee}from"./clock-CvHl_Vd7.js";import{t as te}from"./hash-yia5yLmV.js";import{t as ne}from"./headphones-B8rBVQdH.js";import{t as re}from"./info-DVNsJvAI.js";import{t as ie}from"./lightbulb-CvqLaOvJ.js";import{a as P,i as ae,n as oe,r as se,t as ce}from"./pagination-uSk2V2K7.js";import{t as le}from"./trash-2-2Il_x-4b.js";import{t as ue}from"./triangle-alert-Dc39dkq0.js";import{t as F}from"./upload-RXQqkOuq.js";import{t as I}from"./wand-sparkles-CdzPtG8R.js";import{Ai as de,Fi as L,Ni as fe,Pi as pe}from"./constants-CspFM8fh.js";import{D as R,Ga as me,Hi as he,Ir as ge,Ki as _e,Lr as ve,Rr as z,T as ye,Tn as B,Ua as V,Wi as H,Ya as U,at as W,co as G,ct as K,da as be,go as q,it as xe,li as Se,lt as J,nt as Ce,oi as we,ot as Y,qa as Te,ra as Ee,rt as De,st as Oe,tt as ke}from"./index-C8uXmX2U.js";import{t as Ae}from"./CopyToClipboard-CdXnxkau.js";import{t as je}from"./ReportButton-CpSn2HJv.js";import{t as Me}from"./FilePreview-BpPQ5OAR.js";import{t as X}from"./ImagePreview-BOxOkmuq.js";import{n as Ne}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Pe}from"./ServicePricingSummary-D4J-WJ1t.js";import{t as Fe}from"./AudioPreview-h4P2x5TL.js";import{t as Ie}from"./VideoPlayer-B43pPHVA.js";import{t as Le}from"./VideoPreview-DxrhYEOD.js";import{t as Re}from"./ScenarioPaymentMode-Bfxf8Ufv.js";import{t as ze}from"./ApiCodeButton-C7SPMZJ4.js";import{t as Be}from"./BotPlaceholder-BBI_oSgE.js";import{t as Ve}from"./taskPollingMixin-CcLxtz8z.js";import{t as He}from"./ShowcaseResultTabs-Di_5PzXP.js";import{t as Ue}from"./showcaseRecreateMixin-1te_SCEr.js";import{n as We,t as Ge}from"./generationInput-VbA_cpqx.js";var Ke=v({name:`LayoutKling`,components:{MagicIcon:I,ElDrawer:A,ElButton:G},mixins:[Ne]}),qe={class:`main flex flex-row flex-1 min-h-0`},Je={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)]`},Ye={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Xe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,qe,[e(`div`,Je,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ye,[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 Ze=R(Ke,[[`render`,Xe],[`__scopeId`,`data-v-f4b791b5`]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Z(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v3-turbo`:return{...Qe,audio:!0};case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5,referenceVideo:!1,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Qe}}var Q=`<<<video_1>>>`,$e=/<<<image_\d+>>>/g;function et(e){return e?e.split(Q).join(` `).replace(/\s{2,}/g,` `).trim():``}function tt(e){return e?e.replace($e,` `).replace(/\s{2,}/g,` `).trim():``}function nt(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Z(n,r,i),o=[];e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=[`kling-o1`,`kling-v3-omni`,`kling-v3-turbo`].includes(n)||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function $(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=et(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=tt(n.prompt));return n}var rt=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3-turbo`,label:`v3-Turbo`},{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(de)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=nt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=$({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),it={class:`field`},at={class:`title font-bold`};function ot(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,it,[e(`h2`,at,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var st=R(rt,[[`render`,ot],[`__scopeId`,`data-v-d3faca05`]]),ct=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return L.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=nt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=$({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),lt={class:`field`},ut={class:`header`},dt={class:`title font-bold`},ft={key:0,class:`opt-tip`};function pt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,ft,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var mt=R(ct,[[`render`,pt],[`__scopeId`,`data-v-9a8fa3c5`]]),ht=Array.from({length:13},(e,t)=>t+3),gt=[5,10],_t=[5],vt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return this.selectedModel===`kling-v3-turbo`||L.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?_t:this.isV3Model?ht:gt},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{selectedModel(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=nt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=$({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),yt={class:`field`},bt={class:`control`},xt={class:`label`},St={class:`title font-bold`};function Ct(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[e(`h2`,St,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var wt=R(vt,[[`render`,Ct],[`__scopeId`,`data-v-9051ec82`]]),Tt=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),Et={class:`text-sm font-bold mb-2 block`},Dt={class:`items`},Ot=[`onClick`],kt={class:`name`};function At(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Et,i(t.$t(`kling.name.ratio`)),1),e(`div`,Dt,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,kt,i(r.label),1)],10,Ot))),128))])])}var jt=R(Tt,[[`render`,At],[`__scopeId`,`data-v-cdb14b2f`]]),Mt=v({name:`StartImage`,components:{UploadIcon:F,ElUpload:C,ElButton:G,ElTooltip:w,InfoIcon:P,ImagePreview:X},mixins:[J,K,Y],emits:[`change`],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)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),Nt={class:`relative`},Pt={class:`flex min-h-8 items-center pr-20`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`};function Lt(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-tooltip`),x=l(`el-upload`);return g(),s(`div`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{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,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"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?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rt=R(Mt,[[`render`,Lt],[`__scopeId`,`data-v-60844ac3`]]),zt=v({name:`EndImage`,components:{UploadIcon:F,ElUpload:C,ElButton:G,ElTooltip:w,ImagePreview:X,InfoIcon:P},mixins:[J,K,Y],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)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Z(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),Bt={class:`relative`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={class:`text-sm font-bold`};function Wt(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-tooltip`),x=l(`el-upload`);return g(),s(`div`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`span`,Ut,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{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,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"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?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gt=R(zt,[[`render`,Wt],[`__scopeId`,`data-v-b286c4d0`]]),Kt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:G,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:P,FilePreview:Me,UploadIcon:F},mixins:[K,Y],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)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=xe(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:De(Ce)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(Q),i;if(e&&!r)i=n?`${n} ${Q}`:Q;else if(!e&&r)i=et(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),qt={class:`relative`},Jt={class:`flex min-h-8 items-center pr-20`},Yt={class:`flex justify-start items-center`},Xt={class:`text-sm font-bold`},Zt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Qt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},$t={class:`text-sm`},en={class:`flex items-center justify-between gap-3`},tn={class:`text-sm`};function nn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`span`,Xt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,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===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},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(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,Zt,[e(`div`,Qt,[e(`span`,$t,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,en,[e(`span`,tn,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var rn=R(Kt,[[`render`,nn],[`__scopeId`,`data-v-e3a9dfab`]]),an=v({name:`KlingReferenceImages`,components:{ElButton:G,ElUpload:C,UploadIcon:F,ImagePreview:X,InfoIcon:P},mixins:[J,K,Y],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[tt(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),on={class:`relative`},sn={class:`flex justify-between items-center`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`},un={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function dn(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,un,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var fn=R(an,[[`render`,dn]]),pn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:P,ElInputNumber:j},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),mn={class:`flex justify-between`},hn={class:`flex justify-start items-center`},gn={class:`text-sm font-bold`},_n={class:`flex justify-end items-center`},vn={class:`w-full`};function yn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,mn,[e(`div`,hn,[e(`span`,gn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,_n,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,vn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var bn=R(pn,[[`render`,yn]]),xn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},fixedAudio(){return this.selectedModel===`kling-v3-turbo`},supported(){return!!(this.fixedAudio||L.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.fixedAudio?this.$t(`kling.description.generateAudioIncluded`):this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.fixedAudio?!0:this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),Sn={class:`relative`},Cn={class:`flex justify-between items-center`},wn={class:`flex justify-start items-center`},Tn={class:`text-sm font-bold`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Sn,[e(`div`,Cn,[e(`div`,wn,[e(`span`,Tn,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported||t.fixedAudio},null,8,[`modelValue`,`disabled`])])])}var Dn=R(xn,[[`render`,En]]),On=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],kn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:P},data(){return{configKeys:On}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Z(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),An={class:`field`},jn={class:`header`},Mn={class:`text-sm font-bold`},Nn={key:0,class:`config-grid`},Pn={class:`cfg-row-head`},Fn={class:`cfg-name`};function In(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,An,[e(`div`,jn,[e(`span`,Mn,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Nn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var Ln=R(kn,[[`render`,In],[`__scopeId`,`data-v-cd896060`]]),Rn=[{groupKey:`cameraMovements`,chipKeys:[`rotateAround`,`stationary`,`handheld`,`zoomOut`,`zoomIn`,`follow`,`panRight`,`tiltUp`,`tiltDown`,`orbit`]},{groupKey:`cameraSpeed`,chipKeys:[`speedSlow`,`speedMedium`,`speedFast`]},{groupKey:`shotType`,chipKeys:[`shotClose`,`shotMedium`,`shotLong`,`shotLowAngle`,`shotHighAngle`,`shotShallowDof`,`shotFront`,`shotProfile`,`shotCloseUp`,`shotDrone`]},{groupKey:`light`,chipKeys:[`lightSunlight`,`lightSoft`,`lightNeon`,`lightWarm`,`lightNature`,`lightCandle`,`lightCityNight`]},{groupKey:`frame`,chipKeys:[`frameRichDetails`,`frameSimpleBg`]},{groupKey:`atmosphere`,chipKeys:[`atmosphereMysterious`,`atmospherePeaceful`,`atmosphereHeartwarming`,`atmosphereVivid`,`atmosphereColorful`]}],zn=`, `;function Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${zn}${t}`:t}function Vn(e,t){if(!e||!t)return e||``;let n=[`${t}${zn}`,`${zn}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var Hn=v({name:`InspirationPills`,components:{CloseIcon:Te},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Rn.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:ie,ElButton:G,PromptTextarea:ae,InspirationPills:R(Hn,[[`render`,Kn],[`__scopeId`,`data-v-6be01bcf`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Jn(e,t,n,o,s,c){let u=l(`idea-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Yn=R(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug(`set prompt`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var tr=R(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:Te,IdeaIcon:ie,ElDrawer:A,ElButton:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Rn}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=R(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"kling-v3":`v3`,"kling-v3-turbo":`v3-Turbo`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-o1":`Kling O1`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:ne},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return this.config?.model===`kling-v3-turbo`||!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:G,ServicePricingSummary:Pe,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:st,ModeSelector:mt,DurationSelector:wt,RatioSelector:jt,StartImage:Rt,CfgScaleSelector:bn,GenerateAudioSelector:Dn,CameraControlSelector:Ln,InspirationDrawer:hr,SummaryChip:R(vr,[[`render`,Tr],[`__scopeId`,`data-v-f59e4d1f`]]),EndImage:Gt,ReferenceImages:fn,ReferenceVideo:rn,ScenarioPaymentMode:Re},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return Ge(`kling`,ve(this.config))},config(){return this.$store.state.kling?.config},capabilities(){return Z(this.config?.model,this.config?.mode,this.config?.duration)},restrictedControls(){return[`kling-o1`,`kling-v3-omni`,`kling-v3-turbo`].includes(this.config?.model||``)||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return B(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return he()&&H(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=H(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=H(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await z.quote(ve(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),t.config?.model===`kling-v3-turbo`?o(``,!0):(g(),f(S,{key:2,class:`mb-4`})),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.restrictedControls?o(``,!0):(g(),f(E,{key:3,class:`mb-4`})),t.restrictedControls?o(``,!0):(g(),f(D,{key:4,class:`mb-4`})),t.restrictedControls?o(``,!0):(g(),f(O,{key:5,class:`mb-4`}))]),e(`div`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=R(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:F,ElUpload:C,ElButton:G,InfoIcon:P,ImagePreview:X},mixins:[J,K,Y,ke],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)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(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`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},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,"before-upload":t.beforeUploadSizeGuard,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?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},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(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rr=R(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:F,ElUpload:C,ElButton:G,InfoIcon:P,FilePreview:Me},mixins:[K,Y],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)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,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===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},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(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gr=R(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Zr=R(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:P},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,ei,[e(`div`,ti,[e(`span`,ni,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ii=R($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||ai},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.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 di=R(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.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 vi=R(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??`yes`)===`yes`},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,keep_original_sound:e?`yes`:`no`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var Ti=v({name:`MotionPanel`,components:{MagicIcon:I,ElButton:G,ServicePricingSummary:Pe,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:R(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return B({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,Oi,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ai=R(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{MetaTag:me,ElTabs:x,ElTabPane:S},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Mi=[`title`],Ni={class:`text`};function Pi(t,n,a,u,d,m){let _=l(`meta-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Ni,i(t.label),1),t.badge?(g(),f(_,{key:0,tone:`warning`,class:`badge`,density:`compact`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=R(ji,[[`render`,Pi],[`__scopeId`,`data-v-24ca66ec`]]),Ii={"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:pe.map(e=>({value:e,label:Ii[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=fe)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Vi=R(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:I,UploadIcon:F,ElUpload:C,ElButton:G,ElInput:q,ServicePricingSummary:Pe,InfoIcon:P,ImagePreview:X,ModelSelector:Vi,ModeSelector:R(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Re},mixins:[Y,ke],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:V()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return B({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return he()&&H(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=H(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await z.quoteTalkingPhoto(ge(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qi,[e(`div`,$i,[e(`span`,ea,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=R(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:le,ChannelIcon:te,InfoIcon:re,MagicIcon:I,TimeIcon:ee,WarningIcon:ue,CopyToClipboard:Ae,ElAlert:T,VideoPlayer:Ie,ElTooltip:w,ElButton:G,ImagePreview:X,VideoPreview:Le,AudioPreview:Fe,ApiCodeButton:ze,ReportButton:je},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await U.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),ee=l(`warning-icon`),te=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ca,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,wa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ta,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Oa,[a(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ka,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Aa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,ja,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ma,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Na,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Fa=v({name:`RecentPanel`,components:{TaskPreview:R(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:se,BotPlaceholder:Be,ScrollList:oe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(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`,Ia,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,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`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Ze,RecentPanel:R(Fa,[[`render`,Ra]]),ShowcaseResultTabs:He},mixins:[Oe,Ue(`kling`),Ve(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks},walletMode(){return this.taskType!==`motion`&&he()&&H(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){_e(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();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(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=ve(this.config),t=We(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!W(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>z.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),Ee(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!be())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof we||ye(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return Se(this.$wallet)},async confirmWalletPayment(e){return U.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!W(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!be())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),Ee(`kling`,z.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{ye(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!W(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=ge(e),n=this.createPaymentOperation(e=>z.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),Ee(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=R(za,[[`render`,Ha]]);export{Ua 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{t as y}from"./upload-BG3x_JWJ.js";import{t as b}from"./tooltip-L2G5ntVi.js";import{t as x}from"./alert-BprQRUmf.js";import{_ as S,v as C}from"./vuex.esm-bundler-C-5WV-ta.js";import{t as w}from"./drawer-VaJhlwVr.js";import{t as T}from"./box-3_e2nW7_.js";import{t as E}from"./clock-DIjv9Rh6.js";import{t as D}from"./hash-B61j4cgz.js";import{t as O}from"./info-CDi6ZfZf.js";import{a as k,i as A,n as j,o as M,r as ee,t as N}from"./pagination-BodQ3KsQ.js";import{t as te}from"./trash-2-CUcSh2xz.js";import{t as ne}from"./triangle-alert-fl0O4ttl.js";import{t as P}from"./upload-ClpzRFqM.js";import{t as F}from"./wand-sparkles-C9xUdsPZ.js";import{Mt as I,Nt as L,Ot as R,Pt as re,jt as ie,kt as ae}from"./constants-CspFM8fh.js";import{D as z,Fi as B,Gn as V,Ha as H,Ia as U,Li as W,T as G,Tn as K,Wn as q,Xi as J,at as oe,ct as Y,ia as se,it as ce,li as le,lt as ue,nt as de,oi as fe,ot as X,rt as pe,st as me,to as Z,tt as he}from"./index-Bk9SKIXV.js";import{t as ge}from"./CopyToClipboard-CIB9LY9Y.js";import{t as _e}from"./ReportButton-D3eba7A1.js";import{t as ve}from"./FilePreview-_7yUZ2m8.js";import{t as Q}from"./ImagePreview-Dq6UkYX8.js";import{n as ye}from"./taskDrawerMixin-DyAUhFEq.js";import{t as be}from"./ServicePricingSummary-N2X5DfKj.js";import{t as xe}from"./VideoPlayer-BNtDhrpR.js";import{t as Se}from"./ScenarioPaymentMode-BwoqFZco.js";import{t as Ce}from"./ApiCodeButton-C5tBSXac.js";import{t as we}from"./BotPlaceholder-7Rci0gLD.js";import{t as Te}from"./taskPollingMixin-CcLxtz8z.js";var Ee=v({name:`LayoutOmni`,components:{MagicIcon:F,ElDrawer:w,ElButton:Z},mixins:[ye]}),De={class:`main flex flex-row flex-1`},Oe={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)]`},ke={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ae(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,De,[e(`div`,Oe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ke,[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 je=z(Ee,[[`render`,Ae],[`__scopeId`,`data-v-847afabf`]]),Me=v({name:`OmniPromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.omni?.config?.prompt},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ne(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(`omni.name.prompt`),info:e.$t(`omni.description.prompt`),placeholder:e.$t(`omni.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Pe=z(Me,[[`render`,Ne]]),Fe=v({name:`OmniResolutionSelector`,components:{InfoIcon:k},data(){return{options:[{value:re,label:`720p`},{value:L,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.omni?.config?.resolution},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,resolution:e})}}},mounted(){this.value||=ae}}),Ie={class:`resolution`},Le={class:`header`},Re={class:`title font-bold`},ze={class:`items`},Be=[`onClick`];function Ve(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,ze,[(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,Be))),128))])])}var He=z(Fe,[[`render`,Ve],[`__scopeId`,`data-v-1f9abe29`]]),Ue=v({name:`OmniRatioSelector`,components:{InfoIcon:k},computed:{options(){return[{value:ie,label:`16:9`,w:32,h:18},{value:I,label:`9:16`,w:18,h:32}]},value:{get(){return this.$store.state.omni?.config?.aspect_ratio},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,aspect_ratio:e})}}},mounted(){this.value||=R}}),We={class:`ratio`},Ge={class:`header`},Ke={class:`title font-bold`},qe={class:`items`},Je=[`onClick`],Ye={class:`preview`},Xe={class:`name`};function Ze(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,We,[e(`div`,Ge,[e(`h2`,Ke,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,qe,[(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`,Ye,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,Xe,i(r.label),1)],10,Je))),128))])])}var Qe=z(Ue,[[`render`,Ze],[`__scopeId`,`data-v-1c0c1511`]]),$e=4,et=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:Z,InfoIcon:k,ImagePreview:Q,UploadIcon:P},mixins:[ue,Y,X,he],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`,limit:$e,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.omni?.config?.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(){C.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){C.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,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()}}}),tt={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},nt={class:`flex min-w-0 items-center`},rt={class:`title m-0 text-[14px] font-bold`},it={class:`file-list flex flex-wrap gap-[10px]`};function at(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,tt,[e(`div`,nt,[e(`h2`,rt,i(t.$t(`omni.name.referenceImages`)),1),a(_,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])]),a(b,{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 shrink-0`,limit:t.limit,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,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(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,it,[(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))])])}var ot=z(et,[[`render`,at]]),st=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:Z,InfoIcon:k,FilePreview:ve,UploadIcon:P},mixins:[Y,X],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){C.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){C.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=ce(e.size);return t?n?!0:(C.error(this.$t(`omni.message.uploadVideoSizeExceed`,{max:pe(de)})),!1):(C.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),ct={class:`field flex min-h-8 w-full items-center justify-between gap-3`},lt={class:`flex min-w-0 items-center`},ut={class:`title m-0 text-[14px] font-bold`},dt={key:0,class:`file-list flex flex-wrap gap-[10px]`};function ft(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`file-preview`);return g(),s(`div`,null,[e(`div`,ct,[e(`div`,lt,[e(`h2`,ut,i(t.$t(`omni.name.referenceVideo`)),1),a(m,{content:t.$t(`omni.description.referenceVideo`)},null,8,[`content`])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value shrink-0`,"show-file-list":!1,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},{default:p(()=>[a(_,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.uploadVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.videoUrl?(g(),s(`div`,dt,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var pt=v({name:`OmniConfigPanel`,components:{ElButton:Z,MagicIcon:F,PromptInput:Pe,ResolutionSelector:He,RatioSelector:Qe,ReferenceImagesInput:ot,VideoInput:z(st,[[`render`,ft],[`__scopeId`,`data-v-b87d1e4e`]]),ServicePricingSummary:be,ScenarioPaymentMode:Se},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.omni?.config},consumption(){return K(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service},walletMode(){return B()&&W(`omni`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=W(`omni`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await V.quote(q(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),mt={class:`flex flex-col h-full`},ht={class:`flex-1 overflow-y-auto p-5`},gt={class:`flex flex-col items-center justify-center px-5 pb-5`};function _t(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`ratio-selector`),v=l(`resolution-selector`),y=l(`reference-images-input`),b=l(`video-input`),x=l(`scenario-payment-mode`),S=l(`service-pricing-summary`),C=l(`magic-icon`),w=l(`el-button`);return g(),s(`div`,mt,[e(`div`,ht,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,gt,[a(x,{scenario:`omni`}),t.walletMode?o(``,!0):(g(),f(S,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var vt=z(pt,[[`render`,_t]]),yt=v({name:`OmniTaskPreview`,components:{DeleteIcon:te,ApplicationIcon:T,ChannelIcon:D,CopyToClipboard:ge,ExpandIcon:M,InfoIcon:O,MagicIcon:F,TimeIcon:E,WarningIcon:ne,ElAlert:x,VideoPlayer:xe,ElTooltip:b,ElButton:Z,ImagePreview:Q,ApiCodeButton:Ce,ReportButton:_e},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_urls?.[0]},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:{async onDelete(){let e=this.modelValue?.id;if(e){try{await H.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`omni/deleteTask`,{id:e}),C.success(this.$t(`common.message.deleteTaskSuccess`))}catch{C.error(this.$t(`common.message.deleteTaskFailed`))}}},stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),bt={class:`preview`},xt={class:`left`},St={class:`main`},Ct={class:`bot`},wt={class:`datetime`},Tt=[`aria-label`],Et={class:`info`},Dt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Ot={key:1,class:`prompt mt-2`},kt={key:0},At={key:1},jt={key:0,class:n({content:!0})},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:1,class:n({content:!0})},Ft={key:0,class:`mb-4`},It={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Lt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zt={key:0},Bt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ht={key:2,class:n({content:!0})},Ut={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},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-0`},Kt={key:3,class:n({content:!0})},qt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Jt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`image-preview`),b=l(`time-icon`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`application-icon`),k=l(`expand-icon`),A=l(`channel-icon`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,bt,[e(`div`,xt,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,St,[e(`div`,Ct,[a(h,{capability:`omni`,part:`name`}),e(`span`,wt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Tt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Et,[n.inputImage?(g(),s(`div`,Dt,[a(y,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Ot,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,At,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,kt,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Pt,[n.video?.video_url?(g(),s(`div`,Ft,[a(w,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,It,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(E,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`]),a(D,{service:`omni`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Lt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,Rt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,zt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Bt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,$,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Vt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{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`,Ht,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,Ut,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Wt,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Gt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Kt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,qt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,jt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,Mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Nt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Yt=v({name:`OmniRecentPanel`,components:{TaskPreview:z(yt,[[`render`,Jt],[`__scopeId`,`data-v-83851ad5`]]),BotPlaceholder:we,NoTasks:ee,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.omni?.tasks,items:this.$store.state.omni?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Xt={key:0},Zt={key:2,class:`w-full h-full flex items-center justify-center`};function Qt(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`,Xt,[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`,Zt,[a(v)])):o(``,!0)],64)}var $t=v({name:`OmniIndex`,components:{ConfigPanel:vt,Layout:je,RecentPanel:z(Yt,[[`render`,Qt]])},mixins:[me,Te(`omni`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===S.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===S.Request||this.fetchingTasks},credential(){return this.$store.state.omni?.credential},config(){return this.$store.state.omni?.config},tasks(){return this.$store.state.omni?.tasks},walletMode(){return B()&&W(`omni`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`omni/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await N({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(`omni/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(`omni/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!oe(this.uploadTracker,e=>this.$t(e),e=>C.warning(e)))return;let e=q(this.config);if(!e.prompt){C.warning(this.$t(`omni.message.promptRequired`));return}if(e.video_urls&&!e.image_urls){C.warning(this.$t(`omni.message.videoRequiresImage`));return}let t;if(this.walletMode){let n=this.getWalletContext();if(!n){C.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=V.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!se())return;let n=this.credential?.token;if(!n)return;t=V.generate(e,{token:n})}C.info(this.$t(`omni.message.startingTask`)),J(`omni`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),C.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;e instanceof fe||G(e,`omni`)||(this.walletMode?C.error(this.$t(`common.x402Scenario.paymentFailed`)):C.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return le(this.$wallet)},async confirmWalletPayment(e){return H.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function en(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 tn=z($t,[[`render`,en]]);export{tn 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{t as y}from"./upload-BG3x_JWJ.js";import{t as b}from"./tooltip-Co_mOTlo.js";import{t as x}from"./alert-BprQRUmf.js";import{_ as S,v as C}from"./vuex.esm-bundler-C-5WV-ta.js";import{t as w}from"./drawer-BaqojTRQ.js";import{t as T}from"./box-BzqbI4wX.js";import{t as E}from"./clock-CvHl_Vd7.js";import{t as D}from"./hash-yia5yLmV.js";import{t as O}from"./info-DVNsJvAI.js";import{a as k,i as A,n as j,o as M,r as ee,t as N}from"./pagination-uSk2V2K7.js";import{t as te}from"./trash-2-2Il_x-4b.js";import{t as ne}from"./triangle-alert-Dc39dkq0.js";import{t as P}from"./upload-RXQqkOuq.js";import{t as F}from"./wand-sparkles-CdzPtG8R.js";import{Mt as I,Nt as L,Ot as R,Pt as re,jt as ie,kt as ae}from"./constants-CspFM8fh.js";import{D as z,Gn as B,Hi as V,T as H,Tn as U,Ua as W,Wi as G,Wn as K,Ya as q,at as J,co as Y,ct as X,da as oe,it as se,li as ce,lt as le,nt as ue,oi as de,ot as Z,ra as fe,rt as pe,st as me,tt as he}from"./index-C8uXmX2U.js";import{t as ge}from"./CopyToClipboard-CdXnxkau.js";import{t as _e}from"./ReportButton-CpSn2HJv.js";import{t as ve}from"./FilePreview-BpPQ5OAR.js";import{t as Q}from"./ImagePreview-BOxOkmuq.js";import{n as ye}from"./taskDrawerMixin-DyAUhFEq.js";import{t as be}from"./ServicePricingSummary-D4J-WJ1t.js";import{t as xe}from"./VideoPlayer-B43pPHVA.js";import{t as Se}from"./ScenarioPaymentMode-Bfxf8Ufv.js";import{t as Ce}from"./ApiCodeButton-C7SPMZJ4.js";import{t as we}from"./BotPlaceholder-BBI_oSgE.js";import{t as Te}from"./taskPollingMixin-CcLxtz8z.js";var Ee=v({name:`LayoutOmni`,components:{MagicIcon:F,ElDrawer:w,ElButton:Y},mixins:[ye]}),De={class:`main flex flex-row flex-1`},Oe={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)]`},ke={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ae(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,De,[e(`div`,Oe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ke,[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 je=z(Ee,[[`render`,Ae],[`__scopeId`,`data-v-847afabf`]]),Me=v({name:`OmniPromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.omni?.config?.prompt},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ne(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(`omni.name.prompt`),info:e.$t(`omni.description.prompt`),placeholder:e.$t(`omni.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Pe=z(Me,[[`render`,Ne]]),Fe=v({name:`OmniResolutionSelector`,components:{InfoIcon:k},data(){return{options:[{value:re,label:`720p`},{value:L,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.omni?.config?.resolution},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,resolution:e})}}},mounted(){this.value||=ae}}),Ie={class:`resolution`},Le={class:`header`},Re={class:`title font-bold`},ze={class:`items`},Be=[`onClick`];function Ve(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,ze,[(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,Be))),128))])])}var He=z(Fe,[[`render`,Ve],[`__scopeId`,`data-v-1f9abe29`]]),Ue=v({name:`OmniRatioSelector`,components:{InfoIcon:k},computed:{options(){return[{value:ie,label:`16:9`,w:32,h:18},{value:I,label:`9:16`,w:18,h:32}]},value:{get(){return this.$store.state.omni?.config?.aspect_ratio},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,aspect_ratio:e})}}},mounted(){this.value||=R}}),We={class:`ratio`},Ge={class:`header`},Ke={class:`title font-bold`},qe={class:`items`},Je=[`onClick`],Ye={class:`preview`},Xe={class:`name`};function Ze(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,We,[e(`div`,Ge,[e(`h2`,Ke,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,qe,[(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`,Ye,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,Xe,i(r.label),1)],10,Je))),128))])])}var Qe=z(Ue,[[`render`,Ze],[`__scopeId`,`data-v-1c0c1511`]]),$e=4,et=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:Y,InfoIcon:k,ImagePreview:Q,UploadIcon:P},mixins:[le,X,Z,he],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`,limit:$e,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.omni?.config?.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(){C.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){C.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,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()}}}),tt={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},nt={class:`flex min-w-0 items-center`},rt={class:`title m-0 text-[14px] font-bold`},it={class:`file-list flex flex-wrap gap-[10px]`};function at(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,tt,[e(`div`,nt,[e(`h2`,rt,i(t.$t(`omni.name.referenceImages`)),1),a(_,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])]),a(b,{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 shrink-0`,limit:t.limit,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,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(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,it,[(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))])])}var ot=z(et,[[`render`,at]]),st=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:Y,InfoIcon:k,FilePreview:ve,UploadIcon:P},mixins:[X,Z],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){C.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){C.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=se(e.size);return t?n?!0:(C.error(this.$t(`omni.message.uploadVideoSizeExceed`,{max:pe(ue)})),!1):(C.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),ct={class:`field flex min-h-8 w-full items-center justify-between gap-3`},lt={class:`flex min-w-0 items-center`},ut={class:`title m-0 text-[14px] font-bold`},dt={key:0,class:`file-list flex flex-wrap gap-[10px]`};function ft(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`file-preview`);return g(),s(`div`,null,[e(`div`,ct,[e(`div`,lt,[e(`h2`,ut,i(t.$t(`omni.name.referenceVideo`)),1),a(m,{content:t.$t(`omni.description.referenceVideo`)},null,8,[`content`])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value shrink-0`,"show-file-list":!1,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},{default:p(()=>[a(_,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.uploadVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.videoUrl?(g(),s(`div`,dt,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var pt=v({name:`OmniConfigPanel`,components:{ElButton:Y,MagicIcon:F,PromptInput:Pe,ResolutionSelector:He,RatioSelector:Qe,ReferenceImagesInput:ot,VideoInput:z(st,[[`render`,ft],[`__scopeId`,`data-v-b87d1e4e`]]),ServicePricingSummary:be,ScenarioPaymentMode:Se},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.omni?.config},consumption(){return U(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service},walletMode(){return V()&&G(`omni`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=G(`omni`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await B.quote(K(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),mt={class:`flex flex-col h-full`},ht={class:`flex-1 overflow-y-auto p-5`},gt={class:`flex flex-col items-center justify-center px-5 pb-5`};function _t(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`ratio-selector`),v=l(`resolution-selector`),y=l(`reference-images-input`),b=l(`video-input`),x=l(`scenario-payment-mode`),S=l(`service-pricing-summary`),C=l(`magic-icon`),w=l(`el-button`);return g(),s(`div`,mt,[e(`div`,ht,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,gt,[a(x,{scenario:`omni`}),t.walletMode?o(``,!0):(g(),f(S,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var vt=z(pt,[[`render`,_t]]),yt=v({name:`OmniTaskPreview`,components:{DeleteIcon:te,ApplicationIcon:T,ChannelIcon:D,CopyToClipboard:ge,ExpandIcon:M,InfoIcon:O,MagicIcon:F,TimeIcon:E,WarningIcon:ne,ElAlert:x,VideoPlayer:xe,ElTooltip:b,ElButton:Y,ImagePreview:Q,ApiCodeButton:Ce,ReportButton:_e},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_urls?.[0]},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:{async onDelete(){let e=this.modelValue?.id;if(e){try{await q.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`omni/deleteTask`,{id:e}),C.success(this.$t(`common.message.deleteTaskSuccess`))}catch{C.error(this.$t(`common.message.deleteTaskFailed`))}}},stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),bt={class:`preview`},xt={class:`left`},St={class:`main`},Ct={class:`bot`},wt={class:`datetime`},Tt=[`aria-label`],Et={class:`info`},Dt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Ot={key:1,class:`prompt mt-2`},kt={key:0},At={key:1},jt={key:0,class:n({content:!0})},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:1,class:n({content:!0})},Ft={key:0,class:`mb-4`},It={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Lt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zt={key:0},Bt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ht={key:2,class:n({content:!0})},Ut={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},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-0`},Kt={key:3,class:n({content:!0})},qt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Jt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`image-preview`),b=l(`time-icon`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`application-icon`),k=l(`expand-icon`),A=l(`channel-icon`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,bt,[e(`div`,xt,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,St,[e(`div`,Ct,[a(h,{capability:`omni`,part:`name`}),e(`span`,wt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Tt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Et,[n.inputImage?(g(),s(`div`,Dt,[a(y,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,Ot,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,At,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,kt,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Pt,[n.video?.video_url?(g(),s(`div`,Ft,[a(w,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,It,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(E,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`]),a(D,{service:`omni`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Lt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,Rt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,zt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Bt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,$,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Vt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{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`,Ht,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,Ut,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Wt,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Gt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Kt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,qt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,jt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,Mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Nt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Yt=v({name:`OmniRecentPanel`,components:{TaskPreview:z(yt,[[`render`,Jt],[`__scopeId`,`data-v-83851ad5`]]),BotPlaceholder:we,NoTasks:ee,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.omni?.tasks,items:this.$store.state.omni?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Xt={key:0},Zt={key:2,class:`w-full h-full flex items-center justify-center`};function Qt(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`,Xt,[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`,Zt,[a(v)])):o(``,!0)],64)}var $t=v({name:`OmniIndex`,components:{ConfigPanel:vt,Layout:je,RecentPanel:z(Yt,[[`render`,Qt]])},mixins:[me,Te(`omni`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===S.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===S.Request||this.fetchingTasks},credential(){return this.$store.state.omni?.credential},config(){return this.$store.state.omni?.config},tasks(){return this.$store.state.omni?.tasks},walletMode(){return V()&&G(`omni`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`omni/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await N({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(`omni/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(`omni/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!J(this.uploadTracker,e=>this.$t(e),e=>C.warning(e)))return;let e=K(this.config);if(!e.prompt){C.warning(this.$t(`omni.message.promptRequired`));return}if(e.video_urls&&!e.image_urls){C.warning(this.$t(`omni.message.videoRequiresImage`));return}let t;if(this.walletMode){let n=this.getWalletContext();if(!n){C.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=B.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!oe())return;let n=this.credential?.token;if(!n)return;t=B.generate(e,{token:n})}C.info(this.$t(`omni.message.startingTask`)),fe(`omni`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),C.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;e instanceof de||H(e,`omni`)||(this.walletMode?C.error(this.$t(`common.x402Scenario.paymentFailed`)):C.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return ce(this.$wallet)},async confirmWalletPayment(e){return q.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function en(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 tn=z($t,[[`render`,en]]);export{tn as default};
|