1(self.webpackChunkamanote=self.webpackChunkamanote||[]).push([[284],{9284:(G,z,c)=>{"use strict";c.d(z,{S:()=>I});var r=c(53330),w=c(94666),N=c(39068),P=c(45501),L=c(22465),y=c(53351),$=c(2508),p=c(22560);let m=(()=>{class M{}return M.\u0275fac=function(X){return new(X||M)},M.\u0275mod=p.\u0275\u0275defineNgModule({type:M}),M.\u0275inj=p.\u0275\u0275defineInjector({imports:[w.ez,$.u5,y.o]}),M})();var C=c(20570),g=c(19029),T=c(24921),A=c(75322);let I=(()=>{class M{constructor(){}}return M.\u0275fac=function(X){return new(X||M)},M.\u0275mod=p.\u0275\u0275defineNgModule({type:M}),M.\u0275inj=p.\u0275\u0275defineInjector({providers:[P.q],imports:[w.ez,A.Bz,r.o,N.q,L.bz,y.o,m,$.u5,C.m,g.X,T.S]}),M})()},45501:(G,z,c)=>{"use strict";c.d(z,{q:()=>p});var r=c(22560),w=c(22465),N=c(94666),P=c(23204);function L(m,C){if(1&m){const g=r.\u0275\u0275getCurrentView();r.\u0275\u0275elementContainerStart(0),r.\u0275\u0275elementStart(1,"p"),r.\u0275\u0275text(2),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementStart(3,"app-materials-selector",10),r.\u0275\u0275listener("selectionChanged",function(A){r.\u0275\u0275restoreView(g);const I=r.\u0275\u0275nextContext();return r.\u0275\u0275resetView(I.onSelectionChanged(A))}),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementContainerEnd()}if(2&m){const g=r.\u0275\u0275nextContext();r.\u0275\u0275advance(2),r.\u0275\u0275textInterpolate(g.message),r.\u0275\u0275advance(1),r.\u0275\u0275property("materials",g.materials)("allSelected",!0)}}function y(m,C){1&m&&(r.\u0275\u0275elementContainerStart(0),r.\u0275\u0275elementStart(1,"p"),r.\u0275\u0275i18n(2,11),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementContainerEnd())}let $=(()=>{class m{constructor(g){this.activeModal=g,this.materials=[],this.selectedMaterials=[],this.message=""}onSelectionChanged(g){this.selectedMaterials=g}validateSelection(){this.activeModal.close(this.selectedMaterials)}}return m.\u0275fac=function(g){return new(g||m)(r.\u0275\u0275directiveInject(w.Kz))},m.\u0275cmp=r.\u0275\u0275defineComponent({type:m,selectors:[["app-assistant-materials-selector-modal"]],decls:12,vars:3,consts:function(){let C,g,T;return C="Select materials",g="Add selection",T="All available materials have already been added. To add more, please upload new materials in your LMS.",[[1,"modal-header"],[1,"modal-title"],C,["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[4,"ngIf"],[1,"modal-footer"],["type","button",1,"btn","success",3,"disabled","click"],g,[3,"materials","allSelected","selectionChanged"],T]},template:function(g,T){1&g&&(r.\u0275\u0275elementStart(0,"div",0)(1,"h4",1),r.\u0275\u0275i18n(2,2),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementStart(3,"button",3),r.\u0275\u0275listener("click",function(){return T.activeModal.close([])}),r.\u0275\u0275elementStart(4,"span",4),r.\u0275\u0275text(5,"\xd7"),r.\u0275\u0275elementEnd()()(),r.\u0275\u0275elementStart(6,"div",5),r.\u0275\u0275template(7,L,4,3,"ng-container",6),r.\u0275\u0275template(8,y,3,0,"ng-container",6),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementStart(9,"div",7)(10,"button",8),r.\u0275\u0275listener("click",function(){return T.validateSelection()}),r.\u0275\u0275i18n(11,9),r.\u0275\u0275elementEnd()()),2&g&&(r.\u0275\u0275advance(7),r.\u0275\u0275property("ngIf",T.materials.length>0),r.\u0275\u0275advance(1),r.\u0275\u0275property("ngIf",0==T.materials.length),r.\u0275\u0275advance(2),r.\u0275\u0275property("disabled",0===T.selectedMaterials.length))},dependencies:[N.O5,P.O]}),m})(),p=(()=>{class m{constructor(g){this.ngbModalService=g}openMaterialsSelectorModal(g,T){const A=this.ngbModalService.open($,{size:"lg"});return A.componentInstance.materials=g,void 0!==T&&(A.componentInstance.message=T),A.result}}return m.\u0275fac=function(g){return new(g||m)(r.\u0275\u0275inject(w.FF))},m.\u0275prov=r.\u0275\u0275defineInjectable({token:m,factory:m.\u0275fac}),m})()},16247:(G,z,c)=>{"use strict";c.d(z,{$:()=>r});var r=(()=>{return(w=r||(r={})).Assistant="assistant",w.User="user",r;var w})()},19029:(G,z,c)=>{"use strict";c.d(z,{X:()=>g});var r=c(94666),w=c(94525),N=c(86957),P=c(22465),L=c(20570),y=c(3352),$=c(73505),p=c(39068),m=c(17735),C=c(22560);let g=(()=>{class T{constructor(I){}}return T.\u0275fac=function(I){return new(I||T)(C.\u0275\u0275inject(N.A))}
1,T.\u0275mod=C.\u0275\u0275defineNgModule({type:T}),T.\u0275inj=C.\u0275\u0275defineInjector({providers:[N.A],imports:[r.ez,P.mO,p.q,m.Y,L.m,y.H,$.uH,P.HK,w.JP.forRoot({markedOptions:{provide:w.TX,useValue:{breaks:!0}}})]}),T})()},86957:(G,z,c)=>{"use strict";c.d(z,{A:()=>q});var r=c(71670),w=c(52362),N=c(58987),P=c(16916),L=c(72305),y=c(30246),$=c(16247),p=c(51441),m=c(92218),C=c(55429),g=c(2976),T=c(99485),A=(()=>{return(B=A||(A={})).AnswerPart="answerPart",B.Citation="citation",B.Metadata="metadata",A;var B})(),I=c(99521),M=c(22560),j=c(95080),X=c(55085),re=c(83467);let q=(()=>{class B{constructor(E,O,f,U,Z){this.actions$=E,this.store=O,this.httpService=f,this.alertService=U,this.languageService=Z,this.conversations=new Map,this.conversationsChangeSubject=new m.xQ,this.conversationsChange$=this.conversationsChangeSubject.asObservable(),this.currentConversationId=null,this.currentlyGeneratedMessage=null,this.maximumConversationsCount=500,this.numberOfMessagesAsContext=20,this.assistantId=null,this.actions$.pipe((0,w.xt)(L.Ax)).subscribe(H=>{this.onDocumentChange(H?.documentMetadata)})}setAssistant(E){this.assistantId!==E.id&&(this.assistantId=E.id,this.loadConversationsFromLocalStorage(this.assistantId),this.initChatbot())}startNewConversation(){this.initChatbot(),this.deleteTextSelection()}loadConversation(E){this.currentConversationId!==E&&(this.currentConversation=this.conversations.get(E),this.currentConversationId=E)}deleteConversation(E){this.currentConversationId===E&&this.initChatbot(),this.conversations.delete(E),this.conversationsChangeSubject.next(),this.saveConversationsToLocalStorage(this.assistantId)}deleteTextSelection(){this.store.dispatch(new I.o(void 0))}getSortedConversations(){return Array.from(this.conversations.entries()).map(([E,O])=>({id:E,messages:O})).sort((E,O)=>{const f=E.messages[E.messages.length-1];return new Date(O.messages[O.messages.length-1].createdAt).getTime()-new Date(f.createdAt).getTime()})}addUserMessageAndRunBot(E,O,f){const U=this.createMessage($.$.User,E,this.currentConversationId??void 0);return U.context={...O,currentVisibleContent:void 0},this.currentConversation.push(U),this.getBotResponse(O,f).then(Z=>{null===this.currentConversationId&&(this.currentConversationId=Z.conversationId,this.conversations.set(this.currentConversationId,this.currentConversation)),this.conversationsChangeSubject.next(),this.saveConversationsToLocalStorage(this.assistantId),this.deleteTextSelection()})}registerTextSelection(E){return this.store.dispatch(new I.o(E)).toPromise()}getBotResponse(E,O){var f=this;return new Promise((U,Z)=>{const H=new WebSocket(P.N.websocket.endpoint);let R=null;const xe=setTimeout(()=>{H.readyState===WebSocket.OPEN&&(H.close(),U(null))},12e4),ue=[];let oe=0;const ae=Object.values(A);H.onmessage=function(){var _e=(0,r.Z)(function*(me){const te=JSON.parse(me.data);if(!R&&te.connectionId){R=te.connectionId;const W=f.getLastMessagesFromConversation(f.currentConversation,f.numberOfMessagesAsContext),le=W.slice(0,-1),ce={conversationId:f.currentConversationId??void 0,userPrompt:W[W.length-1],conversationHistory:le,connectionId:R,context:E},be=f.languageService.getCurrentLocal(),ke=(new N.WM).set("Accept-Language",be);f.httpService.post({endpoint:`${P.N.cloud.endpoint}/assistants/${f.assistantId}/message`,body:ce,baseHeaders:ke,requireAuth:!0,withCredentials:!0}).catch(de=>{O(!0),H.close(),429!==de.status&&f.alertService.addErrorAlert(new p.Oi),Z(de)})}if("failed"===te.status)O(!0),H.close(),Z(new Error("An error occurred"));else if(ae.includes(te.type))for(null===f.currentlyGeneratedMessage&&(f.currentlyGeneratedMessage=f.createMessage($.$.Assistant)),ue[te.order]=te;ue[oe];){const W=ue[oe];if(W.type===A.AnswerPart)f.currentlyGeneratedMessage.content.text||f.currentConversation.push(f.currentlyGeneratedMessage),f.currentlyGeneratedMessage.content.text=(f.currentlyGeneratedMessage.content.text||"")+W.content;else if(W.type===A.Citation)f.currentlyGeneratedMessage.citations||(f.currentlyGeneratedMessage.citations=[]),f.currentlyGeneratedMessage.citations.push(W.citation);else if(W.type===A.Metadata){f.currentlyGeneratedMessage.id=W.messageId,f.currentlyGeneratedMessage.assistantId=f.assistantId,f.currentlyGeneratedMessage.conversationId=W.conversationId,f.currentlyGeneratedMessage.createdAt=W.messageCreatedAt,f.currentlyGeneratedMessage=null,O(!0),H.close(),U(W);break}oe+=1,O(!1)}});return function(me){return _e.apply(this,arguments)}}(),H.onopen=()=>{H.send("")}
1,H.onclose=()=>{clearTimeout(xe)}})}initChatbot(){if(this.conversations.size>=this.maximumConversationsCount){const E=this.getSortedConversations();this.deleteConversation(E[E.length-1].id)}this.currentConversation=[],this.currentConversationId=null}rateMessage(E,O,f,U){return this.httpService.put(`${P.N.cloud.endpoint}/assistants/${E}/messages/${O}/score`,{messageId:O,score:f,comment:U},void 0,!0)}onDocumentChange(E){this.store.dispatch(new y.Vr(E&&E.aiAssistantId?{chatbot:!0}:{chatbot:!1}))}loadConversationsFromLocalStorage(E){var O=this;return(0,r.Z)(function*(){if(E)try{const f=`${g.Zb.storageKeys.chatbot.conversations}_${E}`,U=yield C.h.get(f);U&&(O.conversations.clear(),U.forEach(Z=>{O.conversations.set(Z.id,Z.messages)}),O.conversationsChangeSubject.next())}catch(f){console.error("Error loading conversations from storage:",f)}else console.error("Invalid assistant ID:",E)})()}saveConversationsToLocalStorage(E){var O=this;return(0,r.Z)(function*(){try{const f=Array.from(O.conversations.entries()).map(([Z,H])=>({id:Z,messages:H})),U=`${g.Zb.storageKeys.chatbot.conversations}_${E}`;yield C.h.set(U,f)}catch(f){console.error("Error saving conversations to storage:",f)}})()}createMessage(E,O,f){return{id:(0,T.v4)(),role:E,content:{text:O},createdAt:(new Date).toISOString(),conversationId:f}}getLastMessagesFromConversation(E,O){return E.slice(-O)}}return B.\u0275fac=function(E){return new(E||B)(M.\u0275\u0275inject(w.eX),M.\u0275\u0275inject(w.yh),M.\u0275\u0275inject(j.O),M.\u0275\u0275inject(X.c),M.\u0275\u0275inject(re.T))},B.\u0275prov=M.\u0275\u0275defineInjectable({token:B,factory:B.\u0275fac}),B})()},17735:(G,z,c)=>{"use strict";c.d(z,{Y:()=>P});var r=c(74416),w=c(52362),N=c(22560);let P=(()=>{class L{}return L.\u0275fac=function($){return new($||L)},L.\u0275mod=N.\u0275\u0275defineNgModule({type:L}),L.\u0275inj=N.\u0275\u0275defineInjector({imports:[w.$l.forFeature([r.j]),w.$l]}),L})()},99521:(G,z,c)=>{"use strict";c.d(z,{o:()=>r});let r=(()=>{class w{constructor(P){this.textSelection=P}}return w.type="[Chatbot] SetTextSelection",w})()},74416:(G,z,c)=>{"use strict";c.d(z,{j:()=>y});var r=c(52362),N=c(99521),P=c(22560),L=function($,p,m,C){var A,g=arguments.length,T=g<3?p:null===C?C=Object.getOwnPropertyDescriptor(p,m):C;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)T=Reflect.decorate($,p,m,C);else for(var I=$.length-1;I>=0;I--)(A=$[I])&&(T=(g<3?A(T):g>3?A(p,m,T):A(p,m))||T);return g>3&&T&&Object.defineProperty(p,m,T),T};let y=class{static textSelection(p){return p.textSelection}setTextSelection(p,m){p.patchState({textSelection:m.textSelection})}};y.\u0275fac=function(p){return new(p||y)},y.\u0275prov=P.\u0275\u0275defineInjectable({token:y,factory:y.\u0275fac}),L([(0,r.aU)(N.o)],y.prototype,"setTextSelection",null),L([(0,r.Qf)()],y,"textSelection",null),y=L([(0,r.ZM)({name:"chatbot",defaults:{textSelection:{content:""}}})],y)},23204:(G,z,c)=>{"use strict";c.d(z,{O:()=>L});var r=c(22560),w=c(94666);const N=function(y){return{"_border-l-2 _border-indigo-600":y}};function P(y,$){if(1&y){const p=r.\u0275\u0275getCurrentView();r.\u0275\u0275elementContainerStart(0),r.\u0275\u0275elementStart(1,"tr",13)(2,"td",14)(3,"input",5),r.\u0275\u0275listener("change",function(C){const T=r.\u0275\u0275restoreView(p).$implicit,A=r.\u0275\u0275nextContext();return r.\u0275\u0275resetView(A.toggleMaterialsSelection(T,C.target.checked))}),r.\u0275\u0275elementEnd()(),r.\u0275\u0275elementStart(4,"td",15),r.\u0275\u0275text(5),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementStart(6,"td",16)(7,"span",17),r.\u0275\u0275text(8),r.\u0275\u0275elementEnd()()(),r.\u0275\u0275elementContainerEnd()}if(2&y){const p=$.$implicit;r.\u0275\u0275advance(2),r.\u0275\u0275property("ngClass",r.\u0275\u0275pureFunction1(4,N,p.selected)),r.\u0275\u0275advance(1),r.\u0275\u0275property("checked",p.selected),r.\u0275\u0275advance(2),r.\u0275\u0275textInterpolate(p.title),r.\u0275\u0275advance(3),r.\u0275\u0275textInterpolate(null==p.space?null:p.space.name)}}let L=(()=>{class y{constructor(){this.materials=[],this.allSelected=!1,this.selectionChanged=new r.EventEmitter}ngOnInit(){this.allSelected&&this.toggleAllMaterialsSelection(!0)}
1toggleAllMaterialsSelection(p){this.materials.forEach(m=>{m.selected=p}),this.onSelectionChanged(),this.allSelected=p}toggleMaterialsSelection(p,m){p.selected=m,this.onSelectionChanged(),this.allSelected=this.materials.every(C=>C.selected)}onSelectionChanged(){const p=this.materials.filter(m=>m.selected).map(m=>{const{selected:C,...g}=m;return g});this.selectionChanged.emit(p)}}return y.\u0275fac=function(p){return new(p||y)},y.\u0275cmp=r.\u0275\u0275defineComponent({type:y,selectors:[["app-materials-selector"]],inputs:{materials:"materials",allSelected:"allSelected"},outputs:{selectionChanged:"selectionChanged"},decls:14,vars:2,consts:function(){let $,p;return $="Title",p="Source",[[1,"_rounded-lg","_bg-slate-100","dark:_bg-slate-800"],[1,"_w-full","_text-md","_text-left","rtl:_text-right","_border-collapse","_my-2"],[1,"_block"],[1,"_flex"],[1,"_px-6","_py-3","_w-8","_flex-shrink-0"],["type","checkbox",1,"_h-4","_w-4","_form-checkbox",3,"checked","change"],[1,"_px-6","_py-3","_w-[60%]"],$,[1,"_px-6","_py-3","_w-[40%]"],p,[1,"_overflow-y-auto","_max-h-[400px]"],[1,"_w-full","_text-md","_text-left","rtl:_text-right","_border-collapse"],[4,"ngFor","ngForOf"],[1,"_flex","_bg-white","_border-t","_border-gray-200","_hover:_bg-gray-100","dark:_bg-slate-700","dark:_hover:_bg-slate-600","dark:_border-gray-600"],[1,"_px-6","_py-4","_w-8","_flex-shrink-0","_text-center",3,"ngClass"],[1,"_px-6","_py-4","_w-[60%]"],[1,"_px-6","_py-4","_w-[40%]"],[1,"_bg-slate-100","_font-medium","_text-sm","_rounded-full","_px-3","_py-2","dark:_bg-slate-600"]]},template:function(p,m){1&p&&(r.\u0275\u0275elementStart(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr",3)(4,"th",4)(5,"input",5),r.\u0275\u0275listener("change",function(g){return m.toggleAllMaterialsSelection(g.target.checked)}),r.\u0275\u0275elementEnd()(),r.\u0275\u0275elementStart(6,"th",6),r.\u0275\u0275i18n(7,7),r.\u0275\u0275elementEnd(),r.\u0275\u0275elementStart(8,"th",8),r.\u0275\u0275i18n(9,9),r.\u0275\u0275elementEnd()()()(),r.\u0275\u0275elementStart(10,"div",10)(11,"table",11)(12,"tbody",2),r.\u0275\u0275template(13,P,9,6,"ng-container",12),r.\u0275\u0275elementEnd()()()()),2&p&&(r.\u0275\u0275advance(5),r.\u0275\u0275property("checked",m.allSelected),r.\u0275\u0275advance(8),r.\u0275\u0275property("ngForOf",m.materials))},dependencies:[w.mk,w.sg]}),y})()},99485:(G,z,c)=>{var r=c(20582),w=c(98627),N=w;N.v1=r,N.v4=w,G.exports=N},20582:(G,z,c)=>{var N,P,r=c(65354),w=c(44099),L=0,y=0;G.exports=function $(p,m,C){var g=m&&C||0,T=m||[],A=(p=p||{}).node||N,I=void 0!==p.clockseq?p.clockseq:P;if(null==A||null==I){var M=r();null==A&&(A=N=[1|M[0],M[1],M[2],M[3],M[4],M[5]]),null==I&&(I=P=16383&(M[6]<<8|M[7]))}var j=void 0!==p.msecs?p.msecs:(new Date).getTime(),X=void 0!==p.nsecs?p.nsecs:y+1,re=j-L+(X-y)/1e4;if(re<0&&void 0===p.clockseq&&(I=I+1&16383),(re<0||j>L)&&void 0===p.nsecs&&(X=0),X>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");L=j,y=X,P=I;var q=(1e4*(268435455&(j+=122192928e5))+X)%4294967296;T[g++]=q>>>24&255,T[g++]=q>>>16&255,T[g++]=q>>>8&255,T[g++]=255&q;var B=j/4294967296*1e4&268435455;T[g++]=B>>>8&255,T[g++]=255&B,T[g++]=B>>>24&15|16,T[g++]=B>>>16&255,T[g++]=I>>>8|128,T[g++]=255&I;for(var ee=0;ee<6;++ee)T[g+ee]=A[ee];return m||w(T)}},94525:(G,z,c)=>{"use strict";c.d(z,{lF:()=>Le,JP:()=>Ye,TX:()=>Re});var r=c(22560),w=c(92218),N=c(88623),P=c(64139),L=c(45398),y=c(59095),$=c(29361),p=c(53298),m=c(79128),C=c(25722),g=c(86942),T=c(85921),I=(c(25670),c(94666));let j={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const re=/[&<>"']/,q=new RegExp(re.source,"g"),B=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ee=new RegExp(B.source,"g"),E={"&":"&","<":"<",">":">",'"':""","'":"'"},O=o=>E[o];function f(o,n){if(n){if(re.test(o))return o.replace(q,O)}else if(B.test(o))return o.replace(ee,O);return o}const U=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Z(o){return o.replace(U,(n,e)=>"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):"")}const H=/(^|[^\[])\^/g;function R(o,n){o="string"==typeof o?o:o.source,n=n||"";const e={replace:(t,i)=>(i=(i=i.source||i).replace(H,"$1"),o=o.replace(t,i),e),getRegex:()=>new RegExp(o,n)};return e}const xe=/[^\w:]/g,ue=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function oe(o,n,e){if(o){let t;try{t=decodeURIComponent(Z(e)).replace(xe,"").toLowerCase()}catch{return null}if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}n&&!ue.test(e)&&(e=function W(o,n){ae[" "+o]||(ae[" "+o]=_e.test(o)?o+"/":ce(o,"/",!0));const e=-1===(o=ae[" "+o]).indexOf(":");return"//"===n.substring(0,2)?e?n:o.replace(me,"$1")+n:"/"===n.charAt(0)?e?n:o.replace(te,"$1")+n:o+n}(n,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const ae={},_e=/^[^:]+:\/*[^/]*$/,me=/^([^:]+:)[\s\S]*$/,te=/^([^:]+:\/*[^/]*)[\s\S]*$/,le={exec:function(){}};function Se(o,n){const t=o.replace(/\|/g,(s,a,l)=>{let h=!1,b=a;for(;--b>=0&&"\\"===l[b];)h=!h;return h?"|":" |"}).split(/ \|/);let i=0;if(t[0].trim()||t.shift(),t.length>0&&!t[t.length-1].trim()&&t.pop(),t.length>n)t.splice(n);else for(;t.length<n;)t.push("");for(;i<t.length;i++)t[i]=t[i].trim().replace(/\\\|/g,"|");return t}function ce(o,n,e){const t=o.length;if(0===t)return"";let i=0;for(;i<t;){const s=o.charAt(t-i-1);if(s!==n||e){if(s===n||!e)break;i++}else i++}return o.slice(0,t-i)}function de(o,n){if(n<1)return"";let e="";for(;n>1;)1&n&&(e+=o),n>>=1,o+=o;return e+o}function Ae(o,n,e,t){const i=n.href,s=n.title?f(n.title):null,a=o[1].replace(/\\([\[\]])/g,"$1");if("!"!==o[0].charAt(0)){t.state.inLink=!0;const l={type:"link",raw:e,href:i,title:s,text:a,tokens:t.inlineTokens(a)};return t.state.inLink=!1,l}return{type:"image",raw:e,href:i,title:s,text:f(a)}}class Te{constructor(n){this.options=n||j}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:ce(t,"\n")}}}fences(n){const e=this.rules.block.fences.exec(n);if(e){const t=e[0],i=function De(o,n){const e=o.match(/^(\s+)(?:```)/);if(null===e)return n;const t=e[1];return n.split("\n").map(i=>{const s=i.match(/^\s+/);if(null===s)return i;const[a]=s;return a.length>
vendor: 6,387 bytes, line 1
1=t.length?i.slice(t.length):i}).join("\n")}(t,e[3]||"");return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline._escapes,"$1"):e[2],text:i}}}heading(n){const e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(/#$/.test(t)){const i=ce(t,"#");(this.options.pedantic||!i||/ $/.test(i))&&(t=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:e[0]}}blockquote(n){const e=this.rules.block.blockquote.exec(n);if(e){const t=e[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(t);return this.lexer.state.top=i,{type:"blockquote",raw:e[0],tokens:s,text:t}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t,i,s,a,l,h,b,k,S,v,d,K,V=e[1].trim();const se=V.length>1,D={type:"list",raw:"",ordered:se,start:se?+V.slice(0,-1):"",loose:!1,items:[]};V=se?`\\d{1,9}\\${V.slice(-1)}`:`\\${V}`,this.options.pedantic&&(V=se?V:"[*+-]");const F=new RegExp(`^( {0,3}${V})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;n&&(K=!1,(e=F.exec(n))&&!this.rules.block.hr.test(n));){if(t=e[0],n=n.substring(t.length),k=e[2].split("\n",1)[0].replace(/^\t+/,Y=>" ".repeat(3*Y.length)),S=n.split("\n",1)[0],this.options.pedantic?(a=2,d=k.trimLeft()):(a=e[2].search(/[^ ]/),a=a>4?1:a,d=k.slice(a),a+=e[1].length),h=!1,!k&&/^ *$/.test(S)&&(t+=S+"\n",n=n.substring(S.length+1),K=!0),!K){const Y=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),Q=new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),J=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),ge=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;n&&(v=n.split("\n",1)[0],S=v,this.options.pedantic&&(S=S.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(J.test(S)||ge.test(S)||Y.test(S)||Q.test(n)));){if(S.search(/[^ ]/)>=a||!S.trim())d+="\n"+S.slice(a);else{if(h||k.search(/[^ ]/)>=4||J.test(k)||ge.test(k)||Q.test(k))break;d+="\n"+S}!h&&!S.trim()&&(h=!0),t+=v+"\n",n=n.substring(v.length+1),k=S.slice(a)}}D.loose||(b?D.loose=!0:/\n *\n *$/.test(t)&&(b=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(d),i&&(s="[ ] "!==i[0],d=d.replace(/^\[[ xX]\] +/,""))),D.items.push({type:"list_item",raw:t,task:!!i,checked:s,loose:!1,text:d}),D.raw+=t}D.items[D.items.length-1].raw=t.trimRight(),D.items[D.items.length-1].text=d.trimRight(),D.raw=D.raw.trimRight();const he=D.items.length;for(l=0;l<he;l++)if(this.lexer.state.top=!1,D.items[l].tokens=this.lexer.blockTokens(D.items[l].text,[]),!D.loose){const Y=D.items[l].tokens.filter(J=>"space"===J.type),Q=Y.length>0&&Y.some(J=>/\n.*\n/.test(J.raw));D.loose=Q}if(D.loose)for(l=0;l<he;l++)D.items[l].loose=!0;return D}}html(n){const e=this.rules.block.html.exec(n);if(e){const t={type:"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:e[0]};if(this.options.sanitize){const i=this.options.sanitizer?this.options.sanitizer(e[0]):f(e[0]);t.type="paragraph",t.text=i,t.tokens=this.lexer.inline(i)}return t}}def(n){const e=this.rules.block.def.exec(n);if(e){const t=e[1].toLowerCase().replace(/\s+/g," "),i=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:i,title:s}}}table(n){const e=this.rules.block.table.exec(n);if(e){const t={type:"table",header:Se(e[1]).map(i=>({text:i})),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(t.header.length===t.align.length){t.raw=e[0];let s,a,l,h,i=t.align.length;for(s=0;s<i;s++)t.align[s]=/^ *-+: *$/.test(t.align[s])?"right":/^ *:-+: *$/.test(t.align[s])?"center":/^ *:-+ *$/.test(t.align[s])?"left":null;for(i=t.rows.length,s=0;s<i;s++)t.rows[s]=Se(t.rows[s],t.header.length).map(b=>({text:b}));for(i=t.header.length,a=0;a<i;a++)t.header[a].tokens=this.lexer.inline(t.header[a].text);for(i=t.rows.length,a=0;a<i;a++)for(h=t.rows[a],l=0;l<h.length;l++)h[l].tokens=this.lexer.inline(h[l].text);return t}}}lheading(n){const e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){const e=this.rules.block.paragraph.exec(n);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:f(e[1])}}tag(n){const e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&/^<a /i.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):f(e[0]):e[0]}}link(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t))return;const a=ce(t.slice(0,-1),"\\");if((t.length-a.length)%2==0)return}else{const a=function be(o,n){if(-1===o.indexOf(n[1]))return-1;const e=o.length;let t=0,i=0;for(;i<e;i++)if("\\"===o[i])i++;else if(o[i]===n[0])t++;else if(o[i]===n[1]&&(t--,t<0))return i;return-1}(e[2],"()");if(a>-1){const h=(0===e[0].indexOf("!")?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,h).trim(),e[3]=""}}let i=e[2],s="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a&&(i=a[1],s=a[3])}else s=e[3]?e[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(i=this.options.pedantic&&!/>$/.test(t)?i.slice(1):i.slice(1,-1)),Ae(e,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},e[0],this.lexer)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let i=(t[2]||t[1]).replace(/\s+/g," ");
vendor: 19,138 bytes, line 1
1if(i=e[i.toLowerCase()],!i){const s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return Ae(t,i,t[0],this.lexer)}}emStrong(n,e,t=""){let i=this.rules.inline.emStrong.lDelim.exec(n);if(!i||i[3]&&t.match(/[\p{L}\p{N}]/u))return;const s=i[1]||i[2]||"";if(!s||s&&(""===t||this.rules.inline.punctuation.exec(t))){const a=i[0].length-1;let l,h,b=a,k=0;const S="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(S.lastIndex=0,e=e.slice(-1*n.length+a);null!=(i=S.exec(e));){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(h=l.length,i[3]||i[4]){b+=h;continue}if((i[5]||i[6])&&a%3&&!((a+h)%3)){k+=h;continue}if(b-=h,b>0)continue;h=Math.min(h,h+b+k);const v=n.slice(0,a+i.index+(i[0].length-l.length)+h);if(Math.min(a,h)%2){const K=v.slice(1,-1);return{type:"em",raw:v,text:K,tokens:this.lexer.inlineTokens(K)}}const d=v.slice(2,-2);return{type:"strong",raw:v,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(/\n/g," ");const i=/[^ ]/.test(t),s=/^ /.test(t)&&/ $/.test(t);return i&&s&&(t=t.substring(1,t.length-1)),t=f(t,!0),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n,e){const t=this.rules.inline.autolink.exec(n);if(t){let i,s;return"@"===t[2]?(i=f(this.options.mangle?e(t[1]):t[1]),s="mailto:"+i):(i=f(t[1]),s=i),{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(n,e){let t;if(t=this.rules.inline.url.exec(n)){let i,s;if("@"===t[2])i=f(this.options.mangle?e(t[0]):t[0]),s="mailto:"+i;else{let a;do{a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(a!==t[0]);i=f(t[0]),s="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(n,e){const t=this.rules.inline.text.exec(n);if(t){let i;return i=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):f(t[0]):t[0]:f(this.options.smartypants?e(t[0]):t[0]),{type:"text",raw:t[0],text:i}}}}const x={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:le,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};x.def=R(x.def).replace("label",x._label).replace("title",x._title).getRegex(),x.bullet=/(?:[*+-]|\d{1,9}[.)])/,x.listItemStart=R(/^( *)(bull) */).replace("bull",x.bullet).getRegex(),x.list=R(x.list).replace(/bull/g,x.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+x.def.source+")").getRegex(),x._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",x._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,x.html=R(x.html,"i").replace("comment",x._comment).replace("tag",x._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x.paragraph=R(x._paragraph).replace("hr",x.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x._tag).getRegex(),x.blockquote=R(x.blockquote).replace("paragraph",x.paragraph).getRegex(),x.normal={...x},x.gfm={...x.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},x.gfm.table=R(x.gfm.table).replace("hr",x.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x._tag).getRegex(),x.gfm.paragraph=R(x._paragraph).replace("hr",x.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",x.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x._tag).getRegex(),x.pedantic={...x.normal,html:R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",x._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:le,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:R(x.normal._paragraph).replace("hr",x.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",x.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const u={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:le,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:le,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function ze(o){return o.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026")}function we(o){let e,t,n="";const i=o.length;for(e=0;e<i;e++)t=o.charCodeAt(e),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n}u._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",u.punctuation=R(u.punctuation).replace(/punctuation/g,u._punctuation).getRegex(),u.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,u.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,u._comment=R(x._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),u.emStrong.lDelim=R(u.emStrong.lDelim).replace(/punct/g,u._punctuation).getRegex(),u.emStrong.rDelimAst=R(u.emStrong.rDelimAst,"g").replace(/punct/g,u._punctuation).getRegex(),u.emStrong.rDelimUnd=R(u.emStrong.rDelimUnd,"g").replace(/punct/g,u._punctuation).getRegex(),u._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,u._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,u._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])?)+(?![-_])/,u.autolink=R(u.autolink).replace("scheme",u._scheme).replace("email",u._email).getRegex(),u._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,u.tag=R(u.tag).replace("comment",u._comment).replace("attribute",u._attribute).getRegex(),u._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,u._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,u._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,u.link=R(u.link).replace("label",u._label).replace("href",u._href).replace("title",u._title).getRegex(),u.reflink=R(u.reflink).replace("label",u._label).replace("ref",x._label).getRegex(),u.nolink=R(u.nolink).replace("ref",x._label).getRegex(),u.reflinkSearch=R(u.reflinkSearch,"g").replace("reflink",u.reflink).replace("nolink",u.nolink).getRegex(),u.normal={...u},u.pedantic={...u.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:R(/^!?\[(label)\]\((.*?)\)/).replace("label",u._label).getRegex(),reflink:R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",u._label).getRegex()},u.gfm={...u.normal,escape:R(u.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},u.gfm.url=R(u.gfm.url,"i").replace("email",u.gfm._extended_email).getRegex(),u.breaks={...u.gfm,br:R(u.br).replace("{2,}","*").getRegex(),text:R(u.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class ne{constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||j,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={block:x.normal,inline:u.normal};this.options.pedantic?(e.block=x.pedantic,e.inline=u.pedantic):this.options.gfm&&(e.block=x.gfm,e.inline=this.options.breaks?u.breaks:u.gfm),this.tokenizer.rules=e}static get rules(){return{block:x,inline:u}}static lex(n,e){return new ne(e).lex(n)}static lexInline(n,e){return new ne(e).inlineTokens(n)}lex(n){let e;for(n=n.replace(/\r\n|\r/g,"\n"),this.blockTokens(n,this.tokens);e=this.inlineQueue.shift();)this.inlineTokens(e.src,e.tokens);return this.tokens}blockTokens(n,e=[]){let t,i,s,a;for(n=this.options.pedantic?n.replace(/\t/g," ").replace(/^ +$/gm,""):n.replace(/^( *)(\t+)/gm,(l,h,b)=>h+" ".repeat(b.length));n;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>!!(t=l.call({lexer:this},n,e))&&(n=n.substring(t.raw.length),e.push(t),!0)))){if(t=this.tokenizer.space(n)){n=n.substring(t.raw.length),1===t.raw.length&&e.length>0?e[e.length-1].raw+="\n":e.push(t);continue}if(t=this.tokenizer.code(n)){n=n.substring(t.raw.length),i=e[e.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?e.push(t):(i.raw+="\n"+t.raw,i.text+="\n"+t.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);continue}if(t=this.tokenizer.fences(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.heading(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.hr(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.blockquote(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.list(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.html(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.def(n)){n=n.substring(t.raw.length),i=e[e.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title}):(i.raw+="\n"+t.raw,i.text+="\n"+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);continue}if(t=this.tokenizer.table(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.lheading(n)){n=n.substring(t.raw.length),e.push(t);continue}if(s=n,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const h=n.slice(1);let b;this.options.extensions.startBlock.forEach(function(k){b=k.call({lexer:this},h),"number"==typeof b&&b>=0&&(l=Math.min(l,b))}),l<1/0&&l>=0&&(s=n.substring(0,l+1))}if(this.state.top&&(t=this.tokenizer.paragraph(s))){i=e[e.length-1],a&&"paragraph"===i.type?(i.raw+="\n"+t.raw,i.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(t),a=s.length!==n.length,n=n.substring(t.raw.length);continue}if(t=this.tokenizer.text(n)){n=n.substring(t.raw.length),i=e[e.length-1],i&&"text"===i.type?(i.raw+="\n"+t.raw,i.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(t);continue}if(n){const l="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}}return this.state.top=!0,e}inline(n,e=[]){return this.inlineQueue.push({src:n,tokens:e}),e}inlineTokens(n,e=[]){let t,i,s,l,h,b,a=n;if(this.tokens.links){const k=Object.keys(this.tokens.links);if(k.length>0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(a));)k.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+de("a",l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,l.index)+"["+de("a",l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.escapedEmSt.exec(a));)a=a.slice(0,l.index+l[0].length-2)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;n;)if(h||(b=""),h=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(k=>!!(t=k.call({lexer:this},n,e))&&(n=n.substring(t.raw.length),e.push(t),!0)))){if(t=this.tokenizer.escape(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.tag(n)){n=n.substring(t.raw.length),i=e[e.length-1],i&&"text"===t.type&&"text"===i.type?(i.raw+=t.raw,i.text+=t.text):e.push(t);continue}if(t=this.tokenizer.link(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(t.raw.length),i=e[e.length-1],i&&"text"===t.type&&"text"===i.type?(i.raw+=t.raw,i.text+=t.text):e.push(t);continue}if(t=this.tokenizer.emStrong(n,a,b)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.codespan(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.br(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.del(n)){n=n.substring(t.raw.length),e.push(t);continue}if(t=this.tokenizer.autolink(n,we)){n=n.substring(t.raw.length),e.push(t);continue}if(!this.state.inLink&&(t=this.tokenizer.url(n,we))){n=n.substring(t.raw.length),e.push(t);continue}if(s=n,this.options.extensions&&this.options.extensions.startInline){let k=1/0;const S=n.slice(1);let v;this.options.extensions.startInline.forEach(function(d){v=d.call({lexer:this},S),"number"==typeof v&&v>=0&&(k=Math.min(k,v))}),k<1/0&&k>=0&&(s=n.substring(0,k+1))}if(t=this.tokenizer.inlineText(s,ze)){n=n.substring(t.raw.length),"_"!==t.raw.slice(-1)&&(b=t.raw.slice(-1)),h=!0,i=e[e.length-1],i&&"text"===i.type?(i.raw+=t.raw,i.text+=t.text):e.push(t);continue}if(n){const k="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(k);break}throw new Error(k)}}return e}}class pe{constructor(n){this.options=n||j}code(n,e,t){const i=(e||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(n,i);null!=s&&s!==n&&(t=!0,n=s)}return n=n.replace(/\n$/,"")+"\n",i?'<pre><code class="'+this.options.langPrefix+f(i)+'">'+(t?n:f(n,!0))+"</code></pre>\n":"<pre><code>"+(t?n:f(n,!0))+"</code></pre>\n"}blockquote(n){return`<blockquote>\n${n}</blockquote>\n`}html(n){return n}heading(n,e,t,i){return this.options.headerIds?`<h${e} id="${this.options.headerPrefix+i.slug(t)}">${n}</h${e}>\n`:`<h${e}>${n}</h${e}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(n,e,t){const i=e?"ol":"ul";return"<"+i+(e&&1!==t?' start="'+t+'"':"")+">\n"+n+"</"+i+">\n"}listitem(n){return`<li>${n}</li>\n`}checkbox(n){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(n){return`<p>${n}</p>\n`}table(n,e){return e&&(e=`<tbody>${e}</tbody>`),"<table>\n<thead>\n"+n+"</thead>\n"+e+"</table>\n"}tablerow(n){return`<tr>\n${n}</tr>\n`}tablecell(n,e){const t=e.header?"th":"td";return(e.align?`<${t} align="${e.align}">`:`<${t}>`)+n+`</${t}>\n`}strong(n){return`<strong>${n}</strong>`}em(n){return`<em>${n}</em>`}codespan(n){return`<code>${n}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(n){return`<del>${n}</del>`}link(n,e,t){if(null===(n=oe(this.options.sanitize,this.options.baseUrl,n)))return t;let i='<a href="'+n+'"';return e&&(i+=' title="'+e+'"'),i+=">"+t+"</a>",i}image(n,e,t){if(null===(n=oe(this.options.sanitize,this.options.baseUrl,n)))return t;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${e}"`),i+=this.options.xhtml?"/>":">",i}text(n){return n}}class Ce{strong(n){return n}em(n){return n}codespan(n){return n}del(n){return n}html(n){return n}text(n){return n}link(n,e,t){return""+t}image(n,e,t){return""+t}br(){return""}}class Me{constructor(){this.seen={}}serialize(n){return n.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}
1getNextSafeSlug(n,e){let t=n,i=0;if(this.seen.hasOwnProperty(t)){i=this.seen[n];do{i++,t=n+"-"+i}while(this.seen.hasOwnProperty(t))}return e||(this.seen[n]=i,this.seen[t]=0),t}slug(n,e={}){const t=this.serialize(n);return this.getNextSafeSlug(t,e.dryrun)}}class ie{constructor(n){this.options=n||j,this.options.renderer=this.options.renderer||new pe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ce,this.slugger=new Me}static parse(n,e){return new ie(e).parse(n)}static parseInline(n,e){return new ie(e).parseInline(n)}parse(n,e=!0){let i,s,a,l,h,b,k,S,v,d,K,V,se,D,F,he,Y,Q,J,t="";const ge=n.length;for(i=0;i<ge;i++)if(d=n[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(J=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==J||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))t+=J||"";else switch(d.type){case"space":continue;case"hr":t+=this.renderer.hr();continue;case"heading":t+=this.renderer.heading(this.parseInline(d.tokens),d.depth,Z(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":t+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(S="",k="",l=d.header.length,s=0;s<l;s++)k+=this.renderer.tablecell(this.parseInline(d.header[s].tokens),{header:!0,align:d.align[s]});for(S+=this.renderer.tablerow(k),v="",l=d.rows.length,s=0;s<l;s++){for(b=d.rows[s],k="",h=b.length,a=0;a<h;a++)k+=this.renderer.tablecell(this.parseInline(b[a].tokens),{header:!1,align:d.align[a]});v+=this.renderer.tablerow(k)}t+=this.renderer.table(S,v);continue;case"blockquote":v=this.parse(d.tokens),t+=this.renderer.blockquote(v);continue;case"list":for(K=d.ordered,V=d.start,se=d.loose,l=d.items.length,v="",s=0;s<l;s++)F=d.items[s],he=F.checked,Y=F.task,D="",F.task&&(Q=this.renderer.checkbox(he),se?F.tokens.length>0&&"paragraph"===F.tokens[0].type?(F.tokens[0].text=Q+" "+F.tokens[0].text,F.tokens[0].tokens&&F.tokens[0].tokens.length>0&&"text"===F.tokens[0].tokens[0].type&&(F.tokens[0].tokens[0].text=Q+" "+F.tokens[0].tokens[0].text)):F.tokens.unshift({type:"text",text:Q}):D+=Q),D+=this.parse(F.tokens,se),v+=this.renderer.listitem(D,Y,he);t+=this.renderer.list(v,K,V);continue;case"html":t+=this.renderer.html(d.text);continue;case"paragraph":t+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(v=d.tokens?this.parseInline(d.tokens):d.text;i+1<ge&&"text"===n[i+1].type;)d=n[++i],v+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);t+=e?this.renderer.paragraph(v):v;continue;default:{const Pe='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(Pe);throw new Error(Pe)}}return t}parseInline(n,e){e=e||this.renderer;let i,s,a,t="";const l=n.length;for(i=0;i<l;i++)if(s=n[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]&&(a=this.options.extensions.renderers[s.type].call({parser:this},s),!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)))t+=a||"";else switch(s.type){case"escape":case"text":t+=e.text(s.text);break;case"html":t+=e.html(s.text);break;case"link":t+=e.link(s.href,s.title,this.parseInline(s.tokens,e));break;case"image":t+=e.image(s.href,s.title,s.text);break;case"strong":t+=e.strong(this.parseInline(s.tokens,e));break;case"em":t+=e.em(this.parseInline(s.tokens,e));break;case"codespan":t+=e.codespan(s.text);break;case"br":t+=e.br();break;case"del":t+=e.del(this.parseInline(s.tokens,e));break;default:{const h='Token with "'+s.type+'" type was not found.';if(this.options.silent)return void console.error(h);throw new Error(h)}}return t}}class Ee{constructor(n){this.options=n||j}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(n){return n}postprocess(n){return n}}function Oe(o,n){return(e,t,i)=>{"function"==typeof t&&(i=t,t=null);const s={...t},a=function je(o,n,e){return t=>{if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",o){const i="<p>An error occurred:</p><pre>"+f(t.message+"",!0)+"</pre>";return n?Promise.resolve(i):e?void e(null,i):i}if(n)return Promise.reject(t);if(!e)throw t;e(t)}}((t={..._.defaults,...s}).silent,t.async,i);if(typeof e>"u"||null===e)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(function ke(o){o&&o.sanitize&&!o.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(t),t.hooks&&(t.hooks.options=t),i){const l=t.highlight;let h;try{t.hooks&&(e=t.hooks.preprocess(e)),h=o(e,t)}catch(S){return a(S)}const b=function(S){let v;if(!S)try{t.walkTokens&&_.walkTokens(h,t.walkTokens),v=n(h,t),t.hooks&&(v=t.hooks.postprocess(v))}catch(d){S=d}return t.highlight=l,S?a(S):i(null,v)};if(!l||l.length<3||(delete t.highlight,!h.length))return b();let k=0;return _.walkTokens(h,function(S){"code"===S.type&&(k++,setTimeout(()=>{l(S.text,S.lang,function(v,d){if(v)return b(v);null!=d&&d!==S.text&&(S.text=d,S.escaped=!0),k--,0===k&&b()})},0))}),void(0===k&&b())}if(t.async)return Promise.resolve(t.hooks?t.hooks.preprocess(e):e).then(l=>o(l,t)).then(l=>t.walkTokens?Promise.all(_.walkTokens(l,t.walkTokens)).then(()=>l):l).then(l=>n(l,t)).then(l=>t.hooks?t.hooks.postprocess(l):l).catch(a);try{t.hooks&&(e=t.hooks.preprocess(e));const l=o(e,t);t.walkTokens&&_.walkTokens(l,t.walkTokens);let h=n(l,t);return t.hooks&&(h=t.hooks.postprocess(h)),h}catch(l){return a(l)}}}function _(o,n,e){return Oe(ne.lex,ie.parse)(o,n,e)}_.options=_.setOptions=function(o){return function X(o){j=o}(_.defaults={..._.defaults,...o}),_},_.getDefaults=function M(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}},_.defaults=j,_.use=function(...o){const n=_.defaults.extensions||{renderers:{},childTokens:{}};
1o.forEach(e=>{const t={...e};if(t.async=_.defaults.async||t.async||!1,e.extensions&&(e.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const s=n.renderers[i.name];n.renderers[i.name]=s?function(...a){let l=i.renderer.apply(this,a);return!1===l&&(l=s.apply(this,a)),l}:i.renderer}if(i.tokenizer){if(!i.level||"block"!==i.level&&"inline"!==i.level)throw new Error("extension level must be 'block' or 'inline'");n[i.level]?n[i.level].unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&("block"===i.level?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:"inline"===i.level&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),t.extensions=n),e.renderer){const i=_.defaults.renderer||new pe;for(const s in e.renderer){const a=i[s];i[s]=(...l)=>{let h=e.renderer[s].apply(i,l);return!1===h&&(h=a.apply(i,l)),h}}t.renderer=i}if(e.tokenizer){const i=_.defaults.tokenizer||new Te;for(const s in e.tokenizer){const a=i[s];i[s]=(...l)=>{let h=e.tokenizer[s].apply(i,l);return!1===h&&(h=a.apply(i,l)),h}}t.tokenizer=i}if(e.hooks){const i=_.defaults.hooks||new Ee;for(const s in e.hooks){const a=i[s];i[s]=Ee.passThroughHooks.has(s)?l=>{if(_.defaults.async)return Promise.resolve(e.hooks[s].call(i,l)).then(b=>a.call(i,b));const h=e.hooks[s].call(i,l);return a.call(i,h)}:(...l)=>{let h=e.hooks[s].apply(i,l);return!1===h&&(h=a.apply(i,l)),h}}t.hooks=i}if(e.walkTokens){const i=_.defaults.walkTokens;t.walkTokens=function(s){let a=[];return a.push(e.walkTokens.call(this,s)),i&&(a=a.concat(i.call(this,s))),a}}_.setOptions(t)})},_.walkTokens=function(o,n){let e=[];for(const t of o)switch(e=e.concat(n.call(_,t)),t.type){case"table":for(const i of t.header)e=e.concat(_.walkTokens(i.tokens,n));for(const i of t.rows)for(const s of i)e=e.concat(_.walkTokens(s.tokens,n));break;case"list":e=e.concat(_.walkTokens(t.items,n));break;default:_.defaults.extensions&&_.defaults.extensions.childTokens&&_.defaults.extensions.childTokens[t.type]?_.defaults.extensions.childTokens[t.type].forEach(function(i){e=e.concat(_.walkTokens(t[i],n))}):t.tokens&&(e=e.concat(_.walkTokens(t.tokens,n)))}return e},_.parseInline=Oe(ne.lexInline,ie.parseInline),_.Parser=ie,_.parser=ie.parse,_.Renderer=pe,_.TextRenderer=Ce,_.Lexer=ne,_.lexer=ne.lex,_.Tokenizer=Te,_.Slugger=Me,_.Hooks=Ee,_.parse=_;var Be=c(58987),Ie=c(34497);const Ue=["*"];let ve=(()=>{class o{constructor(){this._buttonClick$=new w.xQ,this.copied$=this._buttonClick$.pipe((0,y.w)(()=>(0,N.T)((0,P.of)(!0),(0,L.H)(3e3).pipe((0,$.h)(!1)))),(0,p.x)(),(0,m.d)(1)),this.copiedText$=this.copied$.pipe((0,C.O)(!1),(0,g.U)(e=>e?"Copied":"Copy"))}onCopyToClipboardClick(){this._buttonClick$.next()}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=r.\u0275\u0275defineComponent({type:o,selectors:[["markdown-clipboard"]],decls:4,vars:7,consts:[[1,"markdown-clipboard-button",3,"click"]],template:function(e,t){1&e&&(r.\u0275\u0275elementStart(0,"button",0),r.\u0275\u0275listener("click",function(){return t.onCopyToClipboardClick()}),r.\u0275\u0275pipe(1,"async"),r.\u0275\u0275text(2),r.\u0275\u0275pipe(3,"async"),r.\u0275\u0275elementEnd()),2&e&&(r.\u0275\u0275classProp("copied",r.\u0275\u0275pipeBind1(1,3,t.copied$)),r.\u0275\u0275advance(2),r.\u0275\u0275textInterpolate(r.\u0275\u0275pipeBind1(3,5,t.copiedText$)))},dependencies:[I.Ov],encapsulation:2,changeDetection:0}),o})();class He{}var fe=(()=>{return(o=fe||(fe={})).CommandLine="command-line",o.LineHighlight="line-highlight",o.LineNumbers="line-numbers",fe;var o})();class Re{}const $e=new r.InjectionToken("SECURITY_CONTEXT");let ye=(()=>{class o{constructor(e,t,i,s,a,l){this.platform=e,this.securityContext=t,this.http=i,this.clipboardOptions=s,this.sanitizer=l,this.DEFAULT_MARKED_OPTIONS={renderer:new pe},this.DEFAULT_KATEX_OPTIONS={delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}]},this.DEFAULT_MERMAID_OPTIONS={startOnLoad:!1},this.DEFAULT_CLIPBOARD_OPTIONS={buttonComponent:void 0},this.DEFAULT_PARSE_OPTIONS={decodeHtml:!1,inline:!1,emoji:!1,mermaid:!1,markedOptions:this.DEFAULT_MARKED_OPTIONS,disableSanitizer:!1},this.DEFAULT_RENDER_OPTIONS={clipboard:!1,clipboardOptions:void 0,katex:!1,katexOptions:void 0,mermaid:!1,mermaidOptions:void 0},this._reload$=new w.xQ,this.reload$=this._reload$.asObservable(),this.options=a}get options(){return this._options}set options(e){this._options={...this.DEFAULT_MARKED_OPTIONS,...e}}get renderer(){return this.options.renderer}set renderer(e){this.options.renderer=e}parse(e,t=this.DEFAULT_PARSE_OPTIONS){const{decodeHtml:i,inline:s,emoji:a,mermaid:l,disableSanitizer:h}=t,b={...this.options,...t.markedOptions};l&&(this.renderer=this.extendRenderer(b.renderer||new pe));const k=this.trimIndentation(e),S=i?this.decodeHtml(k):k,v=a?this.parseEmoji(S):S,d=this.parseMarked(v,b,s);
1return(h?d:this.sanitizer.sanitize(this.securityContext,d))||""}render(e,t=this.DEFAULT_RENDER_OPTIONS,i){const{clipboard:s,clipboardOptions:a,katex:l,katexOptions:h,mermaid:b,mermaidOptions:k}=t;s&&this.renderClipboard(e,i,{...this.DEFAULT_CLIPBOARD_OPTIONS,...this.clipboardOptions,...a}),l&&this.renderKatex(e,{...this.DEFAULT_KATEX_OPTIONS,...h}),b&&this.renderMermaid(e,{...this.DEFAULT_MERMAID_OPTIONS,...k}),this.highlight(e)}reload(){this._reload$.next()}getSource(e){if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(e,{responseType:"text"}).pipe((0,g.U)(t=>this.handleExtension(e,t)))}highlight(e){if(!(0,I.NF)(this.platform)||typeof Prism>"u"||typeof Prism.highlightAllUnder>"u")return;e||(e=document);const t=e.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(t,i=>i.classList.add("language-none")),Prism.highlightAllUnder(e)}decodeHtml(e){if(!(0,I.NF)(this.platform))return e;const t=document.createElement("textarea");return t.innerHTML=e,t.value}extendRenderer(e){const t=e;if(!0===t.\u0275NgxMarkdownRendererExtended)return e;const i=e.code;return e.code=function(s,a,l){return"mermaid"===a?`<div class="mermaid">${s}</div>`:i.call(this,s,a,l)},t.\u0275NgxMarkdownRendererExtended=!0,e}handleExtension(e,t){const i=e.lastIndexOf("://"),s=i>-1?e.substring(i+4):e,a=s.lastIndexOf("/"),l=a>-1?s.substring(a+1).split("?")[0]:"",h=l.lastIndexOf("."),b=h>-1?l.substring(h+1):"";return b&&"md"!==b?"```"+b+"\n"+t+"\n```":t}parseMarked(e,t,i=!1){return i?_.parseInline(e,t):_.parse(e,t)}parseEmoji(e){if(!(0,I.NF)(this.platform))return e;if(typeof joypixels>"u"||typeof joypixels.shortnameToUnicode>"u")throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(e)}renderKatex(e,t){if((0,I.NF)(this.platform)){if(typeof katex>"u"||typeof renderMathInElement>"u")throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");renderMathInElement(e,t)}}renderClipboard(e,t,i){if(!(0,I.NF)(this.platform))return;if(typeof ClipboardJS>"u")throw new Error("[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information");if(!t)throw new Error("[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function");const{buttonComponent:s,buttonTemplate:a}=i,l=e.querySelectorAll("pre");for(let h=0;h<l.length;h++){const b=l.item(h),k=document.createElement("div");k.style.position="relative",b.parentNode.insertBefore(k,b),k.appendChild(b);const S=document.createElement("div");let v,d;S.style.position="absolute",S.style.top=".5em",S.style.right=".5em",S.style.opacity="0",S.style.transition="opacity 250ms ease-out",k.insertAdjacentElement("beforeend",S),b.onmouseover=()=>S.style.opacity="1",b.onmouseout=()=>S.style.opacity="0",v=s?t.createComponent(s).hostView:a?t.createEmbeddedView(a):t.createComponent(ve).hostView,v.rootNodes.forEach(K=>{K.onmouseover=()=>S.style.opacity="1",S.appendChild(K),d=new ClipboardJS(K,{text:()=>b.innerText})}),v.onDestroy(()=>d.destroy())}}renderMermaid(e,t=this.DEFAULT_MERMAID_OPTIONS){if(!(0,I.NF)(this.platform))return;if(typeof mermaid>"u"||typeof mermaid.init>"u")throw new Error("[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information");const i=e.querySelectorAll(".mermaid");0!==i.length&&(mermaid.initialize(t),mermaid.init(i))}trimIndentation(e){if(!e)return"";let t;return e.split("\n").map(i=>{let s=t;return i.length>0&&(s=isNaN(s)?i.search(/\S|$/):Math.min(i.search(/\S|$/),s)),isNaN(t)&&(t=s),s?i.substring(s):i}).join("\n")}}return o.\u0275fac=function(e){return new(e||o)(r.\u0275\u0275inject(r.PLATFORM_ID),r.\u0275\u0275inject($e),r.\u0275\u0275inject(Be.eN,8),r.\u0275\u0275inject(He,8),r.\u0275\u0275inject(Re,8),r.\u0275\u0275inject(Ie.H7))},o.\u0275prov=r.\u0275\u0275defineInjectable({token:o,factory:o.\u0275fac}),o})(),Le=(()=>{class o{constructor(e,t,i){this.element=e,this.markdownService=t,this.viewContainerRef
1=i,this.error=new r.EventEmitter,this.load=new r.EventEmitter,this.ready=new r.EventEmitter,this._clipboard=!1,this._commandLine=!1,this._disableSanitizer=!1,this._emoji=!1,this._inline=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1,this._mermaid=!1,this._srcRelativeLink=!1,this.destroyed$=new w.xQ}get disableSanitizer(){return this._disableSanitizer}set disableSanitizer(e){this._disableSanitizer=this.coerceBooleanProperty(e)}get inline(){return this._inline}set inline(e){this._inline=this.coerceBooleanProperty(e)}get srcRelativeLink(){return this._srcRelativeLink}set srcRelativeLink(e){this._srcRelativeLink=this.coerceBooleanProperty(e)}get clipboard(){return this._clipboard}set clipboard(e){this._clipboard=this.coerceBooleanProperty(e)}get emoji(){return this._emoji}set emoji(e){this._emoji=this.coerceBooleanProperty(e)}get katex(){return this._katex}set katex(e){this._katex=this.coerceBooleanProperty(e)}get mermaid(){return this._mermaid}set mermaid(e){this._mermaid=this.coerceBooleanProperty(e)}get lineHighlight(){return this._lineHighlight}set lineHighlight(e){this._lineHighlight=this.coerceBooleanProperty(e)}get lineNumbers(){return this._lineNumbers}set lineNumbers(e){this._lineNumbers=this.coerceBooleanProperty(e)}get commandLine(){return this._commandLine}set commandLine(e){this._commandLine=this.coerceBooleanProperty(e)}ngOnChanges(){this.loadContent()}loadContent(){null==this.data?null==this.src||this.handleSrc():this.handleData()}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion(),this.markdownService.reload$.pipe((0,T.R)(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}render(e,t=!1){let i;this.src&&this.srcRelativeLink&&(i={baseUrl:new URL(this.src,location.origin).pathname});const a={clipboard:this.clipboard,clipboardOptions:{buttonComponent:this.clipboardButtonComponent,buttonTemplate:this.clipboardButtonTemplate},katex:this.katex,katexOptions:this.katexOptions,mermaid:this.mermaid,mermaidOptions:this.mermaidOptions},l=this.markdownService.parse(e,{decodeHtml:t,inline:this.inline,emoji:this.emoji,mermaid:this.mermaid,markedOptions:i,disableSanitizer:this.disableSanitizer});this.element.nativeElement.innerHTML=l,this.handlePlugins(),this.markdownService.render(this.element.nativeElement,a,this.viewContainerRef),this.ready.emit()}coerceBooleanProperty(e){return null!=e&&"false"!=`${String(e)}`}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe({next:e=>{this.render(e),this.load.emit(e)},error:e=>this.error.emit(e)})}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.commandLine&&(this.setPluginClass(this.element.nativeElement,fe.CommandLine),this.setPluginOptions(this.element.nativeElement,{dataFilterOutput:this.filterOutput,dataHost:this.host,dataPrompt:this.prompt,dataOutput:this.output,dataUser:this.user})),this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,fe.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(e,t){const i=e.querySelectorAll("pre");for(let s=0;s<i.length;s++){const a=t instanceof Array?t:[t];i.item(s).classList.add(...a)}}setPluginOptions(e,t){const i=e.querySelectorAll("pre");for(let s=0;s<i.length;s++)Object.keys(t).forEach(a=>{const l=t[a];if(l){const h=this.toLispCase(a);i.item(s).setAttribute(h,l.toString())}})}toLispCase(e){const t=e.match(/([A-Z])/g);if(!t)return e;let i=e.toString();for(let s=0,a=t.length;s<a;s++)i=i.replace(new RegExp(t[s]),"-"+t[s].toLowerCase());return"-"===i.slice(0,1)&&(i=i.slice(1)),i}}return o.\u0275fac=function(e){return new(e||o)(r.\u0275\u0275directiveInject(r.ElementRef),r.\u0275\u0275directiveInject(ye),r.\u0275\u0275directiveInject(r.ViewContainerRef))},o.\u0275cmp=r.\u0275\u0275defineComponent({type:o,selectors:[["markdown"],["","markdown",""]],inputs:{data:"data",src:"src",disableSanitizer:"disableSanitizer",inline:"inline",srcRelativeLink:"srcRelativeLink",clipboard:"clipboard",clipboardButtonComponent:"
1clipboardButtonComponent",clipboardButtonTemplate:"clipboardButtonTemplate",emoji:"emoji",katex:"katex",katexOptions:"katexOptions",mermaid:"mermaid",mermaidOptions:"mermaidOptions",lineHighlight:"lineHighlight",line:"line",lineOffset:"lineOffset",lineNumbers:"lineNumbers",start:"start",commandLine:"commandLine",filterOutput:"filterOutput",host:"host",prompt:"prompt",output:"output",user:"user"},outputs:{error:"error",load:"load",ready:"ready"},features:[r.\u0275\u0275NgOnChangesFeature],ngContentSelectors:Ue,decls:1,vars:0,template:function(e,t){1&e&&(r.\u0275\u0275projectionDef(),r.\u0275\u0275projection(0))},encapsulation:2}),o})(),Ye=(()=>{class o{static forRoot(e){return{ngModule:o,providers:[ye,e&&e.loader||[],e&&e.clipboardOptions||[],e&&e.markedOptions||[],{provide:$e,useValue:e&&null!=e.sanitize?e.sanitize:r.SecurityContext.HTML}]}}static forChild(){return{ngModule:o}}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=r.\u0275\u0275defineNgModule({type:o}),o.\u0275inj=r.\u0275\u0275defineInjector({imports:[I.ez]}),o})();var Ne;!function(o){let n;var i;let e,t;(i=n=o.SecurityLevel||(o.SecurityLevel={})).Strict="strict",i.Loose="loose",i.Antiscript="antiscript",i.Sandbox="sandbox",function(i){i.Base="base",i.Forest="forest",i.Dark="dark",i.Default="default",i.Neutral="neutral"}(e=o.Theme||(o.Theme={})),function(i){i[i.Debug=1]="Debug",i[i.Info=2]="Info",i[i.Warn=3]="Warn",i[i.Error=4]="Error",i[i.Fatal=5]="Fatal"}(t=o.LogLevel||(o.LogLevel={}))}(Ne||(Ne={}))}}]); 2//# sourceMappingURL=284.dd67dff6337d1195.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.