67 lines
50 KiB
Python
67 lines
50 KiB
Python
var qe=Object.defineProperty;var De=(d,e,t)=>e in d?qe(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var v=(d,e,t)=>De(d,typeof e!="symbol"?e+"":e,t);import{c as _e,_ as Pe,u as Fe,s as Ze,r as q,o as Oe,w as Ue,a as Qe,b as I,d as p,n as k,e as f,f as _,g as He,h as Ne,v as Ve,i as Y,t as D,j as U,k as Z,T as oe,l as Ge,m as Xe,p as C,X as ge,q as We,F as Ke,x as Je,y as Ye,z as et,A as tt}from"./index-Bc16PySq.js";import{c as Q,u as nt,S as st,C as it,a as rt,Q as ot,E as lt}from"./_commonjsHelpers-Dc3PgdUR.js";import{B as at}from"./box-6VpOP-P-.js";import{F as xe}from"./file-CaBge1rk.js";import{H as ct,T as ut}from"./trash-CFpSmyrz.js";/**
|
|
* @license lucide-vue-next v0.445.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const pt=_e("ArrowRightIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
* @license lucide-vue-next v0.445.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ke=_e("DownloadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);var $e={exports:{}};(function(d,e){(function(t,n){n()})(Q,function(){function t(c,l){return typeof l>"u"?l={autoBom:!1}:typeof l!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),l={autoBom:!l}),l.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function n(c,l,u){var h=new XMLHttpRequest;h.open("GET",c),h.responseType="blob",h.onload=function(){a(h.response,l,u)},h.onerror=function(){console.error("could not download file")},h.send()}function s(c){var l=new XMLHttpRequest;l.open("HEAD",c,!1);try{l.send()}catch{}return 200<=l.status&&299>=l.status}function i(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var l=document.createEvent("MouseEvents");l.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(l)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Q=="object"&&Q.global===Q?Q:void 0,o=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,l,u){var h=r.URL||r.webkitURL,g=document.createElement("a");l=l||c.name||"download",g.download=l,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?i(g):s(g.href)?n(c,l,u):i(g,g.target="_blank")):(g.href=h.createObjectURL(c),setTimeout(function(){h.revokeObjectURL(g.href)},4e4),setTimeout(function(){i(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,l,u){if(l=l||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(t(c,u),l);else if(s(c))n(c,l,u);else{var h=document.createElement("a");h.href=c,h.target="_blank",setTimeout(function(){i(h)})}}:function(c,l,u,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof c=="string")return n(c,l,u);var g=c.type==="application/octet-stream",w=/constructor/i.test(r.HTMLElement)||r.safari,R=/CriOS\/[\d]+/.test(navigator.userAgent);if((R||g&&w||o)&&typeof FileReader<"u"){var T=new FileReader;T.onloadend=function(){var E=T.result;E=R?E:E.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=E:location=E,h=null},T.readAsDataURL(c)}else{var B=r.URL||r.webkitURL,M=B.createObjectURL(c);h?h.location=M:location.href=M,h=null,setTimeout(function(){B.revokeObjectURL(M)},4e4)}});r.saveAs=a.saveAs=a,d.exports=a})})($e);var ht=$e.exports;function ae(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let F=ae();function Re(d){F=d}const Te=/[&<>"']/,dt=new RegExp(Te.source,"g"),ze=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ft=new RegExp(ze.source,"g"),gt={"&":"&","<":"<",">":">",'"':""","'":"'"},be=d=>gt[d];function z(d,e){if(e){if(Te.test(d))return d.replace(dt,be)}else if(ze.test(d))return d.replace(ft,be);return d}const xt=/(^|[^\[])\^/g;function y(d,e){let t=typeof d=="string"?d:d.source;e=e||"";const n={replace:(s,i)=>{let r=typeof i=="string"?i:i.source;return r=r.replace(xt,"$1"),t=t.replace(s,r),n},getRegex:()=>new RegExp(t,e)};return n}function we(d){try{d=encodeURI(d).replace(/%25/g,"%")}catch{return null}return d}const V={exec:()=>null};function me(d,e){const t=d.replace(/\|/g,(i,r,o)=>{let a=!1,c=r;for(;--c>=0&&o[c]==="\\";)a=!a;return a?"|":" |"}),n=t.split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(/\\\|/g,"|");return n}function H(d,e,t){const n=d.length;if(n===0)return"";let s=0;for(;s<n;){const i=d.charAt(n-s-1);if(i===e&&!t)s++;else if(i!==e&&t)s++;else break}return d.slice(0,n-s)}function kt(d,e){if(d.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<d.length;n++)if(d[n]==="\\")n++;else if(d[n]===e[0])t++;else if(d[n]===e[1]&&(t--,t<0))return n;return-1}function ye(d,e,t,n){const s=e.href,i=e.title?z(e.title):null,r=d[1].replace(/\\([\[\]])/g,"$1");if(d[0].charAt(0)!=="!"){n.state.inLink=!0;const o={type:"link",raw:t,href:s,title:i,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,o}return{type:"image",raw:t,href:s,title:i,text:z(r)}}function bt(d,e){const t=d.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
|
|
`).map(s=>{const i=s.match(/^\s+/);if(i===null)return s;const[r]=i;return r.length>=n.length?s.slice(n.length):s}).join(`
|
|
`)}class te{constructor(e){v(this,"options");v(this,"rules");v(this,"lexer");this.options=e||F}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^(?: {1,4}| {0,3}\t)/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:H(n,`
|
|
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=bt(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const s=H(n,"#");(this.options.pedantic||!s||/ $/.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:H(t[0],`
|
|
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=H(t[0],`
|
|
`).split(`
|
|
`),s="",i="";const r=[];for(;n.length>0;){let o=!1;const a=[];let c;for(c=0;c<n.length;c++)if(/^ {0,3}>/.test(n[c]))a.push(n[c]),o=!0;else if(!o)a.push(n[c]);else break;n=n.slice(c);const l=a.join(`
|
|
`),u=l.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
|
$1`).replace(/^ {0,3}>[ \t]?/gm,"");s=s?`${s}
|
|
${l}`:l,i=i?`${i}
|
|
${u}`:u;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,r,!0),this.lexer.state.top=h,n.length===0)break;const g=r[r.length-1];if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){const w=g,R=w.raw+`
|
|
`+n.join(`
|
|
`),T=this.blockquote(R);r[r.length-1]=T,s=s.substring(0,s.length-w.raw.length)+T.raw,i=i.substring(0,i.length-w.text.length)+T.text;break}else if((g==null?void 0:g.type)==="list"){const w=g,R=w.raw+`
|
|
`+n.join(`
|
|
`),T=this.list(R);r[r.length-1]=T,s=s.substring(0,s.length-g.raw.length)+T.raw,i=i.substring(0,i.length-w.raw.length)+T.raw,n=R.substring(r[r.length-1].raw.length).split(`
|
|
`);continue}}return{type:"blockquote",raw:s,tokens:r,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const r=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let o=!1;for(;e;){let a=!1,c="",l="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let u=t[2].split(`
|
|
`,1)[0].replace(/^\t+/,B=>" ".repeat(3*B.length)),h=e.split(`
|
|
`,1)[0],g=!u.trim(),w=0;if(this.options.pedantic?(w=2,l=u.trimStart()):g?w=t[1].length+1:(w=t[2].search(/[^ ]/),w=w>4?1:w,l=u.slice(w),w+=t[1].length),g&&/^[ \t]*$/.test(h)&&(c+=h+`
|
|
`,e=e.substring(h.length+1),a=!0),!a){const B=new RegExp(`^ {0,${Math.min(3,w-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),M=new RegExp(`^ {0,${Math.min(3,w-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),E=new RegExp(`^ {0,${Math.min(3,w-1)}}(?:\`\`\`|~~~)`),K=new RegExp(`^ {0,${Math.min(3,w-1)}}#`),re=new RegExp(`^ {0,${Math.min(3,w-1)}}<[a-z].*>`,"i");for(;e;){const O=e.split(`
|
|
`,1)[0];let L;if(h=O,this.options.pedantic?(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," "),L=h):L=h.replace(/\t/g," "),E.test(h)||K.test(h)||re.test(h)||B.test(h)||M.test(h))break;if(L.search(/[^ ]/)>=w||!h.trim())l+=`
|
|
`+L.slice(w);else{if(g||u.replace(/\t/g," ").search(/[^ ]/)>=4||E.test(u)||K.test(u)||M.test(u))break;l+=`
|
|
`+h}!g&&!h.trim()&&(g=!0),c+=O+`
|
|
`,e=e.substring(O.length+1),u=L.slice(w)}}i.loose||(o?i.loose=!0:/\n[ \t]*\n[ \t]*$/.test(c)&&(o=!0));let R=null,T;this.options.gfm&&(R=/^\[[ xX]\] /.exec(l),R&&(T=R[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:c,task:!!R,checked:T,loose:!1,text:l,tokens:[]}),i.raw+=c}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let a=0;a<i.items.length;a++)if(this.lexer.state.top=!1,i.items[a].tokens=this.lexer.blockTokens(i.items[a].text,[]),!i.loose){const c=i.items[a].tokens.filter(u=>u.type==="space"),l=c.length>0&&c.some(u=>/\n.*\n/.test(u.raw));i.loose=l}if(i.loose)for(let a=0;a<i.items.length;a++)i.items[a].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),s=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:i}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=me(t[1]),s=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
|
|
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const o of s)/^ *-+: *$/.test(o)?r.align.push("right"):/^ *:-+: *$/.test(o)?r.align.push("center"):/^ *:-+ *$/.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:r.align[o]});for(const o of i)r.rows.push(me(o,r.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[c]})));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:z(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const r=H(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else{const r=kt(t[2],"()");if(r>-1){const a=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let s=t[2],i="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);r&&(s=r[1],i=r[3])}else i=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(this.options.pedantic&&!/>$/.test(n)?s=s.slice(1):s=s.slice(1,-1)),ye(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const s=(n[2]||n[1]).replace(/\s+/g," "),i=t[s.toLowerCase()];if(!i){const r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return ye(n,i,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const r=[...s[0]].length-1;let o,a,c=r,l=0;const u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);(s=u.exec(t))!=null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(a=[...o].length,s[3]||s[4]){c+=a;continue}else if((s[5]||s[6])&&r%3&&!((r+a)%3)){l+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+l);const h=[...s[0]][0].length,g=e.slice(0,r+s.index+h+a);if(Math.min(r,a)%2){const R=g.slice(1,-1);return{type:"em",raw:g,text:R,tokens:this.lexer.inlineTokens(R)}}const w=g.slice(2,-2);return{type:"strong",raw:g,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const s=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return s&&i&&(n=n.substring(1,n.length-1)),n=z(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=z(t[1]),s="mailto:"+n):(n=z(t[1]),s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let s,i;if(t[2]==="@")s=z(t[0]),i="mailto:"+s;else{let r;do r=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(r!==t[0]);s=z(t[0]),t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=z(t[0]),{type:"text",raw:t[0],text:n}}}}const wt=/^(?:[ \t]*(?:\n|$))+/,mt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,yt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,X=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Se=/(?:[*+-]|\d{1,9}[.)])/,Ae=y(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Se).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ce=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_t=/^[^\n]+/,ue=/(?!\s*\])(?:\\.|[^\[\]\\])+/,$t=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ue).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rt=y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Se).getRegex(),ie="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",pe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Tt=y("^ {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|$))","i").replace("comment",pe).replace("tag",ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ee=y(ce).replace("hr",X).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),zt=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ee).getRegex(),he={blockquote:zt,code:mt,def:$t,fences:yt,heading:vt,hr:X,html:Tt,lheading:Ae,list:Rt,newline:wt,paragraph:Ee,table:V,text:_t},ve=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",X).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",ie).getRegex(),St={...he,table:ve,paragraph:y(ce).replace("hr",X).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ve).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",ie).getRegex()},At={...he,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe).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:V,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(ce).replace("hr",X).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",Ae).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Le=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Et=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ie=/^( {2,}|\\)\n(?!\s*$)/,Lt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W="\\p{P}\\p{S}",It=y(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,W).getRegex(),Ct=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Bt=y(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,W).getRegex(),Mt=y("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,W).getRegex(),jt=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,W).getRegex(),qt=y(/\\([punct])/,"gu").replace(/punct/g,W).getRegex(),Dt=y(/^<(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(),Pt=y(pe).replace("(?:-->|$)","-->").getRegex(),Ft=y("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Pt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ne=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Zt=y(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ne).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ce=y(/^!?\[(label)\]\[(ref)\]/).replace("label",ne).replace("ref",ue).getRegex(),Be=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",ue).getRegex(),Ot=y("reflink|nolink(?!\\()","g").replace("reflink",Ce).replace("nolink",Be).getRegex(),de={_backpedal:V,anyPunctuation:qt,autolink:Dt,blockSkip:Ct,br:Ie,code:Et,del:V,emStrongLDelim:Bt,emStrongRDelimAst:Mt,emStrongRDelimUnd:jt,escape:Le,link:Zt,nolink:Be,punctuation:It,reflink:Ce,reflinkSearch:Ot,tag:Ft,text:Lt,url:V},Ut={...de,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",ne).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne).getRegex()},le={...de,escape:y(Le).replace("])","~|])").getRegex(),url:y(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Qt={...le,br:y(Ie).replace("{2,}","*").getRegex(),text:y(le.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ee={normal:he,gfm:St,pedantic:At},N={normal:de,gfm:le,breaks:Qt,pedantic:Ut};class S{constructor(e){v(this,"tokens");v(this,"options");v(this,"state");v(this,"tokenizer");v(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||F,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 t={block:ee.normal,inline:N.normal};this.options.pedantic?(t.block=ee.pedantic,t.inline=N.pedantic):this.options.gfm&&(t.block=ee.gfm,this.options.breaks?t.inline=N.breaks:t.inline=N.gfm),this.tokenizer.rules=t}static get rules(){return{block:ee,inline:N}}static lex(e,t){return new S(t).lex(e)}static lexInline(e,t){return new S(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
|
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.options.pedantic&&(e=e.replace(/\t/g," ").replace(/^ +$/gm,""));let s,i,r;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(o=>(s=o.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length),s.raw.length===1&&t.length>0?t[t.length-1].raw+=`
|
|
`:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
|
`+s.raw,i.text+=`
|
|
`+s.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
|
`+s.raw,i.text+=`
|
|
`+s.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(r=e,this.options.extensions&&this.options.extensions.startBlock){let o=1/0;const a=e.slice(1);let c;this.options.extensions.startBlock.forEach(l=>{c=l.call({lexer:this},a),typeof c=="number"&&c>=0&&(o=Math.min(o,c))}),o<1/0&&o>=0&&(r=e.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(r))){i=t[t.length-1],n&&(i==null?void 0:i.type)==="paragraph"?(i.raw+=`
|
|
`+s.raw,i.text+=`
|
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(s),n=r.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length),i=t[t.length-1],i&&i.type==="text"?(i.raw+=`
|
|
`+s.raw,i.text+=`
|
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(s);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,i,r=e,o,a,c;if(this.tokens.links){const l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(c=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(l=>(n=l.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,r,c)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let l=1/0;const u=e.slice(1);let h;this.options.extensions.startInline.forEach(g=>{h=g.call({lexer:this},u),typeof h=="number"&&h>=0&&(l=Math.min(l,h))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),a=!0,s=t[t.length-1],s&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return t}}class se{constructor(e){v(this,"options");v(this,"parser");this.options=e||F}space(e){return""}code({text:e,lang:t,escaped:n}){var r;const s=(r=(t||"").match(/^\S*/))==null?void 0:r[0],i=e.replace(/\n$/,"")+`
|
|
`;return s?'<pre><code class="language-'+z(s)+'">'+(n?i:z(i,!0))+`</code></pre>
|
|
`:"<pre><code>"+(n?i:z(i,!0))+`</code></pre>
|
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
${this.parser.parse(e)}</blockquote>
|
|
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
`}hr(e){return`<hr>
|
|
`}list(e){const t=e.ordered,n=e.start;let s="";for(let o=0;o<e.items.length;o++){const a=e.items[o];s+=this.listitem(a)}const i=t?"ol":"ul",r=t&&n!==1?' start="'+n+'"':"";return"<"+i+r+`>
|
|
`+s+"</"+i+`>
|
|
`}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let s="";for(let i=0;i<e.rows.length;i++){const r=e.rows[i];n="";for(let o=0;o<r.length;o++)n+=this.tablecell(r[o]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
<thead>
|
|
`+t+`</thead>
|
|
`+s+`</table>
|
|
`}tablerow({text:e}){return`<tr>
|
|
${e}</tr>
|
|
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const s=this.parser.parseInline(n),i=we(e);if(i===null)return s;e=i;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+s+"</a>",r}image({href:e,title:t,text:n}){const s=we(e);if(s===null)return n;e=s;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class fe{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class A{constructor(e){v(this,"options");v(this,"renderer");v(this,"textRenderer");this.options=e||F,this.options.renderer=this.options.renderer||new se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new fe}static parse(e,t){return new A(t).parse(e)}static parseInline(e,t){return new A(t).parseInline(e)}parse(e,t=!0){let n="";for(let s=0;s<e.length;s++){const i=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){n+=a||"";continue}}const r=i;switch(r.type){case"space":{n+=this.renderer.space(r);continue}case"hr":{n+=this.renderer.hr(r);continue}case"heading":{n+=this.renderer.heading(r);continue}case"code":{n+=this.renderer.code(r);continue}case"table":{n+=this.renderer.table(r);continue}case"blockquote":{n+=this.renderer.blockquote(r);continue}case"list":{n+=this.renderer.list(r);continue}case"html":{n+=this.renderer.html(r);continue}case"paragraph":{n+=this.renderer.paragraph(r);continue}case"text":{let o=r,a=this.renderer.text(o);for(;s+1<e.length&&e[s+1].type==="text";)o=e[++s],a+=`
|
|
`+this.renderer.text(o);t?n+=this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a}]}):n+=a;continue}default:{const o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let s=0;s<e.length;s++){const i=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=o||"";continue}}const r=i;switch(r.type){case"escape":{n+=t.text(r);break}case"html":{n+=t.html(r);break}case"link":{n+=t.link(r);break}case"image":{n+=t.image(r);break}case"strong":{n+=t.strong(r);break}case"em":{n+=t.em(r);break}case"codespan":{n+=t.codespan(r);break}case"br":{n+=t.br(r);break}case"del":{n+=t.del(r);break}case"text":{n+=t.text(r);break}default:{const o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}}class G{constructor(e){v(this,"options");v(this,"block");this.options=e||F}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?S.lex:S.lexInline}provideParser(){return this.block?A.parse:A.parseInline}}v(G,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Ht{constructor(...e){v(this,"defaults",ae());v(this,"options",this.setOptions);v(this,"parse",this.parseMarkdown(!0));v(this,"parseInline",this.parseMarkdown(!1));v(this,"Parser",A);v(this,"Renderer",se);v(this,"TextRenderer",fe);v(this,"Lexer",S);v(this,"Tokenizer",te);v(this,"Hooks",G);this.use(...e)}walkTokens(e,t){var s,i;let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const o=r;for(const a of o.header)n=n.concat(this.walkTokens(a.tokens,t));for(const a of o.rows)for(const c of a)n=n.concat(this.walkTokens(c.tokens,t));break}case"list":{const o=r;n=n.concat(this.walkTokens(o.items,t));break}default:{const o=r;(i=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&i[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{const c=o[a].flat(1/0);n=n.concat(this.walkTokens(c,t))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const r=t.renderers[i.name];r?t.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[i.level];r?r.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),s.extensions=t),n.renderer){const i=this.defaults.renderer||new se(this.defaults);for(const r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const o=r,a=n.renderer[o],c=i[o];i[o]=(...l)=>{let u=a.apply(i,l);return u===!1&&(u=c.apply(i,l)),u||""}}s.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new te(this.defaults);for(const r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const o=r,a=n.tokenizer[o],c=i[o];i[o]=(...l)=>{let u=a.apply(i,l);return u===!1&&(u=c.apply(i,l)),u}}s.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new G;for(const r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const o=r,a=n.hooks[o],c=i[o];G.passThroughHooks.has(r)?i[o]=l=>{if(this.defaults.async)return Promise.resolve(a.call(i,l)).then(h=>c.call(i,h));const u=a.call(i,l);return c.call(i,u)}:i[o]=(...l)=>{let u=a.apply(i,l);return u===!1&&(u=c.apply(i,l)),u}}s.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return S.lex(e,t??this.defaults)}parser(e,t){return A.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{const i={...s},r={...this.defaults,...i},o=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));r.hooks&&(r.hooks.options=r,r.hooks.block=e);const a=r.hooks?r.hooks.provideLexer():e?S.lex:S.lexInline,c=r.hooks?r.hooks.provideParser():e?A.parse:A.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(l=>a(l,r)).then(l=>r.hooks?r.hooks.processAllTokens(l):l).then(l=>r.walkTokens?Promise.all(this.walkTokens(l,r.walkTokens)).then(()=>l):l).then(l=>c(l,r)).then(l=>r.hooks?r.hooks.postprocess(l):l).catch(o);try{r.hooks&&(n=r.hooks.preprocess(n));let l=a(n,r);r.hooks&&(l=r.hooks.processAllTokens(l)),r.walkTokens&&this.walkTokens(l,r.walkTokens);let u=c(l,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(l){return o(l)}}}onError(e,t){return n=>{if(n.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}}const P=new Ht;function m(d,e){return P.parse(d,e)}m.options=m.setOptions=function(d){return P.setOptions(d),m.defaults=P.defaults,Re(m.defaults),m};m.getDefaults=ae;m.defaults=F;m.use=function(...d){return P.use(...d),m.defaults=P.defaults,Re(m.defaults),m};m.walkTokens=function(d,e){return P.walkTokens(d,e)};m.parseInline=P.parseInline;m.Parser=A;m.parser=A.parse;m.Renderer=se;m.TextRenderer=fe;m.Lexer=S;m.lexer=S.lex;m.Tokenizer=te;m.Hooks=G;m.parse=m;m.options;m.setOptions;m.use;m.walkTokens;m.parseInline;A.parse;S.lex;const Nt={class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300"},Vt={class:"w-full max-w-md relative z-10"},Gt={class:"p-8"},Xt={class:"flex justify-center mb-8"},Wt={class:"rounded-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 p-1 animate-spin-slow"},Kt={class:"rounded-full bg-gray-900 p-2"},Jt={class:"mb-6 relative"},Yt={class:"relative"},en=["readonly"],tn={key:0,class:"absolute inset-y-0 right-0 flex items-center pr-3"},nn=["disabled"],sn={class:"flex items-center justify-center relative z-10"},rn={class:"mt-6 text-center"},on={class:"flex-grow overflow-y-auto p-6"},ln={class:"flex-shrink-0 mr-4"},an={class:"flex-grow min-w-0 mr-4"},cn={class:"flex-shrink-0 flex space-x-2"},un=["onClick"],pn=["onClick"],hn=["onClick"],dn={key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},fn={class:"space-y-4"},gn={class:"flex items-center"},xn={class:"flex items-center"},kn={class:"flex items-center"},bn={class:"flex items-center"},wn={key:0,class:"ml-2"},mn={key:1},yn=["href"],vn={class:"mt-6 flex flex-col items-center"},_n={class:"bg-white p-2 rounded-lg shadow-md"},$n={key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},Rn={class:"flex justify-between items-center mb-4"},Tn=["innerHTML"],zn={__name:"RetrievewFileView",setup(d){const e=Fe(),t=window.location.origin,n=Ye(),s=et("isDarkMode"),i=nt(),{receiveData:r}=Ze(i),o=q(""),a=q({readonly:!1,loading:!1}),c=q(!1),l=q(""),u=q(null),h=q(!1),g=Ge(),w=r;Oe(()=>{const b=g.query.code;b&&(o.value=b)}),Ue(o,b=>{b.length===5&&R()});const R=async()=>{if(o.value.length!==5){e.showAlert("请输入5位取件码","error");return}a.value.readonly=!0,a.value.loading=!0;try{const b=await tt.post("/share/select/",{code:o.value});if(b.code===200)if(b.detail){const x=b.detail.text.startsWith("/share/download"),j={id:Date.now(),code:b.detail.code,filename:b.detail.name,size:T(b.detail.size),downloadUrl:x?b.detail.text:null,content:x?null:b.detail.text,date:new Date().toLocaleString()};let $=!0;i.receiveData.forEach(J=>{if(J.code===j.code){$=!1;return}}),$&&i.addReceiveData(j),h.value=!0,e.showAlert("文件获取成功","success")}else e.showAlert("无效的取件码","error");else e.showAlert(b.detail||"获取文件失败","error")}catch(b){console.error("取件失败:",b),e.showAlert("取件失败,请稍后重试","error")}finally{a.value.readonly=!1,a.value.loading=!1,o.value=""}},T=b=>{if(b===0)return"0 Bytes";const x=1024,j=["Bytes","KB","MB","GB","TB"],$=Math.floor(Math.log(b)/Math.log(x));return parseFloat((b/Math.pow(x,$)).toFixed(2))+" "+j[$]},B=b=>{u.value=b},M=b=>{const x=w.value.findIndex(j=>j.id===b);x!==-1&&i.deleteReceiveData(x)},E=()=>{h.value=!h.value},K=()=>{n.push("/send")},re=b=>`${t}${b.downloadUrl}`,O=b=>{if(b.downloadUrl)window.open(`${t}${b.downloadUrl}`,"_blank");else if(b.content){const x=new Blob([b.content],{type:"text/plain;charset=utf-8"});ht.saveAs(x,`${b.filename}.txt`)}},L=q(!1),Me=Qe(()=>u.value&&u.value.content?m(u.value.content):""),je=()=>{L.value=!0};return(b,x)=>{const j=Xe("router-link");return C(),I("div",Nt,[p("div",Vt,[p("div",{class:k(["rounded-3xl shadow-2xl overflow-hidden border transform transition-all duration-300",[f(s)?"bg-gray-800 bg-opacity-50 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200"]])},[p("div",Gt,[p("div",Xt,[p("div",Wt,[p("div",Kt,[_(f(at),{class:"w-8 h-8 text-white"})])])]),p("h2",{onClick:K,class:k(["text-3xl cursor-pointer font-extrabold text-center mb-6",[f(s)?"text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300":"text-indigo-600"]])}," FileCodeBox ",2),p("form",{onSubmit:He(R,["prevent"])},[p("div",Jt,[p("label",{for:"code",class:k(["block text-sm font-medium mb-2",[f(s)?"text-gray-300":"text-gray-800"]])},"取件码",2),p("div",Yt,[Ne(p("input",{id:"code","onUpdate:modelValue":x[0]||(x[0]=$=>o.value=$),type:"text",class:k(["w-full px-4 py-3 rounded-lg placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 pr-10",[f(s)?"bg-gray-700 bg-opacity-50":"bg-gray-100",{"ring-2 ring-red-500":l.value},f(s)?"text-gray-300":"text-gray-800"]]),placeholder:"请输入5位取件码",required:"",readonly:a.value.readonly,maxlength:"5",onFocus:x[1]||(x[1]=$=>c.value=!0),onBlur:x[2]||(x[2]=$=>c.value=!1)},null,42,en),[[Ve,o.value]]),a.value.loading?(C(),I("div",tn,x[5]||(x[5]=[p("span",{class:"animate-spin rounded-full h-5 w-5 border-b-2 border-indigo-500"},null,-1)]))):Y("",!0)]),p("div",{class:k(["absolute -bottom-0.5 left-2 h-0.5 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 transition-all duration-300 ease-in-out",{"w-97-100":c.value,"w-0":!c.value}])},null,2)]),p("button",{type:"submit",class:"w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-3 px-4 rounded-lg hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group",disabled:a.value.loading},[p("span",sn,[p("span",null,D(a.value.loading?"处理中...":"提取文件"),1),_(f(pt),{class:"w-5 h-5 ml-2 transition-transform duration-300 transform group-hover:translate-x-1"})]),x[6]||(x[6]=p("span",{class:"absolute top-0 left-0 w-full h-full bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 opacity-0 group-hover:opacity-100 transition-opacity duration-300"},null,-1))],8,nn)],32),p("div",rn,[_(j,{to:"/send",class:"text-indigo-400 hover:text-indigo-300 transition duration-300"},{default:U(()=>x[7]||(x[7]=[Z(" 需要发送文件?点击这里 ")])),_:1})])]),p("div",{class:k(["px-8 py-4 bg-opacity-50 flex justify-between items-center",[f(s)?"bg-gray-800":"bg-gray-100"]])},[p("span",{class:k(["text-sm flex items-center",[f(s)?"text-gray-300":"text-gray-800"]])},[_(f(st),{class:"w-4 h-4 mr-1 text-green-400"}),x[8]||(x[8]=Z(" 安全加密 "))],2),p("button",{onClick:E,class:k(["text-sm hover:text-indigo-300 transition duration-300 flex items-center",[f(s)?"text-indigo-400":"text-indigo-600"]])},[x[9]||(x[9]=Z(" 取件记录 ")),_(f(it),{class:"w-4 h-4 ml-1"})],2)],2)],2)]),_(oe,{name:"drawer"},{default:U(()=>[h.value?(C(),I("div",{key:0,class:k(["fixed inset-y-0 right-0 w-full sm:w-120 bg-opacity-70 backdrop-filter backdrop-blur-xl shadow-2xl z-50 overflow-hidden flex flex-col",[f(s)?"bg-gray-900":"bg-white"]])},[p("div",{class:k(["flex justify-between items-center p-6 border-b",[f(s)?"border-gray-700":"border-gray-200"]])},[p("h3",{class:k(["text-2xl font-bold",[f(s)?"text-white":"text-gray-800"]])}," 取件记录 ",2),p("button",{onClick:E,class:k(["hover:text-white transition duration-300",[f(s)?"text-gray-400":"text-gray-800"]])},[_(f(ge),{class:"w-6 h-6"})],2)],2),p("div",on,[_(We,{name:"list",tag:"div",class:"space-y-4"},{default:U(()=>[(C(!0),I(Ke,null,Je(f(w),$=>(C(),I("div",{key:$.id,class:k(["bg-opacity-50 rounded-lg p-4 flex items-center shadow-md hover:shadow-lg transition duration-300 transform hover:scale-102",[f(s)?"bg-gray-800 hover:bg-gray-700":"bg-gray-100 hover:bg-white"]])},[p("div",ln,[_(f(xe),{class:k(["w-10 h-10",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])]),p("div",an,[p("p",{class:k(["font-medium text-lg truncate",[f(s)?"text-white":"text-gray-800"]])},D($.filename),3),p("p",{class:k(["text-sm truncate",[f(s)?"text-gray-400":"text-gray-600"]])},D($.date)+" · "+D($.size),3)]),p("div",cn,[p("button",{onClick:J=>B($),class:k(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[f(s)?"hover:bg-indigo-400 text-indigo-400":"hover:bg-indigo-100 text-indigo-600"]])},[_(f(lt),{class:"w-5 h-5"})],10,un),p("button",{onClick:J=>O($),class:k(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[f(s)?"hover:bg-green-400 text-green-400":"hover:bg-green-100 text-green-600"]])},[_(f(ke),{class:"w-5 h-5"})],10,pn),p("button",{onClick:J=>M($.id),class:k(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[f(s)?"hover:bg-red-400 text-red-400":"hover:bg-red-100 text-red-600"]])},[_(f(ut),{class:"w-5 h-5"})],10,hn)])],2))),128))]),_:1})])],2)):Y("",!0)]),_:1}),_(oe,{name:"fade"},{default:U(()=>[u.value?(C(),I("div",dn,[p("div",{class:k(["p-8 rounded-2xl max-w-md w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg bg-opacity-70 overflow-hidden",[f(s)?"bg-gray-800":"bg-white"]])},[p("h3",{class:k(["text-2xl font-bold mb-6 truncate",[f(s)?"text-white":"text-gray-800"]])}," 文件详情 ",2),p("div",fn,[p("div",gn,[_(f(xe),{class:k(["w-6 h-6 mr-3 flex-shrink-0",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),p("p",{class:k([[f(s)?"text-gray-300":"text-gray-800"],"truncate flex-grow"])},[x[10]||(x[10]=p("span",{class:"font-medium"},"文件名:",-1)),Z(D(u.value.filename),1)],2)]),p("div",xn,[_(f(rt),{class:k(["w-6 h-6 mr-3 flex-shrink-0",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),p("p",{class:k([[f(s)?"text-gray-300":"text-gray-800"],"truncate flex-grow"])},[x[11]||(x[11]=p("span",{class:"font-medium"},"取件日期:",-1)),Z(D(u.value.date),1)],2)]),p("div",kn,[_(f(ct),{class:k(["w-6 h-6 mr-3 flex-shrink-0",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),p("p",{class:k([[f(s)?"text-gray-300":"text-gray-800"],"truncate flex-grow"])},[x[12]||(x[12]=p("span",{class:"font-medium"},"文件大小:",-1)),Z(D(u.value.size),1)],2)]),p("div",bn,[_(f(ke),{class:k(["w-6 h-6 mr-3",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),p("p",{class:k([f(s)?"text-gray-300":"text-gray-800"])},x[13]||(x[13]=[p("span",{class:"font-medium"},"文件内容:",-1)]),2),u.value.filename=="Text"?(C(),I("div",wn,[p("button",{onClick:je,class:"px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"}," 预览内容 ")])):(C(),I("div",mn,[p("a",{href:`${f(t)}${u.value.downloadUrl}`,target:"_blank",rel:"noopener noreferrer",class:"px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"}," 点击下载 ",8,yn)]))])]),p("div",vn,[p("h4",{class:k(["text-lg font-semibold mb-3",[f(s)?"text-white":"text-gray-800"]])}," 取件二维码 ",2),p("div",_n,[_(ot,{value:re(u.value),size:128,level:"M"},null,8,["value"])]),p("p",{class:k(["mt-2 text-sm",[f(s)?"text-gray-400":"text-gray-600"]])}," 扫描二维码快速取件 ",2)]),p("button",{onClick:x[3]||(x[3]=$=>u.value=null),class:"mt-8 w-full bg-gradient-to-r from-indigo-500 to-purple-600 text-white px-6 py-3 rounded-lg font-medium hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105"}," 关闭 ")],2)])):Y("",!0)]),_:1}),_(oe,{name:"fade"},{default:U(()=>[L.value?(C(),I("div",$n,[p("div",{class:k(["p-8 rounded-2xl max-w-3xl w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg bg-opacity-70 max-h-[80vh] overflow-y-auto",[f(s)?"bg-gray-800":"bg-white"]])},[p("div",Rn,[p("h3",{class:k(["text-2xl font-bold",[f(s)?"text-white":"text-gray-800"]])}," 内容预览 ",2),p("button",{onClick:x[4]||(x[4]=$=>L.value=!1),class:"text-gray-500 hover:text-gray-700"},[_(f(ge),{class:"w-6 h-6"})])]),p("div",{class:k(["prose max-w-none",[f(s)?"prose-invert":""]]),innerHTML:Me.value},null,10,Tn)],2)])):Y("",!0)]),_:1})])}}},Bn=Pe(zn,[["__scopeId","data-v-5f485ea4"]]);export{Bn as default};
|