@acedatacloud/nexior 3.327.13 → 3.327.14
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-B6ugqxDK.js → ApiCodeButton-CZ1yg3gI.js} +1 -1
- package/dist/assets/{Artifacts-ChxHYL6P.js → Artifacts-CU5qmcJu.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-MLoMFQkY.js → AskUserQuestionCard-B2FleOSU.js} +1 -1
- package/dist/assets/{Auth-wpaFPrgr.js → Auth-C3-2XwAN.js} +1 -1
- package/dist/assets/{Bare-DwmWAX-H.js → Bare-xoyMzZj_.js} +1 -1
- package/dist/assets/{BotPlaceholder-DwMB-nyu.js → BotPlaceholder-2PPX3n_C.js} +1 -1
- package/dist/assets/{BottomFooter-jejtxfth.js → BottomFooter-BZa5zQGQ.js} +1 -1
- package/dist/assets/{Callback-D75_4ess.js → Callback-BZoFQ7kg.js} +1 -1
- package/dist/assets/{CodeSnippet-Dh3rolbK.js → CodeSnippet-C9E7V-rR.js} +1 -1
- package/dist/assets/{Console-u92zISr-.js → Console-BqZBpr9p.js} +1 -1
- package/dist/assets/{Consumption-_nwRhH83.js → Consumption-BSGvXSjX.js} +1 -1
- package/dist/assets/{Conversation-DKkhgqPd.js → Conversation-B4DGgEka.js} +1 -1
- package/dist/assets/{Conversation-DA7fmunS.js → Conversation-voAODWio.js} +1 -1
- package/dist/assets/{CopyToClipboard-BQ2Ei1sV.js → CopyToClipboard-BcbOejCl.js} +1 -1
- package/dist/assets/{Detail-CyZi7ogE.js → Detail-VffYtVcY.js} +2 -2
- package/dist/assets/{Extra-D5li270u.js → Extra-rEN1QAia.js} +1 -1
- package/dist/assets/{FilePreview-BSviFDi1.js → FilePreview-dI4g5pKI.js} +1 -1
- package/dist/assets/{Hailuo-Dbc-B9Te.js → Hailuo-DcehbL1m.js} +1 -1
- package/dist/assets/{History-dVoPykWo.js → History-BMhgYJNg.js} +1 -1
- package/dist/assets/{ImagePreview-DKkz6u_p.js → ImagePreview-D7GhT3HH.js} +1 -1
- package/dist/assets/{ImageWrapper-BRTUYofN.js → ImageWrapper-CNjBJ5xI.js} +1 -1
- package/dist/assets/{Index-Dg4BOluo.js → Index-B3L00EtX.js} +1 -1
- package/dist/assets/{Index-_lLCY_Ea.js → Index-B5_M6jfx.js} +1 -1
- package/dist/assets/{Index-a1CjJGW4.js → Index-B7dOlpUO.js} +1 -1
- package/dist/assets/{Index-DQelOaCE.js → Index-BA8PZJM-.js} +1 -1
- package/dist/assets/{Index-CuNZ5VPo.js → Index-BIZjNJJ-.js} +1 -1
- package/dist/assets/{Index-Bsjmz52S.js → Index-BS5NV4nC.js} +1 -1
- package/dist/assets/{Index-4cqh_kOu.js → Index-BWezftIP.js} +1 -1
- package/dist/assets/{Index-C_qRrGdK.js → Index-BX8SbrO0.js} +1 -1
- package/dist/assets/{Index-BuNpeQrj.js → Index-BXIunoXL.js} +1 -1
- package/dist/assets/{Index-SjzgrV03.js → Index-BidJCLdn.js} +1 -1
- package/dist/assets/{Index-Csd8_Agb.js → Index-BvrN6It2.js} +1 -1
- package/dist/assets/{Index-BL75lfg_.js → Index-BxKpEuBc.js} +1 -1
- package/dist/assets/{Index-fJfUyzuW.js → Index-C9FdaRqk.js} +1 -1
- package/dist/assets/{Index-dlLiKtTD.js → Index-CI20I_gt.js} +1 -1
- package/dist/assets/{Index-Crl1Sw0g.js → Index-CIFoBXli.js} +1 -1
- package/dist/assets/{Index-CE770V6G.js → Index-CaYFRZzE.js} +1 -1
- package/dist/assets/{Index-D5NWlMH3.js → Index-CceEyZS4.js} +1 -1
- package/dist/assets/{Index-DiZwqyMw.js → Index-Cenl23Hf.js} +1 -1
- package/dist/assets/{Index-B8hTEerD.js → Index-DQDtQgBR.js} +1 -1
- package/dist/assets/{Index-CY9x2seG.js → Index-DWslPM27.js} +1 -1
- package/dist/assets/{Index-JzdZ0TPa.js → Index-DcT7uZJx.js} +1 -1
- package/dist/assets/{Index--zSMebgV.js → Index-DhPZqXI8.js} +1 -1
- package/dist/assets/{Index-CGpLsRmt.js → Index-Dp6zNOfD.js} +1 -1
- package/dist/assets/{Index-BB098AsY.js → Index-DskGo3f5.js} +1 -1
- package/dist/assets/{Index-P3j5DwyI.js → Index-WfMWDDbC.js} +1 -1
- package/dist/assets/{Index-BF1k8B8X.js → Index-XYT9lrCk.js} +1 -1
- package/dist/assets/{Index-BpGgY_Ek.js → Index-f_htYNMC.js} +1 -1
- package/dist/assets/{Index-B7FqCu9b.js → Index-pfQmr3j5.js} +1 -1
- package/dist/assets/{Index-DlbG_DmZ.js → Index-y5vN3rOs.js} +1 -1
- package/dist/assets/{Invitees-Vc7QeWfZ.js → Invitees-CuNF4Ns-.js} +1 -1
- package/dist/assets/{List-C2HCkQAI.js → List-B3Zp1607.js} +1 -1
- package/dist/assets/{List-CcWcnbv9.js → List-C3QHlcMN.js} +1 -1
- package/dist/assets/{List-BHaLjNnq.js → List-tn5vHSqH.js} +1 -1
- package/dist/assets/{LocalTools-BRuz7qWE.js → LocalTools-B3Hrtrh3.js} +1 -1
- package/dist/assets/{LocalTools-C-v6Bz-r.js → LocalTools-cbw55Zlq.js} +1 -1
- package/dist/assets/{Main-DNwm8rcq.js → Main-C-GOrWTG.js} +1 -1
- package/dist/assets/{Message-s5Ec1YQm.js → Message-CpjuLECV.js} +1 -1
- package/dist/assets/{Model-7P_UY2Dy.js → Model-8NmpfN3t.js} +1 -1
- package/dist/assets/{Navigator-DHT_Wtqn.js → Navigator-BxwR4mZV.js} +3 -3
- package/dist/assets/{NoTasks-Q9DDa660.js → NoTasks-C8vWnK5o.js} +1 -1
- package/dist/assets/{NotFound-Ob-yzf2H.js → NotFound-BlgAKmFe.js} +1 -1
- package/dist/assets/{Pay-NytSoqqM.js → Pay-C-DYx-Vd.js} +1 -1
- package/dist/assets/{Player-BrnX8xA-.js → Player-BO40K0zA.js} +1 -1
- package/dist/assets/{PromptTextarea-5oMvhem7.js → PromptTextarea-CHyNTBsT.js} +1 -1
- package/dist/assets/{RealtimeCall-CEGYhfJe.js → RealtimeCall-CgZQ6AYa.js} +1 -1
- package/dist/assets/ScheduledTasks-1qEyi5Wk.js +2 -0
- package/dist/assets/ScheduledTasks-DsnuqSPs.css +1 -0
- package/dist/assets/{Status-BqztxI8Z.js → Status-DYCfH-N-.js} +1 -1
- package/dist/assets/{Subscribe-D55UOtOX.js → Subscribe-DsVa1lpZ.js} +1 -1
- package/dist/assets/{TabSwitcher-s8FxHO7f.js → TabSwitcher-ZoyG4uSE.js} +1 -1
- package/dist/assets/{Tts-5Zt3ZHoX.js → Tts-BlJKxx9x.js} +1 -1
- package/dist/assets/{VideoPlayer-ikSJRkQv.js → VideoPlayer-Bdn8na6R.js} +1 -1
- package/dist/assets/{VideoPreview-CZrENuKu.js → VideoPreview-DnBxt5uf.js} +1 -1
- package/dist/assets/{alert-BfCyDcWO.js → alert-CkdiVDlK.js} +1 -1
- package/dist/assets/{avatar-CPDZqBps.js → avatar-RPmHfCPM.js} +1 -1
- package/dist/assets/{basic-Cm345FYj.js → basic-Dm0-UBWs.js} +1 -1
- package/dist/assets/{chat-C-DKOo30.js → chat--x9_gJPz.js} +1 -1
- package/dist/assets/{chat-9opabn-h.js → chat-B4uuLtpJ.js} +1 -1
- package/dist/assets/{chat-sBlqc2KU.js → chat-BI2yQyQy.js} +1 -1
- package/dist/assets/{chat-VCk_q53g.js → chat-BV7WcfeH.js} +1 -1
- package/dist/assets/{chat-Bwws-v4D.js → chat-Bjjf7eir.js} +1 -1
- package/dist/assets/{chat-DbN3MSTh.js → chat-C4aYd5cf.js} +1 -1
- package/dist/assets/{chat-CeWfycGq.js → chat-COjmFCyK.js} +1 -1
- package/dist/assets/{chat-MQGYTifz.js → chat-Cuihkv7o.js} +1 -1
- package/dist/assets/{chat-gZYrV4pp.js → chat-Cv1yaYsZ.js} +1 -1
- package/dist/assets/{chat-DthPhVgi.js → chat-D5gP6Sk5.js} +1 -1
- package/dist/assets/{chat-BrZJSdNv.js → chat-DRNK8cKV.js} +1 -1
- package/dist/assets/{chat-Dwhkdkl2.js → chat-D_WKV49e.js} +1 -1
- package/dist/assets/{chat-DW2yPStG.js → chat-DvxEWzFZ.js} +1 -1
- package/dist/assets/{chat-BDFqZmA3.js → chat-G-oUryzh.js} +1 -1
- package/dist/assets/{chat-DpFWauZx.js → chat-OuBIYSuy.js} +1 -1
- package/dist/assets/{chat-DGXJ4mVu.js → chat-PmqkzdK3.js} +1 -1
- package/dist/assets/{chat-BXG0uOVZ.js → chat-aD2kAhrU.js} +1 -1
- package/dist/assets/{chat-DqaOqyAE.js → chat-bJGizI3q.js} +1 -1
- package/dist/assets/{chat-DcUjsF0z.js → chat-oq8iY2nR.js} +1 -1
- package/dist/assets/{codingBridge-CbaTU1_7.js → codingBridge-BBUzDi52.js} +1 -1
- package/dist/assets/{codingBridgeNotify-DIzHGoeo.js → codingBridgeNotify-CjbuaNZH.js} +2 -2
- package/dist/assets/{collapse-Ccqa0VVu.js → collapse-DSPWljAr.js} +1 -1
- package/dist/assets/{constants-BWAHKQ-e.js → constants-BWqqQ28D.js} +1 -1
- package/dist/assets/{createTaskActions-utz_xWYm.js → createTaskActions-D_GgIdEk.js} +1 -1
- package/dist/assets/{date-picker-B1Aj1P6O.js → date-picker-CjAneFAZ.js} +1 -1
- package/dist/assets/{digitalhuman-6sBkCXbF.js → digitalhuman-CIubjSyA.js} +1 -1
- package/dist/assets/{drawer-GII5N0kH.js → drawer-hfiiHebG.js} +1 -1
- package/dist/assets/{dropdown-NCWhNhmE.js → dropdown-DzxLZWqU.js} +1 -1
- package/dist/assets/{dropdown-BAiD4dmf.js → dropdown-gvTEpaM7.js} +1 -1
- package/dist/assets/{esm-B3u8lUhu.js → esm-B32Dy5Ug.js} +3 -3
- package/dist/assets/{esm-B4Mv9hnp.js → esm-BFdMpKcJ.js} +2 -2
- package/dist/assets/{esm-BlbK3YWA.js → esm-CZGsosxe.js} +2 -2
- package/dist/assets/{esm-enNlsZ6P.js → esm-Cq5rP-6n.js} +1 -1
- package/dist/assets/{esm-CQTOhOd1.js → esm-DNUN8tPf.js} +1 -1
- package/dist/assets/{esm-BFDzwz7H.js → esm-fJal_SqO.js} +1 -1
- package/dist/assets/esm-xyK9kYku.js +1 -0
- package/dist/assets/{fish-FcW2RIKk.js → fish-BcWY2iqX.js} +1 -1
- package/dist/assets/{flux-C_uoEh9t.js → flux-ByazEJwf.js} +1 -1
- package/dist/assets/{grokvideo-5JqcID1e.js → grokvideo-B2WZuURM.js} +1 -1
- package/dist/assets/{hailuo-BnOVDYIb.js → hailuo-D2fiKdY6.js} +1 -1
- package/dist/assets/{headshots-rog-taw5.js → headshots-Bs_hFTgB.js} +1 -1
- package/dist/assets/{i18n-BDMAD7Em.js → i18n-YuGefxI0.js} +1 -1
- package/dist/assets/{image-DdozYzas.js → image-B5YV0P5l.js} +1 -1
- package/dist/assets/{index-m0B4VH-l.js → index-Dhzu5qf8.js} +4 -4
- package/dist/assets/{index.browser.esm-CkOw7Di7.js → index.browser.esm-UQo8mxgV.js} +1 -1
- package/dist/assets/{index.es-DVFB1iVe.js → index.es-CY4LWraT.js} +1 -1
- package/dist/assets/{input-number-BZftuN2C.js → input-number-Y246MOpV.js} +1 -1
- package/dist/assets/{kling-Bfb08rFf.js → kling-B7NAJxvL.js} +1 -1
- package/dist/assets/{luma-12kArsfq.js → luma-CNbI6sFQ.js} +1 -1
- package/dist/assets/{maestro-Bm9wS8_g.js → maestro-BvdqzLvb.js} +1 -1
- package/dist/assets/{maestro-BE7pVrHS.js → maestro-DpHlPxpY.js} +1 -1
- package/dist/assets/{midjourney-CYvKJLtX.js → midjourney-5Od7iAcx.js} +1 -1
- package/dist/assets/{mobileLocalExec-Cyxow5dP.js → mobileLocalExec-BNurI8Ms.js} +2 -2
- package/dist/assets/{nanobanana-BUcG4Gxe.js → nanobanana-MTCPW3DC.js} +1 -1
- package/dist/assets/{openaiimage-CZjkzjCL.js → openaiimage-BGMZ5cGy.js} +1 -1
- package/dist/assets/{pagination-OQ6Csuu1.js → pagination-4oRHR4z0.js} +1 -1
- package/dist/assets/{pagination-DiZdmGxW.js → pagination-BaMtpGWF.js} +1 -1
- package/dist/assets/{pika-CzipPX7M.js → pika-CgQtXYJJ.js} +1 -1
- package/dist/assets/{pixverse-CSS6SWUh.js → pixverse-DKJO896Y.js} +1 -1
- package/dist/assets/{popover-DPOFggKQ.js → popover-BIk_9VYt.js} +1 -1
- package/dist/assets/{producer-Ck_R-Q2x.js → producer-iAdBJbs-.js} +1 -1
- package/dist/assets/{qrart-CEksb0cO.js → qrart-CG2xisWr.js} +1 -1
- package/dist/assets/{realtime-Dy4DX0gx.js → realtime-wcFt5u-u.js} +1 -1
- package/dist/assets/{row-BMPJJqEZ.js → row-CRiZ04yf.js} +1 -1
- package/dist/assets/{seedance-YJeq02mp.js → seedance-By8QP5W4.js} +1 -1
- package/dist/assets/{seedream-CC08j83p.js → seedream-B1AuDi4D.js} +1 -1
- package/dist/assets/{select-Dimm3cl1.js → select-Cuj6p07D.js} +1 -1
- package/dist/assets/{serp-CTs8RmbM.js → serp-ZjE1HNsO.js} +1 -1
- package/dist/assets/{slider-DmQjyRiW.js → slider-36NCuBFF.js} +1 -1
- package/dist/assets/{solana-wallets-Bqu9jRXB.js → solana-wallets-1TW9YMDn.js} +2 -2
- package/dist/assets/{solana-wallets-vue-DjANhE7q.js → solana-wallets-vue-Bz6DbYIE.js} +1 -1
- package/dist/assets/{sora-2-T3sx-Y.js → sora-BtwHt5RI.js} +1 -1
- package/dist/assets/{suno-ZdLhI-cJ.js → suno-DJhNnR0-.js} +1 -1
- package/dist/assets/{switch-D94Z7hOB.js → switch-DPhG4Kof.js} +1 -1
- package/dist/assets/{table-CKTQXDS9.js → table-HgG-qCHN.js} +1 -1
- package/dist/assets/{tabs-CoQ1qOZt.js → tabs-33ADAWzG.js} +1 -1
- package/dist/assets/{time-picker-B8u2NouX.js → time-picker-B1TAGeN6.js} +1 -1
- package/dist/assets/{tooltip-CRloPYoS.js → tooltip-DzdEJ1MO.js} +1 -1
- package/dist/assets/{upload-BQXdf3I1.js → upload-4mga_3De.js} +1 -1
- package/dist/assets/{veo-AOvqIips.js → veo-704uzv-f.js} +1 -1
- package/dist/assets/{wan-C0EjXerf.js → wan-DI6Q5Ow4.js} +1 -1
- package/dist/assets/{web-Bg7DToey.js → web-BBpUXcJL.js} +1 -1
- package/dist/assets/{web-GSeS6qM4.js → web-CJYBQ7MJ.js} +1 -1
- package/dist/assets/{web-Bey0K1H_.js → web-DGP6bUNY.js} +1 -1
- package/dist/assets/{web-CxtaLiec.js → web-Dcoe28BP.js} +1 -1
- package/dist/assets/{web-CP12_Eue.js → web-njjXKhfv.js} +1 -1
- package/dist/assets/{webextrator-BD3AJOUe.js → webextrator-Br0MherO.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/ScheduledTasks-BRGzfh-c.css +0 -1
- package/dist/assets/ScheduledTasks-CA_-ym45.js +0 -2
- package/dist/assets/esm-B2GYLCJK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{E as y}from"./use-deprecated-B-uvyrTL.js";import{r as b,t as x}from"./select-Dimm3cl1.js";import{n as S,t as C}from"./tabs-CoQ1qOZt.js";import{t as w}from"./upload-BQXdf3I1.js";import{t as T}from"./tooltip-CRloPYoS.js";import{t as E}from"./image-DdozYzas.js";import{t as ee}from"./alert-BfCyDcWO.js";import{n as D,r as O}from"./radio-Bj0tEwH8.js";import{t as k}from"./drawer-GII5N0kH.js";import{t as A}from"./input-number-BZftuN2C.js";import{t as te}from"./slider-DmQjyRiW.js";import{t as ne}from"./switch-D94Z7hOB.js";import{$r as re,Xr as ie,ei as ae,ti as j}from"./constants-BWAHKQ-e.js";import{G as M,Gi as N,Ii as P,Pi as oe,Ti as F,Tr as I,di as se,hn as L,in as R,mi as z,nn as B,nr as V,on as H,rn as ce,tn as U,wi as W}from"./index-m0B4VH-l.js";import{t as G}from"./index.es-DVFB1iVe.js";import{t as le}from"./CopyToClipboard-BQ2Ei1sV.js";import{t as ue}from"./FilePreview-BSviFDi1.js";import{t as K}from"./ImagePreview-DKkz6u_p.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as q}from"./Consumption-_nwRhH83.js";import{i as J,n as fe,t as pe}from"./pagination-OQ6Csuu1.js";import{t as me}from"./VideoPlayer-ikSJRkQv.js";import{t as he}from"./ApiCodeButton-B6ugqxDK.js";import{t as ge}from"./BotPlaceholder-DwMB-nyu.js";import{t as _e}from"./NoTasks-Q9DDa660.js";import{t as ve}from"./PromptTextarea-5oMvhem7.js";var ye=v({name:`LayoutKling`,components:{ElDrawer:k,ElButton:P,FontAwesomeIcon:G},mixins:[de]}),be={class:`main flex flex-row flex-1 min-h-0`},xe={class:`config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Se={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ce(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,be,[e(`div`,xe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Se,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var we=M(ye,[[`render`,Ce],[`__scopeId`,`data-v-b87958dc`]]),Te={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(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};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case`kling-video-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Te}}function X(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=Y(n,r,i),o=[];return 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`}),o}function Z(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);return n}var Ee=v({name:`ModelSelector`,components:{ElSelect:b,ElOption:x},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-video-o1`,label:`Video-o1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.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=Z({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),F.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})}}}),De={class:`field`},Oe={class:`title font-bold`};function ke(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,De,[e(`h2`,Oe,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 Ae=M(Ee,[[`render`,ke],[`__scopeId`,`data-v-04059875`]]),je=v({name:`ModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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 j.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=X(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.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=Z({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),F.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})}}}),Me={class:`field`},Ne={class:`header`},Pe={class:`title font-bold`},Fe={key:0,class:`opt-tip`};function Ie(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Me,[e(`div`,Ne,[e(`h2`,Pe,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`,Fe,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Le=M(je,[[`render`,Ie],[`__scopeId`,`data-v-9a8fa3c5`]]),Re=[3,5,8,10,12,15],ze=[5,10],Be=v({name:`DurationSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return j.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?Re:ze},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:{isV3Model(){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=X(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.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=Z({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),F.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})}}}),Ve={class:`field`},He={class:`control`},Ue={class:`label`},We={class:`title font-bold`};function Ge(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ve,[e(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`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 Ke=M(Be,[[`render`,Ge],[`__scopeId`,`data-v-5ae55e28`]]),qe=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`}}),Je={class:`text-sm font-bold mb-2 block`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Je,i(t.$t(`kling.name.ratio`)),1),e(`div`,Ye,[(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`,Ze,i(r.label),1)],10,Xe))),128))])])}var $e=M(qe,[[`render`,Qe],[`__scopeId`,`data-v-cdb14b2f`]]),et=v({name:`StartImage`,components:{ElUpload:w,ElButton:P,ElTooltip:T,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[R,B],emits:[`change`],data(){return{fileList:[],uploadUrl:z()+`/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(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){F.error(this.$t(`kling.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),tt={class:`relative`},nt={class:`flex justify-between`},rt={class:`flex justify-start items-center`},it={class:`text-sm font-bold`};function at(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`span`,it,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"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.fileList.splice(t.fileList.indexOf(e),1)},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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var ot=M(et,[[`render`,at],[`__scopeId`,`data-v-756dc269`]]),st=v({name:`EndImage`,components:{ElUpload:w,ElButton:P,ElTooltip:T,ImagePreview:K,InfoIcon:J,FontAwesomeIcon:G},mixins:[R,B],data(){return{fileList:[],uploadUrl:z()+`/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 Y(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(){return this.endImageSupported?this.hasStartImage?!0:(F.warning(this.$t(`kling.message.endImageRequiresStart`)),!1):(F.warning(this.$t(`kling.message.endImageNotSupported`)),!1)},onExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){F.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()}}}),ct={class:`relative`},lt={class:`flex justify-between`},ut={class:`flex justify-start items-center`},dt={class:`text-sm font-bold`};function ft(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`span`,dt,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.fileList.splice(t.fileList.indexOf(e),1)},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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),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 pt=M(st,[[`render`,ft],[`__scopeId`,`data-v-c1b257e5`]]),mt=v({name:`CfgScaleSelector`,components:{ElSlider:te,InfoIcon:J,ElInputNumber:A},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}}),ht={class:`flex justify-between`},gt={class:`flex justify-start items-center`},_t={class:`text-sm font-bold`},vt={class:`flex justify-end items-center`},yt={class:`w-full`};function bt(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`,ht,[e(`div`,gt,[e(`span`,_t,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,vt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,yt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var xt=M(mt,[[`render`,bt]]),St=v({name:`GenerateAudioSelector`,components:{ElSwitch:ne,InfoIcon:J},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(j.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})}}}),Ct={class:`relative`},wt={class:`flex justify-between items-center`},Tt={class:`flex justify-start items-center`},Et={class:`text-sm font-bold`};function Dt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ct,[e(`div`,wt,[e(`div`,Tt,[e(`span`,Et,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 Ot=M(St,[[`render`,Dt]]),kt=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],At=v({name:`CameraControlSelector`,components:{ElSelect:b,ElOption:x,ElSlider:te,ElInputNumber:A,InfoIcon:J},data(){return{configKeys:kt}},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 Y(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)}}}),jt={class:`field`},Mt={class:`header`},Nt={class:`text-sm font-bold`},Pt={key:0,class:`config-grid`},Ft={class:`cfg-row-head`},It={class:`cfg-name`};function Lt(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`,jt,[e(`div`,Mt,[e(`span`,Nt,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`,Pt,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Ft,[e(`span`,It,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 Rt=M(At,[[`render`,Lt],[`__scopeId`,`data-v-cd896060`]]),zt=[{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`]}],Q=`, `;function Bt(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Q}${t}`:t}function $(e,t){if(!e||!t)return e||``;let n=[`${t}${Q}`,`${Q}${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 Vt=v({name:`InspirationPills`,components:{FontAwesomeIcon:G},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return zt.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=$(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Ht={key:0,class:`pills`,role:`list`},Ut={class:`pill-text`},Wt=[`aria-label`,`onClick`];function Gt(n,r,u,d,f,p){let m=l(`font-awesome-icon`);return n.selected.length>0?(g(),s(`div`,Ht,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Ut,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{icon:`fa-solid fa-xmark`})],8,Wt)]))),128))])):o(``,!0)}var Kt=v({name:`PromptInput`,components:{ElButton:P,FontAwesomeIcon:G,PromptTextarea:ve,InspirationPills:M(Vt,[[`render`,Gt],[`__scopeId`,`data-v-5fc4fa65`]])},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 qt(e,t,n,o,s,c){let u=l(`font-awesome-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,{icon:`fa-regular fa-lightbulb`,class:`mr-1`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Jt=M(Kt,[[`render`,qt],[`__scopeId`,`data-v-c01fc1a6`]]),Yt=v({name:`NegativePromptInput`,components:{ElInput:N,InfoIcon:J},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||=``}}),Xt={class:`field`},Zt={class:`box`},Qt={class:`title font-bold`};function $t(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Xt,[e(`div`,Zt,[e(`h2`,Qt,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 en=M(Yt,[[`render`,$t],[`__scopeId`,`data-v-de98cf01`]]),tn=v({name:`InspirationDrawer`,components:{ElDrawer:k,ElButton:P,FontAwesomeIcon:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:zt,Close:y}},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($(this.prompt,e)):this.setPrompt(Bt(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=$(e,t);this.setPrompt(e)}}}),nn={class:`drawer-content`},rn={class:`drawer-header`},an={class:`title-row`},on={class:`title`},sn={class:`hint`},cn={key:0,class:`selected-bar`},ln={class:`selected-text`},un={class:`groups`},dn={class:`group-title`},fn={class:`chip-grid`},pn=[`onClick`];function mn(t,u,d,m,_,v){let y=l(`font-awesome-icon`),b=l(`el-button`),x=l(`el-drawer`);return g(),f(x,{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`,nn,[e(`div`,rn,[e(`div`,an,[a(y,{icon:`fa-regular fa-lightbulb`,class:`mr-2`}),e(`span`,on,i(t.$t(`kling.inspiration.title`)),1)]),a(b,{text:``,icon:t.Close,class:`close-btn`,onClick:u[0]||=e=>t.visible=!1},null,8,[`icon`])]),e(`div`,sn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cn,[e(`span`,ln,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(b,{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`,un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fn,[(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,pn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hn=M(tn,[[`render`,mn],[`__scopeId`,`data-v-7d457a69`]]),gn={"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-video-o1":`Video-o1`},_n={std:`720p`,pro:`1080p`,"4k":`4K`},vn=v({name:`SummaryChip`,components:{FontAwesomeIcon:G},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _n[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yn={class:`summary-chip`},bn=[`title`],xn=[`title`],Sn=[`title`],Cn=[`title`],wn=[`title`];function Tn(t,n,r,c,u,d){let f=l(`font-awesome-icon`);return g(),s(`div`,yn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,bn),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xn),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sn),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cn),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{icon:`fa-solid fa-headphones`})],8,wn)):o(``,!0)])}var En=v({name:`ConfigPanel`,components:{ElButton:P,Consumption:q,FontAwesomeIcon:G,PromptInput:Jt,NegativePromptInput:en,ModelSelector:Ae,ModeSelector:Le,DurationSelector:Ke,RatioSelector:$e,StartImage:ot,CfgScaleSelector:xt,GenerateAudioSelector:Ot,CameraControlSelector:Rt,InspirationDrawer:hn,SummaryChip:M(vn,[[`render`,Tn],[`__scopeId`,`data-v-418a6733`]]),EndImage:pt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return H(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Dn={class:`flex flex-col h-full`},On={class:`flex-1 overflow-y-auto p-5`},kn={class:`flex flex-col items-center justify-center px-5 pb-5`};function An(t,n,o,c,u,d){let m=l(`prompt-input`),h=l(`model-selector`),_=l(`ratio-selector`),v=l(`start-image`),y=l(`end-image`),b=l(`duration-selector`),x=l(`mode-selector`),S=l(`generate-audio-selector`),C=l(`camera-control-selector`),w=l(`cfg-scale-selector`),T=l(`negative-prompt-input`),E=l(`summary-chip`),ee=l(`consumption`),D=l(`font-awesome-icon`),O=l(`el-button`),k=l(`inspiration-drawer`);return g(),s(`div`,Dn,[e(`div`,On,[a(m,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-2`}),a(y,{class:`mb-2`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`})]),e(`div`,kn,[a(E),a(ee,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(O,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(O,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(k,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jn=M(En,[[`render`,An]]),Mn=v({name:`MotionImage`,components:{ElUpload:w,ElButton:P,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[R,B],data(){return{fileList:[],uploadUrl:z()+`/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(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){F.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()}}}),Nn={class:`relative`},Pn={class:`flex justify-between`},Fn={class:`flex justify-start items-center`},In={class:`text-sm font-bold`};function Ln(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Nn,[e(`div`,Pn,[e(`div`,Fn,[e(`span`,In,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,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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rn=M(Mn,[[`render`,Ln],[`__scopeId`,`data-v-e52eaf2f`]]),zn=v({name:`MotionVideo`,components:{ElUpload:w,ElButton:P,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[B],data(){return{fileList:[],uploadUrl:z()+`/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(){F.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){F.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:(F.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(F.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()}}}),Bn={class:`relative`},Vn={class:`flex justify-between`},Hn={class:`flex justify-start items-center`},Un={class:`text-sm font-bold`};function Wn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Bn,[e(`div`,Vn,[e(`div`,Hn,[e(`span`,Un,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{"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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gn=M(zn,[[`render`,Wn],[`__scopeId`,`data-v-7019a8d2`]]),Kn=v({name:`MotionPromptInput`,components:{ElInput:N,InfoIcon:J},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qn={class:`field`},Jn={class:`box`},Yn={class:`title font-bold`};function Xn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qn,[e(`div`,Jn,[e(`h2`,Yn,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 Zn=M(Kn,[[`render`,Xn],[`__scopeId`,`data-v-ca9fdbe5`]]),Qn=`video`,$n=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:O,ElRadioButton:D,InfoIcon:J},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qn},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=Qn)}}),er={class:`field`},tr={class:`header`},nr={class:`text-sm font-bold`};function rr(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`,er,[e(`div`,tr,[e(`span`,nr,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 ir=M($n,[[`render`,rr],[`__scopeId`,`data-v-7a91195b`]]),ar=`kling-v2-6`,or=v({name:`MotionModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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||ar},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=ar)}}),sr={class:`field`},cr={class:`header`},lr={class:`title font-bold`};function ur(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,sr,[e(`div`,cr,[e(`h2`,lr,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 dr=M(or,[[`render`,ur],[`__scopeId`,`data-v-480e8da2`]]),fr=`std`,pr=v({name:`MotionModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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||fr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fr)}}),mr={class:`field`},hr={class:`header`},gr={class:`title font-bold`};function _r(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mr,[e(`div`,hr,[e(`h2`,gr,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 vr=M(pr,[[`render`,_r],[`__scopeId`,`data-v-1295688c`]]),yr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:ne,InfoIcon:J},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`})}}}}),br={class:`relative`},xr={class:`flex justify-between items-center`},Sr={class:`flex justify-start items-center`},Cr={class:`text-sm font-bold`};function wr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,br,[e(`div`,xr,[e(`div`,Sr,[e(`span`,Cr,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 Tr=v({name:`MotionPanel`,components:{ElButton:P,FontAwesomeIcon:G,Consumption:q,MotionImage:Rn,MotionVideo:Gn,MotionPromptInput:Zn,CharacterOrientationSelector:ir,MotionModelSelector:dr,MotionModeSelector:vr,KeepOriginalSoundSelector:M(yr,[[`render`,wr]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return H({...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`)}}}),Er={class:`flex flex-col h-full`},Dr={class:`flex-1 overflow-y-auto p-5`},Or={class:`flex flex-col items-center justify-center px-5 pb-5`};function kr(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(`font-awesome-icon`),C=l(`el-button`);return g(),s(`div`,Er,[e(`div`,Dr,[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`,Or,[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,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ar=M(Tr,[[`render`,kr]]),jr=v({name:`KlingTabSwitcher`,components:{ElTabs:S,ElTabPane:C,ElTag:oe},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)}}}),Mr=[`title`],Nr={class:`text`};function Pr(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`,stretch:``,"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`,Nr,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,Mr)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fr=M(jr,[[`render`,Pr],[`__scopeId`,`data-v-fda33e4c`]]),Ir={"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`},Lr=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:b,ElOption:x},data(){return{options:ae.map(e=>({value:e,label:Ir[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=re)}}),Rr={class:`field`},zr={class:`title font-bold`};function Br(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Rr,[e(`h2`,zr,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 Vr=M(Lr,[[`render`,Br],[`__scopeId`,`data-v-cbc83d11`]]),Hr=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:b,ElOption:x},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`)}}),Ur={class:`field`},Wr={class:`title font-bold`};function Gr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ur,[e(`h2`,Wr,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 Kr=v({name:`TalkingPhotoPanel`,components:{ElUpload:w,ElButton:P,ElInput:N,FontAwesomeIcon:G,Consumption:q,InfoIcon:J,ImagePreview:K,ModelSelector:Vr,ModeSelector:M(Hr,[[`render`,Gr],[`__scopeId`,`data-v-92525a1d`]])},mixins:[B],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:z()+`/api/v1/files/`}},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 H({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)}},methods:{commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){F.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(){F.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){F.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`)}}}),qr={class:`flex flex-col h-full`},Jr={class:`flex-1 overflow-y-auto p-5`},Yr={class:`relative mb-4`},Xr={class:`flex justify-start items-center`},Zr={class:`text-sm font-bold`},Qr={class:`relative mb-4`},$r={class:`flex justify-start items-center`},ei={class:`text-sm font-bold`},ti=[`src`],ni={class:`mb-4`},ri={class:`flex justify-start items-center`},ii={class:`text-sm font-bold`},ai={class:`flex flex-col items-center justify-center px-5 pb-5`};function oi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`font-awesome-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`);return g(),s(`div`,qr,[e(`div`,Jr,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yr,[e(`div`,Xr,[e(`span`,Zr,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,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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qr,[e(`div`,$r,[e(`span`,ei,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,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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`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,ti)):o(``,!0)]),e(`div`,ni,[e(`div`,ri,[e(`span`,ii,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`,ai,[a(w,{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(b,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var si=M(Kr,[[`render`,oi],[`__scopeId`,`data-v-27261e35`]]),ci=v({name:`TaskPreview`,components:{ElImage:E,CopyToClipboard:le,FontAwesomeIcon:G,ElAlert:ee,VideoPlayer:me,ElTooltip:T,ElButton:P,ImagePreview:K,ApiCodeButton:he},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),e}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),li={class:`preview`},ui={class:`left`},di={class:`main`},fi={class:`bot`},pi={class:`datetime`},mi={class:`info`},hi={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},gi={key:1,class:`prompt mt-2`},_i={key:0},vi={key:1},yi={key:0,class:n({content:!0,failed:!0})},bi={key:0,class:`mb-4`},xi={key:1,class:n({operations:!0,"mt-2":!0})},Si={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ci={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ti={key:1,class:n({content:!0})},Ei={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Di={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ki={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ai={key:2,class:n({content:!0})},ji={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Ni(t,n,u,d,m,_){let v=l(`el-image`),y=l(`image-preview`),b=l(`video-player`),x=l(`el-button`),S=l(`el-tooltip`),C=l(`api-code-button`),w=l(`font-awesome-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`);return g(),s(`div`,li,[e(`div`,ui,[a(v,{src:`https://cdn.acedata.cloud/qpbbbb.jpg`,class:`avatar`})]),e(`div`,di,[e(`div`,fi,[r(i(t.$t(`kling.name.klingBot`))+` `,1),e(`span`,pi,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,mi,[t.referenceImages.length>0?(g(),s(`div`,hi,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:t,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,gi,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,_i,` - (`+i(t.$t(`kling.status.pending`))+`) `,1)),t.modelValue?.response?.state===`submitted`||t.modelValue?.response?.state===`processing`||t.modelValue?.response?.state===`pending`||t.modelValue?.response?.state===`completed`?(g(),s(`span`,vi,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,yi,[t.modelValue?.response.video_url?(g(),s(`div`,bi,[a(b,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,xi,[a(S,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(x,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:n[0]||=e=>t.onDownload(e,t.modelValue?.response.video_url)},{default:p(()=>[r(i(t.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(C,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Si,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,Ci,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,wi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===!1?(g(),s(`div`,Ti,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Ei,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,Di,[a(w,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(T,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,Oi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),t.modelValue?.response?.trace_id?(g(),s(`p`,ki,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,Ai,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,ji,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,Mi,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Pi=v({name:`RecentPanel`,components:{TaskPreview:M(ci,[[`render`,Ni],[`__scopeId`,`data-v-c36bfd7f`]]),NoTasks:_e,BotPlaceholder:ge,ScrollList:fe},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?.()}}}),Fi={key:0},Ii={key:2,class:`w-full h-full flex items-center justify-center`};function Li(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`,Fi,[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`,Ii,[a(v)])):o(``,!0)],64)}var Ri=v({name:`KlingIndex`,components:{ConfigPanel:jn,MotionPanel:Ar,TalkingPhotoPanel:si,TabSwitcher:Fr,Layout:we,RecentPanel:M(Pi,[[`render`,Li]])},mixins:[ce],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===se.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===se.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}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await pe({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})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!U(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0};if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){F.warning(this.$t(`kling.message.endImageRequiresStart`));return}if(n.action||(n.video_id||t.video_url?n.action=`extend`:n.start_image_url?n.action=`image2video`:n.action=`text2video`),n.action===`text2video`&&n.end_image_url&&delete n.end_image_url,e?.type&&(n.camera_control={type:e.type,...e.type===`simple`&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,e])=>e!=null))}:{}}),!L())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}F.info(this.$t(`kling.message.startingTask`)),I(`kling`,V.generate(n,{token:r})).then(()=>{F.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`kling.message.usedUp`)):F.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!U(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){F.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(!L())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}F.info(this.$t(`kling.message.startingTask`)),I(`kling`,V.motion(t,{token:n})).then(()=>{F.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`kling.message.usedUp`)):F.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!U(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){F.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t={image_url:e.image_url,audio_url:e.audio_url,model:e.model||`kling-v2-1-master`,mode:e.mode||`pro`,...e.prompt?{prompt:e.prompt}:{},...e.duration?{duration:e.duration}:{},async:!0};if(!L())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}F.info(this.$t(`kling.message.startingTask`)),I(`kling`,V.talkingPhoto(t,{token:n})).then(()=>{F.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`kling.message.usedUp`)):F.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),zi={class:`flex flex-col h-full`},Bi={class:`flex-1 min-h-0`};function Vi(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`,zi,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Bi,[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 Hi=M(Ri,[[`render`,Vi]]);export{Hi 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{E as y}from"./use-deprecated-B-uvyrTL.js";import{r as b,t as x}from"./select-Cuj6p07D.js";import{n as S,t as C}from"./tabs-33ADAWzG.js";import{t as w}from"./upload-4mga_3De.js";import{t as T}from"./tooltip-DzdEJ1MO.js";import{t as E}from"./image-B5YV0P5l.js";import{t as ee}from"./alert-CkdiVDlK.js";import{n as D,r as O}from"./radio-Bj0tEwH8.js";import{t as k}from"./drawer-hfiiHebG.js";import{t as A}from"./input-number-Y246MOpV.js";import{t as te}from"./slider-36NCuBFF.js";import{t as ne}from"./switch-DPhG4Kof.js";import{$r as re,Xr as ie,ei as ae,ti as j}from"./constants-BWqqQ28D.js";import{G as M,Gi as N,Ii as P,Pi as oe,Ti as F,Tr as I,di as se,hn as L,in as R,mi as z,nn as B,nr as V,on as H,rn as ce,tn as U,wi as W}from"./index-Dhzu5qf8.js";import{t as G}from"./index.es-CY4LWraT.js";import{t as le}from"./CopyToClipboard-BcbOejCl.js";import{t as ue}from"./FilePreview-dI4g5pKI.js";import{t as K}from"./ImagePreview-D7GhT3HH.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as q}from"./Consumption-BSGvXSjX.js";import{i as J,n as fe,t as pe}from"./pagination-4oRHR4z0.js";import{t as me}from"./VideoPlayer-Bdn8na6R.js";import{t as he}from"./ApiCodeButton-CZ1yg3gI.js";import{t as ge}from"./BotPlaceholder-2PPX3n_C.js";import{t as _e}from"./NoTasks-C8vWnK5o.js";import{t as ve}from"./PromptTextarea-CHyNTBsT.js";var ye=v({name:`LayoutKling`,components:{ElDrawer:k,ElButton:P,FontAwesomeIcon:G},mixins:[de]}),be={class:`main flex flex-row flex-1 min-h-0`},xe={class:`config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Se={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ce(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,be,[e(`div`,xe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Se,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var we=M(ye,[[`render`,Ce],[`__scopeId`,`data-v-b87958dc`]]),Te={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(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};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case`kling-video-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Te}}function X(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=Y(n,r,i),o=[];return 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`}),o}function Z(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);return n}var Ee=v({name:`ModelSelector`,components:{ElSelect:b,ElOption:x},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-video-o1`,label:`Video-o1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.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=Z({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),F.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})}}}),De={class:`field`},Oe={class:`title font-bold`};function ke(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,De,[e(`h2`,Oe,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 Ae=M(Ee,[[`render`,ke],[`__scopeId`,`data-v-04059875`]]),je=v({name:`ModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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 j.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=X(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.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=Z({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),F.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})}}}),Me={class:`field`},Ne={class:`header`},Pe={class:`title font-bold`},Fe={key:0,class:`opt-tip`};function Ie(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Me,[e(`div`,Ne,[e(`h2`,Pe,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`,Fe,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Le=M(je,[[`render`,Ie],[`__scopeId`,`data-v-9a8fa3c5`]]),Re=[3,5,8,10,12,15],ze=[5,10],Be=v({name:`DurationSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return j.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?Re:ze},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:{isV3Model(){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=X(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.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=Z({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),F.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})}}}),Ve={class:`field`},He={class:`control`},Ue={class:`label`},We={class:`title font-bold`};function Ge(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ve,[e(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`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 Ke=M(Be,[[`render`,Ge],[`__scopeId`,`data-v-5ae55e28`]]),qe=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`}}),Je={class:`text-sm font-bold mb-2 block`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Je,i(t.$t(`kling.name.ratio`)),1),e(`div`,Ye,[(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`,Ze,i(r.label),1)],10,Xe))),128))])])}var $e=M(qe,[[`render`,Qe],[`__scopeId`,`data-v-cdb14b2f`]]),et=v({name:`StartImage`,components:{ElUpload:w,ElButton:P,ElTooltip:T,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[R,B],emits:[`change`],data(){return{fileList:[],uploadUrl:z()+`/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(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){F.error(this.$t(`kling.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),tt={class:`relative`},nt={class:`flex justify-between`},rt={class:`flex justify-start items-center`},it={class:`text-sm font-bold`};function at(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`span`,it,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"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.fileList.splice(t.fileList.indexOf(e),1)},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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var ot=M(et,[[`render`,at],[`__scopeId`,`data-v-756dc269`]]),st=v({name:`EndImage`,components:{ElUpload:w,ElButton:P,ElTooltip:T,ImagePreview:K,InfoIcon:J,FontAwesomeIcon:G},mixins:[R,B],data(){return{fileList:[],uploadUrl:z()+`/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 Y(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(){return this.endImageSupported?this.hasStartImage?!0:(F.warning(this.$t(`kling.message.endImageRequiresStart`)),!1):(F.warning(this.$t(`kling.message.endImageNotSupported`)),!1)},onExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){F.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()}}}),ct={class:`relative`},lt={class:`flex justify-between`},ut={class:`flex justify-start items-center`},dt={class:`text-sm font-bold`};function ft(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`span`,dt,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.fileList.splice(t.fileList.indexOf(e),1)},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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),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 pt=M(st,[[`render`,ft],[`__scopeId`,`data-v-c1b257e5`]]),mt=v({name:`CfgScaleSelector`,components:{ElSlider:te,InfoIcon:J,ElInputNumber:A},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}}),ht={class:`flex justify-between`},gt={class:`flex justify-start items-center`},_t={class:`text-sm font-bold`},vt={class:`flex justify-end items-center`},yt={class:`w-full`};function bt(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`,ht,[e(`div`,gt,[e(`span`,_t,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,vt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,yt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var xt=M(mt,[[`render`,bt]]),St=v({name:`GenerateAudioSelector`,components:{ElSwitch:ne,InfoIcon:J},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(j.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})}}}),Ct={class:`relative`},wt={class:`flex justify-between items-center`},Tt={class:`flex justify-start items-center`},Et={class:`text-sm font-bold`};function Dt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ct,[e(`div`,wt,[e(`div`,Tt,[e(`span`,Et,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 Ot=M(St,[[`render`,Dt]]),kt=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],At=v({name:`CameraControlSelector`,components:{ElSelect:b,ElOption:x,ElSlider:te,ElInputNumber:A,InfoIcon:J},data(){return{configKeys:kt}},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 Y(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)}}}),jt={class:`field`},Mt={class:`header`},Nt={class:`text-sm font-bold`},Pt={key:0,class:`config-grid`},Ft={class:`cfg-row-head`},It={class:`cfg-name`};function Lt(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`,jt,[e(`div`,Mt,[e(`span`,Nt,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`,Pt,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Ft,[e(`span`,It,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 Rt=M(At,[[`render`,Lt],[`__scopeId`,`data-v-cd896060`]]),zt=[{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`]}],Q=`, `;function Bt(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Q}${t}`:t}function $(e,t){if(!e||!t)return e||``;let n=[`${t}${Q}`,`${Q}${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 Vt=v({name:`InspirationPills`,components:{FontAwesomeIcon:G},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return zt.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=$(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Ht={key:0,class:`pills`,role:`list`},Ut={class:`pill-text`},Wt=[`aria-label`,`onClick`];function Gt(n,r,u,d,f,p){let m=l(`font-awesome-icon`);return n.selected.length>0?(g(),s(`div`,Ht,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Ut,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{icon:`fa-solid fa-xmark`})],8,Wt)]))),128))])):o(``,!0)}var Kt=v({name:`PromptInput`,components:{ElButton:P,FontAwesomeIcon:G,PromptTextarea:ve,InspirationPills:M(Vt,[[`render`,Gt],[`__scopeId`,`data-v-5fc4fa65`]])},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 qt(e,t,n,o,s,c){let u=l(`font-awesome-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,{icon:`fa-regular fa-lightbulb`,class:`mr-1`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Jt=M(Kt,[[`render`,qt],[`__scopeId`,`data-v-c01fc1a6`]]),Yt=v({name:`NegativePromptInput`,components:{ElInput:N,InfoIcon:J},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||=``}}),Xt={class:`field`},Zt={class:`box`},Qt={class:`title font-bold`};function $t(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Xt,[e(`div`,Zt,[e(`h2`,Qt,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 en=M(Yt,[[`render`,$t],[`__scopeId`,`data-v-de98cf01`]]),tn=v({name:`InspirationDrawer`,components:{ElDrawer:k,ElButton:P,FontAwesomeIcon:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:zt,Close:y}},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($(this.prompt,e)):this.setPrompt(Bt(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=$(e,t);this.setPrompt(e)}}}),nn={class:`drawer-content`},rn={class:`drawer-header`},an={class:`title-row`},on={class:`title`},sn={class:`hint`},cn={key:0,class:`selected-bar`},ln={class:`selected-text`},un={class:`groups`},dn={class:`group-title`},fn={class:`chip-grid`},pn=[`onClick`];function mn(t,u,d,m,_,v){let y=l(`font-awesome-icon`),b=l(`el-button`),x=l(`el-drawer`);return g(),f(x,{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`,nn,[e(`div`,rn,[e(`div`,an,[a(y,{icon:`fa-regular fa-lightbulb`,class:`mr-2`}),e(`span`,on,i(t.$t(`kling.inspiration.title`)),1)]),a(b,{text:``,icon:t.Close,class:`close-btn`,onClick:u[0]||=e=>t.visible=!1},null,8,[`icon`])]),e(`div`,sn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cn,[e(`span`,ln,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(b,{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`,un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fn,[(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,pn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hn=M(tn,[[`render`,mn],[`__scopeId`,`data-v-7d457a69`]]),gn={"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-video-o1":`Video-o1`},_n={std:`720p`,pro:`1080p`,"4k":`4K`},vn=v({name:`SummaryChip`,components:{FontAwesomeIcon:G},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _n[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yn={class:`summary-chip`},bn=[`title`],xn=[`title`],Sn=[`title`],Cn=[`title`],wn=[`title`];function Tn(t,n,r,c,u,d){let f=l(`font-awesome-icon`);return g(),s(`div`,yn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,bn),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xn),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sn),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cn),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{icon:`fa-solid fa-headphones`})],8,wn)):o(``,!0)])}var En=v({name:`ConfigPanel`,components:{ElButton:P,Consumption:q,FontAwesomeIcon:G,PromptInput:Jt,NegativePromptInput:en,ModelSelector:Ae,ModeSelector:Le,DurationSelector:Ke,RatioSelector:$e,StartImage:ot,CfgScaleSelector:xt,GenerateAudioSelector:Ot,CameraControlSelector:Rt,InspirationDrawer:hn,SummaryChip:M(vn,[[`render`,Tn],[`__scopeId`,`data-v-418a6733`]]),EndImage:pt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return H(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Dn={class:`flex flex-col h-full`},On={class:`flex-1 overflow-y-auto p-5`},kn={class:`flex flex-col items-center justify-center px-5 pb-5`};function An(t,n,o,c,u,d){let m=l(`prompt-input`),h=l(`model-selector`),_=l(`ratio-selector`),v=l(`start-image`),y=l(`end-image`),b=l(`duration-selector`),x=l(`mode-selector`),S=l(`generate-audio-selector`),C=l(`camera-control-selector`),w=l(`cfg-scale-selector`),T=l(`negative-prompt-input`),E=l(`summary-chip`),ee=l(`consumption`),D=l(`font-awesome-icon`),O=l(`el-button`),k=l(`inspiration-drawer`);return g(),s(`div`,Dn,[e(`div`,On,[a(m,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-2`}),a(y,{class:`mb-2`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`})]),e(`div`,kn,[a(E),a(ee,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(O,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(O,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(k,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jn=M(En,[[`render`,An]]),Mn=v({name:`MotionImage`,components:{ElUpload:w,ElButton:P,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[R,B],data(){return{fileList:[],uploadUrl:z()+`/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(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){F.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()}}}),Nn={class:`relative`},Pn={class:`flex justify-between`},Fn={class:`flex justify-start items-center`},In={class:`text-sm font-bold`};function Ln(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Nn,[e(`div`,Pn,[e(`div`,Fn,[e(`span`,In,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,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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rn=M(Mn,[[`render`,Ln],[`__scopeId`,`data-v-e52eaf2f`]]),zn=v({name:`MotionVideo`,components:{ElUpload:w,ElButton:P,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[B],data(){return{fileList:[],uploadUrl:z()+`/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(){F.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){F.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:(F.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(F.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()}}}),Bn={class:`relative`},Vn={class:`flex justify-between`},Hn={class:`flex justify-start items-center`},Un={class:`text-sm font-bold`};function Wn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Bn,[e(`div`,Vn,[e(`div`,Hn,[e(`span`,Un,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{"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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gn=M(zn,[[`render`,Wn],[`__scopeId`,`data-v-7019a8d2`]]),Kn=v({name:`MotionPromptInput`,components:{ElInput:N,InfoIcon:J},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qn={class:`field`},Jn={class:`box`},Yn={class:`title font-bold`};function Xn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qn,[e(`div`,Jn,[e(`h2`,Yn,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 Zn=M(Kn,[[`render`,Xn],[`__scopeId`,`data-v-ca9fdbe5`]]),Qn=`video`,$n=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:O,ElRadioButton:D,InfoIcon:J},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qn},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=Qn)}}),er={class:`field`},tr={class:`header`},nr={class:`text-sm font-bold`};function rr(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`,er,[e(`div`,tr,[e(`span`,nr,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 ir=M($n,[[`render`,rr],[`__scopeId`,`data-v-7a91195b`]]),ar=`kling-v2-6`,or=v({name:`MotionModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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||ar},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=ar)}}),sr={class:`field`},cr={class:`header`},lr={class:`title font-bold`};function ur(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,sr,[e(`div`,cr,[e(`h2`,lr,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 dr=M(or,[[`render`,ur],[`__scopeId`,`data-v-480e8da2`]]),fr=`std`,pr=v({name:`MotionModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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||fr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fr)}}),mr={class:`field`},hr={class:`header`},gr={class:`title font-bold`};function _r(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mr,[e(`div`,hr,[e(`h2`,gr,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 vr=M(pr,[[`render`,_r],[`__scopeId`,`data-v-1295688c`]]),yr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:ne,InfoIcon:J},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`})}}}}),br={class:`relative`},xr={class:`flex justify-between items-center`},Sr={class:`flex justify-start items-center`},Cr={class:`text-sm font-bold`};function wr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,br,[e(`div`,xr,[e(`div`,Sr,[e(`span`,Cr,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 Tr=v({name:`MotionPanel`,components:{ElButton:P,FontAwesomeIcon:G,Consumption:q,MotionImage:Rn,MotionVideo:Gn,MotionPromptInput:Zn,CharacterOrientationSelector:ir,MotionModelSelector:dr,MotionModeSelector:vr,KeepOriginalSoundSelector:M(yr,[[`render`,wr]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return H({...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`)}}}),Er={class:`flex flex-col h-full`},Dr={class:`flex-1 overflow-y-auto p-5`},Or={class:`flex flex-col items-center justify-center px-5 pb-5`};function kr(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(`font-awesome-icon`),C=l(`el-button`);return g(),s(`div`,Er,[e(`div`,Dr,[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`,Or,[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,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ar=M(Tr,[[`render`,kr]]),jr=v({name:`KlingTabSwitcher`,components:{ElTabs:S,ElTabPane:C,ElTag:oe},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)}}}),Mr=[`title`],Nr={class:`text`};function Pr(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`,stretch:``,"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`,Nr,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,Mr)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fr=M(jr,[[`render`,Pr],[`__scopeId`,`data-v-fda33e4c`]]),Ir={"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`},Lr=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:b,ElOption:x},data(){return{options:ae.map(e=>({value:e,label:Ir[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=re)}}),Rr={class:`field`},zr={class:`title font-bold`};function Br(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Rr,[e(`h2`,zr,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 Vr=M(Lr,[[`render`,Br],[`__scopeId`,`data-v-cbc83d11`]]),Hr=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:b,ElOption:x},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`)}}),Ur={class:`field`},Wr={class:`title font-bold`};function Gr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ur,[e(`h2`,Wr,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 Kr=v({name:`TalkingPhotoPanel`,components:{ElUpload:w,ElButton:P,ElInput:N,FontAwesomeIcon:G,Consumption:q,InfoIcon:J,ImagePreview:K,ModelSelector:Vr,ModeSelector:M(Hr,[[`render`,Gr],[`__scopeId`,`data-v-92525a1d`]])},mixins:[B],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:z()+`/api/v1/files/`}},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 H({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)}},methods:{commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){F.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(){F.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){F.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`)}}}),qr={class:`flex flex-col h-full`},Jr={class:`flex-1 overflow-y-auto p-5`},Yr={class:`relative mb-4`},Xr={class:`flex justify-start items-center`},Zr={class:`text-sm font-bold`},Qr={class:`relative mb-4`},$r={class:`flex justify-start items-center`},ei={class:`text-sm font-bold`},ti=[`src`],ni={class:`mb-4`},ri={class:`flex justify-start items-center`},ii={class:`text-sm font-bold`},ai={class:`flex flex-col items-center justify-center px-5 pb-5`};function oi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`font-awesome-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`);return g(),s(`div`,qr,[e(`div`,Jr,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yr,[e(`div`,Xr,[e(`span`,Zr,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,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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qr,[e(`div`,$r,[e(`span`,ei,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,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,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`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,ti)):o(``,!0)]),e(`div`,ni,[e(`div`,ri,[e(`span`,ii,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`,ai,[a(w,{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(b,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var si=M(Kr,[[`render`,oi],[`__scopeId`,`data-v-27261e35`]]),ci=v({name:`TaskPreview`,components:{ElImage:E,CopyToClipboard:le,FontAwesomeIcon:G,ElAlert:ee,VideoPlayer:me,ElTooltip:T,ElButton:P,ImagePreview:K,ApiCodeButton:he},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),e}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),li={class:`preview`},ui={class:`left`},di={class:`main`},fi={class:`bot`},pi={class:`datetime`},mi={class:`info`},hi={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},gi={key:1,class:`prompt mt-2`},_i={key:0},vi={key:1},yi={key:0,class:n({content:!0,failed:!0})},bi={key:0,class:`mb-4`},xi={key:1,class:n({operations:!0,"mt-2":!0})},Si={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ci={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ti={key:1,class:n({content:!0})},Ei={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Di={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ki={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ai={key:2,class:n({content:!0})},ji={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Ni(t,n,u,d,m,_){let v=l(`el-image`),y=l(`image-preview`),b=l(`video-player`),x=l(`el-button`),S=l(`el-tooltip`),C=l(`api-code-button`),w=l(`font-awesome-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`);return g(),s(`div`,li,[e(`div`,ui,[a(v,{src:`https://cdn.acedata.cloud/qpbbbb.jpg`,class:`avatar`})]),e(`div`,di,[e(`div`,fi,[r(i(t.$t(`kling.name.klingBot`))+` `,1),e(`span`,pi,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,mi,[t.referenceImages.length>0?(g(),s(`div`,hi,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:t,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,gi,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,_i,` - (`+i(t.$t(`kling.status.pending`))+`) `,1)),t.modelValue?.response?.state===`submitted`||t.modelValue?.response?.state===`processing`||t.modelValue?.response?.state===`pending`||t.modelValue?.response?.state===`completed`?(g(),s(`span`,vi,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,yi,[t.modelValue?.response.video_url?(g(),s(`div`,bi,[a(b,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,xi,[a(S,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(x,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:n[0]||=e=>t.onDownload(e,t.modelValue?.response.video_url)},{default:p(()=>[r(i(t.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(C,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Si,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,Ci,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,wi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===!1?(g(),s(`div`,Ti,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Ei,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,Di,[a(w,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(T,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,Oi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),t.modelValue?.response?.trace_id?(g(),s(`p`,ki,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,Ai,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,ji,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,Mi,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Pi=v({name:`RecentPanel`,components:{TaskPreview:M(ci,[[`render`,Ni],[`__scopeId`,`data-v-c36bfd7f`]]),NoTasks:_e,BotPlaceholder:ge,ScrollList:fe},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?.()}}}),Fi={key:0},Ii={key:2,class:`w-full h-full flex items-center justify-center`};function Li(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`,Fi,[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`,Ii,[a(v)])):o(``,!0)],64)}var Ri=v({name:`KlingIndex`,components:{ConfigPanel:jn,MotionPanel:Ar,TalkingPhotoPanel:si,TabSwitcher:Fr,Layout:we,RecentPanel:M(Pi,[[`render`,Li]])},mixins:[ce],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===se.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===se.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}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await pe({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})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!U(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0};if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){F.warning(this.$t(`kling.message.endImageRequiresStart`));return}if(n.action||(n.video_id||t.video_url?n.action=`extend`:n.start_image_url?n.action=`image2video`:n.action=`text2video`),n.action===`text2video`&&n.end_image_url&&delete n.end_image_url,e?.type&&(n.camera_control={type:e.type,...e.type===`simple`&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,e])=>e!=null))}:{}}),!L())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}F.info(this.$t(`kling.message.startingTask`)),I(`kling`,V.generate(n,{token:r})).then(()=>{F.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`kling.message.usedUp`)):F.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!U(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){F.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(!L())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}F.info(this.$t(`kling.message.startingTask`)),I(`kling`,V.motion(t,{token:n})).then(()=>{F.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`kling.message.usedUp`)):F.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!U(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){F.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t={image_url:e.image_url,audio_url:e.audio_url,model:e.model||`kling-v2-1-master`,mode:e.mode||`pro`,...e.prompt?{prompt:e.prompt}:{},...e.duration?{duration:e.duration}:{},async:!0};if(!L())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}F.info(this.$t(`kling.message.startingTask`)),I(`kling`,V.talkingPhoto(t,{token:n})).then(()=>{F.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`kling.message.usedUp`)):F.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),zi={class:`flex flex-col h-full`},Bi={class:`flex-1 min-h-0`};function Vi(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`,zi,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Bi,[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 Hi=M(Ri,[[`render`,Vi]]);export{Hi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,T as o,at as s,j as ee,mt as c,rt as l,tt as u,z as d}from"./vendor-chart-Dw-P17PN.js";import{t as f}from"./image-DdozYzas.js";import{t as te}from"./card-D-4S-l7a.js";import{n as p,t as m}from"./row-BMPJJqEZ.js";import{G as ne,Ii as h}from"./index-m0B4VH-l.js";import{t as g}from"./index.es-DVFB1iVe.js";var _=[{key:`chat`,titleKey:`index.title.chat`,subtitleKey:`index.subtitle.chat`,icon:`fa-regular fa-comment`,features:[[`chatgpt`,`/chatgpt`]]},{key:`image`,titleKey:`index.title.midjourney`,subtitleKey:`index.subtitle.midjourney`,icon:`fa-solid fa-palette`,features:[[`midjourney`,`/midjourney`],[`nanobanana`,`/nanobanana`],[`seedream`,`/seedream`],[`flux`,`/flux`],[`openaiimage`,`/openai-image`],[`qrart`,`/qrart`]]},{key:`music`,titleKey:`index.title.suno`,subtitleKey:`index.subtitle.suno`,icon:`fa-solid fa-music`,features:[[`suno`,`/suno`],[`producer`,`/producer`]]},{key:`video`,titleKey:`index.title.luma`,subtitleKey:`index.subtitle.luma`,icon:`fa-solid fa-film`,features:[[`luma`,`/luma`],[`veo`,`/veo`],[`sora`,`/sora`],[`kling`,`/kling`],[`hailuo`,`/hailuo`],[`seedance`,`/seedance`]]}],v=d({name:`Index`,components:{ElButton:h,ElRow:m,ElCol:p,ElCard:te,ElImage:f,FontAwesomeIcon:g},data(){return{comments:[{avatar:`https://cdn.acedata.cloud/avatar1.png`,name:this.$t(`index.customers.name1`),job:this.$t(`index.customers.job1`),content:this.$t(`index.customers.comment1`)},{avatar:`https://cdn.acedata.cloud/avatar2.png`,name:this.$t(`index.customers.name2`),job:this.$t(`index.customers.job2`),content:this.$t(`index.customers.comment2`)},{avatar:`https://cdn.acedata.cloud/avatar3.png`,name:this.$t(`index.customers.name3`),job:this.$t(`index.customers.job3`),content:this.$t(`index.customers.comment3`)}],models:[`ChatGPT`,`Claude`,`Gemini`,`Grok`,`DeepSeek`,`Kimi`,`Midjourney`,`Flux`,`Nano Banana`,`Seedream`,`GPT Image`,`Suno`,`Veo`,`Sora`,`Kling`,`Luma`,`Hailuo`,`Seedance`]}},computed:{site(){return this.$store.state.site},capabilities(){let e=this.site?.features??{},t=[];for(let n of _){let r=n.features.find(([t])=>e[t]?.enabled);r&&t.push({key:n.key,title:this.$t(n.titleKey),subtitle:this.$t(n.subtitleKey),icon:n.icon,path:r[1]})}return t},primaryPath(){return this.capabilities[0]?.path??`/chatgpt`}},methods:{onClickCapability(e){this.$router.push(e.path)},onStart(){this.$router.push({path:this.primaryPath})},scrollToServices(){document.getElementById(`introduction`)?.scrollIntoView({behavior:`smooth`,block:`start`})}}}),y={class:`wrapper`},b={id:`banner`},x={class:`container`},S={class:`info`},C={class:`badge-new`},w={class:`title`},T={class:`subtitle`},E={class:`tagline`},D={class:`operations`},O={id:`introduction`},k={class:`container`},A={class:`title`},j={class:`subtitle`},M={class:`icon-wrapper`},N={class:`title`},P={class:`subtitle`},F={key:0,id:`chat`,class:`block`},I={class:`container`},L=[`alt`],R={class:`title`},z={class:`subtitle`},B={key:1,id:`midjourney`,class:`block`},V={class:`container`},H={class:`title`},U={class:`subtitle`},W=[`alt`],re={key:2,id:`qrart`,class:`block`},G={class:`container`},K=[`alt`],q={class:`title`},J={class:`subtitle`},Y={key:3,id:`suno`,class:`block`},X={class:`container`},ie={class:`title`},ae={class:`subtitle`},oe=[`alt`],se={key:4,id:`luma`,class:`block`},ce={class:`container`},le=[`alt`],ue={class:`title`},de={class:`subtitle`},fe={key:5,id:`headshots`,class:`block`},pe={class:`container`},me={class:`title`},he={class:`subtitle`},Z=[`alt`],ge={id:`models`,class:`models`},_e={class:`container`},ve={class:`section-title`},ye={class:`section-subtitle`},be={class:`model-wall`},xe={id:`cta`,class:`cta`},Se={class:`container`},Ce={class:`cta__title`},we={class:`cta__subtitle`};function Q(d,f,te,p,m,ne){let h=s(`el-button`),g=s(`el-col`),_=s(`el-image`),v=s(`el-row`),Q=s(`font-awesome-icon`),$=s(`el-card`);return u(),a(`div`,y,[e(`div`,b,[e(`div`,x,[r(v,null,{default:c(()=>[r(g,{md:12,xs:24,class:`left`},{default:c(()=>[e(`div`,S,[e(`span`,C,n(d.$t(`index.badge.hero`)),1),e(`h1`,w,n(d.site?.title),1),e(`h3`,T,n(d.$t(`index.subtitle.banner`)),1),e(`p`,E,n(d.$t(`index.subtitle.hero`)),1),e(`div`,D,[r(h,{type:`primary`,round:``,class:`btn-apply`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),r(h,{round:``,class:`btn-explore`,onClick:d.scrollToServices},{default:c(()=>[t(n(d.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])])])]),_:1}),r(g,{md:12,xs:24,class:`right`},{default:c(()=>[r(_,{src:`https://cdn.acedata.cloud/illustration1.png`,class:`brand`,alt:d.site?.title,fit:`contain`},null,8,[`alt`])]),_:1})]),_:1})])]),e(`div`,O,[e(`div`,k,[r(v,{class:`mb-6`},{default:c(()=>[r(g,{span:24},{default:c(()=>[e(`h2`,A,n(d.$t(`index.title.introduction`)),1),e(`h5`,j,n(d.$t(`index.subtitle.introduction`)),1)]),_:1})]),_:1}),r(v,{gutter:15},{default:c(()=>[(u(!0),a(o,null,l(d.capabilities,(t,i)=>(u(),ee(g,{key:i,md:6,xs:24,class:`mb-4`},{default:c(()=>[r($,{class:`info text-center`,shadow:`hover`,onClick:e=>d.onClickCapability(t)},{default:c(()=>[e(`div`,M,[r(Q,{icon:t.icon,class:`icon`},null,8,[`icon`])]),e(`h2`,N,n(t.title),1),e(`p`,P,n(t.subtitle),1)]),_:2},1032,[`onClick`])]),_:2},1024))),128))]),_:1})])]),d.site?.features?.chatgpt?.enabled?(u(),a(`div`,F,[e(`div`,I,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/axynds.png`,class:`image desktop`,alt:d.$t(`index.title.chat`),loading:`lazy`,decoding:`async`},null,8,L),f[6]||=e(`img`,{src:`https://cdn.acedata.cloud/vds4i3.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,R,n(d.$t(`index.title.chat`)),1),e(`p`,z,n(d.$t(`index.subtitle.chat`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[0]||=e=>d.$router.push({path:`/chatgpt`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.midjourney?.enabled?(u(),a(`div`,B,[e(`div`,V,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,H,n(d.$t(`index.title.midjourney`)),1),e(`p`,U,n(d.$t(`index.subtitle.midjourney`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[1]||=e=>d.$router.push({path:`/midjourney`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/uk86mz.png`,class:`image desktop`,alt:d.$t(`index.title.midjourney`),loading:`lazy`,decoding:`async`},null,8,W),f[7]||=e(`img`,{src:`https://cdn.acedata.cloud/rvelwm.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.qrart?.enabled?(u(),a(`div`,re,[e(`div`,G,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/gyogar.png`,class:`image desktop`,alt:d.$t(`index.title.qrart`),loading:`lazy`,decoding:`async`},null,8,K),f[8]||=e(`img`,{src:`https://cdn.acedata.cloud/5kunm0.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,q,n(d.$t(`index.title.qrart`)),1),e(`p`,J,n(d.$t(`index.subtitle.qrart`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[2]||=e=>d.$router.push({path:`/qrart`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.suno?.enabled?(u(),a(`div`,Y,[e(`div`,X,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ie,n(d.$t(`index.title.suno`)),1),e(`p`,ae,n(d.$t(`index.subtitle.suno`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[3]||=e=>d.$router.push({path:`/suno`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/2m8fn.png`,class:`image desktop`,alt:d.$t(`index.title.suno`),loading:`lazy`,decoding:`async`},null,8,oe),f[9]||=e(`img`,{src:`https://cdn.acedata.cloud/23knvs.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.luma?.enabled?(u(),a(`div`,se,[e(`div`,ce,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/6kop1g.png`,class:`image desktop`,alt:d.$t(`index.title.luma`),loading:`lazy`,decoding:`async`},null,8,le),f[10]||=e(`img`,{src:`https://cdn.acedata.cloud/3kcjny.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ue,n(d.$t(`index.title.luma`)),1),e(`p`,de,n(d.$t(`index.subtitle.luma`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[4]||=e=>d.$router.push({path:`/luma`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.headshots?.enabled?(u(),a(`div`,fe,[e(`div`,pe,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,me,n(d.$t(`index.title.headshots`)),1),e(`p`,he,n(d.$t(`index.subtitle.headshots`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[5]||=e=>d.$router.push({path:`/headshots`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/zlyshj.png`,class:`image desktop`,alt:d.$t(`index.title.headshots`),loading:`lazy`,decoding:`async`},null,8,Z),f[11]||=e(`img`,{src:`https://cdn.acedata.cloud/8as0cx.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),i(``,!0),e(`div`,ge,[e(`div`,_e,[e(`h2`,ve,n(d.$t(`index.title.models`)),1),e(`h5`,ye,n(d.$t(`index.subtitle.models`)),1),e(`div`,be,[(u(!0),a(o,null,l(d.models,(e,t)=>(u(),a(`span`,{key:t,class:`model-chip`},n(e),1))),128))])])]),e(`div`,xe,[e(`div`,Se,[e(`h2`,Ce,n(d.$t(`index.title.cta`)),1),e(`p`,we,n(d.$t(`index.subtitle.cta`)),1),r(h,{type:`primary`,round:``,class:`cta__btn`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`])])])])}var $=ne(v,[[`render`,Q],[`__scopeId`,`data-v-2699cde4`]]);export{$ as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,T as o,at as s,j as ee,mt as c,rt as l,tt as u,z as d}from"./vendor-chart-Dw-P17PN.js";import{t as f}from"./image-B5YV0P5l.js";import{t as te}from"./card-D-4S-l7a.js";import{n as p,t as m}from"./row-CRiZ04yf.js";import{G as ne,Ii as h}from"./index-Dhzu5qf8.js";import{t as g}from"./index.es-CY4LWraT.js";var _=[{key:`chat`,titleKey:`index.title.chat`,subtitleKey:`index.subtitle.chat`,icon:`fa-regular fa-comment`,features:[[`chatgpt`,`/chatgpt`]]},{key:`image`,titleKey:`index.title.midjourney`,subtitleKey:`index.subtitle.midjourney`,icon:`fa-solid fa-palette`,features:[[`midjourney`,`/midjourney`],[`nanobanana`,`/nanobanana`],[`seedream`,`/seedream`],[`flux`,`/flux`],[`openaiimage`,`/openai-image`],[`qrart`,`/qrart`]]},{key:`music`,titleKey:`index.title.suno`,subtitleKey:`index.subtitle.suno`,icon:`fa-solid fa-music`,features:[[`suno`,`/suno`],[`producer`,`/producer`]]},{key:`video`,titleKey:`index.title.luma`,subtitleKey:`index.subtitle.luma`,icon:`fa-solid fa-film`,features:[[`luma`,`/luma`],[`veo`,`/veo`],[`sora`,`/sora`],[`kling`,`/kling`],[`hailuo`,`/hailuo`],[`seedance`,`/seedance`]]}],v=d({name:`Index`,components:{ElButton:h,ElRow:m,ElCol:p,ElCard:te,ElImage:f,FontAwesomeIcon:g},data(){return{comments:[{avatar:`https://cdn.acedata.cloud/avatar1.png`,name:this.$t(`index.customers.name1`),job:this.$t(`index.customers.job1`),content:this.$t(`index.customers.comment1`)},{avatar:`https://cdn.acedata.cloud/avatar2.png`,name:this.$t(`index.customers.name2`),job:this.$t(`index.customers.job2`),content:this.$t(`index.customers.comment2`)},{avatar:`https://cdn.acedata.cloud/avatar3.png`,name:this.$t(`index.customers.name3`),job:this.$t(`index.customers.job3`),content:this.$t(`index.customers.comment3`)}],models:[`ChatGPT`,`Claude`,`Gemini`,`Grok`,`DeepSeek`,`Kimi`,`Midjourney`,`Flux`,`Nano Banana`,`Seedream`,`GPT Image`,`Suno`,`Veo`,`Sora`,`Kling`,`Luma`,`Hailuo`,`Seedance`]}},computed:{site(){return this.$store.state.site},capabilities(){let e=this.site?.features??{},t=[];for(let n of _){let r=n.features.find(([t])=>e[t]?.enabled);r&&t.push({key:n.key,title:this.$t(n.titleKey),subtitle:this.$t(n.subtitleKey),icon:n.icon,path:r[1]})}return t},primaryPath(){return this.capabilities[0]?.path??`/chatgpt`}},methods:{onClickCapability(e){this.$router.push(e.path)},onStart(){this.$router.push({path:this.primaryPath})},scrollToServices(){document.getElementById(`introduction`)?.scrollIntoView({behavior:`smooth`,block:`start`})}}}),y={class:`wrapper`},b={id:`banner`},x={class:`container`},S={class:`info`},C={class:`badge-new`},w={class:`title`},T={class:`subtitle`},E={class:`tagline`},D={class:`operations`},O={id:`introduction`},k={class:`container`},A={class:`title`},j={class:`subtitle`},M={class:`icon-wrapper`},N={class:`title`},P={class:`subtitle`},F={key:0,id:`chat`,class:`block`},I={class:`container`},L=[`alt`],R={class:`title`},z={class:`subtitle`},B={key:1,id:`midjourney`,class:`block`},V={class:`container`},H={class:`title`},U={class:`subtitle`},W=[`alt`],re={key:2,id:`qrart`,class:`block`},G={class:`container`},K=[`alt`],q={class:`title`},J={class:`subtitle`},Y={key:3,id:`suno`,class:`block`},X={class:`container`},ie={class:`title`},ae={class:`subtitle`},oe=[`alt`],se={key:4,id:`luma`,class:`block`},ce={class:`container`},le=[`alt`],ue={class:`title`},de={class:`subtitle`},fe={key:5,id:`headshots`,class:`block`},pe={class:`container`},me={class:`title`},he={class:`subtitle`},Z=[`alt`],ge={id:`models`,class:`models`},_e={class:`container`},ve={class:`section-title`},ye={class:`section-subtitle`},be={class:`model-wall`},xe={id:`cta`,class:`cta`},Se={class:`container`},Ce={class:`cta__title`},we={class:`cta__subtitle`};function Q(d,f,te,p,m,ne){let h=s(`el-button`),g=s(`el-col`),_=s(`el-image`),v=s(`el-row`),Q=s(`font-awesome-icon`),$=s(`el-card`);return u(),a(`div`,y,[e(`div`,b,[e(`div`,x,[r(v,null,{default:c(()=>[r(g,{md:12,xs:24,class:`left`},{default:c(()=>[e(`div`,S,[e(`span`,C,n(d.$t(`index.badge.hero`)),1),e(`h1`,w,n(d.site?.title),1),e(`h3`,T,n(d.$t(`index.subtitle.banner`)),1),e(`p`,E,n(d.$t(`index.subtitle.hero`)),1),e(`div`,D,[r(h,{type:`primary`,round:``,class:`btn-apply`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),r(h,{round:``,class:`btn-explore`,onClick:d.scrollToServices},{default:c(()=>[t(n(d.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])])])]),_:1}),r(g,{md:12,xs:24,class:`right`},{default:c(()=>[r(_,{src:`https://cdn.acedata.cloud/illustration1.png`,class:`brand`,alt:d.site?.title,fit:`contain`},null,8,[`alt`])]),_:1})]),_:1})])]),e(`div`,O,[e(`div`,k,[r(v,{class:`mb-6`},{default:c(()=>[r(g,{span:24},{default:c(()=>[e(`h2`,A,n(d.$t(`index.title.introduction`)),1),e(`h5`,j,n(d.$t(`index.subtitle.introduction`)),1)]),_:1})]),_:1}),r(v,{gutter:15},{default:c(()=>[(u(!0),a(o,null,l(d.capabilities,(t,i)=>(u(),ee(g,{key:i,md:6,xs:24,class:`mb-4`},{default:c(()=>[r($,{class:`info text-center`,shadow:`hover`,onClick:e=>d.onClickCapability(t)},{default:c(()=>[e(`div`,M,[r(Q,{icon:t.icon,class:`icon`},null,8,[`icon`])]),e(`h2`,N,n(t.title),1),e(`p`,P,n(t.subtitle),1)]),_:2},1032,[`onClick`])]),_:2},1024))),128))]),_:1})])]),d.site?.features?.chatgpt?.enabled?(u(),a(`div`,F,[e(`div`,I,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/axynds.png`,class:`image desktop`,alt:d.$t(`index.title.chat`),loading:`lazy`,decoding:`async`},null,8,L),f[6]||=e(`img`,{src:`https://cdn.acedata.cloud/vds4i3.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,R,n(d.$t(`index.title.chat`)),1),e(`p`,z,n(d.$t(`index.subtitle.chat`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[0]||=e=>d.$router.push({path:`/chatgpt`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.midjourney?.enabled?(u(),a(`div`,B,[e(`div`,V,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,H,n(d.$t(`index.title.midjourney`)),1),e(`p`,U,n(d.$t(`index.subtitle.midjourney`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[1]||=e=>d.$router.push({path:`/midjourney`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/uk86mz.png`,class:`image desktop`,alt:d.$t(`index.title.midjourney`),loading:`lazy`,decoding:`async`},null,8,W),f[7]||=e(`img`,{src:`https://cdn.acedata.cloud/rvelwm.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.qrart?.enabled?(u(),a(`div`,re,[e(`div`,G,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/gyogar.png`,class:`image desktop`,alt:d.$t(`index.title.qrart`),loading:`lazy`,decoding:`async`},null,8,K),f[8]||=e(`img`,{src:`https://cdn.acedata.cloud/5kunm0.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,q,n(d.$t(`index.title.qrart`)),1),e(`p`,J,n(d.$t(`index.subtitle.qrart`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[2]||=e=>d.$router.push({path:`/qrart`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.suno?.enabled?(u(),a(`div`,Y,[e(`div`,X,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ie,n(d.$t(`index.title.suno`)),1),e(`p`,ae,n(d.$t(`index.subtitle.suno`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[3]||=e=>d.$router.push({path:`/suno`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/2m8fn.png`,class:`image desktop`,alt:d.$t(`index.title.suno`),loading:`lazy`,decoding:`async`},null,8,oe),f[9]||=e(`img`,{src:`https://cdn.acedata.cloud/23knvs.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.luma?.enabled?(u(),a(`div`,se,[e(`div`,ce,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/6kop1g.png`,class:`image desktop`,alt:d.$t(`index.title.luma`),loading:`lazy`,decoding:`async`},null,8,le),f[10]||=e(`img`,{src:`https://cdn.acedata.cloud/3kcjny.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ue,n(d.$t(`index.title.luma`)),1),e(`p`,de,n(d.$t(`index.subtitle.luma`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[4]||=e=>d.$router.push({path:`/luma`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.headshots?.enabled?(u(),a(`div`,fe,[e(`div`,pe,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,me,n(d.$t(`index.title.headshots`)),1),e(`p`,he,n(d.$t(`index.subtitle.headshots`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[5]||=e=>d.$router.push({path:`/headshots`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/zlyshj.png`,class:`image desktop`,alt:d.$t(`index.title.headshots`),loading:`lazy`,decoding:`async`},null,8,Z),f[11]||=e(`img`,{src:`https://cdn.acedata.cloud/8as0cx.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),i(``,!0),e(`div`,ge,[e(`div`,_e,[e(`h2`,ve,n(d.$t(`index.title.models`)),1),e(`h5`,ye,n(d.$t(`index.subtitle.models`)),1),e(`div`,be,[(u(!0),a(o,null,l(d.models,(e,t)=>(u(),a(`span`,{key:t,class:`model-chip`},n(e),1))),128))])])]),e(`div`,xe,[e(`div`,Se,[e(`h2`,Ce,n(d.$t(`index.title.cta`)),1),e(`p`,we,n(d.$t(`index.subtitle.cta`)),1),r(h,{type:`primary`,round:``,class:`cta__btn`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`])])])])}var $=ne(v,[[`render`,Q],[`__scopeId`,`data-v-2699cde4`]]);export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-Dimm3cl1.js";import{t as x}from"./upload-BQXdf3I1.js";import{t as S}from"./tooltip-CRloPYoS.js";import{t as C}from"./image-DdozYzas.js";import{t as w}from"./alert-BfCyDcWO.js";import{t as T}from"./drawer-GII5N0kH.js";import{t as E}from"./input-number-BZftuN2C.js";import{t as D}from"./switch-D94Z7hOB.js";import{_n as O,an as k,cn as A,dn as j,fn as M,gn as ee,in as te,ln as N,mn as P,pn as ne,sn as F,un as I}from"./constants-BWAHKQ-e.js";import{G as L,Ii as R,Rn as re,Ti as z,Tr as ie,di as B,hn as V,in as H,mi as U,nn as W,on as G,rn as K,tn as q,wi as J}from"./index-m0B4VH-l.js";import{t as Y}from"./index.es-DVFB1iVe.js";import{t as ae}from"./CopyToClipboard-BQ2Ei1sV.js";import{t as X}from"./ImagePreview-DKkz6u_p.js";import{n as oe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as se}from"./Consumption-_nwRhH83.js";import{i as Z,n as ce,t as le}from"./pagination-OQ6Csuu1.js";import{t as ue}from"./ApiCodeButton-B6ugqxDK.js";import{t as de}from"./BotPlaceholder-DwMB-nyu.js";import{t as fe}from"./NoTasks-Q9DDa660.js";import{t as pe}from"./PromptTextarea-5oMvhem7.js";import{t as me}from"./ImageWrapper-BRTUYofN.js";var he=_({name:`LayoutSeedream`,components:{ElDrawer:T,ElButton:R,FontAwesomeIcon:Y},mixins:[oe]}),ge={class:`main flex flex-row flex-1`},_e={class:`config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ve={class:`result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]`};function ye(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ge,[e(`div`,_e,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ve,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var be=L(he,[[`render`,ye],[`__scopeId`,`data-v-2a1715d6`]]),xe=_({name:`SeedreamPromptInput`,components:{PromptTextarea:pe},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Se(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ce=L(xe,[[`render`,Se]]),we={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function Q(e){switch(e){case j:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!1};case I:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case N:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case A:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case F:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:k[F],outputFormat:!1,tools:!1};case M:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:k[M],outputFormat:!1,tools:!1};default:return we}}var Te=[`1K`,`2K`,`3K`,`4K`];function Ee(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=Q(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(Te.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function De(e,t,n){let r={...e},i=Q(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var Oe=_({name:`SeedreamImageInput`,components:{ElUpload:x,ElButton:R,InfoIcon:Z,ImagePreview:X,FontAwesomeIcon:Y},mixins:[H,W],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return Q(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){z.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){z.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),ke={key:0},Ae={class:`field`},je={class:`label`},Me={class:`box`},Ne={class:`title font-bold`},Pe={class:`value`},Fe={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Ie(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`font-awesome-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,ke,[e(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`h2`,Ne,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Pe,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{icon:`fa-solid fa-upload`,class:`mr-1`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Fe,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var Le=L(Oe,[[`render`,Ie],[`__scopeId`,`data-v-6ef4c2e4`]]),Re=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{revertKey:0,options:[{value:j,label:this.$t(`seedream.model.seedream50pro`)},{value:I,label:this.$t(`seedream.model.seedream50`)},{value:N,label:this.$t(`seedream.model.seedream45`)},{value:A,label:this.$t(`seedream.model.seedream40`)},{value:F,label:this.$t(`seedream.model.seedream30t2i`)},{value:M,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(te)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Ee(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=De({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),z.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),ze={class:`field`},Be={class:`label`},Ve={class:`box`},He={class:`title font-bold`};function Ue(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,ze,[e(`div`,Be,[e(`div`,Ve,[e(`h2`,He,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var We=L(Re,[[`render`,Ue],[`__scopeId`,`data-v-6413c179`]]),Ge=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:Z},data(){return{SEEDREAM_SIZE_ADAPTIVE:ee,pixelOptions:P}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Q(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),Ke={class:`field`},qe={class:`label`},Je={class:`box`},Ye={class:`title font-bold`};function Xe(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.capabilities.sizeAdaptive?(h(),f(y,{key:1,label:t.$t(`seedream.size.group.adaptive`)},{default:p(()=>[(h(),f(v,{key:t.SEEDREAM_SIZE_ADAPTIVE,label:t.$t(`seedream.size.adaptive`),value:t.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var Ze=L(Ge,[[`render`,Xe],[`__scopeId`,`data-v-dd7bd021`]]),Qe=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:E,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),$e={key:0,class:`field`},et={class:`label`},tt={class:`box`},nt={class:`title font-bold`},rt={class:`value`};function it(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,rt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var at=L(Qe,[[`render`,it],[`__scopeId`,`data-v-f079fd20`]]),ot=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[...ne]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),st={key:0,class:`field`},ct={class:`label`},lt={class:`box`},ut={class:`title font-bold`};function dt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,st,[e(`div`,ct,[e(`div`,lt,[e(`h2`,ut,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var ft=L(ot,[[`render`,dt],[`__scopeId`,`data-v-69ea4c07`]]),pt=_({name:`SeedreamSeedInput`,components:{ElInputNumber:E,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),mt={key:0,class:`field`},ht={class:`label`},gt={class:`box`},_t={class:`title font-bold`},vt={class:`value`};function yt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,mt,[e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,vt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var bt=L(pt,[[`render`,yt],[`__scopeId`,`data-v-10cdc1e0`]]),xt=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:E,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).guidanceScale},defaultValue(){return Q(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),St={key:0,class:`field`},Ct={class:`label`},wt={class:`box`},Tt={class:`title font-bold`},Et={class:`value`};function Dt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`h2`,Tt,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,Et,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var Ot=L(xt,[[`render`,Dt],[`__scopeId`,`data-v-7386f064`]]),kt=_({name:`SeedreamWatermarkSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedream?.config?.watermark;return e===void 0?!1:!!e},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,watermark:e})}}}}),At={class:`field`},jt={class:`label`},Mt={class:`box`},Nt={class:`title font-bold`},Pt={class:`value`};function Ft(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,At,[e(`div`,jt,[e(`div`,Mt,[e(`h2`,Nt,i(t.$t(`seedream.name.watermark`)),1),a(d,{content:t.$t(`seedream.description.watermark`),class:`info`},null,8,[`content`])])]),e(`div`,Pt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var It=_({name:`SeedreamConfigPanel`,components:{ElButton:R,FontAwesomeIcon:Y,PromptInput:Ce,Consumption:se,ImageInput:Le,ModelSelector:We,SizeSelector:Ze,MaxImagesSelector:at,OutputFormatSelector:ft,SeedInput:bt,GuidanceScaleInput:Ot,WatermarkSwitch:L(kt,[[`render`,Ft],[`__scopeId`,`data-v-9e2abf0f`]])},emits:[`generate`],computed:{config(){return this.$store.state.seedream?.config},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,n=e?.sequential_image_generation===`auto`?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return G({...e,action:t?`edit`:`generate`,model:O(e?.model),count:n},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Lt={class:`flex flex-col h-full`},Rt={class:`flex-1 overflow-y-auto p-5`},zt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Bt(t,n,o,c,u,d){let f=l(`model-selector`),m=l(`size-selector`),g=l(`max-images-selector`),_=l(`output-format-selector`),v=l(`seed-input`),y=l(`guidance-scale-input`),b=l(`watermark-switch`),x=l(`prompt-input`),S=l(`image-input`),C=l(`consumption`),w=l(`font-awesome-icon`),T=l(`el-button`);return h(),s(`div`,Lt,[e(`div`,Rt,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`})]),e(`div`,zt,[a(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(w,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Vt=L(It,[[`render`,Bt]]),Ht=_({name:`SeedreamTaskPreview`,components:{ElImage:C,CopyToClipboard:ae,FontAwesomeIcon:Y,ElAlert:w,ImageWrapper:me,ElButton:R,ElTooltip:S,ImagePreview:X,ApiCodeButton:ue},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return O(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Ut={class:`preview`},Wt={class:`left`},Gt={class:`main`},Kt={class:`bot`},qt={class:`datetime`},Jt={class:`info`},Yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Xt={key:1,class:`prompt mt-2`},Zt={key:0},Qt={key:0,class:n({content:!0})},$t={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},en={key:1,class:n({content:!0,failed:!0})},tn={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},nn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},rn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},an={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ln={key:2,class:n({content:!0})},un={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_n={key:3,class:n({content:!0})},vn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function bn(n,u,d,g,_,v){let y=l(`el-image`),b=l(`image-preview`),x=l(`font-awesome-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`image-wrapper`),T=l(`el-button`),E=l(`el-tooltip`),D=l(`api-code-button`);return h(),s(`div`,Ut,[e(`div`,Wt,[a(y,{src:`https://cdn.acedata.cloud/9egrbn.png`,class:`avatar`})]),e(`div`,Gt,[e(`div`,Kt,[r(i(n.$t(`seedream.name.seedreamBot`))+` `,1),e(`span`,qt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Jt,[Array.isArray(n.modelValue?.request?.image)&&n.modelValue?.request?.image.length>0?(h(),s(`div`,Yt,[(h(!0),s(c,null,m(n.modelValue?.request?.image,(e,t)=>(h(),f(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,Xt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Zt,` - (`+i(n.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(h(),s(`div`,en,[e(`div`,tn,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(w,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,nn,[a(E,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(D,{path:`/seedream/images`,body:n.modelValue?.request},null,8,[`body`])]),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,rn,[a(x,{icon:`fa-solid fa-cube`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,an,[a(x,{icon:`fa-solid fa-image`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,on,[a(x,{icon:`fa-solid fa-bolt`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,sn,[a(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,cn,[a(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,$,[a(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,ln,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(x,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,un,[a(x,{icon:`fa-solid fa-cube`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,dn,[a(x,{icon:`fa-solid fa-image`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,fn,[a(x,{icon:`fa-solid fa-bolt`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,pn,[a(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(h(),s(`p`,mn,[a(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(h(),s(`p`,hn,[a(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,gn,[a(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,_n,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,vn,[a(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(h(),s(`p`,yn,[a(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Qt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(x,{icon:`fa-regular fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,$t,[a(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var xn=_({name:`SeedreamRecentPanel`,components:{TaskPreview:L(Ht,[[`render`,bn],[`__scopeId`,`data-v-1b4654bc`]]),BotPlaceholder:de,NoTasks:fe,ScrollList:ce},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Sn={key:0},Cn={key:2,class:`w-full h-full flex items-center justify-center`};function wn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Sn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Cn,[a(v)])):o(``,!0)],64)}var Tn=_({name:`SeedreamIndex`,components:{ConfigPanel:Vt,Layout:be,RecentPanel:L(xn,[[`render`,wn]])},mixins:[K],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===B.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===B.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await le({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!q(this.uploadTracker,e=>this.$t(e),e=>z.warning(e)))return;let e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&`image`in e&&delete e.image,e?.size||delete e.size;let t={...e,async:!0};if(!V())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}z.info(this.$t(`seedream.message.startingTask`)),ie(`seedream`,re.generate(t,{token:n})).then(()=>{z.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?z.error(this.$t(`seedream.message.usedUp`)):z.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function En(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Dn=L(Tn,[[`render`,En]]);export{Dn as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-Cuj6p07D.js";import{t as x}from"./upload-4mga_3De.js";import{t as S}from"./tooltip-DzdEJ1MO.js";import{t as C}from"./image-B5YV0P5l.js";import{t as w}from"./alert-CkdiVDlK.js";import{t as T}from"./drawer-hfiiHebG.js";import{t as E}from"./input-number-Y246MOpV.js";import{t as D}from"./switch-DPhG4Kof.js";import{_n as O,an as k,cn as A,dn as j,fn as M,gn as ee,in as te,ln as N,mn as P,pn as ne,sn as F,un as I}from"./constants-BWqqQ28D.js";import{G as L,Ii as R,Rn as re,Ti as z,Tr as ie,di as B,hn as V,in as H,mi as U,nn as W,on as G,rn as K,tn as q,wi as J}from"./index-Dhzu5qf8.js";import{t as Y}from"./index.es-CY4LWraT.js";import{t as ae}from"./CopyToClipboard-BcbOejCl.js";import{t as X}from"./ImagePreview-D7GhT3HH.js";import{n as oe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as se}from"./Consumption-BSGvXSjX.js";import{i as Z,n as ce,t as le}from"./pagination-4oRHR4z0.js";import{t as ue}from"./ApiCodeButton-CZ1yg3gI.js";import{t as de}from"./BotPlaceholder-2PPX3n_C.js";import{t as fe}from"./NoTasks-C8vWnK5o.js";import{t as pe}from"./PromptTextarea-CHyNTBsT.js";import{t as me}from"./ImageWrapper-CNjBJ5xI.js";var he=_({name:`LayoutSeedream`,components:{ElDrawer:T,ElButton:R,FontAwesomeIcon:Y},mixins:[oe]}),ge={class:`main flex flex-row flex-1`},_e={class:`config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ve={class:`result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]`};function ye(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ge,[e(`div`,_e,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ve,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var be=L(he,[[`render`,ye],[`__scopeId`,`data-v-2a1715d6`]]),xe=_({name:`SeedreamPromptInput`,components:{PromptTextarea:pe},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Se(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ce=L(xe,[[`render`,Se]]),we={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function Q(e){switch(e){case j:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!1};case I:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case N:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case A:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case F:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:k[F],outputFormat:!1,tools:!1};case M:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:k[M],outputFormat:!1,tools:!1};default:return we}}var Te=[`1K`,`2K`,`3K`,`4K`];function Ee(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=Q(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(Te.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function De(e,t,n){let r={...e},i=Q(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var Oe=_({name:`SeedreamImageInput`,components:{ElUpload:x,ElButton:R,InfoIcon:Z,ImagePreview:X,FontAwesomeIcon:Y},mixins:[H,W],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return Q(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){z.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){z.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),ke={key:0},Ae={class:`field`},je={class:`label`},Me={class:`box`},Ne={class:`title font-bold`},Pe={class:`value`},Fe={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Ie(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`font-awesome-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,ke,[e(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`h2`,Ne,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Pe,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{icon:`fa-solid fa-upload`,class:`mr-1`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Fe,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var Le=L(Oe,[[`render`,Ie],[`__scopeId`,`data-v-6ef4c2e4`]]),Re=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{revertKey:0,options:[{value:j,label:this.$t(`seedream.model.seedream50pro`)},{value:I,label:this.$t(`seedream.model.seedream50`)},{value:N,label:this.$t(`seedream.model.seedream45`)},{value:A,label:this.$t(`seedream.model.seedream40`)},{value:F,label:this.$t(`seedream.model.seedream30t2i`)},{value:M,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(te)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Ee(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await J.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=De({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),z.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),ze={class:`field`},Be={class:`label`},Ve={class:`box`},He={class:`title font-bold`};function Ue(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,ze,[e(`div`,Be,[e(`div`,Ve,[e(`h2`,He,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var We=L(Re,[[`render`,Ue],[`__scopeId`,`data-v-6413c179`]]),Ge=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:Z},data(){return{SEEDREAM_SIZE_ADAPTIVE:ee,pixelOptions:P}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Q(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),Ke={class:`field`},qe={class:`label`},Je={class:`box`},Ye={class:`title font-bold`};function Xe(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.capabilities.sizeAdaptive?(h(),f(y,{key:1,label:t.$t(`seedream.size.group.adaptive`)},{default:p(()=>[(h(),f(v,{key:t.SEEDREAM_SIZE_ADAPTIVE,label:t.$t(`seedream.size.adaptive`),value:t.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var Ze=L(Ge,[[`render`,Xe],[`__scopeId`,`data-v-dd7bd021`]]),Qe=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:E,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),$e={key:0,class:`field`},et={class:`label`},tt={class:`box`},nt={class:`title font-bold`},rt={class:`value`};function it(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,rt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var at=L(Qe,[[`render`,it],[`__scopeId`,`data-v-f079fd20`]]),ot=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[...ne]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),st={key:0,class:`field`},ct={class:`label`},lt={class:`box`},ut={class:`title font-bold`};function dt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,st,[e(`div`,ct,[e(`div`,lt,[e(`h2`,ut,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var ft=L(ot,[[`render`,dt],[`__scopeId`,`data-v-69ea4c07`]]),pt=_({name:`SeedreamSeedInput`,components:{ElInputNumber:E,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),mt={key:0,class:`field`},ht={class:`label`},gt={class:`box`},_t={class:`title font-bold`},vt={class:`value`};function yt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,mt,[e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,vt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var bt=L(pt,[[`render`,yt],[`__scopeId`,`data-v-10cdc1e0`]]),xt=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:E,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).guidanceScale},defaultValue(){return Q(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),St={key:0,class:`field`},Ct={class:`label`},wt={class:`box`},Tt={class:`title font-bold`},Et={class:`value`};function Dt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`h2`,Tt,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,Et,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var Ot=L(xt,[[`render`,Dt],[`__scopeId`,`data-v-7386f064`]]),kt=_({name:`SeedreamWatermarkSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedream?.config?.watermark;return e===void 0?!1:!!e},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,watermark:e})}}}}),At={class:`field`},jt={class:`label`},Mt={class:`box`},Nt={class:`title font-bold`},Pt={class:`value`};function Ft(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,At,[e(`div`,jt,[e(`div`,Mt,[e(`h2`,Nt,i(t.$t(`seedream.name.watermark`)),1),a(d,{content:t.$t(`seedream.description.watermark`),class:`info`},null,8,[`content`])])]),e(`div`,Pt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var It=_({name:`SeedreamConfigPanel`,components:{ElButton:R,FontAwesomeIcon:Y,PromptInput:Ce,Consumption:se,ImageInput:Le,ModelSelector:We,SizeSelector:Ze,MaxImagesSelector:at,OutputFormatSelector:ft,SeedInput:bt,GuidanceScaleInput:Ot,WatermarkSwitch:L(kt,[[`render`,Ft],[`__scopeId`,`data-v-9e2abf0f`]])},emits:[`generate`],computed:{config(){return this.$store.state.seedream?.config},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,n=e?.sequential_image_generation===`auto`?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return G({...e,action:t?`edit`:`generate`,model:O(e?.model),count:n},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Lt={class:`flex flex-col h-full`},Rt={class:`flex-1 overflow-y-auto p-5`},zt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Bt(t,n,o,c,u,d){let f=l(`model-selector`),m=l(`size-selector`),g=l(`max-images-selector`),_=l(`output-format-selector`),v=l(`seed-input`),y=l(`guidance-scale-input`),b=l(`watermark-switch`),x=l(`prompt-input`),S=l(`image-input`),C=l(`consumption`),w=l(`font-awesome-icon`),T=l(`el-button`);return h(),s(`div`,Lt,[e(`div`,Rt,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`})]),e(`div`,zt,[a(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(w,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Vt=L(It,[[`render`,Bt]]),Ht=_({name:`SeedreamTaskPreview`,components:{ElImage:C,CopyToClipboard:ae,FontAwesomeIcon:Y,ElAlert:w,ImageWrapper:me,ElButton:R,ElTooltip:S,ImagePreview:X,ApiCodeButton:ue},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return O(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Ut={class:`preview`},Wt={class:`left`},Gt={class:`main`},Kt={class:`bot`},qt={class:`datetime`},Jt={class:`info`},Yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Xt={key:1,class:`prompt mt-2`},Zt={key:0},Qt={key:0,class:n({content:!0})},$t={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},en={key:1,class:n({content:!0,failed:!0})},tn={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},nn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},rn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},an={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ln={key:2,class:n({content:!0})},un={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_n={key:3,class:n({content:!0})},vn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function bn(n,u,d,g,_,v){let y=l(`el-image`),b=l(`image-preview`),x=l(`font-awesome-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`image-wrapper`),T=l(`el-button`),E=l(`el-tooltip`),D=l(`api-code-button`);return h(),s(`div`,Ut,[e(`div`,Wt,[a(y,{src:`https://cdn.acedata.cloud/9egrbn.png`,class:`avatar`})]),e(`div`,Gt,[e(`div`,Kt,[r(i(n.$t(`seedream.name.seedreamBot`))+` `,1),e(`span`,qt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Jt,[Array.isArray(n.modelValue?.request?.image)&&n.modelValue?.request?.image.length>0?(h(),s(`div`,Yt,[(h(!0),s(c,null,m(n.modelValue?.request?.image,(e,t)=>(h(),f(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,Xt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Zt,` - (`+i(n.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(h(),s(`div`,en,[e(`div`,tn,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(w,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,nn,[a(E,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(D,{path:`/seedream/images`,body:n.modelValue?.request},null,8,[`body`])]),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,rn,[a(x,{icon:`fa-solid fa-cube`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,an,[a(x,{icon:`fa-solid fa-image`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,on,[a(x,{icon:`fa-solid fa-bolt`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,sn,[a(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,cn,[a(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,$,[a(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,ln,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(x,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,un,[a(x,{icon:`fa-solid fa-cube`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.model`))+`: `+i(n.shortModel(n.modelValue?.request?.model)),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,dn,[a(x,{icon:`fa-solid fa-image`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),e(`p`,fn,[a(x,{icon:`fa-solid fa-bolt`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.task`))+`: `+i(n.isEdit?n.$t(`seedream.name.edits`):n.$t(`seedream.name.generate`)),1)]),e(`p`,pn,[a(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(h(),s(`p`,mn,[a(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(h(),s(`p`,hn,[a(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,gn,[a(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,_n,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,vn,[a(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(h(),s(`p`,yn,[a(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Qt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(x,{icon:`fa-regular fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,$t,[a(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedream.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var xn=_({name:`SeedreamRecentPanel`,components:{TaskPreview:L(Ht,[[`render`,bn],[`__scopeId`,`data-v-1b4654bc`]]),BotPlaceholder:de,NoTasks:fe,ScrollList:ce},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Sn={key:0},Cn={key:2,class:`w-full h-full flex items-center justify-center`};function wn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Sn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Cn,[a(v)])):o(``,!0)],64)}var Tn=_({name:`SeedreamIndex`,components:{ConfigPanel:Vt,Layout:be,RecentPanel:L(xn,[[`render`,wn]])},mixins:[K],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===B.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===B.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await le({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!q(this.uploadTracker,e=>this.$t(e),e=>z.warning(e)))return;let e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&`image`in e&&delete e.image,e?.size||delete e.size;let t={...e,async:!0};if(!V())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}z.info(this.$t(`seedream.message.startingTask`)),ie(`seedream`,re.generate(t,{token:n})).then(()=>{z.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?z.error(this.$t(`seedream.message.usedUp`)):z.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function En(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Dn=L(Tn,[[`render`,En]]);export{Dn as default};
|