pcm-agents 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/cjs/index-BFPEnLbS.js +195 -0
- package/dist/cjs/index-BFPEnLbS.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/my-component.cjs.entry.js +2 -2
- package/dist/cjs/my-component.cjs.entry.js.map +1 -1
- package/dist/cjs/my-component.entry.cjs.js.map +1 -1
- package/dist/cjs/pcm-agents.cjs.js +1 -1
- package/dist/cjs/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.cjs.js.map +1 -0
- package/dist/cjs/pcm-app-chat-modal_7.cjs.entry.js +6560 -0
- package/dist/cjs/pcm-app-chat-modal_7.cjs.entry.js.map +1 -0
- package/dist/cjs/pcm-chat-modal.cjs.entry.js +17 -32
- package/dist/cjs/pcm-chat-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/pcm-chat-modal.entry.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/my-component/my-component.css +3 -3
- package/dist/collection/components/my-component/my-component.js +1 -1
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.css +2 -1
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js +137 -159
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.css +66 -12
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.js +106 -13
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.js.map +1 -1
- package/dist/collection/components/pcm-chat-modal/pcm-chat-modal.js +39 -34
- package/dist/collection/components/pcm-chat-modal/pcm-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js +76 -105
- package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.css +162 -0
- package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.js +616 -0
- package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.js.map +1 -0
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.css +0 -79
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js +133 -81
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js.map +1 -1
- package/dist/collection/components/pcm-video-chat-modal/pcm-video-chat-modal.js +77 -101
- package/dist/collection/components/pcm-video-chat-modal/pcm-video-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.css +273 -0
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js +613 -0
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js.map +1 -0
- package/dist/collection/global/global.css +324 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/interfaces/chat.js.map +1 -1
- package/dist/collection/utils/utils.js +54 -113
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +1298 -11280
- package/dist/components/index.js.map +1 -1
- package/dist/components/my-component.js +2 -3
- package/dist/components/my-component.js.map +1 -1
- package/dist/components/{p-C4l_DOnx.js → p-BctfuDvG.js} +106 -147
- package/dist/components/p-BctfuDvG.js.map +1 -0
- package/dist/components/{p-D0s1Q-3O.js → p-LkDC0SN2.js} +343 -16
- package/dist/components/p-LkDC0SN2.js.map +1 -0
- package/dist/components/pcm-app-chat-modal.js +1 -1
- package/dist/components/pcm-chat-message.js +1 -1
- package/dist/components/pcm-chat-modal.js +19 -34
- package/dist/components/pcm-chat-modal.js.map +1 -1
- package/dist/components/pcm-hr-chat-modal.js +70 -100
- package/dist/components/pcm-hr-chat-modal.js.map +1 -1
- package/dist/components/pcm-jlpx-modal.d.ts +11 -0
- package/dist/components/pcm-jlpx-modal.js +339 -0
- package/dist/components/pcm-jlpx-modal.js.map +1 -0
- package/dist/components/pcm-mnms-modal.js +109 -57
- package/dist/components/pcm-mnms-modal.js.map +1 -1
- package/dist/components/pcm-video-chat-modal.js +74 -99
- package/dist/components/pcm-video-chat-modal.js.map +1 -1
- package/dist/components/pcm-zygh-modal.d.ts +11 -0
- package/dist/components/pcm-zygh-modal.js +330 -0
- package/dist/components/pcm-zygh-modal.js.map +1 -0
- package/dist/esm/index-nVjZGfA8.js +189 -0
- package/dist/esm/index-nVjZGfA8.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/my-component.entry.js +2 -2
- package/dist/esm/my-component.entry.js.map +1 -1
- package/dist/esm/pcm-agents.js +1 -1
- package/dist/esm/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.js.map +1 -0
- package/dist/esm/pcm-app-chat-modal_7.entry.js +6552 -0
- package/dist/esm/pcm-app-chat-modal_7.entry.js.map +1 -0
- package/dist/esm/pcm-chat-modal.entry.js +17 -32
- package/dist/esm/pcm-chat-modal.entry.js.map +1 -1
- package/dist/pcm-agents/index.esm.js +1 -1
- package/dist/pcm-agents/my-component.entry.esm.js.map +1 -1
- package/dist/pcm-agents/p-55417392.entry.js +2 -0
- package/dist/pcm-agents/p-55417392.entry.js.map +1 -0
- package/dist/pcm-agents/p-a698b59f.entry.js +2 -0
- package/dist/pcm-agents/p-a698b59f.entry.js.map +1 -0
- package/dist/pcm-agents/p-f3ca99b4.entry.js +2 -0
- package/dist/pcm-agents/p-f3ca99b4.entry.js.map +1 -0
- package/dist/pcm-agents/p-nVjZGfA8.js +2 -0
- package/dist/pcm-agents/p-nVjZGfA8.js.map +1 -0
- package/dist/pcm-agents/pcm-agents.esm.js +1 -1
- package/dist/pcm-agents/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.esm.js.map +1 -0
- package/dist/pcm-agents/pcm-chat-modal.entry.esm.js.map +1 -1
- package/dist/types/components/pcm-app-chat-modal/pcm-app-chat-modal.d.ts +13 -8
- package/dist/types/components/pcm-chat-message/pcm-chat-message.d.ts +5 -0
- package/dist/types/components/pcm-chat-modal/pcm-chat-modal.d.ts +8 -8
- package/dist/types/components/pcm-hr-chat-modal/pcm-hr-chat-modal.d.ts +6 -12
- package/dist/types/components/pcm-jlpx-modal/pcm-jlpx-modal.d.ts +113 -0
- package/dist/types/components/pcm-mnms-modal/pcm-mnms-modal.d.ts +19 -20
- package/dist/types/components/pcm-video-chat-modal/pcm-video-chat-modal.d.ts +4 -4
- package/dist/types/components/pcm-zygh-modal/pcm-zygh-modal.d.ts +117 -0
- package/dist/types/components.d.ts +429 -80
- package/dist/types/interfaces/chat.d.ts +0 -4
- package/dist/types/utils/utils.d.ts +29 -83
- package/package.json +61 -60
- package/readme.md +307 -307
- package/dist/cjs/index-DfIUl99H.js +0 -11413
- package/dist/cjs/index-DfIUl99H.js.map +0 -1
- package/dist/cjs/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/pcm-app-chat-modal_3.cjs.entry.js +0 -3734
- package/dist/cjs/pcm-app-chat-modal_3.cjs.entry.js.map +0 -1
- package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js +0 -1078
- package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/pcm-hr-chat-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/pcm-video-chat-modal.cjs.entry.js +0 -927
- package/dist/cjs/pcm-video-chat-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/pcm-video-chat-modal.entry.cjs.js.map +0 -1
- package/dist/components/p-C4l_DOnx.js.map +0 -1
- package/dist/components/p-CgDy4pJp.js +0 -1244
- package/dist/components/p-CgDy4pJp.js.map +0 -1
- package/dist/components/p-D0s1Q-3O.js.map +0 -1
- package/dist/esm/index-B2EtEi7v.js +0 -11409
- package/dist/esm/index-B2EtEi7v.js.map +0 -1
- package/dist/esm/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.js.map +0 -1
- package/dist/esm/pcm-app-chat-modal_3.entry.js +0 -3730
- package/dist/esm/pcm-app-chat-modal_3.entry.js.map +0 -1
- package/dist/esm/pcm-hr-chat-modal.entry.js +0 -1076
- package/dist/esm/pcm-hr-chat-modal.entry.js.map +0 -1
- package/dist/esm/pcm-video-chat-modal.entry.js +0 -925
- package/dist/esm/pcm-video-chat-modal.entry.js.map +0 -1
- package/dist/pcm-agents/p-0ddd5c47.entry.js +0 -2
- package/dist/pcm-agents/p-0ddd5c47.entry.js.map +0 -1
- package/dist/pcm-agents/p-5f624943.entry.js +0 -2
- package/dist/pcm-agents/p-5f624943.entry.js.map +0 -1
- package/dist/pcm-agents/p-6c07f155.entry.js +0 -2
- package/dist/pcm-agents/p-6c07f155.entry.js.map +0 -1
- package/dist/pcm-agents/p-9a1fb6ca.entry.js +0 -2
- package/dist/pcm-agents/p-9a1fb6ca.entry.js.map +0 -1
- package/dist/pcm-agents/p-B2EtEi7v.js +0 -146
- package/dist/pcm-agents/p-B2EtEi7v.js.map +0 -1
- package/dist/pcm-agents/p-e21bc169.entry.js +0 -2
- package/dist/pcm-agents/p-e21bc169.entry.js.map +0 -1
- package/dist/pcm-agents/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.esm.js.map +0 -1
- package/dist/pcm-agents/pcm-hr-chat-modal.entry.esm.js.map +0 -1
- package/dist/pcm-agents/pcm-video-chat-modal.entry.esm.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,g as o,h as r}from"./p-DaMwkrv5.js";import{a as i,s as n}from"./p-B2EtEi7v.js";const s=":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:900px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.mobile-layout{width:100%;height:100%;border-radius:0}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;min-height:400px;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-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.file-info{display:flex;align-items:center;justify-content:space-between;padding:8px;background:white;border:1px solid #e8e8e8;border-radius:4px}.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:0.8rem;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:1rem;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:1rem}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}.text-input-area{display:flex;flex-direction:column;width:100%;height:100%;padding:16px;border-radius:8px;border:none;}.text-answer-input{flex:1;min-height:80px;padding:12px 12px 0px 12px;border:1px solid #ddd;border-radius:8px 8px 0 0;resize:none;font-size:16px;background-color:#fff;border-bottom:none;outline:none;}.input-toolbar{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;background-color:#fff;border:1px solid #ddd;border-top:none;border-radius:0 0 8px 8px}.text-answer-input:focus{border-color:rgb(74, 144, 226);border-bottom:none}.text-answer-input:focus+.input-toolbar{border-color:rgb(74, 144, 226);border-top:none}.toolbar-actions{display:flex;gap:8px}.toolbar-button{background:transparent;border:none;color:#666;padding:4px;cursor:pointer;border-radius:4px}.toolbar-button:hover{background-color:#f0f0f0}.submit-text-button{padding:6px 16px;background-color:#4a90e2;color:white;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:background-color 0.2s}.submit-text-button:hover:not(.disabled){background-color:#3a7bc8}.submit-text-button.disabled{background-color:#b3b3b3;cursor:not-allowed}@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)}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}.chat-history{min-height:200px}}";const a=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.recordingError=e(this,"recordingError");this.recordingStatusChange=e(this,"recordingStatusChange")}modalTitle="在线客服";apiKey="";isOpen=false;messages=[];modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return o(this)}streamComplete;conversationStart;selectedFile=null;isUploading=false;uploadedFileInfo=[];defaultQuery="";showInitialUpload=false;isRecording=false;recordingStream=null;recordedBlob=null;mediaRecorder=null;recordingTimeLeft=0;showRecordingUI=false;recordingTimer=null;recordingStartTime=0;recordingMaxTime=120;waitingToRecord=false;waitingTimer=null;waitingTimeLeft=10;videoRef=null;totalQuestions=2;currentQuestionNumber=0;interviewComplete;SCROLL_THRESHOLD=30;maxRecordingTime=120;countdownWarningTime=30;showCountdownWarning=false;fullscreen=false;isUploadingVideo=false;isPlayingAudio=false;audioUrl=null;audioElement=null;recordingError;recordingStatusChange;enableVoice=true;displayContentStatus="1";userId="";interviewMode="video";textAnswer="";isSubmittingText=false;customInputs={};handleClose=()=>{this.stopRecording();this.modalClosed.emit()};async sendMessageToAPI(t,e){this.isLoading=true;let o="";let r="";const n=new Date;const s=`${n.getHours()}:${n.getMinutes().toString().padStart(2,"0")}`;const a=t.trim()||"请开始";const l=this.currentQuestionNumber>=this.totalQuestions;const d={id:`temp-${Date.now()}`,time:s,query:a,answer:"",isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=d;this.shouldAutoScroll=true;this.scrollToBottom();if(l){this.messages=[...this.messages,d];this.currentStreamingMessage=null;this.isLoading=false;await this.completeInterview();this.interviewComplete.emit({conversation_id:this.conversationId,total_questions:this.totalQuestions});return}const c={response_mode:"streaming",conversation_id:this.conversationId,query:a,user:this.userId};c.inputs={...this.customInputs};if(e){c.inputs.video_url=e}await i({url:`https://pcm_api.ylzhaopin.com/external/v1/chat/chat-messages`,method:"POST",headers:{authorization:"Bearer "+this.apiKey},data:c,onMessage:t=>{console.log("收到Stream数据:",t);if(t.conversation_id&&!this.conversationId){this.conversationId=t.conversation_id;this.conversationStart.emit({conversation_id:t.conversation_id,event:t.event,message_id:t.message_id,id:t.id})}if(t.event==="node_finished"&&t.data.inputs&&t.data.inputs.LLMText){r=t.data.inputs.LLMText;console.log("获取到 LLMText:",r)}if(t.event==="message"){if(t.event==="agent_message"||t.event==="message"){if(t.answer){o+=t.answer;const e={...this.currentStreamingMessage,answer:o,isStreaming:true};this.currentStreamingMessage=e;this.scrollToBottom()}}}if(t.event==="message_end"){this.streamComplete.emit({conversation_id:t.conversation_id||"",event:t.event,message_id:t.message_id,id:t.id})}},onError:t=>{console.error("发生错误:",t);alert(t instanceof Error?t.message:"消息发送失败,请稍后再试");this.messages=[...this.messages,{...d,answer:"抱歉,发生了错误,请稍后再试。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const e=this.currentStreamingMessage;this.messages=[...this.messages,this.currentStreamingMessage];this.currentStreamingMessage=null;if(t==="下一题"||this.currentQuestionNumber===0){this.currentQuestionNumber++}if(e&&e.answer){const t=r||e.answer;if(t){const e=await this.synthesizeAudio(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}}})}handleScroll=()=>{const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!t)return;const{scrollTop:e,scrollHeight:o,clientHeight:r}=t;const i=o-e-r;this.shouldAutoScroll=i<=this.SCROLL_THRESHOLD};scrollToBottom(){if(!this.shouldAutoScroll)return;const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t&&this.isOpen){t.scrollTop=t.scrollHeight}}componentDidRender(){if(this.isLoadingHistory||this.shouldAutoScroll&&this.isOpen){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t){t.scrollTop=t.scrollHeight}}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;console.log("加载历史消息...");try{await n({url:`https://pcm_api.ylzhaopin.com/external/v1/chat/messages`,method:"GET",headers:{authorization:"Bearer "+this.apiKey},data:{conversation_id:this.conversationId,limit:20},onMessage:t=>{if(t.data){const e=t.data||[];const o=e.map((t=>{const e=new Date(t.created_at*1e3);const o=e.getHours().toString().padStart(2,"0");const r=e.getMinutes().toString().padStart(2,"0");const i=`${o}:${r}`;const{inputs:n,...s}=t;return{...s,time:i,isStreaming:false,status:t.status==="error"?"error":"normal"}}));this.messages=o;this.isLoadingHistory=false;requestAnimationFrame((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}))}else{this.isLoadingHistory=false}},onError:t=>{console.error("加载历史消息失败:",t);alert(t instanceof Error?t.message:"加载历史消息失败,请刷新重试");this.isLoadingHistory=false},onComplete:()=>{this.isLoadingHistory=false}})}catch(t){console.error("加载历史消息失败:",t);alert(t instanceof Error?t.message:"加载历史消息失败,请刷新重试");this.isLoadingHistory=false}}componentDidLoad(){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t){t.addEventListener("scroll",this.handleScroll)}}componentWillLoad(){if(this.isOpen){if(this.conversationId){setTimeout((()=>this.loadHistoryMessages()),0)}else{setTimeout((()=>this.sendMessageToAPI(this.defaultQuery)),0)}}}startWaitingToRecord(){if(this.waitingTimer){clearInterval(this.waitingTimer)}if(this.recordingTimer){clearInterval(this.recordingTimer)}this.waitingToRecord=true;this.waitingTimeLeft=10;this.waitingTimer=setInterval((()=>{this.waitingTimeLeft--;if(this.waitingTimeLeft<=0){clearInterval(this.waitingTimer);this.waitingTimer=null;this.waitingToRecord=false;this.startRecording()}}),1e3)}async startRecording(){try{const t=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.recordingStream=t;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(t);const e=this.getSupportedMimeType();let o;try{o=new MediaRecorder(t,{mimeType:e})}catch(e){console.warn("指定的MIME类型不受支持,使用默认设置:",e);try{o=new MediaRecorder(t)}catch(t){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:t});this.showRecordingUI=false;return}}this.mediaRecorder=o;const r=[];o.ondataavailable=t=>{if(t.data.size>0){r.push(t.data)}};o.onerror=t=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:t});this.stopRecording()};o.onstop=()=>{try{const t=e||"video/mp4";const o=new Blob(r,{type:t});if(o.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=o;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:o.size,type:o.type}});this.uploadRecordedVideo()}catch(t){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:t});this.showRecordingUI=false}};try{o.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:o.mimeType}})}catch(t){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:t});this.showRecordingUI=false;return}this.recordingTimer=setInterval((()=>{const t=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-t);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(t){console.error("无法访问摄像头或麦克风:",t);this.recordingError.emit({type:"media_access_failed",message:"无法访问摄像头或麦克风,请确保已授予权限",details:t});this.showRecordingUI=false}}setupVideoPreview(t){setTimeout((()=>{const e=this.hostElement.shadowRoot?.querySelector("video");if(e&&t){try{e.srcObject=t;e.play().catch((t=>{console.error("视频播放失败:",t)}))}catch(o){console.warn("设置srcObject失败,尝试替代方法:",o);try{const o=URL.createObjectURL(t);e.src=o;e.onended=()=>{URL.revokeObjectURL(o)}}catch(t){console.error("创建对象URL失败:",t)}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const t=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const e of t){if(!e)return"";try{if(MediaRecorder.isTypeSupported(e)){return e}}catch(t){console.warn(`检查MIME类型支持时出错 ${e}:`,t)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""}stopRecording(){if(this.mediaRecorder&&this.isRecording){this.mediaRecorder.stop();this.isRecording=false;if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.recordingStream){this.recordingStream.getTracks().forEach((t=>t.stop()));this.recordingStream=null}this.videoRef=null}}async convertAudioToText(t){try{return new Promise(((e,o)=>{n({url:`https://pcm_api.ylzhaopin.com/external/v1/tts/audio_to_text`,method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer "+this.apiKey},data:{cos_key:t},onMessage:t=>{if(t&&t.text){e(t.text)}else{console.warn("音频转文字返回结果格式不正确");e(null)}},onError:t=>{console.error("音频转文字请求失败:",t);o(t)}})}))}catch(t){console.error("音频转文字错误:",t);return null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const t=this.recordedBlob.type.includes("webm")?"webm":"mp4";const e=`answer.${t}`;const o=new FormData;o.append("file",this.recordedBlob,e);const r=await fetch("https://pcm_api.ylzhaopin.com/external/v1/files/upload",{method:"POST",headers:{authorization:"Bearer "+this.apiKey},body:o});const i=await r.json();if(i&&i.cos_key){const t=await this.convertAudioToText(i.cos_key);await this.saveVideoAnswer(i.cos_key);this.sendMessageToAPI(t||"下一题")}else{throw new Error("视频上传失败")}}catch(t){console.error("视频上传或处理错误:",t);this.recordingError.emit({type:"upload_failed",message:"视频上传或处理失败",details:t})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}async saveVideoAnswer(t){if(!this.conversationId)return;try{const e=this.messages.length>0?this.messages[this.messages.length-1]:null;if(!e)return;await n({url:"https://pcm_api.ylzhaopin.com/agents/hr_competition/answer",method:"POST",headers:{authorization:"Bearer "+this.apiKey},data:{conversation_id:this.conversationId,user:this.userId,question:e.answer,file_url:t}})}catch(t){console.error("保存视频答案失败:",t)}}async completeInterview(){if(!this.conversationId)return;try{const t={response_mode:"streaming",conversation_id:this.conversationId,query:"面试完成",user:this.userId,inputs:{...this.customInputs}};i({url:`https://pcm_api.ylzhaopin.com/external/v1/chat/chat-messages`,method:"POST",headers:{authorization:"Bearer "+this.apiKey},data:t}).catch((t=>{console.error("发送面试完成请求失败:",t)}))}catch(t){console.error("发送面试完成请求失败:",t)}}async synthesizeAudio(t){try{const e=await fetch("https://pcm_api.ylzhaopin.com/external/v1/tts/synthesize_audio",{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer "+this.apiKey},body:JSON.stringify({text:t})});if(!e.ok){throw new Error("语音合成失败")}const o=await e.blob();return URL.createObjectURL(o)}catch(t){console.error("语音合成错误:",t);throw t}}playAudio(t){return new Promise((e=>{this.isPlayingAudio=true;this.audioUrl=t;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=t;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;e()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;e()};this.audioElement.play().catch((t=>{console.error("音频播放失败:",t);this.isPlayingAudio=false;this.audioUrl=null;e()}))}))}disconnectedCallback(){const t=this.hostElement.shadowRoot?.querySelector(".chat-history");if(t){t.removeEventListener("scroll",this.handleScroll)}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()}handlePlayAudio=async()=>{if(this.audioUrl){await this.playAudio(this.audioUrl);this.startWaitingToRecord()}};handleTextInputChange=t=>{const e=t.target;this.textAnswer=e.value};handleKeyDown=t=>{if(t.key==="Enter"){if(t.ctrlKey){return}else{t.preventDefault();if(this.textAnswer.trim()&&!this.isSubmittingText&&!this.isLoading&&!this.currentStreamingMessage&&!this.waitingToRecord&&!this.isPlayingAudio){this.submitTextAnswer()}}}};submitTextAnswer=async()=>{if(!this.textAnswer.trim()||this.isSubmittingText){return}this.isSubmittingText=true;try{const t=this.textAnswer;this.textAnswer="";await this.sendMessageToAPI(t)}catch(t){console.error("提交文本回答失败:",t);alert("提交回答失败,请重试")}finally{this.isSubmittingText=false}};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const i=()=>r("div",{class:"video-preview"},r("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:t=>{if(t&&this.recordingStream&&!this.videoRef){this.videoRef=t}}}),r("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},r("span",{class:"recording-dot"}),r("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const n=()=>{if(this.isPlayingAudio){return r("div",{class:"placeholder-status"},r("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return r("div",{class:"placeholder-status"},r("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return r("div",{class:"placeholder-status"},r("p",null,"请等待题目..."))}if(this.waitingToRecord){return r("div",{class:"placeholder-status"},r("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return r("div",{class:"placeholder-status default-status"},r("p",null,"准备中..."))};const s=()=>r("div",{class:"text-input-area"},r("textarea",{class:"text-answer-input",placeholder:"请输入您的回答...(按回车发送,Ctrl+回车换行)",value:this.textAnswer,onInput:this.handleTextInputChange,onKeyDown:this.handleKeyDown,disabled:this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.waitingToRecord||this.isPlayingAudio}),r("div",{class:"input-toolbar"},r("div",{class:"toolbar-actions"}),r("button",{class:{"submit-text-button":true,disabled:!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.waitingToRecord||this.isPlayingAudio},disabled:!this.textAnswer.trim()||this.isSubmittingText||this.isLoading||!!this.currentStreamingMessage||this.waitingToRecord||this.isPlayingAudio,onClick:this.submitTextAnswer},this.isSubmittingText?"发送中...":"发送")));return r("div",{class:o,style:t},r("div",{class:e},this.isShowHeader&&r("div",{class:"modal-header"},r("div",{class:"header-left"},this.icon&&r("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),r("div",null,this.modalTitle)),this.isNeedClose&&r("button",{class:"close-button",onClick:this.handleClose},r("span",null,"×"))),r("div",{style:{height:"100%"}},r("div",{class:"chat-history",onScroll:this.handleScroll},this.isLoadingHistory?r("div",{class:"loading-container"},r("div",{class:"loading-spinner"}),r("p",null,"加载历史消息中...")):r("div",null,this.messages.map((t=>r("div",{id:`message_${t.id}`,key:t.id},r("pcm-chat-message",{message:t,onMessageChange:e=>{const o=this.messages.map((o=>o.id===t.id?{...o,...e.detail}:o));this.messages=o}})))),this.currentStreamingMessage&&r("div",{id:`message_${this.currentStreamingMessage.id}`},r("pcm-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&r("div",{class:"empty-state"},r("p",null,"正在准备面试...")))),r("div",{class:"recording-section"},r("div",{class:"recording-container"},this.interviewMode==="text"&&s(),this.interviewMode==="video"&&r("div",{style:{width:"100%",display:"flex",flexWrap:"wrap",justifyContent:"center"}},r("div",{class:"video-area"},this.showRecordingUI?i():r("div",{class:"video-preview placeholder"},n()),r("div",{class:"progress-container"},r("div",{class:"progress-bar-container"},r("div",{class:"progress-bar",style:{width:`${Math.max(0,this.currentQuestionNumber-1)/this.totalQuestions*100}%`}})),r("div",{class:"progress-text"},"已完成",Math.max(0,this.currentQuestionNumber-1),"/",this.totalQuestions))),r("div",{class:"recording-controls"},this.showRecordingUI?r("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):r("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return r("div",{class:"play-audio-container",onClick:this.handlePlayAudio},r("p",null,r("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},r("path",{d:"M8 5v14l11-7z"})),r("span",{style:{verticalAlign:"middle"}},"播放题目")))}return r("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})()))))))))}};a.style=s;function l(){return{async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}let d=l();function c(t){d=t}const h=/[&<>"']/;const p=new RegExp(h.source,"g");const u=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;const m=new RegExp(u.source,"g");const f={"&":"&","<":"<",">":">",'"':""","'":"'"};const b=t=>f[t];function g(t,e){if(e){if(h.test(t)){return t.replace(p,b)}}else{if(u.test(t)){return t.replace(m,b)}}return t}const y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function w(t){return t.replace(y,((t,e)=>{e=e.toLowerCase();if(e==="colon")return":";if(e.charAt(0)==="#"){return e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1))}return""}))}const k=/(^|[^\[])\^/g;function x(t,e){t=typeof t==="string"?t:t.source;e=e||"";const o={replace:(e,r)=>{r=typeof r==="object"&&"source"in r?r.source:r;r=r.replace(k,"$1");t=t.replace(e,r);return o},getRegex:()=>new RegExp(t,e)};return o}function v(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch(t){return null}return t}const C={exec:()=>null};function z(t,e){const o=t.replace(/\|/g,((t,e,o)=>{let r=false;let i=e;while(--i>=0&&o[i]==="\\")r=!r;if(r){return"|"}else{return" |"}})),r=o.split(/ \|/);let i=0;if(!r[0].trim()){r.shift()}if(r.length>0&&!r[r.length-1].trim()){r.pop()}if(e){if(r.length>e){r.splice(e)}else{while(r.length<e)r.push("")}}for(;i<r.length;i++){r[i]=r[i].trim().replace(/\\\|/g,"|")}return r}function _(t,e,o){const r=t.length;if(r===0){return""}let i=0;while(i<r){const o=t.charAt(r-i-1);if(o===e&&true){i++}else{break}}return t.slice(0,r-i)}function $(t,e){if(t.indexOf(e[1])===-1){return-1}let o=0;for(let r=0;r<t.length;r++){if(t[r]==="\\"){r++}else if(t[r]===e[0]){o++}else if(t[r]===e[1]){o--;if(o<0){return r}}}return-1}function S(t,e,o,r){const i=e.href;const n=e.title?g(e.title):null;const s=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){r.state.inLink=true;const t={type:"link",raw:o,href:i,title:n,text:s,tokens:r.inlineTokens(s)};r.state.inLink=false;return t}return{type:"image",raw:o,href:i,title:n,text:g(s)}}function M(t,e){const o=t.match(/^(\s+)(?:```)/);if(o===null){return e}const r=o[1];return e.split("\n").map((t=>{const e=t.match(/^\s+/);if(e===null){return t}const[o]=e;if(o.length>=r.length){return t.slice(r.length)}return t})).join("\n")}class A{options;rules;lexer;constructor(t){this.options=t||d}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0){return{type:"space",raw:e[0]}}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:!this.options.pedantic?_(t,"\n"):t}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0];const o=M(t,e[3]||"");return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline._escapes,"$1"):e[2],text:o}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(/#$/.test(t)){const e=_(t,"#");if(this.options.pedantic){t=e.trim()}else if(!e||/ $/.test(e)){t=e.trim()}}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e){return{type:"hr",raw:e[0]}}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){const t=_(e[0].replace(/^ *>[ \t]?/gm,""),"\n");const o=this.lexer.state.top;this.lexer.state.top=true;const r=this.lexer.blockTokens(t);this.lexer.state.top=o;return{type:"blockquote",raw:e[0],tokens:r,text:t}}}list(t){let e=this.rules.block.list.exec(t);if(e){let o=e[1].trim();const r=o.length>1;const i={type:"list",raw:"",ordered:r,start:r?+o.slice(0,-1):"",loose:false,items:[]};o=r?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`;if(this.options.pedantic){o=r?o:"[*+-]"}const n=new RegExp(`^( {0,3}${o})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="";let a="";let l=false;while(t){let o=false;if(!(e=n.exec(t))){break}if(this.rules.block.hr.test(t)){break}s=e[0];t=t.substring(s.length);let r=e[2].split("\n",1)[0].replace(/^\t+/,(t=>" ".repeat(3*t.length)));let d=t.split("\n",1)[0];let c=0;if(this.options.pedantic){c=2;a=r.trimStart()}else{c=e[2].search(/[^ ]/);c=c>4?1:c;a=r.slice(c);c+=e[1].length}let h=false;if(!r&&/^ *$/.test(d)){s+=d+"\n";t=t.substring(d.length+1);o=true}if(!o){const e=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`);const o=new RegExp(`^ {0,${Math.min(3,c-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);const i=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:\`\`\`|~~~)`);const n=new RegExp(`^ {0,${Math.min(3,c-1)}}#`);while(t){const l=t.split("\n",1)[0];d=l;if(this.options.pedantic){d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")}if(i.test(d)){break}if(n.test(d)){break}if(e.test(d)){break}if(o.test(t)){break}if(d.search(/[^ ]/)>=c||!d.trim()){a+="\n"+d.slice(c)}else{if(h){break}if(r.search(/[^ ]/)>=4){break}if(i.test(r)){break}if(n.test(r)){break}if(o.test(r)){break}a+="\n"+d}if(!h&&!d.trim()){h=true}s+=l+"\n";t=t.substring(l.length+1);r=d.slice(c)}}if(!i.loose){if(l){i.loose=true}else if(/\n *\n *$/.test(s)){l=true}}let p=null;let u;if(this.options.gfm){p=/^\[[ xX]\] /.exec(a);if(p){u=p[0]!=="[ ] ";a=a.replace(/^\[[ xX]\] +/,"")}}i.items.push({type:"list_item",raw:s,task:!!p,checked:u,loose:false,text:a,tokens:[]});i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd();i.items[i.items.length-1].text=a.trimEnd();i.raw=i.raw.trimEnd();for(let t=0;t<i.items.length;t++){this.lexer.state.top=false;i.items[t].tokens=this.lexer.blockTokens(i.items[t].text,[]);if(!i.loose){const e=i.items[t].tokens.filter((t=>t.type==="space"));const o=e.length>0&&e.some((t=>/\n.*\n/.test(t.raw)));i.loose=o}}if(i.loose){for(let t=0;t<i.items.length;t++){i.items[t].loose=true}}return i}}html(t){const e=this.rules.block.html.exec(t);if(e){const t={type:"html",block:true,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]};return t}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(/\s+/g," ");const o=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"";const r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:o,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(e){if(!/[:|]/.test(e[2])){return}const t={type:"table",raw:e[0],header:z(e[1]).map((t=>({text:t,tokens:[]}))),align:e[2].replace(/^\||\| *$/g,"").split("|"),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(t.header.length===t.align.length){let e=t.align.length;let o,r,i,n;for(o=0;o<e;o++){const e=t.align[o];if(e){if(/^ *-+: *$/.test(e)){t.align[o]="right"}else if(/^ *:-+: *$/.test(e)){t.align[o]="center"}else if(/^ *:-+ *$/.test(e)){t.align[o]="left"}else{t.align[o]=null}}}e=t.rows.length;for(o=0;o<e;o++){t.rows[o]=z(t.rows[o],t.header.length).map((t=>({text:t,tokens:[]})))}e=t.header.length;for(r=0;r<e;r++){t.header[r].tokens=this.lexer.inline(t.header[r].text)}e=t.rows.length;for(r=0;r<e;r++){n=t.rows[r];for(i=0;i<n.length;i++){n[i].tokens=this.lexer.inline(n[i].text)}}return t}}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e){return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t=e[1].charAt(e[1].length-1)==="\n"?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e){return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}}escape(t){const e=this.rules.inline.escape.exec(t);if(e){return{type:"escape",raw:e[0],text:g(e[1])}}}tag(t){const e=this.rules.inline.tag.exec(t);if(e){if(!this.lexer.state.inLink&&/^<a /i.test(e[0])){this.lexer.state.inLink=true}else if(this.lexer.state.inLink&&/^<\/a>/i.test(e[0])){this.lexer.state.inLink=false}if(!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=true}else if(this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=false}return{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:e[0]}}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t)){return}const e=_(t.slice(0,-1),"\\");if((t.length-e.length)%2===0){return}}else{const t=$(e[2],"()");if(t>-1){const o=e[0].indexOf("!")===0?5:4;const r=o+e[1].length+t;e[2]=e[2].substring(0,t);e[0]=e[0].substring(0,r).trim();e[3]=""}}let o=e[2];let r="";if(this.options.pedantic){const t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);if(t){o=t[1];r=t[3]}}else{r=e[3]?e[3].slice(1,-1):""}o=o.trim();if(/^</.test(o)){if(this.options.pedantic&&!/>$/.test(t)){o=o.slice(1)}else{o=o.slice(1,-1)}}return S(e,{href:o?o.replace(this.rules.inline._escapes,"$1"):o,title:r?r.replace(this.rules.inline._escapes,"$1"):r},e[0],this.lexer)}}reflink(t,e){let o;if((o=this.rules.inline.reflink.exec(t))||(o=this.rules.inline.nolink.exec(t))){let t=(o[2]||o[1]).replace(/\s+/g," ");t=e[t.toLowerCase()];if(!t){const t=o[0].charAt(0);return{type:"text",raw:t,text:t}}return S(o,t,o[0],this.lexer)}}emStrong(t,e,o=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r)return;if(r[3]&&o.match(/[\p{L}\p{N}]/u))return;const i=r[1]||r[2]||"";if(!i||!o||this.rules.inline.punctuation.exec(o)){const o=[...r[0]].length-1;let i,n,s=o,a=0;const l=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;l.lastIndex=0;e=e.slice(-1*t.length+o);while((r=l.exec(e))!=null){i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6];if(!i)continue;n=[...i].length;if(r[3]||r[4]){s+=n;continue}else if(r[5]||r[6]){if(o%3&&!((o+n)%3)){a+=n;continue}}s-=n;if(s>0)continue;n=Math.min(n,n+s+a);const e=[...r[0]][0].length;const l=t.slice(0,o+r.index+e+n);if(Math.min(o,n)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const d=l.slice(2,-2);return{type:"strong",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(/\n/g," ");const o=/[^ ]/.test(t);const r=/^ /.test(t)&&/ $/.test(t);if(o&&r){t=t.substring(1,t.length-1)}t=g(t,true);return{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e){return{type:"br",raw:e[0]}}}del(t){const e=this.rules.inline.del.exec(t);if(e){return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,o;if(e[2]==="@"){t=g(e[1]);o="mailto:"+t}else{t=g(e[1]);o=t}return{type:"link",raw:e[0],text:t,href:o,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,o;if(e[2]==="@"){t=g(e[0]);o="mailto:"+t}else{let r;do{r=e[0];e[0]=this.rules.inline._backpedal.exec(e[0])[0]}while(r!==e[0]);t=g(e[0]);if(e[1]==="www."){o="http://"+e[0]}else{o=e[0]}}return{type:"link",raw:e[0],text:t,href:o,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){let t;if(this.lexer.state.inRawBlock){t=e[0]}else{t=g(e[0])}return{type:"text",raw:e[0],text:t}}}}const T={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:"+"<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)"+"|comment[^\\n]*(\\n+|$)"+"|<\\?[\\s\\S]*?(?:\\?>\\n*|$)"+"|<![A-Z][\\s\\S]*?(?:>\\n*|$)"+"|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)"+"|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+")",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:C,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};T._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;T._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;T.def=x(T.def).replace("label",T._label).replace("title",T._title).getRegex();T.bullet=/(?:[*+-]|\d{1,9}[.)])/;T.listItemStart=x(/^( *)(bull) */).replace("bull",T.bullet).getRegex();T.list=x(T.list).replace(/bull/g,T.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+T.def.source+")").getRegex();T._tag="address|article|aside|base|basefont|blockquote|body|caption"+"|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption"+"|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe"+"|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option"+"|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr"+"|track|ul";T._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;T.html=x(T.html,"i").replace("comment",T._comment).replace("tag",T._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();T.lheading=x(T.lheading).replace(/bull/g,T.bullet).getRegex();T.paragraph=x(T._paragraph).replace("hr",T.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",T._tag).getRegex();T.blockquote=x(T.blockquote).replace("paragraph",T.paragraph).getRegex();T.normal={...T};T.gfm={...T.normal,table:"^ *([^\\n ].*)\\n"+" {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)"+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};T.gfm.table=x(T.gfm.table).replace("hr",T.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",T._tag).getRegex();T.gfm.paragraph=x(T._paragraph).replace("hr",T.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",T.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",T._tag).getRegex();T.pedantic={...T.normal,html:x("^ *(?:comment *(?:\\n|\\s*$)"+"|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)"+"|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",T._comment).replace(/tag/g,"(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub"+"|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)"+"\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:C,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(T.normal._paragraph).replace("hr",T.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",T.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const I={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:C,tag:"^comment"+"|^</[a-zA-Z][\\w:-]*\\s*>"+"|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>"+"|^<\\?[\\s\\S]*?\\?>"+"|^<![a-zA-Z]+\\s[\\s\\S]*?>"+"|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:C,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};I._punctuation="\\p{P}$+<=>`^|~";I.punctuation=x(I.punctuation,"u").replace(/punctuation/g,I._punctuation).getRegex();I.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;I.anyPunctuation=/\\[punct]/g;I._escapes=/\\([punct])/g;I._comment=x(T._comment).replace("(?:--\x3e|$)","--\x3e").getRegex();I.emStrong.lDelim=x(I.emStrong.lDelim,"u").replace(/punct/g,I._punctuation).getRegex();I.emStrong.rDelimAst=x(I.emStrong.rDelimAst,"gu").replace(/punct/g,I._punctuation).getRegex();I.emStrong.rDelimUnd=x(I.emStrong.rDelimUnd,"gu").replace(/punct/g,I._punctuation).getRegex();I.anyPunctuation=x(I.anyPunctuation,"gu").replace(/punct/g,I._punctuation).getRegex();I._escapes=x(I._escapes,"gu").replace(/punct/g,I._punctuation).getRegex();I._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;I._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;I.autolink=x(I.autolink).replace("scheme",I._scheme).replace("email",I._email).getRegex();I._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;I.tag=x(I.tag).replace("comment",I._comment).replace("attribute",I._attribute).getRegex();I._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;I._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;I._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;I.link=x(I.link).replace("label",I._label).replace("href",I._href).replace("title",I._title).getRegex();I.reflink=x(I.reflink).replace("label",I._label).replace("ref",T._label).getRegex();I.nolink=x(I.nolink).replace("ref",T._label).getRegex();I.reflinkSearch=x(I.reflinkSearch,"g").replace("reflink",I.reflink).replace("nolink",I.nolink).getRegex();I.normal={...I};I.pedantic={...I.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",I._label).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",I._label).getRegex()};I.gfm={...I.normal,escape:x(I.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};I.gfm.url=x(I.gfm.url,"i").replace("email",I.gfm._extended_email).getRegex();I.breaks={...I.gfm,br:x(I.br).replace("{2,}","*").getRegex(),text:x(I.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class E{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[];this.tokens.links=Object.create(null);this.options=t||d;this.options.tokenizer=this.options.tokenizer||new A;this.tokenizer=this.options.tokenizer;this.tokenizer.options=this.options;this.tokenizer.lexer=this;this.inlineQueue=[];this.state={inLink:false,inRawBlock:false,top:true};const e={block:T.normal,inline:I.normal};if(this.options.pedantic){e.block=T.pedantic;e.inline=I.pedantic}else if(this.options.gfm){e.block=T.gfm;if(this.options.breaks){e.inline=I.breaks}else{e.inline=I.gfm}}this.tokenizer.rules=e}static get rules(){return{block:T,inline:I}}static lex(t,e){const o=new E(e);return o.lex(t)}static lexInline(t,e){const o=new E(e);return o.inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,"\n");this.blockTokens(t,this.tokens);let e;while(e=this.inlineQueue.shift()){this.inlineTokens(e.src,e.tokens)}return this.tokens}blockTokens(t,e=[]){if(this.options.pedantic){t=t.replace(/\t/g," ").replace(/^ +$/gm,"")}else{t=t.replace(/^( *)(\t+)/gm,((t,e,o)=>e+" ".repeat(o.length)))}let o;let r;let i;let n;while(t){if(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>{if(o=r.call({lexer:this},t,e)){t=t.substring(o.raw.length);e.push(o);return true}return false}))){continue}if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);if(o.raw.length===1&&e.length>0){e[e.length-1].raw+="\n"}else{e.push(o)}continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&(r.type==="paragraph"||r.type==="text")){r.raw+="\n"+o.raw;r.text+="\n"+o.text;this.inlineQueue[this.inlineQueue.length-1].src=r.text}else{e.push(o)}continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&(r.type==="paragraph"||r.type==="text")){r.raw+="\n"+o.raw;r.text+="\n"+o.raw;this.inlineQueue[this.inlineQueue.length-1].src=r.text}else if(!this.tokens.links[o.tag]){this.tokens.links[o.tag]={href:o.href,title:o.title}}continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length);e.push(o);continue}i=t;if(this.options.extensions&&this.options.extensions.startBlock){let e=Infinity;const o=t.slice(1);let r;this.options.extensions.startBlock.forEach((t=>{r=t.call({lexer:this},o);if(typeof r==="number"&&r>=0){e=Math.min(e,r)}}));if(e<Infinity&&e>=0){i=t.substring(0,e+1)}}if(this.state.top&&(o=this.tokenizer.paragraph(i))){r=e[e.length-1];if(n&&r.type==="paragraph"){r.raw+="\n"+o.raw;r.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=r.text}else{e.push(o)}n=i.length!==t.length;t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&r.type==="text"){r.raw+="\n"+o.raw;r.text+="\n"+o.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=r.text}else{e.push(o)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}this.state.top=true;return e}inline(t,e=[]){this.inlineQueue.push({src:t,tokens:e});return e}inlineTokens(t,e=[]){let o,r,i;let n=t;let s;let a,l;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0){while((s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null){if(t.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))){n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}}}while((s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null){n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex)}while((s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null){n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex)}while(t){if(!a){l=""}a=false;if(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>{if(o=r.call({lexer:this},t,e)){t=t.substring(o.raw.length);e.push(o);return true}return false}))){continue}if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&o.type==="text"&&r.type==="text"){r.raw+=o.raw;r.text+=o.text}else{e.push(o)}continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);r=e[e.length-1];if(r&&o.type==="text"&&r.type==="text"){r.raw+=o.raw;r.text+=o.text}else{e.push(o)}continue}if(o=this.tokenizer.emStrong(t,n,l)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length);e.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length);e.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length);e.push(o);continue}i=t;if(this.options.extensions&&this.options.extensions.startInline){let e=Infinity;const o=t.slice(1);let r;this.options.extensions.startInline.forEach((t=>{r=t.call({lexer:this},o);if(typeof r==="number"&&r>=0){e=Math.min(e,r)}}));if(e<Infinity&&e>=0){i=t.substring(0,e+1)}}if(o=this.tokenizer.inlineText(i)){t=t.substring(o.raw.length);if(o.raw.slice(-1)!=="_"){l=o.raw.slice(-1)}a=true;r=e[e.length-1];if(r&&r.type==="text"){r.raw+=o.raw;r.text+=o.text}else{e.push(o)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}return e}}class j{options;constructor(t){this.options=t||d}code(t,e,o){const r=(e||"").match(/^\S*/)?.[0];t=t.replace(/\n$/,"")+"\n";if(!r){return"<pre><code>"+(o?t:g(t,true))+"</code></pre>\n"}return'<pre><code class="language-'+g(r)+'">'+(o?t:g(t,true))+"</code></pre>\n"}blockquote(t){return`<blockquote>\n${t}</blockquote>\n`}html(t,e){return t}heading(t,e,o){return`<h${e}>${t}</h${e}>\n`}hr(){return"<hr>\n"}list(t,e,o){const r=e?"ol":"ul";const i=e&&o!==1?' start="'+o+'"':"";return"<"+r+i+">\n"+t+"</"+r+">\n"}listitem(t,e,o){return`<li>${t}</li>\n`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>\n`}table(t,e){if(e)e=`<tbody>${e}</tbody>`;return"<table>\n"+"<thead>\n"+t+"</thead>\n"+e+"</table>\n"}tablerow(t){return`<tr>\n${t}</tr>\n`}tablecell(t,e){const o=e.header?"th":"td";const r=e.align?`<${o} align="${e.align}">`:`<${o}>`;return r+t+`</${o}>\n`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,o){const r=v(t);if(r===null){return o}t=r;let i='<a href="'+t+'"';if(e){i+=' title="'+e+'"'}i+=">"+o+"</a>";return i}image(t,e,o){const r=v(t);if(r===null){return o}t=r;let i=`<img src="${t}" alt="${o}"`;if(e){i+=` title="${e}"`}i+=">";return i}text(t){return t}}class R{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,e,o){return""+o}image(t,e,o){return""+o}br(){return""}}class F{options;renderer;textRenderer;constructor(t){this.options=t||d;this.options.renderer=this.options.renderer||new j;this.renderer=this.options.renderer;this.renderer.options=this.options;this.textRenderer=new R}static parse(t,e){const o=new F(e);return o.parse(t)}static parseInline(t,e){const o=new F(e);return o.parseInline(t)}parse(t,e=true){let o="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const t=i;const e=this.options.extensions.renderers[t.type].call({parser:this},t);if(e!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){o+=e||"";continue}}switch(i.type){case"space":{continue}case"hr":{o+=this.renderer.hr();continue}case"heading":{const t=i;o+=this.renderer.heading(this.parseInline(t.tokens),t.depth,w(this.parseInline(t.tokens,this.textRenderer)));continue}case"code":{const t=i;o+=this.renderer.code(t.text,t.lang,!!t.escaped);continue}case"table":{const t=i;let e="";let r="";for(let e=0;e<t.header.length;e++){r+=this.renderer.tablecell(this.parseInline(t.header[e].tokens),{header:true,align:t.align[e]})}e+=this.renderer.tablerow(r);let n="";for(let e=0;e<t.rows.length;e++){const o=t.rows[e];r="";for(let e=0;e<o.length;e++){r+=this.renderer.tablecell(this.parseInline(o[e].tokens),{header:false,align:t.align[e]})}n+=this.renderer.tablerow(r)}o+=this.renderer.table(e,n);continue}case"blockquote":{const t=i;const e=this.parse(t.tokens);o+=this.renderer.blockquote(e);continue}case"list":{const t=i;const e=t.ordered;const r=t.start;const n=t.loose;let s="";for(let e=0;e<t.items.length;e++){const o=t.items[e];const r=o.checked;const i=o.task;let a="";if(o.task){const t=this.renderer.checkbox(!!r);if(n){if(o.tokens.length>0&&o.tokens[0].type==="paragraph"){o.tokens[0].text=t+" "+o.tokens[0].text;if(o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&o.tokens[0].tokens[0].type==="text"){o.tokens[0].tokens[0].text=t+" "+o.tokens[0].tokens[0].text}}else{o.tokens.unshift({type:"text",text:t+" "})}}else{a+=t+" "}}a+=this.parse(o.tokens,n);s+=this.renderer.listitem(a,i,!!r)}o+=this.renderer.list(s,e,r);continue}case"html":{const t=i;o+=this.renderer.html(t.text,t.block);continue}case"paragraph":{const t=i;o+=this.renderer.paragraph(this.parseInline(t.tokens));continue}case"text":{let n=i;let s=n.tokens?this.parseInline(n.tokens):n.text;while(r+1<t.length&&t[r+1].type==="text"){n=t[++r];s+="\n"+(n.tokens?this.parseInline(n.tokens):n.text)}o+=e?this.renderer.paragraph(s):s;continue}default:{const t='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return o}parseInline(t,e){e=e||this.renderer;let o="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const t=this.options.extensions.renderers[i.type].call({parser:this},i);if(t!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){o+=t||"";continue}}switch(i.type){case"escape":{const t=i;o+=e.text(t.text);break}case"html":{const t=i;o+=e.html(t.text);break}case"link":{const t=i;o+=e.link(t.href,t.title,this.parseInline(t.tokens,e));break}case"image":{const t=i;o+=e.image(t.href,t.title,t.text);break}case"strong":{const t=i;o+=e.strong(this.parseInline(t.tokens,e));break}case"em":{const t=i;o+=e.em(this.parseInline(t.tokens,e));break}case"codespan":{const t=i;o+=e.codespan(t.text);break}case"br":{o+=e.br();break}case"del":{const t=i;o+=e.del(this.parseInline(t.tokens,e));break}case"text":{const t=i;o+=e.text(t.text);break}default:{const t='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return o}}class q{options;constructor(t){this.options=t||d}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}class L{defaults=l();options=this.setOptions;parse=this.#t(E.lex,F.parse);parseInline=this.#t(E.lexInline,F.parseInline);Parser=F;Renderer=j;TextRenderer=R;Lexer=E;Tokenizer=A;Hooks=q;constructor(...t){this.use(...t)}walkTokens(t,e){let o=[];for(const r of t){o=o.concat(e.call(this,r));switch(r.type){case"table":{const t=r;for(const r of t.header){o=o.concat(this.walkTokens(r.tokens,e))}for(const r of t.rows){for(const t of r){o=o.concat(this.walkTokens(t.tokens,e))}}break}case"list":{const t=r;o=o.concat(this.walkTokens(t.items,e));break}default:{const t=r;if(this.defaults.extensions?.childTokens?.[t.type]){this.defaults.extensions.childTokens[t.type].forEach((r=>{o=o.concat(this.walkTokens(t[r],e))}))}else if(t.tokens){o=o.concat(this.walkTokens(t.tokens,e))}}}}return o}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((t=>{const o={...t};o.async=this.defaults.async||o.async||false;if(t.extensions){t.extensions.forEach((t=>{if(!t.name){throw new Error("extension name required")}if("renderer"in t){const o=e.renderers[t.name];if(o){e.renderers[t.name]=function(...e){let r=t.renderer.apply(this,e);if(r===false){r=o.apply(this,e)}return r}}else{e.renderers[t.name]=t.renderer}}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline"){throw new Error("extension level must be 'block' or 'inline'")}const o=e[t.level];if(o){o.unshift(t.tokenizer)}else{e[t.level]=[t.tokenizer]}if(t.start){if(t.level==="block"){if(e.startBlock){e.startBlock.push(t.start)}else{e.startBlock=[t.start]}}else if(t.level==="inline"){if(e.startInline){e.startInline.push(t.start)}else{e.startInline=[t.start]}}}}if("childTokens"in t&&t.childTokens){e.childTokens[t.name]=t.childTokens}}));o.extensions=e}if(t.renderer){const e=this.defaults.renderer||new j(this.defaults);for(const o in t.renderer){const r=t.renderer[o];const i=o;const n=e[i];e[i]=(...t)=>{let o=r.apply(e,t);if(o===false){o=n.apply(e,t)}return o||""}}o.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new A(this.defaults);for(const o in t.tokenizer){const r=t.tokenizer[o];const i=o;const n=e[i];e[i]=(...t)=>{let o=r.apply(e,t);if(o===false){o=n.apply(e,t)}return o}}o.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new q;for(const o in t.hooks){const r=t.hooks[o];const i=o;const n=e[i];if(q.passThroughHooks.has(o)){e[i]=t=>{if(this.defaults.async){return Promise.resolve(r.call(e,t)).then((t=>n.call(e,t)))}const o=r.call(e,t);return n.call(e,o)}}else{e[i]=(...t)=>{let o=r.apply(e,t);if(o===false){o=n.apply(e,t)}return o}}}o.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens;const r=t.walkTokens;o.walkTokens=function(t){let o=[];o.push(r.call(this,t));if(e){o=o.concat(e.call(this,t))}return o}}this.defaults={...this.defaults,...o}}));return this}setOptions(t){this.defaults={...this.defaults,...t};return this}lexer(t,e){return E.lex(t,e??this.defaults)}parser(t,e){return F.parse(t,e??this.defaults)}#t(t,e){return(o,r)=>{const i={...r};const n={...this.defaults,...i};if(this.defaults.async===true&&i.async===false){if(!n.silent){console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.")}n.async=true}const s=this.#e(!!n.silent,!!n.async);if(typeof o==="undefined"||o===null){return s(new Error("marked(): input parameter is undefined or null"))}if(typeof o!=="string"){return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"))}if(n.hooks){n.hooks.options=n}if(n.async){return Promise.resolve(n.hooks?n.hooks.preprocess(o):o).then((e=>t(e,n))).then((t=>n.walkTokens?Promise.all(this.walkTokens(t,n.walkTokens)).then((()=>t)):t)).then((t=>e(t,n))).then((t=>n.hooks?n.hooks.postprocess(t):t)).catch(s)}try{if(n.hooks){o=n.hooks.preprocess(o)}const r=t(o,n);if(n.walkTokens){this.walkTokens(r,n.walkTokens)}let i=e(r,n);if(n.hooks){i=n.hooks.postprocess(i)}return i}catch(t){return s(t)}}}#e(t,e){return o=>{o.message+="\nPlease report this to https://github.com/markedjs/marked.";if(t){const t="<p>An error occurred:</p><pre>"+g(o.message+"",true)+"</pre>";if(e){return Promise.resolve(t)}return t}if(e){return Promise.reject(o)}throw o}}}const Z=new L;function P(t,e){return Z.parse(t,e)}P.options=P.setOptions=function(t){Z.setOptions(t);P.defaults=Z.defaults;c(P.defaults);return P};P.getDefaults=l;P.defaults=d;P.use=function(...t){Z.use(...t);P.defaults=Z.defaults;c(P.defaults);return P};P.walkTokens=function(t,e){return Z.walkTokens(t,e)};P.parseInline=Z.parseInline;P.Parser=F;P.parser=F.parse;P.Renderer=j;P.TextRenderer=R;P.Lexer=E;P.lexer=E.lex;P.Tokenizer=A;P.Hooks=q;P.parse=P;const O=':host{display:block;width:100%}.message-round{margin-bottom:16px;width:100%}.user-message-container{display:flex;flex-direction:column;align-items:flex-end;margin-bottom:8px}.assistant-message-container{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:8px}.message-bubble{padding:7px 18px;max-width:80%;position:relative}.user-message{background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);font-weight:600;font-size:14px;color:#FFFFFF;border-radius:14px 0 14px 14px}.assistant-message{background-color:#0000000f;border-radius:0 14px 14px 14px;font-weight:600;font-size:14px;color:#00000099}.message-time{font-size:12px;color:#999;margin-top:4px}.user-message-container .message-time{color:rgba(255, 255, 255, 0.7)}.loading-dots{display:flex;align-items:center;padding:12px 16px;background-color:#f0f0f0;border-radius:18px;border-top-left-radius:4px}.loading-dots span{width:8px;height:8px;margin:0 3px;background-color:#999;border-radius:50%;display:inline-block;animation:dot-pulse 1.5s infinite ease-in-out}.loading-dots span:nth-child(2){animation-delay:0.2s}.loading-dots span:nth-child(3){animation-delay:0.4s}@keyframes dot-pulse{0%,80%,100%{transform:scale(0.8);opacity:0.5}40%{transform:scale(1.2);opacity:1}}.file-view{margin-top:8px;padding:8px;background-color:#f5f5f5;border-radius:4px;font-size:14px;word-break:break-all}.input-view{margin-top:8px;border:1px solid #eee;border-radius:4px;overflow:hidden}.input-label{padding:4px 8px;background-color:#f5f5f5;font-size:12px;font-weight:500}.input-value{padding:8px;font-size:14px}.input-metadata{font-size:0.875rem;margin-top:4px}.markdown-body{--base-size-4:0.25rem;--base-size-8:0.5rem;--base-size-16:1rem;--base-size-24:1.5rem;--base-size-40:2.5rem;--base-text-weight-normal:400;--base-text-weight-medium:500;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fgColor-accent:Highlight}@media (prefers-color-scheme: dark){.markdown-body,[data-theme="dark"]{color-scheme:dark;--focus-outlineColor:#1f6feb;--fgColor-default:#f0f6fc;--fgColor-muted:#9198a1;--fgColor-accent:#4493f8;--fgColor-success:#3fb950;--fgColor-attention:#d29922;--fgColor-danger:#f85149;--fgColor-done:#ab7df8;--bgColor-default:#0d1117;--bgColor-muted:#151b23;--bgColor-neutral-muted:#656c7633;--bgColor-attention-muted:#bb800926;--borderColor-default:#3d444d;--borderColor-muted:#3d444db3;--borderColor-neutral-muted:#3d444db3;--borderColor-accent-emphasis:#1f6feb;--borderColor-success-emphasis:#238636;--borderColor-attention-emphasis:#9e6a03;--borderColor-danger-emphasis:#da3633;--borderColor-done-emphasis:#8957e5;--color-prettylights-syntax-comment:#9198a1;--color-prettylights-syntax-constant:#79c0ff;--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;--color-prettylights-syntax-entity:#d2a8ff;--color-prettylights-syntax-storage-modifier-import:#f0f6fc;--color-prettylights-syntax-entity-tag:#7ee787;--color-prettylights-syntax-keyword:#ff7b72;--color-prettylights-syntax-string:#a5d6ff;--color-prettylights-syntax-variable:#ffa657;--color-prettylights-syntax-brackethighlighter-unmatched:#f85149;--color-prettylights-syntax-brackethighlighter-angle:#9198a1;--color-prettylights-syntax-invalid-illegal-text:#f0f6fc;--color-prettylights-syntax-invalid-illegal-bg:#8e1519;--color-prettylights-syntax-carriage-return-text:#f0f6fc;--color-prettylights-syntax-carriage-return-bg:#b62324;--color-prettylights-syntax-string-regexp:#7ee787;--color-prettylights-syntax-markup-list:#f2cc60;--color-prettylights-syntax-markup-heading:#1f6feb;--color-prettylights-syntax-markup-italic:#f0f6fc;--color-prettylights-syntax-markup-bold:#f0f6fc;--color-prettylights-syntax-markup-deleted-text:#ffdcd7;--color-prettylights-syntax-markup-deleted-bg:#67060c;--color-prettylights-syntax-markup-inserted-text:#aff5b4;--color-prettylights-syntax-markup-inserted-bg:#033a16;--color-prettylights-syntax-markup-changed-text:#ffdfb6;--color-prettylights-syntax-markup-changed-bg:#5a1e02;--color-prettylights-syntax-markup-ignored-text:#f0f6fc;--color-prettylights-syntax-markup-ignored-bg:#1158c7;--color-prettylights-syntax-meta-diff-range:#d2a8ff;--color-prettylights-syntax-sublimelinter-gutter-mark:#3d444d}}@media (prefers-color-scheme: light){.markdown-body,[data-theme="light"]{color-scheme:light;--focus-outlineColor:#0969da;--fgColor-default:#1f2328;--fgColor-muted:#59636e;--fgColor-accent:#0969da;--fgColor-success:#1a7f37;--fgColor-attention:#9a6700;--fgColor-danger:#d1242f;--fgColor-done:#8250df;--bgColor-default:#ffffff;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--bgColor-attention-muted:#fff8c5;--borderColor-default:#d1d9e0;--borderColor-muted:#d1d9e0b3;--borderColor-neutral-muted:#d1d9e0b3;--borderColor-accent-emphasis:#0969da;--borderColor-success-emphasis:#1a7f37;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-done-emphasis:#8250df;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-storage-modifier-import:#1f2328;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-variable:#953800;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-invalid-illegal-text:#f6f8fa;--color-prettylights-syntax-invalid-illegal-bg:#82071e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98}}.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{width:16px;height:16px;content:\' \';display:inline-block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' version=\'1.1\' aria-hidden=\'true\'><path fill-rule=\'evenodd\' d=\'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none !important}.markdown-body a{background-color:transparent;color:var(--fgColor-accent);text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dfn{font-style:italic}.markdown-body h1{margin:.67em 0;font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.markdown-body sub{bottom:-0.25em}.markdown-body sup{top:-0.5em}.markdown-body img{border-style:none;max-width:100%;box-sizing:content-box}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;overflow:hidden;background:transparent;border-bottom:1px solid var(--borderColor-muted);height:.25em;padding:0;margin:var(--base-size-24) 0;background-color:var(--borderColor-default);border:0}.markdown-body input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{-webkit-appearance:button;appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button,.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button,.markdown-body [type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr::before{display:table;content:""}.markdown-body hr::after{display:table;clear:both;content:""}.markdown-body table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:solid 1px transparent}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{display:inline-block;padding:var(--base-size-4);font:11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);line-height:10px;color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);border-radius:6px;box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted)}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold, 600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold, 600);padding-bottom:.3em;font-size:1.2em;border-bottom:1px solid var(--borderColor-muted)}.markdown-body h3{font-weight:var(--base-text-weight-semibold, 600);font-size:1.05em}.markdown-body h4{font-weight:var(--base-text-weight-semibold, 600);font-size:0.875em}.markdown-body h5{font-weight:var(--base-text-weight-semibold, 600);font-size:.85em}.markdown-body h6{font-weight:var(--base-text-weight-semibold, 600);font-size:.80em;color:var(--fgColor-muted)}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{margin:0;padding:0 1em;color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default)}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{margin-top:0;margin-bottom:0;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px;word-wrap:normal}.markdown-body .octicon{display:inline-block;overflow:visible !important;vertical-align:text-bottom;fill:currentColor}.markdown-body input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button{margin:0;appearance:none}.markdown-body .mr-2{margin-right:var(--base-size-8, 8px) !important}.markdown-body::before{display:table;content:""}.markdown-body::after{display:table;clear:both;content:""}.markdown-body>*:first-child{margin-top:0 !important}.markdown-body>*:last-child{margin-bottom:0 !important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16);font-size:16px;font-weight:400}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{padding:0 .2em;font-size:inherit}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{padding-bottom:0;border-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type="a s"]{list-style-type:lower-alpha}.markdown-body ol[type="A s"]{list-style-type:upper-alpha}.markdown-body ol[type="i s"]{list-style-type:lower-roman}.markdown-body ol[type="I s"]{list-style-type:upper-roman}.markdown-body ol[type="1"]{list-style-type:decimal}.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold, 600)}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold, 600)}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid var(--borderColor-default)}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:transparent}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid var(--borderColor-default)}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:var(--fgColor-default)}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em .4em;margin:0;font-size:85%;white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:transparent;border:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);overflow:auto;font-size:85%;line-height:1.45;color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold, 600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]::before{content:"["}.markdown-body [data-footnote-ref]::after{content:"]"}.markdown-body .footnotes{font-size:12px;color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default)}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{display:inline-block;padding-left:var(--base-size-16);margin-top:var(--base-size-16)}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target::before{position:absolute;top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body body:has(:modal){padding-right:var(--dialog-scrollgutter) !important}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{font-weight:bold;color:var(--color-prettylights-syntax-string-regexp)}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{font-weight:bold;color:var(--color-prettylights-syntax-markup-heading)}.markdown-body .pl-mi{font-style:italic;color:var(--color-prettylights-syntax-markup-italic)}.markdown-body .pl-mb{font-weight:bold;color:var(--color-prettylights-syntax-markup-bold)}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{font-weight:bold;color:var(--color-prettylights-syntax-meta-diff-range)}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{text-decoration:underline;color:var(--color-prettylights-syntax-constant-other-reference-link)}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){outline:none;box-shadow:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{display:inline-block;min-width:1ch;font-family:"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1em;font-style:normal !important;font-weight:var(--base-text-weight-normal, 400);line-height:1;vertical-align:-0.075em}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal, 400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{margin:0 .2em .25em -1.4em;vertical-align:middle}.markdown-body ul:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body ol:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{display:block;width:auto;height:24px;overflow:visible;clip:auto}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{display:flex;font-weight:var(--base-text-weight-medium, 500);align-items:center;line-height:1}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>*:first-child>.heading-element:first-child{margin-top:0 !important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}.message-actions{position:absolute;top:8px;right:8px;opacity:0;transition:opacity 0.2s ease}.assistant-message:hover .message-actions{opacity:1}.copy-button{background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#6e6e80;display:flex;align-items:center;justify-content:center}.copy-button:hover{background-color:rgba(0, 0, 0, 0.05);color:#000}.copy-button svg{width:16px;height:16px}';const U=class{message;messageChange;get hostElement(){return o(this)}constructor(o){t(this,o);this.messageChange=e(this,"messageChange");P.setOptions({breaks:true,gfm:true})}copyMessageContent(){if(this.message.answer){navigator.clipboard.writeText(this.message.answer).then((()=>{console.log("内容已复制到剪贴板")})).catch((t=>{console.error("复制失败:",t)}))}}renderUserMessage(){if(!this.message?.query?.trim())return null;return r("div",{class:"user-message-container"},r("div",{class:"message-bubble user-message"},r("p",null,this.message.query),this.renderInputs()))}renderAssistantMessage(){if(!this.message.answer&&!this.message.isStreaming)return null;const t=this.message.isStreaming&&!this.message.answer;const e=this.message.answer?P(this.message.answer):"";return r("div",{class:"assistant-message-container"},r("div",{class:"message-bubble assistant-message"},r("div",{class:"markdown-content markdown-body",innerHTML:t?`请稍等...`:e})),!t&&this.message.answer&&r("div",{class:"message-actions"},r("button",{class:"copy-button",onClick:()=>this.copyMessageContent(),title:"复制内容"},r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},r("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),r("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})))))}renderInputs(){if(!this.message.inputs)return null;return r("div",null,Object.keys(this.message.inputs).map(((t,e)=>{const o=this.message.inputs[t];if(o&&!t.startsWith("hide_")&&t!=="answer"){if(t==="file_url"){return r("div",{key:e,class:"file-view"},o)}else if(t==="file_urls"||t==="fileUrls"){const t=o.split(",");return r("div",{key:e,class:"flex flex-wrap"},t.map(((t,e)=>r("div",{key:e,class:"file-view"},t))))}else if(t==="job_info"){return r("div",{key:e,class:"input-view"},r("div",{class:"input-label"},"职位信息"),r("div",{class:"input-value"},o))}else if(t==="rule"){return r("div",{key:e,class:"input-view"},r("div",{class:"input-label"},"评估规则"),r("div",{class:"input-value"},o))}else{return r("div",{key:e,class:"input-metadata"},t,": ",`${o}`)}}return null})))}render(){return r("div",{key:"5748f17414b9442b9b791955de38437184fa2f7e",class:"message-round"},this.renderUserMessage(),this.renderAssistantMessage())}};U.style=O;const B=":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:500px;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.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}.pc-layout{width:80%;max-width:500px;min-width:320px}.mobile-layout{width:100%;height:100%;border-radius:0}@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);margin-top:40px;height:calc(100% - 40px);max-height:calc(100% - 40px);border-radius:16px 16px 0 0}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-container{padding:30px 20px;display:flex;flex-direction:column;align-items:center;text-align:center;height:calc(100% - 60px);transition:opacity 0.5s ease-out}.upload-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333}.upload-area{border:2px dashed #ddd;border-radius:8px;width:100%;max-width:400px;cursor:pointer;transition:all 0.3s ease;margin-bottom:20px}.upload-area:hover{border-color:#1890ff;background-color:rgba(24, 144, 255, 0.05)}.upload-placeholder{display:flex;flex-direction:column;align-items:center;color:#666}.upload-hint{font-size:0.8rem;color:#999;margin-top:0.5rem}.file-info{display:flex;align-items:center;justify-content:space-between;padding:8px;background:#f9f9f9;border:1px solid #e8e8e8;border-radius:4px}.file-info span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 30px)}.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}.submit-button{margin-top:10px;padding:10px 30px;background:#1890ff;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}.file-input{display:none}.transitioning{position:relative;overflow:hidden}.fade-out{opacity:0.7;transition:opacity 0.5s ease-out}.transition-container{margin-top:20px;width:100%}.progress-bar{width:100%;height:6px;background-color:#f0f0f0;border-radius:3px;overflow:hidden;margin-bottom:10px}.progress-fill{height:100%;background-color:#4285f4;transition:width 0.3s ease-out}.upload-container.fade-out{opacity:0;transform:translateY(-20px);transition:opacity 0.3s ease, transform 0.3s ease}.chat-modal-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column}.modal-container{position:relative;overflow:hidden}";const D=class{constructor(o){t(this,o);this.modalClosed=e(this,"modalClosed");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete")}modalTitle="在线客服";apiKey="";isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="";fullscreen=false;isMobile=false;customInputs={};uploadSuccess;streamComplete;conversationStart;interviewComplete;selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;isTransitioning=false;transitionTimer=null;get hostElement(){return o(this)}handleClose=()=>{this.isOpen=false;this.modalClosed.emit()};handleFileChange=t=>{const e=t.target;if(e.files&&e.files.length>0){this.selectedFile=e.files[0]}};handleUploadClick=()=>{const t=this.hostElement.shadowRoot?.querySelector(".file-input");t?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=null;const t=this.hostElement.shadowRoot?.querySelector(".file-input");if(t){t.value=""}};async uploadFile(){if(!this.selectedFile)return;this.isUploading=true;try{const t=new FormData;t.append("file",this.selectedFile);const e=await fetch("https://pcm_api.ylzhaopin.com/external/v1/files/upload",{method:"POST",headers:{authorization:"Bearer "+this.apiKey},body:t});const o=await e.json();if(!e.ok){throw new Error(o.message||"文件上传失败")}if(o){this.uploadedFileInfo={cos_key:o.cos_key,filename:o.filename,ext:o.ext,presigned_url:o.presigned_url};this.uploadSuccess.emit(this.uploadedFileInfo)}}catch(t){console.error("文件上传错误:",t);this.clearSelectedFile();alert(t instanceof Error?t.message:"文件上传失败,请重试")}finally{this.isUploading=false}}handleStartInterview=async()=>{if(!this.selectedFile){alert("请上传简历");return}if(!this.uploadedFileInfo){await this.uploadFile();if(!this.uploadedFileInfo){return}}console.log("传递的customInputs:",{...this.customInputs,file_url:this.uploadedFileInfo.cos_key});this.showChatModal=true};handleIsOpenChange(t){if(!t){this.clearSelectedFile();this.showChatModal=false;if(this.transitionTimer){clearTimeout(this.transitionTimer);this.transitionTimer=null}}else if(this.conversationId){this.showChatModal=true}}handleStreamComplete=t=>{this.streamComplete.emit(t.detail)};handleConversationStart=t=>{this.conversationStart.emit(t.detail)};handleInterviewComplete=t=>{this.interviewComplete.emit(t.detail)};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};console.log("showChatModal:",this.showChatModal);const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":!this.isMobile,"mobile-layout":this.isMobile};const o={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};if(this.conversationId&&!this.showChatModal){this.showChatModal=true}return r("div",{class:o,style:t},r("div",{class:e},this.isShowHeader&&r("div",{class:"modal-header"},r("div",{class:"header-left"},this.icon&&r("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),r("div",null,this.modalTitle)),this.isNeedClose&&r("button",{class:"close-button",onClick:this.handleClose},r("span",null,"×"))),!this.showChatModal&&!this.conversationId&&r("div",{class:"upload-container"},r("h3",null,"开始前,请上传您的简历"),r("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?r("div",{class:"file-info"},r("span",null,this.selectedFile.name),r("button",{class:"remove-file",onClick:t=>{t.stopPropagation();this.clearSelectedFile()}},"×")):r("div",{class:"upload-placeholder"},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",width:"48",height:"48"},r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m0-16l-4 4m4-4l4 4"})),r("p",null,"点击上传简历"),r("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式"))),r("button",{class:"submit-button",disabled:!this.selectedFile||this.isUploading,onClick:this.handleStartInterview},this.isUploading?"上传中...":"开始面试"),r("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt,.md"})),this.showChatModal&&r("div",{class:"chat-modal-container"},r("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,apiKey:this.apiKey,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,zIndex:this.zIndex,fullscreen:this.fullscreen,conversationId:this.conversationId,defaultQuery:this.defaultQuery,enableVoice:false,customInputs:this.conversationId?undefined:{...this.customInputs,file_url:this.uploadedFileInfo?.cos_key},interviewMode:"text",onModalClosed:this.handleClose,onStreamComplete:this.handleStreamComplete,onConversationStart:this.handleConversationStart,onInterviewComplete:this.handleInterviewComplete}))))}static get watchers(){return{isOpen:["handleIsOpenChange"]}}};D.style=B;export{a as pcm_app_chat_modal,U as pcm_chat_message,D as pcm_mnms_modal};
|
|
2
|
-
//# sourceMappingURL=p-e21bc169.entry.js.map
|