[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

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