[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> blocks.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["blocks"] =
   2  /******/ (function(modules) { // webpackBootstrap
   3  /******/     // The module cache
   4  /******/     var installedModules = {};
   5  /******/
   6  /******/     // The require function
   7  /******/ 	function __webpack_require__(moduleId) {
   8  /******/
   9  /******/         // Check if module is in cache
  10  /******/         if(installedModules[moduleId]) {
  11  /******/             return installedModules[moduleId].exports;
  12  /******/         }
  13  /******/         // Create a new module (and put it into the cache)
  14  /******/         var module = installedModules[moduleId] = {
  15  /******/             i: moduleId,
  16  /******/             l: false,
  17  /******/             exports: {}
  18  /******/         };
  19  /******/
  20  /******/         // Execute the module function
  21  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22  /******/
  23  /******/         // Flag the module as loaded
  24  /******/         module.l = true;
  25  /******/
  26  /******/         // Return the exports of the module
  27  /******/         return module.exports;
  28  /******/     }
  29  /******/
  30  /******/
  31  /******/     // expose the modules object (__webpack_modules__)
  32  /******/     __webpack_require__.m = modules;
  33  /******/
  34  /******/     // expose the module cache
  35  /******/     __webpack_require__.c = installedModules;
  36  /******/
  37  /******/     // define getter function for harmony exports
  38  /******/     __webpack_require__.d = function(exports, name, getter) {
  39  /******/         if(!__webpack_require__.o(exports, name)) {
  40  /******/             Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41  /******/         }
  42  /******/     };
  43  /******/
  44  /******/     // define __esModule on exports
  45  /******/     __webpack_require__.r = function(exports) {
  46  /******/         if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47  /******/             Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48  /******/         }
  49  /******/         Object.defineProperty(exports, '__esModule', { value: true });
  50  /******/     };
  51  /******/
  52  /******/     // create a fake namespace object
  53  /******/     // mode & 1: value is a module id, require it
  54  /******/     // mode & 2: merge all properties of value into the ns
  55  /******/     // mode & 4: return value when already ns object
  56  /******/     // mode & 8|1: behave like require
  57  /******/     __webpack_require__.t = function(value, mode) {
  58  /******/         if(mode & 1) value = __webpack_require__(value);
  59  /******/         if(mode & 8) return value;
  60  /******/         if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61  /******/         var ns = Object.create(null);
  62  /******/         __webpack_require__.r(ns);
  63  /******/         Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64  /******/         if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65  /******/         return ns;
  66  /******/     };
  67  /******/
  68  /******/     // getDefaultExport function for compatibility with non-harmony modules
  69  /******/     __webpack_require__.n = function(module) {
  70  /******/         var getter = module && module.__esModule ?
  71  /******/ 			function getDefault() { return module['default']; } :
  72  /******/ 			function getModuleExports() { return module; };
  73  /******/         __webpack_require__.d(getter, 'a', getter);
  74  /******/         return getter;
  75  /******/     };
  76  /******/
  77  /******/     // Object.prototype.hasOwnProperty.call
  78  /******/     __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79  /******/
  80  /******/     // __webpack_public_path__
  81  /******/     __webpack_require__.p = "";
  82  /******/
  83  /******/
  84  /******/     // Load entry module and return exports
  85  /******/     return __webpack_require__(__webpack_require__.s = 425);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = this["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 1:
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = this["wp"]["i18n"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ 116:
 105  /***/ (function(module, exports) {
 106  
 107  // Unique ID creation requires a high quality random # generator.  In the
 108  // browser this is a little complicated due to unknown quality of Math.random()
 109  // and inconsistent support for the `crypto` API.  We do the best we can via
 110  // feature-detection
 111  
 112  // getRandomValues needs to be invoked in a context where "this" is a Crypto
 113  // implementation. Also, find the complete implementation of crypto on IE11.
 114  var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
 115                        (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
 116  
 117  if (getRandomValues) {
 118    // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
 119    var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
 120  
 121    module.exports = function whatwgRNG() {
 122      getRandomValues(rnds8);
 123      return rnds8;
 124    };
 125  } else {
 126    // Math.random()-based (RNG)
 127    //
 128    // If all else fails, use Math.random().  It's fast, but is of unspecified
 129    // quality.
 130    var rnds = new Array(16);
 131  
 132    module.exports = function mathRNG() {
 133      for (var i = 0, r; i < 16; i++) {
 134        if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
 135        rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
 136      }
 137  
 138      return rnds;
 139    };
 140  }
 141  
 142  
 143  /***/ }),
 144  
 145  /***/ 117:
 146  /***/ (function(module, exports) {
 147  
 148  /**
 149   * Convert array of 16 byte values to UUID string format of the form:
 150   * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 151   */
 152  var byteToHex = [];
 153  for (var i = 0; i < 256; ++i) {
 154    byteToHex[i] = (i + 0x100).toString(16).substr(1);
 155  }
 156  
 157  function bytesToUuid(buf, offset) {
 158    var i = offset || 0;
 159    var bth = byteToHex;
 160    // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
 161    return ([bth[buf[i++]], bth[buf[i++]], 
 162      bth[buf[i++]], bth[buf[i++]], '-',
 163      bth[buf[i++]], bth[buf[i++]], '-',
 164      bth[buf[i++]], bth[buf[i++]], '-',
 165      bth[buf[i++]], bth[buf[i++]], '-',
 166      bth[buf[i++]], bth[buf[i++]],
 167      bth[buf[i++]], bth[buf[i++]],
 168      bth[buf[i++]], bth[buf[i++]]]).join('');
 169  }
 170  
 171  module.exports = bytesToUuid;
 172  
 173  
 174  /***/ }),
 175  
 176  /***/ 12:
 177  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 178  
 179  "use strict";
 180  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
 181  function _extends() {
 182    _extends = Object.assign || function (target) {
 183      for (var i = 1; i < arguments.length; i++) {
 184        var source = arguments[i];
 185  
 186        for (var key in source) {
 187          if (Object.prototype.hasOwnProperty.call(source, key)) {
 188            target[key] = source[key];
 189          }
 190        }
 191      }
 192  
 193      return target;
 194    };
 195  
 196    return _extends.apply(this, arguments);
 197  }
 198  
 199  /***/ }),
 200  
 201  /***/ 13:
 202  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 203  
 204  "use strict";
 205  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 206  function _defineProperties(target, props) {
 207    for (var i = 0; i < props.length; i++) {
 208      var descriptor = props[i];
 209      descriptor.enumerable = descriptor.enumerable || false;
 210      descriptor.configurable = true;
 211      if ("value" in descriptor) descriptor.writable = true;
 212      Object.defineProperty(target, descriptor.key, descriptor);
 213    }
 214  }
 215  
 216  function _createClass(Constructor, protoProps, staticProps) {
 217    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 218    if (staticProps) _defineProperties(Constructor, staticProps);
 219    return Constructor;
 220  }
 221  
 222  /***/ }),
 223  
 224  /***/ 14:
 225  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 226  
 227  "use strict";
 228  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 229  function _classCallCheck(instance, Constructor) {
 230    if (!(instance instanceof Constructor)) {
 231      throw new TypeError("Cannot call a class as a function");
 232    }
 233  }
 234  
 235  /***/ }),
 236  
 237  /***/ 149:
 238  /***/ (function(module, exports) {
 239  
 240  (function() { module.exports = this["wp"]["shortcode"]; }());
 241  
 242  /***/ }),
 243  
 244  /***/ 18:
 245  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 246  
 247  "use strict";
 248  
 249  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
 250  var arrayLikeToArray = __webpack_require__(25);
 251  
 252  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 253  
 254  function _arrayWithoutHoles(arr) {
 255    if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
 256  }
 257  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 258  var iterableToArray = __webpack_require__(35);
 259  
 260  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 261  var unsupportedIterableToArray = __webpack_require__(27);
 262  
 263  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 264  function _nonIterableSpread() {
 265    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 266  }
 267  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 268  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
 269  
 270  
 271  
 272  
 273  function _toConsumableArray(arr) {
 274    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 275  }
 276  
 277  /***/ }),
 278  
 279  /***/ 2:
 280  /***/ (function(module, exports) {
 281  
 282  (function() { module.exports = this["lodash"]; }());
 283  
 284  /***/ }),
 285  
 286  /***/ 20:
 287  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 288  
 289  "use strict";
 290  
 291  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 292  var arrayWithHoles = __webpack_require__(38);
 293  
 294  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 295  function _iterableToArrayLimit(arr, i) {
 296    if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
 297    var _arr = [];
 298    var _n = true;
 299    var _d = false;
 300    var _e = undefined;
 301  
 302    try {
 303      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 304        _arr.push(_s.value);
 305  
 306        if (i && _arr.length === i) break;
 307      }
 308    } catch (err) {
 309      _d = true;
 310      _e = err;
 311    } finally {
 312      try {
 313        if (!_n && _i["return"] != null) _i["return"]();
 314      } finally {
 315        if (_d) throw _e;
 316      }
 317    }
 318  
 319    return _arr;
 320  }
 321  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 322  var unsupportedIterableToArray = __webpack_require__(27);
 323  
 324  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 325  var nonIterableRest = __webpack_require__(39);
 326  
 327  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 328  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
 329  
 330  
 331  
 332  
 333  function _slicedToArray(arr, i) {
 334    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
 335  }
 336  
 337  /***/ }),
 338  
 339  /***/ 25:
 340  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 341  
 342  "use strict";
 343  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
 344  function _arrayLikeToArray(arr, len) {
 345    if (len == null || len > arr.length) len = arr.length;
 346  
 347    for (var i = 0, arr2 = new Array(len); i < len; i++) {
 348      arr2[i] = arr[i];
 349    }
 350  
 351    return arr2;
 352  }
 353  
 354  /***/ }),
 355  
 356  /***/ 265:
 357  /***/ (function(module, exports) {
 358  
 359  (function() { module.exports = this["wp"]["blockSerializationDefaultParser"]; }());
 360  
 361  /***/ }),
 362  
 363  /***/ 266:
 364  /***/ (function(module, exports, __webpack_require__) {
 365  
 366  var __WEBPACK_AMD_DEFINE_RESULT__;;/*! showdown v 1.9.1 - 02-11-2019 */
 367  (function(){
 368  /**
 369   * Created by Tivie on 13-07-2015.
 370   */
 371  
 372  function getDefaultOpts (simple) {
 373    'use strict';
 374  
 375    var defaultOptions = {
 376      omitExtraWLInCodeBlocks: {
 377        defaultValue: false,
 378        describe: 'Omit the default extra whiteline added to code blocks',
 379        type: 'boolean'
 380      },
 381      noHeaderId: {
 382        defaultValue: false,
 383        describe: 'Turn on/off generated header id',
 384        type: 'boolean'
 385      },
 386      prefixHeaderId: {
 387        defaultValue: false,
 388        describe: 'Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic \'section-\' prefix',
 389        type: 'string'
 390      },
 391      rawPrefixHeaderId: {
 392        defaultValue: false,
 393        describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
 394        type: 'boolean'
 395      },
 396      ghCompatibleHeaderId: {
 397        defaultValue: false,
 398        describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',
 399        type: 'boolean'
 400      },
 401      rawHeaderId: {
 402        defaultValue: false,
 403        describe: 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',
 404        type: 'boolean'
 405      },
 406      headerLevelStart: {
 407        defaultValue: false,
 408        describe: 'The header blocks level start',
 409        type: 'integer'
 410      },
 411      parseImgDimensions: {
 412        defaultValue: false,
 413        describe: 'Turn on/off image dimension parsing',
 414        type: 'boolean'
 415      },
 416      simplifiedAutoLink: {
 417        defaultValue: false,
 418        describe: 'Turn on/off GFM autolink style',
 419        type: 'boolean'
 420      },
 421      excludeTrailingPunctuationFromURLs: {
 422        defaultValue: false,
 423        describe: 'Excludes trailing punctuation from links generated with autoLinking',
 424        type: 'boolean'
 425      },
 426      literalMidWordUnderscores: {
 427        defaultValue: false,
 428        describe: 'Parse midword underscores as literal underscores',
 429        type: 'boolean'
 430      },
 431      literalMidWordAsterisks: {
 432        defaultValue: false,
 433        describe: 'Parse midword asterisks as literal asterisks',
 434        type: 'boolean'
 435      },
 436      strikethrough: {
 437        defaultValue: false,
 438        describe: 'Turn on/off strikethrough support',
 439        type: 'boolean'
 440      },
 441      tables: {
 442        defaultValue: false,
 443        describe: 'Turn on/off tables support',
 444        type: 'boolean'
 445      },
 446      tablesHeaderId: {
 447        defaultValue: false,
 448        describe: 'Add an id to table headers',
 449        type: 'boolean'
 450      },
 451      ghCodeBlocks: {
 452        defaultValue: true,
 453        describe: 'Turn on/off GFM fenced code blocks support',
 454        type: 'boolean'
 455      },
 456      tasklists: {
 457        defaultValue: false,
 458        describe: 'Turn on/off GFM tasklist support',
 459        type: 'boolean'
 460      },
 461      smoothLivePreview: {
 462        defaultValue: false,
 463        describe: 'Prevents weird effects in live previews due to incomplete input',
 464        type: 'boolean'
 465      },
 466      smartIndentationFix: {
 467        defaultValue: false,
 468        description: 'Tries to smartly fix indentation in es6 strings',
 469        type: 'boolean'
 470      },
 471      disableForced4SpacesIndentedSublists: {
 472        defaultValue: false,
 473        description: 'Disables the requirement of indenting nested sublists by 4 spaces',
 474        type: 'boolean'
 475      },
 476      simpleLineBreaks: {
 477        defaultValue: false,
 478        description: 'Parses simple line breaks as <br> (GFM Style)',
 479        type: 'boolean'
 480      },
 481      requireSpaceBeforeHeadingText: {
 482        defaultValue: false,
 483        description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
 484        type: 'boolean'
 485      },
 486      ghMentions: {
 487        defaultValue: false,
 488        description: 'Enables github @mentions',
 489        type: 'boolean'
 490      },
 491      ghMentionsLink: {
 492        defaultValue: 'https://github.com/{u}',
 493        description: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
 494        type: 'string'
 495      },
 496      encodeEmails: {
 497        defaultValue: true,
 498        description: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
 499        type: 'boolean'
 500      },
 501      openLinksInNewWindow: {
 502        defaultValue: false,
 503        description: 'Open all links in new windows',
 504        type: 'boolean'
 505      },
 506      backslashEscapesHTMLTags: {
 507        defaultValue: false,
 508        description: 'Support for HTML Tag escaping. ex: \<div>foo\</div>',
 509        type: 'boolean'
 510      },
 511      emoji: {
 512        defaultValue: false,
 513        description: 'Enable emoji support. Ex: `this is a :smile: emoji`',
 514        type: 'boolean'
 515      },
 516      underline: {
 517        defaultValue: false,
 518        description: 'Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`',
 519        type: 'boolean'
 520      },
 521      completeHTMLDocument: {
 522        defaultValue: false,
 523        description: 'Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags',
 524        type: 'boolean'
 525      },
 526      metadata: {
 527        defaultValue: false,
 528        description: 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).',
 529        type: 'boolean'
 530      },
 531      splitAdjacentBlockquotes: {
 532        defaultValue: false,
 533        description: 'Split adjacent blockquote blocks',
 534        type: 'boolean'
 535      }
 536    };
 537    if (simple === false) {
 538      return JSON.parse(JSON.stringify(defaultOptions));
 539    }
 540    var ret = {};
 541    for (var opt in defaultOptions) {
 542      if (defaultOptions.hasOwnProperty(opt)) {
 543        ret[opt] = defaultOptions[opt].defaultValue;
 544      }
 545    }
 546    return ret;
 547  }
 548  
 549  function allOptionsOn () {
 550    'use strict';
 551    var options = getDefaultOpts(true),
 552        ret = {};
 553    for (var opt in options) {
 554      if (options.hasOwnProperty(opt)) {
 555        ret[opt] = true;
 556      }
 557    }
 558    return ret;
 559  }
 560  
 561  /**
 562   * Created by Tivie on 06-01-2015.
 563   */
 564  
 565  // Private properties
 566  var showdown = {},
 567      parsers = {},
 568      extensions = {},
 569      globalOptions = getDefaultOpts(true),
 570      setFlavor = 'vanilla',
 571      flavor = {
 572        github: {
 573          omitExtraWLInCodeBlocks:              true,
 574          simplifiedAutoLink:                   true,
 575          excludeTrailingPunctuationFromURLs:   true,
 576          literalMidWordUnderscores:            true,
 577          strikethrough:                        true,
 578          tables:                               true,
 579          tablesHeaderId:                       true,
 580          ghCodeBlocks:                         true,
 581          tasklists:                            true,
 582          disableForced4SpacesIndentedSublists: true,
 583          simpleLineBreaks:                     true,
 584          requireSpaceBeforeHeadingText:        true,
 585          ghCompatibleHeaderId:                 true,
 586          ghMentions:                           true,
 587          backslashEscapesHTMLTags:             true,
 588          emoji:                                true,
 589          splitAdjacentBlockquotes:             true
 590        },
 591        original: {
 592          noHeaderId:                           true,
 593          ghCodeBlocks:                         false
 594        },
 595        ghost: {
 596          omitExtraWLInCodeBlocks:              true,
 597          parseImgDimensions:                   true,
 598          simplifiedAutoLink:                   true,
 599          excludeTrailingPunctuationFromURLs:   true,
 600          literalMidWordUnderscores:            true,
 601          strikethrough:                        true,
 602          tables:                               true,
 603          tablesHeaderId:                       true,
 604          ghCodeBlocks:                         true,
 605          tasklists:                            true,
 606          smoothLivePreview:                    true,
 607          simpleLineBreaks:                     true,
 608          requireSpaceBeforeHeadingText:        true,
 609          ghMentions:                           false,
 610          encodeEmails:                         true
 611        },
 612        vanilla: getDefaultOpts(true),
 613        allOn: allOptionsOn()
 614      };
 615  
 616  /**
 617   * helper namespace
 618   * @type {{}}
 619   */
 620  showdown.helper = {};
 621  
 622  /**
 623   * TODO LEGACY SUPPORT CODE
 624   * @type {{}}
 625   */
 626  showdown.extensions = {};
 627  
 628  /**
 629   * Set a global option
 630   * @static
 631   * @param {string} key
 632   * @param {*} value
 633   * @returns {showdown}
 634   */
 635  showdown.setOption = function (key, value) {
 636    'use strict';
 637    globalOptions[key] = value;
 638    return this;
 639  };
 640  
 641  /**
 642   * Get a global option
 643   * @static
 644   * @param {string} key
 645   * @returns {*}
 646   */
 647  showdown.getOption = function (key) {
 648    'use strict';
 649    return globalOptions[key];
 650  };
 651  
 652  /**
 653   * Get the global options
 654   * @static
 655   * @returns {{}}
 656   */
 657  showdown.getOptions = function () {
 658    'use strict';
 659    return globalOptions;
 660  };
 661  
 662  /**
 663   * Reset global options to the default values
 664   * @static
 665   */
 666  showdown.resetOptions = function () {
 667    'use strict';
 668    globalOptions = getDefaultOpts(true);
 669  };
 670  
 671  /**
 672   * Set the flavor showdown should use as default
 673   * @param {string} name
 674   */
 675  showdown.setFlavor = function (name) {
 676    'use strict';
 677    if (!flavor.hasOwnProperty(name)) {
 678      throw Error(name + ' flavor was not found');
 679    }
 680    showdown.resetOptions();
 681    var preset = flavor[name];
 682    setFlavor = name;
 683    for (var option in preset) {
 684      if (preset.hasOwnProperty(option)) {
 685        globalOptions[option] = preset[option];
 686      }
 687    }
 688  };
 689  
 690  /**
 691   * Get the currently set flavor
 692   * @returns {string}
 693   */
 694  showdown.getFlavor = function () {
 695    'use strict';
 696    return setFlavor;
 697  };
 698  
 699  /**
 700   * Get the options of a specified flavor. Returns undefined if the flavor was not found
 701   * @param {string} name Name of the flavor
 702   * @returns {{}|undefined}
 703   */
 704  showdown.getFlavorOptions = function (name) {
 705    'use strict';
 706    if (flavor.hasOwnProperty(name)) {
 707      return flavor[name];
 708    }
 709  };
 710  
 711  /**
 712   * Get the default options
 713   * @static
 714   * @param {boolean} [simple=true]
 715   * @returns {{}}
 716   */
 717  showdown.getDefaultOptions = function (simple) {
 718    'use strict';
 719    return getDefaultOpts(simple);
 720  };
 721  
 722  /**
 723   * Get or set a subParser
 724   *
 725   * subParser(name)       - Get a registered subParser
 726   * subParser(name, func) - Register a subParser
 727   * @static
 728   * @param {string} name
 729   * @param {function} [func]
 730   * @returns {*}
 731   */
 732  showdown.subParser = function (name, func) {
 733    'use strict';
 734    if (showdown.helper.isString(name)) {
 735      if (typeof func !== 'undefined') {
 736        parsers[name] = func;
 737      } else {
 738        if (parsers.hasOwnProperty(name)) {
 739          return parsers[name];
 740        } else {
 741          throw Error('SubParser named ' + name + ' not registered!');
 742        }
 743      }
 744    }
 745  };
 746  
 747  /**
 748   * Gets or registers an extension
 749   * @static
 750   * @param {string} name
 751   * @param {object|function=} ext
 752   * @returns {*}
 753   */
 754  showdown.extension = function (name, ext) {
 755    'use strict';
 756  
 757    if (!showdown.helper.isString(name)) {
 758      throw Error('Extension \'name\' must be a string');
 759    }
 760  
 761    name = showdown.helper.stdExtName(name);
 762  
 763    // Getter
 764    if (showdown.helper.isUndefined(ext)) {
 765      if (!extensions.hasOwnProperty(name)) {
 766        throw Error('Extension named ' + name + ' is not registered!');
 767      }
 768      return extensions[name];
 769  
 770      // Setter
 771    } else {
 772      // Expand extension if it's wrapped in a function
 773      if (typeof ext === 'function') {
 774        ext = ext();
 775      }
 776  
 777      // Ensure extension is an array
 778      if (!showdown.helper.isArray(ext)) {
 779        ext = [ext];
 780      }
 781  
 782      var validExtension = validate(ext, name);
 783  
 784      if (validExtension.valid) {
 785        extensions[name] = ext;
 786      } else {
 787        throw Error(validExtension.error);
 788      }
 789    }
 790  };
 791  
 792  /**
 793   * Gets all extensions registered
 794   * @returns {{}}
 795   */
 796  showdown.getAllExtensions = function () {
 797    'use strict';
 798    return extensions;
 799  };
 800  
 801  /**
 802   * Remove an extension
 803   * @param {string} name
 804   */
 805  showdown.removeExtension = function (name) {
 806    'use strict';
 807    delete extensions[name];
 808  };
 809  
 810  /**
 811   * Removes all extensions
 812   */
 813  showdown.resetExtensions = function () {
 814    'use strict';
 815    extensions = {};
 816  };
 817  
 818  /**
 819   * Validate extension
 820   * @param {array} extension
 821   * @param {string} name
 822   * @returns {{valid: boolean, error: string}}
 823   */
 824  function validate (extension, name) {
 825    'use strict';
 826  
 827    var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
 828        ret = {
 829          valid: true,
 830          error: ''
 831        };
 832  
 833    if (!showdown.helper.isArray(extension)) {
 834      extension = [extension];
 835    }
 836  
 837    for (var i = 0; i < extension.length; ++i) {
 838      var baseMsg = errMsg + ' sub-extension ' + i + ': ',
 839          ext = extension[i];
 840      if (typeof ext !== 'object') {
 841        ret.valid = false;
 842        ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
 843        return ret;
 844      }
 845  
 846      if (!showdown.helper.isString(ext.type)) {
 847        ret.valid = false;
 848        ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
 849        return ret;
 850      }
 851  
 852      var type = ext.type = ext.type.toLowerCase();
 853  
 854      // normalize extension type
 855      if (type === 'language') {
 856        type = ext.type = 'lang';
 857      }
 858  
 859      if (type === 'html') {
 860        type = ext.type = 'output';
 861      }
 862  
 863      if (type !== 'lang' && type !== 'output' && type !== 'listener') {
 864        ret.valid = false;
 865        ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
 866        return ret;
 867      }
 868  
 869      if (type === 'listener') {
 870        if (showdown.helper.isUndefined(ext.listeners)) {
 871          ret.valid = false;
 872          ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
 873          return ret;
 874        }
 875      } else {
 876        if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {
 877          ret.valid = false;
 878          ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method';
 879          return ret;
 880        }
 881      }
 882  
 883      if (ext.listeners) {
 884        if (typeof ext.listeners !== 'object') {
 885          ret.valid = false;
 886          ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + ' given';
 887          return ret;
 888        }
 889        for (var ln in ext.listeners) {
 890          if (ext.listeners.hasOwnProperty(ln)) {
 891            if (typeof ext.listeners[ln] !== 'function') {
 892              ret.valid = false;
 893              ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln +
 894                ' must be a function but ' + typeof ext.listeners[ln] + ' given';
 895              return ret;
 896            }
 897          }
 898        }
 899      }
 900  
 901      if (ext.filter) {
 902        if (typeof ext.filter !== 'function') {
 903          ret.valid = false;
 904          ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + ' given';
 905          return ret;
 906        }
 907      } else if (ext.regex) {
 908        if (showdown.helper.isString(ext.regex)) {
 909          ext.regex = new RegExp(ext.regex, 'g');
 910        }
 911        if (!(ext.regex instanceof RegExp)) {
 912          ret.valid = false;
 913          ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';
 914          return ret;
 915        }
 916        if (showdown.helper.isUndefined(ext.replace)) {
 917          ret.valid = false;
 918          ret.error = baseMsg + '"regex" extensions must implement a replace string or function';
 919          return ret;
 920        }
 921      }
 922    }
 923    return ret;
 924  }
 925  
 926  /**
 927   * Validate extension
 928   * @param {object} ext
 929   * @returns {boolean}
 930   */
 931  showdown.validateExtension = function (ext) {
 932    'use strict';
 933  
 934    var validateExtension = validate(ext, null);
 935    if (!validateExtension.valid) {
 936      console.warn(validateExtension.error);
 937      return false;
 938    }
 939    return true;
 940  };
 941  
 942  /**
 943   * showdownjs helper functions
 944   */
 945  
 946  if (!showdown.hasOwnProperty('helper')) {
 947    showdown.helper = {};
 948  }
 949  
 950  /**
 951   * Check if var is string
 952   * @static
 953   * @param {string} a
 954   * @returns {boolean}
 955   */
 956  showdown.helper.isString = function (a) {
 957    'use strict';
 958    return (typeof a === 'string' || a instanceof String);
 959  };
 960  
 961  /**
 962   * Check if var is a function
 963   * @static
 964   * @param {*} a
 965   * @returns {boolean}
 966   */
 967  showdown.helper.isFunction = function (a) {
 968    'use strict';
 969    var getType = {};
 970    return a && getType.toString.call(a) === '[object Function]';
 971  };
 972  
 973  /**
 974   * isArray helper function
 975   * @static
 976   * @param {*} a
 977   * @returns {boolean}
 978   */
 979  showdown.helper.isArray = function (a) {
 980    'use strict';
 981    return Array.isArray(a);
 982  };
 983  
 984  /**
 985   * Check if value is undefined
 986   * @static
 987   * @param {*} value The value to check.
 988   * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
 989   */
 990  showdown.helper.isUndefined = function (value) {
 991    'use strict';
 992    return typeof value === 'undefined';
 993  };
 994  
 995  /**
 996   * ForEach helper function
 997   * Iterates over Arrays and Objects (own properties only)
 998   * @static
 999   * @param {*} obj
1000   * @param {function} callback Accepts 3 params: 1. value, 2. key, 3. the original array/object
1001   */
1002  showdown.helper.forEach = function (obj, callback) {
1003    'use strict';
1004    // check if obj is defined
1005    if (showdown.helper.isUndefined(obj)) {
1006      throw new Error('obj param is required');
1007    }
1008  
1009    if (showdown.helper.isUndefined(callback)) {
1010      throw new Error('callback param is required');
1011    }
1012  
1013    if (!showdown.helper.isFunction(callback)) {
1014      throw new Error('callback param must be a function/closure');
1015    }
1016  
1017    if (typeof obj.forEach === 'function') {
1018      obj.forEach(callback);
1019    } else if (showdown.helper.isArray(obj)) {
1020      for (var i = 0; i < obj.length; i++) {
1021        callback(obj[i], i, obj);
1022      }
1023    } else if (typeof (obj) === 'object') {
1024      for (var prop in obj) {
1025        if (obj.hasOwnProperty(prop)) {
1026          callback(obj[prop], prop, obj);
1027        }
1028      }
1029    } else {
1030      throw new Error('obj does not seem to be an array or an iterable object');
1031    }
1032  };
1033  
1034  /**
1035   * Standardidize extension name
1036   * @static
1037   * @param {string} s extension name
1038   * @returns {string}
1039   */
1040  showdown.helper.stdExtName = function (s) {
1041    'use strict';
1042    return s.replace(/[_?*+\/\\.^-]/g, '').replace(/\s/g, '').toLowerCase();
1043  };
1044  
1045  function escapeCharactersCallback (wholeMatch, m1) {
1046    'use strict';
1047    var charCodeToEscape = m1.charCodeAt(0);
1048    return '¨E' + charCodeToEscape + 'E';
1049  }
1050  
1051  /**
1052   * Callback used to escape characters when passing through String.replace
1053   * @static
1054   * @param {string} wholeMatch
1055   * @param {string} m1
1056   * @returns {string}
1057   */
1058  showdown.helper.escapeCharactersCallback = escapeCharactersCallback;
1059  
1060  /**
1061   * Escape characters in a string
1062   * @static
1063   * @param {string} text
1064   * @param {string} charsToEscape
1065   * @param {boolean} afterBackslash
1066   * @returns {XML|string|void|*}
1067   */
1068  showdown.helper.escapeCharacters = function (text, charsToEscape, afterBackslash) {
1069    'use strict';
1070    // First we have to escape the escape characters so that
1071    // we can build a character class out of them
1072    var regexString = '([' + charsToEscape.replace(/([\[\]\\])/g, '\\$1') + '])';
1073  
1074    if (afterBackslash) {
1075      regexString = '\\\\' + regexString;
1076    }
1077  
1078    var regex = new RegExp(regexString, 'g');
1079    text = text.replace(regex, escapeCharactersCallback);
1080  
1081    return text;
1082  };
1083  
1084  /**
1085   * Unescape HTML entities
1086   * @param txt
1087   * @returns {string}
1088   */
1089  showdown.helper.unescapeHTMLEntities = function (txt) {
1090    'use strict';
1091  
1092    return txt
1093      .replace(/&quot;/g, '"')
1094      .replace(/&lt;/g, '<')
1095      .replace(/&gt;/g, '>')
1096      .replace(/&amp;/g, '&');
1097  };
1098  
1099  var rgxFindMatchPos = function (str, left, right, flags) {
1100    'use strict';
1101    var f = flags || '',
1102        g = f.indexOf('g') > -1,
1103        x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),
1104        l = new RegExp(left, f.replace(/g/g, '')),
1105        pos = [],
1106        t, s, m, start, end;
1107  
1108    do {
1109      t = 0;
1110      while ((m = x.exec(str))) {
1111        if (l.test(m[0])) {
1112          if (!(t++)) {
1113            s = x.lastIndex;
1114            start = s - m[0].length;
1115          }
1116        } else if (t) {
1117          if (!--t) {
1118            end = m.index + m[0].length;
1119            var obj = {
1120              left: {start: start, end: s},
1121              match: {start: s, end: m.index},
1122              right: {start: m.index, end: end},
1123              wholeMatch: {start: start, end: end}
1124            };
1125            pos.push(obj);
1126            if (!g) {
1127              return pos;
1128            }
1129          }
1130        }
1131      }
1132    } while (t && (x.lastIndex = s));
1133  
1134    return pos;
1135  };
1136  
1137  /**
1138   * matchRecursiveRegExp
1139   *
1140   * (c) 2007 Steven Levithan <stevenlevithan.com>
1141   * MIT License
1142   *
1143   * Accepts a string to search, a left and right format delimiter
1144   * as regex patterns, and optional regex flags. Returns an array
1145   * of matches, allowing nested instances of left/right delimiters.
1146   * Use the "g" flag to return all matches, otherwise only the
1147   * first is returned. Be careful to ensure that the left and
1148   * right format delimiters produce mutually exclusive matches.
1149   * Backreferences are not supported within the right delimiter
1150   * due to how it is internally combined with the left delimiter.
1151   * When matching strings whose format delimiters are unbalanced
1152   * to the left or right, the output is intentionally as a
1153   * conventional regex library with recursion support would
1154   * produce, e.g. "<<x>" and "<x>>" both produce ["x"] when using
1155   * "<" and ">" as the delimiters (both strings contain a single,
1156   * balanced instance of "<x>").
1157   *
1158   * examples:
1159   * matchRecursiveRegExp("test", "\\(", "\\)")
1160   * returns: []
1161   * matchRecursiveRegExp("<t<<e>><s>>t<>", "<", ">", "g")
1162   * returns: ["t<<e>><s>", ""]
1163   * matchRecursiveRegExp("<div id=\"x\">test</div>", "<div\\b[^>]*>", "</div>", "gi")
1164   * returns: ["test"]
1165   */
1166  showdown.helper.matchRecursiveRegExp = function (str, left, right, flags) {
1167    'use strict';
1168  
1169    var matchPos = rgxFindMatchPos (str, left, right, flags),
1170        results = [];
1171  
1172    for (var i = 0; i < matchPos.length; ++i) {
1173      results.push([
1174        str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
1175        str.slice(matchPos[i].match.start, matchPos[i].match.end),
1176        str.slice(matchPos[i].left.start, matchPos[i].left.end),
1177        str.slice(matchPos[i].right.start, matchPos[i].right.end)
1178      ]);
1179    }
1180    return results;
1181  };
1182  
1183  /**
1184   *
1185   * @param {string} str
1186   * @param {string|function} replacement
1187   * @param {string} left
1188   * @param {string} right
1189   * @param {string} flags
1190   * @returns {string}
1191   */
1192  showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {
1193    'use strict';
1194  
1195    if (!showdown.helper.isFunction(replacement)) {
1196      var repStr = replacement;
1197      replacement = function () {
1198        return repStr;
1199      };
1200    }
1201  
1202    var matchPos = rgxFindMatchPos(str, left, right, flags),
1203        finalStr = str,
1204        lng = matchPos.length;
1205  
1206    if (lng > 0) {
1207      var bits = [];
1208      if (matchPos[0].wholeMatch.start !== 0) {
1209        bits.push(str.slice(0, matchPos[0].wholeMatch.start));
1210      }
1211      for (var i = 0; i < lng; ++i) {
1212        bits.push(
1213          replacement(
1214            str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
1215            str.slice(matchPos[i].match.start, matchPos[i].match.end),
1216            str.slice(matchPos[i].left.start, matchPos[i].left.end),
1217            str.slice(matchPos[i].right.start, matchPos[i].right.end)
1218          )
1219        );
1220        if (i < lng - 1) {
1221          bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start));
1222        }
1223      }
1224      if (matchPos[lng - 1].wholeMatch.end < str.length) {
1225        bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));
1226      }
1227      finalStr = bits.join('');
1228    }
1229    return finalStr;
1230  };
1231  
1232  /**
1233   * Returns the index within the passed String object of the first occurrence of the specified regex,
1234   * starting the search at fromIndex. Returns -1 if the value is not found.
1235   *
1236   * @param {string} str string to search
1237   * @param {RegExp} regex Regular expression to search
1238   * @param {int} [fromIndex = 0] Index to start the search
1239   * @returns {Number}
1240   * @throws InvalidArgumentError
1241   */
1242  showdown.helper.regexIndexOf = function (str, regex, fromIndex) {
1243    'use strict';
1244    if (!showdown.helper.isString(str)) {
1245      throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
1246    }
1247    if (regex instanceof RegExp === false) {
1248      throw 'InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp';
1249    }
1250    var indexOf = str.substring(fromIndex || 0).search(regex);
1251    return (indexOf >= 0) ? (indexOf + (fromIndex || 0)) : indexOf;
1252  };
1253  
1254  /**
1255   * Splits the passed string object at the defined index, and returns an array composed of the two substrings
1256   * @param {string} str string to split
1257   * @param {int} index index to split string at
1258   * @returns {[string,string]}
1259   * @throws InvalidArgumentError
1260   */
1261  showdown.helper.splitAtIndex = function (str, index) {
1262    'use strict';
1263    if (!showdown.helper.isString(str)) {
1264      throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
1265    }
1266    return [str.substring(0, index), str.substring(index)];
1267  };
1268  
1269  /**
1270   * Obfuscate an e-mail address through the use of Character Entities,
1271   * transforming ASCII characters into their equivalent decimal or hex entities.
1272   *
1273   * Since it has a random component, subsequent calls to this function produce different results
1274   *
1275   * @param {string} mail
1276   * @returns {string}
1277   */
1278  showdown.helper.encodeEmailAddress = function (mail) {
1279    'use strict';
1280    var encode = [
1281      function (ch) {
1282        return '&#' + ch.charCodeAt(0) + ';';
1283      },
1284      function (ch) {
1285        return '&#x' + ch.charCodeAt(0).toString(16) + ';';
1286      },
1287      function (ch) {
1288        return ch;
1289      }
1290    ];
1291  
1292    mail = mail.replace(/./g, function (ch) {
1293      if (ch === '@') {
1294        // this *must* be encoded. I insist.
1295        ch = encode[Math.floor(Math.random() * 2)](ch);
1296      } else {
1297        var r = Math.random();
1298        // roughly 10% raw, 45% hex, 45% dec
1299        ch = (
1300          r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)
1301        );
1302      }
1303      return ch;
1304    });
1305  
1306    return mail;
1307  };
1308  
1309  /**
1310   *
1311   * @param str
1312   * @param targetLength
1313   * @param padString
1314   * @returns {string}
1315   */
1316  showdown.helper.padEnd = function padEnd (str, targetLength, padString) {
1317    'use strict';
1318    /*jshint bitwise: false*/
1319    // eslint-disable-next-line space-infix-ops
1320    targetLength = targetLength>>0; //floor if number or convert non-number to 0;
1321    /*jshint bitwise: true*/
1322    padString = String(padString || ' ');
1323    if (str.length > targetLength) {
1324      return String(str);
1325    } else {
1326      targetLength = targetLength - str.length;
1327      if (targetLength > padString.length) {
1328        padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
1329      }
1330      return String(str) + padString.slice(0,targetLength);
1331    }
1332  };
1333  
1334  /**
1335   * POLYFILLS
1336   */
1337  // use this instead of builtin is undefined for IE8 compatibility
1338  if (typeof console === 'undefined') {
1339    console = {
1340      warn: function (msg) {
1341        'use strict';
1342        alert(msg);
1343      },
1344      log: function (msg) {
1345        'use strict';
1346        alert(msg);
1347      },
1348      error: function (msg) {
1349        'use strict';
1350        throw msg;
1351      }
1352    };
1353  }
1354  
1355  /**
1356   * Common regexes.
1357   * We declare some common regexes to improve performance
1358   */
1359  showdown.helper.regexes = {
1360    asteriskDashAndColon: /([*_:~])/g
1361  };
1362  
1363  /**
1364   * EMOJIS LIST
1365   */
1366  showdown.helper.emojis = {
1367    '+1':'\ud83d\udc4d',
1368    '-1':'\ud83d\udc4e',
1369    '100':'\ud83d\udcaf',
1370    '1234':'\ud83d\udd22',
1371    '1st_place_medal':'\ud83e\udd47',
1372    '2nd_place_medal':'\ud83e\udd48',
1373    '3rd_place_medal':'\ud83e\udd49',
1374    '8ball':'\ud83c\udfb1',
1375    'a':'\ud83c\udd70\ufe0f',
1376    'ab':'\ud83c\udd8e',
1377    'abc':'\ud83d\udd24',
1378    'abcd':'\ud83d\udd21',
1379    'accept':'\ud83c\ude51',
1380    'aerial_tramway':'\ud83d\udea1',
1381    'airplane':'\u2708\ufe0f',
1382    'alarm_clock':'\u23f0',
1383    'alembic':'\u2697\ufe0f',
1384    'alien':'\ud83d\udc7d',
1385    'ambulance':'\ud83d\ude91',
1386    'amphora':'\ud83c\udffa',
1387    'anchor':'\u2693\ufe0f',
1388    'angel':'\ud83d\udc7c',
1389    'anger':'\ud83d\udca2',
1390    'angry':'\ud83d\ude20',
1391    'anguished':'\ud83d\ude27',
1392    'ant':'\ud83d\udc1c',
1393    'apple':'\ud83c\udf4e',
1394    'aquarius':'\u2652\ufe0f',
1395    'aries':'\u2648\ufe0f',
1396    'arrow_backward':'\u25c0\ufe0f',
1397    'arrow_double_down':'\u23ec',
1398    'arrow_double_up':'\u23eb',
1399    'arrow_down':'\u2b07\ufe0f',
1400    'arrow_down_small':'\ud83d\udd3d',
1401    'arrow_forward':'\u25b6\ufe0f',
1402    'arrow_heading_down':'\u2935\ufe0f',
1403    'arrow_heading_up':'\u2934\ufe0f',
1404    'arrow_left':'\u2b05\ufe0f',
1405    'arrow_lower_left':'\u2199\ufe0f',
1406    'arrow_lower_right':'\u2198\ufe0f',
1407    'arrow_right':'\u27a1\ufe0f',
1408    'arrow_right_hook':'\u21aa\ufe0f',
1409    'arrow_up':'\u2b06\ufe0f',
1410    'arrow_up_down':'\u2195\ufe0f',
1411    'arrow_up_small':'\ud83d\udd3c',
1412    'arrow_upper_left':'\u2196\ufe0f',
1413    'arrow_upper_right':'\u2197\ufe0f',
1414    'arrows_clockwise':'\ud83d\udd03',
1415    'arrows_counterclockwise':'\ud83d\udd04',
1416    'art':'\ud83c\udfa8',
1417    'articulated_lorry':'\ud83d\ude9b',
1418    'artificial_satellite':'\ud83d\udef0',
1419    'astonished':'\ud83d\ude32',
1420    'athletic_shoe':'\ud83d\udc5f',
1421    'atm':'\ud83c\udfe7',
1422    'atom_symbol':'\u269b\ufe0f',
1423    'avocado':'\ud83e\udd51',
1424    'b':'\ud83c\udd71\ufe0f',
1425    'baby':'\ud83d\udc76',
1426    'baby_bottle':'\ud83c\udf7c',
1427    'baby_chick':'\ud83d\udc24',
1428    'baby_symbol':'\ud83d\udebc',
1429    'back':'\ud83d\udd19',
1430    'bacon':'\ud83e\udd53',
1431    'badminton':'\ud83c\udff8',
1432    'baggage_claim':'\ud83d\udec4',
1433    'baguette_bread':'\ud83e\udd56',
1434    'balance_scale':'\u2696\ufe0f',
1435    'balloon':'\ud83c\udf88',
1436    'ballot_box':'\ud83d\uddf3',
1437    'ballot_box_with_check':'\u2611\ufe0f',
1438    'bamboo':'\ud83c\udf8d',
1439    'banana':'\ud83c\udf4c',
1440    'bangbang':'\u203c\ufe0f',
1441    'bank':'\ud83c\udfe6',
1442    'bar_chart':'\ud83d\udcca',
1443    'barber':'\ud83d\udc88',
1444    'baseball':'\u26be\ufe0f',
1445    'basketball':'\ud83c\udfc0',
1446    'basketball_man':'\u26f9\ufe0f',
1447    'basketball_woman':'\u26f9\ufe0f&zwj;\u2640\ufe0f',
1448    'bat':'\ud83e\udd87',
1449    'bath':'\ud83d\udec0',
1450    'bathtub':'\ud83d\udec1',
1451    'battery':'\ud83d\udd0b',
1452    'beach_umbrella':'\ud83c\udfd6',
1453    'bear':'\ud83d\udc3b',
1454    'bed':'\ud83d\udecf',
1455    'bee':'\ud83d\udc1d',
1456    'beer':'\ud83c\udf7a',
1457    'beers':'\ud83c\udf7b',
1458    'beetle':'\ud83d\udc1e',
1459    'beginner':'\ud83d\udd30',
1460    'bell':'\ud83d\udd14',
1461    'bellhop_bell':'\ud83d\udece',
1462    'bento':'\ud83c\udf71',
1463    'biking_man':'\ud83d\udeb4',
1464    'bike':'\ud83d\udeb2',
1465    'biking_woman':'\ud83d\udeb4&zwj;\u2640\ufe0f',
1466    'bikini':'\ud83d\udc59',
1467    'biohazard':'\u2623\ufe0f',
1468    'bird':'\ud83d\udc26',
1469    'birthday':'\ud83c\udf82',
1470    'black_circle':'\u26ab\ufe0f',
1471    'black_flag':'\ud83c\udff4',
1472    'black_heart':'\ud83d\udda4',
1473    'black_joker':'\ud83c\udccf',
1474    'black_large_square':'\u2b1b\ufe0f',
1475    'black_medium_small_square':'\u25fe\ufe0f',
1476    'black_medium_square':'\u25fc\ufe0f',
1477    'black_nib':'\u2712\ufe0f',
1478    'black_small_square':'\u25aa\ufe0f',
1479    'black_square_button':'\ud83d\udd32',
1480    'blonde_man':'\ud83d\udc71',
1481    'blonde_woman':'\ud83d\udc71&zwj;\u2640\ufe0f',
1482    'blossom':'\ud83c\udf3c',
1483    'blowfish':'\ud83d\udc21',
1484    'blue_book':'\ud83d\udcd8',
1485    'blue_car':'\ud83d\ude99',
1486    'blue_heart':'\ud83d\udc99',
1487    'blush':'\ud83d\ude0a',
1488    'boar':'\ud83d\udc17',
1489    'boat':'\u26f5\ufe0f',
1490    'bomb':'\ud83d\udca3',
1491    'book':'\ud83d\udcd6',
1492    'bookmark':'\ud83d\udd16',
1493    'bookmark_tabs':'\ud83d\udcd1',
1494    'books':'\ud83d\udcda',
1495    'boom':'\ud83d\udca5',
1496    'boot':'\ud83d\udc62',
1497    'bouquet':'\ud83d\udc90',
1498    'bowing_man':'\ud83d\ude47',
1499    'bow_and_arrow':'\ud83c\udff9',
1500    'bowing_woman':'\ud83d\ude47&zwj;\u2640\ufe0f',
1501    'bowling':'\ud83c\udfb3',
1502    'boxing_glove':'\ud83e\udd4a',
1503    'boy':'\ud83d\udc66',
1504    'bread':'\ud83c\udf5e',
1505    'bride_with_veil':'\ud83d\udc70',
1506    'bridge_at_night':'\ud83c\udf09',
1507    'briefcase':'\ud83d\udcbc',
1508    'broken_heart':'\ud83d\udc94',
1509    'bug':'\ud83d\udc1b',
1510    'building_construction':'\ud83c\udfd7',
1511    'bulb':'\ud83d\udca1',
1512    'bullettrain_front':'\ud83d\ude85',
1513    'bullettrain_side':'\ud83d\ude84',
1514    'burrito':'\ud83c\udf2f',
1515    'bus':'\ud83d\ude8c',
1516    'business_suit_levitating':'\ud83d\udd74',
1517    'busstop':'\ud83d\ude8f',
1518    'bust_in_silhouette':'\ud83d\udc64',
1519    'busts_in_silhouette':'\ud83d\udc65',
1520    'butterfly':'\ud83e\udd8b',
1521    'cactus':'\ud83c\udf35',
1522    'cake':'\ud83c\udf70',
1523    'calendar':'\ud83d\udcc6',
1524    'call_me_hand':'\ud83e\udd19',
1525    'calling':'\ud83d\udcf2',
1526    'camel':'\ud83d\udc2b',
1527    'camera':'\ud83d\udcf7',
1528    'camera_flash':'\ud83d\udcf8',
1529    'camping':'\ud83c\udfd5',
1530    'cancer':'\u264b\ufe0f',
1531    'candle':'\ud83d\udd6f',
1532    'candy':'\ud83c\udf6c',
1533    'canoe':'\ud83d\udef6',
1534    'capital_abcd':'\ud83d\udd20',
1535    'capricorn':'\u2651\ufe0f',
1536    'car':'\ud83d\ude97',
1537    'card_file_box':'\ud83d\uddc3',
1538    'card_index':'\ud83d\udcc7',
1539    'card_index_dividers':'\ud83d\uddc2',
1540    'carousel_horse':'\ud83c\udfa0',
1541    'carrot':'\ud83e\udd55',
1542    'cat':'\ud83d\udc31',
1543    'cat2':'\ud83d\udc08',
1544    'cd':'\ud83d\udcbf',
1545    'chains':'\u26d3',
1546    'champagne':'\ud83c\udf7e',
1547    'chart':'\ud83d\udcb9',
1548    'chart_with_downwards_trend':'\ud83d\udcc9',
1549    'chart_with_upwards_trend':'\ud83d\udcc8',
1550    'checkered_flag':'\ud83c\udfc1',
1551    'cheese':'\ud83e\uddc0',
1552    'cherries':'\ud83c\udf52',
1553    'cherry_blossom':'\ud83c\udf38',
1554    'chestnut':'\ud83c\udf30',
1555    'chicken':'\ud83d\udc14',
1556    'children_crossing':'\ud83d\udeb8',
1557    'chipmunk':'\ud83d\udc3f',
1558    'chocolate_bar':'\ud83c\udf6b',
1559    'christmas_tree':'\ud83c\udf84',
1560    'church':'\u26ea\ufe0f',
1561    'cinema':'\ud83c\udfa6',
1562    'circus_tent':'\ud83c\udfaa',
1563    'city_sunrise':'\ud83c\udf07',
1564    'city_sunset':'\ud83c\udf06',
1565    'cityscape':'\ud83c\udfd9',
1566    'cl':'\ud83c\udd91',
1567    'clamp':'\ud83d\udddc',
1568    'clap':'\ud83d\udc4f',
1569    'clapper':'\ud83c\udfac',
1570    'classical_building':'\ud83c\udfdb',
1571    'clinking_glasses':'\ud83e\udd42',
1572    'clipboard':'\ud83d\udccb',
1573    'clock1':'\ud83d\udd50',
1574    'clock10':'\ud83d\udd59',
1575    'clock1030':'\ud83d\udd65',
1576    'clock11':'\ud83d\udd5a',
1577    'clock1130':'\ud83d\udd66',
1578    'clock12':'\ud83d\udd5b',
1579    'clock1230':'\ud83d\udd67',
1580    'clock130':'\ud83d\udd5c',
1581    'clock2':'\ud83d\udd51',
1582    'clock230':'\ud83d\udd5d',
1583    'clock3':'\ud83d\udd52',
1584    'clock330':'\ud83d\udd5e',
1585    'clock4':'\ud83d\udd53',
1586    'clock430':'\ud83d\udd5f',
1587    'clock5':'\ud83d\udd54',
1588    'clock530':'\ud83d\udd60',
1589    'clock6':'\ud83d\udd55',
1590    'clock630':'\ud83d\udd61',
1591    'clock7':'\ud83d\udd56',
1592    'clock730':'\ud83d\udd62',
1593    'clock8':'\ud83d\udd57',
1594    'clock830':'\ud83d\udd63',
1595    'clock9':'\ud83d\udd58',
1596    'clock930':'\ud83d\udd64',
1597    'closed_book':'\ud83d\udcd5',
1598    'closed_lock_with_key':'\ud83d\udd10',
1599    'closed_umbrella':'\ud83c\udf02',
1600    'cloud':'\u2601\ufe0f',
1601    'cloud_with_lightning':'\ud83c\udf29',
1602    'cloud_with_lightning_and_rain':'\u26c8',
1603    'cloud_with_rain':'\ud83c\udf27',
1604    'cloud_with_snow':'\ud83c\udf28',
1605    'clown_face':'\ud83e\udd21',
1606    'clubs':'\u2663\ufe0f',
1607    'cocktail':'\ud83c\udf78',
1608    'coffee':'\u2615\ufe0f',
1609    'coffin':'\u26b0\ufe0f',
1610    'cold_sweat':'\ud83d\ude30',
1611    'comet':'\u2604\ufe0f',
1612    'computer':'\ud83d\udcbb',
1613    'computer_mouse':'\ud83d\uddb1',
1614    'confetti_ball':'\ud83c\udf8a',
1615    'confounded':'\ud83d\ude16',
1616    'confused':'\ud83d\ude15',
1617    'congratulations':'\u3297\ufe0f',
1618    'construction':'\ud83d\udea7',
1619    'construction_worker_man':'\ud83d\udc77',
1620    'construction_worker_woman':'\ud83d\udc77&zwj;\u2640\ufe0f',
1621    'control_knobs':'\ud83c\udf9b',
1622    'convenience_store':'\ud83c\udfea',
1623    'cookie':'\ud83c\udf6a',
1624    'cool':'\ud83c\udd92',
1625    'policeman':'\ud83d\udc6e',
1626    'copyright':'\u00a9\ufe0f',
1627    'corn':'\ud83c\udf3d',
1628    'couch_and_lamp':'\ud83d\udecb',
1629    'couple':'\ud83d\udc6b',
1630    'couple_with_heart_woman_man':'\ud83d\udc91',
1631    'couple_with_heart_man_man':'\ud83d\udc68&zwj;\u2764\ufe0f&zwj;\ud83d\udc68',
1632    'couple_with_heart_woman_woman':'\ud83d\udc69&zwj;\u2764\ufe0f&zwj;\ud83d\udc69',
1633    'couplekiss_man_man':'\ud83d\udc68&zwj;\u2764\ufe0f&zwj;\ud83d\udc8b&zwj;\ud83d\udc68',
1634    'couplekiss_man_woman':'\ud83d\udc8f',
1635    'couplekiss_woman_woman':'\ud83d\udc69&zwj;\u2764\ufe0f&zwj;\ud83d\udc8b&zwj;\ud83d\udc69',
1636    'cow':'\ud83d\udc2e',
1637    'cow2':'\ud83d\udc04',
1638    'cowboy_hat_face':'\ud83e\udd20',
1639    'crab':'\ud83e\udd80',
1640    'crayon':'\ud83d\udd8d',
1641    'credit_card':'\ud83d\udcb3',
1642    'crescent_moon':'\ud83c\udf19',
1643    'cricket':'\ud83c\udfcf',
1644    'crocodile':'\ud83d\udc0a',
1645    'croissant':'\ud83e\udd50',
1646    'crossed_fingers':'\ud83e\udd1e',
1647    'crossed_flags':'\ud83c\udf8c',
1648    'crossed_swords':'\u2694\ufe0f',
1649    'crown':'\ud83d\udc51',
1650    'cry':'\ud83d\ude22',
1651    'crying_cat_face':'\ud83d\ude3f',
1652    'crystal_ball':'\ud83d\udd2e',
1653    'cucumber':'\ud83e\udd52',
1654    'cupid':'\ud83d\udc98',
1655    'curly_loop':'\u27b0',
1656    'currency_exchange':'\ud83d\udcb1',
1657    'curry':'\ud83c\udf5b',
1658    'custard':'\ud83c\udf6e',
1659    'customs':'\ud83d\udec3',
1660    'cyclone':'\ud83c\udf00',
1661    'dagger':'\ud83d\udde1',
1662    'dancer':'\ud83d\udc83',
1663    'dancing_women':'\ud83d\udc6f',
1664    'dancing_men':'\ud83d\udc6f&zwj;\u2642\ufe0f',
1665    'dango':'\ud83c\udf61',
1666    'dark_sunglasses':'\ud83d\udd76',
1667    'dart':'\ud83c\udfaf',
1668    'dash':'\ud83d\udca8',
1669    'date':'\ud83d\udcc5',
1670    'deciduous_tree':'\ud83c\udf33',
1671    'deer':'\ud83e\udd8c',
1672    'department_store':'\ud83c\udfec',
1673    'derelict_house':'\ud83c\udfda',
1674    'desert':'\ud83c\udfdc',
1675    'desert_island':'\ud83c\udfdd',
1676    'desktop_computer':'\ud83d\udda5',
1677    'male_detective':'\ud83d\udd75\ufe0f',
1678    'diamond_shape_with_a_dot_inside':'\ud83d\udca0',
1679    'diamonds':'\u2666\ufe0f',
1680    'disappointed':'\ud83d\ude1e',
1681    'disappointed_relieved':'\ud83d\ude25',
1682    'dizzy':'\ud83d\udcab',
1683    'dizzy_face':'\ud83d\ude35',
1684    'do_not_litter':'\ud83d\udeaf',
1685    'dog':'\ud83d\udc36',
1686    'dog2':'\ud83d\udc15',
1687    'dollar':'\ud83d\udcb5',
1688    'dolls':'\ud83c\udf8e',
1689    'dolphin':'\ud83d\udc2c',
1690    'door':'\ud83d\udeaa',
1691    'doughnut':'\ud83c\udf69',
1692    'dove':'\ud83d\udd4a',
1693    'dragon':'\ud83d\udc09',
1694    'dragon_face':'\ud83d\udc32',
1695    'dress':'\ud83d\udc57',
1696    'dromedary_camel':'\ud83d\udc2a',
1697    'drooling_face':'\ud83e\udd24',
1698    'droplet':'\ud83d\udca7',
1699    'drum':'\ud83e\udd41',
1700    'duck':'\ud83e\udd86',
1701    'dvd':'\ud83d\udcc0',
1702    'e-mail':'\ud83d\udce7',
1703    'eagle':'\ud83e\udd85',
1704    'ear':'\ud83d\udc42',
1705    'ear_of_rice':'\ud83c\udf3e',
1706    'earth_africa':'\ud83c\udf0d',
1707    'earth_americas':'\ud83c\udf0e',
1708    'earth_asia':'\ud83c\udf0f',
1709    'egg':'\ud83e\udd5a',
1710    'eggplant':'\ud83c\udf46',
1711    'eight_pointed_black_star':'\u2734\ufe0f',
1712    'eight_spoked_asterisk':'\u2733\ufe0f',
1713    'electric_plug':'\ud83d\udd0c',
1714    'elephant':'\ud83d\udc18',
1715    'email':'\u2709\ufe0f',
1716    'end':'\ud83d\udd1a',
1717    'envelope_with_arrow':'\ud83d\udce9',
1718    'euro':'\ud83d\udcb6',
1719    'european_castle':'\ud83c\udff0',
1720    'european_post_office':'\ud83c\udfe4',
1721    'evergreen_tree':'\ud83c\udf32',
1722    'exclamation':'\u2757\ufe0f',
1723    'expressionless':'\ud83d\ude11',
1724    'eye':'\ud83d\udc41',
1725    'eye_speech_bubble':'\ud83d\udc41&zwj;\ud83d\udde8',
1726    'eyeglasses':'\ud83d\udc53',
1727    'eyes':'\ud83d\udc40',
1728    'face_with_head_bandage':'\ud83e\udd15',
1729    'face_with_thermometer':'\ud83e\udd12',
1730    'fist_oncoming':'\ud83d\udc4a',
1731    'factory':'\ud83c\udfed',
1732    'fallen_leaf':'\ud83c\udf42',
1733    'family_man_woman_boy':'\ud83d\udc6a',
1734    'family_man_boy':'\ud83d\udc68&zwj;\ud83d\udc66',
1735    'family_man_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1736    'family_man_girl':'\ud83d\udc68&zwj;\ud83d\udc67',
1737    'family_man_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1738    'family_man_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1739    'family_man_man_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc66',
1740    'family_man_man_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1741    'family_man_man_girl':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67',
1742    'family_man_man_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1743    'family_man_man_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1744    'family_man_woman_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1745    'family_man_woman_girl':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67',
1746    'family_man_woman_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1747    'family_man_woman_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1748    'family_woman_boy':'\ud83d\udc69&zwj;\ud83d\udc66',
1749    'family_woman_boy_boy':'\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1750    'family_woman_girl':'\ud83d\udc69&zwj;\ud83d\udc67',
1751    'family_woman_girl_boy':'\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1752    'family_woman_girl_girl':'\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1753    'family_woman_woman_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc66',
1754    'family_woman_woman_boy_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1755    'family_woman_woman_girl':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67',
1756    'family_woman_woman_girl_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1757    'family_woman_woman_girl_girl':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1758    'fast_forward':'\u23e9',
1759    'fax':'\ud83d\udce0',
1760    'fearful':'\ud83d\ude28',
1761    'feet':'\ud83d\udc3e',
1762    'female_detective':'\ud83d\udd75\ufe0f&zwj;\u2640\ufe0f',
1763    'ferris_wheel':'\ud83c\udfa1',
1764    'ferry':'\u26f4',
1765    'field_hockey':'\ud83c\udfd1',
1766    'file_cabinet':'\ud83d\uddc4',
1767    'file_folder':'\ud83d\udcc1',
1768    'film_projector':'\ud83d\udcfd',
1769    'film_strip':'\ud83c\udf9e',
1770    'fire':'\ud83d\udd25',
1771    'fire_engine':'\ud83d\ude92',
1772    'fireworks':'\ud83c\udf86',
1773    'first_quarter_moon':'\ud83c\udf13',
1774    'first_quarter_moon_with_face':'\ud83c\udf1b',
1775    'fish':'\ud83d\udc1f',
1776    'fish_cake':'\ud83c\udf65',
1777    'fishing_pole_and_fish':'\ud83c\udfa3',
1778    'fist_raised':'\u270a',
1779    'fist_left':'\ud83e\udd1b',
1780    'fist_right':'\ud83e\udd1c',
1781    'flags':'\ud83c\udf8f',
1782    'flashlight':'\ud83d\udd26',
1783    'fleur_de_lis':'\u269c\ufe0f',
1784    'flight_arrival':'\ud83d\udeec',
1785    'flight_departure':'\ud83d\udeeb',
1786    'floppy_disk':'\ud83d\udcbe',
1787    'flower_playing_cards':'\ud83c\udfb4',
1788    'flushed':'\ud83d\ude33',
1789    'fog':'\ud83c\udf2b',
1790    'foggy':'\ud83c\udf01',
1791    'football':'\ud83c\udfc8',
1792    'footprints':'\ud83d\udc63',
1793    'fork_and_knife':'\ud83c\udf74',
1794    'fountain':'\u26f2\ufe0f',
1795    'fountain_pen':'\ud83d\udd8b',
1796    'four_leaf_clover':'\ud83c\udf40',
1797    'fox_face':'\ud83e\udd8a',
1798    'framed_picture':'\ud83d\uddbc',
1799    'free':'\ud83c\udd93',
1800    'fried_egg':'\ud83c\udf73',
1801    'fried_shrimp':'\ud83c\udf64',
1802    'fries':'\ud83c\udf5f',
1803    'frog':'\ud83d\udc38',
1804    'frowning':'\ud83d\ude26',
1805    'frowning_face':'\u2639\ufe0f',
1806    'frowning_man':'\ud83d\ude4d&zwj;\u2642\ufe0f',
1807    'frowning_woman':'\ud83d\ude4d',
1808    'middle_finger':'\ud83d\udd95',
1809    'fuelpump':'\u26fd\ufe0f',
1810    'full_moon':'\ud83c\udf15',
1811    'full_moon_with_face':'\ud83c\udf1d',
1812    'funeral_urn':'\u26b1\ufe0f',
1813    'game_die':'\ud83c\udfb2',
1814    'gear':'\u2699\ufe0f',
1815    'gem':'\ud83d\udc8e',
1816    'gemini':'\u264a\ufe0f',
1817    'ghost':'\ud83d\udc7b',
1818    'gift':'\ud83c\udf81',
1819    'gift_heart':'\ud83d\udc9d',
1820    'girl':'\ud83d\udc67',
1821    'globe_with_meridians':'\ud83c\udf10',
1822    'goal_net':'\ud83e\udd45',
1823    'goat':'\ud83d\udc10',
1824    'golf':'\u26f3\ufe0f',
1825    'golfing_man':'\ud83c\udfcc\ufe0f',
1826    'golfing_woman':'\ud83c\udfcc\ufe0f&zwj;\u2640\ufe0f',
1827    'gorilla':'\ud83e\udd8d',
1828    'grapes':'\ud83c\udf47',
1829    'green_apple':'\ud83c\udf4f',
1830    'green_book':'\ud83d\udcd7',
1831    'green_heart':'\ud83d\udc9a',
1832    'green_salad':'\ud83e\udd57',
1833    'grey_exclamation':'\u2755',
1834    'grey_question':'\u2754',
1835    'grimacing':'\ud83d\ude2c',
1836    'grin':'\ud83d\ude01',
1837    'grinning':'\ud83d\ude00',
1838    'guardsman':'\ud83d\udc82',
1839    'guardswoman':'\ud83d\udc82&zwj;\u2640\ufe0f',
1840    'guitar':'\ud83c\udfb8',
1841    'gun':'\ud83d\udd2b',
1842    'haircut_woman':'\ud83d\udc87',
1843    'haircut_man':'\ud83d\udc87&zwj;\u2642\ufe0f',
1844    'hamburger':'\ud83c\udf54',
1845    'hammer':'\ud83d\udd28',
1846    'hammer_and_pick':'\u2692',
1847    'hammer_and_wrench':'\ud83d\udee0',
1848    'hamster':'\ud83d\udc39',
1849    'hand':'\u270b',
1850    'handbag':'\ud83d\udc5c',
1851    'handshake':'\ud83e\udd1d',
1852    'hankey':'\ud83d\udca9',
1853    'hatched_chick':'\ud83d\udc25',
1854    'hatching_chick':'\ud83d\udc23',
1855    'headphones':'\ud83c\udfa7',
1856    'hear_no_evil':'\ud83d\ude49',
1857    'heart':'\u2764\ufe0f',
1858    'heart_decoration':'\ud83d\udc9f',
1859    'heart_eyes':'\ud83d\ude0d',
1860    'heart_eyes_cat':'\ud83d\ude3b',
1861    'heartbeat':'\ud83d\udc93',
1862    'heartpulse':'\ud83d\udc97',
1863    'hearts':'\u2665\ufe0f',
1864    'heavy_check_mark':'\u2714\ufe0f',
1865    'heavy_division_sign':'\u2797',
1866    'heavy_dollar_sign':'\ud83d\udcb2',
1867    'heavy_heart_exclamation':'\u2763\ufe0f',
1868    'heavy_minus_sign':'\u2796',
1869    'heavy_multiplication_x':'\u2716\ufe0f',
1870    'heavy_plus_sign':'\u2795',
1871    'helicopter':'\ud83d\ude81',
1872    'herb':'\ud83c\udf3f',
1873    'hibiscus':'\ud83c\udf3a',
1874    'high_brightness':'\ud83d\udd06',
1875    'high_heel':'\ud83d\udc60',
1876    'hocho':'\ud83d\udd2a',
1877    'hole':'\ud83d\udd73',
1878    'honey_pot':'\ud83c\udf6f',
1879    'horse':'\ud83d\udc34',
1880    'horse_racing':'\ud83c\udfc7',
1881    'hospital':'\ud83c\udfe5',
1882    'hot_pepper':'\ud83c\udf36',
1883    'hotdog':'\ud83c\udf2d',
1884    'hotel':'\ud83c\udfe8',
1885    'hotsprings':'\u2668\ufe0f',
1886    'hourglass':'\u231b\ufe0f',
1887    'hourglass_flowing_sand':'\u23f3',
1888    'house':'\ud83c\udfe0',
1889    'house_with_garden':'\ud83c\udfe1',
1890    'houses':'\ud83c\udfd8',
1891    'hugs':'\ud83e\udd17',
1892    'hushed':'\ud83d\ude2f',
1893    'ice_cream':'\ud83c\udf68',
1894    'ice_hockey':'\ud83c\udfd2',
1895    'ice_skate':'\u26f8',
1896    'icecream':'\ud83c\udf66',
1897    'id':'\ud83c\udd94',
1898    'ideograph_advantage':'\ud83c\ude50',
1899    'imp':'\ud83d\udc7f',
1900    'inbox_tray':'\ud83d\udce5',
1901    'incoming_envelope':'\ud83d\udce8',
1902    'tipping_hand_woman':'\ud83d\udc81',
1903    'information_source':'\u2139\ufe0f',
1904    'innocent':'\ud83d\ude07',
1905    'interrobang':'\u2049\ufe0f',
1906    'iphone':'\ud83d\udcf1',
1907    'izakaya_lantern':'\ud83c\udfee',
1908    'jack_o_lantern':'\ud83c\udf83',
1909    'japan':'\ud83d\uddfe',
1910    'japanese_castle':'\ud83c\udfef',
1911    'japanese_goblin':'\ud83d\udc7a',
1912    'japanese_ogre':'\ud83d\udc79',
1913    'jeans':'\ud83d\udc56',
1914    'joy':'\ud83d\ude02',
1915    'joy_cat':'\ud83d\ude39',
1916    'joystick':'\ud83d\udd79',
1917    'kaaba':'\ud83d\udd4b',
1918    'key':'\ud83d\udd11',
1919    'keyboard':'\u2328\ufe0f',
1920    'keycap_ten':'\ud83d\udd1f',
1921    'kick_scooter':'\ud83d\udef4',
1922    'kimono':'\ud83d\udc58',
1923    'kiss':'\ud83d\udc8b',
1924    'kissing':'\ud83d\ude17',
1925    'kissing_cat':'\ud83d\ude3d',
1926    'kissing_closed_eyes':'\ud83d\ude1a',
1927    'kissing_heart':'\ud83d\ude18',
1928    'kissing_smiling_eyes':'\ud83d\ude19',
1929    'kiwi_fruit':'\ud83e\udd5d',
1930    'koala':'\ud83d\udc28',
1931    'koko':'\ud83c\ude01',
1932    'label':'\ud83c\udff7',
1933    'large_blue_circle':'\ud83d\udd35',
1934    'large_blue_diamond':'\ud83d\udd37',
1935    'large_orange_diamond':'\ud83d\udd36',
1936    'last_quarter_moon':'\ud83c\udf17',
1937    'last_quarter_moon_with_face':'\ud83c\udf1c',
1938    'latin_cross':'\u271d\ufe0f',
1939    'laughing':'\ud83d\ude06',
1940    'leaves':'\ud83c\udf43',
1941    'ledger':'\ud83d\udcd2',
1942    'left_luggage':'\ud83d\udec5',
1943    'left_right_arrow':'\u2194\ufe0f',
1944    'leftwards_arrow_with_hook':'\u21a9\ufe0f',
1945    'lemon':'\ud83c\udf4b',
1946    'leo':'\u264c\ufe0f',
1947    'leopard':'\ud83d\udc06',
1948    'level_slider':'\ud83c\udf9a',
1949    'libra':'\u264e\ufe0f',
1950    'light_rail':'\ud83d\ude88',
1951    'link':'\ud83d\udd17',
1952    'lion':'\ud83e\udd81',
1953    'lips':'\ud83d\udc44',
1954    'lipstick':'\ud83d\udc84',
1955    'lizard':'\ud83e\udd8e',
1956    'lock':'\ud83d\udd12',
1957    'lock_with_ink_pen':'\ud83d\udd0f',
1958    'lollipop':'\ud83c\udf6d',
1959    'loop':'\u27bf',
1960    'loud_sound':'\ud83d\udd0a',
1961    'loudspeaker':'\ud83d\udce2',
1962    'love_hotel':'\ud83c\udfe9',
1963    'love_letter':'\ud83d\udc8c',
1964    'low_brightness':'\ud83d\udd05',
1965    'lying_face':'\ud83e\udd25',
1966    'm':'\u24c2\ufe0f',
1967    'mag':'\ud83d\udd0d',
1968    'mag_right':'\ud83d\udd0e',
1969    'mahjong':'\ud83c\udc04\ufe0f',
1970    'mailbox':'\ud83d\udceb',
1971    'mailbox_closed':'\ud83d\udcea',
1972    'mailbox_with_mail':'\ud83d\udcec',
1973    'mailbox_with_no_mail':'\ud83d\udced',
1974    'man':'\ud83d\udc68',
1975    'man_artist':'\ud83d\udc68&zwj;\ud83c\udfa8',
1976    'man_astronaut':'\ud83d\udc68&zwj;\ud83d\ude80',
1977    'man_cartwheeling':'\ud83e\udd38&zwj;\u2642\ufe0f',
1978    'man_cook':'\ud83d\udc68&zwj;\ud83c\udf73',
1979    'man_dancing':'\ud83d\udd7a',
1980    'man_facepalming':'\ud83e\udd26&zwj;\u2642\ufe0f',
1981    'man_factory_worker':'\ud83d\udc68&zwj;\ud83c\udfed',
1982    'man_farmer':'\ud83d\udc68&zwj;\ud83c\udf3e',
1983    'man_firefighter':'\ud83d\udc68&zwj;\ud83d\ude92',
1984    'man_health_worker':'\ud83d\udc68&zwj;\u2695\ufe0f',
1985    'man_in_tuxedo':'\ud83e\udd35',
1986    'man_judge':'\ud83d\udc68&zwj;\u2696\ufe0f',
1987    'man_juggling':'\ud83e\udd39&zwj;\u2642\ufe0f',
1988    'man_mechanic':'\ud83d\udc68&zwj;\ud83d\udd27',
1989    'man_office_worker':'\ud83d\udc68&zwj;\ud83d\udcbc',
1990    'man_pilot':'\ud83d\udc68&zwj;\u2708\ufe0f',
1991    'man_playing_handball':'\ud83e\udd3e&zwj;\u2642\ufe0f',
1992    'man_playing_water_polo':'\ud83e\udd3d&zwj;\u2642\ufe0f',
1993    'man_scientist':'\ud83d\udc68&zwj;\ud83d\udd2c',
1994    'man_shrugging':'\ud83e\udd37&zwj;\u2642\ufe0f',
1995    'man_singer':'\ud83d\udc68&zwj;\ud83c\udfa4',
1996    'man_student':'\ud83d\udc68&zwj;\ud83c\udf93',
1997    'man_teacher':'\ud83d\udc68&zwj;\ud83c\udfeb',
1998    'man_technologist':'\ud83d\udc68&zwj;\ud83d\udcbb',
1999    'man_with_gua_pi_mao':'\ud83d\udc72',
2000    'man_with_turban':'\ud83d\udc73',
2001    'tangerine':'\ud83c\udf4a',
2002    'mans_shoe':'\ud83d\udc5e',
2003    'mantelpiece_clock':'\ud83d\udd70',
2004    'maple_leaf':'\ud83c\udf41',
2005    'martial_arts_uniform':'\ud83e\udd4b',
2006    'mask':'\ud83d\ude37',
2007    'massage_woman':'\ud83d\udc86',
2008    'massage_man':'\ud83d\udc86&zwj;\u2642\ufe0f',
2009    'meat_on_bone':'\ud83c\udf56',
2010    'medal_military':'\ud83c\udf96',
2011    'medal_sports':'\ud83c\udfc5',
2012    'mega':'\ud83d\udce3',
2013    'melon':'\ud83c\udf48',
2014    'memo':'\ud83d\udcdd',
2015    'men_wrestling':'\ud83e\udd3c&zwj;\u2642\ufe0f',
2016    'menorah':'\ud83d\udd4e',
2017    'mens':'\ud83d\udeb9',
2018    'metal':'\ud83e\udd18',
2019    'metro':'\ud83d\ude87',
2020    'microphone':'\ud83c\udfa4',
2021    'microscope':'\ud83d\udd2c',
2022    'milk_glass':'\ud83e\udd5b',
2023    'milky_way':'\ud83c\udf0c',
2024    'minibus':'\ud83d\ude90',
2025    'minidisc':'\ud83d\udcbd',
2026    'mobile_phone_off':'\ud83d\udcf4',
2027    'money_mouth_face':'\ud83e\udd11',
2028    'money_with_wings':'\ud83d\udcb8',
2029    'moneybag':'\ud83d\udcb0',
2030    'monkey':'\ud83d\udc12',
2031    'monkey_face':'\ud83d\udc35',
2032    'monorail':'\ud83d\ude9d',
2033    'moon':'\ud83c\udf14',
2034    'mortar_board':'\ud83c\udf93',
2035    'mosque':'\ud83d\udd4c',
2036    'motor_boat':'\ud83d\udee5',
2037    'motor_scooter':'\ud83d\udef5',
2038    'motorcycle':'\ud83c\udfcd',
2039    'motorway':'\ud83d\udee3',
2040    'mount_fuji':'\ud83d\uddfb',
2041    'mountain':'\u26f0',
2042    'mountain_biking_man':'\ud83d\udeb5',
2043    'mountain_biking_woman':'\ud83d\udeb5&zwj;\u2640\ufe0f',
2044    'mountain_cableway':'\ud83d\udea0',
2045    'mountain_railway':'\ud83d\ude9e',
2046    'mountain_snow':'\ud83c\udfd4',
2047    'mouse':'\ud83d\udc2d',
2048    'mouse2':'\ud83d\udc01',
2049    'movie_camera':'\ud83c\udfa5',
2050    'moyai':'\ud83d\uddff',
2051    'mrs_claus':'\ud83e\udd36',
2052    'muscle':'\ud83d\udcaa',
2053    'mushroom':'\ud83c\udf44',
2054    'musical_keyboard':'\ud83c\udfb9',
2055    'musical_note':'\ud83c\udfb5',
2056    'musical_score':'\ud83c\udfbc',
2057    'mute':'\ud83d\udd07',
2058    'nail_care':'\ud83d\udc85',
2059    'name_badge':'\ud83d\udcdb',
2060    'national_park':'\ud83c\udfde',
2061    'nauseated_face':'\ud83e\udd22',
2062    'necktie':'\ud83d\udc54',
2063    'negative_squared_cross_mark':'\u274e',
2064    'nerd_face':'\ud83e\udd13',
2065    'neutral_face':'\ud83d\ude10',
2066    'new':'\ud83c\udd95',
2067    'new_moon':'\ud83c\udf11',
2068    'new_moon_with_face':'\ud83c\udf1a',
2069    'newspaper':'\ud83d\udcf0',
2070    'newspaper_roll':'\ud83d\uddde',
2071    'next_track_button':'\u23ed',
2072    'ng':'\ud83c\udd96',
2073    'no_good_man':'\ud83d\ude45&zwj;\u2642\ufe0f',
2074    'no_good_woman':'\ud83d\ude45',
2075    'night_with_stars':'\ud83c\udf03',
2076    'no_bell':'\ud83d\udd15',
2077    'no_bicycles':'\ud83d\udeb3',
2078    'no_entry':'\u26d4\ufe0f',
2079    'no_entry_sign':'\ud83d\udeab',
2080    'no_mobile_phones':'\ud83d\udcf5',
2081    'no_mouth':'\ud83d\ude36',
2082    'no_pedestrians':'\ud83d\udeb7',
2083    'no_smoking':'\ud83d\udead',
2084    'non-potable_water':'\ud83d\udeb1',
2085    'nose':'\ud83d\udc43',
2086    'notebook':'\ud83d\udcd3',
2087    'notebook_with_decorative_cover':'\ud83d\udcd4',
2088    'notes':'\ud83c\udfb6',
2089    'nut_and_bolt':'\ud83d\udd29',
2090    'o':'\u2b55\ufe0f',
2091    'o2':'\ud83c\udd7e\ufe0f',
2092    'ocean':'\ud83c\udf0a',
2093    'octopus':'\ud83d\udc19',
2094    'oden':'\ud83c\udf62',
2095    'office':'\ud83c\udfe2',
2096    'oil_drum':'\ud83d\udee2',
2097    'ok':'\ud83c\udd97',
2098    'ok_hand':'\ud83d\udc4c',
2099    'ok_man':'\ud83d\ude46&zwj;\u2642\ufe0f',
2100    'ok_woman':'\ud83d\ude46',
2101    'old_key':'\ud83d\udddd',
2102    'older_man':'\ud83d\udc74',
2103    'older_woman':'\ud83d\udc75',
2104    'om':'\ud83d\udd49',
2105    'on':'\ud83d\udd1b',
2106    'oncoming_automobile':'\ud83d\ude98',
2107    'oncoming_bus':'\ud83d\ude8d',
2108    'oncoming_police_car':'\ud83d\ude94',
2109    'oncoming_taxi':'\ud83d\ude96',
2110    'open_file_folder':'\ud83d\udcc2',
2111    'open_hands':'\ud83d\udc50',
2112    'open_mouth':'\ud83d\ude2e',
2113    'open_umbrella':'\u2602\ufe0f',
2114    'ophiuchus':'\u26ce',
2115    'orange_book':'\ud83d\udcd9',
2116    'orthodox_cross':'\u2626\ufe0f',
2117    'outbox_tray':'\ud83d\udce4',
2118    'owl':'\ud83e\udd89',
2119    'ox':'\ud83d\udc02',
2120    'package':'\ud83d\udce6',
2121    'page_facing_up':'\ud83d\udcc4',
2122    'page_with_curl':'\ud83d\udcc3',
2123    'pager':'\ud83d\udcdf',
2124    'paintbrush':'\ud83d\udd8c',
2125    'palm_tree':'\ud83c\udf34',
2126    'pancakes':'\ud83e\udd5e',
2127    'panda_face':'\ud83d\udc3c',
2128    'paperclip':'\ud83d\udcce',
2129    'paperclips':'\ud83d\udd87',
2130    'parasol_on_ground':'\u26f1',
2131    'parking':'\ud83c\udd7f\ufe0f',
2132    'part_alternation_mark':'\u303d\ufe0f',
2133    'partly_sunny':'\u26c5\ufe0f',
2134    'passenger_ship':'\ud83d\udef3',
2135    'passport_control':'\ud83d\udec2',
2136    'pause_button':'\u23f8',
2137    'peace_symbol':'\u262e\ufe0f',
2138    'peach':'\ud83c\udf51',
2139    'peanuts':'\ud83e\udd5c',
2140    'pear':'\ud83c\udf50',
2141    'pen':'\ud83d\udd8a',
2142    'pencil2':'\u270f\ufe0f',
2143    'penguin':'\ud83d\udc27',
2144    'pensive':'\ud83d\ude14',
2145    'performing_arts':'\ud83c\udfad',
2146    'persevere':'\ud83d\ude23',
2147    'person_fencing':'\ud83e\udd3a',
2148    'pouting_woman':'\ud83d\ude4e',
2149    'phone':'\u260e\ufe0f',
2150    'pick':'\u26cf',
2151    'pig':'\ud83d\udc37',
2152    'pig2':'\ud83d\udc16',
2153    'pig_nose':'\ud83d\udc3d',
2154    'pill':'\ud83d\udc8a',
2155    'pineapple':'\ud83c\udf4d',
2156    'ping_pong':'\ud83c\udfd3',
2157    'pisces':'\u2653\ufe0f',
2158    'pizza':'\ud83c\udf55',
2159    'place_of_worship':'\ud83d\uded0',
2160    'plate_with_cutlery':'\ud83c\udf7d',
2161    'play_or_pause_button':'\u23ef',
2162    'point_down':'\ud83d\udc47',
2163    'point_left':'\ud83d\udc48',
2164    'point_right':'\ud83d\udc49',
2165    'point_up':'\u261d\ufe0f',
2166    'point_up_2':'\ud83d\udc46',
2167    'police_car':'\ud83d\ude93',
2168    'policewoman':'\ud83d\udc6e&zwj;\u2640\ufe0f',
2169    'poodle':'\ud83d\udc29',
2170    'popcorn':'\ud83c\udf7f',
2171    'post_office':'\ud83c\udfe3',
2172    'postal_horn':'\ud83d\udcef',
2173    'postbox':'\ud83d\udcee',
2174    'potable_water':'\ud83d\udeb0',
2175    'potato':'\ud83e\udd54',
2176    'pouch':'\ud83d\udc5d',
2177    'poultry_leg':'\ud83c\udf57',
2178    'pound':'\ud83d\udcb7',
2179    'rage':'\ud83d\ude21',
2180    'pouting_cat':'\ud83d\ude3e',
2181    'pouting_man':'\ud83d\ude4e&zwj;\u2642\ufe0f',
2182    'pray':'\ud83d\ude4f',
2183    'prayer_beads':'\ud83d\udcff',
2184    'pregnant_woman':'\ud83e\udd30',
2185    'previous_track_button':'\u23ee',
2186    'prince':'\ud83e\udd34',
2187    'princess':'\ud83d\udc78',
2188    'printer':'\ud83d\udda8',
2189    'purple_heart':'\ud83d\udc9c',
2190    'purse':'\ud83d\udc5b',
2191    'pushpin':'\ud83d\udccc',
2192    'put_litter_in_its_place':'\ud83d\udeae',
2193    'question':'\u2753',
2194    'rabbit':'\ud83d\udc30',
2195    'rabbit2':'\ud83d\udc07',
2196    'racehorse':'\ud83d\udc0e',
2197    'racing_car':'\ud83c\udfce',
2198    'radio':'\ud83d\udcfb',
2199    'radio_button':'\ud83d\udd18',
2200    'radioactive':'\u2622\ufe0f',
2201    'railway_car':'\ud83d\ude83',
2202    'railway_track':'\ud83d\udee4',
2203    'rainbow':'\ud83c\udf08',
2204    'rainbow_flag':'\ud83c\udff3\ufe0f&zwj;\ud83c\udf08',
2205    'raised_back_of_hand':'\ud83e\udd1a',
2206    'raised_hand_with_fingers_splayed':'\ud83d\udd90',
2207    'raised_hands':'\ud83d\ude4c',
2208    'raising_hand_woman':'\ud83d\ude4b',
2209    'raising_hand_man':'\ud83d\ude4b&zwj;\u2642\ufe0f',
2210    'ram':'\ud83d\udc0f',
2211    'ramen':'\ud83c\udf5c',
2212    'rat':'\ud83d\udc00',
2213    'record_button':'\u23fa',
2214    'recycle':'\u267b\ufe0f',
2215    'red_circle':'\ud83d\udd34',
2216    'registered':'\u00ae\ufe0f',
2217    'relaxed':'\u263a\ufe0f',
2218    'relieved':'\ud83d\ude0c',
2219    'reminder_ribbon':'\ud83c\udf97',
2220    'repeat':'\ud83d\udd01',
2221    'repeat_one':'\ud83d\udd02',
2222    'rescue_worker_helmet':'\u26d1',
2223    'restroom':'\ud83d\udebb',
2224    'revolving_hearts':'\ud83d\udc9e',
2225    'rewind':'\u23ea',
2226    'rhinoceros':'\ud83e\udd8f',
2227    'ribbon':'\ud83c\udf80',
2228    'rice':'\ud83c\udf5a',
2229    'rice_ball':'\ud83c\udf59',
2230    'rice_cracker':'\ud83c\udf58',
2231    'rice_scene':'\ud83c\udf91',
2232    'right_anger_bubble':'\ud83d\uddef',
2233    'ring':'\ud83d\udc8d',
2234    'robot':'\ud83e\udd16',
2235    'rocket':'\ud83d\ude80',
2236    'rofl':'\ud83e\udd23',
2237    'roll_eyes':'\ud83d\ude44',
2238    'roller_coaster':'\ud83c\udfa2',
2239    'rooster':'\ud83d\udc13',
2240    'rose':'\ud83c\udf39',
2241    'rosette':'\ud83c\udff5',
2242    'rotating_light':'\ud83d\udea8',
2243    'round_pushpin':'\ud83d\udccd',
2244    'rowing_man':'\ud83d\udea3',
2245    'rowing_woman':'\ud83d\udea3&zwj;\u2640\ufe0f',
2246    'rugby_football':'\ud83c\udfc9',
2247    'running_man':'\ud83c\udfc3',
2248    'running_shirt_with_sash':'\ud83c\udfbd',
2249    'running_woman':'\ud83c\udfc3&zwj;\u2640\ufe0f',
2250    'sa':'\ud83c\ude02\ufe0f',
2251    'sagittarius':'\u2650\ufe0f',
2252    'sake':'\ud83c\udf76',
2253    'sandal':'\ud83d\udc61',
2254    'santa':'\ud83c\udf85',
2255    'satellite':'\ud83d\udce1',
2256    'saxophone':'\ud83c\udfb7',
2257    'school':'\ud83c\udfeb',
2258    'school_satchel':'\ud83c\udf92',
2259    'scissors':'\u2702\ufe0f',
2260    'scorpion':'\ud83e\udd82',
2261    'scorpius':'\u264f\ufe0f',
2262    'scream':'\ud83d\ude31',
2263    'scream_cat':'\ud83d\ude40',
2264    'scroll':'\ud83d\udcdc',
2265    'seat':'\ud83d\udcba',
2266    'secret':'\u3299\ufe0f',
2267    'see_no_evil':'\ud83d\ude48',
2268    'seedling':'\ud83c\udf31',
2269    'selfie':'\ud83e\udd33',
2270    'shallow_pan_of_food':'\ud83e\udd58',
2271    'shamrock':'\u2618\ufe0f',
2272    'shark':'\ud83e\udd88',
2273    'shaved_ice':'\ud83c\udf67',
2274    'sheep':'\ud83d\udc11',
2275    'shell':'\ud83d\udc1a',
2276    'shield':'\ud83d\udee1',
2277    'shinto_shrine':'\u26e9',
2278    'ship':'\ud83d\udea2',
2279    'shirt':'\ud83d\udc55',
2280    'shopping':'\ud83d\udecd',
2281    'shopping_cart':'\ud83d\uded2',
2282    'shower':'\ud83d\udebf',
2283    'shrimp':'\ud83e\udd90',
2284    'signal_strength':'\ud83d\udcf6',
2285    'six_pointed_star':'\ud83d\udd2f',
2286    'ski':'\ud83c\udfbf',
2287    'skier':'\u26f7',
2288    'skull':'\ud83d\udc80',
2289    'skull_and_crossbones':'\u2620\ufe0f',
2290    'sleeping':'\ud83d\ude34',
2291    'sleeping_bed':'\ud83d\udecc',
2292    'sleepy':'\ud83d\ude2a',
2293    'slightly_frowning_face':'\ud83d\ude41',
2294    'slightly_smiling_face':'\ud83d\ude42',
2295    'slot_machine':'\ud83c\udfb0',
2296    'small_airplane':'\ud83d\udee9',
2297    'small_blue_diamond':'\ud83d\udd39',
2298    'small_orange_diamond':'\ud83d\udd38',
2299    'small_red_triangle':'\ud83d\udd3a',
2300    'small_red_triangle_down':'\ud83d\udd3b',
2301    'smile':'\ud83d\ude04',
2302    'smile_cat':'\ud83d\ude38',
2303    'smiley':'\ud83d\ude03',
2304    'smiley_cat':'\ud83d\ude3a',
2305    'smiling_imp':'\ud83d\ude08',
2306    'smirk':'\ud83d\ude0f',
2307    'smirk_cat':'\ud83d\ude3c',
2308    'smoking':'\ud83d\udeac',
2309    'snail':'\ud83d\udc0c',
2310    'snake':'\ud83d\udc0d',
2311    'sneezing_face':'\ud83e\udd27',
2312    'snowboarder':'\ud83c\udfc2',
2313    'snowflake':'\u2744\ufe0f',
2314    'snowman':'\u26c4\ufe0f',
2315    'snowman_with_snow':'\u2603\ufe0f',
2316    'sob':'\ud83d\ude2d',
2317    'soccer':'\u26bd\ufe0f',
2318    'soon':'\ud83d\udd1c',
2319    'sos':'\ud83c\udd98',
2320    'sound':'\ud83d\udd09',
2321    'space_invader':'\ud83d\udc7e',
2322    'spades':'\u2660\ufe0f',
2323    'spaghetti':'\ud83c\udf5d',
2324    'sparkle':'\u2747\ufe0f',
2325    'sparkler':'\ud83c\udf87',
2326    'sparkles':'\u2728',
2327    'sparkling_heart':'\ud83d\udc96',
2328    'speak_no_evil':'\ud83d\ude4a',
2329    'speaker':'\ud83d\udd08',
2330    'speaking_head':'\ud83d\udde3',
2331    'speech_balloon':'\ud83d\udcac',
2332    'speedboat':'\ud83d\udea4',
2333    'spider':'\ud83d\udd77',
2334    'spider_web':'\ud83d\udd78',
2335    'spiral_calendar':'\ud83d\uddd3',
2336    'spiral_notepad':'\ud83d\uddd2',
2337    'spoon':'\ud83e\udd44',
2338    'squid':'\ud83e\udd91',
2339    'stadium':'\ud83c\udfdf',
2340    'star':'\u2b50\ufe0f',
2341    'star2':'\ud83c\udf1f',
2342    'star_and_crescent':'\u262a\ufe0f',
2343    'star_of_david':'\u2721\ufe0f',
2344    'stars':'\ud83c\udf20',
2345    'station':'\ud83d\ude89',
2346    'statue_of_liberty':'\ud83d\uddfd',
2347    'steam_locomotive':'\ud83d\ude82',
2348    'stew':'\ud83c\udf72',
2349    'stop_button':'\u23f9',
2350    'stop_sign':'\ud83d\uded1',
2351    'stopwatch':'\u23f1',
2352    'straight_ruler':'\ud83d\udccf',
2353    'strawberry':'\ud83c\udf53',
2354    'stuck_out_tongue':'\ud83d\ude1b',
2355    'stuck_out_tongue_closed_eyes':'\ud83d\ude1d',
2356    'stuck_out_tongue_winking_eye':'\ud83d\ude1c',
2357    'studio_microphone':'\ud83c\udf99',
2358    'stuffed_flatbread':'\ud83e\udd59',
2359    'sun_behind_large_cloud':'\ud83c\udf25',
2360    'sun_behind_rain_cloud':'\ud83c\udf26',
2361    'sun_behind_small_cloud':'\ud83c\udf24',
2362    'sun_with_face':'\ud83c\udf1e',
2363    'sunflower':'\ud83c\udf3b',
2364    'sunglasses':'\ud83d\ude0e',
2365    'sunny':'\u2600\ufe0f',
2366    'sunrise':'\ud83c\udf05',
2367    'sunrise_over_mountains':'\ud83c\udf04',
2368    'surfing_man':'\ud83c\udfc4',
2369    'surfing_woman':'\ud83c\udfc4&zwj;\u2640\ufe0f',
2370    'sushi':'\ud83c\udf63',
2371    'suspension_railway':'\ud83d\ude9f',
2372    'sweat':'\ud83d\ude13',
2373    'sweat_drops':'\ud83d\udca6',
2374    'sweat_smile':'\ud83d\ude05',
2375    'sweet_potato':'\ud83c\udf60',
2376    'swimming_man':'\ud83c\udfca',
2377    'swimming_woman':'\ud83c\udfca&zwj;\u2640\ufe0f',
2378    'symbols':'\ud83d\udd23',
2379    'synagogue':'\ud83d\udd4d',
2380    'syringe':'\ud83d\udc89',
2381    'taco':'\ud83c\udf2e',
2382    'tada':'\ud83c\udf89',
2383    'tanabata_tree':'\ud83c\udf8b',
2384    'taurus':'\u2649\ufe0f',
2385    'taxi':'\ud83d\ude95',
2386    'tea':'\ud83c\udf75',
2387    'telephone_receiver':'\ud83d\udcde',
2388    'telescope':'\ud83d\udd2d',
2389    'tennis':'\ud83c\udfbe',
2390    'tent':'\u26fa\ufe0f',
2391    'thermometer':'\ud83c\udf21',
2392    'thinking':'\ud83e\udd14',
2393    'thought_balloon':'\ud83d\udcad',
2394    'ticket':'\ud83c\udfab',
2395    'tickets':'\ud83c\udf9f',
2396    'tiger':'\ud83d\udc2f',
2397    'tiger2':'\ud83d\udc05',
2398    'timer_clock':'\u23f2',
2399    'tipping_hand_man':'\ud83d\udc81&zwj;\u2642\ufe0f',
2400    'tired_face':'\ud83d\ude2b',
2401    'tm':'\u2122\ufe0f',
2402    'toilet':'\ud83d\udebd',
2403    'tokyo_tower':'\ud83d\uddfc',
2404    'tomato':'\ud83c\udf45',
2405    'tongue':'\ud83d\udc45',
2406    'top':'\ud83d\udd1d',
2407    'tophat':'\ud83c\udfa9',
2408    'tornado':'\ud83c\udf2a',
2409    'trackball':'\ud83d\uddb2',
2410    'tractor':'\ud83d\ude9c',
2411    'traffic_light':'\ud83d\udea5',
2412    'train':'\ud83d\ude8b',
2413    'train2':'\ud83d\ude86',
2414    'tram':'\ud83d\ude8a',
2415    'triangular_flag_on_post':'\ud83d\udea9',
2416    'triangular_ruler':'\ud83d\udcd0',
2417    'trident':'\ud83d\udd31',
2418    'triumph':'\ud83d\ude24',
2419    'trolleybus':'\ud83d\ude8e',
2420    'trophy':'\ud83c\udfc6',
2421    'tropical_drink':'\ud83c\udf79',
2422    'tropical_fish':'\ud83d\udc20',
2423    'truck':'\ud83d\ude9a',
2424    'trumpet':'\ud83c\udfba',
2425    'tulip':'\ud83c\udf37',
2426    'tumbler_glass':'\ud83e\udd43',
2427    'turkey':'\ud83e\udd83',
2428    'turtle':'\ud83d\udc22',
2429    'tv':'\ud83d\udcfa',
2430    'twisted_rightwards_arrows':'\ud83d\udd00',
2431    'two_hearts':'\ud83d\udc95',
2432    'two_men_holding_hands':'\ud83d\udc6c',
2433    'two_women_holding_hands':'\ud83d\udc6d',
2434    'u5272':'\ud83c\ude39',
2435    'u5408':'\ud83c\ude34',
2436    'u55b6':'\ud83c\ude3a',
2437    'u6307':'\ud83c\ude2f\ufe0f',
2438    'u6708':'\ud83c\ude37\ufe0f',
2439    'u6709':'\ud83c\ude36',
2440    'u6e80':'\ud83c\ude35',
2441    'u7121':'\ud83c\ude1a\ufe0f',
2442    'u7533':'\ud83c\ude38',
2443    'u7981':'\ud83c\ude32',
2444    'u7a7a':'\ud83c\ude33',
2445    'umbrella':'\u2614\ufe0f',
2446    'unamused':'\ud83d\ude12',
2447    'underage':'\ud83d\udd1e',
2448    'unicorn':'\ud83e\udd84',
2449    'unlock':'\ud83d\udd13',
2450    'up':'\ud83c\udd99',
2451    'upside_down_face':'\ud83d\ude43',
2452    'v':'\u270c\ufe0f',
2453    'vertical_traffic_light':'\ud83d\udea6',
2454    'vhs':'\ud83d\udcfc',
2455    'vibration_mode':'\ud83d\udcf3',
2456    'video_camera':'\ud83d\udcf9',
2457    'video_game':'\ud83c\udfae',
2458    'violin':'\ud83c\udfbb',
2459    'virgo':'\u264d\ufe0f',
2460    'volcano':'\ud83c\udf0b',
2461    'volleyball':'\ud83c\udfd0',
2462    'vs':'\ud83c\udd9a',
2463    'vulcan_salute':'\ud83d\udd96',
2464    'walking_man':'\ud83d\udeb6',
2465    'walking_woman':'\ud83d\udeb6&zwj;\u2640\ufe0f',
2466    'waning_crescent_moon':'\ud83c\udf18',
2467    'waning_gibbous_moon':'\ud83c\udf16',
2468    'warning':'\u26a0\ufe0f',
2469    'wastebasket':'\ud83d\uddd1',
2470    'watch':'\u231a\ufe0f',
2471    'water_buffalo':'\ud83d\udc03',
2472    'watermelon':'\ud83c\udf49',
2473    'wave':'\ud83d\udc4b',
2474    'wavy_dash':'\u3030\ufe0f',
2475    'waxing_crescent_moon':'\ud83c\udf12',
2476    'wc':'\ud83d\udebe',
2477    'weary':'\ud83d\ude29',
2478    'wedding':'\ud83d\udc92',
2479    'weight_lifting_man':'\ud83c\udfcb\ufe0f',
2480    'weight_lifting_woman':'\ud83c\udfcb\ufe0f&zwj;\u2640\ufe0f',
2481    'whale':'\ud83d\udc33',
2482    'whale2':'\ud83d\udc0b',
2483    'wheel_of_dharma':'\u2638\ufe0f',
2484    'wheelchair':'\u267f\ufe0f',
2485    'white_check_mark':'\u2705',
2486    'white_circle':'\u26aa\ufe0f',
2487    'white_flag':'\ud83c\udff3\ufe0f',
2488    'white_flower':'\ud83d\udcae',
2489    'white_large_square':'\u2b1c\ufe0f',
2490    'white_medium_small_square':'\u25fd\ufe0f',
2491    'white_medium_square':'\u25fb\ufe0f',
2492    'white_small_square':'\u25ab\ufe0f',
2493    'white_square_button':'\ud83d\udd33',
2494    'wilted_flower':'\ud83e\udd40',
2495    'wind_chime':'\ud83c\udf90',
2496    'wind_face':'\ud83c\udf2c',
2497    'wine_glass':'\ud83c\udf77',
2498    'wink':'\ud83d\ude09',
2499    'wolf':'\ud83d\udc3a',
2500    'woman':'\ud83d\udc69',
2501    'woman_artist':'\ud83d\udc69&zwj;\ud83c\udfa8',
2502    'woman_astronaut':'\ud83d\udc69&zwj;\ud83d\ude80',
2503    'woman_cartwheeling':'\ud83e\udd38&zwj;\u2640\ufe0f',
2504    'woman_cook':'\ud83d\udc69&zwj;\ud83c\udf73',
2505    'woman_facepalming':'\ud83e\udd26&zwj;\u2640\ufe0f',
2506    'woman_factory_worker':'\ud83d\udc69&zwj;\ud83c\udfed',
2507    'woman_farmer':'\ud83d\udc69&zwj;\ud83c\udf3e',
2508    'woman_firefighter':'\ud83d\udc69&zwj;\ud83d\ude92',
2509    'woman_health_worker':'\ud83d\udc69&zwj;\u2695\ufe0f',
2510    'woman_judge':'\ud83d\udc69&zwj;\u2696\ufe0f',
2511    'woman_juggling':'\ud83e\udd39&zwj;\u2640\ufe0f',
2512    'woman_mechanic':'\ud83d\udc69&zwj;\ud83d\udd27',
2513    'woman_office_worker':'\ud83d\udc69&zwj;\ud83d\udcbc',
2514    'woman_pilot':'\ud83d\udc69&zwj;\u2708\ufe0f',
2515    'woman_playing_handball':'\ud83e\udd3e&zwj;\u2640\ufe0f',
2516    'woman_playing_water_polo':'\ud83e\udd3d&zwj;\u2640\ufe0f',
2517    'woman_scientist':'\ud83d\udc69&zwj;\ud83d\udd2c',
2518    'woman_shrugging':'\ud83e\udd37&zwj;\u2640\ufe0f',
2519    'woman_singer':'\ud83d\udc69&zwj;\ud83c\udfa4',
2520    'woman_student':'\ud83d\udc69&zwj;\ud83c\udf93',
2521    'woman_teacher':'\ud83d\udc69&zwj;\ud83c\udfeb',
2522    'woman_technologist':'\ud83d\udc69&zwj;\ud83d\udcbb',
2523    'woman_with_turban':'\ud83d\udc73&zwj;\u2640\ufe0f',
2524    'womans_clothes':'\ud83d\udc5a',
2525    'womans_hat':'\ud83d\udc52',
2526    'women_wrestling':'\ud83e\udd3c&zwj;\u2640\ufe0f',
2527    'womens':'\ud83d\udeba',
2528    'world_map':'\ud83d\uddfa',
2529    'worried':'\ud83d\ude1f',
2530    'wrench':'\ud83d\udd27',
2531    'writing_hand':'\u270d\ufe0f',
2532    'x':'\u274c',
2533    'yellow_heart':'\ud83d\udc9b',
2534    'yen':'\ud83d\udcb4',
2535    'yin_yang':'\u262f\ufe0f',
2536    'yum':'\ud83d\ude0b',
2537    'zap':'\u26a1\ufe0f',
2538    'zipper_mouth_face':'\ud83e\udd10',
2539    'zzz':'\ud83d\udca4',
2540  
2541    /* special emojis :P */
2542    'octocat':  '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
2543    'showdown': '<span style="font-family: \'Anonymous Pro\', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>'
2544  };
2545  
2546  /**
2547   * Created by Estevao on 31-05-2015.
2548   */
2549  
2550  /**
2551   * Showdown Converter class
2552   * @class
2553   * @param {object} [converterOptions]
2554   * @returns {Converter}
2555   */
2556  showdown.Converter = function (converterOptions) {
2557    'use strict';
2558  
2559    var
2560        /**
2561         * Options used by this converter
2562         * @private
2563         * @type {{}}
2564         */
2565        options = {},
2566  
2567        /**
2568         * Language extensions used by this converter
2569         * @private
2570         * @type {Array}
2571         */
2572        langExtensions = [],
2573  
2574        /**
2575         * Output modifiers extensions used by this converter
2576         * @private
2577         * @type {Array}
2578         */
2579        outputModifiers = [],
2580  
2581        /**
2582         * Event listeners
2583         * @private
2584         * @type {{}}
2585         */
2586        listeners = {},
2587  
2588        /**
2589         * The flavor set in this converter
2590         */
2591        setConvFlavor = setFlavor,
2592  
2593        /**
2594         * Metadata of the document
2595         * @type {{parsed: {}, raw: string, format: string}}
2596         */
2597        metadata = {
2598          parsed: {},
2599          raw: '',
2600          format: ''
2601        };
2602  
2603    _constructor();
2604  
2605    /**
2606     * Converter constructor
2607     * @private
2608     */
2609    function _constructor () {
2610      converterOptions = converterOptions || {};
2611  
2612      for (var gOpt in globalOptions) {
2613        if (globalOptions.hasOwnProperty(gOpt)) {
2614          options[gOpt] = globalOptions[gOpt];
2615        }
2616      }
2617  
2618      // Merge options
2619      if (typeof converterOptions === 'object') {
2620        for (var opt in converterOptions) {
2621          if (converterOptions.hasOwnProperty(opt)) {
2622            options[opt] = converterOptions[opt];
2623          }
2624        }
2625      } else {
2626        throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +
2627        ' was passed instead.');
2628      }
2629  
2630      if (options.extensions) {
2631        showdown.helper.forEach(options.extensions, _parseExtension);
2632      }
2633    }
2634  
2635    /**
2636     * Parse extension
2637     * @param {*} ext
2638     * @param {string} [name='']
2639     * @private
2640     */
2641    function _parseExtension (ext, name) {
2642  
2643      name = name || null;
2644      // If it's a string, the extension was previously loaded
2645      if (showdown.helper.isString(ext)) {
2646        ext = showdown.helper.stdExtName(ext);
2647        name = ext;
2648  
2649        // LEGACY_SUPPORT CODE
2650        if (showdown.extensions[ext]) {
2651          console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +
2652            'Please inform the developer that the extension should be updated!');
2653          legacyExtensionLoading(showdown.extensions[ext], ext);
2654          return;
2655          // END LEGACY SUPPORT CODE
2656  
2657        } else if (!showdown.helper.isUndefined(extensions[ext])) {
2658          ext = extensions[ext];
2659  
2660        } else {
2661          throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.');
2662        }
2663      }
2664  
2665      if (typeof ext === 'function') {
2666        ext = ext();
2667      }
2668  
2669      if (!showdown.helper.isArray(ext)) {
2670        ext = [ext];
2671      }
2672  
2673      var validExt = validate(ext, name);
2674      if (!validExt.valid) {
2675        throw Error(validExt.error);
2676      }
2677  
2678      for (var i = 0; i < ext.length; ++i) {
2679        switch (ext[i].type) {
2680  
2681          case 'lang':
2682            langExtensions.push(ext[i]);
2683            break;
2684  
2685          case 'output':
2686            outputModifiers.push(ext[i]);
2687            break;
2688        }
2689        if (ext[i].hasOwnProperty('listeners')) {
2690          for (var ln in ext[i].listeners) {
2691            if (ext[i].listeners.hasOwnProperty(ln)) {
2692              listen(ln, ext[i].listeners[ln]);
2693            }
2694          }
2695        }
2696      }
2697  
2698    }
2699  
2700    /**
2701     * LEGACY_SUPPORT
2702     * @param {*} ext
2703     * @param {string} name
2704     */
2705    function legacyExtensionLoading (ext, name) {
2706      if (typeof ext === 'function') {
2707        ext = ext(new showdown.Converter());
2708      }
2709      if (!showdown.helper.isArray(ext)) {
2710        ext = [ext];
2711      }
2712      var valid = validate(ext, name);
2713  
2714      if (!valid.valid) {
2715        throw Error(valid.error);
2716      }
2717  
2718      for (var i = 0; i < ext.length; ++i) {
2719        switch (ext[i].type) {
2720          case 'lang':
2721            langExtensions.push(ext[i]);
2722            break;
2723          case 'output':
2724            outputModifiers.push(ext[i]);
2725            break;
2726          default:// should never reach here
2727            throw Error('Extension loader error: Type unrecognized!!!');
2728        }
2729      }
2730    }
2731  
2732    /**
2733     * Listen to an event
2734     * @param {string} name
2735     * @param {function} callback
2736     */
2737    function listen (name, callback) {
2738      if (!showdown.helper.isString(name)) {
2739        throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');
2740      }
2741  
2742      if (typeof callback !== 'function') {
2743        throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');
2744      }
2745  
2746      if (!listeners.hasOwnProperty(name)) {
2747        listeners[name] = [];
2748      }
2749      listeners[name].push(callback);
2750    }
2751  
2752    function rTrimInputText (text) {
2753      var rsp = text.match(/^\s*/)[0].length,
2754          rgx = new RegExp('^\\s{0,' + rsp + '}', 'gm');
2755      return text.replace(rgx, '');
2756    }
2757  
2758    /**
2759     * Dispatch an event
2760     * @private
2761     * @param {string} evtName Event name
2762     * @param {string} text Text
2763     * @param {{}} options Converter Options
2764     * @param {{}} globals
2765     * @returns {string}
2766     */
2767    this._dispatch = function dispatch (evtName, text, options, globals) {
2768      if (listeners.hasOwnProperty(evtName)) {
2769        for (var ei = 0; ei < listeners[evtName].length; ++ei) {
2770          var nText = listeners[evtName][ei](evtName, text, this, options, globals);
2771          if (nText && typeof nText !== 'undefined') {
2772            text = nText;
2773          }
2774        }
2775      }
2776      return text;
2777    };
2778  
2779    /**
2780     * Listen to an event
2781     * @param {string} name
2782     * @param {function} callback
2783     * @returns {showdown.Converter}
2784     */
2785    this.listen = function (name, callback) {
2786      listen(name, callback);
2787      return this;
2788    };
2789  
2790    /**
2791     * Converts a markdown string into HTML
2792     * @param {string} text
2793     * @returns {*}
2794     */
2795    this.makeHtml = function (text) {
2796      //check if text is not falsy
2797      if (!text) {
2798        return text;
2799      }
2800  
2801      var globals = {
2802        gHtmlBlocks:     [],
2803        gHtmlMdBlocks:   [],
2804        gHtmlSpans:      [],
2805        gUrls:           {},
2806        gTitles:         {},
2807        gDimensions:     {},
2808        gListLevel:      0,
2809        hashLinkCounts:  {},
2810        langExtensions:  langExtensions,
2811        outputModifiers: outputModifiers,
2812        converter:       this,
2813        ghCodeBlocks:    [],
2814        metadata: {
2815          parsed: {},
2816          raw: '',
2817          format: ''
2818        }
2819      };
2820  
2821      // This lets us use ¨ trema as an escape char to avoid md5 hashes
2822      // The choice of character is arbitrary; anything that isn't
2823      // magic in Markdown will work.
2824      text = text.replace(/¨/g, '¨T');
2825  
2826      // Replace $ with ¨D
2827      // RegExp interprets $ as a special character
2828      // when it's in a replacement string
2829      text = text.replace(/\$/g, '¨D');
2830  
2831      // Standardize line endings
2832      text = text.replace(/\r\n/g, '\n'); // DOS to Unix
2833      text = text.replace(/\r/g, '\n'); // Mac to Unix
2834  
2835      // Stardardize line spaces
2836      text = text.replace(/\u00A0/g, '&nbsp;');
2837  
2838      if (options.smartIndentationFix) {
2839        text = rTrimInputText(text);
2840      }
2841  
2842      // Make sure text begins and ends with a couple of newlines:
2843      text = '\n\n' + text + '\n\n';
2844  
2845      // detab
2846      text = showdown.subParser('detab')(text, options, globals);
2847  
2848      /**
2849       * Strip any lines consisting only of spaces and tabs.
2850       * This makes subsequent regexs easier to write, because we can
2851       * match consecutive blank lines with /\n+/ instead of something
2852       * contorted like /[ \t]*\n+/
2853       */
2854      text = text.replace(/^[ \t]+$/mg, '');
2855  
2856      //run languageExtensions
2857      showdown.helper.forEach(langExtensions, function (ext) {
2858        text = showdown.subParser('runExtension')(ext, text, options, globals);
2859      });
2860  
2861      // run the sub parsers
2862      text = showdown.subParser('metadata')(text, options, globals);
2863      text = showdown.subParser('hashPreCodeTags')(text, options, globals);
2864      text = showdown.subParser('githubCodeBlocks')(text, options, globals);
2865      text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
2866      text = showdown.subParser('hashCodeTags')(text, options, globals);
2867      text = showdown.subParser('stripLinkDefinitions')(text, options, globals);
2868      text = showdown.subParser('blockGamut')(text, options, globals);
2869      text = showdown.subParser('unhashHTMLSpans')(text, options, globals);
2870      text = showdown.subParser('unescapeSpecialChars')(text, options, globals);
2871  
2872      // attacklab: Restore dollar signs
2873      text = text.replace(/¨D/g, '$$');
2874  
2875      // attacklab: Restore tremas
2876      text = text.replace(/¨T/g, '¨');
2877  
2878      // render a complete html document instead of a partial if the option is enabled
2879      text = showdown.subParser('completeHTMLDocument')(text, options, globals);
2880  
2881      // Run output modifiers
2882      showdown.helper.forEach(outputModifiers, function (ext) {
2883        text = showdown.subParser('runExtension')(ext, text, options, globals);
2884      });
2885  
2886      // update metadata
2887      metadata = globals.metadata;
2888      return text;
2889    };
2890  
2891    /**
2892     * Converts an HTML string into a markdown string
2893     * @param src
2894     * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used.
2895     * @returns {string}
2896     */
2897    this.makeMarkdown = this.makeMd = function (src, HTMLParser) {
2898  
2899      // replace \r\n with \n
2900      src = src.replace(/\r\n/g, '\n');
2901      src = src.replace(/\r/g, '\n'); // old macs
2902  
2903      // due to an edge case, we need to find this: > <
2904      // to prevent removing of non silent white spaces
2905      // ex: <em>this is</em> <strong>sparta</strong>
2906      src = src.replace(/>[ \t]+</, '>¨NBSP;<');
2907  
2908      if (!HTMLParser) {
2909        if (window && window.document) {
2910          HTMLParser = window.document;
2911        } else {
2912          throw new Error('HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM');
2913        }
2914      }
2915  
2916      var doc = HTMLParser.createElement('div');
2917      doc.innerHTML = src;
2918  
2919      var globals = {
2920        preList: substitutePreCodeTags(doc)
2921      };
2922  
2923      // remove all newlines and collapse spaces
2924      clean(doc);
2925  
2926      // some stuff, like accidental reference links must now be escaped
2927      // TODO
2928      // doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/);
2929  
2930      var nodes = doc.childNodes,
2931          mdDoc = '';
2932  
2933      for (var i = 0; i < nodes.length; i++) {
2934        mdDoc += showdown.subParser('makeMarkdown.node')(nodes[i], globals);
2935      }
2936  
2937      function clean (node) {
2938        for (var n = 0; n < node.childNodes.length; ++n) {
2939          var child = node.childNodes[n];
2940          if (child.nodeType === 3) {
2941            if (!/\S/.test(child.nodeValue)) {
2942              node.removeChild(child);
2943              --n;
2944            } else {
2945              child.nodeValue = child.nodeValue.split('\n').join(' ');
2946              child.nodeValue = child.nodeValue.replace(/(\s)+/g, '$1');
2947            }
2948          } else if (child.nodeType === 1) {
2949            clean(child);
2950          }
2951        }
2952      }
2953  
2954      // find all pre tags and replace contents with placeholder
2955      // we need this so that we can remove all indentation from html
2956      // to ease up parsing
2957      function substitutePreCodeTags (doc) {
2958  
2959        var pres = doc.querySelectorAll('pre'),
2960            presPH = [];
2961  
2962        for (var i = 0; i < pres.length; ++i) {
2963  
2964          if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {
2965            var content = pres[i].firstChild.innerHTML.trim(),
2966                language = pres[i].firstChild.getAttribute('data-language') || '';
2967  
2968            // if data-language attribute is not defined, then we look for class language-*
2969            if (language === '') {
2970              var classes = pres[i].firstChild.className.split(' ');
2971              for (var c = 0; c < classes.length; ++c) {
2972                var matches = classes[c].match(/^language-(.+)$/);
2973                if (matches !== null) {
2974                  language = matches[1];
2975                  break;
2976                }
2977              }
2978            }
2979  
2980            // unescape html entities in content
2981            content = showdown.helper.unescapeHTMLEntities(content);
2982  
2983            presPH.push(content);
2984            pres[i].outerHTML = '<precode language="' + language + '" precodenum="' + i.toString() + '"></precode>';
2985          } else {
2986            presPH.push(pres[i].innerHTML);
2987            pres[i].innerHTML = '';
2988            pres[i].setAttribute('prenum', i.toString());
2989          }
2990        }
2991        return presPH;
2992      }
2993  
2994      return mdDoc;
2995    };
2996  
2997    /**
2998     * Set an option of this Converter instance
2999     * @param {string} key
3000     * @param {*} value
3001     */
3002    this.setOption = function (key, value) {
3003      options[key] = value;
3004    };
3005  
3006    /**
3007     * Get the option of this Converter instance
3008     * @param {string} key
3009     * @returns {*}
3010     */
3011    this.getOption = function (key) {
3012      return options[key];
3013    };
3014  
3015    /**
3016     * Get the options of this Converter instance
3017     * @returns {{}}
3018     */
3019    this.getOptions = function () {
3020      return options;
3021    };
3022  
3023    /**
3024     * Add extension to THIS converter
3025     * @param {{}} extension
3026     * @param {string} [name=null]
3027     */
3028    this.addExtension = function (extension, name) {
3029      name = name || null;
3030      _parseExtension(extension, name);
3031    };
3032  
3033    /**
3034     * Use a global registered extension with THIS converter
3035     * @param {string} extensionName Name of the previously registered extension
3036     */
3037    this.useExtension = function (extensionName) {
3038      _parseExtension(extensionName);
3039    };
3040  
3041    /**
3042     * Set the flavor THIS converter should use
3043     * @param {string} name
3044     */
3045    this.setFlavor = function (name) {
3046      if (!flavor.hasOwnProperty(name)) {
3047        throw Error(name + ' flavor was not found');
3048      }
3049      var preset = flavor[name];
3050      setConvFlavor = name;
3051      for (var option in preset) {
3052        if (preset.hasOwnProperty(option)) {
3053          options[option] = preset[option];
3054        }
3055      }
3056    };
3057  
3058    /**
3059     * Get the currently set flavor of this converter
3060     * @returns {string}
3061     */
3062    this.getFlavor = function () {
3063      return setConvFlavor;
3064    };
3065  
3066    /**
3067     * Remove an extension from THIS converter.
3068     * Note: This is a costly operation. It's better to initialize a new converter
3069     * and specify the extensions you wish to use
3070     * @param {Array} extension
3071     */
3072    this.removeExtension = function (extension) {
3073      if (!showdown.helper.isArray(extension)) {
3074        extension = [extension];
3075      }
3076      for (var a = 0; a < extension.length; ++a) {
3077        var ext = extension[a];
3078        for (var i = 0; i < langExtensions.length; ++i) {
3079          if (langExtensions[i] === ext) {
3080            langExtensions[i].splice(i, 1);
3081          }
3082        }
3083        for (var ii = 0; ii < outputModifiers.length; ++i) {
3084          if (outputModifiers[ii] === ext) {
3085            outputModifiers[ii].splice(i, 1);
3086          }
3087        }
3088      }
3089    };
3090  
3091    /**
3092     * Get all extension of THIS converter
3093     * @returns {{language: Array, output: Array}}
3094     */
3095    this.getAllExtensions = function () {
3096      return {
3097        language: langExtensions,
3098        output: outputModifiers
3099      };
3100    };
3101  
3102    /**
3103     * Get the metadata of the previously parsed document
3104     * @param raw
3105     * @returns {string|{}}
3106     */
3107    this.getMetadata = function (raw) {
3108      if (raw) {
3109        return metadata.raw;
3110      } else {
3111        return metadata.parsed;
3112      }
3113    };
3114  
3115    /**
3116     * Get the metadata format of the previously parsed document
3117     * @returns {string}
3118     */
3119    this.getMetadataFormat = function () {
3120      return metadata.format;
3121    };
3122  
3123    /**
3124     * Private: set a single key, value metadata pair
3125     * @param {string} key
3126     * @param {string} value
3127     */
3128    this._setMetadataPair = function (key, value) {
3129      metadata.parsed[key] = value;
3130    };
3131  
3132    /**
3133     * Private: set metadata format
3134     * @param {string} format
3135     */
3136    this._setMetadataFormat = function (format) {
3137      metadata.format = format;
3138    };
3139  
3140    /**
3141     * Private: set metadata raw text
3142     * @param {string} raw
3143     */
3144    this._setMetadataRaw = function (raw) {
3145      metadata.raw = raw;
3146    };
3147  };
3148  
3149  /**
3150   * Turn Markdown link shortcuts into XHTML <a> tags.
3151   */
3152  showdown.subParser('anchors', function (text, options, globals) {
3153    'use strict';
3154  
3155    text = globals.converter._dispatch('anchors.before', text, options, globals);
3156  
3157    var writeAnchorTag = function (wholeMatch, linkText, linkId, url, m5, m6, title) {
3158      if (showdown.helper.isUndefined(title)) {
3159        title = '';
3160      }
3161      linkId = linkId.toLowerCase();
3162  
3163      // Special case for explicit empty url
3164      if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
3165        url = '';
3166      } else if (!url) {
3167        if (!linkId) {
3168          // lower-case and turn embedded newlines into spaces
3169          linkId = linkText.toLowerCase().replace(/ ?\n/g, ' ');
3170        }
3171        url = '#' + linkId;
3172  
3173        if (!showdown.helper.isUndefined(globals.gUrls[linkId])) {
3174          url = globals.gUrls[linkId];
3175          if (!showdown.helper.isUndefined(globals.gTitles[linkId])) {
3176            title = globals.gTitles[linkId];
3177          }
3178        } else {
3179          return wholeMatch;
3180        }
3181      }
3182  
3183      //url = showdown.helper.escapeCharacters(url, '*_', false); // replaced line to improve performance
3184      url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
3185  
3186      var result = '<a href="' + url + '"';
3187  
3188      if (title !== '' && title !== null) {
3189        title = title.replace(/"/g, '&quot;');
3190        //title = showdown.helper.escapeCharacters(title, '*_', false); // replaced line to improve performance
3191        title = title.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
3192        result += ' title="' + title + '"';
3193      }
3194  
3195      // optionLinksInNewWindow only applies
3196      // to external links. Hash links (#) open in same page
3197      if (options.openLinksInNewWindow && !/^#/.test(url)) {
3198        // escaped _
3199        result += ' rel="noopener noreferrer" target="¨E95Eblank"';
3200      }
3201  
3202      result += '>' + linkText + '</a>';
3203  
3204      return result;
3205    };
3206  
3207    // First, handle reference-style links: [link text] [id]
3208    text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag);
3209  
3210    // Next, inline-style links: [link text](url "optional title")
3211    // cases with crazy urls like ./image/cat1).png
3212    text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3213      writeAnchorTag);
3214  
3215    // normal cases
3216    text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3217      writeAnchorTag);
3218  
3219    // handle reference-style shortcuts: [link text]
3220    // These must come last in case you've also got [link test][1]
3221    // or [link test](/foo)
3222    text = text.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag);
3223  
3224    // Lastly handle GithubMentions if option is enabled
3225    if (options.ghMentions) {
3226      text = text.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function (wm, st, escape, mentions, username) {
3227        if (escape === '\\') {
3228          return st + mentions;
3229        }
3230  
3231        //check if options.ghMentionsLink is a string
3232        if (!showdown.helper.isString(options.ghMentionsLink)) {
3233          throw new Error('ghMentionsLink option must be a string');
3234        }
3235        var lnk = options.ghMentionsLink.replace(/\{u}/g, username),
3236            target = '';
3237        if (options.openLinksInNewWindow) {
3238          target = ' rel="noopener noreferrer" target="¨E95Eblank"';
3239        }
3240        return st + '<a href="' + lnk + '"' + target + '>' + mentions + '</a>';
3241      });
3242    }
3243  
3244    text = globals.converter._dispatch('anchors.after', text, options, globals);
3245    return text;
3246  });
3247  
3248  // url allowed chars [a-z\d_.~:/?#[]@!$&'()*+,;=-]
3249  
3250  var simpleURLRegex  = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
3251      simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
3252      delimUrlRegex   = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
3253      simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,
3254      delimMailRegex  = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
3255  
3256      replaceLink = function (options) {
3257        'use strict';
3258        return function (wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {
3259          link = link.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
3260          var lnkTxt = link,
3261              append = '',
3262              target = '',
3263              lmc    = leadingMagicChars || '',
3264              tmc    = trailingMagicChars || '';
3265          if (/^www\./i.test(link)) {
3266            link = link.replace(/^www\./i, 'http://www.');
3267          }
3268          if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {
3269            append = trailingPunctuation;
3270          }
3271          if (options.openLinksInNewWindow) {
3272            target = ' rel="noopener noreferrer" target="¨E95Eblank"';
3273          }
3274          return lmc + '<a href="' + link + '"' + target + '>' + lnkTxt + '</a>' + append + tmc;
3275        };
3276      },
3277  
3278      replaceMail = function (options, globals) {
3279        'use strict';
3280        return function (wholeMatch, b, mail) {
3281          var href = 'mailto:';
3282          b = b || '';
3283          mail = showdown.subParser('unescapeSpecialChars')(mail, options, globals);
3284          if (options.encodeEmails) {
3285            href = showdown.helper.encodeEmailAddress(href + mail);
3286            mail = showdown.helper.encodeEmailAddress(mail);
3287          } else {
3288            href = href + mail;
3289          }
3290          return b + '<a href="' + href + '">' + mail + '</a>';
3291        };
3292      };
3293  
3294  showdown.subParser('autoLinks', function (text, options, globals) {
3295    'use strict';
3296  
3297    text = globals.converter._dispatch('autoLinks.before', text, options, globals);
3298  
3299    text = text.replace(delimUrlRegex, replaceLink(options));
3300    text = text.replace(delimMailRegex, replaceMail(options, globals));
3301  
3302    text = globals.converter._dispatch('autoLinks.after', text, options, globals);
3303  
3304    return text;
3305  });
3306  
3307  showdown.subParser('simplifiedAutoLinks', function (text, options, globals) {
3308    'use strict';
3309  
3310    if (!options.simplifiedAutoLink) {
3311      return text;
3312    }
3313  
3314    text = globals.converter._dispatch('simplifiedAutoLinks.before', text, options, globals);
3315  
3316    if (options.excludeTrailingPunctuationFromURLs) {
3317      text = text.replace(simpleURLRegex2, replaceLink(options));
3318    } else {
3319      text = text.replace(simpleURLRegex, replaceLink(options));
3320    }
3321    text = text.replace(simpleMailRegex, replaceMail(options, globals));
3322  
3323    text = globals.converter._dispatch('simplifiedAutoLinks.after', text, options, globals);
3324  
3325    return text;
3326  });
3327  
3328  /**
3329   * These are all the transformations that form block-level
3330   * tags like paragraphs, headers, and list items.
3331   */
3332  showdown.subParser('blockGamut', function (text, options, globals) {
3333    'use strict';
3334  
3335    text = globals.converter._dispatch('blockGamut.before', text, options, globals);
3336  
3337    // we parse blockquotes first so that we can have headings and hrs
3338    // inside blockquotes
3339    text = showdown.subParser('blockQuotes')(text, options, globals);
3340    text = showdown.subParser('headers')(text, options, globals);
3341  
3342    // Do Horizontal Rules:
3343    text = showdown.subParser('horizontalRule')(text, options, globals);
3344  
3345    text = showdown.subParser('lists')(text, options, globals);
3346    text = showdown.subParser('codeBlocks')(text, options, globals);
3347    text = showdown.subParser('tables')(text, options, globals);
3348  
3349    // We already ran _HashHTMLBlocks() before, in Markdown(), but that
3350    // was to escape raw HTML in the original Markdown source. This time,
3351    // we're escaping the markup we've just created, so that we don't wrap
3352    // <p> tags around block-level tags.
3353    text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
3354    text = showdown.subParser('paragraphs')(text, options, globals);
3355  
3356    text = globals.converter._dispatch('blockGamut.after', text, options, globals);
3357  
3358    return text;
3359  });
3360  
3361  showdown.subParser('blockQuotes', function (text, options, globals) {
3362    'use strict';
3363  
3364    text = globals.converter._dispatch('blockQuotes.before', text, options, globals);
3365  
3366    // add a couple extra lines after the text and endtext mark
3367    text = text + '\n\n';
3368  
3369    var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
3370  
3371    if (options.splitAdjacentBlockquotes) {
3372      rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm;
3373    }
3374  
3375    text = text.replace(rgx, function (bq) {
3376      // attacklab: hack around Konqueror 3.5.4 bug:
3377      // "----------bug".replace(/^-/g,"") == "bug"
3378      bq = bq.replace(/^[ \t]*>[ \t]?/gm, ''); // trim one level of quoting
3379  
3380      // attacklab: clean up hack
3381      bq = bq.replace(/¨0/g, '');
3382  
3383      bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
3384      bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);
3385      bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse
3386  
3387      bq = bq.replace(/(^|\n)/g, '$1  ');
3388      // These leading spaces screw with <pre> content, so we need to fix that:
3389      bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
3390        var pre = m1;
3391        // attacklab: hack around Konqueror 3.5.4 bug:
3392        pre = pre.replace(/^  /mg, '¨0');
3393        pre = pre.replace(/¨0/g, '');
3394        return pre;
3395      });
3396  
3397      return showdown.subParser('hashBlock')('<blockquote>\n' + bq + '\n</blockquote>', options, globals);
3398    });
3399  
3400    text = globals.converter._dispatch('blockQuotes.after', text, options, globals);
3401    return text;
3402  });
3403  
3404  /**
3405   * Process Markdown `<pre><code>` blocks.
3406   */
3407  showdown.subParser('codeBlocks', function (text, options, globals) {
3408    'use strict';
3409  
3410    text = globals.converter._dispatch('codeBlocks.before', text, options, globals);
3411  
3412    // sentinel workarounds for lack of \A and \Z, safari\khtml bug
3413    text += '¨0';
3414  
3415    var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
3416    text = text.replace(pattern, function (wholeMatch, m1, m2) {
3417      var codeblock = m1,
3418          nextChar = m2,
3419          end = '\n';
3420  
3421      codeblock = showdown.subParser('outdent')(codeblock, options, globals);
3422      codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
3423      codeblock = showdown.subParser('detab')(codeblock, options, globals);
3424      codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
3425      codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines
3426  
3427      if (options.omitExtraWLInCodeBlocks) {
3428        end = '';
3429      }
3430  
3431      codeblock = '<pre><code>' + codeblock + end + '</code></pre>';
3432  
3433      return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;
3434    });
3435  
3436    // strip sentinel
3437    text = text.replace(/¨0/, '');
3438  
3439    text = globals.converter._dispatch('codeBlocks.after', text, options, globals);
3440    return text;
3441  });
3442  
3443  /**
3444   *
3445   *   *  Backtick quotes are used for <code></code> spans.
3446   *
3447   *   *  You can use multiple backticks as the delimiters if you want to
3448   *     include literal backticks in the code span. So, this input:
3449   *
3450   *         Just type ``foo `bar` baz`` at the prompt.
3451   *
3452   *       Will translate to:
3453   *
3454   *         <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
3455   *
3456   *    There's no arbitrary limit to the number of backticks you
3457   *    can use as delimters. If you need three consecutive backticks
3458   *    in your code, use four for delimiters, etc.
3459   *
3460   *  *  You can use spaces to get literal backticks at the edges:
3461   *
3462   *         ... type `` `bar` `` ...
3463   *
3464   *       Turns to:
3465   *
3466   *         ... type <code>`bar`</code> ...
3467   */
3468  showdown.subParser('codeSpans', function (text, options, globals) {
3469    'use strict';
3470  
3471    text = globals.converter._dispatch('codeSpans.before', text, options, globals);
3472  
3473    if (typeof text === 'undefined') {
3474      text = '';
3475    }
3476    text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
3477      function (wholeMatch, m1, m2, m3) {
3478        var c = m3;
3479        c = c.replace(/^([ \t]*)/g, '');    // leading whitespace
3480        c = c.replace(/[ \t]*$/g, '');    // trailing whitespace
3481        c = showdown.subParser('encodeCode')(c, options, globals);
3482        c = m1 + '<code>' + c + '</code>';
3483        c = showdown.subParser('hashHTMLSpans')(c, options, globals);
3484        return c;
3485      }
3486    );
3487  
3488    text = globals.converter._dispatch('codeSpans.after', text, options, globals);
3489    return text;
3490  });
3491  
3492  /**
3493   * Create a full HTML document from the processed markdown
3494   */
3495  showdown.subParser('completeHTMLDocument', function (text, options, globals) {
3496    'use strict';
3497  
3498    if (!options.completeHTMLDocument) {
3499      return text;
3500    }
3501  
3502    text = globals.converter._dispatch('completeHTMLDocument.before', text, options, globals);
3503  
3504    var doctype = 'html',
3505        doctypeParsed = '<!DOCTYPE HTML>\n',
3506        title = '',
3507        charset = '<meta charset="utf-8">\n',
3508        lang = '',
3509        metadata = '';
3510  
3511    if (typeof globals.metadata.parsed.doctype !== 'undefined') {
3512      doctypeParsed = '<!DOCTYPE ' +  globals.metadata.parsed.doctype + '>\n';
3513      doctype = globals.metadata.parsed.doctype.toString().toLowerCase();
3514      if (doctype === 'html' || doctype === 'html5') {
3515        charset = '<meta charset="utf-8">';
3516      }
3517    }
3518  
3519    for (var meta in globals.metadata.parsed) {
3520      if (globals.metadata.parsed.hasOwnProperty(meta)) {
3521        switch (meta.toLowerCase()) {
3522          case 'doctype':
3523            break;
3524  
3525          case 'title':
3526            title = '<title>' +  globals.metadata.parsed.title + '</title>\n';
3527            break;
3528  
3529          case 'charset':
3530            if (doctype === 'html' || doctype === 'html5') {
3531              charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n';
3532            } else {
3533              charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n';
3534            }
3535            break;
3536  
3537          case 'language':
3538          case 'lang':
3539            lang = ' lang="' + globals.metadata.parsed[meta] + '"';
3540            metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3541            break;
3542  
3543          default:
3544            metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3545        }
3546      }
3547    }
3548  
3549    text = doctypeParsed + '<html' + lang + '>\n<head>\n' + title + charset + metadata + '</head>\n<body>\n' + text.trim() + '\n</body>\n</html>';
3550  
3551    text = globals.converter._dispatch('completeHTMLDocument.after', text, options, globals);
3552    return text;
3553  });
3554  
3555  /**
3556   * Convert all tabs to spaces
3557   */
3558  showdown.subParser('detab', function (text, options, globals) {
3559    'use strict';
3560    text = globals.converter._dispatch('detab.before', text, options, globals);
3561  
3562    // expand first n-1 tabs
3563    text = text.replace(/\t(?=\t)/g, '    '); // g_tab_width
3564  
3565    // replace the nth with two sentinels
3566    text = text.replace(/\t/g, '¨A¨B');
3567  
3568    // use the sentinel to anchor our regex so it doesn't explode
3569    text = text.replace(/¨B(.+?)¨A/g, function (wholeMatch, m1) {
3570      var leadingText = m1,
3571          numSpaces = 4 - leadingText.length % 4;  // g_tab_width
3572  
3573      // there *must* be a better way to do this:
3574      for (var i = 0; i < numSpaces; i++) {
3575        leadingText += ' ';
3576      }
3577  
3578      return leadingText;
3579    });
3580  
3581    // clean up sentinels
3582    text = text.replace(/¨A/g, '    ');  // g_tab_width
3583    text = text.replace(/¨B/g, '');
3584  
3585    text = globals.converter._dispatch('detab.after', text, options, globals);
3586    return text;
3587  });
3588  
3589  showdown.subParser('ellipsis', function (text, options, globals) {
3590    'use strict';
3591  
3592    text = globals.converter._dispatch('ellipsis.before', text, options, globals);
3593  
3594    text = text.replace(/\.\.\./g, '…');
3595  
3596    text = globals.converter._dispatch('ellipsis.after', text, options, globals);
3597  
3598    return text;
3599  });
3600  
3601  /**
3602   * Turn emoji codes into emojis
3603   *
3604   * List of supported emojis: https://github.com/showdownjs/showdown/wiki/Emojis
3605   */
3606  showdown.subParser('emoji', function (text, options, globals) {
3607    'use strict';
3608  
3609    if (!options.emoji) {
3610      return text;
3611    }
3612  
3613    text = globals.converter._dispatch('emoji.before', text, options, globals);
3614  
3615    var emojiRgx = /:([\S]+?):/g;
3616  
3617    text = text.replace(emojiRgx, function (wm, emojiCode) {
3618      if (showdown.helper.emojis.hasOwnProperty(emojiCode)) {
3619        return showdown.helper.emojis[emojiCode];
3620      }
3621      return wm;
3622    });
3623  
3624    text = globals.converter._dispatch('emoji.after', text, options, globals);
3625  
3626    return text;
3627  });
3628  
3629  /**
3630   * Smart processing for ampersands and angle brackets that need to be encoded.
3631   */
3632  showdown.subParser('encodeAmpsAndAngles', function (text, options, globals) {
3633    'use strict';
3634    text = globals.converter._dispatch('encodeAmpsAndAngles.before', text, options, globals);
3635  
3636    // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
3637    // http://bumppo.net/projects/amputator/
3638    text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, '&amp;');
3639  
3640    // Encode naked <'s
3641    text = text.replace(/<(?![a-z\/?$!])/gi, '&lt;');
3642  
3643    // Encode <
3644    text = text.replace(/</g, '&lt;');
3645  
3646    // Encode >
3647    text = text.replace(/>/g, '&gt;');
3648  
3649    text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals);
3650    return text;
3651  });
3652  
3653  /**
3654   * Returns the string, with after processing the following backslash escape sequences.
3655   *
3656   * attacklab: The polite way to do this is with the new escapeCharacters() function:
3657   *
3658   *    text = escapeCharacters(text,"\\",true);
3659   *    text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
3660   *
3661   * ...but we're sidestepping its use of the (slow) RegExp constructor
3662   * as an optimization for Firefox.  This function gets called a LOT.
3663   */
3664  showdown.subParser('encodeBackslashEscapes', function (text, options, globals) {
3665    'use strict';
3666    text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);
3667  
3668    text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
3669    text = text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown.helper.escapeCharactersCallback);
3670  
3671    text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);
3672    return text;
3673  });
3674  
3675  /**
3676   * Encode/escape certain characters inside Markdown code runs.
3677   * The point is that in code, these characters are literals,
3678   * and lose their special Markdown meanings.
3679   */
3680  showdown.subParser('encodeCode', function (text, options, globals) {
3681    'use strict';
3682  
3683    text = globals.converter._dispatch('encodeCode.before', text, options, globals);
3684  
3685    // Encode all ampersands; HTML entities are not
3686    // entities within a Markdown code span.
3687    text = text
3688      .replace(/&/g, '&amp;')
3689    // Do the angle bracket song and dance:
3690      .replace(/</g, '&lt;')
3691      .replace(/>/g, '&gt;')
3692    // Now, escape characters that are magic in Markdown:
3693      .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
3694  
3695    text = globals.converter._dispatch('encodeCode.after', text, options, globals);
3696    return text;
3697  });
3698  
3699  /**
3700   * Within tags -- meaning between < and > -- encode [\ ` * _ ~ =] so they
3701   * don't conflict with their use in Markdown for code, italics and strong.
3702   */
3703  showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) {
3704    'use strict';
3705    text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.before', text, options, globals);
3706  
3707    // Build a regex to find HTML tags.
3708    var tags     = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,
3709        comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;
3710  
3711    text = text.replace(tags, function (wholeMatch) {
3712      return wholeMatch
3713        .replace(/(.)<\/?code>(?=.)/g, '$1`')
3714        .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
3715    });
3716  
3717    text = text.replace(comments, function (wholeMatch) {
3718      return wholeMatch
3719        .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
3720    });
3721  
3722    text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals);
3723    return text;
3724  });
3725  
3726  /**
3727   * Handle github codeblocks prior to running HashHTML so that
3728   * HTML contained within the codeblock gets escaped properly
3729   * Example:
3730   * ```ruby
3731   *     def hello_world(x)
3732   *       puts "Hello, #{x}"
3733   *     end
3734   * ```
3735   */
3736  showdown.subParser('githubCodeBlocks', function (text, options, globals) {
3737    'use strict';
3738  
3739    // early exit if option is not enabled
3740    if (!options.ghCodeBlocks) {
3741      return text;
3742    }
3743  
3744    text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);
3745  
3746    text += '¨0';
3747  
3748    text = text.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function (wholeMatch, delim, language, codeblock) {
3749      var end = (options.omitExtraWLInCodeBlocks) ? '' : '\n';
3750  
3751      // First parse the github code block
3752      codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
3753      codeblock = showdown.subParser('detab')(codeblock, options, globals);
3754      codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
3755      codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing whitespace
3756  
3757      codeblock = '<pre><code' + (language ? ' class="' + language + ' language-' + language + '"' : '') + '>' + codeblock + end + '</code></pre>';
3758  
3759      codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);
3760  
3761      // Since GHCodeblocks can be false positives, we need to
3762      // store the primitive text and the parsed text in a global var,
3763      // and then return a token
3764      return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
3765    });
3766  
3767    // attacklab: strip sentinel
3768    text = text.replace(/¨0/, '');
3769  
3770    return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);
3771  });
3772  
3773  showdown.subParser('hashBlock', function (text, options, globals) {
3774    'use strict';
3775    text = globals.converter._dispatch('hashBlock.before', text, options, globals);
3776    text = text.replace(/(^\n+|\n+$)/g, '');
3777    text = '\n\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n';
3778    text = globals.converter._dispatch('hashBlock.after', text, options, globals);
3779    return text;
3780  });
3781  
3782  /**
3783   * Hash and escape <code> elements that should not be parsed as markdown
3784   */
3785  showdown.subParser('hashCodeTags', function (text, options, globals) {
3786    'use strict';
3787    text = globals.converter._dispatch('hashCodeTags.before', text, options, globals);
3788  
3789    var repFunc = function (wholeMatch, match, left, right) {
3790      var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
3791      return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';
3792    };
3793  
3794    // Hash naked <code>
3795    text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '<code\\b[^>]*>', '</code>', 'gim');
3796  
3797    text = globals.converter._dispatch('hashCodeTags.after', text, options, globals);
3798    return text;
3799  });
3800  
3801  showdown.subParser('hashElement', function (text, options, globals) {
3802    'use strict';
3803  
3804    return function (wholeMatch, m1) {
3805      var blockText = m1;
3806  
3807      // Undo double lines
3808      blockText = blockText.replace(/\n\n/g, '\n');
3809      blockText = blockText.replace(/^\n/, '');
3810  
3811      // strip trailing blank lines
3812      blockText = blockText.replace(/\n+$/g, '');
3813  
3814      // Replace the element text with a marker ("¨KxK" where x is its key)
3815      blockText = '\n\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n';
3816  
3817      return blockText;
3818    };
3819  });
3820  
3821  showdown.subParser('hashHTMLBlocks', function (text, options, globals) {
3822    'use strict';
3823    text = globals.converter._dispatch('hashHTMLBlocks.before', text, options, globals);
3824  
3825    var blockTags = [
3826          'pre',
3827          'div',
3828          'h1',
3829          'h2',
3830          'h3',
3831          'h4',
3832          'h5',
3833          'h6',
3834          'blockquote',
3835          'table',
3836          'dl',
3837          'ol',
3838          'ul',
3839          'script',
3840          'noscript',
3841          'form',
3842          'fieldset',
3843          'iframe',
3844          'math',
3845          'style',
3846          'section',
3847          'header',
3848          'footer',
3849          'nav',
3850          'article',
3851          'aside',
3852          'address',
3853          'audio',
3854          'canvas',
3855          'figure',
3856          'hgroup',
3857          'output',
3858          'video',
3859          'p'
3860        ],
3861        repFunc = function (wholeMatch, match, left, right) {
3862          var txt = wholeMatch;
3863          // check if this html element is marked as markdown
3864          // if so, it's contents should be parsed as markdown
3865          if (left.search(/\bmarkdown\b/) !== -1) {
3866            txt = left + globals.converter.makeHtml(match) + right;
3867          }
3868          return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
3869        };
3870  
3871    if (options.backslashEscapesHTMLTags) {
3872      // encode backslash escaped HTML tags
3873      text = text.replace(/\\<(\/?[^>]+?)>/g, function (wm, inside) {
3874        return '&lt;' + inside + '&gt;';
3875      });
3876    }
3877  
3878    // hash HTML Blocks
3879    for (var i = 0; i < blockTags.length; ++i) {
3880  
3881      var opTagPos,
3882          rgx1     = new RegExp('^ {0,3}(<' + blockTags[i] + '\\b[^>]*>)', 'im'),
3883          patLeft  = '<' + blockTags[i] + '\\b[^>]*>',
3884          patRight = '</' + blockTags[i] + '>';
3885      // 1. Look for the first position of the first opening HTML tag in the text
3886      while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {
3887  
3888        // if the HTML tag is \ escaped, we need to escape it and break
3889  
3890  
3891        //2. Split the text in that position
3892        var subTexts = showdown.helper.splitAtIndex(text, opTagPos),
3893            //3. Match recursively
3894            newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');
3895  
3896        // prevent an infinite loop
3897        if (newSubText1 === subTexts[1]) {
3898          break;
3899        }
3900        text = subTexts[0].concat(newSubText1);
3901      }
3902    }
3903    // HR SPECIAL CASE
3904    text = text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
3905      showdown.subParser('hashElement')(text, options, globals));
3906  
3907    // Special case for standalone HTML comments
3908    text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {
3909      return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
3910    }, '^ {0,3}<!--', '-->', 'gm');
3911  
3912    // PHP and ASP-style processor instructions (<?...?> and <%...%>)
3913    text = text.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
3914      showdown.subParser('hashElement')(text, options, globals));
3915  
3916    text = globals.converter._dispatch('hashHTMLBlocks.after', text, options, globals);
3917    return text;
3918  });
3919  
3920  /**
3921   * Hash span elements that should not be parsed as markdown
3922   */
3923  showdown.subParser('hashHTMLSpans', function (text, options, globals) {
3924    'use strict';
3925    text = globals.converter._dispatch('hashHTMLSpans.before', text, options, globals);
3926  
3927    function hashHTMLSpan (html) {
3928      return '¨C' + (globals.gHtmlSpans.push(html) - 1) + 'C';
3929    }
3930  
3931    // Hash Self Closing tags
3932    text = text.replace(/<[^>]+?\/>/gi, function (wm) {
3933      return hashHTMLSpan(wm);
3934    });
3935  
3936    // Hash tags without properties
3937    text = text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (wm) {
3938      return hashHTMLSpan(wm);
3939    });
3940  
3941    // Hash tags with properties
3942    text = text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function (wm) {
3943      return hashHTMLSpan(wm);
3944    });
3945  
3946    // Hash self closing tags without />
3947    text = text.replace(/<[^>]+?>/gi, function (wm) {
3948      return hashHTMLSpan(wm);
3949    });
3950  
3951    /*showdown.helper.matchRecursiveRegExp(text, '<code\\b[^>]*>', '</code>', 'gi');*/
3952  
3953    text = globals.converter._dispatch('hashHTMLSpans.after', text, options, globals);
3954    return text;
3955  });
3956  
3957  /**
3958   * Unhash HTML spans
3959   */
3960  showdown.subParser('unhashHTMLSpans', function (text, options, globals) {
3961    'use strict';
3962    text = globals.converter._dispatch('unhashHTMLSpans.before', text, options, globals);
3963  
3964    for (var i = 0; i < globals.gHtmlSpans.length; ++i) {
3965      var repText = globals.gHtmlSpans[i],
3966          // limiter to prevent infinite loop (assume 10 as limit for recurse)
3967          limit = 0;
3968  
3969      while (/¨C(\d+)C/.test(repText)) {
3970        var num = RegExp.$1;
3971        repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);
3972        if (limit === 10) {
3973          console.error('maximum nesting of 10 spans reached!!!');
3974          break;
3975        }
3976        ++limit;
3977      }
3978      text = text.replace('¨C' + i + 'C', repText);
3979    }
3980  
3981    text = globals.converter._dispatch('unhashHTMLSpans.after', text, options, globals);
3982    return text;
3983  });
3984  
3985  /**
3986   * Hash and escape <pre><code> elements that should not be parsed as markdown
3987   */
3988  showdown.subParser('hashPreCodeTags', function (text, options, globals) {
3989    'use strict';
3990    text = globals.converter._dispatch('hashPreCodeTags.before', text, options, globals);
3991  
3992    var repFunc = function (wholeMatch, match, left, right) {
3993      // encode html entities
3994      var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
3995      return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
3996    };
3997  
3998    // Hash <pre><code>
3999    text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>', '^ {0,3}</code>\\s*</pre>', 'gim');
4000  
4001    text = globals.converter._dispatch('hashPreCodeTags.after', text, options, globals);
4002    return text;
4003  });
4004  
4005  showdown.subParser('headers', function (text, options, globals) {
4006    'use strict';
4007  
4008    text = globals.converter._dispatch('headers.before', text, options, globals);
4009  
4010    var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
4011  
4012        // Set text-style headers:
4013        //    Header 1
4014        //    ========
4015        //
4016        //    Header 2
4017        //    --------
4018        //
4019        setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
4020        setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
4021  
4022    text = text.replace(setextRegexH1, function (wholeMatch, m1) {
4023  
4024      var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
4025          hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
4026          hLevel = headerLevelStart,
4027          hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
4028      return showdown.subParser('hashBlock')(hashBlock, options, globals);
4029    });
4030  
4031    text = text.replace(setextRegexH2, function (matchFound, m1) {
4032      var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
4033          hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
4034          hLevel = headerLevelStart + 1,
4035          hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
4036      return showdown.subParser('hashBlock')(hashBlock, options, globals);
4037    });
4038  
4039    // atx-style headers:
4040    //  # Header 1
4041    //  ## Header 2
4042    //  ## Header 2 with closing hashes ##
4043    //  ...
4044    //  ###### Header 6
4045    //
4046    var atxStyle = (options.requireSpaceBeforeHeadingText) ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;
4047  
4048    text = text.replace(atxStyle, function (wholeMatch, m1, m2) {
4049      var hText = m2;
4050      if (options.customizedHeaderId) {
4051        hText = m2.replace(/\s?\{([^{]+?)}\s*$/, '');
4052      }
4053  
4054      var span = showdown.subParser('spanGamut')(hText, options, globals),
4055          hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"',
4056          hLevel = headerLevelStart - 1 + m1.length,
4057          header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>';
4058  
4059      return showdown.subParser('hashBlock')(header, options, globals);
4060    });
4061  
4062    function headerId (m) {
4063      var title,
4064          prefix;
4065  
4066      // It is separate from other options to allow combining prefix and customized
4067      if (options.customizedHeaderId) {
4068        var match = m.match(/\{([^{]+?)}\s*$/);
4069        if (match && match[1]) {
4070          m = match[1];
4071        }
4072      }
4073  
4074      title = m;
4075  
4076      // Prefix id to prevent causing inadvertent pre-existing style matches.
4077      if (showdown.helper.isString(options.prefixHeaderId)) {
4078        prefix = options.prefixHeaderId;
4079      } else if (options.prefixHeaderId === true) {
4080        prefix = 'section-';
4081      } else {
4082        prefix = '';
4083      }
4084  
4085      if (!options.rawPrefixHeaderId) {
4086        title = prefix + title;
4087      }
4088  
4089      if (options.ghCompatibleHeaderId) {
4090        title = title
4091          .replace(/ /g, '-')
4092          // replace previously escaped chars (&, ¨ and $)
4093          .replace(/&amp;/g, '')
4094          .replace(/¨T/g, '')
4095          .replace(/¨D/g, '')
4096          // replace rest of the chars (&~$ are repeated as they might have been escaped)
4097          // borrowed from github's redcarpet (some they should produce similar results)
4098          .replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, '')
4099          .toLowerCase();
4100      } else if (options.rawHeaderId) {
4101        title = title
4102          .replace(/ /g, '-')
4103          // replace previously escaped chars (&, ¨ and $)
4104          .replace(/&amp;/g, '&')
4105          .replace(/¨T/g, '¨')
4106          .replace(/¨D/g, '$')
4107          // replace " and '
4108          .replace(/["']/g, '-')
4109          .toLowerCase();
4110      } else {
4111        title = title
4112          .replace(/[^\w]/g, '')
4113          .toLowerCase();
4114      }
4115  
4116      if (options.rawPrefixHeaderId) {
4117        title = prefix + title;
4118      }
4119  
4120      if (globals.hashLinkCounts[title]) {
4121        title = title + '-' + (globals.hashLinkCounts[title]++);
4122      } else {
4123        globals.hashLinkCounts[title] = 1;
4124      }
4125      return title;
4126    }
4127  
4128    text = globals.converter._dispatch('headers.after', text, options, globals);
4129    return text;
4130  });
4131  
4132  /**
4133   * Turn Markdown link shortcuts into XHTML <a> tags.
4134   */
4135  showdown.subParser('horizontalRule', function (text, options, globals) {
4136    'use strict';
4137    text = globals.converter._dispatch('horizontalRule.before', text, options, globals);
4138  
4139    var key = showdown.subParser('hashBlock')('<hr />', options, globals);
4140    text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
4141    text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
4142    text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
4143  
4144    text = globals.converter._dispatch('horizontalRule.after', text, options, globals);
4145    return text;
4146  });
4147  
4148  /**
4149   * Turn Markdown image shortcuts into <img> tags.
4150   */
4151  showdown.subParser('images', function (text, options, globals) {
4152    'use strict';
4153  
4154    text = globals.converter._dispatch('images.before', text, options, globals);
4155  
4156    var inlineRegExp      = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
4157        crazyRegExp       = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,
4158        base64RegExp      = /!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
4159        referenceRegExp   = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,
4160        refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
4161  
4162    function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {
4163      url = url.replace(/\s/g, '');
4164      return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
4165    }
4166  
4167    function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
4168  
4169      var gUrls   = globals.gUrls,
4170          gTitles = globals.gTitles,
4171          gDims   = globals.gDimensions;
4172  
4173      linkId = linkId.toLowerCase();
4174  
4175      if (!title) {
4176        title = '';
4177      }
4178      // Special case for explicit empty url
4179      if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
4180        url = '';
4181  
4182      } else if (url === '' || url === null) {
4183        if (linkId === '' || linkId === null) {
4184          // lower-case and turn embedded newlines into spaces
4185          linkId = altText.toLowerCase().replace(/ ?\n/g, ' ');
4186        }
4187        url = '#' + linkId;
4188  
4189        if (!showdown.helper.isUndefined(gUrls[linkId])) {
4190          url = gUrls[linkId];
4191          if (!showdown.helper.isUndefined(gTitles[linkId])) {
4192            title = gTitles[linkId];
4193          }
4194          if (!showdown.helper.isUndefined(gDims[linkId])) {
4195            width = gDims[linkId].width;
4196            height = gDims[linkId].height;
4197          }
4198        } else {
4199          return wholeMatch;
4200        }
4201      }
4202  
4203      altText = altText
4204        .replace(/"/g, '&quot;')
4205      //altText = showdown.helper.escapeCharacters(altText, '*_', false);
4206        .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
4207      //url = showdown.helper.escapeCharacters(url, '*_', false);
4208      url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
4209      var result = '<img src="' + url + '" alt="' + altText + '"';
4210  
4211      if (title && showdown.helper.isString(title)) {
4212        title = title
4213          .replace(/"/g, '&quot;')
4214        //title = showdown.helper.escapeCharacters(title, '*_', false);
4215          .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
4216        result += ' title="' + title + '"';
4217      }
4218  
4219      if (width && height) {
4220        width  = (width === '*') ? 'auto' : width;
4221        height = (height === '*') ? 'auto' : height;
4222  
4223        result += ' width="' + width + '"';
4224        result += ' height="' + height + '"';
4225      }
4226  
4227      result += ' />';
4228  
4229      return result;
4230    }
4231  
4232    // First, handle reference-style labeled images: ![alt text][id]
4233    text = text.replace(referenceRegExp, writeImageTag);
4234  
4235    // Next, handle inline images:  ![alt text](url =<width>x<height> "optional title")
4236  
4237    // base64 encoded images
4238    text = text.replace(base64RegExp, writeImageTagBase64);
4239  
4240    // cases with crazy urls like ./image/cat1).png
4241    text = text.replace(crazyRegExp, writeImageTag);
4242  
4243    // normal cases
4244    text = text.replace(inlineRegExp, writeImageTag);
4245  
4246    // handle reference-style shortcuts: ![img text]
4247    text = text.replace(refShortcutRegExp, writeImageTag);
4248  
4249    text = globals.converter._dispatch('images.after', text, options, globals);
4250    return text;
4251  });
4252  
4253  showdown.subParser('italicsAndBold', function (text, options, globals) {
4254    'use strict';
4255  
4256    text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);
4257  
4258    // it's faster to have 3 separate regexes for each case than have just one
4259    // because of backtracing, in some cases, it could lead to an exponential effect
4260    // called "catastrophic backtrace". Ominous!
4261  
4262    function parseInside (txt, left, right) {
4263      /*
4264      if (options.simplifiedAutoLink) {
4265        txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
4266      }
4267      */
4268      return left + txt + right;
4269    }
4270  
4271    // Parse underscores
4272    if (options.literalMidWordUnderscores) {
4273      text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
4274        return parseInside (txt, '<strong><em>', '</em></strong>');
4275      });
4276      text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
4277        return parseInside (txt, '<strong>', '</strong>');
4278      });
4279      text = text.replace(/\b_(\S[\s\S]*?)_\b/g, function (wm, txt) {
4280        return parseInside (txt, '<em>', '</em>');
4281      });
4282    } else {
4283      text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
4284        return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
4285      });
4286      text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
4287        return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
4288      });
4289      text = text.replace(/_([^\s_][\s\S]*?)_/g, function (wm, m) {
4290        // !/^_[^_]/.test(m) - test if it doesn't start with __ (since it seems redundant, we removed it)
4291        return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
4292      });
4293    }
4294  
4295    // Now parse asterisks
4296    if (options.literalMidWordAsterisks) {
4297      text = text.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function (wm, lead, txt) {
4298        return parseInside (txt, lead + '<strong><em>', '</em></strong>');
4299      });
4300      text = text.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function (wm, lead, txt) {
4301        return parseInside (txt, lead + '<strong>', '</strong>');
4302      });
4303      text = text.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function (wm, lead, txt) {
4304        return parseInside (txt, lead + '<em>', '</em>');
4305      });
4306    } else {
4307      text = text.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function (wm, m) {
4308        return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
4309      });
4310      text = text.replace(/\*\*(\S[\s\S]*?)\*\*/g, function (wm, m) {
4311        return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
4312      });
4313      text = text.replace(/\*([^\s*][\s\S]*?)\*/g, function (wm, m) {
4314        // !/^\*[^*]/.test(m) - test if it doesn't start with ** (since it seems redundant, we removed it)
4315        return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
4316      });
4317    }
4318  
4319  
4320    text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);
4321    return text;
4322  });
4323  
4324  /**
4325   * Form HTML ordered (numbered) and unordered (bulleted) lists.
4326   */
4327  showdown.subParser('lists', function (text, options, globals) {
4328    'use strict';
4329  
4330    /**
4331     * Process the contents of a single ordered or unordered list, splitting it
4332     * into individual list items.
4333     * @param {string} listStr
4334     * @param {boolean} trimTrailing
4335     * @returns {string}
4336     */
4337    function processListItems (listStr, trimTrailing) {
4338      // The $g_list_level global keeps track of when we're inside a list.
4339      // Each time we enter a list, we increment it; when we leave a list,
4340      // we decrement. If it's zero, we're not in a list anymore.
4341      //
4342      // We do this because when we're not inside a list, we want to treat
4343      // something like this:
4344      //
4345      //    I recommend upgrading to version
4346      //    8. Oops, now this line is treated
4347      //    as a sub-list.
4348      //
4349      // As a single paragraph, despite the fact that the second line starts
4350      // with a digit-period-space sequence.
4351      //
4352      // Whereas when we're inside a list (or sub-list), that line will be
4353      // treated as the start of a sub-list. What a kludge, huh? This is
4354      // an aspect of Markdown's syntax that's hard to parse perfectly
4355      // without resorting to mind-reading. Perhaps the solution is to
4356      // change the syntax rules such that sub-lists must start with a
4357      // starting cardinal number; e.g. "1." or "a.".
4358      globals.gListLevel++;
4359  
4360      // trim trailing blank lines:
4361      listStr = listStr.replace(/\n{2,}$/, '\n');
4362  
4363      // attacklab: add sentinel to emulate \z
4364      listStr += '¨0';
4365  
4366      var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,
4367          isParagraphed = (/\n[ \t]*\n(?!¨0)/.test(listStr));
4368  
4369      // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation,
4370      // which is a syntax breaking change
4371      // activating this option reverts to old behavior
4372      if (options.disableForced4SpacesIndentedSublists) {
4373        rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm;
4374      }
4375  
4376      listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {
4377        checked = (checked && checked.trim() !== '');
4378  
4379        var item = showdown.subParser('outdent')(m4, options, globals),
4380            bulletStyle = '';
4381  
4382        // Support for github tasklists
4383        if (taskbtn && options.tasklists) {
4384          bulletStyle = ' class="task-list-item" style="list-style-type: none;"';
4385          item = item.replace(/^[ \t]*\[(x|X| )?]/m, function () {
4386            var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
4387            if (checked) {
4388              otp += ' checked';
4389            }
4390            otp += '>';
4391            return otp;
4392          });
4393        }
4394  
4395        // ISSUE #312
4396        // This input: - - - a
4397        // causes trouble to the parser, since it interprets it as:
4398        // <ul><li><li><li>a</li></li></li></ul>
4399        // instead of:
4400        // <ul><li>- - a</li></ul>
4401        // So, to prevent it, we will put a marker (¨A)in the beginning of the line
4402        // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
4403        item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
4404          return '¨A' + wm2;
4405        });
4406  
4407        // m1 - Leading line or
4408        // Has a double return (multi paragraph) or
4409        // Has sublist
4410        if (m1 || (item.search(/\n{2,}/) > -1)) {
4411          item = showdown.subParser('githubCodeBlocks')(item, options, globals);
4412          item = showdown.subParser('blockGamut')(item, options, globals);
4413        } else {
4414          // Recursion for sub-lists:
4415          item = showdown.subParser('lists')(item, options, globals);
4416          item = item.replace(/\n$/, ''); // chomp(item)
4417          item = showdown.subParser('hashHTMLBlocks')(item, options, globals);
4418  
4419          // Colapse double linebreaks
4420          item = item.replace(/\n\n+/g, '\n\n');
4421          if (isParagraphed) {
4422            item = showdown.subParser('paragraphs')(item, options, globals);
4423          } else {
4424            item = showdown.subParser('spanGamut')(item, options, globals);
4425          }
4426        }
4427  
4428        // now we need to remove the marker (¨A)
4429        item = item.replace('¨A', '');
4430        // we can finally wrap the line in list item tags
4431        item =  '<li' + bulletStyle + '>' + item + '</li>\n';
4432  
4433        return item;
4434      });
4435  
4436      // attacklab: strip sentinel
4437      listStr = listStr.replace(/¨0/g, '');
4438  
4439      globals.gListLevel--;
4440  
4441      if (trimTrailing) {
4442        listStr = listStr.replace(/\s+$/, '');
4443      }
4444  
4445      return listStr;
4446    }
4447  
4448    function styleStartNumber (list, listType) {
4449      // check if ol and starts by a number different than 1
4450      if (listType === 'ol') {
4451        var res = list.match(/^ *(\d+)\./);
4452        if (res && res[1] !== '1') {
4453          return ' start="' + res[1] + '"';
4454        }
4455      }
4456      return '';
4457    }
4458  
4459    /**
4460     * Check and parse consecutive lists (better fix for issue #142)
4461     * @param {string} list
4462     * @param {string} listType
4463     * @param {boolean} trimTrailing
4464     * @returns {string}
4465     */
4466    function parseConsecutiveLists (list, listType, trimTrailing) {
4467      // check if we caught 2 or more consecutive lists by mistake
4468      // we use the counterRgx, meaning if listType is UL we look for OL and vice versa
4469      var olRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm,
4470          ulRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm,
4471          counterRxg = (listType === 'ul') ? olRgx : ulRgx,
4472          result = '';
4473  
4474      if (list.search(counterRxg) !== -1) {
4475        (function parseCL (txt) {
4476          var pos = txt.search(counterRxg),
4477              style = styleStartNumber(list, listType);
4478          if (pos !== -1) {
4479            // slice
4480            result += '\n\n<' + listType + style + '>\n' + processListItems(txt.slice(0, pos), !!trimTrailing) + '</' + listType + '>\n';
4481  
4482            // invert counterType and listType
4483            listType = (listType === 'ul') ? 'ol' : 'ul';
4484            counterRxg = (listType === 'ul') ? olRgx : ulRgx;
4485  
4486            //recurse
4487            parseCL(txt.slice(pos));
4488          } else {
4489            result += '\n\n<' + listType + style + '>\n' + processListItems(txt, !!trimTrailing) + '</' + listType + '>\n';
4490          }
4491        })(list);
4492      } else {
4493        var style = styleStartNumber(list, listType);
4494        result = '\n\n<' + listType + style + '>\n' + processListItems(list, !!trimTrailing) + '</' + listType + '>\n';
4495      }
4496  
4497      return result;
4498    }
4499  
4500    /** Start of list parsing **/
4501    text = globals.converter._dispatch('lists.before', text, options, globals);
4502    // add sentinel to hack around khtml/safari bug:
4503    // http://bugs.webkit.org/show_bug.cgi?id=11231
4504    text += '¨0';
4505  
4506    if (globals.gListLevel) {
4507      text = text.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
4508        function (wholeMatch, list, m2) {
4509          var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
4510          return parseConsecutiveLists(list, listType, true);
4511        }
4512      );
4513    } else {
4514      text = text.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
4515        function (wholeMatch, m1, list, m3) {
4516          var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
4517          return parseConsecutiveLists(list, listType, false);
4518        }
4519      );
4520    }
4521  
4522    // strip sentinel
4523    text = text.replace(/¨0/, '');
4524    text = globals.converter._dispatch('lists.after', text, options, globals);
4525    return text;
4526  });
4527  
4528  /**
4529   * Parse metadata at the top of the document
4530   */
4531  showdown.subParser('metadata', function (text, options, globals) {
4532    'use strict';
4533  
4534    if (!options.metadata) {
4535      return text;
4536    }
4537  
4538    text = globals.converter._dispatch('metadata.before', text, options, globals);
4539  
4540    function parseMetadataContents (content) {
4541      // raw is raw so it's not changed in any way
4542      globals.metadata.raw = content;
4543  
4544      // escape chars forbidden in html attributes
4545      // double quotes
4546      content = content
4547        // ampersand first
4548        .replace(/&/g, '&amp;')
4549        // double quotes
4550        .replace(/"/g, '&quot;');
4551  
4552      content = content.replace(/\n {4}/g, ' ');
4553      content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function (wm, key, value) {
4554        globals.metadata.parsed[key] = value;
4555        return '';
4556      });
4557    }
4558  
4559    text = text.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function (wholematch, format, content) {
4560      parseMetadataContents(content);
4561      return '¨M';
4562    });
4563  
4564    text = text.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function (wholematch, format, content) {
4565      if (format) {
4566        globals.metadata.format = format;
4567      }
4568      parseMetadataContents(content);
4569      return '¨M';
4570    });
4571  
4572    text = text.replace(/¨M/g, '');
4573  
4574    text = globals.converter._dispatch('metadata.after', text, options, globals);
4575    return text;
4576  });
4577  
4578  /**
4579   * Remove one level of line-leading tabs or spaces
4580   */
4581  showdown.subParser('outdent', function (text, options, globals) {
4582    'use strict';
4583    text = globals.converter._dispatch('outdent.before', text, options, globals);
4584  
4585    // attacklab: hack around Konqueror 3.5.4 bug:
4586    // "----------bug".replace(/^-/g,"") == "bug"
4587    text = text.replace(/^(\t|[ ]{1,4})/gm, '¨0'); // attacklab: g_tab_width
4588  
4589    // attacklab: clean up hack
4590    text = text.replace(/¨0/g, '');
4591  
4592    text = globals.converter._dispatch('outdent.after', text, options, globals);
4593    return text;
4594  });
4595  
4596  /**
4597   *
4598   */
4599  showdown.subParser('paragraphs', function (text, options, globals) {
4600    'use strict';
4601  
4602    text = globals.converter._dispatch('paragraphs.before', text, options, globals);
4603    // Strip leading and trailing lines:
4604    text = text.replace(/^\n+/g, '');
4605    text = text.replace(/\n+$/g, '');
4606  
4607    var grafs = text.split(/\n{2,}/g),
4608        grafsOut = [],
4609        end = grafs.length; // Wrap <p> tags
4610  
4611    for (var i = 0; i < end; i++) {
4612      var str = grafs[i];
4613      // if this is an HTML marker, copy it
4614      if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
4615        grafsOut.push(str);
4616  
4617      // test for presence of characters to prevent empty lines being parsed
4618      // as paragraphs (resulting in undesired extra empty paragraphs)
4619      } else if (str.search(/\S/) >= 0) {
4620        str = showdown.subParser('spanGamut')(str, options, globals);
4621        str = str.replace(/^([ \t]*)/g, '<p>');
4622        str += '</p>';
4623        grafsOut.push(str);
4624      }
4625    }
4626  
4627    /** Unhashify HTML blocks */
4628    end = grafsOut.length;
4629    for (i = 0; i < end; i++) {
4630      var blockText = '',
4631          grafsOutIt = grafsOut[i],
4632          codeFlag = false;
4633      // if this is a marker for an html block...
4634      // use RegExp.test instead of string.search because of QML bug
4635      while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) {
4636        var delim = RegExp.$1,
4637            num   = RegExp.$2;
4638  
4639        if (delim === 'K') {
4640          blockText = globals.gHtmlBlocks[num];
4641        } else {
4642          // we need to check if ghBlock is a false positive
4643          if (codeFlag) {
4644            // use encoded version of all text
4645            blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text, options, globals);
4646          } else {
4647            blockText = globals.ghCodeBlocks[num].codeblock;
4648          }
4649        }
4650        blockText = blockText.replace(/\$/g, '$$$$'); // Escape any dollar signs
4651  
4652        grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText);
4653        // Check if grafsOutIt is a pre->code
4654        if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) {
4655          codeFlag = true;
4656        }
4657      }
4658      grafsOut[i] = grafsOutIt;
4659    }
4660    text = grafsOut.join('\n');
4661    // Strip leading and trailing lines:
4662    text = text.replace(/^\n+/g, '');
4663    text = text.replace(/\n+$/g, '');
4664    return globals.converter._dispatch('paragraphs.after', text, options, globals);
4665  });
4666  
4667  /**
4668   * Run extension
4669   */
4670  showdown.subParser('runExtension', function (ext, text, options, globals) {
4671    'use strict';
4672  
4673    if (ext.filter) {
4674      text = ext.filter(text, globals.converter, options);
4675  
4676    } else if (ext.regex) {
4677      // TODO remove this when old extension loading mechanism is deprecated
4678      var re = ext.regex;
4679      if (!(re instanceof RegExp)) {
4680        re = new RegExp(re, 'g');
4681      }
4682      text = text.replace(re, ext.replace);
4683    }
4684  
4685    return text;
4686  });
4687  
4688  /**
4689   * These are all the transformations that occur *within* block-level
4690   * tags like paragraphs, headers, and list items.
4691   */
4692  showdown.subParser('spanGamut', function (text, options, globals) {
4693    'use strict';
4694  
4695    text = globals.converter._dispatch('spanGamut.before', text, options, globals);
4696    text = showdown.subParser('codeSpans')(text, options, globals);
4697    text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);
4698    text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);
4699  
4700    // Process anchor and image tags. Images must come first,
4701    // because ![foo][f] looks like an anchor.
4702    text = showdown.subParser('images')(text, options, globals);
4703    text = showdown.subParser('anchors')(text, options, globals);
4704  
4705    // Make links out of things like `<http://example.com/>`
4706    // Must come after anchors, because you can use < and >
4707    // delimiters in inline links like [this](<url>).
4708    text = showdown.subParser('autoLinks')(text, options, globals);
4709    text = showdown.subParser('simplifiedAutoLinks')(text, options, globals);
4710    text = showdown.subParser('emoji')(text, options, globals);
4711    text = showdown.subParser('underline')(text, options, globals);
4712    text = showdown.subParser('italicsAndBold')(text, options, globals);
4713    text = showdown.subParser('strikethrough')(text, options, globals);
4714    text = showdown.subParser('ellipsis')(text, options, globals);
4715  
4716    // we need to hash HTML tags inside spans
4717    text = showdown.subParser('hashHTMLSpans')(text, options, globals);
4718  
4719    // now we encode amps and angles
4720    text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);
4721  
4722    // Do hard breaks
4723    if (options.simpleLineBreaks) {
4724      // GFM style hard breaks
4725      // only add line breaks if the text does not contain a block (special case for lists)
4726      if (!/\n\n¨K/.test(text)) {
4727        text = text.replace(/\n+/g, '<br />\n');
4728      }
4729    } else {
4730      // Vanilla hard breaks
4731      text = text.replace(/  +\n/g, '<br />\n');
4732    }
4733  
4734    text = globals.converter._dispatch('spanGamut.after', text, options, globals);
4735    return text;
4736  });
4737  
4738  showdown.subParser('strikethrough', function (text, options, globals) {
4739    'use strict';
4740  
4741    function parseInside (txt) {
4742      if (options.simplifiedAutoLink) {
4743        txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
4744      }
4745      return '<del>' + txt + '</del>';
4746    }
4747  
4748    if (options.strikethrough) {
4749      text = globals.converter._dispatch('strikethrough.before', text, options, globals);
4750      text = text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function (wm, txt) { return parseInside(txt); });
4751      text = globals.converter._dispatch('strikethrough.after', text, options, globals);
4752    }
4753  
4754    return text;
4755  });
4756  
4757  /**
4758   * Strips link definitions from text, stores the URLs and titles in
4759   * hash references.
4760   * Link defs are in the form: ^[id]: url "optional title"
4761   */
4762  showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
4763    'use strict';
4764  
4765    var regex       = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,
4766        base64Regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;
4767  
4768    // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
4769    text += '¨0';
4770  
4771    var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {
4772      linkId = linkId.toLowerCase();
4773      if (url.match(/^data:.+?\/.+?;base64,/)) {
4774        // remove newlines
4775        globals.gUrls[linkId] = url.replace(/\s/g, '');
4776      } else {
4777        globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url, options, globals);  // Link IDs are case-insensitive
4778      }
4779  
4780      if (blankLines) {
4781        // Oops, found blank lines, so it's not a title.
4782        // Put back the parenthetical statement we stole.
4783        return blankLines + title;
4784  
4785      } else {
4786        if (title) {
4787          globals.gTitles[linkId] = title.replace(/"|'/g, '&quot;');
4788        }
4789        if (options.parseImgDimensions && width && height) {
4790          globals.gDimensions[linkId] = {
4791            width:  width,
4792            height: height
4793          };
4794        }
4795      }
4796      // Completely remove the definition from the text
4797      return '';
4798    };
4799  
4800    // first we try to find base64 link references
4801    text = text.replace(base64Regex, replaceFunc);
4802  
4803    text = text.replace(regex, replaceFunc);
4804  
4805    // attacklab: strip sentinel
4806    text = text.replace(/¨0/, '');
4807  
4808    return text;
4809  });
4810  
4811  showdown.subParser('tables', function (text, options, globals) {
4812    'use strict';
4813  
4814    if (!options.tables) {
4815      return text;
4816    }
4817  
4818    var tableRgx       = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,
4819        //singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
4820        singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
4821  
4822    function parseStyles (sLine) {
4823      if (/^:[ \t]*--*$/.test(sLine)) {
4824        return ' style="text-align:left;"';
4825      } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
4826        return ' style="text-align:right;"';
4827      } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
4828        return ' style="text-align:center;"';
4829      } else {
4830        return '';
4831      }
4832    }
4833  
4834    function parseHeaders (header, style) {
4835      var id = '';
4836      header = header.trim();
4837      // support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility
4838      if (options.tablesHeaderId || options.tableHeaderId) {
4839        id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
4840      }
4841      header = showdown.subParser('spanGamut')(header, options, globals);
4842  
4843      return '<th' + id + style + '>' + header + '</th>\n';
4844    }
4845  
4846    function parseCells (cell, style) {
4847      var subText = showdown.subParser('spanGamut')(cell, options, globals);
4848      return '<td' + style + '>' + subText + '</td>\n';
4849    }
4850  
4851    function buildTable (headers, cells) {
4852      var tb = '<table>\n<thead>\n<tr>\n',
4853          tblLgn = headers.length;
4854  
4855      for (var i = 0; i < tblLgn; ++i) {
4856        tb += headers[i];
4857      }
4858      tb += '</tr>\n</thead>\n<tbody>\n';
4859  
4860      for (i = 0; i < cells.length; ++i) {
4861        tb += '<tr>\n';
4862        for (var ii = 0; ii < tblLgn; ++ii) {
4863          tb += cells[i][ii];
4864        }
4865        tb += '</tr>\n';
4866      }
4867      tb += '</tbody>\n</table>\n';
4868      return tb;
4869    }
4870  
4871    function parseTable (rawTable) {
4872      var i, tableLines = rawTable.split('\n');
4873  
4874      for (i = 0; i < tableLines.length; ++i) {
4875        // strip wrong first and last column if wrapped tables are used
4876        if (/^ {0,3}\|/.test(tableLines[i])) {
4877          tableLines[i] = tableLines[i].replace(/^ {0,3}\|/, '');
4878        }
4879        if (/\|[ \t]*$/.test(tableLines[i])) {
4880          tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, '');
4881        }
4882        // parse code spans first, but we only support one line code spans
4883        tableLines[i] = showdown.subParser('codeSpans')(tableLines[i], options, globals);
4884      }
4885  
4886      var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),
4887          rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),
4888          rawCells = [],
4889          headers = [],
4890          styles = [],
4891          cells = [];
4892  
4893      tableLines.shift();
4894      tableLines.shift();
4895  
4896      for (i = 0; i < tableLines.length; ++i) {
4897        if (tableLines[i].trim() === '') {
4898          continue;
4899        }
4900        rawCells.push(
4901          tableLines[i]
4902            .split('|')
4903            .map(function (s) {
4904              return s.trim();
4905            })
4906        );
4907      }
4908  
4909      if (rawHeaders.length < rawStyles.length) {
4910        return rawTable;
4911      }
4912  
4913      for (i = 0; i < rawStyles.length; ++i) {
4914        styles.push(parseStyles(rawStyles[i]));
4915      }
4916  
4917      for (i = 0; i < rawHeaders.length; ++i) {
4918        if (showdown.helper.isUndefined(styles[i])) {
4919          styles[i] = '';
4920        }
4921        headers.push(parseHeaders(rawHeaders[i], styles[i]));
4922      }
4923  
4924      for (i = 0; i < rawCells.length; ++i) {
4925        var row = [];
4926        for (var ii = 0; ii < headers.length; ++ii) {
4927          if (showdown.helper.isUndefined(rawCells[i][ii])) {
4928  
4929          }
4930          row.push(parseCells(rawCells[i][ii], styles[ii]));
4931        }
4932        cells.push(row);
4933      }
4934  
4935      return buildTable(headers, cells);
4936    }
4937  
4938    text = globals.converter._dispatch('tables.before', text, options, globals);
4939  
4940    // find escaped pipe characters
4941    text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback);
4942  
4943    // parse multi column tables
4944    text = text.replace(tableRgx, parseTable);
4945  
4946    // parse one column tables
4947    text = text.replace(singeColTblRgx, parseTable);
4948  
4949    text = globals.converter._dispatch('tables.after', text, options, globals);
4950  
4951    return text;
4952  });
4953  
4954  showdown.subParser('underline', function (text, options, globals) {
4955    'use strict';
4956  
4957    if (!options.underline) {
4958      return text;
4959    }
4960  
4961    text = globals.converter._dispatch('underline.before', text, options, globals);
4962  
4963    if (options.literalMidWordUnderscores) {
4964      text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
4965        return '<u>' + txt + '</u>';
4966      });
4967      text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
4968        return '<u>' + txt + '</u>';
4969      });
4970    } else {
4971      text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
4972        return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
4973      });
4974      text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
4975        return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
4976      });
4977    }
4978  
4979    // escape remaining underscores to prevent them being parsed by italic and bold
4980    text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback);
4981  
4982    text = globals.converter._dispatch('underline.after', text, options, globals);
4983  
4984    return text;
4985  });
4986  
4987  /**
4988   * Swap back in all the special characters we've hidden.
4989   */
4990  showdown.subParser('unescapeSpecialChars', function (text, options, globals) {
4991    'use strict';
4992    text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals);
4993  
4994    text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) {
4995      var charCodeToReplace = parseInt(m1);
4996      return String.fromCharCode(charCodeToReplace);
4997    });
4998  
4999    text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals);
5000    return text;
5001  });
5002  
5003  showdown.subParser('makeMarkdown.blockquote', function (node, globals) {
5004    'use strict';
5005  
5006    var txt = '';
5007    if (node.hasChildNodes()) {
5008      var children = node.childNodes,
5009          childrenLength = children.length;
5010  
5011      for (var i = 0; i < childrenLength; ++i) {
5012        var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], globals);
5013  
5014        if (innerTxt === '') {
5015          continue;
5016        }
5017        txt += innerTxt;
5018      }
5019    }
5020    // cleanup
5021    txt = txt.trim();
5022    txt = '> ' + txt.split('\n').join('\n> ');
5023    return txt;
5024  });
5025  
5026  showdown.subParser('makeMarkdown.codeBlock', function (node, globals) {
5027    'use strict';
5028  
5029    var lang = node.getAttribute('language'),
5030        num  = node.getAttribute('precodenum');
5031    return '```' + lang + '\n' + globals.preList[num] + '\n```';
5032  });
5033  
5034  showdown.subParser('makeMarkdown.codeSpan', function (node) {
5035    'use strict';
5036  
5037    return '`' + node.innerHTML + '`';
5038  });
5039  
5040  showdown.subParser('makeMarkdown.emphasis', function (node, globals) {
5041    'use strict';
5042  
5043    var txt = '';
5044    if (node.hasChildNodes()) {
5045      txt += '*';
5046      var children = node.childNodes,
5047          childrenLength = children.length;
5048      for (var i = 0; i < childrenLength; ++i) {
5049        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5050      }
5051      txt += '*';
5052    }
5053    return txt;
5054  });
5055  
5056  showdown.subParser('makeMarkdown.header', function (node, globals, headerLevel) {
5057    'use strict';
5058  
5059    var headerMark = new Array(headerLevel + 1).join('#'),
5060        txt = '';
5061  
5062    if (node.hasChildNodes()) {
5063      txt = headerMark + ' ';
5064      var children = node.childNodes,
5065          childrenLength = children.length;
5066  
5067      for (var i = 0; i < childrenLength; ++i) {
5068        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5069      }
5070    }
5071    return txt;
5072  });
5073  
5074  showdown.subParser('makeMarkdown.hr', function () {
5075    'use strict';
5076  
5077    return '---';
5078  });
5079  
5080  showdown.subParser('makeMarkdown.image', function (node) {
5081    'use strict';
5082  
5083    var txt = '';
5084    if (node.hasAttribute('src')) {
5085      txt += '![' + node.getAttribute('alt') + '](';
5086      txt += '<' + node.getAttribute('src') + '>';
5087      if (node.hasAttribute('width') && node.hasAttribute('height')) {
5088        txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height');
5089      }
5090  
5091      if (node.hasAttribute('title')) {
5092        txt += ' "' + node.getAttribute('title') + '"';
5093      }
5094      txt += ')';
5095    }
5096    return txt;
5097  });
5098  
5099  showdown.subParser('makeMarkdown.links', function (node, globals) {
5100    'use strict';
5101  
5102    var txt = '';
5103    if (node.hasChildNodes() && node.hasAttribute('href')) {
5104      var children = node.childNodes,
5105          childrenLength = children.length;
5106      txt = '[';
5107      for (var i = 0; i < childrenLength; ++i) {
5108        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5109      }
5110      txt += '](';
5111      txt += '<' + node.getAttribute('href') + '>';
5112      if (node.hasAttribute('title')) {
5113        txt += ' "' + node.getAttribute('title') + '"';
5114      }
5115      txt += ')';
5116    }
5117    return txt;
5118  });
5119  
5120  showdown.subParser('makeMarkdown.list', function (node, globals, type) {
5121    'use strict';
5122  
5123    var txt = '';
5124    if (!node.hasChildNodes()) {
5125      return '';
5126    }
5127    var listItems       = node.childNodes,
5128        listItemsLenght = listItems.length,
5129        listNum = node.getAttribute('start') || 1;
5130  
5131    for (var i = 0; i < listItemsLenght; ++i) {
5132      if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') {
5133        continue;
5134      }
5135  
5136      // define the bullet to use in list
5137      var bullet = '';
5138      if (type === 'ol') {
5139        bullet = listNum.toString() + '. ';
5140      } else {
5141        bullet = '- ';
5142      }
5143  
5144      // parse list item
5145      txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], globals);
5146      ++listNum;
5147    }
5148  
5149    // add comment at the end to prevent consecutive lists to be parsed as one
5150    txt += '\n<!-- -->\n';
5151    return txt.trim();
5152  });
5153  
5154  showdown.subParser('makeMarkdown.listItem', function (node, globals) {
5155    'use strict';
5156  
5157    var listItemTxt = '';
5158  
5159    var children = node.childNodes,
5160        childrenLenght = children.length;
5161  
5162    for (var i = 0; i < childrenLenght; ++i) {
5163      listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5164    }
5165    // if it's only one liner, we need to add a newline at the end
5166    if (!/\n$/.test(listItemTxt)) {
5167      listItemTxt += '\n';
5168    } else {
5169      // it's multiparagraph, so we need to indent
5170      listItemTxt = listItemTxt
5171        .split('\n')
5172        .join('\n    ')
5173        .replace(/^ {4}$/gm, '')
5174        .replace(/\n\n+/g, '\n\n');
5175    }
5176  
5177    return listItemTxt;
5178  });
5179  
5180  
5181  
5182  showdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) {
5183    'use strict';
5184  
5185    spansOnly = spansOnly || false;
5186  
5187    var txt = '';
5188  
5189    // edge case of text without wrapper paragraph
5190    if (node.nodeType === 3) {
5191      return showdown.subParser('makeMarkdown.txt')(node, globals);
5192    }
5193  
5194    // HTML comment
5195    if (node.nodeType === 8) {
5196      return '<!--' + node.data + '-->\n\n';
5197    }
5198  
5199    // process only node elements
5200    if (node.nodeType !== 1) {
5201      return '';
5202    }
5203  
5204    var tagName = node.tagName.toLowerCase();
5205  
5206    switch (tagName) {
5207  
5208      //
5209      // BLOCKS
5210      //
5211      case 'h1':
5212        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 1) + '\n\n'; }
5213        break;
5214      case 'h2':
5215        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 2) + '\n\n'; }
5216        break;
5217      case 'h3':
5218        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 3) + '\n\n'; }
5219        break;
5220      case 'h4':
5221        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 4) + '\n\n'; }
5222        break;
5223      case 'h5':
5224        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 5) + '\n\n'; }
5225        break;
5226      case 'h6':
5227        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 6) + '\n\n'; }
5228        break;
5229  
5230      case 'p':
5231        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, globals) + '\n\n'; }
5232        break;
5233  
5234      case 'blockquote':
5235        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, globals) + '\n\n'; }
5236        break;
5237  
5238      case 'hr':
5239        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, globals) + '\n\n'; }
5240        break;
5241  
5242      case 'ol':
5243        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ol') + '\n\n'; }
5244        break;
5245  
5246      case 'ul':
5247        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ul') + '\n\n'; }
5248        break;
5249  
5250      case 'precode':
5251        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, globals) + '\n\n'; }
5252        break;
5253  
5254      case 'pre':
5255        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, globals) + '\n\n'; }
5256        break;
5257  
5258      case 'table':
5259        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, globals) + '\n\n'; }
5260        break;
5261  
5262      //
5263      // SPANS
5264      //
5265      case 'code':
5266        txt = showdown.subParser('makeMarkdown.codeSpan')(node, globals);
5267        break;
5268  
5269      case 'em':
5270      case 'i':
5271        txt = showdown.subParser('makeMarkdown.emphasis')(node, globals);
5272        break;
5273  
5274      case 'strong':
5275      case 'b':
5276        txt = showdown.subParser('makeMarkdown.strong')(node, globals);
5277        break;
5278  
5279      case 'del':
5280        txt = showdown.subParser('makeMarkdown.strikethrough')(node, globals);
5281        break;
5282  
5283      case 'a':
5284        txt = showdown.subParser('makeMarkdown.links')(node, globals);
5285        break;
5286  
5287      case 'img':
5288        txt = showdown.subParser('makeMarkdown.image')(node, globals);
5289        break;
5290  
5291      default:
5292        txt = node.outerHTML + '\n\n';
5293    }
5294  
5295    // common normalization
5296    // TODO eventually
5297  
5298    return txt;
5299  });
5300  
5301  showdown.subParser('makeMarkdown.paragraph', function (node, globals) {
5302    'use strict';
5303  
5304    var txt = '';
5305    if (node.hasChildNodes()) {
5306      var children = node.childNodes,
5307          childrenLength = children.length;
5308      for (var i = 0; i < childrenLength; ++i) {
5309        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5310      }
5311    }
5312  
5313    // some text normalization
5314    txt = txt.trim();
5315  
5316    return txt;
5317  });
5318  
5319  showdown.subParser('makeMarkdown.pre', function (node, globals) {
5320    'use strict';
5321  
5322    var num  = node.getAttribute('prenum');
5323    return '<pre>' + globals.preList[num] + '</pre>';
5324  });
5325  
5326  showdown.subParser('makeMarkdown.strikethrough', function (node, globals) {
5327    'use strict';
5328  
5329    var txt = '';
5330    if (node.hasChildNodes()) {
5331      txt += '~~';
5332      var children = node.childNodes,
5333          childrenLength = children.length;
5334      for (var i = 0; i < childrenLength; ++i) {
5335        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5336      }
5337      txt += '~~';
5338    }
5339    return txt;
5340  });
5341  
5342  showdown.subParser('makeMarkdown.strong', function (node, globals) {
5343    'use strict';
5344  
5345    var txt = '';
5346    if (node.hasChildNodes()) {
5347      txt += '**';
5348      var children = node.childNodes,
5349          childrenLength = children.length;
5350      for (var i = 0; i < childrenLength; ++i) {
5351        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5352      }
5353      txt += '**';
5354    }
5355    return txt;
5356  });
5357  
5358  showdown.subParser('makeMarkdown.table', function (node, globals) {
5359    'use strict';
5360  
5361    var txt = '',
5362        tableArray = [[], []],
5363        headings   = node.querySelectorAll('thead>tr>th'),
5364        rows       = node.querySelectorAll('tbody>tr'),
5365        i, ii;
5366    for (i = 0; i < headings.length; ++i) {
5367      var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals),
5368          allign = '---';
5369  
5370      if (headings[i].hasAttribute('style')) {
5371        var style = headings[i].getAttribute('style').toLowerCase().replace(/\s/g, '');
5372        switch (style) {
5373          case 'text-align:left;':
5374            allign = ':---';
5375            break;
5376          case 'text-align:right;':
5377            allign = '---:';
5378            break;
5379          case 'text-align:center;':
5380            allign = ':---:';
5381            break;
5382        }
5383      }
5384      tableArray[0][i] = headContent.trim();
5385      tableArray[1][i] = allign;
5386    }
5387  
5388    for (i = 0; i < rows.length; ++i) {
5389      var r = tableArray.push([]) - 1,
5390          cols = rows[i].getElementsByTagName('td');
5391  
5392      for (ii = 0; ii < headings.length; ++ii) {
5393        var cellContent = ' ';
5394        if (typeof cols[ii] !== 'undefined') {
5395          cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals);
5396        }
5397        tableArray[r].push(cellContent);
5398      }
5399    }
5400  
5401    var cellSpacesCount = 3;
5402    for (i = 0; i < tableArray.length; ++i) {
5403      for (ii = 0; ii < tableArray[i].length; ++ii) {
5404        var strLen = tableArray[i][ii].length;
5405        if (strLen > cellSpacesCount) {
5406          cellSpacesCount = strLen;
5407        }
5408      }
5409    }
5410  
5411    for (i = 0; i < tableArray.length; ++i) {
5412      for (ii = 0; ii < tableArray[i].length; ++ii) {
5413        if (i === 1) {
5414          if (tableArray[i][ii].slice(-1) === ':') {
5415            tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':';
5416          } else {
5417            tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');
5418          }
5419        } else {
5420          tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);
5421        }
5422      }
5423      txt += '| ' + tableArray[i].join(' | ') + ' |\n';
5424    }
5425  
5426    return txt.trim();
5427  });
5428  
5429  showdown.subParser('makeMarkdown.tableCell', function (node, globals) {
5430    'use strict';
5431  
5432    var txt = '';
5433    if (!node.hasChildNodes()) {
5434      return '';
5435    }
5436    var children = node.childNodes,
5437        childrenLength = children.length;
5438  
5439    for (var i = 0; i < childrenLength; ++i) {
5440      txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true);
5441    }
5442    return txt.trim();
5443  });
5444  
5445  showdown.subParser('makeMarkdown.txt', function (node) {
5446    'use strict';
5447  
5448    var txt = node.nodeValue;
5449  
5450    // multiple spaces are collapsed
5451    txt = txt.replace(/ +/g, ' ');
5452  
5453    // replace the custom ¨NBSP; with a space
5454    txt = txt.replace(/¨NBSP;/g, ' ');
5455  
5456    // ", <, > and & should replace escaped html entities
5457    txt = showdown.helper.unescapeHTMLEntities(txt);
5458  
5459    // escape markdown magic characters
5460    // emphasis, strong and strikethrough - can appear everywhere
5461    // we also escape pipe (|) because of tables
5462    // and escape ` because of code blocks and spans
5463    txt = txt.replace(/([*_~|`])/g, '\\$1');
5464  
5465    // escape > because of blockquotes
5466    txt = txt.replace(/^(\s*)>/g, '\\$1>');
5467  
5468    // hash character, only troublesome at the beginning of a line because of headers
5469    txt = txt.replace(/^#/gm, '\\#');
5470  
5471    // horizontal rules
5472    txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, '$1\\$2$3');
5473  
5474    // dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer
5475    txt = txt.replace(/^( {0,3}\d+)\./gm, '$1\\.');
5476  
5477    // +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)
5478    txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\$2');
5479  
5480    // images and links, ] followed by ( is problematic, so we escape it
5481    txt = txt.replace(/]([\s]*)\(/g, '\\]$1\\(');
5482  
5483    // reference URIs must also be escaped
5484    txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, '\\[$1]:');
5485  
5486    return txt;
5487  });
5488  
5489  var root = this;
5490  
5491  // AMD Loader
5492  if (true) {
5493    !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
5494      'use strict';
5495      return showdown;
5496    }).call(exports, __webpack_require__, exports, module),
5497                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
5498  
5499  // CommonJS/nodeJS Loader
5500  } else {}
5501  }).call(this);
5502  
5503  
5504  
5505  /***/ }),
5506  
5507  /***/ 27:
5508  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5509  
5510  "use strict";
5511  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
5512  /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
5513  
5514  function _unsupportedIterableToArray(o, minLen) {
5515    if (!o) return;
5516    if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
5517    var n = Object.prototype.toString.call(o).slice(8, -1);
5518    if (n === "Object" && o.constructor) n = o.constructor.name;
5519    if (n === "Map" || n === "Set") return Array.from(n);
5520    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
5521  }
5522  
5523  /***/ }),
5524  
5525  /***/ 28:
5526  /***/ (function(module, exports) {
5527  
5528  (function() { module.exports = this["wp"]["dom"]; }());
5529  
5530  /***/ }),
5531  
5532  /***/ 32:
5533  /***/ (function(module, exports) {
5534  
5535  (function() { module.exports = this["wp"]["hooks"]; }());
5536  
5537  /***/ }),
5538  
5539  /***/ 35:
5540  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5541  
5542  "use strict";
5543  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
5544  function _iterableToArray(iter) {
5545    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
5546  }
5547  
5548  /***/ }),
5549  
5550  /***/ 38:
5551  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5552  
5553  "use strict";
5554  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
5555  function _arrayWithHoles(arr) {
5556    if (Array.isArray(arr)) return arr;
5557  }
5558  
5559  /***/ }),
5560  
5561  /***/ 39:
5562  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5563  
5564  "use strict";
5565  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
5566  function _nonIterableRest() {
5567    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5568  }
5569  
5570  /***/ }),
5571  
5572  /***/ 4:
5573  /***/ (function(module, exports) {
5574  
5575  (function() { module.exports = this["wp"]["data"]; }());
5576  
5577  /***/ }),
5578  
5579  /***/ 40:
5580  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5581  
5582  "use strict";
5583  
5584  
5585  var LEAF_KEY, hasWeakMap;
5586  
5587  /**
5588   * Arbitrary value used as key for referencing cache object in WeakMap tree.
5589   *
5590   * @type {Object}
5591   */
5592  LEAF_KEY = {};
5593  
5594  /**
5595   * Whether environment supports WeakMap.
5596   *
5597   * @type {boolean}
5598   */
5599  hasWeakMap = typeof WeakMap !== 'undefined';
5600  
5601  /**
5602   * Returns the first argument as the sole entry in an array.
5603   *
5604   * @param {*} value Value to return.
5605   *
5606   * @return {Array} Value returned as entry in array.
5607   */
5608  function arrayOf( value ) {
5609      return [ value ];
5610  }
5611  
5612  /**
5613   * Returns true if the value passed is object-like, or false otherwise. A value
5614   * is object-like if it can support property assignment, e.g. object or array.
5615   *
5616   * @param {*} value Value to test.
5617   *
5618   * @return {boolean} Whether value is object-like.
5619   */
5620  function isObjectLike( value ) {
5621      return !! value && 'object' === typeof value;
5622  }
5623  
5624  /**
5625   * Creates and returns a new cache object.
5626   *
5627   * @return {Object} Cache object.
5628   */
5629  function createCache() {
5630      var cache = {
5631          clear: function() {
5632              cache.head = null;
5633          },
5634      };
5635  
5636      return cache;
5637  }
5638  
5639  /**
5640   * Returns true if entries within the two arrays are strictly equal by
5641   * reference from a starting index.
5642   *
5643   * @param {Array}  a         First array.
5644   * @param {Array}  b         Second array.
5645   * @param {number} fromIndex Index from which to start comparison.
5646   *
5647   * @return {boolean} Whether arrays are shallowly equal.
5648   */
5649  function isShallowEqual( a, b, fromIndex ) {
5650      var i;
5651  
5652      if ( a.length !== b.length ) {
5653          return false;
5654      }
5655  
5656      for ( i = fromIndex; i < a.length; i++ ) {
5657          if ( a[ i ] !== b[ i ] ) {
5658              return false;
5659          }
5660      }
5661  
5662      return true;
5663  }
5664  
5665  /**
5666   * Returns a memoized selector function. The getDependants function argument is
5667   * called before the memoized selector and is expected to return an immutable
5668   * reference or array of references on which the selector depends for computing
5669   * its own return value. The memoize cache is preserved only as long as those
5670   * dependant references remain the same. If getDependants returns a different
5671   * reference(s), the cache is cleared and the selector value regenerated.
5672   *
5673   * @param {Function} selector      Selector function.
5674   * @param {Function} getDependants Dependant getter returning an immutable
5675   *                                 reference or array of reference used in
5676   *                                 cache bust consideration.
5677   *
5678   * @return {Function} Memoized selector.
5679   */
5680  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
5681      var rootCache, getCache;
5682  
5683      // Use object source as dependant if getter not provided
5684      if ( ! getDependants ) {
5685          getDependants = arrayOf;
5686      }
5687  
5688      /**
5689       * Returns the root cache. If WeakMap is supported, this is assigned to the
5690       * root WeakMap cache set, otherwise it is a shared instance of the default
5691       * cache object.
5692       *
5693       * @return {(WeakMap|Object)} Root cache object.
5694       */
5695  	function getRootCache() {
5696          return rootCache;
5697      }
5698  
5699      /**
5700       * Returns the cache for a given dependants array. When possible, a WeakMap
5701       * will be used to create a unique cache for each set of dependants. This
5702       * is feasible due to the nature of WeakMap in allowing garbage collection
5703       * to occur on entries where the key object is no longer referenced. Since
5704       * WeakMap requires the key to be an object, this is only possible when the
5705       * dependant is object-like. The root cache is created as a hierarchy where
5706       * each top-level key is the first entry in a dependants set, the value a
5707       * WeakMap where each key is the next dependant, and so on. This continues
5708       * so long as the dependants are object-like. If no dependants are object-
5709       * like, then the cache is shared across all invocations.
5710       *
5711       * @see isObjectLike
5712       *
5713       * @param {Array} dependants Selector dependants.
5714       *
5715       * @return {Object} Cache object.
5716       */
5717  	function getWeakMapCache( dependants ) {
5718          var caches = rootCache,
5719              isUniqueByDependants = true,
5720              i, dependant, map, cache;
5721  
5722          for ( i = 0; i < dependants.length; i++ ) {
5723              dependant = dependants[ i ];
5724  
5725              // Can only compose WeakMap from object-like key.
5726              if ( ! isObjectLike( dependant ) ) {
5727                  isUniqueByDependants = false;
5728                  break;
5729              }
5730  
5731              // Does current segment of cache already have a WeakMap?
5732              if ( caches.has( dependant ) ) {
5733                  // Traverse into nested WeakMap.
5734                  caches = caches.get( dependant );
5735              } else {
5736                  // Create, set, and traverse into a new one.
5737                  map = new WeakMap();
5738                  caches.set( dependant, map );
5739                  caches = map;
5740              }
5741          }
5742  
5743          // We use an arbitrary (but consistent) object as key for the last item
5744          // in the WeakMap to serve as our running cache.
5745          if ( ! caches.has( LEAF_KEY ) ) {
5746              cache = createCache();
5747              cache.isUniqueByDependants = isUniqueByDependants;
5748              caches.set( LEAF_KEY, cache );
5749          }
5750  
5751          return caches.get( LEAF_KEY );
5752      }
5753  
5754      // Assign cache handler by availability of WeakMap
5755      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
5756  
5757      /**
5758       * Resets root memoization cache.
5759       */
5760  	function clear() {
5761          rootCache = hasWeakMap ? new WeakMap() : createCache();
5762      }
5763  
5764      // eslint-disable-next-line jsdoc/check-param-names
5765      /**
5766       * The augmented selector call, considering first whether dependants have
5767       * changed before passing it to underlying memoize function.
5768       *
5769       * @param {Object} source    Source object for derivation.
5770       * @param {...*}   extraArgs Additional arguments to pass to selector.
5771       *
5772       * @return {*} Selector result.
5773       */
5774  	function callSelector( /* source, ...extraArgs */ ) {
5775          var len = arguments.length,
5776              cache, node, i, args, dependants;
5777  
5778          // Create copy of arguments (avoid leaking deoptimization).
5779          args = new Array( len );
5780          for ( i = 0; i < len; i++ ) {
5781              args[ i ] = arguments[ i ];
5782          }
5783  
5784          dependants = getDependants.apply( null, args );
5785          cache = getCache( dependants );
5786  
5787          // If not guaranteed uniqueness by dependants (primitive type or lack
5788          // of WeakMap support), shallow compare against last dependants and, if
5789          // references have changed, destroy cache to recalculate result.
5790          if ( ! cache.isUniqueByDependants ) {
5791              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
5792                  cache.clear();
5793              }
5794  
5795              cache.lastDependants = dependants;
5796          }
5797  
5798          node = cache.head;
5799          while ( node ) {
5800              // Check whether node arguments match arguments
5801              if ( ! isShallowEqual( node.args, args, 1 ) ) {
5802                  node = node.next;
5803                  continue;
5804              }
5805  
5806              // At this point we can assume we've found a match
5807  
5808              // Surface matched node to head if not already
5809              if ( node !== cache.head ) {
5810                  // Adjust siblings to point to each other.
5811                  node.prev.next = node.next;
5812                  if ( node.next ) {
5813                      node.next.prev = node.prev;
5814                  }
5815  
5816                  node.next = cache.head;
5817                  node.prev = null;
5818                  cache.head.prev = node;
5819                  cache.head = node;
5820              }
5821  
5822              // Return immediately
5823              return node.val;
5824          }
5825  
5826          // No cached value found. Continue to insertion phase:
5827  
5828          node = {
5829              // Generate the result from original function
5830              val: selector.apply( null, args ),
5831          };
5832  
5833          // Avoid including the source object in the cache.
5834          args[ 0 ] = null;
5835          node.args = args;
5836  
5837          // Don't need to check whether node is already head, since it would
5838          // have been returned above already if it was
5839  
5840          // Shift existing head down list
5841          if ( cache.head ) {
5842              cache.head.prev = node;
5843              node.next = cache.head;
5844          }
5845  
5846          cache.head = node;
5847  
5848          return node.val;
5849      }
5850  
5851      callSelector.getDependants = getDependants;
5852      callSelector.clear = clear;
5853      clear();
5854  
5855      return callSelector;
5856  });
5857  
5858  
5859  /***/ }),
5860  
5861  /***/ 41:
5862  /***/ (function(module, exports) {
5863  
5864  (function() { module.exports = this["wp"]["blob"]; }());
5865  
5866  /***/ }),
5867  
5868  /***/ 425:
5869  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5870  
5871  "use strict";
5872  __webpack_require__.r(__webpack_exports__);
5873  var selectors_namespaceObject = {};
5874  __webpack_require__.r(selectors_namespaceObject);
5875  __webpack_require__.d(selectors_namespaceObject, "getBlockTypes", function() { return getBlockTypes; });
5876  __webpack_require__.d(selectors_namespaceObject, "getBlockType", function() { return getBlockType; });
5877  __webpack_require__.d(selectors_namespaceObject, "getBlockStyles", function() { return getBlockStyles; });
5878  __webpack_require__.d(selectors_namespaceObject, "getBlockVariations", function() { return getBlockVariations; });
5879  __webpack_require__.d(selectors_namespaceObject, "getDefaultBlockVariation", function() { return getDefaultBlockVariation; });
5880  __webpack_require__.d(selectors_namespaceObject, "getCategories", function() { return getCategories; });
5881  __webpack_require__.d(selectors_namespaceObject, "getCollections", function() { return getCollections; });
5882  __webpack_require__.d(selectors_namespaceObject, "getDefaultBlockName", function() { return getDefaultBlockName; });
5883  __webpack_require__.d(selectors_namespaceObject, "getFreeformFallbackBlockName", function() { return getFreeformFallbackBlockName; });
5884  __webpack_require__.d(selectors_namespaceObject, "getUnregisteredFallbackBlockName", function() { return getUnregisteredFallbackBlockName; });
5885  __webpack_require__.d(selectors_namespaceObject, "getGroupingBlockName", function() { return getGroupingBlockName; });
5886  __webpack_require__.d(selectors_namespaceObject, "getChildBlockNames", function() { return selectors_getChildBlockNames; });
5887  __webpack_require__.d(selectors_namespaceObject, "getBlockSupport", function() { return selectors_getBlockSupport; });
5888  __webpack_require__.d(selectors_namespaceObject, "hasBlockSupport", function() { return hasBlockSupport; });
5889  __webpack_require__.d(selectors_namespaceObject, "isMatchingSearchTerm", function() { return isMatchingSearchTerm; });
5890  __webpack_require__.d(selectors_namespaceObject, "hasChildBlocks", function() { return selectors_hasChildBlocks; });
5891  __webpack_require__.d(selectors_namespaceObject, "hasChildBlocksWithInserterSupport", function() { return selectors_hasChildBlocksWithInserterSupport; });
5892  var actions_namespaceObject = {};
5893  __webpack_require__.r(actions_namespaceObject);
5894  __webpack_require__.d(actions_namespaceObject, "addBlockTypes", function() { return addBlockTypes; });
5895  __webpack_require__.d(actions_namespaceObject, "removeBlockTypes", function() { return removeBlockTypes; });
5896  __webpack_require__.d(actions_namespaceObject, "addBlockStyles", function() { return addBlockStyles; });
5897  __webpack_require__.d(actions_namespaceObject, "removeBlockStyles", function() { return removeBlockStyles; });
5898  __webpack_require__.d(actions_namespaceObject, "addBlockVariations", function() { return addBlockVariations; });
5899  __webpack_require__.d(actions_namespaceObject, "removeBlockVariations", function() { return removeBlockVariations; });
5900  __webpack_require__.d(actions_namespaceObject, "setDefaultBlockName", function() { return setDefaultBlockName; });
5901  __webpack_require__.d(actions_namespaceObject, "setFreeformFallbackBlockName", function() { return setFreeformFallbackBlockName; });
5902  __webpack_require__.d(actions_namespaceObject, "setUnregisteredFallbackBlockName", function() { return setUnregisteredFallbackBlockName; });
5903  __webpack_require__.d(actions_namespaceObject, "setGroupingBlockName", function() { return setGroupingBlockName; });
5904  __webpack_require__.d(actions_namespaceObject, "setCategories", function() { return setCategories; });
5905  __webpack_require__.d(actions_namespaceObject, "updateCategory", function() { return updateCategory; });
5906  __webpack_require__.d(actions_namespaceObject, "addBlockCollection", function() { return addBlockCollection; });
5907  __webpack_require__.d(actions_namespaceObject, "removeBlockCollection", function() { return removeBlockCollection; });
5908  
5909  // EXTERNAL MODULE: external {"this":["wp","data"]}
5910  var external_this_wp_data_ = __webpack_require__(4);
5911  
5912  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
5913  var toConsumableArray = __webpack_require__(18);
5914  
5915  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
5916  var defineProperty = __webpack_require__(5);
5917  
5918  // EXTERNAL MODULE: external {"this":"lodash"}
5919  var external_this_lodash_ = __webpack_require__(2);
5920  
5921  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
5922  var external_this_wp_i18n_ = __webpack_require__(1);
5923  
5924  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/reducer.js
5925  
5926  
5927  
5928  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
5929  
5930  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
5931  
5932  /**
5933   * External dependencies
5934   */
5935  
5936  /**
5937   * WordPress dependencies
5938   */
5939  
5940  
5941  
5942  /**
5943   * Module Constants
5944   */
5945  
5946  var DEFAULT_CATEGORIES = [{
5947    slug: 'common',
5948    title: Object(external_this_wp_i18n_["__"])('Common blocks')
5949  }, {
5950    slug: 'formatting',
5951    title: Object(external_this_wp_i18n_["__"])('Formatting')
5952  }, {
5953    slug: 'layout',
5954    title: Object(external_this_wp_i18n_["__"])('Layout elements')
5955  }, {
5956    slug: 'widgets',
5957    title: Object(external_this_wp_i18n_["__"])('Widgets')
5958  }, {
5959    slug: 'embed',
5960    title: Object(external_this_wp_i18n_["__"])('Embeds')
5961  }, {
5962    slug: 'reusable',
5963    title: Object(external_this_wp_i18n_["__"])('Reusable blocks')
5964  }];
5965  /**
5966   * Reducer managing the block types
5967   *
5968   * @param {Object} state  Current state.
5969   * @param {Object} action Dispatched action.
5970   *
5971   * @return {Object} Updated state.
5972   */
5973  
5974  function reducer_blockTypes() {
5975    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5976    var action = arguments.length > 1 ? arguments[1] : undefined;
5977  
5978    switch (action.type) {
5979      case 'ADD_BLOCK_TYPES':
5980        return _objectSpread({}, state, {}, Object(external_this_lodash_["keyBy"])(Object(external_this_lodash_["map"])(action.blockTypes, function (blockType) {
5981          return Object(external_this_lodash_["omit"])(blockType, 'styles ');
5982        }), 'name'));
5983  
5984      case 'REMOVE_BLOCK_TYPES':
5985        return Object(external_this_lodash_["omit"])(state, action.names);
5986    }
5987  
5988    return state;
5989  }
5990  /**
5991   * Reducer managing the block style variations.
5992   *
5993   * @param {Object} state  Current state.
5994   * @param {Object} action Dispatched action.
5995   *
5996   * @return {Object} Updated state.
5997   */
5998  
5999  function blockStyles() {
6000    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6001    var action = arguments.length > 1 ? arguments[1] : undefined;
6002  
6003    switch (action.type) {
6004      case 'ADD_BLOCK_TYPES':
6005        return _objectSpread({}, state, {}, Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["keyBy"])(action.blockTypes, 'name'), function (blockType) {
6006          return Object(external_this_lodash_["uniqBy"])([].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(blockType, ['styles'], [])), Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(state, [blockType.name], []))), function (style) {
6007            return style.name;
6008          });
6009        }));
6010  
6011      case 'ADD_BLOCK_STYLES':
6012        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["uniqBy"])([].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(state, [action.blockName], [])), Object(toConsumableArray["a" /* default */])(action.styles)), function (style) {
6013          return style.name;
6014        })));
6015  
6016      case 'REMOVE_BLOCK_STYLES':
6017        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["filter"])(Object(external_this_lodash_["get"])(state, [action.blockName], []), function (style) {
6018          return action.styleNames.indexOf(style.name) === -1;
6019        })));
6020    }
6021  
6022    return state;
6023  }
6024  /**
6025   * Reducer managing the block variations.
6026   *
6027   * @param {Object} state  Current state.
6028   * @param {Object} action Dispatched action.
6029   *
6030   * @return {Object} Updated state.
6031   */
6032  
6033  function blockVariations() {
6034    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6035    var action = arguments.length > 1 ? arguments[1] : undefined;
6036  
6037    switch (action.type) {
6038      case 'ADD_BLOCK_TYPES':
6039        return _objectSpread({}, state, {}, Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["keyBy"])(action.blockTypes, 'name'), function (blockType) {
6040          return Object(external_this_lodash_["uniqBy"])([].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(blockType, ['variations'], [])), Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(state, [blockType.name], []))), function (variation) {
6041            return variation.name;
6042          });
6043        }));
6044  
6045      case 'ADD_BLOCK_VARIATIONS':
6046        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["uniqBy"])([].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(state, [action.blockName], [])), Object(toConsumableArray["a" /* default */])(action.variations)), function (variation) {
6047          return variation.name;
6048        })));
6049  
6050      case 'REMOVE_BLOCK_VARIATIONS':
6051        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["filter"])(Object(external_this_lodash_["get"])(state, [action.blockName], []), function (variation) {
6052          return action.variationNames.indexOf(variation.name) === -1;
6053        })));
6054    }
6055  
6056    return state;
6057  }
6058  /**
6059   * Higher-order Reducer creating a reducer keeping track of given block name.
6060   *
6061   * @param {string} setActionType  Action type.
6062   *
6063   * @return {Function} Reducer.
6064   */
6065  
6066  function createBlockNameSetterReducer(setActionType) {
6067    return function () {
6068      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
6069      var action = arguments.length > 1 ? arguments[1] : undefined;
6070  
6071      switch (action.type) {
6072        case 'REMOVE_BLOCK_TYPES':
6073          if (action.names.indexOf(state) !== -1) {
6074            return null;
6075          }
6076  
6077          return state;
6078  
6079        case setActionType:
6080          return action.name || null;
6081      }
6082  
6083      return state;
6084    };
6085  }
6086  var reducer_defaultBlockName = createBlockNameSetterReducer('SET_DEFAULT_BLOCK_NAME');
6087  var freeformFallbackBlockName = createBlockNameSetterReducer('SET_FREEFORM_FALLBACK_BLOCK_NAME');
6088  var unregisteredFallbackBlockName = createBlockNameSetterReducer('SET_UNREGISTERED_FALLBACK_BLOCK_NAME');
6089  var groupingBlockName = createBlockNameSetterReducer('SET_GROUPING_BLOCK_NAME');
6090  /**
6091   * Reducer managing the categories
6092   *
6093   * @param {Object} state  Current state.
6094   * @param {Object} action Dispatched action.
6095   *
6096   * @return {Object} Updated state.
6097   */
6098  
6099  function reducer_categories() {
6100    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CATEGORIES;
6101    var action = arguments.length > 1 ? arguments[1] : undefined;
6102  
6103    switch (action.type) {
6104      case 'SET_CATEGORIES':
6105        return action.categories || [];
6106  
6107      case 'UPDATE_CATEGORY':
6108        {
6109          if (!action.category || Object(external_this_lodash_["isEmpty"])(action.category)) {
6110            return state;
6111          }
6112  
6113          var categoryToChange = Object(external_this_lodash_["find"])(state, ['slug', action.slug]);
6114  
6115          if (categoryToChange) {
6116            return Object(external_this_lodash_["map"])(state, function (category) {
6117              if (category.slug === action.slug) {
6118                return _objectSpread({}, category, {}, action.category);
6119              }
6120  
6121              return category;
6122            });
6123          }
6124        }
6125    }
6126  
6127    return state;
6128  }
6129  function collections() {
6130    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6131    var action = arguments.length > 1 ? arguments[1] : undefined;
6132  
6133    switch (action.type) {
6134      case 'ADD_BLOCK_COLLECTION':
6135        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.namespace, {
6136          title: action.title,
6137          icon: action.icon
6138        }));
6139  
6140      case 'REMOVE_BLOCK_COLLECTION':
6141        return Object(external_this_lodash_["omit"])(state, action.namespace);
6142    }
6143  
6144    return state;
6145  }
6146  /* harmony default export */ var reducer = (Object(external_this_wp_data_["combineReducers"])({
6147    blockTypes: reducer_blockTypes,
6148    blockStyles: blockStyles,
6149    blockVariations: blockVariations,
6150    defaultBlockName: reducer_defaultBlockName,
6151    freeformFallbackBlockName: freeformFallbackBlockName,
6152    unregisteredFallbackBlockName: unregisteredFallbackBlockName,
6153    groupingBlockName: groupingBlockName,
6154    categories: reducer_categories,
6155    collections: collections
6156  }));
6157  
6158  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
6159  var rememo = __webpack_require__(40);
6160  
6161  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/selectors.js
6162  
6163  
6164  function selectors_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
6165  
6166  function selectors_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { selectors_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { selectors_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6167  
6168  /**
6169   * External dependencies
6170   */
6171  
6172  
6173  /** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
6174  
6175  /** @typedef {import('../api/registration').WPBlockVariationScope} WPBlockVariationScope */
6176  
6177  /**
6178   * Given a block name or block type object, returns the corresponding
6179   * normalized block type object.
6180   *
6181   * @param {Object}          state      Blocks state.
6182   * @param {(string|Object)} nameOrType Block name or type object
6183   *
6184   * @return {Object} Block type object.
6185   */
6186  
6187  var getNormalizedBlockType = function getNormalizedBlockType(state, nameOrType) {
6188    return 'string' === typeof nameOrType ? getBlockType(state, nameOrType) : nameOrType;
6189  };
6190  /**
6191   * Returns all the available block types.
6192   *
6193   * @param {Object} state Data state.
6194   *
6195   * @return {Array} Block Types.
6196   */
6197  
6198  
6199  var getBlockTypes = Object(rememo["a" /* default */])(function (state) {
6200    return Object.values(state.blockTypes).map(function (blockType) {
6201      return selectors_objectSpread({}, blockType, {
6202        variations: getBlockVariations(state, blockType.name)
6203      });
6204    });
6205  }, function (state) {
6206    return [state.blockTypes, state.blockVariations];
6207  });
6208  /**
6209   * Returns a block type by name.
6210   *
6211   * @param {Object} state Data state.
6212   * @param {string} name Block type name.
6213   *
6214   * @return {Object?} Block Type.
6215   */
6216  
6217  function getBlockType(state, name) {
6218    return state.blockTypes[name];
6219  }
6220  /**
6221   * Returns block styles by block name.
6222   *
6223   * @param {Object} state Data state.
6224   * @param {string} name  Block type name.
6225   *
6226   * @return {Array?} Block Styles.
6227   */
6228  
6229  function getBlockStyles(state, name) {
6230    return state.blockStyles[name];
6231  }
6232  /**
6233   * Returns block variations by block name.
6234   *
6235   * @param {Object}                state     Data state.
6236   * @param {string}                blockName Block type name.
6237   * @param {WPBlockVariationScope} [scope]   Block variation scope name.
6238   *
6239   * @return {(WPBlockVariation[]|void)} Block variations.
6240   */
6241  
6242  function getBlockVariations(state, blockName, scope) {
6243    var variations = state.blockVariations[blockName];
6244  
6245    if (!variations || !scope) {
6246      return variations;
6247    }
6248  
6249    return variations.filter(function (variation) {
6250      return !variation.scope || variation.scope.includes(scope);
6251    });
6252  }
6253  /**
6254   * Returns the default block variation for the given block type.
6255   * When there are multiple variations annotated as the default one,
6256   * the last added item is picked. This simplifies registering overrides.
6257   * When there is no default variation set, it returns the first item.
6258   *
6259   * @param {Object}                state     Data state.
6260   * @param {string}                blockName Block type name.
6261   * @param {WPBlockVariationScope} [scope]   Block variation scope name.
6262   *
6263   * @return {?WPBlockVariation} The default block variation.
6264   */
6265  
6266  function getDefaultBlockVariation(state, blockName, scope) {
6267    var variations = getBlockVariations(state, blockName, scope);
6268    return Object(external_this_lodash_["findLast"])(variations, 'isDefault') || Object(external_this_lodash_["first"])(variations);
6269  }
6270  /**
6271   * Returns all the available categories.
6272   *
6273   * @param {Object} state Data state.
6274   *
6275   * @return {Array} Categories list.
6276   */
6277  
6278  function getCategories(state) {
6279    return state.categories;
6280  }
6281  /**
6282   * Returns all the available collections.
6283   *
6284   * @param {Object} state Data state.
6285   *
6286   * @return {Object} Collections list.
6287   */
6288  
6289  function getCollections(state) {
6290    return state.collections;
6291  }
6292  /**
6293   * Returns the name of the default block name.
6294   *
6295   * @param {Object} state Data state.
6296   *
6297   * @return {string?} Default block name.
6298   */
6299  
6300  function getDefaultBlockName(state) {
6301    return state.defaultBlockName;
6302  }
6303  /**
6304   * Returns the name of the block for handling non-block content.
6305   *
6306   * @param {Object} state Data state.
6307   *
6308   * @return {string?} Name of the block for handling non-block content.
6309   */
6310  
6311  function getFreeformFallbackBlockName(state) {
6312    return state.freeformFallbackBlockName;
6313  }
6314  /**
6315   * Returns the name of the block for handling unregistered blocks.
6316   *
6317   * @param {Object} state Data state.
6318   *
6319   * @return {string?} Name of the block for handling unregistered blocks.
6320   */
6321  
6322  function getUnregisteredFallbackBlockName(state) {
6323    return state.unregisteredFallbackBlockName;
6324  }
6325  /**
6326   * Returns the name of the block for handling unregistered blocks.
6327   *
6328   * @param {Object} state Data state.
6329   *
6330   * @return {string?} Name of the block for handling unregistered blocks.
6331   */
6332  
6333  function getGroupingBlockName(state) {
6334    return state.groupingBlockName;
6335  }
6336  /**
6337   * Returns an array with the child blocks of a given block.
6338   *
6339   * @param {Object} state     Data state.
6340   * @param {string} blockName Block type name.
6341   *
6342   * @return {Array} Array of child block names.
6343   */
6344  
6345  var selectors_getChildBlockNames = Object(rememo["a" /* default */])(function (state, blockName) {
6346    return Object(external_this_lodash_["map"])(Object(external_this_lodash_["filter"])(state.blockTypes, function (blockType) {
6347      return Object(external_this_lodash_["includes"])(blockType.parent, blockName);
6348    }), function (_ref) {
6349      var name = _ref.name;
6350      return name;
6351    });
6352  }, function (state) {
6353    return [state.blockTypes];
6354  });
6355  /**
6356   * Returns the block support value for a feature, if defined.
6357   *
6358   * @param  {Object}          state           Data state.
6359   * @param  {(string|Object)} nameOrType      Block name or type object
6360   * @param  {string}          feature         Feature to retrieve
6361   * @param  {*}               defaultSupports Default value to return if not
6362   *                                           explicitly defined
6363   *
6364   * @return {?*} Block support value
6365   */
6366  
6367  var selectors_getBlockSupport = function getBlockSupport(state, nameOrType, feature, defaultSupports) {
6368    var blockType = getNormalizedBlockType(state, nameOrType);
6369    return Object(external_this_lodash_["get"])(blockType, ['supports', feature], defaultSupports);
6370  };
6371  /**
6372   * Returns true if the block defines support for a feature, or false otherwise.
6373   *
6374   * @param  {Object}         state           Data state.
6375   * @param {(string|Object)} nameOrType      Block name or type object.
6376   * @param {string}          feature         Feature to test.
6377   * @param {boolean}         defaultSupports Whether feature is supported by
6378   *                                          default if not explicitly defined.
6379   *
6380   * @return {boolean} Whether block supports feature.
6381   */
6382  
6383  function hasBlockSupport(state, nameOrType, feature, defaultSupports) {
6384    return !!selectors_getBlockSupport(state, nameOrType, feature, defaultSupports);
6385  }
6386  /**
6387   * Returns true if the block type by the given name or object value matches a
6388   * search term, or false otherwise.
6389   *
6390   * @param {Object}          state      Blocks state.
6391   * @param {(string|Object)} nameOrType Block name or type object.
6392   * @param {string}          searchTerm Search term by which to filter.
6393   *
6394   * @return {Object[]} Whether block type matches search term.
6395   */
6396  
6397  function isMatchingSearchTerm(state, nameOrType, searchTerm) {
6398    var blockType = getNormalizedBlockType(state, nameOrType);
6399    var getNormalizedSearchTerm = Object(external_this_lodash_["flow"])([// Disregard diacritics.
6400    //  Input: "média"
6401    external_this_lodash_["deburr"], // Lowercase.
6402    //  Input: "MEDIA"
6403    function (term) {
6404      return term.toLowerCase();
6405    }, // Strip leading and trailing whitespace.
6406    //  Input: " media "
6407    function (term) {
6408      return term.trim();
6409    }]);
6410    var normalizedSearchTerm = getNormalizedSearchTerm(searchTerm);
6411    var isSearchMatch = Object(external_this_lodash_["flow"])([getNormalizedSearchTerm, function (normalizedCandidate) {
6412      return Object(external_this_lodash_["includes"])(normalizedCandidate, normalizedSearchTerm);
6413    }]);
6414    return isSearchMatch(blockType.title) || Object(external_this_lodash_["some"])(blockType.keywords, isSearchMatch) || isSearchMatch(blockType.category);
6415  }
6416  /**
6417   * Returns a boolean indicating if a block has child blocks or not.
6418   *
6419   * @param {Object} state     Data state.
6420   * @param {string} blockName Block type name.
6421   *
6422   * @return {boolean} True if a block contains child blocks and false otherwise.
6423   */
6424  
6425  var selectors_hasChildBlocks = function hasChildBlocks(state, blockName) {
6426    return selectors_getChildBlockNames(state, blockName).length > 0;
6427  };
6428  /**
6429   * Returns a boolean indicating if a block has at least one child block with inserter support.
6430   *
6431   * @param {Object} state     Data state.
6432   * @param {string} blockName Block type name.
6433   *
6434   * @return {boolean} True if a block contains at least one child blocks with inserter support
6435   *                   and false otherwise.
6436   */
6437  
6438  var selectors_hasChildBlocksWithInserterSupport = function hasChildBlocksWithInserterSupport(state, blockName) {
6439    return Object(external_this_lodash_["some"])(selectors_getChildBlockNames(state, blockName), function (childBlockName) {
6440      return hasBlockSupport(state, childBlockName, 'inserter', true);
6441    });
6442  };
6443  
6444  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/actions.js
6445  /**
6446   * External dependencies
6447   */
6448  
6449  /** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
6450  
6451  /**
6452   * Returns an action object used in signalling that block types have been added.
6453   *
6454   * @param {Array|Object} blockTypes Block types received.
6455   *
6456   * @return {Object} Action object.
6457   */
6458  
6459  function addBlockTypes(blockTypes) {
6460    return {
6461      type: 'ADD_BLOCK_TYPES',
6462      blockTypes: Object(external_this_lodash_["castArray"])(blockTypes)
6463    };
6464  }
6465  /**
6466   * Returns an action object used to remove a registered block type.
6467   *
6468   * @param {string|Array} names Block name.
6469   *
6470   * @return {Object} Action object.
6471   */
6472  
6473  function removeBlockTypes(names) {
6474    return {
6475      type: 'REMOVE_BLOCK_TYPES',
6476      names: Object(external_this_lodash_["castArray"])(names)
6477    };
6478  }
6479  /**
6480   * Returns an action object used in signalling that new block styles have been added.
6481   *
6482   * @param {string}       blockName  Block name.
6483   * @param {Array|Object} styles     Block styles.
6484   *
6485   * @return {Object} Action object.
6486   */
6487  
6488  function addBlockStyles(blockName, styles) {
6489    return {
6490      type: 'ADD_BLOCK_STYLES',
6491      styles: Object(external_this_lodash_["castArray"])(styles),
6492      blockName: blockName
6493    };
6494  }
6495  /**
6496   * Returns an action object used in signalling that block styles have been removed.
6497   *
6498   * @param {string}       blockName  Block name.
6499   * @param {Array|string} styleNames Block style names.
6500   *
6501   * @return {Object} Action object.
6502   */
6503  
6504  function removeBlockStyles(blockName, styleNames) {
6505    return {
6506      type: 'REMOVE_BLOCK_STYLES',
6507      styleNames: Object(external_this_lodash_["castArray"])(styleNames),
6508      blockName: blockName
6509    };
6510  }
6511  /**
6512   * Returns an action object used in signalling that new block variations have been added.
6513   *
6514   * @param {string}                              blockName  Block name.
6515   * @param {WPBlockVariation|WPBlockVariation[]} variations Block variations.
6516   *
6517   * @return {Object} Action object.
6518   */
6519  
6520  function addBlockVariations(blockName, variations) {
6521    return {
6522      type: 'ADD_BLOCK_VARIATIONS',
6523      variations: Object(external_this_lodash_["castArray"])(variations),
6524      blockName: blockName
6525    };
6526  }
6527  /**
6528   * Returns an action object used in signalling that block variations have been removed.
6529   *
6530   * @param {string}          blockName      Block name.
6531   * @param {string|string[]} variationNames Block variation names.
6532   *
6533   * @return {Object} Action object.
6534   */
6535  
6536  function removeBlockVariations(blockName, variationNames) {
6537    return {
6538      type: 'REMOVE_BLOCK_VARIATIONS',
6539      variationNames: Object(external_this_lodash_["castArray"])(variationNames),
6540      blockName: blockName
6541    };
6542  }
6543  /**
6544   * Returns an action object used to set the default block name.
6545   *
6546   * @param {string} name Block name.
6547   *
6548   * @return {Object} Action object.
6549   */
6550  
6551  function setDefaultBlockName(name) {
6552    return {
6553      type: 'SET_DEFAULT_BLOCK_NAME',
6554      name: name
6555    };
6556  }
6557  /**
6558   * Returns an action object used to set the name of the block used as a fallback
6559   * for non-block content.
6560   *
6561   * @param {string} name Block name.
6562   *
6563   * @return {Object} Action object.
6564   */
6565  
6566  function setFreeformFallbackBlockName(name) {
6567    return {
6568      type: 'SET_FREEFORM_FALLBACK_BLOCK_NAME',
6569      name: name
6570    };
6571  }
6572  /**
6573   * Returns an action object used to set the name of the block used as a fallback
6574   * for unregistered blocks.
6575   *
6576   * @param {string} name Block name.
6577   *
6578   * @return {Object} Action object.
6579   */
6580  
6581  function setUnregisteredFallbackBlockName(name) {
6582    return {
6583      type: 'SET_UNREGISTERED_FALLBACK_BLOCK_NAME',
6584      name: name
6585    };
6586  }
6587  /**
6588   * Returns an action object used to set the name of the block used
6589   * when grouping other blocks
6590   * eg: in "Group/Ungroup" interactions
6591   *
6592   * @param {string} name Block name.
6593   *
6594   * @return {Object} Action object.
6595   */
6596  
6597  function setGroupingBlockName(name) {
6598    return {
6599      type: 'SET_GROUPING_BLOCK_NAME',
6600      name: name
6601    };
6602  }
6603  /**
6604   * Returns an action object used to set block categories.
6605   *
6606   * @param {Object[]} categories Block categories.
6607   *
6608   * @return {Object} Action object.
6609   */
6610  
6611  function setCategories(categories) {
6612    return {
6613      type: 'SET_CATEGORIES',
6614      categories: categories
6615    };
6616  }
6617  /**
6618   * Returns an action object used to update a category.
6619   *
6620   * @param {string} slug     Block category slug.
6621   * @param {Object} category Object containing the category properties that should be updated.
6622   *
6623   * @return {Object} Action object.
6624   */
6625  
6626  function updateCategory(slug, category) {
6627    return {
6628      type: 'UPDATE_CATEGORY',
6629      slug: slug,
6630      category: category
6631    };
6632  }
6633  /**
6634   * Returns an action object used to add block collections
6635   *
6636   * @param {string} namespace       The namespace of the blocks to put in the collection
6637   * @param {string} title           The title to display in the block inserter
6638   * @param {Object} icon (optional) The icon to display in the block inserter
6639   *
6640   * @return {Object} Action object.
6641   */
6642  
6643  function addBlockCollection(namespace, title, icon) {
6644    return {
6645      type: 'ADD_BLOCK_COLLECTION',
6646      namespace: namespace,
6647      title: title,
6648      icon: icon
6649    };
6650  }
6651  /**
6652   * Returns an action object used to remove block collections
6653   *
6654   * @param {string} namespace       The namespace of the blocks to put in the collection
6655   *
6656   * @return {Object} Action object.
6657   */
6658  
6659  function removeBlockCollection(namespace) {
6660    return {
6661      type: 'REMOVE_BLOCK_COLLECTION',
6662      namespace: namespace
6663    };
6664  }
6665  
6666  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/index.js
6667  /**
6668   * WordPress dependencies
6669   */
6670  
6671  /**
6672   * Internal dependencies
6673   */
6674  
6675  
6676  
6677  
6678  Object(external_this_wp_data_["registerStore"])('core/blocks', {
6679    reducer: reducer,
6680    selectors: selectors_namespaceObject,
6681    actions: actions_namespaceObject
6682  });
6683  
6684  // EXTERNAL MODULE: ./node_modules/uuid/v4.js
6685  var v4 = __webpack_require__(83);
6686  var v4_default = /*#__PURE__*/__webpack_require__.n(v4);
6687  
6688  // EXTERNAL MODULE: external {"this":["wp","hooks"]}
6689  var external_this_wp_hooks_ = __webpack_require__(32);
6690  
6691  // EXTERNAL MODULE: ./node_modules/tinycolor2/tinycolor.js
6692  var tinycolor = __webpack_require__(54);
6693  var tinycolor_default = /*#__PURE__*/__webpack_require__.n(tinycolor);
6694  
6695  // EXTERNAL MODULE: external {"this":["wp","element"]}
6696  var external_this_wp_element_ = __webpack_require__(0);
6697  
6698  // EXTERNAL MODULE: external {"this":["wp","dom"]}
6699  var external_this_wp_dom_ = __webpack_require__(28);
6700  
6701  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/utils.js
6702  
6703  
6704  function utils_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
6705  
6706  function utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { utils_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6707  
6708  /**
6709   * External dependencies
6710   */
6711  
6712  
6713  /**
6714   * WordPress dependencies
6715   */
6716  
6717  
6718  
6719  
6720  /**
6721   * Internal dependencies
6722   */
6723  
6724  
6725  
6726  /**
6727   * Array of icon colors containing a color to be used if the icon color
6728   * was not explicitly set but the icon background color was.
6729   *
6730   * @type {Object}
6731   */
6732  
6733  var ICON_COLORS = ['#191e23', '#f8f9f9'];
6734  /**
6735   * Determines whether the block is a default block
6736   * and its attributes are equal to the default attributes
6737   * which means the block is unmodified.
6738   *
6739   * @param  {WPBlock} block Block Object
6740   *
6741   * @return {boolean}       Whether the block is an unmodified default block
6742   */
6743  
6744  function isUnmodifiedDefaultBlock(block) {
6745    var defaultBlockName = registration_getDefaultBlockName();
6746  
6747    if (block.name !== defaultBlockName) {
6748      return false;
6749    } // Cache a created default block if no cache exists or the default block
6750    // name changed.
6751  
6752  
6753    if (!isUnmodifiedDefaultBlock.block || isUnmodifiedDefaultBlock.block.name !== defaultBlockName) {
6754      isUnmodifiedDefaultBlock.block = createBlock(defaultBlockName);
6755    }
6756  
6757    var newDefaultBlock = isUnmodifiedDefaultBlock.block;
6758    var blockType = registration_getBlockType(defaultBlockName);
6759    return Object(external_this_lodash_["every"])(blockType.attributes, function (value, key) {
6760      return newDefaultBlock.attributes[key] === block.attributes[key];
6761    });
6762  }
6763  /**
6764   * Function that checks if the parameter is a valid icon.
6765   *
6766   * @param {*} icon  Parameter to be checked.
6767   *
6768   * @return {boolean} True if the parameter is a valid icon and false otherwise.
6769   */
6770  
6771  function isValidIcon(icon) {
6772    return !!icon && (Object(external_this_lodash_["isString"])(icon) || Object(external_this_wp_element_["isValidElement"])(icon) || Object(external_this_lodash_["isFunction"])(icon) || icon instanceof external_this_wp_element_["Component"]);
6773  }
6774  /**
6775   * Function that receives an icon as set by the blocks during the registration
6776   * and returns a new icon object that is normalized so we can rely on just on possible icon structure
6777   * in the codebase.
6778   *
6779   * @param {WPBlockTypeIconRender} icon Render behavior of a block type icon;
6780   *                                     one of a Dashicon slug, an element, or a
6781   *                                     component.
6782   *
6783   * @return {WPBlockTypeIconDescriptor} Object describing the icon.
6784   */
6785  
6786  function normalizeIconObject(icon) {
6787    if (isValidIcon(icon)) {
6788      return {
6789        src: icon
6790      };
6791    }
6792  
6793    if (Object(external_this_lodash_["has"])(icon, ['background'])) {
6794      var tinyBgColor = tinycolor_default()(icon.background);
6795      return utils_objectSpread({}, icon, {
6796        foreground: icon.foreground ? icon.foreground : Object(tinycolor["mostReadable"])(tinyBgColor, ICON_COLORS, {
6797          includeFallbackColors: true,
6798          level: 'AA',
6799          size: 'large'
6800        }).toHexString(),
6801        shadowColor: tinyBgColor.setAlpha(0.3).toRgbString()
6802      });
6803    }
6804  
6805    return icon;
6806  }
6807  /**
6808   * Normalizes block type passed as param. When string is passed then
6809   * it converts it to the matching block type object.
6810   * It passes the original object otherwise.
6811   *
6812   * @param {string|Object} blockTypeOrName  Block type or name.
6813   *
6814   * @return {?Object} Block type.
6815   */
6816  
6817  function normalizeBlockType(blockTypeOrName) {
6818    if (Object(external_this_lodash_["isString"])(blockTypeOrName)) {
6819      return registration_getBlockType(blockTypeOrName);
6820    }
6821  
6822    return blockTypeOrName;
6823  }
6824  /**
6825   * Get the label for the block, usually this is either the block title,
6826   * or the value of the block's `label` function when that's specified.
6827   *
6828   * @param {Object} blockType  The block type.
6829   * @param {Object} attributes The values of the block's attributes.
6830   * @param {Object} context    The intended use for the label.
6831   *
6832   * @return {string} The block label.
6833   */
6834  
6835  function getBlockLabel(blockType, attributes) {
6836    var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'visual';
6837    var getLabel = blockType.__experimentalLabel,
6838        title = blockType.title;
6839    var label = getLabel && getLabel(attributes, {
6840      context: context
6841    });
6842  
6843    if (!label) {
6844      return title;
6845    } // Strip any HTML (i.e. RichText formatting) before returning.
6846  
6847  
6848    return Object(external_this_wp_dom_["__unstableStripHTML"])(label);
6849  }
6850  /**
6851   * Get a label for the block for use by screenreaders, this is more descriptive
6852   * than the visual label and includes the block title and the value of the
6853   * `getLabel` function if it's specified.
6854   *
6855   * @param {Object}  blockType              The block type.
6856   * @param {Object}  attributes             The values of the block's attributes.
6857   * @param {?number} position               The position of the block in the block list.
6858   * @param {string}  [direction='vertical'] The direction of the block layout.
6859   *
6860   * @return {string} The block label.
6861   */
6862  
6863  function getAccessibleBlockLabel(blockType, attributes, position) {
6864    var direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'vertical';
6865    // `title` is already localized, `label` is a user-supplied value.
6866    var title = blockType.title;
6867    var label = getBlockLabel(blockType, attributes, 'accessibility');
6868    var hasPosition = position !== undefined; // getBlockLabel returns the block title as a fallback when there's no label,
6869    // if it did return the title, this function needs to avoid adding the
6870    // title twice within the accessible label. Use this `hasLabel` boolean to
6871    // handle that.
6872  
6873    var hasLabel = label && label !== title;
6874  
6875    if (hasPosition && direction === 'vertical') {
6876      if (hasLabel) {
6877        return Object(external_this_wp_i18n_["sprintf"])(
6878        /* translators: accessibility text. %1: The block title, %2: The block row number, %3: The block label.. */
6879        Object(external_this_wp_i18n_["__"])('%1$s Block. Row %2$d. %3$s'), title, position, label);
6880      }
6881  
6882      return Object(external_this_wp_i18n_["sprintf"])(
6883      /* translators: accessibility text. %s: The block title, %d The block row number. */
6884      Object(external_this_wp_i18n_["__"])('%s Block. Row %d'), title, position);
6885    } else if (hasPosition && direction === 'horizontal') {
6886      if (hasLabel) {
6887        return Object(external_this_wp_i18n_["sprintf"])(
6888        /* translators: accessibility text. %1: The block title, %2: The block column number, %3: The block label.. */
6889        Object(external_this_wp_i18n_["__"])('%1$s Block. Column %2$d. %3$s'), title, position, label);
6890      }
6891  
6892      return Object(external_this_wp_i18n_["sprintf"])(
6893      /* translators: accessibility text. %s: The block title, %d The block column number. */
6894      Object(external_this_wp_i18n_["__"])('%s Block. Column %d'), title, position);
6895    }
6896  
6897    if (hasLabel) {
6898      return Object(external_this_wp_i18n_["sprintf"])(
6899      /* translators: accessibility text. %1: The block title. %2: The block label. */
6900      Object(external_this_wp_i18n_["__"])('%1$s Block. %2$s'), title, label);
6901    }
6902  
6903    return Object(external_this_wp_i18n_["sprintf"])(
6904    /* translators: accessibility text. %s: The block title. */
6905    Object(external_this_wp_i18n_["__"])('%s Block'), title);
6906  }
6907  
6908  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/constants.js
6909  /**
6910   * Array of valid keys in a block type settings deprecation object.
6911   *
6912   * @type {string[]}
6913   */
6914  var DEPRECATED_ENTRY_KEYS = ['attributes', 'supports', 'save', 'migrate', 'isEligible'];
6915  
6916  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/registration.js
6917  
6918  
6919  function registration_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
6920  
6921  function registration_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { registration_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { registration_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6922  
6923  /* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */
6924  
6925  /**
6926   * External dependencies
6927   */
6928  
6929  /**
6930   * WordPress dependencies
6931   */
6932  
6933  
6934  
6935  /**
6936   * Internal dependencies
6937   */
6938  
6939  
6940  
6941  /**
6942   * An icon type definition. One of a Dashicon slug, an element,
6943   * or a component.
6944   *
6945   * @typedef {(string|WPElement|WPComponent)} WPIcon
6946   *
6947   * @see https://developer.wordpress.org/resource/dashicons/
6948   */
6949  
6950  /**
6951   * Render behavior of a block type icon; one of a Dashicon slug, an element,
6952   * or a component.
6953   *
6954   * @typedef {WPIcon} WPBlockTypeIconRender
6955   */
6956  
6957  /**
6958   * An object describing a normalized block type icon.
6959   *
6960   * @typedef {Object} WPBlockTypeIconDescriptor
6961   *
6962   * @property {WPBlockTypeIconRender} src         Render behavior of the icon,
6963   *                                               one of a Dashicon slug, an
6964   *                                               element, or a component.
6965   * @property {string}                background  Optimal background hex string
6966   *                                               color when displaying icon.
6967   * @property {string}                foreground  Optimal foreground hex string
6968   *                                               color when displaying icon.
6969   * @property {string}                shadowColor Optimal shadow hex string
6970   *                                               color when displaying icon.
6971   */
6972  
6973  /**
6974   * Value to use to render the icon for a block type in an editor interface,
6975   * either a Dashicon slug, an element, a component, or an object describing
6976   * the icon.
6977   *
6978   * @typedef {(WPBlockTypeIconDescriptor|WPBlockTypeIconRender)} WPBlockTypeIcon
6979   */
6980  
6981  /**
6982   * Named block variation scopes.
6983   *
6984   * @typedef {'block'|'inserter'} WPBlockVariationScope
6985   */
6986  
6987  /**
6988   * An object describing a variation defined for the block type.
6989   *
6990   * @typedef {Object} WPBlockVariation
6991   *
6992   * @property {string}   name                   The unique and machine-readable name.
6993   * @property {string}   title                  A human-readable variation title.
6994   * @property {string}   description            A detailed variation description.
6995   * @property {WPIcon}   [icon]                 An icon helping to visualize the variation.
6996   * @property {boolean}  [isDefault]            Indicates whether the current variation is
6997   *                                             the default one. Defaults to `false`.
6998   * @property {Object}   [attributes]           Values which override block attributes.
6999   * @property {Array[]}  [innerBlocks]          Initial configuration of nested blocks.
7000   * @property {Object}   [example]              Example provides structured data for
7001   *                                             the block preview. You can set to
7002   *                                             `undefined` to disable the preview shown
7003   *                                             for the block type.
7004   * @property {WPBlockVariationScope[]} [scope] The list of scopes where the variation
7005   *                                             is applicable. When not provided, it
7006   *                                             assumes all available scopes.
7007   */
7008  
7009  /**
7010   * Defined behavior of a block type.
7011   *
7012   * @typedef {Object} WPBlock
7013   *
7014   * @property {string}             name         Block type's namespaced name.
7015   * @property {string}             title        Human-readable block type label.
7016   * @property {string}             description  A detailed block type description.
7017   * @property {string}             category     Block type category classification,
7018   *                                             used in search interfaces to arrange
7019   *                                             block types by category.
7020   * @property {WPBlockTypeIcon}    [icon]       Block type icon.
7021   * @property {string[]}           [keywords]   Additional keywords to produce block
7022   *                                             type as result in search interfaces.
7023   * @property {Object}             [attributes] Block type attributes.
7024   * @property {WPComponent}        [save]       Optional component describing
7025   *                                             serialized markup structure of a
7026   *                                             block type.
7027   * @property {WPComponent}        edit         Component rendering an element to
7028   *                                             manipulate the attributes of a block
7029   *                                             in the context of an editor.
7030   * @property {WPBlockVariation[]} [variations] The list of block variations.
7031   * @property {Object}             [example]    Example provides structured data for
7032   *                                             the block preview. When not defined
7033   *                                             then no preview is shown.
7034   */
7035  
7036  /**
7037   * Default values to assign for omitted optional block type settings.
7038   *
7039   * @type {Object}
7040   */
7041  
7042  var DEFAULT_BLOCK_TYPE_SETTINGS = {
7043    icon: 'block-default',
7044    attributes: {},
7045    keywords: [],
7046    save: function save() {
7047      return null;
7048    }
7049  };
7050  var serverSideBlockDefinitions = {};
7051  /**
7052   * Sets the server side block definition of blocks.
7053   *
7054   * @param {Object} definitions Server-side block definitions
7055   */
7056  // eslint-disable-next-line camelcase
7057  
7058  function unstable__bootstrapServerSideBlockDefinitions(definitions) {
7059    serverSideBlockDefinitions = registration_objectSpread({}, serverSideBlockDefinitions, {}, definitions);
7060  }
7061  /**
7062   * Registers a new block provided a unique name and an object defining its
7063   * behavior. Once registered, the block is made available as an option to any
7064   * editor interface where blocks are implemented.
7065   *
7066   * @param {string} name     Block name.
7067   * @param {Object} settings Block settings.
7068   *
7069   * @return {?WPBlock} The block, if it has been successfully registered;
7070   *                    otherwise `undefined`.
7071   */
7072  
7073  function registerBlockType(name, settings) {
7074    settings = registration_objectSpread({
7075      name: name
7076    }, DEFAULT_BLOCK_TYPE_SETTINGS, {}, Object(external_this_lodash_["get"])(serverSideBlockDefinitions, name), {}, settings);
7077  
7078    if (typeof name !== 'string') {
7079      console.error('Block names must be strings.');
7080      return;
7081    }
7082  
7083    if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) {
7084      console.error('Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block');
7085      return;
7086    }
7087  
7088    if (Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name)) {
7089      console.error('Block "' + name + '" is already registered.');
7090      return;
7091    }
7092  
7093    var preFilterSettings = registration_objectSpread({}, settings);
7094  
7095    settings = Object(external_this_wp_hooks_["applyFilters"])('blocks.registerBlockType', settings, name);
7096  
7097    if (settings.deprecated) {
7098      settings.deprecated = settings.deprecated.map(function (deprecation) {
7099        return Object(external_this_lodash_["pick"])( // Only keep valid deprecation keys.
7100        Object(external_this_wp_hooks_["applyFilters"])('blocks.registerBlockType', // Merge deprecation keys with pre-filter settings
7101        // so that filters that depend on specific keys being
7102        // present don't fail.
7103        registration_objectSpread({}, Object(external_this_lodash_["omit"])(preFilterSettings, DEPRECATED_ENTRY_KEYS), {}, deprecation), name), DEPRECATED_ENTRY_KEYS);
7104      });
7105    }
7106  
7107    if (!Object(external_this_lodash_["isPlainObject"])(settings)) {
7108      console.error('Block settings must be a valid object.');
7109      return;
7110    }
7111  
7112    if (!Object(external_this_lodash_["isFunction"])(settings.save)) {
7113      console.error('The "save" property must be a valid function.');
7114      return;
7115    }
7116  
7117    if ('edit' in settings && !Object(external_this_lodash_["isFunction"])(settings.edit)) {
7118      console.error('The "edit" property must be a valid function.');
7119      return;
7120    }
7121  
7122    if (!('category' in settings)) {
7123      console.error('The block "' + name + '" must have a category.');
7124      return;
7125    }
7126  
7127    if ('category' in settings && !Object(external_this_lodash_["some"])(Object(external_this_wp_data_["select"])('core/blocks').getCategories(), {
7128      slug: settings.category
7129    })) {
7130      console.error('The block "' + name + '" must have a registered category.');
7131      return;
7132    }
7133  
7134    if (!('title' in settings) || settings.title === '') {
7135      console.error('The block "' + name + '" must have a title.');
7136      return;
7137    }
7138  
7139    if (typeof settings.title !== 'string') {
7140      console.error('Block titles must be strings.');
7141      return;
7142    }
7143  
7144    settings.icon = normalizeIconObject(settings.icon);
7145  
7146    if (!isValidIcon(settings.icon.src)) {
7147      console.error('The icon passed is invalid. ' + 'The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional');
7148      return;
7149    }
7150  
7151    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockTypes(settings);
7152    return settings;
7153  }
7154  /**
7155   * Registers a new block collection to group blocks in the same namespace in the inserter.
7156   *
7157   * @param {string} namespace The namespace to group blocks by in the inserter; corresponds to the block namespace
7158   * @param {Object} settings  An object composed of a title to show in the inserter, and an icon to show in the inserter
7159   *
7160   */
7161  
7162  function registerBlockCollection(namespace, _ref) {
7163    var title = _ref.title,
7164        icon = _ref.icon;
7165    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockCollection(namespace, title, icon);
7166  }
7167  /**
7168   * Unregisters a block collection
7169   *
7170   * @param {string} namespace The namespace to group blocks by in the inserter; corresponds to the block namespace
7171   *
7172   */
7173  
7174  function unregisterBlockCollection(namespace) {
7175    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockCollection(namespace);
7176  }
7177  /**
7178   * Unregisters a block.
7179   *
7180   * @param {string} name Block name.
7181   *
7182   * @return {?WPBlock} The previous block value, if it has been successfully
7183   *                    unregistered; otherwise `undefined`.
7184   */
7185  
7186  function unregisterBlockType(name) {
7187    var oldBlock = Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name);
7188  
7189    if (!oldBlock) {
7190      console.error('Block "' + name + '" is not registered.');
7191      return;
7192    }
7193  
7194    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockTypes(name);
7195    return oldBlock;
7196  }
7197  /**
7198   * Assigns name of block for handling non-block content.
7199   *
7200   * @param {string} blockName Block name.
7201   */
7202  
7203  function setFreeformContentHandlerName(blockName) {
7204    Object(external_this_wp_data_["dispatch"])('core/blocks').setFreeformFallbackBlockName(blockName);
7205  }
7206  /**
7207   * Retrieves name of block handling non-block content, or undefined if no
7208   * handler has been defined.
7209   *
7210   * @return {?string} Block name.
7211   */
7212  
7213  function getFreeformContentHandlerName() {
7214    return Object(external_this_wp_data_["select"])('core/blocks').getFreeformFallbackBlockName();
7215  }
7216  /**
7217   * Retrieves name of block used for handling grouping interactions.
7218   *
7219   * @return {?string} Block name.
7220   */
7221  
7222  function registration_getGroupingBlockName() {
7223    return Object(external_this_wp_data_["select"])('core/blocks').getGroupingBlockName();
7224  }
7225  /**
7226   * Assigns name of block handling unregistered block types.
7227   *
7228   * @param {string} blockName Block name.
7229   */
7230  
7231  function setUnregisteredTypeHandlerName(blockName) {
7232    Object(external_this_wp_data_["dispatch"])('core/blocks').setUnregisteredFallbackBlockName(blockName);
7233  }
7234  /**
7235   * Retrieves name of block handling unregistered block types, or undefined if no
7236   * handler has been defined.
7237   *
7238   * @return {?string} Block name.
7239   */
7240  
7241  function getUnregisteredTypeHandlerName() {
7242    return Object(external_this_wp_data_["select"])('core/blocks').getUnregisteredFallbackBlockName();
7243  }
7244  /**
7245   * Assigns the default block name.
7246   *
7247   * @param {string} name Block name.
7248   */
7249  
7250  function registration_setDefaultBlockName(name) {
7251    Object(external_this_wp_data_["dispatch"])('core/blocks').setDefaultBlockName(name);
7252  }
7253  /**
7254   * Assigns name of block for handling block grouping interactions.
7255   *
7256   * @param {string} name Block name.
7257   */
7258  
7259  function registration_setGroupingBlockName(name) {
7260    Object(external_this_wp_data_["dispatch"])('core/blocks').setGroupingBlockName(name);
7261  }
7262  /**
7263   * Retrieves the default block name.
7264   *
7265   * @return {?string} Block name.
7266   */
7267  
7268  function registration_getDefaultBlockName() {
7269    return Object(external_this_wp_data_["select"])('core/blocks').getDefaultBlockName();
7270  }
7271  /**
7272   * Returns a registered block type.
7273   *
7274   * @param {string} name Block name.
7275   *
7276   * @return {?Object} Block type.
7277   */
7278  
7279  function registration_getBlockType(name) {
7280    return Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name);
7281  }
7282  /**
7283   * Returns all registered blocks.
7284   *
7285   * @return {Array} Block settings.
7286   */
7287  
7288  function registration_getBlockTypes() {
7289    return Object(external_this_wp_data_["select"])('core/blocks').getBlockTypes();
7290  }
7291  /**
7292   * Returns the block support value for a feature, if defined.
7293   *
7294   * @param  {(string|Object)} nameOrType      Block name or type object
7295   * @param  {string}          feature         Feature to retrieve
7296   * @param  {*}               defaultSupports Default value to return if not
7297   *                                           explicitly defined
7298   *
7299   * @return {?*} Block support value
7300   */
7301  
7302  function registration_getBlockSupport(nameOrType, feature, defaultSupports) {
7303    return Object(external_this_wp_data_["select"])('core/blocks').getBlockSupport(nameOrType, feature, defaultSupports);
7304  }
7305  /**
7306   * Returns true if the block defines support for a feature, or false otherwise.
7307   *
7308   * @param {(string|Object)} nameOrType      Block name or type object.
7309   * @param {string}          feature         Feature to test.
7310   * @param {boolean}         defaultSupports Whether feature is supported by
7311   *                                          default if not explicitly defined.
7312   *
7313   * @return {boolean} Whether block supports feature.
7314   */
7315  
7316  function registration_hasBlockSupport(nameOrType, feature, defaultSupports) {
7317    return Object(external_this_wp_data_["select"])('core/blocks').hasBlockSupport(nameOrType, feature, defaultSupports);
7318  }
7319  /**
7320   * Determines whether or not the given block is a reusable block. This is a
7321   * special block type that is used to point to a global block stored via the
7322   * API.
7323   *
7324   * @param {Object} blockOrType Block or Block Type to test.
7325   *
7326   * @return {boolean} Whether the given block is a reusable block.
7327   */
7328  
7329  function isReusableBlock(blockOrType) {
7330    return blockOrType.name === 'core/block';
7331  }
7332  /**
7333   * Returns an array with the child blocks of a given block.
7334   *
7335   * @param {string} blockName Name of block (example: “latest-posts”).
7336   *
7337   * @return {Array} Array of child block names.
7338   */
7339  
7340  var registration_getChildBlockNames = function getChildBlockNames(blockName) {
7341    return Object(external_this_wp_data_["select"])('core/blocks').getChildBlockNames(blockName);
7342  };
7343  /**
7344   * Returns a boolean indicating if a block has child blocks or not.
7345   *
7346   * @param {string} blockName Name of block (example: “latest-posts”).
7347   *
7348   * @return {boolean} True if a block contains child blocks and false otherwise.
7349   */
7350  
7351  var registration_hasChildBlocks = function hasChildBlocks(blockName) {
7352    return Object(external_this_wp_data_["select"])('core/blocks').hasChildBlocks(blockName);
7353  };
7354  /**
7355   * Returns a boolean indicating if a block has at least one child block with inserter support.
7356   *
7357   * @param {string} blockName Block type name.
7358   *
7359   * @return {boolean} True if a block contains at least one child blocks with inserter support
7360   *                   and false otherwise.
7361   */
7362  
7363  var registration_hasChildBlocksWithInserterSupport = function hasChildBlocksWithInserterSupport(blockName) {
7364    return Object(external_this_wp_data_["select"])('core/blocks').hasChildBlocksWithInserterSupport(blockName);
7365  };
7366  /**
7367   * Registers a new block style variation for the given block.
7368   *
7369   * @param {string} blockName      Name of block (example: “core/latest-posts”).
7370   * @param {Object} styleVariation Object containing `name` which is the class name applied to the block and `label` which identifies the variation to the user.
7371   */
7372  
7373  var registration_registerBlockStyle = function registerBlockStyle(blockName, styleVariation) {
7374    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockStyles(blockName, styleVariation);
7375  };
7376  /**
7377   * Unregisters a block style variation for the given block.
7378   *
7379   * @param {string} blockName          Name of block (example: “core/latest-posts”).
7380   * @param {string} styleVariationName Name of class applied to the block.
7381   */
7382  
7383  var registration_unregisterBlockStyle = function unregisterBlockStyle(blockName, styleVariationName) {
7384    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockStyles(blockName, styleVariationName);
7385  };
7386  /**
7387   * Registers a new block variation for the given block type.
7388   *
7389   * @param {string}           blockName Name of the block (example: “core/columns”).
7390   * @param {WPBlockVariation} variation Object describing a block variation.
7391   */
7392  
7393  var registration_registerBlockVariation = function registerBlockVariation(blockName, variation) {
7394    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockVariations(blockName, variation);
7395  };
7396  /**
7397   * Unregisters a block variation defined for the given block type.
7398   *
7399   * @param {string} blockName     Name of the block (example: “core/columns”).
7400   * @param {string} variationName Name of the variation defined for the block.
7401   */
7402  
7403  var registration_unregisterBlockVariation = function unregisterBlockVariation(blockName, variationName) {
7404    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockVariations(blockName, variationName);
7405  };
7406  
7407  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/factory.js
7408  
7409  
7410  
7411  function factory_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
7412  
7413  function factory_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { factory_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { factory_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7414  
7415  /**
7416   * External dependencies
7417   */
7418  
7419  
7420  /**
7421   * WordPress dependencies
7422   */
7423  
7424  
7425  /**
7426   * Internal dependencies
7427   */
7428  
7429  
7430  
7431  /**
7432   * Returns a block object given its type and attributes.
7433   *
7434   * @param {string} name        Block name.
7435   * @param {Object} attributes  Block attributes.
7436   * @param {?Array} innerBlocks Nested blocks.
7437   *
7438   * @return {Object} Block object.
7439   */
7440  
7441  function createBlock(name) {
7442    var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7443    var innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
7444    // Get the type definition associated with a registered block.
7445    var blockType = registration_getBlockType(name); // Ensure attributes contains only values defined by block type, and merge
7446    // default values for missing attributes.
7447  
7448    var sanitizedAttributes = Object(external_this_lodash_["reduce"])(blockType.attributes, function (accumulator, schema, key) {
7449      var value = attributes[key];
7450  
7451      if (undefined !== value) {
7452        accumulator[key] = value;
7453      } else if (schema.hasOwnProperty('default')) {
7454        accumulator[key] = schema.default;
7455      }
7456  
7457      if (['node', 'children'].indexOf(schema.source) !== -1) {
7458        // Ensure value passed is always an array, which we're expecting in
7459        // the RichText component to handle the deprecated value.
7460        if (typeof accumulator[key] === 'string') {
7461          accumulator[key] = [accumulator[key]];
7462        } else if (!Array.isArray(accumulator[key])) {
7463          accumulator[key] = [];
7464        }
7465      }
7466  
7467      return accumulator;
7468    }, {});
7469    var clientId = v4_default()(); // Blocks are stored with a unique ID, the assigned type name, the block
7470    // attributes, and their inner blocks.
7471  
7472    return {
7473      clientId: clientId,
7474      name: name,
7475      isValid: true,
7476      attributes: sanitizedAttributes,
7477      innerBlocks: innerBlocks
7478    };
7479  }
7480  /**
7481   * Given a block object, returns a copy of the block object, optionally merging
7482   * new attributes and/or replacing its inner blocks.
7483   *
7484   * @param {Object} block              Block instance.
7485   * @param {Object} mergeAttributes    Block attributes.
7486   * @param {?Array} newInnerBlocks     Nested blocks.
7487   *
7488   * @return {Object} A cloned block.
7489   */
7490  
7491  function cloneBlock(block) {
7492    var mergeAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7493    var newInnerBlocks = arguments.length > 2 ? arguments[2] : undefined;
7494    var clientId = v4_default()();
7495    return factory_objectSpread({}, block, {
7496      clientId: clientId,
7497      attributes: factory_objectSpread({}, block.attributes, {}, mergeAttributes),
7498      innerBlocks: newInnerBlocks || block.innerBlocks.map(function (innerBlock) {
7499        return cloneBlock(innerBlock);
7500      })
7501    });
7502  }
7503  /**
7504   * Returns a boolean indicating whether a transform is possible based on
7505   * various bits of context.
7506   *
7507   * @param {Object} transform The transform object to validate.
7508   * @param {string} direction Is this a 'from' or 'to' transform.
7509   * @param {Array} blocks The blocks to transform from.
7510   *
7511   * @return {boolean} Is the transform possible?
7512   */
7513  
7514  var factory_isPossibleTransformForSource = function isPossibleTransformForSource(transform, direction, blocks) {
7515    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7516      return false;
7517    } // If multiple blocks are selected, only multi block transforms
7518    // or wildcard transforms are allowed.
7519  
7520  
7521    var isMultiBlock = blocks.length > 1;
7522    var firstBlockName = Object(external_this_lodash_["first"])(blocks).name;
7523    var isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock;
7524  
7525    if (!isValidForMultiBlocks) {
7526      return false;
7527    } // Check non-wildcard transforms to ensure that transform is valid
7528    // for a block selection of multiple blocks of different types
7529  
7530  
7531    if (!isWildcardBlockTransform(transform) && !Object(external_this_lodash_["every"])(blocks, {
7532      name: firstBlockName
7533    })) {
7534      return false;
7535    } // Only consider 'block' type transforms as valid.
7536  
7537  
7538    var isBlockType = transform.type === 'block';
7539  
7540    if (!isBlockType) {
7541      return false;
7542    } // Check if the transform's block name matches the source block (or is a wildcard)
7543    // only if this is a transform 'from'.
7544  
7545  
7546    var sourceBlock = Object(external_this_lodash_["first"])(blocks);
7547    var hasMatchingName = direction !== 'from' || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
7548  
7549    if (!hasMatchingName) {
7550      return false;
7551    } // Don't allow single Grouping blocks to be transformed into
7552    // a Grouping block.
7553  
7554  
7555    if (!isMultiBlock && factory_isContainerGroupBlock(sourceBlock.name) && factory_isContainerGroupBlock(transform.blockName)) {
7556      return false;
7557    } // If the transform has a `isMatch` function specified, check that it returns true.
7558  
7559  
7560    if (Object(external_this_lodash_["isFunction"])(transform.isMatch)) {
7561      var attributes = transform.isMultiBlock ? blocks.map(function (block) {
7562        return block.attributes;
7563      }) : sourceBlock.attributes;
7564  
7565      if (!transform.isMatch(attributes)) {
7566        return false;
7567      }
7568    }
7569  
7570    return true;
7571  };
7572  /**
7573   * Returns block types that the 'blocks' can be transformed into, based on
7574   * 'from' transforms on other blocks.
7575   *
7576   * @param {Array}  blocks  The blocks to transform from.
7577   *
7578   * @return {Array} Block types that the blocks can be transformed into.
7579   */
7580  
7581  
7582  var factory_getBlockTypesForPossibleFromTransforms = function getBlockTypesForPossibleFromTransforms(blocks) {
7583    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7584      return [];
7585    }
7586  
7587    var allBlockTypes = registration_getBlockTypes(); // filter all blocks to find those with a 'from' transform.
7588  
7589    var blockTypesWithPossibleFromTransforms = Object(external_this_lodash_["filter"])(allBlockTypes, function (blockType) {
7590      var fromTransforms = getBlockTransforms('from', blockType.name);
7591      return !!findTransform(fromTransforms, function (transform) {
7592        return factory_isPossibleTransformForSource(transform, 'from', blocks);
7593      });
7594    });
7595    return blockTypesWithPossibleFromTransforms;
7596  };
7597  /**
7598   * Returns block types that the 'blocks' can be transformed into, based on
7599   * the source block's own 'to' transforms.
7600   *
7601   * @param {Array} blocks The blocks to transform from.
7602   *
7603   * @return {Array} Block types that the source can be transformed into.
7604   */
7605  
7606  
7607  var factory_getBlockTypesForPossibleToTransforms = function getBlockTypesForPossibleToTransforms(blocks) {
7608    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7609      return [];
7610    }
7611  
7612    var sourceBlock = Object(external_this_lodash_["first"])(blocks);
7613    var blockType = registration_getBlockType(sourceBlock.name);
7614    var transformsTo = getBlockTransforms('to', blockType.name); // filter all 'to' transforms to find those that are possible.
7615  
7616    var possibleTransforms = Object(external_this_lodash_["filter"])(transformsTo, function (transform) {
7617      return transform && factory_isPossibleTransformForSource(transform, 'to', blocks);
7618    }); // Build a list of block names using the possible 'to' transforms.
7619  
7620    var blockNames = Object(external_this_lodash_["flatMap"])(possibleTransforms, function (transformation) {
7621      return transformation.blocks;
7622    }); // Map block names to block types.
7623  
7624    return blockNames.map(function (name) {
7625      return registration_getBlockType(name);
7626    });
7627  };
7628  /**
7629   * Determines whether transform is a "block" type
7630   * and if so whether it is a "wildcard" transform
7631   * ie: targets "any" block type
7632   *
7633   * @param {Object} t the Block transform object
7634   *
7635   * @return {boolean} whether transform is a wildcard transform
7636   */
7637  
7638  
7639  var isWildcardBlockTransform = function isWildcardBlockTransform(t) {
7640    return t && t.type === 'block' && Array.isArray(t.blocks) && t.blocks.includes('*');
7641  };
7642  /**
7643   * Determines whether the given Block is the core Block which
7644   * acts as a container Block for other Blocks as part of the
7645   * Grouping mechanics
7646   *
7647   * @param  {string} name the name of the Block to test against
7648   *
7649   * @return {boolean} whether or not the Block is the container Block type
7650   */
7651  
7652  var factory_isContainerGroupBlock = function isContainerGroupBlock(name) {
7653    return name === registration_getGroupingBlockName();
7654  };
7655  /**
7656   * Determines whether the provided Blocks are of the same type
7657   * (eg: all `core/paragraph`).
7658   *
7659   * @param  {Array}  blocksArray the Block definitions
7660   *
7661   * @return {boolean} whether or not the given Blocks pass the criteria
7662   */
7663  
7664  var factory_isBlockSelectionOfSameType = function isBlockSelectionOfSameType() {
7665    var blocksArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
7666  
7667    if (!blocksArray.length) {
7668      return false;
7669    }
7670  
7671    var sourceName = blocksArray[0].name;
7672    return Object(external_this_lodash_["every"])(blocksArray, ['name', sourceName]);
7673  };
7674  /**
7675   * Returns an array of block types that the set of blocks received as argument
7676   * can be transformed into.
7677   *
7678   * @param {Array} blocks Blocks array.
7679   *
7680   * @return {Array} Block types that the blocks argument can be transformed to.
7681   */
7682  
7683  function getPossibleBlockTransformations(blocks) {
7684    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7685      return [];
7686    }
7687  
7688    var blockTypesForFromTransforms = factory_getBlockTypesForPossibleFromTransforms(blocks);
7689    var blockTypesForToTransforms = factory_getBlockTypesForPossibleToTransforms(blocks);
7690    return Object(external_this_lodash_["uniq"])([].concat(Object(toConsumableArray["a" /* default */])(blockTypesForFromTransforms), Object(toConsumableArray["a" /* default */])(blockTypesForToTransforms)));
7691  }
7692  /**
7693   * Given an array of transforms, returns the highest-priority transform where
7694   * the predicate function returns a truthy value. A higher-priority transform
7695   * is one with a lower priority value (i.e. first in priority order). Returns
7696   * null if the transforms set is empty or the predicate function returns a
7697   * falsey value for all entries.
7698   *
7699   * @param {Object[]} transforms Transforms to search.
7700   * @param {Function} predicate  Function returning true on matching transform.
7701   *
7702   * @return {?Object} Highest-priority transform candidate.
7703   */
7704  
7705  function findTransform(transforms, predicate) {
7706    // The hooks library already has built-in mechanisms for managing priority
7707    // queue, so leverage via locally-defined instance.
7708    var hooks = Object(external_this_wp_hooks_["createHooks"])();
7709  
7710    var _loop = function _loop(i) {
7711      var candidate = transforms[i];
7712  
7713      if (predicate(candidate)) {
7714        hooks.addFilter('transform', 'transform/' + i.toString(), function (result) {
7715          return result ? result : candidate;
7716        }, candidate.priority);
7717      }
7718    };
7719  
7720    for (var i = 0; i < transforms.length; i++) {
7721      _loop(i);
7722    } // Filter name is arbitrarily chosen but consistent with above aggregation.
7723  
7724  
7725    return hooks.applyFilters('transform', null);
7726  }
7727  /**
7728   * Returns normal block transforms for a given transform direction, optionally
7729   * for a specific block by name, or an empty array if there are no transforms.
7730   * If no block name is provided, returns transforms for all blocks. A normal
7731   * transform object includes `blockName` as a property.
7732   *
7733   * @param {string}  direction Transform direction ("to", "from").
7734   * @param {string|Object} blockTypeOrName  Block type or name.
7735   *
7736   * @return {Array} Block transforms for direction.
7737   */
7738  
7739  function getBlockTransforms(direction, blockTypeOrName) {
7740    // When retrieving transforms for all block types, recurse into self.
7741    if (blockTypeOrName === undefined) {
7742      return Object(external_this_lodash_["flatMap"])(registration_getBlockTypes(), function (_ref) {
7743        var name = _ref.name;
7744        return getBlockTransforms(direction, name);
7745      });
7746    } // Validate that block type exists and has array of direction.
7747  
7748  
7749    var blockType = normalizeBlockType(blockTypeOrName);
7750  
7751    var _ref2 = blockType || {},
7752        blockName = _ref2.name,
7753        transforms = _ref2.transforms;
7754  
7755    if (!transforms || !Array.isArray(transforms[direction])) {
7756      return [];
7757    } // Map transforms to normal form.
7758  
7759  
7760    return transforms[direction].map(function (transform) {
7761      return factory_objectSpread({}, transform, {
7762        blockName: blockName
7763      });
7764    });
7765  }
7766  /**
7767   * Switch one or more blocks into one or more blocks of the new block type.
7768   *
7769   * @param {Array|Object} blocks Blocks array or block object.
7770   * @param {string}       name   Block name.
7771   *
7772   * @return {?Array} Array of blocks or null.
7773   */
7774  
7775  function switchToBlockType(blocks, name) {
7776    var blocksArray = Object(external_this_lodash_["castArray"])(blocks);
7777    var isMultiBlock = blocksArray.length > 1;
7778    var firstBlock = blocksArray[0];
7779    var sourceName = firstBlock.name; // Unless it's a Grouping Block then for multi block selections
7780    // check that all Blocks are of the same type otherwise
7781    // we can't run a conversion
7782  
7783    if (!factory_isContainerGroupBlock(name) && isMultiBlock && !factory_isBlockSelectionOfSameType(blocksArray)) {
7784      return null;
7785    } // Find the right transformation by giving priority to the "to"
7786    // transformation.
7787  
7788  
7789    var transformationsFrom = getBlockTransforms('from', name);
7790    var transformationsTo = getBlockTransforms('to', sourceName);
7791    var transformation = findTransform(transformationsTo, function (t) {
7792      return t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(name) !== -1) && (!isMultiBlock || t.isMultiBlock);
7793    }) || findTransform(transformationsFrom, function (t) {
7794      return t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t.isMultiBlock);
7795    }); // Stop if there is no valid transformation.
7796  
7797    if (!transformation) {
7798      return null;
7799    }
7800  
7801    var transformationResults;
7802  
7803    if (transformation.isMultiBlock) {
7804      if (Object(external_this_lodash_["has"])(transformation, '__experimentalConvert')) {
7805        transformationResults = transformation.__experimentalConvert(blocksArray);
7806      } else {
7807        transformationResults = transformation.transform(blocksArray.map(function (currentBlock) {
7808          return currentBlock.attributes;
7809        }), blocksArray.map(function (currentBlock) {
7810          return currentBlock.innerBlocks;
7811        }));
7812      }
7813    } else if (Object(external_this_lodash_["has"])(transformation, '__experimentalConvert')) {
7814      transformationResults = transformation.__experimentalConvert(firstBlock);
7815    } else {
7816      transformationResults = transformation.transform(firstBlock.attributes, firstBlock.innerBlocks);
7817    } // Ensure that the transformation function returned an object or an array
7818    // of objects.
7819  
7820  
7821    if (!Object(external_this_lodash_["isObjectLike"])(transformationResults)) {
7822      return null;
7823    } // If the transformation function returned a single object, we want to work
7824    // with an array instead.
7825  
7826  
7827    transformationResults = Object(external_this_lodash_["castArray"])(transformationResults); // Ensure that every block object returned by the transformation has a
7828    // valid block type.
7829  
7830    if (transformationResults.some(function (result) {
7831      return !registration_getBlockType(result.name);
7832    })) {
7833      return null;
7834    }
7835  
7836    var firstSwitchedBlock = Object(external_this_lodash_["findIndex"])(transformationResults, function (result) {
7837      return result.name === name;
7838    }); // Ensure that at least one block object returned by the transformation has
7839    // the expected "destination" block type.
7840  
7841    if (firstSwitchedBlock < 0) {
7842      return null;
7843    }
7844  
7845    return transformationResults.map(function (result, index) {
7846      var transformedBlock = factory_objectSpread({}, result, {
7847        // The first transformed block whose type matches the "destination"
7848        // type gets to keep the existing client ID of the first block.
7849        clientId: index === firstSwitchedBlock ? firstBlock.clientId : result.clientId
7850      });
7851      /**
7852       * Filters an individual transform result from block transformation.
7853       * All of the original blocks are passed, since transformations are
7854       * many-to-many, not one-to-one.
7855       *
7856       * @param {Object}   transformedBlock The transformed block.
7857       * @param {Object[]} blocks           Original blocks transformed.
7858       */
7859  
7860  
7861      return Object(external_this_wp_hooks_["applyFilters"])('blocks.switchToBlockType.transformedBlock', transformedBlock, blocks);
7862    });
7863  }
7864  /**
7865   * Create a block object from the example API.
7866   *
7867   * @param {string} name
7868   * @param {Object} example
7869   *
7870   * @return {Object} block.
7871   */
7872  
7873  var factory_getBlockFromExample = function getBlockFromExample(name, example) {
7874    return createBlock(name, example.attributes, Object(external_this_lodash_["map"])(example.innerBlocks, function (innerBlock) {
7875      return getBlockFromExample(innerBlock.name, innerBlock);
7876    }));
7877  };
7878  
7879  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
7880  var slicedToArray = __webpack_require__(20);
7881  
7882  // CONCATENATED MODULE: ./node_modules/hpq/es/get-path.js
7883  /**
7884   * Given object and string of dot-delimited path segments, returns value at
7885   * path or undefined if path cannot be resolved.
7886   *
7887   * @param  {Object} object Lookup object
7888   * @param  {string} path   Path to resolve
7889   * @return {?*}            Resolved value
7890   */
7891  function getPath(object, path) {
7892    var segments = path.split('.');
7893    var segment;
7894  
7895    while (segment = segments.shift()) {
7896      if (!(segment in object)) {
7897        return;
7898      }
7899  
7900      object = object[segment];
7901    }
7902  
7903    return object;
7904  }
7905  // CONCATENATED MODULE: ./node_modules/hpq/es/index.js
7906  /**
7907   * Internal dependencies
7908   */
7909  
7910  /**
7911   * Function returning a DOM document created by `createHTMLDocument`. The same
7912   * document is returned between invocations.
7913   *
7914   * @return {Document} DOM document.
7915   */
7916  
7917  var getDocument = function () {
7918    var doc;
7919    return function () {
7920      if (!doc) {
7921        doc = document.implementation.createHTMLDocument('');
7922      }
7923  
7924      return doc;
7925    };
7926  }();
7927  /**
7928   * Given a markup string or DOM element, creates an object aligning with the
7929   * shape of the matchers object, or the value returned by the matcher.
7930   *
7931   * @param  {(string|Element)}  source   Source content
7932   * @param  {(Object|Function)} matchers Matcher function or object of matchers
7933   * @return {(Object|*)}                 Matched value(s), shaped by object
7934   */
7935  
7936  
7937  function es_parse(source, matchers) {
7938    if (!matchers) {
7939      return;
7940    } // Coerce to element
7941  
7942  
7943    if ('string' === typeof source) {
7944      var doc = getDocument();
7945      doc.body.innerHTML = source;
7946      source = doc.body;
7947    } // Return singular value
7948  
7949  
7950    if ('function' === typeof matchers) {
7951      return matchers(source);
7952    } // Bail if we can't handle matchers
7953  
7954  
7955    if (Object !== matchers.constructor) {
7956      return;
7957    } // Shape result by matcher object
7958  
7959  
7960    return Object.keys(matchers).reduce(function (memo, key) {
7961      memo[key] = es_parse(source, matchers[key]);
7962      return memo;
7963    }, {});
7964  }
7965  /**
7966   * Generates a function which matches node of type selector, returning an
7967   * attribute by property if the attribute exists. If no selector is passed,
7968   * returns property of the query element.
7969   *
7970   * @param  {?string} selector Optional selector
7971   * @param  {string}  name     Property name
7972   * @return {*}                Property value
7973   */
7974  
7975  function prop(selector, name) {
7976    if (1 === arguments.length) {
7977      name = selector;
7978      selector = undefined;
7979    }
7980  
7981    return function (node) {
7982      var match = node;
7983  
7984      if (selector) {
7985        match = node.querySelector(selector);
7986      }
7987  
7988      if (match) {
7989        return getPath(match, name);
7990      }
7991    };
7992  }
7993  /**
7994   * Generates a function which matches node of type selector, returning an
7995   * attribute by name if the attribute exists. If no selector is passed,
7996   * returns attribute of the query element.
7997   *
7998   * @param  {?string} selector Optional selector
7999   * @param  {string}  name     Attribute name
8000   * @return {?string}          Attribute value
8001   */
8002  
8003  function attr(selector, name) {
8004    if (1 === arguments.length) {
8005      name = selector;
8006      selector = undefined;
8007    }
8008  
8009    return function (node) {
8010      var attributes = prop(selector, 'attributes')(node);
8011  
8012      if (attributes && attributes.hasOwnProperty(name)) {
8013        return attributes[name].value;
8014      }
8015    };
8016  }
8017  /**
8018   * Convenience for `prop( selector, 'innerHTML' )`.
8019   *
8020   * @see prop()
8021   *
8022   * @param  {?string} selector Optional selector
8023   * @return {string}           Inner HTML
8024   */
8025  
8026  function es_html(selector) {
8027    return prop(selector, 'innerHTML');
8028  }
8029  /**
8030   * Convenience for `prop( selector, 'textContent' )`.
8031   *
8032   * @see prop()
8033   *
8034   * @param  {?string} selector Optional selector
8035   * @return {string}           Text content
8036   */
8037  
8038  function es_text(selector) {
8039    return prop(selector, 'textContent');
8040  }
8041  /**
8042   * Creates a new matching context by first finding elements matching selector
8043   * using querySelectorAll before then running another `parse` on `matchers`
8044   * scoped to the matched elements.
8045   *
8046   * @see parse()
8047   *
8048   * @param  {string}            selector Selector to match
8049   * @param  {(Object|Function)} matchers Matcher function or object of matchers
8050   * @return {Array.<*,Object>}           Array of matched value(s)
8051   */
8052  
8053  function query(selector, matchers) {
8054    return function (node) {
8055      var matches = node.querySelectorAll(selector);
8056      return [].map.call(matches, function (match) {
8057        return es_parse(match, matchers);
8058      });
8059    };
8060  }
8061  // EXTERNAL MODULE: external {"this":["wp","autop"]}
8062  var external_this_wp_autop_ = __webpack_require__(85);
8063  
8064  // EXTERNAL MODULE: external {"this":["wp","blockSerializationDefaultParser"]}
8065  var external_this_wp_blockSerializationDefaultParser_ = __webpack_require__(265);
8066  
8067  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
8068  var arrayWithHoles = __webpack_require__(38);
8069  
8070  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
8071  var iterableToArray = __webpack_require__(35);
8072  
8073  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
8074  var unsupportedIterableToArray = __webpack_require__(27);
8075  
8076  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
8077  var nonIterableRest = __webpack_require__(39);
8078  
8079  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toArray.js
8080  
8081  
8082  
8083  
8084  function _toArray(arr) {
8085    return Object(arrayWithHoles["a" /* default */])(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || Object(nonIterableRest["a" /* default */])();
8086  }
8087  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
8088  var classCallCheck = __webpack_require__(14);
8089  
8090  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
8091  var createClass = __webpack_require__(13);
8092  
8093  // CONCATENATED MODULE: ./node_modules/simple-html-tokenizer/dist/es6/index.js
8094  /**
8095   * generated from https://raw.githubusercontent.com/w3c/html/26b5126f96f736f796b9e29718138919dd513744/entities.json
8096   * do not edit
8097   */
8098  var namedCharRefs = {
8099      Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳", Acirc: "Â", acirc: "â", acute: "´", Acy: "А", acy: "а", AElig: "Æ", aelig: "æ", af: "\u2061", Afr: "𝔄", afr: "𝔞", Agrave: "À", agrave: "à", alefsym: "ℵ", aleph: "ℵ", Alpha: "Α", alpha: "α", Amacr: "Ā", amacr: "ā", amalg: "⨿", amp: "&", AMP: "&", andand: "⩕", And: "⩓", and: "∧", andd: "⩜", andslope: "⩘", andv: "⩚", ang: "∠", ange: "⦤", angle: "∠", angmsdaa: "⦨", angmsdab: "⦩", angmsdac: "⦪", angmsdad: "⦫", angmsdae: "⦬", angmsdaf: "⦭", angmsdag: "⦮", angmsdah: "⦯", angmsd: "∡", angrt: "∟", angrtvb: "⊾", angrtvbd: "⦝", angsph: "∢", angst: "Å", angzarr: "⍼", Aogon: "Ą", aogon: "ą", Aopf: "𝔸", aopf: "𝕒", apacir: "⩯", ap: "≈", apE: "⩰", ape: "≊", apid: "≋", apos: "'", ApplyFunction: "\u2061", approx: "≈", approxeq: "≊", Aring: "Å", aring: "å", Ascr: "𝒜", ascr: "𝒶", Assign: "≔", ast: "*", asymp: "≈", asympeq: "≍", Atilde: "Ã", atilde: "ã", Auml: "Ä", auml: "ä", awconint: "∳", awint: "⨑", backcong: "≌", backepsilon: "϶", backprime: "‵", backsim: "∽", backsimeq: "⋍", Backslash: "∖", Barv: "⫧", barvee: "⊽", barwed: "⌅", Barwed: "⌆", barwedge: "⌅", bbrk: "⎵", bbrktbrk: "⎶", bcong: "≌", Bcy: "Б", bcy: "б", bdquo: "„", becaus: "∵", because: "∵", Because: "∵", bemptyv: "⦰", bepsi: "϶", bernou: "ℬ", Bernoullis: "ℬ", Beta: "Β", beta: "β", beth: "ℶ", between: "≬", Bfr: "𝔅", bfr: "𝔟", bigcap: "⋂", bigcirc: "◯", bigcup: "⋃", bigodot: "⨀", bigoplus: "⨁", bigotimes: "⨂", bigsqcup: "⨆", bigstar: "★", bigtriangledown: "▽", bigtriangleup: "△", biguplus: "⨄", bigvee: "⋁", bigwedge: "⋀", bkarow: "⤍", blacklozenge: "⧫", blacksquare: "▪", blacktriangle: "▴", blacktriangledown: "▾", blacktriangleleft: "◂", blacktriangleright: "▸", blank: "␣", blk12: "▒", blk14: "░", blk34: "▓", block: "█", bne: "=⃥", bnequiv: "≡⃥", bNot: "⫭", bnot: "⌐", Bopf: "𝔹", bopf: "𝕓", bot: "⊥", bottom: "⊥", bowtie: "⋈", boxbox: "⧉", boxdl: "┐", boxdL: "╕", boxDl: "╖", boxDL: "╗", boxdr: "┌", boxdR: "╒", boxDr: "╓", boxDR: "╔", boxh: "─", boxH: "═", boxhd: "┬", boxHd: "╤", boxhD: "╥", boxHD: "╦", boxhu: "┴", boxHu: "╧", boxhU: "╨", boxHU: "╩", boxminus: "⊟", boxplus: "⊞", boxtimes: "⊠", boxul: "┘", boxuL: "╛", boxUl: "╜", boxUL: "╝", boxur: "└", boxuR: "╘", boxUr: "╙", boxUR: "╚", boxv: "│", boxV: "║", boxvh: "┼", boxvH: "╪", boxVh: "╫", boxVH: "╬", boxvl: "┤", boxvL: "╡", boxVl: "╢", boxVL: "╣", boxvr: "├", boxvR: "╞", boxVr: "╟", boxVR: "╠", bprime: "‵", breve: "˘", Breve: "˘", brvbar: "¦", bscr: "𝒷", Bscr: "ℬ", bsemi: "⁏", bsim: "∽", bsime: "⋍", bsolb: "⧅", bsol: "\\", bsolhsub: "⟈", bull: "•", bullet: "•", bump: "≎", bumpE: "⪮", bumpe: "≏", Bumpeq: "≎", bumpeq: "≏", Cacute: "Ć", cacute: "ć", capand: "⩄", capbrcup: "⩉", capcap: "⩋", cap: "∩", Cap: "⋒", capcup: "⩇", capdot: "⩀", CapitalDifferentialD: "ⅅ", caps: "∩︀", caret: "⁁", caron: "ˇ", Cayleys: "ℭ", ccaps: "⩍", Ccaron: "Č", ccaron: "č", Ccedil: "Ç", ccedil: "ç", Ccirc: "Ĉ", ccirc: "ĉ", Cconint: "∰", ccups: "⩌", ccupssm: "⩐", Cdot: "Ċ", cdot: "ċ", cedil: "¸", Cedilla: "¸", cemptyv: "⦲", cent: "¢", centerdot: "·", CenterDot: "·", cfr: "𝔠", Cfr: "ℭ", CHcy: "Ч", chcy: "ч", check: "✓", checkmark: "✓", Chi: "Χ", chi: "χ", circ: "ˆ", circeq: "≗", circlearrowleft: "↺", circlearrowright: "↻", circledast: "⊛", circledcirc: "⊚", circleddash: "⊝", CircleDot: "⊙", circledR: "®", circledS: "Ⓢ", CircleMinus: "⊖", CirclePlus: "⊕", CircleTimes: "⊗", cir: "○", cirE: "⧃", cire: "≗", cirfnint: "⨐", cirmid: "⫯", cirscir: "⧂", ClockwiseContourIntegral: "∲", CloseCurlyDoubleQuote: "”", CloseCurlyQuote: "’", clubs: "♣", clubsuit: "♣", colon: ":", Colon: "∷", Colone: "⩴", colone: "≔", coloneq: "≔", comma: ",", commat: "@", comp: "∁", compfn: "∘", complement: "∁", complexes: "ℂ", cong: "≅", congdot: "⩭", Congruent: "≡", conint: "∮", Conint: "∯", ContourIntegral: "∮", copf: "𝕔", Copf: "ℂ", coprod: "∐", Coproduct: "∐", copy: "©", COPY: "©", copysr: "℗", CounterClockwiseContourIntegral: "∳", crarr: "↵", cross: "✗", Cross: "⨯", Cscr: "𝒞", cscr: "𝒸", csub: "⫏", csube: "⫑", csup: "⫐", csupe: "⫒", ctdot: "⋯", cudarrl: "⤸", cudarrr: "⤵", cuepr: "⋞", cuesc: "⋟", cularr: "↶", cularrp: "⤽", cupbrcap: "⩈", cupcap: "⩆", CupCap: "≍", cup: "∪", Cup: "⋓", cupcup: "⩊", cupdot: "⊍", cupor: "⩅", cups: "∪︀", curarr: "↷", curarrm: "⤼", curlyeqprec: "⋞", curlyeqsucc: "⋟", curlyvee: "⋎", curlywedge: "⋏", curren: "¤", curvearrowleft: "↶", curvearrowright: "↷", cuvee: "⋎", cuwed: "⋏", cwconint: "∲", cwint: "∱", cylcty: "⌭", dagger: "†", Dagger: "‡", daleth: "ℸ", darr: "↓", Darr: "↡", dArr: "⇓", dash: "‐", Dashv: "⫤", dashv: "⊣", dbkarow: "⤏", dblac: "˝", Dcaron: "Ď", dcaron: "ď", Dcy: "Д", dcy: "д", ddagger: "‡", ddarr: "⇊", DD: "ⅅ", dd: "ⅆ", DDotrahd: "⤑", ddotseq: "⩷", deg: "°", Del: "∇", Delta: "Δ", delta: "δ", demptyv: "⦱", dfisht: "⥿", Dfr: "𝔇", dfr: "𝔡", dHar: "⥥", dharl: "⇃", dharr: "⇂", DiacriticalAcute: "´", DiacriticalDot: "˙", DiacriticalDoubleAcute: "˝", DiacriticalGrave: "`", DiacriticalTilde: "˜", diam: "⋄", diamond: "⋄", Diamond: "⋄", diamondsuit: "♦", diams: "♦", die: "¨", DifferentialD: "ⅆ", digamma: "ϝ", disin: "⋲", div: "÷", divide: "÷", divideontimes: "⋇", divonx: "⋇", DJcy: "Ђ", djcy: "ђ", dlcorn: "⌞", dlcrop: "⌍", dollar: "$", Dopf: "𝔻", dopf: "𝕕", Dot: "¨", dot: "˙", DotDot: "⃜", doteq: "≐", doteqdot: "≑", DotEqual: "≐", dotminus: "∸", dotplus: "∔", dotsquare: "⊡", doublebarwedge: "⌆", DoubleContourIntegral: "∯", DoubleDot: "¨", DoubleDownArrow: "⇓", DoubleLeftArrow: "⇐", DoubleLeftRightArrow: "⇔", DoubleLeftTee: "⫤", DoubleLongLeftArrow: "⟸", DoubleLongLeftRightArrow: "⟺", DoubleLongRightArrow: "⟹", DoubleRightArrow: "⇒", DoubleRightTee: "⊨", DoubleUpArrow: "⇑", DoubleUpDownArrow: "⇕", DoubleVerticalBar: "∥", DownArrowBar: "⤓", downarrow: "↓", DownArrow: "↓", Downarrow: "⇓", DownArrowUpArrow: "⇵", DownBreve: "̑", downdownarrows: "⇊", downharpoonleft: "⇃", downharpoonright: "⇂", DownLeftRightVector: "⥐", DownLeftTeeVector: "⥞", DownLeftVectorBar: "⥖", DownLeftVector: "↽", DownRightTeeVector: "⥟", DownRightVectorBar: "⥗", DownRightVector: "⇁", DownTeeArrow: "↧", DownTee: "⊤", drbkarow: "⤐", drcorn: "⌟", drcrop: "⌌", Dscr: "𝒟", dscr: "𝒹", DScy: "Ѕ", dscy: "ѕ", dsol: "⧶", Dstrok: "Đ", dstrok: "đ", dtdot: "⋱", dtri: "▿", dtrif: "▾", duarr: "⇵", duhar: "⥯", dwangle: "⦦", DZcy: "Џ", dzcy: "џ", dzigrarr: "⟿", Eacute: "É", eacute: "é", easter: "⩮", Ecaron: "Ě", ecaron: "ě", Ecirc: "Ê", ecirc: "ê", ecir: "≖", ecolon: "≕", Ecy: "Э", ecy: "э", eDDot: "⩷", Edot: "Ė", edot: "ė", eDot: "≑", ee: "ⅇ", efDot: "≒", Efr: "𝔈", efr: "𝔢", eg: "⪚", Egrave: "È", egrave: "è", egs: "⪖", egsdot: "⪘", el: "⪙", Element: "∈", elinters: "⏧", ell: "ℓ", els: "⪕", elsdot: "⪗", Emacr: "Ē", emacr: "ē", empty: "∅", emptyset: "∅", EmptySmallSquare: "◻", emptyv: "∅", EmptyVerySmallSquare: "▫", emsp13: " ", emsp14: " ", emsp: " ", ENG: "Ŋ", eng: "ŋ", ensp: " ", Eogon: "Ę", eogon: "ę", Eopf: "𝔼", eopf: "𝕖", epar: "⋕", eparsl: "⧣", eplus: "⩱", epsi: "ε", Epsilon: "Ε", epsilon: "ε", epsiv: "ϵ", eqcirc: "≖", eqcolon: "≕", eqsim: "≂", eqslantgtr: "⪖", eqslantless: "⪕", Equal: "⩵", equals: "=", EqualTilde: "≂", equest: "≟", Equilibrium: "⇌", equiv: "≡", equivDD: "⩸", eqvparsl: "⧥", erarr: "⥱", erDot: "≓", escr: "ℯ", Escr: "ℰ", esdot: "≐", Esim: "⩳", esim: "≂", Eta: "Η", eta: "η", ETH: "Ð", eth: "ð", Euml: "Ë", euml: "ë", euro: "€", excl: "!", exist: "∃", Exists: "∃", expectation: "ℰ", exponentiale: "ⅇ", ExponentialE: "ⅇ", fallingdotseq: "≒", Fcy: "Ф", fcy: "ф", female: "♀", ffilig: "ffi", fflig: "ff", ffllig: "ffl", Ffr: "𝔉", ffr: "𝔣", filig: "fi", FilledSmallSquare: "◼", FilledVerySmallSquare: "▪", fjlig: "fj", flat: "♭", fllig: "fl", fltns: "▱", fnof: "ƒ", Fopf: "𝔽", fopf: "𝕗", forall: "∀", ForAll: "∀", fork: "⋔", forkv: "⫙", Fouriertrf: "ℱ", fpartint: "⨍", frac12: "½", frac13: "⅓", frac14: "¼", frac15: "⅕", frac16: "⅙", frac18: "⅛", frac23: "⅔", frac25: "⅖", frac34: "¾", frac35: "⅗", frac38: "⅜", frac45: "⅘", frac56: "⅚", frac58: "⅝", frac78: "⅞", frasl: "⁄", frown: "⌢", fscr: "𝒻", Fscr: "ℱ", gacute: "ǵ", Gamma: "Γ", gamma: "γ", Gammad: "Ϝ", gammad: "ϝ", gap: "⪆", Gbreve: "Ğ", gbreve: "ğ", Gcedil: "Ģ", Gcirc: "Ĝ", gcirc: "ĝ", Gcy: "Г", gcy: "г", Gdot: "Ġ", gdot: "ġ", ge: "≥", gE: "≧", gEl: "⪌", gel: "⋛", geq: "≥", geqq: "≧", geqslant: "⩾", gescc: "⪩", ges: "⩾", gesdot: "⪀", gesdoto: "⪂", gesdotol: "⪄", gesl: "⋛︀", gesles: "⪔", Gfr: "𝔊", gfr: "𝔤", gg: "≫", Gg: "⋙", ggg: "⋙", gimel: "ℷ", GJcy: "Ѓ", gjcy: "ѓ", gla: "⪥", gl: "≷", glE: "⪒", glj: "⪤", gnap: "⪊", gnapprox: "⪊", gne: "⪈", gnE: "≩", gneq: "⪈", gneqq: "≩", gnsim: "⋧", Gopf: "𝔾", gopf: "𝕘", grave: "`", GreaterEqual: "≥", GreaterEqualLess: "⋛", GreaterFullEqual: "≧", GreaterGreater: "⪢", GreaterLess: "≷", GreaterSlantEqual: "⩾", GreaterTilde: "≳", Gscr: "𝒢", gscr: "ℊ", gsim: "≳", gsime: "⪎", gsiml: "⪐", gtcc: "⪧", gtcir: "⩺", gt: ">", GT: ">", Gt: "≫", gtdot: "⋗", gtlPar: "⦕", gtquest: "⩼", gtrapprox: "⪆", gtrarr: "⥸", gtrdot: "⋗", gtreqless: "⋛", gtreqqless: "⪌", gtrless: "≷", gtrsim: "≳", gvertneqq: "≩︀", gvnE: "≩︀", Hacek: "ˇ", hairsp: " ", half: "½", hamilt: "ℋ", HARDcy: "Ъ", hardcy: "ъ", harrcir: "⥈", harr: "↔", hArr: "⇔", harrw: "↭", Hat: "^", hbar: "ℏ", Hcirc: "Ĥ", hcirc: "ĥ", hearts: "♥", heartsuit: "♥", hellip: "…", hercon: "⊹", hfr: "𝔥", Hfr: "ℌ", HilbertSpace: "ℋ", hksearow: "⤥", hkswarow: "⤦", hoarr: "⇿", homtht: "∻", hookleftarrow: "↩", hookrightarrow: "↪", hopf: "𝕙", Hopf: "ℍ", horbar: "―", HorizontalLine: "─", hscr: "𝒽", Hscr: "ℋ", hslash: "ℏ", Hstrok: "Ħ", hstrok: "ħ", HumpDownHump: "≎", HumpEqual: "≏", hybull: "⁃", hyphen: "‐", Iacute: "Í", iacute: "í", ic: "\u2063", Icirc: "Î", icirc: "î", Icy: "И", icy: "и", Idot: "İ", IEcy: "Е", iecy: "е", iexcl: "¡", iff: "⇔", ifr: "𝔦", Ifr: "ℑ", Igrave: "Ì", igrave: "ì", ii: "ⅈ", iiiint: "⨌", iiint: "∭", iinfin: "⧜", iiota: "℩", IJlig: "IJ", ijlig: "ij", Imacr: "Ī", imacr: "ī", image: "ℑ", ImaginaryI: "ⅈ", imagline: "ℐ", imagpart: "ℑ", imath: "ı", Im: "ℑ", imof: "⊷", imped: "Ƶ", Implies: "⇒", incare: "℅", in: "∈", infin: "∞", infintie: "⧝", inodot: "ı", intcal: "⊺", int: "∫", Int: "∬", integers: "ℤ", Integral: "∫", intercal: "⊺", Intersection: "⋂", intlarhk: "⨗", intprod: "⨼", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "Ё", iocy: "ё", Iogon: "Į", iogon: "į", Iopf: "𝕀", iopf: "𝕚", Iota: "Ι", iota: "ι", iprod: "⨼", iquest: "¿", iscr: "𝒾", Iscr: "ℐ", isin: "∈", isindot: "⋵", isinE: "⋹", isins: "⋴", isinsv: "⋳", isinv: "∈", it: "\u2062", Itilde: "Ĩ", itilde: "ĩ", Iukcy: "І", iukcy: "і", Iuml: "Ï", iuml: "ï", Jcirc: "Ĵ", jcirc: "ĵ", Jcy: "Й", jcy: "й", Jfr: "𝔍", jfr: "𝔧", jmath: "ȷ", Jopf: "𝕁", jopf: "𝕛", Jscr: "𝒥", jscr: "𝒿", Jsercy: "Ј", jsercy: "ј", Jukcy: "Є", jukcy: "є", Kappa: "Κ", kappa: "κ", kappav: "ϰ", Kcedil: "Ķ", kcedil: "ķ", Kcy: "К", kcy: "к", Kfr: "𝔎", kfr: "𝔨", kgreen: "ĸ", KHcy: "Х", khcy: "х", KJcy: "Ќ", kjcy: "ќ", Kopf: "𝕂", kopf: "𝕜", Kscr: "𝒦", kscr: "𝓀", lAarr: "⇚", Lacute: "Ĺ", lacute: "ĺ", laemptyv: "⦴", lagran: "ℒ", Lambda: "Λ", lambda: "λ", lang: "⟨", Lang: "⟪", langd: "⦑", langle: "⟨", lap: "⪅", Laplacetrf: "ℒ", laquo: "«", larrb: "⇤", larrbfs: "⤟", larr: "←", Larr: "↞", lArr: "⇐", larrfs: "⤝", larrhk: "↩", larrlp: "↫", larrpl: "⤹", larrsim: "⥳", larrtl: "↢", latail: "⤙", lAtail: "⤛", lat: "⪫", late: "⪭", lates: "⪭︀", lbarr: "⤌", lBarr: "⤎", lbbrk: "❲", lbrace: "{", lbrack: "[", lbrke: "⦋", lbrksld: "⦏", lbrkslu: "⦍", Lcaron: "Ľ", lcaron: "ľ", Lcedil: "Ļ", lcedil: "ļ", lceil: "⌈", lcub: "{", Lcy: "Л", lcy: "л", ldca: "⤶", ldquo: "“", ldquor: "„", ldrdhar: "⥧", ldrushar: "⥋", ldsh: "↲", le: "≤", lE: "≦", LeftAngleBracket: "⟨", LeftArrowBar: "⇤", leftarrow: "←", LeftArrow: "←", Leftarrow: "⇐", LeftArrowRightArrow: "⇆", leftarrowtail: "↢", LeftCeiling: "⌈", LeftDoubleBracket: "⟦", LeftDownTeeVector: "⥡", LeftDownVectorBar: "⥙", LeftDownVector: "⇃", LeftFloor: "⌊", leftharpoondown: "↽", leftharpoonup: "↼", leftleftarrows: "⇇", leftrightarrow: "↔", LeftRightArrow: "↔", Leftrightarrow: "⇔", leftrightarrows: "⇆", leftrightharpoons: "⇋", leftrightsquigarrow: "↭", LeftRightVector: "⥎", LeftTeeArrow: "↤", LeftTee: "⊣", LeftTeeVector: "⥚", leftthreetimes: "⋋", LeftTriangleBar: "⧏", LeftTriangle: "⊲", LeftTriangleEqual: "⊴", LeftUpDownVector: "⥑", LeftUpTeeVector: "⥠", LeftUpVectorBar: "⥘", LeftUpVector: "↿", LeftVectorBar: "⥒", LeftVector: "↼", lEg: "⪋", leg: "⋚", leq: "≤", leqq: "≦", leqslant: "⩽", lescc: "⪨", les: "⩽", lesdot: "⩿", lesdoto: "⪁", lesdotor: "⪃", lesg: "⋚︀", lesges: "⪓", lessapprox: "⪅", lessdot: "⋖", lesseqgtr: "⋚", lesseqqgtr: "⪋", LessEqualGreater: "⋚", LessFullEqual: "≦", LessGreater: "≶", lessgtr: "≶", LessLess: "⪡", lesssim: "≲", LessSlantEqual: "⩽", LessTilde: "≲", lfisht: "⥼", lfloor: "⌊", Lfr: "𝔏", lfr: "𝔩", lg: "≶", lgE: "⪑", lHar: "⥢", lhard: "↽", lharu: "↼", lharul: "⥪", lhblk: "▄", LJcy: "Љ", ljcy: "љ", llarr: "⇇", ll: "≪", Ll: "⋘", llcorner: "⌞", Lleftarrow: "⇚", llhard: "⥫", lltri: "◺", Lmidot: "Ŀ", lmidot: "ŀ", lmoustache: "⎰", lmoust: "⎰", lnap: "⪉", lnapprox: "⪉", lne: "⪇", lnE: "≨", lneq: "⪇", lneqq: "≨", lnsim: "⋦", loang: "⟬", loarr: "⇽", lobrk: "⟦", longleftarrow: "⟵", LongLeftArrow: "⟵", Longleftarrow: "⟸", longleftrightarrow: "⟷", LongLeftRightArrow: "⟷", Longleftrightarrow: "⟺", longmapsto: "⟼", longrightarrow: "⟶", LongRightArrow: "⟶", Longrightarrow: "⟹", looparrowleft: "↫", looparrowright: "↬", lopar: "⦅", Lopf: "𝕃", lopf: "𝕝", loplus: "⨭", lotimes: "⨴", lowast: "∗", lowbar: "_", LowerLeftArrow: "↙", LowerRightArrow: "↘", loz: "◊", lozenge: "◊", lozf: "⧫", lpar: "(", lparlt: "⦓", lrarr: "⇆", lrcorner: "⌟", lrhar: "⇋", lrhard: "⥭", lrm: "\u200e", lrtri: "⊿", lsaquo: "‹", lscr: "𝓁", Lscr: "ℒ", lsh: "↰", Lsh: "↰", lsim: "≲", lsime: "⪍", lsimg: "⪏", lsqb: "[", lsquo: "‘", lsquor: "‚", Lstrok: "Ł", lstrok: "ł", ltcc: "⪦", ltcir: "⩹", lt: "<", LT: "<", Lt: "≪", ltdot: "⋖", lthree: "⋋", ltimes: "⋉", ltlarr: "⥶", ltquest: "⩻", ltri: "◃", ltrie: "⊴", ltrif: "◂", ltrPar: "⦖", lurdshar: "⥊", luruhar: "⥦", lvertneqq: "≨︀", lvnE: "≨︀", macr: "¯", male: "♂", malt: "✠", maltese: "✠", Map: "⤅", map: "↦", mapsto: "↦", mapstodown: "↧", mapstoleft: "↤", mapstoup: "↥", marker: "▮", mcomma: "⨩", Mcy: "М", mcy: "м", mdash: "—", mDDot: "∺", measuredangle: "∡", MediumSpace: " ", Mellintrf: "ℳ", Mfr: "𝔐", mfr: "𝔪", mho: "℧", micro: "µ", midast: "*", midcir: "⫰", mid: "∣", middot: "·", minusb: "⊟", minus: "−", minusd: "∸", minusdu: "⨪", MinusPlus: "∓", mlcp: "⫛", mldr: "…", mnplus: "∓", models: "⊧", Mopf: "𝕄", mopf: "𝕞", mp: "∓", mscr: "𝓂", Mscr: "ℳ", mstpos: "∾", Mu: "Μ", mu: "μ", multimap: "⊸", mumap: "⊸", nabla: "∇", Nacute: "Ń", nacute: "ń", nang: "∠⃒", nap: "≉", napE: "⩰̸", napid: "≋̸", napos: "ʼn", napprox: "≉", natural: "♮", naturals: "ℕ", natur: "♮", nbsp: " ", nbump: "≎̸", nbumpe: "≏̸", ncap: "⩃", Ncaron: "Ň", ncaron: "ň", Ncedil: "Ņ", ncedil: "ņ", ncong: "≇", ncongdot: "⩭̸", ncup: "⩂", Ncy: "Н", ncy: "н", ndash: "–", nearhk: "⤤", nearr: "↗", neArr: "⇗", nearrow: "↗", ne: "≠", nedot: "≐̸", NegativeMediumSpace: "​", NegativeThickSpace: "​", NegativeThinSpace: "​", NegativeVeryThinSpace: "​", nequiv: "≢", nesear: "⤨", nesim: "≂̸", NestedGreaterGreater: "≫", NestedLessLess: "≪", NewLine: "\u000a", nexist: "∄", nexists: "∄", Nfr: "𝔑", nfr: "𝔫", ngE: "≧̸", nge: "≱", ngeq: "≱", ngeqq: "≧̸", ngeqslant: "⩾̸", nges: "⩾̸", nGg: "⋙̸", ngsim: "≵", nGt: "≫⃒", ngt: "≯", ngtr: "≯", nGtv: "≫̸", nharr: "↮", nhArr: "⇎", nhpar: "⫲", ni: "∋", nis: "⋼", nisd: "⋺", niv: "∋", NJcy: "Њ", njcy: "њ", nlarr: "↚", nlArr: "⇍", nldr: "‥", nlE: "≦̸", nle: "≰", nleftarrow: "↚", nLeftarrow: "⇍", nleftrightarrow: "↮", nLeftrightarrow: "⇎", nleq: "≰", nleqq: "≦̸", nleqslant: "⩽̸", nles: "⩽̸", nless: "≮", nLl: "⋘̸", nlsim: "≴", nLt: "≪⃒", nlt: "≮", nltri: "⋪", nltrie: "⋬", nLtv: "≪̸", nmid: "∤", NoBreak: "\u2060", NonBreakingSpace: " ", nopf: "𝕟", Nopf: "ℕ", Not: "⫬", not: "¬", NotCongruent: "≢", NotCupCap: "≭", NotDoubleVerticalBar: "∦", NotElement: "∉", NotEqual: "≠", NotEqualTilde: "≂̸", NotExists: "∄", NotGreater: "≯", NotGreaterEqual: "≱", NotGreaterFullEqual: "≧̸", NotGreaterGreater: "≫̸", NotGreaterLess: "≹", NotGreaterSlantEqual: "⩾̸", NotGreaterTilde: "≵", NotHumpDownHump: "≎̸", NotHumpEqual: "≏̸", notin: "∉", notindot: "⋵̸", notinE: "⋹̸", notinva: "∉", notinvb: "⋷", notinvc: "⋶", NotLeftTriangleBar: "⧏̸", NotLeftTriangle: "⋪", NotLeftTriangleEqual: "⋬", NotLess: "≮", NotLessEqual: "≰", NotLessGreater: "≸", NotLessLess: "≪̸", NotLessSlantEqual: "⩽̸", NotLessTilde: "≴", NotNestedGreaterGreater: "⪢̸", NotNestedLessLess: "⪡̸", notni: "∌", notniva: "∌", notnivb: "⋾", notnivc: "⋽", NotPrecedes: "⊀", NotPrecedesEqual: "⪯̸", NotPrecedesSlantEqual: "⋠", NotReverseElement: "∌", NotRightTriangleBar: "⧐̸", NotRightTriangle: "⋫", NotRightTriangleEqual: "⋭", NotSquareSubset: "⊏̸", NotSquareSubsetEqual: "⋢", NotSquareSuperset: "⊐̸", NotSquareSupersetEqual: "⋣", NotSubset: "⊂⃒", NotSubsetEqual: "⊈", NotSucceeds: "⊁", NotSucceedsEqual: "⪰̸", NotSucceedsSlantEqual: "⋡", NotSucceedsTilde: "≿̸", NotSuperset: "⊃⃒", NotSupersetEqual: "⊉", NotTilde: "≁", NotTildeEqual: "≄", NotTildeFullEqual: "≇", NotTildeTilde: "≉", NotVerticalBar: "∤", nparallel: "∦", npar: "∦", nparsl: "⫽⃥", npart: "∂̸", npolint: "⨔", npr: "⊀", nprcue: "⋠", nprec: "⊀", npreceq: "⪯̸", npre: "⪯̸", nrarrc: "⤳̸", nrarr: "↛", nrArr: "⇏", nrarrw: "↝̸", nrightarrow: "↛", nRightarrow: "⇏", nrtri: "⋫", nrtrie: "⋭", nsc: "⊁", nsccue: "⋡", nsce: "⪰̸", Nscr: "𝒩", nscr: "𝓃", nshortmid: "∤", nshortparallel: "∦", nsim: "≁", nsime: "≄", nsimeq: "≄", nsmid: "∤", nspar: "∦", nsqsube: "⋢", nsqsupe: "⋣", nsub: "⊄", nsubE: "⫅̸", nsube: "⊈", nsubset: "⊂⃒", nsubseteq: "⊈", nsubseteqq: "⫅̸", nsucc: "⊁", nsucceq: "⪰̸", nsup: "⊅", nsupE: "⫆̸", nsupe: "⊉", nsupset: "⊃⃒", nsupseteq: "⊉", nsupseteqq: "⫆̸", ntgl: "≹", Ntilde: "Ñ", ntilde: "ñ", ntlg: "≸", ntriangleleft: "⋪", ntrianglelefteq: "⋬", ntriangleright: "⋫", ntrianglerighteq: "⋭", Nu: "Ν", nu: "ν", num: "#", numero: "№", numsp: " ", nvap: "≍⃒", nvdash: "⊬", nvDash: "⊭", nVdash: "⊮", nVDash: "⊯", nvge: "≥⃒", nvgt: ">⃒", nvHarr: "⤄", nvinfin: "⧞", nvlArr: "⤂", nvle: "≤⃒", nvlt: "<⃒", nvltrie: "⊴⃒", nvrArr: "⤃", nvrtrie: "⊵⃒", nvsim: "∼⃒", nwarhk: "⤣", nwarr: "↖", nwArr: "⇖", nwarrow: "↖", nwnear: "⤧", Oacute: "Ó", oacute: "ó", oast: "⊛", Ocirc: "Ô", ocirc: "ô", ocir: "⊚", Ocy: "О", ocy: "о", odash: "⊝", Odblac: "Ő", odblac: "ő", odiv: "⨸", odot: "⊙", odsold: "⦼", OElig: "Œ", oelig: "œ", ofcir: "⦿", Ofr: "𝔒", ofr: "𝔬", ogon: "˛", Ograve: "Ò", ograve: "ò", ogt: "⧁", ohbar: "⦵", ohm: "Ω", oint: "∮", olarr: "↺", olcir: "⦾", olcross: "⦻", oline: "‾", olt: "⧀", Omacr: "Ō", omacr: "ō", Omega: "Ω", omega: "ω", Omicron: "Ο", omicron: "ο", omid: "⦶", ominus: "⊖", Oopf: "𝕆", oopf: "𝕠", opar: "⦷", OpenCurlyDoubleQuote: "“", OpenCurlyQuote: "‘", operp: "⦹", oplus: "⊕", orarr: "↻", Or: "⩔", or: "∨", ord: "⩝", order: "ℴ", orderof: "ℴ", ordf: "ª", ordm: "º", origof: "⊶", oror: "⩖", orslope: "⩗", orv: "⩛", oS: "Ⓢ", Oscr: "𝒪", oscr: "ℴ", Oslash: "Ø", oslash: "ø", osol: "⊘", Otilde: "Õ", otilde: "õ", otimesas: "⨶", Otimes: "⨷", otimes: "⊗", Ouml: "Ö", ouml: "ö", ovbar: "⌽", OverBar: "‾", OverBrace: "⏞", OverBracket: "⎴", OverParenthesis: "⏜", para: "¶", parallel: "∥", par: "∥", parsim: "⫳", parsl: "⫽", part: "∂", PartialD: "∂", Pcy: "П", pcy: "п", percnt: "%", period: ".", permil: "‰", perp: "⊥", pertenk: "‱", Pfr: "𝔓", pfr: "𝔭", Phi: "Φ", phi: "φ", phiv: "ϕ", phmmat: "ℳ", phone: "☎", Pi: "Π", pi: "π", pitchfork: "⋔", piv: "ϖ", planck: "ℏ", planckh: "ℎ", plankv: "ℏ", plusacir: "⨣", plusb: "⊞", pluscir: "⨢", plus: "+", plusdo: "∔", plusdu: "⨥", pluse: "⩲", PlusMinus: "±", plusmn: "±", plussim: "⨦", plustwo: "⨧", pm: "±", Poincareplane: "ℌ", pointint: "⨕", popf: "𝕡", Popf: "ℙ", pound: "£", prap: "⪷", Pr: "⪻", pr: "≺", prcue: "≼", precapprox: "⪷", prec: "≺", preccurlyeq: "≼", Precedes: "≺", PrecedesEqual: "⪯", PrecedesSlantEqual: "≼", PrecedesTilde: "≾", preceq: "⪯", precnapprox: "⪹", precneqq: "⪵", precnsim: "⋨", pre: "⪯", prE: "⪳", precsim: "≾", prime: "′", Prime: "″", primes: "ℙ", prnap: "⪹", prnE: "⪵", prnsim: "⋨", prod: "∏", Product: "∏", profalar: "⌮", profline: "⌒", profsurf: "⌓", prop: "∝", Proportional: "∝", Proportion: "∷", propto: "∝", prsim: "≾", prurel: "⊰", Pscr: "𝒫", pscr: "𝓅", Psi: "Ψ", psi: "ψ", puncsp: " ", Qfr: "𝔔", qfr: "𝔮", qint: "⨌", qopf: "𝕢", Qopf: "ℚ", qprime: "⁗", Qscr: "𝒬", qscr: "𝓆", quaternions: "ℍ", quatint: "⨖", quest: "?", questeq: "≟", quot: "\"", QUOT: "\"", rAarr: "⇛", race: "∽̱", Racute: "Ŕ", racute: "ŕ", radic: "√", raemptyv: "⦳", rang: "⟩", Rang: "⟫", rangd: "⦒", range: "⦥", rangle: "⟩", raquo: "»", rarrap: "⥵", rarrb: "⇥", rarrbfs: "⤠", rarrc: "⤳", rarr: "→", Rarr: "↠", rArr: "⇒", rarrfs: "⤞", rarrhk: "↪", rarrlp: "↬", rarrpl: "⥅", rarrsim: "⥴", Rarrtl: "⤖", rarrtl: "↣", rarrw: "↝", ratail: "⤚", rAtail: "⤜", ratio: "∶", rationals: "ℚ", rbarr: "⤍", rBarr: "⤏", RBarr: "⤐", rbbrk: "❳", rbrace: "}", rbrack: "]", rbrke: "⦌", rbrksld: "⦎", rbrkslu: "⦐", Rcaron: "Ř", rcaron: "ř", Rcedil: "Ŗ", rcedil: "ŗ", rceil: "⌉", rcub: "}", Rcy: "Р", rcy: "р", rdca: "⤷", rdldhar: "⥩", rdquo: "”", rdquor: "”", rdsh: "↳", real: "ℜ", realine: "ℛ", realpart: "ℜ", reals: "ℝ", Re: "ℜ", rect: "▭", reg: "®", REG: "®", ReverseElement: "∋", ReverseEquilibrium: "⇋", ReverseUpEquilibrium: "⥯", rfisht: "⥽", rfloor: "⌋", rfr: "𝔯", Rfr: "ℜ", rHar: "⥤", rhard: "⇁", rharu: "⇀", rharul: "⥬", Rho: "Ρ", rho: "ρ", rhov: "ϱ", RightAngleBracket: "⟩", RightArrowBar: "⇥", rightarrow: "→", RightArrow: "→", Rightarrow: "⇒", RightArrowLeftArrow: "⇄", rightarrowtail: "↣", RightCeiling: "⌉", RightDoubleBracket: "⟧", RightDownTeeVector: "⥝", RightDownVectorBar: "⥕", RightDownVector: "⇂", RightFloor: "⌋", rightharpoondown: "⇁", rightharpoonup: "⇀", rightleftarrows: "⇄", rightleftharpoons: "⇌", rightrightarrows: "⇉", rightsquigarrow: "↝", RightTeeArrow: "↦", RightTee: "⊢", RightTeeVector: "⥛", rightthreetimes: "⋌", RightTriangleBar: "⧐", RightTriangle: "⊳", RightTriangleEqual: "⊵", RightUpDownVector: "⥏", RightUpTeeVector: "⥜", RightUpVectorBar: "⥔", RightUpVector: "↾", RightVectorBar: "⥓", RightVector: "⇀", ring: "˚", risingdotseq: "≓", rlarr: "⇄", rlhar: "⇌", rlm: "\u200f", rmoustache: "⎱", rmoust: "⎱", rnmid: "⫮", roang: "⟭", roarr: "⇾", robrk: "⟧", ropar: "⦆", ropf: "𝕣", Ropf: "ℝ", roplus: "⨮", rotimes: "⨵", RoundImplies: "⥰", rpar: ")", rpargt: "⦔", rppolint: "⨒", rrarr: "⇉", Rrightarrow: "⇛", rsaquo: "›", rscr: "𝓇", Rscr: "ℛ", rsh: "↱", Rsh: "↱", rsqb: "]", rsquo: "’", rsquor: "’", rthree: "⋌", rtimes: "⋊", rtri: "▹", rtrie: "⊵", rtrif: "▸", rtriltri: "⧎", RuleDelayed: "⧴", ruluhar: "⥨", rx: "℞", Sacute: "Ś", sacute: "ś", sbquo: "‚", scap: "⪸", Scaron: "Š", scaron: "š", Sc: "⪼", sc: "≻", sccue: "≽", sce: "⪰", scE: "⪴", Scedil: "Ş", scedil: "ş", Scirc: "Ŝ", scirc: "ŝ", scnap: "⪺", scnE: "⪶", scnsim: "⋩", scpolint: "⨓", scsim: "≿", Scy: "С", scy: "с", sdotb: "⊡", sdot: "⋅", sdote: "⩦", searhk: "⤥", searr: "↘", seArr: "⇘", searrow: "↘", sect: "§", semi: ";", seswar: "⤩", setminus: "∖", setmn: "∖", sext: "✶", Sfr: "𝔖", sfr: "𝔰", sfrown: "⌢", sharp: "♯", SHCHcy: "Щ", shchcy: "щ", SHcy: "Ш", shcy: "ш", ShortDownArrow: "↓", ShortLeftArrow: "←", shortmid: "∣", shortparallel: "∥", ShortRightArrow: "→", ShortUpArrow: "↑", shy: "\u00ad", Sigma: "Σ", sigma: "σ", sigmaf: "ς", sigmav: "ς", sim: "∼", simdot: "⩪", sime: "≃", simeq: "≃", simg: "⪞", simgE: "⪠", siml: "⪝", simlE: "⪟", simne: "≆", simplus: "⨤", simrarr: "⥲", slarr: "←", SmallCircle: "∘", smallsetminus: "∖", smashp: "⨳", smeparsl: "⧤", smid: "∣", smile: "⌣", smt: "⪪", smte: "⪬", smtes: "⪬︀", SOFTcy: "Ь", softcy: "ь", solbar: "⌿", solb: "⧄", sol: "/", Sopf: "𝕊", sopf: "𝕤", spades: "♠", spadesuit: "♠", spar: "∥", sqcap: "⊓", sqcaps: "⊓︀", sqcup: "⊔", sqcups: "⊔︀", Sqrt: "√", sqsub: "⊏", sqsube: "⊑", sqsubset: "⊏", sqsubseteq: "⊑", sqsup: "⊐", sqsupe: "⊒", sqsupset: "⊐", sqsupseteq: "⊒", square: "□", Square: "□", SquareIntersection: "⊓", SquareSubset: "⊏", SquareSubsetEqual: "⊑", SquareSuperset: "⊐", SquareSupersetEqual: "⊒", SquareUnion: "⊔", squarf: "▪", squ: "□", squf: "▪", srarr: "→", Sscr: "𝒮", sscr: "𝓈", ssetmn: "∖", ssmile: "⌣", sstarf: "⋆", Star: "⋆", star: "☆", starf: "★", straightepsilon: "ϵ", straightphi: "ϕ", strns: "¯", sub: "⊂", Sub: "⋐", subdot: "⪽", subE: "⫅", sube: "⊆", subedot: "⫃", submult: "⫁", subnE: "⫋", subne: "⊊", subplus: "⪿", subrarr: "⥹", subset: "⊂", Subset: "⋐", subseteq: "⊆", subseteqq: "⫅", SubsetEqual: "⊆", subsetneq: "⊊", subsetneqq: "⫋", subsim: "⫇", subsub: "⫕", subsup: "⫓", succapprox: "⪸", succ: "≻", succcurlyeq: "≽", Succeeds: "≻", SucceedsEqual: "⪰", SucceedsSlantEqual: "≽", SucceedsTilde: "≿", succeq: "⪰", succnapprox: "⪺", succneqq: "⪶", succnsim: "⋩", succsim: "≿", SuchThat: "∋", sum: "∑", Sum: "∑", sung: "♪", sup1: "¹", sup2: "²", sup3: "³", sup: "⊃", Sup: "⋑", supdot: "⪾", supdsub: "⫘", supE: "⫆", supe: "⊇", supedot: "⫄", Superset: "⊃", SupersetEqual: "⊇", suphsol: "⟉", suphsub: "⫗", suplarr: "⥻", supmult: "⫂", supnE: "⫌", supne: "⊋", supplus: "⫀", supset: "⊃", Supset: "⋑", supseteq: "⊇", supseteqq: "⫆", supsetneq: "⊋", supsetneqq: "⫌", supsim: "⫈", supsub: "⫔", supsup: "⫖", swarhk: "⤦", swarr: "↙", swArr: "⇙", swarrow: "↙", swnwar: "⤪", szlig: "ß", Tab: "\u0009", target: "⌖", Tau: "Τ", tau: "τ", tbrk: "⎴", Tcaron: "Ť", tcaron: "ť", Tcedil: "Ţ", tcedil: "ţ", Tcy: "Т", tcy: "т", tdot: "⃛", telrec: "⌕", Tfr: "𝔗", tfr: "𝔱", there4: "∴", therefore: "∴", Therefore: "∴", Theta: "Θ", theta: "θ", thetasym: "ϑ", thetav: "ϑ", thickapprox: "≈", thicksim: "∼", ThickSpace: "  ", ThinSpace: " ", thinsp: " ", thkap: "≈", thksim: "∼", THORN: "Þ", thorn: "þ", tilde: "˜", Tilde: "∼", TildeEqual: "≃", TildeFullEqual: "≅", TildeTilde: "≈", timesbar: "⨱", timesb: "⊠", times: "×", timesd: "⨰", tint: "∭", toea: "⤨", topbot: "⌶", topcir: "⫱", top: "⊤", Topf: "𝕋", topf: "𝕥", topfork: "⫚", tosa: "⤩", tprime: "‴", trade: "™", TRADE: "™", triangle: "▵", triangledown: "▿", triangleleft: "◃", trianglelefteq: "⊴", triangleq: "≜", triangleright: "▹", trianglerighteq: "⊵", tridot: "◬", trie: "≜", triminus: "⨺", TripleDot: "⃛", triplus: "⨹", trisb: "⧍", tritime: "⨻", trpezium: "⏢", Tscr: "𝒯", tscr: "𝓉", TScy: "Ц", tscy: "ц", TSHcy: "Ћ", tshcy: "ћ", Tstrok: "Ŧ", tstrok: "ŧ", twixt: "≬", twoheadleftarrow: "↞", twoheadrightarrow: "↠", Uacute: "Ú", uacute: "ú", uarr: "↑", Uarr: "↟", uArr: "⇑", Uarrocir: "⥉", Ubrcy: "Ў", ubrcy: "ў", Ubreve: "Ŭ", ubreve: "ŭ", Ucirc: "Û", ucirc: "û", Ucy: "У", ucy: "у", udarr: "⇅", Udblac: "Ű", udblac: "ű", udhar: "⥮", ufisht: "⥾", Ufr: "𝔘", ufr: "𝔲", Ugrave: "Ù", ugrave: "ù", uHar: "⥣", uharl: "↿", uharr: "↾", uhblk: "▀", ulcorn: "⌜", ulcorner: "⌜", ulcrop: "⌏", ultri: "◸", Umacr: "Ū", umacr: "ū", uml: "¨", UnderBar: "_", UnderBrace: "⏟", UnderBracket: "⎵", UnderParenthesis: "⏝", Union: "⋃", UnionPlus: "⊎", Uogon: "Ų", uogon: "ų", Uopf: "𝕌", uopf: "𝕦", UpArrowBar: "⤒", uparrow: "↑", UpArrow: "↑", Uparrow: "⇑", UpArrowDownArrow: "⇅", updownarrow: "↕", UpDownArrow: "↕", Updownarrow: "⇕", UpEquilibrium: "⥮", upharpoonleft: "↿", upharpoonright: "↾", uplus: "⊎", UpperLeftArrow: "↖", UpperRightArrow: "↗", upsi: "υ", Upsi: "ϒ", upsih: "ϒ", Upsilon: "Υ", upsilon: "υ", UpTeeArrow: "↥", UpTee: "⊥", upuparrows: "⇈", urcorn: "⌝", urcorner: "⌝", urcrop: "⌎", Uring: "Ů", uring: "ů", urtri: "◹", Uscr: "𝒰", uscr: "𝓊", utdot: "⋰", Utilde: "Ũ", utilde: "ũ", utri: "▵", utrif: "▴", uuarr: "⇈", Uuml: "Ü", uuml: "ü", uwangle: "⦧", vangrt: "⦜", varepsilon: "ϵ", varkappa: "ϰ", varnothing: "∅", varphi: "ϕ", varpi: "ϖ", varpropto: "∝", varr: "↕", vArr: "⇕", varrho: "ϱ", varsigma: "ς", varsubsetneq: "⊊︀", varsubsetneqq: "⫋︀", varsupsetneq: "⊋︀", varsupsetneqq: "⫌︀", vartheta: "ϑ", vartriangleleft: "⊲", vartriangleright: "⊳", vBar: "⫨", Vbar: "⫫", vBarv: "⫩", Vcy: "В", vcy: "в", vdash: "⊢", vDash: "⊨", Vdash: "⊩", VDash: "⊫", Vdashl: "⫦", veebar: "⊻", vee: "∨", Vee: "⋁", veeeq: "≚", vellip: "⋮", verbar: "|", Verbar: "‖", vert: "|", Vert: "‖", VerticalBar: "∣", VerticalLine: "|", VerticalSeparator: "❘", VerticalTilde: "≀", VeryThinSpace: " ", Vfr: "𝔙", vfr: "𝔳", vltri: "⊲", vnsub: "⊂⃒", vnsup: "⊃⃒", Vopf: "𝕍", vopf: "𝕧", vprop: "∝", vrtri: "⊳", Vscr: "𝒱", vscr: "𝓋", vsubnE: "⫋︀", vsubne: "⊊︀", vsupnE: "⫌︀", vsupne: "⊋︀", Vvdash: "⊪", vzigzag: "⦚", Wcirc: "Ŵ", wcirc: "ŵ", wedbar: "⩟", wedge: "∧", Wedge: "⋀", wedgeq: "≙", weierp: "℘", Wfr: "𝔚", wfr: "𝔴", Wopf: "𝕎", wopf: "𝕨", wp: "℘", wr: "≀", wreath: "≀", Wscr: "𝒲", wscr: "𝓌", xcap: "⋂", xcirc: "◯", xcup: "⋃", xdtri: "▽", Xfr: "𝔛", xfr: "𝔵", xharr: "⟷", xhArr: "⟺", Xi: "Ξ", xi: "ξ", xlarr: "⟵", xlArr: "⟸", xmap: "⟼", xnis: "⋻", xodot: "⨀", Xopf: "𝕏", xopf: "𝕩", xoplus: "⨁", xotime: "⨂", xrarr: "⟶", xrArr: "⟹", Xscr: "𝒳", xscr: "𝓍", xsqcup: "⨆", xuplus: "⨄", xutri: "△", xvee: "⋁", xwedge: "⋀", Yacute: "Ý", yacute: "ý", YAcy: "Я", yacy: "я", Ycirc: "Ŷ", ycirc: "ŷ", Ycy: "Ы", ycy: "ы", yen: "¥", Yfr: "𝔜", yfr: "𝔶", YIcy: "Ї", yicy: "ї", Yopf: "𝕐", yopf: "𝕪", Yscr: "𝒴", yscr: "𝓎", YUcy: "Ю", yucy: "ю", yuml: "ÿ", Yuml: "Ÿ", Zacute: "Ź", zacute: "ź", Zcaron: "Ž", zcaron: "ž", Zcy: "З", zcy: "з", Zdot: "Ż", zdot: "ż", zeetrf: "ℨ", ZeroWidthSpace: "​", Zeta: "Ζ", zeta: "ζ", zfr: "𝔷", Zfr: "ℨ", ZHcy: "Ж", zhcy: "ж", zigrarr: "⇝", zopf: "𝕫", Zopf: "ℤ", Zscr: "𝒵", zscr: "𝓏", zwj: "\u200d", zwnj: "\u200c"
8100  };
8101  
8102  var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/;
8103  var CHARCODE = /^#([0-9]+)$/;
8104  var NAMED = /^([A-Za-z0-9]+)$/;
8105  var EntityParser = /** @class */ (function () {
8106      function EntityParser(named) {
8107          this.named = named;
8108      }
8109      EntityParser.prototype.parse = function (entity) {
8110          if (!entity) {
8111              return;
8112          }
8113          var matches = entity.match(HEXCHARCODE);
8114          if (matches) {
8115              return String.fromCharCode(parseInt(matches[1], 16));
8116          }
8117          matches = entity.match(CHARCODE);
8118          if (matches) {
8119              return String.fromCharCode(parseInt(matches[1], 10));
8120          }
8121          matches = entity.match(NAMED);
8122          if (matches) {
8123              return this.named[matches[1]];
8124          }
8125      };
8126      return EntityParser;
8127  }());
8128  
8129  var WSP = /[\t\n\f ]/;
8130  var ALPHA = /[A-Za-z]/;
8131  var CRLF = /\r\n?/g;
8132  function isSpace(char) {
8133      return WSP.test(char);
8134  }
8135  function isAlpha(char) {
8136      return ALPHA.test(char);
8137  }
8138  function preprocessInput(input) {
8139      return input.replace(CRLF, '\n');
8140  }
8141  
8142  var EventedTokenizer = /** @class */ (function () {
8143      function EventedTokenizer(delegate, entityParser) {
8144          this.delegate = delegate;
8145          this.entityParser = entityParser;
8146          this.state = "beforeData" /* beforeData */;
8147          this.line = -1;
8148          this.column = -1;
8149          this.input = '';
8150          this.index = -1;
8151          this.tagNameBuffer = '';
8152          this.states = {
8153              beforeData: function () {
8154                  var char = this.peek();
8155                  if (char === '<' && !this.isIgnoredEndTag()) {
8156                      this.transitionTo("tagOpen" /* tagOpen */);
8157                      this.markTagStart();
8158                      this.consume();
8159                  }
8160                  else {
8161                      if (char === '\n') {
8162                          var tag = this.tagNameBuffer.toLowerCase();
8163                          if (tag === 'pre' || tag === 'textarea') {
8164                              this.consume();
8165                          }
8166                      }
8167                      this.transitionTo("data" /* data */);
8168                      this.delegate.beginData();
8169                  }
8170              },
8171              data: function () {
8172                  var char = this.peek();
8173                  var tag = this.tagNameBuffer;
8174                  if (char === '<' && !this.isIgnoredEndTag()) {
8175                      this.delegate.finishData();
8176                      this.transitionTo("tagOpen" /* tagOpen */);
8177                      this.markTagStart();
8178                      this.consume();
8179                  }
8180                  else if (char === '&' && tag !== 'script' && tag !== 'style') {
8181                      this.consume();
8182                      this.delegate.appendToData(this.consumeCharRef() || '&');
8183                  }
8184                  else {
8185                      this.consume();
8186                      this.delegate.appendToData(char);
8187                  }
8188              },
8189              tagOpen: function () {
8190                  var char = this.consume();
8191                  if (char === '!') {
8192                      this.transitionTo("markupDeclarationOpen" /* markupDeclarationOpen */);
8193                  }
8194                  else if (char === '/') {
8195                      this.transitionTo("endTagOpen" /* endTagOpen */);
8196                  }
8197                  else if (char === '@' || char === ':' || isAlpha(char)) {
8198                      this.transitionTo("tagName" /* tagName */);
8199                      this.tagNameBuffer = '';
8200                      this.delegate.beginStartTag();
8201                      this.appendToTagName(char);
8202                  }
8203              },
8204              markupDeclarationOpen: function () {
8205                  var char = this.consume();
8206                  if (char === '-' && this.peek() === '-') {
8207                      this.consume();
8208                      this.transitionTo("commentStart" /* commentStart */);
8209                      this.delegate.beginComment();
8210                  }
8211              },
8212              commentStart: function () {
8213                  var char = this.consume();
8214                  if (char === '-') {
8215                      this.transitionTo("commentStartDash" /* commentStartDash */);
8216                  }
8217                  else if (char === '>') {
8218                      this.delegate.finishComment();
8219                      this.transitionTo("beforeData" /* beforeData */);
8220                  }
8221                  else {
8222                      this.delegate.appendToCommentData(char);
8223                      this.transitionTo("comment" /* comment */);
8224                  }
8225              },
8226              commentStartDash: function () {
8227                  var char = this.consume();
8228                  if (char === '-') {
8229                      this.transitionTo("commentEnd" /* commentEnd */);
8230                  }
8231                  else if (char === '>') {
8232                      this.delegate.finishComment();
8233                      this.transitionTo("beforeData" /* beforeData */);
8234                  }
8235                  else {
8236                      this.delegate.appendToCommentData('-');
8237                      this.transitionTo("comment" /* comment */);
8238                  }
8239              },
8240              comment: function () {
8241                  var char = this.consume();
8242                  if (char === '-') {
8243                      this.transitionTo("commentEndDash" /* commentEndDash */);
8244                  }
8245                  else {
8246                      this.delegate.appendToCommentData(char);
8247                  }
8248              },
8249              commentEndDash: function () {
8250                  var char = this.consume();
8251                  if (char === '-') {
8252                      this.transitionTo("commentEnd" /* commentEnd */);
8253                  }
8254                  else {
8255                      this.delegate.appendToCommentData('-' + char);
8256                      this.transitionTo("comment" /* comment */);
8257                  }
8258              },
8259              commentEnd: function () {
8260                  var char = this.consume();
8261                  if (char === '>') {
8262                      this.delegate.finishComment();
8263                      this.transitionTo("beforeData" /* beforeData */);
8264                  }
8265                  else {
8266                      this.delegate.appendToCommentData('--' + char);
8267                      this.transitionTo("comment" /* comment */);
8268                  }
8269              },
8270              tagName: function () {
8271                  var char = this.consume();
8272                  if (isSpace(char)) {
8273                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8274                  }
8275                  else if (char === '/') {
8276                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8277                  }
8278                  else if (char === '>') {
8279                      this.delegate.finishTag();
8280                      this.transitionTo("beforeData" /* beforeData */);
8281                  }
8282                  else {
8283                      this.appendToTagName(char);
8284                  }
8285              },
8286              endTagName: function () {
8287                  var char = this.consume();
8288                  if (isSpace(char)) {
8289                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8290                      this.tagNameBuffer = '';
8291                  }
8292                  else if (char === '/') {
8293                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8294                      this.tagNameBuffer = '';
8295                  }
8296                  else if (char === '>') {
8297                      this.delegate.finishTag();
8298                      this.transitionTo("beforeData" /* beforeData */);
8299                      this.tagNameBuffer = '';
8300                  }
8301                  else {
8302                      this.appendToTagName(char);
8303                  }
8304              },
8305              beforeAttributeName: function () {
8306                  var char = this.peek();
8307                  if (isSpace(char)) {
8308                      this.consume();
8309                      return;
8310                  }
8311                  else if (char === '/') {
8312                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8313                      this.consume();
8314                  }
8315                  else if (char === '>') {
8316                      this.consume();
8317                      this.delegate.finishTag();
8318                      this.transitionTo("beforeData" /* beforeData */);
8319                  }
8320                  else if (char === '=') {
8321                      this.delegate.reportSyntaxError('attribute name cannot start with equals sign');
8322                      this.transitionTo("attributeName" /* attributeName */);
8323                      this.delegate.beginAttribute();
8324                      this.consume();
8325                      this.delegate.appendToAttributeName(char);
8326                  }
8327                  else {
8328                      this.transitionTo("attributeName" /* attributeName */);
8329                      this.delegate.beginAttribute();
8330                  }
8331              },
8332              attributeName: function () {
8333                  var char = this.peek();
8334                  if (isSpace(char)) {
8335                      this.transitionTo("afterAttributeName" /* afterAttributeName */);
8336                      this.consume();
8337                  }
8338                  else if (char === '/') {
8339                      this.delegate.beginAttributeValue(false);
8340                      this.delegate.finishAttributeValue();
8341                      this.consume();
8342                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8343                  }
8344                  else if (char === '=') {
8345                      this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
8346                      this.consume();
8347                  }
8348                  else if (char === '>') {
8349                      this.delegate.beginAttributeValue(false);
8350                      this.delegate.finishAttributeValue();
8351                      this.consume();
8352                      this.delegate.finishTag();
8353                      this.transitionTo("beforeData" /* beforeData */);
8354                  }
8355                  else if (char === '"' || char === "'" || char === '<') {
8356                      this.delegate.reportSyntaxError(char + ' is not a valid character within attribute names');
8357                      this.consume();
8358                      this.delegate.appendToAttributeName(char);
8359                  }
8360                  else {
8361                      this.consume();
8362                      this.delegate.appendToAttributeName(char);
8363                  }
8364              },
8365              afterAttributeName: function () {
8366                  var char = this.peek();
8367                  if (isSpace(char)) {
8368                      this.consume();
8369                      return;
8370                  }
8371                  else if (char === '/') {
8372                      this.delegate.beginAttributeValue(false);
8373                      this.delegate.finishAttributeValue();
8374                      this.consume();
8375                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8376                  }
8377                  else if (char === '=') {
8378                      this.consume();
8379                      this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
8380                  }
8381                  else if (char === '>') {
8382                      this.delegate.beginAttributeValue(false);
8383                      this.delegate.finishAttributeValue();
8384                      this.consume();
8385                      this.delegate.finishTag();
8386                      this.transitionTo("beforeData" /* beforeData */);
8387                  }
8388                  else {
8389                      this.delegate.beginAttributeValue(false);
8390                      this.delegate.finishAttributeValue();
8391                      this.transitionTo("attributeName" /* attributeName */);
8392                      this.delegate.beginAttribute();
8393                      this.consume();
8394                      this.delegate.appendToAttributeName(char);
8395                  }
8396              },
8397              beforeAttributeValue: function () {
8398                  var char = this.peek();
8399                  if (isSpace(char)) {
8400                      this.consume();
8401                  }
8402                  else if (char === '"') {
8403                      this.transitionTo("attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */);
8404                      this.delegate.beginAttributeValue(true);
8405                      this.consume();
8406                  }
8407                  else if (char === "'") {
8408                      this.transitionTo("attributeValueSingleQuoted" /* attributeValueSingleQuoted */);
8409                      this.delegate.beginAttributeValue(true);
8410                      this.consume();
8411                  }
8412                  else if (char === '>') {
8413                      this.delegate.beginAttributeValue(false);
8414                      this.delegate.finishAttributeValue();
8415                      this.consume();
8416                      this.delegate.finishTag();
8417                      this.transitionTo("beforeData" /* beforeData */);
8418                  }
8419                  else {
8420                      this.transitionTo("attributeValueUnquoted" /* attributeValueUnquoted */);
8421                      this.delegate.beginAttributeValue(false);
8422                      this.consume();
8423                      this.delegate.appendToAttributeValue(char);
8424                  }
8425              },
8426              attributeValueDoubleQuoted: function () {
8427                  var char = this.consume();
8428                  if (char === '"') {
8429                      this.delegate.finishAttributeValue();
8430                      this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
8431                  }
8432                  else if (char === '&') {
8433                      this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
8434                  }
8435                  else {
8436                      this.delegate.appendToAttributeValue(char);
8437                  }
8438              },
8439              attributeValueSingleQuoted: function () {
8440                  var char = this.consume();
8441                  if (char === "'") {
8442                      this.delegate.finishAttributeValue();
8443                      this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
8444                  }
8445                  else if (char === '&') {
8446                      this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
8447                  }
8448                  else {
8449                      this.delegate.appendToAttributeValue(char);
8450                  }
8451              },
8452              attributeValueUnquoted: function () {
8453                  var char = this.peek();
8454                  if (isSpace(char)) {
8455                      this.delegate.finishAttributeValue();
8456                      this.consume();
8457                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8458                  }
8459                  else if (char === '/') {
8460                      this.delegate.finishAttributeValue();
8461                      this.consume();
8462                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8463                  }
8464                  else if (char === '&') {
8465                      this.consume();
8466                      this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
8467                  }
8468                  else if (char === '>') {
8469                      this.delegate.finishAttributeValue();
8470                      this.consume();
8471                      this.delegate.finishTag();
8472                      this.transitionTo("beforeData" /* beforeData */);
8473                  }
8474                  else {
8475                      this.consume();
8476                      this.delegate.appendToAttributeValue(char);
8477                  }
8478              },
8479              afterAttributeValueQuoted: function () {
8480                  var char = this.peek();
8481                  if (isSpace(char)) {
8482                      this.consume();
8483                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8484                  }
8485                  else if (char === '/') {
8486                      this.consume();
8487                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8488                  }
8489                  else if (char === '>') {
8490                      this.consume();
8491                      this.delegate.finishTag();
8492                      this.transitionTo("beforeData" /* beforeData */);
8493                  }
8494                  else {
8495                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8496                  }
8497              },
8498              selfClosingStartTag: function () {
8499                  var char = this.peek();
8500                  if (char === '>') {
8501                      this.consume();
8502                      this.delegate.markTagAsSelfClosing();
8503                      this.delegate.finishTag();
8504                      this.transitionTo("beforeData" /* beforeData */);
8505                  }
8506                  else {
8507                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8508                  }
8509              },
8510              endTagOpen: function () {
8511                  var char = this.consume();
8512                  if (char === '@' || char === ':' || isAlpha(char)) {
8513                      this.transitionTo("endTagName" /* endTagName */);
8514                      this.tagNameBuffer = '';
8515                      this.delegate.beg