@acedatacloud/nexior 3.349.2 → 3.350.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-Ck-LkZnA.js → ApiCodeButton-nUA4iGNl.js} +1 -1
- package/dist/assets/{Artifacts-BgIY0V5w.js → Artifacts-BNpkmRJH.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BHIzmvpA.js → AskUserQuestionCard-CWgKrRpn.js} +1 -1
- package/dist/assets/{AudioPreview-B-vGM5ZE.js → AudioPreview-XDhwGk3A.js} +1 -1
- package/dist/assets/{Auth-BSB5j2IR.js → Auth-v6axG8lj.js} +1 -1
- package/dist/assets/{Bare-CGpzlaiP.js → Bare-g2VQEcBP.js} +1 -1
- package/dist/assets/{BotPlaceholder-SAI3U7Vk.js → BotPlaceholder-DQbI2r9r.js} +1 -1
- package/dist/assets/{BottomFooter-BPu8gJnO.js → BottomFooter-C_dyyPiZ.js} +1 -1
- package/dist/assets/{Callback-DI7I7e9o.js → Callback-BdIYD9BC.js} +1 -1
- package/dist/assets/{CodeSnippet-nfL3VN6b.js → CodeSnippet-kiHj1cis.js} +1 -1
- package/dist/assets/{Console-C1p-WtRP.js → Console-CiOsc7Rr.js} +1 -1
- package/dist/assets/{Consumption-JN0X0f8c.js → Consumption-CJEO0Oqt.js} +1 -1
- package/dist/assets/{Conversation-C2YzpBK3.js → Conversation-BGie9_l2.js} +1 -1
- package/dist/assets/{Conversation-C348UZiO.js → Conversation-BtDPU_pU.js} +1 -1
- package/dist/assets/{CopyToClipboard-DOx2-KTG.js → CopyToClipboard-DPVMD9O4.js} +1 -1
- package/dist/assets/{Detail-MUwXxjGI.js → Detail-D4rxpWwt.js} +2 -2
- package/dist/assets/{Extra-DefQxg0y.js → Extra-ojB-cRvO.js} +1 -1
- package/dist/assets/{FilePreview-CibPHhpy.js → FilePreview-BxmED-xP.js} +1 -1
- package/dist/assets/{Hailuo-CE5R8cCt.js → Hailuo-BiU_khhZ.js} +1 -1
- package/dist/assets/{History-CQt5uXkC.js → History-DNPkD8is.js} +1 -1
- package/dist/assets/{ImagePreview-CSSReHgL.js → ImagePreview-3Js4rEnR.js} +1 -1
- package/dist/assets/{ImageWrapper-DkF7PVGL.js → ImageWrapper-DV-01ruL.js} +1 -1
- package/dist/assets/{Index-B5TInMYN.js → Index-7a5TStnA.js} +1 -1
- package/dist/assets/{Index-BIEqYgeq.js → Index-B3KGfGU3.js} +1 -1
- package/dist/assets/{Index-C82TTXNf.js → Index-B6rdwKWw.js} +1 -1
- package/dist/assets/{Index-G-IlVG_I.js → Index-B9-sIplU.js} +1 -1
- package/dist/assets/{Index-BDnHLDfB2.js → Index-B90zsIkd2.js} +1 -1
- package/dist/assets/{Index-i5okuoPn.js → Index-BK1Aqubx.js} +1 -1
- package/dist/assets/{Index-CCfbH63M.js → Index-BQvyO9gR.js} +1 -1
- package/dist/assets/{Index-DNo4I4BL.js → Index-BeE6Bnt2.js} +1 -1
- package/dist/assets/{Index-DxD497tW.js → Index-Beul2qdK.js} +1 -1
- package/dist/assets/{Index-FNMBrHbM.js → Index-BgGoihXp.js} +1 -1
- package/dist/assets/{Index-BmXYmlZt.js → Index-BljxBpY1.js} +1 -1
- package/dist/assets/{Index-Bo9HAK0V.js → Index-Bn2XRx9Z.js} +1 -1
- package/dist/assets/{Index-DZx0iwsI.js → Index-BvqoqesT.js} +1 -1
- package/dist/assets/{Index-DYteu8It2.js → Index-Bz_PxRFe2.js} +1 -1
- package/dist/assets/{Index-ByI27Xqj.js → Index-CAcF77mU.js} +1 -1
- package/dist/assets/{Index-iKaft8ke.js → Index-CGvrT5tM.js} +1 -1
- package/dist/assets/{Index-Cg-dC_Jb.js → Index-CM1gLJAo.js} +1 -1
- package/dist/assets/{Index-wD6dVDos.js → Index-CV6m41if.js} +1 -1
- package/dist/assets/{Index-BxkXq-kP.js → Index-CjQ6bXz9.js} +1 -1
- package/dist/assets/{Index-DpbjqT2k.js → Index-CtXCoGJv.js} +1 -1
- package/dist/assets/{Index-CBRHBLT-.js → Index-Cv3SfbmG.js} +1 -1
- package/dist/assets/{Index-DfVd1UkS.js → Index-CvSm-INl.js} +1 -1
- package/dist/assets/{Index-B7vEEPhg.js → Index-CyvZsUHZ.js} +1 -1
- package/dist/assets/{Index-Do3syugm.js → Index-DJ-t9DOm.js} +1 -1
- package/dist/assets/{Index-B_o8lp612.js → Index-DZJDbfiH2.js} +1 -1
- package/dist/assets/{Index-CETeiJqR.js → Index-Dc44H2u6.js} +1 -1
- package/dist/assets/{Index-NTeyVOvk2.js → Index-IJTL4RQc2.js} +1 -1
- package/dist/assets/{Index-Cr4TQ-xE.js → Index-W1u-ZLDF.js} +1 -1
- package/dist/assets/{Index-DaXmhISA.js → Index-_ZKyljVJ.js} +1 -1
- package/dist/assets/{Index-q8_pYIR6.js → Index-hW9V8rau.js} +1 -1
- package/dist/assets/{Index-FQ4q5-hl.js → Index-nLGQEQ_Y.js} +1 -1
- package/dist/assets/{Index-DDUzpZ0O.js → Index-tnwTr93h.js} +1 -1
- package/dist/assets/{Invitees-DS4bwsvn.js → Invitees-CPz5stX-.js} +1 -1
- package/dist/assets/{List-C9Z8Wip0.js → List-37R-TEQg.js} +1 -1
- package/dist/assets/{List-Bpu2Pidt.js → List-DytbTxOZ.js} +1 -1
- package/dist/assets/{List-DAeJuNL1.js → List-qW5Kya5D.js} +1 -1
- package/dist/assets/{LocalTools-CHjjKZLq.js → LocalTools-D-1MGMXO.js} +1 -1
- package/dist/assets/{LocalTools-CDaNo5_1.js → LocalTools-YQiSD3B2.js} +1 -1
- package/dist/assets/{Logo-DdeUQOfD.js → Logo-CCiNBtgs.js} +1 -1
- package/dist/assets/{Main-DwWx37vb.js → Main-DOASARfc.js} +1 -1
- package/dist/assets/{Message-HtQyFDWX.js → Message-CTs5YRgy.js} +1 -1
- package/dist/assets/{Model-BVtu2MqI.js → Model-DiWutwCe.js} +1 -1
- package/dist/assets/{Navigator-D4znkCq3.js → Navigator-Cf9dv3dJ.js} +3 -3
- package/dist/assets/{NotFound-DUFo-kbQ.js → NotFound-D-PhrwZ3.js} +1 -1
- package/dist/assets/{Pay-BGp7Pc6d.js → Pay-_viNfD3j.js} +1 -1
- package/dist/assets/{Player-DPDc2wPX.js → Player-BHrJ0Eem.js} +1 -1
- package/dist/assets/{Poivelle-DYy7nBfz.js → Poivelle-V4O1ww6G.js} +1 -1
- package/dist/assets/{PromptTextarea-O8KxwMGn.js → PromptTextarea-CjqyhQn4.js} +1 -1
- package/dist/assets/{RealtimeCall-BamozLji.js → RealtimeCall-DZoZmAnB.js} +1 -1
- package/dist/assets/{ScheduledTasks-DawIJs2a.js → ScheduledTasks-f43gX3LL.js} +1 -1
- package/dist/assets/{Status-DIFSbgzO.js → Status-SQ6bR-7G.js} +1 -1
- package/dist/assets/{Subscribe-DBMALSdv.js → Subscribe-CSI2XvDZ.js} +1 -1
- package/dist/assets/{TabSwitcher-BtIo_WJk.js → TabSwitcher-BXqr52YP.js} +1 -1
- package/dist/assets/{Tts-BFhwi7Nm.js → Tts-CLB93SPL.js} +1 -1
- package/dist/assets/{VideoPlayer-BnwIjt1E.js → VideoPlayer-DTaZaNPe.js} +1 -1
- package/dist/assets/{alert-G37GiXIg.js → alert-CjaV4VyH.js} +1 -1
- package/dist/assets/arrow-down-Cq5K81XA.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-Bw3-m9uw.js → arrow-down-wide-narrow-DYoXwuOP.js} +1 -1
- package/dist/assets/arrow-left-BS9IzPRe.js +1 -0
- package/dist/assets/arrow-right-CL2_B7BZ.js +1 -0
- package/dist/assets/arrow-up-vmJ6KcdY.js +1 -0
- package/dist/assets/{avatar-BsiZaXKt.js → avatar-5M6peroW.js} +1 -1
- package/dist/assets/{basic-CUD9ixpS.js → basic-CmWp21US.js} +1 -1
- package/dist/assets/{book-open-VOA-qRz-.js → book-open-RqJbNzPy.js} +1 -1
- package/dist/assets/{box-BTYdpeSs.js → box-BEEkIbso.js} +1 -1
- package/dist/assets/{boxes-wDC71gk_.js → boxes-JieFrmM4.js} +1 -1
- package/dist/assets/{brain-CVKUI3Ty.js → brain-wBdsAYss.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-Css_xsI4.js → chart-no-axes-combined-B8sKdzP9.js} +1 -1
- package/dist/assets/{chat-Cluz0DyK.js → chat-B_GVbkSP.js} +1 -1
- package/dist/assets/check-BA_RbR_g.js +1 -0
- package/dist/assets/chevron-down-Bo3W4e-Z.js +1 -0
- package/dist/assets/chevron-right-7VFX4u3I.js +1 -0
- package/dist/assets/circle-check-9HkCp0kN.js +1 -0
- package/dist/assets/{circle-question-mark-PRKtc95j.js → circle-question-mark-Cl2Lm-5E.js} +1 -1
- package/dist/assets/{clipboard-list-DS2oQz8T.js → clipboard-list-ilQQMwkX.js} +1 -1
- package/dist/assets/clock-BurpmIb0.js +1 -0
- package/dist/assets/code-9oBQJ6Kj.js +1 -0
- package/dist/assets/{codingBridge-Bfu7FDAD.js → codingBridge-BvaMrSGk.js} +1 -1
- package/dist/assets/{codingBridgeNotify--CrnyiFc.js → codingBridgeNotify-CKklEa8P.js} +2 -2
- package/dist/assets/{coins-CbJVFUNa.js → coins-DoRhV5HR.js} +1 -1
- package/dist/assets/{collapse-D-Az5Y1x.js → collapse-CvjzZBFy.js} +1 -1
- package/dist/assets/{copy-BV2l4S4i.js → copy-CIPzrXII.js} +1 -1
- package/dist/assets/{createTaskActions-Dc-9CHrk.js → createTaskActions-SabaluBw.js} +1 -1
- package/dist/assets/{digitalhuman-Dz67yLQj.js → digitalhuman-B-Vp-K7b.js} +1 -1
- package/dist/assets/{dollar-sign-C1g65vkD.js → dollar-sign-BsstGHbZ.js} +1 -1
- package/dist/assets/{download-DH4XAzhp.js → download-CX-M-1p7.js} +1 -1
- package/dist/assets/{drawer-BF8tPGkj.js → drawer-VnK7t36W.js} +1 -1
- package/dist/assets/{dropdown-Dxiw3zEy.js → dropdown-DXoh2CnL.js} +1 -1
- package/dist/assets/{dropdown-BPFUku-f.js → dropdown-j3knQBHD.js} +1 -1
- package/dist/assets/{ellipsis-Dne0PaxK.js → ellipsis-CRlBlm5I.js} +1 -1
- package/dist/assets/{esm-BLmcHm-_.js → esm-BIIIq0k6.js} +1 -1
- package/dist/assets/{esm-D3RGWycH.js → esm-BnjB1a-w.js} +1 -1
- package/dist/assets/{esm-D2EUd9-p.js → esm-DDysbSQY.js} +2 -2
- package/dist/assets/{esm-VF3xOK5d.js → esm-DWYXDiE1.js} +2 -2
- package/dist/assets/esm-LibIVarD.js +1 -0
- package/dist/assets/{esm-D48kK9Ia.js → esm-UTZ8SL6O.js} +3 -3
- package/dist/assets/{esm-DcMLRHGU.js → esm-Z60DZAoG.js} +1 -1
- package/dist/assets/{external-link-Y1fuqa_d.js → external-link-DRY9MBhg.js} +1 -1
- package/dist/assets/{eye-uumNqt6F.js → eye-DZkCrKJ_.js} +1 -1
- package/dist/assets/{file-B6BY8JCh.js → file-Yc-6a-e-.js} +1 -1
- package/dist/assets/{file-output-BRGppmHm.js → file-output-B8Tlktgm.js} +1 -1
- package/dist/assets/{file-text-BD_ZgyAJ.js → file-text-B9gevd-U.js} +1 -1
- package/dist/assets/{fish-D0SCi3ei.js → fish-BoQX54S5.js} +1 -1
- package/dist/assets/{flux-QvdaqKdp.js → flux-D_4i_-FC.js} +1 -1
- package/dist/assets/{folder-D8OqMpU-.js → folder-D28_V3sU.js} +1 -1
- package/dist/assets/gauge-BxJMhEjF.js +1 -0
- package/dist/assets/{globe-DogeYs6l.js → globe-lcGcyJ-S.js} +1 -1
- package/dist/assets/{grokvideo-DyWrWpO4.js → grokvideo-sSSLYi-n.js} +1 -1
- package/dist/assets/{hailuo-m02yWO8T.js → hailuo-v7jkrRK0.js} +1 -1
- package/dist/assets/{headphones-B24PnKmj.js → headphones-B2uibmS9.js} +1 -1
- package/dist/assets/{history-hh_iVs0t.js → history-Df5RJ_mT.js} +1 -1
- package/dist/assets/{house-DMuPgP0K.js → house-CGVOZdy7.js} +1 -1
- package/dist/assets/{image-4hDRDwRY.js → image-N4s0X2er.js} +1 -1
- package/dist/assets/{index-dzU0SACS.js → index-tKADgCY9.js} +3 -3
- package/dist/assets/{index.browser.esm-DEBg8Czw.js → index.browser.esm-BoJWDrUY.js} +1 -1
- package/dist/assets/{index.es-B_JRhb1z.js → index.es-DpUSIKd4.js} +1 -1
- package/dist/assets/{info-C7eq8W70.js → info-DTQ5Jj3H.js} +1 -1
- package/dist/assets/{input-number-DwjoHB_t.js → input-number-Bx2nlQp3.js} +1 -1
- package/dist/assets/{key-round-CbX1QjS3.js → key-round-CcMsFvcS.js} +1 -1
- package/dist/assets/{kling-Uz16T18I.js → kling-DE0R41ac.js} +1 -1
- package/dist/assets/{languages-kMgQhORN.js → languages-D1gPeJMk.js} +1 -1
- package/dist/assets/{laptop--KTFz907.js → laptop-DyL8Al1f.js} +1 -1
- package/dist/assets/{lightbulb-Btwo92TP.js → lightbulb-Cj8gYh-P.js} +1 -1
- package/dist/assets/{link-BHUi4UzQ.js → link-CI8y8JCR.js} +1 -1
- package/dist/assets/loader-circle-YN1fZjAA.js +1 -0
- package/dist/assets/{lock-HFF7LqQ6.js → lock-BePuXV1t.js} +1 -1
- package/dist/assets/{luma-B8gBcwfK.js → luma-QtePWfgh.js} +1 -1
- package/dist/assets/{maestro-DtHatUjf.js → maestro-DrvckkxS.js} +1 -1
- package/dist/assets/{mail-Cf8LFguX.js → mail-CqHkXfXh.js} +1 -1
- package/dist/assets/{message-circle-75uDV2HU.js → message-circle-Bep3nmcN.js} +1 -1
- package/dist/assets/{mic-U9HFofCv.js → mic-u_R_52zb.js} +1 -1
- package/dist/assets/{midjourney-DLsZDLHN.js → midjourney-BZITzhWe.js} +1 -1
- package/dist/assets/{mobileLocalExec-Jy6peL1O.js → mobileLocalExec-DPtGECym.js} +2 -2
- package/dist/assets/{monitor-CaLaxqsl.js → monitor-V1k4Wt17.js} +1 -1
- package/dist/assets/{mouse-pointer-2-OdaCocrT.js → mouse-pointer-2-CR02XkBx.js} +1 -1
- package/dist/assets/music-2-B1iWI6gb.js +1 -0
- package/dist/assets/{nanobanana-Dl-ipICX.js → nanobanana-BZN628q2.js} +1 -1
- package/dist/assets/{omni-CI7RALc3.js → omni-BP9bGSBs.js} +1 -1
- package/dist/assets/{openaiimage-x5VnybkH.js → openaiimage-BohTCOHS.js} +1 -1
- package/dist/assets/{pagination-C5nrzUF9.js → pagination-BnQgCM-x.js} +1 -1
- package/dist/assets/{pagination-DZKa3-YT.js → pagination-D99zvqj0.js} +1 -1
- package/dist/assets/{pagination-Bzi2EMHv.js → pagination-DYnUbk8K.js} +1 -1
- package/dist/assets/{palette-Dcz8R07T.js → palette-CvQ1FazR.js} +1 -1
- package/dist/assets/{paperclip-C9CPT-QH.js → paperclip-BWPa3VpV.js} +1 -1
- package/dist/assets/{pause-B7nZk56m.js → pause-DMZUztb6.js} +1 -1
- package/dist/assets/{pencil-DjYsRqzY.js → pencil-D5dsgh1k.js} +1 -1
- package/dist/assets/{pika-JthT3pXY.js → pika-Sw9xUd5h.js} +1 -1
- package/dist/assets/{pixverse-BdQw9oon.js → pixverse-B-JoN4G6.js} +1 -1
- package/dist/assets/play-CpF6eLfy.js +1 -0
- package/dist/assets/{plug-Pqr_YrfP.js → plug-wX_bvKAP.js} +1 -1
- package/dist/assets/plus-CK2JFYNP.js +1 -0
- package/dist/assets/{poivelle-BhoxBCwR.js → poivelle-DISA8VD4.js} +1 -1
- package/dist/assets/{popover-vu3TWrhj.js → popover-DUgpvcBG.js} +1 -1
- package/dist/assets/{producer-DqmOMlav.js → producer-BDNg0tcR.js} +1 -1
- package/dist/assets/{qrart-wpmoj2Md.js → qrart-ZUQz3J4q.js} +1 -1
- package/dist/assets/{realtime-Ce9utybp.js → realtime-CadXak-M.js} +1 -1
- package/dist/assets/{refresh-cw-CfsQ44rr.js → refresh-cw-DQ1-meTS.js} +1 -1
- package/dist/assets/rotate-ccw-CF8N1p9v.js +1 -0
- package/dist/assets/rotate-cw-DOllsvYy.js +1 -0
- package/dist/assets/{row-ig5nVOkc.js → row-B6o6HQls.js} +1 -1
- package/dist/assets/search-7Ly3KYfT.js +1 -0
- package/dist/assets/{seedance-tg7fYegi.js → seedance-DY7_nuMa.js} +1 -1
- package/dist/assets/{seedream-BN7uBnTq.js → seedream-CSuVYQvD.js} +1 -1
- package/dist/assets/{select--z-fac6_.js → select-CaXJ36xG.js} +1 -1
- package/dist/assets/{serp-B6cjTPwx.js → serp-ggTDzIHo.js} +1 -1
- package/dist/assets/{shield-DTxeqQnl.js → shield-BiAfGNET.js} +1 -1
- package/dist/assets/{shuffle-BGv-o6iw.js → shuffle-D4lblkpM.js} +1 -1
- package/dist/assets/{slider-7iC9uVCH.js → slider-pmMW-cMB.js} +1 -1
- package/dist/assets/{sliders-horizontal-BJThi7W3.js → sliders-horizontal-DaIPZ1NK.js} +1 -1
- package/dist/assets/{solana-wallets-BOOwBWgF.js → solana-wallets-DhqluL4O.js} +2 -2
- package/dist/assets/{solana-wallets-vue-CeTGdA4N.js → solana-wallets-vue-B4-fa4iq.js} +1 -1
- package/dist/assets/{sora-CmhEupYX.js → sora-MV08E5lI.js} +1 -1
- package/dist/assets/{sparkles-BXttUKHs.js → sparkles-Bs6XZiy8.js} +1 -1
- package/dist/assets/square-CqBdciij.js +1 -0
- package/dist/assets/{store-f5a0TlJm.js → store-BHbgBPeW.js} +1 -1
- package/dist/assets/{suno-CMpuwwKN.js → suno-CfI4CLgZ.js} +1 -1
- package/dist/assets/{switch-CU7Lbydn.js → switch-DGps_uPH.js} +1 -1
- package/dist/assets/{table-B1ktVOIV.js → table-C9iSQAZO.js} +1 -1
- package/dist/assets/{tabs-CMeHhbQd.js → tabs-Cv60oJMx.js} +1 -1
- package/dist/assets/{tag-D88Sfg4N.js → tag-CnEt0kh3.js} +1 -1
- package/dist/assets/terminal-CxpLlw3l.js +1 -0
- package/dist/assets/{time-picker-D3G4t_oE.js → time-picker-Dx9ubGKI.js} +1 -1
- package/dist/assets/{tooltip-CVVApYjJ.js → tooltip-kiynJmu_.js} +1 -1
- package/dist/assets/{trash-2-B7h9iX5Q.js → trash-2-NVpkdW0R.js} +1 -1
- package/dist/assets/{triangle-alert-C_NcfP7e.js → triangle-alert-DNESykEp.js} +1 -1
- package/dist/assets/{upload-DRjQvPEd.js → upload-B3hX6Wjm.js} +1 -1
- package/dist/assets/{upload-GC5EGmwp.js → upload-CtyDOjCb.js} +1 -1
- package/dist/assets/user-B_ZZzZTH.js +1 -0
- package/dist/assets/{veo-aFwNCFqW.js → veo-CoWKIJHu.js} +1 -1
- package/dist/assets/{video-DzECS7d8.js → video-CSc-7aSG.js} +1 -1
- package/dist/assets/{volume-2-P5c2kRYc.js → volume-2-D42rEd54.js} +1 -1
- package/dist/assets/{wallet-Dx1JWzUk.js → wallet-Cu4DWt4b.js} +1 -1
- package/dist/assets/{wan-BSz5Kzfp.js → wan-6VXEyQE5.js} +1 -1
- package/dist/assets/{wand-sparkles-BQfGRD0P.js → wand-sparkles-Dhrc68i4.js} +1 -1
- package/dist/assets/{web-CQd8Y7AZ.js → web-B29N341h.js} +1 -1
- package/dist/assets/{web-bobTX3fT.js → web-B8G4NzPr.js} +1 -1
- package/dist/assets/{web-sGhtaPRt.js → web-CyftV12H.js} +1 -1
- package/dist/assets/{web-Bd7fTTXa.js → web-ML2EoPjo.js} +1 -1
- package/dist/assets/{web-Jqmx6K36.js → web-_subBsVB.js} +1 -1
- package/dist/assets/{webextrator-Blj-ynVW.js → webextrator-DEMQXwei.js} +1 -1
- package/dist/assets/{zap-BAyq1MAX.js → zap-BayDgLEm.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/arrow-down-B47oLEZg.js +0 -1
- package/dist/assets/arrow-left-xCa4y53k.js +0 -1
- package/dist/assets/arrow-right-ZB-S5Hdw.js +0 -1
- package/dist/assets/arrow-up-BeYMyDMK.js +0 -1
- package/dist/assets/check-D47LmiyR.js +0 -1
- package/dist/assets/chevron-down-BumkMWkr.js +0 -1
- package/dist/assets/chevron-right-DJAkv6gb.js +0 -1
- package/dist/assets/circle-check-D5h_jiB2.js +0 -1
- package/dist/assets/clock-BbOTrjoQ.js +0 -1
- package/dist/assets/code-DIu2zrn0.js +0 -1
- package/dist/assets/esm-VeU-Svd3.js +0 -1
- package/dist/assets/gauge-kqBdc9W1.js +0 -1
- package/dist/assets/loader-circle-Chlmw50N.js +0 -1
- package/dist/assets/music-2-Bntsr1pc.js +0 -1
- package/dist/assets/play-D4UKBipL.js +0 -1
- package/dist/assets/plus-Yte47cek.js +0 -1
- package/dist/assets/rotate-ccw-C2vE6W20.js +0 -1
- package/dist/assets/rotate-cw-B3ZTq3Bo.js +0 -1
- package/dist/assets/search-Dd9GL0kL.js +0 -1
- package/dist/assets/square-DUN4iYgL.js +0 -1
- package/dist/assets/terminal-BXyA_hw_.js +0 -1
- package/dist/assets/user-DAcxFEzJ.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,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--z-fac6_.js";import{t as x}from"./upload-GC5EGmwp.js";import{t as S}from"./tooltip-CVVApYjJ.js";import{t as C}from"./alert-G37GiXIg.js";import{t as w}from"./drawer-BF8tPGkj.js";import{t as T}from"./input-number-DwjoHB_t.js";import{t as E}from"./switch-CU7Lbydn.js";import{t as D}from"./box-BTYdpeSs.js";import{t as O}from"./clock-BbOTrjoQ.js";import{n as k,r as A,t as j}from"./PromptTextarea-O8KxwMGn.js";import{t as M}from"./info-C7eq8W70.js";import{t as N}from"./trash-2-B7h9iX5Q.js";import{t as P}from"./triangle-alert-C_NcfP7e.js";import{t as F}from"./upload-DRjQvPEd.js";import{t as I}from"./volume-2-P5c2kRYc.js";import{t as L}from"./wand-sparkles-BQfGRD0P.js";import{Xt as R,Zt as ee,_n as z,an as te,cn as ne,dn as re,en as ie,fn as ae,hn as B,in as oe,ln as se,mn as V,nn as ce,on as le,pn as H,rn as ue,sn as de,tn as fe,un as pe}from"./constants-7uZLiijT.js";import{E as U,Gt as me,Kt as W,On as he,Sr as ge,Ti as G,Ut as _e,Wt as K,Yt as ve,ci as q,di as J,in as ye,qt as Y,wi as be,zi as X}from"./index-dzU0SACS.js";import{t as xe}from"./CopyToClipboard-DOx2-KTG.js";import{t as Z}from"./ImagePreview-CSSReHgL.js";import{n as Se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ce}from"./Consumption-JN0X0f8c.js";import{a as Q,n as we,r as Te,t as Ee}from"./pagination-DZKa3-YT.js";import{t as De}from"./VideoPlayer-BnwIjt1E.js";import{t as Oe}from"./ApiCodeButton-Ck-LkZnA.js";import{t as ke}from"./BotPlaceholder-SAI3U7Vk.js";import{t as Ae}from"./ImageWrapper-DkF7PVGL.js";import{n as je,t as Me}from"./AudioPreview-B-vGM5ZE.js";var Ne=v({name:`LayoutSeedance`,components:{MagicIcon:L,ElDrawer:w,ElButton:X},mixins:[Se]}),Pe={class:`main flex flex-row flex-1`},Fe={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)]`},Ie={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Le(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Pe,[e(`div`,Fe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ie,[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 Re=U(Ne,[[`render`,Le],[`__scopeId`,`data-v-ff53dce1`]]),ze=v({name:`SeedancePromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Be(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ve=U(ze,[[`render`,Be]]),He=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:te,label:this.$t(`seedance.model.seedance20`)},{value:le,label:this.$t(`seedance.model.seedance20Fast`)},{value:de,label:this.$t(`seedance.model.seedance20Mini`)},{value:oe,label:this.$t(`seedance.model.seedance15pro`)},{value:ce,label:this.$t(`seedance.model.seedance10pro`)},{value:ue,label:this.$t(`seedance.model.seedance10proFast`)},{value:fe,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:ie,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=R}}),Ue={class:`field`},We={class:`label`},Ge={class:`box`},Ke={class:`title font-bold`};function qe(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ue,[e(`div`,We,[e(`div`,Ge,[e(`h2`,Ke,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Je=U(He,[[`render`,qe],[`__scopeId`,`data-v-deb4c429`]]),Ye=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),Xe={class:`field`},Ze={class:`label`},Qe={class:`box`},$e={class:`title font-bold`};function et(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`div`,Qe,[e(`h2`,$e,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var tt=U(Ye,[[`render`,et],[`__scopeId`,`data-v-d61cc21b`]]),$={[V]:0,[B]:1,[H]:2,"4k":3},nt=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Q,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[{value:V,label:`480p`},{value:B,label:`720p`},{value:H,label:`1080p`},{value:`4k`,label:`4k`}],t=$[this.capability.maxResolution]??$[`1080p`];return e.map(e=>({...e,disabled:$[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),rt={class:`resolution`},it={class:`header`},at={class:`title font-bold`},ot={class:`items`},st=[`onClick`];function ct(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,ot,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,st)]),_:2},1032,[`content`,`disabled`]))),128))])])}var lt=U(nt,[[`render`,ct],[`__scopeId`,`data-v-db7e8aff`]]),ut=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:se,label:`16:9`,w:32,h:18},{value:re,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:pe,label:`21:9`,w:34,h:14},{value:ae,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=ee}}),dt={class:`ratio`},ft={class:`header`},pt={class:`title font-bold`},mt={class:`items`},ht=[`onClick`],gt={class:`preview`},_t={key:1,class:`rect rect-auto`},vt={class:`name`};function yt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,dt,[e(`div`,ft,[e(`h2`,pt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,mt,[(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`,gt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,_t,`A`))]),e(`div`,vt,i(r.label),1)],10,ht))),128))])])}var bt=U(ut,[[`render`,yt],[`__scopeId`,`data-v-8ddec2dd`]]),xt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:E,InfoIcon:Q},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return z(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),St={key:0,class:`field`},Ct={class:`label`},wt={class:`box`},Tt={class:`title font-bold`},Et={class:`value`};function Dt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`h2`,Tt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Et,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Ot=U(xt,[[`render`,Dt],[`__scopeId`,`data-v-df51dfbd`]]),kt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:E,InfoIcon:Q},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),At={class:`field`},jt={class:`label`},Mt={class:`box`},Nt={class:`title font-bold`},Pt={class:`value`};function Ft(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,At,[e(`div`,jt,[e(`div`,Mt,[e(`h2`,Nt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Pt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var It=U(kt,[[`render`,Ft],[`__scopeId`,`data-v-ae777d61`]]),Lt=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:F,ElUpload:x,ElButton:X,InfoIcon:Q,ImagePreview:Z},mixins:[Y,W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),Rt={key:0,class:`relative`},zt={class:`flex min-h-8 items-center pr-20`},Bt={class:`flex justify-start items-center`},Vt={class:`text-sm font-bold`},Ht={key:0,class:`required-badge`};function Ut(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`span`,Vt,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Ht,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Wt=U(Lt,[[`render`,Ut],[`__scopeId`,`data-v-1170578c`]]),Gt=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:F,ElUpload:x,ElButton:X,ImagePreview:Z,InfoIcon:Q},mixins:[Y,W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Kt={key:0,class:`relative`},qt={class:`flex min-h-8 items-center pr-20`},Jt={class:`flex justify-start items-center`},Yt={class:`text-sm font-bold`};function Xt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Kt,[e(`div`,qt,[e(`div`,Jt,[e(`span`,Yt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Zt=U(Gt,[[`render`,Xt],[`__scopeId`,`data-v-584f6ece`]]),Qt=v({name:`SeedanceReferenceImage`,components:{UploadIcon:F,ElUpload:x,ElButton:X,InfoIcon:Q,ImagePreview:Z},mixins:[Y,W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),$t={key:0,class:`relative`},en={class:`flex min-h-8 items-center pr-20`},tn={class:`flex justify-start items-center`},nn={class:`text-sm font-bold`};function rn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,$t,[e(`div`,en,[e(`div`,tn,[e(`span`,nn,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var an=U(Qt,[[`render`,rn],[`__scopeId`,`data-v-152c413d`]]),on=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:F,ElUpload:x,ElButton:X,InfoIcon:Q},mixins:[W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),sn={key:0,class:`relative`},cn={class:`flex min-h-8 items-center pr-20`},ln={class:`flex justify-start items-center`},un={class:`text-sm font-bold`};function dn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,sn,[e(`div`,cn,[e(`div`,ln,[e(`span`,un,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var fn=U(on,[[`render`,dn],[`__scopeId`,`data-v-0814e508`]]),pn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:F,ElUpload:x,ElButton:X,InfoIcon:Q},mixins:[W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),mn={key:0,class:`relative`},hn={class:`flex min-h-8 items-center pr-20`},gn={class:`flex justify-start items-center`},_n={class:`text-sm font-bold`};function vn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,mn,[e(`div`,hn,[e(`div`,gn,[e(`span`,_n,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var yn=U(pn,[[`render`,vn],[`__scopeId`,`data-v-fec4fcd6`]]),bn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:E,InfoIcon:Q},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return z(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),xn={key:0,class:`field`},Sn={class:`label`},Cn={class:`box`},wn={class:`title font-bold`},Tn={class:`value`};function En(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,xn,[e(`div`,Sn,[e(`div`,Cn,[e(`h2`,wn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Tn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Dn=U(bn,[[`render`,En],[`__scopeId`,`data-v-edea5451`]]),On=v({name:`SeedanceSeedInput`,components:{ElInputNumber:T,InfoIcon:Q},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),kn={class:`field`},An={class:`label`},jn={class:`box`},Mn={class:`title font-bold`},Nn={class:`value`};function Pn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,kn,[e(`div`,An,[e(`div`,jn,[e(`h2`,Mn,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Nn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Fn=v({name:`SeedanceConfigPanel`,components:{MagicIcon:L,ElButton:X,PromptInput:Ve,ModelSelector:Je,DurationSelector:tt,ResolutionSelector:lt,RatioSelector:bt,GenerateAudioSwitch:Ot,CameraFixedSwitch:It,ReturnLastFrameSwitch:Dn,SeedInput:U(On,[[`render`,Pn],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:Wt,LastFrameImage:Zt,ReferenceImage:an,ReferenceAudio:fn,ReferenceVideo:yn,Consumption:Ce},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ve(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),In={class:`flex flex-col h-full`},Ln={class:`flex-1 overflow-y-auto p-5`},Rn={class:`flex flex-col items-center justify-center px-5 pb-5`};function zn(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`generate-audio-switch`),b=l(`camera-fixed-switch`),x=l(`return-last-frame-switch`),S=l(`seed-input`),C=l(`first-frame-image`),w=l(`last-frame-image`),T=l(`reference-image`),E=l(`reference-audio`),D=l(`reference-video`),O=l(`consumption`),k=l(`magic-icon`),A=l(`el-button`);return g(),s(`div`,In,[e(`div`,Ln,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(D,{class:`mb-4`})]),e(`div`,Rn,[a(O,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Bn=U(Fn,[[`render`,zn]]),Vn=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:N,ApplicationIcon:D,ChannelIcon:A,FullscreenIcon:k,InfoIcon:M,MagicIcon:L,TimeIcon:O,VolumeIcon:I,WarningIcon:P,CopyToClipboard:xe,ElAlert:C,VideoPlayer:De,ElTooltip:S,ElButton:X,ImageWrapper:Ae,ImagePreview:Z,AudioPreview:Me,VideoPreview:je,ApiCodeButton:Oe},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await be.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(`seedance/deleteTask`,{id:e}),G.success(this.$t(`common.message.deleteTaskSuccess`))}catch{G.error(this.$t(`common.message.deleteTaskFailed`))}}},collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Hn={class:`preview`},Un={class:`left`},Wn={class:`main`},Gn={class:`bot`},Kn={class:`datetime`},qn=[`aria-label`],Jn={class:`info`},Yn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Xn={key:1,class:`prompt mt-2`},Zn={key:0},Qn={key:1},$n={key:0,class:n({content:!0})},er={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tr={key:1,class:n({content:!0})},nr={key:0,class:`mb-4`},rr={key:1,class:`mb-4`},ir={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},ar={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},or={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:0},lr={key:1},ur={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},mr={key:2,class:n({content:!0})},hr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_r={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},yr={key:3,class:n({content:!0})},br={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Sr(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`video-preview`),T=l(`time-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`),k=l(`video-player`),A=l(`image-wrapper`),j=l(`el-button`),M=l(`api-code-button`),N=l(`application-icon`),P=l(`fullscreen-icon`),F=l(`volume-icon`),I=l(`channel-icon`),L=l(`warning-icon`),R=l(`info-icon`);return g(),s(`div`,Hn,[e(`div`,Un,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Wn,[e(`div`,Gn,[a(y,{capability:`seedance`,part:`name`}),e(`span`,Kn,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,qn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Jn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Yn,[(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.referenceAudios,(e,t)=>(g(),f(C,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(w,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Xn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Qn,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Zn,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,tr,[n.video?.video_url?(g(),s(`div`,nr,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,rr,[a(A,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,ir,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(j,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(M,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,ar,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,or,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,sr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,cr,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,lr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,ur,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,dr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,fr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,pr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{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`,mr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,hr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,gr,[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,_r,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,vr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,yr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,br,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,xr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,$n,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,er,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var Cr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:U(Vn,[[`render`,Sr],[`__scopeId`,`data-v-87665265`]]),BotPlaceholder:ke,NoTasks:Te,ScrollList:we},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),wr={key:0},Tr={key:2,class:`w-full h-full flex items-center justify-center`};function Er(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`,wr,[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`,Tr,[a(v)])):o(``,!0)],64)}var Dr=U(Cr,[[`render`,Er]]),Or=new Set(Object.keys(ne)),kr=e=>Array.isArray(e)?e.filter(e=>!!e?.url):[];function Ar(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!Or.has(t.model))return{reject:`modelUnsupported`};let n=z(t.model);t.images=kr(t.images);let r=t.images.some(e=>e.role===`first_frame`),i=t.images.some(e=>e.role===`last_frame`);!r&&i&&(t.images=t.images.map(e=>e.role===`last_frame`?{...e,role:`first_frame`}:e));let a=t.images.length>0;if(a||delete t.images,delete t.service_tier,!n.acceptsImage&&a)return{reject:`modelRejectsImage`};if(!n.acceptsAudio&&t.generate_audio&&(t.generate_audio=!1),!n.acceptsReturnLastFrame&&t.return_last_frame&&(t.return_last_frame=!1),!n.acceptsLastFrame&&a&&(t.images=t.images.filter(e=>e.role!==`last_frame`),a=t.images.length>0,a||delete t.images),n.acceptsReferenceAudio&&Array.isArray(t.audios)&&(t.audios=t.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(t.audios)||t.audios.length===0)&&delete t.audios,n.acceptsReferenceVideo&&Array.isArray(t.videos)&&(t.videos=t.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(t.videos)||t.videos.length===0)&&delete t.videos,!n.acceptsReferenceImage&&Array.isArray(t.images)&&(t.images=t.images.filter(e=>e.role!==`reference_image`),t.images.length===0&&delete t.images),a=Array.isArray(t.images)&&t.images.length>0,n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0;return Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o?{reject:`audioRequiresReference`}:{request:{...t,async:!0}}}var jr=v({name:`SeedanceIndex`,components:{ConfigPanel:Bn,Layout:Re,RecentPanel:Dr},mixins:[me],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===q.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Ee({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!_e(this.uploadTracker,e=>this.$t(e),e=>G.warning(e)))return;let{request:e,reject:t}=Ar(this.config);if(t){G.warning(this.$t(`seedance.message.${t}`));return}if(!e||!ye())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}G.info(this.$t(`seedance.message.startingTask`)),ge(`seedance`,he.generate(e,{token:n})).then(()=>{G.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?G.error(this.$t(`seedance.message.usedUp`)):G.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Mr(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 Nr=U(jr,[[`render`,Mr]]);export{Nr as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-CaXJ36xG.js";import{t as x}from"./upload-CtyDOjCb.js";import{t as S}from"./tooltip-kiynJmu_.js";import{t as C}from"./alert-CjaV4VyH.js";import{t as w}from"./drawer-VnK7t36W.js";import{t as T}from"./input-number-Bx2nlQp3.js";import{t as E}from"./switch-DGps_uPH.js";import{t as D}from"./box-BEEkIbso.js";import{t as O}from"./clock-BurpmIb0.js";import{n as k,r as A,t as j}from"./PromptTextarea-CjqyhQn4.js";import{t as M}from"./info-DTQ5Jj3H.js";import{t as N}from"./trash-2-NVpkdW0R.js";import{t as P}from"./triangle-alert-DNESykEp.js";import{t as F}from"./upload-B3hX6Wjm.js";import{t as I}from"./volume-2-D42rEd54.js";import{t as L}from"./wand-sparkles-Dhrc68i4.js";import{Xt as R,Zt as ee,_n as z,an as te,cn as ne,dn as re,en as ie,fn as ae,hn as B,in as oe,ln as se,mn as V,nn as ce,on as le,pn as H,rn as ue,sn as de,tn as fe,un as pe}from"./constants-7uZLiijT.js";import{E as U,Gt as me,Kt as W,On as he,Sr as ge,Ti as G,Ut as _e,Wt as K,Yt as ve,ci as q,di as J,in as ye,qt as Y,wi as be,zi as X}from"./index-tKADgCY9.js";import{t as xe}from"./CopyToClipboard-DPVMD9O4.js";import{t as Z}from"./ImagePreview-3Js4rEnR.js";import{n as Se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ce}from"./Consumption-CJEO0Oqt.js";import{a as Q,n as we,r as Te,t as Ee}from"./pagination-D99zvqj0.js";import{t as De}from"./VideoPlayer-DTaZaNPe.js";import{t as Oe}from"./ApiCodeButton-nUA4iGNl.js";import{t as ke}from"./BotPlaceholder-DQbI2r9r.js";import{t as Ae}from"./ImageWrapper-DV-01ruL.js";import{n as je,t as Me}from"./AudioPreview-XDhwGk3A.js";var Ne=v({name:`LayoutSeedance`,components:{MagicIcon:L,ElDrawer:w,ElButton:X},mixins:[Se]}),Pe={class:`main flex flex-row flex-1`},Fe={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)]`},Ie={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Le(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Pe,[e(`div`,Fe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ie,[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 Re=U(Ne,[[`render`,Le],[`__scopeId`,`data-v-ff53dce1`]]),ze=v({name:`SeedancePromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Be(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ve=U(ze,[[`render`,Be]]),He=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:te,label:this.$t(`seedance.model.seedance20`)},{value:le,label:this.$t(`seedance.model.seedance20Fast`)},{value:de,label:this.$t(`seedance.model.seedance20Mini`)},{value:oe,label:this.$t(`seedance.model.seedance15pro`)},{value:ce,label:this.$t(`seedance.model.seedance10pro`)},{value:ue,label:this.$t(`seedance.model.seedance10proFast`)},{value:fe,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:ie,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=R}}),Ue={class:`field`},We={class:`label`},Ge={class:`box`},Ke={class:`title font-bold`};function qe(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ue,[e(`div`,We,[e(`div`,Ge,[e(`h2`,Ke,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Je=U(He,[[`render`,qe],[`__scopeId`,`data-v-deb4c429`]]),Ye=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),Xe={class:`field`},Ze={class:`label`},Qe={class:`box`},$e={class:`title font-bold`};function et(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Xe,[e(`div`,Ze,[e(`div`,Qe,[e(`h2`,$e,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var tt=U(Ye,[[`render`,et],[`__scopeId`,`data-v-d61cc21b`]]),$={[V]:0,[B]:1,[H]:2,"4k":3},nt=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Q,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[{value:V,label:`480p`},{value:B,label:`720p`},{value:H,label:`1080p`},{value:`4k`,label:`4k`}],t=$[this.capability.maxResolution]??$[`1080p`];return e.map(e=>({...e,disabled:$[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),rt={class:`resolution`},it={class:`header`},at={class:`title font-bold`},ot={class:`items`},st=[`onClick`];function ct(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,ot,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,st)]),_:2},1032,[`content`,`disabled`]))),128))])])}var lt=U(nt,[[`render`,ct],[`__scopeId`,`data-v-db7e8aff`]]),ut=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:se,label:`16:9`,w:32,h:18},{value:re,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:pe,label:`21:9`,w:34,h:14},{value:ae,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=ee}}),dt={class:`ratio`},ft={class:`header`},pt={class:`title font-bold`},mt={class:`items`},ht=[`onClick`],gt={class:`preview`},_t={key:1,class:`rect rect-auto`},vt={class:`name`};function yt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,dt,[e(`div`,ft,[e(`h2`,pt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,mt,[(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`,gt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,_t,`A`))]),e(`div`,vt,i(r.label),1)],10,ht))),128))])])}var bt=U(ut,[[`render`,yt],[`__scopeId`,`data-v-8ddec2dd`]]),xt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:E,InfoIcon:Q},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return z(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),St={key:0,class:`field`},Ct={class:`label`},wt={class:`box`},Tt={class:`title font-bold`},Et={class:`value`};function Dt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`h2`,Tt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Et,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Ot=U(xt,[[`render`,Dt],[`__scopeId`,`data-v-df51dfbd`]]),kt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:E,InfoIcon:Q},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),At={class:`field`},jt={class:`label`},Mt={class:`box`},Nt={class:`title font-bold`},Pt={class:`value`};function Ft(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,At,[e(`div`,jt,[e(`div`,Mt,[e(`h2`,Nt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Pt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var It=U(kt,[[`render`,Ft],[`__scopeId`,`data-v-ae777d61`]]),Lt=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:F,ElUpload:x,ElButton:X,InfoIcon:Q,ImagePreview:Z},mixins:[Y,W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),Rt={key:0,class:`relative`},zt={class:`flex min-h-8 items-center pr-20`},Bt={class:`flex justify-start items-center`},Vt={class:`text-sm font-bold`},Ht={key:0,class:`required-badge`};function Ut(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`span`,Vt,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Ht,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Wt=U(Lt,[[`render`,Ut],[`__scopeId`,`data-v-1170578c`]]),Gt=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:F,ElUpload:x,ElButton:X,ImagePreview:Z,InfoIcon:Q},mixins:[Y,W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Kt={key:0,class:`relative`},qt={class:`flex min-h-8 items-center pr-20`},Jt={class:`flex justify-start items-center`},Yt={class:`text-sm font-bold`};function Xt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Kt,[e(`div`,qt,[e(`div`,Jt,[e(`span`,Yt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Zt=U(Gt,[[`render`,Xt],[`__scopeId`,`data-v-584f6ece`]]),Qt=v({name:`SeedanceReferenceImage`,components:{UploadIcon:F,ElUpload:x,ElButton:X,InfoIcon:Q,ImagePreview:Z},mixins:[Y,W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),$t={key:0,class:`relative`},en={class:`flex min-h-8 items-center pr-20`},tn={class:`flex justify-start items-center`},nn={class:`text-sm font-bold`};function rn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,$t,[e(`div`,en,[e(`div`,tn,[e(`span`,nn,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var an=U(Qt,[[`render`,rn],[`__scopeId`,`data-v-152c413d`]]),on=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:F,ElUpload:x,ElButton:X,InfoIcon:Q},mixins:[W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),sn={key:0,class:`relative`},cn={class:`flex min-h-8 items-center pr-20`},ln={class:`flex justify-start items-center`},un={class:`text-sm font-bold`};function dn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,sn,[e(`div`,cn,[e(`div`,ln,[e(`span`,un,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var fn=U(on,[[`render`,dn],[`__scopeId`,`data-v-0814e508`]]),pn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:F,ElUpload:x,ElButton:X,InfoIcon:Q},mixins:[W,K],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){G.warning(this.$t(`seedance.message.uploadExceed`))},onError(){G.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),mn={key:0,class:`relative`},hn={class:`flex min-h-8 items-center pr-20`},gn={class:`flex justify-start items-center`},_n={class:`text-sm font-bold`};function vn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,mn,[e(`div`,hn,[e(`div`,gn,[e(`span`,_n,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var yn=U(pn,[[`render`,vn],[`__scopeId`,`data-v-fec4fcd6`]]),bn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:E,InfoIcon:Q},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return z(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),xn={key:0,class:`field`},Sn={class:`label`},Cn={class:`box`},wn={class:`title font-bold`},Tn={class:`value`};function En(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,xn,[e(`div`,Sn,[e(`div`,Cn,[e(`h2`,wn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Tn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Dn=U(bn,[[`render`,En],[`__scopeId`,`data-v-edea5451`]]),On=v({name:`SeedanceSeedInput`,components:{ElInputNumber:T,InfoIcon:Q},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),kn={class:`field`},An={class:`label`},jn={class:`box`},Mn={class:`title font-bold`},Nn={class:`value`};function Pn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,kn,[e(`div`,An,[e(`div`,jn,[e(`h2`,Mn,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Nn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Fn=v({name:`SeedanceConfigPanel`,components:{MagicIcon:L,ElButton:X,PromptInput:Ve,ModelSelector:Je,DurationSelector:tt,ResolutionSelector:lt,RatioSelector:bt,GenerateAudioSwitch:Ot,CameraFixedSwitch:It,ReturnLastFrameSwitch:Dn,SeedInput:U(On,[[`render`,Pn],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:Wt,LastFrameImage:Zt,ReferenceImage:an,ReferenceAudio:fn,ReferenceVideo:yn,Consumption:Ce},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ve(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),In={class:`flex flex-col h-full`},Ln={class:`flex-1 overflow-y-auto p-5`},Rn={class:`flex flex-col items-center justify-center px-5 pb-5`};function zn(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`generate-audio-switch`),b=l(`camera-fixed-switch`),x=l(`return-last-frame-switch`),S=l(`seed-input`),C=l(`first-frame-image`),w=l(`last-frame-image`),T=l(`reference-image`),E=l(`reference-audio`),D=l(`reference-video`),O=l(`consumption`),k=l(`magic-icon`),A=l(`el-button`);return g(),s(`div`,In,[e(`div`,Ln,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(D,{class:`mb-4`})]),e(`div`,Rn,[a(O,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Bn=U(Fn,[[`render`,zn]]),Vn=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:N,ApplicationIcon:D,ChannelIcon:A,FullscreenIcon:k,InfoIcon:M,MagicIcon:L,TimeIcon:O,VolumeIcon:I,WarningIcon:P,CopyToClipboard:xe,ElAlert:C,VideoPlayer:De,ElTooltip:S,ElButton:X,ImageWrapper:Ae,ImagePreview:Z,AudioPreview:Me,VideoPreview:je,ApiCodeButton:Oe},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await be.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(`seedance/deleteTask`,{id:e}),G.success(this.$t(`common.message.deleteTaskSuccess`))}catch{G.error(this.$t(`common.message.deleteTaskFailed`))}}},collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Hn={class:`preview`},Un={class:`left`},Wn={class:`main`},Gn={class:`bot`},Kn={class:`datetime`},qn=[`aria-label`],Jn={class:`info`},Yn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Xn={key:1,class:`prompt mt-2`},Zn={key:0},Qn={key:1},$n={key:0,class:n({content:!0})},er={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tr={key:1,class:n({content:!0})},nr={key:0,class:`mb-4`},rr={key:1,class:`mb-4`},ir={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},ar={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},or={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:0},lr={key:1},ur={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},mr={key:2,class:n({content:!0})},hr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_r={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},yr={key:3,class:n({content:!0})},br={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Sr(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`video-preview`),T=l(`time-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`),k=l(`video-player`),A=l(`image-wrapper`),j=l(`el-button`),M=l(`api-code-button`),N=l(`application-icon`),P=l(`fullscreen-icon`),F=l(`volume-icon`),I=l(`channel-icon`),L=l(`warning-icon`),R=l(`info-icon`);return g(),s(`div`,Hn,[e(`div`,Un,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Wn,[e(`div`,Gn,[a(y,{capability:`seedance`,part:`name`}),e(`span`,Kn,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,qn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Jn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Yn,[(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.referenceAudios,(e,t)=>(g(),f(C,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(w,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Xn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Qn,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Zn,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,tr,[n.video?.video_url?(g(),s(`div`,nr,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,rr,[a(A,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,ir,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(j,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(M,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,ar,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,or,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,sr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,cr,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,lr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,ur,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,dr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,fr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,pr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{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`,mr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,hr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,gr,[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,_r,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,vr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,yr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,br,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,xr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,$n,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,er,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var Cr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:U(Vn,[[`render`,Sr],[`__scopeId`,`data-v-87665265`]]),BotPlaceholder:ke,NoTasks:Te,ScrollList:we},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),wr={key:0},Tr={key:2,class:`w-full h-full flex items-center justify-center`};function Er(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`,wr,[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`,Tr,[a(v)])):o(``,!0)],64)}var Dr=U(Cr,[[`render`,Er]]),Or=new Set(Object.keys(ne)),kr=e=>Array.isArray(e)?e.filter(e=>!!e?.url):[];function Ar(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!Or.has(t.model))return{reject:`modelUnsupported`};let n=z(t.model);t.images=kr(t.images);let r=t.images.some(e=>e.role===`first_frame`),i=t.images.some(e=>e.role===`last_frame`);!r&&i&&(t.images=t.images.map(e=>e.role===`last_frame`?{...e,role:`first_frame`}:e));let a=t.images.length>0;if(a||delete t.images,delete t.service_tier,!n.acceptsImage&&a)return{reject:`modelRejectsImage`};if(!n.acceptsAudio&&t.generate_audio&&(t.generate_audio=!1),!n.acceptsReturnLastFrame&&t.return_last_frame&&(t.return_last_frame=!1),!n.acceptsLastFrame&&a&&(t.images=t.images.filter(e=>e.role!==`last_frame`),a=t.images.length>0,a||delete t.images),n.acceptsReferenceAudio&&Array.isArray(t.audios)&&(t.audios=t.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(t.audios)||t.audios.length===0)&&delete t.audios,n.acceptsReferenceVideo&&Array.isArray(t.videos)&&(t.videos=t.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(t.videos)||t.videos.length===0)&&delete t.videos,!n.acceptsReferenceImage&&Array.isArray(t.images)&&(t.images=t.images.filter(e=>e.role!==`reference_image`),t.images.length===0&&delete t.images),a=Array.isArray(t.images)&&t.images.length>0,n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0;return Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o?{reject:`audioRequiresReference`}:{request:{...t,async:!0}}}var jr=v({name:`SeedanceIndex`,components:{ConfigPanel:Bn,Layout:Re,RecentPanel:Dr},mixins:[me],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===q.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Ee({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!_e(this.uploadTracker,e=>this.$t(e),e=>G.warning(e)))return;let{request:e,reject:t}=Ar(this.config);if(t){G.warning(this.$t(`seedance.message.${t}`));return}if(!e||!ye())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}G.info(this.$t(`seedance.message.startingTask`)),ge(`seedance`,he.generate(e,{token:n})).then(()=>{G.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?G.error(this.$t(`seedance.message.usedUp`)):G.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Mr(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 Nr=U(jr,[[`render`,Mr]]);export{Nr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select--z-fac6_.js";import{t as x}from"./upload-GC5EGmwp.js";import{t as S}from"./tooltip-CVVApYjJ.js";import{t as C}from"./alert-G37GiXIg.js";import{t as w}from"./drawer-BF8tPGkj.js";import{t as T}from"./input-number-DwjoHB_t.js";import{t as E}from"./box-BTYdpeSs.js";import{t as D}from"./clock-BbOTrjoQ.js";import{r as O,t as k}from"./PromptTextarea-O8KxwMGn.js";import{t as A}from"./image-4hDRDwRY.js";import{t as j}from"./info-C7eq8W70.js";import{t as M}from"./trash-2-B7h9iX5Q.js";import{t as N}from"./triangle-alert-C_NcfP7e.js";import{t as P}from"./upload-DRjQvPEd.js";import{t as F}from"./wand-sparkles-BQfGRD0P.js";import{t as I}from"./zap-BAyq1MAX.js";import{An as ee,Cn as L,Dn as te,En as R,On as ne,Sn as z,Tn as B,jn as V,vn as re,wn as H,xn as U,yn as W}from"./constants-7uZLiijT.js";import{E as G,Gt as ie,Kt as ae,Sr as oe,Ti as K,Ut as se,Wt as ce,Yt as le,ci as q,di as ue,in as de,kn as fe,qt as pe,wi as J,zi as Y}from"./index-dzU0SACS.js";import{t as me}from"./CopyToClipboard-DOx2-KTG.js";import{t as X}from"./ImagePreview-CSSReHgL.js";import{n as he}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ge}from"./Consumption-JN0X0f8c.js";import{a as Z,n as _e,r as ve,t as ye}from"./pagination-DZKa3-YT.js";import{t as be}from"./ApiCodeButton-Ck-LkZnA.js";import{t as xe}from"./BotPlaceholder-SAI3U7Vk.js";import{t as Se}from"./ImageWrapper-DkF7PVGL.js";var Ce=_({name:`LayoutSeedream`,components:{MagicIcon:F,ElDrawer:w,ElButton:Y},mixins:[he]}),we={class:`main flex flex-row flex-1`},Te={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)]`},Ee={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function De(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,we,[e(`div`,Te,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ee,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Oe=G(Ce,[[`render`,De],[`__scopeId`,`data-v-c10167d0`]]),ke=_({name:`SeedreamPromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ae(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var je=G(ke,[[`render`,Ae]]),Me={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function Q(e){switch(e){case B:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!1};case H:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case L:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case z:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case U:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:W[U],outputFormat:!1,tools:!1};case R:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:W[R],outputFormat:!1,tools:!1};default:return Me}}function Ne(e,t){let n=Q(e);return n.imageRequired||n.image&&t?.length?`edit`:`generate`}var Pe=[`1K`,`2K`,`3K`,`4K`];function Fe(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=Q(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(Pe.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function Ie(e,t,n){let r={...e},i=Q(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var Le=_({name:`SeedreamImageInput`,components:{UploadIcon:P,ElUpload:x,ElButton:Y,InfoIcon:Z,ImagePreview:X},mixins:[pe,ae,ce],data(){return{fileList:[],uploadUrl:ue()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return Q(this.model).image}},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.onSetImages()},onExceed(){K.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){K.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Re={key:0},ze={class:`field`},Be={class:`label`},Ve={class:`box`},He={class:`title font-bold`},Ue={class:`value`},We={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Ge(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`div`,Ve,[e(`h2`,He,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Ue,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,We,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{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))])])):o(``,!0)}var Ke=G(Le,[[`render`,Ge],[`__scopeId`,`data-v-fef518c4`]]),qe=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{revertKey:0,options:[{value:B,label:this.$t(`seedream.model.seedream50pro`)},{value:H,label:this.$t(`seedream.model.seedream50`)},{value:L,label:this.$t(`seedream.model.seedream45`)},{value:z,label:this.$t(`seedream.model.seedream40`)},{value:U,label:this.$t(`seedream.model.seedream30t2i`)},{value:R,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(re)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Fe(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Ie({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),K.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),Je={class:`field`},Ye={class:`label`},Xe={class:`box`},Ze={class:`title font-bold`};function Qe(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Je,[e(`div`,Ye,[e(`div`,Xe,[e(`h2`,Ze,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var $e=G(qe,[[`render`,Qe],[`__scopeId`,`data-v-6413c179`]]),et=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:Z},data(){return{SEEDREAM_SIZE_ADAPTIVE:ee,pixelOptions:ne}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Q(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),tt={class:`field`},nt={class:`label`},rt={class:`box`},it={class:`title font-bold`};function at(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`h2`,it,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.capabilities.sizeAdaptive?(h(),f(y,{key:1,label:t.$t(`seedream.size.group.adaptive`)},{default:p(()=>[(h(),f(v,{key:t.SEEDREAM_SIZE_ADAPTIVE,label:t.$t(`seedream.size.adaptive`),value:t.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var ot=G(et,[[`render`,at],[`__scopeId`,`data-v-dd7bd021`]]),st=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:T,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),ct={key:0,class:`field`},lt={class:`label`},ut={class:`box`},dt={class:`title font-bold`},ft={class:`value`};function pt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`h2`,dt,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,ft,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var mt=G(st,[[`render`,pt],[`__scopeId`,`data-v-f079fd20`]]),ht=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[...te]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),gt={key:0,class:`field`},_t={class:`label`},vt={class:`box`},yt={class:`title font-bold`};function bt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,gt,[e(`div`,_t,[e(`div`,vt,[e(`h2`,yt,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var xt=G(ht,[[`render`,bt],[`__scopeId`,`data-v-69ea4c07`]]),St=_({name:`SeedreamSeedInput`,components:{ElInputNumber:T,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),Ct={key:0,class:`field`},wt={class:`label`},Tt={class:`box`},Et={class:`title font-bold`},Dt={class:`value`};function Ot(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,Ct,[e(`div`,wt,[e(`div`,Tt,[e(`h2`,Et,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Dt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var kt=G(St,[[`render`,Ot],[`__scopeId`,`data-v-10cdc1e0`]]),At=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:T,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).guidanceScale},defaultValue(){return Q(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),jt={key:0,class:`field`},Mt={class:`label`},Nt={class:`box`},Pt={class:`title font-bold`},Ft={class:`value`};function It(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,jt,[e(`div`,Mt,[e(`div`,Nt,[e(`h2`,Pt,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,Ft,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var Lt=G(At,[[`render`,It],[`__scopeId`,`data-v-7386f064`]]),$=e=>{let t={...e||{}},n=Ne(t.model,t.image);return delete t.action,t.watermark=!1,(n!==`edit`||!t.image?.length)&&delete t.image,t.size||delete t.size,t.sequential_image_generation!==`auto`&&delete t.sequential_image_generation_options,{...t,async:!0}},Rt=_({name:`SeedreamConfigPanel`,components:{MagicIcon:F,ElButton:Y,PromptInput:je,Consumption:ge,ImageInput:Ke,ModelSelector:$e,SizeSelector:ot,MaxImagesSelector:mt,OutputFormatSelector:xt,SeedInput:kt,GuidanceScaleInput:Lt},emits:[`generate`],computed:{action(){return Ne(this.config?.model,this.config?.image)},capabilities(){return Q(this.config?.model)},config(){return this.$store.state.seedream?.config},consumption(){let e=$(this.config),t=e.sequential_image_generation===`auto`?Math.max(1,Math.floor(e.sequential_image_generation_options?.max_images||1)):1;return le({...e,action:this.action,model:V(e.model),input_image_count:e.image?.length||0,count:t},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),zt={class:`flex flex-col h-full`},Bt={class:`flex-1 overflow-y-auto p-5`},Vt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ht(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`seed-input`),x=l(`guidance-scale-input`),S=l(`prompt-input`),C=l(`image-input`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,zt,[e(`div`,Bt,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),t.capabilities.image?(h(),f(C,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,Vt,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(E,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Ut=G(Rt,[[`render`,Ht]]),Wt=_({name:`SeedreamTaskPreview`,components:{DeleteIcon:M,ApplicationIcon:E,ChannelIcon:O,ImageIcon:A,InfoIcon:j,LightningIcon:I,MagicIcon:F,TimeIcon:D,WarningIcon:N,CopyToClipboard:me,ElAlert:C,ImageWrapper:Se,ElButton:Y,ElTooltip:S,ImagePreview:X,ApiCodeButton:be},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return $(this.modelValue?.request)},isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await J.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(`seedream/deleteTask`,{id:e}),K.success(this.$t(`common.message.deleteTaskSuccess`))}catch{K.error(this.$t(`common.message.deleteTaskFailed`))}}},shortModel(e){return V(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Gt={class:`preview`},Kt={class:`left`},qt={class:`main`},Jt={class:`bot`},Yt={class:`datetime`},Xt=[`aria-label`],Zt={class:`info`},Qt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},$t={key:1,class:`prompt mt-2`},en={key:0},tn={key:0,class:n({content:!0})},nn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},rn={key:1,class:n({content:!0,failed:!0})},an={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},on={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},un={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},pn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_n={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},bn={key:3,class:n({content:!0})},xn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Cn(u,d,g,_,v,y){let b=l(`capability-presentation`),x=l(`delete-icon`),S=l(`el-tooltip`),C=l(`image-preview`),w=l(`time-icon`),T=l(`magic-icon`),E=l(`copy-to-clipboard`),D=l(`el-alert`),O=l(`image-wrapper`),k=l(`el-button`),A=l(`api-code-button`),j=l(`application-icon`),M=l(`image-icon`),N=l(`lightning-icon`),P=l(`channel-icon`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,Gt,[e(`div`,Kt,[a(b,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,qt,[e(`div`,Jt,[a(b,{capability:`seedream`,part:`name`}),e(`span`,Yt,i(u.$dayjs.format(``+new Date(parseFloat((u.modelValue?.created_at||``).toString())*1e3))),1),a(S,{effect:`dark`,content:u.$t(`common.button.delete`),placement:`top`},{default:p(()=>[u.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":u.$t(`common.button.delete`),onClick:d[0]||=t((...e)=>u.onDelete&&u.onDelete(...e),[`stop`])},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Xt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Zt,[Array.isArray(u.modelValue?.request?.image)&&u.modelValue?.request?.image.length>0?(h(),s(`div`,Qt,[(h(!0),s(c,null,m(u.modelValue?.request?.image,(e,t)=>(h(),f(C,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),u.modelValue?.request?.prompt?(h(),s(`p`,$t,[r(i(u.modelValue?.request?.prompt)+` `,1),u.modelValue?.response?o(``,!0):(h(),s(`span`,en,` - (`+i(u.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),u.modelValue?.response?u.modelValue?.response?.success===!0?(h(),s(`div`,rn,[e(`div`,an,[(h(!0),s(c,null,m(u.images,(e,t)=>(h(),f(O,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,on,[a(S,{class:`box-item`,effect:`dark`,content:u.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(k,{type:`info`,size:`small`,class:`btn-action`,onClick:d[1]||=t(e=>u.onEdit(u.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(u.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(A,{path:`/seedream/images`,body:u.apiRequest},null,8,[`body`])]),a(D,{closable:!1,class:`mt-2 success`},{default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,sn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,cn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,ln,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,un,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(E,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),u.modelValue?.elapsed?(h(),s(`p`,dn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,fn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(E,{content:u.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):u.modelValue?.response?.success===!1?(h(),s(`div`,{key:2,class:n({content:!0,"mt-[15px]":!u.modelValue?.request?.prompt})},[a(D,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failure`)),1)]),default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,pn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,mn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,hn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,gn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(E,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.error?.message?(h(),s(`p`,_n,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failureReason`))+`: `+i(u.modelValue?.response?.error?.message)+` `,1),a(E,{content:u.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),u.modelValue?.elapsed?(h(),s(`p`,vn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,yn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(E,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})],2)):(h(),s(`div`,bn,[a(D,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,xn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(E,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.trace_id?(h(),s(`p`,Sn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(E,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,tn,[a(D,{closable:!1,class:`info`},{template:p(()=>[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,nn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(E,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var wn=_({name:`SeedreamRecentPanel`,components:{TaskPreview:G(Wt,[[`render`,Cn],[`__scopeId`,`data-v-394e4796`]]),BotPlaceholder:xe,NoTasks:ve,ScrollList:_e},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Tn={key:0},En={key:2,class:`w-full h-full flex items-center justify-center`};function Dn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Tn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{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:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,En,[a(v)])):o(``,!0)],64)}var On=_({name:`SeedreamIndex`,components:{ConfigPanel:Ut,Layout:Oe,RecentPanel:G(wn,[[`render`,Dn]])},mixins:[ie],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===q.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ye({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!se(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;if(Q(this.config?.model).imageRequired&&!this.config?.image?.length){K.warning(this.$t(`seedream.message.referenceImageRequired`));return}let e=$(this.config);if(!de())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}K.info(this.$t(`seedream.message.startingTask`)),oe(`seedream`,fe.generate(e,{token:t})).then(()=>{K.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?K.error(this.$t(`seedream.message.usedUp`)):K.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function kn(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var An=G(On,[[`render`,kn]]);export{An as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-CaXJ36xG.js";import{t as x}from"./upload-CtyDOjCb.js";import{t as S}from"./tooltip-kiynJmu_.js";import{t as C}from"./alert-CjaV4VyH.js";import{t as w}from"./drawer-VnK7t36W.js";import{t as T}from"./input-number-Bx2nlQp3.js";import{t as E}from"./box-BEEkIbso.js";import{t as D}from"./clock-BurpmIb0.js";import{r as O,t as k}from"./PromptTextarea-CjqyhQn4.js";import{t as A}from"./image-N4s0X2er.js";import{t as j}from"./info-DTQ5Jj3H.js";import{t as M}from"./trash-2-NVpkdW0R.js";import{t as N}from"./triangle-alert-DNESykEp.js";import{t as P}from"./upload-B3hX6Wjm.js";import{t as F}from"./wand-sparkles-Dhrc68i4.js";import{t as I}from"./zap-BayDgLEm.js";import{An as ee,Cn as L,Dn as te,En as R,On as ne,Sn as z,Tn as B,jn as V,vn as re,wn as H,xn as U,yn as W}from"./constants-7uZLiijT.js";import{E as G,Gt as ie,Kt as ae,Sr as oe,Ti as K,Ut as se,Wt as ce,Yt as le,ci as q,di as ue,in as de,kn as fe,qt as pe,wi as J,zi as Y}from"./index-tKADgCY9.js";import{t as me}from"./CopyToClipboard-DPVMD9O4.js";import{t as X}from"./ImagePreview-3Js4rEnR.js";import{n as he}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ge}from"./Consumption-CJEO0Oqt.js";import{a as Z,n as _e,r as ve,t as ye}from"./pagination-D99zvqj0.js";import{t as be}from"./ApiCodeButton-nUA4iGNl.js";import{t as xe}from"./BotPlaceholder-DQbI2r9r.js";import{t as Se}from"./ImageWrapper-DV-01ruL.js";var Ce=_({name:`LayoutSeedream`,components:{MagicIcon:F,ElDrawer:w,ElButton:Y},mixins:[he]}),we={class:`main flex flex-row flex-1`},Te={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)]`},Ee={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function De(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,we,[e(`div`,Te,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ee,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Oe=G(Ce,[[`render`,De],[`__scopeId`,`data-v-c10167d0`]]),ke=_({name:`SeedreamPromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ae(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var je=G(ke,[[`render`,Ae]]),Me={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function Q(e){switch(e){case B:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!1};case H:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case L:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case z:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case U:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:W[U],outputFormat:!1,tools:!1};case R:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:W[R],outputFormat:!1,tools:!1};default:return Me}}function Ne(e,t){let n=Q(e);return n.imageRequired||n.image&&t?.length?`edit`:`generate`}var Pe=[`1K`,`2K`,`3K`,`4K`];function Fe(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=Q(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(Pe.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function Ie(e,t,n){let r={...e},i=Q(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var Le=_({name:`SeedreamImageInput`,components:{UploadIcon:P,ElUpload:x,ElButton:Y,InfoIcon:Z,ImagePreview:X},mixins:[pe,ae,ce],data(){return{fileList:[],uploadUrl:ue()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return Q(this.model).image}},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.onSetImages()},onExceed(){K.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){K.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Re={key:0},ze={class:`field`},Be={class:`label`},Ve={class:`box`},He={class:`title font-bold`},Ue={class:`value`},We={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Ge(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`div`,Ve,[e(`h2`,He,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Ue,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,We,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{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))])])):o(``,!0)}var Ke=G(Le,[[`render`,Ge],[`__scopeId`,`data-v-fef518c4`]]),qe=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{revertKey:0,options:[{value:B,label:this.$t(`seedream.model.seedream50pro`)},{value:H,label:this.$t(`seedream.model.seedream50`)},{value:L,label:this.$t(`seedream.model.seedream45`)},{value:z,label:this.$t(`seedream.model.seedream40`)},{value:U,label:this.$t(`seedream.model.seedream30t2i`)},{value:R,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(re)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Fe(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Ie({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),K.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),Je={class:`field`},Ye={class:`label`},Xe={class:`box`},Ze={class:`title font-bold`};function Qe(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Je,[e(`div`,Ye,[e(`div`,Xe,[e(`h2`,Ze,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var $e=G(qe,[[`render`,Qe],[`__scopeId`,`data-v-6413c179`]]),et=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:Z},data(){return{SEEDREAM_SIZE_ADAPTIVE:ee,pixelOptions:ne}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Q(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),tt={class:`field`},nt={class:`label`},rt={class:`box`},it={class:`title font-bold`};function at(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`h2`,it,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.capabilities.sizeAdaptive?(h(),f(y,{key:1,label:t.$t(`seedream.size.group.adaptive`)},{default:p(()=>[(h(),f(v,{key:t.SEEDREAM_SIZE_ADAPTIVE,label:t.$t(`seedream.size.adaptive`),value:t.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var ot=G(et,[[`render`,at],[`__scopeId`,`data-v-dd7bd021`]]),st=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:T,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),ct={key:0,class:`field`},lt={class:`label`},ut={class:`box`},dt={class:`title font-bold`},ft={class:`value`};function pt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`h2`,dt,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,ft,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var mt=G(st,[[`render`,pt],[`__scopeId`,`data-v-f079fd20`]]),ht=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[...te]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),gt={key:0,class:`field`},_t={class:`label`},vt={class:`box`},yt={class:`title font-bold`};function bt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,gt,[e(`div`,_t,[e(`div`,vt,[e(`h2`,yt,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var xt=G(ht,[[`render`,bt],[`__scopeId`,`data-v-69ea4c07`]]),St=_({name:`SeedreamSeedInput`,components:{ElInputNumber:T,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),Ct={key:0,class:`field`},wt={class:`label`},Tt={class:`box`},Et={class:`title font-bold`},Dt={class:`value`};function Ot(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,Ct,[e(`div`,wt,[e(`div`,Tt,[e(`h2`,Et,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Dt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var kt=G(St,[[`render`,Ot],[`__scopeId`,`data-v-10cdc1e0`]]),At=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:T,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).guidanceScale},defaultValue(){return Q(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),jt={key:0,class:`field`},Mt={class:`label`},Nt={class:`box`},Pt={class:`title font-bold`},Ft={class:`value`};function It(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,jt,[e(`div`,Mt,[e(`div`,Nt,[e(`h2`,Pt,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,Ft,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var Lt=G(At,[[`render`,It],[`__scopeId`,`data-v-7386f064`]]),$=e=>{let t={...e||{}},n=Ne(t.model,t.image);return delete t.action,t.watermark=!1,(n!==`edit`||!t.image?.length)&&delete t.image,t.size||delete t.size,t.sequential_image_generation!==`auto`&&delete t.sequential_image_generation_options,{...t,async:!0}},Rt=_({name:`SeedreamConfigPanel`,components:{MagicIcon:F,ElButton:Y,PromptInput:je,Consumption:ge,ImageInput:Ke,ModelSelector:$e,SizeSelector:ot,MaxImagesSelector:mt,OutputFormatSelector:xt,SeedInput:kt,GuidanceScaleInput:Lt},emits:[`generate`],computed:{action(){return Ne(this.config?.model,this.config?.image)},capabilities(){return Q(this.config?.model)},config(){return this.$store.state.seedream?.config},consumption(){let e=$(this.config),t=e.sequential_image_generation===`auto`?Math.max(1,Math.floor(e.sequential_image_generation_options?.max_images||1)):1;return le({...e,action:this.action,model:V(e.model),input_image_count:e.image?.length||0,count:t},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),zt={class:`flex flex-col h-full`},Bt={class:`flex-1 overflow-y-auto p-5`},Vt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ht(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`seed-input`),x=l(`guidance-scale-input`),S=l(`prompt-input`),C=l(`image-input`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,zt,[e(`div`,Bt,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),t.capabilities.image?(h(),f(C,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,Vt,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(E,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Ut=G(Rt,[[`render`,Ht]]),Wt=_({name:`SeedreamTaskPreview`,components:{DeleteIcon:M,ApplicationIcon:E,ChannelIcon:O,ImageIcon:A,InfoIcon:j,LightningIcon:I,MagicIcon:F,TimeIcon:D,WarningIcon:N,CopyToClipboard:me,ElAlert:C,ImageWrapper:Se,ElButton:Y,ElTooltip:S,ImagePreview:X,ApiCodeButton:be},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return $(this.modelValue?.request)},isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await J.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(`seedream/deleteTask`,{id:e}),K.success(this.$t(`common.message.deleteTaskSuccess`))}catch{K.error(this.$t(`common.message.deleteTaskFailed`))}}},shortModel(e){return V(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Gt={class:`preview`},Kt={class:`left`},qt={class:`main`},Jt={class:`bot`},Yt={class:`datetime`},Xt=[`aria-label`],Zt={class:`info`},Qt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},$t={key:1,class:`prompt mt-2`},en={key:0},tn={key:0,class:n({content:!0})},nn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},rn={key:1,class:n({content:!0,failed:!0})},an={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},on={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},un={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},pn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},_n={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},bn={key:3,class:n({content:!0})},xn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Cn(u,d,g,_,v,y){let b=l(`capability-presentation`),x=l(`delete-icon`),S=l(`el-tooltip`),C=l(`image-preview`),w=l(`time-icon`),T=l(`magic-icon`),E=l(`copy-to-clipboard`),D=l(`el-alert`),O=l(`image-wrapper`),k=l(`el-button`),A=l(`api-code-button`),j=l(`application-icon`),M=l(`image-icon`),N=l(`lightning-icon`),P=l(`channel-icon`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,Gt,[e(`div`,Kt,[a(b,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,qt,[e(`div`,Jt,[a(b,{capability:`seedream`,part:`name`}),e(`span`,Yt,i(u.$dayjs.format(``+new Date(parseFloat((u.modelValue?.created_at||``).toString())*1e3))),1),a(S,{effect:`dark`,content:u.$t(`common.button.delete`),placement:`top`},{default:p(()=>[u.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":u.$t(`common.button.delete`),onClick:d[0]||=t((...e)=>u.onDelete&&u.onDelete(...e),[`stop`])},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Xt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Zt,[Array.isArray(u.modelValue?.request?.image)&&u.modelValue?.request?.image.length>0?(h(),s(`div`,Qt,[(h(!0),s(c,null,m(u.modelValue?.request?.image,(e,t)=>(h(),f(C,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),u.modelValue?.request?.prompt?(h(),s(`p`,$t,[r(i(u.modelValue?.request?.prompt)+` `,1),u.modelValue?.response?o(``,!0):(h(),s(`span`,en,` - (`+i(u.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),u.modelValue?.response?u.modelValue?.response?.success===!0?(h(),s(`div`,rn,[e(`div`,an,[(h(!0),s(c,null,m(u.images,(e,t)=>(h(),f(O,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,on,[a(S,{class:`box-item`,effect:`dark`,content:u.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(k,{type:`info`,size:`small`,class:`btn-action`,onClick:d[1]||=t(e=>u.onEdit(u.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(u.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(A,{path:`/seedream/images`,body:u.apiRequest},null,8,[`body`])]),a(D,{closable:!1,class:`mt-2 success`},{default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,sn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,cn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,ln,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,un,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(E,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),u.modelValue?.elapsed?(h(),s(`p`,dn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,fn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(E,{content:u.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):u.modelValue?.response?.success===!1?(h(),s(`div`,{key:2,class:n({content:!0,"mt-[15px]":!u.modelValue?.request?.prompt})},[a(D,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failure`)),1)]),default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,pn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,mn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,hn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,gn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(E,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.error?.message?(h(),s(`p`,_n,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failureReason`))+`: `+i(u.modelValue?.response?.error?.message)+` `,1),a(E,{content:u.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),u.modelValue?.elapsed?(h(),s(`p`,vn,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,yn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(E,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})],2)):(h(),s(`div`,bn,[a(D,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,xn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(E,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.trace_id?(h(),s(`p`,Sn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(E,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,tn,[a(D,{closable:!1,class:`info`},{template:p(()=>[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,nn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(E,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var wn=_({name:`SeedreamRecentPanel`,components:{TaskPreview:G(Wt,[[`render`,Cn],[`__scopeId`,`data-v-394e4796`]]),BotPlaceholder:xe,NoTasks:ve,ScrollList:_e},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Tn={key:0},En={key:2,class:`w-full h-full flex items-center justify-center`};function Dn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Tn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{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:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,En,[a(v)])):o(``,!0)],64)}var On=_({name:`SeedreamIndex`,components:{ConfigPanel:Ut,Layout:Oe,RecentPanel:G(wn,[[`render`,Dn]])},mixins:[ie],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===q.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ye({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!se(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;if(Q(this.config?.model).imageRequired&&!this.config?.image?.length){K.warning(this.$t(`seedream.message.referenceImageRequired`));return}let e=$(this.config);if(!de())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}K.info(this.$t(`seedream.message.startingTask`)),oe(`seedream`,fe.generate(e,{token:t})).then(()=>{K.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?K.error(this.$t(`seedream.message.usedUp`)):K.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function kn(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var An=G(On,[[`render`,kn]]);export{An as default};
|