@8wave/ai-elements 0.119.0-beta.26 → 0.119.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Agent-D8YrsP52.js → Agent-Gdgpd3LA.js} +66 -66
- package/dist/_chunks/Agent-Gdgpd3LA.js.map +1 -0
- package/dist/_chunks/{PkChatbotFilePreview-DAhN8TyL.js → PkChatbotFilePreview-DiuzVVKH.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-DAhN8TyL.js.map → PkChatbotFilePreview-DiuzVVKH.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-Bry3y6Ru.js → PkStreamingMarkdown-DKyHYHUN.js} +890 -853
- package/dist/_chunks/{PkStreamingMarkdown-Bry3y6Ru.js.map → PkStreamingMarkdown-DKyHYHUN.js.map} +1 -1
- package/dist/_chunks/{PkToolEditSpreadsheet-5vHzEy4P.js → PkToolEditSpreadsheet-CfJ3BWMe.js} +3 -3
- package/dist/_chunks/{PkToolEditSpreadsheet-5vHzEy4P.js.map → PkToolEditSpreadsheet-CfJ3BWMe.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-Cj8hTfNF.js → PkToolRequestGeolocation-PxhQxMP1.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-Cj8hTfNF.js.map → PkToolRequestGeolocation-PxhQxMP1.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-BWxR1hV4.js → PkToolRequestOAuthConnection-klmrRZWz.js} +6 -5
- package/dist/_chunks/PkToolRequestOAuthConnection-klmrRZWz.js.map +1 -0
- package/dist/_chunks/{PkToolShowArtifact-CfJLe8vD.js → PkToolShowArtifact-ChDm6ZEK.js} +3 -3
- package/dist/_chunks/PkToolShowArtifact-ChDm6ZEK.js.map +1 -0
- package/dist/_chunks/{PkToolShowCalendarEvent-Bp_yv8S7.js → PkToolShowCalendarEvent-CRVtR3oP.js} +5 -4
- package/dist/_chunks/PkToolShowCalendarEvent-CRVtR3oP.js.map +1 -0
- package/dist/_chunks/{PkToolShowComparison-Bvd4f4tJ.js → PkToolShowComparison-DLC22e1W.js} +4 -3
- package/dist/_chunks/PkToolShowComparison-DLC22e1W.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm--9XOVqNB.js → PkToolShowContactForm-CfCy-b8w.js} +6 -6
- package/dist/_chunks/PkToolShowContactForm-CfCy-b8w.js.map +1 -0
- package/dist/_chunks/{PkToolShowDiagram-C-pNbC9n.js → PkToolShowDiagram-JpRMa4Jj.js} +11 -10
- package/dist/_chunks/PkToolShowDiagram-JpRMa4Jj.js.map +1 -0
- package/dist/_chunks/{PkToolShowEmail-BKel_O29.js → PkToolShowEmail-C7mUCqGL.js} +4 -3
- package/dist/_chunks/PkToolShowEmail-C7mUCqGL.js.map +1 -0
- package/dist/_chunks/{PkToolShowForm-CGAc1O6K.js → PkToolShowForm-DnIwTGl4.js} +6 -5
- package/dist/_chunks/PkToolShowForm-DnIwTGl4.js.map +1 -0
- package/dist/_chunks/{PkToolShowImageGallery-CIhIrIcY.js → PkToolShowImageGallery-Ab8fJ9jY.js} +4 -4
- package/dist/_chunks/{PkToolShowImageGallery-CIhIrIcY.js.map → PkToolShowImageGallery-Ab8fJ9jY.js.map} +1 -1
- package/dist/_chunks/{PkToolShowLocation-78C7jFiV.js → PkToolShowLocation-D5d6bbP-.js} +5 -4
- package/dist/_chunks/PkToolShowLocation-D5d6bbP-.js.map +1 -0
- package/dist/_chunks/{PkToolShowMessage-BScy-w4J.js → PkToolShowMessage-vw4XS4TR.js} +4 -3
- package/dist/_chunks/PkToolShowMessage-vw4XS4TR.js.map +1 -0
- package/dist/_chunks/{PkToolShowProductList-BjWKnbyD.js → PkToolShowProductList-DztzZVDd.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-BjWKnbyD.js.map → PkToolShowProductList-DztzZVDd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowQrCode-B70jPHDw.js → PkToolShowQrCode-BhcAUXSZ.js} +4 -3
- package/dist/_chunks/PkToolShowQrCode-BhcAUXSZ.js.map +1 -0
- package/dist/_chunks/{PkToolShowSources-BJ-XFrLD.js → PkToolShowSources-Bvg3f3GC.js} +52 -51
- package/dist/_chunks/PkToolShowSources-Bvg3f3GC.js.map +1 -0
- package/dist/_chunks/{PkToolShowSuggestedReply-0KahUIlw.js → PkToolShowSuggestedReply-BISQY1ce.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-0KahUIlw.js.map → PkToolShowSuggestedReply-BISQY1ce.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-_V_d-PDr.js → PkToolShowVideo-DdoYLl7R.js} +3 -3
- package/dist/_chunks/{PkToolShowVideo-_V_d-PDr.js.map → PkToolShowVideo-DdoYLl7R.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-DfLsFayn.js → PkToolShowWeather-CnpPZCLm.js} +2 -2
- package/dist/_chunks/{PkToolShowWeather-DfLsFayn.js.map → PkToolShowWeather-CnpPZCLm.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-D55VEPjK.js → PkToolShowWebPages-BooCEJrs.js} +3 -3
- package/dist/_chunks/{PkToolShowWebPages-D55VEPjK.js.map → PkToolShowWebPages-BooCEJrs.js.map} +1 -1
- package/dist/_chunks/VvButtonLocalized-DV-zbH9b.js +21 -0
- package/dist/_chunks/VvButtonLocalized-DV-zbH9b.js.map +1 -0
- package/dist/_chunks/{chatImagePolicy-DXkhb-N_.js → chatImagePolicy-CfJt8_9Z.js} +3 -3
- package/dist/_chunks/{chatImagePolicy-DXkhb-N_.js.map → chatImagePolicy-CfJt8_9Z.js.map} +1 -1
- package/dist/_chunks/{index.es-BrsciU25.js → index.es-oI6RqNZW.js} +2 -2
- package/dist/_chunks/{index.es-BrsciU25.js.map → index.es-oI6RqNZW.js.map} +1 -1
- package/dist/_chunks/{markdown-DpoAzJSk.js → markdown-BbaLt57-.js} +8 -8
- package/dist/_chunks/{markdown-DpoAzJSk.js.map → markdown-BbaLt57-.js.map} +1 -1
- package/dist/_chunks/{src-Dt4rhhPN.js → src-DL9TKN-Z.js} +2 -2
- package/dist/_chunks/src-DL9TKN-Z.js.map +1 -0
- package/dist/_chunks/text-BHCGblDQ.js +6 -0
- package/dist/_chunks/text-BHCGblDQ.js.map +1 -0
- package/dist/_chunks/{useLightbox-pPBe746W.js → useLightbox-1KKLemEE.js} +2 -2
- package/dist/_chunks/{useLightbox-pPBe746W.js.map → useLightbox-1KKLemEE.js.map} +1 -1
- package/dist/ai-elements.es.js +2792 -2529
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAudioTranscript.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotError.js +1 -1
- package/dist-vue/PkChatbotFeedbackForm.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/PkChatbotWakeupBar.js +1 -1
- package/dist-vue/_chunks/{Agent-dGF8mkG9.js → Agent-DU1WWaHR.js} +87 -87
- package/dist-vue/_chunks/Agent-DU1WWaHR.js.map +1 -0
- package/dist-vue/_chunks/{Document-CV-RJu_p.js → Document-Cto-Qws0.js} +2 -2
- package/dist-vue/_chunks/{Document-CV-RJu_p.js.map → Document-Cto-Qws0.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-536vsOfp.js → PkChatbot-C18mnGJ9.js} +86 -85
- package/dist-vue/_chunks/PkChatbot-C18mnGJ9.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotAudioTranscript-BUxBHanA.js → PkChatbotAudioTranscript-0rvrhSRQ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotAudioTranscript-BUxBHanA.js.map → PkChatbotAudioTranscript-0rvrhSRQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotAuth-BMLLTSwK.js → PkChatbotAuth-BVZzjbK9.js} +4 -3
- package/dist-vue/_chunks/PkChatbotAuth-BVZzjbK9.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-Toj4CqXV.js → PkChatbotEmptyState-BKiyP0Ga.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-Toj4CqXV.js.map → PkChatbotEmptyState-BKiyP0Ga.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotError-CRGbK09-.js → PkChatbotError-BV5ga7hk.js} +4 -3
- package/dist-vue/_chunks/PkChatbotError-BV5ga7hk.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-CMFXjoKR.js → PkChatbotFeedbackForm-B5cYsWBr.js} +8 -7
- package/dist-vue/_chunks/PkChatbotFeedbackForm-B5cYsWBr.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotFilePreview-DIP8KLkS.js → PkChatbotFilePreview-D5H-RIk2.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-DIP8KLkS.js.map → PkChatbotFilePreview-D5H-RIk2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BfZqRpQ2.js → PkChatbotInput-GvgsYsUw.js} +8 -7
- package/dist-vue/_chunks/PkChatbotInput-GvgsYsUw.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotMessages-CDLsj7qw.js +876 -0
- package/dist-vue/_chunks/PkChatbotMessages-CDLsj7qw.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-D0eoPBQ8.js → PkChatbotStepPayload-Dm-HCHcG.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-D0eoPBQ8.js.map → PkChatbotStepPayload-Dm-HCHcG.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CMx4cw1D.js → PkChatbotStepToolDetail-Bpd_cZEO.js} +16 -16
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CMx4cw1D.js.map → PkChatbotStepToolDetail-Bpd_cZEO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DeZQhGRU.js → PkChatbotSteps-C4qBM3_t.js} +40 -40
- package/dist-vue/_chunks/{PkChatbotSteps-DeZQhGRU.js.map → PkChatbotSteps-C4qBM3_t.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CVT6OUIv.js → PkChatbotViewChat-By2TY72m.js} +13 -13
- package/dist-vue/_chunks/{PkChatbotViewChat-CVT6OUIv.js.map → PkChatbotViewChat-By2TY72m.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotViewConversations-CU5NfEO4.js +199 -0
- package/dist-vue/_chunks/PkChatbotViewConversations-CU5NfEO4.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewFiles-CA20TBFY.js → PkChatbotViewFiles-CD-UZPT5.js} +18 -17
- package/dist-vue/_chunks/PkChatbotViewFiles-CD-UZPT5.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewProfile-CyzRxE3D.js → PkChatbotViewProfile-DPlb_Wca.js} +11 -10
- package/dist-vue/_chunks/PkChatbotViewProfile-DPlb_Wca.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotWakeupBar-jBti21FQ.js → PkChatbotWakeupBar-Cjgarxnw.js} +3 -2
- package/dist-vue/_chunks/PkChatbotWakeupBar-Cjgarxnw.js.map +1 -0
- package/dist-vue/_chunks/{PkStreamingMarkdown-C55Fi0Pd.js → PkStreamingMarkdown-CsHzdW69.js} +24 -24
- package/dist-vue/_chunks/{PkStreamingMarkdown-C55Fi0Pd.js.map → PkStreamingMarkdown-CsHzdW69.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-Ts3gQ1hB.js → PkSvgViewer-D6DJ2jVO.js} +7 -6
- package/dist-vue/_chunks/PkSvgViewer-D6DJ2jVO.js.map +1 -0
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-HAskd6d3.js → PkToolEditSpreadsheet-D8Zp9gzW.js} +3 -3
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-HAskd6d3.js.map → PkToolEditSpreadsheet-D8Zp9gzW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BE22qwxB.js → PkToolRequestGeolocation-JZYgc-2X.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BE22qwxB.js.map → PkToolRequestGeolocation-JZYgc-2X.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-GfSalEJG.js → PkToolRequestOAuthConnection-DosWR9I4.js} +11 -10
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-DosWR9I4.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowArtifact-z1qTnFkA.js → PkToolShowArtifact-BVofKJ7b.js} +5 -5
- package/dist-vue/_chunks/PkToolShowArtifact-BVofKJ7b.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowCalendarEvent-Dv_rss26.js → PkToolShowCalendarEvent-u9O_Sl3-.js} +8 -7
- package/dist-vue/_chunks/PkToolShowCalendarEvent-u9O_Sl3-.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowComparison-DQs3E6-k.js → PkToolShowComparison-c2e239T4.js} +3 -2
- package/dist-vue/_chunks/PkToolShowComparison-c2e239T4.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowContactForm-Y0lrHXhr.js → PkToolShowContactForm-BzdIFTnC.js} +13 -13
- package/dist-vue/_chunks/PkToolShowContactForm-BzdIFTnC.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowDiagram-7WxDObZ6.js → PkToolShowDiagram-CaoB4k6y.js} +11 -10
- package/dist-vue/_chunks/PkToolShowDiagram-CaoB4k6y.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowEmail-C591LR5N.js → PkToolShowEmail-CUgZN0J5.js} +8 -7
- package/dist-vue/_chunks/PkToolShowEmail-CUgZN0J5.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowForm-CZFWZub7.js → PkToolShowForm-vYuaPtu0.js} +14 -13
- package/dist-vue/_chunks/PkToolShowForm-vYuaPtu0.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowImageGallery-CkfXP_lD.js → PkToolShowImageGallery-ooygXk7j.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowImageGallery-CkfXP_lD.js.map → PkToolShowImageGallery-ooygXk7j.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-Dyz6h_0n.js → PkToolShowLocation-DVMpFdRk.js} +14 -13
- package/dist-vue/_chunks/PkToolShowLocation-DVMpFdRk.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowMessage-CbXERPHI.js → PkToolShowMessage-ATTN5Hac.js} +8 -7
- package/dist-vue/_chunks/PkToolShowMessage-ATTN5Hac.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowProductList-De-PtmD-.js → PkToolShowProductList-D-HJ9a_h.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-De-PtmD-.js.map → PkToolShowProductList-D-HJ9a_h.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowQrCode-DEAvfLFu.js → PkToolShowQrCode-D_5VUtEB.js} +3 -2
- package/dist-vue/_chunks/PkToolShowQrCode-D_5VUtEB.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowSources-CSN7S0zo.js → PkToolShowSources-DJ35l3Z3.js} +58 -57
- package/dist-vue/_chunks/PkToolShowSources-DJ35l3Z3.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DjutyiEi.js → PkToolShowSuggestedReply-I6FBos-F.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DjutyiEi.js.map → PkToolShowSuggestedReply-I6FBos-F.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-B_Q93E2y.js → PkToolShowVideo-xcg1gdIE.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowVideo-B_Q93E2y.js.map → PkToolShowVideo-xcg1gdIE.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWeather-BOuNrvY2.js → PkToolShowWeather-DJxKxVp_.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWeather-BOuNrvY2.js.map → PkToolShowWeather-DJxKxVp_.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-D3CdjJUc.js → PkToolShowWebPages-BuaRjavD.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowWebPages-D3CdjJUc.js.map → PkToolShowWebPages-BuaRjavD.js.map} +1 -1
- package/dist-vue/_chunks/VvButtonLocalized-BuzLsXp3.js +20 -0
- package/dist-vue/_chunks/VvButtonLocalized-BuzLsXp3.js.map +1 -0
- package/dist-vue/_chunks/{createChatbotApiClient-DSLxswr4.js → createChatbotApiClient-G3Tt1I67.js} +18 -18
- package/dist-vue/_chunks/{createChatbotApiClient-DSLxswr4.js.map → createChatbotApiClient-G3Tt1I67.js.map} +1 -1
- package/dist-vue/_chunks/{mcpOAuthReport-BeZDTl87.js → mcpOAuthReport-3A9v_gW_.js} +2 -2
- package/dist-vue/_chunks/{mcpOAuthReport-BeZDTl87.js.map → mcpOAuthReport-3A9v_gW_.js.map} +1 -1
- package/dist-vue/_chunks/{src-DCfvejyT.js → src-DpkuiHam.js} +2 -2
- package/dist-vue/_chunks/src-DpkuiHam.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-rtl-oKqU.js → useChatbotStore-C1sgxgD1.js} +5 -5
- package/dist-vue/_chunks/{useChatbotStore-rtl-oKqU.js.map → useChatbotStore-C1sgxgD1.js.map} +1 -1
- package/dist-vue/_chunks/{useSafeLocalStorage-OwzVTZud.js → useSafeLocalStorage-DLIc8pkn.js} +2 -2
- package/dist-vue/_chunks/{useSafeLocalStorage-OwzVTZud.js.map → useSafeLocalStorage-DLIc8pkn.js.map} +1 -1
- package/dist-vue/_chunks/{utils-CwIMEuAv.js → utils-DsnEcdW3.js} +143 -79
- package/dist-vue/_chunks/utils-DsnEcdW3.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +279 -27
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +3909 -3881
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +42 -6
- package/dist-vue/packages/components/src/PkEditorMarkdown.d.ts +3 -2
- package/dist-vue/packages/components/src/VvButtonLocalized.d.ts +11 -0
- package/dist-vue/packages/components/src/chat/index.d.ts +1 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +30 -0
- package/dist-vue/packages/components/src/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/_chunks/Agent-D8YrsP52.js.map +0 -1
- package/dist/_chunks/PkToolRequestOAuthConnection-BWxR1hV4.js.map +0 -1
- package/dist/_chunks/PkToolShowArtifact-CfJLe8vD.js.map +0 -1
- package/dist/_chunks/PkToolShowCalendarEvent-Bp_yv8S7.js.map +0 -1
- package/dist/_chunks/PkToolShowComparison-Bvd4f4tJ.js.map +0 -1
- package/dist/_chunks/PkToolShowContactForm--9XOVqNB.js.map +0 -1
- package/dist/_chunks/PkToolShowDiagram-C-pNbC9n.js.map +0 -1
- package/dist/_chunks/PkToolShowEmail-BKel_O29.js.map +0 -1
- package/dist/_chunks/PkToolShowForm-CGAc1O6K.js.map +0 -1
- package/dist/_chunks/PkToolShowLocation-78C7jFiV.js.map +0 -1
- package/dist/_chunks/PkToolShowMessage-BScy-w4J.js.map +0 -1
- package/dist/_chunks/PkToolShowQrCode-B70jPHDw.js.map +0 -1
- package/dist/_chunks/PkToolShowSources-BJ-XFrLD.js.map +0 -1
- package/dist/_chunks/src-Dt4rhhPN.js.map +0 -1
- package/dist/_chunks/text-DbSEK8si.js +0 -6
- package/dist/_chunks/text-DbSEK8si.js.map +0 -1
- package/dist-vue/_chunks/Agent-dGF8mkG9.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-536vsOfp.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotAuth-BMLLTSwK.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotError-CRGbK09-.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotFeedbackForm-CMFXjoKR.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-BfZqRpQ2.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-CnI3e9wF.js +0 -869
- package/dist-vue/_chunks/PkChatbotMessages-CnI3e9wF.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewConversations-DHeFtAfN.js +0 -197
- package/dist-vue/_chunks/PkChatbotViewConversations-DHeFtAfN.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewFiles-CA20TBFY.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewProfile-CyzRxE3D.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotWakeupBar-jBti21FQ.js.map +0 -1
- package/dist-vue/_chunks/PkSvgViewer-Ts3gQ1hB.js.map +0 -1
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-GfSalEJG.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowArtifact-z1qTnFkA.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowCalendarEvent-Dv_rss26.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowContactForm-Y0lrHXhr.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowDiagram-7WxDObZ6.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowEmail-C591LR5N.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowForm-CZFWZub7.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowLocation-Dyz6h_0n.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowMessage-CbXERPHI.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowQrCode-DEAvfLFu.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowSources-CSN7S0zo.js.map +0 -1
- package/dist-vue/_chunks/src-DCfvejyT.js.map +0 -1
- package/dist-vue/_chunks/utils-CwIMEuAv.js.map +0 -1
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
import { C as e, F as t, J as n, L as r, N as i, O as a, P as o, X as s, it as c, m as l, v as u, vt as d } from "./vue.runtime.esm-bundler-DKVd2gci.js";
|
|
2
2
|
import { r as f } from "./vue-i18n-CooVjJjT.js";
|
|
3
3
|
import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
|
|
4
|
-
import {
|
|
5
|
-
import "./src-
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { c as m, m as te, t as ne, u as re } from "./Agent-Gdgpd3LA.js";
|
|
5
|
+
import "./src-DL9TKN-Z.js";
|
|
6
|
+
import { n as ie, t as h } from "./text-BHCGblDQ.js";
|
|
7
|
+
import { n as ae } from "./url-validation-9DstIfq2.js";
|
|
8
|
+
import { v as oe } from "./dist-DxtbpUdI.js";
|
|
9
|
+
import { n as g } from "./useShortUrlResolver-qFJHKHwE.js";
|
|
10
|
+
import { t as _ } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
11
|
+
import { n as se } from "./chatImagePolicy-CfJt8_9Z.js";
|
|
11
12
|
//#region ../../packages/utils/src/citations.ts
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
return e && e.replace(
|
|
13
|
+
var ce = /[ \t]*\uE200[^\uE201]*\uE201/g, v = /(?<![ \t])[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, y = /[\uE200-\uE20F]/g;
|
|
14
|
+
function le(e) {
|
|
15
|
+
return e && e.replace(ce, "").replace(v, "").replace(y, "");
|
|
15
16
|
}
|
|
16
17
|
//#endregion
|
|
17
18
|
//#region ../../packages/utils/src/message.ts
|
|
18
|
-
function
|
|
19
|
+
function ue(e) {
|
|
19
20
|
return e ? e.type === "text" : !1;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function b(e) {
|
|
22
23
|
return e ? e.type.startsWith("tool-") : !1;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
25
|
+
function de(e) {
|
|
26
|
+
return b(e) ? e.type.slice(5) : "";
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function x(e) {
|
|
28
29
|
return e ? e.type === "file" : !1;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
if (!
|
|
31
|
+
function fe(e) {
|
|
32
|
+
if (!x(e)) return;
|
|
32
33
|
let t = e.providerMetadata?.["8bot"]?.media;
|
|
33
34
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
if (!
|
|
36
|
+
function S(e) {
|
|
37
|
+
if (!x(e)) return;
|
|
37
38
|
let t = e.providerMetadata?.["8bot"]?.transcript;
|
|
38
39
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function pe(e, t) {
|
|
41
42
|
return e.map((e) => {
|
|
42
43
|
let n = t.filter((t) => t.messageId === e.id);
|
|
43
44
|
return n.length === 0 ? e : {
|
|
44
45
|
...e,
|
|
45
46
|
parts: e.parts.map((e) => {
|
|
46
|
-
let t = n.find(({ storedFileName: t }) => t ===
|
|
47
|
-
return t &&
|
|
47
|
+
let t = n.find(({ storedFileName: t }) => t === fe(e)?.storedFileName);
|
|
48
|
+
return t && x(e) ? {
|
|
48
49
|
...e,
|
|
49
50
|
providerMetadata: {
|
|
50
51
|
...e.providerMetadata,
|
|
@@ -58,54 +59,54 @@ function de(e, t) {
|
|
|
58
59
|
};
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function me(e) {
|
|
62
63
|
return e ? e.type === "reasoning" : !1;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function he(e) {
|
|
65
66
|
if (!e) return;
|
|
66
67
|
let t = e.parts;
|
|
67
|
-
if (Array.isArray(t)) return t.find((e) =>
|
|
68
|
+
if (Array.isArray(t)) return t.find((e) => ue(e))?.text;
|
|
68
69
|
}
|
|
69
70
|
//#endregion
|
|
70
71
|
//#region ../../packages/components/src/chat/utils.ts
|
|
71
|
-
function
|
|
72
|
+
function ge(e) {
|
|
72
73
|
let t = [];
|
|
73
74
|
for (let n of e) {
|
|
74
|
-
if (!
|
|
75
|
+
if (!ue(n)) {
|
|
75
76
|
t.push(n);
|
|
76
77
|
continue;
|
|
77
78
|
}
|
|
78
79
|
let e = t[t.length - 1];
|
|
79
|
-
e &&
|
|
80
|
+
e && ue(e) ? t[t.length - 1] = {
|
|
80
81
|
...e,
|
|
81
82
|
text: e.text + n.text
|
|
82
83
|
} : t.push(n);
|
|
83
84
|
}
|
|
84
85
|
return t;
|
|
85
86
|
}
|
|
86
|
-
var
|
|
87
|
-
function
|
|
87
|
+
var _e = (e) => b(e) && te(de(e));
|
|
88
|
+
function ve(e) {
|
|
88
89
|
let t = /* @__PURE__ */ new Map();
|
|
89
|
-
for (let [n, r] of e.entries())
|
|
90
|
-
return e.filter((e, n) => !(
|
|
90
|
+
for (let [n, r] of e.entries()) _e(r) && r.state !== "output-error" && !xe(r) && t.set(r.type, n);
|
|
91
|
+
return e.filter((e, n) => !(_e(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
|
|
91
92
|
}
|
|
92
|
-
var
|
|
93
|
-
function
|
|
94
|
-
let t = e.filter((e) =>
|
|
95
|
-
return t.length > 0 ? [...e.filter((e) => !
|
|
93
|
+
var C = /* @__PURE__ */ new Set(["tool-editSpreadsheet"]);
|
|
94
|
+
function ye(e) {
|
|
95
|
+
let t = e.filter((e) => C.has(e.type));
|
|
96
|
+
return t.length > 0 ? [...e.filter((e) => !C.has(e.type)), ...t] : e;
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function be(e, t) {
|
|
98
99
|
let n = e.toolCallId;
|
|
99
|
-
return
|
|
100
|
+
return C.has(e.type) && n ? `file-${n}` : t;
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function xe(e) {
|
|
102
103
|
return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
|
|
103
104
|
}
|
|
104
|
-
var
|
|
105
|
-
function
|
|
105
|
+
var Se = 4e3, Ce = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
|
|
106
|
+
function we(e, t) {
|
|
106
107
|
if (e.length <= t) return e;
|
|
107
108
|
let n = e.length - t, r = n + t / 2, i = (e, t) => e !== -1 && e < r ? e + t : void 0, a = i(e.indexOf("\n\n", n), 2) ?? i(e.indexOf("\n", n), 1) ?? n, o;
|
|
108
|
-
for (let t of e.matchAll(
|
|
109
|
+
for (let t of e.matchAll(Ce)) {
|
|
109
110
|
if (t.index >= a) break;
|
|
110
111
|
let [, e, n] = t;
|
|
111
112
|
if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
|
|
@@ -116,37 +117,37 @@ function xe(e, t) {
|
|
|
116
117
|
}
|
|
117
118
|
return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
|
|
118
119
|
}
|
|
119
|
-
var
|
|
120
|
+
var Te = /* @__PURE__ */ new Set([
|
|
120
121
|
"approval-requested",
|
|
121
122
|
"approval-responded",
|
|
122
123
|
"output-denied"
|
|
123
124
|
]);
|
|
124
|
-
function Ce(e) {
|
|
125
|
-
return _(e) ? Se.has(e.state) ? !0 : e.approval != null : !1;
|
|
126
|
-
}
|
|
127
|
-
var we = "requestConfirm";
|
|
128
|
-
function Te(e) {
|
|
129
|
-
return _(e) && e.type === "tool-requestConfirm";
|
|
130
|
-
}
|
|
131
125
|
function Ee(e) {
|
|
132
|
-
return
|
|
126
|
+
return b(e) ? Te.has(e.state) ? !0 : e.approval != null : !1;
|
|
133
127
|
}
|
|
134
|
-
|
|
135
|
-
|
|
128
|
+
var De = "requestConfirm";
|
|
129
|
+
function w(e) {
|
|
130
|
+
return b(e) && e.type === "tool-requestConfirm";
|
|
136
131
|
}
|
|
137
132
|
function Oe(e) {
|
|
133
|
+
return Ee(e) || w(e);
|
|
134
|
+
}
|
|
135
|
+
function T(e) {
|
|
136
|
+
if (b(e)) return e.approval?.id;
|
|
137
|
+
}
|
|
138
|
+
function ke(e) {
|
|
138
139
|
if (e && "state" in e) return e.state;
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
+
function E(e = "000000") {
|
|
141
142
|
let t = e.replace("#", "");
|
|
142
143
|
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
143
144
|
let n = parseInt(t.substring(0, 2), 16) / 255, r = parseInt(t.substring(2, 4), 16) / 255, i = parseInt(t.substring(4, 6), 16) / 255, a = (e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
144
145
|
return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
|
|
145
146
|
}
|
|
146
|
-
function S(e, t) {
|
|
147
|
-
return e === "white" || e === "black" ? e : ke(t);
|
|
148
|
-
}
|
|
149
147
|
function Ae(e, t) {
|
|
148
|
+
return e === "white" || e === "black" ? e : E(t);
|
|
149
|
+
}
|
|
150
|
+
function je(e, t) {
|
|
150
151
|
if (e) return {
|
|
151
152
|
"--chatbot-main-color": e,
|
|
152
153
|
"--chatbot-contrast-color": t,
|
|
@@ -155,10 +156,10 @@ function Ae(e, t) {
|
|
|
155
156
|
"--input-focus-color": "var(--color-brand-graphic)"
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function Me(e, t) {
|
|
159
160
|
if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
+
function Ne(e) {
|
|
162
163
|
if (e !== void 0) {
|
|
163
164
|
if (typeof e == "string") return e.trim() || void 0;
|
|
164
165
|
try {
|
|
@@ -169,10 +170,10 @@ function je(e) {
|
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
-
return
|
|
173
|
+
function Pe(e) {
|
|
174
|
+
return Ne(e) !== void 0;
|
|
174
175
|
}
|
|
175
|
-
function
|
|
176
|
+
function Fe(e, t) {
|
|
176
177
|
let n = e?.input;
|
|
177
178
|
if (typeof t == "string") {
|
|
178
179
|
let e = n?.question ?? n?.steps?.[0]?.question;
|
|
@@ -184,14 +185,14 @@ function Me(e, t) {
|
|
|
184
185
|
return i ? `${i} ${n}` : n;
|
|
185
186
|
}).join(". ");
|
|
186
187
|
}
|
|
187
|
-
function
|
|
188
|
+
function Ie(e) {
|
|
188
189
|
return e?.options ? e.options.map((e) => ({
|
|
189
190
|
label: e.label,
|
|
190
191
|
value: e.label,
|
|
191
192
|
description: e.description
|
|
192
193
|
})) : [];
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
+
function Le(e, t) {
|
|
195
196
|
let n = {};
|
|
196
197
|
if (t == null) return n;
|
|
197
198
|
if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
|
|
@@ -207,12 +208,12 @@ function Pe(e, t) {
|
|
|
207
208
|
for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
|
|
208
209
|
return n;
|
|
209
210
|
}
|
|
210
|
-
var
|
|
211
|
+
var D = [
|
|
211
212
|
"tool-perplexity_search",
|
|
212
213
|
"tool-parallel_search",
|
|
213
214
|
"tool-web_search",
|
|
214
215
|
"tool-google_search"
|
|
215
|
-
],
|
|
216
|
+
], Re = /* @__PURE__ */ new Set([
|
|
216
217
|
"tool-searchInKnowledgeBase",
|
|
217
218
|
"tool-retrieveRevisedAnswers",
|
|
218
219
|
"tool-expandChunkContext",
|
|
@@ -221,78 +222,114 @@ var Fe = [
|
|
|
221
222
|
"tool-geocode",
|
|
222
223
|
"tool-recallUserMemory",
|
|
223
224
|
"tool-saveUserMemory",
|
|
224
|
-
...
|
|
225
|
+
...D
|
|
225
226
|
]);
|
|
226
|
-
function
|
|
227
|
-
return
|
|
227
|
+
function ze(e) {
|
|
228
|
+
return b(e) && Re.has(e.type);
|
|
228
229
|
}
|
|
229
|
-
var
|
|
230
|
+
var Be = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, O = (e, ...t) => {
|
|
230
231
|
for (let n of t) {
|
|
231
232
|
let t = e?.[n];
|
|
232
233
|
if (typeof t == "string" && t.trim()) return t;
|
|
233
234
|
}
|
|
234
235
|
};
|
|
235
|
-
function
|
|
236
|
-
if (!
|
|
237
|
-
let t =
|
|
238
|
-
if (e.type === "tool-searchInKnowledgeBase" ||
|
|
236
|
+
function Ve(e) {
|
|
237
|
+
if (!b(e)) return;
|
|
238
|
+
let t = Be("input" in e ? e.input : void 0), n = Be("output" in e ? e.output : void 0);
|
|
239
|
+
if (e.type === "tool-searchInKnowledgeBase" || D.includes(e.type)) {
|
|
239
240
|
let e = t?.queries;
|
|
240
241
|
if (Array.isArray(e)) {
|
|
241
242
|
let t = e.filter((e) => typeof e == "string" && !!e.trim());
|
|
242
243
|
return t.length ? t.join(" · ") : void 0;
|
|
243
244
|
}
|
|
244
|
-
return
|
|
245
|
+
return O(t, "query", "objective");
|
|
245
246
|
}
|
|
246
|
-
if (e.type === "tool-retrieveRevisedAnswers") return
|
|
247
|
-
if (e.type === "tool-getWeather") return
|
|
248
|
-
if (e.type === "tool-geocode") return
|
|
249
|
-
if (e.type === "tool-expandChunkContext") return
|
|
250
|
-
if (e.type === "tool-readDocumentFile") return
|
|
247
|
+
if (e.type === "tool-retrieveRevisedAnswers") return O(t, "query");
|
|
248
|
+
if (e.type === "tool-getWeather") return O(n, "location") ?? O(t, "locationName");
|
|
249
|
+
if (e.type === "tool-geocode") return O(t, "locationName");
|
|
250
|
+
if (e.type === "tool-expandChunkContext") return O(n, "documentName");
|
|
251
|
+
if (e.type === "tool-readDocumentFile") return O(n, "name");
|
|
251
252
|
if (e.type === "tool-readSpreadsheet") {
|
|
252
|
-
let e =
|
|
253
|
+
let e = O(t, "sheet"), n = O(t, "range");
|
|
253
254
|
return e && n ? `${e}!${n}` : e;
|
|
254
255
|
}
|
|
255
|
-
if (e.type === "tool-editSpreadsheet") return
|
|
256
|
-
if (e.type === "tool-querySpreadsheet") return
|
|
257
|
-
if (e.type === "tool-recallUserMemory") return
|
|
258
|
-
if (e.type === "tool-saveUserMemory") return
|
|
259
|
-
}
|
|
260
|
-
function
|
|
261
|
-
if (
|
|
262
|
-
if (
|
|
263
|
-
if (
|
|
256
|
+
if (e.type === "tool-editSpreadsheet") return O(n, "filename");
|
|
257
|
+
if (e.type === "tool-querySpreadsheet") return O(n, "file");
|
|
258
|
+
if (e.type === "tool-recallUserMemory") return O(t, "query");
|
|
259
|
+
if (e.type === "tool-saveUserMemory") return O(t, "content", "query");
|
|
260
|
+
}
|
|
261
|
+
function He(e) {
|
|
262
|
+
if (b(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-scheduleWakeup" ? "ri:alarm-line" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-readEarlierMessages" ? "ri:history-line" : e.type === "tool-enableTools" ? "ri:toggle-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-requestAccountLink" ? "ri:link" : e.type === "tool-unlinkAccount" ? "ri:link-unlink" : e.type === "tool-perplexity_search" || e.type === "tool-parallel_search" || e.type === "tool-web_search" || e.type === "tool-google_search" ? "ri:global-line" : "ri:tools-line";
|
|
263
|
+
if (me(e)) return "ri:lightbulb-line";
|
|
264
|
+
if (ue(e)) return "ri:double-quotes-r";
|
|
265
|
+
}
|
|
266
|
+
var Ue = [
|
|
267
|
+
ne,
|
|
268
|
+
m,
|
|
269
|
+
re
|
|
270
|
+
];
|
|
271
|
+
function We(e, { t, te: n }) {
|
|
272
|
+
if (n(`agent.tool.${e}`)) return t(`agent.tool.${e}`);
|
|
273
|
+
let r = Ue.find((t) => e.startsWith(t)), i = r ? e.slice(r.length) : e;
|
|
274
|
+
return h(ie(i).trim().toLowerCase());
|
|
275
|
+
}
|
|
276
|
+
var Ge = {
|
|
277
|
+
custom: (e) => e("messagePart.type.custom"),
|
|
278
|
+
data: (e) => e("messagePart.type.data"),
|
|
279
|
+
file: (e) => e("messagePart.type.file"),
|
|
280
|
+
reasoning: (e) => e("messagePart.type.reasoning"),
|
|
281
|
+
"source-document": (e) => e("messagePart.type.sourceDocument"),
|
|
282
|
+
"source-url": (e) => e("messagePart.type.sourceUrl"),
|
|
283
|
+
"step-start": (e) => e("messagePart.type.stepStart"),
|
|
284
|
+
text: (e) => e("messagePart.type.text")
|
|
285
|
+
};
|
|
286
|
+
function Ke(e, t) {
|
|
287
|
+
if (b(e)) return We(de(e), t);
|
|
288
|
+
if (e.type === "dynamic-tool") return We(e.toolName, t);
|
|
289
|
+
let n = Ge[e.type.startsWith("data-") ? "data" : e.type];
|
|
290
|
+
return n ? n(t.t) : h(ie(e.type));
|
|
291
|
+
}
|
|
292
|
+
function qe(e, t) {
|
|
293
|
+
if (!e) return e;
|
|
294
|
+
let n = {
|
|
295
|
+
Intent: t("conversationSummary.intent"),
|
|
296
|
+
"Topics covered": t("conversationSummary.topicsCovered"),
|
|
297
|
+
"Key facts": t("conversationSummary.keyFacts"),
|
|
298
|
+
"Open questions": t("conversationSummary.openQuestions")
|
|
299
|
+
};
|
|
300
|
+
return e.replace(/\*\*(Intent|Topics covered|Key facts|Open questions)(:?)\*\*/g, (e, t, r) => `**${n[t]}${r}**`);
|
|
264
301
|
}
|
|
265
|
-
function
|
|
266
|
-
return
|
|
302
|
+
function Je(e, t) {
|
|
303
|
+
return b(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-scheduleWakeup" ? e("messagePart.scheduleWakeup") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-readEarlierMessages" ? e("messagePart.readEarlierMessages") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : t.type === "tool-requestAccountLink" ? e("messagePart.requestAccountLink") : t.type === "tool-unlinkAccount" ? e("messagePart.unlinkAccount") : D.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : me(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
|
|
267
304
|
}
|
|
268
305
|
//#endregion
|
|
269
306
|
//#region ../../node_modules/.pnpm/remend@1.4.0/node_modules/remend/dist/index.js
|
|
270
|
-
var
|
|
307
|
+
var Ye = Object.defineProperty, Xe = Object.defineProperties, Ze = Object.getOwnPropertyDescriptors, Qe = Object.getOwnPropertySymbols, $e = Object.prototype.hasOwnProperty, et = Object.prototype.propertyIsEnumerable, tt = (e, t, n) => t in e ? Ye(e, t, {
|
|
271
308
|
enumerable: !0,
|
|
272
309
|
configurable: !0,
|
|
273
310
|
writable: !0,
|
|
274
311
|
value: n
|
|
275
|
-
}) : e[t] = n,
|
|
276
|
-
for (var n in t ||= {})
|
|
277
|
-
if (
|
|
312
|
+
}) : e[t] = n, nt = (e, t) => {
|
|
313
|
+
for (var n in t ||= {}) $e.call(t, n) && tt(e, n, t[n]);
|
|
314
|
+
if (Qe) for (var n of Qe(t)) et.call(t, n) && tt(e, n, t[n]);
|
|
278
315
|
return e;
|
|
279
|
-
},
|
|
316
|
+
}, rt = (e, t) => Xe(e, Ze(t)), k = {
|
|
280
317
|
PROSE: 0,
|
|
281
318
|
FENCE_MARKER: 1,
|
|
282
319
|
FENCE_INFO: 2,
|
|
283
320
|
FENCE_BODY: 3,
|
|
284
321
|
CODE_SPAN: 4,
|
|
285
322
|
CODE_SPAN_OPEN: 5
|
|
286
|
-
},
|
|
323
|
+
}, it = /^(`{3,}|~{3,})(.*)$/, A = (e) => e !== void 0 && e >= "0" && e <= "9", at = (e, t) => {
|
|
287
324
|
let n = t;
|
|
288
325
|
if (e[n] === "-" || e[n] === "*" || e[n] === "+") n += 1;
|
|
289
326
|
else {
|
|
290
|
-
for (;
|
|
327
|
+
for (; A(e[n]) && n - t < 9;) n += 1;
|
|
291
328
|
if (n === t || e[n] !== "." && e[n] !== ")") return -1;
|
|
292
329
|
n += 1;
|
|
293
330
|
}
|
|
294
331
|
return e[n] === " " ? n + 1 : -1;
|
|
295
|
-
},
|
|
332
|
+
}, ot = (e, t, n) => {
|
|
296
333
|
let r = 0, i = t, a = !1, o = t;
|
|
297
334
|
for (;;) {
|
|
298
335
|
for (; o < n && e[o] === " ";) o += 1;
|
|
@@ -300,7 +337,7 @@ var He = Object.defineProperty, Ue = Object.defineProperties, We = Object.getOwn
|
|
|
300
337
|
r += 1, o += e[o + 1] === " " ? 2 : 1, i = o, a = !1;
|
|
301
338
|
continue;
|
|
302
339
|
}
|
|
303
|
-
let t = o < n ?
|
|
340
|
+
let t = o < n ? at(e, o) : -1;
|
|
304
341
|
if (t === -1) return {
|
|
305
342
|
contentStart: o,
|
|
306
343
|
listIndent: a ? o - i : 0,
|
|
@@ -308,7 +345,7 @@ var He = Object.defineProperty, Ue = Object.defineProperties, We = Object.getOwn
|
|
|
308
345
|
};
|
|
309
346
|
o = t, a = !0;
|
|
310
347
|
}
|
|
311
|
-
},
|
|
348
|
+
}, st = (e, t, n, r) => {
|
|
312
349
|
let i = t;
|
|
313
350
|
for (let t = 0; t < r; t += 1) {
|
|
314
351
|
for (; i < n && e[i] === " ";) i += 1;
|
|
@@ -316,10 +353,10 @@ var He = Object.defineProperty, Ue = Object.defineProperties, We = Object.getOwn
|
|
|
316
353
|
i += 1, e[i] === " " && (i += 1);
|
|
317
354
|
}
|
|
318
355
|
return i;
|
|
319
|
-
},
|
|
356
|
+
}, ct = (e, t, n, r, i) => {
|
|
320
357
|
let a = t + r;
|
|
321
|
-
e.fill(
|
|
322
|
-
},
|
|
358
|
+
e.fill(k.FENCE_MARKER, a, a + i), e.fill(k.FENCE_INFO, a + i, Math.min(n + 1, e.length));
|
|
359
|
+
}, lt = (e, t, n, r) => {
|
|
323
360
|
let i = t;
|
|
324
361
|
for (; i < n && e[i] === " ";) i += 1;
|
|
325
362
|
let a = 0;
|
|
@@ -330,62 +367,62 @@ var He = Object.defineProperty, Ue = Object.defineProperties, We = Object.getOwn
|
|
|
330
367
|
i += 1;
|
|
331
368
|
}
|
|
332
369
|
return !0;
|
|
333
|
-
},
|
|
334
|
-
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a =
|
|
370
|
+
}, ut = (e, t, n, r) => {
|
|
371
|
+
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = ot(e, n, i), o = e.slice(a.contentStart, i).match(it);
|
|
335
372
|
if (!o) return null;
|
|
336
373
|
let [, s, c] = o, l = s[0];
|
|
337
|
-
return l === "`" && c.includes("`") ? null : (
|
|
374
|
+
return l === "`" && c.includes("`") ? null : (ct(t, n, r, a.contentStart - n, s.length), {
|
|
338
375
|
char: l,
|
|
339
376
|
length: s.length,
|
|
340
377
|
listIndent: a.listIndent,
|
|
341
378
|
quoteDepth: a.quoteDepth
|
|
342
379
|
});
|
|
343
|
-
},
|
|
344
|
-
let i =
|
|
380
|
+
}, dt = (e, t, n, r) => {
|
|
381
|
+
let i = st(e, t, n, r.quoteDepth);
|
|
345
382
|
if (i === -1 || r.listIndent === 0) return i;
|
|
346
383
|
let a = i;
|
|
347
384
|
for (; a < n && e[a] === " ";) a += 1;
|
|
348
385
|
return a === n || e[a] === "\r" && a + 1 === n || a - i >= r.listIndent ? i : -1;
|
|
349
|
-
},
|
|
386
|
+
}, ft = (e, t) => {
|
|
350
387
|
let n = e.length, r = null, i = 0;
|
|
351
388
|
for (; i < n;) {
|
|
352
389
|
let a = e.indexOf("\n", i);
|
|
353
390
|
a === -1 && (a = n);
|
|
354
|
-
let o = r ?
|
|
355
|
-
r && o === -1 && (r = null), r ?
|
|
391
|
+
let o = r ? dt(e, i, a, r) : -1;
|
|
392
|
+
r && o === -1 && (r = null), r ? lt(e, o, a, r) ? (t.fill(k.FENCE_MARKER, i, a), r = null) : t.fill(k.FENCE_BODY, i, Math.min(a + 1, n)) : r = ut(e, t, i, a), i = a + 1;
|
|
356
393
|
}
|
|
357
394
|
return r;
|
|
358
|
-
},
|
|
395
|
+
}, pt = (e, t) => {
|
|
359
396
|
let n = t + 1;
|
|
360
397
|
for (; n < e.length && e[n] === "`";) n += 1;
|
|
361
398
|
return n;
|
|
362
|
-
},
|
|
399
|
+
}, mt = (e, t) => {
|
|
363
400
|
let n = t + 1;
|
|
364
401
|
for (; n < e.length && (e[n] === " " || e[n] === " " || e[n] === "\r");) n += 1;
|
|
365
402
|
return n < e.length && e[n] === "\n";
|
|
366
|
-
},
|
|
403
|
+
}, ht = (e, t, n) => {
|
|
367
404
|
let r = n;
|
|
368
405
|
for (;;) {
|
|
369
406
|
let n = e.indexOf("`", r);
|
|
370
407
|
if (n === -1) return -1;
|
|
371
|
-
let i = n > r && e[n - 1] === "\\" && t[n - 1] ===
|
|
372
|
-
if (t[n] ===
|
|
408
|
+
let i = n > r && e[n - 1] === "\\" && t[n - 1] === k.PROSE;
|
|
409
|
+
if (t[n] === k.PROSE && !i) return n;
|
|
373
410
|
r = n + 1;
|
|
374
411
|
}
|
|
375
|
-
},
|
|
412
|
+
}, j = (e, t) => {
|
|
376
413
|
let n = e.length, r = -1, i = 0, a = 0;
|
|
377
414
|
for (; a < n;) {
|
|
378
415
|
if (r < 0) {
|
|
379
|
-
if (a =
|
|
380
|
-
let n =
|
|
416
|
+
if (a = ht(e, t, a), a === -1) break;
|
|
417
|
+
let n = pt(e, a);
|
|
381
418
|
r = a, i = n - a, a = n;
|
|
382
419
|
continue;
|
|
383
420
|
}
|
|
384
|
-
if (t[a] !==
|
|
385
|
-
t.fill(
|
|
421
|
+
if (t[a] !== k.PROSE) {
|
|
422
|
+
t.fill(k.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
|
|
386
423
|
continue;
|
|
387
424
|
}
|
|
388
|
-
if (e[a] === "\n" &&
|
|
425
|
+
if (e[a] === "\n" && mt(e, a)) {
|
|
389
426
|
r = -1, a += 1;
|
|
390
427
|
continue;
|
|
391
428
|
}
|
|
@@ -393,79 +430,79 @@ var He = Object.defineProperty, Ue = Object.defineProperties, We = Object.getOwn
|
|
|
393
430
|
a += 1;
|
|
394
431
|
continue;
|
|
395
432
|
}
|
|
396
|
-
let n =
|
|
397
|
-
n - a === i && (t.fill(
|
|
433
|
+
let n = pt(e, a);
|
|
434
|
+
n - a === i && (t.fill(k.CODE_SPAN, r, n), r = -1), a = n;
|
|
398
435
|
}
|
|
399
|
-
return r >= 0 ? (t.fill(
|
|
436
|
+
return r >= 0 ? (t.fill(k.CODE_SPAN_OPEN, r, n), {
|
|
400
437
|
start: r,
|
|
401
438
|
runLength: i
|
|
402
439
|
}) : null;
|
|
403
|
-
},
|
|
440
|
+
}, gt = (e) => {
|
|
404
441
|
let t = new Uint8Array(e.length);
|
|
405
442
|
return {
|
|
406
443
|
text: e,
|
|
407
444
|
regions: t,
|
|
408
|
-
openFence:
|
|
409
|
-
openSpan:
|
|
445
|
+
openFence: ft(e, t),
|
|
446
|
+
openSpan: j(e, t),
|
|
410
447
|
mathMask: null,
|
|
411
448
|
linkUrlMask: null,
|
|
412
449
|
htmlTagMask: null
|
|
413
450
|
};
|
|
414
|
-
},
|
|
415
|
-
if (
|
|
416
|
-
let t =
|
|
417
|
-
return
|
|
418
|
-
},
|
|
419
|
-
|
|
420
|
-
},
|
|
421
|
-
let n =
|
|
422
|
-
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] ===
|
|
451
|
+
}, _t = null, vt = null, M = (e) => {
|
|
452
|
+
if (vt !== null && e === _t) return vt;
|
|
453
|
+
let t = gt(e);
|
|
454
|
+
return _t = e, vt = t, t;
|
|
455
|
+
}, yt = () => {
|
|
456
|
+
_t = null, vt = null;
|
|
457
|
+
}, bt = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== k.PROSE, xt = (e, t) => e.regions[t] === k.CODE_SPAN, St = (e, t) => {
|
|
458
|
+
let n = M(e), r = t + t, i = 0;
|
|
459
|
+
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === k.PROSE ? (i += 1, t += 2) : t += 1;
|
|
423
460
|
return i;
|
|
424
|
-
},
|
|
461
|
+
}, Ct = /* @__PURE__ */ new Uint8Array(), wt = (e) => e === "inlineLatex" || e === "blockLatex", Tt = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Et = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", Dt = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Ot = (e, t, n) => {
|
|
425
462
|
let r = e[t + 1];
|
|
426
463
|
if (e[t] === "\\") {
|
|
427
464
|
if (r === "$") return {
|
|
428
465
|
context: n,
|
|
429
466
|
length: 2
|
|
430
467
|
};
|
|
431
|
-
let e =
|
|
468
|
+
let e = Tt(n, r);
|
|
432
469
|
return e === null ? null : {
|
|
433
470
|
context: e,
|
|
434
471
|
length: 2
|
|
435
472
|
};
|
|
436
473
|
}
|
|
437
|
-
if (e[t] === "$" && !
|
|
474
|
+
if (e[t] === "$" && !wt(n)) {
|
|
438
475
|
let e = r === "$";
|
|
439
476
|
return {
|
|
440
|
-
context:
|
|
477
|
+
context: Et(n, e),
|
|
441
478
|
length: e ? 2 : 1
|
|
442
479
|
};
|
|
443
480
|
}
|
|
444
481
|
return null;
|
|
445
|
-
},
|
|
482
|
+
}, kt = (e) => {
|
|
446
483
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
|
|
447
484
|
for (; o < r;) {
|
|
448
485
|
i[o] = a === "none" ? 0 : 1;
|
|
449
|
-
let e = n[o] ===
|
|
486
|
+
let e = n[o] === k.PROSE ? Ot(t, o, a) : null;
|
|
450
487
|
e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
|
|
451
488
|
}
|
|
452
489
|
return i;
|
|
453
|
-
},
|
|
490
|
+
}, At = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = Dt(e.text) ? kt(e) : Ct), e.mathMask[t] === 1), jt = (e, t, n, r) => {
|
|
454
491
|
let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
|
|
455
|
-
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] ===
|
|
492
|
+
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === k.PROSE && (s = 1), o[e - t] = s;
|
|
456
493
|
let c = !1;
|
|
457
|
-
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] ===
|
|
458
|
-
},
|
|
494
|
+
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === k.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
|
|
495
|
+
}, Mt = (e) => {
|
|
459
496
|
let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
|
|
460
497
|
for (; i < n;) {
|
|
461
498
|
let a = t.indexOf("\n", i);
|
|
462
|
-
a === -1 && (a = n),
|
|
499
|
+
a === -1 && (a = n), jt(e, i, a, r), i = a + 1;
|
|
463
500
|
}
|
|
464
501
|
return r;
|
|
465
|
-
},
|
|
502
|
+
}, Nt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? Mt(e) : Ct), e.linkUrlMask[t] === 1), Pt = (e) => {
|
|
466
503
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
|
|
467
504
|
for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
|
|
468
|
-
else if (i[e] = +!!a, n[e] ===
|
|
505
|
+
else if (i[e] = +!!a, n[e] === k.PROSE) {
|
|
469
506
|
if (t[e] === ">") a = !1;
|
|
470
507
|
else if (t[e] === "<") {
|
|
471
508
|
let n = t[e + 1];
|
|
@@ -473,56 +510,56 @@ var He = Object.defineProperty, Ue = Object.defineProperties, We = Object.getOwn
|
|
|
473
510
|
}
|
|
474
511
|
}
|
|
475
512
|
return i;
|
|
476
|
-
},
|
|
513
|
+
}, Ft = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Pt(e) : Ct), e.htmlTagMask[t] === 1), N = (e, t) => bt(M(e), t), It = (e, t) => xt(M(e), t), Lt = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, Rt = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Lt, (t, n, r, i) => N(e, i) ? t : `${n}\\>${r}`), P = (e, { delimiter: t, markerLength: n, regex: r }) => {
|
|
477
514
|
let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
|
|
478
515
|
return e.slice(Math.max(0, a - n + 1)).match(r);
|
|
479
|
-
},
|
|
516
|
+
}, zt = {
|
|
480
517
|
delimiter: "*",
|
|
481
518
|
markerLength: 2,
|
|
482
519
|
regex: /(\*\*)([^*]*\*?)$/
|
|
483
|
-
},
|
|
520
|
+
}, Bt = {
|
|
484
521
|
delimiter: "_",
|
|
485
522
|
markerLength: 2,
|
|
486
523
|
regex: /(__)([^_]*?)$/
|
|
487
|
-
},
|
|
524
|
+
}, Vt = {
|
|
488
525
|
delimiter: "*",
|
|
489
526
|
markerLength: 3,
|
|
490
527
|
regex: /(\*\*\*)([^*]*?)$/
|
|
491
|
-
},
|
|
528
|
+
}, Ht = {
|
|
492
529
|
delimiter: "*",
|
|
493
530
|
markerLength: 1,
|
|
494
531
|
regex: /(\*)([^*]*?)$/
|
|
495
|
-
},
|
|
532
|
+
}, Ut = {
|
|
496
533
|
delimiter: "_",
|
|
497
534
|
markerLength: 1,
|
|
498
535
|
regex: /(_)([^_]*?)$/
|
|
499
|
-
},
|
|
536
|
+
}, Wt = {
|
|
500
537
|
delimiter: "~",
|
|
501
538
|
markerLength: 2,
|
|
502
539
|
regex: /(~~)([^~]*?)$/
|
|
503
|
-
},
|
|
540
|
+
}, Gt = {
|
|
504
541
|
delimiter: "_",
|
|
505
542
|
markerLength: 2,
|
|
506
543
|
regex: /(__)([^_]+)_$/
|
|
507
|
-
},
|
|
544
|
+
}, F = {
|
|
508
545
|
delimiter: "~",
|
|
509
546
|
markerLength: 2,
|
|
510
547
|
regex: /(~~)([^~]+)~$/
|
|
511
|
-
},
|
|
548
|
+
}, Kt = /^[\s_~*`]*$/, qt = /^[\s]*[-*+][\s]+$/, Jt = /[\p{L}\p{N}_]/u, Yt = /^\*{4,}$/, I = (e) => {
|
|
512
549
|
if (!e) return !1;
|
|
513
550
|
let t = e.charCodeAt(0);
|
|
514
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
515
|
-
},
|
|
551
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || Jt.test(e);
|
|
552
|
+
}, Xt = (e, t) => {
|
|
516
553
|
let n = 1;
|
|
517
554
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
518
555
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
519
556
|
return -1;
|
|
520
|
-
},
|
|
557
|
+
}, Zt = (e, t) => {
|
|
521
558
|
let n = 1;
|
|
522
559
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
523
560
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
524
561
|
return -1;
|
|
525
|
-
},
|
|
562
|
+
}, Qt = (e, t) => At(M(e), t), $t = (e, t, n) => {
|
|
526
563
|
let r = 0;
|
|
527
564
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
528
565
|
r = n + 1;
|
|
@@ -540,184 +577,184 @@ var He = Object.defineProperty, Ue = Object.defineProperties, We = Object.getOwn
|
|
|
540
577
|
break;
|
|
541
578
|
}
|
|
542
579
|
return o >= 3 && !s;
|
|
543
|
-
},
|
|
544
|
-
let i =
|
|
580
|
+
}, en = (e, t, n, r) => n === "\\" || At(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.text.length - 2 ? e.text[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), tn = (e) => e === " " || e === " " || e === "\n", nn = (e, t) => !!(e && t && I(e) && I(t)), rn = (e, t, n, r) => {
|
|
581
|
+
let i = nn(e, t), a = !!t && !tn(t), o = !!e && !tn(e);
|
|
545
582
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
546
583
|
count: !0,
|
|
547
584
|
inWordAsteriskChain: i
|
|
548
585
|
} : { count: !1 };
|
|
549
|
-
},
|
|
550
|
-
let t =
|
|
586
|
+
}, an = (e) => {
|
|
587
|
+
let t = M(e), n = 0, r = !1, i = e.length;
|
|
551
588
|
for (let a = 0; a < i; a += 1) {
|
|
552
|
-
if (e[a] !== "*" || t.regions[a] !==
|
|
553
|
-
|
|
589
|
+
if (e[a] !== "*" || t.regions[a] !== k.PROSE) {
|
|
590
|
+
I(e[a]) || (r = !1);
|
|
554
591
|
continue;
|
|
555
592
|
}
|
|
556
593
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
557
|
-
if (
|
|
558
|
-
let c =
|
|
594
|
+
if (en(t, a, o, s)) continue;
|
|
595
|
+
let c = rn(o, s, n, r);
|
|
559
596
|
c.count && (n += 1, r = c.inWordAsteriskChain);
|
|
560
597
|
}
|
|
561
598
|
return n;
|
|
562
|
-
},
|
|
563
|
-
let t =
|
|
599
|
+
}, on = (e, t, n, r) => !!(n === "\\" || At(e, t) || Nt(e, t) || Ft(e, t) || n === "_" || r === "_" || n && r && I(n) && I(r)), sn = (e) => {
|
|
600
|
+
let t = M(e), n = 0, r = e.length;
|
|
564
601
|
for (let i = 0; i < r; i += 1) {
|
|
565
|
-
if (e[i] !== "_" || t.regions[i] !==
|
|
602
|
+
if (e[i] !== "_" || t.regions[i] !== k.PROSE) continue;
|
|
566
603
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
567
|
-
|
|
604
|
+
on(t, i, a, o) || (n += 1);
|
|
568
605
|
}
|
|
569
606
|
return n;
|
|
570
|
-
},
|
|
571
|
-
let t =
|
|
572
|
-
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] ===
|
|
607
|
+
}, cn = (e) => {
|
|
608
|
+
let t = M(e), n = 0, r = 0;
|
|
609
|
+
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === k.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
|
|
573
610
|
return r >= 3 && (n += Math.floor(r / 3)), n;
|
|
574
|
-
},
|
|
575
|
-
if (!(
|
|
611
|
+
}, ln = (e) => St(e, "*"), un = (e) => e === "" || e === " " || e === " " || e === "\n", dn = (e, t, n, r, i) => {
|
|
612
|
+
if (!(un(n) && un(r))) return !1;
|
|
576
613
|
if (t > i.lineEnd) {
|
|
577
614
|
let n = e.indexOf("\n", t);
|
|
578
|
-
i.lineEnd = n === -1 ? e.length : n, i.result =
|
|
615
|
+
i.lineEnd = n === -1 ? e.length : n, i.result = $t(e, t, "_");
|
|
579
616
|
}
|
|
580
617
|
return i.result;
|
|
581
|
-
},
|
|
618
|
+
}, fn = (e, t, n, r) => {
|
|
582
619
|
let i = e.text, a = t, o = !1;
|
|
583
620
|
a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
|
|
584
621
|
let s = n - a;
|
|
585
622
|
if (s < 2) return !1;
|
|
586
623
|
let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
|
|
587
|
-
return
|
|
588
|
-
},
|
|
589
|
-
let t =
|
|
624
|
+
return I(l) && I(u) || dn(i, a, l, u, r) || At(e, a) || Nt(e, a) || Ft(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
|
|
625
|
+
}, pn = (e) => {
|
|
626
|
+
let t = M(e), n = e.length, r = {
|
|
590
627
|
lineEnd: -1,
|
|
591
628
|
result: !1
|
|
592
629
|
}, i = !1, a = 0;
|
|
593
630
|
for (; a < n;) {
|
|
594
|
-
if (e[a] !== "_" || t.regions[a] !==
|
|
631
|
+
if (e[a] !== "_" || t.regions[a] !== k.PROSE) {
|
|
595
632
|
a += 1;
|
|
596
633
|
continue;
|
|
597
634
|
}
|
|
598
635
|
let o = a, s = a + 1;
|
|
599
|
-
for (; s < n && e[s] === "_" && t.regions[s] ===
|
|
600
|
-
a = s,
|
|
636
|
+
for (; s < n && e[s] === "_" && t.regions[s] === k.PROSE;) s += 1;
|
|
637
|
+
a = s, fn(t, o, s, r) && (i = !i);
|
|
601
638
|
}
|
|
602
639
|
return i;
|
|
603
|
-
},
|
|
604
|
-
if (!t ||
|
|
640
|
+
}, mn = (e, t, n) => {
|
|
641
|
+
if (!t || Kt.test(t)) return !0;
|
|
605
642
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
606
|
-
return
|
|
607
|
-
},
|
|
608
|
-
let t =
|
|
643
|
+
return qt.test(a) && t.includes("\n") ? !0 : $t(e, n, "*");
|
|
644
|
+
}, hn = (e) => {
|
|
645
|
+
let t = P(e, zt);
|
|
609
646
|
if (!t) return e;
|
|
610
647
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
611
|
-
return
|
|
612
|
-
},
|
|
613
|
-
if (!t ||
|
|
648
|
+
return N(e, r) || It(e, r) || mn(e, n, r) ? e : ln(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
649
|
+
}, gn = (e, t, n) => {
|
|
650
|
+
if (!t || Kt.test(t)) return !0;
|
|
614
651
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
615
|
-
return
|
|
616
|
-
},
|
|
617
|
-
let t =
|
|
652
|
+
return qt.test(a) && t.includes("\n") ? !0 : $t(e, n, "_");
|
|
653
|
+
}, _n = (e) => {
|
|
654
|
+
let t = P(e, Bt);
|
|
618
655
|
if (!t) {
|
|
619
|
-
let t =
|
|
656
|
+
let t = P(e, Gt);
|
|
620
657
|
if (t) {
|
|
621
658
|
let n = e.lastIndexOf(t[1]);
|
|
622
|
-
if (!(
|
|
659
|
+
if (!(N(e, n) || It(e, n)) && pn(e)) return `${e}_`;
|
|
623
660
|
}
|
|
624
661
|
return e;
|
|
625
662
|
}
|
|
626
663
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
627
|
-
return
|
|
628
|
-
},
|
|
664
|
+
return N(e, r) || It(e, r) || gn(e, n, r) ? e : pn(e) ? `${e}__` : e;
|
|
665
|
+
}, vn = (e, t) => {
|
|
629
666
|
let { text: n } = e;
|
|
630
|
-
return n[t] === "*" && e.regions[t] ===
|
|
631
|
-
},
|
|
632
|
-
let t =
|
|
667
|
+
return n[t] === "*" && e.regions[t] === k.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !At(e, t);
|
|
668
|
+
}, yn = (e) => {
|
|
669
|
+
let t = M(e);
|
|
633
670
|
for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
|
|
634
|
-
if (!
|
|
635
|
-
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r ||
|
|
636
|
-
if (!(a && o) && !(r && i &&
|
|
671
|
+
if (!vn(t, n)) continue;
|
|
672
|
+
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || tn(r), o = !i || tn(i);
|
|
673
|
+
if (!(a && o) && !(r && i && I(r) && I(i)) && !o) return n;
|
|
637
674
|
}
|
|
638
675
|
return -1;
|
|
639
|
-
},
|
|
640
|
-
if (!
|
|
641
|
-
let t =
|
|
642
|
-
if (t === -1 ||
|
|
676
|
+
}, bn = (e) => {
|
|
677
|
+
if (!P(e, Ht)) return e;
|
|
678
|
+
let t = yn(e);
|
|
679
|
+
if (t === -1 || N(e, t) || It(e, t)) return e;
|
|
643
680
|
let n = e.substring(t + 1);
|
|
644
|
-
return !n ||
|
|
645
|
-
},
|
|
646
|
-
let t =
|
|
647
|
-
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] ===
|
|
681
|
+
return !n || Kt.test(n) ? e : an(e) % 2 == 1 ? `${e}*` : e;
|
|
682
|
+
}, xn = (e) => {
|
|
683
|
+
let t = M(e);
|
|
684
|
+
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === k.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !At(t, n) && !Nt(t, n)) {
|
|
648
685
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
649
|
-
if (t && r &&
|
|
686
|
+
if (t && r && I(t) && I(r)) continue;
|
|
650
687
|
return n;
|
|
651
688
|
}
|
|
652
689
|
return -1;
|
|
653
|
-
},
|
|
690
|
+
}, Sn = (e) => {
|
|
654
691
|
let t = e.length;
|
|
655
692
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
656
693
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
657
|
-
},
|
|
694
|
+
}, Cn = (e) => {
|
|
658
695
|
if (!e.endsWith("**")) return null;
|
|
659
696
|
let t = e.slice(0, -2);
|
|
660
|
-
if (
|
|
661
|
-
let n = t.indexOf("**"), r =
|
|
697
|
+
if (ln(t) % 2 != 1) return null;
|
|
698
|
+
let n = t.indexOf("**"), r = xn(t);
|
|
662
699
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
663
|
-
},
|
|
664
|
-
if (!
|
|
665
|
-
let t =
|
|
700
|
+
}, wn = (e) => {
|
|
701
|
+
if (!P(e, Ut)) return e;
|
|
702
|
+
let t = xn(e);
|
|
666
703
|
if (t === -1) return e;
|
|
667
704
|
let n = e.substring(t + 1);
|
|
668
|
-
if (!n ||
|
|
669
|
-
if (
|
|
670
|
-
let t =
|
|
671
|
-
return t === null ?
|
|
705
|
+
if (!n || Kt.test(n) || N(e, t) || It(e, t)) return e;
|
|
706
|
+
if (sn(e) % 2 == 1) {
|
|
707
|
+
let t = Cn(e);
|
|
708
|
+
return t === null ? Sn(e) : t;
|
|
672
709
|
}
|
|
673
710
|
return e;
|
|
674
|
-
},
|
|
675
|
-
let t =
|
|
711
|
+
}, Tn = (e) => {
|
|
712
|
+
let t = ln(e), n = an(e);
|
|
676
713
|
return t % 2 == 0 && n % 2 == 0;
|
|
677
|
-
},
|
|
678
|
-
if (
|
|
679
|
-
let t =
|
|
714
|
+
}, En = (e, t, n) => !t || Kt.test(t) || N(e, n) || It(e, n) ? !0 : $t(e, n, "*"), Dn = (e) => {
|
|
715
|
+
if (Yt.test(e)) return e;
|
|
716
|
+
let t = P(e, Vt);
|
|
680
717
|
if (!t) return e;
|
|
681
718
|
let n = t[2];
|
|
682
|
-
return
|
|
683
|
-
},
|
|
719
|
+
return En(e, n, e.lastIndexOf(t[1])) ? e : cn(e) % 2 == 1 ? Tn(e) ? e : `${e}***` : e;
|
|
720
|
+
}, On = /<[a-zA-Z/][^>]*$/, kn = /[a-zA-Z/]/, An = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), jn = (e, t) => {
|
|
684
721
|
let n = e[t + 1];
|
|
685
|
-
return n !== void 0 &&
|
|
686
|
-
},
|
|
687
|
-
let t = e.match(
|
|
722
|
+
return n !== void 0 && kn.test(n);
|
|
723
|
+
}, Mn = (e) => {
|
|
724
|
+
let t = e.match(On);
|
|
688
725
|
if (!t || t.index === void 0) return e;
|
|
689
|
-
let n =
|
|
690
|
-
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" &&
|
|
726
|
+
let n = An(e);
|
|
727
|
+
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && jn(e, r) && !N(e, r) && !(n && Qt(e, r))) return e.substring(0, r).trimEnd();
|
|
691
728
|
return e;
|
|
692
|
-
},
|
|
693
|
-
let t =
|
|
729
|
+
}, Nn = (e) => {
|
|
730
|
+
let t = M(e);
|
|
694
731
|
if (t.openFence) return e;
|
|
695
732
|
let n = t.openSpan;
|
|
696
733
|
if (!n) return e;
|
|
697
734
|
let r = e.slice(n.start + n.runLength);
|
|
698
|
-
if (!r ||
|
|
735
|
+
if (!r || Kt.test(r)) return e;
|
|
699
736
|
let i = 0, a = e.length - 1;
|
|
700
737
|
for (; a >= 0 && e[a] === "`";) i += 1, --a;
|
|
701
738
|
return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
|
|
702
|
-
},
|
|
703
|
-
let t =
|
|
704
|
-
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] ===
|
|
739
|
+
}, Pn = (e) => St(e, "$"), Fn = (e) => {
|
|
740
|
+
let t = M(e), n = 0;
|
|
741
|
+
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === k.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
|
|
705
742
|
return n;
|
|
706
|
-
},
|
|
743
|
+
}, In = (e) => {
|
|
707
744
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
708
745
|
let t = e.indexOf("$$");
|
|
709
746
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
710
747
|
$$` : `${e}$$`;
|
|
711
|
-
},
|
|
748
|
+
}, Ln = (e) => Pn(e) % 2 == 0 ? e : In(e), Rn = (e) => Fn(e) % 2 == 1 ? `${e}$` : e, zn = "streamdown:incomplete-image", Bn = (e, t, n) => {
|
|
712
749
|
if (e.substring(t + 2).includes(")")) return null;
|
|
713
|
-
let r =
|
|
714
|
-
if (r === -1 ||
|
|
750
|
+
let r = Xt(e, t);
|
|
751
|
+
if (r === -1 || N(e, r)) return null;
|
|
715
752
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
|
|
716
|
-
return i ? `${o} if (e[n] === "[" && !
|
|
753
|
+
return i ? `${o}` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
754
|
+
}, Vn = (e, t) => {
|
|
755
|
+
for (let n = 0; n < t; n++) if (e[n] === "[" && !N(e, n)) {
|
|
719
756
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
720
|
-
let t =
|
|
757
|
+
let t = Zt(e, n);
|
|
721
758
|
if (t === -1) return n;
|
|
722
759
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
723
760
|
let r = e.indexOf(")", t + 2);
|
|
@@ -725,69 +762,69 @@ $$` : `${e}$$`;
|
|
|
725
762
|
}
|
|
726
763
|
}
|
|
727
764
|
return t;
|
|
728
|
-
},
|
|
765
|
+
}, Hn = (e, t, n) => {
|
|
729
766
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
730
|
-
if (!e.substring(t + 1).includes("]") ||
|
|
767
|
+
if (!e.substring(t + 1).includes("]") || Zt(e, t) === -1) {
|
|
731
768
|
let a = e.substring(0, i);
|
|
732
|
-
if (r) return `${a} return `${a}`;
|
|
733
770
|
if (n === "text-only") {
|
|
734
|
-
let n =
|
|
771
|
+
let n = Vn(e, t);
|
|
735
772
|
return e.substring(0, n) + e.substring(n + 1);
|
|
736
773
|
}
|
|
737
774
|
return `${e}](streamdown:incomplete-link)`;
|
|
738
775
|
}
|
|
739
776
|
return null;
|
|
740
|
-
},
|
|
777
|
+
}, Un = (e, t) => {
|
|
741
778
|
let n = e.lastIndexOf("](");
|
|
742
|
-
if (n !== -1 && !
|
|
743
|
-
let r =
|
|
779
|
+
if (n !== -1 && !N(e, n)) {
|
|
780
|
+
let r = Bn(e, n, t);
|
|
744
781
|
if (r !== null) return r;
|
|
745
782
|
}
|
|
746
|
-
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!
|
|
747
|
-
let r =
|
|
783
|
+
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!N(e, n)) {
|
|
784
|
+
let r = Hn(e, n, t);
|
|
748
785
|
if (r !== null) return r;
|
|
749
786
|
}
|
|
750
787
|
return e;
|
|
751
|
-
},
|
|
788
|
+
}, Wn = 32, Gn = (e, t = "protocol") => {
|
|
752
789
|
let n = e;
|
|
753
|
-
for (let e = 0; e <
|
|
754
|
-
let e =
|
|
790
|
+
for (let e = 0; e < Wn; e += 1) {
|
|
791
|
+
let e = Un(n, t);
|
|
755
792
|
if (e.length >= n.length) return e;
|
|
756
793
|
n = e;
|
|
757
794
|
}
|
|
758
795
|
return n;
|
|
759
|
-
},
|
|
796
|
+
}, Kn = /^-{1,2}$/, qn = /^[\s]*-{1,2}[\s]+$/, Jn = /^={1,2}$/, Yn = /^[\s]*={1,2}[\s]+$/, Xn = (e) => {
|
|
760
797
|
if (!e || typeof e != "string") return e;
|
|
761
798
|
let t = e.lastIndexOf("\n");
|
|
762
799
|
if (t === -1) return e;
|
|
763
800
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
764
|
-
if (
|
|
801
|
+
if (Kn.test(i) && !n.match(qn)) {
|
|
765
802
|
let t = r.split("\n").at(-1);
|
|
766
803
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
767
804
|
}
|
|
768
|
-
if (
|
|
805
|
+
if (Jn.test(i) && !n.match(Yn)) {
|
|
769
806
|
let t = r.split("\n").at(-1);
|
|
770
807
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
771
808
|
}
|
|
772
809
|
return e;
|
|
773
|
-
},
|
|
774
|
-
let t =
|
|
810
|
+
}, Zn = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, Qn = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(Zn, (t, n, r) => N(e, r + n.length) ? t : `${n}\\~`), $n = (e) => St(e, "~"), er = (e) => {
|
|
811
|
+
let t = P(e, Wt);
|
|
775
812
|
if (t) {
|
|
776
813
|
let n = t[2];
|
|
777
|
-
if (!n ||
|
|
814
|
+
if (!n || Kt.test(n)) return e;
|
|
778
815
|
let r = e.lastIndexOf(t[1]);
|
|
779
|
-
if (
|
|
780
|
-
if (
|
|
816
|
+
if (N(e, r) || It(e, r)) return e;
|
|
817
|
+
if ($n(e) % 2 == 1) return `${e}~~`;
|
|
781
818
|
} else {
|
|
782
|
-
let t =
|
|
819
|
+
let t = P(e, F);
|
|
783
820
|
if (t) {
|
|
784
821
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
785
|
-
if (
|
|
786
|
-
if (
|
|
822
|
+
if (N(e, n) || It(e, n)) return e;
|
|
823
|
+
if ($n(e) % 2 == 1) return `${e}~`;
|
|
787
824
|
}
|
|
788
825
|
}
|
|
789
826
|
return e;
|
|
790
|
-
},
|
|
827
|
+
}, tr = (e) => e !== !1, nr = (e) => e === !0, L = {
|
|
791
828
|
SINGLE_TILDE: 0,
|
|
792
829
|
COMPARISON_OPERATORS: 5,
|
|
793
830
|
HTML_TAGS: 10,
|
|
@@ -803,11 +840,11 @@ $$` : `${e}$$`;
|
|
|
803
840
|
KATEX: 70,
|
|
804
841
|
INLINE_KATEX: 75,
|
|
805
842
|
DEFAULT: 100
|
|
806
|
-
},
|
|
843
|
+
}, rr = [
|
|
807
844
|
{
|
|
808
845
|
handler: {
|
|
809
846
|
name: "singleTilde",
|
|
810
|
-
handle:
|
|
847
|
+
handle: Qn,
|
|
811
848
|
priority: L.SINGLE_TILDE
|
|
812
849
|
},
|
|
813
850
|
optionKey: "singleTilde"
|
|
@@ -815,7 +852,7 @@ $$` : `${e}$$`;
|
|
|
815
852
|
{
|
|
816
853
|
handler: {
|
|
817
854
|
name: "comparisonOperators",
|
|
818
|
-
handle:
|
|
855
|
+
handle: Rt,
|
|
819
856
|
priority: L.COMPARISON_OPERATORS
|
|
820
857
|
},
|
|
821
858
|
optionKey: "comparisonOperators"
|
|
@@ -823,7 +860,7 @@ $$` : `${e}$$`;
|
|
|
823
860
|
{
|
|
824
861
|
handler: {
|
|
825
862
|
name: "htmlTags",
|
|
826
|
-
handle:
|
|
863
|
+
handle: Mn,
|
|
827
864
|
priority: L.HTML_TAGS
|
|
828
865
|
},
|
|
829
866
|
optionKey: "htmlTags"
|
|
@@ -831,7 +868,7 @@ $$` : `${e}$$`;
|
|
|
831
868
|
{
|
|
832
869
|
handler: {
|
|
833
870
|
name: "setextHeadings",
|
|
834
|
-
handle:
|
|
871
|
+
handle: Xn,
|
|
835
872
|
priority: L.SETEXT_HEADINGS
|
|
836
873
|
},
|
|
837
874
|
optionKey: "setextHeadings"
|
|
@@ -839,7 +876,7 @@ $$` : `${e}$$`;
|
|
|
839
876
|
{
|
|
840
877
|
handler: {
|
|
841
878
|
name: "links",
|
|
842
|
-
handle:
|
|
879
|
+
handle: Gn,
|
|
843
880
|
priority: L.LINKS
|
|
844
881
|
},
|
|
845
882
|
optionKey: "links",
|
|
@@ -848,7 +885,7 @@ $$` : `${e}$$`;
|
|
|
848
885
|
{
|
|
849
886
|
handler: {
|
|
850
887
|
name: "boldItalic",
|
|
851
|
-
handle:
|
|
888
|
+
handle: Dn,
|
|
852
889
|
priority: L.BOLD_ITALIC
|
|
853
890
|
},
|
|
854
891
|
optionKey: "boldItalic"
|
|
@@ -856,7 +893,7 @@ $$` : `${e}$$`;
|
|
|
856
893
|
{
|
|
857
894
|
handler: {
|
|
858
895
|
name: "bold",
|
|
859
|
-
handle:
|
|
896
|
+
handle: hn,
|
|
860
897
|
priority: L.BOLD
|
|
861
898
|
},
|
|
862
899
|
optionKey: "bold"
|
|
@@ -864,7 +901,7 @@ $$` : `${e}$$`;
|
|
|
864
901
|
{
|
|
865
902
|
handler: {
|
|
866
903
|
name: "italicDoubleUnderscore",
|
|
867
|
-
handle:
|
|
904
|
+
handle: _n,
|
|
868
905
|
priority: L.ITALIC_DOUBLE_UNDERSCORE
|
|
869
906
|
},
|
|
870
907
|
optionKey: "italic"
|
|
@@ -872,7 +909,7 @@ $$` : `${e}$$`;
|
|
|
872
909
|
{
|
|
873
910
|
handler: {
|
|
874
911
|
name: "italicSingleAsterisk",
|
|
875
|
-
handle:
|
|
912
|
+
handle: bn,
|
|
876
913
|
priority: L.ITALIC_SINGLE_ASTERISK
|
|
877
914
|
},
|
|
878
915
|
optionKey: "italic"
|
|
@@ -880,7 +917,7 @@ $$` : `${e}$$`;
|
|
|
880
917
|
{
|
|
881
918
|
handler: {
|
|
882
919
|
name: "italicSingleUnderscore",
|
|
883
|
-
handle:
|
|
920
|
+
handle: wn,
|
|
884
921
|
priority: L.ITALIC_SINGLE_UNDERSCORE
|
|
885
922
|
},
|
|
886
923
|
optionKey: "italic"
|
|
@@ -888,7 +925,7 @@ $$` : `${e}$$`;
|
|
|
888
925
|
{
|
|
889
926
|
handler: {
|
|
890
927
|
name: "inlineCode",
|
|
891
|
-
handle:
|
|
928
|
+
handle: Nn,
|
|
892
929
|
priority: L.INLINE_CODE
|
|
893
930
|
},
|
|
894
931
|
optionKey: "inlineCode"
|
|
@@ -896,7 +933,7 @@ $$` : `${e}$$`;
|
|
|
896
933
|
{
|
|
897
934
|
handler: {
|
|
898
935
|
name: "strikethrough",
|
|
899
|
-
handle:
|
|
936
|
+
handle: er,
|
|
900
937
|
priority: L.STRIKETHROUGH
|
|
901
938
|
},
|
|
902
939
|
optionKey: "strikethrough"
|
|
@@ -904,7 +941,7 @@ $$` : `${e}$$`;
|
|
|
904
941
|
{
|
|
905
942
|
handler: {
|
|
906
943
|
name: "katex",
|
|
907
|
-
handle:
|
|
944
|
+
handle: Ln,
|
|
908
945
|
priority: L.KATEX
|
|
909
946
|
},
|
|
910
947
|
optionKey: "katex"
|
|
@@ -912,36 +949,36 @@ $$` : `${e}$$`;
|
|
|
912
949
|
{
|
|
913
950
|
handler: {
|
|
914
951
|
name: "inlineKatex",
|
|
915
|
-
handle:
|
|
952
|
+
handle: Rn,
|
|
916
953
|
priority: L.INLINE_KATEX
|
|
917
954
|
},
|
|
918
955
|
optionKey: "inlineKatex"
|
|
919
956
|
}
|
|
920
|
-
],
|
|
957
|
+
], ir = (e) => {
|
|
921
958
|
let t = e?.linkMode ?? "protocol";
|
|
922
|
-
return
|
|
923
|
-
handler:
|
|
959
|
+
return rr.filter(({ handler: t, optionKey: n }) => t.name === "links" ? tr(e?.links) || tr(e?.images) : t.name === "inlineKatex" ? nr(e?.inlineKatex) : tr(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
960
|
+
handler: rt(nt({}, e), { handle: (e) => Gn(e, t) }),
|
|
924
961
|
earlyReturn: t === "protocol" ? n : void 0
|
|
925
962
|
} : {
|
|
926
963
|
handler: e,
|
|
927
964
|
earlyReturn: n
|
|
928
965
|
});
|
|
929
|
-
},
|
|
966
|
+
}, ar = (e, t) => {
|
|
930
967
|
if (!e || typeof e != "string") return e;
|
|
931
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
932
|
-
handler:
|
|
968
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = ir(t), i = (t?.handlers ?? []).map((e) => ({
|
|
969
|
+
handler: rt(nt({}, e), { priority: e.priority ?? L.DEFAULT }),
|
|
933
970
|
earlyReturn: void 0
|
|
934
971
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
935
972
|
try {
|
|
936
973
|
for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
|
|
937
974
|
return n.endsWith(" ") && !n.endsWith(" ") ? n.slice(0, -1) : n;
|
|
938
975
|
} finally {
|
|
939
|
-
|
|
976
|
+
yt();
|
|
940
977
|
}
|
|
941
978
|
};
|
|
942
979
|
//#endregion
|
|
943
980
|
//#region ../../node_modules/.pnpm/marked@18.1.1/node_modules/marked/lib/marked.esm.js
|
|
944
|
-
function
|
|
981
|
+
function or() {
|
|
945
982
|
return {
|
|
946
983
|
async: !1,
|
|
947
984
|
breaks: !1,
|
|
@@ -955,12 +992,12 @@ function Xn() {
|
|
|
955
992
|
walkTokens: null
|
|
956
993
|
};
|
|
957
994
|
}
|
|
958
|
-
var
|
|
959
|
-
function
|
|
960
|
-
|
|
995
|
+
var sr = or();
|
|
996
|
+
function cr(e) {
|
|
997
|
+
sr = e;
|
|
961
998
|
}
|
|
962
|
-
var
|
|
963
|
-
function
|
|
999
|
+
var lr = { exec: () => null };
|
|
1000
|
+
function ur(e) {
|
|
964
1001
|
let t = [];
|
|
965
1002
|
return (n) => {
|
|
966
1003
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
@@ -977,7 +1014,7 @@ function R(e, t = "") {
|
|
|
977
1014
|
};
|
|
978
1015
|
return r;
|
|
979
1016
|
}
|
|
980
|
-
var
|
|
1017
|
+
var dr = ((e = "") => {
|
|
981
1018
|
try {
|
|
982
1019
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
983
1020
|
} catch {
|
|
@@ -1038,113 +1075,113 @@ var tr = ((e = "") => {
|
|
|
1038
1075
|
notSpaceStart: /^\S*/,
|
|
1039
1076
|
endingNewline: /\n$/,
|
|
1040
1077
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
1041
|
-
nextBulletRegex:
|
|
1042
|
-
hrRegex:
|
|
1043
|
-
fencesBeginRegex:
|
|
1044
|
-
headingBeginRegex:
|
|
1045
|
-
htmlBeginRegex:
|
|
1046
|
-
blockquoteBeginRegex:
|
|
1047
|
-
},
|
|
1048
|
-
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
1049
|
-
code:
|
|
1050
|
-
def:
|
|
1051
|
-
fences:
|
|
1052
|
-
heading:
|
|
1053
|
-
hr
|
|
1054
|
-
html:
|
|
1055
|
-
lheading:
|
|
1056
|
-
list:
|
|
1057
|
-
newline:
|
|
1058
|
-
paragraph:
|
|
1059
|
-
table:
|
|
1060
|
-
text:
|
|
1061
|
-
},
|
|
1062
|
-
...
|
|
1063
|
-
lheading:
|
|
1064
|
-
table:
|
|
1065
|
-
paragraph: R(
|
|
1066
|
-
},
|
|
1067
|
-
...
|
|
1068
|
-
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",
|
|
1078
|
+
nextBulletRegex: ur((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
1079
|
+
hrRegex: ur((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
1080
|
+
fencesBeginRegex: ur((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
1081
|
+
headingBeginRegex: ur((e) => RegExp(`^ {0,${e}}#`)),
|
|
1082
|
+
htmlBeginRegex: ur((e) => RegExp(`^ {0,${e}}(?:</?(?:${Er})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
|
|
1083
|
+
blockquoteBeginRegex: ur((e) => RegExp(`^ {0,${e}}>`))
|
|
1084
|
+
}, fr = /^(?:[ \t]*(?:\n|$))+/, pr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, mr = /^ {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+|$)/, gr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, _r = / {0,3}(?:[*+-]|\d{1,9}[.)])/, vr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, yr = R(vr).replace(/bull/g, _r).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), br = R(vr).replace(/bull/g, _r).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), xr = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Sr = /^[^\n]+/, Cr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, wr = R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Cr).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Tr = R(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, _r).getRegex(), Er = "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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Dr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Or = R("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Dr).replace("tag", Er).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), kr = (e) => R(xr).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Er).getRegex(), Ar = kr(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), jr = kr(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Mr = {
|
|
1085
|
+
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", jr).getRegex(),
|
|
1086
|
+
code: pr,
|
|
1087
|
+
def: wr,
|
|
1088
|
+
fences: mr,
|
|
1089
|
+
heading: gr,
|
|
1090
|
+
hr,
|
|
1091
|
+
html: Or,
|
|
1092
|
+
lheading: yr,
|
|
1093
|
+
list: Tr,
|
|
1094
|
+
newline: fr,
|
|
1095
|
+
paragraph: Ar,
|
|
1096
|
+
table: lr,
|
|
1097
|
+
text: Sr
|
|
1098
|
+
}, Nr = R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Er).getRegex(), Pr = {
|
|
1099
|
+
...Mr,
|
|
1100
|
+
lheading: br,
|
|
1101
|
+
table: Nr,
|
|
1102
|
+
paragraph: R(xr).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Nr).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Er).getRegex()
|
|
1103
|
+
}, Fr = {
|
|
1104
|
+
...Mr,
|
|
1105
|
+
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Dr).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(),
|
|
1069
1106
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
1070
1107
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
1071
|
-
fences:
|
|
1108
|
+
fences: lr,
|
|
1072
1109
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1073
|
-
paragraph: R(
|
|
1074
|
-
},
|
|
1075
|
-
_backpedal:
|
|
1076
|
-
anyPunctuation:
|
|
1077
|
-
anyPunctuationOutsideCode:
|
|
1078
|
-
autolink:
|
|
1079
|
-
blockSkip:
|
|
1080
|
-
br:
|
|
1081
|
-
code:
|
|
1082
|
-
del:
|
|
1083
|
-
delLDelim:
|
|
1084
|
-
delRDelim:
|
|
1085
|
-
emStrongLDelim:
|
|
1086
|
-
emStrongRDelimAst:
|
|
1087
|
-
emStrongRDelimUnd:
|
|
1088
|
-
escape:
|
|
1089
|
-
link:
|
|
1090
|
-
nolink:
|
|
1091
|
-
punctuation:
|
|
1092
|
-
reflink:
|
|
1093
|
-
reflinkSearch:
|
|
1094
|
-
tag:
|
|
1095
|
-
text:
|
|
1096
|
-
url:
|
|
1097
|
-
},
|
|
1098
|
-
...
|
|
1099
|
-
emStrongLDelim:
|
|
1100
|
-
emStrongRDelimAst:
|
|
1101
|
-
emStrongRDelimUnd:
|
|
1102
|
-
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label",
|
|
1103
|
-
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",
|
|
1104
|
-
},
|
|
1105
|
-
...
|
|
1106
|
-
emStrongRDelimAst:
|
|
1107
|
-
emStrongLDelim:
|
|
1108
|
-
delLDelim:
|
|
1109
|
-
delRDelim:
|
|
1110
|
-
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",
|
|
1110
|
+
paragraph: R(xr).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", yr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1111
|
+
}, Ir = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Lr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Rr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, zr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, Br = /[\s\p{P}\p{S}]/u, Vr = /[^\s\p{P}\p{S}]/u, Hr = R(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Br).getRegex(), Ur = /[\p{Pi}\p{Ps}"']/u, Wr = /(?!~)[\p{P}\p{S}]/u, Gr = /(?!~)[\s\p{P}\p{S}]/u, Kr = /(?:[^\s\p{P}\p{S}]|~)/u, qr = R(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", dr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Jr = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Yr = R(Jr, "u").replace(/punct/g, B).getRegex(), Xr = R(Jr, "u").replace(/punct/g, Wr).getRegex(), Zr = R(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Ur).replace(/punct/g, B).getRegex(), Qr = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", $r = R(Qr, "gu").replace(/notPunctSpace/g, Vr).replace(/punctSpace/g, Br).replace(/punct/g, B).getRegex(), ei = R(Qr, "gu").replace(/notPunctSpace/g, Kr).replace(/punctSpace/g, Gr).replace(/punct/g, Wr).getRegex(), ti = R("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Vr).replace(/punctSpace/g, Br).replace(/punct/g, B).getRegex(), ni = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Vr).replace(/punctSpace/g, Br).replace(/punct/g, B).getRegex(), ri = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Vr).replace(/punctSpace/g, Br).replace(/punct/g, B).getRegex(), ii = R(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, B).getRegex(), ai = R("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Vr).replace(/punctSpace/g, Br).replace(/punct/g, B).getRegex(), oi = R(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), si = R(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, B).getRegex(), ci = R(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(), li = R(Dr).replace("(?:-->|$)", "-->").getRegex(), ui = R("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", li).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), di = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, fi = R(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", di).getRegex(), pi = R(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", fi).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), mi = R(/^!?\[(label)\]\[(ref)\]/).replace("label", fi).replace("ref", Cr).getRegex(), hi = R(/^!?\[(ref)\](?:\[\])?/).replace("ref", Cr).getRegex(), gi = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, _i = R(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", di).getRegex(), vi = R("reflink|nolink(?!\\()", "g").replace("reflink", R(/^!?\[(label)\]\[(ref)\]/).replace("label", _i).replace("ref", gi).getRegex()).replace("nolink", R(/^!?\[(ref)\](?:\[\])?/).replace("ref", gi).getRegex()).getRegex(), yi = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, bi = R(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), xi = {
|
|
1112
|
+
_backpedal: lr,
|
|
1113
|
+
anyPunctuation: oi,
|
|
1114
|
+
anyPunctuationOutsideCode: si,
|
|
1115
|
+
autolink: ci,
|
|
1116
|
+
blockSkip: qr,
|
|
1117
|
+
br: Rr,
|
|
1118
|
+
code: Lr,
|
|
1119
|
+
del: lr,
|
|
1120
|
+
delLDelim: lr,
|
|
1121
|
+
delRDelim: lr,
|
|
1122
|
+
emStrongLDelim: Yr,
|
|
1123
|
+
emStrongRDelimAst: $r,
|
|
1124
|
+
emStrongRDelimUnd: ni,
|
|
1125
|
+
escape: Ir,
|
|
1126
|
+
link: pi,
|
|
1127
|
+
nolink: hi,
|
|
1128
|
+
punctuation: Hr,
|
|
1129
|
+
reflink: mi,
|
|
1130
|
+
reflinkSearch: vi,
|
|
1131
|
+
tag: ui,
|
|
1132
|
+
text: zr,
|
|
1133
|
+
url: lr
|
|
1134
|
+
}, Si = {
|
|
1135
|
+
...xi,
|
|
1136
|
+
emStrongLDelim: Zr,
|
|
1137
|
+
emStrongRDelimAst: ti,
|
|
1138
|
+
emStrongRDelimUnd: ri,
|
|
1139
|
+
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label", fi).getRegex(),
|
|
1140
|
+
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", fi).getRegex()
|
|
1141
|
+
}, Ci = {
|
|
1142
|
+
...xi,
|
|
1143
|
+
emStrongRDelimAst: ei,
|
|
1144
|
+
emStrongLDelim: Xr,
|
|
1145
|
+
delLDelim: ii,
|
|
1146
|
+
delRDelim: ai,
|
|
1147
|
+
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", bi).replace("protocol", yi).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
1111
1148
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1112
1149
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1113
|
-
text: R(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",
|
|
1114
|
-
},
|
|
1115
|
-
...
|
|
1116
|
-
br: R(
|
|
1117
|
-
text: R(
|
|
1118
|
-
},
|
|
1119
|
-
normal:
|
|
1120
|
-
gfm:
|
|
1121
|
-
pedantic:
|
|
1122
|
-
},
|
|
1123
|
-
normal:
|
|
1124
|
-
gfm:
|
|
1125
|
-
breaks:
|
|
1126
|
-
pedantic:
|
|
1127
|
-
},
|
|
1150
|
+
text: R(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", yi).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
1151
|
+
}, wi = {
|
|
1152
|
+
...Ci,
|
|
1153
|
+
br: R(Rr).replace("{2,}", "*").getRegex(),
|
|
1154
|
+
text: R(Ci.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1155
|
+
}, Ti = {
|
|
1156
|
+
normal: Mr,
|
|
1157
|
+
gfm: Pr,
|
|
1158
|
+
pedantic: Fr
|
|
1159
|
+
}, Ei = {
|
|
1160
|
+
normal: xi,
|
|
1161
|
+
gfm: Ci,
|
|
1162
|
+
breaks: wi,
|
|
1163
|
+
pedantic: Si
|
|
1164
|
+
}, Di = {
|
|
1128
1165
|
"&": "&",
|
|
1129
1166
|
"<": "<",
|
|
1130
1167
|
">": ">",
|
|
1131
1168
|
"\"": """,
|
|
1132
1169
|
"'": "'"
|
|
1133
|
-
},
|
|
1170
|
+
}, Oi = (e) => Di[e];
|
|
1134
1171
|
function V(e, t) {
|
|
1135
1172
|
if (t) {
|
|
1136
|
-
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace,
|
|
1137
|
-
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode,
|
|
1173
|
+
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace, Oi);
|
|
1174
|
+
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode, Oi);
|
|
1138
1175
|
return e;
|
|
1139
1176
|
}
|
|
1140
|
-
function
|
|
1177
|
+
function ki(e) {
|
|
1141
1178
|
return z.numericCharacterReference.test(e) ? e.replace(z.numericCharacterReferenceOrAmpersand, (e, t, n) => {
|
|
1142
1179
|
if (t === void 0 && n === void 0) return "&";
|
|
1143
1180
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
1144
1181
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : r === 38 ? "&" : String.fromCodePoint(r);
|
|
1145
1182
|
}) : e;
|
|
1146
1183
|
}
|
|
1147
|
-
function
|
|
1184
|
+
function Ai(e) {
|
|
1148
1185
|
try {
|
|
1149
1186
|
e = encodeURI(e).replace(z.percentDecode, "%");
|
|
1150
1187
|
} catch {
|
|
@@ -1152,7 +1189,7 @@ function bi(e) {
|
|
|
1152
1189
|
}
|
|
1153
1190
|
return e;
|
|
1154
1191
|
}
|
|
1155
|
-
function
|
|
1192
|
+
function ji(e, t) {
|
|
1156
1193
|
let n = e.replace(z.findPipe, (e, t, n) => {
|
|
1157
1194
|
let r = !1, i = t;
|
|
1158
1195
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
@@ -1165,7 +1202,7 @@ function xi(e, t) {
|
|
|
1165
1202
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(z.slashPipe, "|");
|
|
1166
1203
|
return n;
|
|
1167
1204
|
}
|
|
1168
|
-
function
|
|
1205
|
+
function Mi(e, t, n) {
|
|
1169
1206
|
let r = e.length;
|
|
1170
1207
|
if (r === 0) return "";
|
|
1171
1208
|
let i = 0;
|
|
@@ -1177,15 +1214,15 @@ function Si(e, t, n) {
|
|
|
1177
1214
|
}
|
|
1178
1215
|
return e.slice(0, r - i);
|
|
1179
1216
|
}
|
|
1180
|
-
function
|
|
1217
|
+
function Ni(e) {
|
|
1181
1218
|
let t = e.split("\n"), n = t.length - 1;
|
|
1182
1219
|
for (; n >= 0 && z.blankLine.test(t[n]);) n--;
|
|
1183
1220
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
1184
1221
|
}
|
|
1185
|
-
function
|
|
1222
|
+
function Pi(e) {
|
|
1186
1223
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
1187
1224
|
}
|
|
1188
|
-
function
|
|
1225
|
+
function Fi(e, t) {
|
|
1189
1226
|
if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
|
|
1190
1227
|
let n = 0;
|
|
1191
1228
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -1193,7 +1230,7 @@ function Ti(e, t) {
|
|
|
1193
1230
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1194
1231
|
return n > 0 ? -2 : -1;
|
|
1195
1232
|
}
|
|
1196
|
-
function
|
|
1233
|
+
function Ii(e, t = 0) {
|
|
1197
1234
|
let n = t, r = "";
|
|
1198
1235
|
for (let t of e) if (t === " ") {
|
|
1199
1236
|
let e = 4 - n % 4;
|
|
@@ -1201,7 +1238,7 @@ function Ei(e, t = 0) {
|
|
|
1201
1238
|
} else r += t, n++;
|
|
1202
1239
|
return r;
|
|
1203
1240
|
}
|
|
1204
|
-
function
|
|
1241
|
+
function Li(e, t, n, r, i) {
|
|
1205
1242
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!", l = r.state.inLink, u = r.state.linkEmitted, d = r.state.inRawBlock;
|
|
1206
1243
|
r.state.inLink = !0, r.state.linkEmitted = !1;
|
|
1207
1244
|
let f = r.inlineTokens(s), p = r.state.linkEmitted;
|
|
@@ -1221,7 +1258,7 @@ function Di(e, t, n, r, i) {
|
|
|
1221
1258
|
tokens: f
|
|
1222
1259
|
};
|
|
1223
1260
|
}
|
|
1224
|
-
function
|
|
1261
|
+
function Ri(e, t, n) {
|
|
1225
1262
|
let r = e.match(n.other.indentCodeCompensation);
|
|
1226
1263
|
if (r === null) return t;
|
|
1227
1264
|
let i = r[1];
|
|
@@ -1232,7 +1269,7 @@ function Oi(e, t, n) {
|
|
|
1232
1269
|
return e.slice(Math.min(r.length, i.length));
|
|
1233
1270
|
}).join("\n");
|
|
1234
1271
|
}
|
|
1235
|
-
function
|
|
1272
|
+
function zi(e, t, n, r) {
|
|
1236
1273
|
if (!t.includes("<")) return !1;
|
|
1237
1274
|
for (let i = 0; i < t.length; i++) {
|
|
1238
1275
|
if (t[i] === "\\") {
|
|
@@ -1255,12 +1292,12 @@ function ki(e, t, n, r) {
|
|
|
1255
1292
|
}
|
|
1256
1293
|
return !1;
|
|
1257
1294
|
}
|
|
1258
|
-
var
|
|
1295
|
+
var Bi = class {
|
|
1259
1296
|
options;
|
|
1260
1297
|
rules;
|
|
1261
1298
|
lexer;
|
|
1262
1299
|
constructor(e) {
|
|
1263
|
-
this.options = e ||
|
|
1300
|
+
this.options = e || sr;
|
|
1264
1301
|
}
|
|
1265
1302
|
space(e) {
|
|
1266
1303
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1272,7 +1309,7 @@ var Ai = class {
|
|
|
1272
1309
|
code(e) {
|
|
1273
1310
|
let t = this.rules.block.code.exec(e);
|
|
1274
1311
|
if (t) {
|
|
1275
|
-
let e = this.options.pedantic ? t[0] :
|
|
1312
|
+
let e = this.options.pedantic ? t[0] : Ni(t[0]);
|
|
1276
1313
|
return {
|
|
1277
1314
|
type: "code",
|
|
1278
1315
|
raw: e,
|
|
@@ -1284,7 +1321,7 @@ var Ai = class {
|
|
|
1284
1321
|
fences(e) {
|
|
1285
1322
|
let t = this.rules.block.fences.exec(e);
|
|
1286
1323
|
if (t) {
|
|
1287
|
-
let e = t[0], n =
|
|
1324
|
+
let e = t[0], n = Ri(e, t[3] || "", this.rules);
|
|
1288
1325
|
return {
|
|
1289
1326
|
type: "code",
|
|
1290
1327
|
raw: e,
|
|
@@ -1298,12 +1335,12 @@ var Ai = class {
|
|
|
1298
1335
|
if (t) {
|
|
1299
1336
|
let e = t[2].trim();
|
|
1300
1337
|
if (this.rules.other.endingHash.test(e)) {
|
|
1301
|
-
let t =
|
|
1338
|
+
let t = Mi(e, "#");
|
|
1302
1339
|
(this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
|
|
1303
1340
|
}
|
|
1304
1341
|
return {
|
|
1305
1342
|
type: "heading",
|
|
1306
|
-
raw:
|
|
1343
|
+
raw: Mi(t[0], "\n"),
|
|
1307
1344
|
depth: t[1].length,
|
|
1308
1345
|
text: e,
|
|
1309
1346
|
tokens: this.lexer.inline(e)
|
|
@@ -1314,13 +1351,13 @@ var Ai = class {
|
|
|
1314
1351
|
let t = this.rules.block.hr.exec(e);
|
|
1315
1352
|
if (t) return {
|
|
1316
1353
|
type: "hr",
|
|
1317
|
-
raw:
|
|
1354
|
+
raw: Mi(t[0], "\n")
|
|
1318
1355
|
};
|
|
1319
1356
|
}
|
|
1320
1357
|
blockquote(e) {
|
|
1321
1358
|
let t = this.rules.block.blockquote.exec(e);
|
|
1322
1359
|
if (t) {
|
|
1323
|
-
let e =
|
|
1360
|
+
let e = Mi(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
1324
1361
|
for (; e.length > 0;) {
|
|
1325
1362
|
let t = !1, a = [], o = 0;
|
|
1326
1363
|
for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -1374,12 +1411,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1374
1411
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1375
1412
|
let l = r();
|
|
1376
1413
|
e = e.substring(t[0].length);
|
|
1377
|
-
let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ?
|
|
1414
|
+
let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ? Ii(u, d) : u.replace(this.rules.other.leadingSpaceTab, (e) => Ii(e, d)), p = e.split("\n", 1)[0], ee = !f.trim(), m = 0;
|
|
1378
1415
|
if (this.options.pedantic ? (m = 2, a = f.trimStart()) : ee ? m = d + 1 : (m = f.search(this.rules.other.nonSpaceChar), m = m > 4 ? 1 : m, a = f.slice(m), m += d), ee && this.rules.other.blankLine.test(p) && (e = e.substring(p.length + 1), i = !0), !i) {
|
|
1379
1416
|
let t = this.rules.other.nextBulletRegex(m), n = this.rules.other.hrRegex(m), r = this.rules.other.fencesBeginRegex(m), i = this.rules.other.headingBeginRegex(m), o = this.rules.other.htmlBeginRegex(m), s = this.rules.other.blockquoteBeginRegex(m);
|
|
1380
1417
|
for (; e;) {
|
|
1381
1418
|
let c = e.split("\n", 1)[0], l;
|
|
1382
|
-
if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) =>
|
|
1419
|
+
if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) => Ii(e)), r.test(p) || i.test(p) || o.test(p) || s.test(p) || t.test(p) || n.test(p)) break;
|
|
1383
1420
|
if (l.search(this.rules.other.nonSpaceChar) >= m || !p.trim()) a += "\n" + l.slice(m);
|
|
1384
1421
|
else {
|
|
1385
1422
|
if (ee || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || r.test(f) || i.test(f) || n.test(f)) break;
|
|
@@ -1440,7 +1477,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1440
1477
|
html(e) {
|
|
1441
1478
|
let t = this.rules.block.html.exec(e);
|
|
1442
1479
|
if (t) {
|
|
1443
|
-
let e =
|
|
1480
|
+
let e = Ni(t[0]);
|
|
1444
1481
|
return {
|
|
1445
1482
|
type: "html",
|
|
1446
1483
|
block: !0,
|
|
@@ -1453,12 +1490,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1453
1490
|
def(e) {
|
|
1454
1491
|
let t = this.rules.block.def.exec(e);
|
|
1455
1492
|
if (t) {
|
|
1456
|
-
if (!this.rules.other.startAngleBracket.test(t[2]) &&
|
|
1457
|
-
let e =
|
|
1493
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && Fi(t[2], "()") !== -1) return;
|
|
1494
|
+
let e = Pi(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
1458
1495
|
return {
|
|
1459
1496
|
type: "def",
|
|
1460
1497
|
tag: e,
|
|
1461
|
-
raw:
|
|
1498
|
+
raw: Mi(t[0], "\n"),
|
|
1462
1499
|
href: n,
|
|
1463
1500
|
title: r
|
|
1464
1501
|
};
|
|
@@ -1467,9 +1504,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1467
1504
|
table(e) {
|
|
1468
1505
|
let t = this.rules.block.table.exec(e);
|
|
1469
1506
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1470
|
-
let n =
|
|
1507
|
+
let n = ji(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
|
|
1471
1508
|
type: "table",
|
|
1472
|
-
raw:
|
|
1509
|
+
raw: Mi(t[0], "\n"),
|
|
1473
1510
|
header: [],
|
|
1474
1511
|
align: [],
|
|
1475
1512
|
rows: []
|
|
@@ -1482,7 +1519,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1482
1519
|
header: !0,
|
|
1483
1520
|
align: a.align[e]
|
|
1484
1521
|
});
|
|
1485
|
-
for (let e of i) a.rows.push(
|
|
1522
|
+
for (let e of i) a.rows.push(ji(e, a.header.length).map((e, t) => ({
|
|
1486
1523
|
text: e,
|
|
1487
1524
|
tokens: this.lexer.inline(e),
|
|
1488
1525
|
header: !1,
|
|
@@ -1497,7 +1534,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1497
1534
|
let e = t[1].trim();
|
|
1498
1535
|
return {
|
|
1499
1536
|
type: "heading",
|
|
1500
|
-
raw:
|
|
1537
|
+
raw: Mi(t[0], "\n"),
|
|
1501
1538
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
1502
1539
|
text: e,
|
|
1503
1540
|
tokens: this.lexer.inline(e)
|
|
@@ -1549,14 +1586,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1549
1586
|
let t = this.rules.inline.link.exec(e);
|
|
1550
1587
|
if (t) {
|
|
1551
1588
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
1552
|
-
if (!this.options.pedantic &&
|
|
1589
|
+
if (!this.options.pedantic && zi(e, t[1], n, this.rules)) return;
|
|
1553
1590
|
let r = t[2].trim();
|
|
1554
1591
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
1555
1592
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
1556
|
-
let e =
|
|
1593
|
+
let e = Mi(r.slice(0, -1), "\\");
|
|
1557
1594
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1558
1595
|
} else {
|
|
1559
|
-
let e =
|
|
1596
|
+
let e = Fi(t[2], "()");
|
|
1560
1597
|
if (e === -2) return;
|
|
1561
1598
|
if (e > -1) {
|
|
1562
1599
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -1568,7 +1605,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1568
1605
|
let e = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1569
1606
|
e && (i = e[1], a = e[3]);
|
|
1570
1607
|
} else a = t[3] ? t[3].slice(1, -1) : "";
|
|
1571
|
-
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)),
|
|
1608
|
+
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), Li(t, {
|
|
1572
1609
|
href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1573
1610
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1574
1611
|
}, t[0], this.lexer, this.rules);
|
|
@@ -1578,8 +1615,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1578
1615
|
let n;
|
|
1579
1616
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1580
1617
|
let r = n[0].charAt(0) === "!" ? 2 : 1;
|
|
1581
|
-
if (!this.options.pedantic &&
|
|
1582
|
-
let i = t[
|
|
1618
|
+
if (!this.options.pedantic && zi(e, n[1], r, this.rules)) return;
|
|
1619
|
+
let i = t[Pi((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
|
|
1583
1620
|
if (!i) {
|
|
1584
1621
|
let e = n[0].charAt(0);
|
|
1585
1622
|
return {
|
|
@@ -1588,7 +1625,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1588
1625
|
text: e
|
|
1589
1626
|
};
|
|
1590
1627
|
}
|
|
1591
|
-
return
|
|
1628
|
+
return Li(n, i, n[0], this.lexer, this.rules);
|
|
1592
1629
|
}
|
|
1593
1630
|
}
|
|
1594
1631
|
emStrong(e, t, n = "") {
|
|
@@ -1721,7 +1758,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1721
1758
|
return {
|
|
1722
1759
|
type: "text",
|
|
1723
1760
|
raw: t[0],
|
|
1724
|
-
text: e ? t[0] :
|
|
1761
|
+
text: e ? t[0] : ki(t[0]),
|
|
1725
1762
|
escaped: e
|
|
1726
1763
|
};
|
|
1727
1764
|
}
|
|
@@ -1733,7 +1770,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1733
1770
|
inlineQueue;
|
|
1734
1771
|
tokenizer;
|
|
1735
1772
|
constructor(e) {
|
|
1736
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1773
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || sr, this.options.tokenizer = this.options.tokenizer || new Bi(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1737
1774
|
inLink: !1,
|
|
1738
1775
|
inRawBlock: !1,
|
|
1739
1776
|
linkEmitted: !1,
|
|
@@ -1742,15 +1779,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1742
1779
|
};
|
|
1743
1780
|
let t = {
|
|
1744
1781
|
other: z,
|
|
1745
|
-
block:
|
|
1746
|
-
inline:
|
|
1782
|
+
block: Ti.normal,
|
|
1783
|
+
inline: Ei.normal
|
|
1747
1784
|
};
|
|
1748
|
-
this.options.pedantic ? (t.block =
|
|
1785
|
+
this.options.pedantic ? (t.block = Ti.pedantic, t.inline = Ei.pedantic) : this.options.gfm && (t.block = Ti.gfm, t.inline = this.options.breaks ? Ei.breaks : Ei.gfm), this.tokenizer.rules = t;
|
|
1749
1786
|
}
|
|
1750
1787
|
static get rules() {
|
|
1751
1788
|
return {
|
|
1752
|
-
block:
|
|
1753
|
-
inline:
|
|
1789
|
+
block: Ti,
|
|
1790
|
+
inline: Ei
|
|
1754
1791
|
};
|
|
1755
1792
|
}
|
|
1756
1793
|
static lex(t, n) {
|
|
@@ -1840,7 +1877,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1840
1877
|
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
|
|
1841
1878
|
for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
1842
1879
|
let e = t[0], n = e.lastIndexOf("[");
|
|
1843
|
-
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links,
|
|
1880
|
+
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Pi(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
|
|
1844
1881
|
}
|
|
1845
1882
|
return !1;
|
|
1846
1883
|
}
|
|
@@ -1859,7 +1896,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1859
1896
|
if (this.tokens.links && e.includes("[")) {
|
|
1860
1897
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
1861
1898
|
let r = n.lastIndexOf("[");
|
|
1862
|
-
if (!Object.hasOwn(this.tokens.links,
|
|
1899
|
+
if (!Object.hasOwn(this.tokens.links, Pi(n.slice(r + 1, -1)))) return n;
|
|
1863
1900
|
if (r > 1 && n.charAt(0) !== "!") {
|
|
1864
1901
|
let i = n.slice(1, r - 1);
|
|
1865
1902
|
if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
|
|
@@ -1919,11 +1956,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1919
1956
|
if (this.options.silent) console.error(t);
|
|
1920
1957
|
else throw Error(t);
|
|
1921
1958
|
}
|
|
1922
|
-
},
|
|
1959
|
+
}, Vi = class {
|
|
1923
1960
|
options;
|
|
1924
1961
|
parser;
|
|
1925
1962
|
constructor(e) {
|
|
1926
|
-
this.options = e ||
|
|
1963
|
+
this.options = e || sr;
|
|
1927
1964
|
}
|
|
1928
1965
|
space(e) {
|
|
1929
1966
|
return "";
|
|
@@ -2009,7 +2046,7 @@ ${e}</tr>
|
|
|
2009
2046
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
2010
2047
|
}
|
|
2011
2048
|
link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
|
|
2012
|
-
let a = i ? V(n, !0) : this.parser.parseInline(r), o =
|
|
2049
|
+
let a = i ? V(n, !0) : this.parser.parseInline(r), o = Ai(e);
|
|
2013
2050
|
if (o === null) return a;
|
|
2014
2051
|
e = V(o, i);
|
|
2015
2052
|
let s = "<a href=\"" + e + "\"";
|
|
@@ -2017,7 +2054,7 @@ ${e}</tr>
|
|
|
2017
2054
|
}
|
|
2018
2055
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
2019
2056
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
2020
|
-
let i =
|
|
2057
|
+
let i = Ai(e);
|
|
2021
2058
|
if (i === null) return V(n);
|
|
2022
2059
|
e = i;
|
|
2023
2060
|
let a = `<img src="${V(e)}" alt="${V(n)}"`;
|
|
@@ -2026,7 +2063,7 @@ ${e}</tr>
|
|
|
2026
2063
|
text(e) {
|
|
2027
2064
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
|
|
2028
2065
|
}
|
|
2029
|
-
},
|
|
2066
|
+
}, Hi = class {
|
|
2030
2067
|
strong({ text: e }) {
|
|
2031
2068
|
return e;
|
|
2032
2069
|
}
|
|
@@ -2062,7 +2099,7 @@ ${e}</tr>
|
|
|
2062
2099
|
renderer;
|
|
2063
2100
|
textRenderer;
|
|
2064
2101
|
constructor(e) {
|
|
2065
|
-
this.options = e ||
|
|
2102
|
+
this.options = e || sr, this.options.renderer = this.options.renderer || new Vi(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Hi();
|
|
2066
2103
|
}
|
|
2067
2104
|
static parse(t, n) {
|
|
2068
2105
|
return new e(n).parse(t);
|
|
@@ -2210,11 +2247,11 @@ ${e}</tr>
|
|
|
2210
2247
|
}
|
|
2211
2248
|
return n;
|
|
2212
2249
|
}
|
|
2213
|
-
},
|
|
2250
|
+
}, Ui = class {
|
|
2214
2251
|
options;
|
|
2215
2252
|
block;
|
|
2216
2253
|
constructor(e) {
|
|
2217
|
-
this.options = e ||
|
|
2254
|
+
this.options = e || sr;
|
|
2218
2255
|
}
|
|
2219
2256
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2220
2257
|
"preprocess",
|
|
@@ -2246,44 +2283,44 @@ ${e}</tr>
|
|
|
2246
2283
|
return e ? U.parse : U.parseInline;
|
|
2247
2284
|
}
|
|
2248
2285
|
};
|
|
2249
|
-
function
|
|
2286
|
+
function Wi(e, t) {
|
|
2250
2287
|
if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n]);
|
|
2251
2288
|
else e.push(t);
|
|
2252
2289
|
}
|
|
2253
|
-
var
|
|
2254
|
-
defaults =
|
|
2290
|
+
var Gi = new class {
|
|
2291
|
+
defaults = or();
|
|
2255
2292
|
options = this.setOptions;
|
|
2256
2293
|
parse = this.parseMarkdown(!0);
|
|
2257
2294
|
parseInline = this.parseMarkdown(!1);
|
|
2258
2295
|
Parser = U;
|
|
2259
|
-
Renderer =
|
|
2260
|
-
TextRenderer =
|
|
2296
|
+
Renderer = Vi;
|
|
2297
|
+
TextRenderer = Hi;
|
|
2261
2298
|
Lexer = H;
|
|
2262
|
-
Tokenizer =
|
|
2263
|
-
Hooks =
|
|
2299
|
+
Tokenizer = Bi;
|
|
2300
|
+
Hooks = Ui;
|
|
2264
2301
|
constructor(...e) {
|
|
2265
2302
|
this.use(...e);
|
|
2266
2303
|
}
|
|
2267
2304
|
walkTokens(e, t) {
|
|
2268
2305
|
let n = [];
|
|
2269
|
-
for (let r of e) switch (
|
|
2306
|
+
for (let r of e) switch (Wi(n, t.call(this, r)), r.type) {
|
|
2270
2307
|
case "table": {
|
|
2271
2308
|
let e = r;
|
|
2272
|
-
for (let r of e.header)
|
|
2273
|
-
for (let r of e.rows) for (let e of r)
|
|
2309
|
+
for (let r of e.header) Wi(n, this.walkTokens(r.tokens, t));
|
|
2310
|
+
for (let r of e.rows) for (let e of r) Wi(n, this.walkTokens(e.tokens, t));
|
|
2274
2311
|
break;
|
|
2275
2312
|
}
|
|
2276
2313
|
case "list": {
|
|
2277
2314
|
let e = r;
|
|
2278
|
-
|
|
2315
|
+
Wi(n, this.walkTokens(e.items, t));
|
|
2279
2316
|
break;
|
|
2280
2317
|
}
|
|
2281
2318
|
default: {
|
|
2282
2319
|
let e = r;
|
|
2283
2320
|
this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
|
|
2284
2321
|
let i = e[r].flat(1 / 0);
|
|
2285
|
-
|
|
2286
|
-
}) : e.tokens &&
|
|
2322
|
+
Wi(n, this.walkTokens(i, t));
|
|
2323
|
+
}) : e.tokens && Wi(n, this.walkTokens(e.tokens, t));
|
|
2287
2324
|
}
|
|
2288
2325
|
}
|
|
2289
2326
|
return n;
|
|
@@ -2311,7 +2348,7 @@ var Fi = new class {
|
|
|
2311
2348
|
}
|
|
2312
2349
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
2313
2350
|
}), n.extensions = t), e.renderer) {
|
|
2314
|
-
let t = this.defaults.renderer || new
|
|
2351
|
+
let t = this.defaults.renderer || new Vi(this.defaults);
|
|
2315
2352
|
for (let n in e.renderer) {
|
|
2316
2353
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
2317
2354
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -2324,7 +2361,7 @@ var Fi = new class {
|
|
|
2324
2361
|
n.renderer = t;
|
|
2325
2362
|
}
|
|
2326
2363
|
if (e.tokenizer) {
|
|
2327
|
-
let t = this.defaults.tokenizer || new
|
|
2364
|
+
let t = this.defaults.tokenizer || new Bi(this.defaults);
|
|
2328
2365
|
for (let n in e.tokenizer) {
|
|
2329
2366
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
2330
2367
|
if ([
|
|
@@ -2341,13 +2378,13 @@ var Fi = new class {
|
|
|
2341
2378
|
n.tokenizer = t;
|
|
2342
2379
|
}
|
|
2343
2380
|
if (e.hooks) {
|
|
2344
|
-
let t = this.defaults.hooks || new
|
|
2381
|
+
let t = this.defaults.hooks || new Ui();
|
|
2345
2382
|
for (let n in e.hooks) {
|
|
2346
2383
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
2347
2384
|
if (["options", "block"].includes(n)) continue;
|
|
2348
2385
|
let r = n, i = e.hooks[r], a = t[r];
|
|
2349
|
-
t[r] =
|
|
2350
|
-
if (this.defaults.async &&
|
|
2386
|
+
t[r] = Ui.passThroughHooks.has(n) ? (e) => {
|
|
2387
|
+
if (this.defaults.async && Ui.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2351
2388
|
let n = await i.call(t, e);
|
|
2352
2389
|
return a.call(t, n);
|
|
2353
2390
|
})();
|
|
@@ -2368,7 +2405,7 @@ var Fi = new class {
|
|
|
2368
2405
|
let t = this.defaults.walkTokens, r = e.walkTokens;
|
|
2369
2406
|
n.walkTokens = function(e) {
|
|
2370
2407
|
let n = [];
|
|
2371
|
-
return n.push(r.call(this, e)), t &&
|
|
2408
|
+
return n.push(r.call(this, e)), t && Wi(n, t.call(this, e)), n;
|
|
2372
2409
|
};
|
|
2373
2410
|
}
|
|
2374
2411
|
this.defaults = {
|
|
@@ -2427,31 +2464,31 @@ var Fi = new class {
|
|
|
2427
2464
|
}
|
|
2428
2465
|
}();
|
|
2429
2466
|
function W(e, t) {
|
|
2430
|
-
return
|
|
2467
|
+
return Gi.parse(e, t);
|
|
2431
2468
|
}
|
|
2432
2469
|
W.options = W.setOptions = function(e) {
|
|
2433
|
-
return
|
|
2434
|
-
}, W.getDefaults =
|
|
2435
|
-
function
|
|
2436
|
-
return
|
|
2437
|
-
}
|
|
2438
|
-
W.use =
|
|
2439
|
-
return
|
|
2440
|
-
}, W.parseInline =
|
|
2470
|
+
return Gi.setOptions(e), W.defaults = Gi.defaults, cr(W.defaults), W;
|
|
2471
|
+
}, W.getDefaults = or, W.defaults = sr;
|
|
2472
|
+
function Ki(...e) {
|
|
2473
|
+
return Gi.use(...e), W.defaults = Gi.defaults, cr(W.defaults), W;
|
|
2474
|
+
}
|
|
2475
|
+
W.use = Ki, W.walkTokens = function(e, t) {
|
|
2476
|
+
return Gi.walkTokens(e, t);
|
|
2477
|
+
}, W.parseInline = Gi.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Vi, W.TextRenderer = Hi, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Bi, W.Hooks = Ui, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
|
|
2441
2478
|
//#endregion
|
|
2442
2479
|
//#region ../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
|
|
2443
|
-
function
|
|
2480
|
+
function qi(e, t) {
|
|
2444
2481
|
this.v = e, this.k = t;
|
|
2445
2482
|
}
|
|
2446
|
-
function
|
|
2483
|
+
function Ji(e, t) {
|
|
2447
2484
|
(t == null || t > e.length) && (t = e.length);
|
|
2448
2485
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2449
2486
|
return r;
|
|
2450
2487
|
}
|
|
2451
|
-
function
|
|
2488
|
+
function Yi(e) {
|
|
2452
2489
|
if (Array.isArray(e)) return e;
|
|
2453
2490
|
}
|
|
2454
|
-
function
|
|
2491
|
+
function Xi(e, t) {
|
|
2455
2492
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2456
2493
|
if (n != null) {
|
|
2457
2494
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -2472,24 +2509,24 @@ function Bi(e, t) {
|
|
|
2472
2509
|
return s;
|
|
2473
2510
|
}
|
|
2474
2511
|
}
|
|
2475
|
-
function
|
|
2512
|
+
function Zi() {
|
|
2476
2513
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2477
2514
|
}
|
|
2478
|
-
function
|
|
2479
|
-
return
|
|
2515
|
+
function Qi(e, t) {
|
|
2516
|
+
return Yi(e) || Xi(e, t) || $i(e, t) || Zi();
|
|
2480
2517
|
}
|
|
2481
|
-
function
|
|
2518
|
+
function $i(e, t) {
|
|
2482
2519
|
if (e) {
|
|
2483
|
-
if (typeof e == "string") return
|
|
2520
|
+
if (typeof e == "string") return Ji(e, t);
|
|
2484
2521
|
var n = {}.toString.call(e).slice(8, -1);
|
|
2485
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
2522
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ji(e, t) : void 0;
|
|
2486
2523
|
}
|
|
2487
2524
|
}
|
|
2488
|
-
function
|
|
2525
|
+
function ea(e) {
|
|
2489
2526
|
var t, n;
|
|
2490
2527
|
function r(t, n) {
|
|
2491
2528
|
try {
|
|
2492
|
-
var a = e[t](n), o = a.value, s = o instanceof
|
|
2529
|
+
var a = e[t](n), o = a.value, s = o instanceof qi;
|
|
2493
2530
|
Promise.resolve(s ? o.v : o).then(function(n) {
|
|
2494
2531
|
if (s) {
|
|
2495
2532
|
var c = t === "return" && o.k ? t : "next";
|
|
@@ -2523,119 +2560,119 @@ function Wi(e) {
|
|
|
2523
2560
|
});
|
|
2524
2561
|
}, typeof e.return != "function" && (this.return = void 0);
|
|
2525
2562
|
}
|
|
2526
|
-
|
|
2563
|
+
ea.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
2527
2564
|
return this;
|
|
2528
|
-
},
|
|
2565
|
+
}, ea.prototype.next = function(e) {
|
|
2529
2566
|
return this._invoke("next", e);
|
|
2530
|
-
},
|
|
2567
|
+
}, ea.prototype.throw = function(e) {
|
|
2531
2568
|
return this._invoke("throw", e);
|
|
2532
|
-
},
|
|
2569
|
+
}, ea.prototype.return = function(e) {
|
|
2533
2570
|
return this._invoke("return", e);
|
|
2534
2571
|
};
|
|
2535
|
-
var
|
|
2572
|
+
var ta = Object.entries, na = Object.setPrototypeOf, ra = Object.isFrozen, ia = Object.getPrototypeOf, aa = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, oa = Object.create, sa = typeof Reflect < "u" && Reflect, ca = sa.apply, la = sa.construct;
|
|
2536
2573
|
G ||= function(e) {
|
|
2537
2574
|
return e;
|
|
2538
2575
|
}, K ||= function(e) {
|
|
2539
2576
|
return e;
|
|
2540
|
-
},
|
|
2577
|
+
}, ca ||= function(e, t) {
|
|
2541
2578
|
var n = [...arguments].slice(2);
|
|
2542
2579
|
return e.apply(t, n);
|
|
2543
|
-
},
|
|
2580
|
+
}, la ||= function(e) {
|
|
2544
2581
|
return new e(...[...arguments].slice(1));
|
|
2545
2582
|
};
|
|
2546
|
-
var
|
|
2583
|
+
var ua = Y(Array.prototype.forEach);
|
|
2547
2584
|
Array.prototype.indexOf;
|
|
2548
|
-
var
|
|
2585
|
+
var da = Y(Array.prototype.lastIndexOf), fa = Y(Array.prototype.pop), pa = Y(Array.prototype.push), ma = Y(Array.prototype.slice), ha = Y(Array.prototype.splice), ga = Array.isArray, _a = Ma(Set), va = Y(Set.prototype.add), ya = Y(Set.prototype.has), ba = Y(String.prototype.toLowerCase), xa = Y(String.prototype.toString), Sa = Y(String.prototype.match), Ca = Y(String.prototype.replace), wa = Y(String.prototype.indexOf), Ta = Y(String.prototype.trim), Ea = Y(Number.prototype.toString), Da = Y(Boolean.prototype.toString), Oa = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), ka = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), Aa = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), ja = Ma(TypeError);
|
|
2549
2586
|
function Y(e) {
|
|
2550
2587
|
return function(t) {
|
|
2551
2588
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
2552
2589
|
var n = [...arguments].slice(1);
|
|
2553
|
-
return
|
|
2590
|
+
return ca(e, t, n);
|
|
2554
2591
|
};
|
|
2555
2592
|
}
|
|
2556
|
-
function
|
|
2593
|
+
function Ma(e) {
|
|
2557
2594
|
return function() {
|
|
2558
|
-
return
|
|
2595
|
+
return la(e, [...arguments]);
|
|
2559
2596
|
};
|
|
2560
2597
|
}
|
|
2561
2598
|
function X(e, t) {
|
|
2562
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2563
|
-
if (
|
|
2599
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ba;
|
|
2600
|
+
if (na && na(e, null), !ga(t)) return e;
|
|
2564
2601
|
let r = t.length;
|
|
2565
2602
|
for (; r--;) {
|
|
2566
2603
|
let i = t[r];
|
|
2567
2604
|
if (typeof i == "string") {
|
|
2568
2605
|
let e = n(i);
|
|
2569
|
-
e !== i && (
|
|
2606
|
+
e !== i && (ra(t) || (t[r] = e), i = e);
|
|
2570
2607
|
}
|
|
2571
2608
|
e[i] = !0;
|
|
2572
2609
|
}
|
|
2573
2610
|
return e;
|
|
2574
2611
|
}
|
|
2575
|
-
function
|
|
2612
|
+
function Na(e) {
|
|
2576
2613
|
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
2577
2614
|
return e;
|
|
2578
2615
|
}
|
|
2579
2616
|
function Z(e) {
|
|
2580
|
-
let t =
|
|
2581
|
-
for (let r of
|
|
2582
|
-
var n =
|
|
2617
|
+
let t = oa(null);
|
|
2618
|
+
for (let r of ta(e)) {
|
|
2619
|
+
var n = Qi(r, 2);
|
|
2583
2620
|
let i = n[0], a = n[1];
|
|
2584
|
-
q(e, i) && (t[i] =
|
|
2621
|
+
q(e, i) && (t[i] = ga(a) ? Na(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
|
|
2585
2622
|
}
|
|
2586
2623
|
return t;
|
|
2587
2624
|
}
|
|
2588
|
-
function
|
|
2625
|
+
function Pa(e) {
|
|
2589
2626
|
switch (typeof e) {
|
|
2590
2627
|
case "string": return e;
|
|
2591
|
-
case "number": return
|
|
2592
|
-
case "boolean": return
|
|
2593
|
-
case "bigint": return
|
|
2594
|
-
case "symbol": return
|
|
2595
|
-
case "undefined": return
|
|
2628
|
+
case "number": return Ea(e);
|
|
2629
|
+
case "boolean": return Da(e);
|
|
2630
|
+
case "bigint": return Oa ? Oa(e) : "0";
|
|
2631
|
+
case "symbol": return ka ? ka(e) : "Symbol()";
|
|
2632
|
+
case "undefined": return Aa(e);
|
|
2596
2633
|
case "function":
|
|
2597
2634
|
case "object": {
|
|
2598
|
-
if (e === null) return
|
|
2635
|
+
if (e === null) return Aa(e);
|
|
2599
2636
|
let t = e, n = Q(t, "toString");
|
|
2600
2637
|
if (typeof n == "function") {
|
|
2601
2638
|
let e = n(t);
|
|
2602
|
-
return typeof e == "string" ? e :
|
|
2639
|
+
return typeof e == "string" ? e : Aa(e);
|
|
2603
2640
|
}
|
|
2604
|
-
return
|
|
2641
|
+
return Aa(e);
|
|
2605
2642
|
}
|
|
2606
|
-
default: return
|
|
2643
|
+
default: return Aa(e);
|
|
2607
2644
|
}
|
|
2608
2645
|
}
|
|
2609
2646
|
function Q(e, t) {
|
|
2610
2647
|
for (; e !== null;) {
|
|
2611
|
-
let n =
|
|
2648
|
+
let n = aa(e, t);
|
|
2612
2649
|
if (n) {
|
|
2613
2650
|
if (n.get) return Y(n.get);
|
|
2614
2651
|
if (typeof n.value == "function") return Y(n.value);
|
|
2615
2652
|
}
|
|
2616
|
-
e =
|
|
2653
|
+
e = ia(e);
|
|
2617
2654
|
}
|
|
2618
2655
|
function n() {
|
|
2619
2656
|
return null;
|
|
2620
2657
|
}
|
|
2621
2658
|
return n;
|
|
2622
2659
|
}
|
|
2623
|
-
function
|
|
2660
|
+
function Fa(e, t) {
|
|
2624
2661
|
for (; e !== null;) {
|
|
2625
|
-
let n =
|
|
2662
|
+
let n = aa(e, t);
|
|
2626
2663
|
if (n) return n.get ? Y(n.get) : null;
|
|
2627
|
-
e =
|
|
2664
|
+
e = ia(e);
|
|
2628
2665
|
}
|
|
2629
2666
|
return null;
|
|
2630
2667
|
}
|
|
2631
|
-
function
|
|
2668
|
+
function Ia(e) {
|
|
2632
2669
|
try {
|
|
2633
2670
|
return J(e, ""), !0;
|
|
2634
2671
|
} catch {
|
|
2635
2672
|
return !1;
|
|
2636
2673
|
}
|
|
2637
2674
|
}
|
|
2638
|
-
var
|
|
2675
|
+
var La = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Ra = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), za = G([
|
|
2639
2676
|
"feBlend",
|
|
2640
2677
|
"feColorMatrix",
|
|
2641
2678
|
"feComponentTransfer",
|
|
@@ -2661,7 +2698,7 @@ var Da = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2661
2698
|
"feSpotLight",
|
|
2662
2699
|
"feTile",
|
|
2663
2700
|
"feTurbulence"
|
|
2664
|
-
]),
|
|
2701
|
+
]), Ba = G([
|
|
2665
2702
|
"animate",
|
|
2666
2703
|
"color-profile",
|
|
2667
2704
|
"cursor",
|
|
@@ -2684,7 +2721,7 @@ var Da = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2684
2721
|
"solidcolor",
|
|
2685
2722
|
"unknown",
|
|
2686
2723
|
"use"
|
|
2687
|
-
]),
|
|
2724
|
+
]), Va = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Ha = G([
|
|
2688
2725
|
"maction",
|
|
2689
2726
|
"maligngroup",
|
|
2690
2727
|
"malignmark",
|
|
@@ -2700,13 +2737,13 @@ var Da = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2700
2737
|
"annotation-xml",
|
|
2701
2738
|
"mprescripts",
|
|
2702
2739
|
"none"
|
|
2703
|
-
]),
|
|
2740
|
+
]), Ua = G(["#text"]), Wa = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Ga = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Ka = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), qa = G([
|
|
2704
2741
|
"xlink:href",
|
|
2705
2742
|
"xml:id",
|
|
2706
2743
|
"xlink:title",
|
|
2707
2744
|
"xml:space",
|
|
2708
2745
|
"xmlns:xlink"
|
|
2709
|
-
]),
|
|
2746
|
+
]), Ja = K(/{{[\w\W]*|^[\w\W]*}}/g), Ya = K(/<%[\w\W]*|^[\w\W]*%>/g), Xa = K(/\${[\w\W]*/g), Za = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), Qa = K(/^aria-[\-\w]+$/), $a = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), eo = K(/^(?:\w+script|data):/i), to = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), no = K(/^html$/i), ro = K(/^[a-z][.\w]*(-[.\w]+)+$/i), io = K(/<[/\w!]/g), ao = K(/<[/\w]/g), oo = K(/<\/no(script|embed|frames)/i), so = K(/\/>/i), $ = {
|
|
2710
2747
|
element: 1,
|
|
2711
2748
|
attribute: 2,
|
|
2712
2749
|
text: 3,
|
|
@@ -2719,7 +2756,7 @@ var Da = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2719
2756
|
documentType: 10,
|
|
2720
2757
|
documentFragment: 11,
|
|
2721
2758
|
notation: 12
|
|
2722
|
-
},
|
|
2759
|
+
}, co = G(X({}, [
|
|
2723
2760
|
"style",
|
|
2724
2761
|
"script",
|
|
2725
2762
|
"xmp",
|
|
@@ -2728,9 +2765,9 @@ var Da = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2728
2765
|
"noframes",
|
|
2729
2766
|
"plaintext",
|
|
2730
2767
|
"noscript"
|
|
2731
|
-
])),
|
|
2768
|
+
])), lo = function() {
|
|
2732
2769
|
return typeof window > "u" ? null : window;
|
|
2733
|
-
},
|
|
2770
|
+
}, uo = function(e, t) {
|
|
2734
2771
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
2735
2772
|
let n = null, r = "data-tt-policy-suffix";
|
|
2736
2773
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -2747,7 +2784,7 @@ var Da = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2747
2784
|
} catch {
|
|
2748
2785
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2749
2786
|
}
|
|
2750
|
-
},
|
|
2787
|
+
}, fo = function() {
|
|
2751
2788
|
return {
|
|
2752
2789
|
afterSanitizeAttributes: [],
|
|
2753
2790
|
afterSanitizeElements: [],
|
|
@@ -2759,62 +2796,62 @@ var Da = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2759
2796
|
uponSanitizeElement: [],
|
|
2760
2797
|
uponSanitizeShadowNode: []
|
|
2761
2798
|
};
|
|
2762
|
-
},
|
|
2763
|
-
return q(e, t) &&
|
|
2764
|
-
},
|
|
2799
|
+
}, po = function(e, t, n, r) {
|
|
2800
|
+
return q(e, t) && ga(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
|
|
2801
|
+
}, mo = function(e, t, n) {
|
|
2765
2802
|
let r = q(e, t) ? e[t] : void 0;
|
|
2766
2803
|
return r && typeof r == "object" ? Z(r) : n();
|
|
2767
2804
|
};
|
|
2768
|
-
function
|
|
2769
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2805
|
+
function ho() {
|
|
2806
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : lo(), t = (e) => ho(e);
|
|
2770
2807
|
if (t.version = "3.4.17", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
|
|
2771
2808
|
let n = e.document, r = n, i = r.currentScript;
|
|
2772
2809
|
e.DocumentFragment;
|
|
2773
2810
|
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
|
|
2774
2811
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
2775
|
-
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), te = Q(d, "childNodes"), ne = Q(d, "parentNode"), re = Q(d, "shadowRoot"), ie = Q(d, "attributes"),
|
|
2776
|
-
return
|
|
2777
|
-
},
|
|
2778
|
-
return
|
|
2779
|
-
},
|
|
2780
|
-
return
|
|
2812
|
+
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), te = Q(d, "childNodes"), ne = Q(d, "parentNode"), re = Q(d, "shadowRoot"), ie = Q(d, "attributes"), h = o && o.prototype ? Q(o.prototype, "nodeType") : null, ae = o && o.prototype ? Q(o.prototype, "nodeName") : null, oe = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, g = function(e) {
|
|
2813
|
+
return h ? h(e) : e.nodeType;
|
|
2814
|
+
}, _ = function(e) {
|
|
2815
|
+
return ae ? ae(e) : e.nodeName;
|
|
2816
|
+
}, se = Fa(d, "namespaceURI"), ce = function(e) {
|
|
2817
|
+
return se ? se(e) : e.namespaceURI;
|
|
2781
2818
|
};
|
|
2782
2819
|
if (typeof a == "function") {
|
|
2783
2820
|
let e = n.createElement("template");
|
|
2784
2821
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
2785
2822
|
}
|
|
2786
|
-
let v, y = "", le, ue = !1,
|
|
2787
|
-
if (
|
|
2788
|
-
},
|
|
2789
|
-
|
|
2823
|
+
let v, y = "", le, ue = !1, b = 0, de = function() {
|
|
2824
|
+
if (b > 0) throw ja("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
|
|
2825
|
+
}, x = function(e) {
|
|
2826
|
+
de(), b++;
|
|
2790
2827
|
try {
|
|
2791
2828
|
return v.createHTML(e);
|
|
2792
2829
|
} finally {
|
|
2793
|
-
|
|
2830
|
+
b--;
|
|
2794
2831
|
}
|
|
2795
|
-
},
|
|
2796
|
-
|
|
2832
|
+
}, fe = function(e) {
|
|
2833
|
+
de(), b++;
|
|
2797
2834
|
try {
|
|
2798
2835
|
return v.createScriptURL(e);
|
|
2799
2836
|
} finally {
|
|
2800
|
-
|
|
2801
|
-
}
|
|
2802
|
-
},
|
|
2803
|
-
return ue ||= (le =
|
|
2804
|
-
},
|
|
2805
|
-
t.isSupported = typeof
|
|
2806
|
-
let
|
|
2807
|
-
...
|
|
2808
|
-
...
|
|
2809
|
-
...
|
|
2810
|
-
...
|
|
2811
|
-
...
|
|
2812
|
-
]),
|
|
2813
|
-
...
|
|
2814
|
-
...
|
|
2815
|
-
...
|
|
2816
|
-
...
|
|
2817
|
-
]),
|
|
2837
|
+
b--;
|
|
2838
|
+
}
|
|
2839
|
+
}, S = function() {
|
|
2840
|
+
return ue ||= (le = uo(u, i), !0), le;
|
|
2841
|
+
}, pe = n, me = pe.implementation, he = pe.createNodeIterator, ge = pe.createDocumentFragment, _e = pe.getElementsByTagName, ve = r.importNode, C = fo();
|
|
2842
|
+
t.isSupported = typeof ta == "function" && typeof ne == "function" && me && me.createHTMLDocument !== void 0;
|
|
2843
|
+
let ye = Ja, be = Ya, xe = Xa, Se = Za, Ce = Qa, we = eo, Te = to, Ee = ro, De = $a, w = null, Oe = X({}, [
|
|
2844
|
+
...La,
|
|
2845
|
+
...Ra,
|
|
2846
|
+
...za,
|
|
2847
|
+
...Va,
|
|
2848
|
+
...Ua
|
|
2849
|
+
]), T = null, ke = X({}, [
|
|
2850
|
+
...Wa,
|
|
2851
|
+
...Ga,
|
|
2852
|
+
...Ka,
|
|
2853
|
+
...qa
|
|
2854
|
+
]), E = Object.seal(oa(null, {
|
|
2818
2855
|
tagNameCheck: {
|
|
2819
2856
|
writable: !0,
|
|
2820
2857
|
configurable: !1,
|
|
@@ -2833,7 +2870,7 @@ function io() {
|
|
|
2833
2870
|
enumerable: !0,
|
|
2834
2871
|
value: !1
|
|
2835
2872
|
}
|
|
2836
|
-
})),
|
|
2873
|
+
})), Ae = null, je = null, Me = Object.seal(oa(null, {
|
|
2837
2874
|
tagCheck: {
|
|
2838
2875
|
writable: !0,
|
|
2839
2876
|
configurable: !1,
|
|
@@ -2846,14 +2883,14 @@ function io() {
|
|
|
2846
2883
|
enumerable: !0,
|
|
2847
2884
|
value: null
|
|
2848
2885
|
}
|
|
2849
|
-
})),
|
|
2886
|
+
})), Ne = !0, Pe = !0, Fe = !1, Ie = !0, Le = !1, D = !0, Re = !1, ze = !1, Be = null, O = null, Ve = !1, He = !1, Ue = !1, We = !1, Ge = !0, Ke = !1, qe = "user-content-", Je = !0, Ye = !1, Xe = null, Ze = {}, Qe = null, $e = X({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), et = null, tt = X({}, [
|
|
2850
2887
|
"audio",
|
|
2851
2888
|
"video",
|
|
2852
2889
|
"img",
|
|
2853
2890
|
"source",
|
|
2854
2891
|
"image",
|
|
2855
2892
|
"track"
|
|
2856
|
-
]),
|
|
2893
|
+
]), nt = null, rt = X({}, [
|
|
2857
2894
|
"alt",
|
|
2858
2895
|
"class",
|
|
2859
2896
|
"for",
|
|
@@ -2868,72 +2905,72 @@ function io() {
|
|
|
2868
2905
|
"value",
|
|
2869
2906
|
"style",
|
|
2870
2907
|
"xmlns"
|
|
2871
|
-
]),
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
],
|
|
2908
|
+
]), k = "http://www.w3.org/1998/Math/MathML", it = "http://www.w3.org/2000/svg", A = "http://www.w3.org/1999/xhtml", at = A, ot = !1, st = null, ct = X({}, [
|
|
2909
|
+
k,
|
|
2910
|
+
it,
|
|
2911
|
+
A
|
|
2912
|
+
], xa), lt = G([
|
|
2876
2913
|
"mi",
|
|
2877
2914
|
"mo",
|
|
2878
2915
|
"mn",
|
|
2879
2916
|
"ms",
|
|
2880
2917
|
"mtext"
|
|
2881
|
-
]),
|
|
2918
|
+
]), ut = X({}, lt), dt = G(["annotation-xml"]), ft = X({}, dt), pt = X({}, [
|
|
2882
2919
|
"title",
|
|
2883
2920
|
"style",
|
|
2884
2921
|
"font",
|
|
2885
2922
|
"a",
|
|
2886
2923
|
"script"
|
|
2887
|
-
]),
|
|
2924
|
+
]), mt = null, ht = ["application/xhtml+xml", "text/html"], j = null, gt = null, _t = n.createElement("form"), vt = function(e) {
|
|
2888
2925
|
return e instanceof RegExp || e instanceof Function;
|
|
2889
|
-
},
|
|
2926
|
+
}, M = function() {
|
|
2890
2927
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2891
|
-
if (
|
|
2892
|
-
(!e || typeof e != "object") && (e = {}), e = Z(e),
|
|
2893
|
-
transform:
|
|
2894
|
-
base: at
|
|
2895
|
-
}), nt = no(e, "ADD_DATA_URI_TAGS", rt, {
|
|
2896
|
-
transform: k,
|
|
2928
|
+
if (gt && gt === e) return;
|
|
2929
|
+
(!e || typeof e != "object") && (e = {}), e = Z(e), mt = ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, j = mt === "application/xhtml+xml" ? xa : ba, w = po(e, "ALLOWED_TAGS", Oe, { transform: j }), T = po(e, "ALLOWED_ATTR", ke, { transform: j }), st = po(e, "ALLOWED_NAMESPACES", ct, { transform: xa }), nt = po(e, "ADD_URI_SAFE_ATTR", rt, {
|
|
2930
|
+
transform: j,
|
|
2897
2931
|
base: rt
|
|
2898
|
-
}), et =
|
|
2899
|
-
|
|
2900
|
-
|
|
2932
|
+
}), et = po(e, "ADD_DATA_URI_TAGS", tt, {
|
|
2933
|
+
transform: j,
|
|
2934
|
+
base: tt
|
|
2935
|
+
}), Qe = po(e, "FORBID_CONTENTS", $e, { transform: j }), Ae = po(e, "FORBID_TAGS", Z({}), { transform: j }), je = po(e, "FORBID_ATTR", Z({}), { transform: j }), Ze = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Ne = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, Fe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ie = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Le = e.SAFE_FOR_TEMPLATES || !1, D = e.SAFE_FOR_XML !== !1, Re = e.WHOLE_DOCUMENT || !1, He = e.RETURN_DOM || !1, Ue = e.RETURN_DOM_FRAGMENT || !1, We = e.RETURN_TRUSTED_TYPE || !1, Ve = e.FORCE_BODY || !1, Ge = e.SANITIZE_DOM !== !1, Ke = e.SANITIZE_NAMED_PROPS || !1, Je = e.KEEP_CONTENT !== !1, Ye = e.IN_PLACE || !1, De = Ia(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : $a, at = typeof e.NAMESPACE == "string" ? e.NAMESPACE : A, ut = mo(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, lt)), ft = mo(e, "HTML_INTEGRATION_POINTS", () => X({}, dt));
|
|
2936
|
+
let t = mo(e, "CUSTOM_ELEMENT_HANDLING", () => oa(null));
|
|
2937
|
+
if (E = oa(null), q(t, "tagNameCheck") && vt(t.tagNameCheck) && (E.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && vt(t.attributeNameCheck) && (E.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(E), Le && (Pe = !1), Ue && (He = !0), Ze && (w = X({}, Ua), T = oa(null), Ze.html === !0 && (X(w, La), X(T, Wa)), Ze.svg === !0 && (X(w, Ra), X(T, Ga), X(T, qa)), Ze.svgFilters === !0 && (X(w, za), X(T, Ga), X(T, qa)), Ze.mathMl === !0 && (X(w, Va), X(T, Ka), X(T, qa))), Me.tagCheck = null, Me.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Me.tagCheck = e.ADD_TAGS : ga(e.ADD_TAGS) && (w === Oe && (w = Z(w)), X(w, e.ADD_TAGS, j))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Me.attributeCheck = e.ADD_ATTR : ga(e.ADD_ATTR) && (T === ke && (T = Z(T)), X(T, e.ADD_ATTR, j))), q(e, "ADD_FORBID_CONTENTS") && ga(e.ADD_FORBID_CONTENTS) && (Qe === $e && (Qe = Z(Qe)), X(Qe, e.ADD_FORBID_CONTENTS, j)), Je && (w["#text"] = !0), Re && X(w, [
|
|
2901
2938
|
"html",
|
|
2902
2939
|
"head",
|
|
2903
2940
|
"body"
|
|
2904
|
-
]),
|
|
2905
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2906
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2941
|
+
]), w.table && (X(w, ["tbody"]), delete Ae.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
2942
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw ja("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
2943
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw ja("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
2907
2944
|
let t = v;
|
|
2908
2945
|
v = e.TRUSTED_TYPES_POLICY;
|
|
2909
2946
|
try {
|
|
2910
|
-
y =
|
|
2947
|
+
y = x("");
|
|
2911
2948
|
} catch (e) {
|
|
2912
2949
|
throw v = t, e;
|
|
2913
2950
|
}
|
|
2914
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (v = void 0, y = "") : (v === void 0 && (v =
|
|
2915
|
-
G && G(e),
|
|
2916
|
-
},
|
|
2917
|
-
...
|
|
2918
|
-
...
|
|
2919
|
-
...
|
|
2920
|
-
]),
|
|
2921
|
-
return t.namespaceURI ===
|
|
2922
|
-
},
|
|
2923
|
-
return t.namespaceURI ===
|
|
2924
|
-
},
|
|
2925
|
-
return t.namespaceURI ===
|
|
2926
|
-
},
|
|
2927
|
-
let t =
|
|
2928
|
-
return r && g(r) === $.element ? (i = { namespaceURI:
|
|
2929
|
-
},
|
|
2930
|
-
|
|
2951
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (v = void 0, y = "") : (v === void 0 && (v = S()), v && typeof y == "string" && (y = x("")));
|
|
2952
|
+
G && G(e), gt = e;
|
|
2953
|
+
}, yt = X({}, [
|
|
2954
|
+
...Ra,
|
|
2955
|
+
...za,
|
|
2956
|
+
...Ba
|
|
2957
|
+
]), bt = X({}, [...Va, ...Ha]), xt = function(e, t, n) {
|
|
2958
|
+
return t.namespaceURI === A ? e === "svg" : t.namespaceURI === k ? e === "svg" && (n === "annotation-xml" || ut[n]) : !!yt[e];
|
|
2959
|
+
}, St = function(e, t, n) {
|
|
2960
|
+
return t.namespaceURI === A ? e === "math" : t.namespaceURI === it ? e === "math" && ft[n] : !!bt[e];
|
|
2961
|
+
}, Ct = function(e, t, n) {
|
|
2962
|
+
return t.namespaceURI === it && !ft[n] || t.namespaceURI === k && !ut[n] ? !1 : !bt[e] && (pt[e] || !yt[e]);
|
|
2963
|
+
}, wt = function(e) {
|
|
2964
|
+
let t = ce(e), n = ba(_(e)), r = ne(e), i, a;
|
|
2965
|
+
return r && g(r) === $.element ? (i = { namespaceURI: ce(r) }, a = ba(_(r))) : (i = { namespaceURI: at }, a = "template"), st[t] ? t === it ? xt(n, i, a) : t === k ? St(n, i, a) : t === A ? Ct(n, i, a) : !!(mt === "application/xhtml+xml" && st[t]) : !1;
|
|
2966
|
+
}, Tt = function(e) {
|
|
2967
|
+
pa(t.removed, { element: e });
|
|
2931
2968
|
try {
|
|
2932
2969
|
ne(e).removeChild(e);
|
|
2933
2970
|
} catch {
|
|
2934
|
-
if (p(e), !ne(e)) throw
|
|
2971
|
+
if (p(e), !ne(e)) throw ja("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2935
2972
|
}
|
|
2936
|
-
},
|
|
2973
|
+
}, Et = function(e, t, n) {
|
|
2937
2974
|
try {
|
|
2938
2975
|
ee(e, t);
|
|
2939
2976
|
} catch {
|
|
@@ -2941,10 +2978,10 @@ function io() {
|
|
|
2941
2978
|
e.removeAttribute(n);
|
|
2942
2979
|
} catch {}
|
|
2943
2980
|
}
|
|
2944
|
-
},
|
|
2945
|
-
|
|
2981
|
+
}, Dt = function(e) {
|
|
2982
|
+
jt(e);
|
|
2946
2983
|
let t = te(e);
|
|
2947
|
-
t &&
|
|
2984
|
+
t && ua(ma(t), (e) => {
|
|
2948
2985
|
try {
|
|
2949
2986
|
p(e);
|
|
2950
2987
|
} catch {}
|
|
@@ -2952,7 +2989,7 @@ function io() {
|
|
|
2952
2989
|
let n = g(e) === $.element ? ie(e) : null;
|
|
2953
2990
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
2954
2991
|
let r = n[t], i = r && r.name;
|
|
2955
|
-
typeof i == "string" &&
|
|
2992
|
+
typeof i == "string" && Et(e, r, i);
|
|
2956
2993
|
}
|
|
2957
2994
|
}, Ot = function(e, n, r) {
|
|
2958
2995
|
if (!r) try {
|
|
@@ -2960,7 +2997,7 @@ function io() {
|
|
|
2960
2997
|
} catch {
|
|
2961
2998
|
r = null;
|
|
2962
2999
|
}
|
|
2963
|
-
|
|
3000
|
+
pa(t.removed, {
|
|
2964
3001
|
attribute: r || null,
|
|
2965
3002
|
from: n
|
|
2966
3003
|
});
|
|
@@ -2972,8 +3009,8 @@ function io() {
|
|
|
2972
3009
|
} catch {}
|
|
2973
3010
|
}
|
|
2974
3011
|
if (e === "is") {
|
|
2975
|
-
if (
|
|
2976
|
-
|
|
3012
|
+
if (He || Ue) try {
|
|
3013
|
+
Tt(n);
|
|
2977
3014
|
} catch {}
|
|
2978
3015
|
else try {
|
|
2979
3016
|
n.setAttribute(e, "");
|
|
@@ -2983,144 +3020,144 @@ function io() {
|
|
|
2983
3020
|
let t = ie(e);
|
|
2984
3021
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
2985
3022
|
let r = t[n], i = r && r.name;
|
|
2986
|
-
typeof i != "string" ||
|
|
3023
|
+
typeof i != "string" || T[j(i)] || Et(e, r, i);
|
|
2987
3024
|
}
|
|
2988
|
-
},
|
|
3025
|
+
}, At = function(e, t) {
|
|
2989
3026
|
let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
|
|
2990
3027
|
for (; r.length > 0;) {
|
|
2991
3028
|
let e = r.pop();
|
|
2992
3029
|
if (t(e) === !1) continue;
|
|
2993
3030
|
if (n && g(e) === $.element) {
|
|
2994
3031
|
let t = re(e);
|
|
2995
|
-
|
|
3032
|
+
Wt(t) && r.push(t);
|
|
2996
3033
|
}
|
|
2997
3034
|
let i = te(e);
|
|
2998
3035
|
if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
|
|
2999
3036
|
}
|
|
3000
|
-
},
|
|
3001
|
-
|
|
3037
|
+
}, jt = function(e) {
|
|
3038
|
+
At(e, (e) => {
|
|
3002
3039
|
g(e) === $.element && kt(e);
|
|
3003
3040
|
});
|
|
3004
|
-
},
|
|
3041
|
+
}, Mt = function(e) {
|
|
3005
3042
|
let t = [];
|
|
3006
|
-
return
|
|
3043
|
+
return At(e, (e) => {
|
|
3007
3044
|
t.push(e);
|
|
3008
3045
|
}, !0), t;
|
|
3009
|
-
},
|
|
3010
|
-
let n =
|
|
3011
|
-
|
|
3012
|
-
g(e) === $.element &&
|
|
3013
|
-
}),
|
|
3014
|
-
g(e) === $.element && !
|
|
3046
|
+
}, Nt = function(e, t) {
|
|
3047
|
+
let n = _a();
|
|
3048
|
+
ua(Mt(e), (e) => {
|
|
3049
|
+
g(e) === $.element && va(n, e);
|
|
3050
|
+
}), ua(t, (e) => {
|
|
3051
|
+
g(e) === $.element && !ya(n, e) && kt(e);
|
|
3015
3052
|
});
|
|
3016
|
-
},
|
|
3053
|
+
}, Pt = function(e, n) {
|
|
3017
3054
|
let r = !1;
|
|
3018
|
-
return
|
|
3019
|
-
t.element && (r ||= t.element === e,
|
|
3020
|
-
}),
|
|
3021
|
-
},
|
|
3022
|
-
let n =
|
|
3023
|
-
|
|
3055
|
+
return ua(t.removed, (t) => {
|
|
3056
|
+
t.element && (r ||= t.element === e, jt(t.element));
|
|
3057
|
+
}), Nt(e, n), r;
|
|
3058
|
+
}, Ft = function(e, t) {
|
|
3059
|
+
let n = Xe, r = null, i = () => (r || (r = _a(), ua(t, (e) => {
|
|
3060
|
+
va(r, e);
|
|
3024
3061
|
})), r);
|
|
3025
3062
|
for (let t = 0;; t++) {
|
|
3026
|
-
let r =
|
|
3027
|
-
if (
|
|
3028
|
-
g(e) === $.documentFragment ?
|
|
3063
|
+
let r = Mt(e), a = [e], o = !1;
|
|
3064
|
+
if (ua(r, (e) => {
|
|
3065
|
+
g(e) === $.documentFragment ? pa(a, e) : !o && !ya(n, e) && (o = ya(i(), e));
|
|
3029
3066
|
}), !o) return;
|
|
3030
|
-
if (t >= 8) throw
|
|
3031
|
-
|
|
3032
|
-
|
|
3067
|
+
if (t >= 8) throw ja("the tree kept changing during in-place sanitization; refusing to return it");
|
|
3068
|
+
ua(a, (t, n) => {
|
|
3069
|
+
N(t, n > 0, e, i());
|
|
3033
3070
|
});
|
|
3034
3071
|
}
|
|
3035
|
-
},
|
|
3036
|
-
let i =
|
|
3037
|
-
for (; a = i.nextNode();)
|
|
3072
|
+
}, N = function(e, t, n, r) {
|
|
3073
|
+
let i = zt(e), a;
|
|
3074
|
+
for (; a = i.nextNode();) ya(r, a) && !ya(Xe, a) && (t && F(C.uponSanitizeShadowNode, a, null), Xt(a, n), rn(a, n), Wt(a.content) && an(a.content));
|
|
3038
3075
|
}, It = function(e) {
|
|
3039
|
-
|
|
3076
|
+
Xe && va(Xe, e);
|
|
3040
3077
|
}, Lt = function(e, t) {
|
|
3041
|
-
return
|
|
3078
|
+
return D ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
3042
3079
|
}, Rt = function(e) {
|
|
3043
|
-
|
|
3080
|
+
D && At(e, (e) => {
|
|
3044
3081
|
let t = g(e);
|
|
3045
|
-
if (t === $.processingInstruction || t === $.comment && J(
|
|
3082
|
+
if (t === $.processingInstruction || t === $.comment && J(ao, e.data)) {
|
|
3046
3083
|
try {
|
|
3047
3084
|
p(e);
|
|
3048
3085
|
} catch {}
|
|
3049
3086
|
return !1;
|
|
3050
3087
|
}
|
|
3051
3088
|
if (t === $.element) {
|
|
3052
|
-
let t = e, n =
|
|
3089
|
+
let t = e, n = j(_(e));
|
|
3053
3090
|
try {
|
|
3054
3091
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Lt("for", n) && t.removeAttribute("for");
|
|
3055
3092
|
} catch {}
|
|
3056
3093
|
}
|
|
3057
3094
|
return !0;
|
|
3058
3095
|
});
|
|
3059
|
-
},
|
|
3096
|
+
}, P = function(e) {
|
|
3060
3097
|
let t = null, r = null;
|
|
3061
|
-
if (
|
|
3098
|
+
if (Ve) e = "<remove></remove>" + e;
|
|
3062
3099
|
else {
|
|
3063
|
-
let t =
|
|
3100
|
+
let t = Sa(e, /^[\r\n\t ]+/);
|
|
3064
3101
|
r = t && t[0];
|
|
3065
3102
|
}
|
|
3066
|
-
|
|
3067
|
-
let i = v ?
|
|
3068
|
-
if (
|
|
3069
|
-
t = new l().parseFromString(i,
|
|
3103
|
+
mt === "application/xhtml+xml" && at === A && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
3104
|
+
let i = v ? x(e) : e;
|
|
3105
|
+
if (at === A) try {
|
|
3106
|
+
t = new l().parseFromString(i, mt);
|
|
3070
3107
|
} catch {}
|
|
3071
3108
|
if (!t || !t.documentElement) {
|
|
3072
|
-
t =
|
|
3109
|
+
t = me.createDocument(at, "template", null);
|
|
3073
3110
|
try {
|
|
3074
|
-
t.documentElement.innerHTML =
|
|
3111
|
+
t.documentElement.innerHTML = ot ? y : i;
|
|
3075
3112
|
} catch {}
|
|
3076
3113
|
}
|
|
3077
3114
|
let a = t.body || t.documentElement;
|
|
3078
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
3079
|
-
},
|
|
3115
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), at === A ? _e.call(t, Re ? "html" : "body")[0] : Re ? t.documentElement : a;
|
|
3116
|
+
}, zt = function(e) {
|
|
3080
3117
|
let t = oe ? oe(e) : e.ownerDocument;
|
|
3081
|
-
return
|
|
3118
|
+
return he.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
3119
|
+
}, Bt = function(e) {
|
|
3120
|
+
return e = Ca(e, ye, " "), e = Ca(e, be, " "), e = Ca(e, xe, " "), e;
|
|
3082
3121
|
}, Vt = function(e) {
|
|
3083
|
-
return e = pa(e, xe, " "), e = pa(e, Se, " "), e = pa(e, Ce, " "), e;
|
|
3084
|
-
}, P = function(e) {
|
|
3085
3122
|
Ht(e);
|
|
3086
3123
|
let t = e.querySelectorAll?.call(e, "template");
|
|
3087
|
-
t &&
|
|
3088
|
-
|
|
3124
|
+
t && ua(t, (e) => {
|
|
3125
|
+
Wt(e.content) && Vt(e.content);
|
|
3089
3126
|
});
|
|
3090
3127
|
}, Ht = function(e) {
|
|
3091
3128
|
e.normalize();
|
|
3092
|
-
let t = oe ? oe(e) : e.ownerDocument, n =
|
|
3093
|
-
for (; r;) r.data =
|
|
3129
|
+
let t = oe ? oe(e) : e.ownerDocument, n = he.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
3130
|
+
for (; r;) r.data = Bt(r.data), r = n.nextNode();
|
|
3094
3131
|
}, Ut = function(e) {
|
|
3095
|
-
let t =
|
|
3096
|
-
return typeof t != "string" ||
|
|
3097
|
-
},
|
|
3098
|
-
if (!
|
|
3132
|
+
let t = ae ? ae(e) : null;
|
|
3133
|
+
return typeof t != "string" || j(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ie(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== h(e) || e.childNodes !== te(e);
|
|
3134
|
+
}, Wt = function(e) {
|
|
3135
|
+
if (!h || typeof e != "object" || !e) return !1;
|
|
3099
3136
|
try {
|
|
3100
|
-
return
|
|
3137
|
+
return h(e) === $.documentFragment;
|
|
3101
3138
|
} catch {
|
|
3102
3139
|
return !1;
|
|
3103
3140
|
}
|
|
3104
|
-
},
|
|
3105
|
-
if (!
|
|
3141
|
+
}, Gt = function(e) {
|
|
3142
|
+
if (!h || typeof e != "object" || !e) return !1;
|
|
3106
3143
|
try {
|
|
3107
|
-
return typeof
|
|
3144
|
+
return typeof h(e) == "number";
|
|
3108
3145
|
} catch {
|
|
3109
3146
|
return !1;
|
|
3110
3147
|
}
|
|
3111
3148
|
};
|
|
3112
|
-
function
|
|
3113
|
-
e.length !== 0 &&
|
|
3114
|
-
e.call(t, n, r,
|
|
3149
|
+
function F(e, n, r) {
|
|
3150
|
+
e.length !== 0 && ua(e, (e) => {
|
|
3151
|
+
e.call(t, n, r, gt);
|
|
3115
3152
|
});
|
|
3116
3153
|
}
|
|
3117
|
-
let
|
|
3118
|
-
return !!(
|
|
3119
|
-
},
|
|
3154
|
+
let Kt = function(e, t) {
|
|
3155
|
+
return !!(D && e.hasChildNodes() && !Gt(e.firstElementChild) && J(io, e.textContent) && J(io, e.innerHTML) || D && co[t] && g(e) === $.element && ce(e) === A && (Gt(e.firstElementChild) || typeof e.textContent == "string" && J(io, e.textContent)) || e.nodeType === $.processingInstruction || D && e.nodeType === $.comment && J(ao, e.data));
|
|
3156
|
+
}, qt = function(e, t) {
|
|
3120
3157
|
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
3121
|
-
},
|
|
3122
|
-
if (!
|
|
3123
|
-
if (
|
|
3158
|
+
}, Jt = function(e, t, n) {
|
|
3159
|
+
if (!Ae[t] && $t(t) && qt(E.tagNameCheck, t)) return !1;
|
|
3160
|
+
if (Je && !Qe[t] && !Qe[ba(t)]) {
|
|
3124
3161
|
let t = ne(e), r = te(e);
|
|
3125
3162
|
if (r && t) {
|
|
3126
3163
|
let i = r.length;
|
|
@@ -3130,34 +3167,34 @@ function io() {
|
|
|
3130
3167
|
}
|
|
3131
3168
|
}
|
|
3132
3169
|
}
|
|
3133
|
-
return
|
|
3134
|
-
},
|
|
3170
|
+
return Tt(e), !0;
|
|
3171
|
+
}, Yt = function(e, t, n, r) {
|
|
3135
3172
|
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
3136
|
-
},
|
|
3137
|
-
return e === t || ne(e) !== null ? !1 : (
|
|
3173
|
+
}, I = function(e, t) {
|
|
3174
|
+
return e === t || ne(e) !== null ? !1 : (Ye && jt(e), !0);
|
|
3138
3175
|
}, Xt = function(e, n) {
|
|
3139
|
-
if (It(e),
|
|
3140
|
-
if (Ut(e)) return
|
|
3141
|
-
let r =
|
|
3142
|
-
if (
|
|
3176
|
+
if (It(e), F(C.beforeSanitizeElements, e, null), I(e, n)) return !0;
|
|
3177
|
+
if (Ut(e)) return Tt(e), !0;
|
|
3178
|
+
let r = j(_(e));
|
|
3179
|
+
if (w = Yt(C.uponSanitizeElement, w, Oe, Be), F(C.uponSanitizeElement, e, {
|
|
3143
3180
|
tagName: r,
|
|
3144
|
-
allowedTags:
|
|
3145
|
-
}),
|
|
3146
|
-
if (
|
|
3147
|
-
if (
|
|
3148
|
-
let t =
|
|
3149
|
-
return t === !1 && (
|
|
3150
|
-
}
|
|
3151
|
-
if (g(e) === $.element && !
|
|
3152
|
-
if (
|
|
3153
|
-
let n =
|
|
3154
|
-
e.textContent !== n && (
|
|
3155
|
-
}
|
|
3156
|
-
return
|
|
3181
|
+
allowedTags: w
|
|
3182
|
+
}), I(e, n)) return !0;
|
|
3183
|
+
if (Kt(e, r)) return Tt(e), !0;
|
|
3184
|
+
if (Ae[r] || !(Me.tagCheck instanceof Function && Me.tagCheck(r)) && !w[r]) {
|
|
3185
|
+
let t = Jt(e, r, n);
|
|
3186
|
+
return t === !1 && (F(C.afterSanitizeElements, e, null), I(e, n)) ? !0 : t;
|
|
3187
|
+
}
|
|
3188
|
+
if (g(e) === $.element && !wt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(oo, e.innerHTML)) return Tt(e), !0;
|
|
3189
|
+
if (Le && e.nodeType === $.text) {
|
|
3190
|
+
let n = Bt(e.textContent);
|
|
3191
|
+
e.textContent !== n && (pa(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
3192
|
+
}
|
|
3193
|
+
return F(C.afterSanitizeElements, e, null), I(e, n);
|
|
3157
3194
|
}, Zt = function(e, t, r) {
|
|
3158
|
-
if (
|
|
3159
|
-
let i =
|
|
3160
|
-
return
|
|
3195
|
+
if (je[t] || Lt(t, e) || Ge && (t === "id" || t === "name") && (r in n || r in _t)) return !1;
|
|
3196
|
+
let i = T[t] || Me.attributeCheck instanceof Function && Me.attributeCheck(t, e);
|
|
3197
|
+
return Pe && J(Se, t) || Ne && J(Ce, t) ? !0 : i ? nt[t] || J(De, Ca(r, Te, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && wa(r, "data:") === 0 && et[e] || Fe && !J(we, Ca(r, Te, "")) ? !0 : !r : $t(e) && qt(E.tagNameCheck, e) && qt(E.attributeNameCheck, t, e) || t === "is" && E.allowCustomizedBuiltInElements && qt(E.tagNameCheck, r);
|
|
3161
3198
|
}, Qt = X({}, [
|
|
3162
3199
|
"annotation-xml",
|
|
3163
3200
|
"color-profile",
|
|
@@ -3168,45 +3205,45 @@ function io() {
|
|
|
3168
3205
|
"font-face-uri",
|
|
3169
3206
|
"missing-glyph"
|
|
3170
3207
|
]), $t = function(e) {
|
|
3171
|
-
return !Qt[
|
|
3208
|
+
return !Qt[ba(e)] && J(Ee, e);
|
|
3172
3209
|
}, en = function(e, t, n, r) {
|
|
3173
3210
|
if (v && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
3174
|
-
case "TrustedHTML": return
|
|
3175
|
-
case "TrustedScriptURL": return
|
|
3211
|
+
case "TrustedHTML": return x(r);
|
|
3212
|
+
case "TrustedScriptURL": return fe(r);
|
|
3176
3213
|
}
|
|
3177
3214
|
return r;
|
|
3178
3215
|
}, tn = function(e, t, n, r) {
|
|
3179
3216
|
try {
|
|
3180
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !Ut(e) || (
|
|
3217
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !Ut(e) || (Tt(e), !1);
|
|
3181
3218
|
} catch {
|
|
3182
3219
|
return Ot(t, e), !1;
|
|
3183
3220
|
}
|
|
3184
3221
|
}, nn = function(e, t) {
|
|
3185
|
-
return
|
|
3222
|
+
return D && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : ba(e) === "attributename" && Sa(t, "href") !== null;
|
|
3186
3223
|
}, rn = function(e, n) {
|
|
3187
|
-
if (
|
|
3224
|
+
if (F(C.beforeSanitizeAttributes, e, null), I(e, n)) return;
|
|
3188
3225
|
let r = e.attributes;
|
|
3189
3226
|
if (!r || Ut(e)) return;
|
|
3190
|
-
|
|
3227
|
+
T = Yt(C.uponSanitizeAttribute, T, ke, O);
|
|
3191
3228
|
let i = {
|
|
3192
3229
|
attrName: "",
|
|
3193
3230
|
attrValue: "",
|
|
3194
3231
|
keepAttr: !0,
|
|
3195
|
-
allowedAttributes:
|
|
3232
|
+
allowedAttributes: T,
|
|
3196
3233
|
forceKeepAttr: void 0
|
|
3197
|
-
}, a = r.length, o =
|
|
3234
|
+
}, a = r.length, o = j(e.nodeName);
|
|
3198
3235
|
for (; a--;) {
|
|
3199
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u =
|
|
3200
|
-
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0,
|
|
3236
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = j(s), d = l, f = s === "value" ? d : Ta(d), p = !1;
|
|
3237
|
+
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, F(C.uponSanitizeAttribute, e, i), f = i.attrValue, Ke && (u === "id" || u === "name") && wa(f, qe) !== 0 && (Ot(s, e, n), f = qe + f, p = !0), nn(s, f) ? Ot(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Ie && J(so, f) ? Ot(s, e, n) : (Le && (f = Bt(f)), Zt(o, u, f) ? (f = en(o, u, c, f), f !== d && tn(e, s, c, f) && p && fa(t.removed)) : Ot(s, e, n)) : Ot(s, e, n));
|
|
3201
3238
|
}
|
|
3202
|
-
|
|
3239
|
+
F(C.afterSanitizeAttributes, e, null), I(e, n);
|
|
3203
3240
|
}, an = function(e) {
|
|
3204
|
-
let t = null, n =
|
|
3205
|
-
for (
|
|
3241
|
+
let t = null, n = zt(e);
|
|
3242
|
+
for (F(C.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (F(C.uponSanitizeShadowNode, t, null), Xt(t, e), rn(t, e), Wt(t.content) && an(t.content), g(t) === $.element) {
|
|
3206
3243
|
let e = re(t);
|
|
3207
|
-
|
|
3244
|
+
Wt(e) && (on(e), an(e));
|
|
3208
3245
|
}
|
|
3209
|
-
|
|
3246
|
+
Le && Ht(e), F(C.afterSanitizeShadowDOM, e, null);
|
|
3210
3247
|
}, on = function(e) {
|
|
3211
3248
|
let t = [{
|
|
3212
3249
|
node: e,
|
|
@@ -3224,10 +3261,10 @@ function io() {
|
|
|
3224
3261
|
shadow: null
|
|
3225
3262
|
});
|
|
3226
3263
|
if (r) {
|
|
3227
|
-
let e =
|
|
3228
|
-
if (typeof e == "string" &&
|
|
3264
|
+
let e = ae ? ae(n) : null;
|
|
3265
|
+
if (typeof e == "string" && j(e) === "template") {
|
|
3229
3266
|
let e = n.content;
|
|
3230
|
-
|
|
3267
|
+
Wt(e) && t.push({
|
|
3231
3268
|
node: e,
|
|
3232
3269
|
shadow: null
|
|
3233
3270
|
});
|
|
@@ -3235,7 +3272,7 @@ function io() {
|
|
|
3235
3272
|
}
|
|
3236
3273
|
if (r) {
|
|
3237
3274
|
let e = re(n);
|
|
3238
|
-
|
|
3275
|
+
Wt(e) && t.push({
|
|
3239
3276
|
node: null,
|
|
3240
3277
|
shadow: e
|
|
3241
3278
|
}, {
|
|
@@ -3247,82 +3284,82 @@ function io() {
|
|
|
3247
3284
|
};
|
|
3248
3285
|
return t.sanitize = function(e) {
|
|
3249
3286
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3250
|
-
if (
|
|
3287
|
+
if (ot = !e, ot && (e = "<!-->"), typeof e != "string" && !Gt(e) && (e = Pa(e), typeof e != "string")) throw ja("dirty is not a string, aborting");
|
|
3251
3288
|
if (!t.isSupported) return e;
|
|
3252
|
-
|
|
3253
|
-
let c =
|
|
3289
|
+
ze ? (w = Be, T = O) : M(n), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (w = Z(w)), C.uponSanitizeAttribute.length > 0 && (T = Z(T)), t.removed = [];
|
|
3290
|
+
let c = Ye && typeof e != "string" && Gt(e), l = [], u = Xe;
|
|
3254
3291
|
if (c) {
|
|
3255
3292
|
Rt(e);
|
|
3256
|
-
let t =
|
|
3293
|
+
let t = _(e);
|
|
3257
3294
|
if (typeof t == "string") {
|
|
3258
|
-
let n =
|
|
3259
|
-
if (!
|
|
3295
|
+
let n = j(t);
|
|
3296
|
+
if (!w[n] || Ae[n]) throw Dt(e), ja("root node is forbidden and cannot be sanitized in-place");
|
|
3260
3297
|
}
|
|
3261
|
-
if (Ut(e)) throw
|
|
3262
|
-
l =
|
|
3263
|
-
} else if (
|
|
3298
|
+
if (Ut(e)) throw Dt(e), ja("root node is clobbered and cannot be sanitized in-place");
|
|
3299
|
+
l = Mt(e), Xe = _a();
|
|
3300
|
+
} else if (Gt(e)) i = P("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), on(i);
|
|
3264
3301
|
else {
|
|
3265
|
-
if (!
|
|
3266
|
-
if (i =
|
|
3302
|
+
if (!He && !Le && !Re && e.indexOf("<") === -1) return v && We ? x(e) : e;
|
|
3303
|
+
if (i = P(e), !i) return He ? null : We ? y : "";
|
|
3267
3304
|
}
|
|
3268
|
-
i &&
|
|
3305
|
+
i && Ve && Tt(i.firstChild);
|
|
3269
3306
|
let d = c ? e : i;
|
|
3270
3307
|
try {
|
|
3271
3308
|
c && on(e);
|
|
3272
|
-
let t =
|
|
3273
|
-
for (; o = t.nextNode();) Xt(o, d), rn(o, d),
|
|
3274
|
-
c &&
|
|
3309
|
+
let t = zt(d);
|
|
3310
|
+
for (; o = t.nextNode();) Xt(o, d), rn(o, d), Wt(o.content) && an(o.content);
|
|
3311
|
+
c && Ft(e, l);
|
|
3275
3312
|
} catch (t) {
|
|
3276
|
-
throw c && (
|
|
3313
|
+
throw c && (Dt(e), Pt(e, l)), t;
|
|
3277
3314
|
} finally {
|
|
3278
|
-
|
|
3315
|
+
Xe = u;
|
|
3279
3316
|
}
|
|
3280
3317
|
if (c) {
|
|
3281
|
-
if (
|
|
3282
|
-
return
|
|
3318
|
+
if (Pt(e, l)) throw ja("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
3319
|
+
return Le && Vt(e), e;
|
|
3283
3320
|
}
|
|
3284
|
-
if (
|
|
3285
|
-
if (
|
|
3321
|
+
if (He) {
|
|
3322
|
+
if (Le && Vt(i), Ue) for (s = ge.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3286
3323
|
else s = i;
|
|
3287
|
-
return (
|
|
3324
|
+
return (T.shadowroot || T.shadowrootmode) && (s = ve.call(r, s, !0)), s;
|
|
3288
3325
|
}
|
|
3289
|
-
let f =
|
|
3290
|
-
return
|
|
3326
|
+
let f = Re ? i.outerHTML : i.innerHTML;
|
|
3327
|
+
return Re && w["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(no, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), Le && (f = Bt(f)), v && We ? x(f) : f;
|
|
3291
3328
|
}, t.setConfig = function() {
|
|
3292
3329
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3293
|
-
|
|
3330
|
+
M(e), ze = !0, Be = w, O = T;
|
|
3294
3331
|
}, t.clearConfig = function() {
|
|
3295
|
-
|
|
3332
|
+
gt = null, ze = !1, Be = null, O = null, v = le, y = "";
|
|
3296
3333
|
}, t.isValidAttribute = function(e, t, n) {
|
|
3297
|
-
|
|
3298
|
-
let r =
|
|
3299
|
-
return typeof n == "string" && (nn(t, n) || !
|
|
3334
|
+
gt || M({});
|
|
3335
|
+
let r = j(e), i = j(t);
|
|
3336
|
+
return typeof n == "string" && (nn(t, n) || !Ie && J(so, n)) ? !1 : Zt(r, i, n);
|
|
3300
3337
|
}, t.addHook = function(e, t) {
|
|
3301
|
-
typeof t == "function" && q(
|
|
3338
|
+
typeof t == "function" && q(C, e) && pa(C[e], t);
|
|
3302
3339
|
}, t.removeHook = function(e, t) {
|
|
3303
|
-
if (q(
|
|
3340
|
+
if (q(C, e)) {
|
|
3304
3341
|
if (t !== void 0) {
|
|
3305
|
-
let n =
|
|
3306
|
-
return n === -1 ? void 0 :
|
|
3342
|
+
let n = da(C[e], t);
|
|
3343
|
+
return n === -1 ? void 0 : ha(C[e], n, 1)[0];
|
|
3307
3344
|
}
|
|
3308
|
-
return
|
|
3345
|
+
return fa(C[e]);
|
|
3309
3346
|
}
|
|
3310
3347
|
}, t.removeHooks = function(e) {
|
|
3311
|
-
q(
|
|
3348
|
+
q(C, e) && (C[e] = []);
|
|
3312
3349
|
}, t.removeAllHooks = function() {
|
|
3313
|
-
|
|
3350
|
+
C = fo();
|
|
3314
3351
|
}, t;
|
|
3315
3352
|
}
|
|
3316
|
-
var
|
|
3353
|
+
var go = ho();
|
|
3317
3354
|
//#endregion
|
|
3318
3355
|
//#region ../../packages/components/src/chat/markdownHtml.ts
|
|
3319
|
-
function
|
|
3356
|
+
function _o(e) {
|
|
3320
3357
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3321
3358
|
}
|
|
3322
|
-
function
|
|
3359
|
+
function vo(e, t) {
|
|
3323
3360
|
return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
|
|
3324
3361
|
}
|
|
3325
|
-
var
|
|
3362
|
+
var yo = {
|
|
3326
3363
|
ADD_ATTR: ["target"],
|
|
3327
3364
|
ALLOW_UNKNOWN_PROTOCOLS: !0,
|
|
3328
3365
|
FORBID_TAGS: [
|
|
@@ -3343,21 +3380,21 @@ var co = {
|
|
|
3343
3380
|
"background"
|
|
3344
3381
|
]
|
|
3345
3382
|
};
|
|
3346
|
-
|
|
3383
|
+
go.addHook("uponSanitizeAttribute", (e, t) => {
|
|
3347
3384
|
t.attrName === "src" && e.nodeName !== "IMG" && (t.keepAttr = !1);
|
|
3348
3385
|
});
|
|
3349
|
-
var
|
|
3350
|
-
function
|
|
3351
|
-
if (!t) return
|
|
3352
|
-
let n =
|
|
3353
|
-
...
|
|
3386
|
+
var bo = "data-held-src";
|
|
3387
|
+
function xo(e, t) {
|
|
3388
|
+
if (!t) return go.sanitize(e, yo);
|
|
3389
|
+
let n = go.sanitize(e, {
|
|
3390
|
+
...yo,
|
|
3354
3391
|
RETURN_DOM_FRAGMENT: !0
|
|
3355
3392
|
});
|
|
3356
3393
|
for (let e of Array.from(n.querySelectorAll("img"))) {
|
|
3357
3394
|
let n = e.getAttribute("src") ?? "";
|
|
3358
3395
|
if (t.canLoad(n)) continue;
|
|
3359
3396
|
let r = e.ownerDocument.createElement("button");
|
|
3360
|
-
r.type = "button", r.className = "markdown-held-image", r.setAttribute(
|
|
3397
|
+
r.type = "button", r.className = "markdown-held-image", r.setAttribute(bo, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
|
|
3361
3398
|
}
|
|
3362
3399
|
let r = n.ownerDocument.createElement("div");
|
|
3363
3400
|
return r.append(n), r.innerHTML;
|
|
@@ -3365,7 +3402,7 @@ function uo(e, t) {
|
|
|
3365
3402
|
//#endregion
|
|
3366
3403
|
//#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
|
|
3367
3404
|
a(), c();
|
|
3368
|
-
var
|
|
3405
|
+
var So = ["innerHTML"], Co = 100, wo = /*#__PURE__*/ _(/* @__PURE__ */ e({
|
|
3369
3406
|
__name: "PkStreamingMarkdown",
|
|
3370
3407
|
props: {
|
|
3371
3408
|
markdown: {
|
|
@@ -3395,14 +3432,14 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3395
3432
|
},
|
|
3396
3433
|
setup(e) {
|
|
3397
3434
|
let a = e, { t: c } = f({ useScope: "global" }), m = null;
|
|
3398
|
-
function
|
|
3435
|
+
function te() {
|
|
3399
3436
|
return m ||= import("./dist-BK6ru3gS.js"), m;
|
|
3400
3437
|
}
|
|
3401
|
-
let
|
|
3402
|
-
function
|
|
3403
|
-
return
|
|
3438
|
+
let ne = null;
|
|
3439
|
+
function re() {
|
|
3440
|
+
return ne ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), ne;
|
|
3404
3441
|
}
|
|
3405
|
-
let
|
|
3442
|
+
let ie = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, h = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
3406
3443
|
W.use({ extensions: [{
|
|
3407
3444
|
name: "inlineKatex",
|
|
3408
3445
|
level: "inline",
|
|
@@ -3411,7 +3448,7 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3411
3448
|
if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
|
|
3412
3449
|
},
|
|
3413
3450
|
tokenizer(e) {
|
|
3414
|
-
let t = e.match(
|
|
3451
|
+
let t = e.match(ie);
|
|
3415
3452
|
if (t) return {
|
|
3416
3453
|
type: "inlineKatex",
|
|
3417
3454
|
raw: t[0],
|
|
@@ -3420,13 +3457,13 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3420
3457
|
};
|
|
3421
3458
|
},
|
|
3422
3459
|
renderer(e) {
|
|
3423
|
-
return
|
|
3460
|
+
return vo(e.text, e.displayMode);
|
|
3424
3461
|
}
|
|
3425
3462
|
}, {
|
|
3426
3463
|
name: "blockKatex",
|
|
3427
3464
|
level: "block",
|
|
3428
3465
|
tokenizer(e) {
|
|
3429
|
-
let t = e.match(
|
|
3466
|
+
let t = e.match(h);
|
|
3430
3467
|
if (t) return {
|
|
3431
3468
|
type: "blockKatex",
|
|
3432
3469
|
raw: t[0],
|
|
@@ -3435,7 +3472,7 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3435
3472
|
};
|
|
3436
3473
|
},
|
|
3437
3474
|
renderer(e) {
|
|
3438
|
-
return
|
|
3475
|
+
return vo(e.text, e.displayMode) + "\n";
|
|
3439
3476
|
}
|
|
3440
3477
|
}] }), W.use({ extensions: [{
|
|
3441
3478
|
name: "thinking",
|
|
@@ -3456,30 +3493,30 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3456
3493
|
return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
|
|
3457
3494
|
}
|
|
3458
3495
|
}] });
|
|
3459
|
-
let _ = new W.Renderer(),
|
|
3496
|
+
let _ = new W.Renderer(), ce = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), v = /^(?:javascript|data|vbscript|file):/i, y = !1, ue = (e) => ce(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
|
|
3460
3497
|
_.link = function({ href: e, title: t, text: n, tokens: r }) {
|
|
3461
3498
|
let i = this.parser.parseInline(r), a = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
|
|
3462
|
-
if (!a ||
|
|
3463
|
-
let o =
|
|
3464
|
-
return `<a href="${
|
|
3499
|
+
if (!a || v.test(a)) return i;
|
|
3500
|
+
let o = y && n === a, s = t || (o ? a : ""), c = s ? ` title="${ce(s)}"` : "", l = ae(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
|
|
3501
|
+
return `<a href="${ce(a)}"${c}${l}>${o ? ue(a) : i}</a>`;
|
|
3465
3502
|
}, _.table = function(e) {
|
|
3466
|
-
|
|
3503
|
+
y = !0;
|
|
3467
3504
|
try {
|
|
3468
|
-
let t = e.header.map((e) =>
|
|
3505
|
+
let t = e.header.map((e) => ce(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
|
|
3469
3506
|
let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
|
|
3470
3507
|
return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
|
|
3471
3508
|
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
|
|
3472
3509
|
return `<div class="table-wrapper u-table-scroll"><table class="${e.header.length >= 3 && e.rows.length ? "u-table u-table--stack" : "u-table"}" role="table"><thead role="rowgroup">${n(e.header)}</thead>${r}</table></div>\n`;
|
|
3473
3510
|
} finally {
|
|
3474
|
-
|
|
3511
|
+
y = !1;
|
|
3475
3512
|
}
|
|
3476
3513
|
};
|
|
3477
|
-
let
|
|
3478
|
-
_.code = ({ text: e }) =>
|
|
3479
|
-
function
|
|
3514
|
+
let b = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
|
|
3515
|
+
_.code = ({ text: e }) => b.test(e) ? `<pre class="mermaid">${_o(e)}</pre>` : `<pre><code>${_o(e)}</code></pre>`;
|
|
3516
|
+
function de(e) {
|
|
3480
3517
|
return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
|
|
3481
3518
|
}
|
|
3482
|
-
function
|
|
3519
|
+
function x(e) {
|
|
3483
3520
|
let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
|
|
3484
3521
|
for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
|
|
3485
3522
|
return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
|
|
@@ -3491,33 +3528,33 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3491
3528
|
}
|
|
3492
3529
|
}).replace(/\n{3,}/g, "\n\n");
|
|
3493
3530
|
}
|
|
3494
|
-
let
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
],
|
|
3500
|
-
let e =
|
|
3501
|
-
return
|
|
3531
|
+
let fe = [
|
|
3532
|
+
le,
|
|
3533
|
+
x,
|
|
3534
|
+
ar,
|
|
3535
|
+
de
|
|
3536
|
+
], S = n("container"), pe = oe(d(a, "markdown"), Co), me = l(() => a.tailLength ? we(pe.value, a.tailLength) : pe.value), { resolveText: he } = g(), ge = he(me), _e = se(), ve = l(() => {
|
|
3537
|
+
let e = fe.reduce((e, t) => t(e), ge.value);
|
|
3538
|
+
return xo(W.parse(e, {
|
|
3502
3539
|
async: !1,
|
|
3503
3540
|
breaks: !0,
|
|
3504
3541
|
renderer: _
|
|
3505
|
-
}),
|
|
3506
|
-
canLoad:
|
|
3507
|
-
hostOf:
|
|
3542
|
+
}), _e.isGated.value ? {
|
|
3543
|
+
canLoad: _e.canLoad,
|
|
3544
|
+
hostOf: _e.hostOf,
|
|
3508
3545
|
label: (e) => c("label.imageHeld", { host: e })
|
|
3509
3546
|
} : void 0);
|
|
3510
3547
|
});
|
|
3511
|
-
function
|
|
3512
|
-
let t = (e.target?.closest?.(`[${
|
|
3513
|
-
t && (e.preventDefault(), e.stopPropagation(),
|
|
3548
|
+
function C(e) {
|
|
3549
|
+
let t = (e.target?.closest?.(`[${bo}]`))?.getAttribute(bo);
|
|
3550
|
+
t && (e.preventDefault(), e.stopPropagation(), _e.release(t));
|
|
3514
3551
|
}
|
|
3515
|
-
async function
|
|
3552
|
+
async function ye() {
|
|
3516
3553
|
if (a.loading) return;
|
|
3517
3554
|
await i();
|
|
3518
|
-
let e =
|
|
3555
|
+
let e = S.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
|
|
3519
3556
|
if (!e?.length) return;
|
|
3520
|
-
let { renderMermaidSVG: t, THEMES: n } = await
|
|
3557
|
+
let { renderMermaidSVG: t, THEMES: n } = await te(), r = a.isDark ? n["github-dark"] : n["github-light"];
|
|
3521
3558
|
for (let n of Array.from(e)) {
|
|
3522
3559
|
if (!n.isConnected) continue;
|
|
3523
3560
|
let e = n.textContent?.trim();
|
|
@@ -3527,19 +3564,19 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3527
3564
|
} catch {}
|
|
3528
3565
|
}
|
|
3529
3566
|
}
|
|
3530
|
-
async function
|
|
3567
|
+
async function be() {
|
|
3531
3568
|
await i();
|
|
3532
|
-
let e =
|
|
3569
|
+
let e = S.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
|
|
3533
3570
|
if (!e?.length) return;
|
|
3534
3571
|
let t = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
|
|
3535
3572
|
for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
|
|
3536
3573
|
}
|
|
3537
|
-
async function
|
|
3574
|
+
async function xe() {
|
|
3538
3575
|
await i();
|
|
3539
|
-
let e =
|
|
3576
|
+
let e = S.value?.querySelectorAll(".katex-pending");
|
|
3540
3577
|
if (!e?.length) return;
|
|
3541
|
-
let t = await
|
|
3542
|
-
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(
|
|
3578
|
+
let t = await re();
|
|
3579
|
+
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(S.value));
|
|
3543
3580
|
for (let n of Array.from(e)) {
|
|
3544
3581
|
if (!n.isConnected) continue;
|
|
3545
3582
|
let e = n.dataset.katex;
|
|
@@ -3553,11 +3590,11 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3553
3590
|
} catch {}
|
|
3554
3591
|
}
|
|
3555
3592
|
}
|
|
3556
|
-
async function
|
|
3593
|
+
async function Se() {
|
|
3557
3594
|
await i();
|
|
3558
|
-
let e =
|
|
3595
|
+
let e = S.value?.querySelectorAll("pre.mermaid[data-rendered]");
|
|
3559
3596
|
if (!e?.length) return;
|
|
3560
|
-
let { renderMermaidSVG: t, THEMES: n } = await
|
|
3597
|
+
let { renderMermaidSVG: t, THEMES: n } = await te(), r = a.isDark ? n["github-dark"] : n["github-light"];
|
|
3561
3598
|
for (let n of Array.from(e)) {
|
|
3562
3599
|
if (!n.isConnected) continue;
|
|
3563
3600
|
let e = n.dataset.code;
|
|
@@ -3566,7 +3603,7 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3566
3603
|
} catch {}
|
|
3567
3604
|
}
|
|
3568
3605
|
}
|
|
3569
|
-
function
|
|
3606
|
+
function Ce(e) {
|
|
3570
3607
|
let t = e.target;
|
|
3571
3608
|
if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
|
|
3572
3609
|
t.dataset.broken = "true";
|
|
@@ -3574,60 +3611,60 @@ var fo = ["innerHTML"], po = 100, mo = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
|
3574
3611
|
n.className = "markdown-broken-image", n.textContent = t.alt || c("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
|
|
3575
3612
|
}
|
|
3576
3613
|
t(() => {
|
|
3577
|
-
|
|
3614
|
+
S.value?.addEventListener("error", Ce, !0);
|
|
3578
3615
|
}), o(() => {
|
|
3579
|
-
|
|
3580
|
-
}), s([
|
|
3581
|
-
let
|
|
3582
|
-
function
|
|
3616
|
+
S.value?.removeEventListener("error", Ce, !0);
|
|
3617
|
+
}), s([ve, () => a.loading], ye, { immediate: !0 }), s(() => a.isDark, Se), s(ve, be, { immediate: !0 }), s(ve, xe, { immediate: !0 });
|
|
3618
|
+
let Te = 0;
|
|
3619
|
+
function Ee(e, t) {
|
|
3583
3620
|
let n = document.createElement("span");
|
|
3584
3621
|
return n.style.cssText = `animation:ft-${a.animation} ${a.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
|
|
3585
3622
|
let t = n.parentNode;
|
|
3586
3623
|
t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
|
|
3587
3624
|
}, { once: !0 }), n;
|
|
3588
3625
|
}
|
|
3589
|
-
function
|
|
3626
|
+
function De(e, t, n, r) {
|
|
3590
3627
|
let i = r, a = e.split(/(\s+)/);
|
|
3591
|
-
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(
|
|
3628
|
+
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(Ee(e, i * 30), n), i++));
|
|
3592
3629
|
return i;
|
|
3593
3630
|
}
|
|
3594
|
-
function
|
|
3631
|
+
function w(e) {
|
|
3595
3632
|
let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
|
|
3596
3633
|
return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
3597
3634
|
} }), n = [];
|
|
3598
3635
|
for (; t.nextNode();) n.push(t.currentNode);
|
|
3599
3636
|
return n;
|
|
3600
3637
|
}
|
|
3601
|
-
function
|
|
3602
|
-
if (!
|
|
3603
|
-
let e = S
|
|
3638
|
+
function Oe() {
|
|
3639
|
+
if (!S.value || !a.loading || !a.animation) return;
|
|
3640
|
+
let e = w(S.value), t = 0, n = 0;
|
|
3604
3641
|
for (let r of e) {
|
|
3605
3642
|
let e = r.textContent || "", i = t, a = t + e.length;
|
|
3606
|
-
if (t = a, a <=
|
|
3643
|
+
if (t = a, a <= Te) continue;
|
|
3607
3644
|
let o = r.parentNode;
|
|
3608
3645
|
if (!o) continue;
|
|
3609
|
-
if (i >=
|
|
3646
|
+
if (i >= Te) {
|
|
3610
3647
|
let t = r.nextSibling;
|
|
3611
|
-
o.removeChild(r), n =
|
|
3648
|
+
o.removeChild(r), n = De(e, o, t, n);
|
|
3612
3649
|
continue;
|
|
3613
3650
|
}
|
|
3614
|
-
let s =
|
|
3615
|
-
o.removeChild(c), n =
|
|
3651
|
+
let s = Te - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
|
|
3652
|
+
o.removeChild(c), n = De(l, o, u, n);
|
|
3616
3653
|
}
|
|
3617
|
-
|
|
3654
|
+
Te = t;
|
|
3618
3655
|
}
|
|
3619
|
-
return s(
|
|
3620
|
-
await i(),
|
|
3656
|
+
return s(ve, async () => {
|
|
3657
|
+
await i(), Oe();
|
|
3621
3658
|
}, { immediate: !0 }), s(() => a.markdown, (e, t) => {
|
|
3622
|
-
(!e || t && e.length < t.length) && (
|
|
3659
|
+
(!e || t && e.length < t.length) && (Te = 0);
|
|
3623
3660
|
}), (e, t) => (r(), u("div", {
|
|
3624
3661
|
ref: "container",
|
|
3625
|
-
onClick:
|
|
3626
|
-
innerHTML:
|
|
3627
|
-
}, null, 8,
|
|
3662
|
+
onClick: C,
|
|
3663
|
+
innerHTML: ve.value
|
|
3664
|
+
}, null, 8, So));
|
|
3628
3665
|
}
|
|
3629
3666
|
}), [["styles", [".markdown-held-image{max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-3);font:inherit;font-size:var(--text-12);vertical-align:middle;cursor:pointer;align-items:center;display:inline-flex}.markdown-held-image:hover,.markdown-held-image:focus-visible{background-color:var(--color-surface-2);color:var(--color-word-2)}.markdown-broken-image{align-items:center;gap:var(--spacing-4);max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-4);font-size:var(--text-12);vertical-align:middle;display:inline-flex}@keyframes ft-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes ft-blurIn{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur()}}@keyframes ft-dropIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-slideUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-fadeAndScale{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}"]]]);
|
|
3630
3667
|
//#endregion
|
|
3631
|
-
export {
|
|
3668
|
+
export { S as A, qe as C, Ne as D, Ae as E, ue as F, b as I, pe as L, de as M, x as N, We as O, me as P, w as S, ye as T, Ve as _, je as a, Oe as b, Fe as c, Me as d, He as f, Je as g, T as h, D as i, he as j, fe as k, Le as l, Ke as m, De as n, ve as o, ke as p, Se as r, be as s, wo as t, Ie as u, Pe as v, ge as w, xe as x, ze as y };
|
|
3632
3669
|
|
|
3633
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3670
|
+
//# sourceMappingURL=PkStreamingMarkdown-DKyHYHUN.js.map
|