All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.22.22.bed853b49cad62de1f58.js Maven / Gradle / Ivy

There is a newer version: 6.0.6
Show newest version
webpackJsonp([22],{714:function(module,exports){eval("if (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    var TempCtor = function () {}\n    TempCtor.prototype = superCtor.prototype\n    ctor.prototype = new TempCtor()\n    ctor.prototype.constructor = ctor\n  }\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/inherits/inherits_browser.js\n ** module id = 714\n ** module chunks = 22\n **/\n//# sourceURL=webpack:///./~/inherits/inherits_browser.js?")},717:function(module,exports,__webpack_require__){eval("// super simple module for the most common nodejs use case.\nexports.markdown = __webpack_require__(718);\nexports.parse = exports.markdown.toHTML;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/markdown/lib/index.js\n ** module id = 717\n ** module chunks = 22\n **/\n//# sourceURL=webpack:///./~/markdown/lib/index.js?")},718:function(module,exports,__webpack_require__){eval('// Released under MIT license\n// Copyright (c) 2009-2010 Dominic Baggott\n// Copyright (c) 2009-2010 Ash Berlin\n// Copyright (c) 2011 Christoph Dorn  (http://www.christophdorn.com)\n\n/*jshint browser:true, devel:true */\n\n(function( expose ) {\n\n/**\n *  class Markdown\n *\n *  Markdown processing in Javascript done right. We have very particular views\n *  on what constitutes \'right\' which include:\n *\n *  - produces well-formed HTML (this means that em and strong nesting is\n *    important)\n *\n *  - has an intermediate representation to allow processing of parsed data (We\n *    in fact have two, both as [JsonML]: a markdown tree and an HTML tree).\n *\n *  - is easily extensible to add new dialects without having to rewrite the\n *    entire parsing mechanics\n *\n *  - has a good test suite\n *\n *  This implementation fulfills all of these (except that the test suite could\n *  do with expanding to automatically run all the fixtures from other Markdown\n *  implementations.)\n *\n *  ##### Intermediate Representation\n *\n *  *TODO* Talk about this :) Its JsonML, but document the node names we use.\n *\n *  [JsonML]: http://jsonml.org/ "JSON Markup Language"\n **/\nvar Markdown = expose.Markdown = function(dialect) {\n  switch (typeof dialect) {\n    case "undefined":\n      this.dialect = Markdown.dialects.Gruber;\n      break;\n    case "object":\n      this.dialect = dialect;\n      break;\n    default:\n      if ( dialect in Markdown.dialects ) {\n        this.dialect = Markdown.dialects[dialect];\n      }\n      else {\n        throw new Error("Unknown Markdown dialect \'" + String(dialect) + "\'");\n      }\n      break;\n  }\n  this.em_state = [];\n  this.strong_state = [];\n  this.debug_indent = "";\n};\n\n/**\n *  parse( markdown, [dialect] ) -> JsonML\n *  - markdown (String): markdown string to parse\n *  - dialect (String | Dialect): the dialect to use, defaults to gruber\n *\n *  Parse `markdown` and return a markdown document as a Markdown.JsonML tree.\n **/\nexpose.parse = function( source, dialect ) {\n  // dialect will default if undefined\n  var md = new Markdown( dialect );\n  return md.toTree( source );\n};\n\n/**\n *  toHTML( markdown, [dialect]  ) -> String\n *  toHTML( md_tree ) -> String\n *  - markdown (String): markdown string to parse\n *  - md_tree (Markdown.JsonML): parsed markdown tree\n *\n *  Take markdown (either as a string or as a JsonML tree) and run it through\n *  [[toHTMLTree]] then turn it into a well-formated HTML fragment.\n **/\nexpose.toHTML = function toHTML( source , dialect , options ) {\n  var input = expose.toHTMLTree( source , dialect , options );\n\n  return expose.renderJsonML( input );\n};\n\n/**\n *  toHTMLTree( markdown, [dialect] ) -> JsonML\n *  toHTMLTree( md_tree ) -> JsonML\n *  - markdown (String): markdown string to parse\n *  - dialect (String | Dialect): the dialect to use, defaults to gruber\n *  - md_tree (Markdown.JsonML): parsed markdown tree\n *\n *  Turn markdown into HTML, represented as a JsonML tree. If a string is given\n *  to this function, it is first parsed into a markdown tree by calling\n *  [[parse]].\n **/\nexpose.toHTMLTree = function toHTMLTree( input, dialect , options ) {\n  // convert string input to an MD tree\n  if ( typeof input ==="string" ) input = this.parse( input, dialect );\n\n  // Now convert the MD tree to an HTML tree\n\n  // remove references from the tree\n  var attrs = extract_attr( input ),\n      refs = {};\n\n  if ( attrs && attrs.references ) {\n    refs = attrs.references;\n  }\n\n  var html = convert_tree_to_html( input, refs , options );\n  merge_text_nodes( html );\n  return html;\n};\n\n// For Spidermonkey based engines\nfunction mk_block_toSource() {\n  return "Markdown.mk_block( " +\n          uneval(this.toString()) +\n          ", " +\n          uneval(this.trailing) +\n          ", " +\n          uneval(this.lineNumber) +\n          " )";\n}\n\n// node\nfunction mk_block_inspect() {\n  var util = __webpack_require__(1151);\n  return "Markdown.mk_block( " +\n          util.inspect(this.toString()) +\n          ", " +\n          util.inspect(this.trailing) +\n          ", " +\n          util.inspect(this.lineNumber) +\n          " )";\n\n}\n\nvar mk_block = Markdown.mk_block = function(block, trail, line) {\n  // Be helpful for default case in tests.\n  if ( arguments.length == 1 ) trail = "\\n\\n";\n\n  var s = new String(block);\n  s.trailing = trail;\n  // To make it clear its not just a string\n  s.inspect = mk_block_inspect;\n  s.toSource = mk_block_toSource;\n\n  if ( line != undefined )\n    s.lineNumber = line;\n\n  return s;\n};\n\nfunction count_lines( str ) {\n  var n = 0, i = -1;\n  while ( ( i = str.indexOf("\\n", i + 1) ) !== -1 ) n++;\n  return n;\n}\n\n// Internal - split source into rough blocks\nMarkdown.prototype.split_blocks = function splitBlocks( input, startLine ) {\n  input = input.replace(/(\\r\\n|\\n|\\r)/g, "\\n");\n  // [\\s\\S] matches _anything_ (newline or space)\n  // [^] is equivalent but doesn\'t work in IEs.\n  var re = /([\\s\\S]+?)($|\\n#|\\n(?:\\s*\\n|$)+)/g,\n      blocks = [],\n      m;\n\n  var line_no = 1;\n\n  if ( ( m = /^(\\s*\\n)/.exec(input) ) != null ) {\n    // skip (but count) leading blank lines\n    line_no += count_lines( m[0] );\n    re.lastIndex = m[0].length;\n  }\n\n  while ( ( m = re.exec(input) ) !== null ) {\n    if (m[2] == "\\n#") {\n      m[2] = "\\n";\n      re.lastIndex--;\n    }\n    blocks.push( mk_block( m[1], m[2], line_no ) );\n    line_no += count_lines( m[0] );\n  }\n\n  return blocks;\n};\n\n/**\n *  Markdown#processBlock( block, next ) -> undefined | [ JsonML, ... ]\n *  - block (String): the block to process\n *  - next (Array): the following blocks\n *\n * Process `block` and return an array of JsonML nodes representing `block`.\n *\n * It does this by asking each block level function in the dialect to process\n * the block until one can. Succesful handling is indicated by returning an\n * array (with zero or more JsonML nodes), failure by a false value.\n *\n * Blocks handlers are responsible for calling [[Markdown#processInline]]\n * themselves as appropriate.\n *\n * If the blocks were split incorrectly or adjacent blocks need collapsing you\n * can adjust `next` in place using shift/splice etc.\n *\n * If any of this default behaviour is not right for the dialect, you can\n * define a `__call__` method on the dialect that will get invoked to handle\n * the block processing.\n */\nMarkdown.prototype.processBlock = function processBlock( block, next ) {\n  var cbs = this.dialect.block,\n      ord = cbs.__order__;\n\n  if ( "__call__" in cbs ) {\n    return cbs.__call__.call(this, block, next);\n  }\n\n  for ( var i = 0; i < ord.length; i++ ) {\n    //D:this.debug( "Testing", ord[i] );\n    var res = cbs[ ord[i] ].call( this, block, next );\n    if ( res ) {\n      //D:this.debug("  matched");\n      if ( !isArray(res) || ( res.length > 0 && !( isArray(res[0]) ) ) )\n        this.debug(ord[i], "didn\'t return a proper array");\n      //D:this.debug( "" );\n      return res;\n    }\n  }\n\n  // Uhoh! no match! Should we throw an error?\n  return [];\n};\n\nMarkdown.prototype.processInline = function processInline( block ) {\n  return this.dialect.inline.__call__.call( this, String( block ) );\n};\n\n/**\n *  Markdown#toTree( source ) -> JsonML\n *  - source (String): markdown source to parse\n *\n *  Parse `source` into a JsonML tree representing the markdown document.\n **/\n// custom_tree means set this.tree to `custom_tree` and restore old value on return\nMarkdown.prototype.toTree = function toTree( source, custom_root ) {\n  var blocks = source instanceof Array ? source : this.split_blocks( source );\n\n  // Make tree a member variable so its easier to mess with in extensions\n  var old_tree = this.tree;\n  try {\n    this.tree = custom_root || this.tree || [ "markdown" ];\n\n    blocks:\n    while ( blocks.length ) {\n      var b = this.processBlock( blocks.shift(), blocks );\n\n      // Reference blocks and the like won\'t return any content\n      if ( !b.length ) continue blocks;\n\n      this.tree.push.apply( this.tree, b );\n    }\n    return this.tree;\n  }\n  finally {\n    if ( custom_root ) {\n      this.tree = old_tree;\n    }\n  }\n};\n\n// Noop by default\nMarkdown.prototype.debug = function () {\n  var args = Array.prototype.slice.call( arguments);\n  args.unshift(this.debug_indent);\n  if ( typeof print !== "undefined" )\n      print.apply( print, args );\n  if ( typeof console !== "undefined" && typeof console.log !== "undefined" )\n      console.log.apply( null, args );\n}\n\nMarkdown.prototype.loop_re_over_block = function( re, block, cb ) {\n  // Dont use /g regexps with this\n  var m,\n      b = block.valueOf();\n\n  while ( b.length && (m = re.exec(b) ) != null ) {\n    b = b.substr( m[0].length );\n    cb.call(this, m);\n  }\n  return b;\n};\n\n/**\n * Markdown.dialects\n *\n * Namespace of built-in dialects.\n **/\nMarkdown.dialects = {};\n\n/**\n * Markdown.dialects.Gruber\n *\n * The default dialect that follows the rules set out by John Gruber\'s\n * markdown.pl as closely as possible. Well actually we follow the behaviour of\n * that script which in some places is not exactly what the syntax web page\n * says.\n **/\nMarkdown.dialects.Gruber = {\n  block: {\n    atxHeader: function atxHeader( block, next ) {\n      var m = block.match( /^(#{1,6})\\s*(.*?)\\s*#*\\s*(?:\\n|$)/ );\n\n      if ( !m ) return undefined;\n\n      var header = [ "header", { level: m[ 1 ].length } ];\n      Array.prototype.push.apply(header, this.processInline(m[ 2 ]));\n\n      if ( m[0].length < block.length )\n        next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );\n\n      return [ header ];\n    },\n\n    setextHeader: function setextHeader( block, next ) {\n      var m = block.match( /^(.*)\\n([-=])\\2\\2+(?:\\n|$)/ );\n\n      if ( !m ) return undefined;\n\n      var level = ( m[ 2 ] === "=" ) ? 1 : 2;\n      var header = [ "header", { level : level }, m[ 1 ] ];\n\n      if ( m[0].length < block.length )\n        next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );\n\n      return [ header ];\n    },\n\n    code: function code( block, next ) {\n      // |    Foo\n      // |bar\n      // should be a code block followed by a paragraph. Fun\n      //\n      // There might also be adjacent code block to merge.\n\n      var ret = [],\n          re = /^(?: {0,3}\\t| {4})(.*)\\n?/,\n          lines;\n\n      // 4 spaces + content\n      if ( !block.match( re ) ) return undefined;\n\n      block_search:\n      do {\n        // Now pull out the rest of the lines\n        var b = this.loop_re_over_block(\n                  re, block.valueOf(), function( m ) { ret.push( m[1] ); } );\n\n        if ( b.length ) {\n          // Case alluded to in first comment. push it back on as a new block\n          next.unshift( mk_block(b, block.trailing) );\n          break block_search;\n        }\n        else if ( next.length ) {\n          // Check the next block - it might be code too\n          if ( !next[0].match( re ) ) break block_search;\n\n          // Pull how how many blanks lines follow - minus two to account for .join\n          ret.push ( block.trailing.replace(/[^\\n]/g, "").substring(2) );\n\n          block = next.shift();\n        }\n        else {\n          break block_search;\n        }\n      } while ( true );\n\n      return [ [ "code_block", ret.join("\\n") ] ];\n    },\n\n    horizRule: function horizRule( block, next ) {\n      // this needs to find any hr in the block to handle abutting blocks\n      var m = block.match( /^(?:([\\s\\S]*?)\\n)?[ \\t]*([-_*])(?:[ \\t]*\\2){2,}[ \\t]*(?:\\n([\\s\\S]*))?$/ );\n\n      if ( !m ) {\n        return undefined;\n      }\n\n      var jsonml = [ [ "hr" ] ];\n\n      // if there\'s a leading abutting block, process it\n      if ( m[ 1 ] ) {\n        jsonml.unshift.apply( jsonml, this.processBlock( m[ 1 ], [] ) );\n      }\n\n      // if there\'s a trailing abutting block, stick it into next\n      if ( m[ 3 ] ) {\n        next.unshift( mk_block( m[ 3 ] ) );\n      }\n\n      return jsonml;\n    },\n\n    // There are two types of lists. Tight and loose. Tight lists have no whitespace\n    // between the items (and result in text just in the 
  • ) and loose lists,\n // which have an empty line between list items, resulting in (one or more)\n // paragraphs inside the
  • .\n //\n // There are all sorts weird edge cases about the original markdown.pl\'s\n // handling of lists:\n //\n // * Nested lists are supposed to be indented by four chars per level. But\n // if they aren\'t, you can get a nested list by indenting by less than\n // four so long as the indent doesn\'t match an indent of an existing list\n // item in the \'nest stack\'.\n //\n // * The type of the list (bullet or number) is controlled just by the\n // first item at the indent. Subsequent changes are ignored unless they\n // are for nested lists\n //\n lists: (function( ) {\n // Use a closure to hide a few variables.\n var any_list = "[*+-]|\\\\d+\\\\.",\n bullet_list = /[*+-]/,\n number_list = /\\d+\\./,\n // Capture leading indent as it matters for determining nested lists.\n is_list_re = new RegExp( "^( {0,3})(" + any_list + ")[ \\t]+" ),\n indent_re = "(?: {0,3}\\\\t| {4})";\n\n // TODO: Cache this regexp for certain depths.\n // Create a regexp suitable for matching an li for a given stack depth\n function regex_for_depth( depth ) {\n\n return new RegExp(\n // m[1] = indent, m[2] = list_type\n "(?:^(" + indent_re + "{0," + depth + "} {0,3})(" + any_list + ")\\\\s+)|" +\n // m[3] = cont\n "(^" + indent_re + "{0," + (depth-1) + "}[ ]{0,4})"\n );\n }\n function expand_tab( input ) {\n return input.replace( / {0,3}\\t/g, " " );\n }\n\n // Add inline content `inline` to `li`. inline comes from processInline\n // so is an array of content\n function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ "para" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == "para"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 ) inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what == "string";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == "string" ) {\n add_to[ add_to.length-1 ] += what;\n }\n else {\n add_to.push( what );\n }\n }\n }\n\n // contained means have an indent greater than the current one. On\n // *every* line in the block\n function get_contained_blocks( depth, blocks ) {\n\n var re = new RegExp( "^(" + indent_re + "{" + depth + "}.*?\\\\n?)*$" ),\n replace = new RegExp("^" + indent_re + "{" + depth + "}", "gm"),\n ret = [];\n\n while ( blocks.length > 0 ) {\n if ( re.exec( blocks[0] ) ) {\n var b = blocks.shift(),\n // Now remove that indent\n x = b.replace( replace, "");\n\n ret.push( mk_block( x, b.trailing, b.lineNumber ) );\n }\n else {\n break;\n }\n }\n return ret;\n }\n\n // passed to stack.forEach to turn list items up the stack into paras\n function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length-1];\n\n if ( last_li[1] instanceof Array && last_li[1][0] == "para" ) {\n return;\n }\n if ( i + 1 == stack.length ) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push( ["para"].concat( last_li.splice(1, last_li.length - 1) ) );\n }\n else {\n var sublist = last_li.pop();\n last_li.push( ["para"].concat( last_li.splice(1, last_li.length - 1) ), sublist );\n }\n }\n\n // The matcher function\n return function( block, next ) {\n var m = block.match( is_list_re );\n if ( !m ) return undefined;\n\n function make_list( m ) {\n var list = bullet_list.exec( m[2] )\n ? ["bulletlist"]\n : ["numberlist"];\n\n stack.push( { list: list, indent: m[1] } );\n return list;\n }\n\n\n var stack = [], // Stack of lists for nesting.\n list = make_list( m ),\n last_li,\n loose = false,\n ret = [ stack[0].list ],\n i;\n\n // Loop to search over block looking for inner block elements and loose lists\n loose_search:\n while ( true ) {\n // Split into lines preserving new lines at end of line\n var lines = block.split( /(?=\\n)/ );\n\n // We have to grab all lines for a li and call processInline on them\n // once as there are some inline things that can span lines.\n var li_accumulate = "";\n\n // Loop over the lines in this block looking for tight lists.\n tight_search:\n for ( var line_no = 0; line_no < lines.length; line_no++ ) {\n var nl = "",\n l = lines[line_no].replace(/^\\n/, function(n) { nl = n; return ""; });\n\n // TODO: really should cache this\n var line_re = regex_for_depth( stack.length );\n\n m = l.match( line_re );\n //print( "line:", uneval(l), "\\nline match:", uneval(m) );\n\n // We have a list item\n if ( m[1] !== undefined ) {\n // Process the previous list item, if any\n if ( li_accumulate.length ) {\n add( last_li, loose, this.processInline( li_accumulate ), nl );\n // Loose mode will have been dealt with. Reset it\n loose = false;\n li_accumulate = "";\n }\n\n m[1] = expand_tab( m[1] );\n var wanted_depth = Math.floor(m[1].length/4)+1;\n //print( "want:", wanted_depth, "stack:", stack.length);\n if ( wanted_depth > stack.length ) {\n // Deep enough for a nested list outright\n //print ( "new nested list" );\n list = make_list( m );\n last_li.push( list );\n last_li = list[1] = [ "listitem" ];\n }\n else {\n // We aren\'t deep enough to be strictly a new level. This is\n // where Md.pl goes nuts. If the indent matches a level in the\n // stack, put it there, else put it one deeper then the\n // wanted_depth deserves.\n var found = false;\n for ( i = 0; i < stack.length; i++ ) {\n if ( stack[ i ].indent != m[1] ) continue;\n list = stack[ i ].list;\n stack.splice( i+1, stack.length - (i+1) );\n found = true;\n break;\n }\n\n if (!found) {\n //print("not found. l:", uneval(l));\n wanted_depth++;\n if ( wanted_depth <= stack.length ) {\n stack.splice(wanted_depth, stack.length - wanted_depth);\n //print("Desired depth now", wanted_depth, "stack:", stack.length);\n list = stack[wanted_depth-1].list;\n //print("list:", uneval(list) );\n }\n else {\n //print ("made new stack for messy indent");\n list = make_list(m);\n last_li.push(list);\n }\n }\n\n //print( uneval(list), "last", list === stack[stack.length-1].list );\n last_li = [ "listitem" ];\n list.push(last_li);\n } // end depth of shenegains\n nl = "";\n }\n\n // Add content\n if ( l.length > m[0].length ) {\n li_accumulate += nl + l.substr( m[0].length );\n }\n } // tight_search\n\n if ( li_accumulate.length ) {\n add( last_li, loose, this.processInline( li_accumulate ), nl );\n // Loose mode will have been dealt with. Reset it\n loose = false;\n li_accumulate = "";\n }\n\n // Look at the next block - we might have a loose list. Or an extra\n // paragraph for the current li\n var contained = get_contained_blocks( stack.length, next );\n\n // Deal with code blocks or properly nested lists\n if ( contained.length > 0 ) {\n // Make sure all listitems up the stack are paragraphs\n forEach( stack, paragraphify, this);\n\n last_li.push.apply( last_li, this.toTree( contained, [] ) );\n }\n\n var next_block = next[0] && next[0].valueOf() || "";\n\n if ( next_block.match(is_list_re) || next_block.match( /^ / ) ) {\n block = next.shift();\n\n // Check for an HR following a list: features/lists/hr_abutting\n var hr = this.dialect.block.horizRule( block, next );\n\n if ( hr ) {\n ret.push.apply(ret, hr);\n break;\n }\n\n // Make sure all listitems up the stack are paragraphs\n forEach( stack, paragraphify, this);\n\n loose = true;\n continue loose_search;\n }\n break;\n } // loose_search\n\n return ret;\n };\n })(),\n\n blockquote: function blockquote( block, next ) {\n if ( !block.match( /^>/m ) )\n return undefined;\n\n var jsonml = [];\n\n // separate out the leading abutting block, if any. I.e. in this case:\n //\n // a\n // > b\n //\n if ( block[ 0 ] != ">" ) {\n var lines = block.split( /\\n/ ),\n prev = [],\n line_no = block.lineNumber;\n\n // keep shifting lines until you find a crotchet\n while ( lines.length && lines[ 0 ][ 0 ] != ">" ) {\n prev.push( lines.shift() );\n line_no++;\n }\n\n var abutting = mk_block( prev.join( "\\n" ), "\\n", block.lineNumber );\n jsonml.push.apply( jsonml, this.processBlock( abutting, [] ) );\n // reassemble new block of just block quotes!\n block = mk_block( lines.join( "\\n" ), block.trailing, line_no );\n }\n\n\n // if the next block is also a blockquote merge it in\n while ( next.length && next[ 0 ][ 0 ] == ">" ) {\n var b = next.shift();\n block = mk_block( block + block.trailing + b, b.trailing, block.lineNumber );\n }\n\n // Strip off the leading "> " and re-process as a block.\n var input = block.replace( /^> ?/gm, "" ),\n old_tree = this.tree,\n processedBlock = this.toTree( input, [ "blockquote" ] ),\n attr = extract_attr( processedBlock );\n\n // If any link references were found get rid of them\n if ( attr && attr.references ) {\n delete attr.references;\n // And then remove the attribute object if it\'s empty\n if ( isEmpty( attr ) ) {\n processedBlock.splice( 1, 1 );\n }\n }\n\n jsonml.push( processedBlock );\n return jsonml;\n },\n\n referenceDefn: function referenceDefn( block, next) {\n var re = /^\\s*\\[(.*?)\\]:\\s*(\\S+)(?:\\s+(?:([\'"])(.*?)\\3|\\((.*?)\\)))?\\n?/;\n // interesting matches are [ , ref_id, url, , title, title ]\n\n if ( !block.match(re) )\n return undefined;\n\n // make an attribute node if it doesn\'t exist\n if ( !extract_attr( this.tree ) ) {\n this.tree.splice( 1, 0, {} );\n }\n\n var attrs = extract_attr( this.tree );\n\n // make a references hash if it doesn\'t exist\n if ( attrs.references === undefined ) {\n attrs.references = {};\n }\n\n var b = this.loop_re_over_block(re, block, function( m ) {\n\n if ( m[2] && m[2][0] == "<" && m[2][m[2].length-1] == ">" )\n m[2] = m[2].substring( 1, m[2].length - 1 );\n\n var ref = attrs.references[ m[1].toLowerCase() ] = {\n href: m[2]\n };\n\n if ( m[4] !== undefined )\n ref.title = m[4];\n else if ( m[5] !== undefined )\n ref.title = m[5];\n\n } );\n\n if ( b.length )\n next.unshift( mk_block( b, block.trailing ) );\n\n return [];\n },\n\n para: function para( block, next ) {\n // everything\'s a para!\n return [ ["para"].concat( this.processInline( block ) ) ];\n }\n }\n};\n\nMarkdown.dialects.Gruber.inline = {\n\n __oneElement__: function oneElement( text, patterns_or_re, previous_nodes ) {\n var m,\n res,\n lastIndex = 0;\n\n patterns_or_re = patterns_or_re || this.dialect.inline.__patterns__;\n var re = new RegExp( "([\\\\s\\\\S]*?)(" + (patterns_or_re.source || patterns_or_re) + ")" );\n\n m = re.exec( text );\n if (!m) {\n // Just boring text\n return [ text.length, text ];\n }\n else if ( m[1] ) {\n // Some un-interesting text matched. Return that first\n return [ m[1].length, m[1] ];\n }\n\n var res;\n if ( m[2] in this.dialect.inline ) {\n res = this.dialect.inline[ m[2] ].call(\n this,\n text.substr( m.index ), m, previous_nodes || [] );\n }\n // Default for now to make dev easier. just slurp special and output it.\n res = res || [ m[2].length, m[2] ];\n return res;\n },\n\n __call__: function inline( text, patterns ) {\n\n var out = [],\n res;\n\n function add(x) {\n //D:self.debug(" adding output", uneval(x));\n if ( typeof x == "string" && typeof out[out.length-1] == "string" )\n out[ out.length-1 ] += x;\n else\n out.push(x);\n }\n\n while ( text.length > 0 ) {\n res = this.dialect.inline.__oneElement__.call(this, text, patterns, out );\n text = text.substr( res.shift() );\n forEach(res, add )\n }\n\n return out;\n },\n\n // These characters are intersting elsewhere, so have rules for them so that\n // chunks of plain text blocks don\'t include them\n "]": function () {},\n "}": function () {},\n\n __escape__ : /^\\\\[\\\\`\\*_{}\\[\\]()#\\+.!\\-]/,\n\n "\\\\": function escaped( text ) {\n // [ length of input processed, node/children to add... ]\n // Only esacape: \\ ` * _ { } [ ] ( ) # * + - . !\n if ( this.dialect.inline.__escape__.exec( text ) )\n return [ 2, text.charAt( 1 ) ];\n else\n // Not an esacpe\n return [ 1, "\\\\" ];\n },\n\n "![": function image( text ) {\n\n // Unlike images, alt text is plain text only. no other elements are\n // allowed in there\n\n // ![Alt text](/path/to/img.jpg "Optional title")\n // 1 2 3 4 <--- captures\n var m = text.match( /^!\\[(.*?)\\][ \\t]*\\([ \\t]*([^")]*?)(?:[ \\t]+(["\'])(.*?)\\3)?[ \\t]*\\)/ );\n\n if ( m ) {\n if ( m[2] && m[2][0] == "<" && m[2][m[2].length-1] == ">" )\n m[2] = m[2].substring( 1, m[2].length - 1 );\n\n m[2] = this.dialect.inline.__call__.call( this, m[2], /\\\\/ )[0];\n\n var attrs = { alt: m[1], href: m[2] || "" };\n if ( m[4] !== undefined)\n attrs.title = m[4];\n\n return [ m[0].length, [ "img", attrs ] ];\n }\n\n // ![Alt text][id]\n m = text.match( /^!\\[(.*?)\\][ \\t]*\\[(.*?)\\]/ );\n\n if ( m ) {\n // We can\'t check if the reference is known here as it likely wont be\n // found till after. Check it in md tree->hmtl tree conversion\n return [ m[0].length, [ "img_ref", { alt: m[1], ref: m[2].toLowerCase(), original: m[0] } ] ];\n }\n\n // Just consume the \'![\'\n return [ 2, "![" ];\n },\n\n "[": function link( text ) {\n\n var orig = String(text);\n // Inline content is possible inside `link text`\n var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), "]" );\n\n // No closing \']\' found. Just consume the [\n if ( !res ) return [ 1, "[" ];\n\n var consumed = 1 + res[ 0 ],\n children = res[ 1 ],\n link,\n attrs;\n\n // At this point the first [...] has been parsed. See what follows to find\n // out which kind of link we are (reference or direct url)\n text = text.substr( consumed );\n\n // [link text](/path/to/img.jpg "Optional title")\n // 1 2 3 <--- captures\n // This will capture up to the last paren in the block. We then pull\n // back based on if there a matching ones in the url\n // ([here](/url/(test))\n // The parens have to be balanced\n var m = text.match( /^\\s*\\([ \\t]*([^"\']*)(?:[ \\t]+(["\'])(.*?)\\2)?[ \\t]*\\)/ );\n if ( m ) {\n var url = m[1];\n consumed += m[0].length;\n\n if ( url && url[0] == "<" && url[url.length-1] == ">" )\n url = url.substring( 1, url.length - 1 );\n\n // If there is a title we don\'t have to worry about parens in the url\n if ( !m[3] ) {\n var open_parens = 1; // One open that isn\'t in the capture\n for ( var len = 0; len < url.length; len++ ) {\n switch ( url[len] ) {\n case "(":\n open_parens++;\n break;\n case ")":\n if ( --open_parens == 0) {\n consumed -= url.length - len;\n url = url.substring(0, len);\n }\n break;\n }\n }\n }\n\n // Process escapes only\n url = this.dialect.inline.__call__.call( this, url, /\\\\/ )[0];\n\n attrs = { href: url || "" };\n if ( m[3] !== undefined)\n attrs.title = m[3];\n\n link = [ "link", attrs ].concat( children );\n return [ consumed, link ];\n }\n\n // [Alt text][id]\n // [Alt text] [id]\n m = text.match( /^\\s*\\[(.*?)\\]/ );\n\n if ( m ) {\n\n consumed += m[ 0 ].length;\n\n // [links][] uses links as its reference\n attrs = { ref: ( m[ 1 ] || String(children) ).toLowerCase(), original: orig.substr( 0, consumed ) };\n\n link = [ "link_ref", attrs ].concat( children );\n\n // We can\'t check if the reference is known here as it likely wont be\n // found till after. Check it in md tree->hmtl tree conversion.\n // Store the original so that conversion can revert if the ref isn\'t found.\n return [ consumed, link ];\n }\n\n // [id]\n // Only if id is plain (no formatting.)\n if ( children.length == 1 && typeof children[0] == "string" ) {\n\n attrs = { ref: children[0].toLowerCase(), original: orig.substr( 0, consumed ) };\n link = [ "link_ref", attrs, children[0] ];\n return [ consumed, link ];\n }\n\n // Just consume the "["\n return [ 1, "[" ];\n },\n\n\n "<": function autoLink( text ) {\n var m;\n\n if ( ( m = text.match( /^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\\.[a-zA-Z]+))>/ ) ) != null ) {\n if ( m[3] ) {\n return [ m[0].length, [ "link", { href: "mailto:" + m[3] }, m[3] ] ];\n\n }\n else if ( m[2] == "mailto" ) {\n return [ m[0].length, [ "link", { href: m[1] }, m[1].substr("mailto:".length ) ] ];\n }\n else\n return [ m[0].length, [ "link", { href: m[1] }, m[1] ] ];\n }\n\n return [ 1, "<" ];\n },\n\n "`": function inlineCode( text ) {\n // Inline code block. as many backticks as you like to start it\n // Always skip over the opening ticks.\n var m = text.match( /(`+)(([\\s\\S]*?)\\1)/ );\n\n if ( m && m[2] )\n return [ m[1].length + m[2].length, [ "inlinecode", m[3] ] ];\n else {\n // TODO: No matching end code found - warn!\n return [ 1, "`" ];\n }\n },\n\n " \\n": function lineBreak( text ) {\n return [ 3, [ "linebreak" ] ];\n }\n\n};\n\n// Meta Helper/generator method for em and strong handling\nfunction strong_em( tag, md ) {\n\n var state_slot = tag + "_state",\n other_slot = tag == "strong" ? "em_state" : "strong_state";\n\n function CloseTag(len) {\n this.len_after = len;\n this.name = "close_" + md;\n }\n\n return function ( text, orig_match ) {\n\n if ( this[state_slot][0] == md ) {\n // Most recent em is of this type\n //D:this.debug("closing", md);\n this[state_slot].shift();\n\n // "Consume" everything to go back to the recrusion in the else-block below\n return[ text.length, new CloseTag(text.length-md.length) ];\n }\n else {\n // Store a clone of the em/strong states\n var other = this[other_slot].slice(),\n state = this[state_slot].slice();\n\n this[state_slot].unshift(md);\n\n //D:this.debug_indent += " ";\n\n // Recurse\n var res = this.processInline( text.substr( md.length ) );\n //D:this.debug_indent = this.debug_indent.substr(2);\n\n var last = res[res.length - 1];\n\n //D:this.debug("processInline from", tag + ": ", uneval( res ) );\n\n var check = this[state_slot].shift();\n if ( last instanceof CloseTag ) {\n res.pop();\n // We matched! Huzzah.\n var consumed = text.length - last.len_after;\n return [ consumed, [ tag ].concat(res) ];\n }\n else {\n // Restore the state of the other kind. We might have mistakenly closed it.\n this[other_slot] = other;\n this[state_slot] = state;\n\n // We can\'t reuse the processed result as it could have wrong parsing contexts in it.\n return [ md.length, md ];\n }\n }\n }; // End returned function\n}\n\nMarkdown.dialects.Gruber.inline["**"] = strong_em("strong", "**");\nMarkdown.dialects.Gruber.inline["__"] = strong_em("strong", "__");\nMarkdown.dialects.Gruber.inline["*"] = strong_em("em", "*");\nMarkdown.dialects.Gruber.inline["_"] = strong_em("em", "_");\n\n\n// Build default order from insertion order.\nMarkdown.buildBlockOrder = function(d) {\n var ord = [];\n for ( var i in d ) {\n if ( i == "__order__" || i == "__call__" ) continue;\n ord.push( i );\n }\n d.__order__ = ord;\n};\n\n// Build patterns for inline matcher\nMarkdown.buildInlinePatterns = function(d) {\n var patterns = [];\n\n for ( var i in d ) {\n // __foo__ is reserved and not a pattern\n if ( i.match( /^__.*__$/) ) continue;\n var l = i.replace( /([\\\\.*+?|()\\[\\]{}])/g, "\\\\$1" )\n .replace( /\\n/, "\\\\n" );\n patterns.push( i.length == 1 ? l : "(?:" + l + ")" );\n }\n\n patterns = patterns.join("|");\n d.__patterns__ = patterns;\n //print("patterns:", uneval( patterns ) );\n\n var fn = d.__call__;\n d.__call__ = function(text, pattern) {\n if ( pattern != undefined ) {\n return fn.call(this, text, pattern);\n }\n else\n {\n return fn.call(this, text, patterns);\n }\n };\n};\n\nMarkdown.DialectHelpers = {};\nMarkdown.DialectHelpers.inline_until_char = function( text, want ) {\n var consumed = 0,\n nodes = [];\n\n while ( true ) {\n if ( text.charAt( consumed ) == want ) {\n // Found the character we were looking for\n consumed++;\n return [ consumed, nodes ];\n }\n\n if ( consumed >= text.length ) {\n // No closing char found. Abort.\n return null;\n }\n\n var res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ) );\n consumed += res[ 0 ];\n // Add any returned nodes.\n nodes.push.apply( nodes, res.slice( 1 ) );\n }\n}\n\n// Helper function to make sub-classing a dialect easier\nMarkdown.subclassDialect = function( d ) {\n function Block() {}\n Block.prototype = d.block;\n function Inline() {}\n Inline.prototype = d.inline;\n\n return { block: new Block(), inline: new Inline() };\n};\n\nMarkdown.buildBlockOrder ( Markdown.dialects.Gruber.block );\nMarkdown.buildInlinePatterns( Markdown.dialects.Gruber.inline );\n\nMarkdown.dialects.Maruku = Markdown.subclassDialect( Markdown.dialects.Gruber );\n\nMarkdown.dialects.Maruku.processMetaHash = function processMetaHash( meta_string ) {\n var meta = split_meta_hash( meta_string ),\n attr = {};\n\n for ( var i = 0; i < meta.length; ++i ) {\n // id: #foo\n if ( /^#/.test( meta[ i ] ) ) {\n attr.id = meta[ i ].substring( 1 );\n }\n // class: .foo\n else if ( /^\\./.test( meta[ i ] ) ) {\n // if class already exists, append the new one\n if ( attr["class"] ) {\n attr["class"] = attr["class"] + meta[ i ].replace( /./, " " );\n }\n else {\n attr["class"] = meta[ i ].substring( 1 );\n }\n }\n // attribute: foo=bar\n else if ( /\\=/.test( meta[ i ] ) ) {\n var s = meta[ i ].split( /\\=/ );\n attr[ s[ 0 ] ] = s[ 1 ];\n }\n }\n\n return attr;\n}\n\nfunction split_meta_hash( meta_string ) {\n var meta = meta_string.split( "" ),\n parts = [ "" ],\n in_quotes = false;\n\n while ( meta.length ) {\n var letter = meta.shift();\n switch ( letter ) {\n case " " :\n // if we\'re in a quoted section, keep it\n if ( in_quotes ) {\n parts[ parts.length - 1 ] += letter;\n }\n // otherwise make a new part\n else {\n parts.push( "" );\n }\n break;\n case "\'" :\n case \'"\' :\n // reverse the quotes and move straight on\n in_quotes = !in_quotes;\n break;\n case "\\\\" :\n // shift off the next letter to be used straight away.\n // it was escaped so we\'ll keep it whatever it is\n letter = meta.shift();\n default :\n parts[ parts.length - 1 ] += letter;\n break;\n }\n }\n\n return parts;\n}\n\nMarkdown.dialects.Maruku.block.document_meta = function document_meta( block, next ) {\n // we\'re only interested in the first block\n if ( block.lineNumber > 1 ) return undefined;\n\n // document_meta blocks consist of one or more lines of `Key: Value\\n`\n if ( ! block.match( /^(?:\\w+:.*\\n)*\\w+:.*$/ ) ) return undefined;\n\n // make an attribute node if it doesn\'t exist\n if ( !extract_attr( this.tree ) ) {\n this.tree.splice( 1, 0, {} );\n }\n\n var pairs = block.split( /\\n/ );\n for ( p in pairs ) {\n var m = pairs[ p ].match( /(\\w+):\\s*(.*)$/ ),\n key = m[ 1 ].toLowerCase(),\n value = m[ 2 ];\n\n this.tree[ 1 ][ key ] = value;\n }\n\n // document_meta produces no content!\n return [];\n};\n\nMarkdown.dialects.Maruku.block.block_meta = function block_meta( block, next ) {\n // check if the last line of the block is an meta hash\n var m = block.match( /(^|\\n) {0,3}\\{:\\s*((?:\\\\\\}|[^\\}])*)\\s*\\}$/ );\n if ( !m ) return undefined;\n\n // process the meta hash\n var attr = this.dialect.processMetaHash( m[ 2 ] );\n\n var hash;\n\n // if we matched ^ then we need to apply meta to the previous block\n if ( m[ 1 ] === "" ) {\n var node = this.tree[ this.tree.length - 1 ];\n hash = extract_attr( node );\n\n // if the node is a string (rather than JsonML), bail\n if ( typeof node === "string" ) return undefined;\n\n // create the attribute hash if it doesn\'t exist\n if ( !hash ) {\n hash = {};\n node.splice( 1, 0, hash );\n }\n\n // add the attributes in\n for ( a in attr ) {\n hash[ a ] = attr[ a ];\n }\n\n // return nothing so the meta hash is removed\n return [];\n }\n\n // pull the meta hash off the block and process what\'s left\n var b = block.replace( /\\n.*$/, "" ),\n result = this.processBlock( b, [] );\n\n // get or make the attributes hash\n hash = extract_attr( result[ 0 ] );\n if ( !hash ) {\n hash = {};\n result[ 0 ].splice( 1, 0, hash );\n }\n\n // attach the attributes to the block\n for ( a in attr ) {\n hash[ a ] = attr[ a ];\n }\n\n return result;\n};\n\nMarkdown.dialects.Maruku.block.definition_list = function definition_list( block, next ) {\n // one or more terms followed by one or more definitions, in a single block\n var tight = /^((?:[^\\s:].*\\n)+):\\s+([\\s\\S]+)$/,\n list = [ "dl" ],\n i, m;\n\n // see if we\'re dealing with a tight or loose block\n if ( ( m = block.match( tight ) ) ) {\n // pull subsequent tight DL blocks out of `next`\n var blocks = [ block ];\n while ( next.length && tight.exec( next[ 0 ] ) ) {\n blocks.push( next.shift() );\n }\n\n for ( var b = 0; b < blocks.length; ++b ) {\n var m = blocks[ b ].match( tight ),\n terms = m[ 1 ].replace( /\\n$/, "" ).split( /\\n/ ),\n defns = m[ 2 ].split( /\\n:\\s+/ );\n\n // print( uneval( m ) );\n\n for ( i = 0; i < terms.length; ++i ) {\n list.push( [ "dt", terms[ i ] ] );\n }\n\n for ( i = 0; i < defns.length; ++i ) {\n // run inline processing over the definition\n list.push( [ "dd" ].concat( this.processInline( defns[ i ].replace( /(\\n)\\s+/, "$1" ) ) ) );\n }\n }\n }\n else {\n return undefined;\n }\n\n return [ list ];\n};\n\n// splits on unescaped instances of @ch. If @ch is not a character the result\n// can be unpredictable\n\nMarkdown.dialects.Maruku.block.table = function table (block, next) {\n\n var _split_on_unescaped = function(s, ch) {\n ch = ch || \'\\\\s\';\n if (ch.match(/^[\\\\|\\[\\]{}?*.+^$]$/)) { ch = \'\\\\\' + ch; }\n var res = [ ],\n r = new RegExp(\'^((?:\\\\\\\\.|[^\\\\\\\\\' + ch + \'])*)\' + ch + \'(.*)\'),\n m;\n while(m = s.match(r)) {\n res.push(m[1]);\n s = m[2];\n }\n res.push(s);\n return res;\n }\n\n var leading_pipe = /^ {0,3}\\|(.+)\\n {0,3}\\|\\s*([\\-:]+[\\-| :]*)\\n((?:\\s*\\|.*(?:\\n|$))*)(?=\\n|$)/,\n // find at least an unescaped pipe in each line\n no_leading_pipe = /^ {0,3}(\\S(?:\\\\.|[^\\\\|])*\\|.*)\\n {0,3}([\\-:]+\\s*\\|[\\-| :]*)\\n((?:(?:\\\\.|[^\\\\|])*\\|.*(?:\\n|$))*)(?=\\n|$)/,\n i, m;\n if (m = block.match(leading_pipe)) {\n // remove leading pipes in contents\n // (header and horizontal rule already have the leading pipe left out)\n m[3] = m[3].replace(/^\\s*\\|/gm, \'\');\n } else if (! ( m = block.match(no_leading_pipe))) {\n return undefined;\n }\n\n var table = [ "table", [ "thead", [ "tr" ] ], [ "tbody" ] ];\n\n // remove trailing pipes, then split on pipes\n // (no escaped pipes are allowed in horizontal rule)\n m[2] = m[2].replace(/\\|\\s*$/, \'\').split(\'|\');\n\n // process alignment\n var html_attrs = [ ];\n forEach (m[2], function (s) {\n if (s.match(/^\\s*-+:\\s*$/)) html_attrs.push({align: "right"});\n else if (s.match(/^\\s*:-+\\s*$/)) html_attrs.push({align: "left"});\n else if (s.match(/^\\s*:-+:\\s*$/)) html_attrs.push({align: "center"});\n else html_attrs.push({});\n });\n\n // now for the header, avoid escaped pipes\n m[1] = _split_on_unescaped(m[1].replace(/\\|\\s*$/, \'\'), \'|\');\n for (i = 0; i < m[1].length; i++) {\n table[1][1].push([\'th\', html_attrs[i] || {}].concat(\n this.processInline(m[1][i].trim())));\n }\n\n // now for body contents\n forEach (m[3].replace(/\\|\\s*$/mg, \'\').split(\'\\n\'), function (row) {\n var html_row = [\'tr\'];\n row = _split_on_unescaped(row, \'|\');\n for (i = 0; i < row.length; i++) {\n html_row.push([\'td\', html_attrs[i] || {}].concat(this.processInline(row[i].trim())));\n }\n table[2].push(html_row);\n }, this);\n\n return [table];\n}\n\nMarkdown.dialects.Maruku.inline[ "{:" ] = function inline_meta( text, matches, out ) {\n if ( !out.length ) {\n return [ 2, "{:" ];\n }\n\n // get the preceeding element\n var before = out[ out.length - 1 ];\n\n if ( typeof before === "string" ) {\n return [ 2, "{:" ];\n }\n\n // match a meta hash\n var m = text.match( /^\\{:\\s*((?:\\\\\\}|[^\\}])*)\\s*\\}/ );\n\n // no match, false alarm\n if ( !m ) {\n return [ 2, "{:" ];\n }\n\n // attach the attributes to the preceeding element\n var meta = this.dialect.processMetaHash( m[ 1 ] ),\n attr = extract_attr( before );\n\n if ( !attr ) {\n attr = {};\n before.splice( 1, 0, attr );\n }\n\n for ( var k in meta ) {\n attr[ k ] = meta[ k ];\n }\n\n // cut out the string and replace it with nothing\n return [ m[ 0 ].length, "" ];\n};\n\nMarkdown.dialects.Maruku.inline.__escape__ = /^\\\\[\\\\`\\*_{}\\[\\]()#\\+.!\\-|:]/;\n\nMarkdown.buildBlockOrder ( Markdown.dialects.Maruku.block );\nMarkdown.buildInlinePatterns( Markdown.dialects.Maruku.inline );\n\nvar isArray = Array.isArray || function(obj) {\n return Object.prototype.toString.call(obj) == "[object Array]";\n};\n\nvar forEach;\n// Don\'t mess with Array.prototype. Its not friendly\nif ( Array.prototype.forEach ) {\n forEach = function( arr, cb, thisp ) {\n return arr.forEach( cb, thisp );\n };\n}\nelse {\n forEach = function(arr, cb, thisp) {\n for (var i = 0; i < arr.length; i++) {\n cb.call(thisp || arr, arr[i], i, arr);\n }\n }\n}\n\nvar isEmpty = function( obj ) {\n for ( var key in obj ) {\n if ( hasOwnProperty.call( obj, key ) ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction extract_attr( jsonml ) {\n return isArray(jsonml)\n && jsonml.length > 1\n && typeof jsonml[ 1 ] === "object"\n && !( isArray(jsonml[ 1 ]) )\n ? jsonml[ 1 ]\n : undefined;\n}\n\n\n\n/**\n * renderJsonML( jsonml[, options] ) -> String\n * - jsonml (Array): JsonML array to render to XML\n * - options (Object): options\n *\n * Converts the given JsonML into well-formed XML.\n *\n * The options currently understood are:\n *\n * - root (Boolean): wether or not the root node should be included in the\n * output, or just its children. The default `false` is to not include the\n * root itself.\n */\nexpose.renderJsonML = function( jsonml, options ) {\n options = options || {};\n // include the root element in the rendered output?\n options.root = options.root || false;\n\n var content = [];\n\n if ( options.root ) {\n content.push( render_tree( jsonml ) );\n }\n else {\n jsonml.shift(); // get rid of the tag\n if ( jsonml.length && typeof jsonml[ 0 ] === "object" && !( jsonml[ 0 ] instanceof Array ) ) {\n jsonml.shift(); // get rid of the attributes\n }\n\n while ( jsonml.length ) {\n content.push( render_tree( jsonml.shift() ) );\n }\n }\n\n return content.join( "\\n\\n" );\n};\n\nfunction escapeHTML( text ) {\n return text.replace( /&/g, "&" )\n .replace( //g, ">" )\n .replace( /"/g, """ )\n .replace( /\'/g, "'" );\n}\n\nfunction render_tree( jsonml ) {\n // basic case\n if ( typeof jsonml === "string" ) {\n return escapeHTML( jsonml );\n }\n\n var tag = jsonml.shift(),\n attributes = {},\n content = [];\n\n if ( jsonml.length && typeof jsonml[ 0 ] === "object" && !( jsonml[ 0 ] instanceof Array ) ) {\n attributes = jsonml.shift();\n }\n\n while ( jsonml.length ) {\n content.push( render_tree( jsonml.shift() ) );\n }\n\n var tag_attrs = "";\n for ( var a in attributes ) {\n tag_attrs += " " + a + \'="\' + escapeHTML( attributes[ a ] ) + \'"\';\n }\n\n // be careful about adding whitespace here for inline elements\n if ( tag == "img" || tag == "br" || tag == "hr" ) {\n return "<"+ tag + tag_attrs + "/>";\n }\n else {\n return "<"+ tag + tag_attrs + ">" + content.join( "" ) + "";\n }\n}\n\nfunction convert_tree_to_html( tree, references, options ) {\n var i;\n options = options || {};\n\n // shallow clone\n var jsonml = tree.slice( 0 );\n\n if ( typeof options.preprocessTreeNode === "function" ) {\n jsonml = options.preprocessTreeNode(jsonml, references);\n }\n\n // Clone attributes if they exist\n var attrs = extract_attr( jsonml );\n if ( attrs ) {\n jsonml[ 1 ] = {};\n for ( i in attrs ) {\n jsonml[ 1 ][ i ] = attrs[ i ];\n }\n attrs = jsonml[ 1 ];\n }\n\n // basic case\n if ( typeof jsonml === "string" ) {\n return jsonml;\n }\n\n // convert this node\n switch ( jsonml[ 0 ] ) {\n case "header":\n jsonml[ 0 ] = "h" + jsonml[ 1 ].level;\n delete jsonml[ 1 ].level;\n break;\n case "bulletlist":\n jsonml[ 0 ] = "ul";\n break;\n case "numberlist":\n jsonml[ 0 ] = "ol";\n break;\n case "listitem":\n jsonml[ 0 ] = "li";\n break;\n case "para":\n jsonml[ 0 ] = "p";\n break;\n case "markdown":\n jsonml[ 0 ] = "html";\n if ( attrs ) delete attrs.references;\n break;\n case "code_block":\n jsonml[ 0 ] = "pre";\n i = attrs ? 2 : 1;\n var code = [ "code" ];\n code.push.apply( code, jsonml.splice( i, jsonml.length - i ) );\n jsonml[ i ] = code;\n break;\n case "inlinecode":\n jsonml[ 0 ] = "code";\n break;\n case "img":\n jsonml[ 1 ].src = jsonml[ 1 ].href;\n delete jsonml[ 1 ].href;\n break;\n case "linebreak":\n jsonml[ 0 ] = "br";\n break;\n case "link":\n jsonml[ 0 ] = "a";\n break;\n case "link_ref":\n jsonml[ 0 ] = "a";\n\n // grab this ref and clean up the attribute node\n var ref = references[ attrs.ref ];\n\n // if the reference exists, make the link\n if ( ref ) {\n delete attrs.ref;\n\n // add in the href and title, if present\n attrs.href = ref.href;\n if ( ref.title ) {\n attrs.title = ref.title;\n }\n\n // get rid of the unneeded original text\n delete attrs.original;\n }\n // the reference doesn\'t exist, so revert to plain text\n else {\n return attrs.original;\n }\n break;\n case "img_ref":\n jsonml[ 0 ] = "img";\n\n // grab this ref and clean up the attribute node\n var ref = references[ attrs.ref ];\n\n // if the reference exists, make the link\n if ( ref ) {\n delete attrs.ref;\n\n // add in the href and title, if present\n attrs.src = ref.href;\n if ( ref.title ) {\n attrs.title = ref.title;\n }\n\n // get rid of the unneeded original text\n delete attrs.original;\n }\n // the reference doesn\'t exist, so revert to plain text\n else {\n return attrs.original;\n }\n break;\n }\n\n // convert all the children\n i = 1;\n\n // deal with the attribute node, if it exists\n if ( attrs ) {\n // if there are keys, skip over it\n for ( var key in jsonml[ 1 ] ) {\n i = 2;\n break;\n }\n // if there aren\'t, remove it\n if ( i === 1 ) {\n jsonml.splice( i, 1 );\n }\n }\n\n for ( ; i < jsonml.length; ++i ) {\n jsonml[ i ] = convert_tree_to_html( jsonml[ i ], references, options );\n }\n\n return jsonml;\n}\n\n\n// merges adjacent text nodes into a single node\nfunction merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it\'s a string check the next item too\n if ( typeof jsonml[ i ] === "string" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === "string" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it\'s not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}\n\n} )( (function() {\n if ( false ) {\n window.markdown = {};\n return window.markdown;\n }\n else {\n return exports;\n }\n} )() );\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/markdown/lib/markdown.js\n ** module id = 718\n ** module chunks = 22\n **/\n//# sourceURL=webpack:///./~/markdown/lib/markdown.js?'); },932:function(module,exports,__webpack_require__){eval("/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require(\"/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-api/modules/index.js\"), RootInstanceProvider = require(\"/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-loader/RootInstanceProvider.js\"), ReactMount = require(\"react/lib/ReactMount\"), React = require(\"react\"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {\n\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _react = __webpack_require__(1);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactBootstrap = __webpack_require__(2);\n\nvar _markdown = __webpack_require__(717);\n\nvar _utilUserNotification = __webpack_require__(5);\n\nvar _utilUserNotification2 = _interopRequireDefault(_utilUserNotification);\n\nvar _actionsConfigurationBundlesConfigurationBundlesActions = __webpack_require__(129);\n\nvar _actionsConfigurationBundlesConfigurationBundlesActions2 = _interopRequireDefault(_actionsConfigurationBundlesConfigurationBundlesActions);\n\nvar ConfigurationBundlePreview = _react2['default'].createClass({\n displayName: 'ConfigurationBundlePreview',\n\n _confirmDeletion: function _confirmDeletion() {\n if (window.confirm('You are about to delete this content pack, are you sure?')) {\n _actionsConfigurationBundlesConfigurationBundlesActions2['default']['delete'](this.props.sourceTypeId).then(function () {\n _utilUserNotification2['default'].success('Bundle deleted successfully!', 'Success!');\n }, function () {\n _utilUserNotification2['default'].error('Deleting bundle failed!', 'Error!');\n });\n }\n },\n _onApply: function _onApply() {\n _actionsConfigurationBundlesConfigurationBundlesActions2['default'].apply(this.props.sourceTypeId).then(function () {\n _utilUserNotification2['default'].success('Bundle applied successfully!', 'Success!');\n }, function () {\n _utilUserNotification2['default'].error('Applying bundle failed!', 'Error!');\n });\n },\n render: function render() {\n var preview = 'Select a content pack from the list to see its preview.';\n var apply_action = '';\n var delete_action = '';\n\n if (this.props.sourceTypeDescription) {\n preview = this.props.sourceTypeDescription;\n apply_action = _react2['default'].createElement(\n _reactBootstrap.Button,\n { bsStyle: 'success', onClick: this._onApply },\n 'Apply content'\n );\n delete_action = _react2['default'].createElement(\n _reactBootstrap.Button,\n { className: 'pull-right', bsStyle: 'warning', onClick: this._confirmDeletion },\n 'Remove pack'\n );\n }\n\n var markdownPreview = _markdown.markdown.toHTML(preview);\n\n return _react2['default'].createElement(\n 'div',\n { className: 'bundle-preview' },\n delete_action,\n _react2['default'].createElement(\n 'h2',\n null,\n 'Content pack description:'\n ),\n _react2['default'].createElement('div', { dangerouslySetInnerHTML: { __html: markdownPreview } }),\n _react2['default'].createElement(\n 'div',\n { className: 'preview-actions' },\n apply_action\n )\n );\n }\n});\n\nexports['default'] = ConfigurationBundlePreview;\nmodule.exports = exports['default'];\n\n/* REACT HOT LOADER */ }).call(this); } finally { if (false) { (function () { var foundReactClasses = module.hot.data && module.hot.data.foundReactClasses || false; if (module.exports && module.makeHot) { var makeExportsHot = require(\"/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-loader/makeExportsHot.js\"); if (makeExportsHot(module, require(\"react\"))) { foundReactClasses = true; } var shouldAcceptModule = true && foundReactClasses; if (shouldAcceptModule) { module.hot.accept(function (err) { if (err) { console.error(\"Cannot not apply hot update to \" + \"ConfigurationBundlePreview.jsx\" + \": \" + err.message); } }); } } module.hot.dispose(function (data) { data.makeHot = module.makeHot; data.foundReactClasses = foundReactClasses; }); })(); } }\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/components/source-tagging/ConfigurationBundlePreview.jsx\n ** module id = 932\n ** module chunks = 22\n **/\n//# sourceURL=webpack:///./src/components/source-tagging/ConfigurationBundlePreview.jsx?")},933:function(module,exports,__webpack_require__){eval("/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require(\"/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-api/modules/index.js\"), RootInstanceProvider = require(\"/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-loader/RootInstanceProvider.js\"), ReactMount = require(\"react/lib/ReactMount\"), React = require(\"react\"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {\n\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _react = __webpack_require__(1);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reflux = __webpack_require__(3);\n\nvar _reflux2 = _interopRequireDefault(_reflux);\n\nvar _reactBootstrap = __webpack_require__(2);\n\nvar _jquery = __webpack_require__(10);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nvar _utilUserNotification = __webpack_require__(5);\n\nvar _utilUserNotification2 = _interopRequireDefault(_utilUserNotification);\n\nvar _actionsConfigurationBundlesConfigurationBundlesActions = __webpack_require__(129);\n\nvar _actionsConfigurationBundlesConfigurationBundlesActions2 = _interopRequireDefault(_actionsConfigurationBundlesConfigurationBundlesActions);\n\nvar _storesConfigurationBundlesConfigurationBundlesStore = __webpack_require__(327);\n\nvar _storesConfigurationBundlesConfigurationBundlesStore2 = _interopRequireDefault(_storesConfigurationBundlesConfigurationBundlesStore);\n\nvar _SourceType = __webpack_require__(934);\n\nvar _SourceType2 = _interopRequireDefault(_SourceType);\n\nvar _ConfigurationBundlePreview = __webpack_require__(932);\n\nvar _ConfigurationBundlePreview2 = _interopRequireDefault(_ConfigurationBundlePreview);\n\nvar _componentsCommonSpinner = __webpack_require__(19);\n\nvar _componentsCommonSpinner2 = _interopRequireDefault(_componentsCommonSpinner);\n\nvar ConfigurationBundles = _react2['default'].createClass({\n displayName: 'ConfigurationBundles',\n\n mixins: [_reflux2['default'].connect(_storesConfigurationBundlesConfigurationBundlesStore2['default'])],\n\n getInitialState: function getInitialState() {\n return {\n sourceTypeId: '',\n sourceTypeDescription: ''\n };\n },\n componentDidMount: function componentDidMount() {\n _actionsConfigurationBundlesConfigurationBundlesActions2['default'].list();\n },\n _getCategoriesHtml: function _getCategoriesHtml() {\n var _this = this;\n\n var categories = _jquery2['default'].map(this.state.configurationBundles, function (bundles, category) {\n return category;\n });\n categories.sort();\n return categories.map(function (category, idx) {\n return _this._getSourceTypeHtml(category, idx);\n }, this);\n },\n _getSourceTypeHtml: function _getSourceTypeHtml(category, idx) {\n var _this2 = this;\n\n var bundles = this._getSortedBundles(category);\n var bundlesJsx = bundles.map(function (bundle) {\n return _react2['default'].createElement(\n 'li',\n { key: bundle.id },\n _react2['default'].createElement(_SourceType2['default'], { id: bundle.id,\n name: bundle.name,\n description: bundle.description,\n onSelect: _this2.handleSourceTypeChange })\n );\n }, this);\n\n return _react2['default'].createElement(\n _reactBootstrap.Panel,\n { key: category, header: category, eventKey: idx },\n _react2['default'].createElement(\n 'ul',\n null,\n bundlesJsx\n )\n );\n },\n _getSortedBundles: function _getSortedBundles(category) {\n var bundles = this.state.configurationBundles[category];\n bundles.sort(function (bundle1, bundle2) {\n if (bundle1.name > bundle2.name) {\n return 1;\n }\n if (bundle1.name < bundle2.name) {\n return -1;\n }\n return 0;\n });\n return bundles;\n },\n onSubmit: function onSubmit(submitEvent) {\n submitEvent.preventDefault();\n if (!this.refs.uploadedFile.files || !this.refs.uploadedFile.files[0]) {\n return;\n }\n\n var reader = new FileReader();\n\n reader.onload = function (evt) {\n var request = evt.target.result;\n _actionsConfigurationBundlesConfigurationBundlesActions2['default'].create.triggerPromise(request).then(function () {\n _utilUserNotification2['default'].success('Bundle added successfully', 'Success!');\n _actionsConfigurationBundlesConfigurationBundlesActions2['default'].list();\n });\n };\n\n reader.readAsText(this.refs.uploadedFile.files[0]);\n },\n handleSourceTypeChange: function handleSourceTypeChange(sourceTypeId, sourceTypeDescription) {\n this.setState({ sourceTypeId: sourceTypeId, sourceTypeDescription: sourceTypeDescription });\n },\n render: function render() {\n return _react2['default'].createElement(\n _reactBootstrap.Row,\n { className: 'configuration-bundles' },\n _react2['default'].createElement(\n _reactBootstrap.Col,\n { md: 6 },\n this.state.configurationBundles ? _react2['default'].createElement(\n _reactBootstrap.Accordion,\n null,\n this._getCategoriesHtml(),\n _react2['default'].createElement(\n _reactBootstrap.Panel,\n { header: 'Import content pack', eventKey: -1 },\n _react2['default'].createElement(\n 'form',\n { onSubmit: this.onSubmit, className: 'form-inline upload', encType: 'multipart/form-data' },\n _react2['default'].createElement(\n 'span',\n { className: 'help-block' },\n 'Please apply the content pack after uploading it to make the changes effective.'\n ),\n _react2['default'].createElement('input', { ref: 'uploadedFile', type: 'file', name: 'bundle' }),\n _react2['default'].createElement(\n 'button',\n { type: 'submit', className: 'btn btn-success' },\n 'Upload'\n )\n )\n )\n ) : _react2['default'].createElement(_componentsCommonSpinner2['default'], null)\n ),\n _react2['default'].createElement(\n _reactBootstrap.Col,\n { md: 6 },\n _react2['default'].createElement(_ConfigurationBundlePreview2['default'], { sourceTypeId: this.state.sourceTypeId, sourceTypeDescription: this.state.sourceTypeDescription })\n )\n );\n }\n});\n\nexports['default'] = ConfigurationBundles;\nmodule.exports = exports['default'];\n\n/* REACT HOT LOADER */ }).call(this); } finally { if (false) { (function () { var foundReactClasses = module.hot.data && module.hot.data.foundReactClasses || false; if (module.exports && module.makeHot) { var makeExportsHot = require(\"/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-loader/makeExportsHot.js\"); if (makeExportsHot(module, require(\"react\"))) { foundReactClasses = true; } var shouldAcceptModule = true && foundReactClasses; if (shouldAcceptModule) { module.hot.accept(function (err) { if (err) { console.error(\"Cannot not apply hot update to \" + \"ConfigurationBundles.jsx\" + \": \" + err.message); } }); } } module.hot.dispose(function (data) { data.makeHot = module.makeHot; data.foundReactClasses = foundReactClasses; }); })(); } }\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/components/source-tagging/ConfigurationBundles.jsx\n ** module id = 933\n ** module chunks = 22\n **/\n//# sourceURL=webpack:///./src/components/source-tagging/ConfigurationBundles.jsx?")},934:function(module,exports,__webpack_require__){eval('/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require("/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-api/modules/index.js"), RootInstanceProvider = require("/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-loader/RootInstanceProvider.js"), ReactMount = require("react/lib/ReactMount"), React = require("react"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {\n\n\'use strict\';\n\nvar React = __webpack_require__(1);\n\nvar SourceType = React.createClass({\n displayName: \'SourceType\',\n\n _onChange: function _onChange(event) {\n this.props.onSelect(event.target.id, event.target.value);\n },\n render: function render() {\n return React.createElement(\n \'label\',\n { className: \'radio\' },\n React.createElement(\'input\', { type: \'radio\', name: \'sourceType\', id: this.props.id, value: this.props.description, onChange: this._onChange }),\n this.props.name\n );\n }\n});\n\nmodule.exports = SourceType;\n\n/* REACT HOT LOADER */ }).call(this); } finally { if (false) { (function () { var foundReactClasses = module.hot.data && module.hot.data.foundReactClasses || false; if (module.exports && module.makeHot) { var makeExportsHot = require("/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-loader/makeExportsHot.js"); if (makeExportsHot(module, require("react"))) { foundReactClasses = true; } var shouldAcceptModule = true && foundReactClasses; if (shouldAcceptModule) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "SourceType.jsx" + ": " + err.message); } }); } } module.hot.dispose(function (data) { data.makeHot = module.makeHot; data.foundReactClasses = foundReactClasses; }); })(); } }\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/components/source-tagging/SourceType.jsx\n ** module id = 934\n ** module chunks = 22\n **/\n//# sourceURL=webpack:///./src/components/source-tagging/SourceType.jsx?')},1001:function(module,exports,__webpack_require__){eval("/* REACT HOT LOADER */ if (false) { (function () { var ReactHotAPI = require(\"/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-api/modules/index.js\"), RootInstanceProvider = require(\"/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-loader/RootInstanceProvider.js\"), ReactMount = require(\"react/lib/ReactMount\"), React = require(\"react\"); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } try { (function () {\n\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _react = __webpack_require__(1);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactBootstrap = __webpack_require__(2);\n\nvar _reactRouterBootstrap = __webpack_require__(17);\n\nvar _routingRoutes = __webpack_require__(11);\n\nvar _routingRoutes2 = _interopRequireDefault(_routingRoutes);\n\nvar _componentsCommonPageHeader = __webpack_require__(43);\n\nvar _componentsCommonPageHeader2 = _interopRequireDefault(_componentsCommonPageHeader);\n\nvar _componentsSourceTaggingConfigurationBundles = __webpack_require__(933);\n\nvar _componentsSourceTaggingConfigurationBundles2 = _interopRequireDefault(_componentsSourceTaggingConfigurationBundles);\n\nvar ContentPacksPage = _react2['default'].createClass({\n displayName: 'ContentPacksPage',\n\n render: function render() {\n\n return _react2['default'].createElement(\n 'span',\n null,\n _react2['default'].createElement(\n _componentsCommonPageHeader2['default'],\n { title: 'Content packs' },\n _react2['default'].createElement(\n 'span',\n null,\n 'Content packs accelerate the set up process for a specific data source. A content pack can include inputs/extractors, streams, and dashboards.'\n ),\n _react2['default'].createElement(\n 'span',\n null,\n 'Find more content packs in ',\n ' ',\n _react2['default'].createElement(\n 'a',\n { href: 'https://marketplace.graylog.org/', target: '_blank' },\n 'the Graylog Marketplace'\n ),\n '.'\n ),\n _react2['default'].createElement(\n _reactRouterBootstrap.LinkContainer,\n { to: _routingRoutes2['default'].SYSTEM.CONTENTPACKS.EXPORT },\n _react2['default'].createElement(\n _reactBootstrap.Button,\n { bsStyle: 'success', bsSize: 'large' },\n 'Create a content pack'\n )\n )\n ),\n _react2['default'].createElement(\n _reactBootstrap.Row,\n { className: 'content' },\n _react2['default'].createElement(\n _reactBootstrap.Col,\n { md: 12 },\n _react2['default'].createElement(\n 'h2',\n null,\n 'Select content packs'\n ),\n _react2['default'].createElement(\n 'div',\n { id: 'react-configuration-bundles' },\n _react2['default'].createElement(_componentsSourceTaggingConfigurationBundles2['default'], null)\n )\n )\n )\n );\n }\n});\n\nexports['default'] = ContentPacksPage;\nmodule.exports = exports['default'];\n\n/* REACT HOT LOADER */ }).call(this); } finally { if (false) { (function () { var foundReactClasses = module.hot.data && module.hot.data.foundReactClasses || false; if (module.exports && module.makeHot) { var makeExportsHot = require(\"/var/lib/jenkins/jobs/graylog-release/workspace/target/checkout/graylog2-web-interface/node_modules/react-hot-loader/makeExportsHot.js\"); if (makeExportsHot(module, require(\"react\"))) { foundReactClasses = true; } var shouldAcceptModule = true && foundReactClasses; if (shouldAcceptModule) { module.hot.accept(function (err) { if (err) { console.error(\"Cannot not apply hot update to \" + \"ContentPacksPage.jsx\" + \": \" + err.message); } }); } } module.hot.dispose(function (data) { data.makeHot = module.makeHot; data.foundReactClasses = foundReactClasses; }); })(); } }\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react-hot-loader!./~/babel-loader!./src/pages/ContentPacksPage.jsx\n ** module id = 1001\n ** module chunks = 22\n **/\n//# sourceURL=webpack:///./src/pages/ContentPacksPage.jsx?./~/react-hot-loader!./~/babel-loader")},1150:function(module,exports){eval("module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/util/support/isBufferBrowser.js\n ** module id = 1150\n ** module chunks = 22\n **/\n//# sourceURL=webpack:///./~/util/support/isBufferBrowser.js?")},1151:function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = __webpack_require__(1150);\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = __webpack_require__(714);\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(65)))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/util/util.js\n ** module id = 1151\n ** module chunks = 22\n **/\n//# sourceURL=webpack:///./~/util/util.js?"); }});




  • © 2015 - 2024 Weber Informatics LLC | Privacy Policy