@acedatacloud/nexior 3.336.4 → 3.337.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ApiCodeButton-BCiH5XH1.js → ApiCodeButton-6dXtdhq1.js} +1 -1
- package/dist/assets/{Artifacts-DIvpgBar.js → Artifacts-DTcKmEBi.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-Cu4K2zWS.js → AskUserQuestionCard-BIp5KYfz.js} +1 -1
- package/dist/assets/{AudioPreview-DsaxaGnI.js → AudioPreview-C0GKXtuz.js} +1 -1
- package/dist/assets/{Auth-BBfONSvc.js → Auth-IUe9nM86.js} +1 -1
- package/dist/assets/{Bare-lmFn1z2I.js → Bare-HOHWkW_v.js} +1 -1
- package/dist/assets/{BotPlaceholder-CE5nL1Rv.js → BotPlaceholder-Cp2pWb4U.js} +1 -1
- package/dist/assets/{BottomFooter-ChjU5xVX.js → BottomFooter-RftyxH8Q.js} +1 -1
- package/dist/assets/{Callback-B2-p42Rg.js → Callback-I9ibHetD.js} +1 -1
- package/dist/assets/{CodeSnippet-wT9SIEcd.js → CodeSnippet-BuGblhnh.js} +1 -1
- package/dist/assets/{Console-Coz7Fnvs.js → Console-BYdiRxhy.js} +1 -1
- package/dist/assets/{Consumption-CZTTskeC.js → Consumption-4lLdaugf.js} +1 -1
- package/dist/assets/{Conversation-H3RA1wvq.js → Conversation-T4xU7jyL.js} +1 -1
- package/dist/assets/Conversation-a5i-zFkD.js +1 -0
- package/dist/assets/{Conversation-C55egwBj.css → Conversation-jWKCDVXR.css} +1 -1
- package/dist/assets/{CopyToClipboard-BmLkUzdp.js → CopyToClipboard-Cuw_Hc_J.js} +1 -1
- package/dist/assets/{Detail-5hoAXR2e.js → Detail-CRER3w0Q.js} +2 -2
- package/dist/assets/{Extra-B8ekGjSA.js → Extra-B7Q64_yj.js} +1 -1
- package/dist/assets/{FilePreview--2HCelWd.js → FilePreview-Dl8scf3A.js} +1 -1
- package/dist/assets/{Hailuo-D-f7Q-vr.js → Hailuo-BXQyxTUq.js} +1 -1
- package/dist/assets/{History-mafEUU54.js → History-CUdLSOTW.js} +1 -1
- package/dist/assets/{ImagePreview-DN-HUNWG.js → ImagePreview-C1hn0jTt.js} +1 -1
- package/dist/assets/{ImageWrapper-Dh31KtOC.js → ImageWrapper-CLRun-3g.js} +1 -1
- package/dist/assets/{Index-CanZGA4O2.js → Index-B0EySWYo2.js} +1 -1
- package/dist/assets/{Index-B0fuyKAA.js → Index-BDWwDlv0.js} +1 -1
- package/dist/assets/{Index-jrzitKC1.js → Index-BQxSBsNF.js} +1 -1
- package/dist/assets/{Index-DX8hE42G2.js → Index-BRVTiz702.js} +1 -1
- package/dist/assets/{Index-B02eYAvV.js → Index-BSpRNVBq.js} +1 -1
- package/dist/assets/{Index-BuS-MFA1.js → Index-BUMq5p96.js} +1 -1
- package/dist/assets/{Index-BNQ9naoH.js → Index-BVEeB3ae.js} +1 -1
- package/dist/assets/{Index-eAjzKE5S.js → Index-Bblw12Mu.js} +1 -1
- package/dist/assets/{Index-FAsLkZfC2.js → Index-Bmkyjtvc2.js} +1 -1
- package/dist/assets/{Index-dg9VoO-G2.js → Index-BpqsFw4a2.js} +1 -1
- package/dist/assets/{Index-2BYL3R00.js → Index-BuJd7Jyx.js} +1 -1
- package/dist/assets/{Index-DiNi0tz02.js → Index-C-L9ZlHq2.js} +1 -1
- package/dist/assets/{Index-E_rMi7FC.js → Index-C1rzVGN6.js} +1 -1
- package/dist/assets/{Index-DIs8cVDw.js → Index-C3syBBRu.js} +1 -1
- package/dist/assets/{Index-BHCw6C3f.js → Index-C4IGN_79.js} +1 -1
- package/dist/assets/{Index-j_sB0Ngg.js → Index-CMa8u-Yo.js} +1 -1
- package/dist/assets/{Index-CgLp7z7p.js → Index-Cb9A1OcN.js} +1 -1
- package/dist/assets/{Index-CwGMEDNl.js → Index-Cp_cs_0H.js} +1 -1
- package/dist/assets/{Index-CsMO40Im.js → Index-DCZcJb1G.js} +1 -1
- package/dist/assets/{Index-D9yXNdl9.js → Index-DF3tNK_a.js} +1 -1
- package/dist/assets/{Index-Cz5-758p.js → Index-DFEs8xVp.js} +1 -1
- package/dist/assets/{Index-DW-Pa8O3.js → Index-DHsKkvK4.js} +1 -1
- package/dist/assets/{Index-D1YdfXaf.js → Index-DWx8TI9j.js} +1 -1
- package/dist/assets/{Index-CzJHBLKQ.js → Index-DYkKSenT.js} +1 -1
- package/dist/assets/{Index-vb3Cm4Lq.js → Index-DhJfgqZS.js} +1 -1
- package/dist/assets/{Index-V0WkST_o2.js → Index-J2AKXJZY2.js} +1 -1
- package/dist/assets/{Index-D8llOyXS.js → Index-bXLQDJLu.js} +1 -1
- package/dist/assets/{Index-CQGGIOuG.js → Index-uPbNexOx.js} +1 -1
- package/dist/assets/{Index-b0iTp1OQ2.js → Index-yaymEImv2.js} +1 -1
- package/dist/assets/{Index-B64IzU8l.js → Index-zejkqksk.js} +1 -1
- package/dist/assets/{Invitees-CVMpgYTb.js → Invitees-BdPYhAuy.js} +1 -1
- package/dist/assets/{List-D0dnGZph.js → List-BFmMLxAU.js} +1 -1
- package/dist/assets/{List-CIJ0zF6w.js → List-D1bTln08.js} +1 -1
- package/dist/assets/{List-BDSwtlKy.js → List-l4HI2_JD.js} +1 -1
- package/dist/assets/{LocalTools-CRZJh6bh.js → LocalTools-D06GnOxo.js} +1 -1
- package/dist/assets/{LocalTools-BrvUxlNI.js → LocalTools-WlH3gayN.js} +1 -1
- package/dist/assets/{Main-Du7vajhO.js → Main-BVFB3erK.js} +1 -1
- package/dist/assets/{Message-DMOAj3Cl.js → Message-B_JBYHJd.js} +1 -1
- package/dist/assets/{Model-BTgVU-rJ.js → Model-CXOasw_A.js} +1 -1
- package/dist/assets/{Navigator-DEoSI2wo.js → Navigator-CLTCuwY8.js} +3 -3
- package/dist/assets/{NotFound-CVNeGShJ.js → NotFound-Bl4KpB6_.js} +1 -1
- package/dist/assets/{Pay-CXv2MTG6.js → Pay-BSiZfasE.js} +1 -1
- package/dist/assets/{Player-CxYEbN_5.js → Player-uyD1STG5.js} +1 -1
- package/dist/assets/{Poivelle-D81DZXKg.js → Poivelle-CBc6JVI7.js} +1 -1
- package/dist/assets/{PromptTextarea-BxPQCRHG.js → PromptTextarea-c7bTJdzp.js} +1 -1
- package/dist/assets/{RealtimeCall-aAMz430Z.js → RealtimeCall-Lyv80eYf.js} +1 -1
- package/dist/assets/ScheduledTasks-BiE9kmqC.js +2 -0
- package/dist/assets/ScheduledTasks-DGtjhm9R.css +1 -0
- package/dist/assets/{Status-CgKS_nUv.js → Status-B0p0Tkkv.js} +1 -1
- package/dist/assets/{Subscribe-Zqtseph0.js → Subscribe-CHCp4JLe.js} +1 -1
- package/dist/assets/{TabSwitcher-CxB0g7RK.js → TabSwitcher-B19dc1YH.js} +1 -1
- package/dist/assets/{Tts-BZcJq6o_.js → Tts-DHZ9DN6s.js} +1 -1
- package/dist/assets/{VideoPlayer-B-RFNph3.js → VideoPlayer-DC58LIaN.js} +1 -1
- package/dist/assets/{alert-NIoXEghZ.js → alert-BJ4eXD_W.js} +1 -1
- package/dist/assets/arrow-down-OUF2OuID.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-Bb-5FmSK.js → arrow-down-wide-narrow-B3V8L5_Z.js} +1 -1
- package/dist/assets/arrow-left-DmRPEetX.js +1 -0
- package/dist/assets/arrow-right-Hl8SArnP.js +1 -0
- package/dist/assets/arrow-up-B4uTIk9Y.js +1 -0
- package/dist/assets/{avatar-DDzWJzE7.js → avatar-C-DgKFsG.js} +1 -1
- package/dist/assets/{basic-C7y6Jt3S.js → basic-eDPy8f-S.js} +1 -1
- package/dist/assets/{box-Bdl3pIxl.js → box-BiXJKqiy.js} +1 -1
- package/dist/assets/{boxes-Cd9SZYzl.js → boxes-DrRTjkgK.js} +1 -1
- package/dist/assets/{brain-vJYAb8PS.js → brain-DOkreN5i.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-CMnI6z0F.js → chart-no-axes-combined-BCgOy60w.js} +1 -1
- package/dist/assets/{chat-DKPMXlT2.js → chat-BrppVrMw.js} +1 -1
- package/dist/assets/check-C2X01eRN.js +1 -0
- package/dist/assets/chevron-down-6whCy-vZ.js +1 -0
- package/dist/assets/chevron-right-RN3rq9L5.js +1 -0
- package/dist/assets/circle-check-B3dD3Ej8.js +1 -0
- package/dist/assets/clock-CSS2EFTL.js +1 -0
- package/dist/assets/{codingBridge-pdah-BMU.js → codingBridge-BA92JvUh.js} +1 -1
- package/dist/assets/{codingBridgeNotify-iDhXh3zr.js → codingBridgeNotify-DMadqQP9.js} +2 -2
- package/dist/assets/{coins-Cs-p2NNe.js → coins-CrGDhXjo.js} +1 -1
- package/dist/assets/{collapse-BJd7tmni.js → collapse-BMJkVoee.js} +1 -1
- package/dist/assets/constants-DneM-Qrs.js +1 -0
- package/dist/assets/{copy-Cy-pQslP.js → copy-BPFZa1JF.js} +1 -1
- package/dist/assets/{createTaskActions-Cd69n0Ab.js → createTaskActions-BusImTv0.js} +1 -1
- package/dist/assets/{digitalhuman-BI39zR2W.js → digitalhuman-Be739hqb.js} +1 -1
- package/dist/assets/{dollar-sign-CY0XX5c4.js → dollar-sign-CXmRbcC5.js} +1 -1
- package/dist/assets/{download-DIUvewp3.js → download-Bw8zVs2A.js} +1 -1
- package/dist/assets/{drawer-CfriDdTF.js → drawer-CtDMRtb8.js} +1 -1
- package/dist/assets/{dropdown-BmeCNsBV.js → dropdown-Bvufwlf0.js} +1 -1
- package/dist/assets/{dropdown-Bk35Iqc_.js → dropdown-CYpfyFf4.js} +1 -1
- package/dist/assets/{ellipsis-DzOiL_TU.js → ellipsis-BFUveEPY.js} +1 -1
- package/dist/assets/esm-BL9hoPBX.js +1 -0
- package/dist/assets/{esm-Bh12GKSR.js → esm-BPw5-hni.js} +2 -2
- package/dist/assets/{esm-wjJwA2MJ.js → esm-CQNHTTrV.js} +3 -3
- package/dist/assets/{esm-BgCOgF9R.js → esm-CnkzoS1g.js} +2 -2
- package/dist/assets/{esm-Cj7X52ax.js → esm-DB1T7gYh.js} +1 -1
- package/dist/assets/{esm-DJGKz5Oj.js → esm-DKwDmYD8.js} +1 -1
- package/dist/assets/{esm-CJDMTCHH.js → esm-FaLF5tMi.js} +1 -1
- package/dist/assets/{external-link-HwZ6_L9S.js → external-link-WCJw2hQm.js} +1 -1
- package/dist/assets/{eye-9FZrT8qj.js → eye-3b_sfMct.js} +1 -1
- package/dist/assets/{file-output-D1N-l77M.js → file-output-3OtzHgnS.js} +1 -1
- package/dist/assets/{file-text-DFSIb87D.js → file-text-BvZblPUR.js} +1 -1
- package/dist/assets/{fish-DKG-qE9o.js → fish-BpPd-3Gu.js} +1 -1
- package/dist/assets/{flux-DbVY30Gj.js → flux-IPFpydrx.js} +1 -1
- package/dist/assets/{folder-Cr3b435f.js → folder-D66uq-aQ.js} +1 -1
- package/dist/assets/gauge-Dr2lw3uS.js +1 -0
- package/dist/assets/{globe-CwMmP46Q.js → globe-8tabNlL1.js} +1 -1
- package/dist/assets/{grokvideo-CqpARtDZ.js → grokvideo-DUmaxLly.js} +1 -1
- package/dist/assets/{hailuo-C1E9Z8h4.js → hailuo-ByrWskFK.js} +1 -1
- package/dist/assets/{headphones-CJQJUVb4.js → headphones-BQW-oNE4.js} +1 -1
- package/dist/assets/{history-C-de2xic.js → history-BmFuX6dW.js} +1 -1
- package/dist/assets/{house-DL5sGEuB.js → house-C28IHutM.js} +1 -1
- package/dist/assets/{image-BweXSgWu.js → image-d634Fq6J.js} +1 -1
- package/dist/assets/{index-D7PshZL1.js → index-DKk73XSL.js} +5 -5
- package/dist/assets/{index.browser.esm-dkwdYkQg.js → index.browser.esm-Dv2bgl2X.js} +1 -1
- package/dist/assets/{index.es-D_pU9uSQ.js → index.es-CiK8oKll.js} +1 -1
- package/dist/assets/{info-BLLJpmyv.js → info-ohLaRJyi.js} +1 -1
- package/dist/assets/{input-number-CQElckio.js → input-number-BAvJZ8RJ.js} +1 -1
- package/dist/assets/{key-round-CkjWUbd6.js → key-round-BqX58nqp.js} +1 -1
- package/dist/assets/{kling-BCVrpWpD.js → kling-CHmWseA3.js} +1 -1
- package/dist/assets/{languages-rBBjnTfT.js → languages-CR9hC4ep.js} +1 -1
- package/dist/assets/{laptop-CHng-OVr.js → laptop-QITM4VF-.js} +1 -1
- package/dist/assets/{lightbulb-MkUKqgJg.js → lightbulb-Dc8HNEQG.js} +1 -1
- package/dist/assets/{link-mrdysi1t.js → link-Cy5Cj7QA.js} +1 -1
- package/dist/assets/loader-circle-DptE_Gr1.js +1 -0
- package/dist/assets/{luma-DALnyRxr.js → luma-PiVMxwzT.js} +1 -1
- package/dist/assets/{maestro-CJvp3PWw.js → maestro-DMZvjr9I.js} +1 -1
- package/dist/assets/{maestro-CiQTs5ep.js → maestro-LzdzL_40.js} +1 -1
- package/dist/assets/{mail-CZzokyPh.js → mail-Cx_FbAls.js} +1 -1
- package/dist/assets/{message-circle-DedY5py3.js → message-circle-BYUvAQbM.js} +1 -1
- package/dist/assets/{mic-CSLvPpSt.js → mic-KPqenF2E.js} +1 -1
- package/dist/assets/{midjourney-CkRfPfTR.js → midjourney-B4gpTEUg.js} +1 -1
- package/dist/assets/{mobileLocalExec-DJnehTjo.js → mobileLocalExec-C1et_-sF.js} +2 -2
- package/dist/assets/{mouse-pointer-2-s2Ly3Sba.js → mouse-pointer-2-jD6xjWxW.js} +1 -1
- package/dist/assets/music-2-Di0MYcRB.js +1 -0
- package/dist/assets/{nanobanana-2zERBcl1.js → nanobanana-C8lmS1rA.js} +1 -1
- package/dist/assets/{omni-BiQkl3Li.js → omni-DsWSbYOx.js} +1 -1
- package/dist/assets/{openaiimage-9CQs1DIt.js → openaiimage-SFMmbqEX.js} +1 -1
- package/dist/assets/{pagination-eYvfEgWP.js → pagination-BzpXSliP.js} +1 -1
- package/dist/assets/{pagination-ZOz4p54z.js → pagination-DgxXd4gx.js} +1 -1
- package/dist/assets/{palette-CIQ0KF6X.js → palette-Bt2eSyuh.js} +1 -1
- package/dist/assets/{paperclip-BRKO1tyd.js → paperclip-Bp5diGIN.js} +1 -1
- package/dist/assets/{pause-C8aoBlIY.js → pause-QAIPWii9.js} +1 -1
- package/dist/assets/{pencil-C1p3piXr.js → pencil-DklKkSt6.js} +1 -1
- package/dist/assets/{pika-DK3PrJxn.js → pika-BwJRH2Vp.js} +1 -1
- package/dist/assets/{pixverse-BeBd44QY.js → pixverse-AVaSXr72.js} +1 -1
- package/dist/assets/play-CSQzkamb.js +1 -0
- package/dist/assets/plus-g4A7eCfw.js +1 -0
- package/dist/assets/{poivelle-D1CzT2Ap.js → poivelle-Dv4PWGFW.js} +1 -1
- package/dist/assets/{popover-Rlh9-jil.js → popover-swjqDCAC.js} +1 -1
- package/dist/assets/{producer-BOnJV-RZ.js → producer-D3DpnLAM.js} +1 -1
- package/dist/assets/{qrart-BYtnl1NW.js → qrart-mey6PUY-.js} +1 -1
- package/dist/assets/{realtime--zmUiI0t.js → realtime-Dj2hbx3d.js} +1 -1
- package/dist/assets/{refresh-cw-DNrlXdcs.js → refresh-cw-p_tCFlcn.js} +1 -1
- package/dist/assets/rotate-ccw-DT_xkQx8.js +1 -0
- package/dist/assets/rotate-cw-DQiilART.js +1 -0
- package/dist/assets/{row-D01IHp_i.js → row-B9MsO7Fu.js} +1 -1
- package/dist/assets/search-17Uy9D9_.js +1 -0
- package/dist/assets/{seedance-HMLTEbe8.js → seedance-Dp6tJHz8.js} +1 -1
- package/dist/assets/{seedream-BXXT8-hS.js → seedream-BkOayUyt.js} +1 -1
- package/dist/assets/{select-kcx--P1x.js → select-B77f_PJQ.js} +1 -1
- package/dist/assets/{serp-4Q56rzrf.js → serp-eRPdJBp-.js} +1 -1
- package/dist/assets/{shield-xja_DgeO.js → shield-D8GVjHcI.js} +1 -1
- package/dist/assets/{shuffle-C44Z2oGy.js → shuffle-BoO8efW2.js} +1 -1
- package/dist/assets/{slider-BLVGADMV.js → slider-CgQtZ5yN.js} +1 -1
- package/dist/assets/{sliders-horizontal-Bwykskrq.js → sliders-horizontal-CRxALS4W.js} +1 -1
- package/dist/assets/{solana-wallets-D01w4FBp.js → solana-wallets-CLoHG06D.js} +2 -2
- package/dist/assets/{solana-wallets-vue-BEdDrUoM.js → solana-wallets-vue-CORZa18O.js} +1 -1
- package/dist/assets/{sora-DfqkR7CY.js → sora-6G2n2ZZo.js} +1 -1
- package/dist/assets/{sparkles-CtS9DN6u.js → sparkles-BUKW7qfb.js} +1 -1
- package/dist/assets/square-BcuL9NkQ.js +1 -0
- package/dist/assets/{suno-Dc6Rubdr.js → suno-BxWqqMEe.js} +1 -1
- package/dist/assets/{switch-DHlseMgb.js → switch-BEH6EuR9.js} +1 -1
- package/dist/assets/{table-BjwwMGC6.js → table-CFlORTAr.js} +1 -1
- package/dist/assets/{tabs-IMKGWO7N.js → tabs-CXoKymzI.js} +1 -1
- package/dist/assets/{tag-C0sOcRYt.js → tag-DeWZqmNZ.js} +1 -1
- package/dist/assets/{taskDrawerMixin-8LJZo-GR.js → taskDrawerMixin-BNR2Da2_.js} +1 -1
- package/dist/assets/terminal-AWkHRUHr.js +1 -0
- package/dist/assets/{time-picker-DZP_HueW.js → time-picker-yaHVs5b_.js} +1 -1
- package/dist/assets/{tooltip-Dg8svYdv.js → tooltip-VSerTQEt.js} +1 -1
- package/dist/assets/{trash-2-BFPsgWSb.js → trash-2-DEZLHac1.js} +1 -1
- package/dist/assets/{triangle-alert-Bt6a07CK.js → triangle-alert-JRUGzlh3.js} +1 -1
- package/dist/assets/{upload-DINS-nXM.js → upload-C_WMoFLD.js} +1 -1
- package/dist/assets/{upload-DvahN9pS.js → upload-DOqvBy36.js} +1 -1
- package/dist/assets/user-CVp88QlJ.js +1 -0
- package/dist/assets/{veo-B5K-2BZg.js → veo-HPSZEOG9.js} +1 -1
- package/dist/assets/{video-D3fAKqsy.js → video-uuavz4PM.js} +1 -1
- package/dist/assets/{volume-2-DsCqwbE_.js → volume-2-DBOkgMWw.js} +1 -1
- package/dist/assets/{wallet-Cb-N281m.js → wallet-BvCrULod.js} +1 -1
- package/dist/assets/{wan-Ce1BjasH.js → wan-DuinhyXx.js} +1 -1
- package/dist/assets/{wand-sparkles-D1gaPiuH.js → wand-sparkles-CmL-nnQq.js} +1 -1
- package/dist/assets/{web-D6xwlNDf.js → web-6VpK5a5k.js} +1 -1
- package/dist/assets/{web-B4gygH6F.js → web-BQl8VXAF.js} +1 -1
- package/dist/assets/{web-CodrqSz4.js → web-DmBK1EOF.js} +1 -1
- package/dist/assets/{web-8KAKueiI.js → web-DthMCWDO.js} +1 -1
- package/dist/assets/{web-CCYw881-.js → web-zjecWYFg.js} +1 -1
- package/dist/assets/{webextrator-CuQ5w1zM.js → webextrator-yolFGKVA.js} +1 -1
- package/dist/assets/{zap-D7ae_2zb.js → zap-BeIUsEa6.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/Conversation-DoTSq27w.js +0 -1
- package/dist/assets/ScheduledTasks-7iAQ9GJY.js +0 -2
- package/dist/assets/ScheduledTasks-BOICFHHQ.css +0 -1
- package/dist/assets/arrow-down-_FHvTr0R.js +0 -1
- package/dist/assets/arrow-left-o-NndlwR.js +0 -1
- package/dist/assets/arrow-right-BM_oc71X.js +0 -1
- package/dist/assets/arrow-up-KxYdI9Hu.js +0 -1
- package/dist/assets/check-CGmfME5i.js +0 -1
- package/dist/assets/chevron-down-Cnvsrfew.js +0 -1
- package/dist/assets/chevron-right-Dmhbh_rE.js +0 -1
- package/dist/assets/circle-check-Cb-gYU_D.js +0 -1
- package/dist/assets/clock-00kgn61e.js +0 -1
- package/dist/assets/constants-BdhyMN3z.js +0 -1
- package/dist/assets/esm-_KhjSfsd.js +0 -1
- package/dist/assets/gauge-DKJ4Z0Qh.js +0 -1
- package/dist/assets/loader-circle-DFJEkxvp.js +0 -1
- package/dist/assets/music-2-CdpSTfuD.js +0 -1
- package/dist/assets/play-CQ_p-xyH.js +0 -1
- package/dist/assets/plus-C0RBava9.js +0 -1
- package/dist/assets/rotate-ccw-crQ5cmET.js +0 -1
- package/dist/assets/rotate-cw-B7XP-iWN.js +0 -1
- package/dist/assets/search-BzcuAImw.js +0 -1
- package/dist/assets/square-BT0bECqd.js +0 -1
- package/dist/assets/terminal-BNQ-WoV4.js +0 -1
- package/dist/assets/user-BmRAN_gQ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,Jt as t,L as n,M as r,N as i,at as a,tt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./arrow-left-
|
|
1
|
+
import{A as e,Jt as t,L as n,M as r,N as i,at as a,tt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./arrow-left-DmRPEetX.js";import{t as l}from"./house-C28IHutM.js";import{E as u}from"./index-DKk73XSL.js";var d=s({name:`NotFound`,components:{BackIcon:c,HomeIcon:l},computed:{path(){return this.$route?.fullPath||``}},mounted(){let e=document.querySelector(`meta[name="robots"]`);e||(e=document.createElement(`meta`),e.setAttribute(`name`,`robots`),document.head.appendChild(e)),e.setAttribute(`content`,`noindex, nofollow`)},beforeUnmount(){let e=document.querySelector(`meta[name="robots"]`);e&&e.setAttribute(`content`,`index, follow`)},methods:{goHome(){this.$router.push(`/`)},goBack(){window.history.length>1?this.$router.back():this.$router.push(`/`)}}}),f={class:`not-found`},p={class:`content`},m={class:`eyebrow`},h={class:`title`},g={class:`subtitle`},_={class:`actions`},v={key:0,class:`path`},y={class:`path__label`},b={class:`path__value`};function x(s,c,l,u,d,x){let S=a(`home-icon`),C=a(`back-icon`);return o(),i(`div`,f,[c[3]||=e(`div`,{class:`glow`,"aria-hidden":`true`},null,-1),e(`main`,p,[e(`p`,m,t(s.$t(`common.message.notFoundEyebrow`)),1),c[2]||=e(`div`,{class:`code`,"aria-hidden":`true`},`404`,-1),e(`h1`,h,t(s.$t(`common.title.notFound`)),1),e(`p`,g,t(s.$t(`common.message.notFound`)),1),e(`div`,_,[e(`button`,{class:`btn btn--primary`,onClick:c[0]||=(...e)=>s.goHome&&s.goHome(...e)},[n(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,t(s.$t(`common.button.backToHome`)),1)]),e(`button`,{class:`btn btn--ghost`,onClick:c[1]||=(...e)=>s.goBack&&s.goBack(...e)},[n(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,t(s.$t(`common.button.goBack`)),1)])]),s.path?(o(),i(`div`,v,[e(`span`,y,t(s.$t(`common.message.notFoundPath`)),1),e(`code`,b,t(s.path),1)])):r(``,!0)])])}var S=u(d,[[`render`,x],[`__scopeId`,`data-v-40e4e98c`]]);export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{t as p}from"./alert-NIoXEghZ.js";import{t as ee}from"./card-D-4S-l7a.js";import{n as m,t as h}from"./row-D01IHp_i.js";import{i as g,n as _,r as v,t as y}from"./wechat-Jy07BKOo.js";import{t as b}from"./divider-BNWJAaA2.js";import{t as x}from"./skeleton-B3LIGUiE.js";import{E as S,Ei as C,Fi as w,It as T,Ni as E,Yt as D,Zr as O,fi as k,li as A,qt as te,tr as j,xi as M}from"./index-D7PshZL1.js";import{t as N}from"./CopyToClipboard-BmLkUzdp.js";var P=f({name:`PublicWechatPayDialog`,components:{ElDialog:C,ElButton:w,QrCode:T,ElRow:h,ElCol:m},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],data(){return{copied:!1,copiedTimer:void 0}},computed:{isMobileOutsideWechat(){return _()&&!y()},isMobileInsideWechat(){return _()&&y()},dialogWidth(){return this.isMobileOutsideWechat||this.isMobileInsideWechat?`90%`:`500px`}},unmounted(){this.copiedTimer&&clearTimeout(this.copiedTimer)},methods:{async onCopyLink(){let e=typeof window<`u`?window.location.href:``;if(!e)return;let t=!1;try{t=await D(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):M.error(String(this.$t(`common.message.copyFailed`)||`Copy failed`))}}}),F={key:0,class:`wechat-pay-mobile text-center py-[20px] px-[10px]`},I={class:`text-[14px] mb-3 leading-relaxed`},L={class:`text-[12px] text-gray-500 mb-4 leading-relaxed`},R={key:1,class:`wechat-pay-longpress text-center py-[20px] px-[10px]`},z={class:`text-[14px] mb-4 leading-relaxed`},B={class:`paycode wechat`},V={class:`help-text block bg-[#00c800] text-white text-[14px] h-[35px] w-[240px] text-center leading-[35px] mt-[10px] mx-auto`};function H(t,s,f,p,ee,m){let h=c(`qr-code`),g=c(`el-button`),_=c(`el-col`),v=c(`el-row`),y=c(`el-dialog`);return d(),l(y,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:t.dialogWidth,center:``,onClose:s[0]||=e=>t.$emit(`hide`)},{default:u(()=>[t.isMobileOutsideWechat?(d(),o(`div`,F,[e(`p`,I,r(t.$t(`order.message.wechatPayMobileScanTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:220,class:`qrcode m-auto mb-3`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,L,r(t.$t(`order.message.wechatPayMobileHint`)),1),i(g,{size:`default`,round:``,class:`w-[220px]`,onClick:t.onCopyLink},{default:u(()=>[n(r(t.copied?t.$t(`common.message.copied`):t.$t(`order.button.copyPayLink`)),1)]),_:1},8,[`onClick`])])):t.isMobileInsideWechat?(d(),o(`div`,R,[e(`p`,z,r(t.$t(`order.message.wechatPayLongPressTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:240,class:`qrcode mx-auto`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0)])):(d(),l(v,{key:2,class:`paycodes py-[30px] w-[500px] mx-auto`},{default:u(()=>[i(_,{span:12},{default:u(()=>[e(`div`,B,[t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:200,class:`qrcode m-auto w-[200px] h-[200px]`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,V,r(t.$t(`order.message.wechatPayHelp`)),1)])]),_:1}),i(_,{span:12},{default:u(()=>[...s[1]||=[e(`div`,{class:`help-img`},[e(`img`,{src:`https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg`})],-1)]]),_:1})]),_:1}))]),_:1},8,[`model-value`,`title`,`width`])}var U=S(P,[[`render`,H]]),W=f({name:`PublicStripePayDialog`,components:{ElDialog:C},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),G={class:`text-center`};function K(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,G,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var q=S(W,[[`render`,K]]),ne=f({name:`PublicAlipayPayDialog`,components:{ElDialog:C},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),J={class:`text-center`};function Y(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,J,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var X=S(ne,[[`render`,Y]]),Z=7e3,re=2e3,Q=function(e){return e.WechatPay=`WechatPay`,e.Stripe=`Stripe`,e.AliPay=`AliPay`,e.Card=`Card`,e}(Q||{}),ie=f({name:`OrderPublicPay`,components:{ElButton:w,ElRow:h,ElCol:m,ElCard:ee,ElSkeleton:x,ElDivider:b,ElAlert:p,ElDescriptions:v,ElDescriptionsItem:g,ElTag:E,PublicWechatPay:U,PublicStripePay:q,PublicAlipayPay:X,CopyToClipboard:N},data(){return{PayWay:Q,OrderState:O,payWay:`WechatPay`,order:void 0,loading:!1,paying:!1,prepaying:!1}},computed:{id(){return this.$route.params?.id?.toString()??``},config(){return this.$store.getters.config},enableCard(){return!!this.config?.features?.ENABLE_CARD},showPayment(){return!k()}},watch:{paying(e){e?this.startOrderPolling(re):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:te,payWayLabel(e){return{WechatPay:this.$t(`order.title.wechatPay`),Stripe:this.$t(`order.title.stripe`),AliPay:this.$t(`order.title.aliPay`),Card:this.$t(`order.title.card`)}[e]||e},onFetchData(){this.id&&(this.loading=!0,j.get(this.id).then(({data:e})=>{this.order=e,e?.pay_way&&e.pay_way in Q&&(this.payWay=e.pay_way),this.loading=!1}).catch(()=>{this.order=void 0,this.loading=!1}))},startOrderPolling(e=0){this.stopOrderPolling();let t=async()=>{try{let{data:e}=await j.get(this.id);if(this.order=e,e?.state===O.PAID||e?.state===O.FINISHED||e?.state===O.FAILED||e?.state===O.EXPIRED){this.paying=!1,this.stopOrderPolling();return}}catch{}this.paying&&(this._orderRefreshTimer=window.setTimeout(t,Z))};this._orderRefreshTimer=window.setTimeout(t,e)},stopOrderPolling(){let e=this._orderRefreshTimer;e&&(clearTimeout(e),this._orderRefreshTimer=void 0)},onRepay(){this.paying=!0},onPay(){if(!this.id)return;this.prepaying=!0;let e={pay_way:this.payWay};this.payWay===`AliPay`&&(e.surface=A()),j.pay(this.id,e).then(({data:e})=>{this.prepaying=!1,e?.id&&(this.order=e),this.order&&this.order.price&&this.order.price>0&&(this.paying=!0)}).catch(()=>{this.prepaying=!1})}}}),ae={class:`title`},oe={key:0,class:`pt-5`},se={key:1,class:`pt-10 text-center`},ce={key:2,class:`order`},le={key:0,class:`price current unfree`},ue={key:1,class:`price free`},de={key:0,class:`payways mb-6`},fe={class:`payname`},pe={class:`payname`},$={class:`payname`},me={class:`payname`},he={key:1},ge={key:2};function _e(f,p,ee,m,h,g){let _=c(`el-col`),v=c(`el-row`),y=c(`el-skeleton`),b=c(`el-alert`),x=c(`copy-to-clipboard`),S=c(`el-descriptions-item`),C=c(`el-tag`),w=c(`el-descriptions`),T=c(`el-divider`),E=c(`el-button`),D=c(`el-card`),O=c(`public-wechat-pay`),k=c(`public-stripe-pay`),A=c(`public-alipay-pay`);return d(),o(s,null,[i(v,{class:`wrapper`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{span:24},{default:u(()=>[e(`h2`,ae,r(f.$t(`order.title.info`)),1)]),_:1})]),_:1}),i(v,{class:`panel`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(D,{shadow:`hover`},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[f.loading?(d(),o(`div`,oe,[i(y,{animated:``})])):f.order?(d(),o(`div`,ce,[i(w,{column:1},{default:u(()=>[i(S,{label:f.$t(`order.field.id`)},{default:u(()=>[e(`span`,null,r(f.order.id),1),f.order.id?(d(),l(x,{key:0,content:f.order.id,class:`inline-block`},null,8,[`content`])):a(``,!0)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.description`)},{default:u(()=>[n(r(f.order.description),1)]),_:1},8,[`label`]),f.order.pay_way?(d(),l(S,{key:0,label:f.$t(`order.field.payWay`)},{default:u(()=>[i(C,{type:`info`,effect:`dark`,round:``,size:`small`},{default:u(()=>[n(r(f.payWayLabel(f.order.pay_way)),1)]),_:1})]),_:1},8,[`label`])):a(``,!0),i(S,{label:f.$t(`order.field.createdAt`)},{default:u(()=>[n(r(f.$dayjs.format(f.order.created_at||``)),1)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.price`)},{default:u(()=>[f.order.price&&f.order.price>0?(d(),o(`span`,le,r(f.getPriceString({value:f.order.price})),1)):(d(),o(`span`,ue,r(f.$t(`order.message.free`)),1))]),_:1},8,[`label`])]),_:1})])):(d(),o(`div`,se,[i(b,{title:f.$t(`order.message.publicPayNotFound`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]))]),_:1})]),_:1}),f.order?.state===f.OrderState.PAID||f.order?.state===f.OrderState.FINISHED?(d(),l(v,{key:0,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.paidSuccessfully`),type:`success`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.EXPIRED?(d(),l(v,{key:1,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.orderExpired`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.FAILED?(d(),l(v,{key:2,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.state.failed`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.PENDING&&f.showPayment?(d(),l(v,{key:3},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),!f.order.pay_way&&f.order.price&&f.order.price>0?(d(),o(`div`,de,[e(`div`,{class:t({payway:!0,wechatpay:!0,active:f.payWay===f.PayWay.WechatPay}),onClick:p[0]||=e=>f.payWay=f.PayWay.WechatPay},[p[7]||=e(`span`,{class:`payicon wechatpay`},null,-1),e(`span`,fe,r(f.$t(`order.title.wechatPay`)),1)],2),e(`div`,{class:t({payway:!0,alipay:!0,active:f.payWay===f.PayWay.AliPay}),onClick:p[1]||=e=>f.payWay=f.PayWay.AliPay},[p[8]||=e(`span`,{class:`payicon alipay`},null,-1),e(`span`,pe,r(f.$t(`order.title.aliPay`)),1)],2),f.enableCard?a(``,!0):(d(),o(`div`,{key:0,class:t({payway:!0,stripe:!0,active:f.payWay===f.PayWay.Stripe}),onClick:p[2]||=e=>f.payWay=f.PayWay.Stripe},[p[9]||=e(`span`,{class:`payicon stripe`},null,-1),e(`span`,$,r(f.$t(`order.title.stripe`)),1)],2)),f.enableCard?(d(),o(`div`,{key:1,class:t({payway:!0,creditcard:!0,active:f.payWay===f.PayWay.Card}),onClick:p[3]||=e=>f.payWay=f.PayWay.Card},[p[10]||=e(`span`,{class:`payicon card`,"aria-hidden":`true`},null,-1),e(`span`,me,r(f.$t(`order.title.card`)),1)],2)):a(``,!0)])):a(``,!0),f.order.pay_way?(d(),o(`div`,ge,[i(E,{type:`primary`,round:``,size:`large`,class:`btn-repay`,onClick:f.onRepay},{default:u(()=>[n(r(f.$t(`common.button.repay`)),1)]),_:1},8,[`onClick`])])):(d(),o(`div`,he,[i(E,{loading:f.prepaying,round:``,type:`primary`,size:`large`,class:`btn-pay`,onClick:f.onPay},{default:u(()=>[n(r(f.$t(`common.button.pay`)),1)]),_:1},8,[`loading`,`onClick`])]))]),_:1})]),_:1})):a(``,!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),f.order&&f.payWay===f.PayWay.WechatPay?(d(),l(O,{key:0,order:f.order,visible:f.paying,onHide:p[4]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&(f.payWay===f.PayWay.Stripe||f.payWay===f.PayWay.Card)?(d(),l(k,{key:1,order:f.order,visible:f.paying,onHide:p[5]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&f.payWay===f.PayWay.AliPay?(d(),l(A,{key:2,order:f.order,visible:f.paying,onHide:p[6]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0)],64)}var ve=S(ie,[[`render`,_e],[`__scopeId`,`data-v-8711039f`]]);export{ve as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{t as p}from"./alert-BJ4eXD_W.js";import{t as ee}from"./card-D-4S-l7a.js";import{n as m,t as h}from"./row-B9MsO7Fu.js";import{i as g,n as _,r as v,t as y}from"./wechat-Jy07BKOo.js";import{t as b}from"./divider-BNWJAaA2.js";import{t as x}from"./skeleton-B3LIGUiE.js";import{E as S,Ei as C,Fi as w,It as T,Ni as E,Yt as D,Zr as O,fi as k,li as A,qt as te,tr as j,xi as M}from"./index-DKk73XSL.js";import{t as N}from"./CopyToClipboard-Cuw_Hc_J.js";var P=f({name:`PublicWechatPayDialog`,components:{ElDialog:C,ElButton:w,QrCode:T,ElRow:h,ElCol:m},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],data(){return{copied:!1,copiedTimer:void 0}},computed:{isMobileOutsideWechat(){return _()&&!y()},isMobileInsideWechat(){return _()&&y()},dialogWidth(){return this.isMobileOutsideWechat||this.isMobileInsideWechat?`90%`:`500px`}},unmounted(){this.copiedTimer&&clearTimeout(this.copiedTimer)},methods:{async onCopyLink(){let e=typeof window<`u`?window.location.href:``;if(!e)return;let t=!1;try{t=await D(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):M.error(String(this.$t(`common.message.copyFailed`)||`Copy failed`))}}}),F={key:0,class:`wechat-pay-mobile text-center py-[20px] px-[10px]`},I={class:`text-[14px] mb-3 leading-relaxed`},L={class:`text-[12px] text-gray-500 mb-4 leading-relaxed`},R={key:1,class:`wechat-pay-longpress text-center py-[20px] px-[10px]`},z={class:`text-[14px] mb-4 leading-relaxed`},B={class:`paycode wechat`},V={class:`help-text block bg-[#00c800] text-white text-[14px] h-[35px] w-[240px] text-center leading-[35px] mt-[10px] mx-auto`};function H(t,s,f,p,ee,m){let h=c(`qr-code`),g=c(`el-button`),_=c(`el-col`),v=c(`el-row`),y=c(`el-dialog`);return d(),l(y,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:t.dialogWidth,center:``,onClose:s[0]||=e=>t.$emit(`hide`)},{default:u(()=>[t.isMobileOutsideWechat?(d(),o(`div`,F,[e(`p`,I,r(t.$t(`order.message.wechatPayMobileScanTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:220,class:`qrcode m-auto mb-3`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,L,r(t.$t(`order.message.wechatPayMobileHint`)),1),i(g,{size:`default`,round:``,class:`w-[220px]`,onClick:t.onCopyLink},{default:u(()=>[n(r(t.copied?t.$t(`common.message.copied`):t.$t(`order.button.copyPayLink`)),1)]),_:1},8,[`onClick`])])):t.isMobileInsideWechat?(d(),o(`div`,R,[e(`p`,z,r(t.$t(`order.message.wechatPayLongPressTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:240,class:`qrcode mx-auto`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0)])):(d(),l(v,{key:2,class:`paycodes py-[30px] w-[500px] mx-auto`},{default:u(()=>[i(_,{span:12},{default:u(()=>[e(`div`,B,[t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:200,class:`qrcode m-auto w-[200px] h-[200px]`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,V,r(t.$t(`order.message.wechatPayHelp`)),1)])]),_:1}),i(_,{span:12},{default:u(()=>[...s[1]||=[e(`div`,{class:`help-img`},[e(`img`,{src:`https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg`})],-1)]]),_:1})]),_:1}))]),_:1},8,[`model-value`,`title`,`width`])}var U=S(P,[[`render`,H]]),W=f({name:`PublicStripePayDialog`,components:{ElDialog:C},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),G={class:`text-center`};function K(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,G,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var q=S(W,[[`render`,K]]),ne=f({name:`PublicAlipayPayDialog`,components:{ElDialog:C},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),J={class:`text-center`};function Y(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,J,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var X=S(ne,[[`render`,Y]]),Z=7e3,re=2e3,Q=function(e){return e.WechatPay=`WechatPay`,e.Stripe=`Stripe`,e.AliPay=`AliPay`,e.Card=`Card`,e}(Q||{}),ie=f({name:`OrderPublicPay`,components:{ElButton:w,ElRow:h,ElCol:m,ElCard:ee,ElSkeleton:x,ElDivider:b,ElAlert:p,ElDescriptions:v,ElDescriptionsItem:g,ElTag:E,PublicWechatPay:U,PublicStripePay:q,PublicAlipayPay:X,CopyToClipboard:N},data(){return{PayWay:Q,OrderState:O,payWay:`WechatPay`,order:void 0,loading:!1,paying:!1,prepaying:!1}},computed:{id(){return this.$route.params?.id?.toString()??``},config(){return this.$store.getters.config},enableCard(){return!!this.config?.features?.ENABLE_CARD},showPayment(){return!k()}},watch:{paying(e){e?this.startOrderPolling(re):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:te,payWayLabel(e){return{WechatPay:this.$t(`order.title.wechatPay`),Stripe:this.$t(`order.title.stripe`),AliPay:this.$t(`order.title.aliPay`),Card:this.$t(`order.title.card`)}[e]||e},onFetchData(){this.id&&(this.loading=!0,j.get(this.id).then(({data:e})=>{this.order=e,e?.pay_way&&e.pay_way in Q&&(this.payWay=e.pay_way),this.loading=!1}).catch(()=>{this.order=void 0,this.loading=!1}))},startOrderPolling(e=0){this.stopOrderPolling();let t=async()=>{try{let{data:e}=await j.get(this.id);if(this.order=e,e?.state===O.PAID||e?.state===O.FINISHED||e?.state===O.FAILED||e?.state===O.EXPIRED){this.paying=!1,this.stopOrderPolling();return}}catch{}this.paying&&(this._orderRefreshTimer=window.setTimeout(t,Z))};this._orderRefreshTimer=window.setTimeout(t,e)},stopOrderPolling(){let e=this._orderRefreshTimer;e&&(clearTimeout(e),this._orderRefreshTimer=void 0)},onRepay(){this.paying=!0},onPay(){if(!this.id)return;this.prepaying=!0;let e={pay_way:this.payWay};this.payWay===`AliPay`&&(e.surface=A()),j.pay(this.id,e).then(({data:e})=>{this.prepaying=!1,e?.id&&(this.order=e),this.order&&this.order.price&&this.order.price>0&&(this.paying=!0)}).catch(()=>{this.prepaying=!1})}}}),ae={class:`title`},oe={key:0,class:`pt-5`},se={key:1,class:`pt-10 text-center`},ce={key:2,class:`order`},le={key:0,class:`price current unfree`},ue={key:1,class:`price free`},de={key:0,class:`payways mb-6`},fe={class:`payname`},pe={class:`payname`},$={class:`payname`},me={class:`payname`},he={key:1},ge={key:2};function _e(f,p,ee,m,h,g){let _=c(`el-col`),v=c(`el-row`),y=c(`el-skeleton`),b=c(`el-alert`),x=c(`copy-to-clipboard`),S=c(`el-descriptions-item`),C=c(`el-tag`),w=c(`el-descriptions`),T=c(`el-divider`),E=c(`el-button`),D=c(`el-card`),O=c(`public-wechat-pay`),k=c(`public-stripe-pay`),A=c(`public-alipay-pay`);return d(),o(s,null,[i(v,{class:`wrapper`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{span:24},{default:u(()=>[e(`h2`,ae,r(f.$t(`order.title.info`)),1)]),_:1})]),_:1}),i(v,{class:`panel`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(D,{shadow:`hover`},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[f.loading?(d(),o(`div`,oe,[i(y,{animated:``})])):f.order?(d(),o(`div`,ce,[i(w,{column:1},{default:u(()=>[i(S,{label:f.$t(`order.field.id`)},{default:u(()=>[e(`span`,null,r(f.order.id),1),f.order.id?(d(),l(x,{key:0,content:f.order.id,class:`inline-block`},null,8,[`content`])):a(``,!0)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.description`)},{default:u(()=>[n(r(f.order.description),1)]),_:1},8,[`label`]),f.order.pay_way?(d(),l(S,{key:0,label:f.$t(`order.field.payWay`)},{default:u(()=>[i(C,{type:`info`,effect:`dark`,round:``,size:`small`},{default:u(()=>[n(r(f.payWayLabel(f.order.pay_way)),1)]),_:1})]),_:1},8,[`label`])):a(``,!0),i(S,{label:f.$t(`order.field.createdAt`)},{default:u(()=>[n(r(f.$dayjs.format(f.order.created_at||``)),1)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.price`)},{default:u(()=>[f.order.price&&f.order.price>0?(d(),o(`span`,le,r(f.getPriceString({value:f.order.price})),1)):(d(),o(`span`,ue,r(f.$t(`order.message.free`)),1))]),_:1},8,[`label`])]),_:1})])):(d(),o(`div`,se,[i(b,{title:f.$t(`order.message.publicPayNotFound`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]))]),_:1})]),_:1}),f.order?.state===f.OrderState.PAID||f.order?.state===f.OrderState.FINISHED?(d(),l(v,{key:0,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.paidSuccessfully`),type:`success`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.EXPIRED?(d(),l(v,{key:1,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.orderExpired`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.FAILED?(d(),l(v,{key:2,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.state.failed`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.PENDING&&f.showPayment?(d(),l(v,{key:3},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),!f.order.pay_way&&f.order.price&&f.order.price>0?(d(),o(`div`,de,[e(`div`,{class:t({payway:!0,wechatpay:!0,active:f.payWay===f.PayWay.WechatPay}),onClick:p[0]||=e=>f.payWay=f.PayWay.WechatPay},[p[7]||=e(`span`,{class:`payicon wechatpay`},null,-1),e(`span`,fe,r(f.$t(`order.title.wechatPay`)),1)],2),e(`div`,{class:t({payway:!0,alipay:!0,active:f.payWay===f.PayWay.AliPay}),onClick:p[1]||=e=>f.payWay=f.PayWay.AliPay},[p[8]||=e(`span`,{class:`payicon alipay`},null,-1),e(`span`,pe,r(f.$t(`order.title.aliPay`)),1)],2),f.enableCard?a(``,!0):(d(),o(`div`,{key:0,class:t({payway:!0,stripe:!0,active:f.payWay===f.PayWay.Stripe}),onClick:p[2]||=e=>f.payWay=f.PayWay.Stripe},[p[9]||=e(`span`,{class:`payicon stripe`},null,-1),e(`span`,$,r(f.$t(`order.title.stripe`)),1)],2)),f.enableCard?(d(),o(`div`,{key:1,class:t({payway:!0,creditcard:!0,active:f.payWay===f.PayWay.Card}),onClick:p[3]||=e=>f.payWay=f.PayWay.Card},[p[10]||=e(`span`,{class:`payicon card`,"aria-hidden":`true`},null,-1),e(`span`,me,r(f.$t(`order.title.card`)),1)],2)):a(``,!0)])):a(``,!0),f.order.pay_way?(d(),o(`div`,ge,[i(E,{type:`primary`,round:``,size:`large`,class:`btn-repay`,onClick:f.onRepay},{default:u(()=>[n(r(f.$t(`common.button.repay`)),1)]),_:1},8,[`onClick`])])):(d(),o(`div`,he,[i(E,{loading:f.prepaying,round:``,type:`primary`,size:`large`,class:`btn-pay`,onClick:f.onPay},{default:u(()=>[n(r(f.$t(`common.button.pay`)),1)]),_:1},8,[`loading`,`onClick`])]))]),_:1})]),_:1})):a(``,!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),f.order&&f.payWay===f.PayWay.WechatPay?(d(),l(O,{key:0,order:f.order,visible:f.paying,onHide:p[4]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&(f.payWay===f.PayWay.Stripe||f.payWay===f.PayWay.Card)?(d(),l(k,{key:1,order:f.order,visible:f.paying,onHide:p[5]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&f.payWay===f.PayWay.AliPay?(d(),l(A,{key:2,order:f.order,visible:f.paying,onHide:p[6]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0)],64)}var ve=S(ie,[[`render`,_e],[`__scopeId`,`data-v-8711039f`]]);export{ve as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime--c01j_DQ.js";import{A as t,Gt as n,Jt as r,L as i,M as a,Mt as o,N as s,U as c,Y as l,ft as u,k as d,mt as f,nt as p,tt as m,yt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{t as _}from"./popover-
|
|
1
|
+
import{t as e}from"./rolldown-runtime--c01j_DQ.js";import{A as t,Gt as n,Jt as r,L as i,M as a,Mt as o,N as s,U as c,Y as l,ft as u,k as d,mt as f,nt as p,tt as m,yt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{t as _}from"./popover-swjqDCAC.js";import{t as v}from"./slider-CgQtZ5yN.js";import{t as y}from"./arrow-left-DmRPEetX.js";import{t as ee}from"./arrow-right-Hl8SArnP.js";import{t as b}from"./pause-QAIPWii9.js";import{t as x}from"./play-CSQzkamb.js";import{t as S}from"./volume-2-DBOkgMWw.js";import{E as C,oi as w,yi as T}from"./index-DKk73XSL.js";var E=T(`brush-cleaning`,[[`path`,{d:`m16 22-1-4`,key:`1ow2iv`}],[`path`,{d:`M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1`,key:`11gii7`}],[`path`,{d:`M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z`,key:`bju7h4`}],[`path`,{d:`m8 22 1-4`,key:`s3unb`}]]);function D(e){let t=Math.floor(e)%60;e=Math.floor(e/60);let n=e%60,r=n<10?`0${n}`:n,i=t<10?`0${t}`:t;return r+`:`+i}var O=e(((e,t)=>{(function(t,n){typeof define==`function`&&define.amd?define([],n):e===void 0?(n(),t.FileSaver={exports:{}}.exports):n()})(e,function(){function e(e,t){return t===void 0?t={autoBom:!1}:typeof t!=`object`&&(console.warn(`Deprecated: Expected third argument to be a object`),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){s(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function r(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!=`object`||window!==a?function(){}:`download`in HTMLAnchorElement.prototype&&!o?function(e,t,o){var s=a.URL||a.webkitURL,c=document.createElement(`a`);t=t||e.name||`download`,c.download=t,c.rel=`noopener`,typeof e==`string`?(c.href=e,c.origin===location.origin?i(c):r(c.href)?n(e,t,o):i(c,c.target=`_blank`)):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:`msSaveOrOpenBlob`in navigator?function(t,a,o){if(a=a||t.name||`download`,typeof t!=`string`)navigator.msSaveOrOpenBlob(e(t,o),a);else if(r(t))n(t,a,o);else{var s=document.createElement(`a`);s.href=t,s.target=`_blank`,setTimeout(function(){i(s)})}}:function(e,t,r,i){if(i||=open(``,`_blank`),i&&(i.document.title=i.document.body.innerText=`downloading...`),typeof e==`string`)return n(e,t,r);var s=e.type===`application/octet-stream`,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||o)&&typeof FileReader<`u`){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout(function(){d.revokeObjectURL(f)},4e4)}});a.saveAs=s.saveAs=s,t!==void 0&&(t.exports=s)})})),k=Symbol(`AudioNamespace`),A=Symbol(`AudioQueue`),j=()=>{let e=c(k);if(!e)throw Error(`[player] useAudioNamespace() must be called inside <Player namespace="suno|producer">`);return e},M=e=>{let t=e??j(),n=w(),r=d({get:()=>n.state[t].audio,set:e=>n.commit(`${t}/setAudio`,e)}),i=e=>{n.commit(`${t}/setAudio`,{...n.state[t].audio,...e})},a=e=>{n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...e})},o=e=>d({get:()=>n.state[t].audio?.[e],set:t=>i({[e]:t})}),s=c(A,void 0),l=d(()=>{let e=s?.value;if(e&&e.length)return e;let r=n.state[t]?.tasks?.items??[],i=[];for(let e of r)for(let t of e?.response?.data??[])t?.audio_url&&i.push(t);return i}),u=d(()=>{let e=n.state[t].audio?.id;return l.value.findIndex(t=>t.id===e)});return{namespace:t,store:n,audio:r,field:o,patchAudio:i,dispatchAudio:a,tracks:l,currentIndex:u,playAdjacent:e=>{let r=u.value;if(r===-1)return;let i=l.value[r+e];i&&n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...i,progress:0,state:`playing`})}}},N={class:`player-slider`},P=g({__name:`PlayerSlider`,setup(e){let{field:t,dispatchAudio:n}=M(),r=t(`progress`),a=t(`duration`),c=()=>{},l=e=>n({progress:Array.isArray(e)?e[0]:e});return(e,t)=>(m(),s(`div`,N,[i(o(v),{modelValue:o(r),"onUpdate:modelValue":t[0]||=e=>h(r)?r.value=e:null,"show-tooltip":!1,min:0,max:o(a),onChange:l,onInput:c},null,8,[`modelValue`,`max`])]))}}),F={class:`flex player-song`},I=[`src`],L={class:`ml-2 text-xs flex flex-col justify-between`},R={class:`w-52 2xl:w-96 cursor-pointer truncate`},z={class:`flex`},B={class:`ml-2 text-dc`},V=g({__name:`PlayerSong`,setup(e){let{audio:n,patchAudio:i}=M(),a=null,c=null,d=()=>{if(a){try{a.pause()}catch{}a.src=``,a=null}c&&=(c.abort(),null)};return u(n,(e,t)=>{if(e?.audio_url!==t?.audio_url){if(d(),!e?.audio_url)return;let t=new Audio(e.audio_url);a=t,c=new AbortController;let{signal:n}=c;e.state===`playing`?t.play().catch(()=>{}):t.pause(),t.addEventListener(`loadedmetadata`,()=>{t.currentTime=0},{signal:n}),t.addEventListener(`timeupdate`,()=>{i({progress:t.currentTime})},{signal:n}),i({object:t})}else e?.progress!==t?.progress&&e?.object&&Math.abs(e.progress-e.object.currentTime)>2?e.object.currentTime=e.progress:e?.state!==t?.state&&e?.object&&(e.state===`playing`?e.object.play().catch(()=>{}):e.object.pause());e?.volume!==t?.volume&&e?.object&&(e.object.volume=e.volume/100)}),l(d),(e,i)=>(m(),s(`div`,F,[t(`img`,{alt:``,class:`w-11 h-11 rounded`,src:o(n)?.image_url||o(`/assets/disk-XFRmVAfp.png`)},null,8,I),t(`div`,L,[t(`div`,R,[t(`div`,z,[t(`span`,null,r(o(n)?.title||`Music`),1),t(`span`,B,`- `+r(o(n)?.style||`SmallRuralDog`),1)])])])]))}}),H={class:`flex justify-end items-center gap-x-2.5`},U={class:`text-xs`},W=g({__name:`PlayerAction`,setup(e){let{field:n}=M(),i=n(`progress`),a=n(`duration`);return(e,n)=>(m(),s(`div`,H,[t(`span`,U,r(o(D)(o(i)))+` / `+r(o(D)(o(a))),1)]))}}),G={class:`player-volume flex flex-col items-center pt-2`},K={class:`text-sm mt-3`},q=g({__name:`PlayerVolumeSlider`,setup(e){let{namespace:n,store:a,field:c}=M(),l=c(`volume`),u=c(`muted`),d=e=>a.dispatch(`${n}/setVolume`,Array.isArray(e)?e[0]:e);return(e,n)=>(m(),s(`div`,G,[i(o(v),{modelValue:o(l),"onUpdate:modelValue":n[0]||=e=>h(l)?l.value=e:null,vertical:``,height:`100px`,"show-tooltip":!1,max:100,min:0,size:`small`,disabled:o(u),onInput:d},null,8,[`modelValue`,`disabled`]),t(`div`,K,r(o(l)),1)]))}}),J={class:`flex items-center justify-center gap-x-3`},Y=[`disabled`,`aria-label`,`title`],X=[`aria-label`,`title`],Z=[`aria-label`,`title`],Q=[`disabled`,`aria-label`,`title`],$=[`aria-label`,`title`],te=C(g({__name:`PlayerController`,setup(e){let{audio:r,dispatchAudio:c,tracks:l,currentIndex:u,playAdjacent:p}=M(),h=d(()=>l.value.length>1),g=d(()=>u.value>0),v=d(()=>u.value!==-1&&u.value<l.value.length-1),C=()=>c({state:r.value?.state===`playing`?`paused`:`playing`});return(e,c)=>(m(),s(`div`,J,[h.value?(m(),s(`button`,{key:0,type:`button`,class:n([`player-control player-control--small cursor-pointer transition-opacity`,g.value?`text-[var(--el-text-color-regular)]`:`opacity-30 cursor-not-allowed`]),disabled:!g.value,"aria-label":e.$t(`common.player.previous`),title:e.$t(`common.player.previous`),onClick:c[0]||=e=>g.value&&o(p)(-1)},[i(o(y),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Y)):a(``,!0),o(r)?.state===`playing`?(m(),s(`button`,{key:1,type:`button`,class:`player-control player-control--main text-[var(--el-color-primary)] cursor-pointer`,"aria-label":e.$t(`common.player.pause`),title:e.$t(`common.player.pause`),onClick:C},[i(o(b),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,X)):(m(),s(`button`,{key:2,type:`button`,class:`player-control player-control--main text-[var(--el-color-primary)] cursor-pointer`,"aria-label":e.$t(`common.player.play`),title:e.$t(`common.player.play`),onClick:C},[i(o(x),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Z)),h.value?(m(),s(`button`,{key:3,type:`button`,class:n([`player-control player-control--small cursor-pointer transition-opacity`,v.value?`text-[var(--el-text-color-regular)]`:`opacity-30 cursor-not-allowed`]),disabled:!v.value,"aria-label":e.$t(`common.player.next`),title:e.$t(`common.player.next`),onClick:c[1]||=e=>v.value&&o(p)(1)},[i(o(ee),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Q)):a(``,!0),i(o(_),{placement:`top`,width:`50px`,trigger:`click`},{reference:f(()=>[t(`button`,{type:`button`,class:`player-control player-control--volume cursor-pointer`,"aria-label":e.$t(`common.player.volume`),title:e.$t(`common.player.volume`)},[i(o(S),{"stroke-width":2,size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,$)]),default:f(()=>[i(q)]),_:1})]))}}),[[`__scopeId`,`data-v-f66c5f86`]]),ne={class:`flex flex-col items-stretch h-20`},re={class:`flex grow px-5 items-center`},ie={class:`flex-1`},ae={class:`flex-1`},oe={class:`flex-1`},se=g({__name:`Player`,props:{namespace:{},tracks:{}},setup(e){let n=e;return p(k,n.namespace),p(A,d(()=>n.tracks??[])),(e,n)=>(m(),s(`div`,ne,[i(P),t(`div`,re,[t(`div`,ie,[i(V)]),t(`div`,ae,[i(te)]),t(`div`,oe,[i(W)])])]))}});export{E as i,O as n,D as r,se as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e,N as t,Q as n,Y as r,at as i,tt as a,wt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./Navigator-
|
|
1
|
+
import{L as e,N as t,Q as n,Y as r,at as i,tt as a,wt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./Navigator-CLTCuwY8.js";import{E as l}from"./index-DKk73XSL.js";var u={class:`poivelle-shell`},d=l(s({__name:`Poivelle`,setup(s){let l=o(typeof window<`u`&&window.innerWidth<768),d=()=>{l.value=window.innerWidth<768};return n(()=>window.addEventListener(`resize`,d)),r(()=>window.removeEventListener(`resize`,d)),(n,r)=>{let o=i(`router-view`);return a(),t(`div`,u,[e(o,{class:`poivelle-view`}),e(c,{class:`poivelle-navigator`,direction:l.value?`row`:`column`},null,8,[`direction`])])}}}),[[`__scopeId`,`data-v-63c6dd21`]]);export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,it as s,j as c,mt as l,tt as u,z as d}from"./vendor-chart-Dw-P17PN.js";import{t as f}from"./tooltip-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,it as s,j as c,mt as l,tt as u,z as d}from"./vendor-chart-Dw-P17PN.js";import{t as f}from"./tooltip-VSerTQEt.js";import{E as p,Ei as m,Fi as h,Wi as g,yi as _}from"./index-DKk73XSL.js";import{a as v}from"./pagination-DgxXd4gx.js";var y=_(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),b=_(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),x=d({name:`PromptTextarea`,components:{FullscreenIcon:b,ElInput:g,ElButton:h,ElTooltip:f,ElDialog:m,InfoIcon:v},props:{modelValue:{type:String,default:``},title:{type:String,required:!0},info:{type:String,default:``},placeholder:{type:String,default:``},minRows:{type:Number,default:4},maxRows:{type:Number,default:12},maxlength:{type:Number,default:0},expandable:{type:Boolean,default:!0},dialogTitle:{type:String,default:``}},emits:[`update:modelValue`,`expand`],data(){return{expanded:!1}},computed:{text:{get(){return this.modelValue??``},set(e){this.$emit(`update:modelValue`,e)}},hasMaxlength(){return typeof this.maxlength==`number`&&this.maxlength>0},effectiveMaxlength(){return this.hasMaxlength?this.maxlength:void 0}},methods:{onExpand(){this.expanded=!0,this.$emit(`expand`)}}}),S={class:`prompt-textarea`},C={class:`header`},w={class:`heading`},T={class:`title font-bold`},E={class:`actions`};function D(d,f,p,m,h,g){let _=o(`info-icon`),v=o(`fullscreen-icon`),y=o(`el-button`),b=o(`el-tooltip`),x=o(`el-input`),D=o(`el-dialog`);return u(),a(`div`,S,[e(`div`,C,[e(`div`,w,[e(`h2`,T,n(d.title),1),d.info?(u(),c(_,{key:0,content:d.info},null,8,[`content`])):i(``,!0)]),e(`div`,E,[s(d.$slots,`actions`,{},void 0,!0),d.expandable?(u(),c(b,{key:0,content:d.$t(`common.button.expand`),placement:`top`},{default:l(()=>[r(y,{size:`small`,circle:``,class:`expand-btn`,"aria-label":d.$t(`common.button.expand`),title:d.$t(`common.button.expand`),onClick:d.onExpand},{default:l(()=>[r(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])]),_:1},8,[`content`])):i(``,!0)])]),s(d.$slots,`before`,{},void 0,!0),r(x,{modelValue:d.text,"onUpdate:modelValue":f[0]||=e=>d.text=e,type:`textarea`,class:`textarea`,autosize:{minRows:d.minRows,maxRows:d.maxRows},resize:`vertical`,placeholder:d.placeholder,maxlength:d.effectiveMaxlength,"show-word-limit":d.hasMaxlength},null,8,[`modelValue`,`autosize`,`placeholder`,`maxlength`,`show-word-limit`]),s(d.$slots,`after`,{},void 0,!0),d.expandable?(u(),c(D,{key:0,modelValue:d.expanded,"onUpdate:modelValue":f[3]||=e=>d.expanded=e,title:d.dialogTitle||d.title,width:`720px`,top:`5vh`,"close-on-click-modal":!1,class:`prompt-expand-dialog`,"append-to-body":``},{footer:l(()=>[r(y,{type:`primary`,onClick:f[2]||=e=>d.expanded=!1},{default:l(()=>[t(n(d.$t(`common.button.confirm`)),1)]),_:1})]),default:l(()=>[r(x,{modelValue:d.text,"onUpdate:modelValue":f[1]||=e=>d.text=e,type:`textarea`,autosize:{minRows:14,maxRows:28},placeholder:d.placeholder,maxlength:d.effectiveMaxlength,"show-word-limit":d.hasMaxlength,autofocus:``},null,8,[`modelValue`,`placeholder`,`maxlength`,`show-word-limit`])]),_:1},8,[`modelValue`,`title`])):i(``,!0)])}var O=p(x,[[`render`,D],[`__scopeId`,`data-v-0543313c`]]);export{b as n,y as r,O as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,Gt as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,p as d,qt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{t as g}from"./chevron-down-Cnvsrfew.js";import{t as _}from"./info-BLLJpmyv.js";import{t as v}from"./mic-CSLvPpSt.js";import{Fi as y,Mi as b,Ni as x,ji as S,la as C}from"./constants-BdhyMN3z.js";import{E as w,P as T,vi as E,yi as D}from"./index-D7PshZL1.js";var O=D(`captions`,[[`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`,key:`12ruh7`}],[`path`,{d:`M7 15h4M15 15h2M7 11h2M13 11h4`,key:`1ueiar`}]]),k=D(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),A=class{token;model;handlers;voice;ws;audioCtx;micStream;micNode;workletNode;analyser;levelRaf=0;running=!1;playHead=0;activeSources=[];disposed=!1;suppressAudio=!1;aiResponding=!1;constructor(e,t,n,r=b){this.token=e,this.model=t,this.handlers=n,this.voice=r}get isRunning(){return this.running}async start(){this.handlers.onStatus?.(`connecting`);let e=window.AudioContext||window.webkitAudioContext;if(this.audioCtx=new e({sampleRate:x}),await this.audioCtx.audioWorklet.addModule(`/recorder-worklet.js`),this.disposed||(this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),this.disposed))return this.teardownAudio();this.micNode=this.audioCtx.createMediaStreamSource(this.micStream),this.workletNode=new AudioWorkletNode(this.audioCtx,`recorder-processor`),this.micNode.connect(this.workletNode),this.analyser=this.audioCtx.createAnalyser(),this.analyser.fftSize=256,this.micNode.connect(this.analyser),this.startLevelLoop();let t=this.audioCtx.createGain();t.gain.value=0,this.workletNode.connect(t).connect(this.audioCtx.destination);let n=`${C}?model=${encodeURIComponent(this.model)}&voice=${encodeURIComponent(this.voice)}`;this.ws=new WebSocket(n,[`realtime`,`acedata-token.${this.token}`]),this.ws.onopen=()=>{if(this.disposed){this.ws?.close();return}this.running=!0,this.handlers.onStatus?.(`connected`)},this.ws.onclose=()=>{this.handlers.onStatus?.(`disconnected`),this.teardownAudio(),this.running=!1},this.ws.onerror=()=>this.handlers.onStatus?.(`error`),this.ws.onmessage=e=>this.onServerEvent(e),this.workletNode.port.onmessage=e=>{!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(JSON.stringify({type:`input_audio_buffer.append`,audio:j(e.data)}))}}setMuted(e){this.micStream?.getAudioTracks().forEach(t=>t.enabled=!e)}startLevelLoop(){let e=new Uint8Array(this.analyser?this.analyser.fftSize:0),t=0,n=()=>{if(this.disposed||!this.analyser)return;this.analyser.getByteTimeDomainData(e);let r=0;for(let t=0;t<e.length;t++){let n=(e[t]-128)/128;r+=n*n}let i=Math.sqrt(r/e.length),a=Math.min(1,i*3.4);t=t*.82+a*.18,this.handlers.onAudioLevel?.(t),this.levelRaf=requestAnimationFrame(n)};this.levelRaf=requestAnimationFrame(n)}stop(){this.disposed=!0,this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)&&this.ws.close(),this.teardownAudio(),this.running=!1,this.handlers.onStatus?.(`disconnected`)}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}onServerEvent(e){let t;try{t=JSON.parse(e.data)}catch{return}switch(t.type){case`session.created`:case`session.updated`:break;case`input_audio_buffer.speech_started`:this.stopPlayback(),this.aiResponding&&this.send({type:`response.cancel`}),this.suppressAudio=!0,this.handlers.onUserSpeechStarted?.();break;case`conversation.item.input_audio_transcription.completed`:this.handlers.onUserTranscript?.(t.transcript||``);break;case`response.created`:this.aiResponding=!0,this.suppressAudio=!1,this.handlers.onAiResponseStart?.();break;case`response.done`:this.aiResponding=!1;break;case`response.output_audio.delta`:case`response.audio.delta`:t.delta&&!this.suppressAudio&&this.enqueuePcm16(t.delta);break;case`response.output_audio_transcript.delta`:case`response.audio_transcript.delta`:t.delta&&this.handlers.onAiTranscriptDelta?.(t.delta);break;case`error`:{let e=t.error||{},n=String(e.code||``),r=String(e.message||``);if(n===`response_cancel_not_active`||/no active response/i.test(r))break;this.handlers.onError?.(r||`realtime error`);break}default:break}}enqueuePcm16(e){if(!this.audioCtx)return;let t=M(e),n=new Int16Array(t);if(n.length===0)return;let r=new Float32Array(n.length);for(let e=0;e<n.length;e++)r[e]=n[e]/32768;let i=this.audioCtx.createBuffer(1,r.length,x);i.getChannelData(0).set(r);let a=this.audioCtx.createBufferSource();a.buffer=i,a.connect(this.audioCtx.destination),this.analyser&&a.connect(this.analyser);let o=this.audioCtx.currentTime;this.playHead<o&&(this.playHead=o+.02),a.start(this.playHead),this.playHead+=i.duration,this.activeSources.push(a),a.onended=()=>{this.activeSources=this.activeSources.filter(e=>e!==a)}}stopPlayback(){for(let e of this.activeSources)try{e.onended=null,e.stop()}catch{}this.activeSources=[],this.playHead=0}teardownAudio(){try{this.levelRaf&&cancelAnimationFrame(this.levelRaf),this.workletNode&&(this.workletNode.port.onmessage=null),this.micStream&&this.micStream.getTracks().forEach(e=>e.stop()),this.stopPlayback(),this.audioCtx&&this.audioCtx.close()}catch{}this.levelRaf=0,this.handlers.onAudioLevel?.(0),this.micStream=this.micNode=this.workletNode=this.audioCtx=this.analyser=void 0}};function j(e){let t=new Uint8Array(e),n=``,r=32768;for(let e=0;e<t.length;e+=r)n+=String.fromCharCode.apply(null,Array.from(t.subarray(e,e+r)));return btoa(n)}function M(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}var N=`nexior.realtime.voice`,P=h({name:`RealtimeCall`,components:{CaptionsIcon:O,CloseIcon:E,ExpandDownIcon:g,InfoIcon:_,MicrophoneIcon:v,MicrophoneOffIcon:k},data(){return{client:void 0,status:`disconnected`,connecting:!1,provisioning:!0,running:!1,aiSpeaking:!1,userText:``,aiText:``,errorMsg:``,level:0,muted:!1,captionsOn:!1,showInfo:!1,voice:b,voices:[...y],voiceMenuOpen:!1,callSeq:0}},computed:{token(){return this.$store.state.realtime?.credential?.token},canCall(){return!!this.token},modelName(){return S},orbScale(){return 1+this.level*.16},haloStyle(){let e=this.running?this.level:0;return{transform:`scale(${1+e*.7})`,opacity:`${.16+e*.5}`}},orbClass(){return{speaking:this.aiSpeaking,live:this.running,idle:!this.running}},captionText(){return this.aiText?this.aiText:this.running&&!this.userText?this.$t(`realtime.listening`):``},stageText(){return this.errorMsg?this.errorMsg:this.provisioning||this.connecting?this.$t(`realtime.status.connecting`):this.running?this.aiSpeaking?this.$t(`realtime.speaking`):this.$t(`realtime.listening`):this.$t(`realtime.start`)},voiceLabel(){return this.labelOf(this.voice)}},async mounted(){try{let e=localStorage.getItem(N);e&&this.voices.includes(e)&&(this.voice=e)}catch{}this.voices.includes(this.voice)||(this.voice=b),this.provisioning=!0;try{await this.$store.dispatch(`realtime/init`)}finally{this.provisioning=!1}this.canCall&&this.startCall()},beforeUnmount(){this.client?.stop()},methods:{async startCall(){if(!this.token||this.connecting||this.running)return;let e=++this.callSeq,t=()=>e===this.callSeq;this.errorMsg=``,this.userText=``,this.aiText=``,this.connecting=!0;let n=new A(this.token,S,{onStatus:e=>{t()&&(this.status=e,this.running=e===`connecting`||e===`connected`,(e===`connected`||e===`disconnected`||e===`error`)&&(this.connecting=!1),this.running||(this.level=0))},onUserSpeechStarted:()=>{t()&&(this.aiSpeaking=!1,this.errorMsg=``)},onUserTranscript:e=>{t()&&(this.userText=e)},onAiResponseStart:()=>{t()&&(this.aiText=``,this.aiSpeaking=!0,this.errorMsg=``)},onAiTranscriptDelta:e=>{t()&&(this.aiText+=e)},onAudioLevel:e=>{t()&&(this.level=e)},onError:e=>{t()&&(this.errorMsg=e)}},this.voice);this.client=n;try{if(await n.start(),!t()||this.client!==n)return;n.setMuted(this.muted)}catch(e){if(n.stop(),!t()||this.client!==n)return;this.connecting=!1,this.running=!1,this.errorMsg=e?.message||this.$t(`realtime.startFailed`)}},toggleMute(){this.muted=!this.muted,this.client?.setMuted(this.muted)},toggleCaptions(){this.captionsOn=!this.captionsOn},labelOf(e){let t=e||`alloy`;return t.charAt(0).toUpperCase()+t.slice(1)},selectVoice(e){if(this.voiceMenuOpen=!1,e!==this.voice){this.voice=e;try{localStorage.setItem(N,e)}catch{}(this.running||this.connecting)&&this.reconnect()}},reconnect(){let e=this.client;this.client=void 0,this.callSeq++,this.running=!1,this.connecting=!1,this.aiSpeaking=!1,this.level=0,this.userText=``,this.aiText=``,this.errorMsg=``,e?.stop(),this.$nextTick(()=>this.startCall())},onOrbTap(){!this.running&&!this.connecting&&this.startCall()},endCall(){this.client?.stop(),this.running=!1,this.aiSpeaking=!1,this.level=0,this.goBack()},goBack(){this.client?.stop(),this.$router.push({name:T})}}}),F={class:`rtc-top`},I={class:`rtc-top-left`},L=[`title`,`aria-label`],R={class:`voice-pick`},ee={class:`voice-name`},z={key:0,class:`voice-menu`},B=[`onClick`],V={class:`rtc-top-right`},H=[`title`,`aria-label`],U=[`title`,`aria-label`],W={class:`rtc-stage`},G={key:0,class:`rtc-info`},K={key:0,class:`rtc-captions`},q={key:0,class:`cap user`},J={class:`cap ai`},Y={class:`rtc-controls`},X=[`title`,`aria-label`],Z=[`title`,`aria-label`],Q=[`title`,`aria-label`];function $(h,g,_,v,y,b){let x=c(`expand-down-icon`),S=c(`info-icon`),C=c(`captions-icon`),w=c(`microphone-off-icon`),T=c(`microphone-icon`),E=c(`close-icon`);return m(),o(`div`,{class:n([`rtc`,{"is-captions":h.captionsOn,"is-live":h.running}])},[e(`header`,F,[e(`div`,I,[e(`button`,{class:`ic`,title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[0]||=(...e)=>h.goBack&&h.goBack(...e)},[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,L),e(`div`,R,[e(`button`,{class:n([`voice-chip`,{on:h.voiceMenuOpen}]),onClick:g[1]||=t(e=>h.voiceMenuOpen=!h.voiceMenuOpen,[`stop`])},[e(`span`,ee,r(h.voiceLabel),1),i(x,{class:`voice-caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})],2),h.voiceMenuOpen?(m(),o(`ul`,z,[(m(!0),o(s,null,p(h.voices,e=>(m(),o(`li`,{key:e,class:n({sel:e===h.voice}),onClick:t=>h.selectVoice(e)},r(h.labelOf(e)),11,B))),128))])):a(``,!0)])]),e(`div`,V,[e(`button`,{class:n([`ic`,{on:h.showInfo}]),title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[2]||=e=>h.showInfo=!h.showInfo},[i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,H),e(`button`,{class:n([`ic`,{on:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[3]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,U)])]),h.voiceMenuOpen?(m(),o(`div`,{key:0,class:`voice-backdrop`,onClick:g[4]||=e=>h.voiceMenuOpen=!1})):a(``,!0),e(`main`,W,[e(`div`,{class:`orb-stage`,onClick:g[5]||=(...e)=>h.onOrbTap&&h.onOrbTap(...e)},[e(`div`,{class:`orb-halo`,style:f(h.haloStyle)},null,4),e(`div`,{class:n([`orb-breathe`,{paused:!h.running}])},[e(`div`,{class:n([`orb`,h.orbClass]),style:f({transform:`scale(${h.orbScale})`})},[...g[9]||=[e(`span`,{class:`cloud c1`},null,-1),e(`span`,{class:`cloud c2`},null,-1),e(`span`,{class:`cloud c3`},null,-1),e(`span`,{class:`sheen`},null,-1)]],6)],2)]),i(d,{name:`fade`},{default:u(()=>[h.showInfo&&!h.captionsOn?(m(),o(`p`,G,r(h.modelName),1)):a(``,!0)]),_:1}),h.captionsOn?(m(),o(`div`,K,[h.userText?(m(),o(`p`,q,r(h.userText),1)):a(``,!0),e(`p`,J,r(h.captionText),1)])):(m(),o(`p`,{key:1,class:n([`rtc-status`,{err:!!h.errorMsg}])},r(h.stageText),3))]),e(`footer`,Y,[e(`button`,{class:n([`ctl`,{active:h.muted}]),title:h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),"aria-label":h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),onClick:g[6]||=(...e)=>h.toggleMute&&h.toggleMute(...e)},[h.muted?(m(),l(w,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),l(T,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))],10,X),e(`button`,{class:n([`ctl`,{active:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[7]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Z),e(`button`,{class:`ctl end`,title:h.$t(`realtime.end`),"aria-label":h.$t(`realtime.end`),onClick:g[8]||=(...e)=>h.endCall&&h.endCall(...e)},[i(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Q)])],2)}var te=w(P,[[`render`,$],[`__scopeId`,`data-v-b55c144b`]]);export{te as default};
|
|
1
|
+
import{A as e,C as t,Gt as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,p as d,qt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{t as g}from"./chevron-down-6whCy-vZ.js";import{t as _}from"./info-ohLaRJyi.js";import{t as v}from"./mic-KPqenF2E.js";import{Fi as y,Mi as b,Ni as x,ji as S,la as C}from"./constants-DneM-Qrs.js";import{E as w,P as T,vi as E,yi as D}from"./index-DKk73XSL.js";var O=D(`captions`,[[`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`,key:`12ruh7`}],[`path`,{d:`M7 15h4M15 15h2M7 11h2M13 11h4`,key:`1ueiar`}]]),k=D(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),A=class{token;model;handlers;voice;ws;audioCtx;micStream;micNode;workletNode;analyser;levelRaf=0;running=!1;playHead=0;activeSources=[];disposed=!1;suppressAudio=!1;aiResponding=!1;constructor(e,t,n,r=b){this.token=e,this.model=t,this.handlers=n,this.voice=r}get isRunning(){return this.running}async start(){this.handlers.onStatus?.(`connecting`);let e=window.AudioContext||window.webkitAudioContext;if(this.audioCtx=new e({sampleRate:x}),await this.audioCtx.audioWorklet.addModule(`/recorder-worklet.js`),this.disposed||(this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),this.disposed))return this.teardownAudio();this.micNode=this.audioCtx.createMediaStreamSource(this.micStream),this.workletNode=new AudioWorkletNode(this.audioCtx,`recorder-processor`),this.micNode.connect(this.workletNode),this.analyser=this.audioCtx.createAnalyser(),this.analyser.fftSize=256,this.micNode.connect(this.analyser),this.startLevelLoop();let t=this.audioCtx.createGain();t.gain.value=0,this.workletNode.connect(t).connect(this.audioCtx.destination);let n=`${C}?model=${encodeURIComponent(this.model)}&voice=${encodeURIComponent(this.voice)}`;this.ws=new WebSocket(n,[`realtime`,`acedata-token.${this.token}`]),this.ws.onopen=()=>{if(this.disposed){this.ws?.close();return}this.running=!0,this.handlers.onStatus?.(`connected`)},this.ws.onclose=()=>{this.handlers.onStatus?.(`disconnected`),this.teardownAudio(),this.running=!1},this.ws.onerror=()=>this.handlers.onStatus?.(`error`),this.ws.onmessage=e=>this.onServerEvent(e),this.workletNode.port.onmessage=e=>{!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(JSON.stringify({type:`input_audio_buffer.append`,audio:j(e.data)}))}}setMuted(e){this.micStream?.getAudioTracks().forEach(t=>t.enabled=!e)}startLevelLoop(){let e=new Uint8Array(this.analyser?this.analyser.fftSize:0),t=0,n=()=>{if(this.disposed||!this.analyser)return;this.analyser.getByteTimeDomainData(e);let r=0;for(let t=0;t<e.length;t++){let n=(e[t]-128)/128;r+=n*n}let i=Math.sqrt(r/e.length),a=Math.min(1,i*3.4);t=t*.82+a*.18,this.handlers.onAudioLevel?.(t),this.levelRaf=requestAnimationFrame(n)};this.levelRaf=requestAnimationFrame(n)}stop(){this.disposed=!0,this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)&&this.ws.close(),this.teardownAudio(),this.running=!1,this.handlers.onStatus?.(`disconnected`)}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}onServerEvent(e){let t;try{t=JSON.parse(e.data)}catch{return}switch(t.type){case`session.created`:case`session.updated`:break;case`input_audio_buffer.speech_started`:this.stopPlayback(),this.aiResponding&&this.send({type:`response.cancel`}),this.suppressAudio=!0,this.handlers.onUserSpeechStarted?.();break;case`conversation.item.input_audio_transcription.completed`:this.handlers.onUserTranscript?.(t.transcript||``);break;case`response.created`:this.aiResponding=!0,this.suppressAudio=!1,this.handlers.onAiResponseStart?.();break;case`response.done`:this.aiResponding=!1;break;case`response.output_audio.delta`:case`response.audio.delta`:t.delta&&!this.suppressAudio&&this.enqueuePcm16(t.delta);break;case`response.output_audio_transcript.delta`:case`response.audio_transcript.delta`:t.delta&&this.handlers.onAiTranscriptDelta?.(t.delta);break;case`error`:{let e=t.error||{},n=String(e.code||``),r=String(e.message||``);if(n===`response_cancel_not_active`||/no active response/i.test(r))break;this.handlers.onError?.(r||`realtime error`);break}default:break}}enqueuePcm16(e){if(!this.audioCtx)return;let t=M(e),n=new Int16Array(t);if(n.length===0)return;let r=new Float32Array(n.length);for(let e=0;e<n.length;e++)r[e]=n[e]/32768;let i=this.audioCtx.createBuffer(1,r.length,x);i.getChannelData(0).set(r);let a=this.audioCtx.createBufferSource();a.buffer=i,a.connect(this.audioCtx.destination),this.analyser&&a.connect(this.analyser);let o=this.audioCtx.currentTime;this.playHead<o&&(this.playHead=o+.02),a.start(this.playHead),this.playHead+=i.duration,this.activeSources.push(a),a.onended=()=>{this.activeSources=this.activeSources.filter(e=>e!==a)}}stopPlayback(){for(let e of this.activeSources)try{e.onended=null,e.stop()}catch{}this.activeSources=[],this.playHead=0}teardownAudio(){try{this.levelRaf&&cancelAnimationFrame(this.levelRaf),this.workletNode&&(this.workletNode.port.onmessage=null),this.micStream&&this.micStream.getTracks().forEach(e=>e.stop()),this.stopPlayback(),this.audioCtx&&this.audioCtx.close()}catch{}this.levelRaf=0,this.handlers.onAudioLevel?.(0),this.micStream=this.micNode=this.workletNode=this.audioCtx=this.analyser=void 0}};function j(e){let t=new Uint8Array(e),n=``,r=32768;for(let e=0;e<t.length;e+=r)n+=String.fromCharCode.apply(null,Array.from(t.subarray(e,e+r)));return btoa(n)}function M(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}var N=`nexior.realtime.voice`,P=h({name:`RealtimeCall`,components:{CaptionsIcon:O,CloseIcon:E,ExpandDownIcon:g,InfoIcon:_,MicrophoneIcon:v,MicrophoneOffIcon:k},data(){return{client:void 0,status:`disconnected`,connecting:!1,provisioning:!0,running:!1,aiSpeaking:!1,userText:``,aiText:``,errorMsg:``,level:0,muted:!1,captionsOn:!1,showInfo:!1,voice:b,voices:[...y],voiceMenuOpen:!1,callSeq:0}},computed:{token(){return this.$store.state.realtime?.credential?.token},canCall(){return!!this.token},modelName(){return S},orbScale(){return 1+this.level*.16},haloStyle(){let e=this.running?this.level:0;return{transform:`scale(${1+e*.7})`,opacity:`${.16+e*.5}`}},orbClass(){return{speaking:this.aiSpeaking,live:this.running,idle:!this.running}},captionText(){return this.aiText?this.aiText:this.running&&!this.userText?this.$t(`realtime.listening`):``},stageText(){return this.errorMsg?this.errorMsg:this.provisioning||this.connecting?this.$t(`realtime.status.connecting`):this.running?this.aiSpeaking?this.$t(`realtime.speaking`):this.$t(`realtime.listening`):this.$t(`realtime.start`)},voiceLabel(){return this.labelOf(this.voice)}},async mounted(){try{let e=localStorage.getItem(N);e&&this.voices.includes(e)&&(this.voice=e)}catch{}this.voices.includes(this.voice)||(this.voice=b),this.provisioning=!0;try{await this.$store.dispatch(`realtime/init`)}finally{this.provisioning=!1}this.canCall&&this.startCall()},beforeUnmount(){this.client?.stop()},methods:{async startCall(){if(!this.token||this.connecting||this.running)return;let e=++this.callSeq,t=()=>e===this.callSeq;this.errorMsg=``,this.userText=``,this.aiText=``,this.connecting=!0;let n=new A(this.token,S,{onStatus:e=>{t()&&(this.status=e,this.running=e===`connecting`||e===`connected`,(e===`connected`||e===`disconnected`||e===`error`)&&(this.connecting=!1),this.running||(this.level=0))},onUserSpeechStarted:()=>{t()&&(this.aiSpeaking=!1,this.errorMsg=``)},onUserTranscript:e=>{t()&&(this.userText=e)},onAiResponseStart:()=>{t()&&(this.aiText=``,this.aiSpeaking=!0,this.errorMsg=``)},onAiTranscriptDelta:e=>{t()&&(this.aiText+=e)},onAudioLevel:e=>{t()&&(this.level=e)},onError:e=>{t()&&(this.errorMsg=e)}},this.voice);this.client=n;try{if(await n.start(),!t()||this.client!==n)return;n.setMuted(this.muted)}catch(e){if(n.stop(),!t()||this.client!==n)return;this.connecting=!1,this.running=!1,this.errorMsg=e?.message||this.$t(`realtime.startFailed`)}},toggleMute(){this.muted=!this.muted,this.client?.setMuted(this.muted)},toggleCaptions(){this.captionsOn=!this.captionsOn},labelOf(e){let t=e||`alloy`;return t.charAt(0).toUpperCase()+t.slice(1)},selectVoice(e){if(this.voiceMenuOpen=!1,e!==this.voice){this.voice=e;try{localStorage.setItem(N,e)}catch{}(this.running||this.connecting)&&this.reconnect()}},reconnect(){let e=this.client;this.client=void 0,this.callSeq++,this.running=!1,this.connecting=!1,this.aiSpeaking=!1,this.level=0,this.userText=``,this.aiText=``,this.errorMsg=``,e?.stop(),this.$nextTick(()=>this.startCall())},onOrbTap(){!this.running&&!this.connecting&&this.startCall()},endCall(){this.client?.stop(),this.running=!1,this.aiSpeaking=!1,this.level=0,this.goBack()},goBack(){this.client?.stop(),this.$router.push({name:T})}}}),F={class:`rtc-top`},I={class:`rtc-top-left`},L=[`title`,`aria-label`],R={class:`voice-pick`},ee={class:`voice-name`},z={key:0,class:`voice-menu`},B=[`onClick`],V={class:`rtc-top-right`},H=[`title`,`aria-label`],U=[`title`,`aria-label`],W={class:`rtc-stage`},G={key:0,class:`rtc-info`},K={key:0,class:`rtc-captions`},q={key:0,class:`cap user`},J={class:`cap ai`},Y={class:`rtc-controls`},X=[`title`,`aria-label`],Z=[`title`,`aria-label`],Q=[`title`,`aria-label`];function $(h,g,_,v,y,b){let x=c(`expand-down-icon`),S=c(`info-icon`),C=c(`captions-icon`),w=c(`microphone-off-icon`),T=c(`microphone-icon`),E=c(`close-icon`);return m(),o(`div`,{class:n([`rtc`,{"is-captions":h.captionsOn,"is-live":h.running}])},[e(`header`,F,[e(`div`,I,[e(`button`,{class:`ic`,title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[0]||=(...e)=>h.goBack&&h.goBack(...e)},[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,L),e(`div`,R,[e(`button`,{class:n([`voice-chip`,{on:h.voiceMenuOpen}]),onClick:g[1]||=t(e=>h.voiceMenuOpen=!h.voiceMenuOpen,[`stop`])},[e(`span`,ee,r(h.voiceLabel),1),i(x,{class:`voice-caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})],2),h.voiceMenuOpen?(m(),o(`ul`,z,[(m(!0),o(s,null,p(h.voices,e=>(m(),o(`li`,{key:e,class:n({sel:e===h.voice}),onClick:t=>h.selectVoice(e)},r(h.labelOf(e)),11,B))),128))])):a(``,!0)])]),e(`div`,V,[e(`button`,{class:n([`ic`,{on:h.showInfo}]),title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[2]||=e=>h.showInfo=!h.showInfo},[i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,H),e(`button`,{class:n([`ic`,{on:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[3]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,U)])]),h.voiceMenuOpen?(m(),o(`div`,{key:0,class:`voice-backdrop`,onClick:g[4]||=e=>h.voiceMenuOpen=!1})):a(``,!0),e(`main`,W,[e(`div`,{class:`orb-stage`,onClick:g[5]||=(...e)=>h.onOrbTap&&h.onOrbTap(...e)},[e(`div`,{class:`orb-halo`,style:f(h.haloStyle)},null,4),e(`div`,{class:n([`orb-breathe`,{paused:!h.running}])},[e(`div`,{class:n([`orb`,h.orbClass]),style:f({transform:`scale(${h.orbScale})`})},[...g[9]||=[e(`span`,{class:`cloud c1`},null,-1),e(`span`,{class:`cloud c2`},null,-1),e(`span`,{class:`cloud c3`},null,-1),e(`span`,{class:`sheen`},null,-1)]],6)],2)]),i(d,{name:`fade`},{default:u(()=>[h.showInfo&&!h.captionsOn?(m(),o(`p`,G,r(h.modelName),1)):a(``,!0)]),_:1}),h.captionsOn?(m(),o(`div`,K,[h.userText?(m(),o(`p`,q,r(h.userText),1)):a(``,!0),e(`p`,J,r(h.captionText),1)])):(m(),o(`p`,{key:1,class:n([`rtc-status`,{err:!!h.errorMsg}])},r(h.stageText),3))]),e(`footer`,Y,[e(`button`,{class:n([`ctl`,{active:h.muted}]),title:h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),"aria-label":h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),onClick:g[6]||=(...e)=>h.toggleMute&&h.toggleMute(...e)},[h.muted?(m(),l(w,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),l(T,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))],10,X),e(`button`,{class:n([`ctl`,{active:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[7]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Z),e(`button`,{class:`ctl end`,title:h.$t(`realtime.end`),"aria-label":h.$t(`realtime.end`),onClick:g[8]||=(...e)=>h.endCall&&h.endCall(...e)},[i(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Q)])],2)}var te=w(P,[[`render`,$],[`__scopeId`,`data-v-b55c144b`]]);export{te as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,j as d,mt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{n as g,r as ee,t as te}from"./select-B77f_PJQ.js";import{t as ne}from"./time-picker-yaHVs5b_.js";import{n as re,t as _}from"./form-BNJ9LdPs.js";import{t as v}from"./tooltip-VSerTQEt.js";import{t as y}from"./card-D-4S-l7a.js";import{r as b,t as x}from"./radio-DgDgyT2l.js";import{t as S}from"./drawer-CtDMRtb8.js";import{t as C}from"./empty-B1wenOj5.js";import{t as w}from"./input-number-BAvJZ8RJ.js";import{t as T}from"./pagination-BzpXSliP.js";import{t as E}from"./skeleton-B3LIGUiE.js";import{t as D}from"./switch-BEH6EuR9.js";import{t as O}from"./brain-DOkreN5i.js";import{t as k}from"./chevron-right-RN3rq9L5.js";import{t as A}from"./clock-CSS2EFTL.js";import{t as j}from"./pencil-DklKkSt6.js";import{t as M}from"./play-CSQzkamb.js";import{t as N}from"./plus-g4A7eCfw.js";import{t as P}from"./refresh-cw-p_tCFlcn.js";import{t as F}from"./trash-2-DEZLHac1.js";import{t as I}from"./vendor-axios-Ck2ffRoh.js";import{Li as L,Xi as R,na as z}from"./constants-DneM-Qrs.js";import{E as B,Ei as V,Fi as H,Ni as U,Wi as W,bi as G,nn as ie,xi as K}from"./index-DKk73XSL.js";function q(e){let t=ie();return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,...t?{"x-site-origin":t}:{}}}var J=`${z}/aichat2/scheduled-tasks`;function Y(e){let t=e?.response?.data;return t?.error===`skill_not_active`?t.detail??{kind:`skill`,slug:``,reason:`not_active`}:null}var X=new class{async listTasks(e){let{data:t}=await I.post(J,{action:`retrieve_batch`},{headers:q(e)});return t?.items??[]}async createTask(e,t,n=!1){let{data:r}=await I.post(J,{action:`create`,...t,...n?{force:!0}:{}},{headers:q(e)});return r}async updateTask(e,t,n,r=!1){let{data:i}=await I.post(J,{action:`update`,id:t,...n,...r?{force:!0}:{}},{headers:q(e)});return i}async deleteTask(e,t){await I.post(J,{action:`delete`,id:t},{headers:q(e)})}async triggerTask(e,t){let{data:n}=await I.post(J,{action:`trigger`,id:t},{headers:q(e)});return n??{}}async listRuns(e,t){let{data:n}=await I.post(J,{action:`retrieve_runs`,id:t},{headers:q(e)});return n?.items??[]}async listAllRuns(e,t={}){let{data:n}=await I.post(J,{action:`retrieve_runs_batch`,...t},{headers:q(e)});return{items:n?.items??[],count:n?.count??0}}async listAuthorizableSkills(e){let{data:t}=await I.post(J,{action:`retrieve_authorizable_skills`},{headers:q(e)});return t?.items??[]}async listAuthorizableCapabilities(e){let{data:t}=await I.post(J,{action:`retrieve_authorizable_skills`},{headers:q(e)});return{skills:t?.skills??t?.items??[],mcp_servers:t?.mcp_servers??[]}}},Z=Intl.DateTimeFormat().resolvedOptions().timeZone||`Asia/Shanghai`,Q=50,ae=h({name:`ScheduledTasks`,components:{AiIcon:O,ExpandRightIcon:k,PlayIcon:M,TimeIcon:A,AddIcon:N,DeleteIcon:F,EditIcon:j,RefreshIcon:P,ElButton:H,ElCard:y,ElSkeleton:E,ElEmpty:C,ElSwitch:D,ElTag:U,ElTooltip:v,ElDrawer:S,ElDialog:V,ElForm:_,ElFormItem:re,ElInput:W,ElSelect:ee,ElOption:te,ElOptionGroup:g,ElRadioGroup:b,ElRadio:x,ElTimePicker:ne,ElInputNumber:w,Pagination:T},data(){return{tasks:[],runs:[],activeTab:`tasks`,tabs:[`tasks`,`runs`],statusFilters:[`all`,`success`,`failed`,`running`,`queued`],allRuns:[],allRunsCount:0,allRunsLoading:!1,allRunsStatus:`all`,allRunsPage:1,allRunsPageSize:20,allRunsRequestId:0,loading:!1,runsLoading:!1,skillsLoading:!1,saving:!1,showCreateDialog:!1,showRunHistory:!1,selectedTask:null,editingTask:null,authorizableSkills:[],authorizableMcpServers:[],triggeringId:``,weekdays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],page:1,pageSize:6,runPage:1,runPageSize:8,form:this.emptyForm()}},computed:{token(){return this.$store.state.chat?.credential?.token},modelGroups(){let e=this.$store.state.site?.features??{};return L.filter(t=>e[t.name]?.enabled!==!1).map(e=>({...e,models:e.models.filter(e=>e.enabled!==!1)})).filter(e=>e.models.length>0)},pagedTasks(){let e=(this.page-1)*this.pageSize;return this.tasks.slice(e,e+this.pageSize)},pagedRuns(){let e=(this.runPage-1)*this.runPageSize;return this.runs.slice(e,e+this.runPageSize)},intervalMax(){return this.form.intervalUnit===`minute`?1440:this.form.intervalUnit===`hour`?720:365},schedulePreview(){try{return this.humanizeSchedule(this.buildSchedule())}catch{return``}},selectedBrowserConnections(){let e=new Set(this.form.authorizedSkills);return this.authorizableSkills.filter(t=>e.has(t.slug)).flatMap(e=>e.browser_connections??[])},selectedBrowserSkills(){let e=new Set(this.form.authorizedSkills);return this.authorizableSkills.filter(t=>e.has(t.slug)&&t.browser_connections!==void 0)},selectedBrowserConnection(){return this.selectedBrowserConnections.find(e=>e.connection_id===this.form.browserConnectionId)},accountChoices(){let e=new Set(this.form.authorizedSkills),t=new Map;for(let n of this.authorizableSkills)if(e.has(n.slug))for(let[e,r]of Object.entries(n.connection_accounts??{})){if((r?.length??0)<2)continue;let n=r[0].connector_identifier||e;t.has(n)||t.set(n,{label:e,accounts:r})}return[...t.entries()].map(([e,{label:t,accounts:n}])=>({identifier:e,label:t,accounts:n}))}},async mounted(){await this.loadTasks()},methods:{emptyForm(){return{name:``,question:``,model:R,scheduleType:`daily`,intervalValue:4,intervalUnit:`hour`,hourlyMinute:0,dailyTime:`09:00`,weekday:1,cronExpr:`0 9 * * *`,authorizedSkills:[],authorizedMcpServers:[],browserConnectionId:``,connectionAccounts:{},authorizationExpiresAt:Math.floor(Date.now()/1e3)+720*60*60,maxTurns:Q}},deriveName(e){let t=(e||``).trim().split(`
|
|
2
|
+
`)[0].trim();return t.length>40?`${t.slice(0,40)}…`:t||`Scheduled Task`},async loadTasks(){if(this.token){this.loading=!0;try{this.tasks=await X.listTasks(this.token);let e=Math.max(1,Math.ceil(this.tasks.length/this.pageSize));this.page>e&&(this.page=e)}catch{K.error(this.$t(`chat.scheduledTasks.loadError`))}finally{this.loading=!1}}},async selectTask(e){this.selectedTask=e,this.showRunHistory=!0,this.runPage=1,this.runsLoading=!0;try{this.runs=await X.listRuns(this.token,e.id)}finally{this.runsLoading=!1}},onPageChange(e){this.page=e},switchTab(e){this.activeTab!==e&&(this.activeTab=e,e===`runs`&&this.loadAllRuns())},onStatusFilter(e){this.allRunsStatus!==e&&(this.allRunsStatus=e,this.allRunsPage=1,this.loadAllRuns())},onAllRunsPageChange(e){this.allRunsPage=e,this.loadAllRuns()},async loadAllRuns(){if(!this.token)return;let e=++this.allRunsRequestId;this.allRunsLoading=!0;try{let{items:t,count:n}=await X.listAllRuns(this.token,{status:this.allRunsStatus===`all`?void 0:this.allRunsStatus,offset:(this.allRunsPage-1)*this.allRunsPageSize,limit:this.allRunsPageSize});if(e!==this.allRunsRequestId)return;this.allRuns=t,this.allRunsCount=n}catch{if(e!==this.allRunsRequestId)return;K.error(this.$t(`chat.scheduledTasks.loadError`))}finally{e===this.allRunsRequestId&&(this.allRunsLoading=!1)}},onRunPageChange(e){this.runPage=e},openCreate(){this.saving||(this.editingTask=null,this.form=this.emptyForm(),this.showCreateDialog=!0)},closeTaskDialog(){this.saving||(this.showCreateDialog=!1)},openEdit(e){this.editingTask=e;let t=e.schedule,n=`cron`,r=4,i=`hour`,a=0,o=`09:00`,s=`0 9 * * *`,c=1;if(t.type===`cron`){s=t.cron;let[e,r,i,l,u]=t.cron.split(/\s+/),d=e=>/^\d+$/.test(e);i===`*`&&l===`*`&&u===`*`&&r===`*`&&d(e)?(n=`hourly`,a=Number(e)):i===`*`&&l===`*`&&u===`*`&&d(r)&&d(e)?(n=`daily`,o=`${r.padStart(2,`0`)}:${e.padStart(2,`0`)}`):i===`*`&&l===`*`&&d(u)&&d(r)&&d(e)&&(n=`weekly`,c=Number(u),o=`${r.padStart(2,`0`)}:${e.padStart(2,`0`)}`)}else if(t.type===`interval`){n=`interval`;let e=t.interval_seconds;e%86400==0?(i=`day`,r=e/86400):e%3600==0?(i=`hour`,r=e/3600):(i=`minute`,r=Math.max(1,Math.round(e/60)))}this.form={name:e.name,question:e.template.question,model:e.template.model,scheduleType:n,intervalValue:r,intervalUnit:i,hourlyMinute:a,dailyTime:o,weekday:c,cronExpr:s,authorizedSkills:e.unattended_policy?.mode===`allow_selected_skills`&&e.unattended_policy.allowed_skills||[],authorizedMcpServers:e.unattended_policy?.mode===`allow_selected_skills`&&e.unattended_policy.allowed_mcp_servers||[],browserConnectionId:e.unattended_policy?.browser_connections?.[0]?.connection_id??``,connectionAccounts:Object.fromEntries((e.unattended_policy?.connection_bindings??[]).map(e=>[e.connector_identifier,e.connection_id])),authorizationExpiresAt:e.unattended_policy?.expires_at??Math.floor(Date.now()/1e3)+720*60*60,maxTurns:e.template.max_turns??Q},this.showCreateDialog=!0,this.loadAuthorizableSkills()},buildSchedule(){let{scheduleType:e,intervalValue:t,intervalUnit:n,hourlyMinute:r,dailyTime:i,weekday:a,cronExpr:o}=this.form;if(e===`interval`)return{type:`interval`,interval_seconds:Math.max(60,Math.round(t)*(n===`day`?86400:n===`hour`?3600:60)),tz:Z};if(e===`hourly`)return{type:`cron`,cron:`${Math.min(59,Math.max(0,Math.round(r)))} * * * *`,tz:Z};if(e===`daily`){let[e,t]=i.split(`:`);return{type:`cron`,cron:`${t} ${e} * * *`,tz:Z}}if(e===`weekly`){let[e,t]=i.split(`:`);return{type:`cron`,cron:`${t} ${e} * * ${a}`,tz:Z}}return{type:`cron`,cron:o,tz:Z}},async saveTask(){if(!this.form.question.trim()){K.warning(this.$t(`chat.scheduledTasks.form.required`));return}if(this.form.authorizedSkills.length>0||this.form.authorizedMcpServers.length>0)try{await G.confirm(this.authorizationConfirmText(),this.$t(`chat.scheduledTasks.form.skillsConfirmTitle`),{type:`warning`,confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`)})}catch{return}let e=[...this.form.authorizedSkills],t=[...this.form.authorizedMcpServers],n;if(this.selectedBrowserSkills.length){let e=this.selectedBrowserConnection;if(!e||!e.online||!e.compatible){K.error(this.$t(`chat.scheduledTasks.form.browserBindingInvalid`));return}n=[{connection_id:e.connection_id,connection_revision:e.connection_revision,device_id:e.device_id,wire_contract_digest:e.wire_contract_digest,policy_digest:e.policy_digest}]}let r=this.accountChoices.map(e=>({connector_identifier:e.identifier,connection_id:this.form.connectionAccounts[e.identifier]||``})).filter(e=>!!e.connection_id&&this.accountChoices.find(t=>t.identifier===e.connector_identifier)?.accounts.some(t=>t.connection_id===e.connection_id)),i={name:this.form.name.trim()||this.deriveName(this.form.question),schedule:this.buildSchedule(),template:{model:this.form.model,question:this.form.question,skills:e,mcp_servers:t,max_turns:this.form.maxTurns},unattended_policy:e.length||t.length?{mode:`allow_selected_skills`,allowed_skills:e,allowed_mcp_servers:t,browser_connections:n,connection_bindings:r.length?r:void 0,expires_at:this.form.authorizationExpiresAt}:{mode:`deny_all`,allowed_skills:[],allowed_mcp_servers:[]}};await this.submitTask(i,!1)},async submitTask(e,t){this.saving=!0;let n=null;try{if(this.editingTask){let n=this.editingTask.id,r=await X.updateTask(this.token,n,e,t),i=this.tasks.findIndex(e=>e.id===n);i!==-1&&(this.tasks[i]=r)}else{let n=await X.createTask(this.token,e,t);this.tasks=[n,...this.tasks],this.page=1}K.success(this.$t(`chat.scheduledTasks.create`)+` OK`),this.showCreateDialog=!1,this.editingTask=null,this.form=this.emptyForm()}catch(e){n=t?null:Y(e),n||K.error(this.$t(`chat.scheduledTasks.loadError`))}finally{this.saving=!1}if(n){if(this.selectedBrowserSkills.length)return;await this.confirmForceSkill(n)&&await this.submitTask(e,!0)}},async confirmForceSkill(e){let t=this.capabilityLabel(e.slug);try{return await G.confirm(this.$t(`chat.scheduledTasks.form.skillNotActiveMessage`,{name:t}),this.$t(`chat.scheduledTasks.form.skillNotActiveTitle`),{type:`warning`,confirmButtonText:this.$t(`chat.scheduledTasks.form.skillNotActiveForce`),cancelButtonText:this.$t(`common.button.cancel`)}),!0}catch{return!1}},capabilityLabel(e){let t=this.authorizableSkills.find(t=>t.slug===e);if(t)return t.name||t.slug;let n=this.authorizableMcpServers.find(t=>t.slug===e);return n?n.name||n.slug:e},async loadAuthorizableSkills(e=!1){if(!(!this.token||this.skillsLoading||!e&&(this.authorizableSkills.length||this.authorizableMcpServers.length))){this.skillsLoading=!0;try{let e=await X.listAuthorizableCapabilities(this.token);this.authorizableSkills=e.skills,this.authorizableMcpServers=e.mcp_servers}catch{K.error(this.$t(`chat.scheduledTasks.loadError`))}finally{this.skillsLoading=!1}}},onSkillSelectVisible(e){e&&this.loadAuthorizableSkills(!0)},skillLabel(e){return e.name||e.slug},mcpServerLabel(e){return e.name||e.slug},authorizationConfirmText(){let e=new Set(this.form.authorizedSkills),t=new Set(this.form.authorizedMcpServers),n=this.authorizableSkills.filter(t=>e.has(t.slug)).map(e=>this.skillLabel(e)),r=this.authorizableMcpServers.filter(e=>t.has(e.slug)).map(e=>this.mcpServerLabel(e));return this.$t(`chat.scheduledTasks.form.skillsConfirm`,{count:e.size+t.size,skills:[...n,...r].length?[...n,...r].join(`, `):[...Array.from(e),...Array.from(t)].join(`, `)})},async toggleState(e,t){let n=this.tasks.findIndex(t=>t.id===e.id),r=t?`enabled`:`disabled`;n!==-1&&(this.tasks[n]={...e,state:r});try{let t=await X.updateTask(this.token,e.id,{state:r});n!==-1&&(this.tasks[n]=t)}catch{n!==-1&&(this.tasks[n]={...e,state:e.state}),K.error(this.$t(`chat.scheduledTasks.loadError`))}},async triggerNow(e){if(!this.triggeringId){this.triggeringId=e.id;try{await X.triggerTask(this.token,e.id),K.success(this.$t(`chat.scheduledTasks.triggerSuccess`)),this.showRunHistory&&this.selectedTask?.id===e.id&&(this.runs=await X.listRuns(this.token,e.id),this.runPage=1)}catch{K.error(this.$t(`chat.scheduledTasks.triggerError`))}finally{this.triggeringId=``}}},async confirmDelete(e){await G.confirm(this.$t(`chat.scheduledTasks.deleteConfirm`,{name:e.name}),{type:`warning`});try{await X.deleteTask(this.token,e.id),this.tasks=this.tasks.filter(t=>t.id!==e.id);let t=Math.max(1,Math.ceil(this.tasks.length/this.pageSize));this.page>t&&(this.page=t)}catch{K.error(this.$t(`chat.scheduledTasks.loadError`))}},openRun(e){if(!e.conversation_id)return;let t=this.modelGroups.map(e=>e.name),n=e.conversation_model_group,r=this.$store.state.chat?.modelGroup?.name||`chatgpt`,i=n&&(t.length===0||t.includes(n))?n:r;this.$router.push(`/${i}/conversations/${e.conversation_id}`)},stateTagType(e){return e===`enabled`?`success`:e===`error`?`danger`:`info`},runTagType(e){return e===`success`?`success`:e===`failed`?`danger`:`warning`},accountTagText(e){let t=e.provider_alias||e.connector_identifier,n=e.label||e.account_name;return n?`${t} · ${n}`:t},runOutcomeText(e){return e.outcome_reason?e.outcome_reason:this.runErrorText(e)},runErrorText(e){if(e.error_message)return e.error_message;let t=e.error_code;return t?this.errorCodeText(t):``},errorCodeText(e){let t=`chat.scheduledTasks.run.reason.${e}`;return this.$te(t)?this.$t(t):e.replace(/_/g,` `)},humanizeSchedule(e){let t=(e,t)=>this.$t(`chat.scheduledTasks.humanize.${e}`,t??{});if(e.type===`interval`){let n=e.interval_seconds;return n%86400==0?t(`everyNDays`,{n:n/86400}):n%3600==0?t(`everyNHours`,{n:n/3600}):t(`everyNMinutes`,{n:Math.round(n/60)})}if(e.type===`cron`){let[n,r,i,a,o]=e.cron.split(/\s+/),s=e=>/^\d+$/.test(e);if(i===`*`&&a===`*`&&o===`*`&&r===`*`&&s(n))return t(`hourlyAtMinute`,{n:Number(n)});let c=s(r)&&s(n)?`${r.padStart(2,`0`)}:${n.padStart(2,`0`)}`:``;return c&&i===`*`&&a===`*`&&o===`*`?t(`dailyAt`,{time:c}):c&&i===`*`&&a===`*`&&s(o)?t(`weeklyAt`,{weekday:this.weekdays[Number(o)]??o,time:c}):t(`cronRaw`,{cron:e.cron})}return t(`once`,{time:new Date(e.at*1e3).toLocaleString()})},scheduleLabel(e){return this.humanizeSchedule(e)},formatTime(e){return new Date(e*1e3).toLocaleString()}}}),oe={class:`scheduled-tasks`},se={class:`inner`},ce={class:`header`},le={class:`title`},ue=[`aria-label`],de=[`aria-selected`,`onClick`],fe={class:`task-list`},pe={class:`task-top`},me={class:`task-name`},he={class:`task-meta`},ge={class:`meta-chip`},_e={class:`meta-chip`},ve={class:`task-prompt`},ye={key:0,class:`task-last-output`},be={class:`task-footer`},xe={class:`run-count`},Se={key:0,class:`error-hint`},Ce={class:`open-hint`},we={key:0,class:`pager`},Te=[`aria-label`],Ee=[`aria-pressed`,`onClick`],De={class:`run-list`},Oe=[`tabindex`,`role`,`onClick`,`onKeydown`],ke={class:`run-body`},Ae={class:`run-line`},je={class:`run-title`},Me={key:0,class:`run-preview`},Ne={class:`run-sub`},Pe={class:`run-time`},Fe=[`title`],Ie={class:`run-action`},Le={key:1,class:`run-noconv`},Re={key:0,class:`pager`},ze={key:0,class:`run-context`},Be={class:`run-context-meta`},Ve={class:`run-context-prompt`},He={key:3,class:`run-list`},Ue=[`tabindex`,`role`,`onClick`,`onKeydown`],We={class:`run-body`},Ge={class:`run-line`},Ke={class:`run-title`},qe={key:0,class:`run-preview`},Je={class:`run-sub`},Ye={class:`run-time`},Xe=[`title`],Ze={class:`run-action`},Qe={key:1,class:`run-noconv`},$e={key:4,class:`pager run-pager`},et={class:`hint`},tt={key:0,class:`schedule-preview`},$={class:`hint`},nt={class:`hint`},rt={class:`jitter-hint`},it={class:`hint`},at={class:`skill-option`},ot={class:`skill-option-name`},st={key:0,class:`skill-option-missing`},ct={class:`hint`},lt={key:0,class:`browser-binding-summary`},ut={class:`hint`},dt={class:`hint`};function ft(h,g,ee,te,ne,re){let _=u(`add-icon`),v=u(`el-button`),y=u(`el-skeleton`),b=u(`el-empty`),x=u(`el-switch`),S=u(`play-icon`),C=u(`el-tooltip`),w=u(`edit-icon`),T=u(`delete-icon`),E=u(`el-tag`),D=u(`time-icon`),O=u(`ai-icon`),k=u(`refresh-icon`),A=u(`expand-right-icon`),j=u(`el-card`),M=u(`pagination`),N=u(`el-drawer`),P=u(`el-input`),F=u(`el-form-item`),I=u(`el-option`),L=u(`el-option-group`),R=u(`el-select`),z=u(`el-radio`),B=u(`el-radio-group`),V=u(`el-input-number`),H=u(`el-time-picker`),U=u(`el-form`),W=u(`el-dialog`);return m(),s(`div`,oe,[e(`div`,se,[e(`div`,ce,[e(`h2`,le,i(h.$t(`chat.scheduledTasks.title`)),1),h.activeTab===`tasks`?(m(),d(v,{key:0,type:`primary`,round:``,disabled:h.saving,onClick:h.openCreate},{default:f(()=>[a(_,{size:16,class:`icon`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.$t(`chat.scheduledTasks.create`)),1)]),_:1},8,[`disabled`,`onClick`])):o(``,!0)]),e(`div`,{class:`tabs`,role:`tablist`,"aria-label":h.$t(`chat.scheduledTasks.title`)},[(m(!0),s(l,null,p(h.tabs,e=>(m(),s(`button`,{key:e,type:`button`,role:`tab`,class:n([`tab`,{active:h.activeTab===e}]),"aria-selected":h.activeTab===e,onClick:t=>h.switchTab(e)},i(h.$t(`chat.scheduledTasks.tab.${e}`)),11,de))),128))],8,ue),h.activeTab===`tasks`?(m(),s(l,{key:0},[h.loading?(m(),d(y,{key:0,rows:4,animated:``,class:`loading-block`})):h.tasks.length?(m(),s(l,{key:2},[e(`div`,fe,[(m(!0),s(l,null,p(h.pagedTasks,n=>(m(),d(j,{key:n.id,class:`task-card`,shadow:`hover`,onClick:e=>h.selectTask(n)},{default:f(()=>[e(`div`,pe,[e(`div`,me,i(n.name),1),e(`div`,{class:`task-actions`,onClick:g[0]||=t(()=>{},[`stop`])},[a(x,{"model-value":n.state===`enabled`,onChange:e=>h.toggleState(n,e===!0)},null,8,[`model-value`,`onChange`]),a(C,{content:h.$t(`chat.scheduledTasks.triggerNow`),placement:`top`},{default:f(()=>[a(v,{text:``,class:`icon-action`,loading:h.triggeringId===n.id,"aria-label":h.$t(`chat.scheduledTasks.triggerNow`),title:h.$t(`chat.scheduledTasks.triggerNow`),onClick:e=>h.triggerNow(n)},{default:f(()=>[h.triggeringId===n.id?o(``,!0):(m(),d(S,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:2},1032,[`loading`,`aria-label`,`title`,`onClick`])]),_:2},1032,[`content`]),a(C,{content:h.$t(`common.button.edit`),placement:`top`},{default:f(()=>[a(v,{text:``,class:`icon-action`,"aria-label":h.$t(`common.button.edit`),onClick:e=>h.openEdit(n)},{default:f(()=>[a(w,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`onClick`])]),_:2},1032,[`content`]),a(C,{content:h.$t(`common.button.delete`),placement:`top`},{default:f(()=>[a(v,{text:``,type:`danger`,class:`icon-action`,"aria-label":h.$t(`common.button.delete`),onClick:e=>h.confirmDelete(n)},{default:f(()=>[a(T,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`onClick`])]),_:2},1032,[`content`])])]),e(`div`,he,[a(E,{size:`small`,type:h.stateTagType(n.state),effect:`dark`,round:``},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.state.${n.state}`)),1)]),_:2},1032,[`type`]),e(`span`,ge,[a(D,{class:`meta-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.scheduleLabel(n.schedule)),1)]),e(`span`,_e,[a(O,{class:`meta-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.template.model),1)])]),e(`div`,ve,i(n.template.question),1),n.last_output_snippet?(m(),s(`div`,ye,i(n.last_output_snippet),1)):o(``,!0),e(`div`,be,[e(`span`,xe,[a(k,{size:16,class:`footer-icon`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.$t(`chat.scheduledTasks.runCount`,{count:n.run_count})),1)]),n.last_error?(m(),s(`span`,Se,i(h.errorCodeText(n.last_error)),1)):o(``,!0),e(`span`,Ce,[r(i(h.$t(`chat.scheduledTasks.viewRuns`))+` `,1),a(A,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])])]),_:2},1032,[`onClick`]))),128))]),h.tasks.length>h.pageSize?(m(),s(`div`,we,[a(M,{"current-page":h.page,"page-size":h.pageSize,total:h.tasks.length,onChange:h.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])):o(``,!0)],64)):(m(),d(b,{key:1,description:h.$t(`chat.scheduledTasks.empty`),class:`empty`},null,8,[`description`]))],64)):(m(),s(l,{key:1},[e(`div`,{class:`filters`,role:`group`,"aria-label":h.$t(`chat.scheduledTasks.tab.runs`)},[(m(!0),s(l,null,p(h.statusFilters,e=>(m(),s(`button`,{key:e,type:`button`,class:n([`filter-chip`,{active:h.allRunsStatus===e}]),"aria-pressed":h.allRunsStatus===e,onClick:t=>h.onStatusFilter(e)},i(e===`all`?h.$t(`chat.scheduledTasks.filterAll`):h.$t(`chat.scheduledTasks.run.${e}`)),11,Ee))),128))],8,Te),h.allRunsLoading?(m(),d(y,{key:0,rows:4,animated:``,class:`loading-block`})):h.allRuns.length?(m(),s(l,{key:2},[e(`div`,De,[(m(!0),s(l,null,p(h.allRuns,u=>(m(),s(`div`,{key:u.id,class:n([`run-item`,{clickable:!!u.conversation_id}]),tabindex:u.conversation_id?0:-1,role:u.conversation_id?`button`:void 0,onClick:e=>h.openRun(u),onKeydown:[c(e=>h.openRun(u),[`enter`]),c(t(e=>h.openRun(u),[`prevent`]),[`space`])]},[e(`div`,ke,[e(`div`,Ae,[e(`span`,je,i(u.conversation_title||h.formatTime(u.scheduled_at)),1),a(E,{size:`small`,type:h.runTagType(u.status),effect:`dark`,round:``,class:`run-tag`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.run.${u.status}`)),1)]),_:2},1032,[`type`])]),u.conversation_preview?(m(),s(`div`,Me,i(u.conversation_preview),1)):o(``,!0),e(`div`,Ne,[u.task_name?(m(),d(E,{key:0,size:`small`,type:`info`,round:``,class:`run-task-tag`},{default:f(()=>[r(i(u.task_name),1)]),_:2},1024)):o(``,!0),(m(!0),s(l,null,p(u.run_accounts,(e,t)=>(m(),d(E,{key:`${e.connector_identifier}-${t}`,size:`small`,type:`info`,round:``,class:`run-account-tag`},{default:f(()=>[r(i(h.accountTagText(e)),1)]),_:2},1024))),128)),e(`span`,Pe,i(h.formatTime(u.scheduled_at)),1),h.runOutcomeText(u)?(m(),s(`span`,{key:1,class:n(u.status===`success`?`run-outcome`:`run-error`),title:h.runOutcomeText(u)},i(h.runOutcomeText(u)),11,Fe)):o(``,!0)])]),e(`div`,Ie,[u.conversation_id?(m(),d(A,{key:0,class:`run-arrow`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),s(`span`,Le,i(h.$t(`chat.scheduledTasks.noConversation`)),1))])],42,Oe))),128))]),h.allRunsCount>h.allRunsPageSize?(m(),s(`div`,Re,[a(M,{"current-page":h.allRunsPage,"page-size":h.allRunsPageSize,total:h.allRunsCount,onChange:h.onAllRunsPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])):o(``,!0)],64)):(m(),d(b,{key:1,description:h.$t(`chat.scheduledTasks.noRuns`),class:`empty`},null,8,[`description`]))],64))]),a(N,{modelValue:h.showRunHistory,"onUpdate:modelValue":g[1]||=e=>h.showRunHistory=e,title:h.selectedTask?.name,direction:`rtl`,size:`min(560px, 92vw)`,class:`run-history-drawer`},{default:f(()=>[h.selectedTask?(m(),s(`div`,ze,[e(`div`,Be,[e(`span`,null,i(h.scheduleLabel(h.selectedTask.schedule)),1),e(`span`,null,i(h.selectedTask.template.model),1),e(`span`,null,i(h.$t(`chat.scheduledTasks.runCount`,{count:h.selectedTask.run_count})),1)]),e(`div`,Ve,i(h.selectedTask.template.question),1)])):o(``,!0),h.runsLoading?(m(),d(y,{key:1,rows:3,animated:``})):h.runs.length?(m(),s(`div`,He,[(m(!0),s(l,null,p(h.pagedRuns,u=>(m(),s(`div`,{key:u.id,class:n([`run-item`,{clickable:!!u.conversation_id}]),tabindex:u.conversation_id?0:-1,role:u.conversation_id?`button`:void 0,onClick:e=>h.openRun(u),onKeydown:[c(e=>h.openRun(u),[`enter`]),c(t(e=>h.openRun(u),[`prevent`]),[`space`])]},[e(`div`,We,[e(`div`,Ge,[e(`span`,Ke,i(u.conversation_title||h.formatTime(u.scheduled_at)),1),a(E,{size:`small`,type:h.runTagType(u.status),effect:`dark`,round:``,class:`run-tag`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.run.${u.status}`)),1)]),_:2},1032,[`type`])]),u.conversation_preview?(m(),s(`div`,qe,i(u.conversation_preview),1)):o(``,!0),e(`div`,Je,[(m(!0),s(l,null,p(u.run_accounts,(e,t)=>(m(),d(E,{key:`${e.connector_identifier}-${t}`,size:`small`,type:`info`,round:``,class:`run-account-tag`},{default:f(()=>[r(i(h.accountTagText(e)),1)]),_:2},1024))),128)),e(`span`,Ye,i(h.formatTime(u.scheduled_at)),1),h.runOutcomeText(u)?(m(),s(`span`,{key:0,class:n(u.status===`success`?`run-outcome`:`run-error`),title:h.runOutcomeText(u)},i(h.runOutcomeText(u)),11,Xe)):o(``,!0)])]),e(`div`,Ze,[u.conversation_id?(m(),d(A,{key:0,class:`run-arrow`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),s(`span`,Qe,i(h.$t(`chat.scheduledTasks.noConversation`)),1))])],42,Ue))),128))])):(m(),d(b,{key:2,description:h.$t(`chat.scheduledTasks.noRuns`)},null,8,[`description`])),!h.runsLoading&&h.runs.length>h.runPageSize?(m(),s(`div`,$e,[a(M,{"current-page":h.runPage,"page-size":h.runPageSize,total:h.runs.length,onChange:h.onRunPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])):o(``,!0)]),_:1},8,[`modelValue`,`title`]),a(W,{modelValue:h.showCreateDialog,"onUpdate:modelValue":g[17]||=e=>h.showCreateDialog=e,title:h.editingTask?h.$t(`chat.scheduledTasks.edit`):h.$t(`chat.scheduledTasks.create`),width:`540px`,"close-on-click-modal":!1,"close-on-press-escape":!h.saving,"show-close":!h.saving,class:`scheduled-task-dialog`},{footer:f(()=>[a(v,{disabled:h.saving,onClick:h.closeTaskDialog},{default:f(()=>[r(i(h.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(v,{type:`primary`,loading:h.saving,onClick:h.saveTask},{default:f(()=>[r(i(h.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`,`onClick`])]),default:f(()=>[a(U,{model:h.form,"label-width":`92px`},{default:f(()=>[a(F,{label:h.$t(`chat.scheduledTasks.form.name`)},{default:f(()=>[a(P,{modelValue:h.form.name,"onUpdate:modelValue":g[2]||=e=>h.form.name=e,placeholder:h.$t(`chat.scheduledTasks.form.namePlaceholder`),maxlength:`80`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.prompt`),required:``},{default:f(()=>[a(P,{modelValue:h.form.question,"onUpdate:modelValue":g[3]||=e=>h.form.question=e,type:`textarea`,rows:6,placeholder:h.$t(`chat.scheduledTasks.form.promptPlaceholder`)},null,8,[`modelValue`,`placeholder`]),e(`div`,et,i(h.$t(`chat.scheduledTasks.form.promptHint`)),1)]),_:1},8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.model`)},{default:f(()=>[a(R,{modelValue:h.form.model,"onUpdate:modelValue":g[4]||=e=>h.form.model=e,style:{width:`100%`},filterable:``},{default:f(()=>[(m(!0),s(l,null,p(h.modelGroups,e=>(m(),d(L,{key:e.name,label:e.getDisplayName()},{default:f(()=>[(m(!0),s(l,null,p(e.models,e=>(m(),d(I,{key:e.name,label:e.getDisplayName(),value:e.name},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.schedule`)},{default:f(()=>[a(B,{modelValue:h.form.scheduleType,"onUpdate:modelValue":g[5]||=e=>h.form.scheduleType=e},{default:f(()=>[a(z,{value:`interval`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.interval`)),1)]),_:1}),a(z,{value:`hourly`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.hourly`)),1)]),_:1}),a(z,{value:`daily`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.daily`)),1)]),_:1}),a(z,{value:`weekly`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.weekly`)),1)]),_:1}),a(z,{value:`cron`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.cron`)),1)]),_:1})]),_:1},8,[`modelValue`]),h.schedulePreview?(m(),s(`div`,tt,[a(D,{class:`preview-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.$t(`chat.scheduledTasks.form.schedulePreview`,{text:h.schedulePreview})),1)])):o(``,!0)]),_:1},8,[`label`]),h.form.scheduleType===`interval`?(m(),d(F,{key:0,label:h.$t(`chat.scheduledTasks.scheduleType.interval`)},{default:f(()=>[a(V,{modelValue:h.form.intervalValue,"onUpdate:modelValue":g[6]||=e=>h.form.intervalValue=e,min:1,max:h.intervalMax,step:1,"controls-position":`right`},null,8,[`modelValue`,`max`]),a(R,{modelValue:h.form.intervalUnit,"onUpdate:modelValue":g[7]||=e=>h.form.intervalUnit=e,style:{width:`110px`,"margin-left":`8px`}},{default:f(()=>[a(I,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.minute`),value:`minute`},null,8,[`label`]),a(I,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.hour`),value:`hour`},null,8,[`label`]),a(I,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.day`),value:`day`},null,8,[`label`])]),_:1},8,[`modelValue`]),e(`div`,$,i(h.$t(`chat.scheduledTasks.form.intervalHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`hourly`?(m(),d(F,{key:1,label:h.$t(`chat.scheduledTasks.form.hourlyMinute`)},{default:f(()=>[a(V,{modelValue:h.form.hourlyMinute,"onUpdate:modelValue":g[8]||=e=>h.form.hourlyMinute=e,min:0,max:59,step:1,"controls-position":`right`},null,8,[`modelValue`]),e(`div`,nt,i(h.$t(`chat.scheduledTasks.form.hourlyMinuteHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`daily`?(m(),d(F,{key:2,label:h.$t(`chat.scheduledTasks.form.time`)},{default:f(()=>[a(H,{modelValue:h.form.dailyTime,"onUpdate:modelValue":g[9]||=e=>h.form.dailyTime=e,format:`HH:mm`,"value-format":`HH:mm`},null,8,[`modelValue`]),e(`span`,rt,i(h.$t(`chat.scheduledTasks.jitterHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`weekly`?(m(),d(F,{key:3,label:h.$t(`chat.scheduledTasks.form.weekday`)},{default:f(()=>[a(R,{modelValue:h.form.weekday,"onUpdate:modelValue":g[10]||=e=>h.form.weekday=e,style:{width:`120px`}},{default:f(()=>[(m(!0),s(l,null,p(h.weekdays,(e,t)=>(m(),d(I,{key:t,label:e,value:t},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`]),a(H,{modelValue:h.form.dailyTime,"onUpdate:modelValue":g[11]||=e=>h.form.dailyTime=e,format:`HH:mm`,"value-format":`HH:mm`,style:{"margin-left":`8px`}},null,8,[`modelValue`])]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`cron`?(m(),d(F,{key:4,label:h.$t(`chat.scheduledTasks.form.cron`)},{default:f(()=>[a(P,{modelValue:h.form.cronExpr,"onUpdate:modelValue":g[12]||=e=>h.form.cronExpr=e,placeholder:`0 9 * * *`},null,8,[`modelValue`]),e(`div`,it,i(h.$t(`chat.scheduledTasks.form.cronHint`)),1)]),_:1},8,[`label`])):o(``,!0),a(F,{label:h.$t(`chat.scheduledTasks.form.skills`)},{default:f(()=>[a(R,{modelValue:h.form.authorizedSkills,"onUpdate:modelValue":g[13]||=e=>h.form.authorizedSkills=e,style:{width:`100%`},multiple:``,filterable:``,"collapse-tags":``,"collapse-tags-tooltip":``,loading:h.skillsLoading,placeholder:h.$t(`chat.scheduledTasks.form.skillsPlaceholder`),onVisibleChange:h.onSkillSelectVisible},{default:f(()=>[(m(!0),s(l,null,p(h.authorizableSkills,t=>(m(),d(I,{key:t.slug,label:h.skillLabel(t),value:t.slug,disabled:!t.connected},{default:f(()=>[e(`div`,at,[e(`span`,ot,i(h.skillLabel(t)),1),t.connected?o(``,!0):(m(),s(`span`,st,i(h.$t(`chat.scheduledTasks.form.skillMissing`)),1))])]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`modelValue`,`loading`,`placeholder`,`onVisibleChange`]),e(`div`,ct,i(h.$t(`chat.scheduledTasks.form.skillsHint`)),1)]),_:1},8,[`label`]),h.selectedBrowserSkills.length?(m(),d(F,{key:5,label:h.$t(`chat.scheduledTasks.form.browserConnection`),required:``},{default:f(()=>[a(R,{modelValue:h.form.browserConnectionId,"onUpdate:modelValue":g[14]||=e=>h.form.browserConnectionId=e,style:{width:`100%`}},{default:f(()=>[(m(!0),s(l,null,p(h.selectedBrowserConnections,e=>(m(),d(I,{key:e.connection_id,label:`${e.name} · ${e.device_name}`,value:e.connection_id,disabled:!e.online||!e.compatible},null,8,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`modelValue`]),h.selectedBrowserConnection?(m(),s(`div`,lt,[e(`div`,null,i(h.selectedBrowserConnection.allowed_origins.join(`, `)),1),e(`div`,null,i(h.$t(`chat.scheduledTasks.form.browserEffects`,{effects:h.selectedBrowserConnection.side_effects.join(`, `)})),1),e(`div`,null,i(h.$t(`chat.scheduledTasks.form.authorizationExpires`,{time:h.formatTime(h.form.authorizationExpiresAt)})),1)])):o(``,!0)]),_:1},8,[`label`])):o(``,!0),(m(!0),s(l,null,p(h.accountChoices,e=>(m(),d(F,{key:e.identifier,label:h.$t(`chat.scheduledTasks.form.connectionAccount`,{connector:e.label})},{default:f(()=>[a(R,{modelValue:h.form.connectionAccounts[e.identifier],"onUpdate:modelValue":t=>h.form.connectionAccounts[e.identifier]=t,clearable:``,placeholder:h.$t(`chat.scheduledTasks.form.connectionAccountDefault`),style:{width:`100%`}},{default:f(()=>[(m(!0),s(l,null,p(e.accounts,e=>(m(),d(I,{key:e.connection_id,label:e.is_default?`${e.label||e.account_name} · ${h.$t(`chat.scheduledTasks.form.accountIsDefault`)}`:e.label||e.account_name,value:e.connection_id},null,8,[`label`,`value`]))),128))]),_:2},1032,[`modelValue`,`onUpdate:modelValue`,`placeholder`])]),_:2},1032,[`label`]))),128)),a(F,{label:h.$t(`chat.scheduledTasks.form.mcpServers`)},{default:f(()=>[a(R,{modelValue:h.form.authorizedMcpServers,"onUpdate:modelValue":g[15]||=e=>h.form.authorizedMcpServers=e,style:{width:`100%`},multiple:``,filterable:``,"collapse-tags":``,"collapse-tags-tooltip":``,loading:h.skillsLoading,placeholder:h.$t(`chat.scheduledTasks.form.mcpServersPlaceholder`),onVisibleChange:h.onSkillSelectVisible},{default:f(()=>[(m(!0),s(l,null,p(h.authorizableMcpServers,e=>(m(),d(I,{key:e.slug,label:h.mcpServerLabel(e),value:e.slug},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`loading`,`placeholder`,`onVisibleChange`]),e(`div`,ut,i(h.$t(`chat.scheduledTasks.form.mcpServersHint`)),1)]),_:1},8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.maxTurns`)},{default:f(()=>[a(V,{modelValue:h.form.maxTurns,"onUpdate:modelValue":g[16]||=e=>h.form.maxTurns=e,min:1,max:50,step:1,"controls-position":`right`},null,8,[`modelValue`]),e(`div`,dt,i(h.$t(`chat.scheduledTasks.form.maxTurnsHint`)),1)]),_:1},8,[`label`])]),_:1},8,[`model`])]),_:1},8,[`modelValue`,`title`,`close-on-press-escape`,`show-close`])])}var pt=B(ae,[[`render`,ft],[`__scopeId`,`data-v-06471b37`]]);export{pt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.scheduled-tasks[data-v-06471b37]{height:100%;overflow-y:auto;background-color:var(--el-bg-color-page)!important}.inner[data-v-06471b37]{max-width:880px;margin:0 auto;padding:24px 20px 48px}.header[data-v-06471b37]{justify-content:space-between;align-items:center;margin-bottom:20px;display:flex}.title[data-v-06471b37]{color:var(--el-text-color-primary);margin:0;font-size:20px;font-weight:700}.header .icon[data-v-06471b37]{margin-right:6px}.tabs[data-v-06471b37]{border-bottom:1px solid var(--app-border-subtle,var(--el-border-color-lighter));gap:6px;margin-bottom:16px;display:flex}.tab[data-v-06471b37]{appearance:none;color:var(--el-text-color-secondary);cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-1px;padding:8px 12px;font-size:14px;font-weight:600;transition:color .16s,border-color .16s}.tab[data-v-06471b37]:hover{color:var(--el-text-color-primary)}.tab[data-v-06471b37]:focus-visible{outline:2px solid var(--el-color-primary);outline-offset:2px;border-radius:4px}.tab.active[data-v-06471b37]{color:var(--el-color-primary);border-bottom-color:var(--el-color-primary)}.filters[data-v-06471b37]{flex-wrap:wrap;gap:8px;margin-bottom:16px;display:flex}.filter-chip[data-v-06471b37]{appearance:none;border:1px solid var(--app-border-subtle,var(--el-border-color-lighter));background:var(--app-bg-surface,var(--el-bg-color-overlay));color:var(--el-text-color-regular);cursor:pointer;border-radius:999px;padding:5px 14px;font-size:13px;transition:background .16s,border-color .16s,color .16s}.filter-chip[data-v-06471b37]:hover:not(.active){background:var(--el-fill-color-lighter)}.filter-chip[data-v-06471b37]:focus-visible{outline:2px solid var(--el-color-primary);outline-offset:2px}.filter-chip.active[data-v-06471b37]{background:var(--el-color-primary);border-color:var(--el-color-primary);color:#fff}.run-task-tag[data-v-06471b37],.run-account-tag[data-v-06471b37]{text-overflow:ellipsis;flex-shrink:0;max-width:200px;overflow:hidden}@media (width<=767px){.inner[data-v-06471b37]{padding-top:56px}}.loading-block[data-v-06471b37]{padding:12px 4px}.task-list[data-v-06471b37]{flex-direction:column;gap:14px;display:flex}.task-card[data-v-06471b37]{cursor:pointer;border:none;border-radius:16px}.task-card[data-v-06471b37] .el-card__body{padding:16px 18px}.task-top[data-v-06471b37]{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.task-name[data-v-06471b37]{color:var(--el-text-color-primary);word-break:break-word;font-size:16px;font-weight:600;line-height:1.4}.task-actions[data-v-06471b37]{flex-shrink:0;align-items:center;gap:0;display:flex}.task-actions .el-button+.el-button[data-v-06471b37]{margin-left:0}.icon-action[data-v-06471b37]{padding:6px 5px}.task-meta[data-v-06471b37]{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:10px;display:flex}.meta-chip[data-v-06471b37]{color:var(--el-text-color-secondary);background:var(--el-fill-color-light);border-radius:8px;align-items:center;gap:5px;padding:3px 9px;font-size:12px;display:inline-flex}.meta-icon[data-v-06471b37]{opacity:.85;font-size:11px}.task-prompt[data-v-06471b37]{color:var(--el-text-color-regular);white-space:pre-line;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;font-size:13px;line-height:1.55;display:-webkit-box;overflow:hidden}.task-last-output[data-v-06471b37]{color:var(--el-text-color-secondary);background:var(--el-fill-color-lighter);-webkit-line-clamp:2;line-clamp:2;border-radius:10px;-webkit-box-orient:vertical;margin-top:10px;padding:10px 12px;font-size:12px;line-height:1.5;display:-webkit-box;overflow:hidden}.task-footer[data-v-06471b37]{color:var(--el-text-color-secondary);align-items:center;gap:10px;margin-top:12px;font-size:12px;display:flex}.run-count[data-v-06471b37]{align-items:center;gap:5px;display:inline-flex}.footer-icon[data-v-06471b37]{opacity:.85;font-size:11px}.error-hint[data-v-06471b37]{color:var(--el-color-danger);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.open-hint[data-v-06471b37]{color:var(--el-color-primary);flex-shrink:0;align-items:center;gap:5px;margin-left:auto;display:inline-flex}.empty[data-v-06471b37]{padding:60px 0}.pager[data-v-06471b37]{justify-content:center;margin-top:20px;display:flex}.run-pager[data-v-06471b37]{margin-top:8px}.run-context[data-v-06471b37]{border-bottom:1px solid var(--app-border-subtle,var(--el-border-color-lighter));margin-bottom:14px;padding-bottom:14px}.run-context-meta[data-v-06471b37]{color:var(--el-text-color-secondary);flex-wrap:wrap;gap:8px;font-size:12px;display:flex}.run-context-meta span+span[data-v-06471b37]:before{content:"·";color:var(--el-text-color-placeholder);margin-right:8px}.run-context-prompt[data-v-06471b37]{color:var(--el-text-color-secondary);white-space:pre-line;max-height:48px;margin-top:8px;font-size:12px;line-height:1.55;overflow:hidden}.run-list[data-v-06471b37]{flex-direction:column;gap:10px;display:flex}.run-item[data-v-06471b37]{border:1px solid var(--app-border-subtle,var(--el-border-color-lighter));background:var(--app-bg-surface,var(--el-bg-color-overlay));border-radius:14px;align-items:center;gap:12px;padding:12px 14px;transition:background .16s,border-color .16s;display:flex}.run-item.clickable[data-v-06471b37]{cursor:pointer}.run-item.clickable[data-v-06471b37]:hover,.run-item.clickable[data-v-06471b37]:focus-visible{background:var(--el-fill-color-lighter);border-color:var(--el-border-color);outline:none}.run-body[data-v-06471b37]{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}.run-line[data-v-06471b37]{align-items:center;gap:8px;display:flex}.run-title[data-v-06471b37]{min-width:0;color:var(--el-text-color-primary);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:14px;font-weight:600;overflow:hidden}.run-tag[data-v-06471b37]{flex-shrink:0}.run-preview[data-v-06471b37]{color:var(--el-text-color-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:12px;line-height:1.5;overflow:hidden}.run-sub[data-v-06471b37]{flex-wrap:wrap;align-items:center;gap:10px;min-width:0;display:flex}.run-time[data-v-06471b37]{color:var(--el-text-color-secondary);font-size:12px}.run-error[data-v-06471b37],.run-outcome[data-v-06471b37]{min-width:0;color:var(--el-text-color-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.run-action[data-v-06471b37]{flex-shrink:0;align-self:center;align-items:center;display:flex}.run-arrow[data-v-06471b37]{color:var(--el-text-color-secondary);flex-shrink:0;font-size:12px}.run-noconv[data-v-06471b37]{color:var(--el-text-color-secondary);flex-shrink:0;font-size:11px}.hint[data-v-06471b37]{color:var(--el-text-color-secondary);flex-basis:100%;margin-top:6px;font-size:11px;line-height:1.5}.jitter-hint[data-v-06471b37]{color:var(--el-text-color-secondary);margin-left:8px;font-size:11px}.schedule-preview[data-v-06471b37]{background:var(--el-fill-color-light);width:fit-content;color:var(--el-text-color-regular);border-radius:8px;flex-basis:100%;align-items:center;gap:6px;margin-top:12px;padding:7px 12px;font-size:12px;display:inline-flex}.preview-icon[data-v-06471b37]{color:var(--el-color-primary)}.skill-option[data-v-06471b37]{justify-content:space-between;align-items:center;gap:8px;min-width:0;display:flex}.skill-option-name[data-v-06471b37]{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.skill-option-missing[data-v-06471b37]{color:var(--el-text-color-secondary);flex-shrink:0;font-size:11px}.run-history-drawer.el-drawer,.run-history-drawer .el-drawer{border-top-left-radius:18px;border-bottom-left-radius:18px;overflow:hidden}.scheduled-task-dialog.el-dialog,.scheduled-task-dialog .el-dialog{border-radius:16px;overflow:hidden}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{W as h}from"./use-deprecated-r4dlLNqm.js";import{t as g}from"./chart-no-axes-combined-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{W as h}from"./use-deprecated-r4dlLNqm.js";import{t as g}from"./chart-no-axes-combined-BCgOy60w.js";import{t as _}from"./check-C2X01eRN.js";import{t as v}from"./coins-CrGDhXjo.js";import{t as y}from"./wallet-BvCrULod.js";import{B as b,E as x,Ei as S,Fi as C,K as w,fi as T,hi as E,hn as D,ri as O}from"./index-DKk73XSL.js";import{t as k}from"./CopyToClipboard-Cuw_Hc_J.js";var A=m({name:`ApplicationInfo`,components:{AnalyticsIcon:g,ConfirmIcon:_,CreditsIcon:v,ElButton:C,ElIcon:h,CopyToClipboard:k,WalletIcon:y},props:{application:{type:Object,required:!0},showType:{type:Boolean,default:!1},showId:{type:Boolean,default:!1}},emits:[`buy`,`usage`],computed:{showPayment(){return D(this.$store.getters.site)?!1:!T()||this.application?.scope===`Global`?!0:(this.application?.packages||[]).some(e=>e?.metadata?.apple_product_id)},remainingAmountText(){let e=Number(this.application?.remaining_amount??0);return!Number.isFinite(e)||e<0?`0.00`:e.toFixed(2)}}}),j={class:`flex flex-col min-w-0`},M={key:0,class:`app-id-row`},N={class:`icon !mb-0 flex-shrink-0`},P={class:`app-id-line`},F={class:`app-id-label`},I={class:`app-id-value`},L={key:1,class:`icon`},R={class:`text-left`},z={class:`description`},ee={key:0},B={key:1},V={class:`value`},H={class:`description2`},U={key:0},W={key:1},G={class:`actions`};function K(n,c,f,m,h,g){let _=l(`confirm-icon`),v=l(`el-icon`),y=l(`wallet-icon`),b=l(`copy-to-clipboard`),x=l(`el-tag`),S=l(`analytics-icon`),C=l(`el-button`),w=l(`credits-icon`);return p(),s(`div`,null,[e(`div`,j,[a(v,{class:`check`},{default:d(()=>[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1}),n.showId?(p(),s(`div`,M,[e(`div`,N,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,P,[e(`span`,F,i(n.$t(`application.field.id`))+`:`,1),e(`span`,I,i(n.application.id),1),n.application.id?(p(),u(b,{key:0,content:n.application.id,class:`copy-small`},null,8,[`content`])):o(``,!0)])])):(p(),s(`div`,L,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`div`,R,[e(`p`,z,[n.application.service?(p(),s(`span`,B,i(n.$t(`application.title.applicationBalance`,{service:n.application.service?.title})),1)):(p(),s(`span`,ee,i(n.$t(`application.title.globalBalance`)),1)),n.application.role===`grantee`?(p(),u(x,{key:2,class:`shared-badge`,size:`small`,type:`warning`,effect:`dark`,round:``},{default:d(()=>[r(i(n.$t(`application.badge.shared`)),1)]),_:1})):o(``,!0)]),e(`p`,V,i(n.remainingAmountText)+` `+i(n.$t(`service.unit.`+(n.application?.service?.unit||`credit`)+`s`)),1),e(`p`,H,[n.application.type===`Period`?(p(),s(`span`,U,i(n.$t(`application.field.expiredAt`))+`: `+i(n.$dayjs.format(n.application.expired_at)),1)):(p(),s(`span`,W,i(n.$t(`application.message.neverExpire`)),1))])])]),e(`div`,G,[a(C,{size:`small`,round:``,onClick:c[0]||=t(e=>n.$emit(`usage`,n.application),[`stop`])},{default:d(()=>[a(S,{class:`mr-1 text-[11px]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`application.button.usage`)),1)]),_:1}),n.showPayment?(p(),u(C,{key:0,type:`primary`,round:``,size:`small`,onClick:c[1]||=t(e=>n.$emit(`buy`,n.application),[`stop`])},{default:d(()=>[a(w,{class:`mr-1 text-[11px]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`application.button.buyMore`)),1)]),_:1})):o(``,!0)])])}var q=m({name:`ApplicationStatus`,components:{WalletIcon:y,ElDialog:S,ApplicationInfo:x(A,[[`render`,K],[`__scopeId`,`data-v-19146d4c`]])},props:{application:{type:Object,required:!0},applications:{type:Array,default:void 0},service:{type:Object,required:!0}},emits:[`select`],data(){return{visible:!1,applicationType:O}},computed:{authenticated(){return!!this.$store.state.token.access},user(){return this.$store.state.user},balanceAmount(){return Number(this.application?.remaining_amount??0)},balanceUnit(){let e=`service.unit.${this.application?.service?.unit||`credit`}`+(this.balanceAmount===1?``:`s`);return this.$t(e)},balanceText(){let e=this.balanceAmount;return Number.isFinite(e)?e>=1e3?Math.round(e).toLocaleString():e>=100?e.toFixed(1):e.toFixed(2):`0`},balanceTitle(){return`${this.balanceText} ${this.balanceUnit}`}},methods:{onGoUsage(e){let t={name:w,query:{application_id:e.id}};if(E()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onBuyMore(e){let t={name:b,params:{id:e.id}};if(E()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onSelectApplication(e){this.$emit(`select`,e)}}}),J={class:`status`},Y={key:0},X={class:`text-center mb-4`},Z={class:`flex flex-col gap-4 mb-6 overflow-y-auto`},Q=[`title`],$={class:`entry-amount`},te={class:`entry-unit`};function ne(t,r,m,h,g,_){let v=l(`application-info`),y=l(`el-dialog`),b=l(`wallet-icon`);return p(),s(`div`,J,[a(y,{modelValue:t.visible,"onUpdate:modelValue":r[0]||=e=>t.visible=e,class:`mt-12`,width:`450px`},{default:d(()=>[t.application?(p(),s(`div`,Y,[e(`p`,X,i(t.$t(`application.message.applicationSelection`)),1),e(`div`,Z,[(p(!0),s(c,null,f(t.applications,(e,r)=>(p(),u(v,{key:r,class:n({item:!0,active:t.application?.id===e.id}),application:e,"show-id":``,onClick:n=>t.onSelectApplication(e),onUsage:n=>t.onGoUsage(e),onBuy:n=>t.onBuyMore(e)},null,8,[`class`,`application`,`onClick`,`onUsage`,`onBuy`]))),128))])])):o(``,!0)]),_:1},8,[`modelValue`]),e(`button`,{type:`button`,class:`entry`,title:t.balanceTitle,onClick:r[1]||=e=>t.visible=!0},[a(b,{class:`entry-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,$,i(t.balanceText),1),e(`span`,te,i(t.balanceUnit),1)],8,Q)])}var re=x(q,[[`render`,ne],[`__scopeId`,`data-v-b2f8b2d1`]]);export{re as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./card-D-4S-l7a.js";import{n as h,t as g}from"./row-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./card-D-4S-l7a.js";import{n as h,t as g}from"./row-B9MsO7Fu.js";import{t as _}from"./empty-B1wenOj5.js";import{t as v}from"./skeleton-B3LIGUiE.js";import{t as y}from"./check-C2X01eRN.js";import{B as b,E as x,Fi as S,Ni as C,U as w,V as T,Xn as E,br as D,dn as O,fi as k,fr as A,hn as j,ii as M,ln as N,qt as P,ri as F,tr as I,vi as L,xi as R}from"./index-DKk73XSL.js";var z=p({name:`ConsoleSubscriptionBuy`,components:{CloseIcon:L,ConfirmIcon:y,ElSkeleton:v,ElRow:g,ElTag:C,ElCol:h,ElCard:m,ElEmpty:_,ElButton:S},data(){return{application:void 0,application2:void 0,type:F.PERIOD,services:[],loading:!1,loadFailed:!1,creating:!1,subscription:void 0}},computed:{site(){return this.$store.getters.site},applicationId(){return this.$route.params?.id?.toString()},showPayment(){return!k()},effectiveMarkupRatio(){return O(this.application2,this.site)},pricingAvailable(){return this.effectiveMarkupRatio!==void 0},subscriptions(){let e=[{name:`WEEK`,label:this.$t(`console.subscription.weekly`),description:this.$t(`console.subscription.weekly.description`),duration:10080*60},{name:`MONTH`,label:this.$t(`console.subscription.monthly`),description:this.$t(`console.subscription.monthly.description`),duration:720*60*60},{name:`YEAR`,tag:this.$t(`console.button.suggested`),label:this.$t(`console.subscription.yearly`),description:this.$t(`console.subscription.yearly.description`),duration:365*24*60*60}];for(let t of e){console.log(`item`,t);let e=this.getPackages(t.duration);console.log(`pkgs`,e),t.available=e.length>0&&this.effectiveMarkupRatio!==void 0,t.available&&(t.price=N(e.reduce((e,t)=>e+t.price,0),this.effectiveMarkupRatio));for(let n of e)t.benefits||=[],t.benefits.push({enabled:!0,content:`${n?.service?.title} - ${n.amount} `+this.$t(`service.unit.`+n?.service?.unit+`s`)});t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit1`)}),t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit2`)})}return e},service(){return this.application?.service},serviceIds(){return!this.application||!this.application.service?[]:[this.application.service.id]}},async mounted(){if(j(this.$store.getters.site)){this.$router.replace({name:T});return}await this.onInitialize()},methods:{async onInitialize(){this.loading=!0,this.loadFailed=!1;try{await this.onFetchApplication(),await this.onFetchApplication2(),await this.onCreateApplications(),this.subscription=this.subscriptions.find(e=>e.available)}catch{this.loadFailed=!0}finally{this.loading=!1}},getPriceString:P,onBuyExtra(){this.$router.push({name:b,params:{id:this.applicationId}})},getPackages(e){let t=[];if(!this.service)return[];let n=[this.service].sort((e,t)=>this.serviceIds.indexOf(e.id)-this.serviceIds.indexOf(t.id));for(let r of n){let n=r.packages?.find(t=>t.type===M.PERIOD&&t.duration===e);n&&t.push({...n,service:r})}return t},async onCreateApplications(){let e=[];if(this.application2||e.push(this.application?.service?.id),e.length>0){for(let t of e)await A.create({service_id:t,type:F.PERIOD});await this.onFetchApplication2()}},onChangeType(){console.log(`onChangeType`,this.type),this.$router.push({name:b,params:this.$route.params})},async onFetchServices(){let{data:e}=await E.getAll({id:this.serviceIds});this.services=e.items,console.debug(`services`,this.services)},async onFetchApplication(){let{data:e}=await A.get(this.applicationId);this.application=e,console.debug(`application`,this.application)},async onFetchApplication2(){let{data:e}=await A.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:`-created_at`,service_id:this.serviceIds,type:F.PERIOD});this.application2=e.items?.[0],console.debug(`application2`,this.application2)},onCreateOrder(e){let t=this.getPackages(e.duration);if(!(!this.pricingAvailable||!e.available||t.length===0)){if(this.subscription=e,this.creating=!0,!this.application2||!this.application2.id){R.error(this.$t(`console.message.applicationNotFound`)),this.creating=!1;return}D(`payment_initiated`,{service:this.service?.alias,action:`subscribe`,duration:e.duration}),I.create({application_ids:[this.application2.id],package_ids:t.map(e=>e.id),description:this.service?.title+` - `+e.label}).then(({data:e})=>{this.creating=!1,this.$router.push({name:w,params:{id:e.id}})}).catch(e=>{R.error(this.$t(`order.message.createFailed`)),this.creating=!1,D(`payment_failed`,{service:this.service?.alias,action:`subscribe`,error:e?.response?.data?.error?.message??String(e)})})}}}}),B={class:`title`},V={class:`introduction`},H={key:1,class:`text-center`},U={class:`name`},W={class:`price`},G={key:1,class:`text-[var(--el-text-color-secondary)]`},K={class:`description`},q={class:`benefits`},J={class:`operations`},Y={key:3,class:`extra`};function X(p,m,h,g,_,v){let y=c(`el-col`),b=c(`el-row`),x=c(`el-empty`),S=c(`el-skeleton`),C=c(`el-button`),w=c(`el-tag`),T=c(`confirm-icon`),E=c(`close-icon`),D=c(`el-card`);return f(),l(b,{class:`panel`},{default:u(()=>[i(y,{span:24},{default:u(()=>[i(b,null,{default:u(()=>[i(y,{span:24},{default:u(()=>[e(`h2`,B,r(p.$t(`common.title.buyMore`)),1)]),_:1})]),_:1}),i(b,null,{default:u(()=>[i(y,{span:24},{default:u(()=>[i(D,{shadow:`hover`,class:`card`},{default:u(()=>[i(b,null,{default:u(()=>[p.showPayment?(f(),l(y,{key:1,class:`max-w-4xl mx-auto`},{default:u(()=>[e(`p`,V,r(p.$t(`console.subscription.title`)),1),p.loading?(f(),l(S,{key:0})):p.loadFailed?(f(),o(`div`,H,[i(x,{description:p.$t(`common.message.noData`)},null,8,[`description`]),i(C,{type:`primary`,round:``,onClick:p.onInitialize},{default:u(()=>[n(r(p.$t(`common.button.refresh`)),1)]),_:1},8,[`onClick`])])):(f(),l(b,{key:2,gutter:15,class:`subscriptions`},{default:u(()=>[(f(!0),o(s,null,d(p.subscriptions,(c,m)=>(f(),l(y,{key:m,xs:24,md:24/(p.subscriptions?.length||4)},{default:u(()=>[i(D,{shadow:`hover`,class:t({subscription:!0,active:p.subscription?.name===c.name,disabled:!c.available}),onClick:e=>c.available&&(p.subscription=c)},{default:u(()=>[e(`h4`,U,[n(r(c.label)+` `,1),c.tag?(f(),l(w,{key:0,type:`warning`},{default:u(()=>[n(r(c.tag),1)]),_:2},1024)):a(``,!0)]),e(`h2`,W,[c.price===void 0?(f(),o(`span`,G,r(p.$t(`common.message.noData`)),1)):(f(),o(s,{key:0},[n(r(p.getPriceString({value:c.price})),1)],64))]),e(`p`,K,r(c.description),1),e(`div`,q,[(f(!0),o(s,null,d(c.benefits,(t,n)=>(f(),o(`div`,{key:n,class:`benefit`},[t.enabled?(f(),l(T,{key:0,class:`icon icon-check`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(f(),l(E,{key:1,class:`icon icon-xmark`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,r(t.content),1)]))),128))]),e(`div`,J,[p.showPayment?(f(),l(C,{key:0,class:`btn btn-subscribe`,type:p.subscription?.name===c?.name?`primary`:``,disabled:!c.available,round:``,onClick:e=>p.onCreateOrder(c)},{default:u(()=>[n(r(p.$t(`common.button.buy`)),1)]),_:1},8,[`type`,`disabled`,`onClick`])):a(``,!0)])]),_:2},1032,[`class`,`onClick`])]),_:2},1032,[`md`]))),128))]),_:1})),!p.loading&&!p.loadFailed&&p.showPayment?(f(),o(`div`,Y,[e(`span`,null,r(p.$t(`console.message.doNotWantSubscribe`)),1),i(C,{type:`primary`,class:`btn btn-extra`,round:``,size:`small`,onClick:p.onBuyExtra},{default:u(()=>[n(r(p.$t(`console.message.buyExtra`)),1)]),_:1},8,[`onClick`])])):a(``,!0)]),_:1})):(f(),l(y,{key:0,class:`max-w-4xl mx-auto`},{default:u(()=>[i(x,{description:p.$t(`common.message.noData`)},null,8,[`description`])]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Z=x(z,[[`render`,X],[`__scopeId`,`data-v-8b874c63`]]);export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{L as e,at as t,j as n,mt as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{n as o,t as s}from"./tabs-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{L as e,at as t,j as n,mt as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{n as o,t as s}from"./tabs-CXoKymzI.js";import{E as c,et as l,tt as u}from"./index-DKk73XSL.js";var d=a({name:`FishTabSwitcher`,components:{ElTabs:o,ElTabPane:s},data(){return{ROUTE_FISH_TTS_INDEX:u,ROUTE_FISH_MODEL_INDEX:l}},computed:{active(){return(this.$route?.name||``)===`fish-model-index`?l:u}},methods:{onUpdate(e){let t=String(e);t!==this.active&&this.$router.push({name:t})}}});function f(a,o,s,c,l,u){let d=t(`el-tab-pane`),f=t(`el-tabs`);return i(),n(f,{"model-value":a.active,class:`fish-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":a.onUpdate},{default:r(()=>[e(d,{label:a.$t(`fish.tab.tts`),name:a.ROUTE_FISH_TTS_INDEX},null,8,[`label`,`name`]),e(d,{label:a.$t(`fish.tab.model`),name:a.ROUTE_FISH_MODEL_INDEX},null,8,[`label`,`name`])]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var p=c(d,[[`render`,f],[`__scopeId`,`data-v-f942a514`]]);export{p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{n as h,r as g,t as _}from"./select-kcx--P1x.js";import{t as v}from"./tooltip-Dg8svYdv.js";import{t as y}from"./alert-NIoXEghZ.js";import{t as b}from"./slider-BLVGADMV.js";import{t as x}from"./clock-00kgn61e.js";import{r as S,t as C}from"./PromptTextarea-BxPQCRHG.js";import{t as w}from"./info-BLLJpmyv.js";import{t as T}from"./mic-CSLvPpSt.js";import{t as E}from"./trash-2-BFPsgWSb.js";import{t as D}from"./triangle-alert-Bt6a07CK.js";import{t as O}from"./wand-sparkles-D1gaPiuH.js";import{ct as k,dt as ee}from"./constants-BdhyMN3z.js";import{Bt as A,E as j,Fi as M,Ht as N,Kt as te,ai as P,bi as ne,tn as re,xi as F,yi as I,yn as L,yr as R}from"./index-D7PshZL1.js";import{t as z}from"./CopyToClipboard-BmLkUzdp.js";import{t as B}from"./Consumption-CZTTskeC.js";import{n as V,r as H,t as U}from"./pagination-ZOz4p54z.js";import{t as W}from"./ApiCodeButton-BCiH5XH1.js";import{t as G}from"./BotPlaceholder-CE5nL1Rv.js";import{t as K}from"./Hailuo-D-f7Q-vr.js";import{t as q}from"./TabSwitcher-CxB0g7RK.js";var J=I(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Y=m({name:`FishTextInput`,components:{PromptTextarea:C},computed:{text:{get(){return this.$store.state.fish?.config?.text},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,text:e})}}}});function X(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.text,"onUpdate:modelValue":t[0]||=t=>e.text=t,title:e.$t(`fish.name.text`),info:e.$t(`fish.description.text`),placeholder:e.$t(`fish.placeholder.text`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ie=j(Y,[[`render`,X]]),ae=m({name:`FishModelSelector`,components:{ElSelect:g,ElOption:_},computed:{options(){return[{value:ee,label:this.$t(`fish.button.modelS2Pro`)},{value:`s1`,label:this.$t(`fish.button.modelS1`)}]},value:{get(){return this.$store.state.fish?.config?.model},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,model:e})}}},mounted(){this.value||=k}}),oe={class:`field`},se={class:`title font-bold`};function ce(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,oe,[e(`h2`,se,i(t.$t(`fish.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`fish.placeholder.select`)},{default:d(()=>[(p(!0),s(c,null,f(t.options,e=>(p(),u(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var le=j(ae,[[`render`,ce],[`__scopeId`,`data-v-9702e6d3`]]),ue=m({name:`FishVoiceOption`,props:{option:{type:Object,required:!0},playing:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`preview`]}),de={class:`voice-option`},fe=[`aria-label`],pe={key:0,class:`spin`,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},me={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},he={key:2,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},ge={key:1,class:`preview placeholder`,"aria-hidden":`true`},_e={class:`meta`},ve={class:`label`},ye={key:0,class:`description`};function be(r,a,c,l,u,d){return p(),s(`div`,de,[r.option.audio?(p(),s(`button`,{key:0,type:`button`,class:n([`preview`,{playing:r.playing,loading:r.loading}]),"aria-label":r.playing?`stop preview`:`play preview`,onMousedown:a[0]||=t(()=>{},[`prevent`]),onClick:a[1]||=t(e=>r.$emit(`preview`,r.option),[`stop`,`prevent`])},[r.loading?(p(),s(`svg`,pe,[...a[2]||=[e(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-dasharray":`42 60`},null,-1)]])):r.playing?(p(),s(`svg`,me,[...a[3]||=[e(`rect`,{x:`6`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1),e(`rect`,{x:`14`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1)]])):(p(),s(`svg`,he,[...a[4]||=[e(`path`,{d:`M8 5v14l11-7z`,fill:`currentColor`},null,-1)]]))],42,fe)):(p(),s(`span`,ge,[...a[5]||=[e(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`},[e(`path`,{d:`M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11z`,fill:`currentColor`})],-1)]])),e(`div`,_e,[e(`span`,ve,i(r.option.label),1),r.option.description?(p(),s(`span`,ye,i(r.option.description),1)):o(``,!0)])])}var xe=j(ue,[[`render`,be],[`__scopeId`,`data-v-c16a6a46`]]),Se=e=>(e.id||e._id||e.reference_id||``).toString(),Z=e=>{let t=Se(e);return{value:t,label:e.title||t,description:e.description,audio:e.samples?.[0]?.audio}},Ce=m({name:`FishVoicePicker`,components:{ElSelect:g,ElOption:_,ElOptionGroup:h,VoiceOption:xe},data(){return{popularVoices:[],searchVoices:[],popularLoading:!1,searchLoading:!1,preloaded:!1,query:``,playingId:null,loadingId:null,labelCache:{},previewAudio:null,searchTimer:null,searchSeq:0}},computed:{remoteLoading(){return this.popularLoading||this.searchLoading},myVoices(){return this.$store.state.fish?.voices??[]},myOptions(){return this.myVoices.map(Z).filter(e=>!!e.value)},publicPool(){return this.query&&(this.searchVoices.length||this.searchLoading)?{voices:this.searchVoices,isSearch:!0}:{voices:this.popularVoices,isSearch:!1}},publicOptions(){let e=new Set(this.myOptions.map(e=>e.value));return this.publicPool.voices.map(Z).filter(t=>!!t.value&&!e.has(t.value))},filteredMyOptions(){return this.applyQuery(this.myOptions)},filteredPublicOptions(){return this.publicPool.isSearch?this.publicOptions:this.applyQuery(this.publicOptions)},fallbackOption(){let e=this.value;return!e||this.myOptions.some(t=>t.value===e)||this.publicOptions.some(t=>t.value===e)?null:{value:e,label:this.labelCache[e]||e}},noDataText(){return this.remoteLoading?this.$t(`fish.message.searching`):this.credential?.token?this.$t(`fish.message.searchVoiceHint`):this.$t(`fish.message.noVoices`)},credential(){return this.$store.state.fish?.credential},value:{get(){return this.$store.state.fish?.config?.reference_id},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,reference_id:e||void 0})}}},watch:{myOptions:{immediate:!0,handler(e){this.cacheLabels(e)}},publicOptions(e){this.cacheLabels(e)},credential:{immediate:!0,handler(e){if(!e?.token)return;let t=this.$store.state.fish?.voices;(t===void 0||t.length===0)&&this.$store.dispatch(`fish/getVoices`),this.preloaded||this.fetchPopular()}}},beforeUnmount(){this.stopPreview(),this.searchTimer&&clearTimeout(this.searchTimer)},methods:{cacheLabels(e){for(let t of e)this.labelCache[t.value]=t.label},applyQuery(e){let t=this.query.toLowerCase();return t?e.filter(e=>e.label.toLowerCase().includes(t)||(e.description||``).toLowerCase().includes(t)):e},onVisibleChange(e){e&&!this.preloaded&&!this.popularLoading&&this.fetchPopular()},onFilter(e){if(this.query=(e||``).trim(),this.searchTimer&&clearTimeout(this.searchTimer),!this.query){this.searchSeq++,this.searchVoices=[],this.searchLoading=!1;return}this.searchTimer=setTimeout(()=>this.fetchSearch(this.query),350)},async fetchPopular(){let e=this.credential?.token;if(!(!e||this.popularLoading)){this.popularLoading=!0;try{let{data:t}=await L.listModels({self:!1,page_size:30,page_number:1},{token:e});this.popularVoices=t?.items??[],this.preloaded=!0}catch(e){console.error(`fish.loadPopularVoices failed`,e)}finally{this.popularLoading=!1}}},async fetchSearch(e){let t=this.credential?.token;if(!t)return;let n=++this.searchSeq;this.searchLoading=!0;try{let{data:r}=await L.listModels({self:!1,page_size:30,page_number:1,title:e},{token:t});if(n!==this.searchSeq)return;this.searchVoices=r?.items??[]}catch(e){n===this.searchSeq&&(this.searchVoices=[]),console.error(`fish.searchPublicVoices failed`,e)}finally{n===this.searchSeq&&(this.searchLoading=!1)}},togglePreview(e){if(!e.audio)return;if(this.playingId===e.value||this.loadingId===e.value){this.stopPreview();return}this.stopPreview();let t=new Audio(e.audio),n=()=>{this.previewAudio===t&&(this.loadingId=null,this.playingId=e.value)},r=()=>{this.previewAudio===t&&this.stopPreview()};t.addEventListener(`playing`,n),t.addEventListener(`ended`,r),t.addEventListener(`error`,r),this.previewAudio=t,this.loadingId=e.value,this.playingId=null,t.play().catch(()=>{this.previewAudio===t&&this.stopPreview()})},stopPreview(){this.previewAudio&&=(this.previewAudio.pause(),this.previewAudio.src=``,null),this.playingId=null,this.loadingId=null}}}),we={class:`field`},Te={class:`title font-bold`};function Ee(t,n,r,m,h,g){let _=l(`el-option`),v=l(`voice-option`),y=l(`el-option-group`),b=l(`el-select`);return p(),s(`div`,we,[e(`h2`,Te,i(t.$t(`fish.name.voice`)),1),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,"popper-class":`fish-voice-popper`,placeholder:t.$t(`fish.placeholder.voice`),clearable:``,filterable:``,"filter-method":t.onFilter,loading:t.remoteLoading,"loading-text":t.$t(`fish.message.searching`),"no-data-text":t.noDataText,onVisibleChange:t.onVisibleChange},{default:d(()=>[t.fallbackOption?(p(),u(_,{key:t.fallbackOption.value,label:t.fallbackOption.label,value:t.fallbackOption.value},null,8,[`label`,`value`])):o(``,!0),t.filteredMyOptions.length?(p(),u(y,{key:1,label:t.$t(`fish.title.myVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredMyOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.filteredPublicOptions.length?(p(),u(y,{key:2,label:t.$t(`fish.group.publicVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredPublicOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0)]),_:1},8,[`modelValue`,`placeholder`,`filter-method`,`loading`,`loading-text`,`no-data-text`,`onVisibleChange`])])}var De=m({name:`FishConfigPanel`,components:{MagicIcon:O,ElButton:M,ElSlider:b,TextInput:ie,ModelSelector:le,VoicePicker:j(Ce,[[`render`,Ee],[`__scopeId`,`data-v-6183b210`]]),Consumption:B},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){let e=this.config?.text?.trim()??``;return te({...this.config,model:this.config?.model??`s2-pro`,byte_count:new TextEncoder().encode(e).byteLength},this.service?.cost)},service(){return this.$store.state.fish?.service},canGenerate(){let e=this.config?.text;return typeof e==`string`&&e.trim().length>0},speed:{get(){return this.config?.prosody?.speed??1},set(e){this.$store.commit(`fish/setConfig`,{...this.config,prosody:{...this.config?.prosody??{},speed:e}})}}},methods:{onGenerate(){this.$emit(`generate`)}}}),Oe={class:`flex flex-col h-full`},ke={class:`flex-1 overflow-y-auto p-5`},Ae={class:`field mb-4`},je={class:`title font-bold`},Me={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ne(t,n,o,c,u,f){let m=l(`text-input`),h=l(`model-selector`),g=l(`voice-picker`),_=l(`el-slider`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return p(),s(`div`,Oe,[e(`div`,ke,[a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),e(`div`,Ae,[e(`h2`,je,i(t.$t(`fish.name.speed`)),1),a(_,{modelValue:t.speed,"onUpdate:modelValue":n[0]||=e=>t.speed=e,min:.5,max:2,step:.1,class:`value`,"show-input":``},null,8,[`modelValue`])])]),e(`div`,Me,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`fish.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Pe=j(De,[[`render`,Ne],[`__scopeId`,`data-v-dc4ea983`]]);function Fe(e){if(!e)return;let t=e.error;if(t){let e=typeof t==`string`?t:t.message;if(e)return e.trim()}let n=e.message;if(!(typeof n!=`string`||!n.trim()))return Q(n.trim())}function Q(e){if(e.startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length){let e=t.map(e=>{let t=typeof e?.msg==`string`?e.msg:void 0;if(!t)return;let n=Array.isArray(e?.loc)?e.loc.filter(e=>e!==`parameters`):[],r=n.length?n[n.length-1]:void 0;return r?`${r}: ${t}`:t}).filter(e=>!!e),n=Array.from(new Set(e));if(n.length)return n.join(`; `)}}catch{}if(e.startsWith(`{`))try{let t=JSON.parse(e);if(t&&typeof t.message==`string`&&t.message.trim())return Q(t.message.trim())}catch{}return e}var Ie=m({name:`FishTaskPreview`,components:{DeleteIcon:E,ElTooltip:v,ChannelIcon:S,CpuIcon:J,InfoIcon:w,MagicIcon:O,MicrophoneIcon:T,TimeIcon:x,WarningIcon:D,CopyToClipboard:z,ElAlert:y,ElButton:M,ApiCodeButton:W},props:{modelValue:{type:Object,required:!0}},computed:{prompt(){return this.modelValue?.request?.text},audioUrl(){return this.modelValue?.response?.audio_url},isFailure(){let e=this.modelValue?.response;if(!e||e.audio_url)return!1;if(e.success===!1||e.error)return!0;let t=Number(e.status);return!Number.isNaN(t)&&t>=400||!!e.message},failureReason(){return Fe(this.modelValue?.response)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await ne.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`fish/deleteTask`,{id:e}),F.success(this.$t(`common.message.deleteTaskSuccess`))}catch{F.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){window.open(e,`_blank`)}}}),Le={class:`preview`},Re={class:`left`},ze={class:`main`},Be={class:`bot`},Ve={class:`datetime`},He=[`aria-label`],Ue={class:`info`},We={key:0,class:`prompt mt-2`},Ge={key:0},Ke={key:0,class:`content`},qe=[`src`],Je={class:`operations mt-2`},Ye={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xe={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$e={key:1,class:`content`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},rt={key:2,class:`content`},it={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function at(n,c,u,f,m,h){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`el-button`),b=l(`api-code-button`),x=l(`cpu-icon`),S=l(`microphone-icon`),C=l(`copy-to-clipboard`),w=l(`magic-icon`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return p(),s(`div`,Le,[e(`div`,Re,[a(g,{capability:`fish`,part:`avatar`,class:`avatar`})]),e(`div`,ze,[e(`div`,Be,[a(g,{capability:`fish`,part:`name`}),e(`span`,Ve,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:d(()=>[n.modelValue?.id?(p(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,He)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ue,[n.prompt?(p(),s(`p`,We,[r(i(n.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ge,` - (`+i(n.$t(`fish.status.pending`))+`) `,1))])):o(``,!0)]),n.audioUrl?(p(),s(`div`,Ke,[e(`audio`,{src:n.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,qe),e(`div`,Je,[a(y,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.audioUrl),[`stop`])},{default:d(()=>[r(i(n.$t(`fish.button.download`)),1)]),_:1}),a(b,{path:`/fish/tts`,body:n.modelValue?.request},null,8,[`body`])]),a(E,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Ye,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.reference_id?(p(),s(`p`,Xe,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.referenceId`))+`: `+i(n.modelValue?.request?.reference_id)+` `,1),a(C,{content:n.modelValue?.request?.reference_id},null,8,[`content`])])):o(``,!0),e(`p`,Ze,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Qe,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):n.isFailure?(p(),s(`div`,$e,[a(E,{closable:!1,class:`failure`},{title:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failure`)),1)]),default:d(()=>[e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(p(),s(`p`,tt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(C,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(p(),s(`p`,$,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(p(),s(`p`,nt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(C,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):(p(),s(`div`,rt,[a(E,{closable:!1,class:`info`},{default:d(()=>[e(`p`,it,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var ot=m({name:`FishRecentPanel`,components:{TaskPreview:j(Ie,[[`render`,at],[`__scopeId`,`data-v-d71784d5`]]),BotPlaceholder:G,NoTasks:H,ScrollList:V},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.fish?.tasks,items:this.$store.state.fish?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),st={key:0},ct={key:2,class:`w-full h-full flex items-center justify-center`};function lt(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,st,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,ct,[a(v)])):o(``,!0)],64)}var ut=m({name:`FishTtsIndex`,components:{ConfigPanel:Pe,Layout:K,RecentPanel:j(ot,[[`render`,lt]]),TabSwitcher:q},mixins:[N],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===P.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===P.Request||this.fetchingTasks},credential(){return this.$store.state.fish?.credential},config(){return this.$store.state.fish?.config},application(){return this.$store.state.fish?.application},tasks(){return this.$store.state.fish?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService(),await this.$store.dispatch(`fish/getVoices`)},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await U({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`fish/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`fish/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!A(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){F.warning(this.$t(`fish.message.textRequired`));return}if(!re())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}let r=e.model||`s2-pro`,i={text:t,async:!0};e.reference_id&&(i.reference_id=e.reference_id),e.format&&(i.format=e.format),e.prosody&&Object.keys(e.prosody).length>0&&(i.prosody=e.prosody),F.info(this.$t(`fish.message.startingTask`)),R(`fish`,L.generateTts(i,{token:n,model:r})).then(()=>{F.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`fish.message.usedUp`)):F.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),dt={class:`flex flex-col h-full`},ft={class:`flex-1 min-h-0`};function pt(t,n,r,i,o,s){let c=l(`tab-switcher`),f=l(`config-panel`),m=l(`recent-panel`),h=l(`layout`);return p(),u(h,null,{config:d(()=>[e(`div`,dt,[a(c),e(`div`,ft,[a(f,{onGenerate:t.onGenerate},null,8,[`onGenerate`])])])]),result:d(()=>[a(m,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var mt=j(ut,[[`render`,pt]]);export{mt as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{n as h,r as g,t as _}from"./select-B77f_PJQ.js";import{t as v}from"./tooltip-VSerTQEt.js";import{t as y}from"./alert-BJ4eXD_W.js";import{t as b}from"./slider-CgQtZ5yN.js";import{t as x}from"./clock-CSS2EFTL.js";import{r as S,t as C}from"./PromptTextarea-c7bTJdzp.js";import{t as w}from"./info-ohLaRJyi.js";import{t as T}from"./mic-KPqenF2E.js";import{t as E}from"./trash-2-DEZLHac1.js";import{t as D}from"./triangle-alert-JRUGzlh3.js";import{t as O}from"./wand-sparkles-CmL-nnQq.js";import{ct as k,dt as ee}from"./constants-DneM-Qrs.js";import{Bt as A,E as j,Fi as M,Ht as N,Kt as te,ai as P,bi as ne,tn as re,xi as F,yi as I,yn as L,yr as R}from"./index-DKk73XSL.js";import{t as z}from"./CopyToClipboard-Cuw_Hc_J.js";import{t as B}from"./Consumption-4lLdaugf.js";import{n as V,r as H,t as U}from"./pagination-DgxXd4gx.js";import{t as W}from"./ApiCodeButton-6dXtdhq1.js";import{t as G}from"./BotPlaceholder-Cp2pWb4U.js";import{t as K}from"./Hailuo-BXQyxTUq.js";import{t as q}from"./TabSwitcher-B19dc1YH.js";var J=I(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Y=m({name:`FishTextInput`,components:{PromptTextarea:C},computed:{text:{get(){return this.$store.state.fish?.config?.text},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,text:e})}}}});function X(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.text,"onUpdate:modelValue":t[0]||=t=>e.text=t,title:e.$t(`fish.name.text`),info:e.$t(`fish.description.text`),placeholder:e.$t(`fish.placeholder.text`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ie=j(Y,[[`render`,X]]),ae=m({name:`FishModelSelector`,components:{ElSelect:g,ElOption:_},computed:{options(){return[{value:ee,label:this.$t(`fish.button.modelS2Pro`)},{value:`s1`,label:this.$t(`fish.button.modelS1`)}]},value:{get(){return this.$store.state.fish?.config?.model},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,model:e})}}},mounted(){this.value||=k}}),oe={class:`field`},se={class:`title font-bold`};function ce(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,oe,[e(`h2`,se,i(t.$t(`fish.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`fish.placeholder.select`)},{default:d(()=>[(p(!0),s(c,null,f(t.options,e=>(p(),u(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var le=j(ae,[[`render`,ce],[`__scopeId`,`data-v-9702e6d3`]]),ue=m({name:`FishVoiceOption`,props:{option:{type:Object,required:!0},playing:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`preview`]}),de={class:`voice-option`},fe=[`aria-label`],pe={key:0,class:`spin`,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},me={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},he={key:2,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},ge={key:1,class:`preview placeholder`,"aria-hidden":`true`},_e={class:`meta`},ve={class:`label`},ye={key:0,class:`description`};function be(r,a,c,l,u,d){return p(),s(`div`,de,[r.option.audio?(p(),s(`button`,{key:0,type:`button`,class:n([`preview`,{playing:r.playing,loading:r.loading}]),"aria-label":r.playing?`stop preview`:`play preview`,onMousedown:a[0]||=t(()=>{},[`prevent`]),onClick:a[1]||=t(e=>r.$emit(`preview`,r.option),[`stop`,`prevent`])},[r.loading?(p(),s(`svg`,pe,[...a[2]||=[e(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-dasharray":`42 60`},null,-1)]])):r.playing?(p(),s(`svg`,me,[...a[3]||=[e(`rect`,{x:`6`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1),e(`rect`,{x:`14`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1)]])):(p(),s(`svg`,he,[...a[4]||=[e(`path`,{d:`M8 5v14l11-7z`,fill:`currentColor`},null,-1)]]))],42,fe)):(p(),s(`span`,ge,[...a[5]||=[e(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`},[e(`path`,{d:`M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11z`,fill:`currentColor`})],-1)]])),e(`div`,_e,[e(`span`,ve,i(r.option.label),1),r.option.description?(p(),s(`span`,ye,i(r.option.description),1)):o(``,!0)])])}var xe=j(ue,[[`render`,be],[`__scopeId`,`data-v-c16a6a46`]]),Se=e=>(e.id||e._id||e.reference_id||``).toString(),Z=e=>{let t=Se(e);return{value:t,label:e.title||t,description:e.description,audio:e.samples?.[0]?.audio}},Ce=m({name:`FishVoicePicker`,components:{ElSelect:g,ElOption:_,ElOptionGroup:h,VoiceOption:xe},data(){return{popularVoices:[],searchVoices:[],popularLoading:!1,searchLoading:!1,preloaded:!1,query:``,playingId:null,loadingId:null,labelCache:{},previewAudio:null,searchTimer:null,searchSeq:0}},computed:{remoteLoading(){return this.popularLoading||this.searchLoading},myVoices(){return this.$store.state.fish?.voices??[]},myOptions(){return this.myVoices.map(Z).filter(e=>!!e.value)},publicPool(){return this.query&&(this.searchVoices.length||this.searchLoading)?{voices:this.searchVoices,isSearch:!0}:{voices:this.popularVoices,isSearch:!1}},publicOptions(){let e=new Set(this.myOptions.map(e=>e.value));return this.publicPool.voices.map(Z).filter(t=>!!t.value&&!e.has(t.value))},filteredMyOptions(){return this.applyQuery(this.myOptions)},filteredPublicOptions(){return this.publicPool.isSearch?this.publicOptions:this.applyQuery(this.publicOptions)},fallbackOption(){let e=this.value;return!e||this.myOptions.some(t=>t.value===e)||this.publicOptions.some(t=>t.value===e)?null:{value:e,label:this.labelCache[e]||e}},noDataText(){return this.remoteLoading?this.$t(`fish.message.searching`):this.credential?.token?this.$t(`fish.message.searchVoiceHint`):this.$t(`fish.message.noVoices`)},credential(){return this.$store.state.fish?.credential},value:{get(){return this.$store.state.fish?.config?.reference_id},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,reference_id:e||void 0})}}},watch:{myOptions:{immediate:!0,handler(e){this.cacheLabels(e)}},publicOptions(e){this.cacheLabels(e)},credential:{immediate:!0,handler(e){if(!e?.token)return;let t=this.$store.state.fish?.voices;(t===void 0||t.length===0)&&this.$store.dispatch(`fish/getVoices`),this.preloaded||this.fetchPopular()}}},beforeUnmount(){this.stopPreview(),this.searchTimer&&clearTimeout(this.searchTimer)},methods:{cacheLabels(e){for(let t of e)this.labelCache[t.value]=t.label},applyQuery(e){let t=this.query.toLowerCase();return t?e.filter(e=>e.label.toLowerCase().includes(t)||(e.description||``).toLowerCase().includes(t)):e},onVisibleChange(e){e&&!this.preloaded&&!this.popularLoading&&this.fetchPopular()},onFilter(e){if(this.query=(e||``).trim(),this.searchTimer&&clearTimeout(this.searchTimer),!this.query){this.searchSeq++,this.searchVoices=[],this.searchLoading=!1;return}this.searchTimer=setTimeout(()=>this.fetchSearch(this.query),350)},async fetchPopular(){let e=this.credential?.token;if(!(!e||this.popularLoading)){this.popularLoading=!0;try{let{data:t}=await L.listModels({self:!1,page_size:30,page_number:1},{token:e});this.popularVoices=t?.items??[],this.preloaded=!0}catch(e){console.error(`fish.loadPopularVoices failed`,e)}finally{this.popularLoading=!1}}},async fetchSearch(e){let t=this.credential?.token;if(!t)return;let n=++this.searchSeq;this.searchLoading=!0;try{let{data:r}=await L.listModels({self:!1,page_size:30,page_number:1,title:e},{token:t});if(n!==this.searchSeq)return;this.searchVoices=r?.items??[]}catch(e){n===this.searchSeq&&(this.searchVoices=[]),console.error(`fish.searchPublicVoices failed`,e)}finally{n===this.searchSeq&&(this.searchLoading=!1)}},togglePreview(e){if(!e.audio)return;if(this.playingId===e.value||this.loadingId===e.value){this.stopPreview();return}this.stopPreview();let t=new Audio(e.audio),n=()=>{this.previewAudio===t&&(this.loadingId=null,this.playingId=e.value)},r=()=>{this.previewAudio===t&&this.stopPreview()};t.addEventListener(`playing`,n),t.addEventListener(`ended`,r),t.addEventListener(`error`,r),this.previewAudio=t,this.loadingId=e.value,this.playingId=null,t.play().catch(()=>{this.previewAudio===t&&this.stopPreview()})},stopPreview(){this.previewAudio&&=(this.previewAudio.pause(),this.previewAudio.src=``,null),this.playingId=null,this.loadingId=null}}}),we={class:`field`},Te={class:`title font-bold`};function Ee(t,n,r,m,h,g){let _=l(`el-option`),v=l(`voice-option`),y=l(`el-option-group`),b=l(`el-select`);return p(),s(`div`,we,[e(`h2`,Te,i(t.$t(`fish.name.voice`)),1),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,"popper-class":`fish-voice-popper`,placeholder:t.$t(`fish.placeholder.voice`),clearable:``,filterable:``,"filter-method":t.onFilter,loading:t.remoteLoading,"loading-text":t.$t(`fish.message.searching`),"no-data-text":t.noDataText,onVisibleChange:t.onVisibleChange},{default:d(()=>[t.fallbackOption?(p(),u(_,{key:t.fallbackOption.value,label:t.fallbackOption.label,value:t.fallbackOption.value},null,8,[`label`,`value`])):o(``,!0),t.filteredMyOptions.length?(p(),u(y,{key:1,label:t.$t(`fish.title.myVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredMyOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.filteredPublicOptions.length?(p(),u(y,{key:2,label:t.$t(`fish.group.publicVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredPublicOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0)]),_:1},8,[`modelValue`,`placeholder`,`filter-method`,`loading`,`loading-text`,`no-data-text`,`onVisibleChange`])])}var De=m({name:`FishConfigPanel`,components:{MagicIcon:O,ElButton:M,ElSlider:b,TextInput:ie,ModelSelector:le,VoicePicker:j(Ce,[[`render`,Ee],[`__scopeId`,`data-v-6183b210`]]),Consumption:B},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){let e=this.config?.text?.trim()??``;return te({...this.config,model:this.config?.model??`s2-pro`,byte_count:new TextEncoder().encode(e).byteLength},this.service?.cost)},service(){return this.$store.state.fish?.service},canGenerate(){let e=this.config?.text;return typeof e==`string`&&e.trim().length>0},speed:{get(){return this.config?.prosody?.speed??1},set(e){this.$store.commit(`fish/setConfig`,{...this.config,prosody:{...this.config?.prosody??{},speed:e}})}}},methods:{onGenerate(){this.$emit(`generate`)}}}),Oe={class:`flex flex-col h-full`},ke={class:`flex-1 overflow-y-auto p-5`},Ae={class:`field mb-4`},je={class:`title font-bold`},Me={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ne(t,n,o,c,u,f){let m=l(`text-input`),h=l(`model-selector`),g=l(`voice-picker`),_=l(`el-slider`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return p(),s(`div`,Oe,[e(`div`,ke,[a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),e(`div`,Ae,[e(`h2`,je,i(t.$t(`fish.name.speed`)),1),a(_,{modelValue:t.speed,"onUpdate:modelValue":n[0]||=e=>t.speed=e,min:.5,max:2,step:.1,class:`value`,"show-input":``},null,8,[`modelValue`])])]),e(`div`,Me,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`fish.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Pe=j(De,[[`render`,Ne],[`__scopeId`,`data-v-dc4ea983`]]);function Fe(e){if(!e)return;let t=e.error;if(t){let e=typeof t==`string`?t:t.message;if(e)return e.trim()}let n=e.message;if(!(typeof n!=`string`||!n.trim()))return Q(n.trim())}function Q(e){if(e.startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length){let e=t.map(e=>{let t=typeof e?.msg==`string`?e.msg:void 0;if(!t)return;let n=Array.isArray(e?.loc)?e.loc.filter(e=>e!==`parameters`):[],r=n.length?n[n.length-1]:void 0;return r?`${r}: ${t}`:t}).filter(e=>!!e),n=Array.from(new Set(e));if(n.length)return n.join(`; `)}}catch{}if(e.startsWith(`{`))try{let t=JSON.parse(e);if(t&&typeof t.message==`string`&&t.message.trim())return Q(t.message.trim())}catch{}return e}var Ie=m({name:`FishTaskPreview`,components:{DeleteIcon:E,ElTooltip:v,ChannelIcon:S,CpuIcon:J,InfoIcon:w,MagicIcon:O,MicrophoneIcon:T,TimeIcon:x,WarningIcon:D,CopyToClipboard:z,ElAlert:y,ElButton:M,ApiCodeButton:W},props:{modelValue:{type:Object,required:!0}},computed:{prompt(){return this.modelValue?.request?.text},audioUrl(){return this.modelValue?.response?.audio_url},isFailure(){let e=this.modelValue?.response;if(!e||e.audio_url)return!1;if(e.success===!1||e.error)return!0;let t=Number(e.status);return!Number.isNaN(t)&&t>=400||!!e.message},failureReason(){return Fe(this.modelValue?.response)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await ne.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`fish/deleteTask`,{id:e}),F.success(this.$t(`common.message.deleteTaskSuccess`))}catch{F.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){window.open(e,`_blank`)}}}),Le={class:`preview`},Re={class:`left`},ze={class:`main`},Be={class:`bot`},Ve={class:`datetime`},He=[`aria-label`],Ue={class:`info`},We={key:0,class:`prompt mt-2`},Ge={key:0},Ke={key:0,class:`content`},qe=[`src`],Je={class:`operations mt-2`},Ye={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xe={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$e={key:1,class:`content`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},rt={key:2,class:`content`},it={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function at(n,c,u,f,m,h){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`el-button`),b=l(`api-code-button`),x=l(`cpu-icon`),S=l(`microphone-icon`),C=l(`copy-to-clipboard`),w=l(`magic-icon`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return p(),s(`div`,Le,[e(`div`,Re,[a(g,{capability:`fish`,part:`avatar`,class:`avatar`})]),e(`div`,ze,[e(`div`,Be,[a(g,{capability:`fish`,part:`name`}),e(`span`,Ve,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:d(()=>[n.modelValue?.id?(p(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,He)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ue,[n.prompt?(p(),s(`p`,We,[r(i(n.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ge,` - (`+i(n.$t(`fish.status.pending`))+`) `,1))])):o(``,!0)]),n.audioUrl?(p(),s(`div`,Ke,[e(`audio`,{src:n.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,qe),e(`div`,Je,[a(y,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.audioUrl),[`stop`])},{default:d(()=>[r(i(n.$t(`fish.button.download`)),1)]),_:1}),a(b,{path:`/fish/tts`,body:n.modelValue?.request},null,8,[`body`])]),a(E,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Ye,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.reference_id?(p(),s(`p`,Xe,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.referenceId`))+`: `+i(n.modelValue?.request?.reference_id)+` `,1),a(C,{content:n.modelValue?.request?.reference_id},null,8,[`content`])])):o(``,!0),e(`p`,Ze,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Qe,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):n.isFailure?(p(),s(`div`,$e,[a(E,{closable:!1,class:`failure`},{title:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failure`)),1)]),default:d(()=>[e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(p(),s(`p`,tt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(C,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(p(),s(`p`,$,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(p(),s(`p`,nt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(C,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):(p(),s(`div`,rt,[a(E,{closable:!1,class:`info`},{default:d(()=>[e(`p`,it,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var ot=m({name:`FishRecentPanel`,components:{TaskPreview:j(Ie,[[`render`,at],[`__scopeId`,`data-v-d71784d5`]]),BotPlaceholder:G,NoTasks:H,ScrollList:V},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.fish?.tasks,items:this.$store.state.fish?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),st={key:0},ct={key:2,class:`w-full h-full flex items-center justify-center`};function lt(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,st,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,ct,[a(v)])):o(``,!0)],64)}var ut=m({name:`FishTtsIndex`,components:{ConfigPanel:Pe,Layout:K,RecentPanel:j(ot,[[`render`,lt]]),TabSwitcher:q},mixins:[N],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===P.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===P.Request||this.fetchingTasks},credential(){return this.$store.state.fish?.credential},config(){return this.$store.state.fish?.config},application(){return this.$store.state.fish?.application},tasks(){return this.$store.state.fish?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService(),await this.$store.dispatch(`fish/getVoices`)},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await U({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`fish/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`fish/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!A(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){F.warning(this.$t(`fish.message.textRequired`));return}if(!re())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}let r=e.model||`s2-pro`,i={text:t,async:!0};e.reference_id&&(i.reference_id=e.reference_id),e.format&&(i.format=e.format),e.prosody&&Object.keys(e.prosody).length>0&&(i.prosody=e.prosody),F.info(this.$t(`fish.message.startingTask`)),R(`fish`,L.generateTts(i,{token:n,model:r})).then(()=>{F.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`fish.message.usedUp`)):F.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),dt={class:`flex flex-col h-full`},ft={class:`flex-1 min-h-0`};function pt(t,n,r,i,o,s){let c=l(`tab-switcher`),f=l(`config-panel`),m=l(`recent-panel`),h=l(`layout`);return p(),u(h,null,{config:d(()=>[e(`div`,dt,[a(c),e(`div`,ft,[a(f,{onGenerate:t.onGenerate},null,8,[`onGenerate`])])])]),result:d(()=>[a(m,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var mt=j(ut,[[`render`,pt]]);export{mt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{t as d}from"./external-link-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{t as d}from"./external-link-WCJw2hQm.js";import{E as f,Fi as p}from"./index-DKk73XSL.js";import{t as m}from"./vue-plyr-wiIKa-zl.js";var h=u({name:`VideoPlayer`,components:{ElButton:p,ExternalLinkIcon:d,VuePlyr:m},props:{src:{type:String,required:!0},options:{type:Object,required:!1,default:()=>({})}},data(){return{failed:!1,mergedOptions:{controls:[`play-large`,`play`,`progress`,`current-time`,`mute`,`volume`,`captions`,`settings`,`pip`,`fullscreen`],iconUrl:`https://cdn.acedata.cloud/7jq4t0.svg`,quality:{default:1080,options:[1080],...this.options.quality},...this.options}}},computed:{safeSrc(){return this.src.trim()}},watch:{safeSrc(){this.failed=!1}},methods:{onError(){this.failed=!0},onOpen(){window.open(this.safeSrc,`_blank`,`noopener,noreferrer`)}}}),g={class:`video max-w-[800px] max-h-[450px] rounded-[15px] overflow-hidden`},_=[`src`],v={key:1,class:`video-fallback`};function y(u,d,f,p,m,h){let y=o(`vue-plyr`),b=o(`external-link-icon`),x=o(`el-button`);return l(),a(`div`,g,[!u.failed&&u.safeSrc?(l(),s(y,{key:u.safeSrc,options:u.mergedOptions},{default:c(()=>[e(`video`,{controls:``,playsinline:``,preload:`metadata`,class:`w-full h-full aspect-[16/9]`,onError:d[0]||=(...e)=>u.onError&&u.onError(...e)},[e(`source`,{size:`1080`,src:u.safeSrc,type:`video/mp4`},null,8,_)],32)]),_:1},8,[`options`])):u.safeSrc?(l(),a(`div`,v,[r(x,{type:`primary`,round:``,onClick:u.onOpen},{default:c(()=>[r(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),t(` `+n(u.$t(`common.button.download`)),1)]),_:1},8,[`onClick`])])):i(``,!0)])}var b=f(h,[[`render`,y],[`__scopeId`,`data-v-0d13923b`]]);export{b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,Mt as o,N as s,Ot as c,T as l,ht as u,it as d,j as f,k as p,mt as m,p as h,st as g,tt as _,ut as v,wt as y,x as b,z as x}from"./vendor-chart-Dw-P17PN.js";import{a as S,c as C,t as w}from"./install-Cn-SLM3u.js";import{n as T,u as E}from"./runtime-BTM7t9of.js";import{Ct as D,Q as O,W as k,d as A,f as j}from"./use-deprecated-r4dlLNqm.js";import{d as M,u as N}from"./tooltip-
|
|
1
|
+
import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,Mt as o,N as s,Ot as c,T as l,ht as u,it as d,j as f,k as p,mt as m,p as h,st as g,tt as _,ut as v,wt as y,x as b,z as x}from"./vendor-chart-Dw-P17PN.js";import{a as S,c as C,t as w}from"./install-Cn-SLM3u.js";import{n as T,u as E}from"./runtime-BTM7t9of.js";import{Ct as D,Q as O,W as k,d as A,f as j}from"./use-deprecated-r4dlLNqm.js";import{d as M,u as N}from"./tooltip-VSerTQEt.js";var P=T({title:{type:String,default:``},description:{type:String,default:``},type:{type:String,values:O(j),default:`info`},closable:{type:Boolean,default:!0},closeText:{type:String,default:``},showIcon:Boolean,center:Boolean,effect:{type:String,values:[`light`,`dark`],default:`light`},...M}),F={open:()=>!0,close:e=>E(e)||e instanceof Event},I=w(S(x({...x({name:`ElAlert`}),props:P,emits:F,setup(x,{emit:S}){let w=x,{Close:T}=A,E=v(),O=C(`alert`),M=y(!1),P=p(()=>j[w.type]),F=p(()=>!!(w.description||E.default)),I=()=>{M.value=!0,S(`open`)},L=e=>{M.value=!1,S(`close`,e)},{onOpen:R,onClose:z}=N({showAfter:c(w,`showAfter`),hideAfter:c(w,`hideAfter`),autoClose:c(w,`autoClose`),open:I,close:L});return D&&R(),(c,p)=>(_(),f(h,{name:o(O).b(`fade`),persisted:``},{default:m(()=>[u(e(`div`,{class:t([o(O).b(),o(O).m(c.type),o(O).is(`center`,c.center),o(O).is(c.effect)]),role:`alert`},[c.showIcon&&(c.$slots.icon||o(P))?(_(),f(o(k),{key:0,class:t([o(O).e(`icon`),{[o(O).is(`big`)]:o(F)}])},{default:m(()=>[d(c.$slots,`icon`,{},()=>[(_(),f(g(o(P))))])]),_:3},8,[`class`])):a(`v-if`,!0),e(`div`,{class:t(o(O).e(`content`))},[c.title||c.$slots.title?(_(),s(`span`,{key:0,class:t([o(O).e(`title`),{"with-description":o(F)}])},[d(c.$slots,`title`,{},()=>[n(r(c.title),1)])],2)):a(`v-if`,!0),o(F)?(_(),s(`p`,{key:1,class:t(o(O).e(`description`))},[d(c.$slots,`default`,{},()=>[n(r(c.description),1)])],2)):a(`v-if`,!0),c.closable?(_(),s(l,{key:2},[c.closeText?(_(),s(`div`,{key:0,class:t([o(O).e(`close-btn`),o(O).is(`customed`)]),onClick:L},r(c.closeText),3)):(_(),f(o(k),{key:1,class:t(o(O).e(`close-btn`)),onClick:o(z)},{default:m(()=>[i(o(T))]),_:1},8,[`class`,`onClick`]))],64)):a(`v-if`,!0)],2)],2),[[b,M.value]])]),_:3},8,[`name`]))}}),[[`__file`,`alert.vue`]]));export{I as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yi as e}from"./index-DKk73XSL.js";var t=e(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]);export{t};
|
package/dist/assets/{arrow-down-wide-narrow-Bb-5FmSK.js → arrow-down-wide-narrow-B3V8L5_Z.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{yi as e}from"./index-
|
|
1
|
+
import{yi as e}from"./index-DKk73XSL.js";var t=e(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yi as e}from"./index-DKk73XSL.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yi as e}from"./index-DKk73XSL.js";var t=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yi as e}from"./index-DKk73XSL.js";var t=e(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]);export{t};
|