@acedatacloud/nexior 3.362.4 → 3.362.5
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-BA7mDSbv.js → ApiCodeButton-C_dp8MuJ.js} +1 -1
- package/dist/assets/{ApiCodeDialog-BsRU8WFT.js → ApiCodeDialog-BLEnKZjI.js} +1 -1
- package/dist/assets/{Artifacts-DJBH37uq.js → Artifacts-DiUqc3Sb.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-DjYhfs68.js → AskUserQuestionCard-akc1YMtx.js} +1 -1
- package/dist/assets/{AudioPreview-4SXEbJja.js → AudioPreview-vjoUTGMO.js} +1 -1
- package/dist/assets/{Auth-BOif7xOO.js → Auth-Bvdnu3X9.js} +1 -1
- package/dist/assets/{Bare-B5Gm4K8P.js → Bare-CSfDxUHK.js} +1 -1
- package/dist/assets/{BotPlaceholder-C--FHvts.js → BotPlaceholder-DKkxXInm.js} +1 -1
- package/dist/assets/{BottomFooter-Diy1dxTR.js → BottomFooter-D7A5_Xlp.js} +1 -1
- package/dist/assets/{BrowseConnectors-BfZCwj7s.js → BrowseConnectors-DFppE4yM.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-CwcFHrVH.js → BrowserPairingDialog-SpVfnsge.js} +1 -1
- package/dist/assets/{Callback-DUubRo9v.js → Callback-DARIhRQR.js} +1 -1
- package/dist/assets/{CodeSnippet-B0neSlgP.js → CodeSnippet-BGqV4i-2.js} +1 -1
- package/dist/assets/{Console-D8pv2zPD.js → Console-Bex3lCkU.js} +1 -1
- package/dist/assets/{Consumption-BK4nImFR.js → Consumption-gbjpxptE.js} +1 -1
- package/dist/assets/{Conversation-BXtScsLN.js → Conversation-BVK91u-s.js} +1 -1
- package/dist/assets/{Conversation-Cv9VbfEe.js → Conversation-BrHSp-Xe.js} +1 -1
- package/dist/assets/{CopyToClipboard-AvaqCeXT.js → CopyToClipboard-QFe7Cn4_.js} +1 -1
- package/dist/assets/Detail-CsmSqQzC.js +2 -0
- package/dist/assets/{Detail-BbDnDZ62.css → Detail-D0VXAJ_e.css} +1 -1
- package/dist/assets/{Extra-Dy27Xepl.js → Extra-Dk6Hp_wi.js} +1 -1
- package/dist/assets/{FilePreview-BNtZwLa2.js → FilePreview-DI9LxA3P.js} +1 -1
- package/dist/assets/{Hailuo-CUHHmlNz.js → Hailuo-BR72DJZp.js} +1 -1
- package/dist/assets/{History-BrR8Yf_Z.js → History-DRSmy2AO.js} +1 -1
- package/dist/assets/{ImagePreview-DPhaVe-K.js → ImagePreview-Bb3mYw3m.js} +1 -1
- package/dist/assets/{ImageWrapper-DwDvvMD7.js → ImageWrapper-BfDpkYJA.js} +1 -1
- package/dist/assets/{Index-DaePlNci.js → Index-BGQtjLK9.js} +1 -1
- package/dist/assets/{Index-DKrXlrk-.js → Index-B_XUs3dD.js} +1 -1
- package/dist/assets/{Index-BgP1xjT5.js → Index-BeJlx-9q.js} +1 -1
- package/dist/assets/{Index-BmXYFehz.js → Index-BtJRmTxI.js} +1 -1
- package/dist/assets/{Index-Bm_crXl-.js → Index-C6l188rj.js} +1 -1
- package/dist/assets/{Index-BIccEBEN.js → Index-C7BqGUOv.js} +1 -1
- package/dist/assets/{Index-DMQ9DZGa.js → Index-C7a3GeIN.js} +1 -1
- package/dist/assets/{Index-ChX8EfQ8.js → Index-CBWJ3bh7.js} +1 -1
- package/dist/assets/{Index-B83b9_wi.js → Index-CHPGNQGH.js} +1 -1
- package/dist/assets/{Index-D948p6ES.js → Index-CSQlE6Us.js} +1 -1
- package/dist/assets/{Index-DlofPOmV.js → Index-Cc0BJv32.js} +1 -1
- package/dist/assets/{Index-Crdhl-Vx.js → Index-CpIVSIgU.js} +1 -1
- package/dist/assets/{Index-D8Y03OtA.js → Index-CtL4ygHX.js} +1 -1
- package/dist/assets/{Index-BXnU9Nhc.js → Index-Cxufo6vo.js} +1 -1
- package/dist/assets/{Index-B1Kw72wN.js → Index-CzBJwmqV.js} +1 -1
- package/dist/assets/{Index-CMSWNfN_.js → Index-D0lk9n2n.js} +1 -1
- package/dist/assets/{Index-OwzwOsGt.js → Index-D7FOLOnS.js} +1 -1
- package/dist/assets/{Index-BthkIMLu.js → Index-DYo_8IfS.js} +1 -1
- package/dist/assets/{Index-CqRMg-uH.js → Index-DZk9fmIX.js} +1 -1
- package/dist/assets/{Index-DbsIgIEX.js → Index-DbOiGC48.js} +1 -1
- package/dist/assets/{Index-DvmQuJd4.js → Index-De2BQ_Wj.js} +1 -1
- package/dist/assets/{Index-CLKH3TKM.js → Index-DeUBNCZY.js} +1 -1
- package/dist/assets/{Index-CMu0wO8E.js → Index-DqATchy4.js} +1 -1
- package/dist/assets/{Index-0tDHczbM.js → Index-DtIPk58o.js} +1 -1
- package/dist/assets/{Index-CaIBqmIZ.js → Index-DtIiLPFH.js} +1 -1
- package/dist/assets/{Index-B2gSKiZ3.js → Index-Dy3RvsJc.js} +1 -1
- package/dist/assets/{Index-CTZWRaZt.js → Index-Eusdi6Fv.js} +1 -1
- package/dist/assets/{Index-2pUrfZDO.js → Index-P6XrKYCT.js} +1 -1
- package/dist/assets/{Index-7fi1vULC2.js → Index-W-7bFZd12.js} +1 -1
- package/dist/assets/{Index-BneErBTq.js → Index-apjA2pwy.js} +1 -1
- package/dist/assets/{Index-CGEzzwMb.js → Index-g-R_CbbQ.js} +1 -1
- package/dist/assets/{Index-BadgGV7L.js → Index-ob9SQEGZ.js} +1 -1
- package/dist/assets/{Index-BhVRicE6.js → Index-pHFwycSO.js} +1 -1
- package/dist/assets/{Index-DWCDjaXA.js → Index-sfXjm8fk.js} +1 -1
- package/dist/assets/{Index-D-kQkhOh.js → Index-w9r1VzQj.js} +1 -1
- package/dist/assets/{Invitees-DL1P2x5O.js → Invitees-CZqn_3Tn.js} +1 -1
- package/dist/assets/{List-By1Vg7U3.js → List-BIYtmLHd.js} +1 -1
- package/dist/assets/{List-B7gE17Uu.js → List-DiSgMGF_.js} +1 -1
- package/dist/assets/{List-ByRoWUqS.js → List-O_f32ddz.js} +1 -1
- package/dist/assets/{LocalTools-Dw-cSEm5.js → LocalTools-BzKWJgcv.js} +1 -1
- package/dist/assets/{LocalTools-C0CsQekj.js → LocalTools-CM0ThL84.js} +1 -1
- package/dist/assets/{Logo-B5pb3LXw.js → Logo-CHfoXMq8.js} +1 -1
- package/dist/assets/{Main-gugFahba.js → Main-CBoA-WCI.js} +1 -1
- package/dist/assets/{Message-C0-5k24c.js → Message-BWy61toK.js} +1 -1
- package/dist/assets/{Model-DSVl1m8-.js → Model-COYZvYm9.js} +1 -1
- package/dist/assets/Navigator-BWwXDF0d.css +1 -0
- package/dist/assets/{Navigator-B-NGLAVz.js → Navigator-DARKa-NL.js} +4 -4
- package/dist/assets/{NotFound-Bp7eiYNh.js → NotFound-C8bH3X66.js} +1 -1
- package/dist/assets/{PageHeader-5PIb-pRr.js → PageHeader-5Xfl78bc.js} +1 -1
- package/dist/assets/{Pay-BXFjGCjg.js → Pay-BcxsJZzz.js} +1 -1
- package/dist/assets/{Player-BDjTM_TZ.js → Player-BmHe8rL9.js} +1 -1
- package/dist/assets/{Poivelle-CATRUvJM.js → Poivelle-BvbPTsxC.js} +1 -1
- package/dist/assets/{RealtimeCall-4hZrsGbX.js → RealtimeCall-By6gPdJe.js} +1 -1
- package/dist/assets/{ReportButton-D07ABYgs.js → ReportButton-ChQMpn6o.js} +1 -1
- package/dist/assets/{ReportDialog-CZ_kBqmh.js → ReportDialog-BJ0RWYu2.js} +1 -1
- package/dist/assets/{ScenarioPaymentMode-DHx-gf_J.js → ScenarioPaymentMode-BlvIIqGE.js} +1 -1
- package/dist/assets/{ScheduledTasks-BTdAj5bj.js → ScheduledTasks-S4Z71gh-.js} +1 -1
- package/dist/assets/{SolanaWalletPickerDialog-Dyf4OrtZ.js → SolanaWalletPickerDialog-Cd5vajex.js} +1 -1
- package/dist/assets/{Status-BAOOm7Y6.js → Status-DNOaXznc.js} +1 -1
- package/dist/assets/{Subscribe-Qqvq4kcb.js → Subscribe-A8OqkeSR.js} +1 -1
- package/dist/assets/{TabSwitcher-SRPkuCQO.js → TabSwitcher-SiRMNexm.js} +1 -1
- package/dist/assets/{Tts-CiW_3IBs.js → Tts-DyMpN8hW.js} +1 -1
- package/dist/assets/{VideoPlayer-89YYttvk.js → VideoPlayer-DZp6QESw.js} +1 -1
- package/dist/assets/{VideoPreview-BlX_PPPl.js → VideoPreview-CPsP_3Pp.js} +1 -1
- package/dist/assets/arrow-down-DvuSfXw8.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-DaI6Uvy0.js → arrow-down-wide-narrow-jXLUrrhB.js} +1 -1
- package/dist/assets/arrow-left-ClF3w0x3.js +1 -0
- package/dist/assets/arrow-right-DTyFeaP3.js +1 -0
- package/dist/assets/arrow-up-DYfHgEeO.js +1 -0
- package/dist/assets/{authorizeFlow-CujA2Sko.js → authorizeFlow-CdT1zXJd.js} +1 -1
- package/dist/assets/{avatar-C6N1pFHe.js → avatar-siturufG.js} +1 -1
- package/dist/assets/{basic-CPefaDNi.js → basic-BR1wKocS.js} +1 -1
- package/dist/assets/{book-open-DAATULmD.js → book-open-BRv0flSZ.js} +1 -1
- package/dist/assets/{box-BShXku0x.js → box-CGknPyOM.js} +1 -1
- package/dist/assets/{boxes-OOy_NK7l.js → boxes-CrrqBGNb.js} +1 -1
- package/dist/assets/{brain-Cu-lPJz-.js → brain-CPbpRfZ5.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-cFmOkyoL.js → chart-no-axes-combined-2KvJOzr0.js} +1 -1
- package/dist/assets/{chat-2mnC6M1U.js → chat-v0s-5f0-.js} +1 -1
- package/dist/assets/check-BZheDjvI.js +1 -0
- package/dist/assets/chevron-down-Balu-tP0.js +1 -0
- package/dist/assets/chevron-right-B5YkTYcE.js +1 -0
- package/dist/assets/circle-check-Ykp05scz.js +1 -0
- package/dist/assets/{circle-question-mark-ChtLUjT_.js → circle-question-mark-DVPxarhq.js} +1 -1
- package/dist/assets/{clipboard-list-BYEYDrSf.js → clipboard-list-BbAJHKUF.js} +1 -1
- package/dist/assets/clock-_L5j4mM2.js +1 -0
- package/dist/assets/code-C9uo_JrJ.js +1 -0
- package/dist/assets/{codingBridge-DSl0gsJ9.js → codingBridge-Djlq6OYX.js} +1 -1
- package/dist/assets/{codingBridgeNotify-kOlSTgx4.js → codingBridgeNotify-B8Q52a6w.js} +2 -2
- package/dist/assets/{coins-DwMmRk4F.js → coins-DEk5buRk.js} +1 -1
- package/dist/assets/{collapse-GpKda_4j.js → collapse-DuU6GFQ5.js} +1 -1
- package/dist/assets/{common-BKsvEmV6.js → common--c1slE1u.js} +1 -1
- package/dist/assets/{common-BqAdpno_.js → common-1y1xR6Hq.js} +1 -1
- package/dist/assets/{common-0gFKvUbv.js → common-5CGWhWTi.js} +1 -1
- package/dist/assets/{common-37ohr-XT.js → common-BBDXNloB.js} +1 -1
- package/dist/assets/{common-DZSi3Hh_.js → common-BF5e88UD.js} +1 -1
- package/dist/assets/{common-B4An_YTm.js → common-BJk75FxQ.js} +1 -1
- package/dist/assets/{common-xxhDQiia.js → common-BWLoKbl8.js} +1 -1
- package/dist/assets/{common-DUhRMhh_.js → common-Bd6DEYvm.js} +1 -1
- package/dist/assets/{common-DRbsZfM1.js → common-BoO0zCSB.js} +1 -1
- package/dist/assets/{common-jvlgniqw.js → common-C-XfsW3T.js} +1 -1
- package/dist/assets/{common-MsalCK0u.js → common-CJWEoJSY.js} +1 -1
- package/dist/assets/{common-CWaCL-rT.js → common-CJzTDJqS.js} +1 -1
- package/dist/assets/{common-B651gMfj.js → common-DoY46wUe.js} +1 -1
- package/dist/assets/{common-CFrdR7cP.js → common-WBrc34-3.js} +1 -1
- package/dist/assets/{common-CDAa_Wy3.js → common-fo0L07YJ.js} +1 -1
- package/dist/assets/{common-CRdaMls6.js → common-gCVhIaMo.js} +1 -1
- package/dist/assets/{common-OrWJ1sIs.js → common-lwxg-JGj.js} +1 -1
- package/dist/assets/{common-BPYnF8a5.js → common-m8zExVQB.js} +1 -1
- package/dist/assets/{constants-COIxBjYU.js → constants-DB14FZRU.js} +1 -1
- package/dist/assets/{copy-BCep57w1.js → copy-Tlgyz9eC.js} +1 -1
- package/dist/assets/{createTaskActions-BXMbF95s.js → createTaskActions-y84vbeM7.js} +1 -1
- package/dist/assets/{digitalhuman-Bnx1V9mB.js → digitalhuman-DDRB4Csy.js} +1 -1
- package/dist/assets/{dollar-sign--p8_eDBy.js → dollar-sign-wjjCBpcj.js} +1 -1
- package/dist/assets/{download-Dt0wWdpW.js → download-on3oR6zb.js} +1 -1
- package/dist/assets/{drawer-BUv2WEZF.js → drawer-DzFnbtlL.js} +1 -1
- package/dist/assets/{dropdown-CBx7fAAp.js → dropdown-CCVkZbVe.js} +1 -1
- package/dist/assets/{dropdown-UTgACN7Q.js → dropdown-uqg5asHe.js} +1 -1
- package/dist/assets/{ellipsis-yuDcWrJ4.js → ellipsis-CuEXKGT9.js} +1 -1
- package/dist/assets/{esm-C9MRpvkK.js → esm-BSPqkRnF.js} +2 -2
- package/dist/assets/{esm-D4Ha2HnB.js → esm-Cb9tjqlT.js} +2 -2
- package/dist/assets/esm-DxuQ0cdg.js +1 -0
- package/dist/assets/{external-link-CYfNxhR8.js → external-link-BajnLjH5.js} +1 -1
- package/dist/assets/{eye-oDfmxiDV.js → eye-Dnck1A5C.js} +1 -1
- package/dist/assets/{file-tjfJc6_R.js → file-CppnGTAr.js} +1 -1
- package/dist/assets/{file-output-XcBh5O_y.js → file-output-CfSdodAg.js} +1 -1
- package/dist/assets/{file-text-DkDLGLgh.js → file-text-D8oDKfdh.js} +1 -1
- package/dist/assets/{fish-Cx9f10Gm.js → fish-ChT_zMsL.js} +1 -1
- package/dist/assets/{flux-Bmcbakjy.js → flux-o57okWf1.js} +1 -1
- package/dist/assets/{folder-DAsfhav6.js → folder-B-ltG5dw.js} +1 -1
- package/dist/assets/gauge-cE9IBSwQ.js +1 -0
- package/dist/assets/{globe-v5rghgGg.js → globe-CzzZWblu.js} +1 -1
- package/dist/assets/{grokvideo-C8TWPKxr.js → grokvideo-DzYUI1pB.js} +1 -1
- package/dist/assets/{hailuo-C1kObLTr.js → hailuo-Dq4un_YM.js} +1 -1
- package/dist/assets/{headphones-B3pskUHm.js → headphones-D2_Mmzg_.js} +1 -1
- package/dist/assets/{history-BZjtFlQ0.js → history-BrJLYCx6.js} +1 -1
- package/dist/assets/{house-f-R5K_9D.js → house-CtSC2H5m.js} +1 -1
- package/dist/assets/{i18n-DBTdUKZz.js → i18n-xBtzqNWD.js} +1 -1
- package/dist/assets/{image-CR04SjVv.js → image-Dg9vPbEl.js} +1 -1
- package/dist/assets/{imageRequests-CLSZhX1d.js → imageRequests-BqaDdLsP.js} +1 -1
- package/dist/assets/{index-CTn7SLTr.js → index-DOhge-pp.js} +4 -4
- package/dist/assets/{index.es-DB6BDgPr.js → index.es-CydCZe7h.js} +1 -1
- package/dist/assets/{info-zYDWDLVP.js → info-GJzZVDF8.js} +1 -1
- package/dist/assets/{input-number-B0xcuDnW.js → input-number-BoZYCfN1.js} +1 -1
- package/dist/assets/{key-round-BX8FPmcu.js → key-round-5TDczo_1.js} +1 -1
- package/dist/assets/{kling-tUEGRRxO.js → kling-QatxYm1a.js} +1 -1
- package/dist/assets/{languages-DKKUB3AY.js → languages-UTY7yc7j.js} +1 -1
- package/dist/assets/{laptop-DSbqbKpY.js → laptop-BJGSHVnD.js} +1 -1
- package/dist/assets/{lightbulb-NABKBXyu.js → lightbulb-ZjHrMfU4.js} +1 -1
- package/dist/assets/{link-ByjYUxSr.js → link-BqsXc2R1.js} +1 -1
- package/dist/assets/loader-circle-DZSyEkt1.js +1 -0
- package/dist/assets/{lock-gJ6pDfMu.js → lock-D0qOcVzH.js} +1 -1
- package/dist/assets/{luma-CfpOdZqb.js → luma-Svwqljg_.js} +1 -1
- package/dist/assets/{maestro-yRubvEFE.js → maestro-C3HE3Qrs.js} +1 -1
- package/dist/assets/{maestroLanguages-B0F58ijw.js → maestroLanguages-CtrBBaF5.js} +1 -1
- package/dist/assets/{mail-DZpi5J9I.js → mail-n46eyUuz.js} +1 -1
- package/dist/assets/{message-circle-D8K26AlF.js → message-circle-BTMUXFus.js} +1 -1
- package/dist/assets/{mic-DKCR-fiK.js → mic-lGrOxDMY.js} +1 -1
- package/dist/assets/{midjourney-DM-JhLuX.js → midjourney-DxxPfzWB.js} +1 -1
- package/dist/assets/{minimax-DxlvMTWd.js → minimax-fXPALjsU.js} +1 -1
- package/dist/assets/{mobileLocalExec-IQ4ZYo9T.js → mobileLocalExec-Dgbyv9K_.js} +2 -2
- package/dist/assets/{models-DAfyWAqc.js → models-BoFv4bCY.js} +1 -1
- package/dist/assets/{monitor-dn1EyIUV.js → monitor-D51qa6h5.js} +1 -1
- package/dist/assets/{mouse-pointer-2-C7O4LVbr.js → mouse-pointer-2-qje-E-S2.js} +1 -1
- package/dist/assets/music-2-FnictHi2.js +1 -0
- package/dist/assets/{nanobanana-CxpWeSUn.js → nanobanana-CGSjj0RF.js} +1 -1
- package/dist/assets/{omni-DxA9Ux8Y.js → omni-Bvnq4XTT.js} +1 -1
- package/dist/assets/{openaiimage-DlDGJtH4.js → openaiimage-CyIt5hLu.js} +1 -1
- package/dist/assets/{pagination-NMff1SYZ.js → pagination-COP0MNDx.js} +1 -1
- package/dist/assets/{pagination-DMwQC4ut.js → pagination-DGp5KHs3.js} +1 -1
- package/dist/assets/{pagination-C5hWM-uh.js → pagination-c0CsKTZZ.js} +1 -1
- package/dist/assets/{palette-CRW1qOCG.js → palette-DFYlQ_Pt.js} +1 -1
- package/dist/assets/{paperclip-HA2RNkmq.js → paperclip-7FI_t6Um.js} +1 -1
- package/dist/assets/{pause-09GpN31S.js → pause-D7ms_ncg.js} +1 -1
- package/dist/assets/{pencil-CD6MLBSx.js → pencil-Cays9IO7.js} +1 -1
- package/dist/assets/{pika-CxjINjjD.js → pika-BnM61JJW.js} +1 -1
- package/dist/assets/{pixverse-CzR8RnTd.js → pixverse-DTniVLBT.js} +1 -1
- package/dist/assets/play-BVfZoHZf.js +1 -0
- package/dist/assets/{plug-D6wUveI9.js → plug-Bh4gquso.js} +1 -1
- package/dist/assets/plus-Dd_HPxkY.js +1 -0
- package/dist/assets/{poivelle-ChqnXNHp.js → poivelle-V318LQcC.js} +1 -1
- package/dist/assets/{popover-8bFfKyEx.js → popover-DTZ9rVtt.js} +1 -1
- package/dist/assets/{producer-CZdiq23k.js → producer-CbvJlCch.js} +1 -1
- package/dist/assets/{qrart-T4a6zkdJ.js → qrart-DuUIjvyD.js} +1 -1
- package/dist/assets/{realtime-C0bVe3k2.js → realtime-DSTjRcVx.js} +1 -1
- package/dist/assets/{refresh-cw-3eBUX5Ea.js → refresh-cw-D2Sl0W82.js} +1 -1
- package/dist/assets/rotate-ccw-D4NNsiWQ.js +1 -0
- package/dist/assets/rotate-cw-Bk6VIECX.js +1 -0
- package/dist/assets/{row-BQUMxfsY.js → row-BlMc5HGF.js} +1 -1
- package/dist/assets/search-F_fqjja6.js +1 -0
- package/dist/assets/{seedance-DWR0aqWj.js → seedance-BvbqVhP1.js} +1 -1
- package/dist/assets/{seedream-CMXDmAzS.js → seedream-BftI-vhj.js} +1 -1
- package/dist/assets/{select-C0yzkTif.js → select-B6369cNi.js} +1 -1
- package/dist/assets/{serp-Dt_PQkXV.js → serp-Cl3p1JHx.js} +1 -1
- package/dist/assets/{shield-wdrqyAOI.js → shield-D8UrbLLz.js} +1 -1
- package/dist/assets/{shuffle-Bqjf3c86.js → shuffle-ChVPnZdn.js} +1 -1
- package/dist/assets/{slider-BDLlDUDz.js → slider-CjdcTpL2.js} +1 -1
- package/dist/assets/{solana-wallets-C-BcnEbE.js → solana-wallets-BUubMUZ5.js} +2 -2
- package/dist/assets/{sora-DFX7Ridx.js → sora-CEMQ0XPI.js} +1 -1
- package/dist/assets/{sparkles-BoTKvrNO.js → sparkles-CRO_Parr.js} +1 -1
- package/dist/assets/square-Cn7IwKvp.js +1 -0
- package/dist/assets/{store-B3O9u73-.js → store-B5udVX4a.js} +1 -1
- package/dist/assets/{suno-DCe2XW0B.js → suno-CjxAiuI5.js} +1 -1
- package/dist/assets/{switch-C7dNKdGq.js → switch-D_YnlIp5.js} +1 -1
- package/dist/assets/{table-UhquZYel.js → table-BkodlB9h.js} +1 -1
- package/dist/assets/{tabs-BwvMWaWZ.js → tabs-CxRafyJg.js} +1 -1
- package/dist/assets/{tag-BJxLMPQ4.js → tag-CVhgierF.js} +1 -1
- package/dist/assets/terminal-AQLyjj8U.js +1 -0
- package/dist/assets/{time-picker-DoJ_mwqy.js → time-picker-CKEVaP9F.js} +1 -1
- package/dist/assets/{tooltip-CY9KP5TS.js → tooltip-3ZZ1q2k4.js} +1 -1
- package/dist/assets/{trash-2-B1wBangj.js → trash-2-DmWihZi_.js} +1 -1
- package/dist/assets/{triangle-alert-CAuu6B-W.js → triangle-alert-CZwE_T9Q.js} +1 -1
- package/dist/assets/{upload-D_4LkjOW.js → upload-CdoLg_bk.js} +1 -1
- package/dist/assets/{upload-D6AM_V-z.js → upload-KvU-H2Pn.js} +1 -1
- package/dist/assets/user-0NnJ74ST.js +1 -0
- package/dist/assets/{veo-W71kXy0Z.js → veo-ONNSpkhL.js} +1 -1
- package/dist/assets/{video-DVgqKgsY.js → video-Ds6UnEus.js} +1 -1
- package/dist/assets/{volume-2-DocaJU2F.js → volume-2--yglTc_s.js} +1 -1
- package/dist/assets/{wallet-RBRJCWek.js → wallet-DvYGlknw.js} +1 -1
- package/dist/assets/{wan-CgXklc_4.js → wan-BesmSQWo.js} +1 -1
- package/dist/assets/{wand-sparkles-CJH0v5L4.js → wand-sparkles-Ck5CAolV.js} +1 -1
- package/dist/assets/{web-BjNw9wT3.js → web-BpazWmuF.js} +1 -1
- package/dist/assets/{web-D29bO3g4.js → web-CC4Ds7ZI.js} +1 -1
- package/dist/assets/{web-9nZX65Vh.js → web-CdcSxdGo.js} +1 -1
- package/dist/assets/{web-DRJhyBh_.js → web-Q5iTq2oM.js} +1 -1
- package/dist/assets/{web-nUZelD8c.js → web-YLsKC2g3.js} +1 -1
- package/dist/assets/{webextrator-C1x7ltX3.js → webextrator-BVrMNlao.js} +1 -1
- package/dist/assets/{zap-Bo8Pzpwk.js → zap-FPxiKD8O.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/Detail-BynbMCsg.js +0 -2
- package/dist/assets/Navigator-DJAPAK_Y.css +0 -1
- package/dist/assets/arrow-down-M2F1qebD.js +0 -1
- package/dist/assets/arrow-left-D_2mJNNF.js +0 -1
- package/dist/assets/arrow-right-abRRWNmS.js +0 -1
- package/dist/assets/arrow-up-DMpA1IsJ.js +0 -1
- package/dist/assets/check-TtZdHrlm.js +0 -1
- package/dist/assets/chevron-down-DMXTi49q.js +0 -1
- package/dist/assets/chevron-right-DIQNv_0r.js +0 -1
- package/dist/assets/circle-check-DKBPWCH5.js +0 -1
- package/dist/assets/clock-D5NbflY9.js +0 -1
- package/dist/assets/code-wKSqPZcq.js +0 -1
- package/dist/assets/esm-BgUDy7vB.js +0 -1
- package/dist/assets/gauge-DP9sk0Fe.js +0 -1
- package/dist/assets/loader-circle-r7o2cOdj.js +0 -1
- package/dist/assets/music-2-UxfKU68J.js +0 -1
- package/dist/assets/play-1r8M6tGa.js +0 -1
- package/dist/assets/plus-Dzhx2WdR.js +0 -1
- package/dist/assets/rotate-ccw-DFETd1JJ.js +0 -1
- package/dist/assets/rotate-cw-BLViYEn3.js +0 -1
- package/dist/assets/search-CiYRAPUv.js +0 -1
- package/dist/assets/square-B9lxDeHX.js +0 -1
- package/dist/assets/terminal-C5ne2YRf.js +0 -1
- package/dist/assets/user-B3wTOjwB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-abRRWNmS.js";import{t as h}from"./check-TtZdHrlm.js";import{t as g}from"./external-link-CYfNxhR8.js";import{t as ee}from"./globe-v5rghgGg.js";import{t as te}from"./wand-sparkles-CJH0v5L4.js";import{M as _,Na as v,O as y,i as b,r as x,vn as S}from"./index-CTn7SLTr.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Business`,components:{ElButton:v,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},heroHeadline(){return this.site?.description?.trim()||this.$t(`index.subtitle.banner`)},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||S()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:x[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.heroHeadline),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-e64a7440`]]);export{Fe as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-DTyFeaP3.js";import{t as h}from"./check-BZheDjvI.js";import{t as g}from"./external-link-BajnLjH5.js";import{t as ee}from"./globe-CzzZWblu.js";import{t as te}from"./wand-sparkles-Ck5CAolV.js";import{M as _,Na as v,O as y,i as b,r as x,vn as S}from"./index-DOhge-pp.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Business`,components:{ElButton:v,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},heroHeadline(){return this.site?.description?.trim()||this.$t(`index.subtitle.banner`)},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||S()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:b.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?b:b.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:x[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.heroHeadline),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=y(k,[[`render`,Pe],[`__scopeId`,`data-v-e64a7440`]]);export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-C0yzkTif.js";import{n as x,t as S}from"./tabs-BwvMWaWZ.js";import{t as C}from"./upload-D6AM_V-z.js";import{t as w}from"./tooltip-CY9KP5TS.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-DAfyWAqc.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-BUv2WEZF.js";import{t as j}from"./input-number-B0xcuDnW.js";import{t as M}from"./slider-BDLlDUDz.js";import{t as N}from"./switch-C7dNKdGq.js";import{t as P}from"./clock-D5NbflY9.js";import{a as F,i as ee,n as te,r as ne,s as re,t as ie}from"./pagination-NMff1SYZ.js";import{t as ae}from"./headphones-B3pskUHm.js";import{t as oe}from"./info-zYDWDLVP.js";import{t as se}from"./lightbulb-NABKBXyu.js";import{t as ce}from"./trash-2-B1wBangj.js";import{t as le}from"./triangle-alert-CAuu6B-W.js";import{t as I}from"./upload-D_4LkjOW.js";import{t as L}from"./wand-sparkles-CJH0v5L4.js";import{_i as ue,mi as de,vi as fe,yi as R}from"./constants-COIxBjYU.js";import{Ar as z,G as B,H as pe,J as V,K as H,Na as U,O as W,Or as me,Qr as he,U as ge,V as _e,Va as G,W as ve,Y as K,_a as ye,_i as be,aa as q,an as J,ei as xe,gi as Y,hi as Se,ja as Ce,ki as we,kr as Te,mn as Ee,q as De,ya as X}from"./index-CTn7SLTr.js";import{t as Oe}from"./CopyToClipboard-AvaqCeXT.js";import{t as ke}from"./ReportButton-D07ABYgs.js";import{t as Ae}from"./FilePreview-BNtZwLa2.js";import{t as Z}from"./ImagePreview-DPhaVe-K.js";import{n as je}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Me}from"./Consumption-BK4nImFR.js";import{t as Ne}from"./AudioPreview-4SXEbJja.js";import{t as Pe}from"./VideoPlayer-89YYttvk.js";import{t as Fe}from"./VideoPreview-BlX_PPPl.js";import{t as Ie}from"./ScenarioPaymentMode-DHx-gf_J.js";import{t as Le}from"./ApiCodeButton-BA7mDSbv.js";import{t as Re}from"./BotPlaceholder-C--FHvts.js";var ze=v({name:`LayoutKling`,components:{MagicIcon:L,ElDrawer:A,ElButton:U},mixins:[je]}),Be={class:`main flex flex-row flex-1 min-h-0`},Ve={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)]`},He={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ue(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Be,[e(`div`,Ve,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,He,[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 We=W(ze,[[`render`,Ue],[`__scopeId`,`data-v-2d826924`]]),Ge={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Q(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5,referenceVideo:!1,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Ge}}var $=`<<<video_1>>>`,Ke=/<<<image_\d+>>>/g;function qe(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function Je(e){return e?e.replace(Ke,` `).replace(/\s{2,}/g,` `).trim():``}function Ye(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Q(n,r,i),o=[];e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function Xe(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=qe(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Je(n.prompt));return n}var Ze=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(de)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Ye(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await X.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Xe({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),Qe={class:`field`},$e={class:`title font-bold`};function et(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,Qe,[e(`h2`,$e,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var tt=W(Ze,[[`render`,et],[`__scopeId`,`data-v-a74e7f31`]]),nt=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return R.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Ye(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await X.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Xe({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),rt={class:`field`},it={class:`header`},at={class:`title font-bold`},ot={key:0,class:`opt-tip`};function st(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,ot,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var ct=W(nt,[[`render`,st],[`__scopeId`,`data-v-9a8fa3c5`]]),lt=[3,5,8,10,12,15],ut=[5,10],dt=[5],ft=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return R.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?dt:this.isV3Model?lt:ut},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{selectedModel(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Ye(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await X.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Xe({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),pt={class:`field`},mt={class:`control`},ht={class:`label`},gt={class:`title font-bold`};function _t(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`h2`,gt,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var vt=W(ft,[[`render`,_t],[`__scopeId`,`data-v-496bf31c`]]),yt=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),bt={class:`text-sm font-bold mb-2 block`},xt={class:`items`},St=[`onClick`],Ct={class:`name`};function wt(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,bt,i(t.$t(`kling.name.ratio`)),1),e(`div`,xt,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,Ct,i(r.label),1)],10,St))),128))])])}var Tt=W(yt,[[`render`,wt],[`__scopeId`,`data-v-cdb14b2f`]]),Et=v({name:`StartImage`,components:{UploadIcon:I,ElUpload:C,ElButton:U,ElTooltip:w,InfoIcon:F,ImagePreview:Z},mixins:[K,V,H],emits:[`change`],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),Dt={class:`relative`},Ot={class:`flex min-h-8 items-center pr-20`},kt={class:`flex justify-start items-center`},At={class:`text-sm font-bold`};function jt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`div`,kt,[e(`span`,At,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Mt=W(Et,[[`render`,jt],[`__scopeId`,`data-v-60844ac3`]]),Nt=v({name:`EndImage`,components:{UploadIcon:I,ElUpload:C,ElButton:U,ElTooltip:w,ImagePreview:Z,InfoIcon:F},mixins:[K,V,H],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),Pt={class:`relative`},Ft={class:`flex min-h-8 items-center pr-20`},It={class:`flex justify-start items-center`},Lt={class:`text-sm font-bold`};function Rt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Pt,[e(`div`,Ft,[e(`div`,It,[e(`span`,Lt,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var zt=W(Nt,[[`render`,Rt],[`__scopeId`,`data-v-b286c4d0`]]),Bt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:U,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:F,FilePreview:Ae,UploadIcon:I},mixins:[V,H],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=ve(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:ge(pe)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes($),i;if(e&&!r)i=n?`${n} ${$}`:$;else if(!e&&r)i=qe(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),Vt={class:`relative`},Ht={class:`flex min-h-8 items-center pr-20`},Ut={class:`flex justify-start items-center`},Wt={class:`text-sm font-bold`},Gt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Kt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},qt={class:`text-sm`},Jt={class:`flex items-center justify-between gap-3`},Yt={class:`text-sm`};function Xt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,Vt,[e(`div`,Ht,[e(`div`,Ut,[e(`span`,Wt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,Gt,[e(`div`,Kt,[e(`span`,qt,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,Jt,[e(`span`,Yt,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var Zt=W(Bt,[[`render`,Xt],[`__scopeId`,`data-v-e3a9dfab`]]),Qt=v({name:`KlingReferenceImages`,components:{ElButton:U,ElUpload:C,UploadIcon:I,ImagePreview:Z,InfoIcon:F},mixins:[K,V,H],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[Je(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),$t={class:`relative`},en={class:`flex justify-between items-center`},tn={class:`flex justify-start items-center`},nn={class:`text-sm font-bold`},rn={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function an(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,$t,[e(`div`,en,[e(`div`,tn,[e(`span`,nn,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,rn,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var on=W(Qt,[[`render`,an]]),sn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:F,ElInputNumber:j},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),cn={class:`flex justify-between`},ln={class:`flex justify-start items-center`},un={class:`text-sm font-bold`},dn={class:`flex justify-end items-center`},fn={class:`w-full`};function pn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,cn,[e(`div`,ln,[e(`span`,un,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,dn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,fn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var mn=W(sn,[[`render`,pn]]),hn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:F},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(R.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),gn={class:`relative`},_n={class:`flex justify-between items-center`},vn={class:`flex justify-start items-center`},yn={class:`text-sm font-bold`};function bn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,gn,[e(`div`,_n,[e(`div`,vn,[e(`span`,yn,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var xn=W(hn,[[`render`,bn]]),Sn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],Cn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:F},data(){return{configKeys:Sn}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),wn={class:`field`},Tn={class:`header`},En={class:`text-sm font-bold`},Dn={key:0,class:`config-grid`},On={class:`cfg-row-head`},kn={class:`cfg-name`};function An(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,wn,[e(`div`,Tn,[e(`span`,En,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Dn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,On,[e(`span`,kn,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var jn=W(Cn,[[`render`,An],[`__scopeId`,`data-v-cd896060`]]),Mn=[{groupKey:`cameraMovements`,chipKeys:[`rotateAround`,`stationary`,`handheld`,`zoomOut`,`zoomIn`,`follow`,`panRight`,`tiltUp`,`tiltDown`,`orbit`]},{groupKey:`cameraSpeed`,chipKeys:[`speedSlow`,`speedMedium`,`speedFast`]},{groupKey:`shotType`,chipKeys:[`shotClose`,`shotMedium`,`shotLong`,`shotLowAngle`,`shotHighAngle`,`shotShallowDof`,`shotFront`,`shotProfile`,`shotCloseUp`,`shotDrone`]},{groupKey:`light`,chipKeys:[`lightSunlight`,`lightSoft`,`lightNeon`,`lightWarm`,`lightNature`,`lightCandle`,`lightCityNight`]},{groupKey:`frame`,chipKeys:[`frameRichDetails`,`frameSimpleBg`]},{groupKey:`atmosphere`,chipKeys:[`atmosphereMysterious`,`atmospherePeaceful`,`atmosphereHeartwarming`,`atmosphereVivid`,`atmosphereColorful`]}],Nn=`, `;function Pn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Nn}${t}`:t}function Fn(e,t){if(!e||!t)return e||``;let n=[`${t}${Nn}`,`${Nn}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var In=v({name:`InspirationPills`,components:{CloseIcon:ye},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Mn.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=Fn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Ln={key:0,class:`pills`,role:`list`},Rn={class:`pill-text`},zn=[`aria-label`,`title`,`onClick`];function Bn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Ln,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Rn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,zn)]))),128))])):o(``,!0)}var Vn=v({name:`PromptInput`,components:{IdeaIcon:se,ElButton:U,PromptTextarea:ee,InspirationPills:W(In,[[`render`,Bn],[`__scopeId`,`data-v-6be01bcf`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Hn(e,t,n,o,s,c){let u=l(`idea-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Un=W(Vn,[[`render`,Hn],[`__scopeId`,`data-v-5754ae54`]]),Wn=v({name:`NegativePromptInput`,components:{ElInput:G,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug(`set prompt`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||=``}}),Gn={class:`field`},Kn={class:`box`},qn={class:`title font-bold`};function Jn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Gn,[e(`div`,Kn,[e(`h2`,qn,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var Yn=W(Wn,[[`render`,Jn],[`__scopeId`,`data-v-de98cf01`]]),Xn=v({name:`InspirationDrawer`,components:{Close:ye,IdeaIcon:se,ElDrawer:A,ElButton:U},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Mn}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(Fn(this.prompt,e)):this.setPrompt(Pn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Fn(e,t);this.setPrompt(e)}}}),Zn={class:`drawer-content`},Qn={class:`drawer-header`},$n={class:`title-row`},er={class:`title`},tr={class:`hint`},nr={key:0,class:`selected-bar`},rr={class:`selected-text`},ir={class:`groups`},ar={class:`group-title`},or={class:`chip-grid`},sr=[`onClick`];function cr(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,Zn,[e(`div`,Qn,[e(`div`,$n,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,er,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,tr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,nr,[e(`span`,rr,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,ir,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,ar,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,or,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,sr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var lr=W(Xn,[[`render`,cr],[`__scopeId`,`data-v-8b2e6a5d`]]),ur={"kling-v3":`v3`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-o1":`Kling O1`},dr={std:`720p`,pro:`1080p`,"4k":`4K`},fr=v({name:`SummaryChip`,components:{AudioIcon:ae},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return ur[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return dr[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),pr={class:`summary-chip`},mr=[`title`],hr=[`title`],gr=[`title`],_r=[`title`],vr=[`title`];function yr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,pr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,mr),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,hr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,gr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,_r),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,vr)):o(``,!0)])}var br=v({name:`ConfigPanel`,components:{MagicIcon:L,ElButton:U,Consumption:Me,PromptInput:Un,NegativePromptInput:Yn,ModelSelector:tt,ModeSelector:ct,DurationSelector:vt,RatioSelector:Tt,StartImage:Mt,CfgScaleSelector:mn,GenerateAudioSelector:xn,CameraControlSelector:jn,InspirationDrawer:lr,SummaryChip:W(fr,[[`render`,yr],[`__scopeId`,`data-v-c800852a`]]),EndImage:zt,ReferenceImages:on,ReferenceVideo:Zt,ScenarioPaymentMode:Ie},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Q(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return J(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return Se()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=Y(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await z.quote(Te(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),xr={class:`flex flex-col h-full`},Sr={class:`flex-1 overflow-y-auto p-5`},Cr={class:`flex flex-col items-center justify-center px-5 pb-5`};function wr(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`scenario-payment-mode`),j=l(`consumption`),M=l(`magic-icon`),N=l(`el-button`),P=l(`inspiration-drawer`);return g(),s(`div`,xr,[e(`div`,Sr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,Cr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(P,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var Tr=W(br,[[`render`,wr]]),Er=v({name:`MotionImage`,components:{UploadIcon:I,ElUpload:C,ElButton:U,InfoIcon:F,ImagePreview:Z},mixins:[K,V,H,_e],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Dr={class:`relative`},Or={class:`flex justify-between`},kr={class:`flex justify-start items-center`},Ar={class:`text-sm font-bold`};function jr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Dr,[e(`div`,Or,[e(`div`,kr,[e(`span`,Ar,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Mr=W(Er,[[`render`,jr],[`__scopeId`,`data-v-4a95ef2c`]]),Nr=v({name:`MotionVideo`,components:{UploadIcon:I,ElUpload:C,ElButton:U,InfoIcon:F,FilePreview:Ae},mixins:[V,H],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Pr={class:`relative`},Fr={class:`flex justify-between`},Ir={class:`flex justify-start items-center`},Lr={class:`text-sm font-bold`};function Rr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Pr,[e(`div`,Fr,[e(`div`,Ir,[e(`span`,Lr,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var zr=W(Nr,[[`render`,Rr],[`__scopeId`,`data-v-630c4521`]]),Br=v({name:`MotionPromptInput`,components:{ElInput:G,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Vr={class:`field`},Hr={class:`box`},Ur={class:`title font-bold`};function Wr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Vr,[e(`div`,Hr,[e(`h2`,Ur,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Gr=W(Br,[[`render`,Wr],[`__scopeId`,`data-v-ca9fdbe5`]]),Kr=`video`,qr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:F},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Kr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=Kr)}}),Jr={class:`field`},Yr={class:`header`},Xr={class:`text-sm font-bold`};function Zr(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,Jr,[e(`div`,Yr,[e(`span`,Xr,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var Qr=W(qr,[[`render`,Zr],[`__scopeId`,`data-v-7a91195b`]]),$r=`kling-v2-6`,ei=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||$r},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=$r)}}),ti={class:`field`},ni={class:`header`},ri={class:`title font-bold`};function ii(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ti,[e(`div`,ni,[e(`h2`,ri,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ai=W(ei,[[`render`,ii],[`__scopeId`,`data-v-480e8da2`]]),oi=`std`,si=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||oi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=oi)}}),ci={class:`field`},li={class:`header`},ui={class:`title font-bold`};function di(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ci,[e(`div`,li,[e(`h2`,ui,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var fi=W(si,[[`render`,di],[`__scopeId`,`data-v-1295688c`]]),pi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:F},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??`yes`)===`yes`},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,keep_original_sound:e?`yes`:`no`})}}}}),mi={class:`relative`},hi={class:`flex justify-between items-center`},gi={class:`flex justify-start items-center`},_i={class:`text-sm font-bold`};function vi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,mi,[e(`div`,hi,[e(`div`,gi,[e(`span`,_i,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var yi=v({name:`MotionPanel`,components:{MagicIcon:L,ElButton:U,Consumption:Me,MotionImage:Mr,MotionVideo:zr,MotionPromptInput:Gr,CharacterOrientationSelector:Qr,MotionModelSelector:ai,MotionModeSelector:fi,KeepOriginalSoundSelector:W(pi,[[`render`,vi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return J({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),bi={class:`flex flex-col h-full`},xi={class:`flex-1 overflow-y-auto p-5`},Si={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ci(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`consumption`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,bi,[e(`div`,xi,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,Si,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var wi=W(yi,[[`render`,Ci]]),Ti=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:Ce},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Ei=[`title`],Di={class:`text`};function Oi(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Di,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Ei)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var ki=W(Ti,[[`render`,Oi],[`__scopeId`,`data-v-e6a2bb26`]]),Ai={"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`},ji=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:fe.map(e=>({value:e,label:Ai[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=ue)}}),Mi={class:`field`},Ni={class:`title font-bold`};function Pi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Mi,[e(`h2`,Ni,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Fi=W(ji,[[`render`,Pi],[`__scopeId`,`data-v-cbc83d11`]]),Ii=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Li={class:`field`},Ri={class:`title font-bold`};function zi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Li,[e(`h2`,Ri,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Bi=v({name:`TalkingPhotoPanel`,components:{MagicIcon:L,UploadIcon:I,ElUpload:C,ElButton:U,ElInput:G,Consumption:Me,InfoIcon:F,ImagePreview:Z,ModelSelector:Fi,ModeSelector:W(Ii,[[`render`,zi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Ie},mixins:[H,_e],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:q()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return J({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return Se()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=Y(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await z.quoteTalkingPhoto(me(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),Vi={class:`flex flex-col h-full`},Hi={class:`flex-1 overflow-y-auto p-5`},Ui={class:`relative mb-4`},Wi={class:`flex justify-start items-center`},Gi={class:`text-sm font-bold`},Ki={class:`relative mb-4`},qi={class:`flex justify-start items-center`},Ji={class:`text-sm font-bold`},Yi=[`src`],Xi={class:`mb-4`},Zi={class:`flex justify-start items-center`},Qi={class:`text-sm font-bold`},$i={class:`flex flex-col items-center justify-center px-5 pb-5`};function ea(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`scenario-payment-mode`),T=l(`consumption`),E=l(`magic-icon`);return g(),s(`div`,Vi,[e(`div`,Hi,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Ui,[e(`div`,Wi,[e(`span`,Gi,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Ki,[e(`div`,qi,[e(`span`,Ji,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,Yi)):o(``,!0)]),e(`div`,Xi,[e(`div`,Zi,[e(`span`,Qi,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,$i,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var ta=W(Bi,[[`render`,ea],[`__scopeId`,`data-v-791e4108`]]),na=v({name:`TaskPreview`,components:{DeleteIcon:ce,ChannelIcon:re,InfoIcon:oe,MagicIcon:L,TimeIcon:P,WarningIcon:le,CopyToClipboard:Oe,ElAlert:T,VideoPlayer:Pe,ElTooltip:w,ElButton:U,ImagePreview:Z,VideoPreview:Fe,AudioPreview:Ne,ApiCodeButton:Le,ReportButton:ke},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await X.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),ra={class:`preview`},ia={class:`left`},aa={class:`main`},oa={class:`bot`},sa={class:`datetime`},ca=[`aria-label`],la={key:0,class:`info`},ua={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},da={key:1,class:`prompt`},fa={key:0},pa={key:1},ma={key:1,class:n({content:!0,failed:!0})},ha={key:0,class:`mb-4`},ga={key:1,class:n({operations:!0,"mt-2":!0})},_a={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},va={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ya={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ba={key:2,class:n({content:!0})},xa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Sa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ca={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ta={key:3,class:n({content:!0})},Ea={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Da={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Oa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),P=l(`warning-icon`),F=l(`info-icon`);return g(),s(`div`,ra,[e(`div`,ia,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,aa,[e(`div`,oa,[a(y,{capability:`kling`,part:`name`}),e(`span`,sa,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,ca)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,la,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ua,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,da,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,pa,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,fa,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ma,[n.modelValue?.response.video_url?(g(),s(`div`,ha,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,ga,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,_a,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,va,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ya,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,ba,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,xa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Sa,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ca,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,wa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,Ta,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ea,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Da,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var ka=v({name:`RecentPanel`,components:{TaskPreview:W(na,[[`render`,Oa],[`__scopeId`,`data-v-73637147`]]),NoTasks:ne,BotPlaceholder:Re,ScrollList:te},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Aa={key:0},ja={key:2,class:`w-full h-full flex items-center justify-center`};function Ma(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`,Aa,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,ja,[a(v)])):o(``,!0)],64)}var Na=v({name:`KlingIndex`,components:{ConfigPanel:Tr,MotionPanel:wi,TalkingPhotoPanel:ta,TabSwitcher:ki,Layout:We,RecentPanel:W(ka,[[`render`,Ma]])},mixins:[De],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks},walletMode(){return this.taskType!==`motion`&&Se()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onGetTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onGetTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ie({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!B(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=Te(this.config),t=Number(!!e.start_image_url)+Number(!!e.end_image_url),n=e.image_list?.length||0,r=e.video_list?.length?4:7;if(t+n>r){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:r}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let i=this.createPaymentOperation(t=>z.generate(e,t));i&&(D.info(this.$t(`kling.message.startingTask`)),we(`kling`,i).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!Ee())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof he||((e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):this.walletMode?D.error(`${this.$t(`common.x402Scenario.paymentFailed`)} ${e?.message||``}`.trim()):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return xe(this.$wallet)},async confirmWalletPayment(e){return X.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(e===`motion`&&be(`kling`,`credits`),await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!B(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!Ee())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),we(`kling`,z.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!B(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=me(e),n=this.createPaymentOperation(e=>z.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),we(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Pa={class:`flex flex-col h-full`},Fa={class:`flex-1 min-h-0`};function Ia(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`layout`);return g(),f(v,null,{config:p(()=>[e(`div`,Pa,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Fa,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var La=W(Na,[[`render`,Ia]]);export{La 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-B6369cNi.js";import{n as x,t as S}from"./tabs-CxRafyJg.js";import{t as C}from"./upload-KvU-H2Pn.js";import{t as w}from"./tooltip-3ZZ1q2k4.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-BoFv4bCY.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-DzFnbtlL.js";import{t as j}from"./input-number-BoZYCfN1.js";import{t as M}from"./slider-CjdcTpL2.js";import{t as N}from"./switch-D_YnlIp5.js";import{t as P}from"./clock-_L5j4mM2.js";import{a as F,i as ee,n as te,r as ne,s as re,t as ie}from"./pagination-COP0MNDx.js";import{t as ae}from"./headphones-D2_Mmzg_.js";import{t as oe}from"./info-GJzZVDF8.js";import{t as se}from"./lightbulb-ZjHrMfU4.js";import{t as ce}from"./trash-2-DmWihZi_.js";import{t as le}from"./triangle-alert-CZwE_T9Q.js";import{t as I}from"./upload-CdoLg_bk.js";import{t as L}from"./wand-sparkles-Ck5CAolV.js";import{_i as ue,mi as de,vi as fe,yi as R}from"./constants-DB14FZRU.js";import{Ar as z,G as B,H as pe,J as V,K as H,Na as U,O as W,Or as me,Qr as he,U as ge,V as _e,Va as G,W as ve,Y as K,_a as ye,_i as be,aa as q,an as J,ei as xe,gi as Y,hi as Se,ja as Ce,ki as we,kr as Te,mn as Ee,q as De,ya as X}from"./index-DOhge-pp.js";import{t as Oe}from"./CopyToClipboard-QFe7Cn4_.js";import{t as ke}from"./ReportButton-ChQMpn6o.js";import{t as Ae}from"./FilePreview-DI9LxA3P.js";import{t as Z}from"./ImagePreview-Bb3mYw3m.js";import{n as je}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Me}from"./Consumption-gbjpxptE.js";import{t as Ne}from"./AudioPreview-vjoUTGMO.js";import{t as Pe}from"./VideoPlayer-DZp6QESw.js";import{t as Fe}from"./VideoPreview-CPsP_3Pp.js";import{t as Ie}from"./ScenarioPaymentMode-BlvIIqGE.js";import{t as Le}from"./ApiCodeButton-C_dp8MuJ.js";import{t as Re}from"./BotPlaceholder-DKkxXInm.js";var ze=v({name:`LayoutKling`,components:{MagicIcon:L,ElDrawer:A,ElButton:U},mixins:[je]}),Be={class:`main flex flex-row flex-1 min-h-0`},Ve={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)]`},He={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ue(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Be,[e(`div`,Ve,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,He,[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 We=W(ze,[[`render`,Ue],[`__scopeId`,`data-v-2d826924`]]),Ge={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Q(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5,referenceVideo:!1,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Ge}}var $=`<<<video_1>>>`,Ke=/<<<image_\d+>>>/g;function qe(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function Je(e){return e?e.replace(Ke,` `).replace(/\s{2,}/g,` `).trim():``}function Ye(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Q(n,r,i),o=[];e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function Xe(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=qe(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Je(n.prompt));return n}var Ze=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(de)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Ye(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await X.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Xe({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),Qe={class:`field`},$e={class:`title font-bold`};function et(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,Qe,[e(`h2`,$e,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var tt=W(Ze,[[`render`,et],[`__scopeId`,`data-v-a74e7f31`]]),nt=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return R.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Ye(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await X.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Xe({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),rt={class:`field`},it={class:`header`},at={class:`title font-bold`},ot={key:0,class:`opt-tip`};function st(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,ot,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var ct=W(nt,[[`render`,st],[`__scopeId`,`data-v-9a8fa3c5`]]),lt=[3,5,8,10,12,15],ut=[5,10],dt=[5],ft=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return R.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?dt:this.isV3Model?lt:ut},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{selectedModel(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Ye(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await X.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Xe({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),pt={class:`field`},mt={class:`control`},ht={class:`label`},gt={class:`title font-bold`};function _t(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`h2`,gt,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var vt=W(ft,[[`render`,_t],[`__scopeId`,`data-v-496bf31c`]]),yt=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),bt={class:`text-sm font-bold mb-2 block`},xt={class:`items`},St=[`onClick`],Ct={class:`name`};function wt(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,bt,i(t.$t(`kling.name.ratio`)),1),e(`div`,xt,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,Ct,i(r.label),1)],10,St))),128))])])}var Tt=W(yt,[[`render`,wt],[`__scopeId`,`data-v-cdb14b2f`]]),Et=v({name:`StartImage`,components:{UploadIcon:I,ElUpload:C,ElButton:U,ElTooltip:w,InfoIcon:F,ImagePreview:Z},mixins:[K,V,H],emits:[`change`],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),Dt={class:`relative`},Ot={class:`flex min-h-8 items-center pr-20`},kt={class:`flex justify-start items-center`},At={class:`text-sm font-bold`};function jt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`div`,kt,[e(`span`,At,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Mt=W(Et,[[`render`,jt],[`__scopeId`,`data-v-60844ac3`]]),Nt=v({name:`EndImage`,components:{UploadIcon:I,ElUpload:C,ElButton:U,ElTooltip:w,ImagePreview:Z,InfoIcon:F},mixins:[K,V,H],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),Pt={class:`relative`},Ft={class:`flex min-h-8 items-center pr-20`},It={class:`flex justify-start items-center`},Lt={class:`text-sm font-bold`};function Rt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,Pt,[e(`div`,Ft,[e(`div`,It,[e(`span`,Lt,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var zt=W(Nt,[[`render`,Rt],[`__scopeId`,`data-v-b286c4d0`]]),Bt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:U,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:F,FilePreview:Ae,UploadIcon:I},mixins:[V,H],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=ve(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:ge(pe)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes($),i;if(e&&!r)i=n?`${n} ${$}`:$;else if(!e&&r)i=qe(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),Vt={class:`relative`},Ht={class:`flex min-h-8 items-center pr-20`},Ut={class:`flex justify-start items-center`},Wt={class:`text-sm font-bold`},Gt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Kt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},qt={class:`text-sm`},Jt={class:`flex items-center justify-between gap-3`},Yt={class:`text-sm`};function Xt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,Vt,[e(`div`,Ht,[e(`div`,Ut,[e(`span`,Wt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,Gt,[e(`div`,Kt,[e(`span`,qt,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,Jt,[e(`span`,Yt,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var Zt=W(Bt,[[`render`,Xt],[`__scopeId`,`data-v-e3a9dfab`]]),Qt=v({name:`KlingReferenceImages`,components:{ElButton:U,ElUpload:C,UploadIcon:I,ImagePreview:Z,InfoIcon:F},mixins:[K,V,H],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[Je(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),$t={class:`relative`},en={class:`flex justify-between items-center`},tn={class:`flex justify-start items-center`},nn={class:`text-sm font-bold`},rn={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function an(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,$t,[e(`div`,en,[e(`div`,tn,[e(`span`,nn,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,rn,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var on=W(Qt,[[`render`,an]]),sn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:F,ElInputNumber:j},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),cn={class:`flex justify-between`},ln={class:`flex justify-start items-center`},un={class:`text-sm font-bold`},dn={class:`flex justify-end items-center`},fn={class:`w-full`};function pn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,cn,[e(`div`,ln,[e(`span`,un,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,dn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,fn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var mn=W(sn,[[`render`,pn]]),hn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:F},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(R.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),gn={class:`relative`},_n={class:`flex justify-between items-center`},vn={class:`flex justify-start items-center`},yn={class:`text-sm font-bold`};function bn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,gn,[e(`div`,_n,[e(`div`,vn,[e(`span`,yn,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var xn=W(hn,[[`render`,bn]]),Sn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],Cn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:F},data(){return{configKeys:Sn}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),wn={class:`field`},Tn={class:`header`},En={class:`text-sm font-bold`},Dn={key:0,class:`config-grid`},On={class:`cfg-row-head`},kn={class:`cfg-name`};function An(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,wn,[e(`div`,Tn,[e(`span`,En,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Dn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,On,[e(`span`,kn,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var jn=W(Cn,[[`render`,An],[`__scopeId`,`data-v-cd896060`]]),Mn=[{groupKey:`cameraMovements`,chipKeys:[`rotateAround`,`stationary`,`handheld`,`zoomOut`,`zoomIn`,`follow`,`panRight`,`tiltUp`,`tiltDown`,`orbit`]},{groupKey:`cameraSpeed`,chipKeys:[`speedSlow`,`speedMedium`,`speedFast`]},{groupKey:`shotType`,chipKeys:[`shotClose`,`shotMedium`,`shotLong`,`shotLowAngle`,`shotHighAngle`,`shotShallowDof`,`shotFront`,`shotProfile`,`shotCloseUp`,`shotDrone`]},{groupKey:`light`,chipKeys:[`lightSunlight`,`lightSoft`,`lightNeon`,`lightWarm`,`lightNature`,`lightCandle`,`lightCityNight`]},{groupKey:`frame`,chipKeys:[`frameRichDetails`,`frameSimpleBg`]},{groupKey:`atmosphere`,chipKeys:[`atmosphereMysterious`,`atmospherePeaceful`,`atmosphereHeartwarming`,`atmosphereVivid`,`atmosphereColorful`]}],Nn=`, `;function Pn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Nn}${t}`:t}function Fn(e,t){if(!e||!t)return e||``;let n=[`${t}${Nn}`,`${Nn}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var In=v({name:`InspirationPills`,components:{CloseIcon:ye},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Mn.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=Fn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Ln={key:0,class:`pills`,role:`list`},Rn={class:`pill-text`},zn=[`aria-label`,`title`,`onClick`];function Bn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Ln,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Rn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,zn)]))),128))])):o(``,!0)}var Vn=v({name:`PromptInput`,components:{IdeaIcon:se,ElButton:U,PromptTextarea:ee,InspirationPills:W(In,[[`render`,Bn],[`__scopeId`,`data-v-6be01bcf`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Hn(e,t,n,o,s,c){let u=l(`idea-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Un=W(Vn,[[`render`,Hn],[`__scopeId`,`data-v-5754ae54`]]),Wn=v({name:`NegativePromptInput`,components:{ElInput:G,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug(`set prompt`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||=``}}),Gn={class:`field`},Kn={class:`box`},qn={class:`title font-bold`};function Jn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Gn,[e(`div`,Kn,[e(`h2`,qn,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var Yn=W(Wn,[[`render`,Jn],[`__scopeId`,`data-v-de98cf01`]]),Xn=v({name:`InspirationDrawer`,components:{Close:ye,IdeaIcon:se,ElDrawer:A,ElButton:U},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Mn}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(Fn(this.prompt,e)):this.setPrompt(Pn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Fn(e,t);this.setPrompt(e)}}}),Zn={class:`drawer-content`},Qn={class:`drawer-header`},$n={class:`title-row`},er={class:`title`},tr={class:`hint`},nr={key:0,class:`selected-bar`},rr={class:`selected-text`},ir={class:`groups`},ar={class:`group-title`},or={class:`chip-grid`},sr=[`onClick`];function cr(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,Zn,[e(`div`,Qn,[e(`div`,$n,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,er,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,tr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,nr,[e(`span`,rr,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,ir,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,ar,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,or,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,sr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var lr=W(Xn,[[`render`,cr],[`__scopeId`,`data-v-8b2e6a5d`]]),ur={"kling-v3":`v3`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-o1":`Kling O1`},dr={std:`720p`,pro:`1080p`,"4k":`4K`},fr=v({name:`SummaryChip`,components:{AudioIcon:ae},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return ur[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return dr[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),pr={class:`summary-chip`},mr=[`title`],hr=[`title`],gr=[`title`],_r=[`title`],vr=[`title`];function yr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,pr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,mr),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,hr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,gr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,_r),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,vr)):o(``,!0)])}var br=v({name:`ConfigPanel`,components:{MagicIcon:L,ElButton:U,Consumption:Me,PromptInput:Un,NegativePromptInput:Yn,ModelSelector:tt,ModeSelector:ct,DurationSelector:vt,RatioSelector:Tt,StartImage:Mt,CfgScaleSelector:mn,GenerateAudioSelector:xn,CameraControlSelector:jn,InspirationDrawer:lr,SummaryChip:W(fr,[[`render`,yr],[`__scopeId`,`data-v-c800852a`]]),EndImage:zt,ReferenceImages:on,ReferenceVideo:Zt,ScenarioPaymentMode:Ie},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Q(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return J(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return Se()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=Y(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await z.quote(Te(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),xr={class:`flex flex-col h-full`},Sr={class:`flex-1 overflow-y-auto p-5`},Cr={class:`flex flex-col items-center justify-center px-5 pb-5`};function wr(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`scenario-payment-mode`),j=l(`consumption`),M=l(`magic-icon`),N=l(`el-button`),P=l(`inspiration-drawer`);return g(),s(`div`,xr,[e(`div`,Sr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,Cr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(P,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var Tr=W(br,[[`render`,wr]]),Er=v({name:`MotionImage`,components:{UploadIcon:I,ElUpload:C,ElButton:U,InfoIcon:F,ImagePreview:Z},mixins:[K,V,H,_e],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Dr={class:`relative`},Or={class:`flex justify-between`},kr={class:`flex justify-start items-center`},Ar={class:`text-sm font-bold`};function jr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Dr,[e(`div`,Or,[e(`div`,kr,[e(`span`,Ar,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Mr=W(Er,[[`render`,jr],[`__scopeId`,`data-v-4a95ef2c`]]),Nr=v({name:`MotionVideo`,components:{UploadIcon:I,ElUpload:C,ElButton:U,InfoIcon:F,FilePreview:Ae},mixins:[V,H],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Pr={class:`relative`},Fr={class:`flex justify-between`},Ir={class:`flex justify-start items-center`},Lr={class:`text-sm font-bold`};function Rr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Pr,[e(`div`,Fr,[e(`div`,Ir,[e(`span`,Lr,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var zr=W(Nr,[[`render`,Rr],[`__scopeId`,`data-v-630c4521`]]),Br=v({name:`MotionPromptInput`,components:{ElInput:G,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Vr={class:`field`},Hr={class:`box`},Ur={class:`title font-bold`};function Wr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Vr,[e(`div`,Hr,[e(`h2`,Ur,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Gr=W(Br,[[`render`,Wr],[`__scopeId`,`data-v-ca9fdbe5`]]),Kr=`video`,qr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:F},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Kr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=Kr)}}),Jr={class:`field`},Yr={class:`header`},Xr={class:`text-sm font-bold`};function Zr(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,Jr,[e(`div`,Yr,[e(`span`,Xr,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var Qr=W(qr,[[`render`,Zr],[`__scopeId`,`data-v-7a91195b`]]),$r=`kling-v2-6`,ei=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||$r},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=$r)}}),ti={class:`field`},ni={class:`header`},ri={class:`title font-bold`};function ii(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ti,[e(`div`,ni,[e(`h2`,ri,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ai=W(ei,[[`render`,ii],[`__scopeId`,`data-v-480e8da2`]]),oi=`std`,si=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||oi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=oi)}}),ci={class:`field`},li={class:`header`},ui={class:`title font-bold`};function di(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ci,[e(`div`,li,[e(`h2`,ui,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var fi=W(si,[[`render`,di],[`__scopeId`,`data-v-1295688c`]]),pi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:F},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??`yes`)===`yes`},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,keep_original_sound:e?`yes`:`no`})}}}}),mi={class:`relative`},hi={class:`flex justify-between items-center`},gi={class:`flex justify-start items-center`},_i={class:`text-sm font-bold`};function vi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,mi,[e(`div`,hi,[e(`div`,gi,[e(`span`,_i,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var yi=v({name:`MotionPanel`,components:{MagicIcon:L,ElButton:U,Consumption:Me,MotionImage:Mr,MotionVideo:zr,MotionPromptInput:Gr,CharacterOrientationSelector:Qr,MotionModelSelector:ai,MotionModeSelector:fi,KeepOriginalSoundSelector:W(pi,[[`render`,vi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return J({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),bi={class:`flex flex-col h-full`},xi={class:`flex-1 overflow-y-auto p-5`},Si={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ci(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`consumption`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,bi,[e(`div`,xi,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,Si,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var wi=W(yi,[[`render`,Ci]]),Ti=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:Ce},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Ei=[`title`],Di={class:`text`};function Oi(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Di,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Ei)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var ki=W(Ti,[[`render`,Oi],[`__scopeId`,`data-v-e6a2bb26`]]),Ai={"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`},ji=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:fe.map(e=>({value:e,label:Ai[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=ue)}}),Mi={class:`field`},Ni={class:`title font-bold`};function Pi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Mi,[e(`h2`,Ni,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Fi=W(ji,[[`render`,Pi],[`__scopeId`,`data-v-cbc83d11`]]),Ii=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Li={class:`field`},Ri={class:`title font-bold`};function zi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Li,[e(`h2`,Ri,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Bi=v({name:`TalkingPhotoPanel`,components:{MagicIcon:L,UploadIcon:I,ElUpload:C,ElButton:U,ElInput:G,Consumption:Me,InfoIcon:F,ImagePreview:Z,ModelSelector:Fi,ModeSelector:W(Ii,[[`render`,zi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Ie},mixins:[H,_e],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:q()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return J({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return Se()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=Y(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await z.quoteTalkingPhoto(me(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),Vi={class:`flex flex-col h-full`},Hi={class:`flex-1 overflow-y-auto p-5`},Ui={class:`relative mb-4`},Wi={class:`flex justify-start items-center`},Gi={class:`text-sm font-bold`},Ki={class:`relative mb-4`},qi={class:`flex justify-start items-center`},Ji={class:`text-sm font-bold`},Yi=[`src`],Xi={class:`mb-4`},Zi={class:`flex justify-start items-center`},Qi={class:`text-sm font-bold`},$i={class:`flex flex-col items-center justify-center px-5 pb-5`};function ea(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`scenario-payment-mode`),T=l(`consumption`),E=l(`magic-icon`);return g(),s(`div`,Vi,[e(`div`,Hi,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Ui,[e(`div`,Wi,[e(`span`,Gi,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Ki,[e(`div`,qi,[e(`span`,Ji,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,Yi)):o(``,!0)]),e(`div`,Xi,[e(`div`,Zi,[e(`span`,Qi,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,$i,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var ta=W(Bi,[[`render`,ea],[`__scopeId`,`data-v-791e4108`]]),na=v({name:`TaskPreview`,components:{DeleteIcon:ce,ChannelIcon:re,InfoIcon:oe,MagicIcon:L,TimeIcon:P,WarningIcon:le,CopyToClipboard:Oe,ElAlert:T,VideoPlayer:Pe,ElTooltip:w,ElButton:U,ImagePreview:Z,VideoPreview:Fe,AudioPreview:Ne,ApiCodeButton:Le,ReportButton:ke},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await X.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),ra={class:`preview`},ia={class:`left`},aa={class:`main`},oa={class:`bot`},sa={class:`datetime`},ca=[`aria-label`],la={key:0,class:`info`},ua={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},da={key:1,class:`prompt`},fa={key:0},pa={key:1},ma={key:1,class:n({content:!0,failed:!0})},ha={key:0,class:`mb-4`},ga={key:1,class:n({operations:!0,"mt-2":!0})},_a={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},va={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ya={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ba={key:2,class:n({content:!0})},xa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Sa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ca={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ta={key:3,class:n({content:!0})},Ea={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Da={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Oa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),P=l(`warning-icon`),F=l(`info-icon`);return g(),s(`div`,ra,[e(`div`,ia,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,aa,[e(`div`,oa,[a(y,{capability:`kling`,part:`name`}),e(`span`,sa,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,ca)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,la,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ua,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,da,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,pa,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,fa,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ma,[n.modelValue?.response.video_url?(g(),s(`div`,ha,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,ga,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,_a,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,va,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ya,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,ba,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,xa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Sa,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ca,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,wa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,Ta,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ea,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Da,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var ka=v({name:`RecentPanel`,components:{TaskPreview:W(na,[[`render`,Oa],[`__scopeId`,`data-v-73637147`]]),NoTasks:ne,BotPlaceholder:Re,ScrollList:te},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Aa={key:0},ja={key:2,class:`w-full h-full flex items-center justify-center`};function Ma(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`,Aa,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,ja,[a(v)])):o(``,!0)],64)}var Na=v({name:`KlingIndex`,components:{ConfigPanel:Tr,MotionPanel:wi,TalkingPhotoPanel:ta,TabSwitcher:ki,Layout:We,RecentPanel:W(ka,[[`render`,Ma]])},mixins:[De],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks},walletMode(){return this.taskType!==`motion`&&Se()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onGetTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onGetTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ie({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!B(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=Te(this.config),t=Number(!!e.start_image_url)+Number(!!e.end_image_url),n=e.image_list?.length||0,r=e.video_list?.length?4:7;if(t+n>r){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:r}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let i=this.createPaymentOperation(t=>z.generate(e,t));i&&(D.info(this.$t(`kling.message.startingTask`)),we(`kling`,i).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!Ee())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof he||((e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):this.walletMode?D.error(`${this.$t(`common.x402Scenario.paymentFailed`)} ${e?.message||``}`.trim()):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return xe(this.$wallet)},async confirmWalletPayment(e){return X.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(e===`motion`&&be(`kling`,`credits`),await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!B(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!Ee())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),we(`kling`,z.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?D.error(this.$t(`kling.message.usedUp`)):D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!B(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=me(e),n=this.createPaymentOperation(e=>z.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),we(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Pa={class:`flex flex-col h-full`},Fa={class:`flex-1 min-h-0`};function Ia(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`layout`);return g(),f(v,null,{config:p(()=>[e(`div`,Pa,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Fa,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var La=W(Na,[[`render`,Ia]]);export{La as default};
|