/*---------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
"use strict";var __extends=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n};define("vs/languages/markdown/common/markdown",["require","exports","vs/editor/common/modes/monarch/monarch","vs/editor/common/modes/monarch/monarchCompile","vs/platform/thread/common/threadService","vs/platform/instantiation/common/descriptors"],function(e,t,n,r,o,i){t.language={displayName:"Markdown",name:"md",defaultToken:"",suggestSupport:{disableAutoTrigger:!0},autoClosingPairs:[],control:/[\\`*_\[\]{}()#+\-\.!]/,noncontrol:/[^\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,jsescapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],tokenizer:{root:[[/^(\s*)(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/,["white","keyword.$1","keyword.$1","keyword.$1"]],[/^\s*(=+|\-+)\s*$/,"keyword.header"],[/^\s*((\*[ ]?)+)\s*$/,"keyword.header"],[/^\s*>+/,"comment"],[/^\s*([\*\-+:]|\d+\.)\s/,"string.list"],[/^(\t|[ ]{4}).*$/,"variable"],[/^\s*~{3}\s*$/,{token:"variable",next:"@codeblock"}],[/^\s*```\s*((?:\w|[\/\-])+)\s*$/,{token:"variable",next:"@codeblockgh",nextEmbedded:"$1"}],[/^\s*`{3}\s*$/,{token:"variable",next:"@codeblock"}],{include:"@linecontent"}],codeblock:[[/^\s*~{3}\s*$/,{token:"variable",next:"@pop"}],[/^\s*`{3}\s*$/,{token:"variable",next:"@pop"}],[/.*$/,"variable.code"]],codeblockgh:[[/```\s*$/,{token:"@rematch",switchTo:"@codeblockghend",nextEmbedded:"@pop"}],[/[^`]*$/,"variable.code"]],codeblockghend:[[/\s*```/,{token:"variable.code",next:"@pop"}],[/./,"@rematch","@pop"]],linecontent:[[/&\w+;/,"string.escape"],[/@escapes/,"escape"],[/\b__([^\\_]|@escapes|_(?!_))+__\b/,"strong"],[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/,"strong"],[/\b_[^_]+_\b/,"emphasis"],[/\*([^\\*]|@escapes)+\*/,"emphasis"],[/`([^\\`]|@escapes)+`/,"variable"],[/\{[^}]+\}/,"string.target"],[/(!?\[)((?:[^\]\\]|@escapes)+)(\]\([^\)]+\))/,["string.link","","string.link"]],[/(!?\[)((?:[^\]\\]|@escapes)+)(\])/,"string.link"],{include:"html"}],html:[[/<(\w+)\/>/,"tag.html.tag-$1"],[/<(\w+)/,{cases:{"@empty":{token:"tag.html.tag-$1",next:"@tag.$1"},"@default":{token:"tag.html.tag-$1",bracket:"@open",next:"@tag.$1"}}}],[/<\/(\w+)\s*>/,{token:"tag.html.tag-$1",bracket:"@close"}],[/<!--/,"comment","@comment"]],comment:[[/[^<\-]+/,"comment.content"],[/-->/,"comment","@pop"],[/<!--/,"comment.content.invalid"],[/[<\-]/,"comment.content"]],tag:[[/[ \t\r\n]+/,"white"],[/(type)(\s*=\s*)(")([^"]+)(")/,["attribute.name","delimiter","attribute.value.html",{token:"attribute.value.html",switchTo:"@tag.$S2.$4"},"attribute.value.html"]],[/(type)(\s*=\s*)(')([^']+)(')/,["attribute.name","delimiter","attribute.value.html",{token:"attribute.value.html",switchTo:"@tag.$S2.$4"},"attribute.value.html"]],[/(\w+)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","delimiter","attribute.value.html"]],[/\w+/,"attribute.name"],[/\/>/,"tag.html.tag-$S2","@pop"],[/>/,{cases:{"$S2==style":{token:"tag.html.tag-$S2",switchTo:"@embedded.$S2",nextEmbedded:"text/css"},"$S2==script":{cases:{$S3:{token:"tag.html.tag-$S2",switchTo:"@embedded.$S2",nextEmbedded:"$S3"},"@default":{token:"tag.html.tag-$S2",switchTo:"@embedded.$S2",nextEmbedded:"text/javascript"}}},"@default":{token:"tag.html.tag-$S2",next:"@pop"}}}]],embedded:[[/[^"'<]+/,""],[/<\/(\w+)\s*>/,{cases:{"$1==$S2":{token:"@rematch",next:"@pop",nextEmbedded:"@pop"},"@default":""}}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/</,""]],string:[[/[^\\"']+/,"string"],[/@jsescapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};var s=function(e){function n(n,o,s){e.call(this,n,o,s,r.compile(t.language),i.AsyncDescriptor.create("vs/languages/markdown/common/markdownWorker","MarkdownWorker")),this.emitOutputSupport=this;var a=n.contextService&&n.contextService.getWorkspace();this.baseUrl=a&&a.resource.toString()}return __extends(n,e),n.prototype.getCommentsConfiguration=function(){return{blockCommentStartToken:"<!--",blockCommentEndToken:"-->"}},n.prototype.getEmitOutput=function(e){var t=this;return this._worker(function(n){return n.getEmitOutput(e,t.baseUrl)})},n.prototype._worker=function(t){return e.prototype._worker.call(this,t)},n.$getEmitOutput=o.OneWorkerAttr(n,n.prototype.getEmitOutput),n}(n.MonarchMode);t.MarkdownMode=s});