pcm-agents 1.0.2 → 1.0.4

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.
Files changed (165) hide show
  1. package/dist/cjs/{components-chat-message_33.cjs.entry.js → components-chat-message_34.cjs.entry.js} +5990 -4059
  2. package/dist/cjs/components-chat-message_34.cjs.entry.js.map +1 -0
  3. package/dist/cjs/{conversation-utils-B4jUfmtU.js → conversation-utils-DGL5uGhS.js} +4 -4
  4. package/dist/cjs/{conversation-utils-B4jUfmtU.js.map → conversation-utils-DGL5uGhS.js.map} +1 -1
  5. package/dist/cjs/{index-Dghp_NL6.js → index-CUDWXBQ4.js} +3 -3
  6. package/dist/cjs/{index-Dghp_NL6.js.map → index-CUDWXBQ4.js.map} +1 -1
  7. package/dist/cjs/index-C_qhED9Z.js +6 -6
  8. package/dist/cjs/index.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/oem-htws-modal.cjs.entry.js +1 -1
  11. package/dist/cjs/oem-jd-modal.cjs.entry.js +2 -2
  12. package/dist/cjs/oem-jlpp-modal.cjs.entry.js +1 -1
  13. package/dist/cjs/oem-jlzz-modal.cjs.entry.js +1 -1
  14. package/dist/cjs/oem-mnct-modal.cjs.entry.js +1 -1
  15. package/dist/cjs/oem-qgqjl-modal.cjs.entry.js +3 -3
  16. package/dist/cjs/pcm-agents.cjs.js +1 -1
  17. package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js +2 -2
  18. package/dist/cjs/pcm-jlsx-modal.cjs.entry.js +2 -2
  19. package/dist/cjs/{oem-mnms-modal.cjs.entry.js → pcm-mnms-modal.cjs.entry.js} +41 -156
  20. package/dist/cjs/pcm-mnms-modal.cjs.entry.js.map +1 -0
  21. package/dist/cjs/pcm-mnms-modal.entry.cjs.js.map +1 -0
  22. package/dist/cjs/{sentry-reporter-CgJowDyu.js → sentry-reporter-DsoYs8_e.js} +3 -3
  23. package/dist/cjs/{sentry-reporter-CgJowDyu.js.map → sentry-reporter-DsoYs8_e.js.map} +1 -1
  24. package/dist/collection/collection-manifest.json +1 -0
  25. package/dist/collection/components/components-oem-virtual-chat-modal/components-oem-virtual-chat-modal.css +1111 -0
  26. package/dist/collection/components/components-oem-virtual-chat-modal/components-oem-virtual-chat-modal.js +2334 -0
  27. package/dist/collection/components/components-oem-virtual-chat-modal/components-oem-virtual-chat-modal.js.map +1 -0
  28. package/dist/collection/components/oem-mnms-modal/oem-mnms-modal.js +2 -2
  29. package/dist/collection/components/oem-mnms-modal/oem-mnms-modal.js.map +1 -1
  30. package/dist/components/components-chat-message.js +1 -1
  31. package/dist/components/components-digital-human.js +1 -1
  32. package/dist/components/components-export-records-modal.js +1 -1
  33. package/dist/components/components-mobile-input-btn.js +1 -1
  34. package/dist/components/components-mobile-upload-btn.js +1 -1
  35. package/dist/components/components-oem-virtual-chat-modal.d.ts +11 -0
  36. package/dist/components/components-oem-virtual-chat-modal.js +9 -0
  37. package/dist/components/components-oem-virtual-chat-modal.js.map +1 -0
  38. package/dist/components/components-position-selector.js +1 -1
  39. package/dist/components/components-thousand-resume-wrapper.js +1 -1
  40. package/dist/components/components-upload.js +1 -1
  41. package/dist/components/components-voice-input-btn.js +1 -1
  42. package/dist/components/index.js +1 -1
  43. package/dist/components/oem-htws-modal.js +5 -5
  44. package/dist/components/oem-jd-modal.js +5 -5
  45. package/dist/components/oem-jlpp-modal.js +7 -7
  46. package/dist/components/oem-jlsx-modal.js +5 -5
  47. package/dist/components/oem-jlzz-modal.js +5 -5
  48. package/dist/components/oem-mnct-modal.js +7 -7
  49. package/dist/components/oem-mnms-modal.js +14 -14
  50. package/dist/components/oem-mnms-modal.js.map +1 -1
  51. package/dist/components/oem-qgqjl-modal.js +9 -9
  52. package/dist/components/oem-zygh-modal.js +5 -5
  53. package/dist/components/{p-BhdGTSLg.js → p-BCFZkcSd.js} +5 -5
  54. package/dist/components/{p-BhdGTSLg.js.map → p-BCFZkcSd.js.map} +1 -1
  55. package/dist/components/p-BG83hpwD.js +1910 -0
  56. package/dist/components/p-BG83hpwD.js.map +1 -0
  57. package/dist/components/{p-BDEiyYVl.js → p-BQcztM0Y.js} +3 -3
  58. package/dist/components/{p-BDEiyYVl.js.map → p-BQcztM0Y.js.map} +1 -1
  59. package/dist/components/{p-DJDJfWq9.js → p-BZPf0rl6.js} +3 -3
  60. package/dist/components/{p-DJDJfWq9.js.map → p-BZPf0rl6.js.map} +1 -1
  61. package/dist/components/{p-D4RnNrxx.js → p-BgwHiYHx.js} +3 -3
  62. package/dist/components/{p-D4RnNrxx.js.map → p-BgwHiYHx.js.map} +1 -1
  63. package/dist/components/{p-Bg0KKnpU.js → p-BqXnsrve.js} +3 -3
  64. package/dist/components/{p-Bg0KKnpU.js.map → p-BqXnsrve.js.map} +1 -1
  65. package/dist/components/{p-C7ubjB1x.js → p-CL_Guy01.js} +3 -3
  66. package/dist/components/{p-C7ubjB1x.js.map → p-CL_Guy01.js.map} +1 -1
  67. package/dist/components/{p-C-lvK9NX.js → p-CNFdfFMH.js} +3 -3
  68. package/dist/components/{p-C-lvK9NX.js.map → p-CNFdfFMH.js.map} +1 -1
  69. package/dist/components/{p-CzFKth7J.js → p-Cbaqx3Tt.js} +3 -3
  70. package/dist/components/{p-CzFKth7J.js.map → p-Cbaqx3Tt.js.map} +1 -1
  71. package/dist/components/{p-oVAdweom.js → p-DFDjQmKS.js} +3 -3
  72. package/dist/components/{p-oVAdweom.js.map → p-DFDjQmKS.js.map} +1 -1
  73. package/dist/components/{p-CB7myOe_.js → p-DNi0tT01.js} +3 -3
  74. package/dist/components/{p-CB7myOe_.js.map → p-DNi0tT01.js.map} +1 -1
  75. package/dist/components/{p-i4wY2JnB.js → p-Dc3NvH9p.js} +4 -4
  76. package/dist/components/{p-i4wY2JnB.js.map → p-Dc3NvH9p.js.map} +1 -1
  77. package/dist/components/{p-CPq5-i_-.js → p-DiLmXw24.js} +4 -4
  78. package/dist/components/{p-CPq5-i_-.js.map → p-DiLmXw24.js.map} +1 -1
  79. package/dist/components/{p-CEu-bFot.js → p-VwrhX6KG.js} +3 -3
  80. package/dist/components/{p-CEu-bFot.js.map → p-VwrhX6KG.js.map} +1 -1
  81. package/dist/components/pcm-1zhanshi-mnms-modal.js +5 -5
  82. package/dist/components/pcm-app-chat-modal.js +1 -1
  83. package/dist/components/pcm-ats-mnms-modal.js +5 -5
  84. package/dist/components/pcm-card.js +1 -1
  85. package/dist/components/pcm-hr-chat-modal.js +2 -2
  86. package/dist/components/pcm-htws-modal.js +8 -8
  87. package/dist/components/pcm-hyzj-modal.js +5 -5
  88. package/dist/components/pcm-jd-modal.js +6 -6
  89. package/dist/components/pcm-jlpp-modal.js +8 -8
  90. package/dist/components/pcm-jlsx-modal.js +5 -5
  91. package/dist/components/pcm-jlzz-modal.js +6 -6
  92. package/dist/components/pcm-mnct-modal.js +7 -7
  93. package/dist/components/pcm-mnms-modal.js +8 -8
  94. package/dist/components/pcm-mnms-zp-modal.js +8 -8
  95. package/dist/components/pcm-msbg-modal.js +5 -5
  96. package/dist/components/pcm-qgqjl-modal.js +9 -9
  97. package/dist/components/pcm-virtual-chat-modal.js +1 -1
  98. package/dist/components/pcm-zsk-chat-modal.js +2 -2
  99. package/dist/components/pcm-zygh-modal.js +7 -7
  100. package/dist/components/pcm-zygh-v2-modal.js +7 -7
  101. package/dist/esm/{components-chat-message_33.entry.js → components-chat-message_34.entry.js} +5989 -4059
  102. package/dist/esm/components-chat-message_34.entry.js.map +1 -0
  103. package/dist/esm/{conversation-utils-CLO35DHR.js → conversation-utils-DJr3w2Gu.js} +4 -4
  104. package/dist/esm/{conversation-utils-CLO35DHR.js.map → conversation-utils-DJr3w2Gu.js.map} +1 -1
  105. package/dist/esm/index-Bq0K-WqZ.js +6 -6
  106. package/dist/esm/{index-KVnu9w-h.js → index-DcQZ0v3S.js} +4 -4
  107. package/dist/esm/{index-KVnu9w-h.js.map → index-DcQZ0v3S.js.map} +1 -1
  108. package/dist/esm/index.js +1 -1
  109. package/dist/esm/loader.js +1 -1
  110. package/dist/esm/oem-htws-modal.entry.js +1 -1
  111. package/dist/esm/oem-jd-modal.entry.js +2 -2
  112. package/dist/esm/oem-jlpp-modal.entry.js +1 -1
  113. package/dist/esm/oem-jlzz-modal.entry.js +1 -1
  114. package/dist/esm/oem-mnct-modal.entry.js +1 -1
  115. package/dist/esm/oem-qgqjl-modal.entry.js +3 -3
  116. package/dist/esm/pcm-agents.js +1 -1
  117. package/dist/esm/pcm-hr-chat-modal.entry.js +2 -2
  118. package/dist/esm/pcm-jlsx-modal.entry.js +2 -2
  119. package/dist/esm/{oem-mnms-modal.entry.js → pcm-mnms-modal.entry.js} +41 -156
  120. package/dist/esm/pcm-mnms-modal.entry.js.map +1 -0
  121. package/dist/esm/{sentry-reporter-B4aHQq-A.js → sentry-reporter-N0y2nHh5.js} +3 -3
  122. package/dist/esm/{sentry-reporter-B4aHQq-A.js.map → sentry-reporter-N0y2nHh5.js.map} +1 -1
  123. package/dist/pcm-agents/index.esm.js +1 -1
  124. package/dist/pcm-agents/{p-eb9b355e.entry.js → p-317ec555.entry.js} +2 -2
  125. package/dist/pcm-agents/p-3f0d27cf.entry.js +8 -0
  126. package/dist/pcm-agents/p-3f0d27cf.entry.js.map +1 -0
  127. package/dist/pcm-agents/{p-aa606968.entry.js → p-57993edb.entry.js} +2 -2
  128. package/dist/pcm-agents/{p-e2b9a9f2.entry.js → p-7c1e7e5a.entry.js} +2 -2
  129. package/dist/pcm-agents/{p-Bktjt_YJ.js → p-C3qMuJRQ.js} +2 -2
  130. package/dist/pcm-agents/{p-Bktjt_YJ.js.map → p-C3qMuJRQ.js.map} +1 -1
  131. package/dist/pcm-agents/p-Ch9kExOi.js +2 -0
  132. package/dist/pcm-agents/{p-B4ClCdh9.js.map → p-Ch9kExOi.js.map} +1 -1
  133. package/dist/pcm-agents/{p-CMfzTNOk.js → p-b8oixHud.js} +2 -2
  134. package/dist/pcm-agents/{p-CMfzTNOk.js.map → p-b8oixHud.js.map} +1 -1
  135. package/dist/pcm-agents/{p-4d7511e0.entry.js → p-babf3d55.entry.js} +2 -2
  136. package/dist/pcm-agents/{p-efb4e819.entry.js → p-c2dc4dcd.entry.js} +2 -2
  137. package/dist/pcm-agents/p-ca1f514b.entry.js +2 -0
  138. package/dist/pcm-agents/p-ca1f514b.entry.js.map +1 -0
  139. package/dist/pcm-agents/{p-8256890d.entry.js → p-cdcdec03.entry.js} +2 -2
  140. package/dist/pcm-agents/{p-8144f0d4.entry.js → p-e13e3325.entry.js} +2 -2
  141. package/dist/pcm-agents/{p-dd6362f0.entry.js → p-f666e503.entry.js} +2 -2
  142. package/dist/pcm-agents/pcm-agents.esm.js +1 -1
  143. package/dist/pcm-agents/pcm-mnms-modal.entry.esm.js.map +1 -0
  144. package/dist/types/components/components-oem-virtual-chat-modal/components-oem-virtual-chat-modal.d.ts +290 -0
  145. package/dist/types/components.d.ts +186 -0
  146. package/package.json +1 -1
  147. package/dist/cjs/components-chat-message_33.cjs.entry.js.map +0 -1
  148. package/dist/cjs/oem-mnms-modal.cjs.entry.js.map +0 -1
  149. package/dist/cjs/oem-mnms-modal.entry.cjs.js.map +0 -1
  150. package/dist/esm/components-chat-message_33.entry.js.map +0 -1
  151. package/dist/esm/oem-mnms-modal.entry.js.map +0 -1
  152. package/dist/pcm-agents/oem-mnms-modal.entry.esm.js.map +0 -1
  153. package/dist/pcm-agents/p-7e8bdfa6.entry.js +0 -2
  154. package/dist/pcm-agents/p-7e8bdfa6.entry.js.map +0 -1
  155. package/dist/pcm-agents/p-B4ClCdh9.js +0 -2
  156. package/dist/pcm-agents/p-f6683f29.entry.js +0 -8
  157. package/dist/pcm-agents/p-f6683f29.entry.js.map +0 -1
  158. /package/dist/pcm-agents/{p-eb9b355e.entry.js.map → p-317ec555.entry.js.map} +0 -0
  159. /package/dist/pcm-agents/{p-aa606968.entry.js.map → p-57993edb.entry.js.map} +0 -0
  160. /package/dist/pcm-agents/{p-e2b9a9f2.entry.js.map → p-7c1e7e5a.entry.js.map} +0 -0
  161. /package/dist/pcm-agents/{p-4d7511e0.entry.js.map → p-babf3d55.entry.js.map} +0 -0
  162. /package/dist/pcm-agents/{p-efb4e819.entry.js.map → p-c2dc4dcd.entry.js.map} +0 -0
  163. /package/dist/pcm-agents/{p-8256890d.entry.js.map → p-cdcdec03.entry.js.map} +0 -0
  164. /package/dist/pcm-agents/{p-8144f0d4.entry.js.map → p-e13e3325.entry.js.map} +0 -0
  165. /package/dist/pcm-agents/{p-dd6362f0.entry.js.map → p-f666e503.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["pcmMnmsModalCss","globalCss","hostCss","MnmsModal","modalTitle","token","isOpen","modalClosed","icon","zIndex","isShowHeader","isNeedClose","conversationId","defaultQuery","maxRecordingTime","waitingTime","fullscreen","customInputs","showWorkspaceHistory","mobileJdInputAble","mobileUploadAble","digitalId","openingIndex","enableVirtualHuman","showEndInterviewButton","playbackRate","uploadSuccess","streamComplete","conversationStart","interviewComplete","tokenInvalid","someErrorEvent","interviewMode","skipResumeUpload","recordingError","showCopyButton","showFeedbackButtons","selectedFile","isUploading","uploadedFileInfo","showChatModal","jobDescription","isSubmitting","tokenInvalidListener","removeErrorListener","virtualChatModalRef","handleTokenChange","newToken","authStore","getToken","setToken","handleIsOpenChange","newValue","this","setComponentActive","resetState","job_info","verifyApiKey","file_url","resume_content","componentWillLoad","configStore","setItem","emit","ErrorEventBus","addErrorListener","errorDetail","document","addEventListener","disconnectedCallback","removeEventListener","handleClose","handleJobDescriptionChange","event","textarea","target","value","handleStartInterview","async","trim","alert","pcmUploadRef","getIsUploading","Message","info","render","modalStyle","String","containerClass","overlayClass","isLoading","hideJdInput","Boolean","hideResumeUpload","hasFileAndJob","h","class","style","src","alt","onClick","htmlFor","name","onOk","e","detail","id","placeholder","rows","onInput","ref","el","maxFileSize","multiple","acceptFileSuffixList","uploadParams","tags","onUploadChange","result","disabled","href","rel","botId","cos_key","file_name","question_number","ai_interview_type"],"sources":["src/components/pcm-mnms-modal/pcm-mnms-modal.css?tag=pcm-mnms-modal&encapsulation=shadow","src/global/global.css?tag=pcm-mnms-modal&encapsulation=shadow","src/global/host.css?tag=pcm-mnms-modal&encapsulation=shadow","src/components/pcm-mnms-modal/pcm-mnms-modal.tsx"],"sourcesContent":[null,"/* 模态框基础样式 */\r\n.modal-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n display: flex;\r\n z-index: 1000;\r\n overflow-y: auto;\r\n}\r\n\r\n/* 全屏模式下的overlay样式 - 改为基于父组件 */\r\n.fullscreen-overlay {\r\n padding: 0;\r\n background-color: rgba(0, 0, 0, 0.7);\r\n /* 改为基于父组件的全屏 */\r\n position: absolute;\r\n width: 100%;\r\n height: auto;\r\n}\r\n\r\n.modal-container {\r\n background-color: #fff;\r\n border-radius: 8px;\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n position: relative;\r\n margin: 5vh auto auto auto;\r\n transition: all 0.3s ease-out;\r\n overflow: hidden;\r\n}\r\n\r\n/* 全屏模式样式 - 改为基于父组件 */\r\n.modal-container.fullscreen {\r\n width: 100%;\r\n max-width: none;\r\n height: 100%;\r\n border-radius: 0;\r\n margin: 0;\r\n display: flex;\r\n flex-direction: column;\r\n max-height: 100%;\r\n}\r\n\r\n/* PC端布局 */\r\n.pc-layout {\r\n width: 80%;\r\n max-width: 600px;\r\n min-width: 320px;\r\n}\r\n\r\n/* 响应式布局 */\r\n@media screen and (max-width: 768px) {\r\n .pc-layout {\r\n width: 95%;\r\n }\r\n\r\n .modal-overlay {\r\n padding: 10px 0px 0px 0px;\r\n }\r\n\r\n .modal-container.fullscreen {\r\n /* 移动端也基于父组件尺寸 */\r\n width: 100%;\r\n height: 100%;\r\n max-height: 100%;\r\n border-radius: 16px 16px 0 0;\r\n /* 保留安全区域支持 */\r\n padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);\r\n }\r\n}\r\n\r\n/* 模态框头部样式 */\r\n.modal-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 4px 16px;\r\n height: 50px;\r\n border-bottom: 1px solid #e8e8e8;\r\n flex-shrink: 0;\r\n}\r\n\r\n.header-left {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n font-size: 16px;\r\n font-weight: 600;\r\n color: #333;\r\n}\r\n\r\n.header-icon {\r\n width: 24px;\r\n height: 24px;\r\n}\r\n\r\n.close-button {\r\n background: transparent;\r\n border: none;\r\n cursor: pointer;\r\n padding: 8px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 32px;\r\n height: 32px;\r\n border-radius: 4px;\r\n}\r\n\r\n.close-button:hover {\r\n background-color: rgba(0, 0, 0, 0.04);\r\n}\r\n\r\n.close-button span {\r\n font-size: 24px;\r\n line-height: 1;\r\n color: #999;\r\n}\r\n\r\n.close-button:hover span {\r\n color: #666;\r\n}\r\n\r\n\r\n/* 文件上传区域通用样式 */\r\n.upload-area {\r\n cursor: pointer;\r\n width: 100%;\r\n}\r\n\r\n\r\n.upload-placeholder {\r\n transition: all 0.3s ease;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n background: rgba(0, 0, 0, 0.02);\r\n border: 1px dashed #d9d9d9;\r\n border-radius: 8px;\r\n cursor: pointer;\r\n}\r\n\r\n.upload-placeholder:hover {\r\n border: 1px dashed #1890ff;\r\n}\r\n\r\n.upload-placeholder img {\r\n margin-top: 8px;\r\n width: 50px;\r\n height: 50px;\r\n}\r\n\r\n.upload-placeholder .upload-text {\r\n margin: 4px 0;\r\n color: #332F39;\r\n font-size: 14px;\r\n}\r\n\r\n.upload-placeholder .upload-hint {\r\n font-size: 14px;\r\n color: #949AA5;\r\n margin-top: 8px;\r\n padding: 0px 10px;\r\n text-align: center;\r\n white-space: normal;\r\n word-wrap: break-word;\r\n word-break: break-all;\r\n line-height: 1.4;\r\n}\r\n\r\n\r\n/* 文件项样式 */\r\n.file-item {\r\n position: relative;\r\n padding: 16px;\r\n border: 1px solid #e2e8f0;\r\n border-radius: 8px;\r\n transition: border-color 0.3s;\r\n cursor: pointer;\r\n margin-bottom: 16px;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n\r\n.file-item:hover {\r\n border-color: #0D75FB;\r\n}\r\n\r\n.file-item-content {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n flex: 1;\r\n min-width: 0;\r\n overflow: hidden;\r\n}\r\n\r\n.file-icon {\r\n color: #0D75FB;\r\n flex-shrink: 0;\r\n}\r\n\r\n.file-name {\r\n font-weight: 500;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n max-width: calc(100% - 50px);\r\n}\r\n\r\n.remove-file {\r\n background: transparent;\r\n border: none;\r\n color: #94a3b8;\r\n cursor: pointer;\r\n font-size: 18px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 4px;\r\n margin-left: 8px;\r\n border-radius: 4px;\r\n transition: all 0.2s;\r\n min-width: 30px;\r\n min-height: 30px;\r\n}\r\n\r\n.remove-file:hover {\r\n background-color: #f1f5f9;\r\n color: #475569;\r\n}\r\n\r\n.file-input {\r\n display: none;\r\n}\r\n\r\n\r\n\r\n/* 输入容器样式 */\r\n.input-container {\r\n padding: 20px;\r\n display: flex;\r\n flex-direction: column;\r\n height: calc(100% - 50px);\r\n background: linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;\r\n /* 减去header高度 */\r\n overflow-y: auto;\r\n}\r\n\r\n.input-container h3 {\r\n margin-top: 0;\r\n margin-bottom: 20px;\r\n font-size: 18px;\r\n color: #333;\r\n text-align: center;\r\n}\r\n\r\n/* JD输入区域样式 */\r\n.jd-input-section {\r\n margin-bottom: 20px;\r\n}\r\n\r\n.jd-input-section label {\r\n display: block;\r\n margin-bottom: 8px;\r\n font-weight: 500;\r\n color: #333;\r\n}\r\n\r\n.job-description-textarea {\r\n width: calc(100% - 16px);\r\n border: 1px solid #ddd;\r\n border-radius: 4px;\r\n resize: vertical;\r\n font-family: inherit;\r\n font-size: 14px;\r\n line-height: 1.5;\r\n transition: border-color 0.3s;\r\n padding: 8px;\r\n}\r\n\r\n.job-description-textarea:focus {\r\n outline: none;\r\n border-color: #1890ff;\r\n box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);\r\n}\r\n\r\n/* 简历上传区域样式 */\r\n.resume-upload-section {\r\n margin-bottom: 20px;\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.resume-upload-section label {\r\n display: block;\r\n margin-bottom: 8px;\r\n font-weight: 500;\r\n color: #333;\r\n}\r\n\r\n/* 面试设置区域 */\r\n.interview-settings-section {\r\n margin-bottom: 24px;\r\n padding: 20px;\r\n background-color: #f8f9fa;\r\n border-radius: 8px;\r\n border: 1px solid #e9ecef;\r\n}\r\n\r\n.settings-row {\r\n margin-bottom: 20px;\r\n}\r\n\r\n.settings-row:last-child {\r\n margin-bottom: 0;\r\n}\r\n\r\n.settings-label {\r\n display: block;\r\n font-weight: 500;\r\n color: #333;\r\n margin-bottom: 12px;\r\n font-size: 14px;\r\n}\r\n\r\n/* 题目数量滑块样式 */\r\n.question-number-section {\r\n width: 100%;\r\n}\r\n\r\n.slider-container {\r\n display: flex;\r\n align-items: center;\r\n gap: 12px;\r\n}\r\n\r\n.question-slider {\r\n flex: 1;\r\n height: 6px;\r\n background: #ddd;\r\n outline: none;\r\n border-radius: 3px;\r\n -webkit-appearance: none;\r\n appearance: none;\r\n}\r\n\r\n.question-slider::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n appearance: none;\r\n width: 20px;\r\n height: 20px;\r\n background: #0D75FB;\r\n cursor: pointer;\r\n border-radius: 50%;\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\r\n}\r\n\r\n.question-slider::-moz-range-thumb {\r\n width: 20px;\r\n height: 20px;\r\n background: #0D75FB;\r\n cursor: pointer;\r\n border-radius: 50%;\r\n border: none;\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\r\n}\r\n\r\n.slider-value {\r\n font-weight: 600;\r\n color: #0D75FB;\r\n font-size: 14px;\r\n min-width: 30px;\r\n text-align: center;\r\n}\r\n\r\n/* 开关样式 */\r\n.analysis-toggle-section {\r\n width: 100%;\r\n}\r\n\r\n.toggle-container {\r\n display: flex;\r\n align-items: center;\r\n gap: 12px;\r\n}\r\n\r\n.toggle-switch {\r\n position: relative;\r\n display: inline-block;\r\n width: 44px;\r\n height: 24px;\r\n}\r\n\r\n.toggle-switch input {\r\n opacity: 0;\r\n width: 0;\r\n height: 0;\r\n}\r\n\r\n.toggle-slider {\r\n position: absolute;\r\n cursor: pointer;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: #ccc;\r\n transition: 0.3s;\r\n border-radius: 24px;\r\n}\r\n\r\n.toggle-slider:before {\r\n position: absolute;\r\n content: \"\";\r\n height: 18px;\r\n width: 18px;\r\n left: 3px;\r\n bottom: 3px;\r\n background-color: white;\r\n transition: 0.3s;\r\n border-radius: 50%;\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\r\n}\r\n\r\ninput:checked + .toggle-slider {\r\n background-color: #0D75FB;\r\n}\r\n\r\ninput:checked + .toggle-slider:before {\r\n transform: translateX(20px);\r\n}\r\n\r\n.toggle-text {\r\n font-size: 14px;\r\n color: #666;\r\n font-weight: 500;\r\n}\r\n\r\n/* 提交按钮通用样式 */\r\n.submit-button {\r\n margin-top: 10px;\r\n padding: 10px 30px;\r\n background: #0D75FB;\r\n color: white;\r\n border: none;\r\n border-radius: 4px;\r\n font-size: 16px;\r\n cursor: pointer;\r\n transition: all 0.3s ease;\r\n width: 100%;\r\n max-width: 400px;\r\n align-self: center;\r\n}\r\n\r\n.submit-button:hover {\r\n background-color: #40a9ff;\r\n}\r\n\r\n.submit-button:disabled {\r\n background-color: rgba(0,0,0,0.04);\r\n color: rgba(0,0,0,0.25);\r\n cursor: not-allowed;\r\n}\r\n\r\n\r\n\r\n/* AI免责声明和备案信息样式 */\r\n.ai-disclaimer {\r\n margin-top: 16px;\r\n text-align: center;\r\n font-size: 12px;\r\n color: #999;\r\n line-height: 1.5;\r\n}\r\n\r\n.ai-disclaimer p {\r\n margin: 4px 0;\r\n}\r\n\r\n.beian-info {\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\r\n gap: 4px;\r\n}\r\n\r\n.ai-disclaimer a {\r\n color: #666;\r\n text-decoration: none;\r\n transition: color 0.2s ease;\r\n}\r\n\r\n.ai-disclaimer a:hover {\r\n color: #1890ff;\r\n text-decoration: underline;\r\n}\r\n\r\n/* 添加加载状态的样式 */\r\n.loading-container {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n height: 100%;\r\n padding: 24px;\r\n }\r\n \r\n .loading-spinner {\r\n width: 40px;\r\n height: 40px;\r\n border: 4px solid rgba(0, 0, 0, 0.1);\r\n border-radius: 50%;\r\n border-top-color: var(--pcm-primary-color, #1890ff);\r\n animation: spin 1s linear infinite;\r\n margin-bottom: 16px;\r\n }\r\n \r\n .loading-text {\r\n font-size: 16px;\r\n color: var(--pcm-text-color, #333);\r\n }\r\n \r\n @keyframes spin {\r\n 0% { transform: rotate(0deg); }\r\n 100% { transform: rotate(360deg); }\r\n }\r\n\r\n/* 历史会话按钮 */\r\n.header-history-button {\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 4px;\r\n padding: 4px 8px;\r\n border: none;\r\n border-radius: 4px;\r\n background: transparent;\r\n color: #bbb;\r\n cursor: pointer;\r\n font-size: 13px;\r\n font-family: inherit;\r\n line-height: 1;\r\n transition: all 0.2s ease;\r\n flex-shrink: 0;\r\n white-space: nowrap;\r\n}\r\n\r\n.header-history-button svg {\r\n width: 16px;\r\n height: 16px;\r\n display: block;\r\n flex-shrink: 0;\r\n}\r\n\r\n.header-history-button:hover {\r\n background-color: rgba(0, 0, 0, 0.04);\r\n color: #666;\r\n}\r\n\r\n.header-history-button:focus-visible {\r\n outline: 2px solid rgba(13, 117, 251, 0.35);\r\n outline-offset: 2px;\r\n}\r\n\r\n/* 历史会话抽屉内容 */\r\n.history-drawer-content {\r\n height: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.conversation-list {\r\n flex: 1;\r\n overflow-y: auto;\r\n padding: 8px 0;\r\n}\r\n\r\n.loading-conversations,\r\n.empty-conversations {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 40px 20px;\r\n color: #999;\r\n}\r\n\r\n.loading-conversations .loading-spinner-small {\r\n margin-bottom: 12px;\r\n}\r\n\r\n.conversation-item {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n padding: 12px 16px;\r\n margin: 0 8px 4px 8px;\r\n border-radius: 8px;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n border: 1px solid transparent;\r\n}\r\n\r\n.conversation-item:hover {\r\n background: #f5f5f5;\r\n}\r\n\r\n.conversation-info {\r\n flex: 1;\r\n min-width: 0;\r\n}\r\n\r\n.conversation-title {\r\n font-size: 14px;\r\n font-weight: 500;\r\n color: #262626;\r\n margin-bottom: 4px;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n}\r\n\r\n.conversation-meta {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n font-size: 12px;\r\n color: #8c8c8c;\r\n}\r\n\r\n.conversation-time {\r\n flex-shrink: 0;\r\n}\r\n\r\n.message-count {\r\n flex-shrink: 0;\r\n}\r\n\r\n.conversation-status {\r\n padding: 2px 6px;\r\n border-radius: 4px;\r\n font-size: 11px;\r\n font-weight: 500;\r\n}\r\n\r\n.conversation-status.completed {\r\n background: #f6ffed;\r\n color: #52c41a;\r\n}\r\n\r\n.conversation-status.running {\r\n background: #fff7e6;\r\n color: #fa8c16;\r\n}\r\n\r\n.header-history-entry {\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n margin-left: 8px;\r\n padding: 4px 8px;\r\n border: none;\r\n border-radius: 4px;\r\n background: #e6f7ff;\r\n color: #1890ff;\r\n cursor: pointer;\r\n font-size: 12px;\r\n font-family: inherit;\r\n line-height: 1;\r\n white-space: nowrap;\r\n transition: all 0.2s ease;\r\n}\r\n\r\n.header-history-entry:hover {\r\n background: #bae7ff;\r\n color: #0958d9;\r\n transform: translateY(-1px);\r\n}\r\n\r\n.header-history-entry:focus-visible {\r\n outline: 2px solid rgba(13, 117, 251, 0.35);\r\n outline-offset: 2px;\r\n}\r\n\r\n.history-pagination {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n gap: 12px;\r\n padding: 12px 16px 16px;\r\n border-top: 1px solid #f0f0f0;\r\n}\r\n\r\n.history-pagination-button {\r\n min-width: 72px;\r\n padding: 6px 12px;\r\n border: 1px solid #d9d9d9;\r\n border-radius: 6px;\r\n background: #fff;\r\n color: #595959;\r\n cursor: pointer;\r\n font-size: 12px;\r\n transition: all 0.2s ease;\r\n}\r\n\r\n.history-pagination-button:hover:not(:disabled) {\r\n border-color: #1890ff;\r\n color: #1890ff;\r\n background: #e6f7ff;\r\n}\r\n\r\n.history-pagination-button:disabled {\r\n border-color: #f0f0f0;\r\n color: #bfbfbf;\r\n background: #fafafa;\r\n cursor: not-allowed;\r\n}\r\n\r\n.history-pagination-info {\r\n flex: 1;\r\n text-align: center;\r\n color: #8c8c8c;\r\n font-size: 12px;\r\n}\r\n \r\n",":host {\r\n /* 字体相关属性 */\r\n font-size: 16px;\r\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\r\n font-weight: normal;\r\n font-style: normal;\r\n font-variant: normal;\r\n line-height: 1.5;\r\n letter-spacing: normal;\r\n word-spacing: normal;\r\n \r\n /* 文本相关属性 */\r\n color: #333; /* 重置文字颜色,避免继承外部的red */\r\n text-align: left;\r\n text-indent: 0;\r\n text-transform: none;\r\n white-space: normal;\r\n word-wrap: normal;\r\n word-break: normal;\r\n \r\n /* 可见性 */\r\n visibility: visible;\r\n \r\n /* 列表相关 */\r\n list-style: none;\r\n list-style-image: none;\r\n list-style-position: outside;\r\n list-style-type: disc;\r\n \r\n /* 表格相关 */\r\n border-collapse: separate;\r\n border-spacing: 0;\r\n caption-side: top;\r\n empty-cells: show;\r\n table-layout: auto;\r\n \r\n /* 引用 */\r\n quotes: auto;\r\n \r\n /* 光标 */\r\n cursor: auto;\r\n \r\n /* 文本方向 */\r\n direction: ltr;\r\n \r\n /* 打印相关 */\r\n orphans: 2;\r\n widows: 2;\r\n page-break-inside: auto;\r\n \r\n /* 其他可能被继承的属性 */\r\n text-decoration: none;\r\n text-shadow: none;\r\n \r\n /* 确保组件有独立的盒模型 */\r\n box-sizing: border-box;\r\n \r\n /* 重置一些可能影响布局的继承属性 */\r\n writing-mode: horizontal-tb;\r\n text-orientation: mixed;\r\n}","import { Component, Prop, h, State, Element, Event, EventEmitter, Watch } from '@stencil/core';\r\nimport { FileUploadResponse, verifyApiKey } from '../../utils/utils';\r\nimport {\r\n StreamCompleteEventData,\r\n ConversationStartEventData,\r\n InterviewCompleteEventData,\r\n RecordingErrorEventData,\r\n} from '../../interfaces/events';\r\nimport { ErrorEventBus, ErrorEventDetail } from '../../utils/error-event';\r\nimport { authStore } from '../../../store/auth.store';\r\nimport { configStore } from '../../../store/config.store';\r\nimport { Message } from '../../services/message.service';\r\n\r\n/**\r\n * 模拟面试(求职)\r\n */\r\n\r\n@Component({\r\n tag: 'pcm-mnms-modal',\r\n styleUrls: ['pcm-mnms-modal.css', '../../global/global.css', '../../global/host.css'],\r\n shadow: true,\r\n})\r\nexport class MnmsModal {\r\n /**\r\n * 模态框标题\r\n */\r\n @Prop() modalTitle: string = '模拟面试';\r\n\r\n /**\r\n * SDK鉴权密钥\r\n */\r\n @Prop({ attribute: 'token' }) token!: string;\r\n\r\n /**\r\n * 是否显示聊天模态框\r\n */\r\n @Prop({ mutable: true }) isOpen: boolean = false;\r\n\r\n /**\r\n * 当点击模态框关闭时触发\r\n */\r\n @Event() modalClosed: EventEmitter<void>;\r\n\r\n /**\r\n * 应用图标URL\r\n */\r\n @Prop() icon?: string;\r\n\r\n /**\r\n * 聊天框的页面层级\r\n */\r\n @Prop() zIndex?: number = 1000;\r\n\r\n /**\r\n * 是否展示顶部标题栏\r\n */\r\n @Prop() isShowHeader: boolean = true;\r\n\r\n /**\r\n * 是否展示右上角的关闭按钮\r\n */\r\n @Prop() isNeedClose: boolean = true;\r\n\r\n /**\r\n * 会话ID,传入继续对话,否则创建新会话\r\n */\r\n @Prop({ mutable: true }) conversationId?: string;\r\n\r\n /**\r\n * 默认查询文本\r\n */\r\n @Prop() defaultQuery: string = '请开始模拟面试';\r\n\r\n /**\r\n * 视频录制最大时长(秒)默认120\r\n */\r\n @Prop() maxRecordingTime: number = 120;\r\n\r\n /**\r\n * 等待录制时间(秒)默认10\r\n */\r\n @Prop() waitingTime: number = 10;\r\n\r\n /**\r\n * 是否以全屏模式打开,移动端建议设置为true\r\n */\r\n @Prop() fullscreen: boolean = false;\r\n\r\n /**\r\n * 自定义输入参数,可传入以下参数:<br>\r\n * customInputs.job_info时,会隐藏JD输入区域。<br>\r\n * customInputs.file_url或customInputs.resume_content时,会隐藏简历上传区域。<br>\r\n * customInputs.file_url(或customInputs.resume_content)和customInputs.job_info时,会直接开始聊天。<br>\r\n * customInputs.resume_content:可传入json字符串,或纯文本字符串,字符串内容为简历内容。<br>\r\n * customInputs.url_callback:可传入url字符串,当报告生成后,会调用该url进行回调。该url请使用post请求,接收报告字段为report_content,会话id字段为conversation_id。<br>\r\n * customInputs.question_number时,会设置面试题总数量, 默认5题。<br>\r\n * customInputs.question_list:可传入字符串数组形式的JSON字符串,自定义面试问题列表。<br>\r\n */\r\n @Prop() customInputs: Record<string, string> = {};\r\n\r\n /**\r\n * 是否显示工作区历史会话按钮\r\n */\r\n @Prop() showWorkspaceHistory: boolean = false;\r\n\r\n /**\r\n * 是否开启移动端上传JD\r\n */\r\n @Prop() mobileJdInputAble: boolean = false;\r\n\r\n /**\r\n * 是否开启移动端上传简历\r\n */\r\n @Prop() mobileUploadAble: boolean = false;\r\n\r\n /**\r\n * 虚拟数字人ID,指定则开启虚拟数字人功能</br>\r\n * 智琪:79202506752 </br>\r\n * 艾綝:79402522624 </br>\r\n * 艾姮:79597885440 </br>\r\n */\r\n @Prop() digitalId?: string;\r\n\r\n /**\r\n * 数字人开场白索引,用于选择开场白和开场视频(可选:0, 1, 2)\r\n * 0、您好,我是聘才猫 AI 面试助手。很高兴为你主持这场面试!在开始前,请确保:身处安静、光线充足的环境。网络顺畅,摄像头和麦克风工作正常。现在我正在查看本次面试的相关信息,为您生成专属面试题,马上就好,请稍等片刻。</br>\r\n * 1、您好,我是您的 AI 面试助手。欢迎参加本次AI面试!为了获得最佳效果,请确认:您在安静、明亮的环境中。您的网络稳定,摄像头和麦克风已开启。我们正在后台为您准备本次专属面试内容,很快开始,请稍候。<br>\r\n * 2、您好,我是您的 AI 面试助手。面试马上开始。趁此片刻,请快速确认:周围安静吗?光线足够吗?网络没问题?摄像头和麦克风准备好了吗?我们正在为您加载个性化的面试环节,稍等就好!\r\n */\r\n @Prop() openingIndex: number = 0;\r\n\r\n /**\r\n * 是否启用全屏数字人模式,此模式下面试报告只会通过url_callback回调返回\r\n */\r\n @Prop() enableVirtualHuman: boolean = false;\r\n\r\n /**\r\n * 是否显示结束面试按钮\r\n */\r\n @Prop() showEndInterviewButton: boolean = false;\r\n\r\n /**\r\n * 数字人视频播放速率(0.5-2.0之间),默认1.0\r\n */\r\n @Prop() playbackRate: number = 1.0;\r\n\r\n /**\r\n * 上传成功事件\r\n */\r\n @Event() uploadSuccess: EventEmitter<FileUploadResponse>;\r\n\r\n /**\r\n * 流式输出完成事件\r\n */\r\n @Event() streamComplete: EventEmitter<StreamCompleteEventData>;\r\n\r\n /**\r\n * 新会话开始的回调,只会在一轮对话开始时触发一次\r\n */\r\n @Event() conversationStart: EventEmitter<ConversationStartEventData>;\r\n\r\n /**\r\n * 当聊天完成时触发\r\n */\r\n @Event() interviewComplete: EventEmitter<InterviewCompleteEventData>;\r\n\r\n /**\r\n * SDK密钥验证失败事件\r\n */\r\n @Event() tokenInvalid: EventEmitter<void>;\r\n\r\n /**\r\n * 错误事件\r\n */\r\n @Event() someErrorEvent: EventEmitter<ErrorEventDetail>;\r\n\r\n\r\n /**\r\n * 面试模式:text - 文本模式,video - 视频模式\r\n */\r\n @Prop() interviewMode: 'text' | 'video' = 'text';\r\n\r\n /**\r\n * 是否跳过简历上传步骤,默认false\r\n */\r\n @Prop() skipResumeUpload: boolean = false;\r\n\r\n /**\r\n * 录制错误事件\r\n */\r\n @Event() recordingError: EventEmitter<RecordingErrorEventData>;\r\n\r\n /**\r\n * 是否显示复制按钮\r\n */\r\n @Prop() showCopyButton: boolean = true;\r\n\r\n /**\r\n * 是否显示点赞点踩按钮\r\n */\r\n @Prop() showFeedbackButtons: boolean = true;\r\n\r\n\r\n @State() selectedFile: File | null = null;\r\n @State() isUploading: boolean = false;\r\n @State() uploadedFileInfo: FileUploadResponse | null = null;\r\n @State() showChatModal: boolean = false;\r\n\r\n // 使用 @Element 装饰器获取组件的 host 元素\r\n @Element() hostElement: HTMLElement;\r\n\r\n @State() jobDescription: string = '';\r\n @State() isSubmitting: boolean = false;\r\n\r\n private tokenInvalidListener: () => void;\r\n private removeErrorListener: () => void;\r\n\r\n // 添加对子组件的引用\r\n private virtualChatModalRef: HTMLPcmVirtualChatModalElement | null = null;\r\n\r\n @Watch('token')\r\n handleTokenChange(newToken: string) {\r\n // 当传入的 token 变化时,更新 authStore 中的 token\r\n if (newToken && newToken !== authStore.getToken()) {\r\n authStore.setToken(newToken);\r\n }\r\n }\r\n\r\n\r\n @Watch('isOpen')\r\n async handleIsOpenChange(newValue: boolean) {\r\n if (!newValue) {\r\n // 当模态框关闭时,调用子组件方法停止所有活动\r\n if (this.virtualChatModalRef) {\r\n await this.virtualChatModalRef.setComponentActive(false);\r\n }\r\n // 重置状态\r\n this.resetState();\r\n } else {\r\n if (this.customInputs && this.customInputs.job_info) {\r\n this.jobDescription = this.customInputs.job_info;\r\n }\r\n\r\n await verifyApiKey(this.token);\r\n\r\n // 如果同时有 file_url 和 job_info,或者有会话ID,直接显示聊天模态框\r\n if (((this.customInputs?.file_url || this.customInputs?.resume_content || this.skipResumeUpload) && this.customInputs?.job_info) || this.conversationId) {\r\n this.showChatModal = true;\r\n }\r\n }\r\n }\r\n\r\n\r\n\r\n componentWillLoad() {\r\n // 将 zIndex 存入配置缓存\r\n if (this.zIndex) {\r\n configStore.setItem('modal-zIndex', this.zIndex);\r\n }\r\n\r\n if (this.token) {\r\n authStore.setToken(this.token);\r\n }\r\n\r\n verifyApiKey(this.token);\r\n\r\n // 添加全局token无效事件监听器\r\n this.tokenInvalidListener = () => {\r\n this.tokenInvalid.emit();\r\n };\r\n\r\n // 添加全局错误监听\r\n this.removeErrorListener = ErrorEventBus.addErrorListener((errorDetail) => {\r\n this.someErrorEvent.emit(errorDetail);\r\n });\r\n\r\n document.addEventListener('pcm-token-invalid', this.tokenInvalidListener);\r\n }\r\n\r\n disconnectedCallback() {\r\n // 组件销毁时移除事件监听器\r\n document.removeEventListener('pcm-token-invalid', this.tokenInvalidListener);\r\n // 移除错误监听器\r\n if (this.removeErrorListener) {\r\n this.removeErrorListener();\r\n }\r\n }\r\n\r\n /**\r\n * 重置组件状态\r\n */\r\n private resetState() {\r\n this.showChatModal = false;\r\n this.jobDescription = '';\r\n this.isSubmitting = false;\r\n this.selectedFile = null;\r\n this.isUploading = false;\r\n this.uploadedFileInfo = null;\r\n }\r\n\r\n private handleClose = () => {\r\n this.modalClosed.emit();\r\n };\r\n\r\n private handleJobDescriptionChange = (event: Event) => {\r\n const textarea = event.target as HTMLTextAreaElement;\r\n this.jobDescription = textarea.value;\r\n };\r\n\r\n private handleStartInterview = async () => {\r\n // 如果没有预设的job_info,则需要检查用户输入\r\n if (!this.customInputs?.job_info && !this.jobDescription.trim()) {\r\n alert('请输入职位描述');\r\n return;\r\n }\r\n // 判断文件是否正在上传\r\n if (await this.pcmUploadRef?.getIsUploading?.()) {\r\n Message.info('文件上传中,请稍后');\r\n return;\r\n }\r\n this.isSubmitting = true;\r\n this.showChatModal = true;\r\n };\r\n\r\n private pcmUploadRef;\r\n\r\n render() {\r\n if (!this.isOpen) return null;\r\n\r\n const modalStyle = {\r\n zIndex: String(this.zIndex)\r\n };\r\n\r\n\r\n const containerClass = {\r\n 'modal-container': true,\r\n 'fullscreen': this.fullscreen,\r\n 'pc-layout': true,\r\n };\r\n\r\n const overlayClass = {\r\n 'modal-overlay': true,\r\n 'fullscreen-overlay': this.fullscreen\r\n };\r\n\r\n // 显示加载状态\r\n const isLoading = this.conversationId && !this.showChatModal;\r\n\r\n // 修正这里的逻辑,确保当 customInputs.job_info 存在时,hideJdInput 为 true\r\n const hideJdInput = Boolean(this.customInputs && this.customInputs.job_info);\r\n\r\n // 判断是否隐藏简历上传区域 - 当有file_url或resume_content时都隐藏\r\n const hideResumeUpload = Boolean(this.customInputs && (this.customInputs.file_url || this.customInputs.resume_content)) || !!this.skipResumeUpload;\r\n\r\n // 判断是否同时提供了(file_url或resume_content)和job_info\r\n const hasFileAndJob = Boolean((this.customInputs?.file_url || this.customInputs?.resume_content) && this.customInputs?.job_info);\r\n\r\n return (\r\n <div class={overlayClass} style={modalStyle}>\r\n <div class={containerClass}>\r\n {this.isShowHeader && (\r\n <div class=\"modal-header\">\r\n <div class=\"header-left\">\r\n {this.icon && <img src={this.icon} class=\"header-icon\" alt=\"应用图标\" />}\r\n <div>{this.modalTitle}</div>\r\n </div>\r\n {this.isNeedClose && (\r\n <button class=\"close-button\" onClick={this.handleClose}>\r\n <span>×</span>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* 上传界面 - 仅在不显示聊天模态框且没有会话ID且没有同时提供file_url和job_info时显示 */}\r\n {!this.showChatModal && !this.conversationId && !hasFileAndJob && (\r\n <div class=\"input-container\">\r\n {/* JD输入区域 - 仅在没有customInputs.job_info时显示 */}\r\n {!hideJdInput && (\r\n <div class=\"jd-input-section\">\r\n <label htmlFor=\"job-description\">请输入职位描述 (JD)</label>\r\n {\r\n !!this.mobileJdInputAble && (\r\n <components-mobile-input-btn\r\n name=\"职位描述\"\r\n onOk={(e) => {\r\n this.jobDescription = e.detail;\r\n }}\r\n />\r\n )\r\n }\r\n <textarea\r\n id=\"job-description\"\r\n class=\"job-description-textarea\"\r\n placeholder=\"请输入职位描述,包括职责、要求等信息...\"\r\n rows={6}\r\n value={this.jobDescription}\r\n onInput={this.handleJobDescriptionChange}\r\n ></textarea>\r\n </div>\r\n )}\r\n\r\n {/* 简历上传区域 - 仅在没有customInputs.file_url或customInputs.resume_content时显示 */}\r\n {\r\n !hideResumeUpload && (\r\n <div class=\"jd-input-section\">\r\n <label>上传简历(选填)</label>\r\n <components-upload\r\n ref={el => this.pcmUploadRef = el}\r\n maxFileSize={15 * 1024 * 1024}\r\n multiple={false}\r\n mobileUploadAble={this.mobileUploadAble}\r\n acceptFileSuffixList={['.txt', '.md', '.pdf', '.docx', '.doc']}\r\n uploadParams={{\r\n tags: ['resume'],\r\n }}\r\n onUploadChange={(e) => {\r\n const result: FileUploadResponse[] = e.detail ?? [];\r\n this.uploadedFileInfo = result[0];\r\n this.uploadSuccess.emit(this.uploadedFileInfo);\r\n }}\r\n />\r\n </div>\r\n )\r\n }\r\n\r\n <button\r\n class=\"submit-button\"\r\n disabled={(!hideJdInput && !this.jobDescription.trim()) || this.isUploading || this.isSubmitting}\r\n onClick={this.handleStartInterview}\r\n >\r\n {this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始面试'}\r\n </button>\r\n\r\n <div class=\"ai-disclaimer\">\r\n <p>所有内容均由AI生成仅供参考</p>\r\n <p class=\"beian-info\">\r\n <span>中央网信办生成式人工智能服务备案号</span>:\r\n <a href=\"https://www.pincaimao.com\" target=\"_blank\" rel=\"noopener noreferrer\">Hunan-PinCaiMao-202412310003</a>\r\n </p>\r\n </div>\r\n </div>\r\n )}\r\n\r\n {/* 加载状态 - 在有会话ID但聊天模态框尚未显示时展示 */}\r\n {isLoading && (\r\n <div class=\"loading-container\">\r\n <div class=\"loading-spinner\"></div>\r\n <p class=\"loading-text\">正在加载对话...</p>\r\n </div>\r\n )}\r\n\r\n {/* 聊天界面 - 在显示聊天模态框时显示 */}\r\n {this.showChatModal && (\r\n <div >\r\n {this.enableVirtualHuman && this.digitalId ? (\r\n <pcm-virtual-chat-modal\r\n ref={el => this.virtualChatModalRef = el}\r\n isOpen={true}\r\n fullscreen={this.fullscreen}\r\n botId=\"3022316191018884\"\r\n digitalId={this.digitalId}\r\n openingIndex={this.openingIndex}\r\n conversationId={this.conversationId}\r\n defaultQuery={this.defaultQuery}\r\n waitingTime={this.waitingTime}\r\n playbackRate={this.playbackRate}\r\n showEndInterviewButton={this.showEndInterviewButton}\r\n customInputs={{\r\n ...this.customInputs,\r\n file_url: this.customInputs?.file_url || this.uploadedFileInfo?.cos_key,\r\n file_name: this.customInputs?.file_name || this.uploadedFileInfo?.file_name,\r\n job_info: this.customInputs?.job_info || this.jobDescription,\r\n question_number: this.customInputs?.question_number || 5,\r\n ai_interview_type: this.digitalId\r\n }}\r\n ></pcm-virtual-chat-modal>\r\n ) : (\r\n <pcm-app-chat-modal\r\n isOpen={true}\r\n modalTitle={this.modalTitle}\r\n icon={this.icon}\r\n isShowHeader={this.isShowHeader}\r\n isNeedClose={this.isShowHeader}\r\n fullscreen={this.fullscreen}\r\n showWorkspaceHistory={this.showWorkspaceHistory}\r\n botId=\"3022316191018884\"\r\n digitalId={this.digitalId}\r\n conversationId={this.conversationId}\r\n defaultQuery={this.defaultQuery}\r\n maxRecordingTime={this.maxRecordingTime}\r\n waitingTime={this.waitingTime}\r\n playbackRate={this.playbackRate}\r\n showCopyButton={this.showCopyButton}\r\n showFeedbackButtons={this.showFeedbackButtons}\r\n showEndInterviewButton={this.showEndInterviewButton}\r\n customInputs={{\r\n ...this.customInputs,\r\n file_url: this.customInputs?.file_url || this.uploadedFileInfo?.cos_key,\r\n file_name: this.customInputs?.file_name || this.uploadedFileInfo?.file_name,\r\n job_info: this.customInputs?.job_info || this.jobDescription,\r\n question_number: this.customInputs?.question_number || 5,\r\n ai_interview_type: this.digitalId || (this.interviewMode === 'video' ? \"2\" : \"1\"),\r\n }}\r\n interviewMode={this.interviewMode}\r\n ></pcm-app-chat-modal>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n} "],"mappings":"mLAAA,MAAMA,EAAkB,GCAxB,MAAMC,EAAY,ysSCAlB,MAAMC,EAAU,4wB,MCsBHC,EAAS,M,iYAIVC,WAAqB,OAKCC,MAKLC,OAAkB,MAKlCC,YAKDC,KAKAC,OAAkB,IAKlBC,aAAwB,KAKxBC,YAAuB,KAKNC,eAKjBC,aAAuB,UAKvBC,iBAA2B,IAK3BC,YAAsB,GAKtBC,WAAsB,MAYtBC,aAAuC,GAKvCC,qBAAgC,MAKhCC,kBAA6B,MAK7BC,iBAA4B,MAQ5BC,UAQAC,aAAuB,EAKvBC,mBAA8B,MAK9BC,uBAAkC,MAKlCC,aAAuB,EAKtBC,cAKAC,eAKAC,kBAKAC,kBAKAC,aAKAC,eAMDC,cAAkC,OAKlCC,iBAA4B,MAK3BC,eAKDC,eAA0B,KAK1BC,oBAA+B,KAG9BC,aAA4B,KAC5BC,YAAuB,MACvBC,iBAA8C,KAC9CC,cAAyB,M,iCAKzBC,eAAyB,GACzBC,aAAwB,MAEzBC,qBACAC,oBAGAC,oBAA6D,KAGrE,iBAAAC,CAAkBC,GAEd,GAAIA,GAAYA,IAAaC,EAAUC,WAAY,CAC/CD,EAAUE,SAASH,E,EAM3B,wBAAMI,CAAmBC,GACrB,IAAKA,EAAU,CAEX,GAAIC,KAAKR,oBAAqB,OACpBQ,KAAKR,oBAAoBS,mBAAmB,M,CAGtDD,KAAKE,Y,KACF,CACH,GAAIF,KAAKpC,cAAgBoC,KAAKpC,aAAauC,SAAU,CACjDH,KAAKZ,eAAiBY,KAAKpC,aAAauC,Q,OAGtCC,EAAaJ,KAAKhD,OAGxB,IAAMgD,KAAKpC,cAAcyC,UAAYL,KAAKpC,cAAc0C,gBAAkBN,KAAKpB,mBAAqBoB,KAAKpC,cAAcuC,UAAaH,KAAKzC,eAAgB,CACrJyC,KAAKb,cAAgB,I,GAOjC,iBAAAoB,GAEI,GAAIP,KAAK5C,OAAQ,CACboD,EAAYC,QAAQ,eAAgBT,KAAK5C,O,CAG7C,GAAI4C,KAAKhD,MAAO,CACZ2C,EAAUE,SAASG,KAAKhD,M,CAG5BoD,EAAaJ,KAAKhD,OAGlBgD,KAAKV,qBAAuB,KACxBU,KAAKvB,aAAaiC,MAAM,EAI5BV,KAAKT,oBAAsBoB,EAAcC,kBAAkBC,IACvDb,KAAKtB,eAAegC,KAAKG,EAAY,IAGzCC,SAASC,iBAAiB,oBAAqBf,KAAKV,qB,CAGxD,oBAAA0B,GAEIF,SAASG,oBAAoB,oBAAqBjB,KAAKV,sBAEvD,GAAIU,KAAKT,oBAAqB,CAC1BS,KAAKT,qB,EAOL,UAAAW,GACJF,KAAKb,cAAgB,MACrBa,KAAKZ,eAAiB,GACtBY,KAAKX,aAAe,MACpBW,KAAKhB,aAAe,KACpBgB,KAAKf,YAAc,MACnBe,KAAKd,iBAAmB,I,CAGpBgC,YAAc,KAClBlB,KAAK9C,YAAYwD,MAAM,EAGnBS,2BAA8BC,IAClC,MAAMC,EAAWD,EAAME,OACvBtB,KAAKZ,eAAiBiC,EAASE,KAAK,EAGhCC,qBAAuBC,UAE3B,IAAKzB,KAAKpC,cAAcuC,WAAaH,KAAKZ,eAAesC,OAAQ,CAC7DC,MAAM,WACN,M,CAGJ,SAAU3B,KAAK4B,cAAcC,oBAAoB,CAC7CC,EAAQC,KAAK,aACb,M,CAEJ/B,KAAKX,aAAe,KACpBW,KAAKb,cAAgB,IAAI,EAGrByC,aAER,MAAAI,GACI,IAAKhC,KAAK/C,OAAQ,OAAO,KAEzB,MAAMgF,EAAa,CACf7E,OAAQ8E,OAAOlC,KAAK5C,SAIxB,MAAM+E,EAAiB,CACnB,kBAAmB,KACnBxE,WAAcqC,KAAKrC,WACnB,YAAa,MAGjB,MAAMyE,EAAe,CACjB,gBAAiB,KACjB,qBAAsBpC,KAAKrC,YAI/B,MAAM0E,EAAYrC,KAAKzC,iBAAmByC,KAAKb,cAG/C,MAAMmD,EAAcC,QAAQvC,KAAKpC,cAAgBoC,KAAKpC,aAAauC,UAGnE,MAAMqC,EAAmBD,QAAQvC,KAAKpC,eAAiBoC,KAAKpC,aAAayC,UAAYL,KAAKpC,aAAa0C,oBAAsBN,KAAKpB,iBAGlI,MAAM6D,EAAgBF,SAASvC,KAAKpC,cAAcyC,UAAYL,KAAKpC,cAAc0C,iBAAmBN,KAAKpC,cAAcuC,UAEvH,OACIuC,EAAA,OAAKC,MAAOP,EAAcQ,MAAOX,GAC7BS,EAAK,OAAAC,MAAOR,GACPnC,KAAK3C,cACFqF,EAAK,OAAAC,MAAM,gBACPD,EAAK,OAAAC,MAAM,eACN3C,KAAK7C,MAAQuF,EAAK,OAAAG,IAAK7C,KAAK7C,KAAMwF,MAAM,cAAcG,IAAI,SAC3DJ,EAAA,WAAM1C,KAAKjD,aAEdiD,KAAK1C,aACFoF,EAAQ,UAAAC,MAAM,eAAeI,QAAS/C,KAAKkB,aACvCwB,EAAc,oBAO5B1C,KAAKb,gBAAkBa,KAAKzC,iBAAmBkF,GAC7CC,EAAK,OAAAC,MAAM,oBAELL,GACEI,EAAK,OAAAC,MAAM,oBACPD,EAAO,SAAAM,QAAQ,mBAAsC,kBAE/ChD,KAAKlC,mBACH4E,EACI,+BAAAO,KAAK,OACLC,KAAOC,IACHnD,KAAKZ,eAAiB+D,EAAEC,MAAM,IAK9CV,EAAA,YACIW,GAAG,kBACHV,MAAM,2BACNW,YAAY,wBACZC,KAAM,EACNhC,MAAOvB,KAAKZ,eACZoE,QAASxD,KAAKmB,+BAOrBqB,GACGE,EAAK,OAAAC,MAAM,oBACPD,EAAuB,yBACvBA,EACI,qBAAAe,IAAKC,GAAM1D,KAAK4B,aAAe8B,EAC/BC,YAAa,GAAK,KAAO,KACzBC,SAAU,MACV7F,iBAAkBiC,KAAKjC,iBACvB8F,qBAAsB,CAAC,OAAQ,MAAO,OAAQ,QAAS,QACvDC,aAAc,CACVC,KAAM,CAAC,WAEXC,eAAiBb,IACb,MAAMc,EAA+Bd,EAAEC,QAAU,GACjDpD,KAAKd,iBAAmB+E,EAAO,GAC/BjE,KAAK3B,cAAcqC,KAAKV,KAAKd,iBAAiB,KAOlEwD,EACI,UAAAC,MAAM,gBACNuB,UAAY5B,IAAgBtC,KAAKZ,eAAesC,QAAW1B,KAAKf,aAAee,KAAKX,aACpF0D,QAAS/C,KAAKwB,sBAEbxB,KAAKf,YAAc,SAAWe,KAAKX,aAAe,SAAW,QAGlEqD,EAAK,OAAAC,MAAM,iBACPD,EAAqB,2BACrBA,EAAG,KAAAC,MAAM,cACLD,EAA8B,qCAC9BA,EAAA,KAAGyB,KAAK,4BAA4B7C,OAAO,SAAS8C,IAAI,uBAAqB,mCAO5F/B,GACGK,EAAK,OAAAC,MAAM,qBACPD,EAAK,OAAAC,MAAM,oBACXD,EAAA,KAAGC,MAAM,gBAAc,cAK9B3C,KAAKb,eACFuD,EACK,WAAA1C,KAAK9B,oBAAsB8B,KAAKhC,UAC7B0E,EAAA,0BACIe,IAAKC,GAAM1D,KAAKR,oBAAsBkE,EACtCzG,OAAQ,KACRU,WAAYqC,KAAKrC,WACjB0G,MAAM,mBACNrG,UAAWgC,KAAKhC,UAChBC,aAAc+B,KAAK/B,aACnBV,eAAgByC,KAAKzC,eACrBC,aAAcwC,KAAKxC,aACnBE,YAAasC,KAAKtC,YAClBU,aAAc4B,KAAK5B,aACnBD,uBAAwB6B,KAAK7B,uBAC7BP,aAAc,IACPoC,KAAKpC,aACRyC,SAAUL,KAAKpC,cAAcyC,UAAYL,KAAKd,kBAAkBoF,QAChEC,UAAWvE,KAAKpC,cAAc2G,WAAavE,KAAKd,kBAAkBqF,UAClEpE,SAAUH,KAAKpC,cAAcuC,UAAYH,KAAKZ,eAC9CoF,gBAAiBxE,KAAKpC,cAAc4G,iBAAmB,EACvDC,kBAAmBzE,KAAKhC,aAIhC0E,EACI,sBAAAzF,OAAQ,KACRF,WAAYiD,KAAKjD,WACjBI,KAAM6C,KAAK7C,KACXE,aAAc2C,KAAK3C,aACnBC,YAAa0C,KAAK3C,aAClBM,WAAYqC,KAAKrC,WACjBE,qBAAsBmC,KAAKnC,qBAC3BwG,MAAM,mBACNrG,UAAWgC,KAAKhC,UAChBT,eAAgByC,KAAKzC,eACrBC,aAAcwC,KAAKxC,aACnBC,iBAAkBuC,KAAKvC,iBACvBC,YAAasC,KAAKtC,YAClBU,aAAc4B,KAAK5B,aACnBU,eAAgBkB,KAAKlB,eACrBC,oBAAqBiB,KAAKjB,oBAC1BZ,uBAAwB6B,KAAK7B,uBAC7BP,aAAc,IACPoC,KAAKpC,aACRyC,SAAUL,KAAKpC,cAAcyC,UAAYL,KAAKd,kBAAkBoF,QAChEC,UAAWvE,KAAKpC,cAAc2G,WAAavE,KAAKd,kBAAkBqF,UAClEpE,SAAUH,KAAKpC,cAAcuC,UAAYH,KAAKZ,eAC9CoF,gBAAiBxE,KAAKpC,cAAc4G,iBAAmB,EACvDC,kBAAmBzE,KAAKhC,YAAcgC,KAAKrB,gBAAkB,QAAU,IAAM,MAEjFA,cAAeqB,KAAKrB,kB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as e,c as t,g as i,h as s}from"./p-Bq0K-WqZ.js";import{a as o,c as n,u as r,b as a,s as l,d,v as c}from"./p-Bktjt_YJ.js";import{E as h}from"./p-C0FYX2-Z.js";import{S as p}from"./p-B4ClCdh9.js";import"./p-Bs-zO1WZ.js";const u=":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:5vh auto auto 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 g=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const m=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.someErrorEvent=t(this,"someErrorEvent");this.interviewComplete=t(this,"interviewComplete");this.recordingError=t(this,"recordingError");this.recordingStatusChange=t(this,"recordingStatusChange");this.tokenInvalid=t(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 i(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(e){if(e&&e!==o.getToken()){o.setToken(e)}}componentWillLoad(){if(this.zIndex){n.setItem("modal-zIndex",this.zIndex)}if(this.token){o.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener);this.visibilityChangeListener=()=>{const e=!document.hidden;this.isWindowVisible=e;if(!e){p.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;p.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 e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};async uploadFile(){if(!this.selectedFile||this.uploadedFileInfo.length>0)return;this.isUploading=true;try{const e=await r(this.selectedFile,{},{tags:["resume"]});if(e){this.uploadedFileInfo=[{cos_key:e.cos_key,file_name:e.file_name,file_size:e.file_size,ext:e.ext}]}}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();this.someErrorEvent.emit({error:e,message:"文件上传失败,请重试"});p.captureError(e,{action:"uploadFile",component:"pcm-hr-chat-modal",title:"文件上传失败"})}finally{this.isUploading=false}}handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=[];const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async sendMessageToAPI(e){this.isLoading=true;let t="";let i="";const s=new Date;const o=`${s.getHours()}:${s.getMinutes().toString().padStart(2,"0")}`;const n=e.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const r=this.messages.length>0?this.messages[this.messages.length-1]:null;if(r&&this.conversationId&&e!=="下一题"){this.saveAnswer(this.conversationId,r.answer,n)}const l=this.currentQuestionNumber>=this.totalQuestions&&e==="下一题";const c={id:`temp-${Date.now()}`,time:o,query:n,answer:"",isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=c;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);if(l){this.messages=[...this.messages,c];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 u={response_mode:"streaming",conversation_id:this.conversationId,query:n,bot_id:"3022316191018880"};u.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 e=this.uploadedFileInfo.map((e=>e.cos_key)).join(",");u.inputs.file_urls=e}await a({url:"/sdk/v1/chat/chat-messages",method:"POST",data:u,onMessage:e=>{if(e.conversation_id&&!this.conversationId){this.conversationId=e.conversation_id;this.conversationStart.emit({conversation_id:e.conversation_id,event:e.event,message_id:e.message_id,id:e.id})}if(e.event==="node_finished"&&e.data.inputs&&e.data.inputs.LLMText){i=e.data.inputs.LLMText}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("异常请重试")){this.currentStreamingMessage.showRetryButton=true;this.aiException=true}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("题号赋值")){this.currentQuestionNumber=e.data.process_data.questions_number-1}if(e.event==="message"){if(e.event==="agent_message"||e.event==="message"){if(e.answer){t+=e.answer;const i={...this.currentStreamingMessage,answer:t,isStreaming:true};this.currentStreamingMessage=i;setTimeout((()=>{this.scrollToBottom()}),200)}}}if(e.event==="error"){const t=e.data?.message||e.message||"请求失败";this.messages=[...this.messages,{...c,answer:t,error:e.data,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false;h.emitError({error:e.data,message:t});return}if(e.event==="message_end"){this.streamComplete.emit({conversation_id:e.conversation_id||"",event:e.event,message_id:e.message_id,id:e.id})}},onError:t=>{console.error("发生错误:",t);this.someErrorEvent.emit({error:t,message:"消息发送失败,请稍后再试"});p.captureError(t,{action:"sendMessageToAPI",component:"pcm-hr-chat-modal",message:e,title:"消息发送失败"});this.messages=[...this.messages,{...c,answer:"消息发送失败,请检查网络。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const e=this.currentStreamingMessage;e.isStreaming=false;this.currentStreamingMessage=null;this.messages=[...this.messages,e];if(!this.aiException){if(this.enableAudio&&e&&e.answer){const t=i||e.answer;if(t){const e=await d(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}else if(!this.enableAudio){this.startWaitingToRecord()}}}})}async saveAnswer(e,t,i){try{await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:e,question:t,answer:i}})}catch(t){console.error("保存答案失败:",t);this.someErrorEvent.emit({error:t,message:"保存答案失败,请稍后再试"});p.captureError(t,{action:"saveAnswer",component:"pcm-hr-chat-modal",conversationId:e,title:"保存答案失败"})}}handleScroll=()=>{if(this.isUserScrolling){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!e)return;const{scrollTop:t,scrollHeight:i,clientHeight:s}=e;const o=i-t-s;this.shouldAutoScroll=o<=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 e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(e&&this.isOpen){e.scrollTop=e.scrollHeight}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;let e=false;try{const t=await l({url:`/sdk/v1/hr_competition/${this.conversationId}`,method:"GET"});if(t.success&&t.data&&t.data.ended==1){e=true}const i=await l({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:"3022316191018880",limit:20}});if(i.success&&i.data){const e=i.data.data||[];const t=e.map((e=>{const t=new Date(e.created_at*1e3);const i=t.getHours().toString().padStart(2,"0");const s=t.getMinutes().toString().padStart(2,"0");const o=`${i}:${s}`;const{inputs:n,...r}=e;return{...r,time:o,isStreaming:false,status:e.status==="error"?"error":"normal"}}));this.messages=t;const s=t.filter((e=>!(e.answer&&(e.answer.includes("请求超时")||e.answer.includes("网络有点拥堵")||e.status==="error"))));this.currentQuestionNumber=s.length>0?s.length:0}}catch(e){console.error("加载历史消息或面试状态失败:",e);this.someErrorEvent.emit({error:e,message:"加载历史消息失败,请刷新重试"});p.captureError(e,{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&&!e){const e=this.messages[this.messages.length-1];if(e&&e.answer&&this.enableAudio){const t=await d(e.answer);if(this.enableVoice){await this.playAudio(t);this.startWaitingToRecord()}else{this.audioUrl=t}}else if(!this.enableAudio){this.startWaitingToRecord()}else{this.sendMessageToAPI("下一题")}}else if(e){this.currentQuestionNumber++;this.isTaskCompleted=true;setTimeout((()=>{this.interviewComplete.emit()}),100)}}),300)}}async handleIsOpenChange(e){if(e){await c(this.token);if(this.conversationId){this.showInitialUpload=false;await this.loadHistoryMessages()}}}handleJobCategorySelect=e=>{this.selectedJobCategory=e};handleDimensionSelect=e=>{if(this.selectedDimensions.includes(e)){this.selectedDimensions=this.selectedDimensions.filter((t=>t!==e))}else{this.selectedDimensions=[...this.selectedDimensions,e]}};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 e=`我是一名${this.selectedJobCategory},请您开始提问`;this.sendMessageToAPI(e)};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 e=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.recordingStream=e;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(e);const t=this.getSupportedMimeType();let i;try{i=new MediaRecorder(e,{mimeType:t,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){console.warn("指定的MIME类型不受支持,使用默认设置:",t);try{i=new MediaRecorder(e,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){try{i=new MediaRecorder(e)}catch(e){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:e});this.showRecordingUI=false;return}}}this.mediaRecorder=i;const s=[];i.ondataavailable=e=>{if(e.data.size>0){s.push(e.data)}};i.onerror=e=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:e});this.stopRecording()};i.onstop=()=>{try{const e=t||"video/mp4";const i=new Blob(s,{type:e});if(i.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=i;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:i.size,type:i.type}});this.uploadRecordedVideo()}catch(e){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:e});this.showRecordingUI=false;p.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{i.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:i.mimeType}})}catch(e){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:e});this.showRecordingUI=false;p.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"开始录制失败"});return}this.recordingTimer=setInterval((()=>{const e=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-e);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(e){console.error("无法访问摄像头或麦克风:",e);this.showRecordingUI=false;this.recordingError.emit({type:"media_access_failed",message:"无法访问摄像头或麦克风,请确保已授予权限",details:e});p.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"无法访问摄像头或麦克风"})}}setupVideoPreview(e){setTimeout((()=>{const t=this.hostElement.shadowRoot?.querySelector("video");if(t&&e){try{t.srcObject=e;t.play().catch((e=>{console.error("视频播放失败:",e);this.someErrorEvent.emit({error:e,message:"视频播放失败"});p.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"录制视频显示失败"})}))}catch(i){console.warn("设置srcObject失败,尝试替代方法:",i);try{const i=URL.createObjectURL(e);t.src=i;t.onended=()=>{URL.revokeObjectURL(i)}}catch(e){console.error("创建对象URL失败:",e);this.someErrorEvent.emit({error:e,message:"创建对象URL失败"});p.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"创建对象URL失败"})}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const e=["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 t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查MIME类型支持时出错 ${t}:`,e)}}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((e=>e.stop()));this.recordingStream=null}this.videoRef=null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const e=this.recordedBlob.type.includes("webm")?"webm":"mp4";const t=`answer.${e}`;const i=new File([this.recordedBlob],t,{type:this.recordedBlob.type});const s=await r(i,{},{tags:["other"]});if(s){await this.saveVideoAnswer(s.cos_key);this.sendMessageToAPI("下一题")}else{throw new Error("视频上传失败")}}catch(e){console.error("视频上传错误:",e);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:e});p.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"视频上传失败"})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}async saveVideoAnswer(e){if(!this.conversationId)return;try{const t=this.messages.length>0?this.messages[this.messages.length-1]:null;if(!t)return;await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:this.conversationId,question:t.answer,file_url:e}})}catch(e){console.error("保存视频答案失败:",e);this.someErrorEvent.emit({error:e,message:"保存视频答案失败"});p.captureError(e,{action:"saveVideoAnswer",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"保存视频答案失败"})}}async completeInterview(){if(!this.conversationId)return;try{await l({url:`/sdk/v1/hr_competition/${this.conversationId}/end`,method:"POST"})}catch(e){console.error("发送面试完成请求失败:",e);this.someErrorEvent.emit({error:e,message:"发送面试完成请求失败"});p.captureError(e,{action:"completeInterview",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"发送面试完成请求失败"})}}playAudio(e){return new Promise((t=>{this.isPlayingAudio=true;this.audioUrl=e;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=e;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;t()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:"音频播放错误",message:"音频播放错误"});p.captureMessage("音频播放错误",{action:"playAudio",component:"pcm-hr-chat-modal",title:"音频播放错误"});t()};this.audioElement.play().catch((e=>{console.error("音频播放失败:",e);this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:e,message:"音频播放失败"});p.captureError(e,{title:"音频播放失败",action:"playAudio",component:"pcm-hr-chat-modal"});t()}))}))}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=e=>{const t=this.messages.find((t=>t.id===e));if(t){this.aiException=false;const i=this.messages.map((t=>t.id===e?{...t,showRetryButton:false}:t));this.messages=i;this.sendMessageToAPI(t.query)}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const o=()=>s("div",{class:"video-preview"},s("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:e=>{if(e&&this.recordingStream&&!this.videoRef){this.videoRef=e}}}),s("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},s("span",{class:"recording-dot"}),s("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const n=()=>{if(this.isTaskCompleted){return s("div",{class:"placeholder-status"},s("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return s("div",{class:"placeholder-status"},s("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return s("div",{class:"placeholder-status"},s("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return s("div",{class:"placeholder-status"},s("p",null,"请等待题目..."))}if(this.waitingToRecord){return s("div",{class:"placeholder-status"},s("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return s("div",{class:"placeholder-status default-status"},s("p",null,"准备中..."))};return s("div",{class:i,style:e},s("div",{class:t},this.isShowHeader&&s("div",{class:"modal-header"},s("div",{class:"header-left"},this.icon&&s("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),s("div",null,this.modalTitle)),this.isNeedClose&&s("button",{class:"close-button",onClick:this.handleClose},s("span",null,"×"))),this.showInitialUpload?s("div",{class:"initial-upload"},s("div",{class:"upload-section"},this.requireResume&&s(s.Fragment,null,s("h3",null,"开始前,请上传您的简历"),s("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?s("div",{class:"file-item"},s("div",{class:"file-item-content"},s("span",{class:"file-icon"},"📝"),s("span",{class:"file-name"},this.selectedFile.name)),s("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):s("div",{class:"upload-placeholder"},s("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),s("p",{class:"upload-text"},"点击上传简历"),s("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),s("div",{class:"category-select"},s("h3",null,"请选择您的职能类别(单选)"),s("div",{class:"category-options"},this.jobCategories.map((e=>s("button",{class:{"category-button":true,selected:this.selectedJobCategory===e},onClick:()=>this.handleJobCategorySelect(e)},e))))),s("div",{class:"dimension-select"},s("h3",null,"请选择关注的模块(可多选)"),s("div",{class:"dimension-options"},this.dimensions.map((e=>s("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(e)},onClick:()=>this.handleDimensionSelect(e)},e))))),s("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&&s("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):s("div",{style:{height:"100%"}},s("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?s("div",{class:"loading-container"},s("div",{class:"loading-spinner"}),s("p",null,"加载历史消息中...")):s("div",null,this.messages.map((e=>s("div",{id:`message_${e.id}`,key:e.id},s("components-chat-message",{message:e,onRetryRequest:e=>this.handleRetryRequest(e.detail),showCopyButton:false,showFeedbackButtons:false})))),this.currentStreamingMessage&&s("div",{id:`message_${this.currentStreamingMessage.id}`},s("components-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&s("div",{class:"empty-state"},s("p",null,"请上传简历开始面试")))),s("div",{class:"recording-section"},s("div",{class:"recording-container"},s("div",{class:"video-area"},this.showRecordingUI?o():s("div",{class:"video-preview placeholder"},n())),s("div",{class:"progress-container"},s("div",{class:"progress-bar-container"},s("div",{class:"progress-bar",style:{width:`${Math.max(0,this.currentQuestionNumber-1)/this.totalQuestions*100}%`}})),s("div",{class:"progress-text"},"已完成",Math.max(0,this.currentQuestionNumber-1),"/",this.totalQuestions)),s("div",{class:"recording-controls"},this.showRecordingUI?s("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):s("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return s("div",{class:"play-audio-container",onClick:this.handlePlayAudio},s("p",null,s("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},s("path",{d:"M8 5v14l11-7z"})),s("span",{style:{verticalAlign:"middle"}},"播放题目")))}return s("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};m.style=u+g;export{m as pcm_hr_chat_modal};
2
- //# sourceMappingURL=p-8256890d.entry.js.map
1
+ import{r as e,c as t,g as i,h as s}from"./p-Bq0K-WqZ.js";import{a as o,c as n,u as r,b as a,s as l,d,v as c}from"./p-C3qMuJRQ.js";import{E as h}from"./p-C0FYX2-Z.js";import{S as p}from"./p-Ch9kExOi.js";import"./p-Bs-zO1WZ.js";const u=":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:5vh auto auto 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 g=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const m=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.someErrorEvent=t(this,"someErrorEvent");this.interviewComplete=t(this,"interviewComplete");this.recordingError=t(this,"recordingError");this.recordingStatusChange=t(this,"recordingStatusChange");this.tokenInvalid=t(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 i(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(e){if(e&&e!==o.getToken()){o.setToken(e)}}componentWillLoad(){if(this.zIndex){n.setItem("modal-zIndex",this.zIndex)}if(this.token){o.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener);this.visibilityChangeListener=()=>{const e=!document.hidden;this.isWindowVisible=e;if(!e){p.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;p.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 e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};async uploadFile(){if(!this.selectedFile||this.uploadedFileInfo.length>0)return;this.isUploading=true;try{const e=await r(this.selectedFile,{},{tags:["resume"]});if(e){this.uploadedFileInfo=[{cos_key:e.cos_key,file_name:e.file_name,file_size:e.file_size,ext:e.ext}]}}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();this.someErrorEvent.emit({error:e,message:"文件上传失败,请重试"});p.captureError(e,{action:"uploadFile",component:"pcm-hr-chat-modal",title:"文件上传失败"})}finally{this.isUploading=false}}handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=[];const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async sendMessageToAPI(e){this.isLoading=true;let t="";let i="";const s=new Date;const o=`${s.getHours()}:${s.getMinutes().toString().padStart(2,"0")}`;const n=e.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const r=this.messages.length>0?this.messages[this.messages.length-1]:null;if(r&&this.conversationId&&e!=="下一题"){this.saveAnswer(this.conversationId,r.answer,n)}const l=this.currentQuestionNumber>=this.totalQuestions&&e==="下一题";const c={id:`temp-${Date.now()}`,time:o,query:n,answer:"",isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=c;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);if(l){this.messages=[...this.messages,c];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 u={response_mode:"streaming",conversation_id:this.conversationId,query:n,bot_id:"3022316191018880"};u.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 e=this.uploadedFileInfo.map((e=>e.cos_key)).join(",");u.inputs.file_urls=e}await a({url:"/sdk/v1/chat/chat-messages",method:"POST",data:u,onMessage:e=>{if(e.conversation_id&&!this.conversationId){this.conversationId=e.conversation_id;this.conversationStart.emit({conversation_id:e.conversation_id,event:e.event,message_id:e.message_id,id:e.id})}if(e.event==="node_finished"&&e.data.inputs&&e.data.inputs.LLMText){i=e.data.inputs.LLMText}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("异常请重试")){this.currentStreamingMessage.showRetryButton=true;this.aiException=true}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("题号赋值")){this.currentQuestionNumber=e.data.process_data.questions_number-1}if(e.event==="message"){if(e.event==="agent_message"||e.event==="message"){if(e.answer){t+=e.answer;const i={...this.currentStreamingMessage,answer:t,isStreaming:true};this.currentStreamingMessage=i;setTimeout((()=>{this.scrollToBottom()}),200)}}}if(e.event==="error"){const t=e.data?.message||e.message||"请求失败";this.messages=[...this.messages,{...c,answer:t,error:e.data,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false;h.emitError({error:e.data,message:t});return}if(e.event==="message_end"){this.streamComplete.emit({conversation_id:e.conversation_id||"",event:e.event,message_id:e.message_id,id:e.id})}},onError:t=>{console.error("发生错误:",t);this.someErrorEvent.emit({error:t,message:"消息发送失败,请稍后再试"});p.captureError(t,{action:"sendMessageToAPI",component:"pcm-hr-chat-modal",message:e,title:"消息发送失败"});this.messages=[...this.messages,{...c,answer:"消息发送失败,请检查网络。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const e=this.currentStreamingMessage;e.isStreaming=false;this.currentStreamingMessage=null;this.messages=[...this.messages,e];if(!this.aiException){if(this.enableAudio&&e&&e.answer){const t=i||e.answer;if(t){const e=await d(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}else if(!this.enableAudio){this.startWaitingToRecord()}}}})}async saveAnswer(e,t,i){try{await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:e,question:t,answer:i}})}catch(t){console.error("保存答案失败:",t);this.someErrorEvent.emit({error:t,message:"保存答案失败,请稍后再试"});p.captureError(t,{action:"saveAnswer",component:"pcm-hr-chat-modal",conversationId:e,title:"保存答案失败"})}}handleScroll=()=>{if(this.isUserScrolling){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!e)return;const{scrollTop:t,scrollHeight:i,clientHeight:s}=e;const o=i-t-s;this.shouldAutoScroll=o<=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 e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(e&&this.isOpen){e.scrollTop=e.scrollHeight}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;let e=false;try{const t=await l({url:`/sdk/v1/hr_competition/${this.conversationId}`,method:"GET"});if(t.success&&t.data&&t.data.ended==1){e=true}const i=await l({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:"3022316191018880",limit:20}});if(i.success&&i.data){const e=i.data.data||[];const t=e.map((e=>{const t=new Date(e.created_at*1e3);const i=t.getHours().toString().padStart(2,"0");const s=t.getMinutes().toString().padStart(2,"0");const o=`${i}:${s}`;const{inputs:n,...r}=e;return{...r,time:o,isStreaming:false,status:e.status==="error"?"error":"normal"}}));this.messages=t;const s=t.filter((e=>!(e.answer&&(e.answer.includes("请求超时")||e.answer.includes("网络有点拥堵")||e.status==="error"))));this.currentQuestionNumber=s.length>0?s.length:0}}catch(e){console.error("加载历史消息或面试状态失败:",e);this.someErrorEvent.emit({error:e,message:"加载历史消息失败,请刷新重试"});p.captureError(e,{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&&!e){const e=this.messages[this.messages.length-1];if(e&&e.answer&&this.enableAudio){const t=await d(e.answer);if(this.enableVoice){await this.playAudio(t);this.startWaitingToRecord()}else{this.audioUrl=t}}else if(!this.enableAudio){this.startWaitingToRecord()}else{this.sendMessageToAPI("下一题")}}else if(e){this.currentQuestionNumber++;this.isTaskCompleted=true;setTimeout((()=>{this.interviewComplete.emit()}),100)}}),300)}}async handleIsOpenChange(e){if(e){await c(this.token);if(this.conversationId){this.showInitialUpload=false;await this.loadHistoryMessages()}}}handleJobCategorySelect=e=>{this.selectedJobCategory=e};handleDimensionSelect=e=>{if(this.selectedDimensions.includes(e)){this.selectedDimensions=this.selectedDimensions.filter((t=>t!==e))}else{this.selectedDimensions=[...this.selectedDimensions,e]}};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 e=`我是一名${this.selectedJobCategory},请您开始提问`;this.sendMessageToAPI(e)};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 e=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.recordingStream=e;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(e);const t=this.getSupportedMimeType();let i;try{i=new MediaRecorder(e,{mimeType:t,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){console.warn("指定的MIME类型不受支持,使用默认设置:",t);try{i=new MediaRecorder(e,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){try{i=new MediaRecorder(e)}catch(e){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:e});this.showRecordingUI=false;return}}}this.mediaRecorder=i;const s=[];i.ondataavailable=e=>{if(e.data.size>0){s.push(e.data)}};i.onerror=e=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:e});this.stopRecording()};i.onstop=()=>{try{const e=t||"video/mp4";const i=new Blob(s,{type:e});if(i.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=i;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:i.size,type:i.type}});this.uploadRecordedVideo()}catch(e){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:e});this.showRecordingUI=false;p.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{i.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:i.mimeType}})}catch(e){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:e});this.showRecordingUI=false;p.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"开始录制失败"});return}this.recordingTimer=setInterval((()=>{const e=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-e);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(e){console.error("无法访问摄像头或麦克风:",e);this.showRecordingUI=false;this.recordingError.emit({type:"media_access_failed",message:"无法访问摄像头或麦克风,请确保已授予权限",details:e});p.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"无法访问摄像头或麦克风"})}}setupVideoPreview(e){setTimeout((()=>{const t=this.hostElement.shadowRoot?.querySelector("video");if(t&&e){try{t.srcObject=e;t.play().catch((e=>{console.error("视频播放失败:",e);this.someErrorEvent.emit({error:e,message:"视频播放失败"});p.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"录制视频显示失败"})}))}catch(i){console.warn("设置srcObject失败,尝试替代方法:",i);try{const i=URL.createObjectURL(e);t.src=i;t.onended=()=>{URL.revokeObjectURL(i)}}catch(e){console.error("创建对象URL失败:",e);this.someErrorEvent.emit({error:e,message:"创建对象URL失败"});p.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"创建对象URL失败"})}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const e=["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 t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查MIME类型支持时出错 ${t}:`,e)}}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((e=>e.stop()));this.recordingStream=null}this.videoRef=null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const e=this.recordedBlob.type.includes("webm")?"webm":"mp4";const t=`answer.${e}`;const i=new File([this.recordedBlob],t,{type:this.recordedBlob.type});const s=await r(i,{},{tags:["other"]});if(s){await this.saveVideoAnswer(s.cos_key);this.sendMessageToAPI("下一题")}else{throw new Error("视频上传失败")}}catch(e){console.error("视频上传错误:",e);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:e});p.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"视频上传失败"})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}async saveVideoAnswer(e){if(!this.conversationId)return;try{const t=this.messages.length>0?this.messages[this.messages.length-1]:null;if(!t)return;await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:this.conversationId,question:t.answer,file_url:e}})}catch(e){console.error("保存视频答案失败:",e);this.someErrorEvent.emit({error:e,message:"保存视频答案失败"});p.captureError(e,{action:"saveVideoAnswer",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"保存视频答案失败"})}}async completeInterview(){if(!this.conversationId)return;try{await l({url:`/sdk/v1/hr_competition/${this.conversationId}/end`,method:"POST"})}catch(e){console.error("发送面试完成请求失败:",e);this.someErrorEvent.emit({error:e,message:"发送面试完成请求失败"});p.captureError(e,{action:"completeInterview",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"发送面试完成请求失败"})}}playAudio(e){return new Promise((t=>{this.isPlayingAudio=true;this.audioUrl=e;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=e;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;t()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:"音频播放错误",message:"音频播放错误"});p.captureMessage("音频播放错误",{action:"playAudio",component:"pcm-hr-chat-modal",title:"音频播放错误"});t()};this.audioElement.play().catch((e=>{console.error("音频播放失败:",e);this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:e,message:"音频播放失败"});p.captureError(e,{title:"音频播放失败",action:"playAudio",component:"pcm-hr-chat-modal"});t()}))}))}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=e=>{const t=this.messages.find((t=>t.id===e));if(t){this.aiException=false;const i=this.messages.map((t=>t.id===e?{...t,showRetryButton:false}:t));this.messages=i;this.sendMessageToAPI(t.query)}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const o=()=>s("div",{class:"video-preview"},s("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:e=>{if(e&&this.recordingStream&&!this.videoRef){this.videoRef=e}}}),s("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},s("span",{class:"recording-dot"}),s("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const n=()=>{if(this.isTaskCompleted){return s("div",{class:"placeholder-status"},s("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return s("div",{class:"placeholder-status"},s("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return s("div",{class:"placeholder-status"},s("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return s("div",{class:"placeholder-status"},s("p",null,"请等待题目..."))}if(this.waitingToRecord){return s("div",{class:"placeholder-status"},s("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return s("div",{class:"placeholder-status default-status"},s("p",null,"准备中..."))};return s("div",{class:i,style:e},s("div",{class:t},this.isShowHeader&&s("div",{class:"modal-header"},s("div",{class:"header-left"},this.icon&&s("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),s("div",null,this.modalTitle)),this.isNeedClose&&s("button",{class:"close-button",onClick:this.handleClose},s("span",null,"×"))),this.showInitialUpload?s("div",{class:"initial-upload"},s("div",{class:"upload-section"},this.requireResume&&s(s.Fragment,null,s("h3",null,"开始前,请上传您的简历"),s("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?s("div",{class:"file-item"},s("div",{class:"file-item-content"},s("span",{class:"file-icon"},"📝"),s("span",{class:"file-name"},this.selectedFile.name)),s("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):s("div",{class:"upload-placeholder"},s("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),s("p",{class:"upload-text"},"点击上传简历"),s("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),s("div",{class:"category-select"},s("h3",null,"请选择您的职能类别(单选)"),s("div",{class:"category-options"},this.jobCategories.map((e=>s("button",{class:{"category-button":true,selected:this.selectedJobCategory===e},onClick:()=>this.handleJobCategorySelect(e)},e))))),s("div",{class:"dimension-select"},s("h3",null,"请选择关注的模块(可多选)"),s("div",{class:"dimension-options"},this.dimensions.map((e=>s("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(e)},onClick:()=>this.handleDimensionSelect(e)},e))))),s("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&&s("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):s("div",{style:{height:"100%"}},s("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?s("div",{class:"loading-container"},s("div",{class:"loading-spinner"}),s("p",null,"加载历史消息中...")):s("div",null,this.messages.map((e=>s("div",{id:`message_${e.id}`,key:e.id},s("components-chat-message",{message:e,onRetryRequest:e=>this.handleRetryRequest(e.detail),showCopyButton:false,showFeedbackButtons:false})))),this.currentStreamingMessage&&s("div",{id:`message_${this.currentStreamingMessage.id}`},s("components-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&s("div",{class:"empty-state"},s("p",null,"请上传简历开始面试")))),s("div",{class:"recording-section"},s("div",{class:"recording-container"},s("div",{class:"video-area"},this.showRecordingUI?o():s("div",{class:"video-preview placeholder"},n())),s("div",{class:"progress-container"},s("div",{class:"progress-bar-container"},s("div",{class:"progress-bar",style:{width:`${Math.max(0,this.currentQuestionNumber-1)/this.totalQuestions*100}%`}})),s("div",{class:"progress-text"},"已完成",Math.max(0,this.currentQuestionNumber-1),"/",this.totalQuestions)),s("div",{class:"recording-controls"},this.showRecordingUI?s("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):s("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return s("div",{class:"play-audio-container",onClick:this.handlePlayAudio},s("p",null,s("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},s("path",{d:"M8 5v14l11-7z"})),s("span",{style:{verticalAlign:"middle"}},"播放题目")))}return s("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};m.style=u+g;export{m as pcm_hr_chat_modal};
2
+ //# sourceMappingURL=p-cdcdec03.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as s,v as n,c as a,P as r}from"./p-Bktjt_YJ.js";import{E as l}from"./p-C0FYX2-Z.js";import{M as d}from"./p-D39f_W8k.js";import{f as p}from"./p-CMfzTNOk.js";import"./p-B4ClCdh9.js";import"./p-Bs-zO1WZ.js";const c=".iframe-container{width:100%;height:85vh}.iframe-container iframe{width:100%;height:100%}.step-section{margin-bottom:20px}.step-title{font-size:14px;font-weight:600;color:#333;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #e8e8e8}.mode-options{display:grid;grid-template-columns:repeat(2, 1fr);gap:8px}.mode-option{padding:16px;border:2px solid #e2e8f0;border-radius:8px;cursor:pointer;transition:all 0.2s ease}.mode-option:hover{border-color:#94a3b8}.mode-option.selected{border-color:#0D75FB;background-color:#f0f7ff}.option-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.option-title{font-weight:600;color:#333}.check-icon{color:#0D75FB;font-size:16px}.option-desc{font-size:14px;color:#666}.option-suitable{font-size:12px;color:#999}.output-options{display:flex;flex-direction:column;gap:12px}.output-option{padding:12px 16px;border:2px solid #e2e8f0;border-radius:8px;cursor:pointer;transition:all 0.2s ease}.output-option:hover{border-color:#94a3b8}.output-option.selected{border-color:#0D75FB;background-color:#f0f7ff}.option-time{font-size:12px;color:#999}.jd-hint{padding:12px;background-color:#f6f8fa;border-radius:8px;text-align:center}.jd-hint p{font-size:14px;color:#666;margin:0}.form-hint{font-size:12px;color:#fa8c16;text-align:center;margin-top:8px}.form-hint.warning{color:#fa8c16}@media screen and (max-width: 768px){.mode-options{grid-template-columns:1fr}}.label-with-button{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.button-group{margin-bottom:8px;display:flex;gap:8px;align-items:center}.position-selector-button{padding:4px 12px;background:#1890ff;color:white;border:none;border-radius:4px;font-size:13px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;height:28px;line-height:20px}.position-selector-button:hover{background:#40a9ff}.position-selector-button:active{background:#096dd9}.position-selector-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:3000;padding:20px}.position-selector-modal{background:white;border-radius:8px;width:90%;max-width:900px;height:80vh;max-height:600px;display:flex;flex-direction:column;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);animation:modalFadeIn 0.3s ease}@keyframes modalFadeIn{from{opacity:0;transform:scale(0.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}.position-selector-modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;border-bottom:1px solid #f0f0f0;flex-shrink:0}.position-selector-modal-header h3{margin:0;font-size:16px;font-weight:500;color:rgba(0, 0, 0, 0.85)}.position-selector-close-btn{background:none;border:none;font-size:24px;line-height:1;cursor:pointer;color:rgba(0, 0, 0, 0.45);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all 0.3s}.position-selector-close-btn:hover{background-color:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.85)}.position-selector-modal-body{flex:1;overflow:hidden;display:flex;flex-direction:column}@media screen and (max-width: 768px){.position-selector-modal{width:100%;height:90vh;max-height:none;border-radius:8px 8px 0 0;margin-top:auto}.position-selector-modal-overlay{padding:0;align-items:flex-end}}";const h='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:5vh auto auto 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;cursor:pointer}.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;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.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;min-width:30px;min-height:30px}.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}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.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)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.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-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}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const f=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){t(this,i);this.modalClosed=e(this,"modalClosed");this.getResumeData=e(this,"getResumeData");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="请帮我优化简历";getResumeData;hideExportButton=false;exportButtonText="导出简历json数据";fullscreen=false;customInputs={};showWorkspaceHistory=false;oemId;showInputHistory=false;mobileUploadAble=false;mobileJdInputAble=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="drawer";autoStart;isUploading=false;uploadedFileInfo=null;showChatModal=false;showIframe=false;isHistoryDrawerOpen=false;historyConversations=[];isLoadingConversations=false;historyConversationCursorStack=[""];historyConversationPageIndex=0;hasMoreHistoryConversations=false;showPositionSelector=false;_internalConversationId;selectedOptimizationMode="";selectedOutputType=null;get hostElement(){return i(this)}jobDescription="";isSubmitting=false;_iframeEl;tokenInvalidListener;removeErrorListener;_historyConversationPageSize=10;pcmUploadRef;optimizationModes=[{id:"targeted",title:"针对性优化",desc:"基于具体职位描述进行优化",suitable:"有明确目标职位"},{id:"general",title:"通用优化",desc:"提升简历整体质量和专业度",suitable:"广撒网投递"}];outputTypes=[{id:0,title:"直接改写",desc:"给我优化后的完整简历",time:"2-3分钟"},{id:1,title:"改进建议",desc:"告诉我哪里需要改,怎么改",time:"1-2分钟"},{id:2,title:"深度分析",desc:"全面诊断+建议+改写",time:"3-5分钟"}];handleTokenChange(t){if(t&&t!==s.getToken()){s.setToken(t)}}async handleIsOpenChange(t){if(!t){this.showChatModal=false;this.showIframe=false;this.jobDescription="";this.uploadedFileInfo=null;this.isUploading=false;this.isSubmitting=false;this._internalConversationId=undefined;this.selectedOptimizationMode="";this.conversationId=undefined;this.selectedOutputType=null;this.showPositionSelector=false}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}if(this.customInputs){if(this.customInputs.optimization_type!==undefined&&this.customInputs.optimization_type!==""){this.selectedOutputType=Number(this.customInputs.optimization_type)}if(!!this.customInputs.job_info){this.selectedOptimizationMode="targeted"}}await n(this.token);if(this.currentConversationId||this.getShouldAutoStart()){this.showChatModal=true;this.showIframe=false}}}get currentConversationId(){return this.conversationId||this._internalConversationId}componentWillLoad(){if(this.zIndex){a.setItem("modal-zIndex",this.zIndex)}if(this.token){s.setToken(this.token)}n(this.token);this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}handleStreamComplete=t=>{this._internalConversationId=t.detail.conversation_id};componentDidLoad(){window.addEventListener("message",this.handleIframeMessage)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}window.removeEventListener("message",this.handleIframeMessage)}handleClose=()=>{this.modalClosed.emit()};loadHistoryConversations=async(t,e)=>{this.isLoadingConversations=true;const i=await p("45444431062634496","pcm-qgqjl-modal",t,this._historyConversationPageSize);const o=this.historyConversationCursorStack.slice(0,e+1);if(i.hasMore&&i.nextCursor){o[e+1]=i.nextCursor}this.historyConversationCursorStack=o;this.historyConversationPageIndex=e;this.historyConversations=i.items;this.hasMoreHistoryConversations=i.hasMore;this.isLoadingConversations=false};handleInputHistoryClick=async()=>{this.isHistoryDrawerOpen=true;this.historyConversationCursorStack=[""];await this.loadHistoryConversations("",0)};handleHistoryConversationPageChange=async t=>{if(t==="prev"){if(this.historyConversationPageIndex===0){return}const t=this.historyConversationPageIndex-1;const e=this.historyConversationCursorStack[t]||"";await this.loadHistoryConversations(e,t);return}if(!this.hasMoreHistoryConversations){return}const e=this.historyConversationPageIndex+1;const i=this.historyConversationCursorStack[e];if(!i){return}await this.loadHistoryConversations(i,e)};handleSelectConversation=t=>{this.conversationId=t.id;this.selectedOutputType=t.inputs?.optimization_type??0;this.isHistoryDrawerOpen=false;this.showChatModal=true;this.showIframe=false};closeResumeChat=()=>{this.showIframe=true;this.showChatModal=false};handleIframeLoad=()=>{};handleIframeMessage=t=>{const e=["http://localhost:3000",r];if(!e.includes(t.origin))return;const{type:i,value:o}=t.data||{};if(i==="callParentMethod"){this.exampleMethodFromIframe(o)}if(i==="iframeReady"&&this._iframeEl?.contentWindow){const t=new URL(this._iframeEl.src).origin;this._iframeEl.contentWindow.postMessage({type:"parentReady",origin:window.location.origin},t);this._iframeEl.contentWindow.postMessage({type:"setToken",token:this.token},t);this._iframeEl.contentWindow.postMessage({type:"buttonConfig",config:{hideExportButton:true,exportButtonText:this.exportButtonText}},t)}};exampleMethodFromIframe(t){this.getResumeData.emit(JSON.parse(t))}handleJobDescriptionChange=t=>{const e=t.target;this.jobDescription=e.value};handleOpenPositionSelector=()=>{if(!this.oemId){d.info("未配置OEM ID,无法选择职位");return}this.showPositionSelector=true};handleClosePositionSelector=()=>{this.showPositionSelector=false};handlePositionSelected=t=>{const e=t.detail;this.jobDescription=e.formatted_text||"";this.showPositionSelector=false;d.success("职位信息已填充")};handleOptimizationModeChange=t=>{this.selectedOptimizationMode=t};handleOutputTypeChange=t=>{this.selectedOutputType=t};getShouldAutoStart=()=>{const t=Boolean(this.customInputs?.file_url||this.customInputs?.resume_content);const e=Boolean(this.customInputs?.job_info);const i=this.customInputs?.optimization_type!==undefined;if(this.autoStart!==undefined){if(this.autoStart===true){return t}else{return t&&e&&i}}return t&&e};isFormValid=()=>{if(this.customInputs?.optimization_type!==undefined){const t=this.customInputs?.file_url||this.customInputs?.resume_content||this.uploadedFileInfo;return Boolean(t)}const t=this.customInputs?.file_url||this.customInputs?.resume_content||this.uploadedFileInfo;const e=t&&this.selectedOptimizationMode&&this.selectedOutputType!==null;if(this.selectedOptimizationMode==="targeted"){return e&&Boolean(this.customInputs?.job_info||this.jobDescription.trim())}return e};handleStartInterview=async()=>{if(!this.customInputs?.file_url&&!this.customInputs?.resume_content&&!this.uploadedFileInfo){d.info("请上传简历");return}if(!this.customInputs?.optimization_type){if(!this.selectedOptimizationMode){d.info("请选择优化模式");return}if(this.selectedOutputType===null){d.info("请选择输出方式");return}}if(this.selectedOptimizationMode==="targeted"&&!this.customInputs?.job_info&&!this.jobDescription.trim()){d.info("针对性优化需要提供职位描述");return}if(await(this.pcmUploadRef?.getIsUploading?.())){d.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};getEffectiveOptimizationType=()=>{const t=this.customInputs?.optimization_type??(this.selectedOutputType??0);return typeof t==="string"?Number(t):t};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":!this.showIframe};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const s=this.currentConversationId&&!this.showChatModal;const n=Boolean(this.customInputs?.job_info);const a=Boolean(this.customInputs?.optimization_type);const l=Boolean(this.selectedOptimizationMode);const d=!l||this.selectedOptimizationMode==="general"&&Boolean(this.customInputs?.file_url||this.customInputs?.resume_content)||this.selectedOptimizationMode==="targeted"&&Boolean(this.customInputs?.job_info)&&Boolean(this.customInputs?.file_url||this.customInputs?.resume_content);const p=Boolean(this.customInputs&&this.customInputs.job_info);const c=Boolean(this.customInputs&&(this.customInputs.file_url||this.customInputs.resume_content));const h=this.getShouldAutoStart();return o("div",{class:i,style:t},o("div",{class:e},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle),this.showInputHistory&&o("button",{type:"button",class:"header-history-entry",onClick:this.handleInputHistoryClick,title:"历史会话"},"历史会话")),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),this.showInputHistory&&o("components-drawer",{isOpen:this.isHistoryDrawerOpen,drawerTitle:"历史会话",width:"400px",onClosed:()=>{this.isHistoryDrawerOpen=false}},o("div",{class:"history-drawer-content"},o("div",{class:"conversation-list"},this.isLoadingConversations?o("div",{class:"loading-conversations"},o("div",{class:"loading-spinner-small"}),o("p",null,"加载中...")):this.historyConversations.length===0?o("div",{class:"empty-conversations"},o("p",null,"暂无历史会话")):this.historyConversations.map((t=>o("div",{key:t.id,class:"conversation-item",onClick:()=>this.handleSelectConversation(t)},o("div",{class:"conversation-info"},o("div",{class:"conversation-title"},t.name),o("div",{class:"conversation-meta"},o("span",{class:"conversation-time"},t.timeDisplay),t.message_count>0&&o("span",{class:"message-count"},t.message_count,"条消息"),t.status&&o("span",{class:{"conversation-status":true,completed:t.status==="结束",running:t.status==="进行中"}},t.status))))))),!this.isLoadingConversations&&(this.historyConversationPageIndex>0||this.hasMoreHistoryConversations)&&o("div",{class:"history-pagination"},o("button",{type:"button",class:"history-pagination-button",disabled:this.historyConversationPageIndex===0,onClick:()=>this.handleHistoryConversationPageChange("prev")},"上一页"),o("span",{class:"history-pagination-info"},"第 ",this.historyConversationPageIndex+1," 页"),o("button",{type:"button",class:"history-pagination-button",disabled:!this.hasMoreHistoryConversations,onClick:()=>this.handleHistoryConversationPageChange("next")},"下一页")))),!this.showChatModal&&!this.currentConversationId&&!h&&o("div",{class:"input-container"},!n&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第一步:选择优化模式"),o("div",{class:"mode-options"},this.optimizationModes.map((t=>o("div",{class:{"mode-option":true,selected:this.selectedOptimizationMode===t.id},onClick:()=>this.handleOptimizationModeChange(t.id)},o("div",{class:"option-header"},o("span",{class:"option-title"},t.title),this.selectedOptimizationMode===t.id&&o("span",{class:"check-icon"},"✓")),o("div",{class:"option-desc"},t.desc),o("span",{class:"option-suitable"},"适合:",t.suitable)))))),!a&&this.selectedOptimizationMode&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第二步:你希望得到什么?"),o("div",{class:"output-options"},this.outputTypes.map((t=>o("div",{class:{"output-option":true,selected:this.selectedOutputType===t.id},onClick:()=>this.handleOutputTypeChange(t.id)},o("div",{class:"option-header"},o("span",{class:"option-title"},t.title),this.selectedOutputType===t.id&&o("span",{class:"check-icon"},"✓")),o("div",{class:"option-desc"},t.desc),o("span",{class:"option-time"},"预计 ",t.time)))))),!d&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第三步:提供材料"),o("div",{class:"resume-upload-section"},o("label",null,"上传简历"),o("components-mobile-upload-btn",{maxFileSize:15*1024*1024,multiple:false,uploadAreaMode:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设简历",file_size:0,ext:""}]:undefined,disabled:c,onOk:t=>{const e=t.detail??[];this.uploadedFileInfo=e[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),this.selectedOptimizationMode==="targeted"&&o("div",{class:"jd-input-section"},o("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),!p&&o("div",{class:"button-group"},!!this.oemId&&o("button",{class:"position-selector-button",onClick:this.handleOpenPositionSelector,type:"button"},"选择职位"),o("components-mobile-input-btn",{name:"职位描述",onOk:t=>{this.jobDescription=t.detail}})),o("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange,disabled:p}))),o("button",{class:"submit-button",disabled:!this.isFormValid()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),!a&&!this.selectedOptimizationMode&&o("div",{class:"form-hint"},"请先选择优化模式和输出方式"),!a&&this.selectedOptimizationMode&&this.selectedOutputType===null&&o("div",{class:"form-hint"},"请选择输出方式"),l&&!c&&!this.uploadedFileInfo&&o("div",{class:"form-hint warning"},"请上传简历文件"),this.selectedOptimizationMode==="targeted"&&!p&&!this.jobDescription.trim()&&l&&o("div",{class:"form-hint warning"},"针对性优化需要提供职位描述"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),s&&!this.showIframe&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,this.getEffectiveOptimizationType()===1||this.getEffectiveOptimizationType()===2?o("components-thousand-resume-wrapper",{isOpen:true,token:this.token,conversationId:this.currentConversationId,botId:"45444431062634496",optimizationType:this.getEffectiveOptimizationType(),customInputs:{...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.selectedOptimizationMode==="targeted"?this.jobDescription:""),job_title:this.customInputs?.job_title||"",optimization_type:this.getEffectiveOptimizationType()},defaultQuery:this.defaultQuery,modalTitle:this.modalTitle,icon:this.icon,fullscreen:this.fullscreen,zIndex:this.zIndex,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,onModalClosed:this.handleClose,onConversationStart:t=>this.handleStreamComplete(t),onStreamComplete:t=>this.handleStreamComplete(t),onInterviewComplete:t=>this.handleStreamComplete(t)}):o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"45444431062634496",conversationId:this.currentConversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,closeResume:this.closeResumeChat,customInputs:{...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.selectedOptimizationMode==="targeted"?this.jobDescription:""),job_title:this.customInputs?.job_title||"",optimization_type:this.getEffectiveOptimizationType()},interviewMode:"text",onStreamComplete:this.handleStreamComplete,onHistoryConversationSelect:t=>{if(t.detail?.inputs?.optimization_type==1||t.detail?.inputs?.optimization_type==2){t.preventDefault();this.handleSelectConversation(t.detail)}}})),this.showIframe&&o(o.Fragment,null,o("div",{class:"iframe-container"},o("iframe",{ref:t=>this._iframeEl=t,src:`${r}/myresume?conversation_id=${this.currentConversationId}&isSdk=true`,frameborder:"0",onLoad:this.handleIframeLoad})))),this.showPositionSelector&&o("div",{class:"position-selector-modal-overlay"},o("div",{class:"position-selector-modal"},o("div",{class:"position-selector-modal-header"},o("h3",null,"选择职位"),o("button",{class:"position-selector-close-btn",onClick:this.handleClosePositionSelector},"×")),o("div",{class:"position-selector-modal-body"},o("components-position-selector",{oemId:this.oemId,multiple:false,onPositionSelected:this.handlePositionSelected})))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=c+(h+f);export{u as oem_qgqjl_modal};
2
- //# sourceMappingURL=p-8144f0d4.entry.js.map
1
+ import{r as t,c as e,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as s,v as n,c as a,P as r}from"./p-C3qMuJRQ.js";import{E as l}from"./p-C0FYX2-Z.js";import{M as d}from"./p-D39f_W8k.js";import{f as p}from"./p-b8oixHud.js";import"./p-Ch9kExOi.js";import"./p-Bs-zO1WZ.js";const c=".iframe-container{width:100%;height:85vh}.iframe-container iframe{width:100%;height:100%}.step-section{margin-bottom:20px}.step-title{font-size:14px;font-weight:600;color:#333;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #e8e8e8}.mode-options{display:grid;grid-template-columns:repeat(2, 1fr);gap:8px}.mode-option{padding:16px;border:2px solid #e2e8f0;border-radius:8px;cursor:pointer;transition:all 0.2s ease}.mode-option:hover{border-color:#94a3b8}.mode-option.selected{border-color:#0D75FB;background-color:#f0f7ff}.option-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.option-title{font-weight:600;color:#333}.check-icon{color:#0D75FB;font-size:16px}.option-desc{font-size:14px;color:#666}.option-suitable{font-size:12px;color:#999}.output-options{display:flex;flex-direction:column;gap:12px}.output-option{padding:12px 16px;border:2px solid #e2e8f0;border-radius:8px;cursor:pointer;transition:all 0.2s ease}.output-option:hover{border-color:#94a3b8}.output-option.selected{border-color:#0D75FB;background-color:#f0f7ff}.option-time{font-size:12px;color:#999}.jd-hint{padding:12px;background-color:#f6f8fa;border-radius:8px;text-align:center}.jd-hint p{font-size:14px;color:#666;margin:0}.form-hint{font-size:12px;color:#fa8c16;text-align:center;margin-top:8px}.form-hint.warning{color:#fa8c16}@media screen and (max-width: 768px){.mode-options{grid-template-columns:1fr}}.label-with-button{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.button-group{margin-bottom:8px;display:flex;gap:8px;align-items:center}.position-selector-button{padding:4px 12px;background:#1890ff;color:white;border:none;border-radius:4px;font-size:13px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;height:28px;line-height:20px}.position-selector-button:hover{background:#40a9ff}.position-selector-button:active{background:#096dd9}.position-selector-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:3000;padding:20px}.position-selector-modal{background:white;border-radius:8px;width:90%;max-width:900px;height:80vh;max-height:600px;display:flex;flex-direction:column;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);animation:modalFadeIn 0.3s ease}@keyframes modalFadeIn{from{opacity:0;transform:scale(0.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}.position-selector-modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;border-bottom:1px solid #f0f0f0;flex-shrink:0}.position-selector-modal-header h3{margin:0;font-size:16px;font-weight:500;color:rgba(0, 0, 0, 0.85)}.position-selector-close-btn{background:none;border:none;font-size:24px;line-height:1;cursor:pointer;color:rgba(0, 0, 0, 0.45);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all 0.3s}.position-selector-close-btn:hover{background-color:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.85)}.position-selector-modal-body{flex:1;overflow:hidden;display:flex;flex-direction:column}@media screen and (max-width: 768px){.position-selector-modal{width:100%;height:90vh;max-height:none;border-radius:8px 8px 0 0;margin-top:auto}.position-selector-modal-overlay{padding:0;align-items:flex-end}}";const h='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:5vh auto auto 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;cursor:pointer}.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;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.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;min-width:30px;min-height:30px}.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}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.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)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.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-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}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const f=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){t(this,i);this.modalClosed=e(this,"modalClosed");this.getResumeData=e(this,"getResumeData");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="请帮我优化简历";getResumeData;hideExportButton=false;exportButtonText="导出简历json数据";fullscreen=false;customInputs={};showWorkspaceHistory=false;oemId;showInputHistory=false;mobileUploadAble=false;mobileJdInputAble=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="drawer";autoStart;isUploading=false;uploadedFileInfo=null;showChatModal=false;showIframe=false;isHistoryDrawerOpen=false;historyConversations=[];isLoadingConversations=false;historyConversationCursorStack=[""];historyConversationPageIndex=0;hasMoreHistoryConversations=false;showPositionSelector=false;_internalConversationId;selectedOptimizationMode="";selectedOutputType=null;get hostElement(){return i(this)}jobDescription="";isSubmitting=false;_iframeEl;tokenInvalidListener;removeErrorListener;_historyConversationPageSize=10;pcmUploadRef;optimizationModes=[{id:"targeted",title:"针对性优化",desc:"基于具体职位描述进行优化",suitable:"有明确目标职位"},{id:"general",title:"通用优化",desc:"提升简历整体质量和专业度",suitable:"广撒网投递"}];outputTypes=[{id:0,title:"直接改写",desc:"给我优化后的完整简历",time:"2-3分钟"},{id:1,title:"改进建议",desc:"告诉我哪里需要改,怎么改",time:"1-2分钟"},{id:2,title:"深度分析",desc:"全面诊断+建议+改写",time:"3-5分钟"}];handleTokenChange(t){if(t&&t!==s.getToken()){s.setToken(t)}}async handleIsOpenChange(t){if(!t){this.showChatModal=false;this.showIframe=false;this.jobDescription="";this.uploadedFileInfo=null;this.isUploading=false;this.isSubmitting=false;this._internalConversationId=undefined;this.selectedOptimizationMode="";this.conversationId=undefined;this.selectedOutputType=null;this.showPositionSelector=false}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}if(this.customInputs){if(this.customInputs.optimization_type!==undefined&&this.customInputs.optimization_type!==""){this.selectedOutputType=Number(this.customInputs.optimization_type)}if(!!this.customInputs.job_info){this.selectedOptimizationMode="targeted"}}await n(this.token);if(this.currentConversationId||this.getShouldAutoStart()){this.showChatModal=true;this.showIframe=false}}}get currentConversationId(){return this.conversationId||this._internalConversationId}componentWillLoad(){if(this.zIndex){a.setItem("modal-zIndex",this.zIndex)}if(this.token){s.setToken(this.token)}n(this.token);this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}handleStreamComplete=t=>{this._internalConversationId=t.detail.conversation_id};componentDidLoad(){window.addEventListener("message",this.handleIframeMessage)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}window.removeEventListener("message",this.handleIframeMessage)}handleClose=()=>{this.modalClosed.emit()};loadHistoryConversations=async(t,e)=>{this.isLoadingConversations=true;const i=await p("45444431062634496","pcm-qgqjl-modal",t,this._historyConversationPageSize);const o=this.historyConversationCursorStack.slice(0,e+1);if(i.hasMore&&i.nextCursor){o[e+1]=i.nextCursor}this.historyConversationCursorStack=o;this.historyConversationPageIndex=e;this.historyConversations=i.items;this.hasMoreHistoryConversations=i.hasMore;this.isLoadingConversations=false};handleInputHistoryClick=async()=>{this.isHistoryDrawerOpen=true;this.historyConversationCursorStack=[""];await this.loadHistoryConversations("",0)};handleHistoryConversationPageChange=async t=>{if(t==="prev"){if(this.historyConversationPageIndex===0){return}const t=this.historyConversationPageIndex-1;const e=this.historyConversationCursorStack[t]||"";await this.loadHistoryConversations(e,t);return}if(!this.hasMoreHistoryConversations){return}const e=this.historyConversationPageIndex+1;const i=this.historyConversationCursorStack[e];if(!i){return}await this.loadHistoryConversations(i,e)};handleSelectConversation=t=>{this.conversationId=t.id;this.selectedOutputType=t.inputs?.optimization_type??0;this.isHistoryDrawerOpen=false;this.showChatModal=true;this.showIframe=false};closeResumeChat=()=>{this.showIframe=true;this.showChatModal=false};handleIframeLoad=()=>{};handleIframeMessage=t=>{const e=["http://localhost:3000",r];if(!e.includes(t.origin))return;const{type:i,value:o}=t.data||{};if(i==="callParentMethod"){this.exampleMethodFromIframe(o)}if(i==="iframeReady"&&this._iframeEl?.contentWindow){const t=new URL(this._iframeEl.src).origin;this._iframeEl.contentWindow.postMessage({type:"parentReady",origin:window.location.origin},t);this._iframeEl.contentWindow.postMessage({type:"setToken",token:this.token},t);this._iframeEl.contentWindow.postMessage({type:"buttonConfig",config:{hideExportButton:true,exportButtonText:this.exportButtonText}},t)}};exampleMethodFromIframe(t){this.getResumeData.emit(JSON.parse(t))}handleJobDescriptionChange=t=>{const e=t.target;this.jobDescription=e.value};handleOpenPositionSelector=()=>{if(!this.oemId){d.info("未配置OEM ID,无法选择职位");return}this.showPositionSelector=true};handleClosePositionSelector=()=>{this.showPositionSelector=false};handlePositionSelected=t=>{const e=t.detail;this.jobDescription=e.formatted_text||"";this.showPositionSelector=false;d.success("职位信息已填充")};handleOptimizationModeChange=t=>{this.selectedOptimizationMode=t};handleOutputTypeChange=t=>{this.selectedOutputType=t};getShouldAutoStart=()=>{const t=Boolean(this.customInputs?.file_url||this.customInputs?.resume_content);const e=Boolean(this.customInputs?.job_info);const i=this.customInputs?.optimization_type!==undefined;if(this.autoStart!==undefined){if(this.autoStart===true){return t}else{return t&&e&&i}}return t&&e};isFormValid=()=>{if(this.customInputs?.optimization_type!==undefined){const t=this.customInputs?.file_url||this.customInputs?.resume_content||this.uploadedFileInfo;return Boolean(t)}const t=this.customInputs?.file_url||this.customInputs?.resume_content||this.uploadedFileInfo;const e=t&&this.selectedOptimizationMode&&this.selectedOutputType!==null;if(this.selectedOptimizationMode==="targeted"){return e&&Boolean(this.customInputs?.job_info||this.jobDescription.trim())}return e};handleStartInterview=async()=>{if(!this.customInputs?.file_url&&!this.customInputs?.resume_content&&!this.uploadedFileInfo){d.info("请上传简历");return}if(!this.customInputs?.optimization_type){if(!this.selectedOptimizationMode){d.info("请选择优化模式");return}if(this.selectedOutputType===null){d.info("请选择输出方式");return}}if(this.selectedOptimizationMode==="targeted"&&!this.customInputs?.job_info&&!this.jobDescription.trim()){d.info("针对性优化需要提供职位描述");return}if(await(this.pcmUploadRef?.getIsUploading?.())){d.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};getEffectiveOptimizationType=()=>{const t=this.customInputs?.optimization_type??(this.selectedOutputType??0);return typeof t==="string"?Number(t):t};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":!this.showIframe};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const s=this.currentConversationId&&!this.showChatModal;const n=Boolean(this.customInputs?.job_info);const a=Boolean(this.customInputs?.optimization_type);const l=Boolean(this.selectedOptimizationMode);const d=!l||this.selectedOptimizationMode==="general"&&Boolean(this.customInputs?.file_url||this.customInputs?.resume_content)||this.selectedOptimizationMode==="targeted"&&Boolean(this.customInputs?.job_info)&&Boolean(this.customInputs?.file_url||this.customInputs?.resume_content);const p=Boolean(this.customInputs&&this.customInputs.job_info);const c=Boolean(this.customInputs&&(this.customInputs.file_url||this.customInputs.resume_content));const h=this.getShouldAutoStart();return o("div",{class:i,style:t},o("div",{class:e},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle),this.showInputHistory&&o("button",{type:"button",class:"header-history-entry",onClick:this.handleInputHistoryClick,title:"历史会话"},"历史会话")),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),this.showInputHistory&&o("components-drawer",{isOpen:this.isHistoryDrawerOpen,drawerTitle:"历史会话",width:"400px",onClosed:()=>{this.isHistoryDrawerOpen=false}},o("div",{class:"history-drawer-content"},o("div",{class:"conversation-list"},this.isLoadingConversations?o("div",{class:"loading-conversations"},o("div",{class:"loading-spinner-small"}),o("p",null,"加载中...")):this.historyConversations.length===0?o("div",{class:"empty-conversations"},o("p",null,"暂无历史会话")):this.historyConversations.map((t=>o("div",{key:t.id,class:"conversation-item",onClick:()=>this.handleSelectConversation(t)},o("div",{class:"conversation-info"},o("div",{class:"conversation-title"},t.name),o("div",{class:"conversation-meta"},o("span",{class:"conversation-time"},t.timeDisplay),t.message_count>0&&o("span",{class:"message-count"},t.message_count,"条消息"),t.status&&o("span",{class:{"conversation-status":true,completed:t.status==="结束",running:t.status==="进行中"}},t.status))))))),!this.isLoadingConversations&&(this.historyConversationPageIndex>0||this.hasMoreHistoryConversations)&&o("div",{class:"history-pagination"},o("button",{type:"button",class:"history-pagination-button",disabled:this.historyConversationPageIndex===0,onClick:()=>this.handleHistoryConversationPageChange("prev")},"上一页"),o("span",{class:"history-pagination-info"},"第 ",this.historyConversationPageIndex+1," 页"),o("button",{type:"button",class:"history-pagination-button",disabled:!this.hasMoreHistoryConversations,onClick:()=>this.handleHistoryConversationPageChange("next")},"下一页")))),!this.showChatModal&&!this.currentConversationId&&!h&&o("div",{class:"input-container"},!n&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第一步:选择优化模式"),o("div",{class:"mode-options"},this.optimizationModes.map((t=>o("div",{class:{"mode-option":true,selected:this.selectedOptimizationMode===t.id},onClick:()=>this.handleOptimizationModeChange(t.id)},o("div",{class:"option-header"},o("span",{class:"option-title"},t.title),this.selectedOptimizationMode===t.id&&o("span",{class:"check-icon"},"✓")),o("div",{class:"option-desc"},t.desc),o("span",{class:"option-suitable"},"适合:",t.suitable)))))),!a&&this.selectedOptimizationMode&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第二步:你希望得到什么?"),o("div",{class:"output-options"},this.outputTypes.map((t=>o("div",{class:{"output-option":true,selected:this.selectedOutputType===t.id},onClick:()=>this.handleOutputTypeChange(t.id)},o("div",{class:"option-header"},o("span",{class:"option-title"},t.title),this.selectedOutputType===t.id&&o("span",{class:"check-icon"},"✓")),o("div",{class:"option-desc"},t.desc),o("span",{class:"option-time"},"预计 ",t.time)))))),!d&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第三步:提供材料"),o("div",{class:"resume-upload-section"},o("label",null,"上传简历"),o("components-mobile-upload-btn",{maxFileSize:15*1024*1024,multiple:false,uploadAreaMode:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设简历",file_size:0,ext:""}]:undefined,disabled:c,onOk:t=>{const e=t.detail??[];this.uploadedFileInfo=e[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),this.selectedOptimizationMode==="targeted"&&o("div",{class:"jd-input-section"},o("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),!p&&o("div",{class:"button-group"},!!this.oemId&&o("button",{class:"position-selector-button",onClick:this.handleOpenPositionSelector,type:"button"},"选择职位"),o("components-mobile-input-btn",{name:"职位描述",onOk:t=>{this.jobDescription=t.detail}})),o("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange,disabled:p}))),o("button",{class:"submit-button",disabled:!this.isFormValid()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),!a&&!this.selectedOptimizationMode&&o("div",{class:"form-hint"},"请先选择优化模式和输出方式"),!a&&this.selectedOptimizationMode&&this.selectedOutputType===null&&o("div",{class:"form-hint"},"请选择输出方式"),l&&!c&&!this.uploadedFileInfo&&o("div",{class:"form-hint warning"},"请上传简历文件"),this.selectedOptimizationMode==="targeted"&&!p&&!this.jobDescription.trim()&&l&&o("div",{class:"form-hint warning"},"针对性优化需要提供职位描述"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),s&&!this.showIframe&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,this.getEffectiveOptimizationType()===1||this.getEffectiveOptimizationType()===2?o("components-thousand-resume-wrapper",{isOpen:true,token:this.token,conversationId:this.currentConversationId,botId:"45444431062634496",optimizationType:this.getEffectiveOptimizationType(),customInputs:{...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.selectedOptimizationMode==="targeted"?this.jobDescription:""),job_title:this.customInputs?.job_title||"",optimization_type:this.getEffectiveOptimizationType()},defaultQuery:this.defaultQuery,modalTitle:this.modalTitle,icon:this.icon,fullscreen:this.fullscreen,zIndex:this.zIndex,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,onModalClosed:this.handleClose,onConversationStart:t=>this.handleStreamComplete(t),onStreamComplete:t=>this.handleStreamComplete(t),onInterviewComplete:t=>this.handleStreamComplete(t)}):o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"45444431062634496",conversationId:this.currentConversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,closeResume:this.closeResumeChat,customInputs:{...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.selectedOptimizationMode==="targeted"?this.jobDescription:""),job_title:this.customInputs?.job_title||"",optimization_type:this.getEffectiveOptimizationType()},interviewMode:"text",onStreamComplete:this.handleStreamComplete,onHistoryConversationSelect:t=>{if(t.detail?.inputs?.optimization_type==1||t.detail?.inputs?.optimization_type==2){t.preventDefault();this.handleSelectConversation(t.detail)}}})),this.showIframe&&o(o.Fragment,null,o("div",{class:"iframe-container"},o("iframe",{ref:t=>this._iframeEl=t,src:`${r}/myresume?conversation_id=${this.currentConversationId}&isSdk=true`,frameborder:"0",onLoad:this.handleIframeLoad})))),this.showPositionSelector&&o("div",{class:"position-selector-modal-overlay"},o("div",{class:"position-selector-modal"},o("div",{class:"position-selector-modal-header"},o("h3",null,"选择职位"),o("button",{class:"position-selector-close-btn",onClick:this.handleClosePositionSelector},"×")),o("div",{class:"position-selector-modal-body"},o("components-position-selector",{oemId:this.oemId,multiple:false,onPositionSelected:this.handlePositionSelected})))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=c+(h+f);export{u as oem_qgqjl_modal};
2
+ //# sourceMappingURL=p-e13e3325.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as e,c as t,g as o,h as i}from"./p-Bq0K-WqZ.js";import{a as n,v as r,c as a,P as s}from"./p-Bktjt_YJ.js";import{E as l}from"./p-C0FYX2-Z.js";import{M as d}from"./p-D39f_W8k.js";const p=".resume-type-container{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-evenly;gap:0;margin-bottom:16px;border-bottom:2px solid #f0f0f0;padding-left:0;overflow-x:auto;overflow-y:hidden}.resume-type-item{cursor:pointer;font-size:16px;color:#333;padding:0 0 8px 0;position:relative;background:none;border:none;outline:none;font-weight:400;white-space:nowrap;flex-shrink:0;transition:color 0.2s}.resume-type-item.selected{color:#2563eb;font-weight:600}.resume-type-item.selected::after{content:'';display:block;position:absolute;left:0;bottom:-2px;width:100%;height:2px;background:#2563eb;border-radius:2px}.chat-content{background-color:#f7f9fc;border:1px solid #e0e6f1;border-radius:8px;padding:16px;display:flex;align-items:center;gap:16px}.chat-content-icon{font-size:24px;flex-shrink:0}.chat-content-text{font-size:14px;color:#595959;line-height:1.6}.resume-type-item:not(.selected):hover{color:#2563eb}.iframe-container{width:100%;height:85vh}.iframe-container iframe{width:100%;height:100%}.optimizing-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.35);z-index:2000;display:flex;align-items:center;justify-content:center}.optimizing-modal-content{background:#fff;border-radius:8px;padding:32px 40px;box-shadow:0 4px 24px rgba(0, 0, 0, 0.12);display:flex;flex-direction:column;align-items:center}.optimizing-modal-content .loading-spinner{width:40px;height:40px;border:4px solid #e0e0e0;border-top:4px solid #2563eb;border-radius:50%;animation:spin 1s linear infinite;margin-bottom:16px}.converstation-list{height:600px;overflow:auto}.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-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:#8c8c8c}.conversation-time{flex-shrink:0}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.optimizing-modal-content .loading-text{font-size:18px;color:#222;font-weight:500;margin:0}";const c='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:5vh auto auto 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;cursor:pointer}.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;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.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;min-width:30px;min-height:30px}.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}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.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)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.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-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}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const h=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const f=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent");this.getResumeData=t(this,"getResumeData");this.resumeDownloadRequested=t(this,"resumeDownloadRequested")}modalTitle="简历制作";token;isOpen=false;isSuccess=false;exportButtonText="导出简历json数据";modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="根据对话生成简历";fullscreen=false;customInputs={};uploadSuccess;streamComplete;conversationStart;tokenInvalid;someErrorEvent;getResumeData;resumeDownloadRequested;filePreviewMode="drawer";isUploading=false;uploadedFileInfo=null;showChatModal=false;resumeType="chat";get hostElement(){return o(this)}isSubmitting=false;showIframe=false;tokenInvalidListener;removeErrorListener;pcmUploadRef;_iframeEl;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.showChatModal=false;this.showIframe=false;this.isSuccess=false;this.conversationId=undefined;this.resumeType="chat"}else{await r(this.token)}}handleIsSuccessChange(e){if(e&&this.resumeType!=="chat"){this.showIframe=true}}handleStreamComplete=e=>{this.conversationId=e.detail.conversation_id;if(this.resumeType!=="chat"){this.showIframe=true;this.isSuccess=true}};componentWillLoad(){if(this.zIndex){a.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}componentDidLoad(){window.addEventListener("message",this.handleIframeMessage)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}window.removeEventListener("message",this.handleIframeMessage)}handleIframeLoad=()=>{};handleIframeMessage=e=>{const t=["http://localhost:3000",s];if(!t.includes(e.origin))return;if(e.source!==this._iframeEl?.contentWindow)return;const{type:o,value:i}=e.data||{};if(o==="callParentMethod"){this.exampleMethodFromIframe(i)}if(o==="resumeDownloadRequested"){if(!i?.url||!i?.fileName)return;this.resumeDownloadRequested.emit({url:i.url,fileName:i.fileName})}if(o==="iframeReady"&&this._iframeEl?.contentWindow){const e=new URL(this._iframeEl.src).origin;this._iframeEl.contentWindow.postMessage({type:"parentReady",origin:window.location.origin},e);this._iframeEl.contentWindow.postMessage({type:"setToken",token:this.token},e);this._iframeEl.contentWindow.postMessage({type:"buttonConfig",config:{hideExportButton:true,exportButtonText:this.exportButtonText}},e)}};exampleMethodFromIframe(e){this.getResumeData.emit(JSON.parse(e))}handleClose=()=>{this.modalClosed.emit()};changeType=e=>{this.resumeType=e};handleStartInterview=async()=>{if(this.resumeType==="upload"&&!this.uploadedFileInfo){d.info("请上传简历");return}if(this.resumeType==="upload"&&await(this.pcmUploadRef?.getIsUploading?.())){d.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};closeResumeChat=()=>{this.isSuccess=false;this.resumeType="upload"};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":!this.isSuccess};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=Boolean(this.customInputs&&this.customInputs.file_url);const r=Boolean(this.customInputs?.file_url&&this.customInputs?.job_info);return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&!this.showChatModal&&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&&!this.showIframe&&i("div",{class:"input-container"},i("div",{class:"resume-type-container"},i("div",{class:{"resume-type-item":true,selected:this.resumeType==="chat"},onClick:()=>this.changeType("chat")},"直接开始"),i("div",{class:{"resume-type-item":true,selected:this.resumeType==="upload"},onClick:()=>this.changeType("upload")},"上传简历")),!n&&this.resumeType==="upload"&&i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("components-mobile-upload-btn",{maxFileSize:15*1024*1024,multiple:false,uploadAreaMode:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},onOk:e=>{const t=e.detail??[];this.uploadedFileInfo=t[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),this.resumeType==="chat"&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"从头开始创建"),i("div",{class:"chat-content"},i("div",{class:"chat-content-text"},"🤖无需复杂操作,只需回答AI的几个简单问题,系统会根据你的回答自动生成内容完整、格式专业的个人简历"))),i("button",{class:"submit-button",disabled:this.resumeType==="upload"&&!n&&!this.uploadedFileInfo||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":this.resumeType==="upload"?"开始制作":"开始对话"),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")))),this.showChatModal&&i(i.Fragment,null,i("div",{style:{display:this.resumeType==="chat"?"block":"none"}},i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,fullscreen:this.fullscreen,showWorkspaceHistory:false,botId:"39284520284983296",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,customInputs:{...this.customInputs,file_url:this.resumeType==="upload"?this.customInputs.file_url||this.uploadedFileInfo?.cos_key:"",mode_type:this.resumeType==="chat"?1:0},interviewMode:"text",closeResume:this.closeResumeChat,onStreamComplete:this.handleStreamComplete})),this.resumeType!=="chat"&&!this.showIframe&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"AI正在优化您的简历...")),this.showIframe&&i(i.Fragment,null,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:"iframe-container"},i("iframe",{ref:e=>this._iframeEl=e,src:`${s}/myresume?conversation_id=${this.conversationId}&isSdk=true`,frameborder:"0",onLoad:this.handleIframeLoad}))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"],isSuccess:["handleIsSuccessChange"]}}};f.style=p+(c+h);export{f as oem_jlzz_modal};
2
- //# sourceMappingURL=p-dd6362f0.entry.js.map
1
+ import{r as e,c as t,g as o,h as i}from"./p-Bq0K-WqZ.js";import{a as n,v as r,c as a,P as s}from"./p-C3qMuJRQ.js";import{E as l}from"./p-C0FYX2-Z.js";import{M as d}from"./p-D39f_W8k.js";const p=".resume-type-container{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-evenly;gap:0;margin-bottom:16px;border-bottom:2px solid #f0f0f0;padding-left:0;overflow-x:auto;overflow-y:hidden}.resume-type-item{cursor:pointer;font-size:16px;color:#333;padding:0 0 8px 0;position:relative;background:none;border:none;outline:none;font-weight:400;white-space:nowrap;flex-shrink:0;transition:color 0.2s}.resume-type-item.selected{color:#2563eb;font-weight:600}.resume-type-item.selected::after{content:'';display:block;position:absolute;left:0;bottom:-2px;width:100%;height:2px;background:#2563eb;border-radius:2px}.chat-content{background-color:#f7f9fc;border:1px solid #e0e6f1;border-radius:8px;padding:16px;display:flex;align-items:center;gap:16px}.chat-content-icon{font-size:24px;flex-shrink:0}.chat-content-text{font-size:14px;color:#595959;line-height:1.6}.resume-type-item:not(.selected):hover{color:#2563eb}.iframe-container{width:100%;height:85vh}.iframe-container iframe{width:100%;height:100%}.optimizing-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.35);z-index:2000;display:flex;align-items:center;justify-content:center}.optimizing-modal-content{background:#fff;border-radius:8px;padding:32px 40px;box-shadow:0 4px 24px rgba(0, 0, 0, 0.12);display:flex;flex-direction:column;align-items:center}.optimizing-modal-content .loading-spinner{width:40px;height:40px;border:4px solid #e0e0e0;border-top:4px solid #2563eb;border-radius:50%;animation:spin 1s linear infinite;margin-bottom:16px}.converstation-list{height:600px;overflow:auto}.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-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:#8c8c8c}.conversation-time{flex-shrink:0}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.optimizing-modal-content .loading-text{font-size:18px;color:#222;font-weight:500;margin:0}";const c='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:5vh auto auto 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;cursor:pointer}.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;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.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;min-width:30px;min-height:30px}.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}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.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)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.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-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}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const h=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const f=class{constructor(o){e(this,o);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent");this.getResumeData=t(this,"getResumeData");this.resumeDownloadRequested=t(this,"resumeDownloadRequested")}modalTitle="简历制作";token;isOpen=false;isSuccess=false;exportButtonText="导出简历json数据";modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="根据对话生成简历";fullscreen=false;customInputs={};uploadSuccess;streamComplete;conversationStart;tokenInvalid;someErrorEvent;getResumeData;resumeDownloadRequested;filePreviewMode="drawer";isUploading=false;uploadedFileInfo=null;showChatModal=false;resumeType="chat";get hostElement(){return o(this)}isSubmitting=false;showIframe=false;tokenInvalidListener;removeErrorListener;pcmUploadRef;_iframeEl;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.showChatModal=false;this.showIframe=false;this.isSuccess=false;this.conversationId=undefined;this.resumeType="chat"}else{await r(this.token)}}handleIsSuccessChange(e){if(e&&this.resumeType!=="chat"){this.showIframe=true}}handleStreamComplete=e=>{this.conversationId=e.detail.conversation_id;if(this.resumeType!=="chat"){this.showIframe=true;this.isSuccess=true}};componentWillLoad(){if(this.zIndex){a.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}componentDidLoad(){window.addEventListener("message",this.handleIframeMessage)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}window.removeEventListener("message",this.handleIframeMessage)}handleIframeLoad=()=>{};handleIframeMessage=e=>{const t=["http://localhost:3000",s];if(!t.includes(e.origin))return;if(e.source!==this._iframeEl?.contentWindow)return;const{type:o,value:i}=e.data||{};if(o==="callParentMethod"){this.exampleMethodFromIframe(i)}if(o==="resumeDownloadRequested"){if(!i?.url||!i?.fileName)return;this.resumeDownloadRequested.emit({url:i.url,fileName:i.fileName})}if(o==="iframeReady"&&this._iframeEl?.contentWindow){const e=new URL(this._iframeEl.src).origin;this._iframeEl.contentWindow.postMessage({type:"parentReady",origin:window.location.origin},e);this._iframeEl.contentWindow.postMessage({type:"setToken",token:this.token},e);this._iframeEl.contentWindow.postMessage({type:"buttonConfig",config:{hideExportButton:true,exportButtonText:this.exportButtonText}},e)}};exampleMethodFromIframe(e){this.getResumeData.emit(JSON.parse(e))}handleClose=()=>{this.modalClosed.emit()};changeType=e=>{this.resumeType=e};handleStartInterview=async()=>{if(this.resumeType==="upload"&&!this.uploadedFileInfo){d.info("请上传简历");return}if(this.resumeType==="upload"&&await(this.pcmUploadRef?.getIsUploading?.())){d.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};closeResumeChat=()=>{this.isSuccess=false;this.resumeType="upload"};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":!this.isSuccess};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=Boolean(this.customInputs&&this.customInputs.file_url);const r=Boolean(this.customInputs?.file_url&&this.customInputs?.job_info);return i("div",{class:o,style:e},i("div",{class:t},this.isShowHeader&&!this.showChatModal&&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&&!this.showIframe&&i("div",{class:"input-container"},i("div",{class:"resume-type-container"},i("div",{class:{"resume-type-item":true,selected:this.resumeType==="chat"},onClick:()=>this.changeType("chat")},"直接开始"),i("div",{class:{"resume-type-item":true,selected:this.resumeType==="upload"},onClick:()=>this.changeType("upload")},"上传简历")),!n&&this.resumeType==="upload"&&i("div",{class:"resume-upload-section"},i("label",null,"上传简历"),i("components-mobile-upload-btn",{maxFileSize:15*1024*1024,multiple:false,uploadAreaMode:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},onOk:e=>{const t=e.detail??[];this.uploadedFileInfo=t[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),this.resumeType==="chat"&&i("div",{class:"jd-input-section"},i("label",{htmlFor:"job-description"},"从头开始创建"),i("div",{class:"chat-content"},i("div",{class:"chat-content-text"},"🤖无需复杂操作,只需回答AI的几个简单问题,系统会根据你的回答自动生成内容完整、格式专业的个人简历"))),i("button",{class:"submit-button",disabled:this.resumeType==="upload"&&!n&&!this.uploadedFileInfo||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":this.resumeType==="upload"?"开始制作":"开始对话"),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")))),this.showChatModal&&i(i.Fragment,null,i("div",{style:{display:this.resumeType==="chat"?"block":"none"}},i("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,fullscreen:this.fullscreen,showWorkspaceHistory:false,botId:"39284520284983296",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,customInputs:{...this.customInputs,file_url:this.resumeType==="upload"?this.customInputs.file_url||this.uploadedFileInfo?.cos_key:"",mode_type:this.resumeType==="chat"?1:0},interviewMode:"text",closeResume:this.closeResumeChat,onStreamComplete:this.handleStreamComplete})),this.resumeType!=="chat"&&!this.showIframe&&i("div",{class:"loading-container"},i("div",{class:"loading-spinner"}),i("p",{class:"loading-text"},"AI正在优化您的简历...")),this.showIframe&&i(i.Fragment,null,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:"iframe-container"},i("iframe",{ref:e=>this._iframeEl=e,src:`${s}/myresume?conversation_id=${this.conversationId}&isSdk=true`,frameborder:"0",onLoad:this.handleIframeLoad}))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"],isSuccess:["handleIsSuccessChange"]}}};f.style=p+(c+h);export{f as oem_jlzz_modal};
2
+ //# sourceMappingURL=p-f666e503.entry.js.map