text/js/latex-BidkzKI9.chunk.mjs

3 строки
3.9 KiB
JavaScript

/*! third party licenses: js/vendor.LICENSE.txt */
import{g as N}from"./emoji-picker-SoWZqoso.chunk.mjs";function E(n,g){for(var o=0;o<g.length;o++){const i=g[o];if(typeof i!="string"&&!Array.isArray(i)){for(const a in i)if(a!=="default"&&!(a in n)){const c=Object.getOwnPropertyDescriptor(i,a);c&&Object.defineProperty(n,a,c.get?c:{enumerable:!0,get:()=>i[a]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}function O(n){const g=n.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(e=>e+"(?![a-zA-Z@:_])")),o=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map(e=>e+"(?![a-zA-Z:_])").join("|")),i=[{begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}],a=[{begin:/\^{6}[0-9a-f]{6}/},{begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/},{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],c={className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0,begin:g},{endsParent:!0,begin:o},{endsParent:!0,variants:a},{endsParent:!0,relevance:0,variants:i}]},A={className:"params",relevance:0,begin:/#+\d?/},P={variants:a},h={className:"built_in",relevance:0,begin:/[$&^_]/},Z={className:"meta",begin:/% ?!(T[eE]X|tex|BIB|bib)/,end:"$",relevance:10},x=n.COMMENT("%","$",{relevance:0}),b=[c,A,P,h,Z,x],u={begin:/\{/,end:/\}/,relevance:0,contains:["self",...b]},w=n.inherit(u,{relevance:0,endsParent:!0,contains:[u,...b]}),y={begin:/\[/,end:/\]/,endsParent:!0,relevance:0,contains:[u,...b]},_={begin:/\s+/,relevance:0},l=[w],f=[y],t=function(e,r){return{contains:[_],starts:{relevance:0,contains:e,starts:r}}},s=function(e,r){return{begin:"\\\\"+e+"(?![a-zA-Z@:_])",keywords:{$pattern:/\\[a-zA-Z]+/,keyword:"\\"+e},relevance:0,contains:[_],starts:r}},m=function(e,r){return n.inherit({begin:"\\\\begin(?=[ ]*(\\r?\\n[ ]*)?\\{"+e+"\\})",keywords:{$pattern:/\\[a-zA-Z]+/,keyword:"\\begin"},relevance:0},t(l,r))},v=(e="string")=>n.END_SAME_AS_BEGIN({className:e,begin:/(.|\r?\n)/,end:/(.|\r?\n)/,excludeBegin:!0,excludeEnd:!0,endsParent:!0}),p=function(e){return{className:"string",end:"(?=\\\\end\\{"+e+"\\})"}},d=(e="string")=>({relevance:0,begin:/\{/,starts:{endsParent:!0,contains:[{className:e,end:/(?=\})/,endsParent:!0,contains:[{begin:/\{/,end:/\}/,relevance:0,contains:["self"]}]}]}}),k=[...["verb","lstinline"].map(e=>s(e,{contains:[v()]})),s("mint",t(l,{contains:[v()]})),s("mintinline",t(l,{contains:[d(),v()]})),s("url",{contains:[d("link"),d("link")]}),s("hyperref",{contains:[d("link")]}),s("href",t(f,{contains:[d("link")]})),...[].concat(...["","\\*"].map(e=>[m("verbatim"+e,p("verbatim"+e)),m("filecontents"+e,t(l,p("filecontents"+e))),...["","B","L"].map(r=>m(r+"Verbatim"+e,t(f,p(r+"Verbatim"+e))))])),m("minted",t(f,t(l,p("minted"))))];return{name:"LaTeX",aliases:["tex"],contains:[...k,...b]}}var z=O;const D=N(z),B=E({__proto__:null,default:D},[z]);export{z as a,B as l};