@acedatacloud/nexior 3.371.3 → 3.371.4
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-CGRTnBjA.js → ApiCodeButton-B7iQtRyE.js} +1 -1
- package/dist/assets/{ApiCodeDialog-Gay4bCfr.js → ApiCodeDialog-CjY9zUXD.js} +1 -1
- package/dist/assets/{Artifacts-4mJocbBS.js → Artifacts-DyoBOofL.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BiIL49gU.js → AskUserQuestionCard-Stu32_7A.js} +1 -1
- package/dist/assets/{AudioPreview-Caes5-Xb.js → AudioPreview-aCkjiIEz.js} +1 -1
- package/dist/assets/{Auth-zKowLjrP.js → Auth-DetfyLGN.js} +1 -1
- package/dist/assets/{Bare-BZw1XJRd.js → Bare-Cuu1PNt6.js} +1 -1
- package/dist/assets/{BotPlaceholder-B285f5nu.js → BotPlaceholder-DwG3z10_.js} +1 -1
- package/dist/assets/{BottomFooter-Dw2YKFpW.js → BottomFooter-i12E3Wxn.js} +1 -1
- package/dist/assets/{BrowseConnectors-ei-2yWAD.js → BrowseConnectors-B8MJeXJk.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-D8kW-ViR.js → BrowserPairingDialog-B0hBZDzK.js} +1 -1
- package/dist/assets/{Callback-Bhm_-6C_.js → Callback-D1nEZs_g.js} +1 -1
- package/dist/assets/{CodeSnippet-Cwg8dFMK.js → CodeSnippet-DoIoonBw.js} +1 -1
- package/dist/assets/{Console-BtxrMcc2.js → Console-SAoY-xzV.js} +1 -1
- package/dist/assets/{Conversation-YJDeI6aL.js → Conversation-D48FgWHH.js} +1 -1
- package/dist/assets/{Conversation-DFANMvAM.js → Conversation-DghMnzHW.js} +1 -1
- package/dist/assets/{CopyToClipboard-CCt1tvH4.js → CopyToClipboard-sz0qw-Lr.js} +1 -1
- package/dist/assets/{Detail-idqj7qB_.js → Detail-AkAmjf-R.js} +1 -1
- package/dist/assets/{Extra-7JWcruAG.js → Extra-CE5pRCgt.js} +1 -1
- package/dist/assets/{FilePreview-BBYVVKx_.js → FilePreview-DKhYXSPe.js} +1 -1
- package/dist/assets/{Hailuo-CuoSeE43.js → Hailuo-CUjZNfzy.js} +1 -1
- package/dist/assets/{History-Na45kCwi.js → History-eoye6QHE.js} +1 -1
- package/dist/assets/{ImagePreview-HVDfPxCI.js → ImagePreview-BDgO7JJQ.js} +1 -1
- package/dist/assets/{ImageWrapper-DJusX6F3.js → ImageWrapper-C_8rYcTq.js} +1 -1
- package/dist/assets/{Index-kvn1jofi.js → Index-0CnHCdeq.js} +1 -1
- package/dist/assets/{Index-CJoHx7IL.js → Index-3ThIl7wr.js} +1 -1
- package/dist/assets/{Index-DgzaRU_u.js → Index-3kW06GOE.js} +1 -1
- package/dist/assets/{Index-BKLMDlNb.js → Index-5dSVc1yH.js} +1 -1
- package/dist/assets/{Index-B29NnMVJ.js → Index-BFDvfcbD.js} +1 -1
- package/dist/assets/{Index-Dtq3xaak.js → Index-BOkb_RNC.js} +1 -1
- package/dist/assets/{Index-CNApKteq.js → Index-BRLu1pwY.js} +1 -1
- package/dist/assets/{Index-CITMIscJ.js → Index-BUmolrNg.js} +1 -1
- package/dist/assets/{Index--YMh9P1_.js → Index-BVLJKgWp.js} +1 -1
- package/dist/assets/{Index-iXuXMV4M.js → Index-BW9gErcb.js} +1 -1
- package/dist/assets/{Index-SDOA4s6G.js → Index-Bf0GjUln.js} +1 -1
- package/dist/assets/{Index-DLgDiG8Y.js → Index-BgCdi3iz.js} +1 -1
- package/dist/assets/{Index-D9P6EhVK.js → Index-Bhw98Rcn.js} +1 -1
- package/dist/assets/{Index-CQt2DE-h.js → Index-BmT-hwvR.js} +1 -1
- package/dist/assets/{Index-Cw3tQFed.js → Index-Bzq6Sz1q.js} +1 -1
- package/dist/assets/{Index-kEioIUv1.js → Index-C1WDNKJt.js} +1 -1
- package/dist/assets/{Index-DYJg-Cpt.js → Index-CBTsPXsC.js} +1 -1
- package/dist/assets/{Index-DKHHbMFI.js → Index-CCtYsO7c.js} +1 -1
- package/dist/assets/{Index-BWL0b3ox.js → Index-CgJnZbEl.js} +1 -1
- package/dist/assets/{Index-rhe9ZgjA.js → Index-Crsd-Olk.js} +1 -1
- package/dist/assets/{Index-Ca_3yOj7.js → Index-Ct1qDnyL.js} +1 -1
- package/dist/assets/{Index-DAjb6kdK.js → Index-CvmDVbde.js} +1 -1
- package/dist/assets/{Index-BBv5I4X5.js → Index-D2MDmq-3.js} +1 -1
- package/dist/assets/{Index-39VcsoCv.js → Index-DAdby2RI.js} +1 -1
- package/dist/assets/{Index-B_TUv6kj.js → Index-DDh3GFmS.js} +1 -1
- package/dist/assets/{Index-BOlcEgT9.js → Index-DJSyrBHp.js} +1 -1
- package/dist/assets/{Index-DDTIPVMv.js → Index-Dlut7Ufb.js} +1 -1
- package/dist/assets/{Index-B2ki1RtE.js → Index-Dm7N0Udj.js} +1 -1
- package/dist/assets/{Index-CUK2OyT3.js → Index-Dpazwvgu.js} +1 -1
- package/dist/assets/{Index-B0CHcsji.js → Index-PRT7EuCp.js} +1 -1
- package/dist/assets/{Index-BWfjPdUt.js → Index-U822vfVB.js} +1 -1
- package/dist/assets/{Index-Dmzkglvs.js → Index-VIOTEzQH.js} +1 -1
- package/dist/assets/{Index-_wrjPICD.js → Index-dD77nmNZ.js} +1 -1
- package/dist/assets/{Index-CG_31FGm.js → Index-l2xagY55.js} +1 -1
- package/dist/assets/{Index-DNPIlc812.js → Index-s9-NbZBH2.js} +1 -1
- package/dist/assets/{Index-D5DYnpW9.js → Index-tDNDvukA.js} +1 -1
- package/dist/assets/{Invitees-moiTFnSF.js → Invitees-VLnksw93.js} +1 -1
- package/dist/assets/{List-TfhtIQaB.js → List-BLUsN_IY.js} +1 -1
- package/dist/assets/{List-CO2tMWVB.js → List-CyrUaLwU.js} +1 -1
- package/dist/assets/{List-FfbJ9ZZp.js → List-Dlt-YFs0.js} +1 -1
- package/dist/assets/{LocalTools-D5Gcci-U.js → LocalTools--4uRokHD.js} +1 -1
- package/dist/assets/{LocalTools-CKsGzj47.js → LocalTools-F_r2NtWr.js} +1 -1
- package/dist/assets/{Logo-BjrkUaTO.js → Logo-CcgvguPx.js} +1 -1
- package/dist/assets/{Main-CkTd100u.js → Main-zMnU7rdc.js} +1 -1
- package/dist/assets/{Message-DAXFqRgv.js → Message-BJsVECMX.js} +1 -1
- package/dist/assets/{Model-C89H_Vps.js → Model-CJu53VI-.js} +1 -1
- package/dist/assets/{Navigator-Cp5jJMRX.js → Navigator-CD_Mkms3.js} +3 -3
- package/dist/assets/{NotFound-c2IbZOdP.js → NotFound-DTJNOBje.js} +1 -1
- package/dist/assets/{PageHeader-BmPV4nuL.js → PageHeader-DBhZwlSN.js} +1 -1
- package/dist/assets/{Pay-C-lXWCpI.js → Pay-Dcf4fAwM.js} +1 -1
- package/dist/assets/{Player-BnwMeYKj.js → Player-NTv8iHvb.js} +1 -1
- package/dist/assets/{Poivelle-B3qLX-0g.js → Poivelle-DMmhJBKc.js} +1 -1
- package/dist/assets/{RealtimeCall-0lHBPV7C.js → RealtimeCall-DeM2ERNf.js} +1 -1
- package/dist/assets/{ReportButton-57emj3Ag.js → ReportButton-DbaMTiER.js} +1 -1
- package/dist/assets/{ReportDialog-BZsBwGJJ.js → ReportDialog-DNwoEOAa.js} +1 -1
- package/dist/assets/{ScenarioPaymentMode-B2nWCVIR.js → ScenarioPaymentMode-kZ7zDlkq.js} +1 -1
- package/dist/assets/{ScheduledTasks-BefYu5UX.js → ScheduledTasks-8gnn-weY.js} +1 -1
- package/dist/assets/{ServicePricingSummary-C5wco0tz.js → ServicePricingSummary-B6e4UMsc.js} +1 -1
- package/dist/assets/{ShowcaseGrid-D6wCcr43.js → ShowcaseGrid-BoavwcxX.js} +1 -1
- package/dist/assets/{ShowcaseResultTabs-CQ3vtIJe.js → ShowcaseResultTabs-D1blU4xG.js} +1 -1
- package/dist/assets/{SolanaWalletPickerDialog-CtmABq2j.js → SolanaWalletPickerDialog-B8eL97-M.js} +1 -1
- package/dist/assets/{Status-BujsSuxP.js → Status-DqCTQE1N.js} +1 -1
- package/dist/assets/{Subscribe-BioCvU_l.js → Subscribe-BPpiVhgm.js} +1 -1
- package/dist/assets/{TabSwitcher-Dvbx0qXf.js → TabSwitcher-BcumkFQb.js} +1 -1
- package/dist/assets/{Tts-dB9wsA-E.js → Tts-BvAhPcNh.js} +1 -1
- package/dist/assets/{VideoPlayer-i3VcnbHP.js → VideoPlayer-D5tztnYV.js} +1 -1
- package/dist/assets/{VideoPreview-CycVY7vI.js → VideoPreview-aiX7Evfh.js} +1 -1
- package/dist/assets/arrow-down-BSHeBz4t.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-De4Gt2z-.js → arrow-down-wide-narrow-CyKXpFct.js} +1 -1
- package/dist/assets/arrow-left-CQxDtYWw.js +1 -0
- package/dist/assets/arrow-right-B8UUyzYE.js +1 -0
- package/dist/assets/arrow-up-CPa1E8_P.js +1 -0
- package/dist/assets/{authorizeFlow-CMFNwjAy.js → authorizeFlow-BmStuqRw.js} +1 -1
- package/dist/assets/{avatar-B40VLBOo.js → avatar-DW8vBFvO.js} +1 -1
- package/dist/assets/{basic-B8RTc2o2.js → basic-V_dCQN-7.js} +1 -1
- package/dist/assets/{book-open-DgI_5ukf.js → book-open-Cx0F2c3b.js} +1 -1
- package/dist/assets/{box-BcHSnpH-.js → box-CTxxH32k.js} +1 -1
- package/dist/assets/{boxes-DY1x746v.js → boxes-D-h30qOE.js} +1 -1
- package/dist/assets/{brain-CRWdx7Pw.js → brain-BCdV44ve.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-DYbfFjq9.js → chart-no-axes-combined-D__zR5Ki.js} +1 -1
- package/dist/assets/{chat-zzRfVzx2.js → chat-EYuHs0yr.js} +1 -1
- package/dist/assets/check-C8mVEur2.js +1 -0
- package/dist/assets/chevron-down-C9d0FXRE.js +1 -0
- package/dist/assets/chevron-right-4Ky2D1GB.js +1 -0
- package/dist/assets/{circle-alert-quyhohc-.js → circle-alert-Cpi8B8aa.js} +1 -1
- package/dist/assets/circle-check-DzyKsQ5E.js +1 -0
- package/dist/assets/{circle-question-mark-CPbnmTcR.js → circle-question-mark-Dl_sOM5u.js} +1 -1
- package/dist/assets/{clipboard-list-BQKLA0v1.js → clipboard-list-D7AvBFtP.js} +1 -1
- package/dist/assets/clock-mP13CJwv.js +1 -0
- package/dist/assets/code-Pa0xuy7_.js +1 -0
- package/dist/assets/{codingBridge-ukbnxa2i.js → codingBridge-plv81E-l.js} +1 -1
- package/dist/assets/{coins-VScLyfIR.js → coins-BzdFOUsK.js} +1 -1
- package/dist/assets/{copy-BZ-nQMG2.js → copy-DtEpCnzV.js} +1 -1
- package/dist/assets/{createTaskActions-BfAz4tbb.js → createTaskActions-CYIxJbdr.js} +1 -1
- package/dist/assets/{date-picker-546ouPku.js → date-picker-BWwuIFnn.js} +1 -1
- package/dist/assets/{digitalhuman-DT6tPIDY.js → digitalhuman-BT4yd-cQ.js} +1 -1
- package/dist/assets/{dollar-sign-BIKVJENN.js → dollar-sign-D0R0nPhR.js} +1 -1
- package/dist/assets/{download-BHzlU_bJ.js → download-BdDFltwZ.js} +1 -1
- package/dist/assets/{drawer-yTqzLaen.js → drawer-KN1LRowH.js} +1 -1
- package/dist/assets/{dropdown-DxHZhHbe.js → dropdown-DWPPZIyK.js} +1 -1
- package/dist/assets/{dropdown-Bw011FVB.js → dropdown-_LBWBf-Y.js} +1 -1
- package/dist/assets/{ellipsis-CJqSKBCr.js → ellipsis-CQoyd1U8.js} +1 -1
- package/dist/assets/{esm-YlpVonMH.js → esm-BG657CGV.js} +2 -2
- package/dist/assets/{external-link-DXffEL3Y.js → external-link-xL7IaTrI.js} +1 -1
- package/dist/assets/{eye-FxhnNuOz.js → eye-C9gPEb69.js} +1 -1
- package/dist/assets/{file-DtMwLDy5.js → file-hh1eR7jk.js} +1 -1
- package/dist/assets/{file-output-CgPlARBN.js → file-output-_urjII1S.js} +1 -1
- package/dist/assets/{file-text-YhDtvMQ4.js → file-text-CTEvw_kE.js} +1 -1
- package/dist/assets/{fish-6YK_gMzf.js → fish-IksHjaG0.js} +1 -1
- package/dist/assets/{flux-DVtrOmjb.js → flux-fgdaXnVh.js} +1 -1
- package/dist/assets/{folder-BOq3rzmG.js → folder-DMqgztyI.js} +1 -1
- package/dist/assets/gauge-BqFWKACq.js +1 -0
- package/dist/assets/{generationInput-3_W3r_nF.js → generationInput-C5bI6y33.js} +1 -1
- package/dist/assets/{globe-DWsAWE_I.js → globe-MR7AWDCi.js} +1 -1
- package/dist/assets/{grokvideo-BV4Snx8H.js → grokvideo-BuG-TOG_.js} +1 -1
- package/dist/assets/{hailuo-C6AjT7BG.js → hailuo-0xIEKJD_.js} +1 -1
- package/dist/assets/{headphones-CDk8qDYh.js → headphones-DCyyVGL4.js} +1 -1
- package/dist/assets/{history-B25VEzje.js → history-DNd_c346.js} +1 -1
- package/dist/assets/{house-CWbvhhdE.js → house-BbdNS63y.js} +1 -1
- package/dist/assets/{image-mOJ1ByjJ.js → image-CZ_tH9kY.js} +1 -1
- package/dist/assets/{index-DM6hrjyQ.js → index-BDrhpCy4.js} +3 -3
- package/dist/assets/{index.es-B7BnZqPt.js → index.es-DRsketdd.js} +1 -1
- package/dist/assets/{info-AmBm9Cbx.js → info-BWyB8juG.js} +1 -1
- package/dist/assets/{input-number-BCjyae0g.js → input-number-BB7Zip42.js} +1 -1
- package/dist/assets/{key-round-qVD6kc-r.js → key-round-Dkk-knOA.js} +1 -1
- package/dist/assets/{kling-DsaOmBOS.js → kling-Cqc8JB9o.js} +1 -1
- package/dist/assets/{languages-DS2I-fXP.js → languages-LYXiy8Zw.js} +1 -1
- package/dist/assets/{laptop-CzgKynug.js → laptop-B4VpgJZX.js} +1 -1
- package/dist/assets/{lightbulb-ClD2GCjs.js → lightbulb-zTCBaXI3.js} +1 -1
- package/dist/assets/{link-DkSgA3dd.js → link-CBFmk5Ee.js} +1 -1
- package/dist/assets/loader-circle-BOHt8R3r.js +1 -0
- package/dist/assets/{lock-YVHBp4zq.js → lock-B3J02iis.js} +1 -1
- package/dist/assets/{luma-BPUDITN-.js → luma-CAg5eV4r.js} +1 -1
- package/dist/assets/{maestro-Dza-xdK1.js → maestro-b5VEc7e9.js} +1 -1
- package/dist/assets/{mail-BcrDtzjl.js → mail-TiuuwEaM.js} +1 -1
- package/dist/assets/{message-circle-IeKu5nx9.js → message-circle-ClAaI6hb.js} +1 -1
- package/dist/assets/{mic-DThA7f_u.js → mic-BIEMJL96.js} +1 -1
- package/dist/assets/{midjourney-BnT_R0Ip.js → midjourney-EES_2sWB.js} +1 -1
- package/dist/assets/{minimax-CR2mnCyQ.js → minimax-CwrWw1Ng.js} +1 -1
- package/dist/assets/{monitor-C7pDvjST.js → monitor-BYunWSkl.js} +1 -1
- package/dist/assets/{mouse-pointer-2-BGP2gVgn.js → mouse-pointer-2-BhJwpXJW.js} +1 -1
- package/dist/assets/music-2-CqlmSnd9.js +1 -0
- package/dist/assets/{nanobanana-CK-KHD71.js → nanobanana-y3dBZ6If.js} +1 -1
- package/dist/assets/{omni-CrWWTQMD.js → omni-Y9f6jFc4.js} +1 -1
- package/dist/assets/{openaiimage-C56Iwluv.js → openaiimage-Q2e2U6WO.js} +1 -1
- package/dist/assets/{pagination-BH4MphOL.js → pagination-B3M80drG.js} +1 -1
- package/dist/assets/{pagination-D-Ckizkk.js → pagination-BV08b7GL.js} +1 -1
- package/dist/assets/{pagination-50HEMFzY.js → pagination-CMtbXlkA.js} +1 -1
- package/dist/assets/{palette-CIMGKHKc.js → palette-oW13lGeT.js} +1 -1
- package/dist/assets/{paperclip-DHtaHoBJ.js → paperclip-x387dn2o.js} +1 -1
- package/dist/assets/{pause-Dh4Nf3e4.js → pause-BHPTY1dG.js} +1 -1
- package/dist/assets/{pencil-Dxw_6QaO.js → pencil-ppJ1ler-.js} +1 -1
- package/dist/assets/{pika-5A4aNWRC.js → pika-DXDppRKZ.js} +1 -1
- package/dist/assets/{pixverse-C6SKj6kT.js → pixverse-LzJlnbKz.js} +1 -1
- package/dist/assets/play-DHhh0pVt.js +1 -0
- package/dist/assets/{plug-CVrABqVX.js → plug-52V5XNg-.js} +1 -1
- package/dist/assets/plus-DO3XunBM.js +1 -0
- package/dist/assets/{poivelle-BqyypMcW.js → poivelle-AAZ1haTU.js} +1 -1
- package/dist/assets/{popover-CCAggJhc.js → popover-PJLeQqI9.js} +1 -1
- package/dist/assets/{producer-D6Jl2NpZ.js → producer-xcN6JvgN.js} +1 -1
- package/dist/assets/{qrart-BD8R3F1p.js → qrart-C5PbBgxj.js} +1 -1
- package/dist/assets/{qwenimage-CSMZKkyT.js → qwenimage-DMqjHshG.js} +1 -1
- package/dist/assets/{realtime-BzbMi6Db.js → realtime-BO9Am7p6.js} +1 -1
- package/dist/assets/{refresh-cw-CVSSWpQM.js → refresh-cw-DuY3Ve_P.js} +1 -1
- package/dist/assets/rotate-ccw-Bd8Mcint.js +1 -0
- package/dist/assets/rotate-cw-BXhODUI7.js +1 -0
- package/dist/assets/search-68wZrrVQ.js +1 -0
- package/dist/assets/{seedance-Bb_b_89I.js → seedance-CfqX2vo9.js} +1 -1
- package/dist/assets/{seedream-CpEq4B8M.js → seedream-DtUIl22l.js} +1 -1
- package/dist/assets/{select-BrdGcmQV.js → select-CJHU1puz.js} +1 -1
- package/dist/assets/{serp-KvxmJhd4.js → serp-DmwcYFH-.js} +1 -1
- package/dist/assets/{shield-D8Epv2bc.js → shield-7wMqeCnl.js} +1 -1
- package/dist/assets/{showcase-DLvb5FT2.js → showcase-BSzYXnlk.js} +1 -1
- package/dist/assets/{showcaseRecreateMixin-TEhFBc7v.js → showcaseRecreateMixin-l4sq0RCR.js} +1 -1
- package/dist/assets/{shuffle-qSlPWPcQ.js → shuffle-DEDsU45E.js} +1 -1
- package/dist/assets/{siteHome-BPe9s0lU.js → siteHome-AQGaYnOE.js} +1 -1
- package/dist/assets/{slider-Dmaw2uOQ.js → slider-D9GXU4sY.js} +1 -1
- package/dist/assets/{solana-wallets-Bqt8suXe.js → solana-wallets-ET1Yt6cz.js} +2 -2
- package/dist/assets/{sora-qoRgh7iI.js → sora-iBNspn8m.js} +1 -1
- package/dist/assets/{sparkles-BW1PBCix.js → sparkles-CcOmlUWX.js} +1 -1
- package/dist/assets/square-OTIXmfWE.js +1 -0
- package/dist/assets/{store-BM4V4uhC.js → store-DSn2Uqvw.js} +1 -1
- package/dist/assets/{suno-3tNeDQrn.js → suno-h9DfMDLr.js} +1 -1
- package/dist/assets/{switch-B1g5dw5D.js → switch-B8GgL0Se.js} +1 -1
- package/dist/assets/{table-CmXt553N.js → table-DaCzJh_U.js} +1 -1
- package/dist/assets/{tag-BaQlfV2_.js → tag-BaBXQkeI.js} +1 -1
- package/dist/assets/{taskPolling-BSXKWFXo.js → taskPolling-CGGGJX46.js} +1 -1
- package/dist/assets/terminal-DVkZFQop.js +1 -0
- package/dist/assets/{time-picker-u02IM5RL.js → time-picker-VI1MHfCH.js} +1 -1
- package/dist/assets/{tooltip-Drsa0R-y.js → tooltip-BmwZvoCo.js} +1 -1
- package/dist/assets/{trash-2-qsTysEar.js → trash-2-Bgi3IwhR.js} +1 -1
- package/dist/assets/{triangle-alert-wPWJieth.js → triangle-alert-tECqMJGT.js} +1 -1
- package/dist/assets/{upload-CYNoIKvu.js → upload-DNoc85A2.js} +1 -1
- package/dist/assets/user-B-D8rRw5.js +1 -0
- package/dist/assets/{veo-DM_UYXdG.js → veo-BByMo8C5.js} +1 -1
- package/dist/assets/{video-C-HdR_Qs.js → video-B1Lu-5UG.js} +1 -1
- package/dist/assets/{volume-2-DioCaOkE.js → volume-2-BflVGSM8.js} +1 -1
- package/dist/assets/{wallet-DUpARZWA.js → wallet-hT9dlcwr.js} +1 -1
- package/dist/assets/{wan-CfhH95bK.js → wan-CXudPQLi.js} +1 -1
- package/dist/assets/{wand-sparkles-B76KgpVz.js → wand-sparkles-CylWIDdZ.js} +1 -1
- package/dist/assets/{web-BHFFE-8r.js → web-B-NdHbL5.js} +1 -1
- package/dist/assets/{webextrator-CbGXAcFj.js → webextrator-BkIM2feg.js} +1 -1
- package/dist/assets/{zap-BDXCQHvY.js → zap-jib8JHPm.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +3 -2
- package/dist/assets/arrow-down-uzLp0EzK.js +0 -1
- package/dist/assets/arrow-left-Dh8RRepJ.js +0 -1
- package/dist/assets/arrow-right-Mc9TL9dE.js +0 -1
- package/dist/assets/arrow-up-Ok1QXX4J.js +0 -1
- package/dist/assets/check-Dkywcw9M.js +0 -1
- package/dist/assets/chevron-down-DofdIa77.js +0 -1
- package/dist/assets/chevron-right-BMqfbr8H.js +0 -1
- package/dist/assets/circle-check-DFAR5I11.js +0 -1
- package/dist/assets/clock-D_pf_5A-.js +0 -1
- package/dist/assets/code-B1khxmUM.js +0 -1
- package/dist/assets/gauge-D1GQHZS1.js +0 -1
- package/dist/assets/loader-circle-D26fSmns.js +0 -1
- package/dist/assets/music-2-BRWsn50W.js +0 -1
- package/dist/assets/play-CM6vdgoM.js +0 -1
- package/dist/assets/plus-CByC99a5.js +0 -1
- package/dist/assets/rotate-ccw-CqDtZEsB.js +0 -1
- package/dist/assets/rotate-cw-CKwX841o.js +0 -1
- package/dist/assets/search-BgeCUkYM.js +0 -1
- package/dist/assets/square-B_xQGZFm.js +0 -1
- package/dist/assets/terminal-DlnoUhS_.js +0 -1
- package/dist/assets/user-B6aZBiwl.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,P as c,T as l,at as u,ht as d,it as f,j as p,mt 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-BrdGcmQV.js";import{t as x}from"./upload-DPM3VJNR.js";import{t as S}from"./tooltip-Drsa0R-y.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-qt9s4QBH.js";import{n as E,r as D}from"./radio-BNhFzeBO.js";import{n as O,t as k}from"./collapse-DsSFtXhr.js";import{t as A}from"./drawer-yTqzLaen.js";import{t as j}from"./input-number-BCjyae0g.js";import{t as M}from"./progress-BuyYfFZn.js";import{t as N}from"./clock-D_pf_5A-.js";import{a as ee,i as P,n as te,o as ne,r as re,s as ie,t as ae}from"./pagination-50HEMFzY.js";import{t as oe}from"./info-AmBm9Cbx.js";import{t as se}from"./music-2-BRWsn50W.js";import{t as ce}from"./plus-CByC99a5.js";import{t as F}from"./trash-2-qsTysEar.js";import{t as I}from"./triangle-alert-wPWJieth.js";import{t as le}from"./upload-CYNoIKvu.js";import{t as ue}from"./user-B6aZBiwl.js";import{t as de}from"./video-C-HdR_Qs.js";import{t as L}from"./wand-sparkles-B76KgpVz.js";import{Br as R,Gr as fe,Hr as pe,Kr as me,Vr as he,zr as ge}from"./constants-CmC-0Hwp.js";import{A as z,Cn as _e,Er as B,Ka as ve,La as ye,Li as V,O as be,Qi as xe,Tr as Se,Va as H,aa as Ce,at as we,ct as Te,di as U,et as Ee,it as De,li as W,lo as Oe,ot as ke,st as Ae,to as G,wr as K,za as je,zi as q}from"./index-DM6hrjyQ.js";import{t as Me}from"./CopyToClipboard-CCt1tvH4.js";import{t as Ne}from"./ReportButton-57emj3Ag.js";import{t as J}from"./ImagePreview-HVDfPxCI.js";import{n as Pe}from"./taskDrawerMixin-DyAUhFEq.js";import{n as Fe,t as Ie}from"./ServicePricingSummary-C5wco0tz.js";import{t as Y}from"./AudioPreview-Caes5-Xb.js";import{t as Le}from"./VideoPlayer-i3VcnbHP.js";import{t as X}from"./VideoPreview-CycVY7vI.js";import{t as Re}from"./ScenarioPaymentMode-B2nWCVIR.js";import{t as ze}from"./ApiCodeButton-CGRTnBjA.js";import{t as Be}from"./BotPlaceholder-B285f5nu.js";import{t as Ve}from"./taskPollingMixin-CcLxtz8z.js";var He=v({name:`LayoutDigitalHuman`,components:{UserIcon:ue,ElDrawer:A,ElButton:G},mixins:[Pe]}),Ue={class:`main flex flex-row flex-1`},We={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)]`},Ge={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ke(t,n,r,i,o,c){let l=u(`user-icon`),p=u(`el-button`),h=u(`el-drawer`);return g(),s(`div`,Ue,[e(`div`,We,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ge,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{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:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var qe=z(He,[[`render`,Ke],[`__scopeId`,`data-v-909c6359`]]),Je=v({name:`DigitalHumanMediaInput`,components:{AudioPreview:Y,CloseIcon:je,ElButton:G,ElProgress:M,ElUpload:x,ImagePreview:J,MusicIcon:se,UploadIcon:le,VideoIcon:de,VideoPreview:X},mixins:[Te,Ae,we,Ee],props:{kind:{type:String,required:!0},accept:{type:String,default:``},buttonText:{type:String,default:``},hint:{type:String,default:``}},emits:[`change`],data(){return{fileList:[],uploadUrl:ye()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},hasFile(){return this.fileList.length>0}},methods:{uploadedUrl(e){return e?.response?.file_url},isPending(e){return e.status===`ready`||e.status===`uploading`},onExceed(e){let t=this.$refs.uploader;t?.clearFiles();let n=e[0];n&&(t?.handleStart?.(n),t?.submit?.())},onError(){T.error(this.$t(`digitalhuman.message.uploadError`))},onRemoveFile(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onChange()},onChange(){let e=this.fileList?.[0];this.$emit(`change`,e?this.uploadedUrl(e):void 0)}}}),Ye={class:`thumb`},Xe={key:2,class:`placeholder`},Ze=[`title`],Qe=[`aria-label`,`title`,`onClick`],$e={key:0,class:`hint`};function et(c,d,f,h,_,v){let y=u(`image-preview`),b=u(`video-preview`),x=u(`audio-preview`),S=u(`el-progress`),C=u(`video-icon`),w=u(`music-icon`),T=u(`close-icon`),E=u(`upload-icon`),D=u(`el-button`),O=u(`el-upload`);return g(),p(O,{ref:`uploader`,"file-list":c.fileList,"onUpdate:fileList":d[0]||=e=>c.fileList=e,accept:c.accept,name:`file`,class:`media-input`,limit:1,multiple:!1,"before-upload":c.beforeUploadSizeGuard,action:c.uploadUrl,headers:c.headers,"on-exceed":c.onExceed,"on-error":c.onError,"on-success":c.onChange,"on-remove":c.onChange},{file:m(({file:r})=>[e(`div`,{class:n([`slot`,{pending:c.isPending(r)}])},[c.kind===`image`&&r.url?(g(),p(y,{key:0,url:r.url,name:r.name,percentage:r.percentage,onRemove:e=>c.onRemoveFile(r)},null,8,[`url`,`name`,`percentage`,`onRemove`])):(g(),s(l,{key:1},[e(`div`,Ye,[c.kind===`video`&&c.uploadedUrl(r)?(g(),p(b,{key:0,url:c.uploadedUrl(r)},null,8,[`url`])):c.kind===`audio`&&c.uploadedUrl(r)?(g(),p(x,{key:1,url:c.uploadedUrl(r)},null,8,[`url`])):(g(),s(`div`,Xe,[c.isPending(r)?(g(),p(S,{key:0,type:`circle`,"stroke-width":4,percentage:Math.round(r.percentage||0),width:34},null,8,[`percentage`])):c.kind===`video`?(g(),p(C,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),p(w,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]))]),e(`span`,{class:`filename`,title:r.name},i(r.name),9,Ze),e(`button`,{type:`button`,class:`remove`,"aria-label":c.$t(`common.button.close`),title:c.$t(`common.button.close`),onClick:t(e=>c.onRemoveFile(r),[`stop`])},[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Qe)],64))],2)]),default:m(()=>[a(D,{round:``,type:`primary`,size:`small`,class:`btn`},{default:m(()=>[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.hasFile?c.$t(`digitalhuman.button.replace`):c.buttonText),1)]),_:1}),c.hint?(g(),s(`p`,$e,i(c.hint),1)):o(``,!0)]),_:1},8,[`file-list`,`accept`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])}var Z=z(Je,[[`render`,et],[`__scopeId`,`data-v-db0590a9`]]),tt=20,Q=e=>{let t=e;return!!t&&typeof t.voice_id==`string`&&!!t.voice_id&&typeof t.name==`string`},$=()=>{try{let e=JSON.parse(localStorage.getItem(`digitalhuman.voices`)||`[]`);return Array.isArray(e)?e.filter(Q).map(e=>({voice_id:e.voice_id,name:e.name,lang:typeof e.lang==`string`?e.lang:`zh`,created_at:typeof e.created_at==`number`?e.created_at:0})):[]}catch{return[]}},nt=e=>{try{localStorage.setItem(me,JSON.stringify(e))}catch{}return e},rt=e=>Q(e)?nt([e,...$().filter(t=>t.voice_id!==e.voice_id)].slice(0,tt)):$(),it=e=>nt($().filter(t=>t.voice_id!==e)),at=e=>`${e} ${$().length+1}`,ot=3e3,st=60,ct=v({name:`DigitalHumanVoiceCloneDialog`,components:{Consumption:Fe,ElAlert:C,ElButton:G,ElDialog:ve,ElInput:Oe,ElRadioButton:E,ElRadioGroup:D,MediaInput:Z},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`,`cloned`],data(){return{sampleUrl:void 0,name:``,lang:`zh`,cloning:!1,destroyed:!1,runId:0,DIGITALHUMAN_AUDIO_ACCEPT:R,DIGITALHUMAN_VOICE_CLONE_CONSUMPTION:2,voiceQuoteUsdc:void 0,voiceQuoteLoading:!1,quoteRunId:0}},computed:{service(){return this.$store.state.digitalhuman?.service},credentialToken(){return this.$store.state.digitalhuman?.credential?.token},walletMode(){return V()&&q(`digitalhuman`).mode===`wallet`},langOptions(){return ge.map(e=>({value:e,label:this.$t(`digitalhuman.name.lang_${e}`)}))}},watch:{walletMode(e){this.voiceQuoteUsdc=void 0,e&&this.visible&&this.sampleUrl&&this.refreshVoiceQuote()},visible(e){e?(this.sampleUrl=void 0,this.name=at(this.$t(`digitalhuman.name.myVoice`)),this.lang=`zh`):(this.runId++,this.quoteRunId++,this.cloning=!1,this.voiceQuoteLoading=!1)}},beforeUnmount(){this.destroyed=!0,this.runId++,this.quoteRunId++},methods:{onVisible(e){this.cloning&&!e||this.$emit(`update:visible`,e)},onSampleChange(e){this.sampleUrl=e,this.voiceQuoteUsdc=void 0,e&&this.walletMode&&this.refreshVoiceQuote()},isStale(e){return this.destroyed||e!==this.runId},sleep(e){return new Promise(t=>setTimeout(t,e))},async refreshVoiceQuote(){if(!this.sampleUrl)return;let e=++this.quoteRunId;this.voiceQuoteLoading=!0;try{let t=await B.quoteVoice(this.voiceRequest());e===this.quoteRunId&&this.walletMode&&(this.voiceQuoteUsdc=t.amountUsdc)}catch(e){console.warn(`x402 voice quote failed`,e)}finally{e===this.quoteRunId&&(this.voiceQuoteLoading=!1)}},voiceRequest(){return Se({audio_url:this.sampleUrl||``,lang:this.lang,name:this.name||void 0})},paymentOptions(){if(!this.walletMode)return this.credentialToken?{token:this.credentialToken}:void 0;let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credentialToken}}},async onClone(){if(!this.sampleUrl)return;let e=this.paymentOptions();if(!e)return;let t=++this.runId;this.cloning=!0;try{let{data:n}=await B.cloneVoice(this.voiceRequest(),e);if(this.isStale(t))return;if(n?.voice_id){this.onCloned(n.voice_id);return}if(n?.task_id)await this.pollVoice(n.task_id,t);else throw Error(`no task`)}catch(e){if(e instanceof W)return;this.isStale(t)||T.error(this.$t(`digitalhuman.message.voiceCloneFailed`))}finally{this.isStale(t)||(this.cloning=!1)}},async pollVoice(e,t){for(let n=0;n<st;n++){if(this.isStale(t)||(await this.sleep(ot),this.isStale(t)))return;let n=this.credentialToken,{data:r}=await B.pollTask(e,n?{token:n}:{mode:`x402`});if(this.isStale(t))return;if(r?.voice_id){this.onCloned(r.voice_id);return}if(r?.state===`failed`)throw Error(`clone failed`)}throw Error(`timeout`)},getWalletContext(){return U(this.$wallet)},async confirmWalletPayment(e){return H.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},onCloned(e){rt({voice_id:e,name:this.name||this.$t(`digitalhuman.name.myVoice`),lang:this.lang,created_at:Date.now()/1e3}),T.success(this.$t(`digitalhuman.message.voiceCloneSuccess`)),this.cloning=!1,this.$emit(`cloned`,e),this.$emit(`update:visible`,!1)}}}),lt={class:`text-xs text-[var(--el-text-color-secondary)] mb-3`},ut={class:`field mb-3`},dt={class:`label`},ft={class:`field`},pt={class:`label`},mt={class:`text-xs mb-0`},ht={key:1,class:`mt-4 text-xs text-[var(--el-text-color-secondary)]`},gt={class:`footer`},_t={key:0,class:`cost text-xs text-[var(--el-text-color-secondary)]`};function vt(t,n,o,c,d,f){let _=u(`media-input`),v=u(`el-input`),y=u(`el-radio-button`),b=u(`el-radio-group`),x=u(`el-alert`),S=u(`consumption`),C=u(`el-button`),w=u(`el-dialog`);return g(),p(w,{"model-value":t.visible,title:t.$t(`digitalhuman.name.cloneVoice`),width:`440`,"align-center":``,"append-to-body":``,"close-on-click-modal":!t.cloning,"close-on-press-escape":!t.cloning,"onUpdate:modelValue":t.onVisible},{footer:m(()=>[e(`div`,gt,[t.walletMode?(g(),s(`span`,_t,i(t.voiceQuoteLoading?`…`:t.voiceQuoteUsdc?`${t.voiceQuoteUsdc} USDC`:t.$t(`common.x402Scenario.quoteBeforeSigning`)),1)):(g(),p(S,{key:1,value:t.DIGITALHUMAN_VOICE_CLONE_CONSUMPTION,service:t.service,class:`cost`},null,8,[`value`,`service`])),e(`div`,null,[a(C,{disabled:t.cloning,onClick:n[2]||=e=>t.onVisible(!1)},{default:m(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`]),a(C,{type:`primary`,loading:t.cloning,disabled:!t.sampleUrl||t.cloning,onClick:t.onClone},{default:m(()=>[r(i(t.$t(`digitalhuman.button.startClone`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])]),default:m(()=>[e(`p`,lt,i(t.$t(`digitalhuman.message.voiceCloneHint`)),1),a(_,{kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSample`),hint:t.$t(`digitalhuman.message.audioHint`),class:`mb-4`,onChange:t.onSampleChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]),e(`div`,ut,[e(`span`,dt,i(t.$t(`digitalhuman.name.voiceName`)),1),a(v,{modelValue:t.name,"onUpdate:modelValue":n[0]||=e=>t.name=e,class:`control`,placeholder:t.$t(`digitalhuman.placeholder.voiceName`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,ft,[e(`span`,pt,i(t.$t(`digitalhuman.name.voiceLang`)),1),a(b,{modelValue:t.lang,"onUpdate:modelValue":n[1]||=e=>t.lang=e,class:`control`},{default:m(()=>[(g(!0),s(l,null,h(t.langOptions,e=>(g(),p(y,{key:e.value,value:e.value},{default:m(()=>[r(i(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`])]),t.cloning?(g(),p(x,{key:0,closable:!1,type:`info`,class:`mt-4`},{default:m(()=>[e(`p`,mt,i(t.$t(`digitalhuman.message.voiceCloneRunning`)),1)]),_:1})):(g(),s(`p`,ht,i(t.$t(`digitalhuman.message.voiceStoredLocally`)),1))]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`onUpdate:modelValue`])}var yt=v({name:`DigitalHumanTimbreSelector`,components:{AddIcon:ce,DeleteIcon:F,ElButton:G,ElOption:b,ElSelect:y,VoiceCloneDialog:z(ct,[[`render`,vt],[`__scopeId`,`data-v-037c810e`]])},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{voices:$(),dialogVisible:!1}},mounted(){this.modelValue&&!this.voices.some(e=>e.voice_id===this.modelValue)&&this.$emit(`update:modelValue`,void 0)},methods:{labelFor(e){let t=this.$t(`digitalhuman.name.lang_${e.lang}`);return t.startsWith(`digitalhuman.`)?e.name:`${e.name} · ${t}`},onCloned(e){this.voices=$(),this.$emit(`update:modelValue`,e)},onRemove(e){this.voices=it(e),this.modelValue===e&&this.$emit(`update:modelValue`,void 0)}}}),bt={class:`row`},xt={class:`label`},St={class:`option`},Ct={class:`option-name`},wt=[`aria-label`,`title`,`onClick`],Tt={class:`empty`};function Et(n,o,d,f,_,v){let y=u(`delete-icon`),b=u(`el-option`),x=u(`el-select`),S=u(`add-icon`),C=u(`el-button`),w=u(`voice-clone-dialog`);return g(),s(`div`,null,[e(`div`,bt,[e(`span`,xt,i(n.$t(`digitalhuman.name.timbre`)),1),a(x,{"model-value":n.modelValue,class:`control`,placeholder:n.$t(`digitalhuman.placeholder.pickTimbre`),"onUpdate:modelValue":o[0]||=e=>n.$emit(`update:modelValue`,e)},c({default:m(()=>[(g(!0),s(l,null,h(n.voices,r=>(g(),p(b,{key:r.voice_id,label:n.labelFor(r),value:r.voice_id},{default:m(()=>[e(`span`,St,[e(`span`,Ct,i(n.labelFor(r)),1),e(`button`,{type:`button`,class:`option-remove`,"aria-label":n.$t(`common.button.delete`),title:n.$t(`common.button.delete`),onClick:t(e=>n.onRemove(r.voice_id),[`stop`])},[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)])]),_:2},1032,[`label`,`value`]))),128))]),_:2},[n.voices.length===0?{name:`empty`,fn:m(()=>[e(`p`,Tt,i(n.$t(`digitalhuman.message.noVoiceYet`)),1)]),key:`0`}:void 0]),1032,[`model-value`,`placeholder`])]),a(C,{size:`small`,text:``,type:`primary`,class:`clone`,onClick:o[1]||=e=>n.dialogVisible=!0},{default:m(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.button.cloneNewVoice`)),1)]),_:1}),a(w,{visible:n.dialogVisible,"onUpdate:visible":o[2]||=e=>n.dialogVisible=e,onCloned:n.onCloned},null,8,[`visible`,`onCloned`])])}var Dt=v({name:`ConfigPanel`,components:{ServicePricingSummary:Ie,ElButton:G,ElCollapse:k,ElCollapseItem:O,ElInputNumber:j,ElRadioButton:E,ElRadioGroup:D,InfoIcon:ee,MagicIcon:L,MediaInput:Z,PromptTextarea:P,TimbreSelector:z(yt,[[`render`,Et],[`__scopeId`,`data-v-e191cc56`]]),WarningIcon:I,ScenarioPaymentMode:Re},emits:[`generate`],data(){return{faceMode:`video`,voiceMode:`text`,advancedOpen:[],DIGITALHUMAN_VIDEO_ACCEPT:fe,DIGITALHUMAN_IMAGE_ACCEPT:pe,DIGITALHUMAN_AUDIO_ACCEPT:R,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.digitalhuman?.config},service(){return this.$store.state.digitalhuman?.service},consumption(){return _e(this.config,this.service?.cost)},missing(){let e=[];return(this.faceMode===`video`?this.config?.video_url:this.config?.image_url)||e.push({key:`face`,message:this.$t(`digitalhuman.message.missingFace`)}),this.voiceMode===`text`?(this.config?.text?.trim()||e.push({key:`text`,message:this.$t(`digitalhuman.message.missingText`)}),this.config?.voice_id||e.push({key:`timbre`,message:this.$t(`digitalhuman.message.missingTimbre`)})):this.config?.audio_url||e.push({key:`audio`,message:this.$t(`digitalhuman.message.missingAudio`)}),e},text:{get(){return this.config?.text},set(e){this.update({text:e})}},voiceId:{get(){return this.config?.voice_id},set(e){this.update({voice_id:e})}},speed:{get(){return this.config?.speed??1},set(e){this.update({speed:e})}},walletMode(){return V()&&q(`digitalhuman`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},faceMode(){this.walletMode&&this.scheduleQuote()},voiceMode(){this.walletMode&&this.scheduleQuote()}},mounted(){this.config?.image_url&&!this.config?.video_url&&(this.faceMode=`photo`),this.config?.audio_url&&(this.voiceMode=`audio`)},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=q(`digitalhuman`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=K(this.config,this.faceMode,this.voiceMode),r=await B.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},isMissing(e){return this.missing.some(t=>t.key===e)},update(e){this.$store.commit(`digitalhuman/setConfig`,{...this.config,...e})},onFaceModeChange(e){this.update(e===`video`?{image_url:void 0}:{video_url:void 0})},onVoiceModeChange(e){this.update(e===`audio`?{text:void 0,voice_id:void 0}:{audio_url:void 0})},onFaceVideoChange(e){this.update({video_url:e})},onFacePhotoChange(e){this.update({image_url:e})},onAudioChange(e){this.update({audio_url:e})},onGenerate(){let e=this.missing[0];if(e){T.warning(e.message);let t=e.key===`face`?`face`:`voice`;this.$refs[t]?.scrollIntoView?.({behavior:`smooth`,block:`center`});return}this.$emit(`generate`,K(this.config,this.faceMode,this.voiceMode))}}}),Ot={class:`flex flex-col h-full`},kt={class:`flex-1 overflow-y-auto p-5`},At={ref:`face`,class:`field-block mb-6`},jt={class:`field-head`},Mt={class:`field-title font-bold`},Nt={key:0,class:`required-badge`},Pt={ref:`voice`,class:`field-block mb-6`},Ft={class:`field-head`},It={class:`field-title font-bold`},Lt={key:0,class:`required-badge`},Rt={class:`field-row`},zt={class:`field-head`},Bt={class:`field-title font-bold`},Vt={class:`flex flex-col items-center justify-center px-5 pb-5`},Ht={key:0,class:`hint-missing`},Ut={class:`hint-eta`};function Wt(t,n,c,d,f,h){let _=u(`info-icon`),v=u(`el-radio-button`),y=u(`el-radio-group`),b=u(`media-input`),x=u(`prompt-textarea`),S=u(`timbre-selector`),C=u(`el-input-number`),w=u(`el-collapse-item`),T=u(`el-collapse`),E=u(`warning-icon`),D=u(`scenario-payment-mode`),O=u(`service-pricing-summary`),k=u(`magic-icon`),A=u(`el-button`);return g(),s(`div`,Ot,[e(`div`,kt,[e(`section`,At,[e(`div`,jt,[e(`h2`,Mt,i(t.$t(`digitalhuman.name.step1`)),1),t.isMissing(`face`)?(g(),s(`span`,Nt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step1`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.faceMode,"onUpdate:modelValue":n[0]||=e=>t.faceMode=e,class:`mode-switch mb-3`,onChange:t.onFaceModeChange},{default:m(()=>[a(v,{value:`video`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModeVideo`)),1)]),_:1}),a(v,{value:`photo`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModePhoto`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.faceMode===`video`?(g(),p(b,{key:0,kind:`video`,accept:t.DIGITALHUMAN_VIDEO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFaceVideo`),hint:t.$t(`digitalhuman.message.faceVideoHint`),onChange:t.onFaceVideoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`])):(g(),p(b,{key:1,kind:`image`,accept:t.DIGITALHUMAN_IMAGE_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFacePhoto`),hint:t.$t(`digitalhuman.message.facePhotoHint`),onChange:t.onFacePhotoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),e(`section`,Pt,[e(`div`,Ft,[e(`h2`,It,i(t.$t(`digitalhuman.name.step2`)),1),t.isMissing(`text`)||t.isMissing(`timbre`)||t.isMissing(`audio`)?(g(),s(`span`,Lt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step2`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.voiceMode,"onUpdate:modelValue":n[1]||=e=>t.voiceMode=e,class:`mode-switch mb-3`,onChange:t.onVoiceModeChange},{default:m(()=>[a(v,{value:`text`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeText`)),1)]),_:1}),a(v,{value:`audio`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeAudio`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.voiceMode===`text`?(g(),s(l,{key:0},[a(x,{modelValue:t.text,"onUpdate:modelValue":n[2]||=e=>t.text=e,class:`mb-3`,title:t.$t(`digitalhuman.name.speech`),placeholder:t.$t(`digitalhuman.placeholder.speech`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`placeholder`]),a(S,{modelValue:t.voiceId,"onUpdate:modelValue":n[3]||=e=>t.voiceId=e},null,8,[`modelValue`])],64)):(g(),p(b,{key:1,kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSpeechAudio`),hint:t.$t(`digitalhuman.message.audioHint`),onChange:t.onAudioChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),a(T,{modelValue:t.advancedOpen,"onUpdate:modelValue":n[5]||=e=>t.advancedOpen=e,class:`advanced`},{default:m(()=>[a(w,{name:`advanced`,title:t.$t(`digitalhuman.name.advanced`)},{default:m(()=>[e(`div`,Rt,[e(`div`,zt,[e(`h2`,Bt,i(t.$t(`digitalhuman.name.speed`)),1),a(_,{content:t.$t(`digitalhuman.description.speed`),class:`ml-1`},null,8,[`content`])]),a(C,{modelValue:t.speed,"onUpdate:modelValue":n[4]||=e=>t.speed=e,class:`field-control`,min:.5,max:2,step:.1,precision:1,"controls-position":`right`},null,8,[`modelValue`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])]),e(`div`,Vt,[t.missing.length>0?(g(),s(`p`,Ht,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.missing[0].message),1)])):o(``,!0),a(D,{scenario:`digitalhuman`}),t.walletMode?o(``,!0):(g(),p(O,{key:1,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`digitalhuman.button.generateVideo`)),1)]),_:1},8,[`onClick`]),e(`p`,Ut,i(t.$t(`digitalhuman.message.eta`)),1)])])}var Gt=z(Dt,[[`render`,Wt],[`__scopeId`,`data-v-0b652d94`]]),Kt=[`.jpg`,`.jpeg`,`.png`,`.webp`,`.bmp`,`.gif`],qt=v({name:`TaskPreview`,components:{ApiCodeButton:ze,AudioPreview:Y,ChannelIcon:ie,CopyToClipboard:Me,DeleteIcon:F,ElAlert:C,ElButton:G,ElProgress:M,ElTooltip:S,FullscreenIcon:ne,ImagePreview:J,InfoIcon:oe,MagicIcon:L,ReportButton:Ne,TimeIcon:N,VideoPlayer:Le,VideoPreview:X,WarningIcon:I},props:{modelValue:{type:Object,required:!0}},computed:{status(){return this.modelValue?.status||this.modelValue?.response?.state||`pending`},isSuccess(){return[`succeed`,`succeeded`].includes(this.status)||!!this.modelValue?.response?.video_url},isFailure(){return[`failed`,`dead`].includes(this.status)||this.modelValue?.response?.success===!1},isTerminal(){return this.isSuccess||this.isFailure},videoUrl(){return this.modelValue?.response?.video_url},progressPct(){let e=this.modelValue?.response?.progress;return typeof e==`number`?e:0},voiceLabel(){return this.modelValue?.request?.audio_url?this.$t(`digitalhuman.name.audioDriven`):this.$t(`digitalhuman.name.textDriven`)},faceUrl(){return this.modelValue?.request?.video_url||this.modelValue?.request?.image_url},isPhotoFace(){if(this.modelValue?.request?.image_url)return!0;let e=(this.faceUrl||``).split(`?`)[0].toLowerCase();return Kt.some(t=>e.endsWith(t))},audioUrl(){return this.modelValue?.request?.audio_url},outputSize(){let{width:e,height:t}=this.modelValue?.response||{};return e&&t?`${e}×${t}`:void 0},etaText(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(!e)return;let t=he-(Date.now()/1e3-e);return t<=60?this.$t(`digitalhuman.message.etaAlmostDone`):this.$t(`digitalhuman.message.etaRemaining`,{minutes:Math.ceil(t/60)})},statusLabel(){let e=`digitalhuman.status.${this.status}`,t=this.$t(e);return t===e?this.$t(`digitalhuman.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await H.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`digitalhuman/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)}}}),Jt={class:`preview`},Yt={class:`left`},Xt={class:`main`},Zt={class:`bot`},Qt={class:`datetime`},$t=[`aria-label`],en={class:`info`},tn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},nn={class:`prompt mt-2`},rn={key:0},an={key:0,class:`content`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ln={key:1,class:`content`},un={class:`operations mt-2`},dn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},gn={key:2,class:`content`},_n={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function xn(n,c,l,d,f,h){let _=u(`capability-presentation`),v=u(`delete-icon`),y=u(`el-tooltip`),b=u(`image-preview`),x=u(`video-preview`),S=u(`audio-preview`),C=u(`time-icon`),w=u(`el-progress`),T=u(`magic-icon`),E=u(`copy-to-clipboard`),D=u(`el-alert`),O=u(`video-player`),k=u(`el-button`),A=u(`api-code-button`),j=u(`report-button`),M=u(`fullscreen-icon`),N=u(`channel-icon`),ee=u(`warning-icon`),P=u(`info-icon`);return g(),s(`div`,Jt,[e(`div`,Yt,[a(_,{capability:`digitalhuman`,part:`avatar`,class:`avatar`})]),e(`div`,Xt,[e(`div`,Zt,[a(_,{capability:`digitalhuman`,part:`name`}),e(`span`,Qt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:m(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,$t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,en,[n.faceUrl||n.audioUrl?(g(),s(`div`,tn,[n.faceUrl&&n.isPhotoFace?(g(),p(b,{key:0,url:n.faceUrl,name:`face`,closable:!1},null,8,[`url`])):n.faceUrl?(g(),p(x,{key:1,url:n.faceUrl,name:`face`},null,8,[`url`])):o(``,!0),n.audioUrl?(g(),p(S,{key:2,url:n.audioUrl,name:`audio`},null,8,[`url`])):o(``,!0)])):o(``,!0),e(`p`,nn,[r(i(n.modelValue?.request?.text||n.voiceLabel)+` `,1),n.isTerminal?o(``,!0):(g(),s(`span`,rn,` - (`+i(n.statusLabel)+`) `,1))])]),n.isTerminal?o(``,!0):(g(),s(`div`,an,[a(D,{closable:!1,class:`info-state`},{default:m(()=>[e(`p`,on,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.statusLabel),1)]),a(w,{percentage:n.progressPct,"stroke-width":6,class:`mb-2`},null,8,[`percentage`]),n.etaText?(g(),s(`p`,sn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.etaLabel`))+`: `+i(n.etaText),1)])):o(``,!0),e(`p`,cn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])),n.isSuccess?(g(),s(`div`,ln,[n.videoUrl?(g(),p(O,{key:0,src:n.videoUrl},null,8,[`src`])):o(``,!0),e(`div`,un,[n.videoUrl?(g(),p(k,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=e=>n.onDownload(e,n.videoUrl)},{default:m(()=>[r(i(n.$t(`digitalhuman.button.download`)),1)]),_:1})):o(``,!0),a(A,{path:`/digital-human/videos`,body:n.modelValue?.request},null,8,[`body`]),a(j,{service:`digitalhuman`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.response?.duration?(g(),s(`p`,dn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.duration`))+`: `+i(n.modelValue?.response?.duration?.toFixed(1))+`s `,1)])):o(``,!0),n.outputSize?(g(),s(`p`,fn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.outputSize`))+`: `+i(n.outputSize),1)])):o(``,!0),e(`p`,pn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,mn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,hn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,gn,[a(D,{closable:!1,class:`failure`},{template:m(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failure`)),1)]),default:m(()=>[e(`p`,_n,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(g(),s(`p`,vn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(E,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,yn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,bn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Sn=v({name:`RecentPanel`,components:{TaskPreview:z(qt,[[`render`,xn],[`__scopeId`,`data-v-342f1d6d`]]),NoTasks:re,BotPlaceholder:Be,ScrollList:te},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.digitalhuman?.tasks,items:this.$store.state.digitalhuman?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Cn={key:0},wn={key:2,class:`w-full h-full flex items-center justify-center`};function Tn(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),_=u(`scroll-list`),v=u(`no-tasks`);return g(),s(l,null,[e.tasks?.items===void 0?(g(),s(`div`,Cn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),p(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:m(()=>[(g(!0),s(l,null,h(e.tasks?.items,(e,t)=>(g(),p(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,wn,[a(v)])):o(``,!0)],64)}var En=v({name:`DigitalHumanIndex`,components:{ConfigPanel:Gt,Layout:qe,RecentPanel:z(Sn,[[`render`,Tn]])},mixins:[ke,Ve(`digitalhuman`,!1)],inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.digitalhuman?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.digitalhuman?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.digitalhuman.credential},config(){return this.$store.state.digitalhuman.config},tasks(){return this.$store.state.digitalhuman.tasks},walletMode(){return V()&&q(`digitalhuman`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`digitalhuman/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){window.clearInterval(this.job),e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ae({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`digitalhuman/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(`digitalhuman/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){if(!De(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let t;if(this.walletMode){let n=this.getWalletContext();if(!n){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=B.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Ce())return;let n=this.credential?.token;if(!n)return;t=B.generate(e,{token:n})}T.info(this.$t(`digitalhuman.message.startingTask`)),xe(`digitalhuman`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`digitalhuman.message.startTaskSuccess`))}).catch(e=>{e instanceof W||be(e,`digitalhuman`)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`digitalhuman.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return U(this.$wallet)},async confirmWalletPayment(e){return H.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Dn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return g(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var On=z(En,[[`render`,Dn]]);export{On 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,P as c,T as l,at as u,ht as d,it as f,j as p,mt 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-CJHU1puz.js";import{t as x}from"./upload-DPM3VJNR.js";import{t as S}from"./tooltip-BmwZvoCo.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-qt9s4QBH.js";import{n as E,r as D}from"./radio-BNhFzeBO.js";import{n as O,t as k}from"./collapse-DsSFtXhr.js";import{t as A}from"./drawer-KN1LRowH.js";import{t as j}from"./input-number-BB7Zip42.js";import{t as M}from"./progress-BuyYfFZn.js";import{t as N}from"./clock-mP13CJwv.js";import{a as ee,i as P,n as te,o as ne,r as re,s as ie,t as ae}from"./pagination-CMtbXlkA.js";import{t as oe}from"./info-BWyB8juG.js";import{t as se}from"./music-2-CqlmSnd9.js";import{t as ce}from"./plus-DO3XunBM.js";import{t as F}from"./trash-2-Bgi3IwhR.js";import{t as I}from"./triangle-alert-tECqMJGT.js";import{t as le}from"./upload-DNoc85A2.js";import{t as ue}from"./user-B-D8rRw5.js";import{t as de}from"./video-B1Lu-5UG.js";import{t as L}from"./wand-sparkles-CylWIDdZ.js";import{Br as R,Gr as fe,Hr as pe,Kr as me,Vr as he,zr as ge}from"./constants-CmC-0Hwp.js";import{A as z,Cn as _e,Er as B,Ka as ve,La as ye,Li as V,O as be,Qi as xe,Tr as Se,Va as H,aa as Ce,at as we,ct as Te,di as U,et as Ee,it as De,li as W,lo as Oe,ot as ke,st as Ae,to as G,wr as K,za as je,zi as q}from"./index-BDrhpCy4.js";import{t as Me}from"./CopyToClipboard-sz0qw-Lr.js";import{t as Ne}from"./ReportButton-DbaMTiER.js";import{t as J}from"./ImagePreview-BDgO7JJQ.js";import{n as Pe}from"./taskDrawerMixin-DyAUhFEq.js";import{n as Fe,t as Ie}from"./ServicePricingSummary-B6e4UMsc.js";import{t as Y}from"./AudioPreview-aCkjiIEz.js";import{t as Le}from"./VideoPlayer-D5tztnYV.js";import{t as X}from"./VideoPreview-aiX7Evfh.js";import{t as Re}from"./ScenarioPaymentMode-kZ7zDlkq.js";import{t as ze}from"./ApiCodeButton-B7iQtRyE.js";import{t as Be}from"./BotPlaceholder-DwG3z10_.js";import{t as Ve}from"./taskPollingMixin-CcLxtz8z.js";var He=v({name:`LayoutDigitalHuman`,components:{UserIcon:ue,ElDrawer:A,ElButton:G},mixins:[Pe]}),Ue={class:`main flex flex-row flex-1`},We={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)]`},Ge={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ke(t,n,r,i,o,c){let l=u(`user-icon`),p=u(`el-button`),h=u(`el-drawer`);return g(),s(`div`,Ue,[e(`div`,We,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ge,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{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:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var qe=z(He,[[`render`,Ke],[`__scopeId`,`data-v-909c6359`]]),Je=v({name:`DigitalHumanMediaInput`,components:{AudioPreview:Y,CloseIcon:je,ElButton:G,ElProgress:M,ElUpload:x,ImagePreview:J,MusicIcon:se,UploadIcon:le,VideoIcon:de,VideoPreview:X},mixins:[Te,Ae,we,Ee],props:{kind:{type:String,required:!0},accept:{type:String,default:``},buttonText:{type:String,default:``},hint:{type:String,default:``}},emits:[`change`],data(){return{fileList:[],uploadUrl:ye()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},hasFile(){return this.fileList.length>0}},methods:{uploadedUrl(e){return e?.response?.file_url},isPending(e){return e.status===`ready`||e.status===`uploading`},onExceed(e){let t=this.$refs.uploader;t?.clearFiles();let n=e[0];n&&(t?.handleStart?.(n),t?.submit?.())},onError(){T.error(this.$t(`digitalhuman.message.uploadError`))},onRemoveFile(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onChange()},onChange(){let e=this.fileList?.[0];this.$emit(`change`,e?this.uploadedUrl(e):void 0)}}}),Ye={class:`thumb`},Xe={key:2,class:`placeholder`},Ze=[`title`],Qe=[`aria-label`,`title`,`onClick`],$e={key:0,class:`hint`};function et(c,d,f,h,_,v){let y=u(`image-preview`),b=u(`video-preview`),x=u(`audio-preview`),S=u(`el-progress`),C=u(`video-icon`),w=u(`music-icon`),T=u(`close-icon`),E=u(`upload-icon`),D=u(`el-button`),O=u(`el-upload`);return g(),p(O,{ref:`uploader`,"file-list":c.fileList,"onUpdate:fileList":d[0]||=e=>c.fileList=e,accept:c.accept,name:`file`,class:`media-input`,limit:1,multiple:!1,"before-upload":c.beforeUploadSizeGuard,action:c.uploadUrl,headers:c.headers,"on-exceed":c.onExceed,"on-error":c.onError,"on-success":c.onChange,"on-remove":c.onChange},{file:m(({file:r})=>[e(`div`,{class:n([`slot`,{pending:c.isPending(r)}])},[c.kind===`image`&&r.url?(g(),p(y,{key:0,url:r.url,name:r.name,percentage:r.percentage,onRemove:e=>c.onRemoveFile(r)},null,8,[`url`,`name`,`percentage`,`onRemove`])):(g(),s(l,{key:1},[e(`div`,Ye,[c.kind===`video`&&c.uploadedUrl(r)?(g(),p(b,{key:0,url:c.uploadedUrl(r)},null,8,[`url`])):c.kind===`audio`&&c.uploadedUrl(r)?(g(),p(x,{key:1,url:c.uploadedUrl(r)},null,8,[`url`])):(g(),s(`div`,Xe,[c.isPending(r)?(g(),p(S,{key:0,type:`circle`,"stroke-width":4,percentage:Math.round(r.percentage||0),width:34},null,8,[`percentage`])):c.kind===`video`?(g(),p(C,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),p(w,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]))]),e(`span`,{class:`filename`,title:r.name},i(r.name),9,Ze),e(`button`,{type:`button`,class:`remove`,"aria-label":c.$t(`common.button.close`),title:c.$t(`common.button.close`),onClick:t(e=>c.onRemoveFile(r),[`stop`])},[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Qe)],64))],2)]),default:m(()=>[a(D,{round:``,type:`primary`,size:`small`,class:`btn`},{default:m(()=>[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.hasFile?c.$t(`digitalhuman.button.replace`):c.buttonText),1)]),_:1}),c.hint?(g(),s(`p`,$e,i(c.hint),1)):o(``,!0)]),_:1},8,[`file-list`,`accept`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])}var Z=z(Je,[[`render`,et],[`__scopeId`,`data-v-db0590a9`]]),tt=20,Q=e=>{let t=e;return!!t&&typeof t.voice_id==`string`&&!!t.voice_id&&typeof t.name==`string`},$=()=>{try{let e=JSON.parse(localStorage.getItem(`digitalhuman.voices`)||`[]`);return Array.isArray(e)?e.filter(Q).map(e=>({voice_id:e.voice_id,name:e.name,lang:typeof e.lang==`string`?e.lang:`zh`,created_at:typeof e.created_at==`number`?e.created_at:0})):[]}catch{return[]}},nt=e=>{try{localStorage.setItem(me,JSON.stringify(e))}catch{}return e},rt=e=>Q(e)?nt([e,...$().filter(t=>t.voice_id!==e.voice_id)].slice(0,tt)):$(),it=e=>nt($().filter(t=>t.voice_id!==e)),at=e=>`${e} ${$().length+1}`,ot=3e3,st=60,ct=v({name:`DigitalHumanVoiceCloneDialog`,components:{Consumption:Fe,ElAlert:C,ElButton:G,ElDialog:ve,ElInput:Oe,ElRadioButton:E,ElRadioGroup:D,MediaInput:Z},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`,`cloned`],data(){return{sampleUrl:void 0,name:``,lang:`zh`,cloning:!1,destroyed:!1,runId:0,DIGITALHUMAN_AUDIO_ACCEPT:R,DIGITALHUMAN_VOICE_CLONE_CONSUMPTION:2,voiceQuoteUsdc:void 0,voiceQuoteLoading:!1,quoteRunId:0}},computed:{service(){return this.$store.state.digitalhuman?.service},credentialToken(){return this.$store.state.digitalhuman?.credential?.token},walletMode(){return V()&&q(`digitalhuman`).mode===`wallet`},langOptions(){return ge.map(e=>({value:e,label:this.$t(`digitalhuman.name.lang_${e}`)}))}},watch:{walletMode(e){this.voiceQuoteUsdc=void 0,e&&this.visible&&this.sampleUrl&&this.refreshVoiceQuote()},visible(e){e?(this.sampleUrl=void 0,this.name=at(this.$t(`digitalhuman.name.myVoice`)),this.lang=`zh`):(this.runId++,this.quoteRunId++,this.cloning=!1,this.voiceQuoteLoading=!1)}},beforeUnmount(){this.destroyed=!0,this.runId++,this.quoteRunId++},methods:{onVisible(e){this.cloning&&!e||this.$emit(`update:visible`,e)},onSampleChange(e){this.sampleUrl=e,this.voiceQuoteUsdc=void 0,e&&this.walletMode&&this.refreshVoiceQuote()},isStale(e){return this.destroyed||e!==this.runId},sleep(e){return new Promise(t=>setTimeout(t,e))},async refreshVoiceQuote(){if(!this.sampleUrl)return;let e=++this.quoteRunId;this.voiceQuoteLoading=!0;try{let t=await B.quoteVoice(this.voiceRequest());e===this.quoteRunId&&this.walletMode&&(this.voiceQuoteUsdc=t.amountUsdc)}catch(e){console.warn(`x402 voice quote failed`,e)}finally{e===this.quoteRunId&&(this.voiceQuoteLoading=!1)}},voiceRequest(){return Se({audio_url:this.sampleUrl||``,lang:this.lang,name:this.name||void 0})},paymentOptions(){if(!this.walletMode)return this.credentialToken?{token:this.credentialToken}:void 0;let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credentialToken}}},async onClone(){if(!this.sampleUrl)return;let e=this.paymentOptions();if(!e)return;let t=++this.runId;this.cloning=!0;try{let{data:n}=await B.cloneVoice(this.voiceRequest(),e);if(this.isStale(t))return;if(n?.voice_id){this.onCloned(n.voice_id);return}if(n?.task_id)await this.pollVoice(n.task_id,t);else throw Error(`no task`)}catch(e){if(e instanceof W)return;this.isStale(t)||T.error(this.$t(`digitalhuman.message.voiceCloneFailed`))}finally{this.isStale(t)||(this.cloning=!1)}},async pollVoice(e,t){for(let n=0;n<st;n++){if(this.isStale(t)||(await this.sleep(ot),this.isStale(t)))return;let n=this.credentialToken,{data:r}=await B.pollTask(e,n?{token:n}:{mode:`x402`});if(this.isStale(t))return;if(r?.voice_id){this.onCloned(r.voice_id);return}if(r?.state===`failed`)throw Error(`clone failed`)}throw Error(`timeout`)},getWalletContext(){return U(this.$wallet)},async confirmWalletPayment(e){return H.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},onCloned(e){rt({voice_id:e,name:this.name||this.$t(`digitalhuman.name.myVoice`),lang:this.lang,created_at:Date.now()/1e3}),T.success(this.$t(`digitalhuman.message.voiceCloneSuccess`)),this.cloning=!1,this.$emit(`cloned`,e),this.$emit(`update:visible`,!1)}}}),lt={class:`text-xs text-[var(--el-text-color-secondary)] mb-3`},ut={class:`field mb-3`},dt={class:`label`},ft={class:`field`},pt={class:`label`},mt={class:`text-xs mb-0`},ht={key:1,class:`mt-4 text-xs text-[var(--el-text-color-secondary)]`},gt={class:`footer`},_t={key:0,class:`cost text-xs text-[var(--el-text-color-secondary)]`};function vt(t,n,o,c,d,f){let _=u(`media-input`),v=u(`el-input`),y=u(`el-radio-button`),b=u(`el-radio-group`),x=u(`el-alert`),S=u(`consumption`),C=u(`el-button`),w=u(`el-dialog`);return g(),p(w,{"model-value":t.visible,title:t.$t(`digitalhuman.name.cloneVoice`),width:`440`,"align-center":``,"append-to-body":``,"close-on-click-modal":!t.cloning,"close-on-press-escape":!t.cloning,"onUpdate:modelValue":t.onVisible},{footer:m(()=>[e(`div`,gt,[t.walletMode?(g(),s(`span`,_t,i(t.voiceQuoteLoading?`…`:t.voiceQuoteUsdc?`${t.voiceQuoteUsdc} USDC`:t.$t(`common.x402Scenario.quoteBeforeSigning`)),1)):(g(),p(S,{key:1,value:t.DIGITALHUMAN_VOICE_CLONE_CONSUMPTION,service:t.service,class:`cost`},null,8,[`value`,`service`])),e(`div`,null,[a(C,{disabled:t.cloning,onClick:n[2]||=e=>t.onVisible(!1)},{default:m(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`]),a(C,{type:`primary`,loading:t.cloning,disabled:!t.sampleUrl||t.cloning,onClick:t.onClone},{default:m(()=>[r(i(t.$t(`digitalhuman.button.startClone`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])]),default:m(()=>[e(`p`,lt,i(t.$t(`digitalhuman.message.voiceCloneHint`)),1),a(_,{kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSample`),hint:t.$t(`digitalhuman.message.audioHint`),class:`mb-4`,onChange:t.onSampleChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]),e(`div`,ut,[e(`span`,dt,i(t.$t(`digitalhuman.name.voiceName`)),1),a(v,{modelValue:t.name,"onUpdate:modelValue":n[0]||=e=>t.name=e,class:`control`,placeholder:t.$t(`digitalhuman.placeholder.voiceName`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,ft,[e(`span`,pt,i(t.$t(`digitalhuman.name.voiceLang`)),1),a(b,{modelValue:t.lang,"onUpdate:modelValue":n[1]||=e=>t.lang=e,class:`control`},{default:m(()=>[(g(!0),s(l,null,h(t.langOptions,e=>(g(),p(y,{key:e.value,value:e.value},{default:m(()=>[r(i(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`])]),t.cloning?(g(),p(x,{key:0,closable:!1,type:`info`,class:`mt-4`},{default:m(()=>[e(`p`,mt,i(t.$t(`digitalhuman.message.voiceCloneRunning`)),1)]),_:1})):(g(),s(`p`,ht,i(t.$t(`digitalhuman.message.voiceStoredLocally`)),1))]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`onUpdate:modelValue`])}var yt=v({name:`DigitalHumanTimbreSelector`,components:{AddIcon:ce,DeleteIcon:F,ElButton:G,ElOption:b,ElSelect:y,VoiceCloneDialog:z(ct,[[`render`,vt],[`__scopeId`,`data-v-037c810e`]])},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{voices:$(),dialogVisible:!1}},mounted(){this.modelValue&&!this.voices.some(e=>e.voice_id===this.modelValue)&&this.$emit(`update:modelValue`,void 0)},methods:{labelFor(e){let t=this.$t(`digitalhuman.name.lang_${e.lang}`);return t.startsWith(`digitalhuman.`)?e.name:`${e.name} · ${t}`},onCloned(e){this.voices=$(),this.$emit(`update:modelValue`,e)},onRemove(e){this.voices=it(e),this.modelValue===e&&this.$emit(`update:modelValue`,void 0)}}}),bt={class:`row`},xt={class:`label`},St={class:`option`},Ct={class:`option-name`},wt=[`aria-label`,`title`,`onClick`],Tt={class:`empty`};function Et(n,o,d,f,_,v){let y=u(`delete-icon`),b=u(`el-option`),x=u(`el-select`),S=u(`add-icon`),C=u(`el-button`),w=u(`voice-clone-dialog`);return g(),s(`div`,null,[e(`div`,bt,[e(`span`,xt,i(n.$t(`digitalhuman.name.timbre`)),1),a(x,{"model-value":n.modelValue,class:`control`,placeholder:n.$t(`digitalhuman.placeholder.pickTimbre`),"onUpdate:modelValue":o[0]||=e=>n.$emit(`update:modelValue`,e)},c({default:m(()=>[(g(!0),s(l,null,h(n.voices,r=>(g(),p(b,{key:r.voice_id,label:n.labelFor(r),value:r.voice_id},{default:m(()=>[e(`span`,St,[e(`span`,Ct,i(n.labelFor(r)),1),e(`button`,{type:`button`,class:`option-remove`,"aria-label":n.$t(`common.button.delete`),title:n.$t(`common.button.delete`),onClick:t(e=>n.onRemove(r.voice_id),[`stop`])},[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)])]),_:2},1032,[`label`,`value`]))),128))]),_:2},[n.voices.length===0?{name:`empty`,fn:m(()=>[e(`p`,Tt,i(n.$t(`digitalhuman.message.noVoiceYet`)),1)]),key:`0`}:void 0]),1032,[`model-value`,`placeholder`])]),a(C,{size:`small`,text:``,type:`primary`,class:`clone`,onClick:o[1]||=e=>n.dialogVisible=!0},{default:m(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.button.cloneNewVoice`)),1)]),_:1}),a(w,{visible:n.dialogVisible,"onUpdate:visible":o[2]||=e=>n.dialogVisible=e,onCloned:n.onCloned},null,8,[`visible`,`onCloned`])])}var Dt=v({name:`ConfigPanel`,components:{ServicePricingSummary:Ie,ElButton:G,ElCollapse:k,ElCollapseItem:O,ElInputNumber:j,ElRadioButton:E,ElRadioGroup:D,InfoIcon:ee,MagicIcon:L,MediaInput:Z,PromptTextarea:P,TimbreSelector:z(yt,[[`render`,Et],[`__scopeId`,`data-v-e191cc56`]]),WarningIcon:I,ScenarioPaymentMode:Re},emits:[`generate`],data(){return{faceMode:`video`,voiceMode:`text`,advancedOpen:[],DIGITALHUMAN_VIDEO_ACCEPT:fe,DIGITALHUMAN_IMAGE_ACCEPT:pe,DIGITALHUMAN_AUDIO_ACCEPT:R,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.digitalhuman?.config},service(){return this.$store.state.digitalhuman?.service},consumption(){return _e(this.config,this.service?.cost)},missing(){let e=[];return(this.faceMode===`video`?this.config?.video_url:this.config?.image_url)||e.push({key:`face`,message:this.$t(`digitalhuman.message.missingFace`)}),this.voiceMode===`text`?(this.config?.text?.trim()||e.push({key:`text`,message:this.$t(`digitalhuman.message.missingText`)}),this.config?.voice_id||e.push({key:`timbre`,message:this.$t(`digitalhuman.message.missingTimbre`)})):this.config?.audio_url||e.push({key:`audio`,message:this.$t(`digitalhuman.message.missingAudio`)}),e},text:{get(){return this.config?.text},set(e){this.update({text:e})}},voiceId:{get(){return this.config?.voice_id},set(e){this.update({voice_id:e})}},speed:{get(){return this.config?.speed??1},set(e){this.update({speed:e})}},walletMode(){return V()&&q(`digitalhuman`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},faceMode(){this.walletMode&&this.scheduleQuote()},voiceMode(){this.walletMode&&this.scheduleQuote()}},mounted(){this.config?.image_url&&!this.config?.video_url&&(this.faceMode=`photo`),this.config?.audio_url&&(this.voiceMode=`audio`)},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=q(`digitalhuman`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=K(this.config,this.faceMode,this.voiceMode),r=await B.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},isMissing(e){return this.missing.some(t=>t.key===e)},update(e){this.$store.commit(`digitalhuman/setConfig`,{...this.config,...e})},onFaceModeChange(e){this.update(e===`video`?{image_url:void 0}:{video_url:void 0})},onVoiceModeChange(e){this.update(e===`audio`?{text:void 0,voice_id:void 0}:{audio_url:void 0})},onFaceVideoChange(e){this.update({video_url:e})},onFacePhotoChange(e){this.update({image_url:e})},onAudioChange(e){this.update({audio_url:e})},onGenerate(){let e=this.missing[0];if(e){T.warning(e.message);let t=e.key===`face`?`face`:`voice`;this.$refs[t]?.scrollIntoView?.({behavior:`smooth`,block:`center`});return}this.$emit(`generate`,K(this.config,this.faceMode,this.voiceMode))}}}),Ot={class:`flex flex-col h-full`},kt={class:`flex-1 overflow-y-auto p-5`},At={ref:`face`,class:`field-block mb-6`},jt={class:`field-head`},Mt={class:`field-title font-bold`},Nt={key:0,class:`required-badge`},Pt={ref:`voice`,class:`field-block mb-6`},Ft={class:`field-head`},It={class:`field-title font-bold`},Lt={key:0,class:`required-badge`},Rt={class:`field-row`},zt={class:`field-head`},Bt={class:`field-title font-bold`},Vt={class:`flex flex-col items-center justify-center px-5 pb-5`},Ht={key:0,class:`hint-missing`},Ut={class:`hint-eta`};function Wt(t,n,c,d,f,h){let _=u(`info-icon`),v=u(`el-radio-button`),y=u(`el-radio-group`),b=u(`media-input`),x=u(`prompt-textarea`),S=u(`timbre-selector`),C=u(`el-input-number`),w=u(`el-collapse-item`),T=u(`el-collapse`),E=u(`warning-icon`),D=u(`scenario-payment-mode`),O=u(`service-pricing-summary`),k=u(`magic-icon`),A=u(`el-button`);return g(),s(`div`,Ot,[e(`div`,kt,[e(`section`,At,[e(`div`,jt,[e(`h2`,Mt,i(t.$t(`digitalhuman.name.step1`)),1),t.isMissing(`face`)?(g(),s(`span`,Nt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step1`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.faceMode,"onUpdate:modelValue":n[0]||=e=>t.faceMode=e,class:`mode-switch mb-3`,onChange:t.onFaceModeChange},{default:m(()=>[a(v,{value:`video`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModeVideo`)),1)]),_:1}),a(v,{value:`photo`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModePhoto`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.faceMode===`video`?(g(),p(b,{key:0,kind:`video`,accept:t.DIGITALHUMAN_VIDEO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFaceVideo`),hint:t.$t(`digitalhuman.message.faceVideoHint`),onChange:t.onFaceVideoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`])):(g(),p(b,{key:1,kind:`image`,accept:t.DIGITALHUMAN_IMAGE_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFacePhoto`),hint:t.$t(`digitalhuman.message.facePhotoHint`),onChange:t.onFacePhotoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),e(`section`,Pt,[e(`div`,Ft,[e(`h2`,It,i(t.$t(`digitalhuman.name.step2`)),1),t.isMissing(`text`)||t.isMissing(`timbre`)||t.isMissing(`audio`)?(g(),s(`span`,Lt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step2`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.voiceMode,"onUpdate:modelValue":n[1]||=e=>t.voiceMode=e,class:`mode-switch mb-3`,onChange:t.onVoiceModeChange},{default:m(()=>[a(v,{value:`text`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeText`)),1)]),_:1}),a(v,{value:`audio`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeAudio`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.voiceMode===`text`?(g(),s(l,{key:0},[a(x,{modelValue:t.text,"onUpdate:modelValue":n[2]||=e=>t.text=e,class:`mb-3`,title:t.$t(`digitalhuman.name.speech`),placeholder:t.$t(`digitalhuman.placeholder.speech`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`placeholder`]),a(S,{modelValue:t.voiceId,"onUpdate:modelValue":n[3]||=e=>t.voiceId=e},null,8,[`modelValue`])],64)):(g(),p(b,{key:1,kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSpeechAudio`),hint:t.$t(`digitalhuman.message.audioHint`),onChange:t.onAudioChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),a(T,{modelValue:t.advancedOpen,"onUpdate:modelValue":n[5]||=e=>t.advancedOpen=e,class:`advanced`},{default:m(()=>[a(w,{name:`advanced`,title:t.$t(`digitalhuman.name.advanced`)},{default:m(()=>[e(`div`,Rt,[e(`div`,zt,[e(`h2`,Bt,i(t.$t(`digitalhuman.name.speed`)),1),a(_,{content:t.$t(`digitalhuman.description.speed`),class:`ml-1`},null,8,[`content`])]),a(C,{modelValue:t.speed,"onUpdate:modelValue":n[4]||=e=>t.speed=e,class:`field-control`,min:.5,max:2,step:.1,precision:1,"controls-position":`right`},null,8,[`modelValue`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])]),e(`div`,Vt,[t.missing.length>0?(g(),s(`p`,Ht,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.missing[0].message),1)])):o(``,!0),a(D,{scenario:`digitalhuman`}),t.walletMode?o(``,!0):(g(),p(O,{key:1,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`digitalhuman.button.generateVideo`)),1)]),_:1},8,[`onClick`]),e(`p`,Ut,i(t.$t(`digitalhuman.message.eta`)),1)])])}var Gt=z(Dt,[[`render`,Wt],[`__scopeId`,`data-v-0b652d94`]]),Kt=[`.jpg`,`.jpeg`,`.png`,`.webp`,`.bmp`,`.gif`],qt=v({name:`TaskPreview`,components:{ApiCodeButton:ze,AudioPreview:Y,ChannelIcon:ie,CopyToClipboard:Me,DeleteIcon:F,ElAlert:C,ElButton:G,ElProgress:M,ElTooltip:S,FullscreenIcon:ne,ImagePreview:J,InfoIcon:oe,MagicIcon:L,ReportButton:Ne,TimeIcon:N,VideoPlayer:Le,VideoPreview:X,WarningIcon:I},props:{modelValue:{type:Object,required:!0}},computed:{status(){return this.modelValue?.status||this.modelValue?.response?.state||`pending`},isSuccess(){return[`succeed`,`succeeded`].includes(this.status)||!!this.modelValue?.response?.video_url},isFailure(){return[`failed`,`dead`].includes(this.status)||this.modelValue?.response?.success===!1},isTerminal(){return this.isSuccess||this.isFailure},videoUrl(){return this.modelValue?.response?.video_url},progressPct(){let e=this.modelValue?.response?.progress;return typeof e==`number`?e:0},voiceLabel(){return this.modelValue?.request?.audio_url?this.$t(`digitalhuman.name.audioDriven`):this.$t(`digitalhuman.name.textDriven`)},faceUrl(){return this.modelValue?.request?.video_url||this.modelValue?.request?.image_url},isPhotoFace(){if(this.modelValue?.request?.image_url)return!0;let e=(this.faceUrl||``).split(`?`)[0].toLowerCase();return Kt.some(t=>e.endsWith(t))},audioUrl(){return this.modelValue?.request?.audio_url},outputSize(){let{width:e,height:t}=this.modelValue?.response||{};return e&&t?`${e}×${t}`:void 0},etaText(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(!e)return;let t=he-(Date.now()/1e3-e);return t<=60?this.$t(`digitalhuman.message.etaAlmostDone`):this.$t(`digitalhuman.message.etaRemaining`,{minutes:Math.ceil(t/60)})},statusLabel(){let e=`digitalhuman.status.${this.status}`,t=this.$t(e);return t===e?this.$t(`digitalhuman.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await H.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`digitalhuman/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)}}}),Jt={class:`preview`},Yt={class:`left`},Xt={class:`main`},Zt={class:`bot`},Qt={class:`datetime`},$t=[`aria-label`],en={class:`info`},tn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},nn={class:`prompt mt-2`},rn={key:0},an={key:0,class:`content`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ln={key:1,class:`content`},un={class:`operations mt-2`},dn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},gn={key:2,class:`content`},_n={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function xn(n,c,l,d,f,h){let _=u(`capability-presentation`),v=u(`delete-icon`),y=u(`el-tooltip`),b=u(`image-preview`),x=u(`video-preview`),S=u(`audio-preview`),C=u(`time-icon`),w=u(`el-progress`),T=u(`magic-icon`),E=u(`copy-to-clipboard`),D=u(`el-alert`),O=u(`video-player`),k=u(`el-button`),A=u(`api-code-button`),j=u(`report-button`),M=u(`fullscreen-icon`),N=u(`channel-icon`),ee=u(`warning-icon`),P=u(`info-icon`);return g(),s(`div`,Jt,[e(`div`,Yt,[a(_,{capability:`digitalhuman`,part:`avatar`,class:`avatar`})]),e(`div`,Xt,[e(`div`,Zt,[a(_,{capability:`digitalhuman`,part:`name`}),e(`span`,Qt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:m(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,$t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,en,[n.faceUrl||n.audioUrl?(g(),s(`div`,tn,[n.faceUrl&&n.isPhotoFace?(g(),p(b,{key:0,url:n.faceUrl,name:`face`,closable:!1},null,8,[`url`])):n.faceUrl?(g(),p(x,{key:1,url:n.faceUrl,name:`face`},null,8,[`url`])):o(``,!0),n.audioUrl?(g(),p(S,{key:2,url:n.audioUrl,name:`audio`},null,8,[`url`])):o(``,!0)])):o(``,!0),e(`p`,nn,[r(i(n.modelValue?.request?.text||n.voiceLabel)+` `,1),n.isTerminal?o(``,!0):(g(),s(`span`,rn,` - (`+i(n.statusLabel)+`) `,1))])]),n.isTerminal?o(``,!0):(g(),s(`div`,an,[a(D,{closable:!1,class:`info-state`},{default:m(()=>[e(`p`,on,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.statusLabel),1)]),a(w,{percentage:n.progressPct,"stroke-width":6,class:`mb-2`},null,8,[`percentage`]),n.etaText?(g(),s(`p`,sn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.etaLabel`))+`: `+i(n.etaText),1)])):o(``,!0),e(`p`,cn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])),n.isSuccess?(g(),s(`div`,ln,[n.videoUrl?(g(),p(O,{key:0,src:n.videoUrl},null,8,[`src`])):o(``,!0),e(`div`,un,[n.videoUrl?(g(),p(k,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=e=>n.onDownload(e,n.videoUrl)},{default:m(()=>[r(i(n.$t(`digitalhuman.button.download`)),1)]),_:1})):o(``,!0),a(A,{path:`/digital-human/videos`,body:n.modelValue?.request},null,8,[`body`]),a(j,{service:`digitalhuman`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.response?.duration?(g(),s(`p`,dn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.duration`))+`: `+i(n.modelValue?.response?.duration?.toFixed(1))+`s `,1)])):o(``,!0),n.outputSize?(g(),s(`p`,fn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.outputSize`))+`: `+i(n.outputSize),1)])):o(``,!0),e(`p`,pn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,mn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,hn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,gn,[a(D,{closable:!1,class:`failure`},{template:m(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failure`)),1)]),default:m(()=>[e(`p`,_n,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(g(),s(`p`,vn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(E,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,yn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,bn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Sn=v({name:`RecentPanel`,components:{TaskPreview:z(qt,[[`render`,xn],[`__scopeId`,`data-v-342f1d6d`]]),NoTasks:re,BotPlaceholder:Be,ScrollList:te},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.digitalhuman?.tasks,items:this.$store.state.digitalhuman?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Cn={key:0},wn={key:2,class:`w-full h-full flex items-center justify-center`};function Tn(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),_=u(`scroll-list`),v=u(`no-tasks`);return g(),s(l,null,[e.tasks?.items===void 0?(g(),s(`div`,Cn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),p(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:m(()=>[(g(!0),s(l,null,h(e.tasks?.items,(e,t)=>(g(),p(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,wn,[a(v)])):o(``,!0)],64)}var En=v({name:`DigitalHumanIndex`,components:{ConfigPanel:Gt,Layout:qe,RecentPanel:z(Sn,[[`render`,Tn]])},mixins:[ke,Ve(`digitalhuman`,!1)],inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.digitalhuman?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.digitalhuman?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.digitalhuman.credential},config(){return this.$store.state.digitalhuman.config},tasks(){return this.$store.state.digitalhuman.tasks},walletMode(){return V()&&q(`digitalhuman`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`digitalhuman/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){window.clearInterval(this.job),e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ae({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`digitalhuman/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(`digitalhuman/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){if(!De(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let t;if(this.walletMode){let n=this.getWalletContext();if(!n){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=B.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Ce())return;let n=this.credential?.token;if(!n)return;t=B.generate(e,{token:n})}T.info(this.$t(`digitalhuman.message.startingTask`)),xe(`digitalhuman`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`digitalhuman.message.startTaskSuccess`))}).catch(e=>{e instanceof W||be(e,`digitalhuman`)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`digitalhuman.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return U(this.$wallet)},async confirmWalletPayment(e){return H.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Dn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return g(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var On=z(En,[[`render`,Dn]]);export{On as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-BrdGcmQV.js";import{t as x}from"./upload-DPM3VJNR.js";import{t as S}from"./tooltip-Drsa0R-y.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-qt9s4QBH.js";import{t as E}from"./drawer-yTqzLaen.js";import{t as D}from"./input-number-BCjyae0g.js";import{t as O}from"./switch-B1g5dw5D.js";import{t as k}from"./box-BcHSnpH-.js";import{t as A}from"./clock-D_pf_5A-.js";import{a as j,i as M,n as N,o as ee,r as P,s as te,t as F}from"./pagination-50HEMFzY.js";import{t as ne}from"./info-AmBm9Cbx.js";import{t as I}from"./trash-2-qsTysEar.js";import{t as re}from"./triangle-alert-wPWJieth.js";import{t as L}from"./upload-CYNoIKvu.js";import{t as ie}from"./volume-2-DioCaOkE.js";import{t as R}from"./wand-sparkles-B76KgpVz.js";import{Sn as z,_n as ae,an as oe,bn as se,cn as ce,dn as le,en as ue,fn as de,gn as fe,hn as pe,in as me,ln as he,mn as ge,on as _e,pn as ve,sn as ye,tn as be,un as xe,vn as Se,yn as Ce}from"./constants-CmC-0Hwp.js";import{A as B,Cn as we,La as V,Li as Te,Mn as H,O as Ee,Qi as De,Va as Oe,aa as ke,at as U,ct as W,di as Ae,er as G,et as K,it as je,li as Me,ot as Ne,st as q,to as J,zi as Y}from"./index-DM6hrjyQ.js";import{t as Pe}from"./CopyToClipboard-CCt1tvH4.js";import{t as Fe}from"./ReportButton-57emj3Ag.js";import{t as X}from"./ImagePreview-HVDfPxCI.js";import{n as Ie}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Le}from"./ServicePricingSummary-C5wco0tz.js";import{t as Re}from"./AudioPreview-Caes5-Xb.js";import{t as ze}from"./VideoPlayer-i3VcnbHP.js";import{t as Be}from"./VideoPreview-CycVY7vI.js";import{t as Ve}from"./ScenarioPaymentMode-B2nWCVIR.js";import{t as He}from"./ApiCodeButton-CGRTnBjA.js";import{t as Ue}from"./BotPlaceholder-B285f5nu.js";import{t as We}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ge}from"./ShowcaseResultTabs-CQ3vtIJe.js";import{t as Ke}from"./showcaseRecreateMixin-TEhFBc7v.js";import{t as qe}from"./generationInput-3_W3r_nF.js";import{t as Je}from"./ImageWrapper-DJusX6F3.js";var Ye=v({name:`LayoutSeedance`,components:{MagicIcon:R,ElDrawer:E,ElButton:J},mixins:[Ie]}),Xe={class:`main flex flex-row flex-1`},Ze={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)]`},Qe={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function $e(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Xe,[e(`div`,Ze,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Qe,[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 et=B(Ye,[[`render`,$e],[`__scopeId`,`data-v-86340af4`]]),tt=v({name:`SeedancePromptInput`,components:{PromptTextarea:M},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 nt(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 rt=B(tt,[[`render`,nt]]),it=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},data(){return{options:[{value:de,label:this.$t(`seedance.model.seedance25`)},{value:he,label:this.$t(`seedance.model.seedance20`)},{value:xe,label:this.$t(`seedance.model.seedance20Fast`)},{value:le,label:this.$t(`seedance.model.seedance20Mini`)},{value:ce,label:this.$t(`seedance.model.seedance15pro`)},{value:_e,label:this.$t(`seedance.model.seedance10pro`)},{value:ye,label:this.$t(`seedance.model.seedance10proFast`)},{value:oe,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:me,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||=ue}}),at={class:`field`},ot={class:`label`},st={class:`box`},ct={class:`title font-bold`};function lt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,at,[e(`div`,ot,[e(`div`,st,[e(`h2`,ct,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 ut=B(it,[[`render`,lt],[`__scopeId`,`data-v-0092c9dc`]]),dt=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},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)}}}),ft={class:`field`},pt={class:`label`},mt={class:`box`},ht={class:`title font-bold`};function gt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ft,[e(`div`,pt,[e(`div`,mt,[e(`h2`,ht,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 _t=B(dt,[[`render`,gt],[`__scopeId`,`data-v-d61cc21b`]]),Z={[Ce]:0,[se]:1,[Se]:2,"4k":3},vt=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:j,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[{value:Ce,label:`480p`},{value:se,label:`720p`},{value:Se,label:`1080p`},{value:`4k`,label:`4k`}],t=Z[this.capability.maxResolution]??Z[`1080p`];return e.map(e=>({...e,disabled:Z[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`)}}}),yt={class:`resolution`},bt={class:`header`},xt={class:`title font-bold`},St={class:`items`},Ct=[`onClick`];function wt(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,yt,[e(`div`,bt,[e(`h2`,xt,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,St,[(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,Ct)]),_:2},1032,[`content`,`disabled`]))),128))])])}var Tt=B(vt,[[`render`,wt],[`__scopeId`,`data-v-db7e8aff`]]),Et=v({name:`SeedanceRatioSelector`,components:{InfoIcon:j},computed:{options(){return[{value:ge,label:`16:9`,w:32,h:18},{value:fe,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||=be}}),Dt={class:`ratio`},Ot={class:`header`},kt={class:`title font-bold`},At={class:`items`},jt=[`onClick`],Mt={class:`preview`},Nt={key:1,class:`rect rect-auto`},Pt={class:`name`};function Ft(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`h2`,kt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,At,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Mt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,Nt,`A`))]),e(`div`,Pt,i(r.label),1)],10,jt))),128))])])}var It=B(Et,[[`render`,Ft],[`__scopeId`,`data-v-8ddec2dd`]]),Lt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:O,InfoIcon:j},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)}}),Rt={key:0,class:`field`},zt={class:`label`},Bt={class:`box`},Vt={class:`title font-bold`},Ht={class:`value`};function Ut(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`h2`,Vt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Ht,[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 Wt=B(Lt,[[`render`,Ut],[`__scopeId`,`data-v-df51dfbd`]]),Gt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:O,InfoIcon:j},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)}}),Kt={class:`field`},qt={class:`label`},Jt={class:`box`},Yt={class:`title font-bold`},Xt={class:`value`};function Zt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Kt,[e(`div`,qt,[e(`div`,Jt,[e(`h2`,Yt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Xt,[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 Qt=B(Gt,[[`render`,Zt],[`__scopeId`,`data-v-ae777d61`]]),$t=new Set(Object.keys(ve)),en=e=>Array.isArray(e)?e.filter(e=>H(e?.url)):[];function Q(e){let t=en(e?.images),n=t.some(e=>!e.role||e.role===`first_frame`||e.role===`last_frame`),r=t.some(e=>e.role===`reference_image`)||e?.audios?.some(e=>H(e?.url))===!0||e?.videos?.some(e=>H(e?.url))===!0;return{frame:n,reference:r,mixed:n&&r}}function $(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!$t.has(t.model))return{reject:`modelUnsupported`};let n=z(t.model);t.images=en(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=>H(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=>H(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,Q(t).mixed)return{reject:`frameReferenceConflict`};if(n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0,s=(t.images||[]).filter(e=>e.role===`reference_image`).length,c=t.model===`doubao-seedance-2-5-260628`?t.images?.length||0:s,l=t.videos?.length||0,u=t.audios?.length||0;return s>n.maxReferenceImages||l>n.maxReferenceVideos||u>n.maxReferenceAudios||c+l+u>n.maxReferenceMedia?{reject:`referenceMediaExceeded`}:Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o&&!n.supportsAudioOnly?{reject:`audioRequiresReference`}:(n.taskTypes.includes(t.omni_reference_task_type)||delete t.omni_reference_task_type,t.omni_reference_task_type===`reference`&&!Q(t).reference?{reject:`taskRequiresReferenceMedia`}:(n.outputFormats.includes(t.output_format)||delete t.output_format,t.model===`doubao-seedance-2-5-260628`&&t.web_search===!0?t.tools=[{type:`web_search`}]:delete t.tools,delete t.web_search,t.model===`doubao-seedance-2-5-260628`&&t.images?.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&(t.ratio=`adaptive`),(t.omni_reference_task_type===`edit`||t.omni_reference_task_type===`extend`)&&!o?{reject:`taskRequiresVideo`}:!t.prompt&&!a&&!o&&!Array.isArray(t.audios)?{reject:`generationInputRequired`}:(t.omni_reference_task_type===`edit`?(t.ratio=`adaptive`,t.duration=-1):t.omni_reference_task_type===`extend`&&(t.ratio=`adaptive`),{request:{...t,async:!0}})))}var tn=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j,ImagePreview:X},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetFirstFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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()}}}),nn={key:0,class:`relative`},rn={class:`flex min-h-8 items-center pr-20`},an={class:`flex justify-start items-center`},on={class:`text-sm font-bold`},sn={key:0,class:`required-badge`};function cn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,nn,[e(`div`,rn,[e(`div`,an,[e(`span`,on,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,sn,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var ln=B(tn,[[`render`,cn],[`__scopeId`,`data-v-e41ac7c3`]]),un=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,ImagePreview:X,InfoIcon:j},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetLastFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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()}}}),dn={key:0,class:`relative`},fn={class:`flex min-h-8 items-center pr-20`},pn={class:`flex justify-start items-center`},mn={class:`text-sm font-bold`};function hn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,dn,[e(`div`,fn,[e(`div`,pn,[e(`span`,mn,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var gn=B(un,[[`render`,hn],[`__scopeId`,`data-v-198d2769`]]),_n=v({name:`SeedanceReferenceImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j,ImagePreview:X},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetReferenceImageUrls()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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()}}}),vn={key:0,class:`relative`},yn={class:`flex min-h-8 items-center pr-20`},bn={class:`flex justify-start items-center`},xn={class:`text-sm font-bold`};function Sn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,vn,[e(`div`,yn,[e(`div`,bn,[e(`span`,xn,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.capability.maxReferenceImages,class:`upload-wrapper`,multiple:t.capability.maxReferenceImages>1,"before-upload":t.onBeforeUpload,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Cn=B(_n,[[`render`,Sn],[`__scopeId`,`data-v-591ef66f`]]),wn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j},mixins:[q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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()}}}),Tn={key:0,class:`relative`},En={class:`flex min-h-8 items-center pr-20`},Dn={class:`flex justify-start items-center`},On={class:`text-sm font-bold`};function kn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,Tn,[e(`div`,En,[e(`div`,Dn,[e(`span`,On,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:t.capability.maxReferenceAudios,class:`upload-wrapper`,multiple:t.capability.maxReferenceAudios>1,"before-upload":t.onBeforeUpload,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(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var An=B(wn,[[`render`,kn],[`__scopeId`,`data-v-cb408b11`]]),jn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j},mixins:[q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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`},Nn={class:`flex min-h-8 items-center pr-20`},Pn={class:`flex justify-start items-center`},Fn={class:`text-sm font-bold`};function In(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,Mn,[e(`div`,Nn,[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:t.capability.maxReferenceVideos,class:`upload-wrapper`,multiple:t.capability.maxReferenceVideos>1,"before-upload":t.onBeforeUpload,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(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ln=B(jn,[[`render`,In],[`__scopeId`,`data-v-c0492201`]]),Rn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:O,InfoIcon:j},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)}}),zn={key:0,class:`field`},Bn={class:`label`},Vn={class:`box`},Hn={class:`title font-bold`},Un={class:`value`};function Wn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,zn,[e(`div`,Bn,[e(`div`,Vn,[e(`h2`,Hn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Un,[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 Gn=B(Rn,[[`render`,Wn],[`__scopeId`,`data-v-edea5451`]]),Kn=v({name:`SeedanceAdvanced25Settings`,components:{ElOption:b,ElSelect:y,ElSwitch:O,InfoIcon:j},computed:{visible(){return this.$store.state.seedance?.config?.model===de},taskType:{get(){return this.$store.state.seedance?.config?.omni_reference_task_type||`auto`},set(e){this.updateConfig({omni_reference_task_type:e})}},outputFormat:{get(){return this.$store.state.seedance?.config?.output_format||`mp4`},set(e){this.updateConfig({output_format:e})}},webSearch:{get(){return this.$store.state.seedance?.config?.web_search===!0},set(e){this.updateConfig({web_search:e})}}},methods:{updateConfig(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,...e})}}}),qn={key:0,class:`space-y-4`},Jn={class:`field`},Yn={class:`label`},Xn={class:`title font-bold`},Zn={class:`field`},Qn={class:`label`},$n={class:`title font-bold`},er={class:`field`},tr={class:`label`},nr={class:`title font-bold`};function rr(t,n,r,c,u,d){let f=l(`info-icon`),m=l(`el-option`),h=l(`el-select`),_=l(`el-switch`);return t.visible?(g(),s(`div`,qn,[e(`div`,Jn,[e(`div`,Yn,[e(`h2`,Xn,i(t.$t(`seedance.name.taskType`)),1),a(f,{content:t.$t(`seedance.description.taskType`),class:`info`},null,8,[`content`])]),a(h,{modelValue:t.taskType,"onUpdate:modelValue":n[0]||=e=>t.taskType=e,class:`value`},{default:p(()=>[a(m,{value:`auto`,label:t.$t(`seedance.taskType.auto`)},null,8,[`label`]),a(m,{value:`reference`,label:t.$t(`seedance.taskType.reference`)},null,8,[`label`]),a(m,{value:`edit`,label:t.$t(`seedance.taskType.edit`)},null,8,[`label`]),a(m,{value:`extend`,label:t.$t(`seedance.taskType.extend`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`seedance.name.outputFormat`)),1)]),a(h,{modelValue:t.outputFormat,"onUpdate:modelValue":n[1]||=e=>t.outputFormat=e,class:`value`},{default:p(()=>[a(m,{value:`mp4`,label:`MP4`}),a(m,{value:`mov`,label:`MOV`})]),_:1},8,[`modelValue`])]),e(`div`,er,[e(`div`,tr,[e(`h2`,nr,i(t.$t(`seedance.name.webSearch`)),1),a(f,{content:t.$t(`seedance.description.webSearch`),class:`info`},null,8,[`content`])]),a(_,{modelValue:t.webSearch,"onUpdate:modelValue":n[2]||=e=>t.webSearch=e},null,8,[`modelValue`])])])):o(``,!0)}var ir=B(Kn,[[`render`,rr],[`__scopeId`,`data-v-b4dd64f6`]]),ar=v({name:`SeedanceSeedInput`,components:{ElInputNumber:D,InfoIcon:j},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)}}}}),or={class:`field`},sr={class:`label`},cr={class:`box`},lr={class:`title font-bold`},ur={class:`value`};function dr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,or,[e(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,ur,[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 fr=v({name:`SeedanceConfigPanel`,components:{MagicIcon:R,ElAlert:C,ElButton:J,PromptInput:rt,ModelSelector:ut,DurationSelector:_t,ResolutionSelector:Tt,RatioSelector:It,GenerateAudioSwitch:Wt,CameraFixedSwitch:Qt,ReturnLastFrameSwitch:Gn,Advanced25Settings:ir,SeedInput:B(ar,[[`render`,dr],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:ln,LastFrameImage:gn,ReferenceImage:Cn,ReferenceAudio:An,ReferenceVideo:Ln,ServicePricingSummary:Le,ScenarioPaymentMode:Ve},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){let{request:e,reject:t}=$(this.config);return!t&&qe(`seedance`,e)},config(){return this.$store.state.seedance?.config},capability(){return z(this.config?.model)},inputModes(){return Q(this.config)},consumption(){return we(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service},walletMode(){return Te()&&Y(`seedance`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=Y(`seedance`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=Y(`seedance`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;let{request:n}=$(this.config);try{if(!n)return;let r=await G.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`,this.walletMode?void 0:this.consumption)}}}),pr={class:`flex flex-col h-full`},mr={class:`flex-1 overflow-y-auto p-5`},hr={key:0,class:`input-mode-guide mb-4`},gr={class:`flex flex-col items-center justify-center px-5 pb-5`};function _r(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`generate-audio-switch`),S=l(`camera-fixed-switch`),C=l(`return-last-frame-switch`),w=l(`advanced25-settings`),T=l(`seed-input`),E=l(`el-alert`),D=l(`first-frame-image`),O=l(`last-frame-image`),k=l(`reference-image`),A=l(`reference-audio`),j=l(`reference-video`),M=l(`scenario-payment-mode`),N=l(`service-pricing-summary`),ee=l(`magic-icon`),P=l(`el-button`);return g(),s(`div`,pr,[e(`div`,mr,[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`}),t.capability.acceptsReferenceImage?(g(),s(`div`,hr,[e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.frames`)),1),r(` `+i(t.$t(`seedance.description.frameMode`)),1)]),e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.reference`)),1),r(` `+i(t.$t(`seedance.description.referenceMode`)),1)])])):o(``,!0),t.inputModes.mixed?(g(),f(E,{key:1,class:`mb-4`,type:`warning`,closable:!1,title:t.$t(`seedance.message.frameReferenceConflict`),"show-icon":``},null,8,[`title`])):o(``,!0),a(D,{class:`mb-4`}),a(O,{class:`mb-4`}),a(k,{class:`mb-4`}),a(A,{class:`mb-4`}),a(j,{class:`mb-4`})]),e(`div`,gr,[a(M,{scenario:`seedance`}),t.walletMode?o(``,!0):(g(),f(N,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(P,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(ee,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var vr=B(fr,[[`render`,_r],[`__scopeId`,`data-v-0b17b09f`]]),yr=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:I,ApplicationIcon:k,ChannelIcon:te,FullscreenIcon:ee,InfoIcon:ne,MagicIcon:R,TimeIcon:A,VolumeIcon:ie,WarningIcon:re,CopyToClipboard:Pe,ElAlert:C,VideoPlayer:ze,ElTooltip:S,ElButton:J,ImageWrapper:Je,ImagePreview:X,AudioPreview:Re,VideoPreview:Be,ApiCodeButton:He,ReportButton:Fe},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 Oe.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`seedance/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.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`)}}}),br={class:`preview`},xr={class:`left`},Sr={class:`main`},Cr={class:`bot`},wr={class:`datetime`},Tr=[`aria-label`],Er={class:`info`},Dr={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Or={key:1,class:`prompt mt-2`},kr={key:0},Ar={key:1},jr={key:0,class:n({content:!0})},Mr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Nr={key:1,class:n({content:!0})},Pr={key:0,class:`mb-4`},Fr={key:1,class:`mb-4`},Ir={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Lr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Br={key:0},Vr={key:1},Hr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ur={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kr={key:2,class:n({content:!0})},qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Zr={key:3,class:n({content:!0})},Qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$r={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ei(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(`report-button`),ee=l(`application-icon`),P=l(`fullscreen-icon`),te=l(`volume-icon`),F=l(`channel-icon`),ne=l(`warning-icon`),I=l(`info-icon`);return g(),s(`div`,br,[e(`div`,xr,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Sr,[e(`div`,Cr,[a(y,{capability:`seedance`,part:`name`}),e(`span`,wr,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,Tr)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Er,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Dr,[(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`,Or,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Ar,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,kr,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Nr,[n.video?.video_url?(g(),s(`div`,Pr,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,Fr,[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`]),a(N,{service:`seedance`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Lr,[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Rr,[a(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`,zr,[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`,Br,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,Vr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,Hr,[a(te,{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`,Ur,[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`,Wr,[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`,Gr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(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`,Kr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(ne,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,qr,[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`,Jr,[a(I,{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`,Yr,[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`,Xr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Zr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,Qr,[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`,$r,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,jr,[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`,Mr,[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 ti=v({name:`SeedanceRecentPanel`,components:{TaskPreview:B(yr,[[`render`,ei],[`__scopeId`,`data-v-a9336aee`]]),BotPlaceholder:Ue,NoTasks:P,ScrollList:N},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?.()}}}),ni={key:0},ri={key:2,class:`w-full h-full flex items-center justify-center`};function ii(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`,ni,[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`,ri,[a(v)])):o(``,!0)],64)}var ai=v({name:`SeedanceIndex`,components:{ConfigPanel:vr,Layout:et,RecentPanel:B(ti,[[`render`,ii]]),ShowcaseResultTabs:Ge},mixins:[Ne,Ke(`seedance`),We(`seedance`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks},walletMode(){return Te()&&Y(`seedance`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`seedance/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await F({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,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){let{request:t,reject:n}=$(this.config);if(n){let e=n===`generationInputRequired`?`common.message.generationInputRequired`:`seedance.message.${n}`;T.warning(this.$t(e));return}if(!je(this.uploadTracker,e=>this.$t(e),e=>T.warning(e))||!t)return;let r;if(this.walletMode){let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}r=G.generate(t,{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!ke())return;let e=this.credential?.token;if(!e)return;r=G.generate(t,{token:e})}let i=T.info(this.$t(`seedance.message.startingTask`));De(`seedance`,r).then(e=>{i.close();let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(t=>{i.close();let n=t?.response?.data;t instanceof Me||Ee(t,`seedance`,e)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`seedance.message.startTaskFailed`)+(n?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Ae(this.$wallet)},async confirmWalletPayment(e){return Oe.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function oi(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(u,{service:`seedance`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var si=B(ai,[[`render`,oi]]);export{si 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-CJHU1puz.js";import{t as x}from"./upload-DPM3VJNR.js";import{t as S}from"./tooltip-BmwZvoCo.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-qt9s4QBH.js";import{t as E}from"./drawer-KN1LRowH.js";import{t as D}from"./input-number-BB7Zip42.js";import{t as O}from"./switch-B8GgL0Se.js";import{t as k}from"./box-CTxxH32k.js";import{t as A}from"./clock-mP13CJwv.js";import{a as j,i as M,n as N,o as ee,r as P,s as te,t as F}from"./pagination-CMtbXlkA.js";import{t as ne}from"./info-BWyB8juG.js";import{t as I}from"./trash-2-Bgi3IwhR.js";import{t as re}from"./triangle-alert-tECqMJGT.js";import{t as L}from"./upload-DNoc85A2.js";import{t as ie}from"./volume-2-BflVGSM8.js";import{t as R}from"./wand-sparkles-CylWIDdZ.js";import{Sn as z,_n as ae,an as oe,bn as se,cn as ce,dn as le,en as ue,fn as de,gn as fe,hn as pe,in as me,ln as he,mn as ge,on as _e,pn as ve,sn as ye,tn as be,un as xe,vn as Se,yn as Ce}from"./constants-CmC-0Hwp.js";import{A as B,Cn as we,La as V,Li as Te,Mn as H,O as Ee,Qi as De,Va as Oe,aa as ke,at as U,ct as W,di as Ae,er as G,et as K,it as je,li as Me,ot as Ne,st as q,to as J,zi as Y}from"./index-BDrhpCy4.js";import{t as Pe}from"./CopyToClipboard-sz0qw-Lr.js";import{t as Fe}from"./ReportButton-DbaMTiER.js";import{t as X}from"./ImagePreview-BDgO7JJQ.js";import{n as Ie}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Le}from"./ServicePricingSummary-B6e4UMsc.js";import{t as Re}from"./AudioPreview-aCkjiIEz.js";import{t as ze}from"./VideoPlayer-D5tztnYV.js";import{t as Be}from"./VideoPreview-aiX7Evfh.js";import{t as Ve}from"./ScenarioPaymentMode-kZ7zDlkq.js";import{t as He}from"./ApiCodeButton-B7iQtRyE.js";import{t as Ue}from"./BotPlaceholder-DwG3z10_.js";import{t as We}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ge}from"./ShowcaseResultTabs-D1blU4xG.js";import{t as Ke}from"./showcaseRecreateMixin-l4sq0RCR.js";import{t as qe}from"./generationInput-C5bI6y33.js";import{t as Je}from"./ImageWrapper-C_8rYcTq.js";var Ye=v({name:`LayoutSeedance`,components:{MagicIcon:R,ElDrawer:E,ElButton:J},mixins:[Ie]}),Xe={class:`main flex flex-row flex-1`},Ze={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)]`},Qe={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function $e(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Xe,[e(`div`,Ze,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Qe,[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 et=B(Ye,[[`render`,$e],[`__scopeId`,`data-v-86340af4`]]),tt=v({name:`SeedancePromptInput`,components:{PromptTextarea:M},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 nt(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 rt=B(tt,[[`render`,nt]]),it=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},data(){return{options:[{value:de,label:this.$t(`seedance.model.seedance25`)},{value:he,label:this.$t(`seedance.model.seedance20`)},{value:xe,label:this.$t(`seedance.model.seedance20Fast`)},{value:le,label:this.$t(`seedance.model.seedance20Mini`)},{value:ce,label:this.$t(`seedance.model.seedance15pro`)},{value:_e,label:this.$t(`seedance.model.seedance10pro`)},{value:ye,label:this.$t(`seedance.model.seedance10proFast`)},{value:oe,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:me,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||=ue}}),at={class:`field`},ot={class:`label`},st={class:`box`},ct={class:`title font-bold`};function lt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,at,[e(`div`,ot,[e(`div`,st,[e(`h2`,ct,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 ut=B(it,[[`render`,lt],[`__scopeId`,`data-v-0092c9dc`]]),dt=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:j},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)}}}),ft={class:`field`},pt={class:`label`},mt={class:`box`},ht={class:`title font-bold`};function gt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ft,[e(`div`,pt,[e(`div`,mt,[e(`h2`,ht,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 _t=B(dt,[[`render`,gt],[`__scopeId`,`data-v-d61cc21b`]]),Z={[Ce]:0,[se]:1,[Se]:2,"4k":3},vt=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:j,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return z(this.model)},options(){let e=[{value:Ce,label:`480p`},{value:se,label:`720p`},{value:Se,label:`1080p`},{value:`4k`,label:`4k`}],t=Z[this.capability.maxResolution]??Z[`1080p`];return e.map(e=>({...e,disabled:Z[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`)}}}),yt={class:`resolution`},bt={class:`header`},xt={class:`title font-bold`},St={class:`items`},Ct=[`onClick`];function wt(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,yt,[e(`div`,bt,[e(`h2`,xt,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,St,[(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,Ct)]),_:2},1032,[`content`,`disabled`]))),128))])])}var Tt=B(vt,[[`render`,wt],[`__scopeId`,`data-v-db7e8aff`]]),Et=v({name:`SeedanceRatioSelector`,components:{InfoIcon:j},computed:{options(){return[{value:ge,label:`16:9`,w:32,h:18},{value:fe,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||=be}}),Dt={class:`ratio`},Ot={class:`header`},kt={class:`title font-bold`},At={class:`items`},jt=[`onClick`],Mt={class:`preview`},Nt={key:1,class:`rect rect-auto`},Pt={class:`name`};function Ft(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`h2`,kt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,At,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Mt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,Nt,`A`))]),e(`div`,Pt,i(r.label),1)],10,jt))),128))])])}var It=B(Et,[[`render`,Ft],[`__scopeId`,`data-v-8ddec2dd`]]),Lt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:O,InfoIcon:j},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)}}),Rt={key:0,class:`field`},zt={class:`label`},Bt={class:`box`},Vt={class:`title font-bold`},Ht={class:`value`};function Ut(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`h2`,Vt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Ht,[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 Wt=B(Lt,[[`render`,Ut],[`__scopeId`,`data-v-df51dfbd`]]),Gt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:O,InfoIcon:j},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)}}),Kt={class:`field`},qt={class:`label`},Jt={class:`box`},Yt={class:`title font-bold`},Xt={class:`value`};function Zt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Kt,[e(`div`,qt,[e(`div`,Jt,[e(`h2`,Yt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Xt,[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 Qt=B(Gt,[[`render`,Zt],[`__scopeId`,`data-v-ae777d61`]]),$t=new Set(Object.keys(ve)),en=e=>Array.isArray(e)?e.filter(e=>H(e?.url)):[];function Q(e){let t=en(e?.images),n=t.some(e=>!e.role||e.role===`first_frame`||e.role===`last_frame`),r=t.some(e=>e.role===`reference_image`)||e?.audios?.some(e=>H(e?.url))===!0||e?.videos?.some(e=>H(e?.url))===!0;return{frame:n,reference:r,mixed:n&&r}}function $(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!$t.has(t.model))return{reject:`modelUnsupported`};let n=z(t.model);t.images=en(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=>H(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=>H(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,Q(t).mixed)return{reject:`frameReferenceConflict`};if(n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0,s=(t.images||[]).filter(e=>e.role===`reference_image`).length,c=t.model===`doubao-seedance-2-5-260628`?t.images?.length||0:s,l=t.videos?.length||0,u=t.audios?.length||0;return s>n.maxReferenceImages||l>n.maxReferenceVideos||u>n.maxReferenceAudios||c+l+u>n.maxReferenceMedia?{reject:`referenceMediaExceeded`}:Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o&&!n.supportsAudioOnly?{reject:`audioRequiresReference`}:(n.taskTypes.includes(t.omni_reference_task_type)||delete t.omni_reference_task_type,t.omni_reference_task_type===`reference`&&!Q(t).reference?{reject:`taskRequiresReferenceMedia`}:(n.outputFormats.includes(t.output_format)||delete t.output_format,t.model===`doubao-seedance-2-5-260628`&&t.web_search===!0?t.tools=[{type:`web_search`}]:delete t.tools,delete t.web_search,t.model===`doubao-seedance-2-5-260628`&&t.images?.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&(t.ratio=`adaptive`),(t.omni_reference_task_type===`edit`||t.omni_reference_task_type===`extend`)&&!o?{reject:`taskRequiresVideo`}:!t.prompt&&!a&&!o&&!Array.isArray(t.audios)?{reject:`generationInputRequired`}:(t.omni_reference_task_type===`edit`?(t.ratio=`adaptive`,t.duration=-1):t.omni_reference_task_type===`extend`&&(t.ratio=`adaptive`),{request:{...t,async:!0}})))}var tn=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j,ImagePreview:X},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetFirstFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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()}}}),nn={key:0,class:`relative`},rn={class:`flex min-h-8 items-center pr-20`},an={class:`flex justify-start items-center`},on={class:`text-sm font-bold`},sn={key:0,class:`required-badge`};function cn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,nn,[e(`div`,rn,[e(`div`,an,[e(`span`,on,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,sn,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var ln=B(tn,[[`render`,cn],[`__scopeId`,`data-v-e41ac7c3`]]),un=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,ImagePreview:X,InfoIcon:j},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetLastFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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()}}}),dn={key:0,class:`relative`},fn={class:`flex min-h-8 items-center pr-20`},pn={class:`flex justify-start items-center`},mn={class:`text-sm font-bold`};function hn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,dn,[e(`div`,fn,[e(`div`,pn,[e(`span`,mn,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var gn=B(un,[[`render`,hn],[`__scopeId`,`data-v-198d2769`]]),_n=v({name:`SeedanceReferenceImage`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j,ImagePreview:X},mixins:[W,q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetReferenceImageUrls()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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()}}}),vn={key:0,class:`relative`},yn={class:`flex min-h-8 items-center pr-20`},bn={class:`flex justify-start items-center`},xn={class:`text-sm font-bold`};function Sn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,vn,[e(`div`,yn,[e(`div`,bn,[e(`span`,xn,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.capability.maxReferenceImages,class:`upload-wrapper`,multiple:t.capability.maxReferenceImages>1,"before-upload":t.onBeforeUpload,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.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Cn=B(_n,[[`render`,Sn],[`__scopeId`,`data-v-591ef66f`]]),wn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j},mixins:[q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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()}}}),Tn={key:0,class:`relative`},En={class:`flex min-h-8 items-center pr-20`},Dn={class:`flex justify-start items-center`},On={class:`text-sm font-bold`};function kn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,Tn,[e(`div`,En,[e(`div`,Dn,[e(`span`,On,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:t.capability.maxReferenceAudios,class:`upload-wrapper`,multiple:t.capability.maxReferenceAudios>1,"before-upload":t.onBeforeUpload,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(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var An=B(wn,[[`render`,kn],[`__scopeId`,`data-v-cb408b11`]]),jn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:L,ElUpload:x,ElButton:J,ElTooltip:S,InfoIcon:j},mixins:[q,U,K],data(){return{fileList:[],uploadUrl:V()+`/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)},inputModes(){return Q(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.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`},Nn={class:`flex min-h-8 items-center pr-20`},Pn={class:`flex justify-start items-center`},Fn={class:`text-sm font-bold`};function In(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,Mn,[e(`div`,Nn,[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:t.capability.maxReferenceVideos,class:`upload-wrapper`,multiple:t.capability.maxReferenceVideos>1,"before-upload":t.onBeforeUpload,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(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ln=B(jn,[[`render`,In],[`__scopeId`,`data-v-c0492201`]]),Rn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:O,InfoIcon:j},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)}}),zn={key:0,class:`field`},Bn={class:`label`},Vn={class:`box`},Hn={class:`title font-bold`},Un={class:`value`};function Wn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,zn,[e(`div`,Bn,[e(`div`,Vn,[e(`h2`,Hn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Un,[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 Gn=B(Rn,[[`render`,Wn],[`__scopeId`,`data-v-edea5451`]]),Kn=v({name:`SeedanceAdvanced25Settings`,components:{ElOption:b,ElSelect:y,ElSwitch:O,InfoIcon:j},computed:{visible(){return this.$store.state.seedance?.config?.model===de},taskType:{get(){return this.$store.state.seedance?.config?.omni_reference_task_type||`auto`},set(e){this.updateConfig({omni_reference_task_type:e})}},outputFormat:{get(){return this.$store.state.seedance?.config?.output_format||`mp4`},set(e){this.updateConfig({output_format:e})}},webSearch:{get(){return this.$store.state.seedance?.config?.web_search===!0},set(e){this.updateConfig({web_search:e})}}},methods:{updateConfig(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,...e})}}}),qn={key:0,class:`space-y-4`},Jn={class:`field`},Yn={class:`label`},Xn={class:`title font-bold`},Zn={class:`field`},Qn={class:`label`},$n={class:`title font-bold`},er={class:`field`},tr={class:`label`},nr={class:`title font-bold`};function rr(t,n,r,c,u,d){let f=l(`info-icon`),m=l(`el-option`),h=l(`el-select`),_=l(`el-switch`);return t.visible?(g(),s(`div`,qn,[e(`div`,Jn,[e(`div`,Yn,[e(`h2`,Xn,i(t.$t(`seedance.name.taskType`)),1),a(f,{content:t.$t(`seedance.description.taskType`),class:`info`},null,8,[`content`])]),a(h,{modelValue:t.taskType,"onUpdate:modelValue":n[0]||=e=>t.taskType=e,class:`value`},{default:p(()=>[a(m,{value:`auto`,label:t.$t(`seedance.taskType.auto`)},null,8,[`label`]),a(m,{value:`reference`,label:t.$t(`seedance.taskType.reference`)},null,8,[`label`]),a(m,{value:`edit`,label:t.$t(`seedance.taskType.edit`)},null,8,[`label`]),a(m,{value:`extend`,label:t.$t(`seedance.taskType.extend`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`seedance.name.outputFormat`)),1)]),a(h,{modelValue:t.outputFormat,"onUpdate:modelValue":n[1]||=e=>t.outputFormat=e,class:`value`},{default:p(()=>[a(m,{value:`mp4`,label:`MP4`}),a(m,{value:`mov`,label:`MOV`})]),_:1},8,[`modelValue`])]),e(`div`,er,[e(`div`,tr,[e(`h2`,nr,i(t.$t(`seedance.name.webSearch`)),1),a(f,{content:t.$t(`seedance.description.webSearch`),class:`info`},null,8,[`content`])]),a(_,{modelValue:t.webSearch,"onUpdate:modelValue":n[2]||=e=>t.webSearch=e},null,8,[`modelValue`])])])):o(``,!0)}var ir=B(Kn,[[`render`,rr],[`__scopeId`,`data-v-b4dd64f6`]]),ar=v({name:`SeedanceSeedInput`,components:{ElInputNumber:D,InfoIcon:j},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)}}}}),or={class:`field`},sr={class:`label`},cr={class:`box`},lr={class:`title font-bold`},ur={class:`value`};function dr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,or,[e(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,ur,[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 fr=v({name:`SeedanceConfigPanel`,components:{MagicIcon:R,ElAlert:C,ElButton:J,PromptInput:rt,ModelSelector:ut,DurationSelector:_t,ResolutionSelector:Tt,RatioSelector:It,GenerateAudioSwitch:Wt,CameraFixedSwitch:Qt,ReturnLastFrameSwitch:Gn,Advanced25Settings:ir,SeedInput:B(ar,[[`render`,dr],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:ln,LastFrameImage:gn,ReferenceImage:Cn,ReferenceAudio:An,ReferenceVideo:Ln,ServicePricingSummary:Le,ScenarioPaymentMode:Ve},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){let{request:e,reject:t}=$(this.config);return!t&&qe(`seedance`,e)},config(){return this.$store.state.seedance?.config},capability(){return z(this.config?.model)},inputModes(){return Q(this.config)},consumption(){return we(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service},walletMode(){return Te()&&Y(`seedance`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=Y(`seedance`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=Y(`seedance`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;let{request:n}=$(this.config);try{if(!n)return;let r=await G.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`,this.walletMode?void 0:this.consumption)}}}),pr={class:`flex flex-col h-full`},mr={class:`flex-1 overflow-y-auto p-5`},hr={key:0,class:`input-mode-guide mb-4`},gr={class:`flex flex-col items-center justify-center px-5 pb-5`};function _r(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`generate-audio-switch`),S=l(`camera-fixed-switch`),C=l(`return-last-frame-switch`),w=l(`advanced25-settings`),T=l(`seed-input`),E=l(`el-alert`),D=l(`first-frame-image`),O=l(`last-frame-image`),k=l(`reference-image`),A=l(`reference-audio`),j=l(`reference-video`),M=l(`scenario-payment-mode`),N=l(`service-pricing-summary`),ee=l(`magic-icon`),P=l(`el-button`);return g(),s(`div`,pr,[e(`div`,mr,[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`}),t.capability.acceptsReferenceImage?(g(),s(`div`,hr,[e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.frames`)),1),r(` `+i(t.$t(`seedance.description.frameMode`)),1)]),e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.reference`)),1),r(` `+i(t.$t(`seedance.description.referenceMode`)),1)])])):o(``,!0),t.inputModes.mixed?(g(),f(E,{key:1,class:`mb-4`,type:`warning`,closable:!1,title:t.$t(`seedance.message.frameReferenceConflict`),"show-icon":``},null,8,[`title`])):o(``,!0),a(D,{class:`mb-4`}),a(O,{class:`mb-4`}),a(k,{class:`mb-4`}),a(A,{class:`mb-4`}),a(j,{class:`mb-4`})]),e(`div`,gr,[a(M,{scenario:`seedance`}),t.walletMode?o(``,!0):(g(),f(N,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(P,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(ee,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var vr=B(fr,[[`render`,_r],[`__scopeId`,`data-v-0b17b09f`]]),yr=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:I,ApplicationIcon:k,ChannelIcon:te,FullscreenIcon:ee,InfoIcon:ne,MagicIcon:R,TimeIcon:A,VolumeIcon:ie,WarningIcon:re,CopyToClipboard:Pe,ElAlert:C,VideoPlayer:ze,ElTooltip:S,ElButton:J,ImageWrapper:Je,ImagePreview:X,AudioPreview:Re,VideoPreview:Be,ApiCodeButton:He,ReportButton:Fe},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 Oe.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`seedance/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.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`)}}}),br={class:`preview`},xr={class:`left`},Sr={class:`main`},Cr={class:`bot`},wr={class:`datetime`},Tr=[`aria-label`],Er={class:`info`},Dr={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Or={key:1,class:`prompt mt-2`},kr={key:0},Ar={key:1},jr={key:0,class:n({content:!0})},Mr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Nr={key:1,class:n({content:!0})},Pr={key:0,class:`mb-4`},Fr={key:1,class:`mb-4`},Ir={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Lr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Br={key:0},Vr={key:1},Hr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ur={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kr={key:2,class:n({content:!0})},qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Zr={key:3,class:n({content:!0})},Qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$r={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ei(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(`report-button`),ee=l(`application-icon`),P=l(`fullscreen-icon`),te=l(`volume-icon`),F=l(`channel-icon`),ne=l(`warning-icon`),I=l(`info-icon`);return g(),s(`div`,br,[e(`div`,xr,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Sr,[e(`div`,Cr,[a(y,{capability:`seedance`,part:`name`}),e(`span`,wr,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,Tr)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Er,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Dr,[(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`,Or,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Ar,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,kr,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Nr,[n.video?.video_url?(g(),s(`div`,Pr,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,Fr,[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`]),a(N,{service:`seedance`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Lr,[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Rr,[a(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`,zr,[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`,Br,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,Vr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,Hr,[a(te,{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`,Ur,[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`,Wr,[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`,Gr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(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`,Kr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(ne,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,qr,[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`,Jr,[a(I,{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`,Yr,[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`,Xr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Zr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,Qr,[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`,$r,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,jr,[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`,Mr,[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 ti=v({name:`SeedanceRecentPanel`,components:{TaskPreview:B(yr,[[`render`,ei],[`__scopeId`,`data-v-a9336aee`]]),BotPlaceholder:Ue,NoTasks:P,ScrollList:N},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?.()}}}),ni={key:0},ri={key:2,class:`w-full h-full flex items-center justify-center`};function ii(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`,ni,[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`,ri,[a(v)])):o(``,!0)],64)}var ai=v({name:`SeedanceIndex`,components:{ConfigPanel:vr,Layout:et,RecentPanel:B(ti,[[`render`,ii]]),ShowcaseResultTabs:Ge},mixins:[Ne,Ke(`seedance`),We(`seedance`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks},walletMode(){return Te()&&Y(`seedance`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`seedance/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await F({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,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){let{request:t,reject:n}=$(this.config);if(n){let e=n===`generationInputRequired`?`common.message.generationInputRequired`:`seedance.message.${n}`;T.warning(this.$t(e));return}if(!je(this.uploadTracker,e=>this.$t(e),e=>T.warning(e))||!t)return;let r;if(this.walletMode){let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}r=G.generate(t,{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!ke())return;let e=this.credential?.token;if(!e)return;r=G.generate(t,{token:e})}let i=T.info(this.$t(`seedance.message.startingTask`));De(`seedance`,r).then(e=>{i.close();let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(t=>{i.close();let n=t?.response?.data;t instanceof Me||Ee(t,`seedance`,e)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`seedance.message.startTaskFailed`)+(n?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Ae(this.$wallet)},async confirmWalletPayment(e){return Oe.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function oi(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(u,{service:`seedance`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var si=B(ai,[[`render`,oi]]);export{si as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as ee}from"./table-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as ee}from"./table-DaCzJh_U.js";import{t as f}from"./tooltip-BmwZvoCo.js";import{t as p}from"./card-IQwqnRJR.js";import{n as m,t as h}from"./row-IQ605R-m.js";import{t as g}from"./divider-Du_3kymg.js";import{t as _}from"./progress-BuyYfFZn.js";import{t as v}from"./skeleton-Dj_a_iIP.js";import{t as y}from"./coins-BzdFOUsK.js";import{t as b}from"./link-CBFmk5Ee.js";import{t as x}from"./user-B-D8rRw5.js";import{t as S}from"./wallet-hT9dlcwr.js";import{$r as C,A as w,B as T,Ba as E,In as D,Mt as O,Pt as k,Qr as A,Zr as j,ht as M,qi as N,to as P,wn as F}from"./index-BDrhpCy4.js";import{t as I}from"./CopyToClipboard-sz0qw-Lr.js";var L=u({name:`ConsoleDistributionList`,components:{CreditsIcon:y,LinkIcon:b,PercentIcon:E(`percent`,[[`line`,{x1:`19`,x2:`5`,y1:`5`,y2:`19`,key:`1x9vlm`}],[`circle`,{cx:`6.5`,cy:`6.5`,r:`2.5`,key:`4mh3h7`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`2.5`,key:`1mdrzq`}]]),UserIcon:x,WalletIcon:S,CopyToClipboard:I,QrCode:T,ElProgress:_,ElRow:h,ElCol:m,ElButton:P,ElDivider:g,ElCard:p,ElTooltip:f,ElTable:ee,ElTableColumn:d,ElSkeleton:v},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||`1`)},qrColor(){let e=document.documentElement.classList.contains(`dark`);return{dark:e?`#ffffff`:`#000000`,light:e?`#1e1e1e`:`#ffffff`}},distributionLevelMap(){let e={};return this.distributionLevels.forEach(t=>{e[t.level]=t}),e}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:F,goPromotionTemplates(){this.$router.push({name:M,query:{template_category:`marketing`}})},goHistory(){this.$router.push({name:O})},goInvitees(){this.$router.push({name:k})},onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{page:e}})},getPercentageForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level]?.threshold,t=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor((this.distributionStatus?.price-e)/(t-e)*100)},getDeltaForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor(e-this.distributionStatus?.price)},async onFetchData(){this.loading=!0,await A.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){let e=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{let t=(await C.create(e))?.data?.data?.url||e;this.distributionLink=D()?t.replace(`surl.id`,`share.acedata.cloud`):t}catch{this.distributionLink=e}},async onFetchDistributionStatus(){let{data:e}=await A.getAll({user_id:this.$store.getters.user.id});e.items&&e.items.length>0&&(this.distributionStatus=e.items[0])},async onFetchDistributionLevels(){let{data:e}=await j.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=e.items},async onFetchInvitees(){let{data:e}=await N.getInvitees({});this.invitees=e.items,this.inviteesCount=e.count}}}),R={class:`title`},z={key:1},B={class:`icon-wrapper`},V={class:`text-left`},H={class:`description`},U={class:`value`},W={key:1},G={class:`icon-wrapper`},K={class:`text-left`},q={class:`description`},J={class:`value`},Y={key:1},X={class:`icon-wrapper`},te={class:`text-left`},Z={class:`description`},Q={class:`value`},ne={key:1},re={class:`icon-wrapper`},ie={class:`text-left`},ae={class:`description`},oe={class:`value`},se={key:1},ce={class:`title`},le={class:`clear-both overflow-hidden`},ue={class:`float-left description`},de={class:`float-right description`},fe={class:`description`},pe={class:`level`},$={class:`level`},me={class:`level`},he={key:1},ge={class:`title`},_e={class:`link-wrapper text-center`},ve=[`href`],ye={class:`qr-wrapper ml-auto mr-auto`},be={class:`mt-0`},xe={class:`description`},Se={class:`more`};function Ce(u,d,ee,f,p,m){let h=o(`el-col`),g=o(`el-row`),_=o(`el-skeleton`),v=o(`wallet-icon`),y=o(`el-button`),b=o(`el-card`),x=o(`credits-icon`),S=o(`el-tooltip`),C=o(`percent-icon`),w=o(`user-icon`),T=o(`el-progress`),E=o(`el-divider`),D=o(`el-table-column`),O=o(`el-table`);o(`link-icon`);let k=o(`copy-to-clipboard`),A=o(`qr-code`);return l(),s(g,{class:`panel`},{default:c(()=>[r(h,{span:24},{default:c(()=>[r(g,null,{default:c(()=>[r(h,{span:24},{default:c(()=>[e(`h2`,R,n(u.$t(`common.title.distribution`)),1)]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,z,[e(`div`,B,[r(v,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,V,[e(`p`,H,n(u.$t(`distribution.title.price`)),1),e(`p`,U,n(u.getPriceString({value:u.distributionStatus?.price})),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goHistory},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,W,[e(`div`,G,[r(x,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,K,[e(`p`,q,n(u.$t(`distribution.title.reward`)),1),e(`p`,J,n(u.getPriceString({value:u.distributionStatus?.reward})),1)]),r(S,{effect:`dark`,content:u.$t(`distribution.message.developingWithDrawal`),placement:`top`},{default:c(()=>[r(y,{type:`primary`,round:``,size:`small`,class:`btn`},{default:c(()=>[t(n(u.$t(`distribution.button.withdrawal`)),1)]),_:1})]),_:1},8,[`content`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,Y,[e(`div`,X,[r(C,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,te,[e(`p`,Z,n(u.$t(`distribution.title.percentage`)),1),e(`p`,Q,n(u.distributionStatus?.level?.percentage)+`%`,1)])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,ne,[e(`div`,re,[r(w,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,ie,[e(`p`,ae,n(u.$t(`distribution.title.inviteesCount`)),1),e(`p`,oe,n(u.inviteesCount),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goInvitees},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1})]),_:1}),r(g,{gutter:15,class:`mb-4`},{default:c(()=>[r(h,{span:24},{default:c(()=>[r(b,{shadow:`hover`,class:`automation-card`},{default:c(()=>[e(`div`,null,[e(`h3`,null,n(u.$t(`distribution.title.promotionAutomation`)),1),e(`p`,null,n(u.$t(`distribution.message.promotionAutomation`)),1)]),r(y,{type:`primary`,round:``,onClick:u.goPromotionTemplates},{default:c(()=>[t(n(u.$t(`distribution.button.browseTemplates`)),1)]),_:1},8,[`onClick`])]),_:1})]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`level-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,se,[e(`h4`,ce,n(u.$t(`distribution.title.levelInfo`)),1),e(`div`,le,[e(`div`,ue,[e(`p`,null,n(u.$t(`distribution.title.currentLevel`))+`: L`+n(u.distributionStatus?.level?.level),1),e(`p`,null,n(u.$t(`distribution.title.currentPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level]?.percentage)+`% `,1)]),e(`div`,de,[e(`p`,null,n(u.$t(`distribution.title.nextLevel`))+`: L`+n(u.distributionStatus?.level?.level+1),1),e(`p`,null,n(u.$t(`distribution.title.nextPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level+1]?.percentage)+`% `,1)])]),r(T,{"text-inside":!0,"stroke-width":20,percentage:u.getPercentageForNextLevel(),class:`mb-2`},null,8,[`percentage`]),e(`p`,fe,n(u.$t(`distribution.message.deltaPriceForNextLevel`))+`: $`+n(u.getDeltaForNextLevel()),1),r(E),u.distributionLevels?(l(),s(O,{key:0,data:u.distributionLevels,stripe:``},{default:c(()=>[r(D,{label:u.$t(`distribution.field.level`)},{default:c(t=>[e(`span`,pe,`L`+n(t.row?.level),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.threshold`)},{default:c(t=>[e(`span`,$,`$`+n(t.row?.threshold),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.percentage`)},{default:c(t=>[e(`span`,me,n(t.row?.percentage)+`%`,1)]),_:1},8,[`label`])]),_:1},8,[`data`])):i(``,!0)]))]),_:1})]),_:1}),r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`distribution-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,he,[e(`h4`,ge,n(u.$t(`distribution.title.distributionLink`)),1),r(E),e(`div`,_e,[i(``,!0),e(`a`,{href:u.distributionLink,class:`link`},n(u.distributionLink),9,ve),r(k,{content:u.distributionLink},null,8,[`content`])]),e(`div`,ye,[u.distributionLink?(l(),s(A,{key:0,value:u.distributionLink,size:180,margin:2,class:`block mb-2 ml-auto mr-auto`,type:`image/png`,color:u.qrColor},null,8,[`value`,`color`])):i(``,!0),e(`p`,be,n(u.$t(`distribution.message.distributionQrDescription`)),1)]),e(`p`,xe,[t(n(u.$t(`distribution.message.distributionLinkDescription`))+` `,1),e(`span`,Se,[r(S,{effect:`dark`,content:u.$t(`distribution.message.distributionLinkDescription2`),placement:`top`},{default:c(()=>[t(n(u.$t(`distribution.message.technicalDetail`)),1)]),_:1},8,[`content`])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var we=w(L,[[`render`,Ce],[`__scopeId`,`data-v-67465fd5`]]);export{we as default};
|