pcm-agents 0.6.11 → 0.6.13
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/cjs/error-event-J_ZWIqWF.js +33 -0
- package/dist/cjs/error-event-J_ZWIqWF.js.map +1 -0
- package/dist/cjs/{index-CvEfNyEj.js → index-CRlt8Nv6.js} +53 -3
- package/dist/cjs/index-CRlt8Nv6.js.map +1 -0
- package/dist/cjs/index-WNdOTXnX.js +11068 -0
- package/dist/cjs/index-WNdOTXnX.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +3 -5
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/message.service-DGUsA-FY.js +135 -0
- package/dist/cjs/message.service-DGUsA-FY.js.map +1 -0
- package/dist/cjs/{pcm-1zhanshi-mnms-modal_17.cjs.entry.js → pcm-1zhanshi-mnms-modal_21.cjs.entry.js} +3276 -216
- package/dist/cjs/pcm-1zhanshi-mnms-modal_21.cjs.entry.js.map +1 -0
- package/dist/cjs/pcm-agents.cjs.js +4 -6
- package/dist/cjs/pcm-agents.cjs.js.map +1 -1
- package/dist/cjs/pcm-message.cjs.entry.js +3 -3
- package/dist/cjs/pcm-message.cjs.entry.js.map +1 -1
- package/dist/cjs/pcm-message.entry.cjs.js.map +1 -1
- package/dist/cjs/pcm-mnms-video-modal.cjs.entry.js +8 -8
- package/dist/cjs/pcm-mnms-video-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/pcm-mnms-video-modal.entry.cjs.js.map +1 -1
- package/dist/cjs/pcm-mnms-zp-modal.cjs.entry.js +29 -86
- package/dist/cjs/pcm-mnms-zp-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/pcm-mnms-zp-modal.entry.cjs.js.map +1 -1
- package/dist/cjs/{sentry-reporter-BWFtw_aT.js → sentry-reporter-tpI4WdkE.js} +12 -40
- package/dist/cjs/sentry-reporter-tpI4WdkE.js.map +1 -0
- package/dist/collection/collection-manifest.json +5 -1
- package/dist/collection/components/pcm-1zhanshi-mnms-modal/pcm-1zhanshi-mnms-modal.js.map +1 -1
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.css +986 -986
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js +7 -9
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-button/pcm-button.css +199 -199
- package/dist/collection/components/pcm-button/pcm-button.js +6 -6
- package/dist/collection/components/pcm-button/pcm-button.js.map +1 -1
- package/dist/collection/components/pcm-card/pcm-card.css +259 -259
- package/dist/collection/components/pcm-card/pcm-card.js +1 -1
- package/dist/collection/components/pcm-card/pcm-card.js.map +1 -1
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.css +554 -554
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.js +3 -3
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.js.map +1 -1
- package/dist/collection/components/pcm-drawer/pcm-drawer.css +102 -102
- package/dist/collection/components/pcm-drawer/pcm-drawer.js +1 -1
- package/dist/collection/components/pcm-drawer/pcm-drawer.js.map +1 -1
- package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.css +854 -854
- package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js +5 -7
- package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.css +95 -95
- package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.js +1 -1
- package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.js.map +1 -1
- package/dist/collection/components/pcm-hyzj-modal/pcm-hyzj-modal.js +2 -2
- package/dist/collection/components/pcm-hyzj-modal/pcm-hyzj-modal.js.map +1 -1
- package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.css +312 -312
- package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.js +1 -1
- package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.js.map +1 -1
- package/dist/collection/components/pcm-jlpp-modal/pcm-jlpp-modal.js +2 -2
- package/dist/collection/components/pcm-jlpp-modal/pcm-jlpp-modal.js.map +1 -1
- package/dist/collection/components/pcm-message/pcm-message.css +64 -64
- package/dist/collection/components/pcm-message/pcm-message.js +2 -2
- package/dist/collection/components/pcm-message/pcm-message.js.map +1 -1
- package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.css +1 -1
- package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.js +2 -2
- package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.js.map +1 -1
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js +67 -84
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js.map +1 -1
- package/dist/collection/components/pcm-mnms-video-modal/pcm-mnms-video-modal.js +2 -2
- package/dist/collection/components/pcm-mnms-video-modal/pcm-mnms-video-modal.js.map +1 -1
- package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js +67 -84
- package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js.map +1 -1
- package/dist/collection/components/pcm-mobile-input-btn/pcm-mobile-input-btn.css +140 -0
- package/dist/collection/components/pcm-mobile-input-btn/pcm-mobile-input-btn.js +307 -0
- package/dist/collection/components/pcm-mobile-input-btn/pcm-mobile-input-btn.js.map +1 -0
- package/dist/collection/components/pcm-mobile-input-btn/uploadNumberSDK.js +25 -0
- package/dist/collection/components/pcm-mobile-input-btn/uploadNumberSDK.js.map +1 -0
- package/dist/collection/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.css +127 -0
- package/dist/collection/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.js +350 -0
- package/dist/collection/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.js.map +1 -0
- package/dist/collection/components/pcm-mobile-upload-btn/uploadNumberSDK.js +25 -0
- package/dist/collection/components/pcm-mobile-upload-btn/uploadNumberSDK.js.map +1 -0
- package/dist/collection/components/pcm-msbg-modal/pcm-msbg-modal.js +2 -2
- package/dist/collection/components/pcm-msbg-modal/pcm-msbg-modal.js.map +1 -1
- package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.css +1 -1
- package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.js +2 -2
- package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.js.map +1 -1
- package/dist/collection/components/pcm-time-count-down/pcm-time-count-down.css +0 -0
- package/dist/collection/components/pcm-time-count-down/pcm-time-count-down.js +106 -0
- package/dist/collection/components/pcm-time-count-down/pcm-time-count-down.js.map +1 -0
- package/dist/collection/components/pcm-upload/pcm-upload.css +0 -0
- package/dist/collection/components/pcm-upload/pcm-upload.js +408 -0
- package/dist/collection/components/pcm-upload/pcm-upload.js.map +1 -0
- package/dist/collection/components/pcm-zsk-chat-modal/pcm-zsk-chat-modal.css +969 -969
- package/dist/collection/components/pcm-zsk-chat-modal/pcm-zsk-chat-modal.js +3 -5
- package/dist/collection/components/pcm-zsk-chat-modal/pcm-zsk-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.css +68 -68
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js +4 -4
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js.map +1 -1
- package/dist/collection/global/global.css +401 -398
- package/dist/collection/global/markdown.css +1233 -1233
- package/dist/collection/global/message.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/interfaces/chat.js.map +1 -1
- package/dist/collection/interfaces/events.js.map +1 -1
- package/dist/collection/services/message.service.js.map +1 -1
- package/dist/collection/utils/env.js +3 -0
- package/dist/collection/utils/env.js.map +1 -1
- package/dist/collection/utils/error-event.js.map +1 -1
- package/dist/collection/utils/init.js.map +1 -1
- package/dist/collection/utils/sentry-reporter.js.map +1 -1
- package/dist/collection/utils/utils.js +48 -24
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +3 -5482
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-AYWZDCn8.js → p-B0WOTw9J.js} +51 -4
- package/dist/components/p-B0WOTw9J.js.map +1 -0
- package/dist/components/{p-DUQ46MUh.js → p-BGXbWUJg.js} +3 -3
- package/dist/components/{p-DUQ46MUh.js.map → p-BGXbWUJg.js.map} +1 -1
- package/dist/{esm/sentry-reporter-BFBS363a.js → components/p-BW3r6Lrf.js} +5 -32
- package/dist/components/p-BW3r6Lrf.js.map +1 -0
- package/dist/{esm/app-globals-Chti62re.js → components/p-BdiUKin5.js} +9619 -4296
- package/dist/components/p-BdiUKin5.js.map +1 -0
- package/dist/components/{p-FjtoYPVY.js → p-BywzltXy.js} +10 -9
- package/dist/components/p-BywzltXy.js.map +1 -0
- package/dist/components/p-C2OsjtRx.js +208 -0
- package/dist/components/p-C2OsjtRx.js.map +1 -0
- package/dist/components/{p-D2Z8casl.js → p-CuIvbaWY.js} +5 -5
- package/dist/components/p-CuIvbaWY.js.map +1 -0
- package/dist/components/p-D0ZMoyH8.js +251 -0
- package/dist/components/p-D0ZMoyH8.js.map +1 -0
- package/dist/components/{p-CjbFHLT7.js → p-De3VHEUn.js} +7 -71
- package/dist/components/p-De3VHEUn.js.map +1 -0
- package/dist/components/p-Dv8qvK0w.js +2646 -0
- package/dist/components/p-Dv8qvK0w.js.map +1 -0
- package/dist/components/p-RD3mwuBX.js +226 -0
- package/dist/components/p-RD3mwuBX.js.map +1 -0
- package/dist/components/p-njngFX_n.js +80 -0
- package/dist/components/p-njngFX_n.js.map +1 -0
- package/dist/components/pcm-1zhanshi-mnms-modal.js +7 -7
- package/dist/components/pcm-1zhanshi-mnms-modal.js.map +1 -1
- package/dist/components/pcm-app-chat-modal.js +1 -1
- package/dist/components/pcm-button.js +2 -2
- package/dist/components/pcm-button.js.map +1 -1
- package/dist/components/pcm-card.js +3 -3
- package/dist/components/pcm-card.js.map +1 -1
- package/dist/components/pcm-chat-message.js +1 -1
- package/dist/components/pcm-drawer.js +1 -1
- package/dist/components/pcm-hr-chat-modal.js +5 -4
- package/dist/components/pcm-hr-chat-modal.js.map +1 -1
- package/dist/components/pcm-htws-modal.js +8 -7
- package/dist/components/pcm-htws-modal.js.map +1 -1
- package/dist/components/pcm-hyzj-modal.js +8 -7
- package/dist/components/pcm-hyzj-modal.js.map +1 -1
- package/dist/components/pcm-jd-modal.js +8 -7
- package/dist/components/pcm-jd-modal.js.map +1 -1
- package/dist/components/pcm-jlpp-modal.js +8 -7
- package/dist/components/pcm-jlpp-modal.js.map +1 -1
- package/dist/components/pcm-message.js +3 -3
- package/dist/components/pcm-message.js.map +1 -1
- package/dist/components/pcm-mnct-modal.js +8 -7
- package/dist/components/pcm-mnct-modal.js.map +1 -1
- package/dist/components/pcm-mnms-modal.js +60 -90
- package/dist/components/pcm-mnms-modal.js.map +1 -1
- package/dist/components/pcm-mnms-video-modal.js +8 -7
- package/dist/components/pcm-mnms-video-modal.js.map +1 -1
- package/dist/components/pcm-mnms-zp-modal.js +60 -90
- package/dist/components/pcm-mnms-zp-modal.js.map +1 -1
- package/dist/components/pcm-mobile-input-btn.d.ts +11 -0
- package/dist/components/pcm-mobile-input-btn.js +9 -0
- package/dist/components/pcm-mobile-input-btn.js.map +1 -0
- package/dist/components/pcm-mobile-upload-btn.d.ts +11 -0
- package/dist/components/pcm-mobile-upload-btn.js +9 -0
- package/dist/components/pcm-mobile-upload-btn.js.map +1 -0
- package/dist/components/pcm-msbg-modal.js +8 -7
- package/dist/components/pcm-msbg-modal.js.map +1 -1
- package/dist/components/pcm-qgqjl-modal.js +8 -7
- package/dist/components/pcm-qgqjl-modal.js.map +1 -1
- package/dist/components/pcm-time-count-down.d.ts +11 -0
- package/dist/components/pcm-time-count-down.js +9 -0
- package/dist/components/pcm-time-count-down.js.map +1 -0
- package/dist/components/pcm-upload.d.ts +11 -0
- package/dist/components/pcm-upload.js +9 -0
- package/dist/components/pcm-upload.js.map +1 -0
- package/dist/components/pcm-zsk-chat-modal.js +4 -4
- package/dist/components/pcm-zsk-chat-modal.js.map +1 -1
- package/dist/components/pcm-zygh-modal.js +8 -7
- package/dist/components/pcm-zygh-modal.js.map +1 -1
- package/dist/esm/error-event-C0FYX2-Z.js +31 -0
- package/dist/esm/error-event-C0FYX2-Z.js.map +1 -0
- package/dist/esm/{index-GyOE8SlD.js → index-BnNqOUZf.js} +51 -4
- package/dist/esm/index-BnNqOUZf.js.map +1 -0
- package/dist/esm/index-BuVfV0zo.js +11035 -0
- package/dist/esm/index-BuVfV0zo.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -5
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/message.service-DXVhHj6-.js +133 -0
- package/dist/esm/message.service-DXVhHj6-.js.map +1 -0
- package/dist/esm/{pcm-1zhanshi-mnms-modal_17.entry.js → pcm-1zhanshi-mnms-modal_21.entry.js} +3225 -169
- package/dist/esm/pcm-1zhanshi-mnms-modal_21.entry.js.map +1 -0
- package/dist/esm/pcm-agents.js +4 -6
- package/dist/esm/pcm-agents.js.map +1 -1
- package/dist/esm/pcm-message.entry.js +3 -3
- package/dist/esm/pcm-message.entry.js.map +1 -1
- package/dist/esm/pcm-mnms-video-modal.entry.js +5 -5
- package/dist/esm/pcm-mnms-video-modal.entry.js.map +1 -1
- package/dist/esm/pcm-mnms-zp-modal.entry.js +28 -85
- package/dist/esm/pcm-mnms-zp-modal.entry.js.map +1 -1
- package/dist/esm/sentry-reporter-CYzy4_8O.js +70 -0
- package/dist/esm/sentry-reporter-CYzy4_8O.js.map +1 -0
- package/dist/pcm-agents/index.esm.js +1 -1
- package/dist/pcm-agents/loader.esm.js.map +1 -1
- package/dist/pcm-agents/p-18a06873.entry.js +2 -0
- package/dist/pcm-agents/p-18a06873.entry.js.map +1 -0
- package/dist/pcm-agents/p-47e2e1d0.entry.js +2 -0
- package/dist/pcm-agents/p-47e2e1d0.entry.js.map +1 -0
- package/dist/pcm-agents/{p-3608c0c6.entry.js → p-7a582f00.entry.js} +2 -2
- package/dist/pcm-agents/p-7a582f00.entry.js.map +1 -0
- package/dist/pcm-agents/p-BhFnI70g.js +2 -0
- package/dist/pcm-agents/p-BhFnI70g.js.map +1 -0
- package/dist/pcm-agents/p-BuVfV0zo.js +3 -0
- package/dist/pcm-agents/p-BuVfV0zo.js.map +1 -0
- package/dist/pcm-agents/p-C0FYX2-Z.js +2 -0
- package/dist/pcm-agents/p-C0FYX2-Z.js.map +1 -0
- package/dist/pcm-agents/p-DXVhHj6-.js +2 -0
- package/dist/pcm-agents/p-DXVhHj6-.js.map +1 -0
- package/dist/pcm-agents/p-DkeaAFic.js +2 -0
- package/dist/pcm-agents/p-DkeaAFic.js.map +1 -0
- package/dist/pcm-agents/p-f5f96853.entry.js +245 -0
- package/dist/pcm-agents/p-f5f96853.entry.js.map +1 -0
- package/dist/pcm-agents/pcm-agents.esm.js +1 -1
- package/dist/pcm-agents/pcm-agents.esm.js.map +1 -1
- package/dist/pcm-agents/pcm-message.entry.esm.js.map +1 -1
- package/dist/pcm-agents/pcm-mnms-video-modal.entry.esm.js.map +1 -1
- package/dist/pcm-agents/pcm-mnms-zp-modal.entry.esm.js.map +1 -1
- package/dist/store/auth.store.js.map +1 -1
- package/dist/store/config.store.js.map +1 -1
- package/dist/types/components/pcm-mnms-modal/pcm-mnms-modal.d.ts +9 -4
- package/dist/types/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.d.ts +9 -4
- package/dist/types/components/pcm-mobile-input-btn/pcm-mobile-input-btn.d.ts +36 -0
- package/dist/types/components/pcm-mobile-input-btn/uploadNumberSDK.d.ts +9 -0
- package/dist/types/components/pcm-mobile-upload-btn/pcm-mobile-upload-btn.d.ts +44 -0
- package/dist/types/components/pcm-mobile-upload-btn/uploadNumberSDK.d.ts +9 -0
- package/dist/types/components/pcm-time-count-down/pcm-time-count-down.d.ts +15 -0
- package/dist/types/components/pcm-upload/pcm-upload.d.ts +54 -0
- package/dist/types/components/pcm-upload/type.d.ts +4 -0
- package/dist/types/components.d.ts +798 -30
- package/dist/types/stencil-public-runtime.d.ts +1 -1
- package/dist/types/utils/env.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +30 -12
- package/package.json +70 -69
- package/dist/cjs/app-globals-BIO4q6tX.js +0 -5487
- package/dist/cjs/app-globals-BIO4q6tX.js.map +0 -1
- package/dist/cjs/exports-Dc-pQh4A.js +0 -4087
- package/dist/cjs/exports-Dc-pQh4A.js.map +0 -1
- package/dist/cjs/index-C_qhED9Z.js +0 -1538
- package/dist/cjs/index-C_qhED9Z.js.map +0 -1
- package/dist/cjs/index-CvEfNyEj.js.map +0 -1
- package/dist/cjs/pcm-1zhanshi-mnms-modal_17.cjs.entry.js.map +0 -1
- package/dist/cjs/sentry-reporter-BWFtw_aT.js.map +0 -1
- package/dist/components/p-75J0r72D.js +0 -4017
- package/dist/components/p-75J0r72D.js.map +0 -1
- package/dist/components/p-AYWZDCn8.js.map +0 -1
- package/dist/components/p-CR7WLzmM.js +0 -1303
- package/dist/components/p-CR7WLzmM.js.map +0 -1
- package/dist/components/p-CjbFHLT7.js.map +0 -1
- package/dist/components/p-D2Z8casl.js.map +0 -1
- package/dist/components/p-FjtoYPVY.js.map +0 -1
- package/dist/esm/app-globals-Chti62re.js.map +0 -1
- package/dist/esm/exports-Bs-zO1WZ.js +0 -4017
- package/dist/esm/exports-Bs-zO1WZ.js.map +0 -1
- package/dist/esm/index-Bq0K-WqZ.js +0 -1528
- package/dist/esm/index-Bq0K-WqZ.js.map +0 -1
- package/dist/esm/index-GyOE8SlD.js.map +0 -1
- package/dist/esm/pcm-1zhanshi-mnms-modal_17.entry.js.map +0 -1
- package/dist/esm/sentry-reporter-BFBS363a.js.map +0 -1
- package/dist/pcm-agents/p-2Gpw8rvH.js +0 -2
- package/dist/pcm-agents/p-2Gpw8rvH.js.map +0 -1
- package/dist/pcm-agents/p-3608c0c6.entry.js.map +0 -1
- package/dist/pcm-agents/p-60d7a0b0.entry.js +0 -2
- package/dist/pcm-agents/p-60d7a0b0.entry.js.map +0 -1
- package/dist/pcm-agents/p-9e6efc2d.entry.js +0 -2
- package/dist/pcm-agents/p-9e6efc2d.entry.js.map +0 -1
- package/dist/pcm-agents/p-BUV0S8Cc.js +0 -2
- package/dist/pcm-agents/p-BUV0S8Cc.js.map +0 -1
- package/dist/pcm-agents/p-Bq0K-WqZ.js +0 -3
- package/dist/pcm-agents/p-Bq0K-WqZ.js.map +0 -1
- package/dist/pcm-agents/p-Bs-zO1WZ.js +0 -2
- package/dist/pcm-agents/p-Bs-zO1WZ.js.map +0 -1
- package/dist/pcm-agents/p-CeRTfvY9.js +0 -2
- package/dist/pcm-agents/p-CeRTfvY9.js.map +0 -1
- package/dist/pcm-agents/p-e6c87a78.entry.js +0 -2
- package/dist/pcm-agents/p-e6c87a78.entry.js.map +0 -1
- /package/dist/types/{code/agents-sdk → Users/debugksir/Documents/pcm/sdk}/packages/pcm-agents/.stencil/store/auth.store.d.ts +0 -0
- /package/dist/types/{code/agents-sdk → Users/debugksir/Documents/pcm/sdk}/packages/pcm-agents/.stencil/store/config.store.d.ts +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,g as o,h as i}from"./p-Bq0K-WqZ.js";import{a as n,c as r,v as s,f as a,s as l,b as d,d as c,u as h,g as p,e as u}from"./p-2Gpw8rvH.js";import{E as m,S as f}from"./p-BUV0S8Cc.js";import"./p-Bs-zO1WZ.js";const g="";const b=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const x=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent");this.recordingError=e(this,"recordingError")}modalTitle="模拟面试";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始模拟面试";maxRecordingTime=120;fullscreen=false;customInputs={};uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;recordingError;selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};async handleIsOpenChange(t){if(!t){this.showChatModal=false;this.jobDescription=""}else{await s(this.token);this.showChatModal=true}}render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,botId:"3022316191018903",conversationId:this.conversationId,defaultQuery:this.defaultQuery,maxRecordingTime:this.maxRecordingTime,enableTTS:false,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.uploadedFileInfo?.cos_key,file_name:this.uploadedFileInfo?.file_name},interviewMode:"video"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};x.style=g+b;function w(){return{async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}let y=w();function k(t){y=t}const v=/[&<>"']/;const C=new RegExp(v.source,"g");const z=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;const _=new RegExp(z.source,"g");const I={"&":"&","<":"<",">":">",'"':""","'":"'"};const j=t=>I[t];function S(t,e){if(e){if(v.test(t)){return t.replace(C,j)}}else{if(z.test(t)){return t.replace(_,j)}}return t}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function T(t){return t.replace(M,((t,e)=>{e=e.toLowerCase();if(e==="colon")return":";if(e.charAt(0)==="#"){return e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1))}return""}))}const F=/(^|[^\[])\^/g;function E(t,e){t=typeof t==="string"?t:t.source;e=e||"";const o={replace:(e,i)=>{i=typeof i==="object"&&"source"in i?i.source:i;i=i.replace(F,"$1");t=t.replace(e,i);return o},getRegex:()=>new RegExp(t,e)};return o}function $(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch(t){return null}return t}const A={exec:()=>null};function R(t,e){const o=t.replace(/\|/g,((t,e,o)=>{let i=false;let n=e;while(--n>=0&&o[n]==="\\")i=!i;if(i){return"|"}else{return" |"}})),i=o.split(/ \|/);let n=0;if(!i[0].trim()){i.shift()}if(i.length>0&&!i[i.length-1].trim()){i.pop()}if(e){if(i.length>e){i.splice(e)}else{while(i.length<e)i.push("")}}for(;n<i.length;n++){i[n]=i[n].trim().replace(/\\\|/g,"|")}return i}function B(t,e,o){const i=t.length;if(i===0){return""}let n=0;while(n<i){const o=t.charAt(i-n-1);if(o===e&&true){n++}else{break}}return t.slice(0,i-n)}function D(t,e){if(t.indexOf(e[1])===-1){return-1}let o=0;for(let i=0;i<t.length;i++){if(t[i]==="\\"){i++}else if(t[i]===e[0]){o++}else if(t[i]===e[1]){o--;if(o<0){return i}}}return-1}function L(t,e,o,i){const n=e.href;const r=e.title?S(e.title):null;const s=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){i.state.inLink=true;const t={type:"link",raw:o,href:n,title:r,text:s,tokens:i.inlineTokens(s)};i.state.inLink=false;return t}return{type:"image",raw:o,href:n,title:r,text:S(s)}}function H(t,e){const o=t.match(/^(\s+)(?:```)/);if(o===null){return e}const i=o[1];return e.split("\n").map((t=>{const e=t.match(/^\s+/);if(e===null){return t}const[o]=e;if(o.length>=i.length){return t.slice(i.length)}return t})).join("\n")}class O{options;rules;lexer;constructor(t){this.options=t||y}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0){return{type:"space",raw:e[0]}}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:!this.options.pedantic?B(t,"\n"):t}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0];const o=H(t,e[3]||"");return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline._escapes,"$1"):e[2],text:o}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(/#$/.test(t)){const e=B(t,"#");if(this.options.pedantic){t=e.trim()}else if(!e||/ $/.test(e)){t=e.trim()}}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e){return{type:"hr",raw:e[0]}}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){const t=B(e[0].replace(/^ *>[ \t]?/gm,""),"\n");const o=this.lexer.state.top;this.lexer.state.top=true;const i=this.lexer.blockTokens(t);this.lexer.state.top=o;return{type:"blockquote",raw:e[0],tokens:i,text:t}}}list(t){let e=this.rules.block.list.exec(t);if(e){let o=e[1].trim();const i=o.length>1;const n={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:false,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`;if(this.options.pedantic){o=i?o:"[*+-]"}const r=new RegExp(`^( {0,3}${o})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="";let a="";let l=false;while(t){let o=false;if(!(e=r.exec(t))){break}if(this.rules.block.hr.test(t)){break}s=e[0];t=t.substring(s.length);let i=e[2].split("\n",1)[0].replace(/^\t+/,(t=>" ".repeat(3*t.length)));let d=t.split("\n",1)[0];let c=0;if(this.options.pedantic){c=2;a=i.trimStart()}else{c=e[2].search(/[^ ]/);c=c>4?1:c;a=i.slice(c);c+=e[1].length}let h=false;if(!i&&/^ *$/.test(d)){s+=d+"\n";t=t.substring(d.length+1);o=true}if(!o){const e=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`);const o=new RegExp(`^ {0,${Math.min(3,c-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);const n=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:\`\`\`|~~~)`);const r=new RegExp(`^ {0,${Math.min(3,c-1)}}#`);while(t){const l=t.split("\n",1)[0];d=l;if(this.options.pedantic){d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")}if(n.test(d)){break}if(r.test(d)){break}if(e.test(d)){break}if(o.test(t)){break}if(d.search(/[^ ]/)>=c||!d.trim()){a+="\n"+d.slice(c)}else{if(h){break}if(i.search(/[^ ]/)>=4){break}if(n.test(i)){break}if(r.test(i)){break}if(o.test(i)){break}a+="\n"+d}if(!h&&!d.trim()){h=true}s+=l+"\n";t=t.substring(l.length+1);i=d.slice(c)}}if(!n.loose){if(l){n.loose=true}else if(/\n *\n *$/.test(s)){l=true}}let p=null;let u;if(this.options.gfm){p=/^\[[ xX]\] /.exec(a);if(p){u=p[0]!=="[ ] ";a=a.replace(/^\[[ xX]\] +/,"")}}n.items.push({type:"list_item",raw:s,task:!!p,checked:u,loose:false,text:a,tokens:[]});n.raw+=s}n.items[n.items.length-1].raw=s.trimEnd();n.items[n.items.length-1].text=a.trimEnd();n.raw=n.raw.trimEnd();for(let t=0;t<n.items.length;t++){this.lexer.state.top=false;n.items[t].tokens=this.lexer.blockTokens(n.items[t].text,[]);if(!n.loose){const e=n.items[t].tokens.filter((t=>t.type==="space"));const o=e.length>0&&e.some((t=>/\n.*\n/.test(t.raw)));n.loose=o}}if(n.loose){for(let t=0;t<n.items.length;t++){n.items[t].loose=true}}return n}}html(t){const e=this.rules.block.html.exec(t);if(e){const t={type:"html",block:true,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]};return t}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(/\s+/g," ");const o=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"";const i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:o,title:i}}}table(t){const e=this.rules.block.table.exec(t);if(e){if(!/[:|]/.test(e[2])){return}const t={type:"table",raw:e[0],header:R(e[1]).map((t=>({text:t,tokens:[]}))),align:e[2].replace(/^\||\| *$/g,"").split("|"),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(t.header.length===t.align.length){let e=t.align.length;let o,i,n,r;for(o=0;o<e;o++){const e=t.align[o];if(e){if(/^ *-+: *$/.test(e)){t.align[o]="right"}else if(/^ *:-+: *$/.test(e)){t.align[o]="center"}else if(/^ *:-+ *$/.test(e)){t.align[o]="left"}else{t.align[o]=null}}}e=t.rows.length;for(o=0;o<e;o++){t.rows[o]=R(t.rows[o],t.header.length).map((t=>({text:t,tokens:[]})))}e=t.header.length;for(i=0;i<e;i++){t.header[i].tokens=this.lexer.inline(t.header[i].text)}e=t.rows.length;for(i=0;i<e;i++){r=t.rows[i];for(n=0;n<r.length;n++){r[n].tokens=this.lexer.inline(r[n].text)}}return t}}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e){return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t=e[1].charAt(e[1].length-1)==="\n"?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e){return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}}escape(t){const e=this.rules.inline.escape.exec(t);if(e){return{type:"escape",raw:e[0],text:S(e[1])}}}tag(t){const e=this.rules.inline.tag.exec(t);if(e){if(!this.lexer.state.inLink&&/^<a /i.test(e[0])){this.lexer.state.inLink=true}else if(this.lexer.state.inLink&&/^<\/a>/i.test(e[0])){this.lexer.state.inLink=false}if(!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=true}else if(this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=false}return{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:e[0]}}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t)){return}const e=B(t.slice(0,-1),"\\");if((t.length-e.length)%2===0){return}}else{const t=D(e[2],"()");if(t>-1){const o=e[0].indexOf("!")===0?5:4;const i=o+e[1].length+t;e[2]=e[2].substring(0,t);e[0]=e[0].substring(0,i).trim();e[3]=""}}let o=e[2];let i="";if(this.options.pedantic){const t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);if(t){o=t[1];i=t[3]}}else{i=e[3]?e[3].slice(1,-1):""}o=o.trim();if(/^</.test(o)){if(this.options.pedantic&&!/>$/.test(t)){o=o.slice(1)}else{o=o.slice(1,-1)}}return L(e,{href:o?o.replace(this.rules.inline._escapes,"$1"):o,title:i?i.replace(this.rules.inline._escapes,"$1"):i},e[0],this.lexer)}}reflink(t,e){let o;if((o=this.rules.inline.reflink.exec(t))||(o=this.rules.inline.nolink.exec(t))){let t=(o[2]||o[1]).replace(/\s+/g," ");t=e[t.toLowerCase()];if(!t){const t=o[0].charAt(0);return{type:"text",raw:t,text:t}}return L(o,t,o[0],this.lexer)}}emStrong(t,e,o=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i)return;if(i[3]&&o.match(/[\p{L}\p{N}]/u))return;const n=i[1]||i[2]||"";if(!n||!o||this.rules.inline.punctuation.exec(o)){const o=[...i[0]].length-1;let n,r,s=o,a=0;const l=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;l.lastIndex=0;e=e.slice(-1*t.length+o);while((i=l.exec(e))!=null){n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6];if(!n)continue;r=[...n].length;if(i[3]||i[4]){s+=r;continue}else if(i[5]||i[6]){if(o%3&&!((o+r)%3)){a+=r;continue}}s-=r;if(s>0)continue;r=Math.min(r,r+s+a);const e=[...i[0]][0].length;const l=t.slice(0,o+i.index+e+r);if(Math.min(o,r)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const d=l.slice(2,-2);return{type:"strong",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(/\n/g," ");const o=/[^ ]/.test(t);const i=/^ /.test(t)&&/ $/.test(t);if(o&&i){t=t.substring(1,t.length-1)}t=S(t,true);return{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e){return{type:"br",raw:e[0]}}}del(t){const e=this.rules.inline.del.exec(t);if(e){return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,o;if(e[2]==="@"){t=S(e[1]);o="mailto:"+t}else{t=S(e[1]);o=t}return{type:"link",raw:e[0],text:t,href:o,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,o;if(e[2]==="@"){t=S(e[0]);o="mailto:"+t}else{let i;do{i=e[0];e[0]=this.rules.inline._backpedal.exec(e[0])[0]}while(i!==e[0]);t=S(e[0]);if(e[1]==="www."){o="http://"+e[0]}else{o=e[0]}}return{type:"link",raw:e[0],text:t,href:o,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){let t;if(this.lexer.state.inRawBlock){t=e[0]}else{t=S(e[0])}return{type:"text",raw:e[0],text:t}}}}const P={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:"+"<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)"+"|comment[^\\n]*(\\n+|$)"+"|<\\?[\\s\\S]*?(?:\\?>\\n*|$)"+"|<![A-Z][\\s\\S]*?(?:>\\n*|$)"+"|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)"+"|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+")",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:A,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};P._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;P._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;P.def=E(P.def).replace("label",P._label).replace("title",P._title).getRegex();P.bullet=/(?:[*+-]|\d{1,9}[.)])/;P.listItemStart=E(/^( *)(bull) */).replace("bull",P.bullet).getRegex();P.list=E(P.list).replace(/bull/g,P.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+P.def.source+")").getRegex();P._tag="address|article|aside|base|basefont|blockquote|body|caption"+"|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption"+"|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe"+"|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option"+"|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr"+"|track|ul";P._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;P.html=E(P.html,"i").replace("comment",P._comment).replace("tag",P._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();P.lheading=E(P.lheading).replace(/bull/g,P.bullet).getRegex();P.paragraph=E(P._paragraph).replace("hr",P.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",P._tag).getRegex();P.blockquote=E(P.blockquote).replace("paragraph",P.paragraph).getRegex();P.normal={...P};P.gfm={...P.normal,table:"^ *([^\\n ].*)\\n"+" {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)"+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};P.gfm.table=E(P.gfm.table).replace("hr",P.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",P._tag).getRegex();P.gfm.paragraph=E(P._paragraph).replace("hr",P.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",P.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",P._tag).getRegex();P.pedantic={...P.normal,html:E("^ *(?:comment *(?:\\n|\\s*$)"+"|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)"+"|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",P._comment).replace(/tag/g,"(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub"+"|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)"+"\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:E(P.normal._paragraph).replace("hr",P.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",P.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:A,tag:"^comment"+"|^</[a-zA-Z][\\w:-]*\\s*>"+"|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>"+"|^<\\?[\\s\\S]*?\\?>"+"|^<![a-zA-Z]+\\s[\\s\\S]*?>"+"|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:A,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};q._punctuation="\\p{P}$+<=>`^|~";q.punctuation=E(q.punctuation,"u").replace(/punctuation/g,q._punctuation).getRegex();q.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;q.anyPunctuation=/\\[punct]/g;q._escapes=/\\([punct])/g;q._comment=E(P._comment).replace("(?:--\x3e|$)","--\x3e").getRegex();q.emStrong.lDelim=E(q.emStrong.lDelim,"u").replace(/punct/g,q._punctuation).getRegex();q.emStrong.rDelimAst=E(q.emStrong.rDelimAst,"gu").replace(/punct/g,q._punctuation).getRegex();q.emStrong.rDelimUnd=E(q.emStrong.rDelimUnd,"gu").replace(/punct/g,q._punctuation).getRegex();q.anyPunctuation=E(q.anyPunctuation,"gu").replace(/punct/g,q._punctuation).getRegex();q._escapes=E(q._escapes,"gu").replace(/punct/g,q._punctuation).getRegex();q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;q.autolink=E(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex();q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;q.tag=E(q.tag).replace("comment",q._comment).replace("attribute",q._attribute).getRegex();q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;q.link=E(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex();q.reflink=E(q.reflink).replace("label",q._label).replace("ref",P._label).getRegex();q.nolink=E(q.nolink).replace("ref",P._label).getRegex();q.reflinkSearch=E(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex();q.normal={...q};q.pedantic={...q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:E(/^!?\[(label)\]\((.*?)\)/).replace("label",q._label).getRegex(),reflink:E(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()};q.gfm={...q.normal,escape:E(q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};q.gfm.url=E(q.gfm.url,"i").replace("email",q.gfm._extended_email).getRegex();q.breaks={...q.gfm,br:E(q.br).replace("{2,}","*").getRegex(),text:E(q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class U{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[];this.tokens.links=Object.create(null);this.options=t||y;this.options.tokenizer=this.options.tokenizer||new O;this.tokenizer=this.options.tokenizer;this.tokenizer.options=this.options;this.tokenizer.lexer=this;this.inlineQueue=[];this.state={inLink:false,inRawBlock:false,top:true};const e={block:P.normal,inline:q.normal};if(this.options.pedantic){e.block=P.pedantic;e.inline=q.pedantic}else if(this.options.gfm){e.block=P.gfm;if(this.options.breaks){e.inline=q.breaks}else{e.inline=q.gfm}}this.tokenizer.rules=e}static get rules(){return{block:P,inline:q}}static lex(t,e){const o=new U(e);return o.lex(t)}static lexInline(t,e){const o=new U(e);return o.inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,"\n");this.blockTokens(t,this.tokens);let e;while(e=this.inlineQueue.shift()){this.inlineTokens(e.src,e.tokens)}return this.tokens}blockTokens(t,e=[]){if(this.options.pedantic){t=t.replace(/\t/g," ").replace(/^ +$/gm,"")}else{t=t.replace(/^( *)(\t+)/gm,((t,e,o)=>e+" ".repeat(o.length)))}let o;let i;let n;let r;while(t){if(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((i=>{if(o=i.call({lexer:this},t,e)){t=t.substring(o.raw.length);e.push(o);return true}return false}))){continue}if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);if(o.raw.length===1&&e.length>0){e[e.length-1].raw+="\n"}else{e.push(o)}continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);i=e[e.length-1];if(i&&(i.type==="paragraph"||i.type==="text")){i.raw+="\n"+o.raw;i.text+="\n"+o.text;this.inlineQueue[this.inlineQueue.length-1].src=i.text}else{e.push(o)}continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);i=e[e.length-1];if(i&&(i.type==="paragraph"||i.type==="text")){i.raw+="\n"+o.raw;i.text+="\n"+o.raw;this.inlineQueue[this.inlineQueue.length-1].src=i.text}else if(!this.tokens.links[o.tag]){this.tokens.links[o.tag]={href:o.href,title:o.title}}continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length);e.push(o);continue}n=t;if(this.options.extensions&&this.options.extensions.startBlock){let e=Infinity;const o=t.slice(1);let i;this.options.extensions.startBlock.forEach((t=>{i=t.call({lexer:this},o);if(typeof i==="number"&&i>=0){e=Math.min(e,i)}}));if(e<Infinity&&e>=0){n=t.substring(0,e+1)}}if(this.state.top&&(o=this.tokenizer.paragraph(n))){i=e[e.length-1];if(r&&i.type==="paragraph"){i.raw+="\n"+o.raw;i.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=i.text}else{e.push(o)}r=n.length!==t.length;t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);i=e[e.length-1];if(i&&i.type==="text"){i.raw+="\n"+o.raw;i.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=i.text}else{e.push(o)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}this.state.top=true;return e}inline(t,e=[]){this.inlineQueue.push({src:t,tokens:e});return e}inlineTokens(t,e=[]){let o,i,n;let r=t;let s;let a,l;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0){while((s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null){if(t.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))){r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}}}while((s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null){r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex)}while((s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null){r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex)}while(t){if(!a){l=""}a=false;if(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((i=>{if(o=i.call({lexer:this},t,e)){t=t.substring(o.raw.length);e.push(o);return true}return false}))){continue}if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length);i=e[e.length-1];if(i&&o.type==="text"&&i.type==="text"){i.raw+=o.raw;i.text+=o.text}else{e.push(o)}continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);i=e[e.length-1];if(i&&o.type==="text"&&i.type==="text"){i.raw+=o.raw;i.text+=o.text}else{e.push(o)}continue}if(o=this.tokenizer.emStrong(t,r,l)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length);e.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length);e.push(o);continue}n=t;if(this.options.extensions&&this.options.extensions.startInline){let e=Infinity;const o=t.slice(1);let i;this.options.extensions.startInline.forEach((t=>{i=t.call({lexer:this},o);if(typeof i==="number"&&i>=0){e=Math.min(e,i)}}));if(e<Infinity&&e>=0){n=t.substring(0,e+1)}}if(o=this.tokenizer.inlineText(n)){t=t.substring(o.raw.length);if(o.raw.slice(-1)!=="_"){l=o.raw.slice(-1)}a=true;i=e[e.length-1];if(i&&i.type==="text"){i.raw+=o.raw;i.text+=o.text}else{e.push(o)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}return e}}class W{options;constructor(t){this.options=t||y}code(t,e,o){const i=(e||"").match(/^\S*/)?.[0];t=t.replace(/\n$/,"")+"\n";if(!i){return"<pre><code>"+(o?t:S(t,true))+"</code></pre>\n"}return'<pre><code class="language-'+S(i)+'">'+(o?t:S(t,true))+"</code></pre>\n"}blockquote(t){return`<blockquote>\n${t}</blockquote>\n`}html(t,e){return t}heading(t,e,o){return`<h${e}>${t}</h${e}>\n`}hr(){return"<hr>\n"}list(t,e,o){const i=e?"ol":"ul";const n=e&&o!==1?' start="'+o+'"':"";return"<"+i+n+">\n"+t+"</"+i+">\n"}listitem(t,e,o){return`<li>${t}</li>\n`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>\n`}table(t,e){if(e)e=`<tbody>${e}</tbody>`;return"<table>\n"+"<thead>\n"+t+"</thead>\n"+e+"</table>\n"}tablerow(t){return`<tr>\n${t}</tr>\n`}tablecell(t,e){const o=e.header?"th":"td";const i=e.align?`<${o} align="${e.align}">`:`<${o}>`;return i+t+`</${o}>\n`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,o){const i=$(t);if(i===null){return o}t=i;let n='<a href="'+t+'"';if(e){n+=' title="'+e+'"'}n+=">"+o+"</a>";return n}image(t,e,o){const i=$(t);if(i===null){return o}t=i;let n=`<img src="${t}" alt="${o}"`;if(e){n+=` title="${e}"`}n+=">";return n}text(t){return t}}class V{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,e,o){return""+o}image(t,e,o){return""+o}br(){return""}}class N{options;renderer;textRenderer;constructor(t){this.options=t||y;this.options.renderer=this.options.renderer||new W;this.renderer=this.options.renderer;this.renderer.options=this.options;this.textRenderer=new V}static parse(t,e){const o=new N(e);return o.parse(t)}static parseInline(t,e){const o=new N(e);return o.parseInline(t)}parse(t,e=true){let o="";for(let i=0;i<t.length;i++){const n=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const t=n;const e=this.options.extensions.renderers[t.type].call({parser:this},t);if(e!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){o+=e||"";continue}}switch(n.type){case"space":{continue}case"hr":{o+=this.renderer.hr();continue}case"heading":{const t=n;o+=this.renderer.heading(this.parseInline(t.tokens),t.depth,T(this.parseInline(t.tokens,this.textRenderer)));continue}case"code":{const t=n;o+=this.renderer.code(t.text,t.lang,!!t.escaped);continue}case"table":{const t=n;let e="";let i="";for(let e=0;e<t.header.length;e++){i+=this.renderer.tablecell(this.parseInline(t.header[e].tokens),{header:true,align:t.align[e]})}e+=this.renderer.tablerow(i);let r="";for(let e=0;e<t.rows.length;e++){const o=t.rows[e];i="";for(let e=0;e<o.length;e++){i+=this.renderer.tablecell(this.parseInline(o[e].tokens),{header:false,align:t.align[e]})}r+=this.renderer.tablerow(i)}o+=this.renderer.table(e,r);continue}case"blockquote":{const t=n;const e=this.parse(t.tokens);o+=this.renderer.blockquote(e);continue}case"list":{const t=n;const e=t.ordered;const i=t.start;const r=t.loose;let s="";for(let e=0;e<t.items.length;e++){const o=t.items[e];const i=o.checked;const n=o.task;let a="";if(o.task){const t=this.renderer.checkbox(!!i);if(r){if(o.tokens.length>0&&o.tokens[0].type==="paragraph"){o.tokens[0].text=t+" "+o.tokens[0].text;if(o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&o.tokens[0].tokens[0].type==="text"){o.tokens[0].tokens[0].text=t+" "+o.tokens[0].tokens[0].text}}else{o.tokens.unshift({type:"text",text:t+" "})}}else{a+=t+" "}}a+=this.parse(o.tokens,r);s+=this.renderer.listitem(a,n,!!i)}o+=this.renderer.list(s,e,i);continue}case"html":{const t=n;o+=this.renderer.html(t.text,t.block);continue}case"paragraph":{const t=n;o+=this.renderer.paragraph(this.parseInline(t.tokens));continue}case"text":{let r=n;let s=r.tokens?this.parseInline(r.tokens):r.text;while(i+1<t.length&&t[i+1].type==="text"){r=t[++i];s+="\n"+(r.tokens?this.parseInline(r.tokens):r.text)}o+=e?this.renderer.paragraph(s):s;continue}default:{const t='Token with "'+n.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return o}parseInline(t,e){e=e||this.renderer;let o="";for(let i=0;i<t.length;i++){const n=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const t=this.options.extensions.renderers[n.type].call({parser:this},n);if(t!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){o+=t||"";continue}}switch(n.type){case"escape":{const t=n;o+=e.text(t.text);break}case"html":{const t=n;o+=e.html(t.text);break}case"link":{const t=n;o+=e.link(t.href,t.title,this.parseInline(t.tokens,e));break}case"image":{const t=n;o+=e.image(t.href,t.title,t.text);break}case"strong":{const t=n;o+=e.strong(this.parseInline(t.tokens,e));break}case"em":{const t=n;o+=e.em(this.parseInline(t.tokens,e));break}case"codespan":{const t=n;o+=e.codespan(t.text);break}case"br":{o+=e.br();break}case"del":{const t=n;o+=e.del(this.parseInline(t.tokens,e));break}case"text":{const t=n;o+=e.text(t.text);break}default:{const t='Token with "'+n.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return o}}class Z{options;constructor(t){this.options=t||y}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}class Q{defaults=w();options=this.setOptions;parse=this.#t(U.lex,N.parse);parseInline=this.#t(U.lexInline,N.parseInline);Parser=N;Renderer=W;TextRenderer=V;Lexer=U;Tokenizer=O;Hooks=Z;constructor(...t){this.use(...t)}walkTokens(t,e){let o=[];for(const i of t){o=o.concat(e.call(this,i));switch(i.type){case"table":{const t=i;for(const i of t.header){o=o.concat(this.walkTokens(i.tokens,e))}for(const i of t.rows){for(const t of i){o=o.concat(this.walkTokens(t.tokens,e))}}break}case"list":{const t=i;o=o.concat(this.walkTokens(t.items,e));break}default:{const t=i;if(this.defaults.extensions?.childTokens?.[t.type]){this.defaults.extensions.childTokens[t.type].forEach((i=>{o=o.concat(this.walkTokens(t[i],e))}))}else if(t.tokens){o=o.concat(this.walkTokens(t.tokens,e))}}}}return o}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((t=>{const o={...t};o.async=this.defaults.async||o.async||false;if(t.extensions){t.extensions.forEach((t=>{if(!t.name){throw new Error("extension name required")}if("renderer"in t){const o=e.renderers[t.name];if(o){e.renderers[t.name]=function(...e){let i=t.renderer.apply(this,e);if(i===false){i=o.apply(this,e)}return i}}else{e.renderers[t.name]=t.renderer}}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline"){throw new Error("extension level must be 'block' or 'inline'")}const o=e[t.level];if(o){o.unshift(t.tokenizer)}else{e[t.level]=[t.tokenizer]}if(t.start){if(t.level==="block"){if(e.startBlock){e.startBlock.push(t.start)}else{e.startBlock=[t.start]}}else if(t.level==="inline"){if(e.startInline){e.startInline.push(t.start)}else{e.startInline=[t.start]}}}}if("childTokens"in t&&t.childTokens){e.childTokens[t.name]=t.childTokens}}));o.extensions=e}if(t.renderer){const e=this.defaults.renderer||new W(this.defaults);for(const o in t.renderer){const i=t.renderer[o];const n=o;const r=e[n];e[n]=(...t)=>{let o=i.apply(e,t);if(o===false){o=r.apply(e,t)}return o||""}}o.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new O(this.defaults);for(const o in t.tokenizer){const i=t.tokenizer[o];const n=o;const r=e[n];e[n]=(...t)=>{let o=i.apply(e,t);if(o===false){o=r.apply(e,t)}return o}}o.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new Z;for(const o in t.hooks){const i=t.hooks[o];const n=o;const r=e[n];if(Z.passThroughHooks.has(o)){e[n]=t=>{if(this.defaults.async){return Promise.resolve(i.call(e,t)).then((t=>r.call(e,t)))}const o=i.call(e,t);return r.call(e,o)}}else{e[n]=(...t)=>{let o=i.apply(e,t);if(o===false){o=r.apply(e,t)}return o}}}o.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens;const i=t.walkTokens;o.walkTokens=function(t){let o=[];o.push(i.call(this,t));if(e){o=o.concat(e.call(this,t))}return o}}this.defaults={...this.defaults,...o}}));return this}setOptions(t){this.defaults={...this.defaults,...t};return this}lexer(t,e){return U.lex(t,e??this.defaults)}parser(t,e){return N.parse(t,e??this.defaults)}#t(t,e){return(o,i)=>{const n={...i};const r={...this.defaults,...n};if(this.defaults.async===true&&n.async===false){if(!r.silent){console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.")}r.async=true}const s=this.#e(!!r.silent,!!r.async);if(typeof o==="undefined"||o===null){return s(new Error("marked(): input parameter is undefined or null"))}if(typeof o!=="string"){return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"))}if(r.hooks){r.hooks.options=r}if(r.async){return Promise.resolve(r.hooks?r.hooks.preprocess(o):o).then((e=>t(e,r))).then((t=>r.walkTokens?Promise.all(this.walkTokens(t,r.walkTokens)).then((()=>t)):t)).then((t=>e(t,r))).then((t=>r.hooks?r.hooks.postprocess(t):t)).catch(s)}try{if(r.hooks){o=r.hooks.preprocess(o)}const i=t(o,r);if(r.walkTokens){this.walkTokens(i,r.walkTokens)}let n=e(i,r);if(r.hooks){n=r.hooks.postprocess(n)}return n}catch(t){return s(t)}}}#e(t,e){return o=>{o.message+="\nPlease report this to https://github.com/markedjs/marked.";if(t){const t="<p>An error occurred:</p><pre>"+S(o.message+"",true)+"</pre>";if(e){return Promise.resolve(t)}return t}if(e){return Promise.reject(o)}throw o}}}const J=new Q;function G(t,e){return J.parse(t,e)}G.options=G.setOptions=function(t){J.setOptions(t);G.defaults=J.defaults;k(G.defaults);return G};G.getDefaults=w;G.defaults=y;G.use=function(...t){J.use(...t);G.defaults=J.defaults;k(G.defaults);return G};G.walkTokens=function(t,e){return J.walkTokens(t,e)};G.parseInline=J.parseInline;G.Parser=N;G.parser=N.parse;G.Renderer=W;G.TextRenderer=V;G.Lexer=U;G.lexer=U.lex;G.Tokenizer=O;G.Hooks=Z;G.parse=G;const X=":host{display:block;font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0;position:absolute;width:100%;height:100%}.modal-container{background:white;border-radius:8px;width:100%;max-width:900px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.placeholder-status p{font-size:16px}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;margin-bottom:20px}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-left div{font-size:16px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-container{background-image:url(https://pub.pincaimao.com/static/web/images/login/bg_login_m.png);background-size:100%;height:100%;border-radius:0px 0px 8px 8px}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;height:400px}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{width:38px;height:38px;border-radius:16px;background:#0d75fb;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color 0.2s ease}.send-button img{width:24px;height:24px}.send-button:hover{background:#0a62d6}.send-button.disabled{background:#d9d9d9;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:10px 20px 0px 20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;top:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:14px;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:16px;background-color:#0D75FB;border-radius:6px;width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:16px}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}.text-input-area{display:flex;flex-direction:column;width:100%;height:100%;padding:0px 16px 16px 16px;border-radius:8px;border:none;}.text-answer-input{flex:1;min-height:80px;padding:12px 12px 0px 12px;border:1px solid #ddd;border-radius:8px 8px 0 0;resize:none;font-size:16px;background-color:#fff;border-bottom:none;outline:none;}.input-toolbar{display:flex;justify-content:end;align-items:center;padding:8px 12px;background-color:#fff;border:1px solid #ddd;border-top:none;border-radius:0 0 8px 8px}.text-answer-input:focus{border-color:rgb(74, 144, 226);border-bottom:none}.text-answer-input:focus+.input-toolbar{border-color:rgb(74, 144, 226);border-top:none}.toolbar-actions{width:32px;height:32px;display:flex;justify-content:center;align-items:center;margin-right:10px;border:1px solid #d9d9d9;border-radius:6px}.toolbar-actions:hover{background-color:#f0f0f0}.toolbar-button{background:transparent;border:none;color:#666;cursor:pointer;padding:0;margin:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.toolbar-button>div,.toolbar-button>svg{display:flex;justify-content:center;align-items:center}.submit-text-button{padding:6px 16px;background-color:#4a90e2;color:white;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:background-color 0.2s}.submit-text-button:hover:not(.disabled){background-color:#3a7bc8}.submit-text-button.disabled{background-color:#b3b3b3;cursor:not-allowed}.toolbar-button.recording{background-color:rgba(255, 0, 0, 0.1);color:#ff3b30;animation:pulse 1.5s infinite}.toolbar-button.converting{background-color:rgba(0, 122, 255, 0.1);color:#007aff}.toolbar-button .recording-time{font-size:12px;margin-left:4px}.converting-indicator{display:flex;justify-content:center;align-items:center}.converting-indicator svg{animation:spin 1.5s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(255, 0, 0, 0.4)}70%{box-shadow:0 0 0 6px rgba(255, 0, 0, 0)}100%{box-shadow:0 0 0 0 rgba(255, 0, 0, 0)}}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:0}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.workspace-section{width:100%;padding:0px 16px 16px}.workspace-toolbar{display:flex;justify-content:end;align-items:center;gap:12px}.workspace-button{display:flex;align-items:center;gap:6px;padding:8px 16px;border:1px solid #d9d9d9;border-radius:6px;background:white;color:#666;font-size:14px;cursor:pointer;transition:all 0.2s ease;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05)}.workspace-button:hover{border-color:#4096ff;color:#4096ff;box-shadow:0 2px 4px rgba(64, 150, 255, 0.1)}.workspace-button svg{flex-shrink:0}.history-drawer-content{height:100%;display:flex;flex-direction:column}.conversation-list{flex:1;overflow-y:auto;padding:8px 0}.loading-conversations,.empty-conversations{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;color:#999}.loading-conversations .loading-spinner-small{margin-bottom:12px}.conversation-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;margin:0 8px 4px 8px;border-radius:8px;cursor:pointer;transition:all 0.2s ease;border:1px solid transparent}.conversation-item:hover{background:#f5f5f5}.conversation-item.active{background:#e6f7ff;border-color:#1890ff}.conversation-info{flex:1;min-width:0}.conversation-title{font-size:14px;font-weight:500;color:#262626;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:#8c8c8c}.conversation-time{flex-shrink:0}.message-count{flex-shrink:0}.conversation-status{padding:2px 6px;border-radius:4px;font-size:11px;font-weight:500}.conversation-status.completed{background:#f6ffed;color:#52c41a}.conversation-status.running{background:#fff7e6;color:#fa8c16}.current-indicator{flex-shrink:0;color:#1890ff;margin-left:8px}";const K='.markdown-body{--base-size-4:4px;--base-size-8:8px;--base-size-16:16px;--base-size-24:24px;--base-size-40:40px;--base-text-weight-normal:400;--base-text-weight-medium:500;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fgColor-accent:Highlight}@media (prefers-color-scheme: dark){.markdown-body,[data-theme="dark"]{color-scheme:dark;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}@media (prefers-color-scheme: light){.markdown-body,[data-theme="light"]{color-scheme:light;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{width:16px;height:16px;content:\' \';display:inline-block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none !important}.markdown-body a{background-color:transparent;color:var(--fgColor-accent);text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dfn{font-style:italic}.markdown-body h1{margin:.67em 0;font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.markdown-body sub{bottom:-0.25em}.markdown-body sup{top:-0.5em}.markdown-body img{border-style:none;max-width:100%;box-sizing:content-box}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;overflow:hidden;background:transparent;border-bottom:1px solid var(--borderColor-muted);height:.25em;padding:0;margin:var(--base-size-24) 0;background-color:var(--borderColor-default);border:0}.markdown-body input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{-webkit-appearance:button;appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button,.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button,.markdown-body [type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr::before{display:table;content:""}.markdown-body hr::after{display:table;clear:both;content:""}.markdown-body table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:solid 1px transparent}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{display:inline-block;padding:var(--base-size-4);font:11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);line-height:10px;color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);border-radius:6px;box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted)}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold, 600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.2em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body h3{font-weight:var(--base-text-weight-semibold, 600);font-size:1.05em}.markdown-body h4{font-weight:var(--base-text-weight-semibold, 600);font-size:0.875em}.markdown-body h5{font-weight:var(--base-text-weight-semibold, 600);font-size:.85em}.markdown-body h6{font-weight:var(--base-text-weight-semibold, 600);font-size:.80em;color:var(--fgColor-muted)}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{margin:0;padding:0 1em;color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default)}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{margin-top:0;margin-bottom:0;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px;word-wrap:normal}.markdown-body .octicon{display:inline-block;overflow:visible !important;vertical-align:text-bottom;fill:currentColor}.markdown-body input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button{margin:0;appearance:none}.markdown-body .mr-2{margin-right:var(--base-size-8, 8px) !important}.markdown-body::before{display:table;content:""}.markdown-body::after{display:table;clear:both;content:""}.markdown-body>*:first-child{margin-top:0 !important}.markdown-body>*:last-child{margin-bottom:0 !important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16);font-size:16px;font-weight:400}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{padding:0 .2em;font-size:inherit}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{padding-bottom:0;border-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type="a s"]{list-style-type:lower-alpha}.markdown-body ol[type="A s"]{list-style-type:upper-alpha}.markdown-body ol[type="i s"]{list-style-type:lower-roman}.markdown-body ol[type="I s"]{list-style-type:upper-roman}.markdown-body ol[type="1"]{list-style-type:decimal}.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid var(--borderColor-default)}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:transparent}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid var(--borderColor-default)}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:var(--fgColor-default)}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em .4em;margin:0;font-size:85%;white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:transparent;border:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);overflow:auto;font-size:85%;line-height:1.45;color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold, 600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]::before{content:"["}.markdown-body [data-footnote-ref]::after{content:"]"}.markdown-body .footnotes{font-size:12px;color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default)}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{display:inline-block;padding-left:var(--base-size-16);margin-top:var(--base-size-16)}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target::before{position:absolute;top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body body:has(:modal){padding-right:var(--dialog-scrollgutter) !important}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{font-weight:bold;color:var(--color-prettylights-syntax-string-regexp)}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{font-weight:bold;color:var(--color-prettylights-syntax-markup-heading)}.markdown-body .pl-mi{font-style:italic;color:var(--color-prettylights-syntax-markup-italic)}.markdown-body .pl-mb{font-weight:bold;color:var(--color-prettylights-syntax-markup-bold)}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{font-weight:bold;color:var(--color-prettylights-syntax-meta-diff-range)}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{text-decoration:underline;color:var(--color-prettylights-syntax-constant-other-reference-link)}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){outline:none;box-shadow:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{display:inline-block;min-width:1ch;font-family:"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1em;font-style:normal !important;font-weight:var(--base-text-weight-normal, 400);line-height:1;vertical-align:-0.075em}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal, 400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{margin:0 .2em .25em -1.4em;vertical-align:middle}.markdown-body ul:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body ol:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{display:block;width:auto;height:24px;overflow:visible;clip:auto}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{display:flex;font-weight:var(--base-text-weight-medium, 500);align-items:center;line-height:1}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>*:first-child>.heading-element:first-child{margin-top:0 !important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}';const Y=class{modalTitle="在线客服";token;isOpen=false;messages=[];modalClosed;icon;zIndex;isShowHeader=true;isNeedClose=true;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return o(this)}streamComplete;conversationStart;isUploading=false;defaultQuery="你好!聘才猫";maxRecordingTime=120;countdownWarningTime=30;isRecording=false;recordingStream=null;recordedBlob=null;mediaRecorder=null;recordingTimeLeft=0;showRecordingUI=false;recordingTimer=null;recordingStartTime=0;waitingToRecord=false;waitingTimer=null;waitingTimeLeft=10;videoRef=null;currentQuestionNumber=0;interviewComplete;SCROLL_THRESHOLD=20;showCountdownWarning=false;fullscreen=false;isUploadingVideo=false;isPlayingAudio=false;audioUrl=null;audioElement=null;recordingError;recordingStatusChange;tokenInvalid;enableTTS=false;enableVoice=false;interviewMode="video";textAnswer="";isSubmittingText=false;customInputs={};botId;isRecordingAudio=false;audioRecorder=null;audioChunks=[];isConvertingAudio=false;audioRecordingTimeLeft=60;audioRecordingTimer=null;audioRecordingStartTime=0;maxAudioRecordingTime=60;userAvatar="https://pub.pincaimao.com/static/common/i_pcm_logo.png";assistantAvatar;agentLogo="";isTaskCompleted=false;tokenInvalidListener;showCopyButton=true;showFeedbackButtons=true;filePreviewMode="window";showWorkspaceHistory=false;isDrawerOpen=false;previewUrl="";previewFileName="";previewContentType="file";previewContent="";isUserScrolling=false;deviceError=null;isHistoryDrawerOpen=false;historyConversations=[];isLoadingConversations=false;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.recordingError=e(this,"recordingError");this.recordingStatusChange=e(this,"recordingStatusChange");this.tokenInvalid=e(this,"tokenInvalid");G.setOptions({breaks:true,gfm:true})}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}else{const t=r.getItem("modal-zIndex");if(t){this.zIndex=t}else{this.zIndex=1e3;r.setItem("modal-zIndex",1e3)}}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener);if(!this.customInputs){this.customInputs={}}if(!this.assistantAvatar&&this.botId){this.fetchAgentLogo()}if(this.isOpen){if(this.conversationId){setTimeout((()=>this.loadHistoryMessages()),0)}else{setTimeout((()=>{this.sendMessageToAPI(this.defaultQuery)}),0)}}}handleClose=()=>{this.stopRecording();this.modalClosed.emit()};async fetchAgentLogo(){if(!this.botId)return;try{const t=await a(this.botId);if(t&&t.logo){this.agentLogo=t.logo}}catch(t){f.captureError(t,{action:"fetchAgentLogo",component:"pcm-app-chat-modal",title:"获取智能体信息失败"});m.emitError({error:t,message:"获取智能体信息失败"})}}async sendMessageToAPI(t,e){this.isLoading=true;let o="";let i="";const n=new Date;const r=`${n.getHours()}:${n.getMinutes().toString().padStart(2,"0")}`;const s=t.trim()||"请开始";if(e){this.customInputs={...this.customInputs,video_url:e}}const a={id:`temp-${Date.now()}`,conversation_id:this.conversationId,parent_message_id:"00000000-0000-0000-0000-000000000000",inputs:this.customInputs||{},query:s,answer:"",message_files:[],feedback:{},retriever_resources:[],created_at:Math.floor(Date.now()/1e3).toString(),agent_thoughts:[],status:"normal",error:null,time:r,isStreaming:true};this.currentStreamingMessage=a;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);const d={response_mode:"streaming",conversation_id:this.conversationId,query:s,bot_id:this.botId};d.inputs={...this.customInputs};await l({url:"/sdk/v1/chat/chat-messages",method:"POST",data:d,onMessage:t=>{if(t.conversation_id&&!this.conversationId){this.conversationId=t.conversation_id;this.conversationStart.emit({conversation_id:t.conversation_id,event:t.event,message_id:t.message_id,id:t.id})}if(t.event==="node_finished"&&t.data.inputs&&t.data.inputs.LLMText){i=t.data.inputs.LLMText}if(t.event==="node_finished"&&t.data.title&&t.data.title.includes("聘才猫任务结束")){this.isTaskCompleted=true;const t=i||o||this.currentStreamingMessage?.answer||"";this.interviewComplete.emit({conversation_id:this.conversationId,current_question_number:this.currentQuestionNumber,ai_response:t})}if(t.event==="message"){if(t.event==="agent_message"||t.event==="message"){if(t.answer){o+=t.answer;const e={...this.currentStreamingMessage,answer:o,id:t.message_id||this.currentStreamingMessage.id,isStreaming:true,parent_message_id:t.parent_message_id||this.currentStreamingMessage.parent_message_id,retriever_resources:t.retriever_resources||this.currentStreamingMessage.retriever_resources,agent_thoughts:t.agent_thoughts||this.currentStreamingMessage.agent_thoughts};this.currentStreamingMessage=e;this.scrollToBottom()}}}if(t.event==="message_end"){this.streamComplete.emit({conversation_id:t.conversation_id||"",event:t.event,message_id:t.message_id,id:t.id})}},onError:t=>{console.error("发生错误:",t);m.emitError({error:t,message:"消息发送失败,请稍后再试"});f.captureError(t,{action:"sendMessageToAPI",component:"pcm-app-chat-modal",title:"消息发送失败"});this.messages=[...this.messages,{...a,answer:"抱歉,发生了错误,请稍后再试。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const t=this.currentStreamingMessage;t.isStreaming=false;this.currentStreamingMessage=null;this.messages=[...this.messages,t];this.currentQuestionNumber++;if(this.isTaskCompleted){return}if(t&&t.answer){const e=i||t.answer;if(e&&this.enableTTS){const t=await c(e);if(this.enableVoice){await this.playAudio(t);if(this.interviewMode==="video"){this.startWaitingToRecord()}}else{this.audioUrl=t}}else if(this.interviewMode==="video"){this.startWaitingToRecord()}}}})}handleScroll=()=>{if(this.isUserScrolling){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!t)return;const{scrollTop:e,scrollHeight:o,clientHeight:i}=t;const n=o-e-i;this.shouldAutoScroll=n<=this.SCROLL_THRESHOLD}};handleTouchStart=()=>{this.isUserScrolling=true};handleTouchEnd=()=>{setTimeout((()=>{this.isUserScrolling=false}),100)};_wheelTimer=null;handleWheel=()=>{this.isUserScrolling=true;if(this._wheelTimer){clearTimeout(this._wheelTimer)}this._wheelTimer=setTimeout((()=>{this.isUserScrolling=false}),150)};scrollToBottom(){if(!this.shouldAutoScroll)return;const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t&&this.isOpen){t.scrollTop=t.scrollHeight}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;let t=false;try{const e=await d({url:`/sdk/v1/chat/conversation`,method:"GET",data:{conversation_id:this.conversationId}});if(e.success&&e.data&&e.data.run_status=="结束"){t=true}const o=await d({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:this.botId,limit:20}});if(o.success&&o.data){const t=o.data.data||[];const e=t.map((t=>{const e=new Date(parseInt(t.created_at)*1e3);const o=e.getHours().toString().padStart(2,"0");const i=e.getMinutes().toString().padStart(2,"0");const n=`${o}:${i}`;return{id:t.id,conversation_id:t.conversation_id,parent_message_id:t.parent_message_id||"00000000-0000-0000-0000-000000000000",inputs:t.inputs||{},query:t.query||"",answer:t.answer||"",message_files:t.message_files||[],feedback:t.feedback||{},retriever_resources:t.retriever_resources||[],created_at:t.created_at,agent_thoughts:t.agent_thoughts||[],status:t.status||"normal",error:t.error,time:n,isStreaming:false}}));this.messages=e}}catch(t){console.error("加载历史消息或会话状态失败:",t);f.captureError(t,{action:"loadHistoryMessages",component:"pcm-app-chat-modal",title:"加载历史消息失败"});m.emitError({error:t,message:"加载历史消息失败,请刷新重试"})}finally{this.isLoadingHistory=false;setTimeout((async()=>{this.shouldAutoScroll=true;this.scrollToBottom();if(this.conversationId&&this.messages.length>0&&!t){const t=this.messages[this.messages.length-1];if(t&&t.answer&&this.enableTTS){const e=await c(t.answer);if(this.enableVoice){await this.playAudio(e);if(this.interviewMode==="video"){this.startWaitingToRecord()}}else{this.audioUrl=e}}else if(!this.enableTTS&&this.interviewMode==="video"){this.startWaitingToRecord()}}else if(t){this.isTaskCompleted=true}}),200)}}startWaitingToRecord(){if(this.interviewMode!=="video"){return}if(this.waitingTimer){clearInterval(this.waitingTimer)}if(this.recordingTimer){clearInterval(this.recordingTimer)}this.waitingToRecord=true;this.waitingTimeLeft=10;this.waitingTimer=setInterval((()=>{this.waitingTimeLeft--;if(this.waitingTimeLeft<=0){clearInterval(this.waitingTimer);this.waitingTimer=null;this.waitingToRecord=false;this.startRecording()}}),1e3)}async startRecording(){try{const t=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.deviceError=null;this.recordingStream=t;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(t);const e=this.getSupportedMimeType();let o;try{o=new MediaRecorder(t,{mimeType:e,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(e){console.warn("指定的MIME类型不受支持,使用默认设置:",e);try{o=new MediaRecorder(t,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(e){try{o=new MediaRecorder(t)}catch(t){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:t});this.showRecordingUI=false;return}}}this.mediaRecorder=o;const i=[];o.ondataavailable=t=>{if(t.data.size>0){i.push(t.data)}};o.onerror=t=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:t});this.stopRecording()};o.onstop=()=>{try{const t=e||"video/mp4";const o=new Blob(i,{type:t});if(o.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=o;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:o.size,type:o.type}});this.uploadRecordedVideo()}catch(t){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:t});this.showRecordingUI=false;f.captureError(t,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{o.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:o.mimeType}})}catch(t){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:t});this.showRecordingUI=false;f.captureError(t,{action:"startRecording",component:"pcm-hr-chat-modal",title:"开始录制失败"});return}this.recordingTimer=setInterval((()=>{const t=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-t);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(t){console.error("无法访问摄像头或麦克风:",t);let e="设备访问失败";if(t.name==="NotAllowedError"){e="请允许访问摄像头和麦克风权限"}else if(t.name==="NotFoundError"){e="未检测到摄像头或麦克风设备"}else if(t.name==="NotReadableError"){e="设备正在被其他应用程序使用"}else if(t.name==="OverconstrainedError"){e="摄像头不支持指定的配置"}else{e="无法访问摄像头或麦克风,请检查设备连接"}this.deviceError=e;this.showRecordingUI=false;m.emitError({error:t,message:e});f.captureError(t,{action:"startRecording",component:"pcm-app-chat-modal",title:e})}}setupVideoPreview(t){setTimeout((()=>{const e=this.hostElement.shadowRoot?.querySelector("video");if(e&&t){try{e.srcObject=t;e.play().catch((t=>{console.error("视频播放失败:",t);f.captureError(t,{action:"setupVideoPreview",component:"pcm-app-chat-modal",title:"视频播放失败"});m.emitError({error:t,message:"视频播放失败"})}))}catch(o){console.warn("设置srcObject失败,尝试替代方法:",o);try{const o=URL.createObjectURL(t);e.src=o;e.onended=()=>{URL.revokeObjectURL(o)}}catch(t){console.error("创建对象URL失败:",t);f.captureError(t,{action:"setupVideoPreview",component:"pcm-app-chat-modal",title:"创建对象URL失败"});m.emitError({error:t,message:"创建对象URL失败"})}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const t=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const e of t){if(!e)return"";try{if(MediaRecorder.isTypeSupported(e)){return e}}catch(t){console.warn(`检查MIME类型支持时出错 ${e}:`,t)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""}stopRecording(){if(this.mediaRecorder&&this.isRecording){this.mediaRecorder.stop();this.isRecording=false;if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.recordingStream){this.recordingStream.getTracks().forEach((t=>t.stop()));this.recordingStream=null}this.videoRef=null}}async convertAudioToText(t){try{const e=await d({url:"/sdk/v1/tts/audio_to_text",method:"POST",data:{cos_key:t}});if(e.success&&e.data&&e.data.text){return e.data.text}else{console.warn("音频转文字返回结果格式不正确");return null}}catch(t){console.error("音频转文字错误:",t);f.captureError(t,{action:"convertAudioToText",component:"pcm-app-chat-modal",title:"音频转文字错误"});m.emitError({error:t,message:"音频转文字错误"});return null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const t=this.recordedBlob.type.includes("webm")?"webm":"mp4";const e=`answer.${t}`;const o=new File([this.recordedBlob],e,{type:this.recordedBlob.type});const i=await h(o,{},{tags:["other"]});const n=await this.convertAudioToText(i.cos_key);this.sendMessageToAPI(n||"下一题",i.cos_key)}catch(t){console.error("视频上传或处理错误:",t);f.captureError(t,{action:"uploadRecordedVideo",component:"pcm-app-chat-modal",title:"视频上传或处理失败"});m.emitError({error:t,message:"视频上传或处理失败"})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}playAudio(t){return new Promise((e=>{this.isPlayingAudio=true;this.audioUrl=t;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=t;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;e()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;m.emitError({error:"音频播放错误",message:"音频播放错误"});f.captureMessage("音频播放错误",{action:"playAudio",component:"pcm-hr-chat-modal",title:"音频播放错误"});e()};this.audioElement.play().catch((t=>{console.error("音频播放失败:",t);this.isPlayingAudio=false;this.audioUrl=null;m.emitError({error:t,message:"音频播放失败"});f.captureError(t,{title:"音频播放失败",action:"playAudio",component:"pcm-hr-chat-modal"});e()}))}))}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.audioElement){this.audioElement.pause();this.audioElement.src="";this.audioElement=null}if(this.audioUrl){URL.revokeObjectURL(this.audioUrl);this.audioUrl=null}if(this.waitingTimer){clearInterval(this.waitingTimer);this.waitingTimer=null}if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.audioRecordingTimer){clearInterval(this.audioRecordingTimer);this.audioRecordingTimer=null}this.stopRecording();this.stopAudioRecording()}handlePlayAudio=async()=>{if(this.audioUrl){await this.playAudio(this.audioUrl);if(this.interviewMode==="video"){this.startWaitingToRecord()}}};handleTextInputChange=t=>{const e=t.target;this.textAnswer=e.value};handleKeyDown=t=>{if(t.key==="Enter"){if(t.ctrlKey){const e=t.target;const o=e.selectionStart;const i=this.textAnswer.substring(0,o);const n=this.textAnswer.substring(o);this.textAnswer=i+"\n"+n;t.preventDefault();setTimeout((()=>{const t=o+1;e.setSelectionRange(t,t)}),0);return}else{t.preventDefault();if(this.textAnswer.trim()&&!this.isSubmittingText&&!this.isLoading&&!this.currentStreamingMessage&&!this.waitingToRecord&&!this.isPlayingAudio){this.submitTextAnswer()}}}};submitTextAnswer=async()=>{if(!this.textAnswer.trim()||this.isSubmittingText){return}this.isSubmittingText=true;try{const t=this.textAnswer;this.textAnswer="";await this.sendMessageToAPI(t)}catch(t){console.error("提交文本回答失败:",t);f.captureError(t,{action:"submitTextAnswer",component:"pcm-app-chat-modal",title:"提交文本回答失败"});m.emitError({error:t,message:"提交文本回答失败"})}finally{this.isSubmittingText=false}};handleVoiceInputClick=()=>{if(this.isRecordingAudio){this.stopAudioRecording()}else{navigator.mediaDevices.getUserMedia({audio:true}).then((t=>{this.startRecordingWithStream(t)})).catch((t=>{console.error("麦克风权限请求失败:",t);f.captureError(t,{action:"handleVoiceInputClick",component:"pcm-app-chat-modal",title:"麦克风权限请求失败"});m.emitError({error:t,message:"麦克风权限请求失败"})}))}};startRecordingWithStream(t){try{const e=this.getSupportedAudioMimeType();let o;try{o=new MediaRecorder(t,{mimeType:e})}catch(e){console.warn("指定的音频MIME类型不受支持,使用默认设置:",e);try{o=new MediaRecorder(t)}catch(e){t.getTracks().forEach((t=>t.stop()));console.error("无法创建音频录制器:",e);f.captureError(e,{action:"startRecordingWithStream",component:"pcm-app-chat-modal",title:"无法创建音频录制器"});m.emitError({error:e,message:"无法创建音频录制器"});return}}this.audioRecorder=o;this.audioChunks=[];this.isRecordingAudio=true;this.audioRecordingStartTime=Date.now();this.audioRecordingTimeLeft=this.maxAudioRecordingTime;o.ondataavailable=t=>{if(t.data.size>0){this.audioChunks.push(t.data)}};o.onstop=()=>{t.getTracks().forEach((t=>t.stop()));this.processAudioRecording()};o.start(100);this.audioRecordingTimer=setInterval((()=>{const t=Math.floor((Date.now()-this.audioRecordingStartTime)/1e3);this.audioRecordingTimeLeft=Math.max(0,this.maxAudioRecordingTime-t);if(this.audioRecordingTimeLeft<=0){this.stopAudioRecording()}}),1e3)}catch(e){t.getTracks().forEach((t=>t.stop()));console.error("开始录音失败:",e);f.captureError(e,{action:"startRecordingWithStream",component:"pcm-app-chat-modal",title:"开始录音失败"});m.emitError({error:e,message:"开始录音失败,请确保麦克风设备正常工作"})}}async processAudioRecording(){if(this.audioChunks.length===0){console.warn("没有录制到音频数据");return}try{this.isConvertingAudio=true;const t=this.getSupportedAudioMimeType()||"audio/webm";const e=new Blob(this.audioChunks,{type:t});if(e.size===0){console.warn("录制的音频为空");this.isConvertingAudio=false;return}const o=t.includes("webm")?"webm":"mp3";const i=`audio_input.${o}`;const n=new File([e],i,{type:t});const r=await h(n,{},{tags:["audio"]});const s=await this.convertAudioToText(r.cos_key);if(s){const t=this.hostElement.shadowRoot?.querySelector(".text-answer-input");const e=t?.selectionStart||this.textAnswer.length;const o=this.textAnswer.substring(0,e);const i=this.textAnswer.substring(e);const n=o.length>0&&!o.endsWith(" ")?" ":"";this.textAnswer=o+n+s+i;setTimeout((()=>{if(t){const o=e+n.length+s.length;t.focus();t.setSelectionRange(o,o)}}),0)}else{console.warn("未能识别语音内容");alert("未能识别语音内容,请重试或直接输入文字")}}catch(t){console.error("处理音频录制失败:",t);f.captureError(t,{action:"processAudioRecording",component:"pcm-app-chat-modal",title:"处理音频录制失败"});m.emitError({error:t,message:"语音识别失败,请重试"})}finally{this.isConvertingAudio=false;this.audioChunks=[]}}getSupportedAudioMimeType(){const t=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const e of t){if(!e)return"";try{if(MediaRecorder.isTypeSupported(e)){return e}}catch(t){console.warn(`检查音频MIME类型支持时出错 ${e}:`,t)}}console.warn("没有找到支持的音频MIME类型,将使用浏览器默认值");return""}stopAudioRecording(){if(this.audioRecorder&&this.isRecordingAudio){this.audioRecorder.stop();this.isRecordingAudio=false;if(this.audioRecordingTimer){clearInterval(this.audioRecordingTimer);this.audioRecordingTimer=null}}}handleHistoryClick=()=>{this.isHistoryDrawerOpen=true;this.loadHistoryConversations()};async loadHistoryConversations(){if(!this.botId){console.warn("没有提供botId,无法获取历史会话");return}this.isLoadingConversations=true;try{const t=await d({url:"/sdk/v1/chat/conversations",method:"GET",data:{bot_id:this.botId,limit:50,page:1}});if(t.success&&t.data){const e=t.data.data||[];this.historyConversations=e.map((t=>{let e;let o="未知时间";try{const i=typeof t.created_at==="string"?parseInt(t.created_at):t.created_at;if(isNaN(i)||i<=0){console.warn("无效的时间戳:",t.created_at);e=new Date}else{e=new Date(i*1e3)}if(isNaN(e.getTime())){console.warn("无效的日期对象:",t.created_at);e=new Date}const n=new Date;const r=n.getTime()-e.getTime();const s=Math.floor(r/(1e3*60*60*24));if(s===0){o=`今天 ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}else if(s===1){o=`昨天 ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}else if(s>0&&s<7){const t=["周日","周一","周二","周三","周四","周五","周六"];o=`${t[e.getDay()]} ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}else if(s<0){o=`${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")} ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}else{o=`${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")} ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}}catch(e){console.error("时间格式化错误:",e,t.created_at);o="时间解析失败"}return{id:t.id,name:t.name||"新会话",created_at:t.created_at,updated_at:t.updated_at,status:t.status,message_count:t.message_count||0,timeDisplay:o}}))}}catch(t){console.error("获取历史会话失败:",t);f.captureError(t,{action:"loadHistoryConversations",component:"pcm-app-chat-modal",title:"获取历史会话失败"});m.emitError({error:t,message:"获取历史会话失败"})}finally{this.isLoadingConversations=false}}handleSwitchConversation=t=>{if(t===this.conversationId){this.isHistoryDrawerOpen=false;return}this.conversationId=t;this.messages=[];this.currentStreamingMessage=null;this.isTaskCompleted=false;this.currentQuestionNumber=0;this.isHistoryDrawerOpen=false;this.loadHistoryMessages()};handleFilePreviewRequest=t=>{const{url:e,fileName:o,content:i,contentType:n}=t.detail;this.previewFileName=o||"内容预览";this.previewContentType=n;this.previewUrl=e;this.previewContent=i||"";this.isDrawerOpen=true};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=()=>i("div",{class:"video-preview"},i("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:t=>{if(t&&this.recordingStream&&!this.videoRef){this.videoRef=t}}}),i("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},i("span",{class:"recording-dot"}),i("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const r=()=>{if(this.deviceError){return i("div",{class:"placeholder-status error-status"},i("p",null,this.deviceError),i("div",{class:"error-suggestions"},i("p",null,"请尝试以下解决方案:"),i("ul",null,i("li",null,"更换有摄像头和麦克风的设备"),i("li",null,"确保已允许浏览器访问摄像头和麦克风"),i("li",null,"关闭其他正在使用摄像头/麦克风的应用"))))}if(this.isTaskCompleted){return i("div",{class:"placeholder-status"},i("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return i("div",{class:"placeholder-status"},i("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return i("div",{class:"placeholder-status"},i("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return i("div",{class:"placeholder-status"},i("p",null,"请等待题目..."))}if(this.waitingToRecord){return i("div",{class:"placeholder-status"},i("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return i("div",{class:"placeholder-status default-status"},i("p",null,"准备中..."))};const s=()=>i("div",{class:"text-input-area"},i("textarea",{class:"text-answer-input",placeholder:this.isTaskCompleted?"会话已结束":"发消息",value:this.textAnswer,onInput:this.handleTextInputChange,onKeyDown:this.handleKeyDown,disabled:this.isTaskCompleted||this.isRecordingAudio||this.isConvertingAudio}),i("div",{class:"input-toolbar"},i("div",{class:"toolbar-actions"},i("button",{class:{"toolbar-button":true,recording:this.isRecordingAudio,converting:this.isConvertingAudio},title:this.isRecordingAudio?"点击停止录音":this.isConvertingAudio?"正在识别语音...":"语音输入",onClick:this.handleVoiceInputClick,disabled:this.isTaskCompleted||this.isConvertingAudio||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.waitingToRecord||this.isPlayingAudio},this.isRecordingAudio?i("div",null,i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),i("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}),i("circle",{cx:"12",cy:"11",r:"4",fill:"red"}))):this.isConvertingAudio?i("div",{class:"converting-indicator"},i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}))):i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),i("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"})))),i("div",{class:{"send-button":true,disabled:this.isTaskCompleted||!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.waitingToRecord||this.isPlayingAudio||this.isRecordingAudio||this.isConvertingAudio},onClick:()=>{if(this.isTaskCompleted||!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.waitingToRecord||this.isPlayingAudio||this.isRecordingAudio||this.isConvertingAudio){return}this.submitTextAnswer()}},i("img",{src:"https://pcm-pub-1351162788.cos.ap-guangzhou.myqcloud.com/sdk/image/i_send.png",alt:"发送"}))));const a=this.assistantAvatar||this.agentLogo;return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),i("div",{class:"chat-container"},i("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",null,"加载历史消息中...")):i("div",null,this.messages.map((t=>i("div",{id:`message_${t.id}`,key:t.id},i("pcm-chat-message",{botId:this.botId,message:t,userAvatar:this.userAvatar,assistantAvatar:a,showCopyButton:this.showCopyButton,showFeedbackButtons:this.showFeedbackButtons,filePreviewMode:this.filePreviewMode,onFilePreviewRequest:this.handleFilePreviewRequest,onMessageChange:e=>{const o=this.messages.map((o=>o.id===t.id?{...o,...e.detail}:o));this.messages=o}})))),this.currentStreamingMessage&&i("div",{id:`message_${this.currentStreamingMessage.id}`},i("pcm-chat-message",{botId:this.botId,message:this.currentStreamingMessage,userAvatar:this.userAvatar,assistantAvatar:a,showCopyButton:this.showCopyButton,showFeedbackButtons:this.showFeedbackButtons,filePreviewMode:this.filePreviewMode,onFilePreviewRequest:this.handleFilePreviewRequest})),this.messages.length===0&&!this.currentStreamingMessage&&i("div",{class:"empty-state"},i("p",null,"正在准备面试...")))),i("div",{class:"recording-section"},i("div",{class:"recording-container"},this.showWorkspaceHistory&&i("div",{class:"workspace-section"},i("div",{class:"workspace-toolbar"},i("button",{class:"workspace-button history-button",onClick:()=>this.handleHistoryClick()},i("span",null,"历史会话")))),this.interviewMode==="text"&&s(),this.interviewMode==="video"&&i("div",{class:"video-container"},i("div",{class:"video-area"},this.showRecordingUI?n():i("div",{class:"video-preview placeholder"},r())),i("div",{class:"recording-controls"},this.showRecordingUI?i("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):i("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return i("div",{class:"play-audio-container",onClick:this.handlePlayAudio},i("p",null,i("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},i("path",{d:"M8 5v14l11-7z"})),i("span",{style:{verticalAlign:"middle"}},"播放题目")))}return i("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))),i("pcm-drawer",{isOpen:this.isDrawerOpen,drawerTitle:this.previewFileName,width:"80%",onClosed:()=>{this.isDrawerOpen=false;this.previewUrl="";this.previewContent=""}},this.previewContentType==="file"&&this.previewUrl&&i("div",{class:"file-preview-container"},i("iframe",{src:this.previewUrl,frameborder:"0",width:"100%",height:"100%",style:{border:"none",height:"calc(100vh - 120px)"}})),this.previewContentType==="markdown"&&this.previewContent&&i("div",{class:"markdown-preview-container markdown-body",innerHTML:G(this.previewContent)}),this.previewContentType==="text"&&this.previewContent&&i("div",{class:"text-preview-container"},i("pre",null,this.previewContent))),i("pcm-drawer",{isOpen:this.isHistoryDrawerOpen,drawerTitle:"历史会话",width:"400px",onClosed:()=>{this.isHistoryDrawerOpen=false}},i("div",{class:"history-drawer-content"},i("div",{class:"conversation-list"},this.isLoadingConversations?i("div",{class:"loading-conversations"},i("div",{class:"loading-spinner-small"}),i("p",null,"加载中...")):this.historyConversations.length===0?i("div",{class:"empty-conversations"},i("p",null,"暂无历史会话")):this.historyConversations.map((t=>i("div",{key:t.id,class:{"conversation-item":true,active:t.id===this.conversationId},onClick:()=>this.handleSwitchConversation(t.id)},i("div",{class:"conversation-info"},i("div",{class:"conversation-title"},t.name),i("div",{class:"conversation-meta"},i("span",{class:"conversation-time"},t.timeDisplay),t.message_count>0&&i("span",{class:"message-count"},t.message_count,"条消息"),t.status&&i("span",{class:{"conversation-status":true,completed:t.status==="结束",running:t.status==="进行中"}},t.status))),t.id===this.conversationId&&i("div",{class:"current-indicator"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})))))))))))}static get watchers(){return{token:["handleTokenChange"]}}};Y.style=X+K;const tt=":host{display:inline-block}.pcm-button{display:inline-flex;align-items:center;justify-content:center;font-weight:400;white-space:nowrap;text-align:center;background-image:none;border:1px solid transparent;cursor:pointer;transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);user-select:none;touch-action:manipulation;height:32px;padding:0 15px;font-size:14px;border-radius:4px;color:rgba(0, 0, 0, 0.85);background-color:white;border-color:#d9d9d9;outline:none}.pcm-button:hover{border-color:#40a9ff;color:#40a9ff}.pcm-button:active{border-color:#096dd9;color:#096dd9}.pcm-button-default{background-color:white;border-color:#d9d9d9;color:rgba(0, 0, 0, 0.85)}.pcm-button-primary{background-color:#1677FF;border-color:#1677FF;color:white}.pcm-button-primary:hover{background-color:#40a9ff;border-color:#40a9ff;color:white}.pcm-button-primary:active{background-color:#096dd9;border-color:#096dd9;color:white}.pcm-button-dashed{background-color:white;border-color:#d9d9d9;border-style:dashed}.pcm-button-text{background-color:transparent;border-color:transparent;color:rgba(0, 0, 0, 0.85);box-shadow:none}.pcm-button-text:hover{background-color:rgba(0, 0, 0, 0.05);border-color:transparent;color:rgba(0, 0, 0, 0.85)}.pcm-button-link{background-color:transparent;border-color:transparent;color:#1677FF;box-shadow:none}.pcm-button-link:hover{color:#40a9ff;background-color:transparent;border-color:transparent}.pcm-button-large{height:40px;padding:0 20px;font-size:16px}.pcm-button-small{height:24px;padding:0 7px;font-size:12px}.pcm-button-circle{min-width:32px;padding:0;border-radius:50%}.pcm-button-large.pcm-button-circle{min-width:40px}.pcm-button-small.pcm-button-circle{min-width:24px}.pcm-button-round{border-radius:40px}.pcm-button-loading{opacity:0.65;cursor:default}.loading-icon{width:14px;height:14px;margin-right:8px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:loading-spin 1s infinite linear;display:inline-block}@keyframes loading-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.pcm-button-disabled{cursor:not-allowed;opacity:0.65}.pcm-button-disabled:hover,.pcm-button-disabled:active{color:rgba(0, 0, 0, 0.25);background-color:#f5f5f5;border-color:#d9d9d9}.pcm-button-primary.pcm-button-disabled:hover,.pcm-button-primary.pcm-button-disabled:active{background-color:#1677FF;border-color:#1677FF;color:white}.button-icon{margin-right:8px;display:inline-flex;align-items:center}.button-icon img{width:16px;height:16px}.pcm-button-small .button-icon img{width:12px;height:12px}.pcm-button-large .button-icon img{width:18px;height:18px}.pcm-button-block{width:100%;display:flex}";const et=class{constructor(e){t(this,e)}type="default";size="middle";loading=false;disabled=false;icon="https://pub.pincaimao.com/static/common/i_pcm_logo.png";shape="default";backgroundColor="";textColor="";borderColor="";borderRadius=null;width="";block=false;borderStyle="solid";render(){const t={"pcm-button":true,[`pcm-button-${this.type}`]:true,[`pcm-button-${this.size}`]:true,[`pcm-button-${this.shape}`]:true,"pcm-button-loading":this.loading,"pcm-button-disabled":this.disabled,"pcm-button-block":this.block};const e={};if(this.backgroundColor){e["backgroundColor"]=this.backgroundColor}if(this.textColor){e["color"]=this.textColor}if(this.borderColor){e["borderColor"]=this.borderColor}if(this.borderRadius!==null){e["borderRadius"]=`${this.borderRadius}px`}if(this.width){e["width"]=this.width}if(this.borderStyle){e["borderStyle"]=this.borderStyle}return i("button",{key:"f8105a4e08d60af62e77185726b2d67f8378ad2a",class:Object.keys(t).filter((e=>t[e])).join(" "),style:e,disabled:this.disabled,type:"button"},this.loading&&i("span",{key:"713aaf3ed2e05e933e3813128146cad481179055",class:"loading-icon"}),this.icon&&!this.loading&&i("span",{key:"f680ccc5a0481c8c2eddaef84497475426eba8fb",class:"button-icon"},i("img",{key:"888b1a7ba7427a91f4c53732ba4583e3cc68fbe5",src:this.icon,alt:""})),i("slot",{key:"1ee6ce028c10949dd2d0bc761c52b9e01d8fc673"}))}};et.style=tt;const ot=":host{display:block}.loading-container,.error-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:200px;width:100%;color:#86909C;font-size:14px;text-align:center}.loading-spinner{width:32px;height:32px;border:3px solid #f3f3f3;border-top:3px solid #1677FF;border-radius:50%;margin-bottom:12px;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.error-icon{width:32px;height:32px;background-color:#FFF0F0;color:#F53F3F;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:bold;margin-bottom:12px}.error-message{color:#86909C;max-width:80%}.card-container{border-radius:8px;padding:16px;cursor:pointer;transition:all 0.2s ease;display:flex;flex-direction:column;background-color:#ffffff;border:1px solid #E5E6EB;position:relative;height:100%;min-width:300px}.card-container:hover{transform:translateY(-2px);box-shadow:0 4px 16px rgba(0, 21, 41, 0.08)}.card-header{display:flex;width:100%;padding-bottom:16px;gap:12px}.card-icon{width:64px;height:64px;margin-right:12px;flex-shrink:0;overflow:hidden;border-radius:2px;background-color:#f8f9fa}.card-icon img{width:100%;height:100%;object-fit:contain}.card-info{flex:1;display:flex;flex-direction:column;overflow:hidden}.title-row{display:flex;align-items:center}.title-wrapper{flex:1;margin-right:8px;overflow:hidden}.card-title{font-size:18px;font-weight:700;color:#1D2129;line-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%}.chat-tag{display:flex;align-items:center;justify-content:center;height:24px;padding:0 8px;background-color:#F2F7E8;color:#56961F;font-size:12px;border-radius:4px;font-weight:500;flex-shrink:0}.author-row{display:flex;align-items:center;margin-top:8px}.author-avatar{width:16px;height:16px;border-radius:50%;margin-right:4px;background-color:#f8f9fa;overflow:hidden}.author-name{font-size:12px;color:#86909C}.card-description{font-size:12px;color:#86909C;margin-top:8px;line-height:18px;height:54px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:pre-line;word-break:break-word}.card-footer{padding-top:16px;display:flex;justify-content:space-between;align-items:center;border-top:1px solid #E5E6EB}.stats-container{display:flex;align-items:center;flex:1}.stat-item{display:flex;align-items:center;margin-right:8px;color:#86909C}.stat-icon{width:16px;height:16px;margin-right:4px;background-repeat:no-repeat;background-position:center;background-size:contain}.user-icon{background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' focusable='false' aria-hidden='true'%3E%3Cpath d='M12 14c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6Zm0-10C9.8 4 8 5.8 8 8s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4Z' fill='currentColor'%3E%3C/path%3E%3Cpath d='M21.9 20.6c-.1-.2-2.3-5.6-9.9-5.6-7.6 0-9.8 5.4-9.9 5.6-.2.5 0 1.1.6 1.3.5.2 1.1 0 1.3-.5 0-.2 1.8-4.4 8-4.4s8 4.2 8.1 4.4c.2.5.8.8 1.3.5.5-.2.7-.8.5-1.3Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E\")}.star-icon{background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' focusable='false' aria-hidden='true'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 5.03 9.57 9.1c-.17.3-.46.5-.8.55l-4.3.79 3 3.46c.22.26.32.6.28.93l-.62 4.46 4.41-1.9c.3-.12.63-.12.92 0l4.4 1.9-.6-4.46c-.05-.34.05-.67.27-.93l3-3.46-4.3-.79a1.17 1.17 0 0 1-.8-.55L12 5.03Zm-1-2.46a1.16 1.16 0 0 1 2 0l3.03 5.07 5.51 1c.89.17 1.26 1.24.68 1.92l-3.8 4.4.77 5.71c.13.9-.78 1.6-1.61 1.23L12 19.5l-5.58 2.4a1.17 1.17 0 0 1-1.61-1.23l.78-5.7-3.8-4.4a1.17 1.17 0 0 1 .67-1.92l5.51-1L11 2.56Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E\")}.video-icon{background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' focusable='false' aria-hidden='true'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4 2a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H4Zm0 2h16v16H4V4Zm5.5 3.13A1 1 0 0 0 8 8v8a1 1 0 0 0 1.5.87l7-4a1 1 0 0 0 0-1.74l-7-4ZM13.98 12 10 14.28V9.72L13.98 12Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E\")}.stat-value{font-size:12px}.use-button{font-size:12px;color:#86909C;cursor:pointer;white-space:nowrap}.use-button:hover{color:#1677FF}@media screen and (max-width: 768px){.card-container{padding:12px}.card-header{gap:8px;padding-bottom:12px}.card-icon{width:48px;height:48px}.card-title{font-size:16px;line-height:20px}.card-description{font-size:12px;line-height:16px;height:48px}}";const it=class{constructor(o){t(this,o);this.tokenInvalid=e(this,"tokenInvalid")}token;cardTitle="";description="";iconUrl="";author="";authorAvatarUrl="";showChatTag=false;customChatTag="";useButtonText="立即使用";botId="";botData=null;loading=false;error="";tokenInvalid;tokenInvalidListener;watchBotIdHandler(t){if(t){this.fetchBotData()}}handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}componentWillLoad(){if(this.token){n.setToken(this.token)}if(this.botId){this.fetchBotData()}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener)}async fetchBotData(){if(!this.botId)return;this.loading=true;this.error="";try{const t=await d({url:`/sdk/v1/agent/${this.botId}/info`,method:"GET"});if(t.success&&t.data){this.botData=t.data}else{throw new Error(t.message||"获取智能体信息失败")}}catch(t){this.error=t.message||"获取智能体信息失败";console.error("获取智能体信息失败:",t)}finally{this.loading=false}}render(){const t=this.cardTitle||(this.botData?.title||"");const e=this.description||(this.botData?.description||"");const o=this.botData?.icon||this.botData?.iconUrl||this.botData?.logo||"";const n=this.iconUrl||o;const r=this.author||(this.botData?.author_name||"");const s=this.authorAvatarUrl||(this.botData?.author_avatar||"");const a=this.customChatTag||(this.botData?.flag||"");const l=this.botData?.use_count||0;const d=this.botData?.follow_count||0;const c=this.botData?.view_count||0;return i("div",{key:"686774ebe2a5e2942c7e41d73a9fd8ae8e427f5d",class:"card-container"},this.loading?i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("div",null,"加载中...")):this.error?i("div",{class:"error-container"},i("div",{class:"error-icon"},"!"),i("div",{class:"error-message"},this.error)):i("div",null,i("div",{class:"card-header"},n&&i("div",{class:"card-icon"},i("img",{src:n,alt:t})),i("div",{class:"card-info"},i("div",{class:"title-row"},i("div",{class:"title-wrapper"},i("div",{class:"card-title"},t)),this.showChatTag&&a&&i("div",{class:"chat-tag"},a)),r&&i("div",{class:"author-row"},s&&i("img",{class:"author-avatar",src:s,alt:r}),i("div",{class:"author-name"},r)),e&&i("div",{class:"card-description"},e))),i("div",{class:"card-footer"},i("div",{class:"stats-container"},i("div",{class:"stat-item"},i("span",{class:"stat-icon user-icon"}),i("div",{class:"stat-value"},l)),i("div",{class:"stat-item"},i("span",{class:"stat-icon star-icon"}),i("div",{class:"stat-value"},d)),i("div",{class:"stat-item"},i("span",{class:"stat-icon video-icon"}),i("div",{class:"stat-value"},c))),i("div",{class:"use-button"},this.useButtonText||"立即使用"))))}static get watchers(){return{botId:["watchBotIdHandler"],token:["handleTokenChange"]}}};it.style=ot;function nt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}var rt;var st;function at(){if(st)return rt;st=1;function t({interruptPatterns:t=[],skipEmptyRows:i=true}={}){return{extensions:[{name:"spanTable",level:"block",start(t){return t.match(/\n *([^\n ].*\|.*)\n/m)?.index},tokenizer(e,n){let r="^ *([^\\n ].*\\|.*\\n(?: *[^\\s].*\\n)*?)"+" {0,3}(?:\\| *)?(:?-+(?: *(?:100|[1-9][0-9]?%) *-+)?:? *(?:\\| *:?-+(?: *(?:100|[1-9][0-9]?%) *-+)?:? *)*)(?:\\| *)?"+"(?:\\n((?:(?! *\\n| {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})"+"(?:\\n+|$)| {0,3}#{1,6}(?:\\s|$)| {0,3}>| {4}[^\\n]| {0,3}(?:`{3,}"+"(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n| {0,3}(?:[*+-]|1[.)]) |"+"<\\/?(?:address|article|aside|base|basefont|blockquote|body"+"|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt"+"|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]"+"|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem"+"|meta|nav|noframes|ol|optgroup|option|p|param|section|source"+"|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)"+"(?: +|\\n|\\/?>)|<(?:script|pre|style|textarea|!--)endRegex).*(?:\\n|$))*)\\n*|$)";r=r.replace("endRegex",t.map((t=>`|(?:${t})`)).join(""));const s=/ *(?:100|[1-9][0-9]?%) */g;const a=new RegExp(r);const l=a.exec(e);if(l){const t={type:"spanTable",header:l[1].replace(/\n$/,"").split("\n"),align:l[2].replace(s,"").replace(/^ *|\| *$/g,"").split(/ *\| */),rows:l[3]?.trim()?l[3].replace(/\n[ \t]*$/,"").split("\n"):[],width:l[2].replace(/:/g,"").replace(/-+| /g,"").split("|")};t.header[0]=o(t.header[0]);const e=t.header[0].reduce(((t,e)=>t+e.colspan),0);if(e===t.align.length){t.raw=l[0];let n,r,s,a;let d=t.align.length;for(n=0;n<d;n++){if(/^ *-+: *$/.test(t.align[n])){t.align[n]="right"}else if(/^ *:-+: *$/.test(t.align[n])){t.align[n]="center"}else if(/^ *:-+ *$/.test(t.align[n])){t.align[n]="left"}else{t.align[n]=null}}d=t.header.length;for(n=1;n<d;n++){t.header[n]=o(t.header[n],e,t.header[n-1],i)}d=t.rows.length;for(n=0;n<d;n++){t.rows[n]=o(t.rows[n],e,t.rows[n-1],i)}d=t.header.length;for(r=0;r<d;r++){a=t.header[r];for(s=0;s<a.length;s++){a[s].tokens=[];this.lexer.inline(a[s].text,a[s].tokens)}}d=t.rows.length;for(r=0;r<d;r++){a=t.rows[r];for(s=0;s<a.length;s++){a[s].tokens=[];this.lexer.inline(a[s].text,a[s].tokens)}}return t}}},renderer(t){let o,i,n,r,s,a;let l="<table>";l+="<thead>";for(o=0;o<t.header.length;o++){n=t.header[o];let s=0;l+="<tr>";for(i=0;i<n.length;i++){r=n[i];a=this.parser.parseInline(r.tokens);l+=e(a,r,"th",t.align[s],t.width[s]);s+=r.colspan}l+="</tr>"}l+="</thead>";if(t.rows.length){l+="<tbody>";for(o=0;o<t.rows.length;o++){n=t.rows[o];s=0;if(!n[0].emptyRow){l+="<tr>";for(i=0;i<n.length;i++){r=n[i];a=this.parser.parseInline(r.tokens);l+=e(a,r,"td",t.align[s],t.width[s]);s+=r.colspan}l+="</tr>"}}l+="</tbody>"}l+="</table>";return l}}]}}const e=(t,e,o,i,n)=>{if(!e.rowspan){return""}const r=`<${o}`+`${e.colspan>1?` colspan=${e.colspan}`:""}`+`${e.rowspan>1?` rowspan=${e.rowspan}`:""}`+`${i?` align=${i}`:""}`+`${n?` width=${n}`:""}>`;return`${r+t}</${o}>\n`};const o=(t,e,o=[],i)=>{const n=[...t.trim().matchAll(/(?:[^|\\]|\\.?)+(?:\|+|$)/g)].map((t=>t[0]));if(!n[0]?.trim()){n.shift()}if(!n[n.length-1]?.trim()){n.pop()}let r=0;let s,a,l,d,c;for(s=0;s<n.length;s++){l=n[s].split(/\|+$/)[0];n[s]={rowspan:1,colspan:Math.max(n[s].length-l.length,1),text:l.trim().replace(/\\\|/g,"|")};if(l.slice(-1)==="^"&&o.length){c=0;for(a=0;a<o.length;a++){d=o[a];if(c===r&&d.colspan===n[s].colspan){n[s].rowSpanTarget=d.rowSpanTarget??d;n[s].rowSpanTarget.text+=` ${n[s].text.slice(0,-1)}`;n[s].rowSpanTarget.rowspan+=1;n[s].rowspan=0;break}c+=d.colspan;if(c>r){break}}}r+=n[s].colspan}if(n.length>0&&i&&n.length===n.filter((t=>t.rowspan===0)).length){n[0].emptyRow=true;for(s=0;s<n.length;s++){n[s].rowSpanTarget.rowspan-=1}}if(r>e){n.splice(e)}else{while(r<e){n.push({rowspan:1,colspan:1,text:""});r+=1}}return n};rt=t;return rt}var lt=at();var dt=nt(lt);const ct='.markdown-body{--base-size-4:4px;--base-size-8:8px;--base-size-16:16px;--base-size-24:24px;--base-size-40:40px;--base-text-weight-normal:400;--base-text-weight-medium:500;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fgColor-accent:Highlight}@media (prefers-color-scheme: dark){.markdown-body,[data-theme="dark"]{color-scheme:dark;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}@media (prefers-color-scheme: light){.markdown-body,[data-theme="light"]{color-scheme:light;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{width:16px;height:16px;content:\' \';display:inline-block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none !important}.markdown-body a{background-color:transparent;color:var(--fgColor-accent);text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dfn{font-style:italic}.markdown-body h1{margin:.67em 0;font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.markdown-body sub{bottom:-0.25em}.markdown-body sup{top:-0.5em}.markdown-body img{border-style:none;max-width:100%;box-sizing:content-box}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;overflow:hidden;background:transparent;border-bottom:1px solid var(--borderColor-muted);height:.25em;padding:0;margin:var(--base-size-24) 0;background-color:var(--borderColor-default);border:0}.markdown-body input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{-webkit-appearance:button;appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button,.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button,.markdown-body [type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr::before{display:table;content:""}.markdown-body hr::after{display:table;clear:both;content:""}.markdown-body table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:solid 1px transparent}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{display:inline-block;padding:var(--base-size-4);font:11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);line-height:10px;color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);border-radius:6px;box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted)}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold, 600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.2em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body h3{font-weight:var(--base-text-weight-semibold, 600);font-size:1.05em}.markdown-body h4{font-weight:var(--base-text-weight-semibold, 600);font-size:0.875em}.markdown-body h5{font-weight:var(--base-text-weight-semibold, 600);font-size:.85em}.markdown-body h6{font-weight:var(--base-text-weight-semibold, 600);font-size:.80em;color:var(--fgColor-muted)}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{margin:0;padding:0 1em;color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default)}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{margin-top:0;margin-bottom:0;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px;word-wrap:normal}.markdown-body .octicon{display:inline-block;overflow:visible !important;vertical-align:text-bottom;fill:currentColor}.markdown-body input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button{margin:0;appearance:none}.markdown-body .mr-2{margin-right:var(--base-size-8, 8px) !important}.markdown-body::before{display:table;content:""}.markdown-body::after{display:table;clear:both;content:""}.markdown-body>*:first-child{margin-top:0 !important}.markdown-body>*:last-child{margin-bottom:0 !important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16);font-size:16px;font-weight:400}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{padding:0 .2em;font-size:inherit}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{padding-bottom:0;border-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type="a s"]{list-style-type:lower-alpha}.markdown-body ol[type="A s"]{list-style-type:upper-alpha}.markdown-body ol[type="i s"]{list-style-type:lower-roman}.markdown-body ol[type="I s"]{list-style-type:upper-roman}.markdown-body ol[type="1"]{list-style-type:decimal}.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid var(--borderColor-default)}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:transparent}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid var(--borderColor-default)}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:var(--fgColor-default)}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em .4em;margin:0;font-size:85%;white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:transparent;border:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);overflow:auto;font-size:85%;line-height:1.45;color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold, 600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]::before{content:"["}.markdown-body [data-footnote-ref]::after{content:"]"}.markdown-body .footnotes{font-size:12px;color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default)}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{display:inline-block;padding-left:var(--base-size-16);margin-top:var(--base-size-16)}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target::before{position:absolute;top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body body:has(:modal){padding-right:var(--dialog-scrollgutter) !important}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{font-weight:bold;color:var(--color-prettylights-syntax-string-regexp)}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{font-weight:bold;color:var(--color-prettylights-syntax-markup-heading)}.markdown-body .pl-mi{font-style:italic;color:var(--color-prettylights-syntax-markup-italic)}.markdown-body .pl-mb{font-weight:bold;color:var(--color-prettylights-syntax-markup-bold)}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{font-weight:bold;color:var(--color-prettylights-syntax-meta-diff-range)}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{text-decoration:underline;color:var(--color-prettylights-syntax-constant-other-reference-link)}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){outline:none;box-shadow:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{display:inline-block;min-width:1ch;font-family:"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1em;font-style:normal !important;font-weight:var(--base-text-weight-normal, 400);line-height:1;vertical-align:-0.075em}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal, 400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{margin:0 .2em .25em -1.4em;vertical-align:middle}.markdown-body ul:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body ol:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{display:block;width:auto;height:24px;overflow:visible;clip:auto}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{display:flex;font-weight:var(--base-text-weight-medium, 500);align-items:center;line-height:1}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>*:first-child>.heading-element:first-child{margin-top:0 !important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}';const ht=":host{display:block;width:100%}.message-round{margin-bottom:16px;width:100%}.user-message-container{display:flex;flex-direction:row-reverse;align-items:flex-start;margin-bottom:15px;position:relative}.assistant-message-container{display:flex;flex-direction:row;align-items:flex-start;margin-bottom:15px;position:relative}.message-bubble{max-width:85%;position:relative}.user-message{padding:5px 10px;background:#f5f7ff;font-size:14px;color:#1F2328;border-radius:6px;box-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.1)}.assistant-message{padding:15px 10px;background-color:#fff;border-radius:6px;font-size:14px;color:#1F2328;box-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.05)}.message-time{font-size:12px;color:#999;margin-top:4px}.user-message-container .message-time{color:rgba(255, 255, 255, 0.7)}.loading-dots{display:flex;align-items:center;padding:12px 16px;background-color:#f0f0f0;border-radius:18px;border-top-left-radius:4px}.loading-dots span{width:8px;height:8px;margin:0 3px;background-color:#999;border-radius:50%;display:inline-block;animation:dot-pulse 1.5s infinite ease-in-out}.loading-dots span:nth-child(2){animation-delay:0.2s}.loading-dots span:nth-child(3){animation-delay:0.4s}@keyframes dot-pulse{0%,80%,100%{transform:scale(0.8);opacity:0.5}40%{transform:scale(1.2);opacity:1}}.file-view{margin-top:8px;padding:12px;background-color:#f8f9fa;border:1px solid #e9ecef;border-radius:6px;font-size:14px;word-break:break-all;color:#2c3e50;line-height:1.5;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05)}.input-view{margin-top:8px;margin-bottom:10px;padding-bottom:10px;border:1px solid #e9ecef;border-radius:6px;overflow:hidden;background-color:#ffffff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05)}.input-label-container{display:flex;align-items:center;margin-bottom:4px;background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:8px 12px}.copy-input-button{background:transparent;border:none;cursor:pointer;padding:2px;display:flex;align-items:center;justify-content:center;color:#8c8c8c;opacity:0.7;transition:opacity 0.2s ease;margin-left:5px}.copy-input-button:hover{opacity:1;color:#1677ff}.input-label{font-size:13px;font-weight:600;color:#495057}.input-value{padding:12px 12px 0px;font-size:14px;line-height:1.5;color:#2c3e50;background-color:#ffffff;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.input-metadata{font-size:13px;margin-top:8px}.message-actions{display:flex;align-items:center;gap:8px;transition:opacity 0.2s ease;margin-top:15px}.action-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #d9d9d9;border-radius:6px;padding:4px 15px;font-size:14px;height:32px;background-color:white;cursor:pointer;color:rgba(0, 0, 0, 0.88);transition:all 0.2s}.action-button:hover{color:#1677ff;border-color:#1677ff}.action-button.primary{color:#1677ff;border-color:#1677ff}.action-button.primary:hover{color:#4096ff;border-color:#4096ff}.action-button.icon-only{padding:4px 8px;margin-right:9px}.button-icon{margin-right:8px;display:flex;align-items:center;justify-content:center}.icon-only .button-icon{margin-right:0}.file-list{display:flex;flex-wrap:wrap;gap:12px;margin-top:8px}.file-item{display:flex;flex-direction:column;align-items:center;width:80px;cursor:pointer;padding:8px;border-radius:4px;transition:background-color 0.3s;margin:5px 10px}.file-item:hover{background-color:rgba(0, 0, 0, 0.04)}.file-icon{margin-bottom:4px}.file-name{font-size:12px;text-align:center;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8B4513}.action-button.active{color:#1677ff;background-color:rgba(22, 119, 255, 0.1)}.action-button.active .button-icon svg{stroke:#1677ff}.inputs-container{margin-top:8px;display:flex;flex-direction:column;gap:8px}.file-list{display:flex;flex-direction:column;gap:8px}.file-item{display:flex;align-items:center;padding:8px 12px;background-color:#f5f5f5;border-radius:6px;cursor:pointer;transition:background-color 0.2s}.file-item:hover{background-color:#e8e8e8}.file-icon{margin-right:8px}.file-name{font-size:14px;color:#333;word-break:break-word}.input-view{background-color:#f9f9f9;border-radius:8px;padding:12px;border:1px solid #e8e8e8}.input-label-container{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.input-label{font-weight:500;color:#333}.input-value{color:#666;line-height:1.5;word-break:break-word;max-height:200px;overflow-y:auto}.copy-input-button{background:none;border:none;cursor:pointer;color:#1677ff;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center}.copy-input-button:hover{background-color:rgba(22, 119, 255, 0.1)}.input-metadata{font-size:14px;color:#666;padding:4px 0}.file-card{display:flex;align-items:center;padding:12px;background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 200px 100px no-repeat, #fff;border-radius:8px;cursor:pointer;transition:background-color 0.2s;border:1px solid #e8e8e8;margin-top:8px}.file-card:hover{background-color:#f0f0f0}.file-card-icon{margin-right:12px;flex-shrink:0;border-radius:12px;background:#0d75fb;width:48px;height:48px;display:flex;align-items:center;justify-content:center}.file-card-icon img{width:40px;height:40px}.file-card-content{display:flex;flex-direction:column;flex:1;min-width:0}.file-card-type{font-size:14px;color:#8c8c8c;margin-bottom:4px}.file-card-name{font-size:16px;font-weight:500;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.copy-card-button{background:none;border:none;cursor:pointer;color:#8c8c8c;padding:8px;border-radius:4px;display:flex;align-items:center;justify-content:center;margin-left:8px;transition:color 0.2s}.copy-card-button:hover{color:#1677ff}.avatar{width:32px;height:32px;border-radius:50%;overflow:hidden;flex-shrink:0}.avatar img{width:100%;height:100%;object-fit:cover}.user-avatar{margin-left:8px}.assistant-avatar{margin-right:8px}.retry-button{background-color:#ff6b35 !important;color:white !important;border:none !important}.retry-button:hover{background-color:#e55a2b !important}.retry-button .button-icon{margin-right:4px}.video-inputs-container{display:flex;flex-direction:column;align-items:end}.video-container{margin-top:0px;border-radius:8px;overflow:hidden;box-shadow:0 2px 8px rgba(0, 0, 0, 0.1);background-color:#000;width:250px;height:auto;max-height:250px;transition:transform 0.2s ease, box-shadow 0.2s ease}.video-container:hover{transform:translateY(-2px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.15)}.video-container video{display:block;width:100%;max-width:500px;height:auto;border-radius:8px}.video-container video:focus{outline:none}.video-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;background-color:#f8f9fa;border-radius:8px;color:#666;font-size:14px}.loading-spinner{width:24px;height:24px;border:2px solid #e9ecef;border-top:2px solid #1677ff;border-radius:50%;animation:spin 1s linear infinite;margin-bottom:12px}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@media (max-width: 768px){.video-container{width:100%;max-width:300px}}";const pt=class{message;showFeedbackButtons=true;botId;messageChange;get hostElement(){return o(this)}feedbackStatus=null;videoUrls={};userAvatar;assistantAvatar;showCopyButton=true;filePreviewMode="window";filePreviewRequest;retryRequest;constructor(o){t(this,o);this.messageChange=e(this,"messageChange");this.filePreviewRequest=e(this,"filePreviewRequest");this.retryRequest=e(this,"retryRequest");G.use(dt);G.setOptions({breaks:true,gfm:true})}componentWillLoad(){if(this.message&&this.message.feedback){this.feedbackStatus=this.message.feedback.rating}}copyMessageContent(){if(this.message.answer){navigator.clipboard.writeText(this.message.answer).then((()=>{alert("内容已复制到剪贴板")})).catch((t=>{m.emitError({error:t,message:"复制内容失败"});console.error("复制失败:",t)}))}}renderUserMessage(){if(!this.message?.query?.trim())return null;const t=this.message.query?G(this.message.query):"";return i("div",{class:{"user-message-container":true}},this.userAvatar&&i("div",{class:"avatar user-avatar"},i("img",{src:this.userAvatar,alt:"用户头像"})),i("div",{class:"message-bubble user-message"},i("div",{innerHTML:t}),this.renderInputs()))}renderAssistantMessage(){if(!this.message.answer&&!this.message.isStreaming)return null;const t=this.message.isStreaming&&!this.message.answer;const e=this.message.answer?G(this.message.answer):"";return i("div",{class:{"assistant-message-container":true}},this.assistantAvatar&&i("div",{class:"avatar assistant-avatar"},i("img",{src:this.assistantAvatar,alt:"助手头像"})),i("div",{class:"message-bubble "},i("div",{class:"assistant-message"},i("div",{class:"markdown-content markdown-body",innerHTML:t?`请稍等...`:e})),!t&&this.message.answer&&!this.message.isStreaming&&i("div",{class:"message-actions"},this.message.showRetryButton&&i("button",{class:"action-button retry-button",onClick:()=>this.handleRetry(),title:"重试"},i("span",{class:"button-icon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("polyline",{points:"23 4 23 10 17 10"}),i("polyline",{points:"1 20 1 14 7 14"}),i("path",{d:"M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"}))),"重试"),this.showCopyButton&&i("button",{class:"action-button",onClick:()=>this.copyMessageContent(),title:"复制内容"},i("span",{class:"button-icon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),i("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))),"复制"),this.showFeedbackButtons&&i(i.Fragment,null,i("button",{class:`action-button icon-only ${this.feedbackStatus==="like"?"active":""}`,title:"赞",onClick:()=>this.handleLike()},i("span",{class:"button-icon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"})))),i("button",{class:`action-button icon-only ${this.feedbackStatus==="dislike"?"active":""}`,title:"踩",onClick:()=>this.handleDislike()},i("span",{class:"button-icon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("path",{d:"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"}))))))))}getFileName(t){const e=t.split("/");return e[e.length-1]}handleContentClick(t,e,o="text"){this.filePreviewRequest.emit({fileName:t,content:e,contentType:o})}async loadVideoUrl(t){if(this.videoUrls[t]){return}const e=await p(t);if(e){this.videoUrls={...this.videoUrls,[t]:e}}}async handleFileClick(t,e){const o=await u(t);if(o){if(this.filePreviewMode==="drawer"){this.filePreviewRequest.emit({url:o,fileName:e,contentType:"file"})}else{window.open(o,"_blank")}}else{console.error("无法获取预览URL");f.captureError("无法获取预览URL",{action:"handleFileClick",component:"pcm-chat-message",title:"无法获取预览URL"});m.emitError({error:"无法获取预览URL",message:"无法获取预览URL"})}}renderFileItem(t,e,o){return i("div",{key:o,class:"file-card",onClick:()=>this.handleFileClick(e,t)},i("div",{class:"file-card-icon",style:{background:"linear-gradient(45deg, #ff5600, #ff8344)"}},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_file.png"})),i("div",{class:"file-card-content"},i("div",{class:"file-card-type"},"[附件信息]"),i("div",{class:"file-card-name"},t)))}renderInputs(){if(!this.message.inputs)return null;const t=Object.keys(this.message.inputs).some((t=>{const e=this.message.inputs[t];return e!==null&&e!==undefined&&e!==""&&!t.startsWith("hide_")&&t!=="answer"}));if(!t)return null;return i("div",{class:"inputs-container"},Object.keys(this.message.inputs).map(((t,e)=>{const o=this.message.inputs[t];if(o&&!t.startsWith("hide_")&&t!=="answer"){if(t==="video_url"){const t=o;const n=this.videoUrls[t];if(!n){this.loadVideoUrl(t)}return i("div",{class:"video-inputs-container"},i("div",{key:e,class:"video-container"},n?i("video",{key:t,controls:true,preload:"metadata",onLoadedMetaData:t=>{const e=t.target;e.currentTime=.01},controlsList:"nodownload",style:{width:"250px",height:"auto",maxHeight:"250px",borderRadius:"8px",marginTop:"8px"}},i("source",{src:n,type:"video/webm"}),i("source",{src:n,type:"video/mp4"}),i("source",{src:n,type:"video/ogg"}),"您的浏览器不支持视频播放。"):i("div",{class:"video-loading"},i("div",{class:"loading-spinner"}),i("span",null,"正在加载视频..."))))}else if(t==="file_url"){const t=this.message.inputs.file_name||this.getFileName(o);return this.renderFileItem(t,o,e)}else if(t==="file_urls"){const t=typeof o==="string"?o.split(","):[o.toString()];const n=this.message.inputs.file_names?typeof this.message.inputs.file_names==="string"?this.message.inputs.file_names.split(","):[this.message.inputs.file_names.toString()]:[];return i("div",{key:e},t.map(((t,e)=>{const o=n[e]||this.getFileName(t);return this.renderFileItem(o,t,e)})))}else if(t==="job_info"||t==="rule"){const n=t==="job_info"?"职位信息":"评估规则";const r=typeof o==="string"?o:JSON.stringify(o,null,2);return i("div",{key:e,class:"file-card",onClick:()=>this.handleContentClick(n,r)},i("div",{class:"file-card-icon",style:{background:"#0d75fb"}},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_position.png"})),i("div",{class:"file-card-content"},i("div",{class:"file-card-type"},"[",n,"]"),i("div",{class:"file-card-name"},r.length>50?r.substring(0,50)+"...":r)))}else if(t==="input"){return i("div",{key:e,class:"input-metadata"},`${o}`)}}return null})))}async handleLike(){const t=this.feedbackStatus==="like"?null:"like";await this.submitFeedback(t)}async handleDislike(){const t=this.feedbackStatus==="dislike"?null:"dislike";await this.submitFeedback(t)}async submitFeedback(t){if(!this.message.id){console.error("消息ID不存在,无法提交反馈");f.captureError("消息ID不存在,无法提交反馈",{action:"submitFeedback",component:"pcm-chat-message",title:"无法提交反馈"});m.emitError({error:"消息ID不存在,无法提交反馈",message:"消息ID不存在,无法提交反馈"});return}try{const e=await d({url:`/sdk/v1/chat/messages/${this.message.id}/feedbacks`,method:"POST",data:{rating:t,bot_id:this.botId,content:""}});if(e.success){this.feedbackStatus=t;if(this.message&&this.message.feedback){this.message={...this.message,feedback:{...this.message.feedback,rating:t}}}}else{console.error("反馈提交失败:",e.message)}}catch(t){console.error("提交反馈时发生错误:",t);f.captureError(t,{action:"submitFeedback",component:"pcm-chat-message",title:"提交反馈失败"})}}handleRetry(){if(this.message.id){this.retryRequest.emit(this.message.id)}}render(){return i("div",{key:"5a0c434cc297b60f94398c681145ac8922d0fc70",class:"message-round"},this.renderUserMessage(),this.renderAssistantMessage())}};pt.style=ct+ht;const ut=":host{display:block}.drawer-container{position:fixed;top:0;left:0;width:0;height:0;overflow:visible}.drawer-mask{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.45);opacity:0;visibility:hidden;transition:opacity 0.3s ease, visibility 0.3s ease}.mask-visible{opacity:1;visibility:visible}.drawer-content{position:fixed;top:0;right:0;bottom:0;display:flex;flex-direction:column;background-color:#fff;box-shadow:-2px 0 8px rgba(0, 0, 0, 0.15);transform:translateX(100%);transition:transform 0.3s cubic-bezier(0.23, 1, 0.32, 1)}.drawer-content-visible{transform:translateX(0)}.drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;color:rgba(0, 0, 0, 0.85);border-bottom:1px solid #f0f0f0}.drawer-title{flex:1;margin:0;font-size:16px;line-height:22px;font-weight:500;color:rgba(0, 0, 0, 0.85);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drawer-close{padding:0;background:transparent;border:none;outline:none;cursor:pointer;font-size:16px;color:rgba(0, 0, 0, 0.45);transition:color 0.3s}.drawer-close:hover{color:rgba(0, 0, 0, 0.85)}.drawer-body{flex:1;padding:24px;overflow:auto}@media (max-width: 768px){.drawer-content{width:100% !important}.drawer-header{padding:12px 16px}.drawer-body{padding:16px}}";const mt=class{constructor(o){t(this,o);this.closed=e(this,"closed");this.afterOpen=e(this,"afterOpen");this.afterClose=e(this,"afterClose")}isOpen=false;drawerTitle="";width="378px";height="378px";closable=true;maskClosable=true;mask=true;closed;afterOpen;afterClose;get hostElement(){return o(this)}zIndex=1e3;bodyOverflowBeforeOpen="";transitionEndHandler;async open(){this.isOpen=true}async close(){this.isOpen=false}visibleChanged(t){if(t){this.bodyOverflowBeforeOpen=document.body.style.overflow;document.body.style.overflow="hidden";const t=this.hostElement.shadowRoot.querySelector(".drawer-content");if(t){this.transitionEndHandler=()=>{this.afterOpen.emit()};t.addEventListener("transitionend",this.transitionEndHandler,{once:true})}}else{document.body.style.overflow=this.bodyOverflowBeforeOpen;const t=this.hostElement.shadowRoot.querySelector(".drawer-content");if(t){this.transitionEndHandler=()=>{this.afterClose.emit()};t.addEventListener("transitionend",this.transitionEndHandler,{once:true})}}}componentWillLoad(){const t=r.getItem("modal-zIndex");if(t){this.zIndex=t}}disconnectedCallback(){if(this.isOpen){document.body.style.overflow=this.bodyOverflowBeforeOpen}const t=this.hostElement.shadowRoot?.querySelector(".drawer-content");if(t&&this.transitionEndHandler){t.removeEventListener("transitionend",this.transitionEndHandler)}}handleMaskClick=()=>{if(this.maskClosable){this.handleClose()}};handleClose=()=>{this.isOpen=false;this.closed.emit()};render(){const t={width:this.width,zIndex:`${this.zIndex+1}`};const e={zIndex:`${this.zIndex}`};return i("div",{key:"c0c12a379d5ebfa0dd3cc3d1bbdc3ac758a5006f",class:{"drawer-container":true,"drawer-open":this.isOpen}},this.mask&&i("div",{key:"01a6db65de08dd54fbc1a52efeda576e6f71f4ae",class:{"drawer-mask":true,"mask-visible":this.isOpen},style:e,onClick:this.handleMaskClick}),i("div",{key:"121cb9463b12c9ff287e1890c03281dd69d074a9",class:{"drawer-content":true,"drawer-content-visible":this.isOpen},style:t},i("div",{key:"839536eb87451599dafdda11185935f51b59ce03",class:"drawer-header"},this.drawerTitle&&i("div",{key:"f02c896b38f2e089687f0baa96fea06f4303ebf0",class:"drawer-title"},this.drawerTitle),this.closable&&i("button",{key:"0ed699d106894d01242f105583860376f1228f48",class:"drawer-close",onClick:this.handleClose},i("svg",{key:"987102bc7f8fb3d86322a8d9029951db6cccb266",viewBox:"64 64 896 896",focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},i("path",{key:"b2e5ea93efbab2fe2a76ed59872144cdb4ee9f6a",d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"})))),i("div",{key:"d882ce5d71c4d2adeecab918a70a56b657e86b63",class:"drawer-body"},i("slot",{key:"9a822a390e1f2f20d287d29dbbbb0501b0989207"}))))}static get watchers(){return{isOpen:["visibleChanged"]}}};mt.style=ut;const ft=":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:800px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}@media screen and (max-width: 768px){.pc-layout{width:95%;}.modal-overlay{padding:0}.modal-container.fullscreen{height:-webkit-fill-available;max-height:-webkit-fill-available;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.placeholder-status p{font-size:16px}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-left div{font-size:16px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;min-height:200px;background:url(https://pcm-resource-1312611446.cos.ap-guangzhou.myqcloud.com/web/sdk/chat_bg.png);background-size:100%}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{background-color:#1890ff;color:white;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-weight:500}.send-button:disabled{background-color:#ccc;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#999;cursor:pointer;padding:4px 8px;font-size:16px;line-height:1;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f0f0f0;color:#666}.initial-upload{padding:16px;display:flex;flex-direction:column;align-items:center;height:100%}.upload-section{max-width:600px;width:100%;text-align:center}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px}.submit-button:disabled{background:#ccc;cursor:not-allowed}.submit-button:hover:not(:disabled){background:#40a9ff}.category-select,.dimension-select{margin:30px 0}.category-options,.dimension-options{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.category-button,.dimension-button{padding:12px 16px;border:1px solid #E5E5E5;border-radius:6px;background:white;cursor:pointer;transition:all 0.3s}.category-button:hover,.dimension-button:hover{background:#f5f5f5}.category-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.dimension-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;top:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:14px;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:16px;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:16px}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}";const gt=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.someErrorEvent=e(this,"someErrorEvent");this.interviewComplete=e(this,"interviewComplete");this.recordingError=e(this,"recordingError");this.recordingStatusChange=e(this,"recordingStatusChange");this.tokenInvalid=e(this,"tokenInvalid")}modalTitle="金牌HR大赛";token;isOpen=false;messages=[];modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return o(this)}streamComplete;conversationStart;someErrorEvent;selectedFile=null;isUploading=false;uploadedFileInfo=[];aiException=false;defaultQuery="请开始出题";showInitialUpload=true;selectedJobCategory="";jobCategories=["人力资源学生(实习)","人力资源专员","人力资源主管","人力资源经理","人力资源总监"];dimensions=["人力资源规划","招聘与配置","员工关系","培训与开发","薪酬与绩效","组织与人才发展"];selectedDimensions=[];isRecording=false;recordingStream=null;recordedBlob=null;mediaRecorder=null;recordingTimeLeft=0;showRecordingUI=false;recordingTimer=null;recordingStartTime=0;waitingToRecord=false;waitingTimer=null;waitingTimeLeft=15;videoRef=null;totalQuestions=2;currentQuestionNumber=0;interviewComplete;SCROLL_THRESHOLD=20;maxRecordingTime=120;countdownWarningTime=30;showCountdownWarning=false;toEmail="";callbackUrl="";fullscreen=false;isUploadingVideo=false;requireResume=false;isPlayingAudio=false;audioUrl=null;audioElement=null;recordingError;recordingStatusChange;tokenInvalid;enableVoice=true;enableAudio=true;displayContentStatus=true;isTaskCompleted=false;tokenInvalidListener;isUserScrolling=false;isPageFocused=true;isWindowVisible=true;visibilityChangeListener;blurListener;focusListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener);this.visibilityChangeListener=()=>{const t=!document.hidden;this.isWindowVisible=t;if(!t){f.captureMessage("用户失去焦点 - 页面隐藏",{action:"visibilityChange",component:"pcm-hr-chat-modal",type:"visibility_hidden",timestamp:Date.now(),isRecording:this.isRecording,currentQuestionNumber:this.currentQuestionNumber,conversationId:this.conversationId})}};this.blurListener=()=>{this.isPageFocused=false;f.captureMessage("用户失去焦点 - 窗口失焦",{action:"windowBlur",component:"pcm-hr-chat-modal",type:"window_blur",timestamp:Date.now(),isRecording:this.isRecording,currentQuestionNumber:this.currentQuestionNumber,conversationId:this.conversationId})};this.focusListener=()=>{this.isPageFocused=true};document.addEventListener("visibilitychange",this.visibilityChangeListener);window.addEventListener("blur",this.blurListener);window.addEventListener("focus",this.focusListener)}handleClose=()=>{this.stopRecording();this.modalClosed.emit()};handleFileChange=async t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};async uploadFile(){if(!this.selectedFile||this.uploadedFileInfo.length>0)return;this.isUploading=true;try{const t=await h(this.selectedFile,{},{tags:["resume"]});if(t){this.uploadedFileInfo=[{cos_key:t.cos_key,file_name:t.file_name,file_size:t.file_size,ext:t.ext}]}}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();this.someErrorEvent.emit({error:t,message:"文件上传失败,请重试"});f.captureError(t,{action:"uploadFile",component:"pcm-hr-chat-modal",title:"文件上传失败"})}finally{this.isUploading=false}}handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=[];const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async sendMessageToAPI(t){this.isLoading=true;let e="";let o="";const i=new Date;const n=`${i.getHours()}:${i.getMinutes().toString().padStart(2,"0")}`;const r=t.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const s=this.messages.length>0?this.messages[this.messages.length-1]:null;if(s&&this.conversationId&&t!=="下一题"){this.saveAnswer(this.conversationId,s.answer,r)}const a=this.currentQuestionNumber>=this.totalQuestions&&t==="下一题";const d={id:`temp-${Date.now()}`,time:n,query:r,answer:"",isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=d;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);if(a){this.messages=[...this.messages,d];this.currentStreamingMessage=null;this.isLoading=false;this.currentQuestionNumber++;this.isTaskCompleted=true;await this.completeInterview();this.interviewComplete.emit({conversation_id:this.conversationId,total_questions:this.totalQuestions});return}const h={response_mode:"streaming",conversation_id:this.conversationId,query:r,bot_id:"3022316191018880"};h.inputs={job_info:this.selectedJobCategory,dimensional_info:this.selectedDimensions.join(","),email:this.toEmail,callback_url:this.callbackUrl,display_content_status:this.displayContentStatus?"1":"0"};if(this.uploadedFileInfo.length>0){const t=this.uploadedFileInfo.map((t=>t.cos_key)).join(",");h.inputs.file_urls=t}await l({url:"/sdk/v1/chat/chat-messages",method:"POST",data:h,onMessage:t=>{if(t.conversation_id&&!this.conversationId){this.conversationId=t.conversation_id;this.conversationStart.emit({conversation_id:t.conversation_id,event:t.event,message_id:t.message_id,id:t.id})}if(t.event==="node_finished"&&t.data.inputs&&t.data.inputs.LLMText){o=t.data.inputs.LLMText}if(t.event==="node_finished"&&t.data.title&&t.data.title.includes("异常请重试")){this.currentStreamingMessage.showRetryButton=true;this.aiException=true}if(t.event==="node_finished"&&t.data.title&&t.data.title.includes("题号赋值")){this.currentQuestionNumber=t.data.process_data.questions_number-1}if(t.event==="message"){if(t.event==="agent_message"||t.event==="message"){if(t.answer){e+=t.answer;const o={...this.currentStreamingMessage,answer:e,isStreaming:true};this.currentStreamingMessage=o;setTimeout((()=>{this.scrollToBottom()}),200)}}}if(t.event==="message_end"){this.streamComplete.emit({conversation_id:t.conversation_id||"",event:t.event,message_id:t.message_id,id:t.id})}},onError:e=>{console.error("发生错误:",e);this.someErrorEvent.emit({error:e,message:"消息发送失败,请稍后再试"});f.captureError(e,{action:"sendMessageToAPI",component:"pcm-hr-chat-modal",message:t,title:"消息发送失败"});this.messages=[...this.messages,{...d,answer:"抱歉,发生了错误,请稍后再试。",error:e,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const t=this.currentStreamingMessage;t.isStreaming=false;this.currentStreamingMessage=null;this.messages=[...this.messages,t];if(!this.aiException){if(this.enableAudio&&t&&t.answer){const e=o||t.answer;if(e){const t=await c(e);if(this.enableVoice){await this.playAudio(t);this.startWaitingToRecord()}else{this.audioUrl=t}}}else if(!this.enableAudio){this.startWaitingToRecord()}}}})}async saveAnswer(t,e,o){try{await d({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:t,question:e,answer:o}})}catch(e){console.error("保存答案失败:",e);this.someErrorEvent.emit({error:e,message:"保存答案失败,请稍后再试"});f.captureError(e,{action:"saveAnswer",component:"pcm-hr-chat-modal",conversationId:t,title:"保存答案失败"})}}handleScroll=()=>{if(this.isUserScrolling){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!t)return;const{scrollTop:e,scrollHeight:o,clientHeight:i}=t;const n=o-e-i;this.shouldAutoScroll=n<=this.SCROLL_THRESHOLD}};handleTouchStart=()=>{this.isUserScrolling=true};handleTouchEnd=()=>{setTimeout((()=>{this.isUserScrolling=false}),100)};_wheelTimer=null;handleWheel=()=>{this.isUserScrolling=true;if(this._wheelTimer){clearTimeout(this._wheelTimer)}this._wheelTimer=setTimeout((()=>{this.isUserScrolling=false}),150)};scrollToBottom(){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t&&this.isOpen){t.scrollTop=t.scrollHeight}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;let t=false;try{const e=await d({url:`/sdk/v1/hr_competition/${this.conversationId}`,method:"GET"});if(e.success&&e.data&&e.data.ended==1){t=true}const o=await d({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:"3022316191018880",limit:20}});if(o.success&&o.data){const t=o.data.data||[];const e=t.map((t=>{const e=new Date(t.created_at*1e3);const o=e.getHours().toString().padStart(2,"0");const i=e.getMinutes().toString().padStart(2,"0");const n=`${o}:${i}`;const{inputs:r,...s}=t;return{...s,time:n,isStreaming:false,status:t.status==="error"?"error":"normal"}}));this.messages=e;const i=e.filter((t=>!(t.answer&&(t.answer.includes("请求超时")||t.answer.includes("网络有点拥堵")||t.status==="error"))));this.currentQuestionNumber=i.length>0?i.length:0}}catch(t){console.error("加载历史消息或面试状态失败:",t);this.someErrorEvent.emit({error:t,message:"加载历史消息失败,请刷新重试"});f.captureError(t,{action:"loadHistoryMessages",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"加载历史消息失败"})}finally{this.isLoadingHistory=false;setTimeout((async()=>{this.shouldAutoScroll=true;this.scrollToBottom();if(this.conversationId&&this.messages.length>0&&!t){const t=this.messages[this.messages.length-1];if(t&&t.answer&&this.enableAudio){const e=await c(t.answer);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}else if(!this.enableAudio){this.startWaitingToRecord()}else{this.sendMessageToAPI("下一题")}}else if(t){this.currentQuestionNumber++;this.isTaskCompleted=true;setTimeout((()=>{this.interviewComplete.emit()}),100)}}),300)}}async handleIsOpenChange(t){if(t){await s(this.token);if(this.conversationId){this.showInitialUpload=false;await this.loadHistoryMessages()}}}handleJobCategorySelect=t=>{this.selectedJobCategory=t};handleDimensionSelect=t=>{if(this.selectedDimensions.includes(t)){this.selectedDimensions=this.selectedDimensions.filter((e=>e!==t))}else{this.selectedDimensions=[...this.selectedDimensions,t]}};handleInitialSubmit=async()=>{if(this.requireResume&&!this.selectedFile){alert("请上传简历");return}if(!this.selectedJobCategory){alert("请选择职能类别");return}if(this.selectedDimensions.length===0){alert("请至少选择一个关注模块");return}if(this.requireResume){await this.uploadFile();if(this.uploadedFileInfo.length===0){return}}this.showInitialUpload=false;const t=`我是一名${this.selectedJobCategory},请您开始提问`;this.sendMessageToAPI(t)};startWaitingToRecord(){if(this.waitingTimer){clearInterval(this.waitingTimer)}if(this.recordingTimer){clearInterval(this.recordingTimer)}this.waitingToRecord=true;this.waitingTimeLeft=15;this.waitingTimer=setInterval((()=>{this.waitingTimeLeft--;if(this.waitingTimeLeft<=0){clearInterval(this.waitingTimer);this.waitingTimer=null;this.waitingToRecord=false;this.startRecording()}}),1e3)}async startRecording(){try{const t=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.recordingStream=t;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(t);const e=this.getSupportedMimeType();let o;try{o=new MediaRecorder(t,{mimeType:e,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(e){console.warn("指定的MIME类型不受支持,使用默认设置:",e);try{o=new MediaRecorder(t,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(e){try{o=new MediaRecorder(t)}catch(t){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:t});this.showRecordingUI=false;return}}}this.mediaRecorder=o;const i=[];o.ondataavailable=t=>{if(t.data.size>0){i.push(t.data)}};o.onerror=t=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:t});this.stopRecording()};o.onstop=()=>{try{const t=e||"video/mp4";const o=new Blob(i,{type:t});if(o.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=o;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:o.size,type:o.type}});this.uploadRecordedVideo()}catch(t){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:t});this.showRecordingUI=false;f.captureError(t,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{o.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:o.mimeType}})}catch(t){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:t});this.showRecordingUI=false;f.captureError(t,{action:"startRecording",component:"pcm-hr-chat-modal",title:"开始录制失败"});return}this.recordingTimer=setInterval((()=>{const t=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-t);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(t){console.error("无法访问摄像头或麦克风:",t);this.showRecordingUI=false;this.recordingError.emit({type:"media_access_failed",message:"无法访问摄像头或麦克风,请确保已授予权限",details:t});f.captureError(t,{action:"startRecording",component:"pcm-hr-chat-modal",title:"无法访问摄像头或麦克风"})}}setupVideoPreview(t){setTimeout((()=>{const e=this.hostElement.shadowRoot?.querySelector("video");if(e&&t){try{e.srcObject=t;e.play().catch((t=>{console.error("视频播放失败:",t);this.someErrorEvent.emit({error:t,message:"视频播放失败"});f.captureError(t,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"录制视频显示失败"})}))}catch(o){console.warn("设置srcObject失败,尝试替代方法:",o);try{const o=URL.createObjectURL(t);e.src=o;e.onended=()=>{URL.revokeObjectURL(o)}}catch(t){console.error("创建对象URL失败:",t);this.someErrorEvent.emit({error:t,message:"创建对象URL失败"});f.captureError(t,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"创建对象URL失败"})}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const t=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const e of t){if(!e)return"";try{if(MediaRecorder.isTypeSupported(e)){return e}}catch(t){console.warn(`检查MIME类型支持时出错 ${e}:`,t)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""}stopRecording(){if(this.mediaRecorder&&this.isRecording){this.mediaRecorder.stop();this.isRecording=false;if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.recordingStream){this.recordingStream.getTracks().forEach((t=>t.stop()));this.recordingStream=null}this.videoRef=null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const t=this.recordedBlob.type.includes("webm")?"webm":"mp4";const e=`answer.${t}`;const o=new File([this.recordedBlob],e,{type:this.recordedBlob.type});const i=await h(o,{},{tags:["other"]});if(i){await this.saveVideoAnswer(i.cos_key);this.sendMessageToAPI("下一题")}else{throw new Error("视频上传失败")}}catch(t){console.error("视频上传错误:",t);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:t});f.captureError(t,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"视频上传失败"})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}async saveVideoAnswer(t){if(!this.conversationId)return;try{const e=this.messages.length>0?this.messages[this.messages.length-1]:null;if(!e)return;await d({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:this.conversationId,question:e.answer,file_url:t}})}catch(t){console.error("保存视频答案失败:",t);this.someErrorEvent.emit({error:t,message:"保存视频答案失败"});f.captureError(t,{action:"saveVideoAnswer",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"保存视频答案失败"})}}async completeInterview(){if(!this.conversationId)return;try{await d({url:`/sdk/v1/hr_competition/${this.conversationId}/end`,method:"POST"})}catch(t){console.error("发送面试完成请求失败:",t);this.someErrorEvent.emit({error:t,message:"发送面试完成请求失败"});f.captureError(t,{action:"completeInterview",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"发送面试完成请求失败"})}}playAudio(t){return new Promise((e=>{this.isPlayingAudio=true;this.audioUrl=t;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=t;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;e()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:"音频播放错误",message:"音频播放错误"});f.captureMessage("音频播放错误",{action:"playAudio",component:"pcm-hr-chat-modal",title:"音频播放错误"});e()};this.audioElement.play().catch((t=>{console.error("音频播放失败:",t);this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:t,message:"音频播放失败"});f.captureError(t,{title:"音频播放失败",action:"playAudio",component:"pcm-hr-chat-modal"});e()}))}))}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.audioElement){this.audioElement.pause();this.audioElement.src="";this.audioElement=null}if(this.audioUrl){URL.revokeObjectURL(this.audioUrl);this.audioUrl=null}if(this.waitingTimer){clearInterval(this.waitingTimer);this.waitingTimer=null}if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}this.stopRecording();if(this.visibilityChangeListener){document.removeEventListener("visibilitychange",this.visibilityChangeListener)}if(this.blurListener){window.removeEventListener("blur",this.blurListener)}if(this.focusListener){window.removeEventListener("focus",this.focusListener)}}handlePlayAudio=async()=>{if(this.audioUrl){await this.playAudio(this.audioUrl);this.startWaitingToRecord()}};handleRetryRequest=t=>{const e=this.messages.find((e=>e.id===t));if(e){this.aiException=false;const o=this.messages.map((e=>e.id===t?{...e,showRetryButton:false}:e));this.messages=o;this.sendMessageToAPI(e.query)}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=()=>i("div",{class:"video-preview"},i("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:t=>{if(t&&this.recordingStream&&!this.videoRef){this.videoRef=t}}}),i("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},i("span",{class:"recording-dot"}),i("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const r=()=>{if(this.isTaskCompleted){return i("div",{class:"placeholder-status"},i("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return i("div",{class:"placeholder-status"},i("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return i("div",{class:"placeholder-status"},i("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return i("div",{class:"placeholder-status"},i("p",null,"请等待题目..."))}if(this.waitingToRecord){return i("div",{class:"placeholder-status"},i("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return i("div",{class:"placeholder-status default-status"},i("p",null,"准备中..."))};return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),this.showInitialUpload?i("div",{class:"initial-upload"},i("div",{class:"upload-section"},this.requireResume&&i(i.Fragment,null,i("h3",null,"开始前,请上传您的简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),i("div",{class:"category-select"},i("h3",null,"请选择您的职能类别(单选)"),i("div",{class:"category-options"},this.jobCategories.map((t=>i("button",{class:{"category-button":true,selected:this.selectedJobCategory===t},onClick:()=>this.handleJobCategorySelect(t)},t))))),i("div",{class:"dimension-select"},i("h3",null,"请选择关注的模块(可多选)"),i("div",{class:"dimension-options"},this.dimensions.map((t=>i("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(t)},onClick:()=>this.handleDimensionSelect(t)},t))))),i("button",{class:"submit-button",disabled:this.requireResume&&!this.selectedFile||!this.selectedJobCategory||this.selectedDimensions.length===0||this.requireResume&&this.isUploading,onClick:this.handleInitialSubmit},this.requireResume&&this.isUploading?"上传中...":"开始面试")),this.requireResume&&i("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):i("div",{style:{height:"100%"}},i("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",null,"加载历史消息中...")):i("div",null,this.messages.map((t=>i("div",{id:`message_${t.id}`,key:t.id},i("pcm-chat-message",{message:t,onRetryRequest:t=>this.handleRetryRequest(t.detail),showCopyButton:false,showFeedbackButtons:false,onMessageChange:e=>{const o=this.messages.map((o=>o.id===t.id?{...o,...e.detail}:o));this.messages=o}})))),this.currentStreamingMessage&&i("div",{id:`message_${this.currentStreamingMessage.id}`},i("pcm-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&i("div",{class:"empty-state"},i("p",null,"请上传简历开始面试")))),i("div",{class:"recording-section"},i("div",{class:"recording-container"},i("div",{class:"video-area"},this.showRecordingUI?n():i("div",{class:"video-preview placeholder"},r())),i("div",{class:"progress-container"},i("div",{class:"progress-bar-container"},i("div",{class:"progress-bar",style:{width:`${Math.max(0,this.currentQuestionNumber-1)/this.totalQuestions*100}%`}})),i("div",{class:"progress-text"},"已完成",Math.max(0,this.currentQuestionNumber-1),"/",this.totalQuestions)),i("div",{class:"recording-controls"},this.showRecordingUI?i("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):i("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return i("div",{class:"play-audio-container",onClick:this.handlePlayAudio},i("p",null,i("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},i("path",{d:"M8 5v14l11-7z"})),i("span",{style:{verticalAlign:"middle"}},"播放题目")))}return i("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};gt.style=ft;const bt=".input-mode-toggle{display:flex;align-items:center;margin-bottom:16px}.input-mode-toggle span{color:#333;margin-right:12px}.toggle-button{display:flex;align-items:center;background:none;border:none;color:#2E6EDF;cursor:pointer;font-size:14px;padding:4px 8px}.toggle-button svg{margin-right:4px}.free-input{width:100%}.textarea-container{margin-bottom:16px}.textarea-container label{display:block;margin-bottom:8px;font-weight:500;color:#333}.textarea-container textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;resize:vertical;background-color:#f9f9f9;min-height:150px;width:100%;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.textarea-container textarea:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.required{color:#f56c6c}.input-guide{background-color:#f5f7fa;border-radius:4px;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.guide-title{font-weight:500;color:#333;margin-bottom:8px}.guide-content{color:#666;font-size:13px;max-width:100%;word-wrap:break-word}.guide-content div{margin-bottom:4px}";const xt=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const wt=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="劳动合同卫士";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始分析";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}isSubmitting=false;inputMode="upload";freeInputText="";tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const t=await h(this.selectedFile,{},{tags:["other"]});this.uploadedFileInfo=t;this.uploadSuccess.emit(t)}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();f.captureError(t,{action:"uploadFile",component:"pcm-htws-modal",title:"文件上传失败"});m.emitError({error:t,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleToggleInput=()=>{this.inputMode=this.inputMode==="upload"?"free":"upload"};handleFreeInputChange=t=>{const e=t.target;this.freeInputText=e.value};handleStartInterview=async()=>{if(this.inputMode==="upload"&&!this.selectedFile){alert("请上传合同文件");return}if(this.inputMode==="free"&&!this.freeInputText.trim()){alert("请输入合同内容");return}this.isSubmitting=true;try{if(this.inputMode==="upload"){if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}}this.showChatModal=true}catch(t){console.error("开始分析时出错:",t);f.captureError(t,{action:"handleStartInterview",component:"pcm-htws-modal",title:"开始分析时出错"});m.emitError({error:t,message:"开始分析时出错,请重试"})}finally{this.isSubmitting=false}};async handleIsOpenChange(t){if(!t){this.clearSelectedFile();this.showChatModal=false;this.freeInputText="";this.inputMode="upload"}else{if(this.customInputs&&this.customInputs.input){this.inputMode="free";this.freeInputText=this.customInputs.input}await s(this.token);if(this.conversationId){this.showChatModal=true}}}render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&i("div",{class:"input-container"},i("div",{class:"input-mode-toggle"},i("span",null,"合同内容"),i("button",{class:"toggle-button",onClick:this.handleToggleInput},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})),"切换输入")),this.inputMode==="upload"&&i("div",{class:"resume-upload-section"},i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传合同"),i("p",{class:"upload-hint"},"支持markdown、pdf、docx、doc、md 格式")))),this.inputMode==="free"&&i("div",{class:"free-input"},i("div",{class:"textarea-container"},i("textarea",{id:"free-input-text",placeholder:"请输入合同内容",rows:8,value:this.freeInputText,onInput:this.handleFreeInputChange})),i("div",{class:"input-guide"},i("div",{class:"guide-title"},"输入提示:"),i("div",{class:"guide-content"},i("div",null,"• 请输入完整的劳动合同内容"),i("div",null,"• 包括甲方(公司)、乙方(员工)信息"),i("div",null,"• 合同期限、工作内容、工作地点"),i("div",null,"• 工作时间、休息休假、劳动报酬"),i("div",null,"• 社会保险、劳动保护、劳动条件"),i("div",null,"• 合同变更、解除和终止条件等")))),i("button",{class:"submit-button",disabled:this.inputMode==="upload"&&!this.selectedFile||this.inputMode==="free"&&!this.freeInputText.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018882",conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableVoice:false,filePreviewMode:this.filePreviewMode,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.inputMode==="upload"?this.uploadedFileInfo?.cos_key:undefined,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,input:this.inputMode==="free"?this.freeInputText:undefined},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};wt.style=bt+xt;const yt="";const kt=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const vt=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="会议总结助手";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始总结";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}async handleIsOpenChange(t){if(!t){this.clearSelectedFile();this.showChatModal=false}else{await s(this.token);if(this.conversationId||this.customInputs?.file_url){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const t=await h(this.selectedFile,{},{tags:["other"]});this.uploadedFileInfo=t;this.uploadSuccess.emit(t)}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();f.captureError(t,{action:"uploadFile",component:"pcm-hyzj-modal",title:"文件上传失败"});m.emitError({error:t,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleStartInterview=async()=>{if(!this.selectedFile){alert("请上传面试内容");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(t){console.error("开始面试时出错:",t);f.captureError(t,{action:"handleStartInterview",component:"pcm-hyzj-modal",title:"开始面试时出错"});m.emitError({error:t,message:"开始面试时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.file_url);return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!r&&i("div",{class:"input-container"},i("div",{class:"resume-upload-section"},i("label",null,"上传会议纪要"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传会议纪要"),i("p",{class:"upload-hint"},"支持 mp3、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!this.selectedFile||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018885",conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableVoice:false,filePreviewMode:this.filePreviewMode,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};vt.style=yt+kt;const Ct=".input-mode-toggle{display:flex;align-items:center;margin-bottom:16px}.input-mode-toggle span{color:#333;margin-right:12px}.toggle-button{display:flex;align-items:center;background:none;border:none;color:#2E6EDF;cursor:pointer;font-size:14px;padding:4px 8px}.toggle-button svg{margin-right:4px}.toggle-button:disabled{opacity:0.5;cursor:not-allowed}.structured-input{width:100%}.job-name-input{margin-bottom:20px}.job-name-input label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-name-input input{width:95%;padding:10px 12px;border:1px solid #ddd;border-radius:4px;font-size:14px;background-color:#f9f9f9}.job-name-input input:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.required{color:#f56c6c}.button-container{display:flex;justify-content:center;margin-top:24px;gap:12px;max-width:100%;box-sizing:border-box;flex-wrap:wrap}.next-button{background-color:#2E6EDF;color:white}.next-button:hover{background-color:#2457b8}.next-button:disabled{background-color:#a0c0e8;cursor:not-allowed}.prev-button{background-color:#f0f0f0 !important;color:#333 !important}.prev-button:hover{background-color:#e0e0e0}.tag-selection{width:100%}.tag-selection-content{width:100%}.section-title{font-weight:600;color:#333;margin-bottom:12px;font-size:16px}.ai-tags-section,.basic-tags-section{margin-bottom:24px}.tag-group{margin-bottom:16px}.tag-title{color:#555;margin-bottom:8px;font-weight:500}.tag-container{display:flex;flex-wrap:wrap;gap:8px;max-width:100%;box-sizing:border-box}.tag{display:inline-flex;align-items:center;padding:6px 12px;border-radius:4px;background-color:#f5f5f5;border:1px solid #e0e0e0;color:#333;font-size:13px;cursor:pointer;transition:all 0.2s;max-width:100%;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tag:hover{background-color:#e8e8e8}.tag-selected{background-color:#e6f0ff;border-color:#2E6EDF;color:#2E6EDF}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 0;background-color:#f9f9f9;border-radius:8px;margin:20px 0;max-width:100%;box-sizing:border-box}.loading-spinner{width:40px;height:40px;border:3px solid rgba(46, 110, 223, 0.2);border-radius:50%;border-top-color:#2E6EDF;animation:spin 1s linear infinite;margin-bottom:16px}@keyframes spin{to{transform:rotate(360deg)}}.loading-text{text-align:center;color:#333;font-weight:500}.loading-subtext{color:#888;font-size:14px;margin-top:4px}.free-input{width:100%}.textarea-container{margin-bottom:16px}.textarea-container label{display:block;margin-bottom:8px;font-weight:500;color:#333}.textarea-container textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;resize:vertical;background-color:#f9f9f9;min-height:150px;width:100%;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.textarea-container textarea:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.input-guide{background-color:#f5f7fa;border-radius:4px;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.guide-title{font-weight:500;color:#333;margin-bottom:8px}.guide-content{color:#666;font-size:13px;max-width:100%;word-wrap:break-word}.guide-content div{margin-bottom:4px}@media (max-width: 768px){.tag-container{gap:7px}.tag{padding:4px 8px;font-size:12px}}@media (max-width: 480px){.button-container{flex-direction:column;align-items:center}.next-button,.prev-button,.submit-button{width:100%;margin-bottom:8px}.tag{max-width:calc(50% - 8px)}}.tag-selection,.tag-selection-content,.ai-tags-section,.basic-tags-section,.structured-input,.free-input{max-width:100%;box-sizing:border-box}";const zt=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const _t=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="职位生成";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请帮我生成职位信息";fullscreen=false;customInputs={};showWorkspaceHistory=false;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";showChatModal=false;get hostElement(){return o(this)}inputMode="structured";step="input";jobName="";freeInputText="";isLoading=false;isSubmitting=false;tagGroups=[];shuffledTagGroups=[];selectedAITags={};selectedTags={salary:"",benefits:[],education:""};tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}salaryRanges=[{text:"3k-5k",value:"3k_5k"},{text:"5k-8k",value:"5k_8k"},{text:"8k-12k",value:"8k_12k"},{text:"12k-15k",value:"12k_15k"},{text:"15k-20k",value:"15k_20k"},{text:"20k以上",value:"above_20k"}];benefits=[{text:"五险一金",value:"五险一金"},{text:"年终奖",value:"年终奖"},{text:"带薪年假",value:"带薪年假"},{text:"加班补贴",value:"加班补贴"},{text:"餐补",value:"餐补"},{text:"交通补贴",value:"交通补贴"},{text:"节日福利",value:"节日福利"},{text:"团队建设",value:"团队建设"}];educationRequirements=[{text:"大专",value:"大专"},{text:"本科",value:"本科"},{text:"硕士",value:"硕士"},{text:"博士",value:"博士"},{text:"学历不限",value:"学历不限"}];handleClose=()=>{this.modalClosed.emit()};handleToggleInput=()=>{this.inputMode=this.inputMode==="structured"?"free":"structured"};handleJobNameChange=t=>{const e=t.target;this.jobName=e.value};handleFreeInputChange=t=>{const e=t.target;this.freeInputText=e.value};handleNextStep=async()=>{if(!this.jobName.trim()){alert("请输入职位名称");return}this.step="review";await this.handlePositionAnalysis(this.jobName)};handlePrevStep=()=>{this.step="input"};async handlePositionAnalysis(t){if(!t.trim())return;this.isLoading=true;try{const e=await d({url:"/sdk/v1/chat/workflow/block-run",method:"POST",data:{inputs:{input_info:t},workflow_code:"generate_jd_tags"}});if(e.success&&e.data?.data.outputs?.text){try{const t=JSON.parse(e.data.data.outputs.text);this.tagGroups=t.tagGroup||[];const o={};const i=(t.tagGroup||[]).map((t=>{const e=[...t.defaultTags||[],...t.optionalTags||[]];for(let t=e.length-1;t>0;t--){const o=Math.floor(Math.random()*(t+1));[e[t],e[o]]=[e[o],e[t]]}if(t.defaultTags&&t.defaultTags.length>0){o[t.dimensionName]=[...t.defaultTags]}return{dimensionName:t.dimensionName,tags:e}}));this.shuffledTagGroups=i;this.selectedAITags=o}catch(t){f.captureError(t,{action:"handlePositionAnalysis",component:"pcm-jd-modal",title:"解析前置标签时错误"});m.emitError({error:t,message:"解析前置标签时错误"})}}}catch(t){console.error("工作流运行错误:",t)}finally{this.isLoading=false}}handleTagClick=(t,e)=>{if(t==="benefits"){const t=[...this.selectedTags.benefits];const o=t.includes(e)?t.filter((t=>t!==e)):[...t,e];this.selectedTags={...this.selectedTags,benefits:o}}else{this.selectedTags={...this.selectedTags,[t]:this.selectedTags[t]===e?"":e}}};handleAITagClick=(t,e)=>{const o=this.selectedAITags[t]||[];const i=o.includes(e)?o.filter((t=>t!==e)):[...o,e];this.selectedAITags={...this.selectedAITags,[t]:i}};handleSubmitStructured=async()=>{this.isSubmitting=true;try{let t="";if(this.selectedTags.salary){const e=this.salaryRanges.find((t=>t.value===this.selectedTags.salary));if(e){t=e.text}}const e=this.selectedTags.benefits.join("、");let o="";if(this.selectedTags.education){const t=this.educationRequirements.find((t=>t.value===this.selectedTags.education));if(t){o=t.text}}let i=`职位名称:${this.jobName}\n`;if(t){i+=`薪资范围:${t}\n`}if(e){i+=`福利待遇:${e}\n`}if(o){i+=`学历要求:${o}\n`}Object.entries(this.selectedAITags).forEach((([t,e])=>{if(e.length>0){i+=`${t}:${e.join("、")}\n`}}));this.showChatModal=true;this.jobDescription=i}catch(t){console.error("提交结构化数据时出错:",t);f.captureError(t,{action:"handleSubmitStructured",component:"pcm-jd-modal",title:"提交数据时出错"});m.emitError({error:t,message:"提交数据时出错,请重试"})}finally{this.isSubmitting=false}};handleSubmitFree=async()=>{if(!this.freeInputText.trim()){alert("请输入职位需求信息");return}this.isSubmitting=true;try{this.jobDescription=this.freeInputText;this.showChatModal=true}catch(t){console.error("提交自由输入数据时出错:",t);f.captureError(t,{action:"handleSubmitFree",component:"pcm-jd-modal",title:"提交数据时出错"});m.emitError({error:t,message:"提交数据时出错,请重试"})}finally{this.isSubmitting=false}};jobDescription="";async handleIsOpenChange(t){if(!t){this.showChatModal=false;this.jobDescription="";this.jobName="";this.freeInputText="";this.step="input";this.inputMode="structured";this.tagGroups=[];this.shuffledTagGroups=[];this.selectedAITags={};this.selectedTags={salary:"",benefits:[],education:""}}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info;this.inputMode="free";this.freeInputText=this.customInputs.job_info}await s(this.token);if(this.conversationId){this.showChatModal=true}}}renderTagGroup(t,e,o){return i("div",{class:"tag-group"},i("div",{class:"tag-title"},t),i("div",{class:"tag-container"},e.map((t=>{const e=o==="benefits"?this.selectedTags.benefits.includes(t.value):this.selectedTags[o]===t.value;return i("div",{class:{tag:true,"tag-selected":e},onClick:()=>this.handleTagClick(o,t.value)},t.text)}))))}renderAITagGroups(){return i("div",{class:"ai-tag-groups"},this.shuffledTagGroups.map((t=>i("div",{class:"tag-group"},i("div",{class:"tag-title"},t.dimensionName),i("div",{class:"tag-container"},t.tags.map((e=>{const o=(this.selectedAITags[t.dimensionName]||[]).includes(e);return i("div",{class:{tag:true,"tag-selected":o},onClick:()=>this.handleAITagClick(t.dimensionName,e)},e)})))))))}renderLoadingState(){return i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("div",{class:"loading-text"},i("div",null,"AI 正在分析职位信息"),i("div",{class:"loading-subtext"},"请稍候...")))}render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&true&&i("div",{class:"input-container"},i("div",{class:"input-mode-toggle"},i("span",null,"职位需求信息"),i("button",{class:"toggle-button",onClick:this.handleToggleInput,disabled:this.isLoading},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})),"切换输入")),this.inputMode==="structured"&&i("div",{class:"structured-input"},this.step==="input"&&i("div",{class:"job-name-input"},i("label",{htmlFor:"job-name"},"职位名称 ",i("span",{class:"required"},"*")),i("input",{id:"job-name",type:"text",placeholder:"请输入职位名称",value:this.jobName,onInput:this.handleJobNameChange,disabled:this.isLoading}),i("div",{class:"button-container"},i("button",{class:"submit-button next-button",onClick:this.handleNextStep,disabled:!this.jobName.trim()||this.isLoading},"下一步"))),this.step==="review"&&i("div",{class:"tag-selection"},this.isLoading?this.renderLoadingState():i("div",{class:"tag-selection-content"},this.tagGroups.length>0&&i("div",{class:"ai-tags-section"},i("div",{class:"section-title"},"AI 推荐标签"),this.renderAITagGroups()),this.tagGroups.length>0&&i("div",{class:"basic-tags-section"},this.renderTagGroup("月薪范围",this.salaryRanges,"salary"),this.renderTagGroup("福利待遇",this.benefits,"benefits"),this.renderTagGroup("学历要求",this.educationRequirements,"education")),i("div",{class:"button-container"},i("button",{class:"submit-button prev-button",onClick:this.handlePrevStep},"上一步"),i("button",{class:"submit-button",onClick:this.handleSubmitStructured,disabled:this.isSubmitting},this.isSubmitting?"处理中...":"生成JD"))))),this.inputMode==="free"&&i("div",{class:"free-input"},i("div",{class:"textarea-container"},i("label",{htmlFor:"free-input-text"},"JD信息 ",i("span",{class:"required"},"*")),i("textarea",{id:"free-input-text",placeholder:"请按照下方提示格式输入职位需求信息",rows:8,value:this.freeInputText,onInput:this.handleFreeInputChange})),i("div",{class:"input-guide"},i("div",{class:"guide-title"},"输入格式参考:"),i("div",{class:"guide-content"},i("div",null,"• 职位名称 - 明确定义职位的名称"),i("div",null,"• 薪资范围 - 明确该岗位的月薪或年薪"),i("div",null,"• 福利待遇 - 该职位的福利待遇,如:五险一金、年休假、下午茶等"),i("div",null,"• 工作职责 - 描述工作内容"),i("div",null,"• 任职资格 - 包括学历、经验和技术要求"),i("div",null,"• 工作地点与性质 - 全职/兼职、远程/办公室"))),i("div",{class:"button-container"},i("button",{class:"submit-button",onClick:this.handleSubmitFree,disabled:!this.freeInputText.trim()||this.isSubmitting},this.isSubmitting?"处理中...":"生成JD"))),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018873",conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableVoice:false,filePreviewMode:this.filePreviewMode,customInputs:this.conversationId?{}:{...this.customInputs,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};_t.style=Ct+zt;const It="";const jt=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const St=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="简历剖析助手";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始分析";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;jobDescription="";isSubmitting=false;get hostElement(){return o(this)}tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}async handleIsOpenChange(t){if(!t){this.clearSelectedFile();this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if(this.conversationId||this.customInputs?.file_url&&this.customInputs?.job_info){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};handleJobDescriptionChange=t=>{const e=t.target;this.jobDescription=e.value};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const t=await h(this.selectedFile,{},{tags:["resume"]});this.uploadedFileInfo=t;this.uploadSuccess.emit(t)}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();f.captureError(t,{action:"uploadFile",component:"pcm-jlpp-modal",title:"文件上传失败"});m.emitError({error:t,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleStartAnalysis=async()=>{if(!this.selectedFile){alert("请上传简历");return}if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(t){console.error("开始分析时出错:",t);f.captureError(t,{action:"handleStartAnalysis",component:"pcm-jlpp-modal",title:"开始分析时出错"});m.emitError({error:t,message:"开始分析时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&this.customInputs.file_url);const a=Boolean(this.customInputs?.file_url&&this.customInputs?.job_info);return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!s&&!this.selectedFile||!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartAnalysis},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableTTS:false,filePreviewMode:this.filePreviewMode,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018881",customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};St.style=It+jt;const Mt="";const Tt=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Ft=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="面试出题大师";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始出题";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}async handleIsOpenChange(t){if(!t){this.clearSelectedFile();this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if(this.conversationId||this.customInputs?.file_url&&this.customInputs?.job_info){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const t=await h(this.selectedFile,{},{tags:["resume"]});this.uploadedFileInfo=t;this.uploadSuccess.emit(t)}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();f.captureError(t,{action:"uploadFile",component:"pcm-mnct-modal",title:"文件上传失败"});m.emitError({error:t,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleJobDescriptionChange=t=>{const e=t.target;this.jobDescription=e.value};handleStartInterview=async()=>{if(!this.selectedFile){alert("请上传简历");return}if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(t){console.error("开始面试时出错:",t);f.captureError(t,{action:"handleStartInterview",component:"pcm-mnct-modal",title:"开始面试时出错"});m.emitError({error:t,message:"开始面试时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&this.customInputs.file_url);const a=Boolean(this.customInputs?.file_url&&this.customInputs?.job_info);return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!s&&!this.selectedFile||!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018876",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,enableVoice:false,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};Ft.style=Mt+Tt;const Et="";const $t=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const At=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent");this.recordingError=e(this,"recordingError")}modalTitle="模拟面试";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始模拟面试";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";interviewMode="text";recordingError;showCopyButton=true;showFeedbackButtons=true;selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}async handleIsOpenChange(t){if(!t){this.clearSelectedFile();this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if((this.customInputs?.file_url||this.customInputs?.resume_content)&&this.customInputs?.job_info||this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const t=await h(this.selectedFile,{},{tags:["resume"]});this.uploadedFileInfo=t;this.uploadSuccess.emit(t)}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();f.captureError(t,{action:"uploadFile",component:"pcm-mnms-modal",title:"文件上传失败"});m.emitError({error:t,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleJobDescriptionChange=t=>{const e=t.target;this.jobDescription=e.value};handleStartInterview=async()=>{const t=Boolean(this.customInputs&&(this.customInputs.file_url||this.customInputs.resume_content));if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;try{if(!t&&this.selectedFile&&!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(t){console.error("开始面试时出错:",t);f.captureError(t,{action:"handleStartInterview",component:"pcm-mnms-modal",title:"开始面试时出错"});m.emitError({error:t,message:"开始面试时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&(this.customInputs.file_url||this.customInputs.resume_content));const a=Boolean((this.customInputs?.file_url||this.customInputs?.resume_content)&&this.customInputs?.job_info);return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("div",{class:"resume-upload-section"},i("label",null,"上传简历(选填)"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018884",conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableTTS:false,filePreviewMode:this.filePreviewMode,showCopyButton:this.showCopyButton,showFeedbackButtons:this.showFeedbackButtons,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription,resume_content:this.customInputs?.resume_content},interviewMode:this.interviewMode}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};At.style=Et+$t;const Rt="";const Bt=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Dt=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="面试报告";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始分析";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}async handleIsOpenChange(t){if(!t){this.clearSelectedFile();this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if(this.conversationId||this.customInputs?.file_urls&&this.customInputs?.job_info){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const t=await h(this.selectedFile,{},{tags:["other"]});this.uploadedFileInfo=t;this.uploadSuccess.emit(t)}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();f.captureError(t,{action:"uploadFile",component:"pcm-msbg-modal",title:"文件上传失败"});m.emitError({error:t,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleJobDescriptionChange=t=>{const e=t.target;this.jobDescription=e.value};handleStartInterview=async()=>{if(!this.selectedFile){alert("请上传面试内容");return}if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(t){console.error("开始面试时出错:",t);f.captureError(t,{action:"handleStartInterview",component:"pcm-msbg-modal",title:"开始面试时出错"});m.emitError({error:t,message:"开始面试时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&this.customInputs.file_urls);const a=Boolean(this.customInputs?.file_urls&&this.customInputs?.job_info);return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("div",{class:"resume-upload-section"},i("label",null,"上传面试内容"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传面试内容"),i("p",{class:"upload-hint"},"支持 mp3、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!s&&!this.selectedFile||!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018877",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,enableVoice:false,customInputs:this.conversationId?{}:{...this.customInputs,file_urls:this.customInputs?.file_urls||this.uploadedFileInfo?.cos_key,file_names:this.customInputs?.file_names||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};Dt.style=Rt+Bt;const Lt="";const Ht=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Ot=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="千岗千简历";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始出题";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return o(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}async handleIsOpenChange(t){if(!t){this.clearSelectedFile();this.showChatModal=false;this.jobDescription=""}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}await s(this.token);if(this.conversationId||this.customInputs?.file_url&&this.customInputs?.job_info){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const t=await h(this.selectedFile,{},{tags:["resume"]});this.uploadedFileInfo=t;this.uploadSuccess.emit(t)}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();f.captureError(t,{action:"uploadFile",component:"pcm-qgqjl-modal",title:"文件上传失败"});m.emitError({error:t,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleJobDescriptionChange=t=>{const e=t.target;this.jobDescription=e.value};handleStartInterview=async()=>{if(!this.selectedFile){alert("请上传简历");return}if(!this.customInputs?.job_info&&!this.jobDescription.trim()){alert("请输入职位描述");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(t){console.error("开始面试时出错:",t);f.captureError(t,{action:"handleStartInterview",component:"pcm-qgqjl-modal",title:"开始面试时出错"});m.emitError({error:t,message:"开始面试时出错,请重试"})}finally{this.isSubmitting=false}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.job_info);const s=Boolean(this.customInputs&&this.customInputs.file_url);const a=Boolean(this.customInputs?.file_url&&this.customInputs?.job_info);return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!a&&i("div",{class:"input-container"},!r&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),i("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange})),!s&&i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!s&&!this.selectedFile||!r&&!this.jobDescription.trim()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"45444431062634496",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,enableVoice:false,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};Ot.style=Lt+Ht;const Pt=":host{display:block;font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000;-webkit-overflow-scrolling:touch;}.fullscreen-overlay{padding:0;position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background:white;border-radius:8px;width:100%;max-width:900px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-container{background-image:url(https://pub.pincaimao.com/static/web/images/login/bg_login_m.png);background-size:100%;height:100%;border-radius:0px 0px 8px 8px}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;height:400px}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{width:38px;height:38px;border-radius:16px;background:#0d75fb;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color 0.2s ease}.send-button img{width:24px;height:24px}.send-button:hover{background:#0a62d6}.send-button.disabled{background:#d9d9d9;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:10px 20px 0px 20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;top:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:14px;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:16px;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:16px}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}.text-input-area{display:flex;flex-direction:column;width:100%;height:100%;padding:0px 16px 16px 16px;border-radius:8px;border:none;}.text-answer-input{flex:1;min-height:80px;padding:12px 12px 0px 12px;border:1px solid #ddd;border-radius:8px 8px 0 0;resize:none;font-size:16px;background-color:#fff;border-bottom:none;outline:none;}.input-toolbar{display:flex;justify-content:end;align-items:center;padding:8px 12px;background-color:#fff;border:1px solid #ddd;border-top:none;border-radius:0 0 8px 8px}.text-answer-input:focus{border-color:rgb(74, 144, 226);border-bottom:none}.text-answer-input:focus+.input-toolbar{border-color:rgb(74, 144, 226);border-top:none}.toolbar-actions{width:32px;height:32px;display:flex;justify-content:center;align-items:center;margin-right:10px;border:1px solid #d9d9d9;border-radius:6px}.toolbar-actions:hover{background-color:#f0f0f0}.toolbar-button{background:transparent;border:none;color:#666;cursor:pointer;padding:0;margin:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.toolbar-button>div,.toolbar-button>svg{display:flex;justify-content:center;align-items:center}.toolbar-button img{width:16px;height:16px}.submit-text-button{padding:6px 16px;background-color:#4a90e2;color:white;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:background-color 0.2s}.submit-text-button:hover:not(.disabled){background-color:#3a7bc8}.submit-text-button.disabled{background-color:#b3b3b3;cursor:not-allowed}.toolbar-button.recording{background-color:rgba(255, 0, 0, 0.1);color:#ff3b30;animation:pulse 1.5s infinite}.toolbar-button.converting{background-color:rgba(0, 122, 255, 0.1);color:#007aff}.toolbar-button .recording-time{font-size:12px;margin-left:4px}.converting-indicator{display:flex;justify-content:center;align-items:center}.converting-indicator svg{animation:spin 1.5s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(255, 0, 0, 0.4)}70%{box-shadow:0 0 0 6px rgba(255, 0, 0, 0)}100%{box-shadow:0 0 0 0 rgba(255, 0, 0, 0)}}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.references-section{margin-top:30px;padding:12px;background-color:#f9f9f9;border-radius:8px;border:1px solid #e8e8e8}.references-title{font-size:14px;color:#666;margin:0 0 8px 0;font-weight:500}.references-list{display:flex;flex-direction:column;gap:8px}.reference-item{background-color:#fff;border:1px solid #e8e8e8;border-radius:6px;padding:10px;cursor:pointer;transition:background-color 0.2s, box-shadow 0.2s}.reference-item:hover{background-color:#f5f5f5;box-shadow:0 2px 8px rgba(0, 0, 0, 0.1)}.reference-header{display:flex;align-items:center;gap:6px;position:relative}.reference-icon{color:#1890ff;display:flex;align-items:center}.reference-name{font-size:13px;font-weight:500;color:#333;flex:1}.download-icon{color:#1890ff;display:flex;align-items:center}.reference-content{display:none}.suggested-questions{margin-top:20px;padding:12px;background-color:#f0f7ff;border-radius:8px;border:1px solid #d6e8ff}.suggested-title{font-size:14px;color:#1890ff;margin:0 0 8px 0;font-weight:500}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#fff;border:1px solid #e6f7ff;border-radius:6px;cursor:pointer;font-size:14px;color:#1890ff;transition:all 0.3s;margin-bottom:8px}.suggested-question:last-child{margin-bottom:0}.suggested-question:hover{background-color:#e6f7ff;border-color:#91d5ff}.arrow-right{color:#1890ff;display:flex;align-items:center}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e6f7ff;border-top-color:#1890ff;border-radius:50%;animation:spin 1s linear infinite}";const qt=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.tokenInvalid=e(this,"tokenInvalid");this.clearConversation=e(this,"clearConversation")}modalTitle;token;isOpen=false;messages=[];modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return o(this)}streamComplete;conversationStart;tokenInvalid;SCROLL_THRESHOLD=20;fullscreen=false;textAnswer="";isSubmittingText=false;customInputs={show_suggested_questions:"false"};suggestedQuestions=[];suggestedQuestionsLoading=false;currentRefs=[];showReferences=false;employeeId;isRecordingAudio=false;audioRecorder=null;audioChunks=[];isConvertingAudio=false;audioRecordingTimeLeft=60;audioRecordingTimer=null;audioRecordingStartTime=0;maxAudioRecordingTime=60;employeeDetails=null;isLoadingEmployeeDetails=false;quickQuestions=[];tokenInvalidListener;clearConversation;shouldHideReferences=false;isUserScrolling=false;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}handleClose=()=>{this.modalClosed.emit()};async sendMessageToAPI(t){if(!this.employeeId){alert("请提供有效的数字员工ID");return}this.isLoading=true;let e="";const o=new Date;const i=`${o.getHours()}:${o.getMinutes().toString().padStart(2,"0")}`;const n=t.trim()||"请开始";this.suggestedQuestions=[];this.currentRefs=[];this.shouldHideReferences=false;const r={id:`temp-${Date.now()}`,conversation_id:this.conversationId,parent_message_id:"00000000-0000-0000-0000-000000000000",inputs:this.customInputs||{},query:n,answer:"",message_files:[],feedback:{},retriever_resources:[],created_at:Math.floor(Date.now()/1e3).toString(),agent_thoughts:[],status:"normal",error:null,time:i,isStreaming:true};this.currentStreamingMessage=r;this.shouldAutoScroll=true;this.scrollToBottom();const s={response_mode:"streaming",conversation_id:this.conversationId,query:n,employee_id:this.employeeId};s.inputs={...this.customInputs};await l({url:`/sdk/v1/knowledge/chat/chat-messages`,method:"POST",data:s,onMessage:t=>{if(t.conversation_id&&!this.conversationId){this.conversationId=t.conversation_id;this.conversationStart.emit({conversation_id:t.conversation_id,event:t.event,message_id:t.message_id,id:t.id})}if(t.event==="node_started"&&t.data.title.includes("聘才猫推荐开始")){this.suggestedQuestionsLoading=true}if(t.event==="node_started"&&t.data.title.includes("不显示引用")){this.shouldHideReferences=true}if(t.event==="node_finished"&&t.data.title.includes("聘才猫推荐结束")){let e=[];try{let o=t.data.outputs.text;if(typeof o==="string"){o=o.replace(/```json\n/,"").replace(/```/,"").trim();const t=JSON.parse(o);if(t.status==="success"&&Array.isArray(t.items)){e=t.items.map((t=>t.question))}}else{const t=o;if(t.status==="success"&&Array.isArray(t.items)){e=t.items.map((t=>t.question))}}}catch(t){console.warn("解析问题建议失败:",t)}this.suggestedQuestions=e;this.suggestedQuestionsLoading=false}if(t.event==="node_finished"&&t.data?.inputs?.documents){const e=[];t.data.inputs.documents.forEach((t=>{if(t.result_list&&Array.isArray(t.result_list)){t.result_list.forEach((t=>{if(t.doc_info&&t.content){e.push({doc_info:{doc_name:t.doc_info.doc_name,doc_id:t.doc_info.doc_id},content:t.content})}}))}}));const o=new Map;e.forEach((t=>{if(t.doc_info&&t.doc_info.doc_id){o.set(t.doc_info.doc_id,t)}}));this.currentRefs=Array.from(o.values())}if(t.event==="message"){if(t.event==="agent_message"||t.event==="message"){if(t.answer){e+=t.answer;const o={...this.currentStreamingMessage,answer:e,id:t.message_id||this.currentStreamingMessage.id,isStreaming:true,parent_message_id:t.parent_message_id||this.currentStreamingMessage.parent_message_id,retriever_resources:t.retriever_resources||this.currentStreamingMessage.retriever_resources,agent_thoughts:t.agent_thoughts||this.currentStreamingMessage.agent_thoughts};this.currentStreamingMessage=o;this.scrollToBottom()}}}if(t.event==="message_end"){this.streamComplete.emit({conversation_id:t.conversation_id||"",event:t.event,message_id:t.message_id,id:t.id})}},onError:t=>{console.error("发生错误:",t);alert(t instanceof Error?t.message:"消息发送失败,请稍后再试");this.messages=[...this.messages,{...r,answer:"抱歉,发生了错误,请稍后再试。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const t=this.currentStreamingMessage;t.isStreaming=false;this.messages=[...this.messages,t];this.currentStreamingMessage=null}})}handleScroll=()=>{if(this.isUserScrolling){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!t)return;const{scrollTop:e,scrollHeight:o,clientHeight:i}=t;const n=o-e-i;this.shouldAutoScroll=n<=this.SCROLL_THRESHOLD}};handleTouchStart=()=>{this.isUserScrolling=true};handleTouchEnd=()=>{setTimeout((()=>{this.isUserScrolling=false}),100)};_wheelTimer=null;handleWheel=()=>{this.isUserScrolling=true;if(this._wheelTimer){clearTimeout(this._wheelTimer)}this._wheelTimer=setTimeout((()=>{this.isUserScrolling=false}),150)};scrollToBottom(){if(!this.shouldAutoScroll)return;const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t&&this.isOpen){t.scrollTop=t.scrollHeight}}componentDidRender(){if(this.isLoadingHistory||this.shouldAutoScroll&&this.isOpen){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t){t.scrollTop=t.scrollHeight}}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;try{const t=await d({url:"/sdk/v1/knowledge/chat/conversation-history",method:"GET",data:{conversation_id:this.conversationId}});if(t.success&&t.data){const e=t.data.data||[];const o=e.map((t=>{const e=new Date(parseInt(t.created_at)*1e3);const o=e.getHours().toString().padStart(2,"0");const i=e.getMinutes().toString().padStart(2,"0");const n=`${o}:${i}`;return{id:t.id,conversation_id:t.conversation_id,parent_message_id:t.parent_message_id||"00000000-0000-0000-0000-000000000000",inputs:t.inputs||{},query:t.query||"",answer:t.answer||"",message_files:t.message_files||[],feedback:t.feedback||{},retriever_resources:t.retriever_resources||[],created_at:t.created_at,agent_thoughts:t.agent_thoughts||[],status:t.status||"normal",error:t.error,time:n,isStreaming:false}}));this.messages=o}}catch(t){console.error("加载历史消息失败:",t);alert(t instanceof Error?t.message:"加载历史消息失败,请刷新重试")}finally{this.isLoadingHistory=false;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200)}}async convertAudioToText(t){try{const e=await d({url:"/sdk/v1/tts/audio_to_text",method:"POST",data:{cos_key:t}});if(e.success&&e.data&&e.data.text){return e.data.text}else{console.warn("音频转文字返回结果格式不正确");return null}}catch(t){console.error("音频转文字错误:",t);return null}}async fetchEmployeeDetails(){if(!this.employeeId||!this.token)return;this.isLoadingEmployeeDetails=true;try{const t=await d({url:`/sdk/v1/knowledge/chat/employee/${this.employeeId}`,method:"GET"});if(t.success&&t.data){this.employeeDetails=t.data;if(this.employeeDetails.show_quote_doc!==undefined){this.showReferences=this.employeeDetails.show_quote_doc}if(this.employeeDetails.quick_questions){this.quickQuestions=this.employeeDetails.quick_questions.split(",").map((t=>t.trim())).filter((t=>t))}if(this.conversationId){await this.loadHistoryMessages()}}else{alert("获取智能体详情失败,请检查token和employeeId是否正确")}}catch(t){console.error("获取智能体详情失败:",t)}finally{this.isLoadingEmployeeDetails=false}}async handleIsOpenChange(t){if(t){if(!this.employeeId){console.error("未提供数字员工ID (employeeId)");setTimeout((()=>alert("请提供有效的数字员工ID")),0);return}await s(this.token);await this.fetchEmployeeDetails()}}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.audioRecordingTimer){clearInterval(this.audioRecordingTimer);this.audioRecordingTimer=null}this.stopAudioRecording()}handleTextInputChange=t=>{const e=t.target;this.textAnswer=e.value};handleKeyDown=t=>{if(t.key==="Enter"){if(t.ctrlKey){return}else{t.preventDefault();if(this.textAnswer.trim()&&!this.isSubmittingText&&!this.isLoading&&!this.currentStreamingMessage){this.submitTextAnswer()}}}};submitTextAnswer=async()=>{if(!this.textAnswer.trim()||this.isSubmittingText){return}this.isSubmittingText=true;try{const t=this.textAnswer;this.textAnswer="";await this.sendMessageToAPI(t)}catch(t){console.error("提交文本回答失败:",t);alert("提交回答失败,请重试")}finally{this.isSubmittingText=false}};handleVoiceInputClick=()=>{if(this.isRecordingAudio){this.stopAudioRecording()}else{navigator.mediaDevices.getUserMedia({audio:true}).then((t=>{this.startRecordingWithStream(t)})).catch((t=>{console.error("麦克风权限请求失败:",t);if(t.name==="NotAllowedError"||t.name==="PermissionDeniedError"){alert("麦克风访问被拒绝。\n\n在Mac上,请前往系统偏好设置 > 安全性与隐私 > 隐私 > 麦克风,确保您的浏览器已被允许访问麦克风。")}else{alert("无法访问麦克风,请确保已授予权限并且麦克风设备正常工作。")}}))}};startRecordingWithStream(t){try{const e=this.getSupportedAudioMimeType();let o;try{o=new MediaRecorder(t,{mimeType:e})}catch(e){console.warn("指定的音频MIME类型不受支持,使用默认设置:",e);try{o=new MediaRecorder(t)}catch(e){t.getTracks().forEach((t=>t.stop()));console.error("无法创建音频录制器:",e);alert("您的浏览器不支持音频录制功能");return}}this.audioRecorder=o;this.audioChunks=[];this.isRecordingAudio=true;this.audioRecordingStartTime=Date.now();this.audioRecordingTimeLeft=this.maxAudioRecordingTime;o.ondataavailable=t=>{if(t.data.size>0){this.audioChunks.push(t.data)}};o.onstop=()=>{t.getTracks().forEach((t=>t.stop()));this.processAudioRecording()};o.start(100);this.audioRecordingTimer=setInterval((()=>{const t=Math.floor((Date.now()-this.audioRecordingStartTime)/1e3);this.audioRecordingTimeLeft=Math.max(0,this.maxAudioRecordingTime-t);if(this.audioRecordingTimeLeft<=0){this.stopAudioRecording()}}),1e3)}catch(e){t.getTracks().forEach((t=>t.stop()));console.error("开始录音失败:",e);alert("开始录音失败,请确保麦克风设备正常工作")}}async processAudioRecording(){if(this.audioChunks.length===0){console.warn("没有录制到音频数据");return}try{this.isConvertingAudio=true;const t=this.getSupportedAudioMimeType()||"audio/webm";const e=new Blob(this.audioChunks,{type:t});if(e.size===0){console.warn("录制的音频为空");this.isConvertingAudio=false;return}const o=t.includes("webm")?"webm":"mp3";const i=`audio_input.${o}`;const n=new File([e],i,{type:t});const r=await h(n,{},{tags:["audio"]});const s=await this.convertAudioToText(r.cos_key);if(s){const t=this.hostElement.shadowRoot?.querySelector(".text-answer-input");const e=t?.selectionStart||this.textAnswer.length;const o=this.textAnswer.substring(0,e);const i=this.textAnswer.substring(e);const n=o.length>0&&!o.endsWith(" ")?" ":"";this.textAnswer=o+n+s+i;setTimeout((()=>{if(t){const o=e+n.length+s.length;t.focus();t.setSelectionRange(o,o)}}),0)}else{console.warn("未能识别语音内容");alert("未能识别语音内容,请重试或直接输入文字")}}catch(t){console.error("处理音频录制失败:",t);alert("语音识别失败,请重试")}finally{this.isConvertingAudio=false;this.audioChunks=[]}}getSupportedAudioMimeType(){const t=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const e of t){if(!e)return"";try{if(MediaRecorder.isTypeSupported(e)){return e}}catch(t){console.warn(`检查音频MIME类型支持时出错 ${e}:`,t)}}console.warn("没有找到支持的音频MIME类型,将使用浏览器默认值");return""}stopAudioRecording(){if(this.audioRecorder&&this.isRecordingAudio){this.audioRecorder.stop();this.isRecordingAudio=false;if(this.audioRecordingTimer){clearInterval(this.audioRecordingTimer);this.audioRecordingTimer=null}}}handleSuggestedQuestionClick=t=>{if(this.isLoading||this.currentStreamingMessage)return;this.textAnswer=t;this.submitTextAnswer()};async handleDocumentDownload(t){try{const e=t.doc_info.doc_id.match(/docID_(\d+)/);if(!e||!e[1]){alert("无法解析文档ID");return}const o=e[1];const i=await d({url:`/sdk/v1/files/${o}/info`,method:"GET"});if(i.success&&i.data?.file_url){const t=i.data.file_url;const e=`${t}${t.includes("?")?"&":"?"}ci-process=doc-preview©able=1&dstType=html`;window.open(e,"_blank")}else{alert("获取文档链接失败")}}catch(t){console.error("下载文档失败:",t);alert("下载文档失败,请稍后再试")}}handleClearConversation=()=>{if(this.isLoading||this.currentStreamingMessage)return;this.clearConversation.emit(this.conversationId);this.messages=[];this.currentStreamingMessage=null;this.conversationId=undefined;this.currentRefs=[];this.suggestedQuestions=[]};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.icon||(this.employeeDetails?.avatar||"");const r=this.modalTitle||(this.employeeDetails?.name||"在线客服");const s=()=>{if(!this.showReferences||this.currentRefs.length===0||this.currentStreamingMessage||this.shouldHideReferences)return null;return i("div",{class:"references-section"},i("h3",{class:"references-title"},"引用文档"),i("div",{class:"references-list"},this.currentRefs.map(((t,e)=>i("div",{class:"reference-item",key:`ref-${e}`,onClick:()=>this.handleDocumentDownload(t)},i("div",{class:"reference-header"},i("span",{class:"reference-icon"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))),i("span",{class:"reference-name"},t.doc_info.doc_name),i("span",{class:"download-icon"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})))))))))};const a=()=>{if(!this.customInputs.show_suggested_questions&&!this.currentStreamingMessage){return null}if(this.suggestedQuestionsLoading){return i("div",{class:"loading-suggestions"},i("div",{class:"loading-spinner-small"}))}if(this.suggestedQuestions.length===0)return null;return i("div",{class:"suggested-questions"},i("h3",{class:"suggested-title"},"推荐问题"),this.suggestedQuestions.map(((t,e)=>i("div",{class:"suggested-question",key:`question-${e}`,onClick:()=>this.handleSuggestedQuestionClick(t)},i("span",null,t),i("span",{class:"arrow-right"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})))))))};const l=()=>{if(this.conversationId||this.quickQuestions.length===0||this.currentStreamingMessage)return null;return i("div",{class:"suggested-questions"},i("h3",{class:"suggested-title"},"常见问题"),this.quickQuestions.map(((t,e)=>i("div",{class:"suggested-question",key:`preset-question-${e}`,onClick:()=>this.handleSuggestedQuestionClick(t)},i("span",null,t),i("span",{class:"arrow-right"},i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},i("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})))))))};const d=()=>i("div",{class:"text-input-area"},i("textarea",{class:"text-answer-input",placeholder:"发消息",value:this.textAnswer,onInput:this.handleTextInputChange,onKeyDown:this.handleKeyDown,disabled:this.isRecordingAudio||this.isConvertingAudio}),i("div",{class:"input-toolbar"},i("div",{class:"toolbar-actions"},i("button",{class:"toolbar-button",title:"清除对话记录",onClick:this.handleClearConversation,disabled:this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.messages.length===0},i("img",{src:"https://pcm-pub-1351162788.cos.ap-guangzhou.myqcloud.com/sdk/image/brush-alt-svgrepo-com.png",alt:"清除对话记录"}))),i("div",{class:"toolbar-actions"},i("button",{class:{"toolbar-button":true,recording:this.isRecordingAudio,converting:this.isConvertingAudio},title:this.isRecordingAudio?"点击停止录音":this.isConvertingAudio?"正在识别语音...":"语音输入",onClick:this.handleVoiceInputClick,disabled:this.isConvertingAudio||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage},this.isRecordingAudio?i("div",null,i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),i("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}),i("circle",{cx:"12",cy:"11",r:"4",fill:"red"}))):this.isConvertingAudio?i("div",{class:"converting-indicator"},i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}))):i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),i("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"})))),i("div",{class:{"send-button":true,disabled:!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.isRecordingAudio||this.isConvertingAudio},onClick:()=>{if(!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.isRecordingAudio||this.isConvertingAudio){return}this.submitTextAnswer()}},i("img",{src:"https://pcm-pub-1351162788.cos.ap-guangzhou.myqcloud.com/sdk/image/i_send.png",alt:"发送"}))));return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},n&&i("img",{src:n,class:"header-icon",alt:"应用图标"}),i("div",null,r)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),i("div",{class:"chat-container"},i("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",null,"加载历史消息中...")):i("div",null,this.messages.map((t=>i("div",{id:`message_${t.id}`,key:t.id},i("pcm-chat-message",{message:t,showFeedbackButtons:false,onMessageChange:e=>{const o=this.messages.map((o=>o.id===t.id?{...o,...e.detail}:o));this.messages=o}})))),this.currentStreamingMessage&&i("div",{id:`message_${this.currentStreamingMessage.id}`},i("pcm-chat-message",{message:this.currentStreamingMessage,showFeedbackButtons:false})),this.messages.length===0&&!this.currentStreamingMessage&&i("div",{class:"empty-state"},this.isLoadingEmployeeDetails?i("p",null,"加载中..."):this.employeeDetails?.default_greeting?i("p",null,this.employeeDetails.default_greeting):i("p",null,"请输入...")),s(),a(),l())),i("div",{class:"recording-section"},i("div",{class:"recording-container"},d())))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};qt.style=Pt;const Ut=":host{font-size:16px}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const Wt=".plan-type-section{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}.plan-type-section label{font-weight:600;color:#333;margin-bottom:8px}.plan-type-options{display:flex;gap:15px;flex-wrap:wrap}.plan-type-option{flex:1;min-width:120px;border:1px solid #e8e8e8;border-radius:8px;padding:15px;cursor:pointer;display:flex;flex-direction:column;align-items:center;transition:all 0.3s}.plan-type-option:hover{border-color:#1890ff;background-color:#f0f7ff}.plan-type-option.selected{border-color:#1890ff;background-color:#e6f7ff;box-shadow:0 2px 8px rgba(24, 144, 255, 0.2)}.option-icon{font-size:24px;margin-bottom:8px}.option-label{font-size:14px;font-weight:500;color:#333}.resume-upload-section{display:flex;flex-direction:column;gap:8px}.resume-upload-section label{font-weight:600;color:#333;margin-bottom:8px}";const Vt=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.planningComplete=e(this,"planningComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="职业规划助手";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始规划";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;planningComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;isSubmitting=false;selectedPlanType="长期规划";get hostElement(){return o(this)}tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}async handleIsOpenChange(t){if(!t){this.clearSelectedFile();this.showChatModal=false}else{if(this.customInputs&&this.customInputs.type){const t=this.customInputs.type;if(t==="长期规划"||t==="转行建议"||t==="晋升路径"){this.selectedPlanType=t}}await s(this.token);if(this.conversationId||this.customInputs?.file_url){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=m.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}handleClose=()=>{this.modalClosed.emit()};handleFileChange=t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};handlePlanTypeChange=t=>{this.selectedPlanType=t};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const t=await h(this.selectedFile,{},{tags:["resume"]});this.uploadedFileInfo=t;this.uploadSuccess.emit(t)}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();f.captureError(t,{action:"uploadFile",component:"pcm-zygh-modal",title:"文件上传失败"});m.emitError({error:t,message:"文件上传失败,请重试"})}finally{this.isUploading=false}}handleStartPlanning=async()=>{if(!this.selectedFile){alert("请上传简历");return}this.isSubmitting=true;try{if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){this.isSubmitting=false;return}}this.showChatModal=true}catch(t){console.error("开始规划时出错:",t);f.captureError(t,{action:"handleStartPlanning",component:"pcm-zygh-modal",title:"开始规划时出错"});m.emitError({error:t,message:"开始规划时出错,请重试"})}finally{this.isSubmitting=false}};handlePlanningComplete=t=>{this.planningComplete.emit({...t.detail,type:this.selectedPlanType})};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const r=Boolean(this.customInputs&&this.customInputs.file_url);return i("div",{class:o,style:t},i("div",{class:e},this.isShowHeader&&i("div",{class:"modal-header"},i("div",{class:"header-left"},this.icon&&i("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),i("div",null,this.modalTitle)),this.isNeedClose&&i("button",{class:"close-button",onClick:this.handleClose},i("span",null,"×"))),!this.showChatModal&&!this.conversationId&&!r&&i("div",{class:"input-container"},i("div",{class:"plan-type-section"},i("label",null,"选择规划类型"),i("div",{class:"plan-type-options"},i("div",{class:`plan-type-option ${this.selectedPlanType==="长期规划"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("长期规划")},i("div",{class:"option-icon"},"📈"),i("div",{class:"option-label"},"长期规划")),i("div",{class:`plan-type-option ${this.selectedPlanType==="转行建议"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("转行建议")},i("div",{class:"option-icon"},"🔄"),i("div",{class:"option-label"},"转行建议")),i("div",{class:`plan-type-option ${this.selectedPlanType==="晋升路径"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("晋升路径")},i("div",{class:"option-icon"},"🚀"),i("div",{class:"option-label"},"晋升路径")))),i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?i("div",{class:"file-item"},i("div",{class:"file-item-content"},i("span",{class:"file-icon"},"📝"),i("span",{class:"file-name"},this.selectedFile.name)),i("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):i("div",{class:"upload-placeholder"},i("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),i("p",{class:"upload-text"},"点击上传简历"),i("p",{class:"upload-hint"},"支持 txt、markdown、pdf、docx、doc、md 格式")))),i("button",{class:"submit-button",disabled:!this.selectedFile||this.isUploading||this.isSubmitting,onClick:this.handleStartPlanning},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始规划"),i("div",{class:"ai-disclaimer"},i("p",null,"所有内容均由AI生成仅供参考"),i("p",{class:"beian-info"},i("span",null,"中央网信办生成式人工智能服务备案号"),":",i("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003"))),i("input",{type:"file",class:"file-input",onChange:this.handleFileChange})),n&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&i("div",null,i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018898",fullscreen:this.fullscreen,conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableVoice:false,filePreviewMode:this.filePreviewMode,customInputs:this.conversationId?{}:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,type:this.selectedPlanType},interviewMode:"text",onInterviewComplete:this.handlePlanningComplete}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};Vt.style=Ut+Wt;export{x as pcm_1zhanshi_mnms_modal,Y as pcm_app_chat_modal,et as pcm_button,it as pcm_card,pt as pcm_chat_message,mt as pcm_drawer,gt as pcm_hr_chat_modal,wt as pcm_htws_modal,vt as pcm_hyzj_modal,_t as pcm_jd_modal,St as pcm_jlpp_modal,Ft as pcm_mnct_modal,At as pcm_mnms_modal,Dt as pcm_msbg_modal,Ot as pcm_qgqjl_modal,qt as pcm_zsk_chat_modal,Vt as pcm_zygh_modal};
|
|
2
|
-
//# sourceMappingURL=p-9e6efc2d.entry.js.map
|