@acedatacloud/nexior 3.186.0 → 3.187.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Auth-DH1Vd7Sl.js → Auth-DCrnIwVH.js} +1 -1
- package/dist/assets/{BotPlaceholder-SsROT5uE.js → BotPlaceholder-rIUYY_kq.js} +1 -1
- package/dist/assets/{Callback-VDl_wr6z.js → Callback-BGTJ8tKS.js} +1 -1
- package/dist/assets/Console-Dct78sg1.js +1 -0
- package/dist/assets/{Consumption-CAhrj82G.js → Consumption-DOBMmPDx.js} +1 -1
- package/dist/assets/{Conversation-3oGbPOu3.js → Conversation-iNHdp4S-.js} +1 -1
- package/dist/assets/{CopyToClipboard-COxFR3cx.js → CopyToClipboard-fcd0URBV.js} +1 -1
- package/dist/assets/{Detail-Cv2U_888.js → Detail-BESWj6Ix.js} +2 -2
- package/dist/assets/{Extra-DSPi4K5u.js → Extra-CEuHuT5c.js} +1 -1
- package/dist/assets/{FilePreview-3GV2SWsm.js → FilePreview-87sqKMNC.js} +1 -1
- package/dist/assets/{History-DgsBNUYl.js → History-voFHd7kt.js} +1 -1
- package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-yjmwj_qD.js → IconPark.vue_vue_type_script_setup_true_lang-K-Rl1mWr.js} +1 -1
- package/dist/assets/{ImagePreview-Cd1_21Ps.js → ImagePreview-DaewBV0b.js} +1 -1
- package/dist/assets/{ImageWrapper-Coy_mQ2k.js → ImageWrapper-BIMST89z.js} +1 -1
- package/dist/assets/{Index-D4HVhAu1.js → Index-0K-UuqrA.js} +1 -1
- package/dist/assets/{Index-CkitkXHX.js → Index-1qyjuWCz.js} +1 -1
- package/dist/assets/{Index-BN91tyz1.js → Index-BB8Iom4I.js} +1 -1
- package/dist/assets/{Index-Bxrz5muF.js → Index-BHSpK6Nz.js} +1 -1
- package/dist/assets/{Index-n0YUU_RY.js → Index-BVD2rVVu.js} +1 -1
- package/dist/assets/{Index-C8RNlTMv.js → Index-BVxiMfSq.js} +2 -2
- package/dist/assets/{Index-WH-aUx4d.js → Index-BkkiNHQ-.js} +1 -1
- package/dist/assets/{Index-BwELOWP7.js → Index-Bm4nCsCO.js} +1 -1
- package/dist/assets/{Index-CfnmkBxT.js → Index-C56DfaDJ.js} +1 -1
- package/dist/assets/{Index-896eJPHM.js → Index-C6pfLJy6.js} +1 -1
- package/dist/assets/{Index-BDmY1SY6.css → Index-CCt4FkN_.css} +1 -1
- package/dist/assets/{Index-dw4adnex.js → Index-COFVtOVJ.js} +1 -1
- package/dist/assets/{Index-DIHodpeA.js → Index-CV96TArW.js} +1 -1
- package/dist/assets/Index-CYrwPpwQ.js +1 -0
- package/dist/assets/{Index-DRwIKb2Q.js → Index-CzJhohcO.js} +1 -1
- package/dist/assets/{Index-B8n5oelj.js → Index-DbrkjKdo.js} +1 -1
- package/dist/assets/{Index-DlAbmbFy.js → Index-Dpd3qFvE.js} +1 -1
- package/dist/assets/{Index-b_6BB08J.js → Index-DsDOju6C.js} +1 -1
- package/dist/assets/{Index-CC2j_otN.js → Index-DtQ5jJIQ.js} +1 -1
- package/dist/assets/{Index-D4iunNXo.js → Index-FM2MO3-7.js} +1 -1
- package/dist/assets/Index-F__Tp94X.js +1 -0
- package/dist/assets/{Index-B3k2womX.js → Index-H6sTsjAz.js} +1 -1
- package/dist/assets/{Index-fHGWPqUz.js → Index-He0xNqxM.js} +1 -1
- package/dist/assets/{Index-V9RuoK0L.js → Index-Wc0OsPzu.js} +1 -1
- package/dist/assets/{Index-2q-H_DbV.js → Index-vB488_gn.js} +1 -1
- package/dist/assets/{Invitees-DT81hiy9.js → Invitees-I_Z9KY3e.js} +1 -1
- package/dist/assets/{List-gW8-NDCh.js → List-BeQdJGvy.js} +1 -1
- package/dist/assets/{List-CYgR1jcN.js → List-BhR5f47v.js} +1 -1
- package/dist/assets/{List-Riiwt59m.js → List-h40TcVPL.js} +1 -1
- package/dist/assets/Main-CmMfoawX.js +1 -0
- package/dist/assets/Navigator-BUa8lOJ4.css +1 -0
- package/dist/assets/Navigator-CesHy1Kb.js +3 -0
- package/dist/assets/{NoTasks-B_ODnKax.js → NoTasks-D-T1pxT-.js} +1 -1
- package/dist/assets/{NotFound-DPV4_qui.js → NotFound-CXsHazO-.js} +1 -1
- package/dist/assets/{OAuthCallback-CDkqko6l.js → OAuthCallback-mLTNrXcf.js} +1 -1
- package/dist/assets/{Pagination-C_YEsGGi.js → Pagination-BUZhOZ1-.js} +1 -1
- package/dist/assets/{Status-T1CFK3Mw.js → Status-n83x84SF.js} +1 -1
- package/dist/assets/{Subscribe-p7adx5d3.js → Subscribe-DBDs4Du0.js} +1 -1
- package/dist/assets/{VideoPlayer-bUE3PTPG.js → VideoPlayer-CaCit_ZB.js} +1 -1
- package/dist/assets/_Uint8Array-DBmqcMe4.js +1 -0
- package/dist/assets/{_baseClone-DS_LGzZX.js → _baseClone-Bm4TBjKj.js} +1 -1
- package/dist/assets/_baseIteratee-BAZHAt5C.js +1 -0
- package/dist/assets/_initCloneObject-BZf03094.js +1 -0
- package/dist/assets/{add-GBs3Qpd7.js → add-CRlxaWHY.js} +1 -1
- package/dist/assets/{all-wallets-CFmXfaFj.js → all-wallets-BtxAc-PD.js} +1 -1
- package/dist/assets/{app-store-B2Q1oeVA.js → app-store-PBUChKVm.js} +1 -1
- package/dist/assets/{apple-DyERKwo5.js → apple-7sNJkxrn.js} +1 -1
- package/dist/assets/{arrow-bottom-CYR2hb-I.js → arrow-bottom-BJu_Bzkn.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-BcEIUI1J.js → arrow-bottom-circle-Fixr9-vT.js} +1 -1
- package/dist/assets/{arrow-left-DnwM8hdu.js → arrow-left-DjSR5qnQ.js} +1 -1
- package/dist/assets/{arrow-right-BDhKLCGv.js → arrow-right-CFlcBb_r.js} +1 -1
- package/dist/assets/{arrow-top-Dr1oh9Pn.js → arrow-top-_Owpiv8h.js} +1 -1
- package/dist/assets/{avatar-CbjfTmC-.js → avatar-BXgDZw59.js} +1 -1
- package/dist/assets/{bank-Dj4XZxi6.js → bank-BSU3wZpq.js} +1 -1
- package/dist/assets/{basic-DTtGgRs-.js → basic-2yXFYkjd.js} +1 -1
- package/dist/assets/{browser-CwPVDIrE.js → browser-BGEvXDzq.js} +1 -1
- package/dist/assets/{byokCredential-D6tkRJ39.js → byokCredential-CR6tT90Y.js} +1 -1
- package/dist/assets/{card-BbbmHrNi.js → card-CXkeuC6P.js} +1 -1
- package/dist/assets/{castArray-DNZQWJZ9.js → castArray-BlsV8Nl5.js} +1 -1
- package/dist/assets/{chat-kCZo75NC.js → chat-CUJ33E4Q.js} +1 -1
- package/dist/assets/{checkmark-p-rvHOgw.js → checkmark-DcfnLutb.js} +1 -1
- package/dist/assets/{checkmark-bold-xixWzfM6.js → checkmark-bold-Bsbn5oVf.js} +1 -1
- package/dist/assets/{chevron-bottom-CHtDFRXd.js → chevron-bottom-Cos70ruM.js} +1 -1
- package/dist/assets/{chevron-left-C6SAsLxx.js → chevron-left-DJopNrpe.js} +1 -1
- package/dist/assets/{chevron-right-CkeYHZZ4.js → chevron-right-D26mrnKb.js} +1 -1
- package/dist/assets/{chevron-top-DatGNB-S.js → chevron-top-C23PENiR.js} +1 -1
- package/dist/assets/{chrome-store-DTkZ51Ny.js → chrome-store-fkdE3DKJ.js} +1 -1
- package/dist/assets/{clock-B1-i0C7K.js → clock-C8u9FYSt.js} +1 -1
- package/dist/assets/{close-BIPi437I.js → close-DZcHsMGw.js} +1 -1
- package/dist/assets/{coinPlaceholder-C6QyLpyx.js → coinPlaceholder-DAJydBbN.js} +1 -1
- package/dist/assets/{compass-B_2I8s3_.js → compass-Bx0xZTEb.js} +1 -1
- package/dist/assets/{copy-BNGO4MCc.js → copy-Bh9czH80.js} +1 -1
- package/dist/assets/{createTaskActions-CxN6ZO3c.js → createTaskActions-nNmqSx3T.js} +1 -1
- package/dist/assets/{cursor-oI1JysUd.js → cursor-B5iru8W4.js} +1 -1
- package/dist/assets/{cursor-transparent-DT1lRKyX.js → cursor-transparent-DksDgy8R.js} +1 -1
- package/dist/assets/{debounce-eIYMYWhR.js → debounce-DJstNg5L.js} +1 -1
- package/dist/assets/{desktop-C3x7i98x.js → desktop-D27c8_dH.js} +1 -1
- package/dist/assets/{disconnect-C1FmiYmX.js → disconnect-1HCNei_D.js} +1 -1
- package/dist/assets/{discord-hd2KFo_m.js → discord-1ZOOq10N.js} +1 -1
- package/dist/assets/{distribution-A2GB4a0Z.js → distribution-C16_cRya.js} +1 -1
- package/dist/assets/{dropdown-DJFLooo0.js → dropdown-B92ywxBD.js} +1 -1
- package/dist/assets/{etherscan-Ce6CN305.js → etherscan-BCSKpaV_.js} +1 -1
- package/dist/assets/{exclamation-triangle-Cj0bG8vF.js → exclamation-triangle-CooCM7MO.js} +1 -1
- package/dist/assets/{extension-D0FzSzgH.js → extension-DGtpGNiC.js} +1 -1
- package/dist/assets/{external-link--VdKU8XD.js → external-link-BLGg7OQ-.js} +1 -1
- package/dist/assets/{facebook-CRbAA5Ax.js → facebook-HB4JwWya.js} +1 -1
- package/dist/assets/{farcaster-Czy0v5wu.js → farcaster-DdwITg8t.js} +1 -1
- package/dist/assets/{filters-DdSmsOcN.js → filters-DYxnnzuQ.js} +1 -1
- package/dist/assets/{github-CiEhADD9.js → github-pVX5Fj0a.js} +1 -1
- package/dist/assets/{google-BuOhfP8Y.js → google-CLItY-jD.js} +1 -1
- package/dist/assets/{help-circle-CJTW-374.js → help-circle-CXSDH2jY.js} +1 -1
- package/dist/assets/{id-B6KEGBwg.js → id-CFAFcILN.js} +1 -1
- package/dist/assets/{image-MjoRR5ap.js → image-wMkKY25E.js} +1 -1
- package/dist/assets/{index-DBIWjbJE.js → index-4jvz1cCs.js} +1 -1
- package/dist/assets/{index-BDEUkDca.js → index-B5YpBNHT.js} +1 -1
- package/dist/assets/{index-CBQ06cKz.js → index-BA-4pC-U.js} +1 -1
- package/dist/assets/{index-DoMPvIeR.js → index-BBj2bu0O.js} +1 -1
- package/dist/assets/{index-ssDHuElC.js → index-BC_jZhgt.js} +1 -1
- package/dist/assets/{index-D9Q5moTz.js → index-BCz0fs4Q.js} +1 -1
- package/dist/assets/{index-DtxGppsl.js → index-BFYyFSWW.js} +1 -1
- package/dist/assets/{index-SXSMbPsb.js → index-BG50CX5a.js} +1 -1
- package/dist/assets/{index-wpjJo68M.js → index-BG_XooxF.js} +3 -3
- package/dist/assets/{index-CgIoE6y0.js → index-BIq05yu9.js} +1 -1
- package/dist/assets/{index-CespLNuK.js → index-BLZB5LF-.js} +1 -1
- package/dist/assets/index-BLZi2Tod.js +1 -0
- package/dist/assets/{index-BajT1XSW.js → index-BTDJ_dCb.js} +1 -1
- package/dist/assets/{index-C74NCRLg.js → index-BcYHq-dW.js} +1 -1
- package/dist/assets/{index-hkeQzgSz.js → index-BczxWa3s.js} +1 -1
- package/dist/assets/index-BfcozeoS.js +1 -0
- package/dist/assets/{index-CGYKhIfz.js → index-BglU6saV.js} +1 -1
- package/dist/assets/{index-DpAJ2tcJ.js → index-BhwFaUXW.js} +1 -1
- package/dist/assets/{index-BQTeuJfN.js → index-BmF4EUul.js} +1 -1
- package/dist/assets/{index-BanO9ONg.js → index-BosLFAxw.js} +1 -1
- package/dist/assets/{index-9b-Psec_.js → index-BsRrcWNn.js} +1 -1
- package/dist/assets/{index-DMegc4HX.js → index-C09LrJ3Z.js} +1 -1
- package/dist/assets/{index-CgsVS0C3.js → index-C4gWXjlo.js} +1 -1
- package/dist/assets/{index-CUUq0hlV.js → index-C6RVSXMS.js} +1 -1
- package/dist/assets/{index-d2rqZZYz.js → index-CI9L_kfK.js} +1 -1
- package/dist/assets/{index-DRKZAE9p.js → index-CNFUAH-T.js} +1 -1
- package/dist/assets/{index-BeRl9zcZ.js → index-CO2v-Uge.js} +1 -1
- package/dist/assets/{index-CW3l52vC.js → index-COo1AIy1.js} +1 -1
- package/dist/assets/{index-C0qYYI3A.js → index-CcgLy-HH.js} +1 -1
- package/dist/assets/{index-CGjyIH_A.css → index-CdjbCVgM.css} +1 -1
- package/dist/assets/{index-DqzA14CK.js → index-CsK9znWq.js} +1 -1
- package/dist/assets/{index-Qb7mu-zz.js → index-CsNpUw6F.js} +1 -1
- package/dist/assets/{index-BSVakLgG.js → index-CxkP59wJ.js} +1 -1
- package/dist/assets/{index-Bj3C_o6O.js → index-D13GCfoT.js} +1 -1
- package/dist/assets/{index-jdJj9m9s.js → index-D4H-Ti5i.js} +1 -1
- package/dist/assets/{index-CQiVyAFw.js → index-DE7HX_fp.js} +1 -1
- package/dist/assets/{index-Ms3ynCfw.js → index-DFeqXt1B.js} +1 -1
- package/dist/assets/{index-DC3bbaVK.js → index-DHoiN4iS.js} +1 -1
- package/dist/assets/{index-DE4dYCQT.js → index-DIaLSCOX.js} +1 -1
- package/dist/assets/{index-DWKG09R5.js → index-DNhmoeY7.js} +1 -1
- package/dist/assets/{index-HfPDcNZW.js → index-DTf2Yobg.js} +1 -1
- package/dist/assets/{index-D2S4J9sX.js → index-DWZT6KAN.js} +1 -1
- package/dist/assets/{index-DRJcmib8.js → index-Dayu-ogD.js} +1 -1
- package/dist/assets/{index-WP4a4j30.js → index-DjX6mjUT.js} +1 -1
- package/dist/assets/{index-CXcxS6Tb.js → index-DlzQ_Am-.js} +1 -1
- package/dist/assets/{index-BVNvjRp7.js → index-DmzIDab5.js} +3 -3
- package/dist/assets/{index-CVm9uD3g.js → index-DnUVjOvd.js} +1 -1
- package/dist/assets/{index-DRRUlWZq.js → index-Du3AVQcG.js} +1 -1
- package/dist/assets/{index-Bc_L-KVx.js → index-Dyl__F53.js} +1 -1
- package/dist/assets/{index-BaTdpxaZ.js → index-FUKFpD8x.js} +1 -1
- package/dist/assets/{index-6WXbEX6N.js → index-PVwHwQrT.js} +1 -1
- package/dist/assets/{index-D2EVue7e.js → index-PvLZ3P1X.js} +1 -1
- package/dist/assets/index-WjYXLdZh.js +1 -0
- package/dist/assets/{index-DbwGo6yj.js → index-YO1H-TYi.js} +5 -5
- package/dist/assets/{index-D0ECG3FC.js → index-Z-KtkVq2.js} +1 -1
- package/dist/assets/{index-Cf5BsQAZ.js → index-ivuKxQKf.js} +1 -1
- package/dist/assets/index-kt3JmFHf.js +1 -0
- package/dist/assets/{index-Dd5AgwZM.js → index-ngJHxeyG.js} +2 -2
- package/dist/assets/{index-CV0EVuZw.js → index-nqas1N5V.js} +1 -1
- package/dist/assets/{index-X5hbW6Qf.js → index-wZ-Dmmo3.js} +1 -1
- package/dist/assets/{index-DLb1l7gU.js → index-yUvHDYqb.js} +1 -1
- package/dist/assets/{index.browser.esm-CidL5oJS.js → index.browser.esm-COjCI9wu.js} +1 -1
- package/dist/assets/{index.es-B-oBIK4i.js → index.es-C0ey3-R3.js} +1 -1
- package/dist/assets/{info-COgdH5DE.js → info-BUKncl7h.js} +1 -1
- package/dist/assets/{info-circle-SGhUbblq.js → info-circle-C5ZmVirC.js} +1 -1
- package/dist/assets/{isEqual-hkTAHR86.js → isEqual-GBLUqtKG.js} +1 -1
- package/dist/assets/{isPlainObject-DojcLKlA.js → isPlainObject-BvjdTmRY.js} +1 -1
- package/dist/assets/{lightbulb-Du45Pnev.js → lightbulb-DQW2p9bj.js} +1 -1
- package/dist/assets/{mail-Bbu24DUH.js → mail-S0MiSVEP.js} +1 -1
- package/dist/assets/{midjourney-7gB4jST6.js → midjourney-DxLkyhUb.js} +1 -1
- package/dist/assets/{mobile-Cn1zKgp4.js → mobile-CC9x5s7S.js} +1 -1
- package/dist/assets/{more-B0sU7sH8.js → more-C4Q5iMlk.js} +1 -1
- package/dist/assets/{network-placeholder-ChMN4B5U.js → network-placeholder-DUfeYTGE.js} +1 -1
- package/dist/assets/{nftPlaceholder-B-ylI41S.js → nftPlaceholder-qIPp1pSU.js} +1 -1
- package/dist/assets/{off-B4BA9qzT.js → off-z_S1CdLQ.js} +1 -1
- package/dist/assets/{order-CIxDmicW.js → order-Y4K_pXPH.js} +1 -1
- package/dist/assets/{pagination-SBJi51n4.js → pagination-DmGb5MLv.js} +1 -1
- package/dist/assets/{play-store-8H-snbDD.js → play-store-OHQQ5vg1.js} +1 -1
- package/dist/assets/{plus-EiDHjdTr.js → plus-C-1Vi0M-.js} +1 -1
- package/dist/assets/{price-BvAGRK8n.js → price-DcG4BRcB.js} +1 -1
- package/dist/assets/{producer-DP85fuAq.js → producer-BGNC4QeM.js} +1 -1
- package/dist/assets/{producer-D349jr0q.js → producer-DjQ5FQ3O.js} +1 -1
- package/dist/assets/{qr-code-h0_2zzC-.js → qr-code-B0v8ftst.js} +1 -1
- package/dist/assets/{recycle-horizontal-B9vniPUU.js → recycle-horizontal-_1D7heY3.js} +1 -1
- package/dist/assets/{refresh-CjQl31ja.js → refresh-CuIqG_I3.js} +1 -1
- package/dist/assets/{reown-logo-CzR8K7r1.js → reown-logo-D-pOIqJo.js} +1 -1
- package/dist/assets/{search-CtjqpMpN.js → search-DG2rsNIq.js} +1 -1
- package/dist/assets/{secp256k1-CHEoBIAf.js → secp256k1-CCyvsDHN.js} +1 -1
- package/dist/assets/{secp256k1-Bfx7Nu3Q.js → secp256k1-UW5I48gP.js} +1 -1
- package/dist/assets/{seedream-CikOxm_v.js → seedream-A09rQC1N.js} +1 -1
- package/dist/assets/{send-Du4k6MEB.js → send-R8u4S2zs.js} +1 -1
- package/dist/assets/{service-9E7bVAdX.js → service-CpHWaMeA.js} +1 -1
- package/dist/assets/{solana-wallets-BKXNJJuB.js → solana-wallets-Bum1zSNZ.js} +2 -2
- package/dist/assets/{solana-wallets-vue-M_q4PwDF.js → solana-wallets-vue-CaiIKhKL.js} +1 -1
- package/dist/assets/{suno-BAbqHfdU.js → suno-DqC_GsjI.js} +1 -1
- package/dist/assets/{swapHorizontal-BkZToE1_.js → swapHorizontal-DPutiB5t.js} +1 -1
- package/dist/assets/{swapHorizontalBold-dRYA1RrJ.js → swapHorizontalBold-BmX6727x.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-DWw-DA75.js → swapHorizontalMedium-BEmJ4muT.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-lHG245o2.js → swapHorizontalRoundedBold-BH7wfC57.js} +1 -1
- package/dist/assets/{swapVertical-DKWXW6rg.js → swapVertical-CO1BaBbS.js} +1 -1
- package/dist/assets/{telegram-CHOd_aff.js → telegram-X9mXOH3B.js} +1 -1
- package/dist/assets/{three-dots-BCPoUZ5e.js → three-dots-Cp6nmelW.js} +1 -1
- package/dist/assets/{twitch-DCpUklxd.js → twitch-gN0nRh20.js} +1 -1
- package/dist/assets/{twitterIcon-lZBx1lzG.js → twitterIcon-BZ2SXD4G.js} +1 -1
- package/dist/assets/{typescript-CODnKE5F.js → typescript-KHf3OKxy.js} +1 -1
- package/dist/assets/{use-form-item-BbBsagre.js → use-form-item-DdkTXwP4.js} +1 -1
- package/dist/assets/validator-BHNihkZT.js +1 -0
- package/dist/assets/{verify-ChQufcNA.js → verify-WJN4xUG6.js} +1 -1
- package/dist/assets/{verify-filled-BuiMvk7b.js → verify-filled-BNQ0TDsK.js} +1 -1
- package/dist/assets/{w3m-modal-BEcX4Oal.js → w3m-modal-G_ngDMaU.js} +1 -1
- package/dist/assets/{wallet-Duf2ZBJS.js → wallet-BpVVzFB6.js} +1 -1
- package/dist/assets/{wallet-placeholder-Btf_fW9a.js → wallet-placeholder-DKqoPacL.js} +1 -1
- package/dist/assets/{walletconnect-nm6_uTKN.js → walletconnect-BMC22Q5U.js} +1 -1
- package/dist/assets/{warning-circle-CEV76c5r.js → warning-circle-DiRfz4yr.js} +1 -1
- package/dist/assets/{web-Bq68rVm7.js → web-3LbRd7Bp.js} +1 -1
- package/dist/assets/{web-Dg2GdsZq.js → web-gKcx9BEj.js} +1 -1
- package/dist/assets/{x-yYv29UIL.js → x-D5ZlUrKx.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/Console-B-6SMX0O.js +0 -1
- package/dist/assets/EditArray-B4LwGKJc.css +0 -1
- package/dist/assets/EditArray-BksWGcBl.js +0 -3
- package/dist/assets/Index-D-0xegny.js +0 -1
- package/dist/assets/Index-DAqmhqGb.css +0 -1
- package/dist/assets/Index-Drzdf-_A.js +0 -1
- package/dist/assets/Main-B9uvXKpd.js +0 -1
- package/dist/assets/Navigator-CAoOaR4h.css +0 -1
- package/dist/assets/Navigator-DS2HayXO.js +0 -1
- package/dist/assets/_Uint8Array-CvdQKNTH.js +0 -1
- package/dist/assets/_baseIteratee-D4WzrUe9.js +0 -1
- package/dist/assets/_initCloneObject-BtMKtTta.js +0 -1
- package/dist/assets/index-Bw6jO9kQ.js +0 -1
- package/dist/assets/index-CkpRuSjM.js +0 -1
- package/dist/assets/index-CqvHUGbn.js +0 -1
- package/dist/assets/index-fgfJZlZE.js +0 -1
- package/dist/assets/validator-ZvH0hMEF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as C}from"./index.es-B-oBIK4i.js";import{E as G}from"./index-hkeQzgSz.js";import{E as L}from"./index-DoMPvIeR.js";import{d as v,H as l,E as r,z as A,C as s,y as d,D as n,q as o,F as a,I as g,O as I,N as T,x as E,Q as S,c as U,J as $}from"./vendor-vue-NSDaktjZ.js";import{G as b,bl as D,cu as z,bd as M,n as O,S as V,cv as j}from"./index-BVNvjRp7.js";import{p as B}from"./pasteUploadMixin-BurWbGNQ.js";import{I as q,S as F,l as N}from"./pagination-SBJi51n4.js";import{I as H}from"./ImagePreview-Cd1_21Ps.js";import{E as J}from"./index-CXcxS6Tb.js";import{E as w}from"./index-D2EVue7e.js";import{a as Q,E as W}from"./index-Ms3ynCfw.js";import{E as R}from"./index-d2rqZZYz.js";import{E as K,a as X}from"./index-fgfJZlZE.js";import{b as Y,a as Z}from"./errorCode-Cqj9Td_Z.js";import{A as x}from"./Status-T1CFK3Mw.js";import{C as ee}from"./CopyToClipboard-COxFR3cx.js";import{E as se}from"./index-DRJcmib8.js";import{E as te,a as oe}from"./index-BDEUkDca.js";import"./use-form-item-BbBsagre.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-D0ECG3FC.js";import"./index-CqvHUGbn.js";import"./typescript-CODnKE5F.js";import"./index-DMegc4HX.js";import"./_baseClone-DS_LGzZX.js";import"./_Uint8Array-CvdQKNTH.js";import"./_initCloneObject-BtMKtTta.js";import"./isEqual-hkTAHR86.js";import"./debounce-eIYMYWhR.js";import"./index-DC3bbaVK.js";import"./strings-beZM2Y-f.js";import"./isPlainObject-DojcLKlA.js";const ae=v({name:"LayoutHeadshots",components:{ElDrawer:L,ElButton:G,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ne={class:"main flex flex-row flex-1"},ie={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},le={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function re(e,t,m,h,k,y){const p=n("font-awesome-icon"),u=n("el-button"),i=n("el-drawer");return o(),l("div",ne,[r("div",ie,[A(e.$slots,"config",{},void 0,!0)]),r("div",le,[A(e.$slots,"result",{},void 0,!0)]),s(u,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:d(()=>[s(p,{icon:"fa-solid fa-gear"})]),_:1}),s(i,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),"with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[A(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ce=b(ae,[["render",re],["__scopeId","data-v-c93166c8"]]),de=v({name:"ImageUrlsInput",components:{ElUpload:J,ElButton:G,InfoIcon:q,ImagePreview:H,FontAwesomeIcon:C},mixins:[B],data(){return{fileList:[],uploadUrl:D()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.headshots?.config?.image_urls},set(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){w.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){w.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),pe={class:"field"},me={class:"title font-bold"},he={class:"upload-wrapper"};function ue(e,t,m,h,k,y){const p=n("image-preview"),u=n("font-awesome-icon"),i=n("el-button"),c=n("el-upload"),f=n("info-icon");return o(),l("div",pe,[r("h2",me,a(e.$t("headshots.name.endImageUrls")),1),r("div",he,[s(c,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value upload-wrapper",limit:2,multiple:!0,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:d(({file:_})=>[s(p,{url:_.url||_.response?.file_url,name:_.name,percentage:_.percentage,onRemove:P=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])]),default:d(()=>[s(i,{size:"small",type:"primary",round:""},{default:d(()=>[s(u,{icon:"fa-solid fa-upload",class:"mr-1"}),g(" "+a(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(f,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}const fe=b(de,[["render",ue],["__scopeId","data-v-ca56051e"]]),ge="fast",_e=v({name:"ModeSelector",components:{ElRadioButton:W,ElRadioGroup:Q},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){return this.$store.state.headshots.config?.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=ge)}}),$e={class:"field"},ve={class:"title font-bold"};function be(e,t,m,h,k,y){const p=n("el-radio-button"),u=n("el-radio-group");return o(),l("div",$e,[r("h2",ve,a(e.$t("headshots.name.mode")),1),s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),class:"mode"},{default:d(()=>[(o(!0),l(I,null,T(e.options,i=>(o(),E(p,{key:i.value,label:i.value},{default:d(()=>[g(a(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}const ke=b(_e,[["render",be],["__scopeId","data-v-e7702494"]]),ye=v({name:"StylizeSelector",components:{ElTabs:X,ElTabPane:K,ElImage:R},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){console.debug("set template",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:e})}},mounted(){this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})},methods:{onToggle(e){this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})}}}),we={class:"field"},Ie=["onClick"],Te={class:"name"};function Ee(e,t,m,h,k,y){const p=n("el-image"),u=n("el-tab-pane"),i=n("el-tabs");return o(),l("div",we,[s(i,{modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=c=>e.tab=c)},{default:d(()=>[(o(!0),l(I,null,T(e.elements,(c,f)=>(o(),E(u,{key:f,label:c.displayName,name:f,class:"pane"},{default:d(()=>[(o(!0),l(I,null,T(c.items,(_,P)=>(o(),l("div",{key:P,class:S({item:!0,active:e.value===_.value}),onClick:ys=>e.onToggle(_.value)},[s(p,{src:_.image,fit:"fill",class:"preview"},null,8,["src"]),r("span",Te,a(_.label),1)],10,Ie))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}const Se=b(ye,[["render",Ee],["__scopeId","data-v-be4bd25d"]]),Ve=v({name:"PresetPanel",components:{ModeSelector:ke,ImageUrlsInput:fe,ElButton:G,FontAwesomeIcon:C,ElementsSelector:Se},emits:["generate"],computed:{config(){return this.$store.state.headshots?.config}},methods:{onGenerate(){this.$emit("generate")}}}),Ce={class:"panel"},Ae={class:"config"},Ge={class:"actions"};function Pe(e,t,m,h,k,y){const p=n("elements-selector"),u=n("mode-selector"),i=n("image-urls-input"),c=n("font-awesome-icon"),f=n("el-button");return o(),l("div",Ce,[r("div",Ae,[s(p,{class:"mb-4"}),s(u,{class:"mb-4"}),s(i,{class:"mb-4"}),r("div",Ge,[s(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(c,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+a(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}const Re=b(Ve,[["render",Pe],["__scopeId","data-v-848739f6"]]),Le=v({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:U(()=>e.modelValue?.response?.data?.slice(0,2)||[]),viewImage:h=>{window.open(h,"_blank")}}}}),Ue={class:"image-gallery"},De=["src"],ze=["onClick"];function Me(e,t,m,h,k,y){return o(),l("div",Ue,[(o(!0),l(I,null,T(e.images,(p,u)=>(o(),l("div",{key:u,class:"image-container"},[r("img",{src:p.image_url,alt:"Image"},null,8,De),p.image_url?(o(),l("button",{key:0,class:"view-button",onClick:i=>e.viewImage(p.image_url)},a(e.$t("headshots.button.viewImage")),9,ze)):$("",!0)]))),128))])}const Oe=b(Le,[["render",Me],["__scopeId","data-v-42f0a7be"]]),je=v({name:"TaskPreview",components:{ElImage:R,CopyToClipboard:ee,FontAwesomeIcon:C,ElAlert:se,ImageGallery:Oe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.headshots?.application},config(){return this.$store.state.headshots?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,m=new URL(t.src),h=m.searchParams.get("retry");if(!h)m.searchParams.set("retry","1");else if(parseInt(h)<2)m.searchParams.set("retry",(parseInt(h)+1).toString());else return;t.src=m.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Be={class:"preview"},qe={class:"left"},Fe={class:"main"},Ne={class:"bot"},He={class:"datetime"},Je={class:"info"},Qe={key:0,class:"prompt mt-2"},We={key:0},Ke={key:1},Xe={key:0,class:S({content:!0,failed:!0})},Ye={class:"image-wrapper"},Ze={class:"description"},xe={key:0,class:"description"},es={key:1,class:S({content:!0})},ss={class:"description"},ts={class:"description"},os={key:0,class:"description"},as={class:"description"},ns={key:2,class:S({content:!0})},is={class:"description"},ls={key:3,class:S({content:!0})},rs={class:"description"};function cs(e,t,m,h,k,y){const p=n("el-image"),u=n("image-gallery"),i=n("font-awesome-icon"),c=n("copy-to-clipboard"),f=n("el-alert");return o(),l("div",Be,[r("div",qe,[s(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),r("div",Fe,[r("div",Ne,[g(a(e.$t("headshots.name.headshotsBot"))+" ",1),r("span",He,a(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",Je,[e.modelValue?.request?.template?(o(),l("p",Qe,[g(a(e.modelValue?.request?.template)+" ",1),e.modelValue?.response?$("",!0):(o(),l("span",We," - ("+a(e.$t("headshots.status.pending"))+") ",1)),e.modelValue?.response?.status==="unknown"?(o(),l("span",Ke," - ("+a(e.$t("headshots.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0?(o(),l("div",Xe,[r("div",Ye,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),s(f,{closable:!1,class:"mt-2 success"},{default:d(()=>[r("p",Ze,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",xe,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(o(),l("div",es,[s(f,{closable:!1,class:"failure"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",ss,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),r("p",ts,[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failureReason"))+": "+a(e.modelValue?.response?.error?.message)+" ",1),s(c,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",os,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),r("p",as,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+a(e.$t("headshots.name.traceId"))+": "+a(e.modelValue?.response?.trace_id)+" ",1),s(c,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?$("",!0):(o(),l("div",ns,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",is,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])),e.modelValue?.response?.status==="unknown"?(o(),l("div",ls,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",rs,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0)])])}const ds=b(je,[["render",cs],["__scopeId","data-v-d286678e"]]),ps=v({name:"RecentPanel",components:{TaskPreview:ds,ElSkeleton:oe,ElSkeletonItem:te,ScrollList:F},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.headshots?.tasks,items:this.$store.state.headshots?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ms={key:0,class:"tasks"},hs={class:"left"},us={class:"main"},fs={key:1,class:"tasks"},gs={key:2,class:"description"};function _s(e,t,m,h,k,y){const p=n("el-skeleton-item"),u=n("el-skeleton"),i=n("task-preview"),c=n("scroll-list");return o(),E(c,{ref:"scrollList",class:"panel recent",loading:e.loading,onReachTop:t[0]||(t[0]=f=>e.$emit("reach-top"))},{default:d(()=>[e.tasks?.items===void 0?(o(),l("div",ms,[(o(),l(I,null,T(3,f=>r("div",{key:f,class:"task placeholder"},[r("div",hs,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),r("div",us,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),l("div",fs,[(o(!0),l(I,null,T(e.tasks?.items,(f,_)=>(o(),E(i,{key:_,"model-value":f,class:"preview"},null,8,["model-value"]))),128))])):$("",!0),e.tasks?.items?.length===0?(o(),l("p",gs,a(e.$t("headshots.message.noTasks")),1)):$("",!0)]),_:1},8,["loading"])}const $s=b(ps,[["render",_s],["__scopeId","data-v-ffd55c16"]]),vs=j("headshots"),bs=v({name:"HeadshotsIndex",components:{ConfigPanel:Re,Layout:ce,ApplicationStatus:x,RecentPanel:$s},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.headshots?.status?.getApplications===V.Request},tasksLoading(){return this.$store.state.headshots?.status?.getTasks===V.Request||this.fetchingTasks},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===V.Request},needApply(){return this.$store.state.headshots.status.getApplications===V.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.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 N({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){O.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===Z&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const 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);const{limit:t=5,createdAtMin:m,createdAtMax:h}=e||{};console.debug("limit",t,"createdAtMin",m,"createdAtMax",h),this.fetchingTasks=!0;try{await this.$store.dispatch("headshots/getTasks",{limit:t,createdAtMin:m,createdAtMax:h})}finally{this.fetchingTasks=!1}},async onGeneratePicture(){const e={...this.config,callback_url:vs},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("headshots.message.startingTask")),z("headshots",M.generate(e,{token:t})).then(()=>{w.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(m=>{m?.response?.data?.error?.code===Y?w.error(this.$t("headshots.message.usedUp")):w.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ks(e,t,m,h,k,y){const p=n("config-panel"),u=n("application-status"),i=n("recent-panel"),c=n("layout");return o(),E(c,null,{config:d(()=>[s(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:d(()=>[s(u,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(i,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const at=b(bs,[["render",ks],["__scopeId","data-v-0af228d8"]]);export{at as default};
|
|
1
|
+
import{F as C}from"./index.es-C0ey3-R3.js";import{E as G}from"./index-BczxWa3s.js";import{E as L}from"./index-BBj2bu0O.js";import{d as v,H as l,E as r,z as A,C as s,y as d,D as n,q as o,F as a,I as g,O as I,N as T,x as E,Q as S,c as U,J as $}from"./vendor-vue-NSDaktjZ.js";import{G as b,bk as D,cp as z,bc as M,n as O,S as V,cq as j}from"./index-DmzIDab5.js";import{p as B}from"./pasteUploadMixin-BurWbGNQ.js";import{I as q,S as F,l as N}from"./pagination-DmGb5MLv.js";import{I as H}from"./ImagePreview-DaewBV0b.js";import{E as J}from"./index-DlzQ_Am-.js";import{E as w}from"./index-PvLZ3P1X.js";import{a as Q,E as W}from"./index-DFeqXt1B.js";import{E as R}from"./index-CI9L_kfK.js";import{E as K,a as X}from"./index-WjYXLdZh.js";import{b as Y,a as Z}from"./errorCode-Cqj9Td_Z.js";import{A as x}from"./Status-n83x84SF.js";import{C as ee}from"./CopyToClipboard-fcd0URBV.js";import{E as se}from"./index-Dayu-ogD.js";import{E as te,a as oe}from"./index-B5YpBNHT.js";import"./use-form-item-DdkTXwP4.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-Z-KtkVq2.js";import"./index-BfcozeoS.js";import"./typescript-KHf3OKxy.js";import"./index-C09LrJ3Z.js";import"./_baseClone-Bm4TBjKj.js";import"./_Uint8Array-DBmqcMe4.js";import"./_initCloneObject-BZf03094.js";import"./isEqual-GBLUqtKG.js";import"./debounce-DJstNg5L.js";import"./index-DHoiN4iS.js";import"./strings-beZM2Y-f.js";import"./isPlainObject-BvjdTmRY.js";const ae=v({name:"LayoutHeadshots",components:{ElDrawer:L,ElButton:G,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ne={class:"main flex flex-row flex-1"},ie={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},le={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function re(e,t,m,h,k,y){const p=n("font-awesome-icon"),u=n("el-button"),i=n("el-drawer");return o(),l("div",ne,[r("div",ie,[A(e.$slots,"config",{},void 0,!0)]),r("div",le,[A(e.$slots,"result",{},void 0,!0)]),s(u,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:d(()=>[s(p,{icon:"fa-solid fa-gear"})]),_:1}),s(i,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),"with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[A(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ce=b(ae,[["render",re],["__scopeId","data-v-c93166c8"]]),de=v({name:"ImageUrlsInput",components:{ElUpload:J,ElButton:G,InfoIcon:q,ImagePreview:H,FontAwesomeIcon:C},mixins:[B],data(){return{fileList:[],uploadUrl:D()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.headshots?.config?.image_urls},set(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){w.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){w.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),pe={class:"field"},me={class:"title font-bold"},he={class:"upload-wrapper"};function ue(e,t,m,h,k,y){const p=n("image-preview"),u=n("font-awesome-icon"),i=n("el-button"),c=n("el-upload"),f=n("info-icon");return o(),l("div",pe,[r("h2",me,a(e.$t("headshots.name.endImageUrls")),1),r("div",he,[s(c,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value upload-wrapper",limit:2,multiple:!0,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:d(({file:_})=>[s(p,{url:_.url||_.response?.file_url,name:_.name,percentage:_.percentage,onRemove:P=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])]),default:d(()=>[s(i,{size:"small",type:"primary",round:""},{default:d(()=>[s(u,{icon:"fa-solid fa-upload",class:"mr-1"}),g(" "+a(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(f,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}const fe=b(de,[["render",ue],["__scopeId","data-v-ca56051e"]]),ge="fast",_e=v({name:"ModeSelector",components:{ElRadioButton:W,ElRadioGroup:Q},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){return this.$store.state.headshots.config?.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=ge)}}),$e={class:"field"},ve={class:"title font-bold"};function be(e,t,m,h,k,y){const p=n("el-radio-button"),u=n("el-radio-group");return o(),l("div",$e,[r("h2",ve,a(e.$t("headshots.name.mode")),1),s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),class:"mode"},{default:d(()=>[(o(!0),l(I,null,T(e.options,i=>(o(),E(p,{key:i.value,label:i.value},{default:d(()=>[g(a(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}const ke=b(_e,[["render",be],["__scopeId","data-v-e7702494"]]),ye=v({name:"StylizeSelector",components:{ElTabs:X,ElTabPane:K,ElImage:R},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){console.debug("set template",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:e})}},mounted(){this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})},methods:{onToggle(e){this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})}}}),we={class:"field"},Ie=["onClick"],Te={class:"name"};function Ee(e,t,m,h,k,y){const p=n("el-image"),u=n("el-tab-pane"),i=n("el-tabs");return o(),l("div",we,[s(i,{modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=c=>e.tab=c)},{default:d(()=>[(o(!0),l(I,null,T(e.elements,(c,f)=>(o(),E(u,{key:f,label:c.displayName,name:f,class:"pane"},{default:d(()=>[(o(!0),l(I,null,T(c.items,(_,P)=>(o(),l("div",{key:P,class:S({item:!0,active:e.value===_.value}),onClick:ys=>e.onToggle(_.value)},[s(p,{src:_.image,fit:"fill",class:"preview"},null,8,["src"]),r("span",Te,a(_.label),1)],10,Ie))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}const Se=b(ye,[["render",Ee],["__scopeId","data-v-be4bd25d"]]),Ve=v({name:"PresetPanel",components:{ModeSelector:ke,ImageUrlsInput:fe,ElButton:G,FontAwesomeIcon:C,ElementsSelector:Se},emits:["generate"],computed:{config(){return this.$store.state.headshots?.config}},methods:{onGenerate(){this.$emit("generate")}}}),Ce={class:"panel"},Ae={class:"config"},Ge={class:"actions"};function Pe(e,t,m,h,k,y){const p=n("elements-selector"),u=n("mode-selector"),i=n("image-urls-input"),c=n("font-awesome-icon"),f=n("el-button");return o(),l("div",Ce,[r("div",Ae,[s(p,{class:"mb-4"}),s(u,{class:"mb-4"}),s(i,{class:"mb-4"}),r("div",Ge,[s(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(c,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+a(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}const Re=b(Ve,[["render",Pe],["__scopeId","data-v-848739f6"]]),Le=v({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:U(()=>e.modelValue?.response?.data?.slice(0,2)||[]),viewImage:h=>{window.open(h,"_blank")}}}}),Ue={class:"image-gallery"},De=["src"],ze=["onClick"];function Me(e,t,m,h,k,y){return o(),l("div",Ue,[(o(!0),l(I,null,T(e.images,(p,u)=>(o(),l("div",{key:u,class:"image-container"},[r("img",{src:p.image_url,alt:"Image"},null,8,De),p.image_url?(o(),l("button",{key:0,class:"view-button",onClick:i=>e.viewImage(p.image_url)},a(e.$t("headshots.button.viewImage")),9,ze)):$("",!0)]))),128))])}const Oe=b(Le,[["render",Me],["__scopeId","data-v-42f0a7be"]]),je=v({name:"TaskPreview",components:{ElImage:R,CopyToClipboard:ee,FontAwesomeIcon:C,ElAlert:se,ImageGallery:Oe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.headshots?.application},config(){return this.$store.state.headshots?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,m=new URL(t.src),h=m.searchParams.get("retry");if(!h)m.searchParams.set("retry","1");else if(parseInt(h)<2)m.searchParams.set("retry",(parseInt(h)+1).toString());else return;t.src=m.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Be={class:"preview"},qe={class:"left"},Fe={class:"main"},Ne={class:"bot"},He={class:"datetime"},Je={class:"info"},Qe={key:0,class:"prompt mt-2"},We={key:0},Ke={key:1},Xe={key:0,class:S({content:!0,failed:!0})},Ye={class:"image-wrapper"},Ze={class:"description"},xe={key:0,class:"description"},es={key:1,class:S({content:!0})},ss={class:"description"},ts={class:"description"},os={key:0,class:"description"},as={class:"description"},ns={key:2,class:S({content:!0})},is={class:"description"},ls={key:3,class:S({content:!0})},rs={class:"description"};function cs(e,t,m,h,k,y){const p=n("el-image"),u=n("image-gallery"),i=n("font-awesome-icon"),c=n("copy-to-clipboard"),f=n("el-alert");return o(),l("div",Be,[r("div",qe,[s(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),r("div",Fe,[r("div",Ne,[g(a(e.$t("headshots.name.headshotsBot"))+" ",1),r("span",He,a(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",Je,[e.modelValue?.request?.template?(o(),l("p",Qe,[g(a(e.modelValue?.request?.template)+" ",1),e.modelValue?.response?$("",!0):(o(),l("span",We," - ("+a(e.$t("headshots.status.pending"))+") ",1)),e.modelValue?.response?.status==="unknown"?(o(),l("span",Ke," - ("+a(e.$t("headshots.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0?(o(),l("div",Xe,[r("div",Ye,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),s(f,{closable:!1,class:"mt-2 success"},{default:d(()=>[r("p",Ze,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",xe,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(o(),l("div",es,[s(f,{closable:!1,class:"failure"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",ss,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),r("p",ts,[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failureReason"))+": "+a(e.modelValue?.response?.error?.message)+" ",1),s(c,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",os,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),r("p",as,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+a(e.$t("headshots.name.traceId"))+": "+a(e.modelValue?.response?.trace_id)+" ",1),s(c,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?$("",!0):(o(),l("div",ns,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",is,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])),e.modelValue?.response?.status==="unknown"?(o(),l("div",ls,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",rs,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0)])])}const ds=b(je,[["render",cs],["__scopeId","data-v-d286678e"]]),ps=v({name:"RecentPanel",components:{TaskPreview:ds,ElSkeleton:oe,ElSkeletonItem:te,ScrollList:F},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.headshots?.tasks,items:this.$store.state.headshots?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ms={key:0,class:"tasks"},hs={class:"left"},us={class:"main"},fs={key:1,class:"tasks"},gs={key:2,class:"description"};function _s(e,t,m,h,k,y){const p=n("el-skeleton-item"),u=n("el-skeleton"),i=n("task-preview"),c=n("scroll-list");return o(),E(c,{ref:"scrollList",class:"panel recent",loading:e.loading,onReachTop:t[0]||(t[0]=f=>e.$emit("reach-top"))},{default:d(()=>[e.tasks?.items===void 0?(o(),l("div",ms,[(o(),l(I,null,T(3,f=>r("div",{key:f,class:"task placeholder"},[r("div",hs,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),r("div",us,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),l("div",fs,[(o(!0),l(I,null,T(e.tasks?.items,(f,_)=>(o(),E(i,{key:_,"model-value":f,class:"preview"},null,8,["model-value"]))),128))])):$("",!0),e.tasks?.items?.length===0?(o(),l("p",gs,a(e.$t("headshots.message.noTasks")),1)):$("",!0)]),_:1},8,["loading"])}const $s=b(ps,[["render",_s],["__scopeId","data-v-ffd55c16"]]),vs=j("headshots"),bs=v({name:"HeadshotsIndex",components:{ConfigPanel:Re,Layout:ce,ApplicationStatus:x,RecentPanel:$s},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.headshots?.status?.getApplications===V.Request},tasksLoading(){return this.$store.state.headshots?.status?.getTasks===V.Request||this.fetchingTasks},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===V.Request},needApply(){return this.$store.state.headshots.status.getApplications===V.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.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 N({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){O.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===Z&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const 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);const{limit:t=5,createdAtMin:m,createdAtMax:h}=e||{};console.debug("limit",t,"createdAtMin",m,"createdAtMax",h),this.fetchingTasks=!0;try{await this.$store.dispatch("headshots/getTasks",{limit:t,createdAtMin:m,createdAtMax:h})}finally{this.fetchingTasks=!1}},async onGeneratePicture(){const e={...this.config,callback_url:vs},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("headshots.message.startingTask")),z("headshots",M.generate(e,{token:t})).then(()=>{w.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(m=>{m?.response?.data?.error?.code===Y?w.error(this.$t("headshots.message.usedUp")):w.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ks(e,t,m,h,k,y){const p=n("config-panel"),u=n("application-status"),i=n("recent-panel"),c=n("layout");return o(),E(c,null,{config:d(()=>[s(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:d(()=>[s(u,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(i,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const at=b(bs,[["render",ks],["__scopeId","data-v-0af228d8"]]);export{at as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as S,d as G}from"./avatar-
|
|
1
|
+
import{L as S,d as G}from"./avatar-BXgDZw59.js";import{bu as V,br as A,bv as q,bw as M,bm as j,bt as O,G as k,bx as P}from"./index-DmzIDab5.js";import{b as z,E as J,a as K}from"./index-D13GCfoT.js";import{E as W}from"./index-BczxWa3s.js";import{E as X,a as Y}from"./index-BG50CX5a.js";import{a as L,E as R}from"./index-BglU6saV.js";import{d as g,x as u,y as n,C as o,G as i,J as p,I as _,F as m,H as I,E as f,D as t,K as Q,q as r}from"./vendor-vue-NSDaktjZ.js";import{F as Z}from"./index.es-C0ey3-R3.js";import{a as N,b as x,c as ee,E as oe}from"./index-BLZB5LF-.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-KHf3OKxy.js";import"./index-DE7HX_fp.js";import"./index-Z-KtkVq2.js";import"./index-BfcozeoS.js";import"./index-BuyEbX8F.js";import"./index-BTDJ_dCb.js";import"./use-form-item-DdkTXwP4.js";import"./index-CO2v-Uge.js";import"./dropdown-B92ywxBD.js";import"./castArray-BlsV8Nl5.js";const te=g({name:"TopHeader",components:{ElCol:R,Logo:S,ElRow:L,ElDropdown:Y,ElMenu:K,ElMenuItem:J,ElDropdownItem:X,ElButton:W,ElSubMenu:z},data(){return{defaultAvatar:G,products:"chat"}},computed:{site(){return this.$store.state?.site},dark(){return this.$store.getters?.dark},active(){return this.$route.matched?.[0]?.path},user(){return this.$store.getters?.user},authenticated(){return this.$store.getters?.authenticated}},methods:{openTab(e){window.open(e,"_blank")},onSelect(e){e&&this.$router.push(e)},onHome(){this.$router.push({name:j})},onLogin(){this.$router.push({name:M})},onDownload(){this.$router.push({name:q})},onProfile(){const e=O();window.open(A(`${e}/user/profile`),"_blank")},onVerify(){const e=O();window.open(A(`${e}/user/verify`),"_blank")},onConsole(){this.$router.push({name:V})},async onLogout(){this.$store.dispatch("logout")}}}),ne={key:0,class:"mt-4 pr-10"},ae={key:1,class:"float-right"},se=["src"];function re(e,s,C,E,y,D){const h=t("logo"),c=t("el-col"),a=t("el-menu-item"),$=t("el-sub-menu"),b=t("el-menu"),v=t("el-button"),w=t("language-selector"),U=t("dark-selector"),T=t("el-dropdown-item"),B=t("el-dropdown-menu"),F=t("el-dropdown"),H=t("el-row"),l=Q("t");return r(),u(H,{class:"header"},{default:n(()=>[o(c,{md:4,xs:24,class:"brand-col"},{default:n(()=>[o(h,{onClick:e.onHome},null,8,["onClick"])]),_:1}),o(c,{md:16,xs:13},{default:n(()=>[o(b,{"default-active":e.active,mode:"horizontal",class:"menu",ellipsis:!0,onSelect:e.onSelect},{default:n(()=>[o($,{index:e.products},{title:n(()=>[_(m(e.$t("common.nav.products")),1)]),default:n(()=>[e.site?.features?.chatgpt?.enabled?i((r(),u(a,{key:0,index:"/chat"},null,512)),[[l,"index.title.chat"]]):p("",!0),e.site?.features?.midjourney?.enabled?i((r(),u(a,{key:1,index:"/midjourney"},null,512)),[[l,"index.title.midjourney"]]):p("",!0),e.site?.features?.qrart?.enabled?i((r(),u(a,{key:2,index:"/qrart"},null,512)),[[l,"index.title.qrart"]]):p("",!0),e.site?.features?.suno?.enabled?i((r(),u(a,{key:3,index:"/suno"},null,512)),[[l,"index.title.suno"]]):p("",!0),e.site?.features?.luma?.enabled?i((r(),u(a,{key:4,index:"/luma"},null,512)),[[l,"index.title.luma"]]):p("",!0),e.site?.features?.headshots?.enabled?i((r(),u(a,{key:5,index:"/headshots"},null,512)),[[l,"index.title.headshots"]]):p("",!0)]),_:1},8,["index"]),i(o(a,{onRoute:d=>{},onClick:e.onDownload},null,8,["onClick"]),[[l,"common.nav.mobileApp"]]),i(o(a,{onRoute:d=>{},onClick:s[0]||(s[0]=d=>e.openTab("https://platform.acedata.cloud"))},null,512),[[l,"common.nav.apiPlatform"]]),i(o(a,{onRoute:d=>{},onClick:s[1]||(s[1]=d=>e.openTab("https://platform.acedata.cloud/support"))},null,512),[[l,"common.nav.support"]]),i(o(a,{onRoute:d=>{},onClick:s[2]||(s[2]=d=>e.openTab("https://platform.acedata.cloud/earning"))},null,512),[[l,"common.nav.referral"]])]),_:1},8,["default-active","onSelect"])]),_:1}),o(c,{md:4,xs:11},{default:n(()=>[e.authenticated?(r(),I("div",ae,[f("div",{class:"console",onClick:s[3]||(s[3]=(...d)=>e.onConsole&&e.onConsole(...d))},m(e.$t("common.button.console")),1),o(F,{trigger:"click"},{dropdown:n(()=>[o(B,null,{default:n(()=>[o(T,{onClick:e.onProfile},{default:n(()=>[_(m(e.$t("common.button.profile")),1)]),_:1},8,["onClick"]),o(T,{onClick:e.onLogout},{default:n(()=>[_(m(e.$t("common.button.logout")),1)]),_:1},8,["onClick"])]),_:1})]),default:n(()=>[f("img",{src:e.user?.avatar||e.defaultAvatar,class:"avatar"},null,8,se)]),_:1})])):(r(),I("div",ne,[o(v,{type:"primary",class:"float-right",size:"small",round:"",onClick:e.onLogin},{default:n(()=>[_(m(e.$t("common.button.login")),1)]),_:1},8,["onClick"]),o(w,{class:"locale float-right mr-4"}),o(U,{class:"float-right mr-4"})]))]),_:1})]),_:1})}const le=k(te,[["render",re]]),ie=g({name:"BottomFooter",components:{ElContainer:N,ElRow:L,ElCol:R,FontAwesomeIcon:Z},data(){return{faGithub:P}},computed:{},methods:{}}),ue={href:"/download"},me={href:"https://platform.acedata.cloud"},ce=["title"];function de(e,s,C,E,y,D){const h=t("font-awesome-icon"),c=t("el-col"),a=t("el-row"),$=t("el-container");return r(),u($,{id:"footer",class:"footer"},{default:n(()=>[o(a,{class:"w-full"},{default:n(()=>[o(c,{class:"container",span:18,offset:3},{default:n(()=>[o(a,null,{default:n(()=>[o(c,{span:24,class:"text-center"},{default:n(()=>[f("p",null,[f("a",ue,m(e.$t("common.nav.mobileApp")),1),s[0]||(s[0]=_(" · ",-1)),f("a",me,m(e.$t("common.entity.website")),1),_(" © "+m(new Date().getFullYear())+" "+m(e.$t("common.entity.copyright"))+" · ",1),f("a",{href:"https://github.com/AceDataCloud/Nexior",target:"_blank",rel:"noopener noreferrer",class:"github-link",title:e.$t("common.nav.github")},[o(h,{icon:e.faGithub},null,8,["icon"])],8,ce)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const pe=k(ie,[["render",de],["__scopeId","data-v-f6b91b08"]]),_e=g({name:"LayoutIndex",components:{TopHeader:le,BottomFooter:pe,ElContainer:N,ElMain:oe,ElFooter:ee,ElHeader:x}});function fe(e,s,C,E,y,D){const h=t("top-header"),c=t("el-header"),a=t("router-view"),$=t("el-main"),b=t("bottom-footer"),v=t("el-footer"),w=t("el-container");return r(),u(w,{class:"wrapper min-h-[100vh]"},{default:n(()=>[o(c,{class:"header p-0 h-auto"},{default:n(()=>[o(h)]),_:1}),o($,{class:"main"},{default:n(()=>[o(a)]),_:1}),o(v,{class:"footer p-0 h-auto"},{default:n(()=>[o(b)]),_:1})]),_:1})}const Se=k(_e,[["render",fe]]);export{Se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as E}from"./index.es-B-oBIK4i.js";import{E as L}from"./index-hkeQzgSz.js";import{E as ce}from"./index-DoMPvIeR.js";import{d as b,H as u,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as S,O as I,N as T,Q as U,J as k,R as ke,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bl as G,ah as ye,H as we,cu as te,aH as oe,S as ne,cv as Ce}from"./index-BVNvjRp7.js";import{b as Se,c as se,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as P}from"./index-D2S4J9sX.js";import{E as q}from"./index-6WXbEX6N.js";import{E as C}from"./index-D2EVue7e.js";import{I as V,S as Ee,l as Le}from"./pagination-SBJi51n4.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-Cd1_21Ps.js";import{E as W}from"./index-D0ECG3FC.js";import{E as O}from"./index-CXcxS6Tb.js";import{C as de}from"./Consumption-CAhrj82G.js";import{E as ue}from"./index-Bc_L-KVx.js";import{E as me}from"./index-jdJj9m9s.js";import{E as pe}from"./index-DpAJ2tcJ.js";import{E as J}from"./index-BQTeuJfN.js";import{a as ge}from"./price-BvAGRK8n.js";import{F as Me}from"./FilePreview-3GV2SWsm.js";import{E as Re,a as Ue}from"./index-Ms3ynCfw.js";import{E as De,a as Ae}from"./index-fgfJZlZE.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Pe}from"./CopyToClipboard-COxFR3cx.js";import{V as Ge}from"./VideoPlayer-bUE3PTPG.js";import{E as Ke}from"./index-DRJcmib8.js";import{E as Oe}from"./index-d2rqZZYz.js";import{B as je}from"./BotPlaceholder-SsROT5uE.js";import{N as Ne}from"./NoTasks-B_ODnKax.js";import"./use-form-item-BbBsagre.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-BeRl9zcZ.js";import"./typescript-CODnKE5F.js";import"./index-CqvHUGbn.js";import"./strings-beZM2Y-f.js";import"./isEqual-hkTAHR86.js";import"./_Uint8Array-CvdQKNTH.js";import"./castArray-DNZQWJZ9.js";import"./debounce-eIYMYWhR.js";import"./_baseIteratee-D4WzrUe9.js";import"./index-BajT1XSW.js";import"./validator-ZvH0hMEF.js";import"./index-DMegc4HX.js";import"./_baseClone-DS_LGzZX.js";import"./_initCloneObject-BtMKtTta.js";import"./index-Cu41y2Fl.js";import"./index-DC3bbaVK.js";import"./isPlainObject-DojcLKlA.js";import"./vue-plyr-BO2nlN4c.js";import"./index-BDEUkDca.js";const Be=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),ze={class:"main flex flex-row flex-1 min-h-0"},Fe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function He(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),u("div",ze,[i("div",Fe,[N(e.$slots,"config",{},void 0,!0)]),i("div",qe,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const We=y(Be,[["render",He],["__scopeId","data-v-394a324b"]]),Je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(e,t,s){const a=t||"std",m=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:m===5,audio:!1,motionControl:m===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="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:a!=="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 Je}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,m=t.duration??e.duration;if(!s)return[];const $=Q(s,a,m),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function X(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Qe=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},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(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(m=>this.$t(m.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const m=X({...t,model:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Ye={class:"field"},Xe={class:"title font-bold"};function Ze(e,t,s,a,m,$){const d=o("el-option"),p=o("el-select");return l(),u("div",Ye,[i("h2",Xe,r(e.$t("pika.name.model")),1),(l(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,f=>(l(),S(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const xe=y(Qe,[["render",Ze],["__scopeId","data-v-04059875"]]),et=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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 F.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(se)}},mounted(){this.value||this.applyMode(se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(m=>this.$t(m.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const m=X({...t,mode:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),tt={class:"field"},ot={class:"header"},nt={class:"title font-bold"},st={key:0,class:"opt-tip"};function it(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",tt,[i("div",ot,[i("h2",nt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),u("span",st,r(c.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const lt=y(et,[["render",it],["__scopeId","data-v-9a8fa3c5"]]),at=[3,5,8,10,12,15],rt=[5,10],ct=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?at:rt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(m=>this.$t(m.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const m=X({...t,duration:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),dt={class:"field"},ut={class:"control"},mt={class:"label"},pt={class:"title font-bold"};function gt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",dt,[i("div",ut,[i("div",mt,[i("h2",pt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.allowedDurations,c=>(l(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ft=y(ct,[["render",gt],["__scopeId","data-v-5ae55e28"]]),ht=b({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||(this.value=Ve)}}),_t={class:"text-sm font-bold mb-2 block"},$t={class:"items"},vt=["onClick"],kt={class:"name"};function bt(e,t,s,a,m,$){return l(),u("div",null,[i("span",_t,r(e.$t("kling.name.ratio")),1),i("div",$t,[(l(!0),u(I,null,T(e.options,(d,p)=>(l(),u("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ke({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",kt,r(d.label),1)],10,vt))),128))])])}const yt=y(ht,[["render",bt],["__scopeId","data-v-cdb14b2f"]]),wt=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:G()+"/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||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Ct={class:"relative"},St={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},It={class:"text-sm font-bold"};function Tt(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Ct,[i("div",St,[i("div",Vt,[i("span",It,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$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"])])}const Et=y(wt,[["render",Tt],["__scopeId","data-v-68cf38f5"]]),Lt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:V,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(C.warning(this.$t("kling.message.endImageRequiresStart")),!1):(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Mt={class:"relative"},Rt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"};function At(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Mt,[i("div",Rt,[i("div",Ut,[i("span",Dt,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$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"])])}const Pt=y(Lt,[["render",At],["__scopeId","data-v-593c3bde"]]),Gt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:V,ElInputNumber:ue},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||(this.value=Ie)}}),Kt={class:"flex justify-between"},Ot={class:"flex justify-start items-center"},jt={class:"text-sm font-bold"},Nt={class:"flex justify-end items-center"},Bt={class:"w-full"};function zt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),u("div",null,[i("div",Kt,[i("div",Ot,[i("span",jt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Nt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Bt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Ft=y(Gt,[["render",zt]]),qt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:V},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.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??Te:!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})}}}),Ht={class:"relative"},Wt={class:"flex justify-between items-center"},Jt={class:"flex justify-start items-center"},Qt={class:"text-sm font-bold"};function Yt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Ht,[i("div",Wt,[i("div",Jt,[i("span",Qt,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Xt=y(qt,[["render",Yt]]),Zt=["horizontal","vertical","pan","tilt","roll","zoom"],xt=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:ue,InfoIcon:V},data(){return{configKeys:Zt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="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){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},m={...a.config||{}};t==null?delete m[e]:m[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:m}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),eo={class:"field"},to={class:"header"},oo={class:"text-sm font-bold"},no={key:0,class:"config-grid"},so={class:"cfg-row-head"},io={class:"cfg-name"};function lo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),v=o("el-slider");return l(),u("div",eo,[i("div",to,[i("span",oo,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),u(I,null,T(e.typeOptions,g=>(l(),S(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),u("div",no,[(l(!0),u(I,null,T(e.configKeys,g=>(l(),u("div",{key:g,class:"cfg-row"},[i("div",so,[i("span",io,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const ao=y(xt,[["render",lo],["__scopeId","data-v-cd896060"]]),fe=[{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"]}],B=", ";function ro(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const m of s)if(a.includes(m)){a=a.replace(m,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const co=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),uo={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function go(e,t,s,a,m,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),u("div",uo,[(l(!0),u(I,null,T(e.selected,p=>(l(),u("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const fo=y(co,[["render",go],["__scopeId","data-v-5fc4fa65"]]),ho="",_o=b({name:"PromptInput",components:{ElInput:J,ElButton:L,FontAwesomeIcon:E,InfoIcon:V,InspirationPills:fo},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ho)}}),$o={class:"field"},vo={class:"box"},ko={class:"title font-bold"},bo={class:"actions"};function yo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),c=o("inspiration-pills"),v=o("el-input");return l(),u("div",$o,[i("div",vo,[i("h2",ko,r(e.$t("kling.name.prompt")),1),i("div",bo,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(c),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const wo=y(_o,[["render",yo],["__scopeId","data-v-0a5c57b8"]]),Co="",So=b({name:"NegativePromptInput",components:{ElInput:J,InfoIcon:V},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||(this.prompt=Co)}}),Vo={class:"field"},Io={class:"box"},To={class:"title font-bold"};function Eo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Vo,[i("div",Io,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Lo=y(So,[["render",Eo],["__scopeId","data-v-de98cf01"]]),Mo=b({name:"InspirationDrawer",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},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(t=>this.$t(`kling.inspiration.chip.${t}`)))},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(z(this.prompt,e)):this.setPrompt(ro(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Ro={class:"drawer-content"},Uo={class:"drawer-header"},Do={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Go={key:0,class:"selected-bar"},Ko={class:"selected-text"},Oo={class:"groups"},jo={class:"group-title"},No={class:"chip-grid"},Bo=["onClick"];function zo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),S(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Ro,[i("div",Uo,[i("div",Do,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),u("div",Go,[i("span",Ko,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):k("",!0),i("div",Oo,[(l(!0),u(I,null,T(e.groups,c=>(l(),u("div",{key:c.groupKey,class:"group"},[i("div",jo,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",No,[(l(!0),u(I,null,T(c.chipKeys,v=>(l(),u("button",{key:v,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,Bo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Fo=y(Mo,[["render",zo],["__scopeId","data-v-7d457a69"]]),qo={"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"},Ho={std:"720p",pro:"1080p","4k":"4K"},Wo=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return qo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Ho[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Jo={class:"summary-chip"},Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"];function en(e,t,s,a,m,$){const d=o("font-awesome-icon");return l(),u("div",Jo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Qo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Yo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Xo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Zo),e.generateAudio?(l(),u("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,xo)):k("",!0)])}const tn=y(Wo,[["render",en],["__scopeId","data-v-418a6733"]]),on=b({name:"ConfigPanel",components:{ElButton:L,Consumption:de,FontAwesomeIcon:E,PromptInput:wo,NegativePromptInput:Lo,ModelSelector:xe,ModeSelector:lt,DurationSelector:ft,RatioSelector:yt,StartImage:Et,CfgScaleSelector:Ft,GenerateAudioSelector:Xt,CameraControlSelector:ao,InspirationDrawer:Fo,SummaryChip:tn,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),nn={class:"flex flex-col h-full"},sn={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function an(e,t,s,a,m,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),ve=o("inspiration-drawer");return l(),u("div",nn,[i("div",sn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",ln,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),S(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),S(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ve,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const rn=y(on,[["render",an]]),cn=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),dn={class:"relative"},un={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function gn(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",dn,[i("div",un,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),S(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const fn=y(cn,[["render",gn],["__scopeId","data-v-37d42da7"]]),hn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:V,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:G()+"/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(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.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){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),_n={class:"relative"},$n={class:"flex justify-between"},vn={class:"flex justify-start items-center"},kn={class:"text-sm font-bold"};function bn(e,t,s,a,m,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",_n,[i("div",$n,[i("div",vn,[i("span",kn,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.percentage!==void 0?(l(),S(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const yn=y(hn,[["render",bn],["__scopeId","data-v-5cf93212"]]),wn=b({name:"MotionPromptInput",components:{ElInput:J,InfoIcon:V},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Cn={class:"field"},Sn={class:"box"},Vn={class:"title font-bold"};function In(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Cn,[i("div",Sn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Tn=y(wn,[["render",In],["__scopeId","data-v-ca9fdbe5"]]),le="video",En=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ue,ElRadioButton:Re,InfoIcon:V},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},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=le)}}),Ln={class:"field"},Mn={class:"header"},Rn={class:"text-sm font-bold"};function Un(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),u("div",Ln,[i("div",Mn,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Dn=y(En,[["render",Un],["__scopeId","data-v-7a91195b"]]),ae="std",An=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),Pn={class:"field"},Gn={class:"header"},Kn={class:"title font-bold"};function On(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",Pn,[i("div",Gn,[i("h2",Kn,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jn=y(An,[["render",On],["__scopeId","data-v-1295688c"]]),Nn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,InfoIcon:V},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"})}}}}),Bn={class:"relative"},zn={class:"flex justify-between items-center"},Fn={class:"flex justify-start items-center"},qn={class:"text-sm font-bold"};function Hn(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Bn,[i("div",zn,[i("div",Fn,[i("span",qn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Wn=y(Nn,[["render",Hn]]),Jn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:de,MotionImage:fn,MotionVideo:yn,MotionPromptInput:Tn,CharacterOrientationSelector:Dn,MotionModeSelector:jn,KeepOriginalSoundSelector:Wn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Qn={class:"flex flex-col h-full"},Yn={class:"flex-1 overflow-y-auto p-5"},Xn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zn(e,t,s,a,m,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),u("div",Qn,[i("div",Yn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Xn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const xn=y(Jn,[["render",Zn]]),es=b({name:"KlingTabSwitcher",components:{ElTabs:Ae,ElTabPane:De,ElTag:we},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")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),ts=["title"],os={class:"text"};function ns(e,t,s,a,m,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),S(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),u(I,null,T(e.tabs,c=>(l(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",os,r(c.label),1),c.badge?(l(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):k("",!0)],8,ts)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ss=y(es,[["render",ns],["__scopeId","data-v-bf00c27e"]]),is=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:Pe,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,ElTooltip:W,ElButton:L,ImagePreview:K},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ls={class:"preview"},as={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},us={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},gs={key:0},fs={key:1},hs={key:0,class:U({content:!0,failed:!0})},_s={key:0,class:"mb-4"},$s={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ys={key:1,class:U({content:!0})},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Is={key:2,class:U({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Es={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ls(e,t,s,a,m,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),u("div",ls,[i("div",as,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",rs,[i("div",cs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",ds,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",us,[e.referenceImages.length>0?(l(),u("div",ms,[(l(!0),u(I,null,T(e.referenceImages,(R,j)=>(l(),S(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),u("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),u("span",gs," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),u("span",fs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),u("div",hs,[e.modelValue?.response.video_url?(l(),u("div",_s,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),u("div",$s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",ks,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),u("p",bs,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),u("div",ys,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",ws,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",Cs,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),u("p",Ss,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0),e.modelValue?.response?.trace_id?(l(),u("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),u("div",Is,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ts,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),u("p",Es,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ms=y(is,[["render",Ls],["__scopeId","data-v-e8e87659"]]),Rs=b({name:"RecentPanel",components:{TaskPreview:Ms,NoTasks:Ne,BotPlaceholder:je,ScrollList:Ee},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?.()}}}),Us={key:0},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,m,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),u(I,null,[e.tasks?.items===void 0?(l(),u("div",Us,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),S(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),u(I,null,T(e.tasks?.items,v=>(l(),S(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),u("div",Ds,[n(c)])):k("",!0)],64)}const Ps=y(Rs,[["render",As]]),re=Ce("kling"),Gs=b({name:"KlingIndex",components:{ConfigPanel:rn,MotionPanel:xn,TabSwitcher:ss,Layout:We,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},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 Le({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();const 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);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:re};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){C.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,m])=>m!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(m=>{m?.response?.data?.error?.code===ie?C.error(this.$t("kling.message.usedUp")):C.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(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){C.warning(this.$t("kling.message.motionMissingInputs"));return}const 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.prompt?{prompt:e.prompt}:{},callback_url:re},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Ks={class:"flex flex-col h-full"},Os={class:"flex-1 min-h-0"};function js(e,t,s,a,m,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),v=o("layout");return l(),S(v,null,{config:h(()=>[i("div",Ks,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Os,[e.taskType==="videos"?(l(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),S(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Gs,[["render",js]]);export{Ni as default};
|
|
1
|
+
import{F as E}from"./index.es-C0ey3-R3.js";import{E as L}from"./index-BczxWa3s.js";import{E as ce}from"./index-BBj2bu0O.js";import{d as b,H as u,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as S,O as I,N as T,Q as U,J as k,R as ke,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bk as P,ah as ye,H as we,cp as te,aG as oe,S as ne,cq as Ce}from"./index-DmzIDab5.js";import{b as Se,c as se,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as G}from"./index-DWZT6KAN.js";import{E as q}from"./index-PVwHwQrT.js";import{E as C}from"./index-PvLZ3P1X.js";import{I as V,S as Ee,l as Le}from"./pagination-DmGb5MLv.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-DaewBV0b.js";import{E as W}from"./index-Z-KtkVq2.js";import{E as O}from"./index-DlzQ_Am-.js";import{C as de}from"./Consumption-DOBMmPDx.js";import{E as ue}from"./index-Dyl__F53.js";import{E as me}from"./index-D4H-Ti5i.js";import{E as pe}from"./index-BhwFaUXW.js";import{E as J}from"./index-BmF4EUul.js";import{a as ge}from"./price-DcG4BRcB.js";import{F as Me}from"./FilePreview-87sqKMNC.js";import{E as Re,a as Ue}from"./index-DFeqXt1B.js";import{E as De,a as Ae}from"./index-WjYXLdZh.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Ge}from"./CopyToClipboard-fcd0URBV.js";import{V as Pe}from"./VideoPlayer-CaCit_ZB.js";import{E as Ke}from"./index-Dayu-ogD.js";import{E as Oe}from"./index-CI9L_kfK.js";import{B as je}from"./BotPlaceholder-rIUYY_kq.js";import{N as Ne}from"./NoTasks-D-T1pxT-.js";import"./use-form-item-DdkTXwP4.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-CO2v-Uge.js";import"./typescript-KHf3OKxy.js";import"./index-BfcozeoS.js";import"./strings-beZM2Y-f.js";import"./isEqual-GBLUqtKG.js";import"./_Uint8Array-DBmqcMe4.js";import"./castArray-BlsV8Nl5.js";import"./debounce-DJstNg5L.js";import"./_baseIteratee-BAZHAt5C.js";import"./index-BTDJ_dCb.js";import"./validator-BHNihkZT.js";import"./index-C09LrJ3Z.js";import"./_baseClone-Bm4TBjKj.js";import"./_initCloneObject-BZf03094.js";import"./index-Cu41y2Fl.js";import"./index-DHoiN4iS.js";import"./isPlainObject-BvjdTmRY.js";import"./vue-plyr-BO2nlN4c.js";import"./index-B5YpBNHT.js";const Be=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),ze={class:"main flex flex-row flex-1 min-h-0"},Fe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function He(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),u("div",ze,[i("div",Fe,[N(e.$slots,"config",{},void 0,!0)]),i("div",qe,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const We=y(Be,[["render",He],["__scopeId","data-v-394a324b"]]),Je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(e,t,s){const a=t||"std",m=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:m===5,audio:!1,motionControl:m===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="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:a!=="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 Je}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,m=t.duration??e.duration;if(!s)return[];const $=Q(s,a,m),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function X(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Qe=b({name:"ModelSelector",components:{ElSelect:G,ElOption:A},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(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(m=>this.$t(m.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const m=X({...t,model:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Ye={class:"field"},Xe={class:"title font-bold"};function Ze(e,t,s,a,m,$){const d=o("el-option"),p=o("el-select");return l(),u("div",Ye,[i("h2",Xe,r(e.$t("pika.name.model")),1),(l(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,f=>(l(),S(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const xe=y(Qe,[["render",Ze],["__scopeId","data-v-04059875"]]),et=b({name:"ModeSelector",components:{ElSelect:G,ElOption:A,InfoIcon:V},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 F.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(se)}},mounted(){this.value||this.applyMode(se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(m=>this.$t(m.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const m=X({...t,mode:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),tt={class:"field"},ot={class:"header"},nt={class:"title font-bold"},st={key:0,class:"opt-tip"};function it(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",tt,[i("div",ot,[i("h2",nt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),u("span",st,r(c.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const lt=y(et,[["render",it],["__scopeId","data-v-9a8fa3c5"]]),at=[3,5,8,10,12,15],rt=[5,10],ct=b({name:"DurationSelector",components:{ElSelect:G,ElOption:A,InfoIcon:V},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?at:rt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(m=>this.$t(m.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const m=X({...t,duration:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),dt={class:"field"},ut={class:"control"},mt={class:"label"},pt={class:"title font-bold"};function gt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",dt,[i("div",ut,[i("div",mt,[i("h2",pt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.allowedDurations,c=>(l(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ft=y(ct,[["render",gt],["__scopeId","data-v-5ae55e28"]]),ht=b({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||(this.value=Ve)}}),_t={class:"text-sm font-bold mb-2 block"},$t={class:"items"},vt=["onClick"],kt={class:"name"};function bt(e,t,s,a,m,$){return l(),u("div",null,[i("span",_t,r(e.$t("kling.name.ratio")),1),i("div",$t,[(l(!0),u(I,null,T(e.options,(d,p)=>(l(),u("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ke({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",kt,r(d.label),1)],10,vt))),128))])])}const yt=y(ht,[["render",bt],["__scopeId","data-v-cdb14b2f"]]),wt=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:P()+"/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||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Ct={class:"relative"},St={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},It={class:"text-sm font-bold"};function Tt(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Ct,[i("div",St,[i("div",Vt,[i("span",It,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$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"])])}const Et=y(wt,[["render",Tt],["__scopeId","data-v-68cf38f5"]]),Lt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:V,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:P()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(C.warning(this.$t("kling.message.endImageRequiresStart")),!1):(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Mt={class:"relative"},Rt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"};function At(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Mt,[i("div",Rt,[i("div",Ut,[i("span",Dt,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$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"])])}const Gt=y(Lt,[["render",At],["__scopeId","data-v-593c3bde"]]),Pt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:V,ElInputNumber:ue},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||(this.value=Ie)}}),Kt={class:"flex justify-between"},Ot={class:"flex justify-start items-center"},jt={class:"text-sm font-bold"},Nt={class:"flex justify-end items-center"},Bt={class:"w-full"};function zt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),u("div",null,[i("div",Kt,[i("div",Ot,[i("span",jt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Nt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Bt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Ft=y(Pt,[["render",zt]]),qt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:V},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.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??Te:!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})}}}),Ht={class:"relative"},Wt={class:"flex justify-between items-center"},Jt={class:"flex justify-start items-center"},Qt={class:"text-sm font-bold"};function Yt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Ht,[i("div",Wt,[i("div",Jt,[i("span",Qt,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Xt=y(qt,[["render",Yt]]),Zt=["horizontal","vertical","pan","tilt","roll","zoom"],xt=b({name:"CameraControlSelector",components:{ElSelect:G,ElOption:A,ElSlider:me,ElInputNumber:ue,InfoIcon:V},data(){return{configKeys:Zt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="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){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},m={...a.config||{}};t==null?delete m[e]:m[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:m}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),eo={class:"field"},to={class:"header"},oo={class:"text-sm font-bold"},no={key:0,class:"config-grid"},so={class:"cfg-row-head"},io={class:"cfg-name"};function lo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),v=o("el-slider");return l(),u("div",eo,[i("div",to,[i("span",oo,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),u(I,null,T(e.typeOptions,g=>(l(),S(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),u("div",no,[(l(!0),u(I,null,T(e.configKeys,g=>(l(),u("div",{key:g,class:"cfg-row"},[i("div",so,[i("span",io,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const ao=y(xt,[["render",lo],["__scopeId","data-v-cd896060"]]),fe=[{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"]}],B=", ";function ro(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const m of s)if(a.includes(m)){a=a.replace(m,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const co=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),uo={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function go(e,t,s,a,m,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),u("div",uo,[(l(!0),u(I,null,T(e.selected,p=>(l(),u("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const fo=y(co,[["render",go],["__scopeId","data-v-5fc4fa65"]]),ho="",_o=b({name:"PromptInput",components:{ElInput:J,ElButton:L,FontAwesomeIcon:E,InfoIcon:V,InspirationPills:fo},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ho)}}),$o={class:"field"},vo={class:"box"},ko={class:"title font-bold"},bo={class:"actions"};function yo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),c=o("inspiration-pills"),v=o("el-input");return l(),u("div",$o,[i("div",vo,[i("h2",ko,r(e.$t("kling.name.prompt")),1),i("div",bo,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(c),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const wo=y(_o,[["render",yo],["__scopeId","data-v-0a5c57b8"]]),Co="",So=b({name:"NegativePromptInput",components:{ElInput:J,InfoIcon:V},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||(this.prompt=Co)}}),Vo={class:"field"},Io={class:"box"},To={class:"title font-bold"};function Eo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Vo,[i("div",Io,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Lo=y(So,[["render",Eo],["__scopeId","data-v-de98cf01"]]),Mo=b({name:"InspirationDrawer",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},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(t=>this.$t(`kling.inspiration.chip.${t}`)))},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(z(this.prompt,e)):this.setPrompt(ro(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Ro={class:"drawer-content"},Uo={class:"drawer-header"},Do={class:"title-row"},Ao={class:"title"},Go={class:"hint"},Po={key:0,class:"selected-bar"},Ko={class:"selected-text"},Oo={class:"groups"},jo={class:"group-title"},No={class:"chip-grid"},Bo=["onClick"];function zo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),S(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Ro,[i("div",Uo,[i("div",Do,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Go,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),u("div",Po,[i("span",Ko,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):k("",!0),i("div",Oo,[(l(!0),u(I,null,T(e.groups,c=>(l(),u("div",{key:c.groupKey,class:"group"},[i("div",jo,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",No,[(l(!0),u(I,null,T(c.chipKeys,v=>(l(),u("button",{key:v,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,Bo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Fo=y(Mo,[["render",zo],["__scopeId","data-v-7d457a69"]]),qo={"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"},Ho={std:"720p",pro:"1080p","4k":"4K"},Wo=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return qo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Ho[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Jo={class:"summary-chip"},Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"];function en(e,t,s,a,m,$){const d=o("font-awesome-icon");return l(),u("div",Jo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Qo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Yo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Xo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Zo),e.generateAudio?(l(),u("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,xo)):k("",!0)])}const tn=y(Wo,[["render",en],["__scopeId","data-v-418a6733"]]),on=b({name:"ConfigPanel",components:{ElButton:L,Consumption:de,FontAwesomeIcon:E,PromptInput:wo,NegativePromptInput:Lo,ModelSelector:xe,ModeSelector:lt,DurationSelector:ft,RatioSelector:yt,StartImage:Et,CfgScaleSelector:Ft,GenerateAudioSelector:Xt,CameraControlSelector:ao,InspirationDrawer:Fo,SummaryChip:tn,EndImage:Gt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),nn={class:"flex flex-col h-full"},sn={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function an(e,t,s,a,m,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),ve=o("inspiration-drawer");return l(),u("div",nn,[i("div",sn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",ln,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),S(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),S(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ve,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const rn=y(on,[["render",an]]),cn=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:P()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),dn={class:"relative"},un={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function gn(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",dn,[i("div",un,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),S(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const fn=y(cn,[["render",gn],["__scopeId","data-v-37d42da7"]]),hn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:V,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:P()+"/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(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.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){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),_n={class:"relative"},$n={class:"flex justify-between"},vn={class:"flex justify-start items-center"},kn={class:"text-sm font-bold"};function bn(e,t,s,a,m,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",_n,[i("div",$n,[i("div",vn,[i("span",kn,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.percentage!==void 0?(l(),S(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const yn=y(hn,[["render",bn],["__scopeId","data-v-5cf93212"]]),wn=b({name:"MotionPromptInput",components:{ElInput:J,InfoIcon:V},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Cn={class:"field"},Sn={class:"box"},Vn={class:"title font-bold"};function In(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Cn,[i("div",Sn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Tn=y(wn,[["render",In],["__scopeId","data-v-ca9fdbe5"]]),le="video",En=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ue,ElRadioButton:Re,InfoIcon:V},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},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=le)}}),Ln={class:"field"},Mn={class:"header"},Rn={class:"text-sm font-bold"};function Un(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),u("div",Ln,[i("div",Mn,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Dn=y(En,[["render",Un],["__scopeId","data-v-7a91195b"]]),ae="std",An=b({name:"MotionModeSelector",components:{ElSelect:G,ElOption:A,InfoIcon:V},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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),Gn={class:"field"},Pn={class:"header"},Kn={class:"title font-bold"};function On(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",Gn,[i("div",Pn,[i("h2",Kn,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jn=y(An,[["render",On],["__scopeId","data-v-1295688c"]]),Nn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,InfoIcon:V},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"})}}}}),Bn={class:"relative"},zn={class:"flex justify-between items-center"},Fn={class:"flex justify-start items-center"},qn={class:"text-sm font-bold"};function Hn(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Bn,[i("div",zn,[i("div",Fn,[i("span",qn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Wn=y(Nn,[["render",Hn]]),Jn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:de,MotionImage:fn,MotionVideo:yn,MotionPromptInput:Tn,CharacterOrientationSelector:Dn,MotionModeSelector:jn,KeepOriginalSoundSelector:Wn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Qn={class:"flex flex-col h-full"},Yn={class:"flex-1 overflow-y-auto p-5"},Xn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zn(e,t,s,a,m,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),u("div",Qn,[i("div",Yn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Xn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const xn=y(Jn,[["render",Zn]]),es=b({name:"KlingTabSwitcher",components:{ElTabs:Ae,ElTabPane:De,ElTag:we},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")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),ts=["title"],os={class:"text"};function ns(e,t,s,a,m,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),S(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),u(I,null,T(e.tabs,c=>(l(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",os,r(c.label),1),c.badge?(l(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):k("",!0)],8,ts)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ss=y(es,[["render",ns],["__scopeId","data-v-bf00c27e"]]),is=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:Ge,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Pe,ElTooltip:W,ElButton:L,ImagePreview:K},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ls={class:"preview"},as={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},us={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},gs={key:0},fs={key:1},hs={key:0,class:U({content:!0,failed:!0})},_s={key:0,class:"mb-4"},$s={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ys={key:1,class:U({content:!0})},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Is={key:2,class:U({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Es={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ls(e,t,s,a,m,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),u("div",ls,[i("div",as,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",rs,[i("div",cs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",ds,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",us,[e.referenceImages.length>0?(l(),u("div",ms,[(l(!0),u(I,null,T(e.referenceImages,(R,j)=>(l(),S(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),u("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),u("span",gs," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),u("span",fs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),u("div",hs,[e.modelValue?.response.video_url?(l(),u("div",_s,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),u("div",$s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",ks,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),u("p",bs,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),u("div",ys,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",ws,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",Cs,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),u("p",Ss,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0),e.modelValue?.response?.trace_id?(l(),u("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),u("div",Is,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ts,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),u("p",Es,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ms=y(is,[["render",Ls],["__scopeId","data-v-e8e87659"]]),Rs=b({name:"RecentPanel",components:{TaskPreview:Ms,NoTasks:Ne,BotPlaceholder:je,ScrollList:Ee},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?.()}}}),Us={key:0},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,m,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),u(I,null,[e.tasks?.items===void 0?(l(),u("div",Us,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),S(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),u(I,null,T(e.tasks?.items,v=>(l(),S(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),u("div",Ds,[n(c)])):k("",!0)],64)}const Gs=y(Rs,[["render",As]]),re=Ce("kling"),Ps=b({name:"KlingIndex",components:{ConfigPanel:rn,MotionPanel:xn,TabSwitcher:ss,Layout:We,RecentPanel:Gs},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},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 Le({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();const 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);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:re};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){C.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,m])=>m!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(m=>{m?.response?.data?.error?.code===ie?C.error(this.$t("kling.message.usedUp")):C.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(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){C.warning(this.$t("kling.message.motionMissingInputs"));return}const 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.prompt?{prompt:e.prompt}:{},callback_url:re},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Ks={class:"flex flex-col h-full"},Os={class:"flex-1 min-h-0"};function js(e,t,s,a,m,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),v=o("layout");return l(),S(v,null,{config:h(()=>[i("div",Ks,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Os,[e.taskType==="videos"?(l(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),S(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Ps,[["render",js]]);export{Ni as default};
|