detectType = function detectType(text) {
  text = text.replace(/^\s*%%.*\n/g, '\n');
  _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Detecting diagram type based on the text ' + text);

  if (text.match(/^\s*sequenceDiagram/)) {
    return 'sequence';
  }

  if (text.match(/^\s*gantt/)) {
    return 'gantt';
  }

  if (text.match(/^\s*classDiagram/)) {
    return 'class';
  }

  if (text.match(/^\s*stateDiagram/)) {
    return 'state';
  }

  if (text.match(/^\s*gitGraph/)) {
    return 'git';
  }

  if (text.match(/^\s*info/)) {
    return 'info';
  }

  if (text.match(/^\s*pie/)) {
    return 'pie';
  }

  return 'flowchart';
}
@function detectType
Detects the type of the graph text.
```mermaid
graph LR
 a-->b
 b-->c
 c-->d
 d-->e
 e-->f
 f-->g
 g-->h
```

@param {string} text The text defining the graph
@returns {string} A graph definition key