[ 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 = 442);
  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  /***/ 103:
 105  /***/ (function(module, exports) {
 106  
 107  (function() { module.exports = this["wp"]["autop"]; }());
 108  
 109  /***/ }),
 110  
 111  /***/ 125:
 112  /***/ (function(module, exports) {
 113  
 114  (function() { module.exports = this["wp"]["shortcode"]; }());
 115  
 116  /***/ }),
 117  
 118  /***/ 14:
 119  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 120  
 121  "use strict";
 122  
 123  // EXPORTS
 124  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
 125  
 126  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 127  var arrayWithHoles = __webpack_require__(38);
 128  
 129  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 130  function _iterableToArrayLimit(arr, i) {
 131    if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
 132    var _arr = [];
 133    var _n = true;
 134    var _d = false;
 135    var _e = undefined;
 136  
 137    try {
 138      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 139        _arr.push(_s.value);
 140  
 141        if (i && _arr.length === i) break;
 142      }
 143    } catch (err) {
 144      _d = true;
 145      _e = err;
 146    } finally {
 147      try {
 148        if (!_n && _i["return"] != null) _i["return"]();
 149      } finally {
 150        if (_d) throw _e;
 151      }
 152    }
 153  
 154    return _arr;
 155  }
 156  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 157  var unsupportedIterableToArray = __webpack_require__(29);
 158  
 159  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 160  var nonIterableRest = __webpack_require__(39);
 161  
 162  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 163  
 164  
 165  
 166  
 167  function _slicedToArray(arr, i) {
 168    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
 169  }
 170  
 171  /***/ }),
 172  
 173  /***/ 146:
 174  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 175  
 176  "use strict";
 177  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toArray; });
 178  /* harmony import */ var _arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38);
 179  /* harmony import */ var _iterableToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
 180  /* harmony import */ var _unsupportedIterableToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29);
 181  /* harmony import */ var _nonIterableRest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39);
 182  
 183  
 184  
 185  
 186  function _toArray(arr) {
 187    return Object(_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(arr) || Object(_iterableToArray__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(arr) || Object(_unsupportedIterableToArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(arr) || Object(_nonIterableRest__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])();
 188  }
 189  
 190  /***/ }),
 191  
 192  /***/ 18:
 193  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 194  
 195  "use strict";
 196  
 197  // EXPORTS
 198  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
 199  
 200  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
 201  var arrayLikeToArray = __webpack_require__(26);
 202  
 203  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 204  
 205  function _arrayWithoutHoles(arr) {
 206    if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
 207  }
 208  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 209  var iterableToArray = __webpack_require__(35);
 210  
 211  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 212  var unsupportedIterableToArray = __webpack_require__(29);
 213  
 214  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 215  function _nonIterableSpread() {
 216    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 217  }
 218  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 219  
 220  
 221  
 222  
 223  function _toConsumableArray(arr) {
 224    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 225  }
 226  
 227  /***/ }),
 228  
 229  /***/ 19:
 230  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 231  
 232  "use strict";
 233  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 234  function _defineProperties(target, props) {
 235    for (var i = 0; i < props.length; i++) {
 236      var descriptor = props[i];
 237      descriptor.enumerable = descriptor.enumerable || false;
 238      descriptor.configurable = true;
 239      if ("value" in descriptor) descriptor.writable = true;
 240      Object.defineProperty(target, descriptor.key, descriptor);
 241    }
 242  }
 243  
 244  function _createClass(Constructor, protoProps, staticProps) {
 245    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 246    if (staticProps) _defineProperties(Constructor, staticProps);
 247    return Constructor;
 248  }
 249  
 250  /***/ }),
 251  
 252  /***/ 2:
 253  /***/ (function(module, exports) {
 254  
 255  (function() { module.exports = this["lodash"]; }());
 256  
 257  /***/ }),
 258  
 259  /***/ 20:
 260  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 261  
 262  "use strict";
 263  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 264  function _classCallCheck(instance, Constructor) {
 265    if (!(instance instanceof Constructor)) {
 266      throw new TypeError("Cannot call a class as a function");
 267    }
 268  }
 269  
 270  /***/ }),
 271  
 272  /***/ 201:
 273  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 274  
 275  "use strict";
 276  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
 277  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
 278  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
 279  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
 280  
 281  
 282  /**
 283   * WordPress dependencies
 284   */
 285  
 286  var blockDefault = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
 287    xmlns: "http://www.w3.org/2000/svg",
 288    viewBox: "0 0 24 24"
 289  }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
 290    d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
 291  }));
 292  /* harmony default export */ __webpack_exports__["a"] = (blockDefault);
 293  
 294  
 295  /***/ }),
 296  
 297  /***/ 26:
 298  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 299  
 300  "use strict";
 301  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
 302  function _arrayLikeToArray(arr, len) {
 303    if (len == null || len > arr.length) len = arr.length;
 304  
 305    for (var i = 0, arr2 = new Array(len); i < len; i++) {
 306      arr2[i] = arr[i];
 307    }
 308  
 309    return arr2;
 310  }
 311  
 312  /***/ }),
 313  
 314  /***/ 267:
 315  /***/ (function(module, exports) {
 316  
 317  (function() { module.exports = this["wp"]["blockSerializationDefaultParser"]; }());
 318  
 319  /***/ }),
 320  
 321  /***/ 268:
 322  /***/ (function(module, exports, __webpack_require__) {
 323  
 324  var __WEBPACK_AMD_DEFINE_RESULT__;;/*! showdown v 1.9.1 - 02-11-2019 */
 325  (function(){
 326  /**
 327   * Created by Tivie on 13-07-2015.
 328   */
 329  
 330  function getDefaultOpts (simple) {
 331    'use strict';
 332  
 333    var defaultOptions = {
 334      omitExtraWLInCodeBlocks: {
 335        defaultValue: false,
 336        describe: 'Omit the default extra whiteline added to code blocks',
 337        type: 'boolean'
 338      },
 339      noHeaderId: {
 340        defaultValue: false,
 341        describe: 'Turn on/off generated header id',
 342        type: 'boolean'
 343      },
 344      prefixHeaderId: {
 345        defaultValue: false,
 346        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',
 347        type: 'string'
 348      },
 349      rawPrefixHeaderId: {
 350        defaultValue: false,
 351        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)',
 352        type: 'boolean'
 353      },
 354      ghCompatibleHeaderId: {
 355        defaultValue: false,
 356        describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',
 357        type: 'boolean'
 358      },
 359      rawHeaderId: {
 360        defaultValue: false,
 361        describe: 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',
 362        type: 'boolean'
 363      },
 364      headerLevelStart: {
 365        defaultValue: false,
 366        describe: 'The header blocks level start',
 367        type: 'integer'
 368      },
 369      parseImgDimensions: {
 370        defaultValue: false,
 371        describe: 'Turn on/off image dimension parsing',
 372        type: 'boolean'
 373      },
 374      simplifiedAutoLink: {
 375        defaultValue: false,
 376        describe: 'Turn on/off GFM autolink style',
 377        type: 'boolean'
 378      },
 379      excludeTrailingPunctuationFromURLs: {
 380        defaultValue: false,
 381        describe: 'Excludes trailing punctuation from links generated with autoLinking',
 382        type: 'boolean'
 383      },
 384      literalMidWordUnderscores: {
 385        defaultValue: false,
 386        describe: 'Parse midword underscores as literal underscores',
 387        type: 'boolean'
 388      },
 389      literalMidWordAsterisks: {
 390        defaultValue: false,
 391        describe: 'Parse midword asterisks as literal asterisks',
 392        type: 'boolean'
 393      },
 394      strikethrough: {
 395        defaultValue: false,
 396        describe: 'Turn on/off strikethrough support',
 397        type: 'boolean'
 398      },
 399      tables: {
 400        defaultValue: false,
 401        describe: 'Turn on/off tables support',
 402        type: 'boolean'
 403      },
 404      tablesHeaderId: {
 405        defaultValue: false,
 406        describe: 'Add an id to table headers',
 407        type: 'boolean'
 408      },
 409      ghCodeBlocks: {
 410        defaultValue: true,
 411        describe: 'Turn on/off GFM fenced code blocks support',
 412        type: 'boolean'
 413      },
 414      tasklists: {
 415        defaultValue: false,
 416        describe: 'Turn on/off GFM tasklist support',
 417        type: 'boolean'
 418      },
 419      smoothLivePreview: {
 420        defaultValue: false,
 421        describe: 'Prevents weird effects in live previews due to incomplete input',
 422        type: 'boolean'
 423      },
 424      smartIndentationFix: {
 425        defaultValue: false,
 426        description: 'Tries to smartly fix indentation in es6 strings',
 427        type: 'boolean'
 428      },
 429      disableForced4SpacesIndentedSublists: {
 430        defaultValue: false,
 431        description: 'Disables the requirement of indenting nested sublists by 4 spaces',
 432        type: 'boolean'
 433      },
 434      simpleLineBreaks: {
 435        defaultValue: false,
 436        description: 'Parses simple line breaks as <br> (GFM Style)',
 437        type: 'boolean'
 438      },
 439      requireSpaceBeforeHeadingText: {
 440        defaultValue: false,
 441        description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
 442        type: 'boolean'
 443      },
 444      ghMentions: {
 445        defaultValue: false,
 446        description: 'Enables github @mentions',
 447        type: 'boolean'
 448      },
 449      ghMentionsLink: {
 450        defaultValue: 'https://github.com/{u}',
 451        description: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
 452        type: 'string'
 453      },
 454      encodeEmails: {
 455        defaultValue: true,
 456        description: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
 457        type: 'boolean'
 458      },
 459      openLinksInNewWindow: {
 460        defaultValue: false,
 461        description: 'Open all links in new windows',
 462        type: 'boolean'
 463      },
 464      backslashEscapesHTMLTags: {
 465        defaultValue: false,
 466        description: 'Support for HTML Tag escaping. ex: \<div>foo\</div>',
 467        type: 'boolean'
 468      },
 469      emoji: {
 470        defaultValue: false,
 471        description: 'Enable emoji support. Ex: `this is a :smile: emoji`',
 472        type: 'boolean'
 473      },
 474      underline: {
 475        defaultValue: false,
 476        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>`',
 477        type: 'boolean'
 478      },
 479      completeHTMLDocument: {
 480        defaultValue: false,
 481        description: 'Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags',
 482        type: 'boolean'
 483      },
 484      metadata: {
 485        defaultValue: false,
 486        description: 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).',
 487        type: 'boolean'
 488      },
 489      splitAdjacentBlockquotes: {
 490        defaultValue: false,
 491        description: 'Split adjacent blockquote blocks',
 492        type: 'boolean'
 493      }
 494    };
 495    if (simple === false) {
 496      return JSON.parse(JSON.stringify(defaultOptions));
 497    }
 498    var ret = {};
 499    for (var opt in defaultOptions) {
 500      if (defaultOptions.hasOwnProperty(opt)) {
 501        ret[opt] = defaultOptions[opt].defaultValue;
 502      }
 503    }
 504    return ret;
 505  }
 506  
 507  function allOptionsOn () {
 508    'use strict';
 509    var options = getDefaultOpts(true),
 510        ret = {};
 511    for (var opt in options) {
 512      if (options.hasOwnProperty(opt)) {
 513        ret[opt] = true;
 514      }
 515    }
 516    return ret;
 517  }
 518  
 519  /**
 520   * Created by Tivie on 06-01-2015.
 521   */
 522  
 523  // Private properties
 524  var showdown = {},
 525      parsers = {},
 526      extensions = {},
 527      globalOptions = getDefaultOpts(true),
 528      setFlavor = 'vanilla',
 529      flavor = {
 530        github: {
 531          omitExtraWLInCodeBlocks:              true,
 532          simplifiedAutoLink:                   true,
 533          excludeTrailingPunctuationFromURLs:   true,
 534          literalMidWordUnderscores:            true,
 535          strikethrough:                        true,
 536          tables:                               true,
 537          tablesHeaderId:                       true,
 538          ghCodeBlocks:                         true,
 539          tasklists:                            true,
 540          disableForced4SpacesIndentedSublists: true,
 541          simpleLineBreaks:                     true,
 542          requireSpaceBeforeHeadingText:        true,
 543          ghCompatibleHeaderId:                 true,
 544          ghMentions:                           true,
 545          backslashEscapesHTMLTags:             true,
 546          emoji:                                true,
 547          splitAdjacentBlockquotes:             true
 548        },
 549        original: {
 550          noHeaderId:                           true,
 551          ghCodeBlocks:                         false
 552        },
 553        ghost: {
 554          omitExtraWLInCodeBlocks:              true,
 555          parseImgDimensions:                   true,
 556          simplifiedAutoLink:                   true,
 557          excludeTrailingPunctuationFromURLs:   true,
 558          literalMidWordUnderscores:            true,
 559          strikethrough:                        true,
 560          tables:                               true,
 561          tablesHeaderId:                       true,
 562          ghCodeBlocks:                         true,
 563          tasklists:                            true,
 564          smoothLivePreview:                    true,
 565          simpleLineBreaks:                     true,
 566          requireSpaceBeforeHeadingText:        true,
 567          ghMentions:                           false,
 568          encodeEmails:                         true
 569        },
 570        vanilla: getDefaultOpts(true),
 571        allOn: allOptionsOn()
 572      };
 573  
 574  /**
 575   * helper namespace
 576   * @type {{}}
 577   */
 578  showdown.helper = {};
 579  
 580  /**
 581   * TODO LEGACY SUPPORT CODE
 582   * @type {{}}
 583   */
 584  showdown.extensions = {};
 585  
 586  /**
 587   * Set a global option
 588   * @static
 589   * @param {string} key
 590   * @param {*} value
 591   * @returns {showdown}
 592   */
 593  showdown.setOption = function (key, value) {
 594    'use strict';
 595    globalOptions[key] = value;
 596    return this;
 597  };
 598  
 599  /**
 600   * Get a global option
 601   * @static
 602   * @param {string} key
 603   * @returns {*}
 604   */
 605  showdown.getOption = function (key) {
 606    'use strict';
 607    return globalOptions[key];
 608  };
 609  
 610  /**
 611   * Get the global options
 612   * @static
 613   * @returns {{}}
 614   */
 615  showdown.getOptions = function () {
 616    'use strict';
 617    return globalOptions;
 618  };
 619  
 620  /**
 621   * Reset global options to the default values
 622   * @static
 623   */
 624  showdown.resetOptions = function () {
 625    'use strict';
 626    globalOptions = getDefaultOpts(true);
 627  };
 628  
 629  /**
 630   * Set the flavor showdown should use as default
 631   * @param {string} name
 632   */
 633  showdown.setFlavor = function (name) {
 634    'use strict';
 635    if (!flavor.hasOwnProperty(name)) {
 636      throw Error(name + ' flavor was not found');
 637    }
 638    showdown.resetOptions();
 639    var preset = flavor[name];
 640    setFlavor = name;
 641    for (var option in preset) {
 642      if (preset.hasOwnProperty(option)) {
 643        globalOptions[option] = preset[option];
 644      }
 645    }
 646  };
 647  
 648  /**
 649   * Get the currently set flavor
 650   * @returns {string}
 651   */
 652  showdown.getFlavor = function () {
 653    'use strict';
 654    return setFlavor;
 655  };
 656  
 657  /**
 658   * Get the options of a specified flavor. Returns undefined if the flavor was not found
 659   * @param {string} name Name of the flavor
 660   * @returns {{}|undefined}
 661   */
 662  showdown.getFlavorOptions = function (name) {
 663    'use strict';
 664    if (flavor.hasOwnProperty(name)) {
 665      return flavor[name];
 666    }
 667  };
 668  
 669  /**
 670   * Get the default options
 671   * @static
 672   * @param {boolean} [simple=true]
 673   * @returns {{}}
 674   */
 675  showdown.getDefaultOptions = function (simple) {
 676    'use strict';
 677    return getDefaultOpts(simple);
 678  };
 679  
 680  /**
 681   * Get or set a subParser
 682   *
 683   * subParser(name)       - Get a registered subParser
 684   * subParser(name, func) - Register a subParser
 685   * @static
 686   * @param {string} name
 687   * @param {function} [func]
 688   * @returns {*}
 689   */
 690  showdown.subParser = function (name, func) {
 691    'use strict';
 692    if (showdown.helper.isString(name)) {
 693      if (typeof func !== 'undefined') {
 694        parsers[name] = func;
 695      } else {
 696        if (parsers.hasOwnProperty(name)) {
 697          return parsers[name];
 698        } else {
 699          throw Error('SubParser named ' + name + ' not registered!');
 700        }
 701      }
 702    }
 703  };
 704  
 705  /**
 706   * Gets or registers an extension
 707   * @static
 708   * @param {string} name
 709   * @param {object|function=} ext
 710   * @returns {*}
 711   */
 712  showdown.extension = function (name, ext) {
 713    'use strict';
 714  
 715    if (!showdown.helper.isString(name)) {
 716      throw Error('Extension \'name\' must be a string');
 717    }
 718  
 719    name = showdown.helper.stdExtName(name);
 720  
 721    // Getter
 722    if (showdown.helper.isUndefined(ext)) {
 723      if (!extensions.hasOwnProperty(name)) {
 724        throw Error('Extension named ' + name + ' is not registered!');
 725      }
 726      return extensions[name];
 727  
 728      // Setter
 729    } else {
 730      // Expand extension if it's wrapped in a function
 731      if (typeof ext === 'function') {
 732        ext = ext();
 733      }
 734  
 735      // Ensure extension is an array
 736      if (!showdown.helper.isArray(ext)) {
 737        ext = [ext];
 738      }
 739  
 740      var validExtension = validate(ext, name);
 741  
 742      if (validExtension.valid) {
 743        extensions[name] = ext;
 744      } else {
 745        throw Error(validExtension.error);
 746      }
 747    }
 748  };
 749  
 750  /**
 751   * Gets all extensions registered
 752   * @returns {{}}
 753   */
 754  showdown.getAllExtensions = function () {
 755    'use strict';
 756    return extensions;
 757  };
 758  
 759  /**
 760   * Remove an extension
 761   * @param {string} name
 762   */
 763  showdown.removeExtension = function (name) {
 764    'use strict';
 765    delete extensions[name];
 766  };
 767  
 768  /**
 769   * Removes all extensions
 770   */
 771  showdown.resetExtensions = function () {
 772    'use strict';
 773    extensions = {};
 774  };
 775  
 776  /**
 777   * Validate extension
 778   * @param {array} extension
 779   * @param {string} name
 780   * @returns {{valid: boolean, error: string}}
 781   */
 782  function validate (extension, name) {
 783    'use strict';
 784  
 785    var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
 786        ret = {
 787          valid: true,
 788          error: ''
 789        };
 790  
 791    if (!showdown.helper.isArray(extension)) {
 792      extension = [extension];
 793    }
 794  
 795    for (var i = 0; i < extension.length; ++i) {
 796      var baseMsg = errMsg + ' sub-extension ' + i + ': ',
 797          ext = extension[i];
 798      if (typeof ext !== 'object') {
 799        ret.valid = false;
 800        ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
 801        return ret;
 802      }
 803  
 804      if (!showdown.helper.isString(ext.type)) {
 805        ret.valid = false;
 806        ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
 807        return ret;
 808      }
 809  
 810      var type = ext.type = ext.type.toLowerCase();
 811  
 812      // normalize extension type
 813      if (type === 'language') {
 814        type = ext.type = 'lang';
 815      }
 816  
 817      if (type === 'html') {
 818        type = ext.type = 'output';
 819      }
 820  
 821      if (type !== 'lang' && type !== 'output' && type !== 'listener') {
 822        ret.valid = false;
 823        ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
 824        return ret;
 825      }
 826  
 827      if (type === 'listener') {
 828        if (showdown.helper.isUndefined(ext.listeners)) {
 829          ret.valid = false;
 830          ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
 831          return ret;
 832        }
 833      } else {
 834        if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {
 835          ret.valid = false;
 836          ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method';
 837          return ret;
 838        }
 839      }
 840  
 841      if (ext.listeners) {
 842        if (typeof ext.listeners !== 'object') {
 843          ret.valid = false;
 844          ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + ' given';
 845          return ret;
 846        }
 847        for (var ln in ext.listeners) {
 848          if (ext.listeners.hasOwnProperty(ln)) {
 849            if (typeof ext.listeners[ln] !== 'function') {
 850              ret.valid = false;
 851              ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln +
 852                ' must be a function but ' + typeof ext.listeners[ln] + ' given';
 853              return ret;
 854            }
 855          }
 856        }
 857      }
 858  
 859      if (ext.filter) {
 860        if (typeof ext.filter !== 'function') {
 861          ret.valid = false;
 862          ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + ' given';
 863          return ret;
 864        }
 865      } else if (ext.regex) {
 866        if (showdown.helper.isString(ext.regex)) {
 867          ext.regex = new RegExp(ext.regex, 'g');
 868        }
 869        if (!(ext.regex instanceof RegExp)) {
 870          ret.valid = false;
 871          ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';
 872          return ret;
 873        }
 874        if (showdown.helper.isUndefined(ext.replace)) {
 875          ret.valid = false;
 876          ret.error = baseMsg + '"regex" extensions must implement a replace string or function';
 877          return ret;
 878        }
 879      }
 880    }
 881    return ret;
 882  }
 883  
 884  /**
 885   * Validate extension
 886   * @param {object} ext
 887   * @returns {boolean}
 888   */
 889  showdown.validateExtension = function (ext) {
 890    'use strict';
 891  
 892    var validateExtension = validate(ext, null);
 893    if (!validateExtension.valid) {
 894      console.warn(validateExtension.error);
 895      return false;
 896    }
 897    return true;
 898  };
 899  
 900  /**
 901   * showdownjs helper functions
 902   */
 903  
 904  if (!showdown.hasOwnProperty('helper')) {
 905    showdown.helper = {};
 906  }
 907  
 908  /**
 909   * Check if var is string
 910   * @static
 911   * @param {string} a
 912   * @returns {boolean}
 913   */
 914  showdown.helper.isString = function (a) {
 915    'use strict';
 916    return (typeof a === 'string' || a instanceof String);
 917  };
 918  
 919  /**
 920   * Check if var is a function
 921   * @static
 922   * @param {*} a
 923   * @returns {boolean}
 924   */
 925  showdown.helper.isFunction = function (a) {
 926    'use strict';
 927    var getType = {};
 928    return a && getType.toString.call(a) === '[object Function]';
 929  };
 930  
 931  /**
 932   * isArray helper function
 933   * @static
 934   * @param {*} a
 935   * @returns {boolean}
 936   */
 937  showdown.helper.isArray = function (a) {
 938    'use strict';
 939    return Array.isArray(a);
 940  };
 941  
 942  /**
 943   * Check if value is undefined
 944   * @static
 945   * @param {*} value The value to check.
 946   * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
 947   */
 948  showdown.helper.isUndefined = function (value) {
 949    'use strict';
 950    return typeof value === 'undefined';
 951  };
 952  
 953  /**
 954   * ForEach helper function
 955   * Iterates over Arrays and Objects (own properties only)
 956   * @static
 957   * @param {*} obj
 958   * @param {function} callback Accepts 3 params: 1. value, 2. key, 3. the original array/object
 959   */
 960  showdown.helper.forEach = function (obj, callback) {
 961    'use strict';
 962    // check if obj is defined
 963    if (showdown.helper.isUndefined(obj)) {
 964      throw new Error('obj param is required');
 965    }
 966  
 967    if (showdown.helper.isUndefined(callback)) {
 968      throw new Error('callback param is required');
 969    }
 970  
 971    if (!showdown.helper.isFunction(callback)) {
 972      throw new Error('callback param must be a function/closure');
 973    }
 974  
 975    if (typeof obj.forEach === 'function') {
 976      obj.forEach(callback);
 977    } else if (showdown.helper.isArray(obj)) {
 978      for (var i = 0; i < obj.length; i++) {
 979        callback(obj[i], i, obj);
 980      }
 981    } else if (typeof (obj) === 'object') {
 982      for (var prop in obj) {
 983        if (obj.hasOwnProperty(prop)) {
 984          callback(obj[prop], prop, obj);
 985        }
 986      }
 987    } else {
 988      throw new Error('obj does not seem to be an array or an iterable object');
 989    }
 990  };
 991  
 992  /**
 993   * Standardidize extension name
 994   * @static
 995   * @param {string} s extension name
 996   * @returns {string}
 997   */
 998  showdown.helper.stdExtName = function (s) {
 999    'use strict';
1000    return s.replace(/[_?*+\/\\.^-]/g, '').replace(/\s/g, '').toLowerCase();
1001  };
1002  
1003  function escapeCharactersCallback (wholeMatch, m1) {
1004    'use strict';
1005    var charCodeToEscape = m1.charCodeAt(0);
1006    return '¨E' + charCodeToEscape + 'E';
1007  }
1008  
1009  /**
1010   * Callback used to escape characters when passing through String.replace
1011   * @static
1012   * @param {string} wholeMatch
1013   * @param {string} m1
1014   * @returns {string}
1015   */
1016  showdown.helper.escapeCharactersCallback = escapeCharactersCallback;
1017  
1018  /**
1019   * Escape characters in a string
1020   * @static
1021   * @param {string} text
1022   * @param {string} charsToEscape
1023   * @param {boolean} afterBackslash
1024   * @returns {XML|string|void|*}
1025   */
1026  showdown.helper.escapeCharacters = function (text, charsToEscape, afterBackslash) {
1027    'use strict';
1028    // First we have to escape the escape characters so that
1029    // we can build a character class out of them
1030    var regexString = '([' + charsToEscape.replace(/([\[\]\\])/g, '\\$1') + '])';
1031  
1032    if (afterBackslash) {
1033      regexString = '\\\\' + regexString;
1034    }
1035  
1036    var regex = new RegExp(regexString, 'g');
1037    text = text.replace(regex, escapeCharactersCallback);
1038  
1039    return text;
1040  };
1041  
1042  /**
1043   * Unescape HTML entities
1044   * @param txt
1045   * @returns {string}
1046   */
1047  showdown.helper.unescapeHTMLEntities = function (txt) {
1048    'use strict';
1049  
1050    return txt
1051      .replace(/&quot;/g, '"')
1052      .replace(/&lt;/g, '<')
1053      .replace(/&gt;/g, '>')
1054      .replace(/&amp;/g, '&');
1055  };
1056  
1057  var rgxFindMatchPos = function (str, left, right, flags) {
1058    'use strict';
1059    var f = flags || '',
1060        g = f.indexOf('g') > -1,
1061        x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),
1062        l = new RegExp(left, f.replace(/g/g, '')),
1063        pos = [],
1064        t, s, m, start, end;
1065  
1066    do {
1067      t = 0;
1068      while ((m = x.exec(str))) {
1069        if (l.test(m[0])) {
1070          if (!(t++)) {
1071            s = x.lastIndex;
1072            start = s - m[0].length;
1073          }
1074        } else if (t) {
1075          if (!--t) {
1076            end = m.index + m[0].length;
1077            var obj = {
1078              left: {start: start, end: s},
1079              match: {start: s, end: m.index},
1080              right: {start: m.index, end: end},
1081              wholeMatch: {start: start, end: end}
1082            };
1083            pos.push(obj);
1084            if (!g) {
1085              return pos;
1086            }
1087          }
1088        }
1089      }
1090    } while (t && (x.lastIndex = s));
1091  
1092    return pos;
1093  };
1094  
1095  /**
1096   * matchRecursiveRegExp
1097   *
1098   * (c) 2007 Steven Levithan <stevenlevithan.com>
1099   * MIT License
1100   *
1101   * Accepts a string to search, a left and right format delimiter
1102   * as regex patterns, and optional regex flags. Returns an array
1103   * of matches, allowing nested instances of left/right delimiters.
1104   * Use the "g" flag to return all matches, otherwise only the
1105   * first is returned. Be careful to ensure that the left and
1106   * right format delimiters produce mutually exclusive matches.
1107   * Backreferences are not supported within the right delimiter
1108   * due to how it is internally combined with the left delimiter.
1109   * When matching strings whose format delimiters are unbalanced
1110   * to the left or right, the output is intentionally as a
1111   * conventional regex library with recursion support would
1112   * produce, e.g. "<<x>" and "<x>>" both produce ["x"] when using
1113   * "<" and ">" as the delimiters (both strings contain a single,
1114   * balanced instance of "<x>").
1115   *
1116   * examples:
1117   * matchRecursiveRegExp("test", "\\(", "\\)")
1118   * returns: []
1119   * matchRecursiveRegExp("<t<<e>><s>>t<>", "<", ">", "g")
1120   * returns: ["t<<e>><s>", ""]
1121   * matchRecursiveRegExp("<div id=\"x\">test</div>", "<div\\b[^>]*>", "</div>", "gi")
1122   * returns: ["test"]
1123   */
1124  showdown.helper.matchRecursiveRegExp = function (str, left, right, flags) {
1125    'use strict';
1126  
1127    var matchPos = rgxFindMatchPos (str, left, right, flags),
1128        results = [];
1129  
1130    for (var i = 0; i < matchPos.length; ++i) {
1131      results.push([
1132        str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
1133        str.slice(matchPos[i].match.start, matchPos[i].match.end),
1134        str.slice(matchPos[i].left.start, matchPos[i].left.end),
1135        str.slice(matchPos[i].right.start, matchPos[i].right.end)
1136      ]);
1137    }
1138    return results;
1139  };
1140  
1141  /**
1142   *
1143   * @param {string} str
1144   * @param {string|function} replacement
1145   * @param {string} left
1146   * @param {string} right
1147   * @param {string} flags
1148   * @returns {string}
1149   */
1150  showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {
1151    'use strict';
1152  
1153    if (!showdown.helper.isFunction(replacement)) {
1154      var repStr = replacement;
1155      replacement = function () {
1156        return repStr;
1157      };
1158    }
1159  
1160    var matchPos = rgxFindMatchPos(str, left, right, flags),
1161        finalStr = str,
1162        lng = matchPos.length;
1163  
1164    if (lng > 0) {
1165      var bits = [];
1166      if (matchPos[0].wholeMatch.start !== 0) {
1167        bits.push(str.slice(0, matchPos[0].wholeMatch.start));
1168      }
1169      for (var i = 0; i < lng; ++i) {
1170        bits.push(
1171          replacement(
1172            str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
1173            str.slice(matchPos[i].match.start, matchPos[i].match.end),
1174            str.slice(matchPos[i].left.start, matchPos[i].left.end),
1175            str.slice(matchPos[i].right.start, matchPos[i].right.end)
1176          )
1177        );
1178        if (i < lng - 1) {
1179          bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start));
1180        }
1181      }
1182      if (matchPos[lng - 1].wholeMatch.end < str.length) {
1183        bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));
1184      }
1185      finalStr = bits.join('');
1186    }
1187    return finalStr;
1188  };
1189  
1190  /**
1191   * Returns the index within the passed String object of the first occurrence of the specified regex,
1192   * starting the search at fromIndex. Returns -1 if the value is not found.
1193   *
1194   * @param {string} str string to search
1195   * @param {RegExp} regex Regular expression to search
1196   * @param {int} [fromIndex = 0] Index to start the search
1197   * @returns {Number}
1198   * @throws InvalidArgumentError
1199   */
1200  showdown.helper.regexIndexOf = function (str, regex, fromIndex) {
1201    'use strict';
1202    if (!showdown.helper.isString(str)) {
1203      throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
1204    }
1205    if (regex instanceof RegExp === false) {
1206      throw 'InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp';
1207    }
1208    var indexOf = str.substring(fromIndex || 0).search(regex);
1209    return (indexOf >= 0) ? (indexOf + (fromIndex || 0)) : indexOf;
1210  };
1211  
1212  /**
1213   * Splits the passed string object at the defined index, and returns an array composed of the two substrings
1214   * @param {string} str string to split
1215   * @param {int} index index to split string at
1216   * @returns {[string,string]}
1217   * @throws InvalidArgumentError
1218   */
1219  showdown.helper.splitAtIndex = function (str, index) {
1220    'use strict';
1221    if (!showdown.helper.isString(str)) {
1222      throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
1223    }
1224    return [str.substring(0, index), str.substring(index)];
1225  };
1226  
1227  /**
1228   * Obfuscate an e-mail address through the use of Character Entities,
1229   * transforming ASCII characters into their equivalent decimal or hex entities.
1230   *
1231   * Since it has a random component, subsequent calls to this function produce different results
1232   *
1233   * @param {string} mail
1234   * @returns {string}
1235   */
1236  showdown.helper.encodeEmailAddress = function (mail) {
1237    'use strict';
1238    var encode = [
1239      function (ch) {
1240        return '&#' + ch.charCodeAt(0) + ';';
1241      },
1242      function (ch) {
1243        return '&#x' + ch.charCodeAt(0).toString(16) + ';';
1244      },
1245      function (ch) {
1246        return ch;
1247      }
1248    ];
1249  
1250    mail = mail.replace(/./g, function (ch) {
1251      if (ch === '@') {
1252        // this *must* be encoded. I insist.
1253        ch = encode[Math.floor(Math.random() * 2)](ch);
1254      } else {
1255        var r = Math.random();
1256        // roughly 10% raw, 45% hex, 45% dec
1257        ch = (
1258          r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)
1259        );
1260      }
1261      return ch;
1262    });
1263  
1264    return mail;
1265  };
1266  
1267  /**
1268   *
1269   * @param str
1270   * @param targetLength
1271   * @param padString
1272   * @returns {string}
1273   */
1274  showdown.helper.padEnd = function padEnd (str, targetLength, padString) {
1275    'use strict';
1276    /*jshint bitwise: false*/
1277    // eslint-disable-next-line space-infix-ops
1278    targetLength = targetLength>>0; //floor if number or convert non-number to 0;
1279    /*jshint bitwise: true*/
1280    padString = String(padString || ' ');
1281    if (str.length > targetLength) {
1282      return String(str);
1283    } else {
1284      targetLength = targetLength - str.length;
1285      if (targetLength > padString.length) {
1286        padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
1287      }
1288      return String(str) + padString.slice(0,targetLength);
1289    }
1290  };
1291  
1292  /**
1293   * POLYFILLS
1294   */
1295  // use this instead of builtin is undefined for IE8 compatibility
1296  if (typeof console === 'undefined') {
1297    console = {
1298      warn: function (msg) {
1299        'use strict';
1300        alert(msg);
1301      },
1302      log: function (msg) {
1303        'use strict';
1304        alert(msg);
1305      },
1306      error: function (msg) {
1307        'use strict';
1308        throw msg;
1309      }
1310    };
1311  }
1312  
1313  /**
1314   * Common regexes.
1315   * We declare some common regexes to improve performance
1316   */
1317  showdown.helper.regexes = {
1318    asteriskDashAndColon: /([*_:~])/g
1319  };
1320  
1321  /**
1322   * EMOJIS LIST
1323   */
1324  showdown.helper.emojis = {
1325    '+1':'\ud83d\udc4d',
1326    '-1':'\ud83d\udc4e',
1327    '100':'\ud83d\udcaf',
1328    '1234':'\ud83d\udd22',
1329    '1st_place_medal':'\ud83e\udd47',
1330    '2nd_place_medal':'\ud83e\udd48',
1331    '3rd_place_medal':'\ud83e\udd49',
1332    '8ball':'\ud83c\udfb1',
1333    'a':'\ud83c\udd70\ufe0f',
1334    'ab':'\ud83c\udd8e',
1335    'abc':'\ud83d\udd24',
1336    'abcd':'\ud83d\udd21',
1337    'accept':'\ud83c\ude51',
1338    'aerial_tramway':'\ud83d\udea1',
1339    'airplane':'\u2708\ufe0f',
1340    'alarm_clock':'\u23f0',
1341    'alembic':'\u2697\ufe0f',
1342    'alien':'\ud83d\udc7d',
1343    'ambulance':'\ud83d\ude91',
1344    'amphora':'\ud83c\udffa',
1345    'anchor':'\u2693\ufe0f',
1346    'angel':'\ud83d\udc7c',
1347    'anger':'\ud83d\udca2',
1348    'angry':'\ud83d\ude20',
1349    'anguished':'\ud83d\ude27',
1350    'ant':'\ud83d\udc1c',
1351    'apple':'\ud83c\udf4e',
1352    'aquarius':'\u2652\ufe0f',
1353    'aries':'\u2648\ufe0f',
1354    'arrow_backward':'\u25c0\ufe0f',
1355    'arrow_double_down':'\u23ec',
1356    'arrow_double_up':'\u23eb',
1357    'arrow_down':'\u2b07\ufe0f',
1358    'arrow_down_small':'\ud83d\udd3d',
1359    'arrow_forward':'\u25b6\ufe0f',
1360    'arrow_heading_down':'\u2935\ufe0f',
1361    'arrow_heading_up':'\u2934\ufe0f',
1362    'arrow_left':'\u2b05\ufe0f',
1363    'arrow_lower_left':'\u2199\ufe0f',
1364    'arrow_lower_right':'\u2198\ufe0f',
1365    'arrow_right':'\u27a1\ufe0f',
1366    'arrow_right_hook':'\u21aa\ufe0f',
1367    'arrow_up':'\u2b06\ufe0f',
1368    'arrow_up_down':'\u2195\ufe0f',
1369    'arrow_up_small':'\ud83d\udd3c',
1370    'arrow_upper_left':'\u2196\ufe0f',
1371    'arrow_upper_right':'\u2197\ufe0f',
1372    'arrows_clockwise':'\ud83d\udd03',
1373    'arrows_counterclockwise':'\ud83d\udd04',
1374    'art':'\ud83c\udfa8',
1375    'articulated_lorry':'\ud83d\ude9b',
1376    'artificial_satellite':'\ud83d\udef0',
1377    'astonished':'\ud83d\ude32',
1378    'athletic_shoe':'\ud83d\udc5f',
1379    'atm':'\ud83c\udfe7',
1380    'atom_symbol':'\u269b\ufe0f',
1381    'avocado':'\ud83e\udd51',
1382    'b':'\ud83c\udd71\ufe0f',
1383    'baby':'\ud83d\udc76',
1384    'baby_bottle':'\ud83c\udf7c',
1385    'baby_chick':'\ud83d\udc24',
1386    'baby_symbol':'\ud83d\udebc',
1387    'back':'\ud83d\udd19',
1388    'bacon':'\ud83e\udd53',
1389    'badminton':'\ud83c\udff8',
1390    'baggage_claim':'\ud83d\udec4',
1391    'baguette_bread':'\ud83e\udd56',
1392    'balance_scale':'\u2696\ufe0f',
1393    'balloon':'\ud83c\udf88',
1394    'ballot_box':'\ud83d\uddf3',
1395    'ballot_box_with_check':'\u2611\ufe0f',
1396    'bamboo':'\ud83c\udf8d',
1397    'banana':'\ud83c\udf4c',
1398    'bangbang':'\u203c\ufe0f',
1399    'bank':'\ud83c\udfe6',
1400    'bar_chart':'\ud83d\udcca',
1401    'barber':'\ud83d\udc88',
1402    'baseball':'\u26be\ufe0f',
1403    'basketball':'\ud83c\udfc0',
1404    'basketball_man':'\u26f9\ufe0f',
1405    'basketball_woman':'\u26f9\ufe0f&zwj;\u2640\ufe0f',
1406    'bat':'\ud83e\udd87',
1407    'bath':'\ud83d\udec0',
1408    'bathtub':'\ud83d\udec1',
1409    'battery':'\ud83d\udd0b',
1410    'beach_umbrella':'\ud83c\udfd6',
1411    'bear':'\ud83d\udc3b',
1412    'bed':'\ud83d\udecf',
1413    'bee':'\ud83d\udc1d',
1414    'beer':'\ud83c\udf7a',
1415    'beers':'\ud83c\udf7b',
1416    'beetle':'\ud83d\udc1e',
1417    'beginner':'\ud83d\udd30',
1418    'bell':'\ud83d\udd14',
1419    'bellhop_bell':'\ud83d\udece',
1420    'bento':'\ud83c\udf71',
1421    'biking_man':'\ud83d\udeb4',
1422    'bike':'\ud83d\udeb2',
1423    'biking_woman':'\ud83d\udeb4&zwj;\u2640\ufe0f',
1424    'bikini':'\ud83d\udc59',
1425    'biohazard':'\u2623\ufe0f',
1426    'bird':'\ud83d\udc26',
1427    'birthday':'\ud83c\udf82',
1428    'black_circle':'\u26ab\ufe0f',
1429    'black_flag':'\ud83c\udff4',
1430    'black_heart':'\ud83d\udda4',
1431    'black_joker':'\ud83c\udccf',
1432    'black_large_square':'\u2b1b\ufe0f',
1433    'black_medium_small_square':'\u25fe\ufe0f',
1434    'black_medium_square':'\u25fc\ufe0f',
1435    'black_nib':'\u2712\ufe0f',
1436    'black_small_square':'\u25aa\ufe0f',
1437    'black_square_button':'\ud83d\udd32',
1438    'blonde_man':'\ud83d\udc71',
1439    'blonde_woman':'\ud83d\udc71&zwj;\u2640\ufe0f',
1440    'blossom':'\ud83c\udf3c',
1441    'blowfish':'\ud83d\udc21',
1442    'blue_book':'\ud83d\udcd8',
1443    'blue_car':'\ud83d\ude99',
1444    'blue_heart':'\ud83d\udc99',
1445    'blush':'\ud83d\ude0a',
1446    'boar':'\ud83d\udc17',
1447    'boat':'\u26f5\ufe0f',
1448    'bomb':'\ud83d\udca3',
1449    'book':'\ud83d\udcd6',
1450    'bookmark':'\ud83d\udd16',
1451    'bookmark_tabs':'\ud83d\udcd1',
1452    'books':'\ud83d\udcda',
1453    'boom':'\ud83d\udca5',
1454    'boot':'\ud83d\udc62',
1455    'bouquet':'\ud83d\udc90',
1456    'bowing_man':'\ud83d\ude47',
1457    'bow_and_arrow':'\ud83c\udff9',
1458    'bowing_woman':'\ud83d\ude47&zwj;\u2640\ufe0f',
1459    'bowling':'\ud83c\udfb3',
1460    'boxing_glove':'\ud83e\udd4a',
1461    'boy':'\ud83d\udc66',
1462    'bread':'\ud83c\udf5e',
1463    'bride_with_veil':'\ud83d\udc70',
1464    'bridge_at_night':'\ud83c\udf09',
1465    'briefcase':'\ud83d\udcbc',
1466    'broken_heart':'\ud83d\udc94',
1467    'bug':'\ud83d\udc1b',
1468    'building_construction':'\ud83c\udfd7',
1469    'bulb':'\ud83d\udca1',
1470    'bullettrain_front':'\ud83d\ude85',
1471    'bullettrain_side':'\ud83d\ude84',
1472    'burrito':'\ud83c\udf2f',
1473    'bus':'\ud83d\ude8c',
1474    'business_suit_levitating':'\ud83d\udd74',
1475    'busstop':'\ud83d\ude8f',
1476    'bust_in_silhouette':'\ud83d\udc64',
1477    'busts_in_silhouette':'\ud83d\udc65',
1478    'butterfly':'\ud83e\udd8b',
1479    'cactus':'\ud83c\udf35',
1480    'cake':'\ud83c\udf70',
1481    'calendar':'\ud83d\udcc6',
1482    'call_me_hand':'\ud83e\udd19',
1483    'calling':'\ud83d\udcf2',
1484    'camel':'\ud83d\udc2b',
1485    'camera':'\ud83d\udcf7',
1486    'camera_flash':'\ud83d\udcf8',
1487    'camping':'\ud83c\udfd5',
1488    'cancer':'\u264b\ufe0f',
1489    'candle':'\ud83d\udd6f',
1490    'candy':'\ud83c\udf6c',
1491    'canoe':'\ud83d\udef6',
1492    'capital_abcd':'\ud83d\udd20',
1493    'capricorn':'\u2651\ufe0f',
1494    'car':'\ud83d\ude97',
1495    'card_file_box':'\ud83d\uddc3',
1496    'card_index':'\ud83d\udcc7',
1497    'card_index_dividers':'\ud83d\uddc2',
1498    'carousel_horse':'\ud83c\udfa0',
1499    'carrot':'\ud83e\udd55',
1500    'cat':'\ud83d\udc31',
1501    'cat2':'\ud83d\udc08',
1502    'cd':'\ud83d\udcbf',
1503    'chains':'\u26d3',
1504    'champagne':'\ud83c\udf7e',
1505    'chart':'\ud83d\udcb9',
1506    'chart_with_downwards_trend':'\ud83d\udcc9',
1507    'chart_with_upwards_trend':'\ud83d\udcc8',
1508    'checkered_flag':'\ud83c\udfc1',
1509    'cheese':'\ud83e\uddc0',
1510    'cherries':'\ud83c\udf52',
1511    'cherry_blossom':'\ud83c\udf38',
1512    'chestnut':'\ud83c\udf30',
1513    'chicken':'\ud83d\udc14',
1514    'children_crossing':'\ud83d\udeb8',
1515    'chipmunk':'\ud83d\udc3f',
1516    'chocolate_bar':'\ud83c\udf6b',
1517    'christmas_tree':'\ud83c\udf84',
1518    'church':'\u26ea\ufe0f',
1519    'cinema':'\ud83c\udfa6',
1520    'circus_tent':'\ud83c\udfaa',
1521    'city_sunrise':'\ud83c\udf07',
1522    'city_sunset':'\ud83c\udf06',
1523    'cityscape':'\ud83c\udfd9',
1524    'cl':'\ud83c\udd91',
1525    'clamp':'\ud83d\udddc',
1526    'clap':'\ud83d\udc4f',
1527    'clapper':'\ud83c\udfac',
1528    'classical_building':'\ud83c\udfdb',
1529    'clinking_glasses':'\ud83e\udd42',
1530    'clipboard':'\ud83d\udccb',
1531    'clock1':'\ud83d\udd50',
1532    'clock10':'\ud83d\udd59',
1533    'clock1030':'\ud83d\udd65',
1534    'clock11':'\ud83d\udd5a',
1535    'clock1130':'\ud83d\udd66',
1536    'clock12':'\ud83d\udd5b',
1537    'clock1230':'\ud83d\udd67',
1538    'clock130':'\ud83d\udd5c',
1539    'clock2':'\ud83d\udd51',
1540    'clock230':'\ud83d\udd5d',
1541    'clock3':'\ud83d\udd52',
1542    'clock330':'\ud83d\udd5e',
1543    'clock4':'\ud83d\udd53',
1544    'clock430':'\ud83d\udd5f',
1545    'clock5':'\ud83d\udd54',
1546    'clock530':'\ud83d\udd60',
1547    'clock6':'\ud83d\udd55',
1548    'clock630':'\ud83d\udd61',
1549    'clock7':'\ud83d\udd56',
1550    'clock730':'\ud83d\udd62',
1551    'clock8':'\ud83d\udd57',
1552    'clock830':'\ud83d\udd63',
1553    'clock9':'\ud83d\udd58',
1554    'clock930':'\ud83d\udd64',
1555    'closed_book':'\ud83d\udcd5',
1556    'closed_lock_with_key':'\ud83d\udd10',
1557    'closed_umbrella':'\ud83c\udf02',
1558    'cloud':'\u2601\ufe0f',
1559    'cloud_with_lightning':'\ud83c\udf29',
1560    'cloud_with_lightning_and_rain':'\u26c8',
1561    'cloud_with_rain':'\ud83c\udf27',
1562    'cloud_with_snow':'\ud83c\udf28',
1563    'clown_face':'\ud83e\udd21',
1564    'clubs':'\u2663\ufe0f',
1565    'cocktail':'\ud83c\udf78',
1566    'coffee':'\u2615\ufe0f',
1567    'coffin':'\u26b0\ufe0f',
1568    'cold_sweat':'\ud83d\ude30',
1569    'comet':'\u2604\ufe0f',
1570    'computer':'\ud83d\udcbb',
1571    'computer_mouse':'\ud83d\uddb1',
1572    'confetti_ball':'\ud83c\udf8a',
1573    'confounded':'\ud83d\ude16',
1574    'confused':'\ud83d\ude15',
1575    'congratulations':'\u3297\ufe0f',
1576    'construction':'\ud83d\udea7',
1577    'construction_worker_man':'\ud83d\udc77',
1578    'construction_worker_woman':'\ud83d\udc77&zwj;\u2640\ufe0f',
1579    'control_knobs':'\ud83c\udf9b',
1580    'convenience_store':'\ud83c\udfea',
1581    'cookie':'\ud83c\udf6a',
1582    'cool':'\ud83c\udd92',
1583    'policeman':'\ud83d\udc6e',
1584    'copyright':'\u00a9\ufe0f',
1585    'corn':'\ud83c\udf3d',
1586    'couch_and_lamp':'\ud83d\udecb',
1587    'couple':'\ud83d\udc6b',
1588    'couple_with_heart_woman_man':'\ud83d\udc91',
1589    'couple_with_heart_man_man':'\ud83d\udc68&zwj;\u2764\ufe0f&zwj;\ud83d\udc68',
1590    'couple_with_heart_woman_woman':'\ud83d\udc69&zwj;\u2764\ufe0f&zwj;\ud83d\udc69',
1591    'couplekiss_man_man':'\ud83d\udc68&zwj;\u2764\ufe0f&zwj;\ud83d\udc8b&zwj;\ud83d\udc68',
1592    'couplekiss_man_woman':'\ud83d\udc8f',
1593    'couplekiss_woman_woman':'\ud83d\udc69&zwj;\u2764\ufe0f&zwj;\ud83d\udc8b&zwj;\ud83d\udc69',
1594    'cow':'\ud83d\udc2e',
1595    'cow2':'\ud83d\udc04',
1596    'cowboy_hat_face':'\ud83e\udd20',
1597    'crab':'\ud83e\udd80',
1598    'crayon':'\ud83d\udd8d',
1599    'credit_card':'\ud83d\udcb3',
1600    'crescent_moon':'\ud83c\udf19',
1601    'cricket':'\ud83c\udfcf',
1602    'crocodile':'\ud83d\udc0a',
1603    'croissant':'\ud83e\udd50',
1604    'crossed_fingers':'\ud83e\udd1e',
1605    'crossed_flags':'\ud83c\udf8c',
1606    'crossed_swords':'\u2694\ufe0f',
1607    'crown':'\ud83d\udc51',
1608    'cry':'\ud83d\ude22',
1609    'crying_cat_face':'\ud83d\ude3f',
1610    'crystal_ball':'\ud83d\udd2e',
1611    'cucumber':'\ud83e\udd52',
1612    'cupid':'\ud83d\udc98',
1613    'curly_loop':'\u27b0',
1614    'currency_exchange':'\ud83d\udcb1',
1615    'curry':'\ud83c\udf5b',
1616    'custard':'\ud83c\udf6e',
1617    'customs':'\ud83d\udec3',
1618    'cyclone':'\ud83c\udf00',
1619    'dagger':'\ud83d\udde1',
1620    'dancer':'\ud83d\udc83',
1621    'dancing_women':'\ud83d\udc6f',
1622    'dancing_men':'\ud83d\udc6f&zwj;\u2642\ufe0f',
1623    'dango':'\ud83c\udf61',
1624    'dark_sunglasses':'\ud83d\udd76',
1625    'dart':'\ud83c\udfaf',
1626    'dash':'\ud83d\udca8',
1627    'date':'\ud83d\udcc5',
1628    'deciduous_tree':'\ud83c\udf33',
1629    'deer':'\ud83e\udd8c',
1630    'department_store':'\ud83c\udfec',
1631    'derelict_house':'\ud83c\udfda',
1632    'desert':'\ud83c\udfdc',
1633    'desert_island':'\ud83c\udfdd',
1634    'desktop_computer':'\ud83d\udda5',
1635    'male_detective':'\ud83d\udd75\ufe0f',
1636    'diamond_shape_with_a_dot_inside':'\ud83d\udca0',
1637    'diamonds':'\u2666\ufe0f',
1638    'disappointed':'\ud83d\ude1e',
1639    'disappointed_relieved':'\ud83d\ude25',
1640    'dizzy':'\ud83d\udcab',
1641    'dizzy_face':'\ud83d\ude35',
1642    'do_not_litter':'\ud83d\udeaf',
1643    'dog':'\ud83d\udc36',
1644    'dog2':'\ud83d\udc15',
1645    'dollar':'\ud83d\udcb5',
1646    'dolls':'\ud83c\udf8e',
1647    'dolphin':'\ud83d\udc2c',
1648    'door':'\ud83d\udeaa',
1649    'doughnut':'\ud83c\udf69',
1650    'dove':'\ud83d\udd4a',
1651    'dragon':'\ud83d\udc09',
1652    'dragon_face':'\ud83d\udc32',
1653    'dress':'\ud83d\udc57',
1654    'dromedary_camel':'\ud83d\udc2a',
1655    'drooling_face':'\ud83e\udd24',
1656    'droplet':'\ud83d\udca7',
1657    'drum':'\ud83e\udd41',
1658    'duck':'\ud83e\udd86',
1659    'dvd':'\ud83d\udcc0',
1660    'e-mail':'\ud83d\udce7',
1661    'eagle':'\ud83e\udd85',
1662    'ear':'\ud83d\udc42',
1663    'ear_of_rice':'\ud83c\udf3e',
1664    'earth_africa':'\ud83c\udf0d',
1665    'earth_americas':'\ud83c\udf0e',
1666    'earth_asia':'\ud83c\udf0f',
1667    'egg':'\ud83e\udd5a',
1668    'eggplant':'\ud83c\udf46',
1669    'eight_pointed_black_star':'\u2734\ufe0f',
1670    'eight_spoked_asterisk':'\u2733\ufe0f',
1671    'electric_plug':'\ud83d\udd0c',
1672    'elephant':'\ud83d\udc18',
1673    'email':'\u2709\ufe0f',
1674    'end':'\ud83d\udd1a',
1675    'envelope_with_arrow':'\ud83d\udce9',
1676    'euro':'\ud83d\udcb6',
1677    'european_castle':'\ud83c\udff0',
1678    'european_post_office':'\ud83c\udfe4',
1679    'evergreen_tree':'\ud83c\udf32',
1680    'exclamation':'\u2757\ufe0f',
1681    'expressionless':'\ud83d\ude11',
1682    'eye':'\ud83d\udc41',
1683    'eye_speech_bubble':'\ud83d\udc41&zwj;\ud83d\udde8',
1684    'eyeglasses':'\ud83d\udc53',
1685    'eyes':'\ud83d\udc40',
1686    'face_with_head_bandage':'\ud83e\udd15',
1687    'face_with_thermometer':'\ud83e\udd12',
1688    'fist_oncoming':'\ud83d\udc4a',
1689    'factory':'\ud83c\udfed',
1690    'fallen_leaf':'\ud83c\udf42',
1691    'family_man_woman_boy':'\ud83d\udc6a',
1692    'family_man_boy':'\ud83d\udc68&zwj;\ud83d\udc66',
1693    'family_man_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1694    'family_man_girl':'\ud83d\udc68&zwj;\ud83d\udc67',
1695    'family_man_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1696    'family_man_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1697    'family_man_man_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc66',
1698    'family_man_man_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1699    'family_man_man_girl':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67',
1700    'family_man_man_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1701    'family_man_man_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1702    'family_man_woman_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1703    'family_man_woman_girl':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67',
1704    'family_man_woman_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1705    'family_man_woman_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1706    'family_woman_boy':'\ud83d\udc69&zwj;\ud83d\udc66',
1707    'family_woman_boy_boy':'\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1708    'family_woman_girl':'\ud83d\udc69&zwj;\ud83d\udc67',
1709    'family_woman_girl_boy':'\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1710    'family_woman_girl_girl':'\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1711    'family_woman_woman_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc66',
1712    'family_woman_woman_boy_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1713    'family_woman_woman_girl':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67',
1714    'family_woman_woman_girl_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1715    'family_woman_woman_girl_girl':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1716    'fast_forward':'\u23e9',
1717    'fax':'\ud83d\udce0',
1718    'fearful':'\ud83d\ude28',
1719    'feet':'\ud83d\udc3e',
1720    'female_detective':'\ud83d\udd75\ufe0f&zwj;\u2640\ufe0f',
1721    'ferris_wheel':'\ud83c\udfa1',
1722    'ferry':'\u26f4',
1723    'field_hockey':'\ud83c\udfd1',
1724    'file_cabinet':'\ud83d\uddc4',
1725    'file_folder':'\ud83d\udcc1',
1726    'film_projector':'\ud83d\udcfd',
1727    'film_strip':'\ud83c\udf9e',
1728    'fire':'\ud83d\udd25',
1729    'fire_engine':'\ud83d\ude92',
1730    'fireworks':'\ud83c\udf86',
1731    'first_quarter_moon':'\ud83c\udf13',
1732    'first_quarter_moon_with_face':'\ud83c\udf1b',
1733    'fish':'\ud83d\udc1f',
1734    'fish_cake':'\ud83c\udf65',
1735    'fishing_pole_and_fish':'\ud83c\udfa3',
1736    'fist_raised':'\u270a',
1737    'fist_left':'\ud83e\udd1b',
1738    'fist_right':'\ud83e\udd1c',
1739    'flags':'\ud83c\udf8f',
1740    'flashlight':'\ud83d\udd26',
1741    'fleur_de_lis':'\u269c\ufe0f',
1742    'flight_arrival':'\ud83d\udeec',
1743    'flight_departure':'\ud83d\udeeb',
1744    'floppy_disk':'\ud83d\udcbe',
1745    'flower_playing_cards':'\ud83c\udfb4',
1746    'flushed':'\ud83d\ude33',
1747    'fog':'\ud83c\udf2b',
1748    'foggy':'\ud83c\udf01',
1749    'football':'\ud83c\udfc8',
1750    'footprints':'\ud83d\udc63',
1751    'fork_and_knife':'\ud83c\udf74',
1752    'fountain':'\u26f2\ufe0f',
1753    'fountain_pen':'\ud83d\udd8b',
1754    'four_leaf_clover':'\ud83c\udf40',
1755    'fox_face':'\ud83e\udd8a',
1756    'framed_picture':'\ud83d\uddbc',
1757    'free':'\ud83c\udd93',
1758    'fried_egg':'\ud83c\udf73',
1759    'fried_shrimp':'\ud83c\udf64',
1760    'fries':'\ud83c\udf5f',
1761    'frog':'\ud83d\udc38',
1762    'frowning':'\ud83d\ude26',
1763    'frowning_face':'\u2639\ufe0f',
1764    'frowning_man':'\ud83d\ude4d&zwj;\u2642\ufe0f',
1765    'frowning_woman':'\ud83d\ude4d',
1766    'middle_finger':'\ud83d\udd95',
1767    'fuelpump':'\u26fd\ufe0f',
1768    'full_moon':'\ud83c\udf15',
1769    'full_moon_with_face':'\ud83c\udf1d',
1770    'funeral_urn':'\u26b1\ufe0f',
1771    'game_die':'\ud83c\udfb2',
1772    'gear':'\u2699\ufe0f',
1773    'gem':'\ud83d\udc8e',
1774    'gemini':'\u264a\ufe0f',
1775    'ghost':'\ud83d\udc7b',
1776    'gift':'\ud83c\udf81',
1777    'gift_heart':'\ud83d\udc9d',
1778    'girl':'\ud83d\udc67',
1779    'globe_with_meridians':'\ud83c\udf10',
1780    'goal_net':'\ud83e\udd45',
1781    'goat':'\ud83d\udc10',
1782    'golf':'\u26f3\ufe0f',
1783    'golfing_man':'\ud83c\udfcc\ufe0f',
1784    'golfing_woman':'\ud83c\udfcc\ufe0f&zwj;\u2640\ufe0f',
1785    'gorilla':'\ud83e\udd8d',
1786    'grapes':'\ud83c\udf47',
1787    'green_apple':'\ud83c\udf4f',
1788    'green_book':'\ud83d\udcd7',
1789    'green_heart':'\ud83d\udc9a',
1790    'green_salad':'\ud83e\udd57',
1791    'grey_exclamation':'\u2755',
1792    'grey_question':'\u2754',
1793    'grimacing':'\ud83d\ude2c',
1794    'grin':'\ud83d\ude01',
1795    'grinning':'\ud83d\ude00',
1796    'guardsman':'\ud83d\udc82',
1797    'guardswoman':'\ud83d\udc82&zwj;\u2640\ufe0f',
1798    'guitar':'\ud83c\udfb8',
1799    'gun':'\ud83d\udd2b',
1800    'haircut_woman':'\ud83d\udc87',
1801    'haircut_man':'\ud83d\udc87&zwj;\u2642\ufe0f',
1802    'hamburger':'\ud83c\udf54',
1803    'hammer':'\ud83d\udd28',
1804    'hammer_and_pick':'\u2692',
1805    'hammer_and_wrench':'\ud83d\udee0',
1806    'hamster':'\ud83d\udc39',
1807    'hand':'\u270b',
1808    'handbag':'\ud83d\udc5c',
1809    'handshake':'\ud83e\udd1d',
1810    'hankey':'\ud83d\udca9',
1811    'hatched_chick':'\ud83d\udc25',
1812    'hatching_chick':'\ud83d\udc23',
1813    'headphones':'\ud83c\udfa7',
1814    'hear_no_evil':'\ud83d\ude49',
1815    'heart':'\u2764\ufe0f',
1816    'heart_decoration':'\ud83d\udc9f',
1817    'heart_eyes':'\ud83d\ude0d',
1818    'heart_eyes_cat':'\ud83d\ude3b',
1819    'heartbeat':'\ud83d\udc93',
1820    'heartpulse':'\ud83d\udc97',
1821    'hearts':'\u2665\ufe0f',
1822    'heavy_check_mark':'\u2714\ufe0f',
1823    'heavy_division_sign':'\u2797',
1824    'heavy_dollar_sign':'\ud83d\udcb2',
1825    'heavy_heart_exclamation':'\u2763\ufe0f',
1826    'heavy_minus_sign':'\u2796',
1827    'heavy_multiplication_x':'\u2716\ufe0f',
1828    'heavy_plus_sign':'\u2795',
1829    'helicopter':'\ud83d\ude81',
1830    'herb':'\ud83c\udf3f',
1831    'hibiscus':'\ud83c\udf3a',
1832    'high_brightness':'\ud83d\udd06',
1833    'high_heel':'\ud83d\udc60',
1834    'hocho':'\ud83d\udd2a',
1835    'hole':'\ud83d\udd73',
1836    'honey_pot':'\ud83c\udf6f',
1837    'horse':'\ud83d\udc34',
1838    'horse_racing':'\ud83c\udfc7',
1839    'hospital':'\ud83c\udfe5',
1840    'hot_pepper':'\ud83c\udf36',
1841    'hotdog':'\ud83c\udf2d',
1842    'hotel':'\ud83c\udfe8',
1843    'hotsprings':'\u2668\ufe0f',
1844    'hourglass':'\u231b\ufe0f',
1845    'hourglass_flowing_sand':'\u23f3',
1846    'house':'\ud83c\udfe0',
1847    'house_with_garden':'\ud83c\udfe1',
1848    'houses':'\ud83c\udfd8',
1849    'hugs':'\ud83e\udd17',
1850    'hushed':'\ud83d\ude2f',
1851    'ice_cream':'\ud83c\udf68',
1852    'ice_hockey':'\ud83c\udfd2',
1853    'ice_skate':'\u26f8',
1854    'icecream':'\ud83c\udf66',
1855    'id':'\ud83c\udd94',
1856    'ideograph_advantage':'\ud83c\ude50',
1857    'imp':'\ud83d\udc7f',
1858    'inbox_tray':'\ud83d\udce5',
1859    'incoming_envelope':'\ud83d\udce8',
1860    'tipping_hand_woman':'\ud83d\udc81',
1861    'information_source':'\u2139\ufe0f',
1862    'innocent':'\ud83d\ude07',
1863    'interrobang':'\u2049\ufe0f',
1864    'iphone':'\ud83d\udcf1',
1865    'izakaya_lantern':'\ud83c\udfee',
1866    'jack_o_lantern':'\ud83c\udf83',
1867    'japan':'\ud83d\uddfe',
1868    'japanese_castle':'\ud83c\udfef',
1869    'japanese_goblin':'\ud83d\udc7a',
1870    'japanese_ogre':'\ud83d\udc79',
1871    'jeans':'\ud83d\udc56',
1872    'joy':'\ud83d\ude02',
1873    'joy_cat':'\ud83d\ude39',
1874    'joystick':'\ud83d\udd79',
1875    'kaaba':'\ud83d\udd4b',
1876    'key':'\ud83d\udd11',
1877    'keyboard':'\u2328\ufe0f',
1878    'keycap_ten':'\ud83d\udd1f',
1879    'kick_scooter':'\ud83d\udef4',
1880    'kimono':'\ud83d\udc58',
1881    'kiss':'\ud83d\udc8b',
1882    'kissing':'\ud83d\ude17',
1883    'kissing_cat':'\ud83d\ude3d',
1884    'kissing_closed_eyes':'\ud83d\ude1a',
1885    'kissing_heart':'\ud83d\ude18',
1886    'kissing_smiling_eyes':'\ud83d\ude19',
1887    'kiwi_fruit':'\ud83e\udd5d',
1888    'koala':'\ud83d\udc28',
1889    'koko':'\ud83c\ude01',
1890    'label':'\ud83c\udff7',
1891    'large_blue_circle':'\ud83d\udd35',
1892    'large_blue_diamond':'\ud83d\udd37',
1893    'large_orange_diamond':'\ud83d\udd36',
1894    'last_quarter_moon':'\ud83c\udf17',
1895    'last_quarter_moon_with_face':'\ud83c\udf1c',
1896    'latin_cross':'\u271d\ufe0f',
1897    'laughing':'\ud83d\ude06',
1898    'leaves':'\ud83c\udf43',
1899    'ledger':'\ud83d\udcd2',
1900    'left_luggage':'\ud83d\udec5',
1901    'left_right_arrow':'\u2194\ufe0f',
1902    'leftwards_arrow_with_hook':'\u21a9\ufe0f',
1903    'lemon':'\ud83c\udf4b',
1904    'leo':'\u264c\ufe0f',
1905    'leopard':'\ud83d\udc06',
1906    'level_slider':'\ud83c\udf9a',
1907    'libra':'\u264e\ufe0f',
1908    'light_rail':'\ud83d\ude88',
1909    'link':'\ud83d\udd17',
1910    'lion':'\ud83e\udd81',
1911    'lips':'\ud83d\udc44',
1912    'lipstick':'\ud83d\udc84',
1913    'lizard':'\ud83e\udd8e',
1914    'lock':'\ud83d\udd12',
1915    'lock_with_ink_pen':'\ud83d\udd0f',
1916    'lollipop':'\ud83c\udf6d',
1917    'loop':'\u27bf',
1918    'loud_sound':'\ud83d\udd0a',
1919    'loudspeaker':'\ud83d\udce2',
1920    'love_hotel':'\ud83c\udfe9',
1921    'love_letter':'\ud83d\udc8c',
1922    'low_brightness':'\ud83d\udd05',
1923    'lying_face':'\ud83e\udd25',
1924    'm':'\u24c2\ufe0f',
1925    'mag':'\ud83d\udd0d',
1926    'mag_right':'\ud83d\udd0e',
1927    'mahjong':'\ud83c\udc04\ufe0f',
1928    'mailbox':'\ud83d\udceb',
1929    'mailbox_closed':'\ud83d\udcea',
1930    'mailbox_with_mail':'\ud83d\udcec',
1931    'mailbox_with_no_mail':'\ud83d\udced',
1932    'man':'\ud83d\udc68',
1933    'man_artist':'\ud83d\udc68&zwj;\ud83c\udfa8',
1934    'man_astronaut':'\ud83d\udc68&zwj;\ud83d\ude80',
1935    'man_cartwheeling':'\ud83e\udd38&zwj;\u2642\ufe0f',
1936    'man_cook':'\ud83d\udc68&zwj;\ud83c\udf73',
1937    'man_dancing':'\ud83d\udd7a',
1938    'man_facepalming':'\ud83e\udd26&zwj;\u2642\ufe0f',
1939    'man_factory_worker':'\ud83d\udc68&zwj;\ud83c\udfed',
1940    'man_farmer':'\ud83d\udc68&zwj;\ud83c\udf3e',
1941    'man_firefighter':'\ud83d\udc68&zwj;\ud83d\ude92',
1942    'man_health_worker':'\ud83d\udc68&zwj;\u2695\ufe0f',
1943    'man_in_tuxedo':'\ud83e\udd35',
1944    'man_judge':'\ud83d\udc68&zwj;\u2696\ufe0f',
1945    'man_juggling':'\ud83e\udd39&zwj;\u2642\ufe0f',
1946    'man_mechanic':'\ud83d\udc68&zwj;\ud83d\udd27',
1947    'man_office_worker':'\ud83d\udc68&zwj;\ud83d\udcbc',
1948    'man_pilot':'\ud83d\udc68&zwj;\u2708\ufe0f',
1949    'man_playing_handball':'\ud83e\udd3e&zwj;\u2642\ufe0f',
1950    'man_playing_water_polo':'\ud83e\udd3d&zwj;\u2642\ufe0f',
1951    'man_scientist':'\ud83d\udc68&zwj;\ud83d\udd2c',
1952    'man_shrugging':'\ud83e\udd37&zwj;\u2642\ufe0f',
1953    'man_singer':'\ud83d\udc68&zwj;\ud83c\udfa4',
1954    'man_student':'\ud83d\udc68&zwj;\ud83c\udf93',
1955    'man_teacher':'\ud83d\udc68&zwj;\ud83c\udfeb',
1956    'man_technologist':'\ud83d\udc68&zwj;\ud83d\udcbb',
1957    'man_with_gua_pi_mao':'\ud83d\udc72',
1958    'man_with_turban':'\ud83d\udc73',
1959    'tangerine':'\ud83c\udf4a',
1960    'mans_shoe':'\ud83d\udc5e',
1961    'mantelpiece_clock':'\ud83d\udd70',
1962    'maple_leaf':'\ud83c\udf41',
1963    'martial_arts_uniform':'\ud83e\udd4b',
1964    'mask':'\ud83d\ude37',
1965    'massage_woman':'\ud83d\udc86',
1966    'massage_man':'\ud83d\udc86&zwj;\u2642\ufe0f',
1967    'meat_on_bone':'\ud83c\udf56',
1968    'medal_military':'\ud83c\udf96',
1969    'medal_sports':'\ud83c\udfc5',
1970    'mega':'\ud83d\udce3',
1971    'melon':'\ud83c\udf48',
1972    'memo':'\ud83d\udcdd',
1973    'men_wrestling':'\ud83e\udd3c&zwj;\u2642\ufe0f',
1974    'menorah':'\ud83d\udd4e',
1975    'mens':'\ud83d\udeb9',
1976    'metal':'\ud83e\udd18',
1977    'metro':'\ud83d\ude87',
1978    'microphone':'\ud83c\udfa4',
1979    'microscope':'\ud83d\udd2c',
1980    'milk_glass':'\ud83e\udd5b',
1981    'milky_way':'\ud83c\udf0c',
1982    'minibus':'\ud83d\ude90',
1983    'minidisc':'\ud83d\udcbd',
1984    'mobile_phone_off':'\ud83d\udcf4',
1985    'money_mouth_face':'\ud83e\udd11',
1986    'money_with_wings':'\ud83d\udcb8',
1987    'moneybag':'\ud83d\udcb0',
1988    'monkey':'\ud83d\udc12',
1989    'monkey_face':'\ud83d\udc35',
1990    'monorail':'\ud83d\ude9d',
1991    'moon':'\ud83c\udf14',
1992    'mortar_board':'\ud83c\udf93',
1993    'mosque':'\ud83d\udd4c',
1994    'motor_boat':'\ud83d\udee5',
1995    'motor_scooter':'\ud83d\udef5',
1996    'motorcycle':'\ud83c\udfcd',
1997    'motorway':'\ud83d\udee3',
1998    'mount_fuji':'\ud83d\uddfb',
1999    'mountain':'\u26f0',
2000    'mountain_biking_man':'\ud83d\udeb5',
2001    'mountain_biking_woman':'\ud83d\udeb5&zwj;\u2640\ufe0f',
2002    'mountain_cableway':'\ud83d\udea0',
2003    'mountain_railway':'\ud83d\ude9e',
2004    'mountain_snow':'\ud83c\udfd4',
2005    'mouse':'\ud83d\udc2d',
2006    'mouse2':'\ud83d\udc01',
2007    'movie_camera':'\ud83c\udfa5',
2008    'moyai':'\ud83d\uddff',
2009    'mrs_claus':'\ud83e\udd36',
2010    'muscle':'\ud83d\udcaa',
2011    'mushroom':'\ud83c\udf44',
2012    'musical_keyboard':'\ud83c\udfb9',
2013    'musical_note':'\ud83c\udfb5',
2014    'musical_score':'\ud83c\udfbc',
2015    'mute':'\ud83d\udd07',
2016    'nail_care':'\ud83d\udc85',
2017    'name_badge':'\ud83d\udcdb',
2018    'national_park':'\ud83c\udfde',
2019    'nauseated_face':'\ud83e\udd22',
2020    'necktie':'\ud83d\udc54',
2021    'negative_squared_cross_mark':'\u274e',
2022    'nerd_face':'\ud83e\udd13',
2023    'neutral_face':'\ud83d\ude10',
2024    'new':'\ud83c\udd95',
2025    'new_moon':'\ud83c\udf11',
2026    'new_moon_with_face':'\ud83c\udf1a',
2027    'newspaper':'\ud83d\udcf0',
2028    'newspaper_roll':'\ud83d\uddde',
2029    'next_track_button':'\u23ed',
2030    'ng':'\ud83c\udd96',
2031    'no_good_man':'\ud83d\ude45&zwj;\u2642\ufe0f',
2032    'no_good_woman':'\ud83d\ude45',
2033    'night_with_stars':'\ud83c\udf03',
2034    'no_bell':'\ud83d\udd15',
2035    'no_bicycles':'\ud83d\udeb3',
2036    'no_entry':'\u26d4\ufe0f',
2037    'no_entry_sign':'\ud83d\udeab',
2038    'no_mobile_phones':'\ud83d\udcf5',
2039    'no_mouth':'\ud83d\ude36',
2040    'no_pedestrians':'\ud83d\udeb7',
2041    'no_smoking':'\ud83d\udead',
2042    'non-potable_water':'\ud83d\udeb1',
2043    'nose':'\ud83d\udc43',
2044    'notebook':'\ud83d\udcd3',
2045    'notebook_with_decorative_cover':'\ud83d\udcd4',
2046    'notes':'\ud83c\udfb6',
2047    'nut_and_bolt':'\ud83d\udd29',
2048    'o':'\u2b55\ufe0f',
2049    'o2':'\ud83c\udd7e\ufe0f',
2050    'ocean':'\ud83c\udf0a',
2051    'octopus':'\ud83d\udc19',
2052    'oden':'\ud83c\udf62',
2053    'office':'\ud83c\udfe2',
2054    'oil_drum':'\ud83d\udee2',
2055    'ok':'\ud83c\udd97',
2056    'ok_hand':'\ud83d\udc4c',
2057    'ok_man':'\ud83d\ude46&zwj;\u2642\ufe0f',
2058    'ok_woman':'\ud83d\ude46',
2059    'old_key':'\ud83d\udddd',
2060    'older_man':'\ud83d\udc74',
2061    'older_woman':'\ud83d\udc75',
2062    'om':'\ud83d\udd49',
2063    'on':'\ud83d\udd1b',
2064    'oncoming_automobile':'\ud83d\ude98',
2065    'oncoming_bus':'\ud83d\ude8d',
2066    'oncoming_police_car':'\ud83d\ude94',
2067    'oncoming_taxi':'\ud83d\ude96',
2068    'open_file_folder':'\ud83d\udcc2',
2069    'open_hands':'\ud83d\udc50',
2070    'open_mouth':'\ud83d\ude2e',
2071    'open_umbrella':'\u2602\ufe0f',
2072    'ophiuchus':'\u26ce',
2073    'orange_book':'\ud83d\udcd9',
2074    'orthodox_cross':'\u2626\ufe0f',
2075    'outbox_tray':'\ud83d\udce4',
2076    'owl':'\ud83e\udd89',
2077    'ox':'\ud83d\udc02',
2078    'package':'\ud83d\udce6',
2079    'page_facing_up':'\ud83d\udcc4',
2080    'page_with_curl':'\ud83d\udcc3',
2081    'pager':'\ud83d\udcdf',
2082    'paintbrush':'\ud83d\udd8c',
2083    'palm_tree':'\ud83c\udf34',
2084    'pancakes':'\ud83e\udd5e',
2085    'panda_face':'\ud83d\udc3c',
2086    'paperclip':'\ud83d\udcce',
2087    'paperclips':'\ud83d\udd87',
2088    'parasol_on_ground':'\u26f1',
2089    'parking':'\ud83c\udd7f\ufe0f',
2090    'part_alternation_mark':'\u303d\ufe0f',
2091    'partly_sunny':'\u26c5\ufe0f',
2092    'passenger_ship':'\ud83d\udef3',
2093    'passport_control':'\ud83d\udec2',
2094    'pause_button':'\u23f8',
2095    'peace_symbol':'\u262e\ufe0f',
2096    'peach':'\ud83c\udf51',
2097    'peanuts':'\ud83e\udd5c',
2098    'pear':'\ud83c\udf50',
2099    'pen':'\ud83d\udd8a',
2100    'pencil2':'\u270f\ufe0f',
2101    'penguin':'\ud83d\udc27',
2102    'pensive':'\ud83d\ude14',
2103    'performing_arts':'\ud83c\udfad',
2104    'persevere':'\ud83d\ude23',
2105    'person_fencing':'\ud83e\udd3a',
2106    'pouting_woman':'\ud83d\ude4e',
2107    'phone':'\u260e\ufe0f',
2108    'pick':'\u26cf',
2109    'pig':'\ud83d\udc37',
2110    'pig2':'\ud83d\udc16',
2111    'pig_nose':'\ud83d\udc3d',
2112    'pill':'\ud83d\udc8a',
2113    'pineapple':'\ud83c\udf4d',
2114    'ping_pong':'\ud83c\udfd3',
2115    'pisces':'\u2653\ufe0f',
2116    'pizza':'\ud83c\udf55',
2117    'place_of_worship':'\ud83d\uded0',
2118    'plate_with_cutlery':'\ud83c\udf7d',
2119    'play_or_pause_button':'\u23ef',
2120    'point_down':'\ud83d\udc47',
2121    'point_left':'\ud83d\udc48',
2122    'point_right':'\ud83d\udc49',
2123    'point_up':'\u261d\ufe0f',
2124    'point_up_2':'\ud83d\udc46',
2125    'police_car':'\ud83d\ude93',
2126    'policewoman':'\ud83d\udc6e&zwj;\u2640\ufe0f',
2127    'poodle':'\ud83d\udc29',
2128    'popcorn':'\ud83c\udf7f',
2129    'post_office':'\ud83c\udfe3',
2130    'postal_horn':'\ud83d\udcef',
2131    'postbox':'\ud83d\udcee',
2132    'potable_water':'\ud83d\udeb0',
2133    'potato':'\ud83e\udd54',
2134    'pouch':'\ud83d\udc5d',
2135    'poultry_leg':'\ud83c\udf57',
2136    'pound':'\ud83d\udcb7',
2137    'rage':'\ud83d\ude21',
2138    'pouting_cat':'\ud83d\ude3e',
2139    'pouting_man':'\ud83d\ude4e&zwj;\u2642\ufe0f',
2140    'pray':'\ud83d\ude4f',
2141    'prayer_beads':'\ud83d\udcff',
2142    'pregnant_woman':'\ud83e\udd30',
2143    'previous_track_button':'\u23ee',
2144    'prince':'\ud83e\udd34',
2145    'princess':'\ud83d\udc78',
2146    'printer':'\ud83d\udda8',
2147    'purple_heart':'\ud83d\udc9c',
2148    'purse':'\ud83d\udc5b',
2149    'pushpin':'\ud83d\udccc',
2150    'put_litter_in_its_place':'\ud83d\udeae',
2151    'question':'\u2753',
2152    'rabbit':'\ud83d\udc30',
2153    'rabbit2':'\ud83d\udc07',
2154    'racehorse':'\ud83d\udc0e',
2155    'racing_car':'\ud83c\udfce',
2156    'radio':'\ud83d\udcfb',
2157    'radio_button':'\ud83d\udd18',
2158    'radioactive':'\u2622\ufe0f',
2159    'railway_car':'\ud83d\ude83',
2160    'railway_track':'\ud83d\udee4',
2161    'rainbow':'\ud83c\udf08',
2162    'rainbow_flag':'\ud83c\udff3\ufe0f&zwj;\ud83c\udf08',
2163    'raised_back_of_hand':'\ud83e\udd1a',
2164    'raised_hand_with_fingers_splayed':'\ud83d\udd90',
2165    'raised_hands':'\ud83d\ude4c',
2166    'raising_hand_woman':'\ud83d\ude4b',
2167    'raising_hand_man':'\ud83d\ude4b&zwj;\u2642\ufe0f',
2168    'ram':'\ud83d\udc0f',
2169    'ramen':'\ud83c\udf5c',
2170    'rat':'\ud83d\udc00',
2171    'record_button':'\u23fa',
2172    'recycle':'\u267b\ufe0f',
2173    'red_circle':'\ud83d\udd34',
2174    'registered':'\u00ae\ufe0f',
2175    'relaxed':'\u263a\ufe0f',
2176    'relieved':'\ud83d\ude0c',
2177    'reminder_ribbon':'\ud83c\udf97',
2178    'repeat':'\ud83d\udd01',
2179    'repeat_one':'\ud83d\udd02',
2180    'rescue_worker_helmet':'\u26d1',
2181    'restroom':'\ud83d\udebb',
2182    'revolving_hearts':'\ud83d\udc9e',
2183    'rewind':'\u23ea',
2184    'rhinoceros':'\ud83e\udd8f',
2185    'ribbon':'\ud83c\udf80',
2186    'rice':'\ud83c\udf5a',
2187    'rice_ball':'\ud83c\udf59',
2188    'rice_cracker':'\ud83c\udf58',
2189    'rice_scene':'\ud83c\udf91',
2190    'right_anger_bubble':'\ud83d\uddef',
2191    'ring':'\ud83d\udc8d',
2192    'robot':'\ud83e\udd16',
2193    'rocket':'\ud83d\ude80',
2194    'rofl':'\ud83e\udd23',
2195    'roll_eyes':'\ud83d\ude44',
2196    'roller_coaster':'\ud83c\udfa2',
2197    'rooster':'\ud83d\udc13',
2198    'rose':'\ud83c\udf39',
2199    'rosette':'\ud83c\udff5',
2200    'rotating_light':'\ud83d\udea8',
2201    'round_pushpin':'\ud83d\udccd',
2202    'rowing_man':'\ud83d\udea3',
2203    'rowing_woman':'\ud83d\udea3&zwj;\u2640\ufe0f',
2204    'rugby_football':'\ud83c\udfc9',
2205    'running_man':'\ud83c\udfc3',
2206    'running_shirt_with_sash':'\ud83c\udfbd',
2207    'running_woman':'\ud83c\udfc3&zwj;\u2640\ufe0f',
2208    'sa':'\ud83c\ude02\ufe0f',
2209    'sagittarius':'\u2650\ufe0f',
2210    'sake':'\ud83c\udf76',
2211    'sandal':'\ud83d\udc61',
2212    'santa':'\ud83c\udf85',
2213    'satellite':'\ud83d\udce1',
2214    'saxophone':'\ud83c\udfb7',
2215    'school':'\ud83c\udfeb',
2216    'school_satchel':'\ud83c\udf92',
2217    'scissors':'\u2702\ufe0f',
2218    'scorpion':'\ud83e\udd82',
2219    'scorpius':'\u264f\ufe0f',
2220    'scream':'\ud83d\ude31',
2221    'scream_cat':'\ud83d\ude40',
2222    'scroll':'\ud83d\udcdc',
2223    'seat':'\ud83d\udcba',
2224    'secret':'\u3299\ufe0f',
2225    'see_no_evil':'\ud83d\ude48',
2226    'seedling':'\ud83c\udf31',
2227    'selfie':'\ud83e\udd33',
2228    'shallow_pan_of_food':'\ud83e\udd58',
2229    'shamrock':'\u2618\ufe0f',
2230    'shark':'\ud83e\udd88',
2231    'shaved_ice':'\ud83c\udf67',
2232    'sheep':'\ud83d\udc11',
2233    'shell':'\ud83d\udc1a',
2234    'shield':'\ud83d\udee1',
2235    'shinto_shrine':'\u26e9',
2236    'ship':'\ud83d\udea2',
2237    'shirt':'\ud83d\udc55',
2238    'shopping':'\ud83d\udecd',
2239    'shopping_cart':'\ud83d\uded2',
2240    'shower':'\ud83d\udebf',
2241    'shrimp':'\ud83e\udd90',
2242    'signal_strength':'\ud83d\udcf6',
2243    'six_pointed_star':'\ud83d\udd2f',
2244    'ski':'\ud83c\udfbf',
2245    'skier':'\u26f7',
2246    'skull':'\ud83d\udc80',
2247    'skull_and_crossbones':'\u2620\ufe0f',
2248    'sleeping':'\ud83d\ude34',
2249    'sleeping_bed':'\ud83d\udecc',
2250    'sleepy':'\ud83d\ude2a',
2251    'slightly_frowning_face':'\ud83d\ude41',
2252    'slightly_smiling_face':'\ud83d\ude42',
2253    'slot_machine':'\ud83c\udfb0',
2254    'small_airplane':'\ud83d\udee9',
2255    'small_blue_diamond':'\ud83d\udd39',
2256    'small_orange_diamond':'\ud83d\udd38',
2257    'small_red_triangle':'\ud83d\udd3a',
2258    'small_red_triangle_down':'\ud83d\udd3b',
2259    'smile':'\ud83d\ude04',
2260    'smile_cat':'\ud83d\ude38',
2261    'smiley':'\ud83d\ude03',
2262    'smiley_cat':'\ud83d\ude3a',
2263    'smiling_imp':'\ud83d\ude08',
2264    'smirk':'\ud83d\ude0f',
2265    'smirk_cat':'\ud83d\ude3c',
2266    'smoking':'\ud83d\udeac',
2267    'snail':'\ud83d\udc0c',
2268    'snake':'\ud83d\udc0d',
2269    'sneezing_face':'\ud83e\udd27',
2270    'snowboarder':'\ud83c\udfc2',
2271    'snowflake':'\u2744\ufe0f',
2272    'snowman':'\u26c4\ufe0f',
2273    'snowman_with_snow':'\u2603\ufe0f',
2274    'sob':'\ud83d\ude2d',
2275    'soccer':'\u26bd\ufe0f',
2276    'soon':'\ud83d\udd1c',
2277    'sos':'\ud83c\udd98',
2278    'sound':'\ud83d\udd09',
2279    'space_invader':'\ud83d\udc7e',
2280    'spades':'\u2660\ufe0f',
2281    'spaghetti':'\ud83c\udf5d',
2282    'sparkle':'\u2747\ufe0f',
2283    'sparkler':'\ud83c\udf87',
2284    'sparkles':'\u2728',
2285    'sparkling_heart':'\ud83d\udc96',
2286    'speak_no_evil':'\ud83d\ude4a',
2287    'speaker':'\ud83d\udd08',
2288    'speaking_head':'\ud83d\udde3',
2289    'speech_balloon':'\ud83d\udcac',
2290    'speedboat':'\ud83d\udea4',
2291    'spider':'\ud83d\udd77',
2292    'spider_web':'\ud83d\udd78',
2293    'spiral_calendar':'\ud83d\uddd3',
2294    'spiral_notepad':'\ud83d\uddd2',
2295    'spoon':'\ud83e\udd44',
2296    'squid':'\ud83e\udd91',
2297    'stadium':'\ud83c\udfdf',
2298    'star':'\u2b50\ufe0f',
2299    'star2':'\ud83c\udf1f',
2300    'star_and_crescent':'\u262a\ufe0f',
2301    'star_of_david':'\u2721\ufe0f',
2302    'stars':'\ud83c\udf20',
2303    'station':'\ud83d\ude89',
2304    'statue_of_liberty':'\ud83d\uddfd',
2305    'steam_locomotive':'\ud83d\ude82',
2306    'stew':'\ud83c\udf72',
2307    'stop_button':'\u23f9',
2308    'stop_sign':'\ud83d\uded1',
2309    'stopwatch':'\u23f1',
2310    'straight_ruler':'\ud83d\udccf',
2311    'strawberry':'\ud83c\udf53',
2312    'stuck_out_tongue':'\ud83d\ude1b',
2313    'stuck_out_tongue_closed_eyes':'\ud83d\ude1d',
2314    'stuck_out_tongue_winking_eye':'\ud83d\ude1c',
2315    'studio_microphone':'\ud83c\udf99',
2316    'stuffed_flatbread':'\ud83e\udd59',
2317    'sun_behind_large_cloud':'\ud83c\udf25',
2318    'sun_behind_rain_cloud':'\ud83c\udf26',
2319    'sun_behind_small_cloud':'\ud83c\udf24',
2320    'sun_with_face':'\ud83c\udf1e',
2321    'sunflower':'\ud83c\udf3b',
2322    'sunglasses':'\ud83d\ude0e',
2323    'sunny':'\u2600\ufe0f',
2324    'sunrise':'\ud83c\udf05',
2325    'sunrise_over_mountains':'\ud83c\udf04',
2326    'surfing_man':'\ud83c\udfc4',
2327    'surfing_woman':'\ud83c\udfc4&zwj;\u2640\ufe0f',
2328    'sushi':'\ud83c\udf63',
2329    'suspension_railway':'\ud83d\ude9f',
2330    'sweat':'\ud83d\ude13',
2331    'sweat_drops':'\ud83d\udca6',
2332    'sweat_smile':'\ud83d\ude05',
2333    'sweet_potato':'\ud83c\udf60',
2334    'swimming_man':'\ud83c\udfca',
2335    'swimming_woman':'\ud83c\udfca&zwj;\u2640\ufe0f',
2336    'symbols':'\ud83d\udd23',
2337    'synagogue':'\ud83d\udd4d',
2338    'syringe':'\ud83d\udc89',
2339    'taco':'\ud83c\udf2e',
2340    'tada':'\ud83c\udf89',
2341    'tanabata_tree':'\ud83c\udf8b',
2342    'taurus':'\u2649\ufe0f',
2343    'taxi':'\ud83d\ude95',
2344    'tea':'\ud83c\udf75',
2345    'telephone_receiver':'\ud83d\udcde',
2346    'telescope':'\ud83d\udd2d',
2347    'tennis':'\ud83c\udfbe',
2348    'tent':'\u26fa\ufe0f',
2349    'thermometer':'\ud83c\udf21',
2350    'thinking':'\ud83e\udd14',
2351    'thought_balloon':'\ud83d\udcad',
2352    'ticket':'\ud83c\udfab',
2353    'tickets':'\ud83c\udf9f',
2354    'tiger':'\ud83d\udc2f',
2355    'tiger2':'\ud83d\udc05',
2356    'timer_clock':'\u23f2',
2357    'tipping_hand_man':'\ud83d\udc81&zwj;\u2642\ufe0f',
2358    'tired_face':'\ud83d\ude2b',
2359    'tm':'\u2122\ufe0f',
2360    'toilet':'\ud83d\udebd',
2361    'tokyo_tower':'\ud83d\uddfc',
2362    'tomato':'\ud83c\udf45',
2363    'tongue':'\ud83d\udc45',
2364    'top':'\ud83d\udd1d',
2365    'tophat':'\ud83c\udfa9',
2366    'tornado':'\ud83c\udf2a',
2367    'trackball':'\ud83d\uddb2',
2368    'tractor':'\ud83d\ude9c',
2369    'traffic_light':'\ud83d\udea5',
2370    'train':'\ud83d\ude8b',
2371    'train2':'\ud83d\ude86',
2372    'tram':'\ud83d\ude8a',
2373    'triangular_flag_on_post':'\ud83d\udea9',
2374    'triangular_ruler':'\ud83d\udcd0',
2375    'trident':'\ud83d\udd31',
2376    'triumph':'\ud83d\ude24',
2377    'trolleybus':'\ud83d\ude8e',
2378    'trophy':'\ud83c\udfc6',
2379    'tropical_drink':'\ud83c\udf79',
2380    'tropical_fish':'\ud83d\udc20',
2381    'truck':'\ud83d\ude9a',
2382    'trumpet':'\ud83c\udfba',
2383    'tulip':'\ud83c\udf37',
2384    'tumbler_glass':'\ud83e\udd43',
2385    'turkey':'\ud83e\udd83',
2386    'turtle':'\ud83d\udc22',
2387    'tv':'\ud83d\udcfa',
2388    'twisted_rightwards_arrows':'\ud83d\udd00',
2389    'two_hearts':'\ud83d\udc95',
2390    'two_men_holding_hands':'\ud83d\udc6c',
2391    'two_women_holding_hands':'\ud83d\udc6d',
2392    'u5272':'\ud83c\ude39',
2393    'u5408':'\ud83c\ude34',
2394    'u55b6':'\ud83c\ude3a',
2395    'u6307':'\ud83c\ude2f\ufe0f',
2396    'u6708':'\ud83c\ude37\ufe0f',
2397    'u6709':'\ud83c\ude36',
2398    'u6e80':'\ud83c\ude35',
2399    'u7121':'\ud83c\ude1a\ufe0f',
2400    'u7533':'\ud83c\ude38',
2401    'u7981':'\ud83c\ude32',
2402    'u7a7a':'\ud83c\ude33',
2403    'umbrella':'\u2614\ufe0f',
2404    'unamused':'\ud83d\ude12',
2405    'underage':'\ud83d\udd1e',
2406    'unicorn':'\ud83e\udd84',
2407    'unlock':'\ud83d\udd13',
2408    'up':'\ud83c\udd99',
2409    'upside_down_face':'\ud83d\ude43',
2410    'v':'\u270c\ufe0f',
2411    'vertical_traffic_light':'\ud83d\udea6',
2412    'vhs':'\ud83d\udcfc',
2413    'vibration_mode':'\ud83d\udcf3',
2414    'video_camera':'\ud83d\udcf9',
2415    'video_game':'\ud83c\udfae',
2416    'violin':'\ud83c\udfbb',
2417    'virgo':'\u264d\ufe0f',
2418    'volcano':'\ud83c\udf0b',
2419    'volleyball':'\ud83c\udfd0',
2420    'vs':'\ud83c\udd9a',
2421    'vulcan_salute':'\ud83d\udd96',
2422    'walking_man':'\ud83d\udeb6',
2423    'walking_woman':'\ud83d\udeb6&zwj;\u2640\ufe0f',
2424    'waning_crescent_moon':'\ud83c\udf18',
2425    'waning_gibbous_moon':'\ud83c\udf16',
2426    'warning':'\u26a0\ufe0f',
2427    'wastebasket':'\ud83d\uddd1',
2428    'watch':'\u231a\ufe0f',
2429    'water_buffalo':'\ud83d\udc03',
2430    'watermelon':'\ud83c\udf49',
2431    'wave':'\ud83d\udc4b',
2432    'wavy_dash':'\u3030\ufe0f',
2433    'waxing_crescent_moon':'\ud83c\udf12',
2434    'wc':'\ud83d\udebe',
2435    'weary':'\ud83d\ude29',
2436    'wedding':'\ud83d\udc92',
2437    'weight_lifting_man':'\ud83c\udfcb\ufe0f',
2438    'weight_lifting_woman':'\ud83c\udfcb\ufe0f&zwj;\u2640\ufe0f',
2439    'whale':'\ud83d\udc33',
2440    'whale2':'\ud83d\udc0b',
2441    'wheel_of_dharma':'\u2638\ufe0f',
2442    'wheelchair':'\u267f\ufe0f',
2443    'white_check_mark':'\u2705',
2444    'white_circle':'\u26aa\ufe0f',
2445    'white_flag':'\ud83c\udff3\ufe0f',
2446    'white_flower':'\ud83d\udcae',
2447    'white_large_square':'\u2b1c\ufe0f',
2448    'white_medium_small_square':'\u25fd\ufe0f',
2449    'white_medium_square':'\u25fb\ufe0f',
2450    'white_small_square':'\u25ab\ufe0f',
2451    'white_square_button':'\ud83d\udd33',
2452    'wilted_flower':'\ud83e\udd40',
2453    'wind_chime':'\ud83c\udf90',
2454    'wind_face':'\ud83c\udf2c',
2455    'wine_glass':'\ud83c\udf77',
2456    'wink':'\ud83d\ude09',
2457    'wolf':'\ud83d\udc3a',
2458    'woman':'\ud83d\udc69',
2459    'woman_artist':'\ud83d\udc69&zwj;\ud83c\udfa8',
2460    'woman_astronaut':'\ud83d\udc69&zwj;\ud83d\ude80',
2461    'woman_cartwheeling':'\ud83e\udd38&zwj;\u2640\ufe0f',
2462    'woman_cook':'\ud83d\udc69&zwj;\ud83c\udf73',
2463    'woman_facepalming':'\ud83e\udd26&zwj;\u2640\ufe0f',
2464    'woman_factory_worker':'\ud83d\udc69&zwj;\ud83c\udfed',
2465    'woman_farmer':'\ud83d\udc69&zwj;\ud83c\udf3e',
2466    'woman_firefighter':'\ud83d\udc69&zwj;\ud83d\ude92',
2467    'woman_health_worker':'\ud83d\udc69&zwj;\u2695\ufe0f',
2468    'woman_judge':'\ud83d\udc69&zwj;\u2696\ufe0f',
2469    'woman_juggling':'\ud83e\udd39&zwj;\u2640\ufe0f',
2470    'woman_mechanic':'\ud83d\udc69&zwj;\ud83d\udd27',
2471    'woman_office_worker':'\ud83d\udc69&zwj;\ud83d\udcbc',
2472    'woman_pilot':'\ud83d\udc69&zwj;\u2708\ufe0f',
2473    'woman_playing_handball':'\ud83e\udd3e&zwj;\u2640\ufe0f',
2474    'woman_playing_water_polo':'\ud83e\udd3d&zwj;\u2640\ufe0f',
2475    'woman_scientist':'\ud83d\udc69&zwj;\ud83d\udd2c',
2476    'woman_shrugging':'\ud83e\udd37&zwj;\u2640\ufe0f',
2477    'woman_singer':'\ud83d\udc69&zwj;\ud83c\udfa4',
2478    'woman_student':'\ud83d\udc69&zwj;\ud83c\udf93',
2479    'woman_teacher':'\ud83d\udc69&zwj;\ud83c\udfeb',
2480    'woman_technologist':'\ud83d\udc69&zwj;\ud83d\udcbb',
2481    'woman_with_turban':'\ud83d\udc73&zwj;\u2640\ufe0f',
2482    'womans_clothes':'\ud83d\udc5a',
2483    'womans_hat':'\ud83d\udc52',
2484    'women_wrestling':'\ud83e\udd3c&zwj;\u2640\ufe0f',
2485    'womens':'\ud83d\udeba',
2486    'world_map':'\ud83d\uddfa',
2487    'worried':'\ud83d\ude1f',
2488    'wrench':'\ud83d\udd27',
2489    'writing_hand':'\u270d\ufe0f',
2490    'x':'\u274c',
2491    'yellow_heart':'\ud83d\udc9b',
2492    'yen':'\ud83d\udcb4',
2493    'yin_yang':'\u262f\ufe0f',
2494    'yum':'\ud83d\ude0b',
2495    'zap':'\u26a1\ufe0f',
2496    'zipper_mouth_face':'\ud83e\udd10',
2497    'zzz':'\ud83d\udca4',
2498  
2499    /* special emojis :P */
2500    'octocat':  '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
2501    '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>'
2502  };
2503  
2504  /**
2505   * Created by Estevao on 31-05-2015.
2506   */
2507  
2508  /**
2509   * Showdown Converter class
2510   * @class
2511   * @param {object} [converterOptions]
2512   * @returns {Converter}
2513   */
2514  showdown.Converter = function (converterOptions) {
2515    'use strict';
2516  
2517    var
2518        /**
2519         * Options used by this converter
2520         * @private
2521         * @type {{}}
2522         */
2523        options = {},
2524  
2525        /**
2526         * Language extensions used by this converter
2527         * @private
2528         * @type {Array}
2529         */
2530        langExtensions = [],
2531  
2532        /**
2533         * Output modifiers extensions used by this converter
2534         * @private
2535         * @type {Array}
2536         */
2537        outputModifiers = [],
2538  
2539        /**
2540         * Event listeners
2541         * @private
2542         * @type {{}}
2543         */
2544        listeners = {},
2545  
2546        /**
2547         * The flavor set in this converter
2548         */
2549        setConvFlavor = setFlavor,
2550  
2551        /**
2552         * Metadata of the document
2553         * @type {{parsed: {}, raw: string, format: string}}
2554         */
2555        metadata = {
2556          parsed: {},
2557          raw: '',
2558          format: ''
2559        };
2560  
2561    _constructor();
2562  
2563    /**
2564     * Converter constructor
2565     * @private
2566     */
2567    function _constructor () {
2568      converterOptions = converterOptions || {};
2569  
2570      for (var gOpt in globalOptions) {
2571        if (globalOptions.hasOwnProperty(gOpt)) {
2572          options[gOpt] = globalOptions[gOpt];
2573        }
2574      }
2575  
2576      // Merge options
2577      if (typeof converterOptions === 'object') {
2578        for (var opt in converterOptions) {
2579          if (converterOptions.hasOwnProperty(opt)) {
2580            options[opt] = converterOptions[opt];
2581          }
2582        }
2583      } else {
2584        throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +
2585        ' was passed instead.');
2586      }
2587  
2588      if (options.extensions) {
2589        showdown.helper.forEach(options.extensions, _parseExtension);
2590      }
2591    }
2592  
2593    /**
2594     * Parse extension
2595     * @param {*} ext
2596     * @param {string} [name='']
2597     * @private
2598     */
2599    function _parseExtension (ext, name) {
2600  
2601      name = name || null;
2602      // If it's a string, the extension was previously loaded
2603      if (showdown.helper.isString(ext)) {
2604        ext = showdown.helper.stdExtName(ext);
2605        name = ext;
2606  
2607        // LEGACY_SUPPORT CODE
2608        if (showdown.extensions[ext]) {
2609          console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +
2610            'Please inform the developer that the extension should be updated!');
2611          legacyExtensionLoading(showdown.extensions[ext], ext);
2612          return;
2613          // END LEGACY SUPPORT CODE
2614  
2615        } else if (!showdown.helper.isUndefined(extensions[ext])) {
2616          ext = extensions[ext];
2617  
2618        } else {
2619          throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.');
2620        }
2621      }
2622  
2623      if (typeof ext === 'function') {
2624        ext = ext();
2625      }
2626  
2627      if (!showdown.helper.isArray(ext)) {
2628        ext = [ext];
2629      }
2630  
2631      var validExt = validate(ext, name);
2632      if (!validExt.valid) {
2633        throw Error(validExt.error);
2634      }
2635  
2636      for (var i = 0; i < ext.length; ++i) {
2637        switch (ext[i].type) {
2638  
2639          case 'lang':
2640            langExtensions.push(ext[i]);
2641            break;
2642  
2643          case 'output':
2644            outputModifiers.push(ext[i]);
2645            break;
2646        }
2647        if (ext[i].hasOwnProperty('listeners')) {
2648          for (var ln in ext[i].listeners) {
2649            if (ext[i].listeners.hasOwnProperty(ln)) {
2650              listen(ln, ext[i].listeners[ln]);
2651            }
2652          }
2653        }
2654      }
2655  
2656    }
2657  
2658    /**
2659     * LEGACY_SUPPORT
2660     * @param {*} ext
2661     * @param {string} name
2662     */
2663    function legacyExtensionLoading (ext, name) {
2664      if (typeof ext === 'function') {
2665        ext = ext(new showdown.Converter());
2666      }
2667      if (!showdown.helper.isArray(ext)) {
2668        ext = [ext];
2669      }
2670      var valid = validate(ext, name);
2671  
2672      if (!valid.valid) {
2673        throw Error(valid.error);
2674      }
2675  
2676      for (var i = 0; i < ext.length; ++i) {
2677        switch (ext[i].type) {
2678          case 'lang':
2679            langExtensions.push(ext[i]);
2680            break;
2681          case 'output':
2682            outputModifiers.push(ext[i]);
2683            break;
2684          default:// should never reach here
2685            throw Error('Extension loader error: Type unrecognized!!!');
2686        }
2687      }
2688    }
2689  
2690    /**
2691     * Listen to an event
2692     * @param {string} name
2693     * @param {function} callback
2694     */
2695    function listen (name, callback) {
2696      if (!showdown.helper.isString(name)) {
2697        throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');
2698      }
2699  
2700      if (typeof callback !== 'function') {
2701        throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');
2702      }
2703  
2704      if (!listeners.hasOwnProperty(name)) {
2705        listeners[name] = [];
2706      }
2707      listeners[name].push(callback);
2708    }
2709  
2710    function rTrimInputText (text) {
2711      var rsp = text.match(/^\s*/)[0].length,
2712          rgx = new RegExp('^\\s{0,' + rsp + '}', 'gm');
2713      return text.replace(rgx, '');
2714    }
2715  
2716    /**
2717     * Dispatch an event
2718     * @private
2719     * @param {string} evtName Event name
2720     * @param {string} text Text
2721     * @param {{}} options Converter Options
2722     * @param {{}} globals
2723     * @returns {string}
2724     */
2725    this._dispatch = function dispatch (evtName, text, options, globals) {
2726      if (listeners.hasOwnProperty(evtName)) {
2727        for (var ei = 0; ei < listeners[evtName].length; ++ei) {
2728          var nText = listeners[evtName][ei](evtName, text, this, options, globals);
2729          if (nText && typeof nText !== 'undefined') {
2730            text = nText;
2731          }
2732        }
2733      }
2734      return text;
2735    };
2736  
2737    /**
2738     * Listen to an event
2739     * @param {string} name
2740     * @param {function} callback
2741     * @returns {showdown.Converter}
2742     */
2743    this.listen = function (name, callback) {
2744      listen(name, callback);
2745      return this;
2746    };
2747  
2748    /**
2749     * Converts a markdown string into HTML
2750     * @param {string} text
2751     * @returns {*}
2752     */
2753    this.makeHtml = function (text) {
2754      //check if text is not falsy
2755      if (!text) {
2756        return text;
2757      }
2758  
2759      var globals = {
2760        gHtmlBlocks:     [],
2761        gHtmlMdBlocks:   [],
2762        gHtmlSpans:      [],
2763        gUrls:           {},
2764        gTitles:         {},
2765        gDimensions:     {},
2766        gListLevel:      0,
2767        hashLinkCounts:  {},
2768        langExtensions:  langExtensions,
2769        outputModifiers: outputModifiers,
2770        converter:       this,
2771        ghCodeBlocks:    [],
2772        metadata: {
2773          parsed: {},
2774          raw: '',
2775          format: ''
2776        }
2777      };
2778  
2779      // This lets us use ¨ trema as an escape char to avoid md5 hashes
2780      // The choice of character is arbitrary; anything that isn't
2781      // magic in Markdown will work.
2782      text = text.replace(/¨/g, '¨T');
2783  
2784      // Replace $ with ¨D
2785      // RegExp interprets $ as a special character
2786      // when it's in a replacement string
2787      text = text.replace(/\$/g, '¨D');
2788  
2789      // Standardize line endings
2790      text = text.replace(/\r\n/g, '\n'); // DOS to Unix
2791      text = text.replace(/\r/g, '\n'); // Mac to Unix
2792  
2793      // Stardardize line spaces
2794      text = text.replace(/\u00A0/g, '&nbsp;');
2795  
2796      if (options.smartIndentationFix) {
2797        text = rTrimInputText(text);
2798      }
2799  
2800      // Make sure text begins and ends with a couple of newlines:
2801      text = '\n\n' + text + '\n\n';
2802  
2803      // detab
2804      text = showdown.subParser('detab')(text, options, globals);
2805  
2806      /**
2807       * Strip any lines consisting only of spaces and tabs.
2808       * This makes subsequent regexs easier to write, because we can
2809       * match consecutive blank lines with /\n+/ instead of something
2810       * contorted like /[ \t]*\n+/
2811       */
2812      text = text.replace(/^[ \t]+$/mg, '');
2813  
2814      //run languageExtensions
2815      showdown.helper.forEach(langExtensions, function (ext) {
2816        text = showdown.subParser('runExtension')(ext, text, options, globals);
2817      });
2818  
2819      // run the sub parsers
2820      text = showdown.subParser('metadata')(text, options, globals);
2821      text = showdown.subParser('hashPreCodeTags')(text, options, globals);
2822      text = showdown.subParser('githubCodeBlocks')(text, options, globals);
2823      text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
2824      text = showdown.subParser('hashCodeTags')(text, options, globals);
2825      text = showdown.subParser('stripLinkDefinitions')(text, options, globals);
2826      text = showdown.subParser('blockGamut')(text, options, globals);
2827      text = showdown.subParser('unhashHTMLSpans')(text, options, globals);
2828      text = showdown.subParser('unescapeSpecialChars')(text, options, globals);
2829  
2830      // attacklab: Restore dollar signs
2831      text = text.replace(/¨D/g, '$$');
2832  
2833      // attacklab: Restore tremas
2834      text = text.replace(/¨T/g, '¨');
2835  
2836      // render a complete html document instead of a partial if the option is enabled
2837      text = showdown.subParser('completeHTMLDocument')(text, options, globals);
2838  
2839      // Run output modifiers
2840      showdown.helper.forEach(outputModifiers, function (ext) {
2841        text = showdown.subParser('runExtension')(ext, text, options, globals);
2842      });
2843  
2844      // update metadata
2845      metadata = globals.metadata;
2846      return text;
2847    };
2848  
2849    /**
2850     * Converts an HTML string into a markdown string
2851     * @param src
2852     * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used.
2853     * @returns {string}
2854     */
2855    this.makeMarkdown = this.makeMd = function (src, HTMLParser) {
2856  
2857      // replace \r\n with \n
2858      src = src.replace(/\r\n/g, '\n');
2859      src = src.replace(/\r/g, '\n'); // old macs
2860  
2861      // due to an edge case, we need to find this: > <
2862      // to prevent removing of non silent white spaces
2863      // ex: <em>this is</em> <strong>sparta</strong>
2864      src = src.replace(/>[ \t]+</, '>¨NBSP;<');
2865  
2866      if (!HTMLParser) {
2867        if (window && window.document) {
2868          HTMLParser = window.document;
2869        } else {
2870          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');
2871        }
2872      }
2873  
2874      var doc = HTMLParser.createElement('div');
2875      doc.innerHTML = src;
2876  
2877      var globals = {
2878        preList: substitutePreCodeTags(doc)
2879      };
2880  
2881      // remove all newlines and collapse spaces
2882      clean(doc);
2883  
2884      // some stuff, like accidental reference links must now be escaped
2885      // TODO
2886      // doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/);
2887  
2888      var nodes = doc.childNodes,
2889          mdDoc = '';
2890  
2891      for (var i = 0; i < nodes.length; i++) {
2892        mdDoc += showdown.subParser('makeMarkdown.node')(nodes[i], globals);
2893      }
2894  
2895      function clean (node) {
2896        for (var n = 0; n < node.childNodes.length; ++n) {
2897          var child = node.childNodes[n];
2898          if (child.nodeType === 3) {
2899            if (!/\S/.test(child.nodeValue)) {
2900              node.removeChild(child);
2901              --n;
2902            } else {
2903              child.nodeValue = child.nodeValue.split('\n').join(' ');
2904              child.nodeValue = child.nodeValue.replace(/(\s)+/g, '$1');
2905            }
2906          } else if (child.nodeType === 1) {
2907            clean(child);
2908          }
2909        }
2910      }
2911  
2912      // find all pre tags and replace contents with placeholder
2913      // we need this so that we can remove all indentation from html
2914      // to ease up parsing
2915      function substitutePreCodeTags (doc) {
2916  
2917        var pres = doc.querySelectorAll('pre'),
2918            presPH = [];
2919  
2920        for (var i = 0; i < pres.length; ++i) {
2921  
2922          if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {
2923            var content = pres[i].firstChild.innerHTML.trim(),
2924                language = pres[i].firstChild.getAttribute('data-language') || '';
2925  
2926            // if data-language attribute is not defined, then we look for class language-*
2927            if (language === '') {
2928              var classes = pres[i].firstChild.className.split(' ');
2929              for (var c = 0; c < classes.length; ++c) {
2930                var matches = classes[c].match(/^language-(.+)$/);
2931                if (matches !== null) {
2932                  language = matches[1];
2933                  break;
2934                }
2935              }
2936            }
2937  
2938            // unescape html entities in content
2939            content = showdown.helper.unescapeHTMLEntities(content);
2940  
2941            presPH.push(content);
2942            pres[i].outerHTML = '<precode language="' + language + '" precodenum="' + i.toString() + '"></precode>';
2943          } else {
2944            presPH.push(pres[i].innerHTML);
2945            pres[i].innerHTML = '';
2946            pres[i].setAttribute('prenum', i.toString());
2947          }
2948        }
2949        return presPH;
2950      }
2951  
2952      return mdDoc;
2953    };
2954  
2955    /**
2956     * Set an option of this Converter instance
2957     * @param {string} key
2958     * @param {*} value
2959     */
2960    this.setOption = function (key, value) {
2961      options[key] = value;
2962    };
2963  
2964    /**
2965     * Get the option of this Converter instance
2966     * @param {string} key
2967     * @returns {*}
2968     */
2969    this.getOption = function (key) {
2970      return options[key];
2971    };
2972  
2973    /**
2974     * Get the options of this Converter instance
2975     * @returns {{}}
2976     */
2977    this.getOptions = function () {
2978      return options;
2979    };
2980  
2981    /**
2982     * Add extension to THIS converter
2983     * @param {{}} extension
2984     * @param {string} [name=null]
2985     */
2986    this.addExtension = function (extension, name) {
2987      name = name || null;
2988      _parseExtension(extension, name);
2989    };
2990  
2991    /**
2992     * Use a global registered extension with THIS converter
2993     * @param {string} extensionName Name of the previously registered extension
2994     */
2995    this.useExtension = function (extensionName) {
2996      _parseExtension(extensionName);
2997    };
2998  
2999    /**
3000     * Set the flavor THIS converter should use
3001     * @param {string} name
3002     */
3003    this.setFlavor = function (name) {
3004      if (!flavor.hasOwnProperty(name)) {
3005        throw Error(name + ' flavor was not found');
3006      }
3007      var preset = flavor[name];
3008      setConvFlavor = name;
3009      for (var option in preset) {
3010        if (preset.hasOwnProperty(option)) {
3011          options[option] = preset[option];
3012        }
3013      }
3014    };
3015  
3016    /**
3017     * Get the currently set flavor of this converter
3018     * @returns {string}
3019     */
3020    this.getFlavor = function () {
3021      return setConvFlavor;
3022    };
3023  
3024    /**
3025     * Remove an extension from THIS converter.
3026     * Note: This is a costly operation. It's better to initialize a new converter
3027     * and specify the extensions you wish to use
3028     * @param {Array} extension
3029     */
3030    this.removeExtension = function (extension) {
3031      if (!showdown.helper.isArray(extension)) {
3032        extension = [extension];
3033      }
3034      for (var a = 0; a < extension.length; ++a) {
3035        var ext = extension[a];
3036        for (var i = 0; i < langExtensions.length; ++i) {
3037          if (langExtensions[i] === ext) {
3038            langExtensions[i].splice(i, 1);
3039          }
3040        }
3041        for (var ii = 0; ii < outputModifiers.length; ++i) {
3042          if (outputModifiers[ii] === ext) {
3043            outputModifiers[ii].splice(i, 1);
3044          }
3045        }
3046      }
3047    };
3048  
3049    /**
3050     * Get all extension of THIS converter
3051     * @returns {{language: Array, output: Array}}
3052     */
3053    this.getAllExtensions = function () {
3054      return {
3055        language: langExtensions,
3056        output: outputModifiers
3057      };
3058    };
3059  
3060    /**
3061     * Get the metadata of the previously parsed document
3062     * @param raw
3063     * @returns {string|{}}
3064     */
3065    this.getMetadata = function (raw) {
3066      if (raw) {
3067        return metadata.raw;
3068      } else {
3069        return metadata.parsed;
3070      }
3071    };
3072  
3073    /**
3074     * Get the metadata format of the previously parsed document
3075     * @returns {string}
3076     */
3077    this.getMetadataFormat = function () {
3078      return metadata.format;
3079    };
3080  
3081    /**
3082     * Private: set a single key, value metadata pair
3083     * @param {string} key
3084     * @param {string} value
3085     */
3086    this._setMetadataPair = function (key, value) {
3087      metadata.parsed[key] = value;
3088    };
3089  
3090    /**
3091     * Private: set metadata format
3092     * @param {string} format
3093     */
3094    this._setMetadataFormat = function (format) {
3095      metadata.format = format;
3096    };
3097  
3098    /**
3099     * Private: set metadata raw text
3100     * @param {string} raw
3101     */
3102    this._setMetadataRaw = function (raw) {
3103      metadata.raw = raw;
3104    };
3105  };
3106  
3107  /**
3108   * Turn Markdown link shortcuts into XHTML <a> tags.
3109   */
3110  showdown.subParser('anchors', function (text, options, globals) {
3111    'use strict';
3112  
3113    text = globals.converter._dispatch('anchors.before', text, options, globals);
3114  
3115    var writeAnchorTag = function (wholeMatch, linkText, linkId, url, m5, m6, title) {
3116      if (showdown.helper.isUndefined(title)) {
3117        title = '';
3118      }
3119      linkId = linkId.toLowerCase();
3120  
3121      // Special case for explicit empty url
3122      if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
3123        url = '';
3124      } else if (!url) {
3125        if (!linkId) {
3126          // lower-case and turn embedded newlines into spaces
3127          linkId = linkText.toLowerCase().replace(/ ?\n/g, ' ');
3128        }
3129        url = '#' + linkId;
3130  
3131        if (!showdown.helper.isUndefined(globals.gUrls[linkId])) {
3132          url = globals.gUrls[linkId];
3133          if (!showdown.helper.isUndefined(globals.gTitles[linkId])) {
3134            title = globals.gTitles[linkId];
3135          }
3136        } else {
3137          return wholeMatch;
3138        }
3139      }
3140  
3141      //url = showdown.helper.escapeCharacters(url, '*_', false); // replaced line to improve performance
3142      url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
3143  
3144      var result = '<a href="' + url + '"';
3145  
3146      if (title !== '' && title !== null) {
3147        title = title.replace(/"/g, '&quot;');
3148        //title = showdown.helper.escapeCharacters(title, '*_', false); // replaced line to improve performance
3149        title = title.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
3150        result += ' title="' + title + '"';
3151      }
3152  
3153      // optionLinksInNewWindow only applies
3154      // to external links. Hash links (#) open in same page
3155      if (options.openLinksInNewWindow && !/^#/.test(url)) {
3156        // escaped _
3157        result += ' rel="noopener noreferrer" target="¨E95Eblank"';
3158      }
3159  
3160      result += '>' + linkText + '</a>';
3161  
3162      return result;
3163    };
3164  
3165    // First, handle reference-style links: [link text] [id]
3166    text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag);
3167  
3168    // Next, inline-style links: [link text](url "optional title")
3169    // cases with crazy urls like ./image/cat1).png
3170    text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3171      writeAnchorTag);
3172  
3173    // normal cases
3174    text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3175      writeAnchorTag);
3176  
3177    // handle reference-style shortcuts: [link text]
3178    // These must come last in case you've also got [link test][1]
3179    // or [link test](/foo)
3180    text = text.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag);
3181  
3182    // Lastly handle GithubMentions if option is enabled
3183    if (options.ghMentions) {
3184      text = text.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function (wm, st, escape, mentions, username) {
3185        if (escape === '\\') {
3186          return st + mentions;
3187        }
3188  
3189        //check if options.ghMentionsLink is a string
3190        if (!showdown.helper.isString(options.ghMentionsLink)) {
3191          throw new Error('ghMentionsLink option must be a string');
3192        }
3193        var lnk = options.ghMentionsLink.replace(/\{u}/g, username),
3194            target = '';
3195        if (options.openLinksInNewWindow) {
3196          target = ' rel="noopener noreferrer" target="¨E95Eblank"';
3197        }
3198        return st + '<a href="' + lnk + '"' + target + '>' + mentions + '</a>';
3199      });
3200    }
3201  
3202    text = globals.converter._dispatch('anchors.after', text, options, globals);
3203    return text;
3204  });
3205  
3206  // url allowed chars [a-z\d_.~:/?#[]@!$&'()*+,;=-]
3207  
3208  var simpleURLRegex  = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
3209      simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
3210      delimUrlRegex   = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
3211      simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,
3212      delimMailRegex  = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
3213  
3214      replaceLink = function (options) {
3215        'use strict';
3216        return function (wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {
3217          link = link.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
3218          var lnkTxt = link,
3219              append = '',
3220              target = '',
3221              lmc    = leadingMagicChars || '',
3222              tmc    = trailingMagicChars || '';
3223          if (/^www\./i.test(link)) {
3224            link = link.replace(/^www\./i, 'http://www.');
3225          }
3226          if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {
3227            append = trailingPunctuation;
3228          }
3229          if (options.openLinksInNewWindow) {
3230            target = ' rel="noopener noreferrer" target="¨E95Eblank"';
3231          }
3232          return lmc + '<a href="' + link + '"' + target + '>' + lnkTxt + '</a>' + append + tmc;
3233        };
3234      },
3235  
3236      replaceMail = function (options, globals) {
3237        'use strict';
3238        return function (wholeMatch, b, mail) {
3239          var href = 'mailto:';
3240          b = b || '';
3241          mail = showdown.subParser('unescapeSpecialChars')(mail, options, globals);
3242          if (options.encodeEmails) {
3243            href = showdown.helper.encodeEmailAddress(href + mail);
3244            mail = showdown.helper.encodeEmailAddress(mail);
3245          } else {
3246            href = href + mail;
3247          }
3248          return b + '<a href="' + href + '">' + mail + '</a>';
3249        };
3250      };
3251  
3252  showdown.subParser('autoLinks', function (text, options, globals) {
3253    'use strict';
3254  
3255    text = globals.converter._dispatch('autoLinks.before', text, options, globals);
3256  
3257    text = text.replace(delimUrlRegex, replaceLink(options));
3258    text = text.replace(delimMailRegex, replaceMail(options, globals));
3259  
3260    text = globals.converter._dispatch('autoLinks.after', text, options, globals);
3261  
3262    return text;
3263  });
3264  
3265  showdown.subParser('simplifiedAutoLinks', function (text, options, globals) {
3266    'use strict';
3267  
3268    if (!options.simplifiedAutoLink) {
3269      return text;
3270    }
3271  
3272    text = globals.converter._dispatch('simplifiedAutoLinks.before', text, options, globals);
3273  
3274    if (options.excludeTrailingPunctuationFromURLs) {
3275      text = text.replace(simpleURLRegex2, replaceLink(options));
3276    } else {
3277      text = text.replace(simpleURLRegex, replaceLink(options));
3278    }
3279    text = text.replace(simpleMailRegex, replaceMail(options, globals));
3280  
3281    text = globals.converter._dispatch('simplifiedAutoLinks.after', text, options, globals);
3282  
3283    return text;
3284  });
3285  
3286  /**
3287   * These are all the transformations that form block-level
3288   * tags like paragraphs, headers, and list items.
3289   */
3290  showdown.subParser('blockGamut', function (text, options, globals) {
3291    'use strict';
3292  
3293    text = globals.converter._dispatch('blockGamut.before', text, options, globals);
3294  
3295    // we parse blockquotes first so that we can have headings and hrs
3296    // inside blockquotes
3297    text = showdown.subParser('blockQuotes')(text, options, globals);
3298    text = showdown.subParser('headers')(text, options, globals);
3299  
3300    // Do Horizontal Rules:
3301    text = showdown.subParser('horizontalRule')(text, options, globals);
3302  
3303    text = showdown.subParser('lists')(text, options, globals);
3304    text = showdown.subParser('codeBlocks')(text, options, globals);
3305    text = showdown.subParser('tables')(text, options, globals);
3306  
3307    // We already ran _HashHTMLBlocks() before, in Markdown(), but that
3308    // was to escape raw HTML in the original Markdown source. This time,
3309    // we're escaping the markup we've just created, so that we don't wrap
3310    // <p> tags around block-level tags.
3311    text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
3312    text = showdown.subParser('paragraphs')(text, options, globals);
3313  
3314    text = globals.converter._dispatch('blockGamut.after', text, options, globals);
3315  
3316    return text;
3317  });
3318  
3319  showdown.subParser('blockQuotes', function (text, options, globals) {
3320    'use strict';
3321  
3322    text = globals.converter._dispatch('blockQuotes.before', text, options, globals);
3323  
3324    // add a couple extra lines after the text and endtext mark
3325    text = text + '\n\n';
3326  
3327    var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
3328  
3329    if (options.splitAdjacentBlockquotes) {
3330      rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm;
3331    }
3332  
3333    text = text.replace(rgx, function (bq) {
3334      // attacklab: hack around Konqueror 3.5.4 bug:
3335      // "----------bug".replace(/^-/g,"") == "bug"
3336      bq = bq.replace(/^[ \t]*>[ \t]?/gm, ''); // trim one level of quoting
3337  
3338      // attacklab: clean up hack
3339      bq = bq.replace(/¨0/g, '');
3340  
3341      bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
3342      bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);
3343      bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse
3344  
3345      bq = bq.replace(/(^|\n)/g, '$1  ');
3346      // These leading spaces screw with <pre> content, so we need to fix that:
3347      bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
3348        var pre = m1;
3349        // attacklab: hack around Konqueror 3.5.4 bug:
3350        pre = pre.replace(/^  /mg, '¨0');
3351        pre = pre.replace(/¨0/g, '');
3352        return pre;
3353      });
3354  
3355      return showdown.subParser('hashBlock')('<blockquote>\n' + bq + '\n</blockquote>', options, globals);
3356    });
3357  
3358    text = globals.converter._dispatch('blockQuotes.after', text, options, globals);
3359    return text;
3360  });
3361  
3362  /**
3363   * Process Markdown `<pre><code>` blocks.
3364   */
3365  showdown.subParser('codeBlocks', function (text, options, globals) {
3366    'use strict';
3367  
3368    text = globals.converter._dispatch('codeBlocks.before', text, options, globals);
3369  
3370    // sentinel workarounds for lack of \A and \Z, safari\khtml bug
3371    text += '¨0';
3372  
3373    var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
3374    text = text.replace(pattern, function (wholeMatch, m1, m2) {
3375      var codeblock = m1,
3376          nextChar = m2,
3377          end = '\n';
3378  
3379      codeblock = showdown.subParser('outdent')(codeblock, options, globals);
3380      codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
3381      codeblock = showdown.subParser('detab')(codeblock, options, globals);
3382      codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
3383      codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines
3384  
3385      if (options.omitExtraWLInCodeBlocks) {
3386        end = '';
3387      }
3388  
3389      codeblock = '<pre><code>' + codeblock + end + '</code></pre>';
3390  
3391      return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;
3392    });
3393  
3394    // strip sentinel
3395    text = text.replace(/¨0/, '');
3396  
3397    text = globals.converter._dispatch('codeBlocks.after', text, options, globals);
3398    return text;
3399  });
3400  
3401  /**
3402   *
3403   *   *  Backtick quotes are used for <code></code> spans.
3404   *
3405   *   *  You can use multiple backticks as the delimiters if you want to
3406   *     include literal backticks in the code span. So, this input:
3407   *
3408   *         Just type ``foo `bar` baz`` at the prompt.
3409   *
3410   *       Will translate to:
3411   *
3412   *         <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
3413   *
3414   *    There's no arbitrary limit to the number of backticks you
3415   *    can use as delimters. If you need three consecutive backticks
3416   *    in your code, use four for delimiters, etc.
3417   *
3418   *  *  You can use spaces to get literal backticks at the edges:
3419   *
3420   *         ... type `` `bar` `` ...
3421   *
3422   *       Turns to:
3423   *
3424   *         ... type <code>`bar`</code> ...
3425   */
3426  showdown.subParser('codeSpans', function (text, options, globals) {
3427    'use strict';
3428  
3429    text = globals.converter._dispatch('codeSpans.before', text, options, globals);
3430  
3431    if (typeof text === 'undefined') {
3432      text = '';
3433    }
3434    text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
3435      function (wholeMatch, m1, m2, m3) {
3436        var c = m3;
3437        c = c.replace(/^([ \t]*)/g, '');    // leading whitespace
3438        c = c.replace(/[ \t]*$/g, '');    // trailing whitespace
3439        c = showdown.subParser('encodeCode')(c, options, globals);
3440        c = m1 + '<code>' + c + '</code>';
3441        c = showdown.subParser('hashHTMLSpans')(c, options, globals);
3442        return c;
3443      }
3444    );
3445  
3446    text = globals.converter._dispatch('codeSpans.after', text, options, globals);
3447    return text;
3448  });
3449  
3450  /**
3451   * Create a full HTML document from the processed markdown
3452   */
3453  showdown.subParser('completeHTMLDocument', function (text, options, globals) {
3454    'use strict';
3455  
3456    if (!options.completeHTMLDocument) {
3457      return text;
3458    }
3459  
3460    text = globals.converter._dispatch('completeHTMLDocument.before', text, options, globals);
3461  
3462    var doctype = 'html',
3463        doctypeParsed = '<!DOCTYPE HTML>\n',
3464        title = '',
3465        charset = '<meta charset="utf-8">\n',
3466        lang = '',
3467        metadata = '';
3468  
3469    if (typeof globals.metadata.parsed.doctype !== 'undefined') {
3470      doctypeParsed = '<!DOCTYPE ' +  globals.metadata.parsed.doctype + '>\n';
3471      doctype = globals.metadata.parsed.doctype.toString().toLowerCase();
3472      if (doctype === 'html' || doctype === 'html5') {
3473        charset = '<meta charset="utf-8">';
3474      }
3475    }
3476  
3477    for (var meta in globals.metadata.parsed) {
3478      if (globals.metadata.parsed.hasOwnProperty(meta)) {
3479        switch (meta.toLowerCase()) {
3480          case 'doctype':
3481            break;
3482  
3483          case 'title':
3484            title = '<title>' +  globals.metadata.parsed.title + '</title>\n';
3485            break;
3486  
3487          case 'charset':
3488            if (doctype === 'html' || doctype === 'html5') {
3489              charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n';
3490            } else {
3491              charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n';
3492            }
3493            break;
3494  
3495          case 'language':
3496          case 'lang':
3497            lang = ' lang="' + globals.metadata.parsed[meta] + '"';
3498            metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3499            break;
3500  
3501          default:
3502            metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3503        }
3504      }
3505    }
3506  
3507    text = doctypeParsed + '<html' + lang + '>\n<head>\n' + title + charset + metadata + '</head>\n<body>\n' + text.trim() + '\n</body>\n</html>';
3508  
3509    text = globals.converter._dispatch('completeHTMLDocument.after', text, options, globals);
3510    return text;
3511  });
3512  
3513  /**
3514   * Convert all tabs to spaces
3515   */
3516  showdown.subParser('detab', function (text, options, globals) {
3517    'use strict';
3518    text = globals.converter._dispatch('detab.before', text, options, globals);
3519  
3520    // expand first n-1 tabs
3521    text = text.replace(/\t(?=\t)/g, '    '); // g_tab_width
3522  
3523    // replace the nth with two sentinels
3524    text = text.replace(/\t/g, '¨A¨B');
3525  
3526    // use the sentinel to anchor our regex so it doesn't explode
3527    text = text.replace(/¨B(.+?)¨A/g, function (wholeMatch, m1) {
3528      var leadingText = m1,
3529          numSpaces = 4 - leadingText.length % 4;  // g_tab_width
3530  
3531      // there *must* be a better way to do this:
3532      for (var i = 0; i < numSpaces; i++) {
3533        leadingText += ' ';
3534      }
3535  
3536      return leadingText;
3537    });
3538  
3539    // clean up sentinels
3540    text = text.replace(/¨A/g, '    ');  // g_tab_width
3541    text = text.replace(/¨B/g, '');
3542  
3543    text = globals.converter._dispatch('detab.after', text, options, globals);
3544    return text;
3545  });
3546  
3547  showdown.subParser('ellipsis', function (text, options, globals) {
3548    'use strict';
3549  
3550    text = globals.converter._dispatch('ellipsis.before', text, options, globals);
3551  
3552    text = text.replace(/\.\.\./g, '…');
3553  
3554    text = globals.converter._dispatch('ellipsis.after', text, options, globals);
3555  
3556    return text;
3557  });
3558  
3559  /**
3560   * Turn emoji codes into emojis
3561   *
3562   * List of supported emojis: https://github.com/showdownjs/showdown/wiki/Emojis
3563   */
3564  showdown.subParser('emoji', function (text, options, globals) {
3565    'use strict';
3566  
3567    if (!options.emoji) {
3568      return text;
3569    }
3570  
3571    text = globals.converter._dispatch('emoji.before', text, options, globals);
3572  
3573    var emojiRgx = /:([\S]+?):/g;
3574  
3575    text = text.replace(emojiRgx, function (wm, emojiCode) {
3576      if (showdown.helper.emojis.hasOwnProperty(emojiCode)) {
3577        return showdown.helper.emojis[emojiCode];
3578      }
3579      return wm;
3580    });
3581  
3582    text = globals.converter._dispatch('emoji.after', text, options, globals);
3583  
3584    return text;
3585  });
3586  
3587  /**
3588   * Smart processing for ampersands and angle brackets that need to be encoded.
3589   */
3590  showdown.subParser('encodeAmpsAndAngles', function (text, options, globals) {
3591    'use strict';
3592    text = globals.converter._dispatch('encodeAmpsAndAngles.before', text, options, globals);
3593  
3594    // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
3595    // http://bumppo.net/projects/amputator/
3596    text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, '&amp;');
3597  
3598    // Encode naked <'s
3599    text = text.replace(/<(?![a-z\/?$!])/gi, '&lt;');
3600  
3601    // Encode <
3602    text = text.replace(/</g, '&lt;');
3603  
3604    // Encode >
3605    text = text.replace(/>/g, '&gt;');
3606  
3607    text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals);
3608    return text;
3609  });
3610  
3611  /**
3612   * Returns the string, with after processing the following backslash escape sequences.
3613   *
3614   * attacklab: The polite way to do this is with the new escapeCharacters() function:
3615   *
3616   *    text = escapeCharacters(text,"\\",true);
3617   *    text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
3618   *
3619   * ...but we're sidestepping its use of the (slow) RegExp constructor
3620   * as an optimization for Firefox.  This function gets called a LOT.
3621   */
3622  showdown.subParser('encodeBackslashEscapes', function (text, options, globals) {
3623    'use strict';
3624    text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);
3625  
3626    text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
3627    text = text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown.helper.escapeCharactersCallback);
3628  
3629    text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);
3630    return text;
3631  });
3632  
3633  /**
3634   * Encode/escape certain characters inside Markdown code runs.
3635   * The point is that in code, these characters are literals,
3636   * and lose their special Markdown meanings.
3637   */
3638  showdown.subParser('encodeCode', function (text, options, globals) {
3639    'use strict';
3640  
3641    text = globals.converter._dispatch('encodeCode.before', text, options, globals);
3642  
3643    // Encode all ampersands; HTML entities are not
3644    // entities within a Markdown code span.
3645    text = text
3646      .replace(/&/g, '&amp;')
3647    // Do the angle bracket song and dance:
3648      .replace(/</g, '&lt;')
3649      .replace(/>/g, '&gt;')
3650    // Now, escape characters that are magic in Markdown:
3651      .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
3652  
3653    text = globals.converter._dispatch('encodeCode.after', text, options, globals);
3654    return text;
3655  });
3656  
3657  /**
3658   * Within tags -- meaning between < and > -- encode [\ ` * _ ~ =] so they
3659   * don't conflict with their use in Markdown for code, italics and strong.
3660   */
3661  showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) {
3662    'use strict';
3663    text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.before', text, options, globals);
3664  
3665    // Build a regex to find HTML tags.
3666    var tags     = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,
3667        comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;
3668  
3669    text = text.replace(tags, function (wholeMatch) {
3670      return wholeMatch
3671        .replace(/(.)<\/?code>(?=.)/g, '$1`')
3672        .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
3673    });
3674  
3675    text = text.replace(comments, function (wholeMatch) {
3676      return wholeMatch
3677        .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
3678    });
3679  
3680    text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals);
3681    return text;
3682  });
3683  
3684  /**
3685   * Handle github codeblocks prior to running HashHTML so that
3686   * HTML contained within the codeblock gets escaped properly
3687   * Example:
3688   * ```ruby
3689   *     def hello_world(x)
3690   *       puts "Hello, #{x}"
3691   *     end
3692   * ```
3693   */
3694  showdown.subParser('githubCodeBlocks', function (text, options, globals) {
3695    'use strict';
3696  
3697    // early exit if option is not enabled
3698    if (!options.ghCodeBlocks) {
3699      return text;
3700    }
3701  
3702    text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);
3703  
3704    text += '¨0';
3705  
3706    text = text.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function (wholeMatch, delim, language, codeblock) {
3707      var end = (options.omitExtraWLInCodeBlocks) ? '' : '\n';
3708  
3709      // First parse the github code block
3710      codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
3711      codeblock = showdown.subParser('detab')(codeblock, options, globals);
3712      codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
3713      codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing whitespace
3714  
3715      codeblock = '<pre><code' + (language ? ' class="' + language + ' language-' + language + '"' : '') + '>' + codeblock + end + '</code></pre>';
3716  
3717      codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);
3718  
3719      // Since GHCodeblocks can be false positives, we need to
3720      // store the primitive text and the parsed text in a global var,
3721      // and then return a token
3722      return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
3723    });
3724  
3725    // attacklab: strip sentinel
3726    text = text.replace(/¨0/, '');
3727  
3728    return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);
3729  });
3730  
3731  showdown.subParser('hashBlock', function (text, options, globals) {
3732    'use strict';
3733    text = globals.converter._dispatch('hashBlock.before', text, options, globals);
3734    text = text.replace(/(^\n+|\n+$)/g, '');
3735    text = '\n\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n';
3736    text = globals.converter._dispatch('hashBlock.after', text, options, globals);
3737    return text;
3738  });
3739  
3740  /**
3741   * Hash and escape <code> elements that should not be parsed as markdown
3742   */
3743  showdown.subParser('hashCodeTags', function (text, options, globals) {
3744    'use strict';
3745    text = globals.converter._dispatch('hashCodeTags.before', text, options, globals);
3746  
3747    var repFunc = function (wholeMatch, match, left, right) {
3748      var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
3749      return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';
3750    };
3751  
3752    // Hash naked <code>
3753    text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '<code\\b[^>]*>', '</code>', 'gim');
3754  
3755    text = globals.converter._dispatch('hashCodeTags.after', text, options, globals);
3756    return text;
3757  });
3758  
3759  showdown.subParser('hashElement', function (text, options, globals) {
3760    'use strict';
3761  
3762    return function (wholeMatch, m1) {
3763      var blockText = m1;
3764  
3765      // Undo double lines
3766      blockText = blockText.replace(/\n\n/g, '\n');
3767      blockText = blockText.replace(/^\n/, '');
3768  
3769      // strip trailing blank lines
3770      blockText = blockText.replace(/\n+$/g, '');
3771  
3772      // Replace the element text with a marker ("¨KxK" where x is its key)
3773      blockText = '\n\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n';
3774  
3775      return blockText;
3776    };
3777  });
3778  
3779  showdown.subParser('hashHTMLBlocks', function (text, options, globals) {
3780    'use strict';
3781    text = globals.converter._dispatch('hashHTMLBlocks.before', text, options, globals);
3782  
3783    var blockTags = [
3784          'pre',
3785          'div',
3786          'h1',
3787          'h2',
3788          'h3',
3789          'h4',
3790          'h5',
3791          'h6',
3792          'blockquote',
3793          'table',
3794          'dl',
3795          'ol',
3796          'ul',
3797          'script',
3798          'noscript',
3799          'form',
3800          'fieldset',
3801          'iframe',
3802          'math',
3803          'style',
3804          'section',
3805          'header',
3806          'footer',
3807          'nav',
3808          'article',
3809          'aside',
3810          'address',
3811          'audio',
3812          'canvas',
3813          'figure',
3814          'hgroup',
3815          'output',
3816          'video',
3817          'p'
3818        ],
3819        repFunc = function (wholeMatch, match, left, right) {
3820          var txt = wholeMatch;
3821          // check if this html element is marked as markdown
3822          // if so, it's contents should be parsed as markdown
3823          if (left.search(/\bmarkdown\b/) !== -1) {
3824            txt = left + globals.converter.makeHtml(match) + right;
3825          }
3826          return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
3827        };
3828  
3829    if (options.backslashEscapesHTMLTags) {
3830      // encode backslash escaped HTML tags
3831      text = text.replace(/\\<(\/?[^>]+?)>/g, function (wm, inside) {
3832        return '&lt;' + inside + '&gt;';
3833      });
3834    }
3835  
3836    // hash HTML Blocks
3837    for (var i = 0; i < blockTags.length; ++i) {
3838  
3839      var opTagPos,
3840          rgx1     = new RegExp('^ {0,3}(<' + blockTags[i] + '\\b[^>]*>)', 'im'),
3841          patLeft  = '<' + blockTags[i] + '\\b[^>]*>',
3842          patRight = '</' + blockTags[i] + '>';
3843      // 1. Look for the first position of the first opening HTML tag in the text
3844      while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {
3845  
3846        // if the HTML tag is \ escaped, we need to escape it and break
3847  
3848  
3849        //2. Split the text in that position
3850        var subTexts = showdown.helper.splitAtIndex(text, opTagPos),
3851            //3. Match recursively
3852            newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');
3853  
3854        // prevent an infinite loop
3855        if (newSubText1 === subTexts[1]) {
3856          break;
3857        }
3858        text = subTexts[0].concat(newSubText1);
3859      }
3860    }
3861    // HR SPECIAL CASE
3862    text = text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
3863      showdown.subParser('hashElement')(text, options, globals));
3864  
3865    // Special case for standalone HTML comments
3866    text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {
3867      return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
3868    }, '^ {0,3}<!--', '-->', 'gm');
3869  
3870    // PHP and ASP-style processor instructions (<?...?> and <%...%>)
3871    text = text.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
3872      showdown.subParser('hashElement')(text, options, globals));
3873  
3874    text = globals.converter._dispatch('hashHTMLBlocks.after', text, options, globals);
3875    return text;
3876  });
3877  
3878  /**
3879   * Hash span elements that should not be parsed as markdown
3880   */
3881  showdown.subParser('hashHTMLSpans', function (text, options, globals) {
3882    'use strict';
3883    text = globals.converter._dispatch('hashHTMLSpans.before', text, options, globals);
3884  
3885    function hashHTMLSpan (html) {
3886      return '¨C' + (globals.gHtmlSpans.push(html) - 1) + 'C';
3887    }
3888  
3889    // Hash Self Closing tags
3890    text = text.replace(/<[^>]+?\/>/gi, function (wm) {
3891      return hashHTMLSpan(wm);
3892    });
3893  
3894    // Hash tags without properties
3895    text = text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (wm) {
3896      return hashHTMLSpan(wm);
3897    });
3898  
3899    // Hash tags with properties
3900    text = text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function (wm) {
3901      return hashHTMLSpan(wm);
3902    });
3903  
3904    // Hash self closing tags without />
3905    text = text.replace(/<[^>]+?>/gi, function (wm) {
3906      return hashHTMLSpan(wm);
3907    });
3908  
3909    /*showdown.helper.matchRecursiveRegExp(text, '<code\\b[^>]*>', '</code>', 'gi');*/
3910  
3911    text = globals.converter._dispatch('hashHTMLSpans.after', text, options, globals);
3912    return text;
3913  });
3914  
3915  /**
3916   * Unhash HTML spans
3917   */
3918  showdown.subParser('unhashHTMLSpans', function (text, options, globals) {
3919    'use strict';
3920    text = globals.converter._dispatch('unhashHTMLSpans.before', text, options, globals);
3921  
3922    for (var i = 0; i < globals.gHtmlSpans.length; ++i) {
3923      var repText = globals.gHtmlSpans[i],
3924          // limiter to prevent infinite loop (assume 10 as limit for recurse)
3925          limit = 0;
3926  
3927      while (/¨C(\d+)C/.test(repText)) {
3928        var num = RegExp.$1;
3929        repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);
3930        if (limit === 10) {
3931          console.error('maximum nesting of 10 spans reached!!!');
3932          break;
3933        }
3934        ++limit;
3935      }
3936      text = text.replace('¨C' + i + 'C', repText);
3937    }
3938  
3939    text = globals.converter._dispatch('unhashHTMLSpans.after', text, options, globals);
3940    return text;
3941  });
3942  
3943  /**
3944   * Hash and escape <pre><code> elements that should not be parsed as markdown
3945   */
3946  showdown.subParser('hashPreCodeTags', function (text, options, globals) {
3947    'use strict';
3948    text = globals.converter._dispatch('hashPreCodeTags.before', text, options, globals);
3949  
3950    var repFunc = function (wholeMatch, match, left, right) {
3951      // encode html entities
3952      var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
3953      return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
3954    };
3955  
3956    // Hash <pre><code>
3957    text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>', '^ {0,3}</code>\\s*</pre>', 'gim');
3958  
3959    text = globals.converter._dispatch('hashPreCodeTags.after', text, options, globals);
3960    return text;
3961  });
3962  
3963  showdown.subParser('headers', function (text, options, globals) {
3964    'use strict';
3965  
3966    text = globals.converter._dispatch('headers.before', text, options, globals);
3967  
3968    var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
3969  
3970        // Set text-style headers:
3971        //    Header 1
3972        //    ========
3973        //
3974        //    Header 2
3975        //    --------
3976        //
3977        setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
3978        setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
3979  
3980    text = text.replace(setextRegexH1, function (wholeMatch, m1) {
3981  
3982      var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
3983          hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
3984          hLevel = headerLevelStart,
3985          hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
3986      return showdown.subParser('hashBlock')(hashBlock, options, globals);
3987    });
3988  
3989    text = text.replace(setextRegexH2, function (matchFound, m1) {
3990      var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
3991          hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
3992          hLevel = headerLevelStart + 1,
3993          hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
3994      return showdown.subParser('hashBlock')(hashBlock, options, globals);
3995    });
3996  
3997    // atx-style headers:
3998    //  # Header 1
3999    //  ## Header 2
4000    //  ## Header 2 with closing hashes ##
4001    //  ...
4002    //  ###### Header 6
4003    //
4004    var atxStyle = (options.requireSpaceBeforeHeadingText) ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;
4005  
4006    text = text.replace(atxStyle, function (wholeMatch, m1, m2) {
4007      var hText = m2;
4008      if (options.customizedHeaderId) {
4009        hText = m2.replace(/\s?\{([^{]+?)}\s*$/, '');
4010      }
4011  
4012      var span = showdown.subParser('spanGamut')(hText, options, globals),
4013          hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"',
4014          hLevel = headerLevelStart - 1 + m1.length,
4015          header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>';
4016  
4017      return showdown.subParser('hashBlock')(header, options, globals);
4018    });
4019  
4020    function headerId (m) {
4021      var title,
4022          prefix;
4023  
4024      // It is separate from other options to allow combining prefix and customized
4025      if (options.customizedHeaderId) {
4026        var match = m.match(/\{([^{]+?)}\s*$/);
4027        if (match && match[1]) {
4028          m = match[1];
4029        }
4030      }
4031  
4032      title = m;
4033  
4034      // Prefix id to prevent causing inadvertent pre-existing style matches.
4035      if (showdown.helper.isString(options.prefixHeaderId)) {
4036        prefix = options.prefixHeaderId;
4037      } else if (options.prefixHeaderId === true) {
4038        prefix = 'section-';
4039      } else {
4040        prefix = '';
4041      }
4042  
4043      if (!options.rawPrefixHeaderId) {
4044        title = prefix + title;
4045      }
4046  
4047      if (options.ghCompatibleHeaderId) {
4048        title = title
4049          .replace(/ /g, '-')
4050          // replace previously escaped chars (&, ¨ and $)
4051          .replace(/&amp;/g, '')
4052          .replace(/¨T/g, '')
4053          .replace(/¨D/g, '')
4054          // replace rest of the chars (&~$ are repeated as they might have been escaped)
4055          // borrowed from github's redcarpet (some they should produce similar results)
4056          .replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, '')
4057          .toLowerCase();
4058      } else if (options.rawHeaderId) {
4059        title = title
4060          .replace(/ /g, '-')
4061          // replace previously escaped chars (&, ¨ and $)
4062          .replace(/&amp;/g, '&')
4063          .replace(/¨T/g, '¨')
4064          .replace(/¨D/g, '$')
4065          // replace " and '
4066          .replace(/["']/g, '-')
4067          .toLowerCase();
4068      } else {
4069        title = title
4070          .replace(/[^\w]/g, '')
4071          .toLowerCase();
4072      }
4073  
4074      if (options.rawPrefixHeaderId) {
4075        title = prefix + title;
4076      }
4077  
4078      if (globals.hashLinkCounts[title]) {
4079        title = title + '-' + (globals.hashLinkCounts[title]++);
4080      } else {
4081        globals.hashLinkCounts[title] = 1;
4082      }
4083      return title;
4084    }
4085  
4086    text = globals.converter._dispatch('headers.after', text, options, globals);
4087    return text;
4088  });
4089  
4090  /**
4091   * Turn Markdown link shortcuts into XHTML <a> tags.
4092   */
4093  showdown.subParser('horizontalRule', function (text, options, globals) {
4094    'use strict';
4095    text = globals.converter._dispatch('horizontalRule.before', text, options, globals);
4096  
4097    var key = showdown.subParser('hashBlock')('<hr />', options, globals);
4098    text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
4099    text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
4100    text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
4101  
4102    text = globals.converter._dispatch('horizontalRule.after', text, options, globals);
4103    return text;
4104  });
4105  
4106  /**
4107   * Turn Markdown image shortcuts into <img> tags.
4108   */
4109  showdown.subParser('images', function (text, options, globals) {
4110    'use strict';
4111  
4112    text = globals.converter._dispatch('images.before', text, options, globals);
4113  
4114    var inlineRegExp      = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
4115        crazyRegExp       = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,
4116        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,
4117        referenceRegExp   = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,
4118        refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
4119  
4120    function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {
4121      url = url.replace(/\s/g, '');
4122      return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
4123    }
4124  
4125    function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
4126  
4127      var gUrls   = globals.gUrls,
4128          gTitles = globals.gTitles,
4129          gDims   = globals.gDimensions;
4130  
4131      linkId = linkId.toLowerCase();
4132  
4133      if (!title) {
4134        title = '';
4135      }
4136      // Special case for explicit empty url
4137      if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
4138        url = '';
4139  
4140      } else if (url === '' || url === null) {
4141        if (linkId === '' || linkId === null) {
4142          // lower-case and turn embedded newlines into spaces
4143          linkId = altText.toLowerCase().replace(/ ?\n/g, ' ');
4144        }
4145        url = '#' + linkId;
4146  
4147        if (!showdown.helper.isUndefined(gUrls[linkId])) {
4148          url = gUrls[linkId];
4149          if (!showdown.helper.isUndefined(gTitles[linkId])) {
4150            title = gTitles[linkId];
4151          }
4152          if (!showdown.helper.isUndefined(gDims[linkId])) {
4153            width = gDims[linkId].width;
4154            height = gDims[linkId].height;
4155          }
4156        } else {
4157          return wholeMatch;
4158        }
4159      }
4160  
4161      altText = altText
4162        .replace(/"/g, '&quot;')
4163      //altText = showdown.helper.escapeCharacters(altText, '*_', false);
4164        .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
4165      //url = showdown.helper.escapeCharacters(url, '*_', false);
4166      url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
4167      var result = '<img src="' + url + '" alt="' + altText + '"';
4168  
4169      if (title && showdown.helper.isString(title)) {
4170        title = title
4171          .replace(/"/g, '&quot;')
4172        //title = showdown.helper.escapeCharacters(title, '*_', false);
4173          .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
4174        result += ' title="' + title + '"';
4175      }
4176  
4177      if (width && height) {
4178        width  = (width === '*') ? 'auto' : width;
4179        height = (height === '*') ? 'auto' : height;
4180  
4181        result += ' width="' + width + '"';
4182        result += ' height="' + height + '"';
4183      }
4184  
4185      result += ' />';
4186  
4187      return result;
4188    }
4189  
4190    // First, handle reference-style labeled images: ![alt text][id]
4191    text = text.replace(referenceRegExp, writeImageTag);
4192  
4193    // Next, handle inline images:  ![alt text](url =<width>x<height> "optional title")
4194  
4195    // base64 encoded images
4196    text = text.replace(base64RegExp, writeImageTagBase64);
4197  
4198    // cases with crazy urls like ./image/cat1).png
4199    text = text.replace(crazyRegExp, writeImageTag);
4200  
4201    // normal cases
4202    text = text.replace(inlineRegExp, writeImageTag);
4203  
4204    // handle reference-style shortcuts: ![img text]
4205    text = text.replace(refShortcutRegExp, writeImageTag);
4206  
4207    text = globals.converter._dispatch('images.after', text, options, globals);
4208    return text;
4209  });
4210  
4211  showdown.subParser('italicsAndBold', function (text, options, globals) {
4212    'use strict';
4213  
4214    text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);
4215  
4216    // it's faster to have 3 separate regexes for each case than have just one
4217    // because of backtracing, in some cases, it could lead to an exponential effect
4218    // called "catastrophic backtrace". Ominous!
4219  
4220    function parseInside (txt, left, right) {
4221      /*
4222      if (options.simplifiedAutoLink) {
4223        txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
4224      }
4225      */
4226      return left + txt + right;
4227    }
4228  
4229    // Parse underscores
4230    if (options.literalMidWordUnderscores) {
4231      text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
4232        return parseInside (txt, '<strong><em>', '</em></strong>');
4233      });
4234      text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
4235        return parseInside (txt, '<strong>', '</strong>');
4236      });
4237      text = text.replace(/\b_(\S[\s\S]*?)_\b/g, function (wm, txt) {
4238        return parseInside (txt, '<em>', '</em>');
4239      });
4240    } else {
4241      text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
4242        return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
4243      });
4244      text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
4245        return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
4246      });
4247      text = text.replace(/_([^\s_][\s\S]*?)_/g, function (wm, m) {
4248        // !/^_[^_]/.test(m) - test if it doesn't start with __ (since it seems redundant, we removed it)
4249        return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
4250      });
4251    }
4252  
4253    // Now parse asterisks
4254    if (options.literalMidWordAsterisks) {
4255      text = text.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function (wm, lead, txt) {
4256        return parseInside (txt, lead + '<strong><em>', '</em></strong>');
4257      });
4258      text = text.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function (wm, lead, txt) {
4259        return parseInside (txt, lead + '<strong>', '</strong>');
4260      });
4261      text = text.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function (wm, lead, txt) {
4262        return parseInside (txt, lead + '<em>', '</em>');
4263      });
4264    } else {
4265      text = text.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function (wm, m) {
4266        return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
4267      });
4268      text = text.replace(/\*\*(\S[\s\S]*?)\*\*/g, function (wm, m) {
4269        return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
4270      });
4271      text = text.replace(/\*([^\s*][\s\S]*?)\*/g, function (wm, m) {
4272        // !/^\*[^*]/.test(m) - test if it doesn't start with ** (since it seems redundant, we removed it)
4273        return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
4274      });
4275    }
4276  
4277  
4278    text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);
4279    return text;
4280  });
4281  
4282  /**
4283   * Form HTML ordered (numbered) and unordered (bulleted) lists.
4284   */
4285  showdown.subParser('lists', function (text, options, globals) {
4286    'use strict';
4287  
4288    /**
4289     * Process the contents of a single ordered or unordered list, splitting it
4290     * into individual list items.
4291     * @param {string} listStr
4292     * @param {boolean} trimTrailing
4293     * @returns {string}
4294     */
4295    function processListItems (listStr, trimTrailing) {
4296      // The $g_list_level global keeps track of when we're inside a list.
4297      // Each time we enter a list, we increment it; when we leave a list,
4298      // we decrement. If it's zero, we're not in a list anymore.
4299      //
4300      // We do this because when we're not inside a list, we want to treat
4301      // something like this:
4302      //
4303      //    I recommend upgrading to version
4304      //    8. Oops, now this line is treated
4305      //    as a sub-list.
4306      //
4307      // As a single paragraph, despite the fact that the second line starts
4308      // with a digit-period-space sequence.
4309      //
4310      // Whereas when we're inside a list (or sub-list), that line will be
4311      // treated as the start of a sub-list. What a kludge, huh? This is
4312      // an aspect of Markdown's syntax that's hard to parse perfectly
4313      // without resorting to mind-reading. Perhaps the solution is to
4314      // change the syntax rules such that sub-lists must start with a
4315      // starting cardinal number; e.g. "1." or "a.".
4316      globals.gListLevel++;
4317  
4318      // trim trailing blank lines:
4319      listStr = listStr.replace(/\n{2,}$/, '\n');
4320  
4321      // attacklab: add sentinel to emulate \z
4322      listStr += '¨0';
4323  
4324      var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,
4325          isParagraphed = (/\n[ \t]*\n(?!¨0)/.test(listStr));
4326  
4327      // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation,
4328      // which is a syntax breaking change
4329      // activating this option reverts to old behavior
4330      if (options.disableForced4SpacesIndentedSublists) {
4331        rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm;
4332      }
4333  
4334      listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {
4335        checked = (checked && checked.trim() !== '');
4336  
4337        var item = showdown.subParser('outdent')(m4, options, globals),
4338            bulletStyle = '';
4339  
4340        // Support for github tasklists
4341        if (taskbtn && options.tasklists) {
4342          bulletStyle = ' class="task-list-item" style="list-style-type: none;"';
4343          item = item.replace(/^[ \t]*\[(x|X| )?]/m, function () {
4344            var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
4345            if (checked) {
4346              otp += ' checked';
4347            }
4348            otp += '>';
4349            return otp;
4350          });
4351        }
4352  
4353        // ISSUE #312
4354        // This input: - - - a
4355        // causes trouble to the parser, since it interprets it as:
4356        // <ul><li><li><li>a</li></li></li></ul>
4357        // instead of:
4358        // <ul><li>- - a</li></ul>
4359        // So, to prevent it, we will put a marker (¨A)in the beginning of the line
4360        // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
4361        item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
4362          return '¨A' + wm2;
4363        });
4364  
4365        // m1 - Leading line or
4366        // Has a double return (multi paragraph) or
4367        // Has sublist
4368        if (m1 || (item.search(/\n{2,}/) > -1)) {
4369          item = showdown.subParser('githubCodeBlocks')(item, options, globals);
4370          item = showdown.subParser('blockGamut')(item, options, globals);
4371        } else {
4372          // Recursion for sub-lists:
4373          item = showdown.subParser('lists')(item, options, globals);
4374          item = item.replace(/\n$/, ''); // chomp(item)
4375          item = showdown.subParser('hashHTMLBlocks')(item, options, globals);
4376  
4377          // Colapse double linebreaks
4378          item = item.replace(/\n\n+/g, '\n\n');
4379          if (isParagraphed) {
4380            item = showdown.subParser('paragraphs')(item, options, globals);
4381          } else {
4382            item = showdown.subParser('spanGamut')(item, options, globals);
4383          }
4384        }
4385  
4386        // now we need to remove the marker (¨A)
4387        item = item.replace('¨A', '');
4388        // we can finally wrap the line in list item tags
4389        item =  '<li' + bulletStyle + '>' + item + '</li>\n';
4390  
4391        return item;
4392      });
4393  
4394      // attacklab: strip sentinel
4395      listStr = listStr.replace(/¨0/g, '');
4396  
4397      globals.gListLevel--;
4398  
4399      if (trimTrailing) {
4400        listStr = listStr.replace(/\s+$/, '');
4401      }
4402  
4403      return listStr;
4404    }
4405  
4406    function styleStartNumber (list, listType) {
4407      // check if ol and starts by a number different than 1
4408      if (listType === 'ol') {
4409        var res = list.match(/^ *(\d+)\./);
4410        if (res && res[1] !== '1') {
4411          return ' start="' + res[1] + '"';
4412        }
4413      }
4414      return '';
4415    }
4416  
4417    /**
4418     * Check and parse consecutive lists (better fix for issue #142)
4419     * @param {string} list
4420     * @param {string} listType
4421     * @param {boolean} trimTrailing
4422     * @returns {string}
4423     */
4424    function parseConsecutiveLists (list, listType, trimTrailing) {
4425      // check if we caught 2 or more consecutive lists by mistake
4426      // we use the counterRgx, meaning if listType is UL we look for OL and vice versa
4427      var olRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm,
4428          ulRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm,
4429          counterRxg = (listType === 'ul') ? olRgx : ulRgx,
4430          result = '';
4431  
4432      if (list.search(counterRxg) !== -1) {
4433        (function parseCL (txt) {
4434          var pos = txt.search(counterRxg),
4435              style = styleStartNumber(list, listType);
4436          if (pos !== -1) {
4437            // slice
4438            result += '\n\n<' + listType + style + '>\n' + processListItems(txt.slice(0, pos), !!trimTrailing) + '</' + listType + '>\n';
4439  
4440            // invert counterType and listType
4441            listType = (listType === 'ul') ? 'ol' : 'ul';
4442            counterRxg = (listType === 'ul') ? olRgx : ulRgx;
4443  
4444            //recurse
4445            parseCL(txt.slice(pos));
4446          } else {
4447            result += '\n\n<' + listType + style + '>\n' + processListItems(txt, !!trimTrailing) + '</' + listType + '>\n';
4448          }
4449        })(list);
4450      } else {
4451        var style = styleStartNumber(list, listType);
4452        result = '\n\n<' + listType + style + '>\n' + processListItems(list, !!trimTrailing) + '</' + listType + '>\n';
4453      }
4454  
4455      return result;
4456    }
4457  
4458    /** Start of list parsing **/
4459    text = globals.converter._dispatch('lists.before', text, options, globals);
4460    // add sentinel to hack around khtml/safari bug:
4461    // http://bugs.webkit.org/show_bug.cgi?id=11231
4462    text += '¨0';
4463  
4464    if (globals.gListLevel) {
4465      text = text.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
4466        function (wholeMatch, list, m2) {
4467          var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
4468          return parseConsecutiveLists(list, listType, true);
4469        }
4470      );
4471    } else {
4472      text = text.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
4473        function (wholeMatch, m1, list, m3) {
4474          var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
4475          return parseConsecutiveLists(list, listType, false);
4476        }
4477      );
4478    }
4479  
4480    // strip sentinel
4481    text = text.replace(/¨0/, '');
4482    text = globals.converter._dispatch('lists.after', text, options, globals);
4483    return text;
4484  });
4485  
4486  /**
4487   * Parse metadata at the top of the document
4488   */
4489  showdown.subParser('metadata', function (text, options, globals) {
4490    'use strict';
4491  
4492    if (!options.metadata) {
4493      return text;
4494    }
4495  
4496    text = globals.converter._dispatch('metadata.before', text, options, globals);
4497  
4498    function parseMetadataContents (content) {
4499      // raw is raw so it's not changed in any way
4500      globals.metadata.raw = content;
4501  
4502      // escape chars forbidden in html attributes
4503      // double quotes
4504      content = content
4505        // ampersand first
4506        .replace(/&/g, '&amp;')
4507        // double quotes
4508        .replace(/"/g, '&quot;');
4509  
4510      content = content.replace(/\n {4}/g, ' ');
4511      content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function (wm, key, value) {
4512        globals.metadata.parsed[key] = value;
4513        return '';
4514      });
4515    }
4516  
4517    text = text.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function (wholematch, format, content) {
4518      parseMetadataContents(content);
4519      return '¨M';
4520    });
4521  
4522    text = text.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function (wholematch, format, content) {
4523      if (format) {
4524        globals.metadata.format = format;
4525      }
4526      parseMetadataContents(content);
4527      return '¨M';
4528    });
4529  
4530    text = text.replace(/¨M/g, '');
4531  
4532    text = globals.converter._dispatch('metadata.after', text, options, globals);
4533    return text;
4534  });
4535  
4536  /**
4537   * Remove one level of line-leading tabs or spaces
4538   */
4539  showdown.subParser('outdent', function (text, options, globals) {
4540    'use strict';
4541    text = globals.converter._dispatch('outdent.before', text, options, globals);
4542  
4543    // attacklab: hack around Konqueror 3.5.4 bug:
4544    // "----------bug".replace(/^-/g,"") == "bug"
4545    text = text.replace(/^(\t|[ ]{1,4})/gm, '¨0'); // attacklab: g_tab_width
4546  
4547    // attacklab: clean up hack
4548    text = text.replace(/¨0/g, '');
4549  
4550    text = globals.converter._dispatch('outdent.after', text, options, globals);
4551    return text;
4552  });
4553  
4554  /**
4555   *
4556   */
4557  showdown.subParser('paragraphs', function (text, options, globals) {
4558    'use strict';
4559  
4560    text = globals.converter._dispatch('paragraphs.before', text, options, globals);
4561    // Strip leading and trailing lines:
4562    text = text.replace(/^\n+/g, '');
4563    text = text.replace(/\n+$/g, '');
4564  
4565    var grafs = text.split(/\n{2,}/g),
4566        grafsOut = [],
4567        end = grafs.length; // Wrap <p> tags
4568  
4569    for (var i = 0; i < end; i++) {
4570      var str = grafs[i];
4571      // if this is an HTML marker, copy it
4572      if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
4573        grafsOut.push(str);
4574  
4575      // test for presence of characters to prevent empty lines being parsed
4576      // as paragraphs (resulting in undesired extra empty paragraphs)
4577      } else if (str.search(/\S/) >= 0) {
4578        str = showdown.subParser('spanGamut')(str, options, globals);
4579        str = str.replace(/^([ \t]*)/g, '<p>');
4580        str += '</p>';
4581        grafsOut.push(str);
4582      }
4583    }
4584  
4585    /** Unhashify HTML blocks */
4586    end = grafsOut.length;
4587    for (i = 0; i < end; i++) {
4588      var blockText = '',
4589          grafsOutIt = grafsOut[i],
4590          codeFlag = false;
4591      // if this is a marker for an html block...
4592      // use RegExp.test instead of string.search because of QML bug
4593      while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) {
4594        var delim = RegExp.$1,
4595            num   = RegExp.$2;
4596  
4597        if (delim === 'K') {
4598          blockText = globals.gHtmlBlocks[num];
4599        } else {
4600          // we need to check if ghBlock is a false positive
4601          if (codeFlag) {
4602            // use encoded version of all text
4603            blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text, options, globals);
4604          } else {
4605            blockText = globals.ghCodeBlocks[num].codeblock;
4606          }
4607        }
4608        blockText = blockText.replace(/\$/g, '$$$$'); // Escape any dollar signs
4609  
4610        grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText);
4611        // Check if grafsOutIt is a pre->code
4612        if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) {
4613          codeFlag = true;
4614        }
4615      }
4616      grafsOut[i] = grafsOutIt;
4617    }
4618    text = grafsOut.join('\n');
4619    // Strip leading and trailing lines:
4620    text = text.replace(/^\n+/g, '');
4621    text = text.replace(/\n+$/g, '');
4622    return globals.converter._dispatch('paragraphs.after', text, options, globals);
4623  });
4624  
4625  /**
4626   * Run extension
4627   */
4628  showdown.subParser('runExtension', function (ext, text, options, globals) {
4629    'use strict';
4630  
4631    if (ext.filter) {
4632      text = ext.filter(text, globals.converter, options);
4633  
4634    } else if (ext.regex) {
4635      // TODO remove this when old extension loading mechanism is deprecated
4636      var re = ext.regex;
4637      if (!(re instanceof RegExp)) {
4638        re = new RegExp(re, 'g');
4639      }
4640      text = text.replace(re, ext.replace);
4641    }
4642  
4643    return text;
4644  });
4645  
4646  /**
4647   * These are all the transformations that occur *within* block-level
4648   * tags like paragraphs, headers, and list items.
4649   */
4650  showdown.subParser('spanGamut', function (text, options, globals) {
4651    'use strict';
4652  
4653    text = globals.converter._dispatch('spanGamut.before', text, options, globals);
4654    text = showdown.subParser('codeSpans')(text, options, globals);
4655    text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);
4656    text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);
4657  
4658    // Process anchor and image tags. Images must come first,
4659    // because ![foo][f] looks like an anchor.
4660    text = showdown.subParser('images')(text, options, globals);
4661    text = showdown.subParser('anchors')(text, options, globals);
4662  
4663    // Make links out of things like `<http://example.com/>`
4664    // Must come after anchors, because you can use < and >
4665    // delimiters in inline links like [this](<url>).
4666    text = showdown.subParser('autoLinks')(text, options, globals);
4667    text = showdown.subParser('simplifiedAutoLinks')(text, options, globals);
4668    text = showdown.subParser('emoji')(text, options, globals);
4669    text = showdown.subParser('underline')(text, options, globals);
4670    text = showdown.subParser('italicsAndBold')(text, options, globals);
4671    text = showdown.subParser('strikethrough')(text, options, globals);
4672    text = showdown.subParser('ellipsis')(text, options, globals);
4673  
4674    // we need to hash HTML tags inside spans
4675    text = showdown.subParser('hashHTMLSpans')(text, options, globals);
4676  
4677    // now we encode amps and angles
4678    text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);
4679  
4680    // Do hard breaks
4681    if (options.simpleLineBreaks) {
4682      // GFM style hard breaks
4683      // only add line breaks if the text does not contain a block (special case for lists)
4684      if (!/\n\n¨K/.test(text)) {
4685        text = text.replace(/\n+/g, '<br />\n');
4686      }
4687    } else {
4688      // Vanilla hard breaks
4689      text = text.replace(/  +\n/g, '<br />\n');
4690    }
4691  
4692    text = globals.converter._dispatch('spanGamut.after', text, options, globals);
4693    return text;
4694  });
4695  
4696  showdown.subParser('strikethrough', function (text, options, globals) {
4697    'use strict';
4698  
4699    function parseInside (txt) {
4700      if (options.simplifiedAutoLink) {
4701        txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
4702      }
4703      return '<del>' + txt + '</del>';
4704    }
4705  
4706    if (options.strikethrough) {
4707      text = globals.converter._dispatch('strikethrough.before', text, options, globals);
4708      text = text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function (wm, txt) { return parseInside(txt); });
4709      text = globals.converter._dispatch('strikethrough.after', text, options, globals);
4710    }
4711  
4712    return text;
4713  });
4714  
4715  /**
4716   * Strips link definitions from text, stores the URLs and titles in
4717   * hash references.
4718   * Link defs are in the form: ^[id]: url "optional title"
4719   */
4720  showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
4721    'use strict';
4722  
4723    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,
4724        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;
4725  
4726    // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
4727    text += '¨0';
4728  
4729    var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {
4730      linkId = linkId.toLowerCase();
4731      if (url.match(/^data:.+?\/.+?;base64,/)) {
4732        // remove newlines
4733        globals.gUrls[linkId] = url.replace(/\s/g, '');
4734      } else {
4735        globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url, options, globals);  // Link IDs are case-insensitive
4736      }
4737  
4738      if (blankLines) {
4739        // Oops, found blank lines, so it's not a title.
4740        // Put back the parenthetical statement we stole.
4741        return blankLines + title;
4742  
4743      } else {
4744        if (title) {
4745          globals.gTitles[linkId] = title.replace(/"|'/g, '&quot;');
4746        }
4747        if (options.parseImgDimensions && width && height) {
4748          globals.gDimensions[linkId] = {
4749            width:  width,
4750            height: height
4751          };
4752        }
4753      }
4754      // Completely remove the definition from the text
4755      return '';
4756    };
4757  
4758    // first we try to find base64 link references
4759    text = text.replace(base64Regex, replaceFunc);
4760  
4761    text = text.replace(regex, replaceFunc);
4762  
4763    // attacklab: strip sentinel
4764    text = text.replace(/¨0/, '');
4765  
4766    return text;
4767  });
4768  
4769  showdown.subParser('tables', function (text, options, globals) {
4770    'use strict';
4771  
4772    if (!options.tables) {
4773      return text;
4774    }
4775  
4776    var tableRgx       = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,
4777        //singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
4778        singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
4779  
4780    function parseStyles (sLine) {
4781      if (/^:[ \t]*--*$/.test(sLine)) {
4782        return ' style="text-align:left;"';
4783      } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
4784        return ' style="text-align:right;"';
4785      } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
4786        return ' style="text-align:center;"';
4787      } else {
4788        return '';
4789      }
4790    }
4791  
4792    function parseHeaders (header, style) {
4793      var id = '';
4794      header = header.trim();
4795      // support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility
4796      if (options.tablesHeaderId || options.tableHeaderId) {
4797        id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
4798      }
4799      header = showdown.subParser('spanGamut')(header, options, globals);
4800  
4801      return '<th' + id + style + '>' + header + '</th>\n';
4802    }
4803  
4804    function parseCells (cell, style) {
4805      var subText = showdown.subParser('spanGamut')(cell, options, globals);
4806      return '<td' + style + '>' + subText + '</td>\n';
4807    }
4808  
4809    function buildTable (headers, cells) {
4810      var tb = '<table>\n<thead>\n<tr>\n',
4811          tblLgn = headers.length;
4812  
4813      for (var i = 0; i < tblLgn; ++i) {
4814        tb += headers[i];
4815      }
4816      tb += '</tr>\n</thead>\n<tbody>\n';
4817  
4818      for (i = 0; i < cells.length; ++i) {
4819        tb += '<tr>\n';
4820        for (var ii = 0; ii < tblLgn; ++ii) {
4821          tb += cells[i][ii];
4822        }
4823        tb += '</tr>\n';
4824      }
4825      tb += '</tbody>\n</table>\n';
4826      return tb;
4827    }
4828  
4829    function parseTable (rawTable) {
4830      var i, tableLines = rawTable.split('\n');
4831  
4832      for (i = 0; i < tableLines.length; ++i) {
4833        // strip wrong first and last column if wrapped tables are used
4834        if (/^ {0,3}\|/.test(tableLines[i])) {
4835          tableLines[i] = tableLines[i].replace(/^ {0,3}\|/, '');
4836        }
4837        if (/\|[ \t]*$/.test(tableLines[i])) {
4838          tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, '');
4839        }
4840        // parse code spans first, but we only support one line code spans
4841        tableLines[i] = showdown.subParser('codeSpans')(tableLines[i], options, globals);
4842      }
4843  
4844      var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),
4845          rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),
4846          rawCells = [],
4847          headers = [],
4848          styles = [],
4849          cells = [];
4850  
4851      tableLines.shift();
4852      tableLines.shift();
4853  
4854      for (i = 0; i < tableLines.length; ++i) {
4855        if (tableLines[i].trim() === '') {
4856          continue;
4857        }
4858        rawCells.push(
4859          tableLines[i]
4860            .split('|')
4861            .map(function (s) {
4862              return s.trim();
4863            })
4864        );
4865      }
4866  
4867      if (rawHeaders.length < rawStyles.length) {
4868        return rawTable;
4869      }
4870  
4871      for (i = 0; i < rawStyles.length; ++i) {
4872        styles.push(parseStyles(rawStyles[i]));
4873      }
4874  
4875      for (i = 0; i < rawHeaders.length; ++i) {
4876        if (showdown.helper.isUndefined(styles[i])) {
4877          styles[i] = '';
4878        }
4879        headers.push(parseHeaders(rawHeaders[i], styles[i]));
4880      }
4881  
4882      for (i = 0; i < rawCells.length; ++i) {
4883        var row = [];
4884        for (var ii = 0; ii < headers.length; ++ii) {
4885          if (showdown.helper.isUndefined(rawCells[i][ii])) {
4886  
4887          }
4888          row.push(parseCells(rawCells[i][ii], styles[ii]));
4889        }
4890        cells.push(row);
4891      }
4892  
4893      return buildTable(headers, cells);
4894    }
4895  
4896    text = globals.converter._dispatch('tables.before', text, options, globals);
4897  
4898    // find escaped pipe characters
4899    text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback);
4900  
4901    // parse multi column tables
4902    text = text.replace(tableRgx, parseTable);
4903  
4904    // parse one column tables
4905    text = text.replace(singeColTblRgx, parseTable);
4906  
4907    text = globals.converter._dispatch('tables.after', text, options, globals);
4908  
4909    return text;
4910  });
4911  
4912  showdown.subParser('underline', function (text, options, globals) {
4913    'use strict';
4914  
4915    if (!options.underline) {
4916      return text;
4917    }
4918  
4919    text = globals.converter._dispatch('underline.before', text, options, globals);
4920  
4921    if (options.literalMidWordUnderscores) {
4922      text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
4923        return '<u>' + txt + '</u>';
4924      });
4925      text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
4926        return '<u>' + txt + '</u>';
4927      });
4928    } else {
4929      text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
4930        return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
4931      });
4932      text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
4933        return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
4934      });
4935    }
4936  
4937    // escape remaining underscores to prevent them being parsed by italic and bold
4938    text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback);
4939  
4940    text = globals.converter._dispatch('underline.after', text, options, globals);
4941  
4942    return text;
4943  });
4944  
4945  /**
4946   * Swap back in all the special characters we've hidden.
4947   */
4948  showdown.subParser('unescapeSpecialChars', function (text, options, globals) {
4949    'use strict';
4950    text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals);
4951  
4952    text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) {
4953      var charCodeToReplace = parseInt(m1);
4954      return String.fromCharCode(charCodeToReplace);
4955    });
4956  
4957    text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals);
4958    return text;
4959  });
4960  
4961  showdown.subParser('makeMarkdown.blockquote', function (node, globals) {
4962    'use strict';
4963  
4964    var txt = '';
4965    if (node.hasChildNodes()) {
4966      var children = node.childNodes,
4967          childrenLength = children.length;
4968  
4969      for (var i = 0; i < childrenLength; ++i) {
4970        var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], globals);
4971  
4972        if (innerTxt === '') {
4973          continue;
4974        }
4975        txt += innerTxt;
4976      }
4977    }
4978    // cleanup
4979    txt = txt.trim();
4980    txt = '> ' + txt.split('\n').join('\n> ');
4981    return txt;
4982  });
4983  
4984  showdown.subParser('makeMarkdown.codeBlock', function (node, globals) {
4985    'use strict';
4986  
4987    var lang = node.getAttribute('language'),
4988        num  = node.getAttribute('precodenum');
4989    return '```' + lang + '\n' + globals.preList[num] + '\n```';
4990  });
4991  
4992  showdown.subParser('makeMarkdown.codeSpan', function (node) {
4993    'use strict';
4994  
4995    return '`' + node.innerHTML + '`';
4996  });
4997  
4998  showdown.subParser('makeMarkdown.emphasis', function (node, globals) {
4999    'use strict';
5000  
5001    var txt = '';
5002    if (node.hasChildNodes()) {
5003      txt += '*';
5004      var children = node.childNodes,
5005          childrenLength = children.length;
5006      for (var i = 0; i < childrenLength; ++i) {
5007        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5008      }
5009      txt += '*';
5010    }
5011    return txt;
5012  });
5013  
5014  showdown.subParser('makeMarkdown.header', function (node, globals, headerLevel) {
5015    'use strict';
5016  
5017    var headerMark = new Array(headerLevel + 1).join('#'),
5018        txt = '';
5019  
5020    if (node.hasChildNodes()) {
5021      txt = headerMark + ' ';
5022      var children = node.childNodes,
5023          childrenLength = children.length;
5024  
5025      for (var i = 0; i < childrenLength; ++i) {
5026        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5027      }
5028    }
5029    return txt;
5030  });
5031  
5032  showdown.subParser('makeMarkdown.hr', function () {
5033    'use strict';
5034  
5035    return '---';
5036  });
5037  
5038  showdown.subParser('makeMarkdown.image', function (node) {
5039    'use strict';
5040  
5041    var txt = '';
5042    if (node.hasAttribute('src')) {
5043      txt += '![' + node.getAttribute('alt') + '](';
5044      txt += '<' + node.getAttribute('src') + '>';
5045      if (node.hasAttribute('width') && node.hasAttribute('height')) {
5046        txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height');
5047      }
5048  
5049      if (node.hasAttribute('title')) {
5050        txt += ' "' + node.getAttribute('title') + '"';
5051      }
5052      txt += ')';
5053    }
5054    return txt;
5055  });
5056  
5057  showdown.subParser('makeMarkdown.links', function (node, globals) {
5058    'use strict';
5059  
5060    var txt = '';
5061    if (node.hasChildNodes() && node.hasAttribute('href')) {
5062      var children = node.childNodes,
5063          childrenLength = children.length;
5064      txt = '[';
5065      for (var i = 0; i < childrenLength; ++i) {
5066        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5067      }
5068      txt += '](';
5069      txt += '<' + node.getAttribute('href') + '>';
5070      if (node.hasAttribute('title')) {
5071        txt += ' "' + node.getAttribute('title') + '"';
5072      }
5073      txt += ')';
5074    }
5075    return txt;
5076  });
5077  
5078  showdown.subParser('makeMarkdown.list', function (node, globals, type) {
5079    'use strict';
5080  
5081    var txt = '';
5082    if (!node.hasChildNodes()) {
5083      return '';
5084    }
5085    var listItems       = node.childNodes,
5086        listItemsLenght = listItems.length,
5087        listNum = node.getAttribute('start') || 1;
5088  
5089    for (var i = 0; i < listItemsLenght; ++i) {
5090      if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') {
5091        continue;
5092      }
5093  
5094      // define the bullet to use in list
5095      var bullet = '';
5096      if (type === 'ol') {
5097        bullet = listNum.toString() + '. ';
5098      } else {
5099        bullet = '- ';
5100      }
5101  
5102      // parse list item
5103      txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], globals);
5104      ++listNum;
5105    }
5106  
5107    // add comment at the end to prevent consecutive lists to be parsed as one
5108    txt += '\n<!-- -->\n';
5109    return txt.trim();
5110  });
5111  
5112  showdown.subParser('makeMarkdown.listItem', function (node, globals) {
5113    'use strict';
5114  
5115    var listItemTxt = '';
5116  
5117    var children = node.childNodes,
5118        childrenLenght = children.length;
5119  
5120    for (var i = 0; i < childrenLenght; ++i) {
5121      listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5122    }
5123    // if it's only one liner, we need to add a newline at the end
5124    if (!/\n$/.test(listItemTxt)) {
5125      listItemTxt += '\n';
5126    } else {
5127      // it's multiparagraph, so we need to indent
5128      listItemTxt = listItemTxt
5129        .split('\n')
5130        .join('\n    ')
5131        .replace(/^ {4}$/gm, '')
5132        .replace(/\n\n+/g, '\n\n');
5133    }
5134  
5135    return listItemTxt;
5136  });
5137  
5138  
5139  
5140  showdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) {
5141    'use strict';
5142  
5143    spansOnly = spansOnly || false;
5144  
5145    var txt = '';
5146  
5147    // edge case of text without wrapper paragraph
5148    if (node.nodeType === 3) {
5149      return showdown.subParser('makeMarkdown.txt')(node, globals);
5150    }
5151  
5152    // HTML comment
5153    if (node.nodeType === 8) {
5154      return '<!--' + node.data + '-->\n\n';
5155    }
5156  
5157    // process only node elements
5158    if (node.nodeType !== 1) {
5159      return '';
5160    }
5161  
5162    var tagName = node.tagName.toLowerCase();
5163  
5164    switch (tagName) {
5165  
5166      //
5167      // BLOCKS
5168      //
5169      case 'h1':
5170        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 1) + '\n\n'; }
5171        break;
5172      case 'h2':
5173        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 2) + '\n\n'; }
5174        break;
5175      case 'h3':
5176        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 3) + '\n\n'; }
5177        break;
5178      case 'h4':
5179        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 4) + '\n\n'; }
5180        break;
5181      case 'h5':
5182        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 5) + '\n\n'; }
5183        break;
5184      case 'h6':
5185        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 6) + '\n\n'; }
5186        break;
5187  
5188      case 'p':
5189        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, globals) + '\n\n'; }
5190        break;
5191  
5192      case 'blockquote':
5193        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, globals) + '\n\n'; }
5194        break;
5195  
5196      case 'hr':
5197        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, globals) + '\n\n'; }
5198        break;
5199  
5200      case 'ol':
5201        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ol') + '\n\n'; }
5202        break;
5203  
5204      case 'ul':
5205        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ul') + '\n\n'; }
5206        break;
5207  
5208      case 'precode':
5209        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, globals) + '\n\n'; }
5210        break;
5211  
5212      case 'pre':
5213        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, globals) + '\n\n'; }
5214        break;
5215  
5216      case 'table':
5217        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, globals) + '\n\n'; }
5218        break;
5219  
5220      //
5221      // SPANS
5222      //
5223      case 'code':
5224        txt = showdown.subParser('makeMarkdown.codeSpan')(node, globals);
5225        break;
5226  
5227      case 'em':
5228      case 'i':
5229        txt = showdown.subParser('makeMarkdown.emphasis')(node, globals);
5230        break;
5231  
5232      case 'strong':
5233      case 'b':
5234        txt = showdown.subParser('makeMarkdown.strong')(node, globals);
5235        break;
5236  
5237      case 'del':
5238        txt = showdown.subParser('makeMarkdown.strikethrough')(node, globals);
5239        break;
5240  
5241      case 'a':
5242        txt = showdown.subParser('makeMarkdown.links')(node, globals);
5243        break;
5244  
5245      case 'img':
5246        txt = showdown.subParser('makeMarkdown.image')(node, globals);
5247        break;
5248  
5249      default:
5250        txt = node.outerHTML + '\n\n';
5251    }
5252  
5253    // common normalization
5254    // TODO eventually
5255  
5256    return txt;
5257  });
5258  
5259  showdown.subParser('makeMarkdown.paragraph', function (node, globals) {
5260    'use strict';
5261  
5262    var txt = '';
5263    if (node.hasChildNodes()) {
5264      var children = node.childNodes,
5265          childrenLength = children.length;
5266      for (var i = 0; i < childrenLength; ++i) {
5267        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5268      }
5269    }
5270  
5271    // some text normalization
5272    txt = txt.trim();
5273  
5274    return txt;
5275  });
5276  
5277  showdown.subParser('makeMarkdown.pre', function (node, globals) {
5278    'use strict';
5279  
5280    var num  = node.getAttribute('prenum');
5281    return '<pre>' + globals.preList[num] + '</pre>';
5282  });
5283  
5284  showdown.subParser('makeMarkdown.strikethrough', function (node, globals) {
5285    'use strict';
5286  
5287    var txt = '';
5288    if (node.hasChildNodes()) {
5289      txt += '~~';
5290      var children = node.childNodes,
5291          childrenLength = children.length;
5292      for (var i = 0; i < childrenLength; ++i) {
5293        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5294      }
5295      txt += '~~';
5296    }
5297    return txt;
5298  });
5299  
5300  showdown.subParser('makeMarkdown.strong', function (node, globals) {
5301    'use strict';
5302  
5303    var txt = '';
5304    if (node.hasChildNodes()) {
5305      txt += '**';
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      txt += '**';
5312    }
5313    return txt;
5314  });
5315  
5316  showdown.subParser('makeMarkdown.table', function (node, globals) {
5317    'use strict';
5318  
5319    var txt = '',
5320        tableArray = [[], []],
5321        headings   = node.querySelectorAll('thead>tr>th'),
5322        rows       = node.querySelectorAll('tbody>tr'),
5323        i, ii;
5324    for (i = 0; i < headings.length; ++i) {
5325      var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals),
5326          allign = '---';
5327  
5328      if (headings[i].hasAttribute('style')) {
5329        var style = headings[i].getAttribute('style').toLowerCase().replace(/\s/g, '');
5330        switch (style) {
5331          case 'text-align:left;':
5332            allign = ':---';
5333            break;
5334          case 'text-align:right;':
5335            allign = '---:';
5336            break;
5337          case 'text-align:center;':
5338            allign = ':---:';
5339            break;
5340        }
5341      }
5342      tableArray[0][i] = headContent.trim();
5343      tableArray[1][i] = allign;
5344    }
5345  
5346    for (i = 0; i < rows.length; ++i) {
5347      var r = tableArray.push([]) - 1,
5348          cols = rows[i].getElementsByTagName('td');
5349  
5350      for (ii = 0; ii < headings.length; ++ii) {
5351        var cellContent = ' ';
5352        if (typeof cols[ii] !== 'undefined') {
5353          cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals);
5354        }
5355        tableArray[r].push(cellContent);
5356      }
5357    }
5358  
5359    var cellSpacesCount = 3;
5360    for (i = 0; i < tableArray.length; ++i) {
5361      for (ii = 0; ii < tableArray[i].length; ++ii) {
5362        var strLen = tableArray[i][ii].length;
5363        if (strLen > cellSpacesCount) {
5364          cellSpacesCount = strLen;
5365        }
5366      }
5367    }
5368  
5369    for (i = 0; i < tableArray.length; ++i) {
5370      for (ii = 0; ii < tableArray[i].length; ++ii) {
5371        if (i === 1) {
5372          if (tableArray[i][ii].slice(-1) === ':') {
5373            tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':';
5374          } else {
5375            tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');
5376          }
5377        } else {
5378          tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);
5379        }
5380      }
5381      txt += '| ' + tableArray[i].join(' | ') + ' |\n';
5382    }
5383  
5384    return txt.trim();
5385  });
5386  
5387  showdown.subParser('makeMarkdown.tableCell', function (node, globals) {
5388    'use strict';
5389  
5390    var txt = '';
5391    if (!node.hasChildNodes()) {
5392      return '';
5393    }
5394    var children = node.childNodes,
5395        childrenLength = children.length;
5396  
5397    for (var i = 0; i < childrenLength; ++i) {
5398      txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true);
5399    }
5400    return txt.trim();
5401  });
5402  
5403  showdown.subParser('makeMarkdown.txt', function (node) {
5404    'use strict';
5405  
5406    var txt = node.nodeValue;
5407  
5408    // multiple spaces are collapsed
5409    txt = txt.replace(/ +/g, ' ');
5410  
5411    // replace the custom ¨NBSP; with a space
5412    txt = txt.replace(/¨NBSP;/g, ' ');
5413  
5414    // ", <, > and & should replace escaped html entities
5415    txt = showdown.helper.unescapeHTMLEntities(txt);
5416  
5417    // escape markdown magic characters
5418    // emphasis, strong and strikethrough - can appear everywhere
5419    // we also escape pipe (|) because of tables
5420    // and escape ` because of code blocks and spans
5421    txt = txt.replace(/([*_~|`])/g, '\\$1');
5422  
5423    // escape > because of blockquotes
5424    txt = txt.replace(/^(\s*)>/g, '\\$1>');
5425  
5426    // hash character, only troublesome at the beginning of a line because of headers
5427    txt = txt.replace(/^#/gm, '\\#');
5428  
5429    // horizontal rules
5430    txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, '$1\\$2$3');
5431  
5432    // dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer
5433    txt = txt.replace(/^( {0,3}\d+)\./gm, '$1\\.');
5434  
5435    // +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)
5436    txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\$2');
5437  
5438    // images and links, ] followed by ( is problematic, so we escape it
5439    txt = txt.replace(/]([\s]*)\(/g, '\\]$1\\(');
5440  
5441    // reference URIs must also be escaped
5442    txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, '\\[$1]:');
5443  
5444    return txt;
5445  });
5446  
5447  var root = this;
5448  
5449  // AMD Loader
5450  if (true) {
5451    !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
5452      'use strict';
5453      return showdown;
5454    }).call(exports, __webpack_require__, exports, module),
5455                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
5456  
5457  // CommonJS/nodeJS Loader
5458  } else {}
5459  }).call(this);
5460  
5461  
5462  
5463  /***/ }),
5464  
5465  /***/ 29:
5466  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5467  
5468  "use strict";
5469  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
5470  /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
5471  
5472  function _unsupportedIterableToArray(o, minLen) {
5473    if (!o) return;
5474    if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
5475    var n = Object.prototype.toString.call(o).slice(8, -1);
5476    if (n === "Object" && o.constructor) n = o.constructor.name;
5477    if (n === "Map" || n === "Set") return Array.from(o);
5478    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
5479  }
5480  
5481  /***/ }),
5482  
5483  /***/ 30:
5484  /***/ (function(module, exports) {
5485  
5486  (function() { module.exports = this["wp"]["dom"]; }());
5487  
5488  /***/ }),
5489  
5490  /***/ 32:
5491  /***/ (function(module, exports) {
5492  
5493  (function() { module.exports = this["wp"]["hooks"]; }());
5494  
5495  /***/ }),
5496  
5497  /***/ 35:
5498  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5499  
5500  "use strict";
5501  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
5502  function _iterableToArray(iter) {
5503    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
5504  }
5505  
5506  /***/ }),
5507  
5508  /***/ 38:
5509  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5510  
5511  "use strict";
5512  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
5513  function _arrayWithHoles(arr) {
5514    if (Array.isArray(arr)) return arr;
5515  }
5516  
5517  /***/ }),
5518  
5519  /***/ 39:
5520  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5521  
5522  "use strict";
5523  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
5524  function _nonIterableRest() {
5525    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5526  }
5527  
5528  /***/ }),
5529  
5530  /***/ 4:
5531  /***/ (function(module, exports) {
5532  
5533  (function() { module.exports = this["wp"]["data"]; }());
5534  
5535  /***/ }),
5536  
5537  /***/ 42:
5538  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5539  
5540  "use strict";
5541  
5542  
5543  var LEAF_KEY, hasWeakMap;
5544  
5545  /**
5546   * Arbitrary value used as key for referencing cache object in WeakMap tree.
5547   *
5548   * @type {Object}
5549   */
5550  LEAF_KEY = {};
5551  
5552  /**
5553   * Whether environment supports WeakMap.
5554   *
5555   * @type {boolean}
5556   */
5557  hasWeakMap = typeof WeakMap !== 'undefined';
5558  
5559  /**
5560   * Returns the first argument as the sole entry in an array.
5561   *
5562   * @param {*} value Value to return.
5563   *
5564   * @return {Array} Value returned as entry in array.
5565   */
5566  function arrayOf( value ) {
5567      return [ value ];
5568  }
5569  
5570  /**
5571   * Returns true if the value passed is object-like, or false otherwise. A value
5572   * is object-like if it can support property assignment, e.g. object or array.
5573   *
5574   * @param {*} value Value to test.
5575   *
5576   * @return {boolean} Whether value is object-like.
5577   */
5578  function isObjectLike( value ) {
5579      return !! value && 'object' === typeof value;
5580  }
5581  
5582  /**
5583   * Creates and returns a new cache object.
5584   *
5585   * @return {Object} Cache object.
5586   */
5587  function createCache() {
5588      var cache = {
5589          clear: function() {
5590              cache.head = null;
5591          },
5592      };
5593  
5594      return cache;
5595  }
5596  
5597  /**
5598   * Returns true if entries within the two arrays are strictly equal by
5599   * reference from a starting index.
5600   *
5601   * @param {Array}  a         First array.
5602   * @param {Array}  b         Second array.
5603   * @param {number} fromIndex Index from which to start comparison.
5604   *
5605   * @return {boolean} Whether arrays are shallowly equal.
5606   */
5607  function isShallowEqual( a, b, fromIndex ) {
5608      var i;
5609  
5610      if ( a.length !== b.length ) {
5611          return false;
5612      }
5613  
5614      for ( i = fromIndex; i < a.length; i++ ) {
5615          if ( a[ i ] !== b[ i ] ) {
5616              return false;
5617          }
5618      }
5619  
5620      return true;
5621  }
5622  
5623  /**
5624   * Returns a memoized selector function. The getDependants function argument is
5625   * called before the memoized selector and is expected to return an immutable
5626   * reference or array of references on which the selector depends for computing
5627   * its own return value. The memoize cache is preserved only as long as those
5628   * dependant references remain the same. If getDependants returns a different
5629   * reference(s), the cache is cleared and the selector value regenerated.
5630   *
5631   * @param {Function} selector      Selector function.
5632   * @param {Function} getDependants Dependant getter returning an immutable
5633   *                                 reference or array of reference used in
5634   *                                 cache bust consideration.
5635   *
5636   * @return {Function} Memoized selector.
5637   */
5638  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
5639      var rootCache, getCache;
5640  
5641      // Use object source as dependant if getter not provided
5642      if ( ! getDependants ) {
5643          getDependants = arrayOf;
5644      }
5645  
5646      /**
5647       * Returns the root cache. If WeakMap is supported, this is assigned to the
5648       * root WeakMap cache set, otherwise it is a shared instance of the default
5649       * cache object.
5650       *
5651       * @return {(WeakMap|Object)} Root cache object.
5652       */
5653  	function getRootCache() {
5654          return rootCache;
5655      }
5656  
5657      /**
5658       * Returns the cache for a given dependants array. When possible, a WeakMap
5659       * will be used to create a unique cache for each set of dependants. This
5660       * is feasible due to the nature of WeakMap in allowing garbage collection
5661       * to occur on entries where the key object is no longer referenced. Since
5662       * WeakMap requires the key to be an object, this is only possible when the
5663       * dependant is object-like. The root cache is created as a hierarchy where
5664       * each top-level key is the first entry in a dependants set, the value a
5665       * WeakMap where each key is the next dependant, and so on. This continues
5666       * so long as the dependants are object-like. If no dependants are object-
5667       * like, then the cache is shared across all invocations.
5668       *
5669       * @see isObjectLike
5670       *
5671       * @param {Array} dependants Selector dependants.
5672       *
5673       * @return {Object} Cache object.
5674       */
5675  	function getWeakMapCache( dependants ) {
5676          var caches = rootCache,
5677              isUniqueByDependants = true,
5678              i, dependant, map, cache;
5679  
5680          for ( i = 0; i < dependants.length; i++ ) {
5681              dependant = dependants[ i ];
5682  
5683              // Can only compose WeakMap from object-like key.
5684              if ( ! isObjectLike( dependant ) ) {
5685                  isUniqueByDependants = false;
5686                  break;
5687              }
5688  
5689              // Does current segment of cache already have a WeakMap?
5690              if ( caches.has( dependant ) ) {
5691                  // Traverse into nested WeakMap.
5692                  caches = caches.get( dependant );
5693              } else {
5694                  // Create, set, and traverse into a new one.
5695                  map = new WeakMap();
5696                  caches.set( dependant, map );
5697                  caches = map;
5698              }
5699          }
5700  
5701          // We use an arbitrary (but consistent) object as key for the last item
5702          // in the WeakMap to serve as our running cache.
5703          if ( ! caches.has( LEAF_KEY ) ) {
5704              cache = createCache();
5705              cache.isUniqueByDependants = isUniqueByDependants;
5706              caches.set( LEAF_KEY, cache );
5707          }
5708  
5709          return caches.get( LEAF_KEY );
5710      }
5711  
5712      // Assign cache handler by availability of WeakMap
5713      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
5714  
5715      /**
5716       * Resets root memoization cache.
5717       */
5718  	function clear() {
5719          rootCache = hasWeakMap ? new WeakMap() : createCache();
5720      }
5721  
5722      // eslint-disable-next-line jsdoc/check-param-names
5723      /**
5724       * The augmented selector call, considering first whether dependants have
5725       * changed before passing it to underlying memoize function.
5726       *
5727       * @param {Object} source    Source object for derivation.
5728       * @param {...*}   extraArgs Additional arguments to pass to selector.
5729       *
5730       * @return {*} Selector result.
5731       */
5732  	function callSelector( /* source, ...extraArgs */ ) {
5733          var len = arguments.length,
5734              cache, node, i, args, dependants;
5735  
5736          // Create copy of arguments (avoid leaking deoptimization).
5737          args = new Array( len );
5738          for ( i = 0; i < len; i++ ) {
5739              args[ i ] = arguments[ i ];
5740          }
5741  
5742          dependants = getDependants.apply( null, args );
5743          cache = getCache( dependants );
5744  
5745          // If not guaranteed uniqueness by dependants (primitive type or lack
5746          // of WeakMap support), shallow compare against last dependants and, if
5747          // references have changed, destroy cache to recalculate result.
5748          if ( ! cache.isUniqueByDependants ) {
5749              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
5750                  cache.clear();
5751              }
5752  
5753              cache.lastDependants = dependants;
5754          }
5755  
5756          node = cache.head;
5757          while ( node ) {
5758              // Check whether node arguments match arguments
5759              if ( ! isShallowEqual( node.args, args, 1 ) ) {
5760                  node = node.next;
5761                  continue;
5762              }
5763  
5764              // At this point we can assume we've found a match
5765  
5766              // Surface matched node to head if not already
5767              if ( node !== cache.head ) {
5768                  // Adjust siblings to point to each other.
5769                  node.prev.next = node.next;
5770                  if ( node.next ) {
5771                      node.next.prev = node.prev;
5772                  }
5773  
5774                  node.next = cache.head;
5775                  node.prev = null;
5776                  cache.head.prev = node;
5777                  cache.head = node;
5778              }
5779  
5780              // Return immediately
5781              return node.val;
5782          }
5783  
5784          // No cached value found. Continue to insertion phase:
5785  
5786          node = {
5787              // Generate the result from original function
5788              val: selector.apply( null, args ),
5789          };
5790  
5791          // Avoid including the source object in the cache.
5792          args[ 0 ] = null;
5793          node.args = args;
5794  
5795          // Don't need to check whether node is already head, since it would
5796          // have been returned above already if it was
5797  
5798          // Shift existing head down list
5799          if ( cache.head ) {
5800              cache.head.prev = node;
5801              node.next = cache.head;
5802          }
5803  
5804          cache.head = node;
5805  
5806          return node.val;
5807      }
5808  
5809      callSelector.getDependants = getDependants;
5810      callSelector.clear = clear;
5811      clear();
5812  
5813      return callSelector;
5814  });
5815  
5816  
5817  /***/ }),
5818  
5819  /***/ 44:
5820  /***/ (function(module, exports) {
5821  
5822  (function() { module.exports = this["wp"]["blob"]; }());
5823  
5824  /***/ }),
5825  
5826  /***/ 442:
5827  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5828  
5829  "use strict";
5830  // ESM COMPAT FLAG
5831  __webpack_require__.r(__webpack_exports__);
5832  
5833  // EXPORTS
5834  __webpack_require__.d(__webpack_exports__, "createBlock", function() { return /* reexport */ createBlock; });
5835  __webpack_require__.d(__webpack_exports__, "cloneBlock", function() { return /* reexport */ cloneBlock; });
5836  __webpack_require__.d(__webpack_exports__, "getPossibleBlockTransformations", function() { return /* reexport */ getPossibleBlockTransformations; });
5837  __webpack_require__.d(__webpack_exports__, "switchToBlockType", function() { return /* reexport */ switchToBlockType; });
5838  __webpack_require__.d(__webpack_exports__, "getBlockTransforms", function() { return /* reexport */ getBlockTransforms; });
5839  __webpack_require__.d(__webpack_exports__, "findTransform", function() { return /* reexport */ findTransform; });
5840  __webpack_require__.d(__webpack_exports__, "getBlockFromExample", function() { return /* reexport */ factory_getBlockFromExample; });
5841  __webpack_require__.d(__webpack_exports__, "parse", function() { return /* reexport */ parser; });
5842  __webpack_require__.d(__webpack_exports__, "getBlockAttributes", function() { return /* reexport */ getBlockAttributes; });
5843  __webpack_require__.d(__webpack_exports__, "parseWithAttributeSchema", function() { return /* reexport */ parseWithAttributeSchema; });
5844  __webpack_require__.d(__webpack_exports__, "pasteHandler", function() { return /* reexport */ pasteHandler; });
5845  __webpack_require__.d(__webpack_exports__, "rawHandler", function() { return /* reexport */ rawHandler; });
5846  __webpack_require__.d(__webpack_exports__, "getPhrasingContentSchema", function() { return /* reexport */ getPhrasingContentSchema; });
5847  __webpack_require__.d(__webpack_exports__, "serialize", function() { return /* reexport */ serialize; });
5848  __webpack_require__.d(__webpack_exports__, "getBlockContent", function() { return /* reexport */ getBlockContent; });
5849  __webpack_require__.d(__webpack_exports__, "getBlockDefaultClassName", function() { return /* reexport */ getBlockDefaultClassName; });
5850  __webpack_require__.d(__webpack_exports__, "getBlockMenuDefaultClassName", function() { return /* reexport */ getBlockMenuDefaultClassName; });
5851  __webpack_require__.d(__webpack_exports__, "getSaveElement", function() { return /* reexport */ getSaveElement; });
5852  __webpack_require__.d(__webpack_exports__, "getSaveContent", function() { return /* reexport */ getSaveContent; });
5853  __webpack_require__.d(__webpack_exports__, "isValidBlockContent", function() { return /* reexport */ isValidBlockContent; });
5854  __webpack_require__.d(__webpack_exports__, "getCategories", function() { return /* reexport */ categories_getCategories; });
5855  __webpack_require__.d(__webpack_exports__, "setCategories", function() { return /* reexport */ categories_setCategories; });
5856  __webpack_require__.d(__webpack_exports__, "updateCategory", function() { return /* reexport */ categories_updateCategory; });
5857  __webpack_require__.d(__webpack_exports__, "registerBlockType", function() { return /* reexport */ registerBlockType; });
5858  __webpack_require__.d(__webpack_exports__, "registerBlockCollection", function() { return /* reexport */ registerBlockCollection; });
5859  __webpack_require__.d(__webpack_exports__, "unregisterBlockType", function() { return /* reexport */ unregisterBlockType; });
5860  __webpack_require__.d(__webpack_exports__, "setFreeformContentHandlerName", function() { return /* reexport */ setFreeformContentHandlerName; });
5861  __webpack_require__.d(__webpack_exports__, "getFreeformContentHandlerName", function() { return /* reexport */ getFreeformContentHandlerName; });
5862  __webpack_require__.d(__webpack_exports__, "setUnregisteredTypeHandlerName", function() { return /* reexport */ setUnregisteredTypeHandlerName; });
5863  __webpack_require__.d(__webpack_exports__, "getUnregisteredTypeHandlerName", function() { return /* reexport */ getUnregisteredTypeHandlerName; });
5864  __webpack_require__.d(__webpack_exports__, "setDefaultBlockName", function() { return /* reexport */ registration_setDefaultBlockName; });
5865  __webpack_require__.d(__webpack_exports__, "getDefaultBlockName", function() { return /* reexport */ registration_getDefaultBlockName; });
5866  __webpack_require__.d(__webpack_exports__, "setGroupingBlockName", function() { return /* reexport */ registration_setGroupingBlockName; });
5867  __webpack_require__.d(__webpack_exports__, "getGroupingBlockName", function() { return /* reexport */ registration_getGroupingBlockName; });
5868  __webpack_require__.d(__webpack_exports__, "getBlockType", function() { return /* reexport */ registration_getBlockType; });
5869  __webpack_require__.d(__webpack_exports__, "getBlockTypes", function() { return /* reexport */ registration_getBlockTypes; });
5870  __webpack_require__.d(__webpack_exports__, "getBlockSupport", function() { return /* reexport */ registration_getBlockSupport; });
5871  __webpack_require__.d(__webpack_exports__, "hasBlockSupport", function() { return /* reexport */ registration_hasBlockSupport; });
5872  __webpack_require__.d(__webpack_exports__, "isReusableBlock", function() { return /* reexport */ isReusableBlock; });
5873  __webpack_require__.d(__webpack_exports__, "getChildBlockNames", function() { return /* reexport */ registration_getChildBlockNames; });
5874  __webpack_require__.d(__webpack_exports__, "hasChildBlocks", function() { return /* reexport */ registration_hasChildBlocks; });
5875  __webpack_require__.d(__webpack_exports__, "hasChildBlocksWithInserterSupport", function() { return /* reexport */ registration_hasChildBlocksWithInserterSupport; });
5876  __webpack_require__.d(__webpack_exports__, "unstable__bootstrapServerSideBlockDefinitions", function() { return /* reexport */ unstable__bootstrapServerSideBlockDefinitions; });
5877  __webpack_require__.d(__webpack_exports__, "registerBlockStyle", function() { return /* reexport */ registration_registerBlockStyle; });
5878  __webpack_require__.d(__webpack_exports__, "unregisterBlockStyle", function() { return /* reexport */ registration_unregisterBlockStyle; });
5879  __webpack_require__.d(__webpack_exports__, "registerBlockVariation", function() { return /* reexport */ registration_registerBlockVariation; });
5880  __webpack_require__.d(__webpack_exports__, "unregisterBlockVariation", function() { return /* reexport */ registration_unregisterBlockVariation; });
5881  __webpack_require__.d(__webpack_exports__, "isUnmodifiedDefaultBlock", function() { return /* reexport */ isUnmodifiedDefaultBlock; });
5882  __webpack_require__.d(__webpack_exports__, "normalizeIconObject", function() { return /* reexport */ normalizeIconObject; });
5883  __webpack_require__.d(__webpack_exports__, "isValidIcon", function() { return /* reexport */ isValidIcon; });
5884  __webpack_require__.d(__webpack_exports__, "__experimentalGetBlockLabel", function() { return /* reexport */ getBlockLabel; });
5885  __webpack_require__.d(__webpack_exports__, "__experimentalGetAccessibleBlockLabel", function() { return /* reexport */ getAccessibleBlockLabel; });
5886  __webpack_require__.d(__webpack_exports__, "doBlocksMatchTemplate", function() { return /* reexport */ doBlocksMatchTemplate; });
5887  __webpack_require__.d(__webpack_exports__, "synchronizeBlocksWithTemplate", function() { return /* reexport */ synchronizeBlocksWithTemplate; });
5888  __webpack_require__.d(__webpack_exports__, "children", function() { return /* reexport */ api_children; });
5889  __webpack_require__.d(__webpack_exports__, "node", function() { return /* reexport */ api_node; });
5890  __webpack_require__.d(__webpack_exports__, "withBlockContentContext", function() { return /* reexport */ withBlockContentContext; });
5891  
5892  // NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/selectors.js
5893  var selectors_namespaceObject = {};
5894  __webpack_require__.r(selectors_namespaceObject);
5895  __webpack_require__.d(selectors_namespaceObject, "getBlockTypes", function() { return getBlockTypes; });
5896  __webpack_require__.d(selectors_namespaceObject, "getBlockType", function() { return getBlockType; });
5897  __webpack_require__.d(selectors_namespaceObject, "getBlockStyles", function() { return getBlockStyles; });
5898  __webpack_require__.d(selectors_namespaceObject, "getBlockVariations", function() { return getBlockVariations; });
5899  __webpack_require__.d(selectors_namespaceObject, "getDefaultBlockVariation", function() { return getDefaultBlockVariation; });
5900  __webpack_require__.d(selectors_namespaceObject, "getCategories", function() { return getCategories; });
5901  __webpack_require__.d(selectors_namespaceObject, "getCollections", function() { return getCollections; });
5902  __webpack_require__.d(selectors_namespaceObject, "getDefaultBlockName", function() { return getDefaultBlockName; });
5903  __webpack_require__.d(selectors_namespaceObject, "getFreeformFallbackBlockName", function() { return getFreeformFallbackBlockName; });
5904  __webpack_require__.d(selectors_namespaceObject, "getUnregisteredFallbackBlockName", function() { return getUnregisteredFallbackBlockName; });
5905  __webpack_require__.d(selectors_namespaceObject, "getGroupingBlockName", function() { return getGroupingBlockName; });
5906  __webpack_require__.d(selectors_namespaceObject, "getChildBlockNames", function() { return selectors_getChildBlockNames; });
5907  __webpack_require__.d(selectors_namespaceObject, "getBlockSupport", function() { return selectors_getBlockSupport; });
5908  __webpack_require__.d(selectors_namespaceObject, "hasBlockSupport", function() { return hasBlockSupport; });
5909  __webpack_require__.d(selectors_namespaceObject, "isMatchingSearchTerm", function() { return isMatchingSearchTerm; });
5910  __webpack_require__.d(selectors_namespaceObject, "hasChildBlocks", function() { return selectors_hasChildBlocks; });
5911  __webpack_require__.d(selectors_namespaceObject, "hasChildBlocksWithInserterSupport", function() { return selectors_hasChildBlocksWithInserterSupport; });
5912  
5913  // NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/actions.js
5914  var actions_namespaceObject = {};
5915  __webpack_require__.r(actions_namespaceObject);
5916  __webpack_require__.d(actions_namespaceObject, "addBlockTypes", function() { return addBlockTypes; });
5917  __webpack_require__.d(actions_namespaceObject, "removeBlockTypes", function() { return removeBlockTypes; });
5918  __webpack_require__.d(actions_namespaceObject, "addBlockStyles", function() { return addBlockStyles; });
5919  __webpack_require__.d(actions_namespaceObject, "removeBlockStyles", function() { return removeBlockStyles; });
5920  __webpack_require__.d(actions_namespaceObject, "addBlockVariations", function() { return addBlockVariations; });
5921  __webpack_require__.d(actions_namespaceObject, "removeBlockVariations", function() { return removeBlockVariations; });
5922  __webpack_require__.d(actions_namespaceObject, "setDefaultBlockName", function() { return setDefaultBlockName; });
5923  __webpack_require__.d(actions_namespaceObject, "setFreeformFallbackBlockName", function() { return setFreeformFallbackBlockName; });
5924  __webpack_require__.d(actions_namespaceObject, "setUnregisteredFallbackBlockName", function() { return setUnregisteredFallbackBlockName; });
5925  __webpack_require__.d(actions_namespaceObject, "setGroupingBlockName", function() { return setGroupingBlockName; });
5926  __webpack_require__.d(actions_namespaceObject, "setCategories", function() { return setCategories; });
5927  __webpack_require__.d(actions_namespaceObject, "updateCategory", function() { return updateCategory; });
5928  __webpack_require__.d(actions_namespaceObject, "addBlockCollection", function() { return addBlockCollection; });
5929  __webpack_require__.d(actions_namespaceObject, "removeBlockCollection", function() { return removeBlockCollection; });
5930  
5931  // EXTERNAL MODULE: external {"this":["wp","data"]}
5932  var external_this_wp_data_ = __webpack_require__(4);
5933  
5934  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
5935  var toConsumableArray = __webpack_require__(18);
5936  
5937  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
5938  var defineProperty = __webpack_require__(5);
5939  
5940  // EXTERNAL MODULE: external {"this":"lodash"}
5941  var external_this_lodash_ = __webpack_require__(2);
5942  
5943  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
5944  var external_this_wp_i18n_ = __webpack_require__(1);
5945  
5946  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/reducer.js
5947  
5948  
5949  
5950  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; }
5951  
5952  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; }
5953  
5954  /**
5955   * External dependencies
5956   */
5957  
5958  /**
5959   * WordPress dependencies
5960   */
5961  
5962  
5963  
5964  /**
5965   * @typedef {Object} WPBlockCategory
5966   *
5967   * @property {string} slug  Unique category slug.
5968   * @property {string} title Category label, for display in user interface.
5969   */
5970  
5971  /**
5972   * Default set of categories.
5973   *
5974   * @type {WPBlockCategory[]}
5975   */
5976  
5977  var DEFAULT_CATEGORIES = [{
5978    slug: 'text',
5979    title: Object(external_this_wp_i18n_["__"])('Text')
5980  }, {
5981    slug: 'media',
5982    title: Object(external_this_wp_i18n_["__"])('Media')
5983  }, {
5984    slug: 'design',
5985    title: Object(external_this_wp_i18n_["__"])('Design')
5986  }, {
5987    slug: 'widgets',
5988    title: Object(external_this_wp_i18n_["__"])('Widgets')
5989  }, {
5990    slug: 'embed',
5991    title: Object(external_this_wp_i18n_["__"])('Embeds')
5992  }, {
5993    slug: 'reusable',
5994    title: Object(external_this_wp_i18n_["__"])('Reusable blocks')
5995  }];
5996  /**
5997   * Reducer managing the block types
5998   *
5999   * @param {Object} state  Current state.
6000   * @param {Object} action Dispatched action.
6001   *
6002   * @return {Object} Updated state.
6003   */
6004  
6005  function reducer_blockTypes() {
6006    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6007    var action = arguments.length > 1 ? arguments[1] : undefined;
6008  
6009    switch (action.type) {
6010      case 'ADD_BLOCK_TYPES':
6011        return _objectSpread({}, state, {}, Object(external_this_lodash_["keyBy"])(Object(external_this_lodash_["map"])(action.blockTypes, function (blockType) {
6012          return Object(external_this_lodash_["omit"])(blockType, 'styles ');
6013        }), 'name'));
6014  
6015      case 'REMOVE_BLOCK_TYPES':
6016        return Object(external_this_lodash_["omit"])(state, action.names);
6017    }
6018  
6019    return state;
6020  }
6021  /**
6022   * Reducer managing the block style variations.
6023   *
6024   * @param {Object} state  Current state.
6025   * @param {Object} action Dispatched action.
6026   *
6027   * @return {Object} Updated state.
6028   */
6029  
6030  function blockStyles() {
6031    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6032    var action = arguments.length > 1 ? arguments[1] : undefined;
6033  
6034    switch (action.type) {
6035      case 'ADD_BLOCK_TYPES':
6036        return _objectSpread({}, state, {}, Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["keyBy"])(action.blockTypes, 'name'), function (blockType) {
6037          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) {
6038            return style.name;
6039          });
6040        }));
6041  
6042      case 'ADD_BLOCK_STYLES':
6043        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) {
6044          return style.name;
6045        })));
6046  
6047      case 'REMOVE_BLOCK_STYLES':
6048        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["filter"])(Object(external_this_lodash_["get"])(state, [action.blockName], []), function (style) {
6049          return action.styleNames.indexOf(style.name) === -1;
6050        })));
6051    }
6052  
6053    return state;
6054  }
6055  /**
6056   * Reducer managing the block variations.
6057   *
6058   * @param {Object} state  Current state.
6059   * @param {Object} action Dispatched action.
6060   *
6061   * @return {Object} Updated state.
6062   */
6063  
6064  function blockVariations() {
6065    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6066    var action = arguments.length > 1 ? arguments[1] : undefined;
6067  
6068    switch (action.type) {
6069      case 'ADD_BLOCK_TYPES':
6070        return _objectSpread({}, state, {}, Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["keyBy"])(action.blockTypes, 'name'), function (blockType) {
6071          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) {
6072            return variation.name;
6073          });
6074        }));
6075  
6076      case 'ADD_BLOCK_VARIATIONS':
6077        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) {
6078          return variation.name;
6079        })));
6080  
6081      case 'REMOVE_BLOCK_VARIATIONS':
6082        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["filter"])(Object(external_this_lodash_["get"])(state, [action.blockName], []), function (variation) {
6083          return action.variationNames.indexOf(variation.name) === -1;
6084        })));
6085    }
6086  
6087    return state;
6088  }
6089  /**
6090   * Higher-order Reducer creating a reducer keeping track of given block name.
6091   *
6092   * @param {string} setActionType  Action type.
6093   *
6094   * @return {Function} Reducer.
6095   */
6096  
6097  function createBlockNameSetterReducer(setActionType) {
6098    return function () {
6099      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
6100      var action = arguments.length > 1 ? arguments[1] : undefined;
6101  
6102      switch (action.type) {
6103        case 'REMOVE_BLOCK_TYPES':
6104          if (action.names.indexOf(state) !== -1) {
6105            return null;
6106          }
6107  
6108          return state;
6109  
6110        case setActionType:
6111          return action.name || null;
6112      }
6113  
6114      return state;
6115    };
6116  }
6117  var reducer_defaultBlockName = createBlockNameSetterReducer('SET_DEFAULT_BLOCK_NAME');
6118  var freeformFallbackBlockName = createBlockNameSetterReducer('SET_FREEFORM_FALLBACK_BLOCK_NAME');
6119  var unregisteredFallbackBlockName = createBlockNameSetterReducer('SET_UNREGISTERED_FALLBACK_BLOCK_NAME');
6120  var groupingBlockName = createBlockNameSetterReducer('SET_GROUPING_BLOCK_NAME');
6121  /**
6122   * Reducer managing the categories
6123   *
6124   * @param {WPBlockCategory[]} state  Current state.
6125   * @param {Object}            action Dispatched action.
6126   *
6127   * @return {WPBlockCategory[]} Updated state.
6128   */
6129  
6130  function reducer_categories() {
6131    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CATEGORIES;
6132    var action = arguments.length > 1 ? arguments[1] : undefined;
6133  
6134    switch (action.type) {
6135      case 'SET_CATEGORIES':
6136        return action.categories || [];
6137  
6138      case 'UPDATE_CATEGORY':
6139        {
6140          if (!action.category || Object(external_this_lodash_["isEmpty"])(action.category)) {
6141            return state;
6142          }
6143  
6144          var categoryToChange = Object(external_this_lodash_["find"])(state, ['slug', action.slug]);
6145  
6146          if (categoryToChange) {
6147            return Object(external_this_lodash_["map"])(state, function (category) {
6148              if (category.slug === action.slug) {
6149                return _objectSpread({}, category, {}, action.category);
6150              }
6151  
6152              return category;
6153            });
6154          }
6155        }
6156    }
6157  
6158    return state;
6159  }
6160  function collections() {
6161    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6162    var action = arguments.length > 1 ? arguments[1] : undefined;
6163  
6164    switch (action.type) {
6165      case 'ADD_BLOCK_COLLECTION':
6166        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.namespace, {
6167          title: action.title,
6168          icon: action.icon
6169        }));
6170  
6171      case 'REMOVE_BLOCK_COLLECTION':
6172        return Object(external_this_lodash_["omit"])(state, action.namespace);
6173    }
6174  
6175    return state;
6176  }
6177  /* harmony default export */ var reducer = (Object(external_this_wp_data_["combineReducers"])({
6178    blockTypes: reducer_blockTypes,
6179    blockStyles: blockStyles,
6180    blockVariations: blockVariations,
6181    defaultBlockName: reducer_defaultBlockName,
6182    freeformFallbackBlockName: freeformFallbackBlockName,
6183    unregisteredFallbackBlockName: unregisteredFallbackBlockName,
6184    groupingBlockName: groupingBlockName,
6185    categories: reducer_categories,
6186    collections: collections
6187  }));
6188  
6189  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
6190  var rememo = __webpack_require__(42);
6191  
6192  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/selectors.js
6193  
6194  
6195  
6196  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; }
6197  
6198  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; }
6199  
6200  /**
6201   * External dependencies
6202   */
6203  
6204  
6205  /** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
6206  
6207  /** @typedef {import('../api/registration').WPBlockVariationScope} WPBlockVariationScope */
6208  
6209  /** @typedef {import('./reducer').WPBlockCategory} WPBlockCategory */
6210  
6211  /**
6212   * Given a block name or block type object, returns the corresponding
6213   * normalized block type object.
6214   *
6215   * @param {Object}          state      Blocks state.
6216   * @param {(string|Object)} nameOrType Block name or type object
6217   *
6218   * @return {Object} Block type object.
6219   */
6220  
6221  var getNormalizedBlockType = function getNormalizedBlockType(state, nameOrType) {
6222    return 'string' === typeof nameOrType ? getBlockType(state, nameOrType) : nameOrType;
6223  };
6224  /**
6225   * Returns all the available block types.
6226   *
6227   * @param {Object} state Data state.
6228   *
6229   * @return {Array} Block Types.
6230   */
6231  
6232  
6233  var getBlockTypes = Object(rememo["a" /* default */])(function (state) {
6234    return Object.values(state.blockTypes).map(function (blockType) {
6235      return selectors_objectSpread({}, blockType, {
6236        variations: getBlockVariations(state, blockType.name)
6237      });
6238    });
6239  }, function (state) {
6240    return [state.blockTypes, state.blockVariations];
6241  });
6242  /**
6243   * Returns a block type by name.
6244   *
6245   * @param {Object} state Data state.
6246   * @param {string} name Block type name.
6247   *
6248   * @return {Object?} Block Type.
6249   */
6250  
6251  function getBlockType(state, name) {
6252    return state.blockTypes[name];
6253  }
6254  /**
6255   * Returns block styles by block name.
6256   *
6257   * @param {Object} state Data state.
6258   * @param {string} name  Block type name.
6259   *
6260   * @return {Array?} Block Styles.
6261   */
6262  
6263  function getBlockStyles(state, name) {
6264    return state.blockStyles[name];
6265  }
6266  /**
6267   * Returns block variations by block name.
6268   *
6269   * @param {Object}                state     Data state.
6270   * @param {string}                blockName Block type name.
6271   * @param {WPBlockVariationScope} [scope]   Block variation scope name.
6272   *
6273   * @return {(WPBlockVariation[]|void)} Block variations.
6274   */
6275  
6276  function getBlockVariations(state, blockName, scope) {
6277    var variations = state.blockVariations[blockName];
6278  
6279    if (!variations || !scope) {
6280      return variations;
6281    }
6282  
6283    return variations.filter(function (variation) {
6284      return !variation.scope || variation.scope.includes(scope);
6285    });
6286  }
6287  /**
6288   * Returns the default block variation for the given block type.
6289   * When there are multiple variations annotated as the default one,
6290   * the last added item is picked. This simplifies registering overrides.
6291   * When there is no default variation set, it returns the first item.
6292   *
6293   * @param {Object}                state     Data state.
6294   * @param {string}                blockName Block type name.
6295   * @param {WPBlockVariationScope} [scope]   Block variation scope name.
6296   *
6297   * @return {?WPBlockVariation} The default block variation.
6298   */
6299  
6300  function getDefaultBlockVariation(state, blockName, scope) {
6301    var variations = getBlockVariations(state, blockName, scope);
6302    return Object(external_this_lodash_["findLast"])(variations, 'isDefault') || Object(external_this_lodash_["first"])(variations);
6303  }
6304  /**
6305   * Returns all the available categories.
6306   *
6307   * @param {Object} state Data state.
6308   *
6309   * @return {WPBlockCategory[]} Categories list.
6310   */
6311  
6312  function getCategories(state) {
6313    return state.categories;
6314  }
6315  /**
6316   * Returns all the available collections.
6317   *
6318   * @param {Object} state Data state.
6319   *
6320   * @return {Object} Collections list.
6321   */
6322  
6323  function getCollections(state) {
6324    return state.collections;
6325  }
6326  /**
6327   * Returns the name of the default block name.
6328   *
6329   * @param {Object} state Data state.
6330   *
6331   * @return {string?} Default block name.
6332   */
6333  
6334  function getDefaultBlockName(state) {
6335    return state.defaultBlockName;
6336  }
6337  /**
6338   * Returns the name of the block for handling non-block content.
6339   *
6340   * @param {Object} state Data state.
6341   *
6342   * @return {string?} Name of the block for handling non-block content.
6343   */
6344  
6345  function getFreeformFallbackBlockName(state) {
6346    return state.freeformFallbackBlockName;
6347  }
6348  /**
6349   * Returns the name of the block for handling unregistered blocks.
6350   *
6351   * @param {Object} state Data state.
6352   *
6353   * @return {string?} Name of the block for handling unregistered blocks.
6354   */
6355  
6356  function getUnregisteredFallbackBlockName(state) {
6357    return state.unregisteredFallbackBlockName;
6358  }
6359  /**
6360   * Returns the name of the block for handling unregistered blocks.
6361   *
6362   * @param {Object} state Data state.
6363   *
6364   * @return {string?} Name of the block for handling unregistered blocks.
6365   */
6366  
6367  function getGroupingBlockName(state) {
6368    return state.groupingBlockName;
6369  }
6370  /**
6371   * Returns an array with the child blocks of a given block.
6372   *
6373   * @param {Object} state     Data state.
6374   * @param {string} blockName Block type name.
6375   *
6376   * @return {Array} Array of child block names.
6377   */
6378  
6379  var selectors_getChildBlockNames = Object(rememo["a" /* default */])(function (state, blockName) {
6380    return Object(external_this_lodash_["map"])(Object(external_this_lodash_["filter"])(state.blockTypes, function (blockType) {
6381      return Object(external_this_lodash_["includes"])(blockType.parent, blockName);
6382    }), function (_ref) {
6383      var name = _ref.name;
6384      return name;
6385    });
6386  }, function (state) {
6387    return [state.blockTypes];
6388  });
6389  /**
6390   * Returns the block support value for a feature, if defined.
6391   *
6392   * @param  {Object}          state           Data state.
6393   * @param  {(string|Object)} nameOrType      Block name or type object
6394   * @param  {string}          feature         Feature to retrieve
6395   * @param  {*}               defaultSupports Default value to return if not
6396   *                                           explicitly defined
6397   *
6398   * @return {?*} Block support value
6399   */
6400  
6401  var selectors_getBlockSupport = function getBlockSupport(state, nameOrType, feature, defaultSupports) {
6402    var blockType = getNormalizedBlockType(state, nameOrType);
6403    return Object(external_this_lodash_["get"])(blockType, ['supports'].concat(Object(toConsumableArray["a" /* default */])(feature.split('.'))), defaultSupports);
6404  };
6405  /**
6406   * Returns true if the block defines support for a feature, or false otherwise.
6407   *
6408   * @param  {Object}         state           Data state.
6409   * @param {(string|Object)} nameOrType      Block name or type object.
6410   * @param {string}          feature         Feature to test.
6411   * @param {boolean}         defaultSupports Whether feature is supported by
6412   *                                          default if not explicitly defined.
6413   *
6414   * @return {boolean} Whether block supports feature.
6415   */
6416  
6417  function hasBlockSupport(state, nameOrType, feature, defaultSupports) {
6418    return !!selectors_getBlockSupport(state, nameOrType, feature, defaultSupports);
6419  }
6420  /**
6421   * Returns true if the block type by the given name or object value matches a
6422   * search term, or false otherwise.
6423   *
6424   * @param {Object}          state      Blocks state.
6425   * @param {(string|Object)} nameOrType Block name or type object.
6426   * @param {string}          searchTerm Search term by which to filter.
6427   *
6428   * @return {Object[]} Whether block type matches search term.
6429   */
6430  
6431  function isMatchingSearchTerm(state, nameOrType, searchTerm) {
6432    var blockType = getNormalizedBlockType(state, nameOrType);
6433    var getNormalizedSearchTerm = Object(external_this_lodash_["flow"])([// Disregard diacritics.
6434    //  Input: "média"
6435    external_this_lodash_["deburr"], // Lowercase.
6436    //  Input: "MEDIA"
6437    function (term) {
6438      return term.toLowerCase();
6439    }, // Strip leading and trailing whitespace.
6440    //  Input: " media "
6441    function (term) {
6442      return term.trim();
6443    }]);
6444    var normalizedSearchTerm = getNormalizedSearchTerm(searchTerm);
6445    var isSearchMatch = Object(external_this_lodash_["flow"])([getNormalizedSearchTerm, function (normalizedCandidate) {
6446      return Object(external_this_lodash_["includes"])(normalizedCandidate, normalizedSearchTerm);
6447    }]);
6448    return isSearchMatch(blockType.title) || Object(external_this_lodash_["some"])(blockType.keywords, isSearchMatch) || isSearchMatch(blockType.category);
6449  }
6450  /**
6451   * Returns a boolean indicating if a block has child blocks or not.
6452   *
6453   * @param {Object} state     Data state.
6454   * @param {string} blockName Block type name.
6455   *
6456   * @return {boolean} True if a block contains child blocks and false otherwise.
6457   */
6458  
6459  var selectors_hasChildBlocks = function hasChildBlocks(state, blockName) {
6460    return selectors_getChildBlockNames(state, blockName).length > 0;
6461  };
6462  /**
6463   * Returns a boolean indicating if a block has at least one child block with inserter support.
6464   *
6465   * @param {Object} state     Data state.
6466   * @param {string} blockName Block type name.
6467   *
6468   * @return {boolean} True if a block contains at least one child blocks with inserter support
6469   *                   and false otherwise.
6470   */
6471  
6472  var selectors_hasChildBlocksWithInserterSupport = function hasChildBlocksWithInserterSupport(state, blockName) {
6473    return Object(external_this_lodash_["some"])(selectors_getChildBlockNames(state, blockName), function (childBlockName) {
6474      return hasBlockSupport(state, childBlockName, 'inserter', true);
6475    });
6476  };
6477  
6478  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/actions.js
6479  /**
6480   * External dependencies
6481   */
6482  
6483  /** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
6484  
6485  /**
6486   * Returns an action object used in signalling that block types have been added.
6487   *
6488   * @param {Array|Object} blockTypes Block types received.
6489   *
6490   * @return {Object} Action object.
6491   */
6492  
6493  function addBlockTypes(blockTypes) {
6494    return {
6495      type: 'ADD_BLOCK_TYPES',
6496      blockTypes: Object(external_this_lodash_["castArray"])(blockTypes)
6497    };
6498  }
6499  /**
6500   * Returns an action object used to remove a registered block type.
6501   *
6502   * @param {string|Array} names Block name.
6503   *
6504   * @return {Object} Action object.
6505   */
6506  
6507  function removeBlockTypes(names) {
6508    return {
6509      type: 'REMOVE_BLOCK_TYPES',
6510      names: Object(external_this_lodash_["castArray"])(names)
6511    };
6512  }
6513  /**
6514   * Returns an action object used in signalling that new block styles have been added.
6515   *
6516   * @param {string}       blockName  Block name.
6517   * @param {Array|Object} styles     Block styles.
6518   *
6519   * @return {Object} Action object.
6520   */
6521  
6522  function addBlockStyles(blockName, styles) {
6523    return {
6524      type: 'ADD_BLOCK_STYLES',
6525      styles: Object(external_this_lodash_["castArray"])(styles),
6526      blockName: blockName
6527    };
6528  }
6529  /**
6530   * Returns an action object used in signalling that block styles have been removed.
6531   *
6532   * @param {string}       blockName  Block name.
6533   * @param {Array|string} styleNames Block style names.
6534   *
6535   * @return {Object} Action object.
6536   */
6537  
6538  function removeBlockStyles(blockName, styleNames) {
6539    return {
6540      type: 'REMOVE_BLOCK_STYLES',
6541      styleNames: Object(external_this_lodash_["castArray"])(styleNames),
6542      blockName: blockName
6543    };
6544  }
6545  /**
6546   * Returns an action object used in signalling that new block variations have been added.
6547   *
6548   * @param {string}                              blockName  Block name.
6549   * @param {WPBlockVariation|WPBlockVariation[]} variations Block variations.
6550   *
6551   * @return {Object} Action object.
6552   */
6553  
6554  function addBlockVariations(blockName, variations) {
6555    return {
6556      type: 'ADD_BLOCK_VARIATIONS',
6557      variations: Object(external_this_lodash_["castArray"])(variations),
6558      blockName: blockName
6559    };
6560  }
6561  /**
6562   * Returns an action object used in signalling that block variations have been removed.
6563   *
6564   * @param {string}          blockName      Block name.
6565   * @param {string|string[]} variationNames Block variation names.
6566   *
6567   * @return {Object} Action object.
6568   */
6569  
6570  function removeBlockVariations(blockName, variationNames) {
6571    return {
6572      type: 'REMOVE_BLOCK_VARIATIONS',
6573      variationNames: Object(external_this_lodash_["castArray"])(variationNames),
6574      blockName: blockName
6575    };
6576  }
6577  /**
6578   * Returns an action object used to set the default block name.
6579   *
6580   * @param {string} name Block name.
6581   *
6582   * @return {Object} Action object.
6583   */
6584  
6585  function setDefaultBlockName(name) {
6586    return {
6587      type: 'SET_DEFAULT_BLOCK_NAME',
6588      name: name
6589    };
6590  }
6591  /**
6592   * Returns an action object used to set the name of the block used as a fallback
6593   * for non-block content.
6594   *
6595   * @param {string} name Block name.
6596   *
6597   * @return {Object} Action object.
6598   */
6599  
6600  function setFreeformFallbackBlockName(name) {
6601    return {
6602      type: 'SET_FREEFORM_FALLBACK_BLOCK_NAME',
6603      name: name
6604    };
6605  }
6606  /**
6607   * Returns an action object used to set the name of the block used as a fallback
6608   * for unregistered blocks.
6609   *
6610   * @param {string} name Block name.
6611   *
6612   * @return {Object} Action object.
6613   */
6614  
6615  function setUnregisteredFallbackBlockName(name) {
6616    return {
6617      type: 'SET_UNREGISTERED_FALLBACK_BLOCK_NAME',
6618      name: name
6619    };
6620  }
6621  /**
6622   * Returns an action object used to set the name of the block used
6623   * when grouping other blocks
6624   * eg: in "Group/Ungroup" interactions
6625   *
6626   * @param {string} name Block name.
6627   *
6628   * @return {Object} Action object.
6629   */
6630  
6631  function setGroupingBlockName(name) {
6632    return {
6633      type: 'SET_GROUPING_BLOCK_NAME',
6634      name: name
6635    };
6636  }
6637  /**
6638   * Returns an action object used to set block categories.
6639   *
6640   * @param {Object[]} categories Block categories.
6641   *
6642   * @return {Object} Action object.
6643   */
6644  
6645  function setCategories(categories) {
6646    return {
6647      type: 'SET_CATEGORIES',
6648      categories: categories
6649    };
6650  }
6651  /**
6652   * Returns an action object used to update a category.
6653   *
6654   * @param {string} slug     Block category slug.
6655   * @param {Object} category Object containing the category properties that should be updated.
6656   *
6657   * @return {Object} Action object.
6658   */
6659  
6660  function updateCategory(slug, category) {
6661    return {
6662      type: 'UPDATE_CATEGORY',
6663      slug: slug,
6664      category: category
6665    };
6666  }
6667  /**
6668   * Returns an action object used to add block collections
6669   *
6670   * @param {string} namespace       The namespace of the blocks to put in the collection
6671   * @param {string} title           The title to display in the block inserter
6672   * @param {Object} icon (optional) The icon to display in the block inserter
6673   *
6674   * @return {Object} Action object.
6675   */
6676  
6677  function addBlockCollection(namespace, title, icon) {
6678    return {
6679      type: 'ADD_BLOCK_COLLECTION',
6680      namespace: namespace,
6681      title: title,
6682      icon: icon
6683    };
6684  }
6685  /**
6686   * Returns an action object used to remove block collections
6687   *
6688   * @param {string} namespace       The namespace of the blocks to put in the collection
6689   *
6690   * @return {Object} Action object.
6691   */
6692  
6693  function removeBlockCollection(namespace) {
6694    return {
6695      type: 'REMOVE_BLOCK_COLLECTION',
6696      namespace: namespace
6697    };
6698  }
6699  
6700  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/index.js
6701  /**
6702   * WordPress dependencies
6703   */
6704  
6705  /**
6706   * Internal dependencies
6707   */
6708  
6709  
6710  
6711  
6712  Object(external_this_wp_data_["registerStore"])('core/blocks', {
6713    reducer: reducer,
6714    selectors: selectors_namespaceObject,
6715    actions: actions_namespaceObject
6716  });
6717  
6718  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/rng.js
6719  // Unique ID creation requires a high quality random # generator. In the browser we therefore
6720  // require the crypto API and do not support built-in fallback to lower quality random number
6721  // generators (like Math.random()).
6722  // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
6723  // find the complete implementation of crypto (msCrypto) on IE11.
6724  var getRandomValues = typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != 'undefined' && typeof msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto);
6725  var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
6726  
6727  function rng() {
6728    if (!getRandomValues) {
6729      throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
6730    }
6731  
6732    return getRandomValues(rnds8);
6733  }
6734  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/bytesToUuid.js
6735  /**
6736   * Convert array of 16 byte values to UUID string format of the form:
6737   * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
6738   */
6739  var byteToHex = [];
6740  
6741  for (var bytesToUuid_i = 0; bytesToUuid_i < 256; ++bytesToUuid_i) {
6742    byteToHex[bytesToUuid_i] = (bytesToUuid_i + 0x100).toString(16).substr(1);
6743  }
6744  
6745  function bytesToUuid(buf, offset) {
6746    var i = offset || 0;
6747    var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
6748  
6749    return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');
6750  }
6751  
6752  /* harmony default export */ var esm_browser_bytesToUuid = (bytesToUuid);
6753  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/v4.js
6754  
6755  
6756  
6757  function v4(options, buf, offset) {
6758    var i = buf && offset || 0;
6759  
6760    if (typeof options == 'string') {
6761      buf = options === 'binary' ? new Array(16) : null;
6762      options = null;
6763    }
6764  
6765    options = options || {};
6766    var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
6767  
6768    rnds[6] = rnds[6] & 0x0f | 0x40;
6769    rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
6770  
6771    if (buf) {
6772      for (var ii = 0; ii < 16; ++ii) {
6773        buf[i + ii] = rnds[ii];
6774      }
6775    }
6776  
6777    return buf || esm_browser_bytesToUuid(rnds);
6778  }
6779  
6780  /* harmony default export */ var esm_browser_v4 = (v4);
6781  // EXTERNAL MODULE: external {"this":["wp","hooks"]}
6782  var external_this_wp_hooks_ = __webpack_require__(32);
6783  
6784  // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
6785  var block_default = __webpack_require__(201);
6786  
6787  // EXTERNAL MODULE: ./node_modules/tinycolor2/tinycolor.js
6788  var tinycolor = __webpack_require__(66);
6789  var tinycolor_default = /*#__PURE__*/__webpack_require__.n(tinycolor);
6790  
6791  // EXTERNAL MODULE: external {"this":["wp","element"]}
6792  var external_this_wp_element_ = __webpack_require__(0);
6793  
6794  // EXTERNAL MODULE: external {"this":["wp","dom"]}
6795  var external_this_wp_dom_ = __webpack_require__(30);
6796  
6797  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/utils.js
6798  
6799  
6800  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; }
6801  
6802  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; }
6803  
6804  /**
6805   * External dependencies
6806   */
6807  
6808  
6809  /**
6810   * WordPress dependencies
6811   */
6812  
6813  
6814  
6815  
6816  /**
6817   * Internal dependencies
6818   */
6819  
6820  
6821  
6822  /**
6823   * Array of icon colors containing a color to be used if the icon color
6824   * was not explicitly set but the icon background color was.
6825   *
6826   * @type {Object}
6827   */
6828  
6829  var ICON_COLORS = ['#191e23', '#f8f9f9'];
6830  /**
6831   * Determines whether the block is a default block
6832   * and its attributes are equal to the default attributes
6833   * which means the block is unmodified.
6834   *
6835   * @param  {WPBlock} block Block Object
6836   *
6837   * @return {boolean}       Whether the block is an unmodified default block
6838   */
6839  
6840  function isUnmodifiedDefaultBlock(block) {
6841    var defaultBlockName = registration_getDefaultBlockName();
6842  
6843    if (block.name !== defaultBlockName) {
6844      return false;
6845    } // Cache a created default block if no cache exists or the default block
6846    // name changed.
6847  
6848  
6849    if (!isUnmodifiedDefaultBlock.block || isUnmodifiedDefaultBlock.block.name !== defaultBlockName) {
6850      isUnmodifiedDefaultBlock.block = createBlock(defaultBlockName);
6851    }
6852  
6853    var newDefaultBlock = isUnmodifiedDefaultBlock.block;
6854    var blockType = registration_getBlockType(defaultBlockName);
6855    return Object(external_this_lodash_["every"])(blockType.attributes, function (value, key) {
6856      return newDefaultBlock.attributes[key] === block.attributes[key];
6857    });
6858  }
6859  /**
6860   * Function that checks if the parameter is a valid icon.
6861   *
6862   * @param {*} icon  Parameter to be checked.
6863   *
6864   * @return {boolean} True if the parameter is a valid icon and false otherwise.
6865   */
6866  
6867  function isValidIcon(icon) {
6868    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"]);
6869  }
6870  /**
6871   * Function that receives an icon as set by the blocks during the registration
6872   * and returns a new icon object that is normalized so we can rely on just on possible icon structure
6873   * in the codebase.
6874   *
6875   * @param {WPBlockTypeIconRender} icon Render behavior of a block type icon;
6876   *                                     one of a Dashicon slug, an element, or a
6877   *                                     component.
6878   *
6879   * @return {WPBlockTypeIconDescriptor} Object describing the icon.
6880   */
6881  
6882  function normalizeIconObject(icon) {
6883    if (isValidIcon(icon)) {
6884      return {
6885        src: icon
6886      };
6887    }
6888  
6889    if (Object(external_this_lodash_["has"])(icon, ['background'])) {
6890      var tinyBgColor = tinycolor_default()(icon.background);
6891      return utils_objectSpread({}, icon, {
6892        foreground: icon.foreground ? icon.foreground : Object(tinycolor["mostReadable"])(tinyBgColor, ICON_COLORS, {
6893          includeFallbackColors: true,
6894          level: 'AA',
6895          size: 'large'
6896        }).toHexString(),
6897        shadowColor: tinyBgColor.setAlpha(0.3).toRgbString()
6898      });
6899    }
6900  
6901    return icon;
6902  }
6903  /**
6904   * Normalizes block type passed as param. When string is passed then
6905   * it converts it to the matching block type object.
6906   * It passes the original object otherwise.
6907   *
6908   * @param {string|Object} blockTypeOrName  Block type or name.
6909   *
6910   * @return {?Object} Block type.
6911   */
6912  
6913  function normalizeBlockType(blockTypeOrName) {
6914    if (Object(external_this_lodash_["isString"])(blockTypeOrName)) {
6915      return registration_getBlockType(blockTypeOrName);
6916    }
6917  
6918    return blockTypeOrName;
6919  }
6920  /**
6921   * Get the label for the block, usually this is either the block title,
6922   * or the value of the block's `label` function when that's specified.
6923   *
6924   * @param {Object} blockType  The block type.
6925   * @param {Object} attributes The values of the block's attributes.
6926   * @param {Object} context    The intended use for the label.
6927   *
6928   * @return {string} The block label.
6929   */
6930  
6931  function getBlockLabel(blockType, attributes) {
6932    var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'visual';
6933    var getLabel = blockType.__experimentalLabel,
6934        title = blockType.title;
6935    var label = getLabel && getLabel(attributes, {
6936      context: context
6937    });
6938  
6939    if (!label) {
6940      return title;
6941    } // Strip any HTML (i.e. RichText formatting) before returning.
6942  
6943  
6944    return Object(external_this_wp_dom_["__unstableStripHTML"])(label);
6945  }
6946  /**
6947   * Get a label for the block for use by screenreaders, this is more descriptive
6948   * than the visual label and includes the block title and the value of the
6949   * `getLabel` function if it's specified.
6950   *
6951   * @param {Object}  blockType              The block type.
6952   * @param {Object}  attributes             The values of the block's attributes.
6953   * @param {?number} position               The position of the block in the block list.
6954   * @param {string}  [direction='vertical'] The direction of the block layout.
6955   *
6956   * @return {string} The block label.
6957   */
6958  
6959  function getAccessibleBlockLabel(blockType, attributes, position) {
6960    var direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'vertical';
6961    // `title` is already localized, `label` is a user-supplied value.
6962    var title = blockType.title;
6963    var label = getBlockLabel(blockType, attributes, 'accessibility');
6964    var hasPosition = position !== undefined; // getBlockLabel returns the block title as a fallback when there's no label,
6965    // if it did return the title, this function needs to avoid adding the
6966    // title twice within the accessible label. Use this `hasLabel` boolean to
6967    // handle that.
6968  
6969    var hasLabel = label && label !== title;
6970  
6971    if (hasPosition && direction === 'vertical') {
6972      if (hasLabel) {
6973        return Object(external_this_wp_i18n_["sprintf"])(
6974        /* translators: accessibility text. 1: The block title. 2: The block row number. 3: The block label.. */
6975        Object(external_this_wp_i18n_["__"])('%1$s Block. Row %2$d. %3$s'), title, position, label);
6976      }
6977  
6978      return Object(external_this_wp_i18n_["sprintf"])(
6979      /* translators: accessibility text. 1: The block title. 2: The block row number. */
6980      Object(external_this_wp_i18n_["__"])('%1$s Block. Row %2$d'), title, position);
6981    } else if (hasPosition && direction === 'horizontal') {
6982      if (hasLabel) {
6983        return Object(external_this_wp_i18n_["sprintf"])(
6984        /* translators: accessibility text. 1: The block title. 2: The block column number. 3: The block label.. */
6985        Object(external_this_wp_i18n_["__"])('%1$s Block. Column %2$d. %3$s'), title, position, label);
6986      }
6987  
6988      return Object(external_this_wp_i18n_["sprintf"])(
6989      /* translators: accessibility text. 1: The block title. 2: The block column number. */
6990      Object(external_this_wp_i18n_["__"])('%1$s Block. Column %2$d'), title, position);
6991    }
6992  
6993    if (hasLabel) {
6994      return Object(external_this_wp_i18n_["sprintf"])(
6995      /* translators: accessibility text. %1: The block title. %2: The block label. */
6996      Object(external_this_wp_i18n_["__"])('%1$s Block. %2$s'), title, label);
6997    }
6998  
6999    return Object(external_this_wp_i18n_["sprintf"])(
7000    /* translators: accessibility text. %s: The block title. */
7001    Object(external_this_wp_i18n_["__"])('%s Block'), title);
7002  }
7003  
7004  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/constants.js
7005  /**
7006   * Array of valid keys in a block type settings deprecation object.
7007   *
7008   * @type {string[]}
7009   */
7010  var DEPRECATED_ENTRY_KEYS = ['attributes', 'supports', 'save', 'migrate', 'isEligible'];
7011  
7012  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/registration.js
7013  
7014  
7015  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; }
7016  
7017  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; }
7018  
7019  /* eslint no-console: [ 'error', { allow: [ 'error', 'warn' ] } ] */
7020  
7021  /**
7022   * External dependencies
7023   */
7024  
7025  /**
7026   * WordPress dependencies
7027   */
7028  
7029  
7030  
7031  
7032  /**
7033   * Internal dependencies
7034   */
7035  
7036  
7037  
7038  /**
7039   * An icon type definition. One of a Dashicon slug, an element,
7040   * or a component.
7041   *
7042   * @typedef {(string|WPElement|WPComponent)} WPIcon
7043   *
7044   * @see https://developer.wordpress.org/resource/dashicons/
7045   */
7046  
7047  /**
7048   * Render behavior of a block type icon; one of a Dashicon slug, an element,
7049   * or a component.
7050   *
7051   * @typedef {WPIcon} WPBlockTypeIconRender
7052   */
7053  
7054  /**
7055   * An object describing a normalized block type icon.
7056   *
7057   * @typedef {Object} WPBlockTypeIconDescriptor
7058   *
7059   * @property {WPBlockTypeIconRender} src         Render behavior of the icon,
7060   *                                               one of a Dashicon slug, an
7061   *                                               element, or a component.
7062   * @property {string}                background  Optimal background hex string
7063   *                                               color when displaying icon.
7064   * @property {string}                foreground  Optimal foreground hex string
7065   *                                               color when displaying icon.
7066   * @property {string}                shadowColor Optimal shadow hex string
7067   *                                               color when displaying icon.
7068   */
7069  
7070  /**
7071   * Value to use to render the icon for a block type in an editor interface,
7072   * either a Dashicon slug, an element, a component, or an object describing
7073   * the icon.
7074   *
7075   * @typedef {(WPBlockTypeIconDescriptor|WPBlockTypeIconRender)} WPBlockTypeIcon
7076   */
7077  
7078  /**
7079   * Named block variation scopes.
7080   *
7081   * @typedef {'block'|'inserter'} WPBlockVariationScope
7082   */
7083  
7084  /**
7085   * An object describing a variation defined for the block type.
7086   *
7087   * @typedef {Object} WPBlockVariation
7088   *
7089   * @property {string}   name                   The unique and machine-readable name.
7090   * @property {string}   title                  A human-readable variation title.
7091   * @property {string}   [description]          A detailed variation description.
7092   * @property {WPIcon}   [icon]                 An icon helping to visualize the variation.
7093   * @property {boolean}  [isDefault]            Indicates whether the current variation is
7094   *                                             the default one. Defaults to `false`.
7095   * @property {Object}   [attributes]           Values which override block attributes.
7096   * @property {Array[]}  [innerBlocks]          Initial configuration of nested blocks.
7097   * @property {Object}   [example]              Example provides structured data for
7098   *                                             the block preview. You can set to
7099   *                                             `undefined` to disable the preview shown
7100   *                                             for the block type.
7101   * @property {WPBlockVariationScope[]} [scope] The list of scopes where the variation
7102   *                                             is applicable. When not provided, it
7103   *                                             assumes all available scopes.
7104   */
7105  
7106  /**
7107   * Defined behavior of a block type.
7108   *
7109   * @typedef {Object} WPBlock
7110   *
7111   * @property {string}             name          Block type's namespaced name.
7112   * @property {string}             title         Human-readable block type label.
7113   * @property {string}             [description] A detailed block type description.
7114   * @property {string}             [category]    Block type category classification,
7115   *                                              used in search interfaces to arrange
7116   *                                              block types by category.
7117   * @property {WPBlockTypeIcon}    [icon]        Block type icon.
7118   * @property {string[]}           [keywords]    Additional keywords to produce block
7119   *                                              type as result in search interfaces.
7120   * @property {Object}             [attributes]  Block type attributes.
7121   * @property {WPComponent}        [save]        Optional component describing
7122   *                                              serialized markup structure of a
7123   *                                              block type.
7124   * @property {WPComponent}        edit          Component rendering an element to
7125   *                                              manipulate the attributes of a block
7126   *                                              in the context of an editor.
7127   * @property {WPBlockVariation[]} [variations]  The list of block variations.
7128   * @property {Object}             [example]     Example provides structured data for
7129   *                                              the block preview. When not defined
7130   *                                              then no preview is shown.
7131   */
7132  
7133  /**
7134   * Mapping of legacy category slugs to their latest normal values, used to
7135   * accommodate updates of the default set of block categories.
7136   *
7137   * @type {Record<string,string>}
7138   */
7139  
7140  var LEGACY_CATEGORY_MAPPING = {
7141    common: 'text',
7142    formatting: 'text',
7143    layout: 'design'
7144  };
7145  var serverSideBlockDefinitions = {};
7146  /**
7147   * Sets the server side block definition of blocks.
7148   *
7149   * @param {Object} definitions Server-side block definitions
7150   */
7151  // eslint-disable-next-line camelcase
7152  
7153  function unstable__bootstrapServerSideBlockDefinitions(definitions) {
7154    serverSideBlockDefinitions = registration_objectSpread({}, serverSideBlockDefinitions, {}, definitions);
7155  }
7156  /**
7157   * Registers a new block provided a unique name and an object defining its
7158   * behavior. Once registered, the block is made available as an option to any
7159   * editor interface where blocks are implemented.
7160   *
7161   * @param {string} name     Block name.
7162   * @param {Object} settings Block settings.
7163   *
7164   * @return {?WPBlock} The block, if it has been successfully registered;
7165   *                    otherwise `undefined`.
7166   */
7167  
7168  function registerBlockType(name, settings) {
7169    settings = registration_objectSpread({
7170      name: name,
7171      icon: block_default["a" /* default */],
7172      keywords: [],
7173      attributes: {},
7174      providesContext: {},
7175      usesContext: [],
7176      supports: {},
7177      styles: [],
7178      save: function save() {
7179        return null;
7180      }
7181    }, Object(external_this_lodash_["pickBy"])(Object(external_this_lodash_["get"])(serverSideBlockDefinitions, name, {}), function (value) {
7182      return !Object(external_this_lodash_["isNil"])(value);
7183    }), {}, settings);
7184  
7185    if (typeof name !== 'string') {
7186      console.error('Block names must be strings.');
7187      return;
7188    }
7189  
7190    if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) {
7191      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');
7192      return;
7193    }
7194  
7195    if (Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name)) {
7196      console.error('Block "' + name + '" is already registered.');
7197      return;
7198    }
7199  
7200    var preFilterSettings = registration_objectSpread({}, settings);
7201  
7202    settings = Object(external_this_wp_hooks_["applyFilters"])('blocks.registerBlockType', settings, name);
7203  
7204    if (settings.deprecated) {
7205      settings.deprecated = settings.deprecated.map(function (deprecation) {
7206        return Object(external_this_lodash_["pick"])( // Only keep valid deprecation keys.
7207        Object(external_this_wp_hooks_["applyFilters"])('blocks.registerBlockType', // Merge deprecation keys with pre-filter settings
7208        // so that filters that depend on specific keys being
7209        // present don't fail.
7210        registration_objectSpread({}, Object(external_this_lodash_["omit"])(preFilterSettings, DEPRECATED_ENTRY_KEYS), {}, deprecation), name), DEPRECATED_ENTRY_KEYS);
7211      });
7212    }
7213  
7214    if (!Object(external_this_lodash_["isPlainObject"])(settings)) {
7215      console.error('Block settings must be a valid object.');
7216      return;
7217    }
7218  
7219    if (!Object(external_this_lodash_["isFunction"])(settings.save)) {
7220      console.error('The "save" property must be a valid function.');
7221      return;
7222    }
7223  
7224    if ('edit' in settings && !Object(external_this_lodash_["isFunction"])(settings.edit)) {
7225      console.error('The "edit" property must be a valid function.');
7226      return;
7227    } // Canonicalize legacy categories to equivalent fallback.
7228  
7229  
7230    if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) {
7231      settings.category = LEGACY_CATEGORY_MAPPING[settings.category];
7232    }
7233  
7234    if ('category' in settings && !Object(external_this_lodash_["some"])(Object(external_this_wp_data_["select"])('core/blocks').getCategories(), {
7235      slug: settings.category
7236    })) {
7237      console.warn('The block "' + name + '" is registered with an invalid category "' + settings.category + '".');
7238      delete settings.category;
7239    }
7240  
7241    if (!('title' in settings) || settings.title === '') {
7242      console.error('The block "' + name + '" must have a title.');
7243      return;
7244    }
7245  
7246    if (typeof settings.title !== 'string') {
7247      console.error('Block titles must be strings.');
7248      return;
7249    }
7250  
7251    settings.icon = normalizeIconObject(settings.icon);
7252  
7253    if (!isValidIcon(settings.icon.src)) {
7254      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');
7255      return;
7256    }
7257  
7258    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockTypes(settings);
7259    return settings;
7260  }
7261  /**
7262   * Registers a new block collection to group blocks in the same namespace in the inserter.
7263   *
7264   * @param {string} namespace       The namespace to group blocks by in the inserter; corresponds to the block namespace.
7265   * @param {Object} settings        The block collection settings.
7266   * @param {string} settings.title  The title to display in the block inserter.
7267   * @param {Object} [settings.icon] The icon to display in the block inserter.
7268   */
7269  
7270  function registerBlockCollection(namespace, _ref) {
7271    var title = _ref.title,
7272        icon = _ref.icon;
7273    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockCollection(namespace, title, icon);
7274  }
7275  /**
7276   * Unregisters a block collection
7277   *
7278   * @param {string} namespace The namespace to group blocks by in the inserter; corresponds to the block namespace
7279   *
7280   */
7281  
7282  function unregisterBlockCollection(namespace) {
7283    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockCollection(namespace);
7284  }
7285  /**
7286   * Unregisters a block.
7287   *
7288   * @param {string} name Block name.
7289   *
7290   * @return {?WPBlock} The previous block value, if it has been successfully
7291   *                    unregistered; otherwise `undefined`.
7292   */
7293  
7294  function unregisterBlockType(name) {
7295    var oldBlock = Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name);
7296  
7297    if (!oldBlock) {
7298      console.error('Block "' + name + '" is not registered.');
7299      return;
7300    }
7301  
7302    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockTypes(name);
7303    return oldBlock;
7304  }
7305  /**
7306   * Assigns name of block for handling non-block content.
7307   *
7308   * @param {string} blockName Block name.
7309   */
7310  
7311  function setFreeformContentHandlerName(blockName) {
7312    Object(external_this_wp_data_["dispatch"])('core/blocks').setFreeformFallbackBlockName(blockName);
7313  }
7314  /**
7315   * Retrieves name of block handling non-block content, or undefined if no
7316   * handler has been defined.
7317   *
7318   * @return {?string} Block name.
7319   */
7320  
7321  function getFreeformContentHandlerName() {
7322    return Object(external_this_wp_data_["select"])('core/blocks').getFreeformFallbackBlockName();
7323  }
7324  /**
7325   * Retrieves name of block used for handling grouping interactions.
7326   *
7327   * @return {?string} Block name.
7328   */
7329  
7330  function registration_getGroupingBlockName() {
7331    return Object(external_this_wp_data_["select"])('core/blocks').getGroupingBlockName();
7332  }
7333  /**
7334   * Assigns name of block handling unregistered block types.
7335   *
7336   * @param {string} blockName Block name.
7337   */
7338  
7339  function setUnregisteredTypeHandlerName(blockName) {
7340    Object(external_this_wp_data_["dispatch"])('core/blocks').setUnregisteredFallbackBlockName(blockName);
7341  }
7342  /**
7343   * Retrieves name of block handling unregistered block types, or undefined if no
7344   * handler has been defined.
7345   *
7346   * @return {?string} Block name.
7347   */
7348  
7349  function getUnregisteredTypeHandlerName() {
7350    return Object(external_this_wp_data_["select"])('core/blocks').getUnregisteredFallbackBlockName();
7351  }
7352  /**
7353   * Assigns the default block name.
7354   *
7355   * @param {string} name Block name.
7356   */
7357  
7358  function registration_setDefaultBlockName(name) {
7359    Object(external_this_wp_data_["dispatch"])('core/blocks').setDefaultBlockName(name);
7360  }
7361  /**
7362   * Assigns name of block for handling block grouping interactions.
7363   *
7364   * @param {string} name Block name.
7365   */
7366  
7367  function registration_setGroupingBlockName(name) {
7368    Object(external_this_wp_data_["dispatch"])('core/blocks').setGroupingBlockName(name);
7369  }
7370  /**
7371   * Retrieves the default block name.
7372   *
7373   * @return {?string} Block name.
7374   */
7375  
7376  function registration_getDefaultBlockName() {
7377    return Object(external_this_wp_data_["select"])('core/blocks').getDefaultBlockName();
7378  }
7379  /**
7380   * Returns a registered block type.
7381   *
7382   * @param {string} name Block name.
7383   *
7384   * @return {?Object} Block type.
7385   */
7386  
7387  function registration_getBlockType(name) {
7388    return Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name);
7389  }
7390  /**
7391   * Returns all registered blocks.
7392   *
7393   * @return {Array} Block settings.
7394   */
7395  
7396  function registration_getBlockTypes() {
7397    return Object(external_this_wp_data_["select"])('core/blocks').getBlockTypes();
7398  }
7399  /**
7400   * Returns the block support value for a feature, if defined.
7401   *
7402   * @param  {(string|Object)} nameOrType      Block name or type object
7403   * @param  {string}          feature         Feature to retrieve
7404   * @param  {*}               defaultSupports Default value to return if not
7405   *                                           explicitly defined
7406   *
7407   * @return {?*} Block support value
7408   */
7409  
7410  function registration_getBlockSupport(nameOrType, feature, defaultSupports) {
7411    return Object(external_this_wp_data_["select"])('core/blocks').getBlockSupport(nameOrType, feature, defaultSupports);
7412  }
7413  /**
7414   * Returns true if the block defines support for a feature, or false otherwise.
7415   *
7416   * @param {(string|Object)} nameOrType      Block name or type object.
7417   * @param {string}          feature         Feature to test.
7418   * @param {boolean}         defaultSupports Whether feature is supported by
7419   *                                          default if not explicitly defined.
7420   *
7421   * @return {boolean} Whether block supports feature.
7422   */
7423  
7424  function registration_hasBlockSupport(nameOrType, feature, defaultSupports) {
7425    return Object(external_this_wp_data_["select"])('core/blocks').hasBlockSupport(nameOrType, feature, defaultSupports);
7426  }
7427  /**
7428   * Determines whether or not the given block is a reusable block. This is a
7429   * special block type that is used to point to a global block stored via the
7430   * API.
7431   *
7432   * @param {Object} blockOrType Block or Block Type to test.
7433   *
7434   * @return {boolean} Whether the given block is a reusable block.
7435   */
7436  
7437  function isReusableBlock(blockOrType) {
7438    return blockOrType.name === 'core/block';
7439  }
7440  /**
7441   * Returns an array with the child blocks of a given block.
7442   *
7443   * @param {string} blockName Name of block (example: “latest-posts”).
7444   *
7445   * @return {Array} Array of child block names.
7446   */
7447  
7448  var registration_getChildBlockNames = function getChildBlockNames(blockName) {
7449    return Object(external_this_wp_data_["select"])('core/blocks').getChildBlockNames(blockName);
7450  };
7451  /**
7452   * Returns a boolean indicating if a block has child blocks or not.
7453   *
7454   * @param {string} blockName Name of block (example: “latest-posts”).
7455   *
7456   * @return {boolean} True if a block contains child blocks and false otherwise.
7457   */
7458  
7459  var registration_hasChildBlocks = function hasChildBlocks(blockName) {
7460    return Object(external_this_wp_data_["select"])('core/blocks').hasChildBlocks(blockName);
7461  };
7462  /**
7463   * Returns a boolean indicating if a block has at least one child block with inserter support.
7464   *
7465   * @param {string} blockName Block type name.
7466   *
7467   * @return {boolean} True if a block contains at least one child blocks with inserter support
7468   *                   and false otherwise.
7469   */
7470  
7471  var registration_hasChildBlocksWithInserterSupport = function hasChildBlocksWithInserterSupport(blockName) {
7472    return Object(external_this_wp_data_["select"])('core/blocks').hasChildBlocksWithInserterSupport(blockName);
7473  };
7474  /**
7475   * Registers a new block style variation for the given block.
7476   *
7477   * @param {string} blockName      Name of block (example: “core/latest-posts”).
7478   * @param {Object} styleVariation Object containing `name` which is the class name applied to the block and `label` which identifies the variation to the user.
7479   */
7480  
7481  var registration_registerBlockStyle = function registerBlockStyle(blockName, styleVariation) {
7482    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockStyles(blockName, styleVariation);
7483  };
7484  /**
7485   * Unregisters a block style variation for the given block.
7486   *
7487   * @param {string} blockName          Name of block (example: “core/latest-posts”).
7488   * @param {string} styleVariationName Name of class applied to the block.
7489   */
7490  
7491  var registration_unregisterBlockStyle = function unregisterBlockStyle(blockName, styleVariationName) {
7492    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockStyles(blockName, styleVariationName);
7493  };
7494  /**
7495   * Registers a new block variation for the given block type.
7496   *
7497   * @param {string}           blockName Name of the block (example: “core/columns”).
7498   * @param {WPBlockVariation} variation Object describing a block variation.
7499   */
7500  
7501  var registration_registerBlockVariation = function registerBlockVariation(blockName, variation) {
7502    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockVariations(blockName, variation);
7503  };
7504  /**
7505   * Unregisters a block variation defined for the given block type.
7506   *
7507   * @param {string} blockName     Name of the block (example: “core/columns”).
7508   * @param {string} variationName Name of the variation defined for the block.
7509   */
7510  
7511  var registration_unregisterBlockVariation = function unregisterBlockVariation(blockName, variationName) {
7512    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockVariations(blockName, variationName);
7513  };
7514  
7515  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/factory.js
7516  
7517  
7518  
7519  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; }
7520  
7521  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; }
7522  
7523  /**
7524   * External dependencies
7525   */
7526  
7527  
7528  /**
7529   * WordPress dependencies
7530   */
7531  
7532  
7533  /**
7534   * Internal dependencies
7535   */
7536  
7537  
7538  
7539  /**
7540   * Returns a block object given its type and attributes.
7541   *
7542   * @param {string} name        Block name.
7543   * @param {Object} attributes  Block attributes.
7544   * @param {?Array} innerBlocks Nested blocks.
7545   *
7546   * @return {Object} Block object.
7547   */
7548  
7549  function createBlock(name) {
7550    var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7551    var innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
7552    // Get the type definition associated with a registered block.
7553    var blockType = registration_getBlockType(name); // Ensure attributes contains only values defined by block type, and merge
7554    // default values for missing attributes.
7555  
7556    var sanitizedAttributes = Object(external_this_lodash_["reduce"])(blockType.attributes, function (accumulator, schema, key) {
7557      var value = attributes[key];
7558  
7559      if (undefined !== value) {
7560        accumulator[key] = value;
7561      } else if (schema.hasOwnProperty('default')) {
7562        accumulator[key] = schema.default;
7563      }
7564  
7565      if (['node', 'children'].indexOf(schema.source) !== -1) {
7566        // Ensure value passed is always an array, which we're expecting in
7567        // the RichText component to handle the deprecated value.
7568        if (typeof accumulator[key] === 'string') {
7569          accumulator[key] = [accumulator[key]];
7570        } else if (!Array.isArray(accumulator[key])) {
7571          accumulator[key] = [];
7572        }
7573      }
7574  
7575      return accumulator;
7576    }, {});
7577    var clientId = esm_browser_v4(); // Blocks are stored with a unique ID, the assigned type name, the block
7578    // attributes, and their inner blocks.
7579  
7580    return {
7581      clientId: clientId,
7582      name: name,
7583      isValid: true,
7584      attributes: sanitizedAttributes,
7585      innerBlocks: innerBlocks
7586    };
7587  }
7588  /**
7589   * Given a block object, returns a copy of the block object, optionally merging
7590   * new attributes and/or replacing its inner blocks.
7591   *
7592   * @param {Object} block              Block instance.
7593   * @param {Object} mergeAttributes    Block attributes.
7594   * @param {?Array} newInnerBlocks     Nested blocks.
7595   *
7596   * @return {Object} A cloned block.
7597   */
7598  
7599  function cloneBlock(block) {
7600    var mergeAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7601    var newInnerBlocks = arguments.length > 2 ? arguments[2] : undefined;
7602    var clientId = esm_browser_v4();
7603    return factory_objectSpread({}, block, {
7604      clientId: clientId,
7605      attributes: factory_objectSpread({}, block.attributes, {}, mergeAttributes),
7606      innerBlocks: newInnerBlocks || block.innerBlocks.map(function (innerBlock) {
7607        return cloneBlock(innerBlock);
7608      })
7609    });
7610  }
7611  /**
7612   * Returns a boolean indicating whether a transform is possible based on
7613   * various bits of context.
7614   *
7615   * @param {Object} transform The transform object to validate.
7616   * @param {string} direction Is this a 'from' or 'to' transform.
7617   * @param {Array} blocks The blocks to transform from.
7618   *
7619   * @return {boolean} Is the transform possible?
7620   */
7621  
7622  var factory_isPossibleTransformForSource = function isPossibleTransformForSource(transform, direction, blocks) {
7623    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7624      return false;
7625    } // If multiple blocks are selected, only multi block transforms
7626    // or wildcard transforms are allowed.
7627  
7628  
7629    var isMultiBlock = blocks.length > 1;
7630    var firstBlockName = Object(external_this_lodash_["first"])(blocks).name;
7631    var isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock;
7632  
7633    if (!isValidForMultiBlocks) {
7634      return false;
7635    } // Check non-wildcard transforms to ensure that transform is valid
7636    // for a block selection of multiple blocks of different types
7637  
7638  
7639    if (!isWildcardBlockTransform(transform) && !Object(external_this_lodash_["every"])(blocks, {
7640      name: firstBlockName
7641    })) {
7642      return false;
7643    } // Only consider 'block' type transforms as valid.
7644  
7645  
7646    var isBlockType = transform.type === 'block';
7647  
7648    if (!isBlockType) {
7649      return false;
7650    } // Check if the transform's block name matches the source block (or is a wildcard)
7651    // only if this is a transform 'from'.
7652  
7653  
7654    var sourceBlock = Object(external_this_lodash_["first"])(blocks);
7655    var hasMatchingName = direction !== 'from' || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
7656  
7657    if (!hasMatchingName) {
7658      return false;
7659    } // Don't allow single Grouping blocks to be transformed into
7660    // a Grouping block.
7661  
7662  
7663    if (!isMultiBlock && factory_isContainerGroupBlock(sourceBlock.name) && factory_isContainerGroupBlock(transform.blockName)) {
7664      return false;
7665    } // If the transform has a `isMatch` function specified, check that it returns true.
7666  
7667  
7668    if (Object(external_this_lodash_["isFunction"])(transform.isMatch)) {
7669      var attributes = transform.isMultiBlock ? blocks.map(function (block) {
7670        return block.attributes;
7671      }) : sourceBlock.attributes;
7672  
7673      if (!transform.isMatch(attributes)) {
7674        return false;
7675      }
7676    }
7677  
7678    return true;
7679  };
7680  /**
7681   * Returns block types that the 'blocks' can be transformed into, based on
7682   * 'from' transforms on other blocks.
7683   *
7684   * @param {Array}  blocks  The blocks to transform from.
7685   *
7686   * @return {Array} Block types that the blocks can be transformed into.
7687   */
7688  
7689  
7690  var factory_getBlockTypesForPossibleFromTransforms = function getBlockTypesForPossibleFromTransforms(blocks) {
7691    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7692      return [];
7693    }
7694  
7695    var allBlockTypes = registration_getBlockTypes(); // filter all blocks to find those with a 'from' transform.
7696  
7697    var blockTypesWithPossibleFromTransforms = Object(external_this_lodash_["filter"])(allBlockTypes, function (blockType) {
7698      var fromTransforms = getBlockTransforms('from', blockType.name);
7699      return !!findTransform(fromTransforms, function (transform) {
7700        return factory_isPossibleTransformForSource(transform, 'from', blocks);
7701      });
7702    });
7703    return blockTypesWithPossibleFromTransforms;
7704  };
7705  /**
7706   * Returns block types that the 'blocks' can be transformed into, based on
7707   * the source block's own 'to' transforms.
7708   *
7709   * @param {Array} blocks The blocks to transform from.
7710   *
7711   * @return {Array} Block types that the source can be transformed into.
7712   */
7713  
7714  
7715  var factory_getBlockTypesForPossibleToTransforms = function getBlockTypesForPossibleToTransforms(blocks) {
7716    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7717      return [];
7718    }
7719  
7720    var sourceBlock = Object(external_this_lodash_["first"])(blocks);
7721    var blockType = registration_getBlockType(sourceBlock.name);
7722    var transformsTo = getBlockTransforms('to', blockType.name); // filter all 'to' transforms to find those that are possible.
7723  
7724    var possibleTransforms = Object(external_this_lodash_["filter"])(transformsTo, function (transform) {
7725      return transform && factory_isPossibleTransformForSource(transform, 'to', blocks);
7726    }); // Build a list of block names using the possible 'to' transforms.
7727  
7728    var blockNames = Object(external_this_lodash_["flatMap"])(possibleTransforms, function (transformation) {
7729      return transformation.blocks;
7730    }); // Map block names to block types.
7731  
7732    return blockNames.map(function (name) {
7733      return registration_getBlockType(name);
7734    });
7735  };
7736  /**
7737   * Determines whether transform is a "block" type
7738   * and if so whether it is a "wildcard" transform
7739   * ie: targets "any" block type
7740   *
7741   * @param {Object} t the Block transform object
7742   *
7743   * @return {boolean} whether transform is a wildcard transform
7744   */
7745  
7746  
7747  var isWildcardBlockTransform = function isWildcardBlockTransform(t) {
7748    return t && t.type === 'block' && Array.isArray(t.blocks) && t.blocks.includes('*');
7749  };
7750  /**
7751   * Determines whether the given Block is the core Block which
7752   * acts as a container Block for other Blocks as part of the
7753   * Grouping mechanics
7754   *
7755   * @param  {string} name the name of the Block to test against
7756   *
7757   * @return {boolean} whether or not the Block is the container Block type
7758   */
7759  
7760  var factory_isContainerGroupBlock = function isContainerGroupBlock(name) {
7761    return name === registration_getGroupingBlockName();
7762  };
7763  /**
7764   * Returns an array of block types that the set of blocks received as argument
7765   * can be transformed into.
7766   *
7767   * @param {Array} blocks Blocks array.
7768   *
7769   * @return {Array} Block types that the blocks argument can be transformed to.
7770   */
7771  
7772  function getPossibleBlockTransformations(blocks) {
7773    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7774      return [];
7775    }
7776  
7777    var blockTypesForFromTransforms = factory_getBlockTypesForPossibleFromTransforms(blocks);
7778    var blockTypesForToTransforms = factory_getBlockTypesForPossibleToTransforms(blocks);
7779    return Object(external_this_lodash_["uniq"])([].concat(Object(toConsumableArray["a" /* default */])(blockTypesForFromTransforms), Object(toConsumableArray["a" /* default */])(blockTypesForToTransforms)));
7780  }
7781  /**
7782   * Given an array of transforms, returns the highest-priority transform where
7783   * the predicate function returns a truthy value. A higher-priority transform
7784   * is one with a lower priority value (i.e. first in priority order). Returns
7785   * null if the transforms set is empty or the predicate function returns a
7786   * falsey value for all entries.
7787   *
7788   * @param {Object[]} transforms Transforms to search.
7789   * @param {Function} predicate  Function returning true on matching transform.
7790   *
7791   * @return {?Object} Highest-priority transform candidate.
7792   */
7793  
7794  function findTransform(transforms, predicate) {
7795    // The hooks library already has built-in mechanisms for managing priority
7796    // queue, so leverage via locally-defined instance.
7797    var hooks = Object(external_this_wp_hooks_["createHooks"])();
7798  
7799    var _loop = function _loop(i) {
7800      var candidate = transforms[i];
7801  
7802      if (predicate(candidate)) {
7803        hooks.addFilter('transform', 'transform/' + i.toString(), function (result) {
7804          return result ? result : candidate;
7805        }, candidate.priority);
7806      }
7807    };
7808  
7809    for (var i = 0; i < transforms.length; i++) {
7810      _loop(i);
7811    } // Filter name is arbitrarily chosen but consistent with above aggregation.
7812  
7813  
7814    return hooks.applyFilters('transform', null);
7815  }
7816  /**
7817   * Returns normal block transforms for a given transform direction, optionally
7818   * for a specific block by name, or an empty array if there are no transforms.
7819   * If no block name is provided, returns transforms for all blocks. A normal
7820   * transform object includes `blockName` as a property.
7821   *
7822   * @param {string}  direction Transform direction ("to", "from").
7823   * @param {string|Object} blockTypeOrName  Block type or name.
7824   *
7825   * @return {Array} Block transforms for direction.
7826   */
7827  
7828  function getBlockTransforms(direction, blockTypeOrName) {
7829    // When retrieving transforms for all block types, recurse into self.
7830    if (blockTypeOrName === undefined) {
7831      return Object(external_this_lodash_["flatMap"])(registration_getBlockTypes(), function (_ref) {
7832        var name = _ref.name;
7833        return getBlockTransforms(direction, name);
7834      });
7835    } // Validate that block type exists and has array of direction.
7836  
7837  
7838    var blockType = normalizeBlockType(blockTypeOrName);
7839  
7840    var _ref2 = blockType || {},
7841        blockName = _ref2.name,
7842        transforms = _ref2.transforms;
7843  
7844    if (!transforms || !Array.isArray(transforms[direction])) {
7845      return [];
7846    } // Map transforms to normal form.
7847  
7848  
7849    return transforms[direction].map(function (transform) {
7850      return factory_objectSpread({}, transform, {
7851        blockName: blockName
7852      });
7853    });
7854  }
7855  /**
7856   * Switch one or more blocks into one or more blocks of the new block type.
7857   *
7858   * @param {Array|Object} blocks Blocks array or block object.
7859   * @param {string}       name   Block name.
7860   *
7861   * @return {?Array} Array of blocks or null.
7862   */
7863  
7864  function switchToBlockType(blocks, name) {
7865    var blocksArray = Object(external_this_lodash_["castArray"])(blocks);
7866    var isMultiBlock = blocksArray.length > 1;
7867    var firstBlock = blocksArray[0];
7868    var sourceName = firstBlock.name; // Find the right transformation by giving priority to the "to"
7869    // transformation.
7870  
7871    var transformationsFrom = getBlockTransforms('from', name);
7872    var transformationsTo = getBlockTransforms('to', sourceName);
7873    var transformation = findTransform(transformationsTo, function (t) {
7874      return t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(name) !== -1) && (!isMultiBlock || t.isMultiBlock);
7875    }) || findTransform(transformationsFrom, function (t) {
7876      return t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t.isMultiBlock);
7877    }); // Stop if there is no valid transformation.
7878  
7879    if (!transformation) {
7880      return null;
7881    }
7882  
7883    var transformationResults;
7884  
7885    if (transformation.isMultiBlock) {
7886      if (Object(external_this_lodash_["has"])(transformation, '__experimentalConvert')) {
7887        transformationResults = transformation.__experimentalConvert(blocksArray);
7888      } else {
7889        transformationResults = transformation.transform(blocksArray.map(function (currentBlock) {
7890          return currentBlock.attributes;
7891        }), blocksArray.map(function (currentBlock) {
7892          return currentBlock.innerBlocks;
7893        }));
7894      }
7895    } else if (Object(external_this_lodash_["has"])(transformation, '__experimentalConvert')) {
7896      transformationResults = transformation.__experimentalConvert(firstBlock);
7897    } else {
7898      transformationResults = transformation.transform(firstBlock.attributes, firstBlock.innerBlocks);
7899    } // Ensure that the transformation function returned an object or an array
7900    // of objects.
7901  
7902  
7903    if (!Object(external_this_lodash_["isObjectLike"])(transformationResults)) {
7904      return null;
7905    } // If the transformation function returned a single object, we want to work
7906    // with an array instead.
7907  
7908  
7909    transformationResults = Object(external_this_lodash_["castArray"])(transformationResults); // Ensure that every block object returned by the transformation has a
7910    // valid block type.
7911  
7912    if (transformationResults.some(function (result) {
7913      return !registration_getBlockType(result.name);
7914    })) {
7915      return null;
7916    }
7917  
7918    var firstSwitchedBlock = Object(external_this_lodash_["findIndex"])(transformationResults, function (result) {
7919      return result.name === name;
7920    }); // Ensure that at least one block object returned by the transformation has
7921    // the expected "destination" block type.
7922  
7923    if (firstSwitchedBlock < 0) {
7924      return null;
7925    }
7926  
7927    return transformationResults.map(function (result, index) {
7928      var transformedBlock = factory_objectSpread({}, result, {
7929        // The first transformed block whose type matches the "destination"
7930        // type gets to keep the existing client ID of the first block.
7931        clientId: index === firstSwitchedBlock ? firstBlock.clientId : result.clientId
7932      });
7933      /**
7934       * Filters an individual transform result from block transformation.
7935       * All of the original blocks are passed, since transformations are
7936       * many-to-many, not one-to-one.
7937       *
7938       * @param {Object}   transformedBlock The transformed block.
7939       * @param {Object[]} blocks           Original blocks transformed.
7940       */
7941  
7942  
7943      return Object(external_this_wp_hooks_["applyFilters"])('blocks.switchToBlockType.transformedBlock', transformedBlock, blocks);
7944    });
7945  }
7946  /**
7947   * Create a block object from the example API.
7948   *
7949   * @param {string} name
7950   * @param {Object} example
7951   *
7952   * @return {Object} block.
7953   */
7954  
7955  var factory_getBlockFromExample = function getBlockFromExample(name, example) {
7956    return createBlock(name, example.attributes, Object(external_this_lodash_["map"])(example.innerBlocks, function (innerBlock) {
7957      return getBlockFromExample(innerBlock.name, innerBlock);
7958    }));
7959  };
7960  
7961  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
7962  var slicedToArray = __webpack_require__(14);
7963  
7964  // CONCATENATED MODULE: ./node_modules/hpq/es/get-path.js
7965  /**
7966   * Given object and string of dot-delimited path segments, returns value at
7967   * path or undefined if path cannot be resolved.
7968   *
7969   * @param  {Object} object Lookup object
7970   * @param  {string} path   Path to resolve
7971   * @return {?*}            Resolved value
7972   */
7973  function getPath(object, path) {
7974    var segments = path.split('.');
7975    var segment;
7976  
7977    while (segment = segments.shift()) {
7978      if (!(segment in object)) {
7979        return;
7980      }
7981  
7982      object = object[segment];
7983    }
7984  
7985    return object;
7986  }
7987  // CONCATENATED MODULE: ./node_modules/hpq/es/index.js
7988  /**
7989   * Internal dependencies
7990   */
7991  
7992  /**
7993   * Function returning a DOM document created by `createHTMLDocument`. The same
7994   * document is returned between invocations.
7995   *
7996   * @return {Document} DOM document.
7997   */
7998  
7999  var getDocument = function () {
8000    var doc;
8001    return function () {
8002      if (!doc) {
8003        doc = document.implementation.createHTMLDocument('');
8004      }
8005  
8006      return doc;
8007    };
8008  }();
8009  /**
8010   * Given a markup string or DOM element, creates an object aligning with the
8011   * shape of the matchers object, or the value returned by the matcher.
8012   *
8013   * @param  {(string|Element)}  source   Source content
8014   * @param  {(Object|Function)} matchers Matcher function or object of matchers
8015   * @return {(Object|*)}                 Matched value(s), shaped by object
8016   */
8017  
8018  
8019  function es_parse(source, matchers) {
8020    if (!matchers) {
8021      return;
8022    } // Coerce to element
8023  
8024  
8025    if ('string' === typeof source) {
8026      var doc = getDocument();
8027      doc.body.innerHTML = source;
8028      source = doc.body;
8029    } // Return singular value
8030  
8031  
8032    if ('function' === typeof matchers) {
8033      return matchers(source);
8034    } // Bail if we can't handle matchers
8035  
8036  
8037    if (Object !== matchers.constructor) {
8038      return;
8039    } // Shape result by matcher object
8040  
8041  
8042    return Object.keys(matchers).reduce(function (memo, key) {
8043      memo[key] = es_parse(source, matchers[key]);
8044      return memo;
8045    }, {});
8046  }
8047  /**
8048   * Generates a function which matches node of type selector, returning an
8049   * attribute by property if the attribute exists. If no selector is passed,
8050   * returns property of the query element.
8051   *
8052   * @param  {?string} selector Optional selector
8053   * @param  {string}  name     Property name
8054   * @return {*}                Property value
8055   */
8056  
8057  function prop(selector, name) {
8058    if (1 === arguments.length) {
8059      name = selector;
8060      selector = undefined;
8061    }
8062  
8063    return function (node) {
8064      var match = node;
8065  
8066      if (selector) {
8067        match = node.querySelector(selector);
8068      }
8069  
8070      if (match) {
8071        return getPath(match, name);
8072      }
8073    };
8074  }
8075  /**
8076   * Generates a function which matches node of type selector, returning an
8077   * attribute by name if the attribute exists. If no selector is passed,
8078   * returns attribute of the query element.
8079   *
8080   * @param  {?string} selector Optional selector
8081   * @param  {string}  name     Attribute name
8082   * @return {?string}          Attribute value
8083   */
8084  
8085  function attr(selector, name) {
8086    if (1 === arguments.length) {
8087      name = selector;
8088      selector = undefined;
8089    }
8090  
8091    return function (node) {
8092      var attributes = prop(selector, 'attributes')(node);
8093  
8094      if (attributes && attributes.hasOwnProperty(name)) {
8095        return attributes[name].value;
8096      }
8097    };
8098  }
8099  /**
8100   * Convenience for `prop( selector, 'innerHTML' )`.
8101   *
8102   * @see prop()
8103   *
8104   * @param  {?string} selector Optional selector
8105   * @return {string}           Inner HTML
8106   */
8107  
8108  function es_html(selector) {
8109    return prop(selector, 'innerHTML');
8110  }
8111  /**
8112   * Convenience for `prop( selector, 'textContent' )`.
8113   *
8114   * @see prop()
8115   *
8116   * @param  {?string} selector Optional selector
8117   * @return {string}           Text content
8118   */
8119  
8120  function es_text(selector) {
8121    return prop(selector, 'textContent');
8122  }
8123  /**
8124   * Creates a new matching context by first finding elements matching selector
8125   * using querySelectorAll before then running another `parse` on `matchers`
8126   * scoped to the matched elements.
8127   *
8128   * @see parse()
8129   *
8130   * @param  {string}            selector Selector to match
8131   * @param  {(Object|Function)} matchers Matcher function or object of matchers
8132   * @return {Array.<*,Object>}           Array of matched value(s)
8133   */
8134  
8135  function query(selector, matchers) {
8136    return function (node) {
8137      var matches = node.querySelectorAll(selector);
8138      return [].map.call(matches, function (match) {
8139        return es_parse(match, matchers);
8140      });
8141    };
8142  }
8143  // EXTERNAL MODULE: external {"this":["wp","autop"]}
8144  var external_this_wp_autop_ = __webpack_require__(103);
8145  
8146  // EXTERNAL MODULE: external {"this":["wp","blockSerializationDefaultParser"]}
8147  var external_this_wp_blockSerializationDefaultParser_ = __webpack_require__(267);
8148  
8149  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toArray.js
8150  var toArray = __webpack_require__(146);
8151  
8152  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
8153  var classCallCheck = __webpack_require__(20);
8154  
8155  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
8156  var createClass = __webpack_require__(19);
8157  
8158  // CONCATENATED MODULE: ./node_modules/simple-html-tokenizer/dist/es6/index.js
8159  /**
8160   * generated from https://raw.githubusercontent.com/w3c/html/26b5126f96f736f796b9e29718138919dd513744/entities.json
8161   * do not edit
8162   */
8163  var namedCharRefs = {
8164      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"
8165  };
8166  
8167  var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/;
8168  var CHARCODE = /^#([0-9]+)$/;
8169  var NAMED = /^([A-Za-z0-9]+)$/;
8170  var EntityParser = /** @class */ (function () {
8171      function EntityParser(named) {
8172          this.named = named;
8173      }
8174      EntityParser.prototype.parse = function (entity) {
8175          if (!entity) {
8176              return;
8177          }
8178          var matches = entity.match(HEXCHARCODE);
8179          if (matches) {
8180              return String.fromCharCode(parseInt(matches[1], 16));
8181          }
8182          matches = entity.match(CHARCODE);
8183          if (matches) {
8184              return String.fromCharCode(parseInt(matches[1], 10));
8185          }
8186          matches = entity.match(NAMED);
8187          if (matches) {
8188              return this.named[matches[1]];
8189          }
8190      };
8191      return EntityParser;
8192  }());
8193  
8194  var WSP = /[\t\n\f ]/;
8195  var ALPHA = /[A-Za-z]/;
8196  var CRLF = /\r\n?/g;
8197  function isSpace(char) {
8198      return WSP.test(char);
8199  }
8200  function isAlpha(char) {
8201      return ALPHA.test(char);
8202  }
8203  function preprocessInput(input) {
8204      return input.replace(CRLF, '\n');
8205  }
8206  
8207  var EventedTokenizer = /** @class */ (function () {
8208      function EventedTokenizer(delegate, entityParser) {
8209          this.delegate = delegate;
8210          this.entityParser = entityParser;
8211          this.state = "beforeData" /* beforeData */;
8212          this.line = -1;
8213          this.column = -1;
8214          this.input = '';
8215          this.index = -1;
8216          this.tagNameBuffer = '';
8217          this.states = {
8218              beforeData: function () {
8219                  var char = this.peek();
8220                  if (char === '<' && !this.isIgnoredEndTag()) {
8221                      this.transitionTo("tagOpen" /* tagOpen */);
8222                      this.markTagStart();
8223                      this.consume();
8224                  }
8225                  else {
8226                      if (char === '\n') {
8227                          var tag = this.tagNameBuffer.toLowerCase();
8228                          if (tag === 'pre' || tag === 'textarea') {
8229                              this.consume();
8230                          }
8231                      }
8232                      this.transitionTo("data" /* data */);
8233                      this.delegate.beginData();
8234                  }
8235              },
8236              data: function () {
8237                  var char = this.peek();
8238                  var tag = this.tagNameBuffer;
8239                  if (char === '<' && !this.isIgnoredEndTag()) {
8240                      this.delegate.finishData();
8241                      this.transitionTo("tagOpen" /* tagOpen */);
8242                      this.markTagStart();
8243                      this.consume();
8244                  }
8245                  else if (char === '&' && tag !== 'script' && tag !== 'style') {
8246                      this.consume();
8247                      this.delegate.appendToData(this.consumeCharRef() || '&');
8248                  }
8249                  else {
8250                      this.consume();
8251                      this.delegate.appendToData(char);
8252                  }
8253              },
8254              tagOpen: function () {
8255                  var char = this.consume();
8256                  if (char === '!') {
8257                      this.transitionTo("markupDeclarationOpen" /* markupDeclarationOpen */);
8258                  }
8259                  else if (char === '/') {
8260                      this.transitionTo("endTagOpen" /* endTagOpen */);
8261                  }
8262                  else if (char === '@' || char === ':' || isAlpha(char)) {
8263                      this.transitionTo("tagName" /* tagName */);
8264                      this.tagNameBuffer = '';
8265                      this.delegate.beginStartTag();
8266                      this.appendToTagName(char);
8267                  }
8268              },
8269              markupDeclarationOpen: function () {
8270                  var char = this.consume();
8271                  if (char === '-' && this.peek() === '-') {
8272                      this.consume();
8273                      this.transitionTo("commentStart" /* commentStart */);
8274                      this.delegate.beginComment();
8275                  }
8276              },
8277              commentStart: function () {
8278                  var char = this.consume();
8279                  if (char === '-') {
8280                      this.transitionTo("commentStartDash" /* commentStartDash */);
8281                  }
8282                  else if (char === '>') {
8283                      this.delegate.finishComment();
8284                      this.transitionTo("beforeData" /* beforeData */);
8285                  }
8286                  else {
8287                      this.delegate.appendToCommentData(char);
8288                      this.transitionTo("comment" /* comment */);
8289                  }
8290              },
8291              commentStartDash: function () {
8292                  var char = this.consume();
8293                  if (char === '-') {
8294                      this.transitionTo("commentEnd" /* commentEnd */);
8295                  }
8296                  else if (char === '>') {
8297                      this.delegate.finishComment();
8298                      this.transitionTo("beforeData" /* beforeData */);
8299                  }
8300                  else {
8301                      this.delegate.appendToCommentData('-');
8302                      this.transitionTo("comment" /* comment */);
8303                  }
8304              },
8305              comment: function () {
8306                  var char = this.consume();
8307                  if (char === '-') {
8308                      this.transitionTo("commentEndDash" /* commentEndDash */);
8309                  }
8310                  else {
8311                      this.delegate.appendToCommentData(char);
8312                  }
8313              },
8314              commentEndDash: function () {
8315                  var char = this.consume();
8316                  if (char === '-') {
8317                      this.transitionTo("commentEnd" /* commentEnd */);
8318                  }
8319                  else {
8320                      this.delegate.appendToCommentData('-' + char);
8321                      this.transitionTo("comment" /* comment */);
8322                  }
8323              },
8324              commentEnd: function () {
8325                  var char = this.consume();
8326                  if (char === '>') {
8327                      this.delegate.finishComment();
8328                      this.transitionTo("beforeData" /* beforeData */);
8329                  }
8330                  else {
8331                      this.delegate.appendToCommentData('--' + char);
8332                      this.transitionTo("comment" /* comment */);
8333                  }
8334              },
8335              tagName: function () {
8336                  var char = this.consume();
8337                  if (isSpace(char)) {
8338                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8339                  }
8340                  else if (char === '/') {
8341                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8342                  }
8343                  else if (char === '>') {
8344                      this.delegate.finishTag();
8345                      this.transitionTo("beforeData" /* beforeData */);
8346                  }
8347                  else {
8348                      this.appendToTagName(char);
8349                  }
8350              },
8351              endTagName: function () {
8352                  var char = this.consume();
8353                  if (isSpace(char)) {
8354                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8355                      this.tagNameBuffer = '';
8356                  }
8357                  else if (char === '/') {
8358                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8359                      this.tagNameBuffer = '';
8360                  }
8361                  else if (char === '>') {
8362                      this.delegate.finishTag();
8363                      this.transitionTo("beforeData" /* beforeData */);
8364                      this.tagNameBuffer = '';
8365                  }
8366                  else {
8367                      this.appendToTagName(char);
8368                  }
8369              },
8370              beforeAttributeName: function () {
8371                  var char = this.peek();
8372                  if (isSpace(char)) {
8373                      this.consume();
8374                      return;
8375                  }
8376                  else if (char === '/') {
8377                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8378                      this.consume();
8379                  }
8380                  else if (char === '>') {
8381                      this.consume();
8382                      this.delegate.finishTag();
8383                      this.transitionTo("beforeData" /* beforeData */);
8384                  }
8385                  else if (char === '=') {
8386                      this.delegate.reportSyntaxError('attribute name cannot start with equals sign');
8387                      this.transitionTo("attributeName" /* attributeName */);
8388                      this.delegate.beginAttribute();
8389                      this.consume();
8390                      this.delegate.appendToAttributeName(char);
8391                  }
8392                  else {
8393                      this.transitionTo("attributeName" /* attributeName */);
8394                      this.delegate.beginAttribute();
8395                  }
8396              },
8397              attributeName: function () {
8398                  var char = this.peek();
8399                  if (isSpace(char)) {
8400                      this.transitionTo("afterAttributeName" /* afterAttributeName */);
8401                      this.consume();
8402                  }
8403                  else if (char === '/') {
8404                      this.delegate.beginAttributeValue(false);
8405                      this.delegate.finishAttributeValue();
8406                      this.consume();
8407                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8408                  }
8409                  else if (char === '=') {
8410                      this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
8411                      this.consume();
8412                  }
8413                  else if (char === '>') {
8414                      this.delegate.beginAttributeValue(false);
8415                      this.delegate.finishAttributeValue();
8416                      this.consume();
8417                      this.delegate.finishTag();
8418                      this.transitionTo("beforeData" /* beforeData */);
8419                  }
8420                  else if (char === '"' || char === "'" || char === '<') {
8421                      this.delegate.reportSyntaxError(char + ' is not a valid character within attribute names');
8422                      this.consume();
8423                      this.delegate.appendToAttributeName(char);
8424                  }
8425                  else {
8426                      this.consume();
8427                      this.delegate.appendToAttributeName(char);
8428                  }
8429              },
8430              afterAttributeName: function () {
8431                  var char = this.peek();
8432                  if (isSpace(char)) {
8433                      this.consume();
8434                      return;
8435                  }
8436                  else if (char === '/') {
8437                      this.delegate.beginAttributeValue(false);
8438                      this.delegate.finishAttributeValue();
8439                      this.consume();
8440                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8441                  }
8442                  else if (char === '=') {
8443                      this.consume();
8444                      this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
8445                  }
8446                  else if (char === '>') {
8447                      this.delegate.beginAttributeValue(false);
8448                      this.delegate.finishAttributeValue();
8449                      this.consume();
8450                      this.delegate.finishTag();
8451                      this.transitionTo("beforeData" /* beforeData */);
8452                  }
8453                  else {
8454                      this.delegate.beginAttributeValue(false);
8455                      this.delegate.finishAttributeValue();
8456                      this.transitionTo("attributeName" /* attributeName */);
8457                      this.delegate.beginAttribute();
8458                      this.consume();
8459                      this.delegate.appendToAttributeName(char);
8460                  }
8461              },
8462              beforeAttributeValue: function () {
8463                  var char = this.peek();
8464                  if (isSpace(char)) {
8465                      this.consume();
8466                  }
8467                  else if (char === '"') {
8468                      this.transitionTo("attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */);
8469                      this.delegate.beginAttributeValue(true);
8470                      this.consume();
8471                  }