roojs-ui.js
[roojs1] / roojs-core.js
index 5ccb0cb..3f7c560 100644 (file)
@@ -683,61 +683,62 @@ Roo.debug&&Roo.log(C);if(!E.hideProgress&&Roo.MessageBox){Roo.MessageBox.updateP
 
 // Roo/Markdown.js
 Roo.Markdown={};Roo.Markdown.toHtml=function(A){var c=new Roo.Markdown.marked.setOptions({renderer:new Roo.Markdown.marked.Renderer(),gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:true,smartypants:false});A=A.replace(/\\\n/g,' ');
-return Roo.Markdown.marked(A);};(function(){var A={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/}
-;A.bullet=/(?:[*+-]|\d+\.)/;A.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;A.item=replace(A.item,'gm')(/bull/g,A.bullet)();A.list=replace(A.list)(/bull/g,A.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+A.def.source+')')();A.blockquote=replace(A.blockquote)('def',A.def)();
-A._tag='(?!(?:'+'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';A.html=replace(A.html)('comment',/<!--[\s\S]*?-->/)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,A._tag)();
-A.paragraph=replace(A.paragraph)('hr',A.hr)('heading',A.heading)('lheading',A.lheading)('blockquote',A.blockquote)('tag','<'+A._tag)('def',A.def)();A.normal=merge({},A);A.gfm=merge({},A.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}
-);A.gfm.paragraph=replace(A.paragraph)('(?!','(?!'+A.gfm.fences.source.replace('\\1','\\2')+'|'+A.list.source.replace('\\1','\\3')+'|')();A.tables=merge({},A.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}
-);var B=function(G){this.tokens=[];this.tokens.links={};this.options=G||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(G,H){var I=new B(H);return I.lex(G);
-};B.prototype.lex=function(G){G=G.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(G,true);};B.prototype.token=function(G,H,bq){var G=G.replace(/^ +$/gm,''),I,J,K,L,b,M,N,i,l;while(G){if(K=this.rules.newline.exec(G)){G=G.substring(K[0].length);
-if(K[0].length>1){this.tokens.push({type:'space'});}}if(K=this.rules.code.exec(G)){G=G.substring(K[0].length);K=K[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?K.replace(/\n+$/,''):K});continue;}if(K=this.rules.fences.exec(G)){G=G.substring(K[0].length);
-this.tokens.push({type:'code',lang:K[2],text:K[3]||''});continue;}if(K=this.rules.heading.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'heading',depth:K[1].length,text:K[2]});continue;}if(H&&(K=this.rules.nptable.exec(G))){G=G.substring(K[0].length);
-M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/\n$/,'').split('\n')};for(i=0;i<M.align.length;i++){if(/^ *-+: *$/.test(M.align[i])){M.align[i]='right';}else if(/^ *:-+: *$/.test(M.align[i])){M.align[i]='center';
-}else if(/^ *:-+ *$/.test(M.align[i])){M.align[i]='left';}else{M.align[i]=null;}}for(i=0;i<M.cells.length;i++){M.cells[i]=M.cells[i].split(/ *\| */);}this.tokens.push(M);continue;}if(K=this.rules.lheading.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'heading',depth:K[2]==='='?1:2,text:K[1]}
-);continue;}if(K=this.rules.hr.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'hr'});continue;}if(K=this.rules.blockquote.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'blockquote_start'});K=K[0].replace(/^ *> ?/gm,'');this.token(K,H,true);
-this.tokens.push({type:'blockquote_end'});continue;}if(K=this.rules.list.exec(G)){G=G.substring(K[0].length);L=K[2];this.tokens.push({type:'list_start',ordered:L.length>1});K=K[0].match(this.rules.item);I=false;l=K.length;i=0;for(;i<l;i++){M=K[i];N=M.length;
-M=M.replace(/^ *([*+-]|\d+\.) +/,'');if(~M.indexOf('\n ')){N-=M.length;M=!this.options.pedantic?M.replace(new RegExp('^ {1,'+N+'}','gm'),''):M.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(K[i+1])[0];if(L!==b&&!(L.length>1&&b.length>1)){G=K.slice(i+1).join('\n')+G;
-i=l-1;}}J=I||/\n\n(?!\s*$)/.test(M);if(i!==l-1){I=M.charAt(M.length-1)==='\n';if(!J){J=I;}}this.tokens.push({type:J?'loose_item_start':'list_item_start'});this.token(M,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
-continue;}if(K=this.rules.html.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(K[1]==='pre'||K[1]==='script'||K[1]==='style'),text:K[0]});continue;}if((!bq&&H)&&(K=this.rules.def.exec(G))){G=G.substring(K[0].length);
-this.tokens.links[K[1].toLowerCase()]={href:K[2],title:K[3]};continue;}if(H&&(K=this.rules.table.exec(G))){G=G.substring(K[0].length);M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<M.align.length;i++){if(/^ *-+: *$/.test(M.align[i])){M.align[i]='right';}else if(/^ *:-+: *$/.test(M.align[i])){M.align[i]='center';}else if(/^ *:-+ *$/.test(M.align[i])){M.align[i]='left';}else{M.align[i]=null;}}for(i=0;i<M.cells.length;i++){M.cells[i]=M.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(M);continue;}if(H&&(K=this.rules.paragraph.exec(G))){G=G.substring(K[0].length);this.tokens.push({type:'paragraph',text:K[1].charAt(K[1].length-1)==='\n'?K[1].slice(0,-1):K[1]});continue;}if(K=this.rules.text.exec(G)){G=G.substring(K[0].length);
-this.tokens.push({type:'text',text:K[0]});continue;}if(G){throw new Error('Infinite loop on byte: '+G.charCodeAt(0));}}return this.tokens;};var C={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
-;C._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;C._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;C.link=replace(C.link)('inside',C._inside)('href',C._href)();C.reflink=replace(C.reflink)('inside',C._inside)();C.normal=merge({},C);C.pedantic=merge({}
-,C.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});C.gfm=merge({},C.normal,{escape:replace(C.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(C.text)(']|','~]|')('|','|https?://|')()}
-);C.breaks=merge({},C.gfm,{br:replace(C.br)('{2,}','*')(),text:replace(C.gfm.text)('{2,}','*')()});var D=function(G,H){this.options=H||marked.defaults;this.links=G;this.rules=C.normal;this.renderer=this.options.renderer||new E;this.renderer.options=this.options;
-if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks;}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}};D.rules=C;D.output=function(G,H,I){var J=new D(H,I);
-return J.output(G);};D.prototype.output=function(G){var H='',I,J,K,L;while(G){if(L=this.rules.escape.exec(G)){G=G.substring(L[0].length);H+=L[1];continue;}if(L=this.rules.autolink.exec(G)){G=G.substring(L[0].length);if(L[2]==='@'){J=L[1].charAt(6)===':'?this.mangle(L[1].substring(7)):this.mangle(L[1]);
-K=this.mangle('mailto:')+J;}else{J=escape(L[1]);K=J;}H+=this.renderer.link(K,null,J);continue;}if(!this.inLink&&(L=this.rules.url.exec(G))){G=G.substring(L[0].length);J=escape(L[1]);K=J;H+=this.renderer.link(K,null,J);continue;}if(L=this.rules.tag.exec(G)){if(!this.inLink&&/^<a /i.test(L[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(L[0])){this.inLink=false;}G=G.substring(L[0].length);H+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(L[0]):escape(L[0]):L[0];continue;}if(L=this.rules.link.exec(G)){G=G.substring(L[0].length);this.inLink=true;
-H+=this.outputLink(L,{href:L[2],title:L[3]});this.inLink=false;continue;}if((L=this.rules.reflink.exec(G))||(L=this.rules.nolink.exec(G))){G=G.substring(L[0].length);I=(L[2]||L[1]).replace(/\s+/g,' ');I=this.links[I.toLowerCase()];if(!I||!I.href){H+=L[0].charAt(0);
-G=L[0].substring(1)+G;continue;}this.inLink=true;H+=this.outputLink(L,I);this.inLink=false;continue;}if(L=this.rules.strong.exec(G)){G=G.substring(L[0].length);H+=this.renderer.strong(this.output(L[2]||L[1]));continue;}if(L=this.rules.em.exec(G)){G=G.substring(L[0].length);
-H+=this.renderer.em(this.output(L[2]||L[1]));continue;}if(L=this.rules.code.exec(G)){G=G.substring(L[0].length);H+=this.renderer.codespan(escape(L[2],true));continue;}if(L=this.rules.br.exec(G)){G=G.substring(L[0].length);H+=this.renderer.br();continue;}if(L=this.rules.del.exec(G)){G=G.substring(L[0].length);
-H+=this.renderer.del(this.output(L[1]));continue;}if(L=this.rules.text.exec(G)){G=G.substring(L[0].length);H+=this.renderer.text(escape(this.smartypants(L[0])));continue;}if(G){throw new Error('Infinite loop on byte: '+G.charCodeAt(0));}}return H;};D.prototype.outputLink=function(G,H){var I=escape(H.href),J=H.title?escape(H.title):null;
-return G[0].charAt(0)!=='!'?this.renderer.link(I,J,this.output(G[1])):this.renderer.image(I,J,escape(G[1]));};D.prototype.smartypants=function(G){if(!this.options.smartypants){return G;}return G.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');
-};D.prototype.mangle=function(G){if(!this.options.mangle){return G;}var H='',l=G.length,i=0,ch;for(;i<l;i++){ch=G.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}H+='&#'+ch+';';}return H;};var E=function(G){this.options=G||{};};E.prototype.code=function(G,H,I){if(this.options.highlight){var J=this.options.highlight(G,H);
-if(J!=null&&J!==G){I=true;G=J;}}else{I=true;}if(!H){return '<pre><code>'+(I?G:escape(G,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(H,true)+'">'+(I?G:escape(G,true))+'\n</code></pre>\n';};E.prototype.blockquote=function(G){return '<blockquote>\n'+G+'</blockquote>\n';
-};E.prototype.html=function(G){return G;};E.prototype.heading=function(G,H,I){return '<h'+H+' id="'+this.options.headerPrefix+I.toLowerCase().replace(/[^\w]+/g,'-')+'">'+G+'</h'+H+'>\n';};E.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};E.prototype.list=function(G,H){var I=H?'ol':'ul';return '<'+I+'>\n'+G+'</'+I+'>\n';};E.prototype.listitem=function(G){return '<li>'+G+'</li>\n';};E.prototype.paragraph=function(G){return '<p>'+G+'</p>\n';};E.prototype.table=function(G,H){return '<table class="table table-striped">\n'+'<thead>\n'+G+'</thead>\n'+'<tbody>\n'+H+'</tbody>\n'+'</table>\n';
-};E.prototype.tablerow=function(G){return '<tr>\n'+G+'</tr>\n';};E.prototype.tablecell=function(G,H){var I=H.header?'th':'td';var J=H.align?'<'+I+' style="text-align:'+H.align+'">':'<'+I+'>';return J+G+'</'+I+'>\n';};E.prototype.strong=function(G){return '<strong>'+G+'</strong>';
-};E.prototype.em=function(G){return '<em>'+G+'</em>';};E.prototype.codespan=function(G){return '<code>'+G+'</code>';};E.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};E.prototype.del=function(G){return '<del>'+G+'</del>';};E.prototype.link=function(G,H,I){if(this.options.sanitize){try{var J=decodeURIComponent(unescape(G)).replace(/[^\w:]/g,'').toLowerCase();
-}catch(e){return '';}if(J.indexOf('javascript:')===0||J.indexOf('vbscript:')===0){return '';}}var K='<a href="'+G+'"';if(H){K+=' title="'+H+'"';}K+='>'+I+'</a>';return K;};E.prototype.image=function(G,H,I){var J='<img src="'+G+'" alt="'+I+'"';if(H){J+=' title="'+H+'"';
-}J+=this.options.xhtml?'/>':'>';return J;};E.prototype.text=function(G){return G;};var F=function(G){this.tokens=[];this.token=null;this.options=G||marked.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options;
-};F.parse=function(G,H,I){var J=new F(H,I);return J.parse(G);};F.prototype.parse=function(G){this.inline=new D(G.links,this.options,this.renderer);this.tokens=G.reverse();var H='';while(this.next()){H+=this.tok();}return H;};F.prototype.next=function(){return this.token=this.tokens.pop();
-};F.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};F.prototype.parseText=function(){var G=this.token.text;while(this.peek().type==='text'){G+='\n'+this.next().text;}return this.inline.output(G);};F.prototype.tok=function(){switch(this.token.type){case 'space':{return '';
-}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var G='',H='',i,I,J,K,j;
-J='';for(i=0;i<this.token.header.length;i++){K={header:true,align:this.token.align[i]};J+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}G+=this.renderer.tablerow(J);for(i=0;i<this.token.cells.length;
-i++){I=this.token.cells[i];J='';for(j=0;j<I.length;j++){J+=this.renderer.tablecell(this.inline.output(I[j]),{header:false,align:this.token.align[j]});}H+=this.renderer.tablerow(J);}return this.renderer.table(G,H);}case 'blockquote_start':{var H='';while(this.next().type!=='blockquote_end'){H+=this.tok();
-}return this.renderer.blockquote(H);}case 'list_start':{var H='',L=this.token.ordered;while(this.next().type!=='list_end'){H+=this.tok();}return this.renderer.list(H,L);}case 'list_item_start':{var H='';while(this.next().type!=='list_item_end'){H+=this.token.type==='text'?this.parseText():this.tok();
-}return this.renderer.listitem(H);}case 'loose_item_start':{var H='';while(this.next().type!=='list_item_end'){H+=this.tok();}return this.renderer.listitem(H);}case 'html':{var M=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
-return this.renderer.html(M);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(G,H){return G.replace(!H?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
-}function unescape(G){return G.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));
-}return '';});}function replace(G,H){G=G.source;H=H||'';return function I(J,K){if(!J){return new RegExp(G,H);}K=K.source||K;K=K.replace(/(^|[^\[])\^/g,'$1');G=G.replace(J,K);return I;};}function noop(){}noop.exec=noop;function merge(G){var i=1,H,I;for(;i<arguments.length;
-i++){H=arguments[i];for(I in H){if(Object.prototype.hasOwnProperty.call(H,I)){G[I]=H[I];}}}return G;}function marked(G,H,I){if(I||typeof H==='function'){if(!I){I=H;H=null;}H=merge({},marked.defaults,H||{});var J=H.highlight,K,L,i=0;try{K=B.lex(G,H)}catch(e){return I(e);
-}L=K.length;var M=function(N){if(N){H.highlight=J;return I(N);}var O;try{O=F.parse(K,H);}catch(e){N=e;}H.highlight=J;return N?I(N):I(null,O);};if(!J||J.length<3){return M();}delete H.highlight;if(!L){return M();}for(;i<K.length;i++){(function(N){if(N.type!=='code'){return --L||M();
-}return J(N.text,N.lang,function(O,P){if(O){return M(O);}if(P==null||P===N.text){return --L||M();}N.text=P;N.escaped=true;--L||M();});})(K[i]);}return;}try{if(H){H=merge({},marked.defaults,H);}return F.parse(B.lex(G,H),H);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';
-if((H||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';}throw e;}}marked.options=marked.setOptions=function(G){merge(marked.defaults,G);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new E,xhtml:false}
-;marked.Parser=F;marked.parser=F.parse;marked.Renderer=E;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
+return Roo.Markdown.marked(A);};(function(){var A=function(I,J){return I.replace(!J?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');};var unescape=function(I){return I.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();
+if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});};var replace=function(I,J){I=I.source;J=J||'';return function K(L,M){if(!L){return new RegExp(I,J);
+}M=M.source||M;M=M.replace(/(^|[^\[])\^/g,'$1');I=I.replace(L,M);return K;};};var noop=function(){};noop.exec=noop;var B=function(I){var i=1,J,K;for(;i<arguments.length;i++){J=arguments[i];for(K in J){if(Object.prototype.hasOwnProperty.call(J,K)){I[K]=J[K];
+}}}return I;};var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/}
+;block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,'gm')(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+block.def.source+')')();
+block.blockquote=replace(block.blockquote)('def',block.def)();block._tag='(?!(?:'+'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';block.html=replace(block.html)('comment',/<!--[\s\S]*?-->/)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,block._tag)();
+block.paragraph=replace(block.paragraph)('hr',block.hr)('heading',block.heading)('lheading',block.lheading)('blockquote',block.blockquote)('tag','<'+block._tag)('def',block.def)();block.normal=B({},block);block.gfm=B({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}
+);block.gfm.paragraph=replace(block.paragraph)('(?!','(?!'+block.gfm.fences.source.replace('\\1','\\2')+'|'+block.list.source.replace('\\1','\\3')+'|')();block.tables=B({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}
+);var C=function(I){this.tokens=[];this.tokens.links={};this.options=I||H.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables;}else{this.rules=block.gfm;}}};C.rules=block;C.lex=function(I,J){var K=new C(J);
+return K.lex(I);};C.prototype.lex=function(I){I=I.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(I,true);};C.prototype.token=function(I,J,bq){var I=I.replace(/^ +$/gm,''),K,L,M,N,b,O,P,i,l;while(I){if(M=this.rules.newline.exec(I)){I=I.substring(M[0].length);
+if(M[0].length>1){this.tokens.push({type:'space'});}}if(M=this.rules.code.exec(I)){I=I.substring(M[0].length);M=M[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?M.replace(/\n+$/,''):M});continue;}if(M=this.rules.fences.exec(I)){I=I.substring(M[0].length);
+this.tokens.push({type:'code',lang:M[2],text:M[3]||''});continue;}if(M=this.rules.heading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[1].length,text:M[2]});continue;}if(J&&(M=this.rules.nptable.exec(I))){I=I.substring(M[0].length);
+O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/\n$/,'').split('\n')};for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';
+}else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].split(/ *\| */);}this.tokens.push(O);continue;}if(M=this.rules.lheading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[2]==='='?1:2,text:M[1]}
+);continue;}if(M=this.rules.hr.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'hr'});continue;}if(M=this.rules.blockquote.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'blockquote_start'});M=M[0].replace(/^ *> ?/gm,'');this.token(M,J,true);
+this.tokens.push({type:'blockquote_end'});continue;}if(M=this.rules.list.exec(I)){I=I.substring(M[0].length);N=M[2];this.tokens.push({type:'list_start',ordered:N.length>1});M=M[0].match(this.rules.item);K=false;l=M.length;i=0;for(;i<l;i++){O=M[i];P=O.length;
+O=O.replace(/^ *([*+-]|\d+\.) +/,'');if(~O.indexOf('\n ')){P-=O.length;O=!this.options.pedantic?O.replace(new RegExp('^ {1,'+P+'}','gm'),''):O.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(M[i+1])[0];if(N!==b&&!(N.length>1&&b.length>1)){I=M.slice(i+1).join('\n')+I;
+i=l-1;}}L=K||/\n\n(?!\s*$)/.test(O);if(i!==l-1){K=O.charAt(O.length-1)==='\n';if(!L){L=K;}}this.tokens.push({type:L?'loose_item_start':'list_item_start'});this.token(O,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
+continue;}if(M=this.rules.html.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(M[1]==='pre'||M[1]==='script'||M[1]==='style'),text:M[0]});continue;}if((!bq&&J)&&(M=this.rules.def.exec(I))){I=I.substring(M[0].length);
+this.tokens.links[M[1].toLowerCase()]={href:M[2],title:M[3]};continue;}if(J&&(M=this.rules.table.exec(I))){I=I.substring(M[0].length);O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
+;for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';}else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
+}this.tokens.push(O);continue;}if(J&&(M=this.rules.paragraph.exec(I))){I=I.substring(M[0].length);this.tokens.push({type:'paragraph',text:M[1].charAt(M[1].length-1)==='\n'?M[1].slice(0,-1):M[1]});continue;}if(M=this.rules.text.exec(I)){I=I.substring(M[0].length);
+this.tokens.push({type:'text',text:M[0]});continue;}if(I){throw new Error('Infinite loop on byte: '+I.charCodeAt(0));}}return this.tokens;};var D={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
+;D._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;D._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;D.link=replace(D.link)('inside',D._inside)('href',D._href)();D.reflink=replace(D.reflink)('inside',D._inside)();D.normal=B({},D);D.pedantic=B({},D.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}
+);D.gfm=B({},D.normal,{escape:replace(D.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(D.text)(']|','~]|')('|','|https?://|')()});D.breaks=B({},D.gfm,{br:replace(D.br)('{2,}','*')(),text:replace(D.gfm.text)('{2,}','*')()}
+);var E=function(I,J){this.options=J||H.defaults;this.links=I;this.rules=D.normal;this.renderer=this.options.renderer||new F;this.renderer.options=this.options;if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=D.breaks;
+}else{this.rules=D.gfm;}}else if(this.options.pedantic){this.rules=D.pedantic;}};E.rules=D;E.output=function(I,J,K){var L=new E(J,K);return L.output(I);};E.prototype.output=function(I){var J='',K,L,M,N;while(I){if(N=this.rules.escape.exec(I)){I=I.substring(N[0].length);
+J+=N[1];continue;}if(N=this.rules.autolink.exec(I)){I=I.substring(N[0].length);if(N[2]==='@'){L=N[1].charAt(6)===':'?this.mangle(N[1].substring(7)):this.mangle(N[1]);M=this.mangle('mailto:')+L;}else{L=A(N[1]);M=L;}J+=this.renderer.link(M,null,L);continue;
+}if(!this.inLink&&(N=this.rules.url.exec(I))){I=I.substring(N[0].length);L=A(N[1]);M=L;J+=this.renderer.link(M,null,L);continue;}if(N=this.rules.tag.exec(I)){if(!this.inLink&&/^<a /i.test(N[0])){this.inLink=true;}else if(this.inLink&&/^<\/a>/i.test(N[0])){this.inLink=false;
+}I=I.substring(N[0].length);J+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):A(N[0]):N[0];continue;}if(N=this.rules.link.exec(I)){I=I.substring(N[0].length);this.inLink=true;J+=this.outputLink(N,{href:N[2],title:N[3]});this.inLink=false;
+continue;}if((N=this.rules.reflink.exec(I))||(N=this.rules.nolink.exec(I))){I=I.substring(N[0].length);K=(N[2]||N[1]).replace(/\s+/g,' ');K=this.links[K.toLowerCase()];if(!K||!K.href){J+=N[0].charAt(0);I=N[0].substring(1)+I;continue;}this.inLink=true;J+=this.outputLink(N,K);
+this.inLink=false;continue;}if(N=this.rules.strong.exec(I)){I=I.substring(N[0].length);J+=this.renderer.strong(this.output(N[2]||N[1]));continue;}if(N=this.rules.em.exec(I)){I=I.substring(N[0].length);J+=this.renderer.em(this.output(N[2]||N[1]));continue;
+}if(N=this.rules.code.exec(I)){I=I.substring(N[0].length);J+=this.renderer.codespan(A(N[2],true));continue;}if(N=this.rules.br.exec(I)){I=I.substring(N[0].length);J+=this.renderer.br();continue;}if(N=this.rules.del.exec(I)){I=I.substring(N[0].length);J+=this.renderer.del(this.output(N[1]));
+continue;}if(N=this.rules.text.exec(I)){I=I.substring(N[0].length);J+=this.renderer.text(A(this.smartypants(N[0])));continue;}if(I){throw new Error('Infinite loop on byte: '+I.charCodeAt(0));}}return J;};E.prototype.outputLink=function(I,J){var K=A(J.href),L=J.title?A(J.title):null;
+return I[0].charAt(0)!=='!'?this.renderer.link(K,L,this.output(I[1])):this.renderer.image(K,L,A(I[1]));};E.prototype.smartypants=function(I){if(!this.options.smartypants){return I;}return I.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');
+};E.prototype.mangle=function(I){if(!this.options.mangle){return I;}var J='',l=I.length,i=0,ch;for(;i<l;i++){ch=I.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}J+='&#'+ch+';';}return J;};var F=function(I){this.options=I||{};};F.prototype.code=function(I,J,K){if(this.options.highlight){var L=this.options.highlight(I,J);
+if(L!=null&&L!==I){K=true;I=L;}}else{K=true;}if(!J){return '<pre><code>'+(K?I:A(I,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+A(J,true)+'">'+(K?I:A(I,true))+'\n</code></pre>\n';};F.prototype.blockquote=function(I){return '<blockquote>\n'+I+'</blockquote>\n';
+};F.prototype.html=function(I){return I;};F.prototype.heading=function(I,J,K){return '<h'+J+' id="'+this.options.headerPrefix+K.toLowerCase().replace(/[^\w]+/g,'-')+'">'+I+'</h'+J+'>\n';};F.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
+};F.prototype.list=function(I,J){var K=J?'ol':'ul';return '<'+K+'>\n'+I+'</'+K+'>\n';};F.prototype.listitem=function(I){return '<li>'+I+'</li>\n';};F.prototype.paragraph=function(I){return '<p>'+I+'</p>\n';};F.prototype.table=function(I,J){return '<table class="table table-striped">\n'+'<thead>\n'+I+'</thead>\n'+'<tbody>\n'+J+'</tbody>\n'+'</table>\n';
+};F.prototype.tablerow=function(I){return '<tr>\n'+I+'</tr>\n';};F.prototype.tablecell=function(I,J){var K=J.header?'th':'td';var L=J.align?'<'+K+' style="text-align:'+J.align+'">':'<'+K+'>';return L+I+'</'+K+'>\n';};F.prototype.strong=function(I){return '<strong>'+I+'</strong>';
+};F.prototype.em=function(I){return '<em>'+I+'</em>';};F.prototype.codespan=function(I){return '<code>'+I+'</code>';};F.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};F.prototype.del=function(I){return '<del>'+I+'</del>';};F.prototype.link=function(I,J,K){if(this.options.sanitize){try{var L=decodeURIComponent(unescape(I)).replace(/[^\w:]/g,'').toLowerCase();
+}catch(e){return '';}if(L.indexOf('javascript:')===0||L.indexOf('vbscript:')===0){return '';}}var M='<a href="'+I+'"';if(J){M+=' title="'+J+'"';}M+='>'+K+'</a>';return M;};F.prototype.image=function(I,J,K){var L='<img src="'+I+'" alt="'+K+'"';if(J){L+=' title="'+J+'"';
+}L+=this.options.xhtml?'/>':'>';return L;};F.prototype.text=function(I){return I;};var G=function(I){this.tokens=[];this.token=null;this.options=I||H.defaults;this.options.renderer=this.options.renderer||new F;this.renderer=this.options.renderer;this.renderer.options=this.options;
+};G.parse=function(I,J,K){var L=new G(J,K);return L.parse(I);};G.prototype.parse=function(I){this.inline=new E(I.links,this.options,this.renderer);this.tokens=I.reverse();var J='';while(this.next()){J+=this.tok();}return J;};G.prototype.next=function(){return this.token=this.tokens.pop();
+};G.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};G.prototype.parseText=function(){var I=this.token.text;while(this.peek().type==='text'){I+='\n'+this.next().text;}return this.inline.output(I);};G.prototype.tok=function(){switch(this.token.type){case 'space':{return '';
+}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var I='',J='',i,K,L,M,j;
+L='';for(i=0;i<this.token.header.length;i++){M={header:true,align:this.token.align[i]};L+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}I+=this.renderer.tablerow(L);for(i=0;i<this.token.cells.length;
+i++){K=this.token.cells[i];L='';for(j=0;j<K.length;j++){L+=this.renderer.tablecell(this.inline.output(K[j]),{header:false,align:this.token.align[j]});}J+=this.renderer.tablerow(L);}return this.renderer.table(I,J);}case 'blockquote_start':{var J='';while(this.next().type!=='blockquote_end'){J+=this.tok();
+}return this.renderer.blockquote(J);}case 'list_start':{var J='',N=this.token.ordered;while(this.next().type!=='list_end'){J+=this.tok();}return this.renderer.list(J,N);}case 'list_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.token.type==='text'?this.parseText():this.tok();
+}return this.renderer.listitem(J);}case 'loose_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.tok();}return this.renderer.listitem(J);}case 'html':{var O=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
+return this.renderer.html(O);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};var H=function(I,J,K){if(K||typeof J==='function'){if(!K){K=J;J=null;}J=B({}
+,H.defaults,J||{});var L=J.highlight,M,N,i=0;try{M=C.lex(I,J)}catch(e){return K(e);}N=M.length;var O=function(P){if(P){J.highlight=L;return K(P);}var Q;try{Q=G.parse(M,J);}catch(e){P=e;}J.highlight=L;return P?K(P):K(null,Q);};if(!L||L.length<3){return O();
+}delete J.highlight;if(!N){return O();}for(;i<M.length;i++){(function(P){if(P.type!=='code'){return --N||O();}return L(P.text,P.lang,function(Q,R){if(Q){return O(Q);}if(R==null||R===P.text){return --N||O();}P.text=R;P.escaped=true;--N||O();});})(M[i]);}return;
+}try{if(J){J=B({},H.defaults,J);}return G.parse(C.lex(I,J),J);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((J||H.defaults).silent){return '<p>An error occured:</p><pre>'+A(e.message+'',true)+'</pre>';}throw e;}};H.options=H.setOptions=function(I){B(H.defaults,I);
+return H;};H.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new F,xhtml:false};H.Parser=G;H.parser=G.parse;
+H.Renderer=F;H.Lexer=C;H.lexer=C.lex;H.InlineLexer=E;H.inlineLexer=E.output;H.parse=H;Roo.Markdown.marked=H;})();
 // Roo/dd/DragDrop.js
 (function(){var A=Roo.EventManager;var B=Roo.lib.Dom;Roo.dd.DragDrop=function(id,C,D){if(id){this.init(id,C,D);}};Roo.extend(Roo.dd.DragDrop,Roo.util.Observable,{id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;
 },unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){}