[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/js/dist/ -> rich-text.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["richText"] =
   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 = 346);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = this["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 10:
  98  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99  
 100  "use strict";
 101  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
 102  function _defineProperty(obj, key, value) {
 103    if (key in obj) {
 104      Object.defineProperty(obj, key, {
 105        value: value,
 106        enumerable: true,
 107        configurable: true,
 108        writable: true
 109      });
 110    } else {
 111      obj[key] = value;
 112    }
 113  
 114    return obj;
 115  }
 116  
 117  /***/ }),
 118  
 119  /***/ 11:
 120  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 121  
 122  "use strict";
 123  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 124  function _defineProperties(target, props) {
 125    for (var i = 0; i < props.length; i++) {
 126      var descriptor = props[i];
 127      descriptor.enumerable = descriptor.enumerable || false;
 128      descriptor.configurable = true;
 129      if ("value" in descriptor) descriptor.writable = true;
 130      Object.defineProperty(target, descriptor.key, descriptor);
 131    }
 132  }
 133  
 134  function _createClass(Constructor, protoProps, staticProps) {
 135    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 136    if (staticProps) _defineProperties(Constructor, staticProps);
 137    return Constructor;
 138  }
 139  
 140  /***/ }),
 141  
 142  /***/ 12:
 143  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 144  
 145  "use strict";
 146  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 147  function _classCallCheck(instance, Constructor) {
 148    if (!(instance instanceof Constructor)) {
 149      throw new TypeError("Cannot call a class as a function");
 150    }
 151  }
 152  
 153  /***/ }),
 154  
 155  /***/ 13:
 156  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 157  
 158  "use strict";
 159  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
 160  /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
 161  /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
 162  
 163  
 164  function _possibleConstructorReturn(self, call) {
 165    if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
 166      return call;
 167    }
 168  
 169    return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
 170  }
 171  
 172  /***/ }),
 173  
 174  /***/ 14:
 175  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 176  
 177  "use strict";
 178  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
 179  function _getPrototypeOf(o) {
 180    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
 181      return o.__proto__ || Object.getPrototypeOf(o);
 182    };
 183    return _getPrototypeOf(o);
 184  }
 185  
 186  /***/ }),
 187  
 188  /***/ 15:
 189  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 190  
 191  "use strict";
 192  
 193  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
 194  function _setPrototypeOf(o, p) {
 195    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
 196      o.__proto__ = p;
 197      return o;
 198    };
 199  
 200    return _setPrototypeOf(o, p);
 201  }
 202  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
 203  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
 204  
 205  function _inherits(subClass, superClass) {
 206    if (typeof superClass !== "function" && superClass !== null) {
 207      throw new TypeError("Super expression must either be null or a function");
 208    }
 209  
 210    subClass.prototype = Object.create(superClass && superClass.prototype, {
 211      constructor: {
 212        value: subClass,
 213        writable: true,
 214        configurable: true
 215      }
 216    });
 217    if (superClass) _setPrototypeOf(subClass, superClass);
 218  }
 219  
 220  /***/ }),
 221  
 222  /***/ 16:
 223  /***/ (function(module, exports, __webpack_require__) {
 224  
 225  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
 226    Copyright (c) 2017 Jed Watson.
 227    Licensed under the MIT License (MIT), see
 228    http://jedwatson.github.io/classnames
 229  */
 230  /* global define */
 231  
 232  (function () {
 233      'use strict';
 234  
 235      var hasOwn = {}.hasOwnProperty;
 236  
 237  	function classNames () {
 238          var classes = [];
 239  
 240          for (var i = 0; i < arguments.length; i++) {
 241              var arg = arguments[i];
 242              if (!arg) continue;
 243  
 244              var argType = typeof arg;
 245  
 246              if (argType === 'string' || argType === 'number') {
 247                  classes.push(arg);
 248              } else if (Array.isArray(arg) && arg.length) {
 249                  var inner = classNames.apply(null, arg);
 250                  if (inner) {
 251                      classes.push(inner);
 252                  }
 253              } else if (argType === 'object') {
 254                  for (var key in arg) {
 255                      if (hasOwn.call(arg, key) && arg[key]) {
 256                          classes.push(key);
 257                      }
 258                  }
 259              }
 260          }
 261  
 262          return classes.join(' ');
 263      }
 264  
 265      if ( true && module.exports) {
 266          classNames.default = classNames;
 267          module.exports = classNames;
 268      } else if (true) {
 269          // register as 'classnames', consistent with npm package name
 270          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
 271              return classNames;
 272          }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
 273                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
 274      } else {}
 275  }());
 276  
 277  
 278  /***/ }),
 279  
 280  /***/ 17:
 281  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 282  
 283  "use strict";
 284  
 285  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 286  function _arrayWithoutHoles(arr) {
 287    if (Array.isArray(arr)) {
 288      for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
 289        arr2[i] = arr[i];
 290      }
 291  
 292      return arr2;
 293    }
 294  }
 295  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 296  var iterableToArray = __webpack_require__(30);
 297  
 298  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 299  function _nonIterableSpread() {
 300    throw new TypeError("Invalid attempt to spread non-iterable instance");
 301  }
 302  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 303  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
 304  
 305  
 306  
 307  function _toConsumableArray(arr) {
 308    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 309  }
 310  
 311  /***/ }),
 312  
 313  /***/ 18:
 314  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 315  
 316  "use strict";
 317  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
 318  function _extends() {
 319    _extends = Object.assign || function (target) {
 320      for (var i = 1; i < arguments.length; i++) {
 321        var source = arguments[i];
 322  
 323        for (var key in source) {
 324          if (Object.prototype.hasOwnProperty.call(source, key)) {
 325            target[key] = source[key];
 326          }
 327        }
 328      }
 329  
 330      return target;
 331    };
 332  
 333    return _extends.apply(this, arguments);
 334  }
 335  
 336  /***/ }),
 337  
 338  /***/ 19:
 339  /***/ (function(module, exports) {
 340  
 341  (function() { module.exports = this["wp"]["keycodes"]; }());
 342  
 343  /***/ }),
 344  
 345  /***/ 2:
 346  /***/ (function(module, exports) {
 347  
 348  (function() { module.exports = this["lodash"]; }());
 349  
 350  /***/ }),
 351  
 352  /***/ 21:
 353  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 354  
 355  "use strict";
 356  
 357  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
 358  function _objectWithoutPropertiesLoose(source, excluded) {
 359    if (source == null) return {};
 360    var target = {};
 361    var sourceKeys = Object.keys(source);
 362    var key, i;
 363  
 364    for (i = 0; i < sourceKeys.length; i++) {
 365      key = sourceKeys[i];
 366      if (excluded.indexOf(key) >= 0) continue;
 367      target[key] = source[key];
 368    }
 369  
 370    return target;
 371  }
 372  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
 373  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
 374  
 375  function _objectWithoutProperties(source, excluded) {
 376    if (source == null) return {};
 377    var target = _objectWithoutPropertiesLoose(source, excluded);
 378    var key, i;
 379  
 380    if (Object.getOwnPropertySymbols) {
 381      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
 382  
 383      for (i = 0; i < sourceSymbolKeys.length; i++) {
 384        key = sourceSymbolKeys[i];
 385        if (excluded.indexOf(key) >= 0) continue;
 386        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
 387        target[key] = source[key];
 388      }
 389    }
 390  
 391    return target;
 392  }
 393  
 394  /***/ }),
 395  
 396  /***/ 27:
 397  /***/ (function(module, exports) {
 398  
 399  (function() { module.exports = this["wp"]["hooks"]; }());
 400  
 401  /***/ }),
 402  
 403  /***/ 30:
 404  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 405  
 406  "use strict";
 407  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
 408  function _iterableToArray(iter) {
 409    if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
 410  }
 411  
 412  /***/ }),
 413  
 414  /***/ 31:
 415  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 416  
 417  "use strict";
 418  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
 419  function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
 420  
 421  function _typeof(obj) {
 422    if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
 423      _typeof = function _typeof(obj) {
 424        return _typeof2(obj);
 425      };
 426    } else {
 427      _typeof = function _typeof(obj) {
 428        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
 429      };
 430    }
 431  
 432    return _typeof(obj);
 433  }
 434  
 435  /***/ }),
 436  
 437  /***/ 346:
 438  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 439  
 440  "use strict";
 441  __webpack_require__.r(__webpack_exports__);
 442  var selectors_namespaceObject = {};
 443  __webpack_require__.r(selectors_namespaceObject);
 444  __webpack_require__.d(selectors_namespaceObject, "getFormatTypes", function() { return getFormatTypes; });
 445  __webpack_require__.d(selectors_namespaceObject, "getFormatType", function() { return getFormatType; });
 446  __webpack_require__.d(selectors_namespaceObject, "getFormatTypeForBareElement", function() { return getFormatTypeForBareElement; });
 447  __webpack_require__.d(selectors_namespaceObject, "getFormatTypeForClassName", function() { return getFormatTypeForClassName; });
 448  var actions_namespaceObject = {};
 449  __webpack_require__.r(actions_namespaceObject);
 450  __webpack_require__.d(actions_namespaceObject, "addFormatTypes", function() { return addFormatTypes; });
 451  __webpack_require__.d(actions_namespaceObject, "removeFormatTypes", function() { return removeFormatTypes; });
 452  
 453  // EXTERNAL MODULE: external {"this":["wp","data"]}
 454  var external_this_wp_data_ = __webpack_require__(4);
 455  
 456  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
 457  var objectSpread = __webpack_require__(7);
 458  
 459  // EXTERNAL MODULE: external "lodash"
 460  var external_lodash_ = __webpack_require__(2);
 461  
 462  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/reducer.js
 463  
 464  
 465  /**
 466   * External dependencies
 467   */
 468  
 469  /**
 470   * WordPress dependencies
 471   */
 472  
 473  
 474  /**
 475   * Reducer managing the format types
 476   *
 477   * @param {Object} state  Current state.
 478   * @param {Object} action Dispatched action.
 479   *
 480   * @return {Object} Updated state.
 481   */
 482  
 483  function reducer_formatTypes() {
 484    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 485    var action = arguments.length > 1 ? arguments[1] : undefined;
 486  
 487    switch (action.type) {
 488      case 'ADD_FORMAT_TYPES':
 489        return Object(objectSpread["a" /* default */])({}, state, Object(external_lodash_["keyBy"])(action.formatTypes, 'name'));
 490  
 491      case 'REMOVE_FORMAT_TYPES':
 492        return Object(external_lodash_["omit"])(state, action.names);
 493    }
 494  
 495    return state;
 496  }
 497  /* harmony default export */ var reducer = (Object(external_this_wp_data_["combineReducers"])({
 498    formatTypes: reducer_formatTypes
 499  }));
 500  
 501  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
 502  var rememo = __webpack_require__(36);
 503  
 504  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/selectors.js
 505  /**
 506   * External dependencies
 507   */
 508  
 509  
 510  /**
 511   * Returns all the available format types.
 512   *
 513   * @param {Object} state Data state.
 514   *
 515   * @return {Array} Format types.
 516   */
 517  
 518  var getFormatTypes = Object(rememo["a" /* default */])(function (state) {
 519    return Object.values(state.formatTypes);
 520  }, function (state) {
 521    return [state.formatTypes];
 522  });
 523  /**
 524   * Returns a format type by name.
 525   *
 526   * @param {Object} state Data state.
 527   * @param {string} name Format type name.
 528   *
 529   * @return {Object?} Format type.
 530   */
 531  
 532  function getFormatType(state, name) {
 533    return state.formatTypes[name];
 534  }
 535  /**
 536   * Gets the format type, if any, that can handle a bare element (without a
 537   * data-format-type attribute), given the tag name of this element.
 538   *
 539   * @param {Object} state              Data state.
 540   * @param {string} bareElementTagName The tag name of the element to find a
 541   *                                    format type for.
 542   * @return {?Object} Format type.
 543   */
 544  
 545  function getFormatTypeForBareElement(state, bareElementTagName) {
 546    return Object(external_lodash_["find"])(getFormatTypes(state), function (_ref) {
 547      var className = _ref.className,
 548          tagName = _ref.tagName;
 549      return className === null && bareElementTagName === tagName;
 550    });
 551  }
 552  /**
 553   * Gets the format type, if any, that can handle an element, given its classes.
 554   *
 555   * @param {Object} state            Data state.
 556   * @param {string} elementClassName The classes of the element to find a format
 557   *                                  type for.
 558   * @return {?Object} Format type.
 559   */
 560  
 561  function getFormatTypeForClassName(state, elementClassName) {
 562    return Object(external_lodash_["find"])(getFormatTypes(state), function (_ref2) {
 563      var className = _ref2.className;
 564  
 565      if (className === null) {
 566        return false;
 567      }
 568  
 569      return " ".concat(elementClassName, " ").indexOf(" ".concat(className, " ")) >= 0;
 570    });
 571  }
 572  
 573  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/actions.js
 574  /**
 575   * External dependencies
 576   */
 577  
 578  /**
 579   * Returns an action object used in signalling that format types have been
 580   * added.
 581   *
 582   * @param {Array|Object} formatTypes Format types received.
 583   *
 584   * @return {Object} Action object.
 585   */
 586  
 587  function addFormatTypes(formatTypes) {
 588    return {
 589      type: 'ADD_FORMAT_TYPES',
 590      formatTypes: Object(external_lodash_["castArray"])(formatTypes)
 591    };
 592  }
 593  /**
 594   * Returns an action object used to remove a registered format type.
 595   *
 596   * @param {string|Array} names Format name.
 597   *
 598   * @return {Object} Action object.
 599   */
 600  
 601  function removeFormatTypes(names) {
 602    return {
 603      type: 'REMOVE_FORMAT_TYPES',
 604      names: Object(external_lodash_["castArray"])(names)
 605    };
 606  }
 607  
 608  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/index.js
 609  /**
 610   * WordPress dependencies
 611   */
 612  
 613  /**
 614   * Internal dependencies
 615   */
 616  
 617  
 618  
 619  
 620  Object(external_this_wp_data_["registerStore"])('core/rich-text', {
 621    reducer: reducer,
 622    selectors: selectors_namespaceObject,
 623    actions: actions_namespaceObject
 624  });
 625  
 626  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
 627  var toConsumableArray = __webpack_require__(17);
 628  
 629  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-format-equal.js
 630  /**
 631   * Optimised equality check for format objects.
 632   *
 633   * @param {?Object} format1 Format to compare.
 634   * @param {?Object} format2 Format to compare.
 635   *
 636   * @return {boolean} True if formats are equal, false if not.
 637   */
 638  function isFormatEqual(format1, format2) {
 639    // Both not defined.
 640    if (format1 === format2) {
 641      return true;
 642    } // Either not defined.
 643  
 644  
 645    if (!format1 || !format2) {
 646      return false;
 647    }
 648  
 649    if (format1.type !== format2.type) {
 650      return false;
 651    }
 652  
 653    var attributes1 = format1.attributes;
 654    var attributes2 = format2.attributes; // Both not defined.
 655  
 656    if (attributes1 === attributes2) {
 657      return true;
 658    } // Either not defined.
 659  
 660  
 661    if (!attributes1 || !attributes2) {
 662      return false;
 663    }
 664  
 665    var keys1 = Object.keys(attributes1);
 666    var keys2 = Object.keys(attributes2);
 667  
 668    if (keys1.length !== keys2.length) {
 669      return false;
 670    }
 671  
 672    var length = keys1.length; // Optimise for speed.
 673  
 674    for (var i = 0; i < length; i++) {
 675      var name = keys1[i];
 676  
 677      if (attributes1[name] !== attributes2[name]) {
 678        return false;
 679      }
 680    }
 681  
 682    return true;
 683  }
 684  
 685  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/normalise-formats.js
 686  
 687  
 688  /**
 689   * Internal dependencies
 690   */
 691  
 692  /**
 693   * Normalises formats: ensures subsequent adjacent equal formats have the same
 694   * reference.
 695   *
 696   * @param {Object} value Value to normalise formats of.
 697   *
 698   * @return {Object} New value with normalised formats.
 699   */
 700  
 701  function normaliseFormats(value) {
 702    var newFormats = value.formats.slice();
 703    newFormats.forEach(function (formatsAtIndex, index) {
 704      var formatsAtPreviousIndex = newFormats[index - 1];
 705  
 706      if (formatsAtPreviousIndex) {
 707        var newFormatsAtIndex = formatsAtIndex.slice();
 708        newFormatsAtIndex.forEach(function (format, formatIndex) {
 709          var previousFormat = formatsAtPreviousIndex[formatIndex];
 710  
 711          if (isFormatEqual(format, previousFormat)) {
 712            newFormatsAtIndex[formatIndex] = previousFormat;
 713          }
 714        });
 715        newFormats[index] = newFormatsAtIndex;
 716      }
 717    });
 718    return Object(objectSpread["a" /* default */])({}, value, {
 719      formats: newFormats
 720    });
 721  }
 722  
 723  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/apply-format.js
 724  
 725  
 726  
 727  /**
 728   * External dependencies
 729   */
 730  
 731  /**
 732   * Internal dependencies
 733   */
 734  
 735  
 736  
 737  function replace(array, index, value) {
 738    array = array.slice();
 739    array[index] = value;
 740    return array;
 741  }
 742  /**
 743   * Apply a format object to a Rich Text value from the given `startIndex` to the
 744   * given `endIndex`. Indices are retrieved from the selection if none are
 745   * provided.
 746   *
 747   * @param {Object} value        Value to modify.
 748   * @param {Object} format       Format to apply.
 749   * @param {number} [startIndex] Start index.
 750   * @param {number} [endIndex]   End index.
 751   *
 752   * @return {Object} A new value with the format applied.
 753   */
 754  
 755  
 756  function applyFormat(value, format) {
 757    var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
 758    var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
 759    var formats = value.formats,
 760        activeFormats = value.activeFormats;
 761    var newFormats = formats.slice(); // The selection is collapsed.
 762  
 763    if (startIndex === endIndex) {
 764      var startFormat = Object(external_lodash_["find"])(newFormats[startIndex], {
 765        type: format.type
 766      }); // If the caret is at a format of the same type, expand start and end to
 767      // the edges of the format. This is useful to apply new attributes.
 768  
 769      if (startFormat) {
 770        var index = newFormats[startIndex].indexOf(startFormat);
 771  
 772        while (newFormats[startIndex] && newFormats[startIndex][index] === startFormat) {
 773          newFormats[startIndex] = replace(newFormats[startIndex], index, format);
 774          startIndex--;
 775        }
 776  
 777        endIndex++;
 778  
 779        while (newFormats[endIndex] && newFormats[endIndex][index] === startFormat) {
 780          newFormats[endIndex] = replace(newFormats[endIndex], index, format);
 781          endIndex++;
 782        }
 783      }
 784    } else {
 785      // Determine the highest position the new format can be inserted at.
 786      var position = +Infinity;
 787  
 788      for (var _index = startIndex; _index < endIndex; _index++) {
 789        if (newFormats[_index]) {
 790          newFormats[_index] = newFormats[_index].filter(function (_ref) {
 791            var type = _ref.type;
 792            return type !== format.type;
 793          });
 794          var length = newFormats[_index].length;
 795  
 796          if (length < position) {
 797            position = length;
 798          }
 799        } else {
 800          newFormats[_index] = [];
 801          position = 0;
 802        }
 803      }
 804  
 805      for (var _index2 = startIndex; _index2 < endIndex; _index2++) {
 806        newFormats[_index2].splice(position, 0, format);
 807      }
 808    }
 809  
 810    return normaliseFormats(Object(objectSpread["a" /* default */])({}, value, {
 811      formats: newFormats,
 812      // Always revise active formats. This serves as a placeholder for new
 813      // inputs with the format so new input appears with the format applied,
 814      // and ensures a format of the same type uses the latest values.
 815      activeFormats: [].concat(Object(toConsumableArray["a" /* default */])(Object(external_lodash_["reject"])(activeFormats, {
 816        type: format.type
 817      })), [format])
 818    }));
 819  }
 820  
 821  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
 822  var esm_typeof = __webpack_require__(31);
 823  
 824  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/create-element.js
 825  /**
 826   * Parse the given HTML into a body element.
 827   *
 828   * Note: The current implementation will return a shared reference, reset on
 829   * each call to `createElement`. Therefore, you should not hold a reference to
 830   * the value to operate upon asynchronously, as it may have unexpected results.
 831   *
 832   * @param {HTMLDocument} document The HTML document to use to parse.
 833   * @param {string}       html     The HTML to parse.
 834   *
 835   * @return {HTMLBodyElement} Body element with parsed HTML.
 836   */
 837  function createElement(_ref, html) {
 838    var implementation = _ref.implementation;
 839  
 840    // Because `createHTMLDocument` is an expensive operation, and with this
 841    // function being internal to `rich-text` (full control in avoiding a risk
 842    // of asynchronous operations on the shared reference), a single document
 843    // is reused and reset for each call to the function.
 844    if (!createElement.body) {
 845      createElement.body = implementation.createHTMLDocument('').body;
 846    }
 847  
 848    createElement.body.innerHTML = html;
 849    return createElement.body;
 850  }
 851  
 852  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/special-characters.js
 853  /**
 854   * Line separator character, used for multiline text.
 855   */
 856  var LINE_SEPARATOR = "\u2028";
 857  /**
 858   * Object replacement character, used as a placeholder for objects.
 859   */
 860  
 861  var OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
 862  /**
 863   * Zero width non-breaking space, used as padding in the editable DOM tree when
 864   * it is empty otherwise.
 865   */
 866  
 867  var ZWNBSP = "\uFEFF";
 868  
 869  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/create.js
 870  
 871  
 872  
 873  
 874  /**
 875   * WordPress dependencies
 876   */
 877  
 878  /**
 879   * Internal dependencies
 880   */
 881  
 882  
 883  
 884  
 885  
 886  /**
 887   * Browser dependencies
 888   */
 889  
 890  var _window$Node = window.Node,
 891      TEXT_NODE = _window$Node.TEXT_NODE,
 892      ELEMENT_NODE = _window$Node.ELEMENT_NODE;
 893  
 894  function createEmptyValue() {
 895    return {
 896      formats: [],
 897      replacements: [],
 898      text: ''
 899    };
 900  }
 901  
 902  function simpleFindKey(object, value) {
 903    for (var key in object) {
 904      if (object[key] === value) {
 905        return key;
 906      }
 907    }
 908  }
 909  
 910  function toFormat(_ref) {
 911    var type = _ref.type,
 912        attributes = _ref.attributes;
 913    var formatType;
 914  
 915    if (attributes && attributes.class) {
 916      formatType = Object(external_this_wp_data_["select"])('core/rich-text').getFormatTypeForClassName(attributes.class);
 917  
 918      if (formatType) {
 919        // Preserve any additional classes.
 920        attributes.class = " ".concat(attributes.class, " ").replace(" ".concat(formatType.className, " "), ' ').trim();
 921  
 922        if (!attributes.class) {
 923          delete attributes.class;
 924        }
 925      }
 926    }
 927  
 928    if (!formatType) {
 929      formatType = Object(external_this_wp_data_["select"])('core/rich-text').getFormatTypeForBareElement(type);
 930    }
 931  
 932    if (!formatType) {
 933      return attributes ? {
 934        type: type,
 935        attributes: attributes
 936      } : {
 937        type: type
 938      };
 939    }
 940  
 941    if (formatType.__experimentalCreatePrepareEditableTree && !formatType.__experimentalCreateOnChangeEditableValue) {
 942      return null;
 943    }
 944  
 945    if (!attributes) {
 946      return {
 947        type: formatType.name
 948      };
 949    }
 950  
 951    var registeredAttributes = {};
 952    var unregisteredAttributes = {};
 953  
 954    for (var name in attributes) {
 955      var key = simpleFindKey(formatType.attributes, name);
 956  
 957      if (key) {
 958        registeredAttributes[key] = attributes[name];
 959      } else {
 960        unregisteredAttributes[name] = attributes[name];
 961      }
 962    }
 963  
 964    return {
 965      type: formatType.name,
 966      attributes: registeredAttributes,
 967      unregisteredAttributes: unregisteredAttributes
 968    };
 969  }
 970  /**
 971   * Create a RichText value from an `Element` tree (DOM), an HTML string or a
 972   * plain text string, with optionally a `Range` object to set the selection. If
 973   * called without any input, an empty value will be created. If
 974   * `multilineTag` is provided, any content of direct children whose type matches
 975   * `multilineTag` will be separated by two newlines. The optional functions can
 976   * be used to filter out content.
 977   *
 978   * A value will have the following shape, which you are strongly encouraged not
 979   * to modify without the use of helper functions:
 980   *
 981   * ```js
 982   * {
 983   *   text: string,
 984   *   formats: Array,
 985   *   replacements: Array,
 986   *   ?start: number,
 987   *   ?end: number,
 988   * }
 989   * ```
 990   *
 991   * As you can see, text and formatting are separated. `text` holds the text,
 992   * including any replacement characters for objects and lines. `formats`,
 993   * `objects` and `lines` are all sparse arrays of the same length as `text`. It
 994   * holds information about the formatting at the relevant text indices. Finally
 995   * `start` and `end` state which text indices are selected. They are only
 996   * provided if a `Range` was given.
 997   *
 998   * @param {Object}  [$1]                      Optional named arguments.
 999   * @param {Element} [$1.element]              Element to create value from.
1000   * @param {string}  [$1.text]                 Text to create value from.
1001   * @param {string}  [$1.html]                 HTML to create value from.
1002   * @param {Range}   [$1.range]                Range to create value from.
1003   * @param {string}  [$1.multilineTag]         Multiline tag if the structure is
1004   *                                            multiline.
1005   * @param {Array}   [$1.multilineWrapperTags] Tags where lines can be found if
1006   *                                            nesting is possible.
1007   *
1008   * @return {Object} A rich text value.
1009   */
1010  
1011  
1012  function create() {
1013    var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1014        element = _ref2.element,
1015        text = _ref2.text,
1016        html = _ref2.html,
1017        range = _ref2.range,
1018        multilineTag = _ref2.multilineTag,
1019        multilineWrapperTags = _ref2.multilineWrapperTags,
1020        isEditableTree = _ref2.__unstableIsEditableTree;
1021  
1022    if (typeof text === 'string' && text.length > 0) {
1023      return {
1024        formats: Array(text.length),
1025        replacements: Array(text.length),
1026        text: text
1027      };
1028    }
1029  
1030    if (typeof html === 'string' && html.length > 0) {
1031      element = createElement(document, html);
1032    }
1033  
1034    if (Object(esm_typeof["a" /* default */])(element) !== 'object') {
1035      return createEmptyValue();
1036    }
1037  
1038    if (!multilineTag) {
1039      return createFromElement({
1040        element: element,
1041        range: range,
1042        isEditableTree: isEditableTree
1043      });
1044    }
1045  
1046    return createFromMultilineElement({
1047      element: element,
1048      range: range,
1049      multilineTag: multilineTag,
1050      multilineWrapperTags: multilineWrapperTags,
1051      isEditableTree: isEditableTree
1052    });
1053  }
1054  /**
1055   * Helper to accumulate the value's selection start and end from the current
1056   * node and range.
1057   *
1058   * @param {Object} accumulator Object to accumulate into.
1059   * @param {Node}   node        Node to create value with.
1060   * @param {Range}  range       Range to create value with.
1061   * @param {Object} value       Value that is being accumulated.
1062   */
1063  
1064  function accumulateSelection(accumulator, node, range, value) {
1065    if (!range) {
1066      return;
1067    }
1068  
1069    var parentNode = node.parentNode;
1070    var startContainer = range.startContainer,
1071        startOffset = range.startOffset,
1072        endContainer = range.endContainer,
1073        endOffset = range.endOffset;
1074    var currentLength = accumulator.text.length; // Selection can be extracted from value.
1075  
1076    if (value.start !== undefined) {
1077      accumulator.start = currentLength + value.start; // Range indicates that the current node has selection.
1078    } else if (node === startContainer && node.nodeType === TEXT_NODE) {
1079      accumulator.start = currentLength + startOffset; // Range indicates that the current node is selected.
1080    } else if (parentNode === startContainer && node === startContainer.childNodes[startOffset]) {
1081      accumulator.start = currentLength; // Range indicates that the selection is after the current node.
1082    } else if (parentNode === startContainer && node === startContainer.childNodes[startOffset - 1]) {
1083      accumulator.start = currentLength + value.text.length; // Fallback if no child inside handled the selection.
1084    } else if (node === startContainer) {
1085      accumulator.start = currentLength;
1086    } // Selection can be extracted from value.
1087  
1088  
1089    if (value.end !== undefined) {
1090      accumulator.end = currentLength + value.end; // Range indicates that the current node has selection.
1091    } else if (node === endContainer && node.nodeType === TEXT_NODE) {
1092      accumulator.end = currentLength + endOffset; // Range indicates that the current node is selected.
1093    } else if (parentNode === endContainer && node === endContainer.childNodes[endOffset - 1]) {
1094      accumulator.end = currentLength + value.text.length; // Range indicates that the selection is before the current node.
1095    } else if (parentNode === endContainer && node === endContainer.childNodes[endOffset]) {
1096      accumulator.end = currentLength; // Fallback if no child inside handled the selection.
1097    } else if (node === endContainer) {
1098      accumulator.end = currentLength + endOffset;
1099    }
1100  }
1101  /**
1102   * Adjusts the start and end offsets from a range based on a text filter.
1103   *
1104   * @param {Node}     node   Node of which the text should be filtered.
1105   * @param {Range}    range  The range to filter.
1106   * @param {Function} filter Function to use to filter the text.
1107   *
1108   * @return {?Object} Object containing range properties.
1109   */
1110  
1111  
1112  function filterRange(node, range, filter) {
1113    if (!range) {
1114      return;
1115    }
1116  
1117    var startContainer = range.startContainer,
1118        endContainer = range.endContainer;
1119    var startOffset = range.startOffset,
1120        endOffset = range.endOffset;
1121  
1122    if (node === startContainer) {
1123      startOffset = filter(node.nodeValue.slice(0, startOffset)).length;
1124    }
1125  
1126    if (node === endContainer) {
1127      endOffset = filter(node.nodeValue.slice(0, endOffset)).length;
1128    }
1129  
1130    return {
1131      startContainer: startContainer,
1132      startOffset: startOffset,
1133      endContainer: endContainer,
1134      endOffset: endOffset
1135    };
1136  }
1137  
1138  var ZWNBSPRegExp = new RegExp(ZWNBSP, 'g');
1139  
1140  function filterString(string) {
1141    // Reduce any whitespace used for HTML formatting to one space
1142    // character, because it will also be displayed as such by the browser.
1143    return string.replace(/[\n\r\t]+/g, ' ') // Remove padding added by `toTree`.
1144    .replace(ZWNBSPRegExp, '');
1145  }
1146  /**
1147   * Creates a Rich Text value from a DOM element and range.
1148   *
1149   * @param {Object}    $1                      Named argements.
1150   * @param {?Element}  $1.element              Element to create value from.
1151   * @param {?Range}    $1.range                Range to create value from.
1152   * @param {?string}   $1.multilineTag         Multiline tag if the structure is
1153   *                                            multiline.
1154   * @param {?Array}    $1.multilineWrapperTags Tags where lines can be found if
1155   *                                            nesting is possible.
1156   *
1157   * @return {Object} A rich text value.
1158   */
1159  
1160  
1161  function createFromElement(_ref3) {
1162    var element = _ref3.element,
1163        range = _ref3.range,
1164        multilineTag = _ref3.multilineTag,
1165        multilineWrapperTags = _ref3.multilineWrapperTags,
1166        _ref3$currentWrapperT = _ref3.currentWrapperTags,
1167        currentWrapperTags = _ref3$currentWrapperT === void 0 ? [] : _ref3$currentWrapperT,
1168        isEditableTree = _ref3.isEditableTree;
1169    var accumulator = createEmptyValue();
1170  
1171    if (!element) {
1172      return accumulator;
1173    }
1174  
1175    if (!element.hasChildNodes()) {
1176      accumulateSelection(accumulator, element, range, createEmptyValue());
1177      return accumulator;
1178    }
1179  
1180    var length = element.childNodes.length; // Optimise for speed.
1181  
1182    var _loop = function _loop(index) {
1183      var node = element.childNodes[index];
1184      var type = node.nodeName.toLowerCase();
1185  
1186      if (node.nodeType === TEXT_NODE) {
1187        var text = filterString(node.nodeValue);
1188        range = filterRange(node, range, filterString);
1189        accumulateSelection(accumulator, node, range, {
1190          text: text
1191        }); // Create a sparse array of the same length as `text`, in which
1192        // formats can be added.
1193  
1194        accumulator.formats.length += text.length;
1195        accumulator.replacements.length += text.length;
1196        accumulator.text += text;
1197        return "continue";
1198      }
1199  
1200      if (node.nodeType !== ELEMENT_NODE) {
1201        return "continue";
1202      }
1203  
1204      if (isEditableTree && ( // Ignore any placeholders.
1205      node.getAttribute('data-rich-text-placeholder') || // Ignore any line breaks that are not inserted by us.
1206      type === 'br' && !node.getAttribute('data-rich-text-line-break'))) {
1207        accumulateSelection(accumulator, node, range, createEmptyValue());
1208        return "continue";
1209      }
1210  
1211      if (type === 'br') {
1212        accumulateSelection(accumulator, node, range, createEmptyValue());
1213        mergePair(accumulator, create({
1214          text: '\n'
1215        }));
1216        return "continue";
1217      }
1218  
1219      var lastFormats = accumulator.formats[accumulator.formats.length - 1];
1220      var lastFormat = lastFormats && lastFormats[lastFormats.length - 1];
1221      var newFormat = toFormat({
1222        type: type,
1223        attributes: getAttributes({
1224          element: node
1225        })
1226      });
1227      var format = isFormatEqual(newFormat, lastFormat) ? lastFormat : newFormat;
1228  
1229      if (multilineWrapperTags && multilineWrapperTags.indexOf(type) !== -1) {
1230        var _value = createFromMultilineElement({
1231          element: node,
1232          range: range,
1233          multilineTag: multilineTag,
1234          multilineWrapperTags: multilineWrapperTags,
1235          currentWrapperTags: [].concat(Object(toConsumableArray["a" /* default */])(currentWrapperTags), [format]),
1236          isEditableTree: isEditableTree
1237        });
1238  
1239        accumulateSelection(accumulator, node, range, _value);
1240        mergePair(accumulator, _value);
1241        return "continue";
1242      }
1243  
1244      var value = createFromElement({
1245        element: node,
1246        range: range,
1247        multilineTag: multilineTag,
1248        multilineWrapperTags: multilineWrapperTags,
1249        isEditableTree: isEditableTree
1250      });
1251      accumulateSelection(accumulator, node, range, value);
1252  
1253      if (!format) {
1254        mergePair(accumulator, value);
1255      } else if (value.text.length === 0) {
1256        if (format.attributes) {
1257          mergePair(accumulator, {
1258            formats: [,],
1259            replacements: [format],
1260            text: OBJECT_REPLACEMENT_CHARACTER
1261          });
1262        }
1263      } else {
1264        mergePair(accumulator, Object(objectSpread["a" /* default */])({}, value, {
1265          formats: Array.from(value.formats, function (formats) {
1266            return formats ? [format].concat(Object(toConsumableArray["a" /* default */])(formats)) : [format];
1267          })
1268        }));
1269      }
1270    };
1271  
1272    for (var index = 0; index < length; index++) {
1273      var _ret = _loop(index);
1274  
1275      if (_ret === "continue") continue;
1276    }
1277  
1278    return accumulator;
1279  }
1280  /**
1281   * Creates a rich text value from a DOM element and range that should be
1282   * multiline.
1283   *
1284   * @param {Object}    $1                      Named argements.
1285   * @param {?Element}  $1.element              Element to create value from.
1286   * @param {?Range}    $1.range                Range to create value from.
1287   * @param {?string}   $1.multilineTag         Multiline tag if the structure is
1288   *                                            multiline.
1289   * @param {?Array}    $1.multilineWrapperTags Tags where lines can be found if
1290   *                                            nesting is possible.
1291   * @param {boolean}   $1.currentWrapperTags   Whether to prepend a line
1292   *                                            separator.
1293   *
1294   * @return {Object} A rich text value.
1295   */
1296  
1297  
1298  function createFromMultilineElement(_ref4) {
1299    var element = _ref4.element,
1300        range = _ref4.range,
1301        multilineTag = _ref4.multilineTag,
1302        multilineWrapperTags = _ref4.multilineWrapperTags,
1303        _ref4$currentWrapperT = _ref4.currentWrapperTags,
1304        currentWrapperTags = _ref4$currentWrapperT === void 0 ? [] : _ref4$currentWrapperT,
1305        isEditableTree = _ref4.isEditableTree;
1306    var accumulator = createEmptyValue();
1307  
1308    if (!element || !element.hasChildNodes()) {
1309      return accumulator;
1310    }
1311  
1312    var length = element.children.length; // Optimise for speed.
1313  
1314    for (var index = 0; index < length; index++) {
1315      var node = element.children[index];
1316  
1317      if (node.nodeName.toLowerCase() !== multilineTag) {
1318        continue;
1319      }
1320  
1321      var value = createFromElement({
1322        element: node,
1323        range: range,
1324        multilineTag: multilineTag,
1325        multilineWrapperTags: multilineWrapperTags,
1326        currentWrapperTags: currentWrapperTags,
1327        isEditableTree: isEditableTree
1328      }); // Multiline value text should be separated by a line separator.
1329  
1330      if (index !== 0 || currentWrapperTags.length > 0) {
1331        mergePair(accumulator, {
1332          formats: [,],
1333          replacements: currentWrapperTags.length > 0 ? [currentWrapperTags] : [,],
1334          text: LINE_SEPARATOR
1335        });
1336      }
1337  
1338      accumulateSelection(accumulator, node, range, value);
1339      mergePair(accumulator, value);
1340    }
1341  
1342    return accumulator;
1343  }
1344  /**
1345   * Gets the attributes of an element in object shape.
1346   *
1347   * @param {Object}    $1                 Named argements.
1348   * @param {Element}   $1.element         Element to get attributes from.
1349   *
1350   * @return {?Object} Attribute object or `undefined` if the element has no
1351   *                   attributes.
1352   */
1353  
1354  
1355  function getAttributes(_ref5) {
1356    var element = _ref5.element;
1357  
1358    if (!element.hasAttributes()) {
1359      return;
1360    }
1361  
1362    var length = element.attributes.length;
1363    var accumulator; // Optimise for speed.
1364  
1365    for (var i = 0; i < length; i++) {
1366      var _element$attributes$i = element.attributes[i],
1367          name = _element$attributes$i.name,
1368          value = _element$attributes$i.value;
1369  
1370      if (name.indexOf('data-rich-text-') === 0) {
1371        continue;
1372      }
1373  
1374      accumulator = accumulator || {};
1375      accumulator[name] = value;
1376    }
1377  
1378    return accumulator;
1379  }
1380  
1381  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/concat.js
1382  /**
1383   * Internal dependencies
1384   */
1385  
1386  
1387  /**
1388   * Concats a pair of rich text values. Not that this mutates `a` and does NOT
1389   * normalise formats!
1390   *
1391   * @param  {Object} a Value to mutate.
1392   * @param  {Object} b Value to add read from.
1393   *
1394   * @return {Object} `a`, mutated.
1395   */
1396  
1397  function mergePair(a, b) {
1398    a.formats = a.formats.concat(b.formats);
1399    a.replacements = a.replacements.concat(b.replacements);
1400    a.text += b.text;
1401    return a;
1402  }
1403  /**
1404   * Combine all Rich Text values into one. This is similar to
1405   * `String.prototype.concat`.
1406   *
1407   * @param {...Object} values Objects to combine.
1408   *
1409   * @return {Object} A new value combining all given records.
1410   */
1411  
1412  function concat() {
1413    for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
1414      values[_key] = arguments[_key];
1415    }
1416  
1417    return normaliseFormats(values.reduce(mergePair, create()));
1418  }
1419  
1420  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-active-formats.js
1421  /**
1422   * Gets the all format objects at the start of the selection.
1423   *
1424   * @param {Object} value Value to inspect.
1425   *
1426   * @return {?Object} Active format objects.
1427   */
1428  function getActiveFormats(_ref) {
1429    var formats = _ref.formats,
1430        start = _ref.start,
1431        end = _ref.end,
1432        activeFormats = _ref.activeFormats;
1433  
1434    if (start === undefined) {
1435      return [];
1436    }
1437  
1438    if (start === end) {
1439      // For a collapsed caret, it is possible to override the active formats.
1440      if (activeFormats) {
1441        return activeFormats;
1442      }
1443  
1444      var formatsBefore = formats[start - 1] || [];
1445      var formatsAfter = formats[start] || []; // By default, select the lowest amount of formats possible (which means
1446      // the caret is positioned outside the format boundary). The user can
1447      // then use arrow keys to define `activeFormats`.
1448  
1449      if (formatsBefore.length < formatsAfter.length) {
1450        return formatsBefore;
1451      }
1452  
1453      return formatsAfter;
1454    }
1455  
1456    return formats[start] || [];
1457  }
1458  
1459  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-active-format.js
1460  /**
1461   * External dependencies
1462   */
1463  
1464  /**
1465   * Internal dependencies
1466   */
1467  
1468  
1469  /**
1470   * Gets the format object by type at the start of the selection. This can be
1471   * used to get e.g. the URL of a link format at the current selection, but also
1472   * to check if a format is active at the selection. Returns undefined if there
1473   * is no format at the selection.
1474   *
1475   * @param {Object} value      Value to inspect.
1476   * @param {string} formatType Format type to look for.
1477   *
1478   * @return {Object|undefined} Active format object of the specified type, or undefined.
1479   */
1480  
1481  function getActiveFormat(value, formatType) {
1482    return Object(external_lodash_["find"])(getActiveFormats(value), {
1483      type: formatType
1484    });
1485  }
1486  
1487  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-active-object.js
1488  /**
1489   * Internal dependencies
1490   */
1491  
1492  /**
1493   * Gets the active object, if there is any.
1494   *
1495   * @param {Object} value Value to inspect.
1496   *
1497   * @return {?Object} Active object, or undefined.
1498   */
1499  
1500  function getActiveObject(_ref) {
1501    var start = _ref.start,
1502        end = _ref.end,
1503        replacements = _ref.replacements,
1504        text = _ref.text;
1505  
1506    if (start + 1 !== end || text[start] !== OBJECT_REPLACEMENT_CHARACTER) {
1507      return;
1508    }
1509  
1510    return replacements[start];
1511  }
1512  
1513  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-text-content.js
1514  /**
1515   * Get the textual content of a Rich Text value. This is similar to
1516   * `Element.textContent`.
1517   *
1518   * @param {Object} value Value to use.
1519   *
1520   * @return {string} The text content.
1521   */
1522  function getTextContent(_ref) {
1523    var text = _ref.text;
1524    return text;
1525  }
1526  
1527  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-line-index.js
1528  /**
1529   * Internal dependencies
1530   */
1531  
1532  /**
1533   * Gets the currently selected line index, or the first line index if the
1534   * selection spans over multiple items.
1535   *
1536   * @param {Object}  value      Value to get the line index from.
1537   * @param {boolean} startIndex Optional index that should be contained by the
1538   *                             line. Defaults to the selection start of the
1539   *                             value.
1540   *
1541   * @return {?boolean} The line index. Undefined if not found.
1542   */
1543  
1544  function getLineIndex(_ref) {
1545    var start = _ref.start,
1546        text = _ref.text;
1547    var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
1548    var index = startIndex;
1549  
1550    while (index--) {
1551      if (text[index] === LINE_SEPARATOR) {
1552        return index;
1553      }
1554    }
1555  }
1556  
1557  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-list-root-selected.js
1558  /**
1559   * Internal dependencies
1560   */
1561  
1562  /**
1563   * Whether or not the root list is selected.
1564   *
1565   * @param {Object} value The value to check.
1566   *
1567   * @return {boolean} True if the root list or nothing is selected, false if an
1568   *                   inner list is selected.
1569   */
1570  
1571  function isListRootSelected(value) {
1572    var replacements = value.replacements,
1573        start = value.start;
1574    var lineIndex = getLineIndex(value, start);
1575    var replacement = replacements[lineIndex];
1576    return !replacement || replacement.length < 1;
1577  }
1578  
1579  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-active-list-type.js
1580  /**
1581   * Internal dependencies
1582   */
1583  
1584  /**
1585   * Wether or not the selected list has the given tag name.
1586   *
1587   * @param {Object}  value    The value to check.
1588   * @param {string}  type     The tag name the list should have.
1589   * @param {string}  rootType The current root tag name, to compare with in case
1590   *                           nothing is selected.
1591   *
1592   * @return {boolean} True if the current list type matches `type`, false if not.
1593   */
1594  
1595  function isActiveListType(value, type, rootType) {
1596    var replacements = value.replacements,
1597        start = value.start;
1598    var lineIndex = getLineIndex(value, start);
1599    var replacement = replacements[lineIndex];
1600  
1601    if (!replacement || replacement.length === 0) {
1602      return type === rootType;
1603    }
1604  
1605    var lastFormat = replacement[replacement.length - 1];
1606    return lastFormat.type === type;
1607  }
1608  
1609  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-collapsed.js
1610  /**
1611   * Check if the selection of a Rich Text value is collapsed or not. Collapsed
1612   * means that no characters are selected, but there is a caret present. If there
1613   * is no selection, `undefined` will be returned. This is similar to
1614   * `window.getSelection().isCollapsed()`.
1615   *
1616   * @param {Object} value The rich text value to check.
1617   *
1618   * @return {boolean|undefined} True if the selection is collapsed, false if not,
1619   *                             undefined if there is no selection.
1620   */
1621  function isCollapsed(_ref) {
1622    var start = _ref.start,
1623        end = _ref.end;
1624  
1625    if (start === undefined || end === undefined) {
1626      return;
1627    }
1628  
1629    return start === end;
1630  }
1631  
1632  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-empty.js
1633  /**
1634   * Internal dependencies
1635   */
1636  
1637  /**
1638   * Check if a Rich Text value is Empty, meaning it contains no text or any
1639   * objects (such as images).
1640   *
1641   * @param {Object} value Value to use.
1642   *
1643   * @return {boolean} True if the value is empty, false if not.
1644   */
1645  
1646  function isEmpty(_ref) {
1647    var text = _ref.text;
1648    return text.length === 0;
1649  }
1650  /**
1651   * Check if the current collapsed selection is on an empty line in case of a
1652   * multiline value.
1653   *
1654   * @param  {Object} value Value te check.
1655   *
1656   * @return {boolean} True if the line is empty, false if not.
1657   */
1658  
1659  function isEmptyLine(_ref2) {
1660    var text = _ref2.text,
1661        start = _ref2.start,
1662        end = _ref2.end;
1663  
1664    if (start !== end) {
1665      return false;
1666    }
1667  
1668    if (text.length === 0) {
1669      return true;
1670    }
1671  
1672    if (start === 0 && text.slice(0, 1) === LINE_SEPARATOR) {
1673      return true;
1674    }
1675  
1676    if (start === text.length && text.slice(-1) === LINE_SEPARATOR) {
1677      return true;
1678    }
1679  
1680    return text.slice(start - 1, end + 1) === "".concat(LINE_SEPARATOR).concat(LINE_SEPARATOR);
1681  }
1682  
1683  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/join.js
1684  /**
1685   * Internal dependencies
1686   */
1687  
1688  
1689  /**
1690   * Combine an array of Rich Text values into one, optionally separated by
1691   * `separator`, which can be a Rich Text value, HTML string, or plain text
1692   * string. This is similar to `Array.prototype.join`.
1693   *
1694   * @param {Array<Object>} values      An array of values to join.
1695   * @param {string|Object} [separator] Separator string or value.
1696   *
1697   * @return {Object} A new combined value.
1698   */
1699  
1700  function join(values) {
1701    var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1702  
1703    if (typeof separator === 'string') {
1704      separator = create({
1705        text: separator
1706      });
1707    }
1708  
1709    return normaliseFormats(values.reduce(function (accumlator, _ref) {
1710      var formats = _ref.formats,
1711          replacements = _ref.replacements,
1712          text = _ref.text;
1713      return {
1714        formats: accumlator.formats.concat(separator.formats, formats),
1715        replacements: accumlator.replacements.concat(separator.replacements, replacements),
1716        text: accumlator.text + separator.text + text
1717      };
1718    }));
1719  }
1720  
1721  // EXTERNAL MODULE: external {"this":["wp","element"]}
1722  var external_this_wp_element_ = __webpack_require__(0);
1723  
1724  // EXTERNAL MODULE: external {"this":["wp","hooks"]}
1725  var external_this_wp_hooks_ = __webpack_require__(27);
1726  
1727  // EXTERNAL MODULE: external {"this":["wp","compose"]}
1728  var external_this_wp_compose_ = __webpack_require__(8);
1729  
1730  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/register-format-type.js
1731  
1732  
1733  
1734  /**
1735   * External dependencies
1736   */
1737  
1738  /**
1739   * WordPress dependencies
1740   */
1741  
1742  
1743  
1744  
1745  /**
1746   * Registers a new format provided a unique name and an object defining its
1747   * behavior.
1748   *
1749   * @param {string}   name                 Format name.
1750   * @param {Object}   settings             Format settings.
1751   * @param {string}   settings.tagName     The HTML tag this format will wrap the selection with.
1752   * @param {string}   [settings.className] A class to match the format.
1753   * @param {string}   settings.title       Name of the format.
1754   * @param {Function} settings.edit        Should return a component for the user to interact with the new registered format.
1755   *
1756   * @return {WPFormat|undefined} The format, if it has been successfully registered;
1757   *                              otherwise `undefined`.
1758   */
1759  
1760  function registerFormatType(name, settings) {
1761    settings = Object(objectSpread["a" /* default */])({
1762      name: name
1763    }, settings);
1764  
1765    if (typeof settings.name !== 'string') {
1766      window.console.error('Format names must be strings.');
1767      return;
1768    }
1769  
1770    if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(settings.name)) {
1771      window.console.error('Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format');
1772      return;
1773    }
1774  
1775    if (Object(external_this_wp_data_["select"])('core/rich-text').getFormatType(settings.name)) {
1776      window.console.error('Format "' + settings.name + '" is already registered.');
1777      return;
1778    }
1779  
1780    if (typeof settings.tagName !== 'string' || settings.tagName === '') {
1781      window.console.error('Format tag names must be a string.');
1782      return;
1783    }
1784  
1785    if ((typeof settings.className !== 'string' || settings.className === '') && settings.className !== null) {
1786      window.console.error('Format class names must be a string, or null to handle bare elements.');
1787      return;
1788    }
1789  
1790    if (!/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(settings.className)) {
1791      window.console.error('A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.');
1792      return;
1793    }
1794  
1795    if (settings.className === null) {
1796      var formatTypeForBareElement = Object(external_this_wp_data_["select"])('core/rich-text').getFormatTypeForBareElement(settings.tagName);
1797  
1798      if (formatTypeForBareElement) {
1799        window.console.error("Format \"".concat(formatTypeForBareElement.name, "\" is already registered to handle bare tag name \"").concat(settings.tagName, "\"."));
1800        return;
1801      }
1802    } else {
1803      var formatTypeForClassName = Object(external_this_wp_data_["select"])('core/rich-text').getFormatTypeForClassName(settings.className);
1804  
1805      if (formatTypeForClassName) {
1806        window.console.error("Format \"".concat(formatTypeForClassName.name, "\" is already registered to handle class name \"").concat(settings.className, "\"."));
1807        return;
1808      }
1809    }
1810  
1811    if (!('title' in settings) || settings.title === '') {
1812      window.console.error('The format "' + settings.name + '" must have a title.');
1813      return;
1814    }
1815  
1816    if ('keywords' in settings && settings.keywords.length > 3) {
1817      window.console.error('The format "' + settings.name + '" can have a maximum of 3 keywords.');
1818      return;
1819    }
1820  
1821    if (typeof settings.title !== 'string') {
1822      window.console.error('Format titles must be strings.');
1823      return;
1824    }
1825  
1826    Object(external_this_wp_data_["dispatch"])('core/rich-text').addFormatTypes(settings);
1827  
1828    if (settings.__experimentalCreatePrepareEditableTree) {
1829      Object(external_this_wp_hooks_["addFilter"])('experimentalRichText', name, function (OriginalComponent) {
1830        var selectPrefix = "format_prepare_props_(".concat(name, ")_");
1831        var dispatchPrefix = "format_on_change_props_(".concat(name, ")_");
1832  
1833        var Component = function Component(props) {
1834          var newProps = Object(objectSpread["a" /* default */])({}, props);
1835  
1836          var propsByPrefix = Object.keys(props).reduce(function (accumulator, key) {
1837            if (key.startsWith(selectPrefix)) {
1838              accumulator[key.slice(selectPrefix.length)] = props[key];
1839            }
1840  
1841            if (key.startsWith(dispatchPrefix)) {
1842              accumulator[key.slice(dispatchPrefix.length)] = props[key];
1843            }
1844  
1845            return accumulator;
1846          }, {});
1847          var args = {
1848            richTextIdentifier: props.identifier,
1849            blockClientId: props.clientId
1850          };
1851  
1852          if (settings.__experimentalCreateOnChangeEditableValue) {
1853            newProps["format_value_functions_(".concat(name, ")")] = settings.__experimentalCreatePrepareEditableTree(propsByPrefix, args);
1854            newProps["format_on_change_functions_(".concat(name, ")")] = settings.__experimentalCreateOnChangeEditableValue(propsByPrefix, args);
1855          } else {
1856            newProps["format_prepare_functions_(".concat(name, ")")] = settings.__experimentalCreatePrepareEditableTree(propsByPrefix, args);
1857          }
1858  
1859          return Object(external_this_wp_element_["createElement"])(OriginalComponent, newProps);
1860        };
1861  
1862        var hocs = [];
1863  
1864        if (settings.__experimentalGetPropsForEditableTreePreparation) {
1865          hocs.push(Object(external_this_wp_data_["withSelect"])(function (sel, _ref) {
1866            var clientId = _ref.clientId,
1867                identifier = _ref.identifier;
1868            return Object(external_lodash_["mapKeys"])(settings.__experimentalGetPropsForEditableTreePreparation(sel, {
1869              richTextIdentifier: identifier,
1870              blockClientId: clientId
1871            }), function (value, key) {
1872              return selectPrefix + key;
1873            });
1874          }));
1875        }
1876  
1877        if (settings.__experimentalGetPropsForEditableTreeChangeHandler) {
1878          hocs.push(Object(external_this_wp_data_["withDispatch"])(function (disp, _ref2) {
1879            var clientId = _ref2.clientId,
1880                identifier = _ref2.identifier;
1881            return Object(external_lodash_["mapKeys"])(settings.__experimentalGetPropsForEditableTreeChangeHandler(disp, {
1882              richTextIdentifier: identifier,
1883              blockClientId: clientId
1884            }), function (value, key) {
1885              return dispatchPrefix + key;
1886            });
1887          }));
1888        }
1889  
1890        return hocs.length ? Object(external_this_wp_compose_["compose"])(hocs)(Component) : Component;
1891      });
1892    }
1893  
1894    return settings;
1895  }
1896  
1897  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/remove-format.js
1898  
1899  
1900  /**
1901   * External dependencies
1902   */
1903  
1904  /**
1905   * Internal dependencies
1906   */
1907  
1908  
1909  /**
1910   * Remove any format object from a Rich Text value by type from the given
1911   * `startIndex` to the given `endIndex`. Indices are retrieved from the
1912   * selection if none are provided.
1913   *
1914   * @param {Object} value        Value to modify.
1915   * @param {string} formatType   Format type to remove.
1916   * @param {number} [startIndex] Start index.
1917   * @param {number} [endIndex]   End index.
1918   *
1919   * @return {Object} A new value with the format applied.
1920   */
1921  
1922  function removeFormat(value, formatType) {
1923    var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
1924    var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
1925    var formats = value.formats,
1926        activeFormats = value.activeFormats;
1927    var newFormats = formats.slice(); // If the selection is collapsed, expand start and end to the edges of the
1928    // format.
1929  
1930    if (startIndex === endIndex) {
1931      var format = Object(external_lodash_["find"])(newFormats[startIndex], {
1932        type: formatType
1933      });
1934  
1935      if (format) {
1936        while (Object(external_lodash_["find"])(newFormats[startIndex], format)) {
1937          filterFormats(newFormats, startIndex, formatType);
1938          startIndex--;
1939        }
1940  
1941        endIndex++;
1942  
1943        while (Object(external_lodash_["find"])(newFormats[endIndex], format)) {
1944          filterFormats(newFormats, endIndex, formatType);
1945          endIndex++;
1946        }
1947      }
1948    } else {
1949      for (var i = startIndex; i < endIndex; i++) {
1950        if (newFormats[i]) {
1951          filterFormats(newFormats, i, formatType);
1952        }
1953      }
1954    }
1955  
1956    return normaliseFormats(Object(objectSpread["a" /* default */])({}, value, {
1957      formats: newFormats,
1958      activeFormats: Object(external_lodash_["reject"])(activeFormats, {
1959        type: formatType
1960      })
1961    }));
1962  }
1963  
1964  function filterFormats(formats, index, formatType) {
1965    var newFormats = formats[index].filter(function (_ref) {
1966      var type = _ref.type;
1967      return type !== formatType;
1968    });
1969  
1970    if (newFormats.length) {
1971      formats[index] = newFormats;
1972    } else {
1973      delete formats[index];
1974    }
1975  }
1976  
1977  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/insert.js
1978  /**
1979   * Internal dependencies
1980   */
1981  
1982  
1983  /**
1984   * Insert a Rich Text value, an HTML string, or a plain text string, into a
1985   * Rich Text value at the given `startIndex`. Any content between `startIndex`
1986   * and `endIndex` will be removed. Indices are retrieved from the selection if
1987   * none are provided.
1988   *
1989   * @param {Object}        value         Value to modify.
1990   * @param {Object|string} valueToInsert Value to insert.
1991   * @param {number}        [startIndex]  Start index.
1992   * @param {number}        [endIndex]    End index.
1993   *
1994   * @return {Object} A new value with the value inserted.
1995   */
1996  
1997  function insert(value, valueToInsert) {
1998    var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
1999    var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
2000    var formats = value.formats,
2001        replacements = value.replacements,
2002        text = value.text;
2003  
2004    if (typeof valueToInsert === 'string') {
2005      valueToInsert = create({
2006        text: valueToInsert
2007      });
2008    }
2009  
2010    var index = startIndex + valueToInsert.text.length;
2011    return normaliseFormats({
2012      formats: formats.slice(0, startIndex).concat(valueToInsert.formats, formats.slice(endIndex)),
2013      replacements: replacements.slice(0, startIndex).concat(valueToInsert.replacements, replacements.slice(endIndex)),
2014      text: text.slice(0, startIndex) + valueToInsert.text + text.slice(endIndex),
2015      start: index,
2016      end: index
2017    });
2018  }
2019  
2020  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/remove.js
2021  /**
2022   * Internal dependencies
2023   */
2024  
2025  
2026  /**
2027   * Remove content from a Rich Text value between the given `startIndex` and
2028   * `endIndex`. Indices are retrieved from the selection if none are provided.
2029   *
2030   * @param {Object} value        Value to modify.
2031   * @param {number} [startIndex] Start index.
2032   * @param {number} [endIndex]   End index.
2033   *
2034   * @return {Object} A new value with the content removed.
2035   */
2036  
2037  function remove_remove(value, startIndex, endIndex) {
2038    return insert(value, create(), startIndex, endIndex);
2039  }
2040  
2041  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/replace.js
2042  
2043  
2044  /**
2045   * Internal dependencies
2046   */
2047  
2048  /**
2049   * Search a Rich Text value and replace the match(es) with `replacement`. This
2050   * is similar to `String.prototype.replace`.
2051   *
2052   * @param {Object}         value        The value to modify.
2053   * @param {RegExp|string}  pattern      A RegExp object or literal. Can also be
2054   *                                      a string. It is treated as a verbatim
2055   *                                      string and is not interpreted as a
2056   *                                      regular expression. Only the first
2057   *                                      occurrence will be replaced.
2058   * @param {Function|string} replacement The match or matches are replaced with
2059   *                                      the specified or the value returned by
2060   *                                      the specified function.
2061   *
2062   * @return {Object} A new value with replacements applied.
2063   */
2064  
2065  function replace_replace(_ref, pattern, replacement) {
2066    var formats = _ref.formats,
2067        replacements = _ref.replacements,
2068        text = _ref.text,
2069        start = _ref.start,
2070        end = _ref.end;
2071    text = text.replace(pattern, function (match) {
2072      for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2073        rest[_key - 1] = arguments[_key];
2074      }
2075  
2076      var offset = rest[rest.length - 2];
2077      var newText = replacement;
2078      var newFormats;
2079      var newReplacements;
2080  
2081      if (typeof newText === 'function') {
2082        newText = replacement.apply(void 0, [match].concat(rest));
2083      }
2084  
2085      if (Object(esm_typeof["a" /* default */])(newText) === 'object') {
2086        newFormats = newText.formats;
2087        newReplacements = newText.replacements;
2088        newText = newText.text;
2089      } else {
2090        newFormats = Array(newText.length);
2091        newReplacements = Array(newText.length);
2092  
2093        if (formats[offset]) {
2094          newFormats = newFormats.fill(formats[offset]);
2095        }
2096      }
2097  
2098      formats = formats.slice(0, offset).concat(newFormats, formats.slice(offset + match.length));
2099      replacements = replacements.slice(0, offset).concat(newReplacements, replacements.slice(offset + match.length));
2100  
2101      if (start) {
2102        start = end = offset + newText.length;
2103      }
2104  
2105      return newText;
2106    });
2107    return normaliseFormats({
2108      formats: formats,
2109      replacements: replacements,
2110      text: text,
2111      start: start,
2112      end: end
2113    });
2114  }
2115  
2116  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/insert-line-separator.js
2117  /**
2118   * Internal dependencies
2119   */
2120  
2121  
2122  
2123  /**
2124   * Insert a line break character into a Rich Text value at the given
2125   * `startIndex`. Any content between `startIndex` and `endIndex` will be
2126   * removed. Indices are retrieved from the selection if none are provided.
2127   *
2128   * @param {Object} value        Value to modify.
2129   * @param {number} [startIndex] Start index.
2130   * @param {number} [endIndex]   End index.
2131   *
2132   * @return {Object} A new value with the value inserted.
2133   */
2134  
2135  function insertLineSeparator(value) {
2136    var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : value.start;
2137    var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.end;
2138    var beforeText = getTextContent(value).slice(0, startIndex);
2139    var previousLineSeparatorIndex = beforeText.lastIndexOf(LINE_SEPARATOR);
2140    var previousLineSeparatorFormats = value.replacements[previousLineSeparatorIndex];
2141    var replacements = [,];
2142  
2143    if (previousLineSeparatorFormats) {
2144      replacements = [previousLineSeparatorFormats];
2145    }
2146  
2147    var valueToInsert = {
2148      formats: [,],
2149      replacements: replacements,
2150      text: LINE_SEPARATOR
2151    };
2152    return insert(value, valueToInsert, startIndex, endIndex);
2153  }
2154  
2155  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/remove-line-separator.js
2156  
2157  
2158  /**
2159   * Internal dependencies
2160   */
2161  
2162  
2163  
2164  /**
2165   * Removes a line separator character, if existing, from a Rich Text value at the current
2166   * indices. If no line separator exists on the indices it will return undefined.
2167   *
2168   * @param {Object} value Value to modify.
2169   * @param {boolean} backward indicates if are removing from the start index or the end index.
2170   *
2171   * @return {Object|undefined} A new value with the line separator removed. Or undefined if no line separator is found on the position.
2172   */
2173  
2174  function removeLineSeparator(value) {
2175    var backward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2176    var replacements = value.replacements,
2177        text = value.text,
2178        start = value.start,
2179        end = value.end;
2180    var collapsed = isCollapsed(value);
2181    var index = start - 1;
2182    var removeStart = collapsed ? start - 1 : start;
2183    var removeEnd = end;
2184  
2185    if (!backward) {
2186      index = end;
2187      removeStart = start;
2188      removeEnd = collapsed ? end + 1 : end;
2189    }
2190  
2191    if (text[index] !== LINE_SEPARATOR) {
2192      return;
2193    }
2194  
2195    var newValue; // If the line separator that is about te be removed
2196    // contains wrappers, remove the wrappers first.
2197  
2198    if (collapsed && replacements[index] && replacements[index].length) {
2199      var newReplacements = replacements.slice();
2200      newReplacements[index] = replacements[index].slice(0, -1);
2201      newValue = Object(objectSpread["a" /* default */])({}, value, {
2202        replacements: newReplacements
2203      });
2204    } else {
2205      newValue = remove_remove(value, removeStart, removeEnd);
2206    }
2207  
2208    return newValue;
2209  }
2210  
2211  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/insert-object.js
2212  /**
2213   * Internal dependencies
2214   */
2215  
2216  var insert_object_OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
2217  /**
2218   * Insert a format as an object into a Rich Text value at the given
2219   * `startIndex`. Any content between `startIndex` and `endIndex` will be
2220   * removed. Indices are retrieved from the selection if none are provided.
2221   *
2222   * @param {Object} value          Value to modify.
2223   * @param {Object} formatToInsert Format to insert as object.
2224   * @param {number} [startIndex]   Start index.
2225   * @param {number} [endIndex]     End index.
2226   *
2227   * @return {Object} A new value with the object inserted.
2228   */
2229  
2230  function insertObject(value, formatToInsert, startIndex, endIndex) {
2231    var valueToInsert = {
2232      formats: [,],
2233      replacements: [formatToInsert],
2234      text: insert_object_OBJECT_REPLACEMENT_CHARACTER
2235    };
2236    return insert(value, valueToInsert, startIndex, endIndex);
2237  }
2238  
2239  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/slice.js
2240  
2241  
2242  /**
2243   * Slice a Rich Text value from `startIndex` to `endIndex`. Indices are
2244   * retrieved from the selection if none are provided. This is similar to
2245   * `String.prototype.slice`.
2246   *
2247   * @param {Object} value        Value to modify.
2248   * @param {number} [startIndex] Start index.
2249   * @param {number} [endIndex]   End index.
2250   *
2251   * @return {Object} A new extracted value.
2252   */
2253  function slice(value) {
2254    var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : value.start;
2255    var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.end;
2256    var formats = value.formats,
2257        replacements = value.replacements,
2258        text = value.text;
2259  
2260    if (startIndex === undefined || endIndex === undefined) {
2261      return Object(objectSpread["a" /* default */])({}, value);
2262    }
2263  
2264    return {
2265      formats: formats.slice(startIndex, endIndex),
2266      replacements: replacements.slice(startIndex, endIndex),
2267      text: text.slice(startIndex, endIndex)
2268    };
2269  }
2270  
2271  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/split.js
2272  /**
2273   * Internal dependencies
2274   */
2275  
2276  /**
2277   * Split a Rich Text value in two at the given `startIndex` and `endIndex`, or
2278   * split at the given separator. This is similar to `String.prototype.split`.
2279   * Indices are retrieved from the selection if none are provided.
2280   *
2281   * @param {Object}        value
2282   * @param {Object[]}      value.formats
2283   * @param {Object[]}      value.replacements
2284   * @param {string}        value.text
2285   * @param {number}        value.start
2286   * @param {number}        value.end
2287   * @param {number|string} [string] Start index, or string at which to split.
2288   *
2289   * @return {Array} An array of new values.
2290   */
2291  
2292  function split(_ref, string) {
2293    var formats = _ref.formats,
2294        replacements = _ref.replacements,
2295        text = _ref.text,
2296        start = _ref.start,
2297        end = _ref.end;
2298  
2299    if (typeof string !== 'string') {
2300      return splitAtSelection.apply(void 0, arguments);
2301    }
2302  
2303    var nextStart = 0;
2304    return text.split(string).map(function (substring) {
2305      var startIndex = nextStart;
2306      var value = {
2307        formats: formats.slice(startIndex, startIndex + substring.length),
2308        replacements: replacements.slice(startIndex, startIndex + substring.length),
2309        text: substring
2310      };
2311      nextStart += string.length + substring.length;
2312  
2313      if (start !== undefined && end !== undefined) {
2314        if (start >= startIndex && start < nextStart) {
2315          value.start = start - startIndex;
2316        } else if (start < startIndex && end > startIndex) {
2317          value.start = 0;
2318        }
2319  
2320        if (end >= startIndex && end < nextStart) {
2321          value.end = end - startIndex;
2322        } else if (start < nextStart && end > nextStart) {
2323          value.end = substring.length;
2324        }
2325      }
2326  
2327      return value;
2328    });
2329  }
2330  
2331  function splitAtSelection(_ref2) {
2332    var formats = _ref2.formats,
2333        replacements = _ref2.replacements,
2334        text = _ref2.text,
2335        start = _ref2.start,
2336        end = _ref2.end;
2337    var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
2338    var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : end;
2339    var before = {
2340      formats: formats.slice(0, startIndex),
2341      replacements: replacements.slice(0, startIndex),
2342      text: text.slice(0, startIndex)
2343    };
2344    var after = {
2345      formats: formats.slice(endIndex),
2346      replacements: replacements.slice(endIndex),
2347      text: text.slice(endIndex),
2348      start: 0,
2349      end: 0
2350    };
2351    return [// Ensure newlines are trimmed.
2352    replace_replace(before, /\u2028+$/, ''), replace_replace(after, /^\u2028+/, '')];
2353  }
2354  
2355  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-format-type.js
2356  /**
2357   * WordPress dependencies
2358   */
2359  
2360  /**
2361   * Returns a registered format type.
2362   *
2363   * @param {string} name Format name.
2364   *
2365   * @return {?Object} Format type.
2366   */
2367  
2368  function get_format_type_getFormatType(name) {
2369    return Object(external_this_wp_data_["select"])('core/rich-text').getFormatType(name);
2370  }
2371  
2372  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/to-tree.js
2373  
2374  
2375  
2376  /**
2377   * Internal dependencies
2378   */
2379  
2380  
2381  
2382  /**
2383   * Converts a format object to information that can be used to create an element
2384   * from (type, attributes and object).
2385   *
2386   * @param  {Object}  $1                        Named parameters.
2387   * @param  {string}  $1.type                   The format type.
2388   * @param  {Object}  $1.attributes             The format attributes.
2389   * @param  {Object}  $1.unregisteredAttributes The unregistered format
2390   *                                             attributes.
2391   * @param  {boolean} $1.object                 Wether or not it is an object
2392   *                                             format.
2393   * @param  {boolean} $1.boundaryClass          Wether or not to apply a boundary
2394   *                                             class.
2395   * @return {Object}                            Information to be used for
2396   *                                             element creation.
2397   */
2398  
2399  function fromFormat(_ref) {
2400    var type = _ref.type,
2401        attributes = _ref.attributes,
2402        unregisteredAttributes = _ref.unregisteredAttributes,
2403        object = _ref.object,
2404        boundaryClass = _ref.boundaryClass;
2405    var formatType = get_format_type_getFormatType(type);
2406    var elementAttributes = {};
2407  
2408    if (boundaryClass) {
2409      elementAttributes['data-rich-text-format-boundary'] = 'true';
2410    }
2411  
2412    if (!formatType) {
2413      if (attributes) {
2414        elementAttributes = Object(objectSpread["a" /* default */])({}, attributes, elementAttributes);
2415      }
2416  
2417      return {
2418        type: type,
2419        attributes: elementAttributes,
2420        object: object
2421      };
2422    }
2423  
2424    elementAttributes = Object(objectSpread["a" /* default */])({}, unregisteredAttributes, elementAttributes);
2425  
2426    for (var name in attributes) {
2427      var key = formatType.attributes ? formatType.attributes[name] : false;
2428  
2429      if (key) {
2430        elementAttributes[key] = attributes[name];
2431      } else {
2432        elementAttributes[name] = attributes[name];
2433      }
2434    }
2435  
2436    if (formatType.className) {
2437      if (elementAttributes.class) {
2438        elementAttributes.class = "".concat(formatType.className, " ").concat(elementAttributes.class);
2439      } else {
2440        elementAttributes.class = formatType.className;
2441      }
2442    }
2443  
2444    return {
2445      type: formatType.tagName,
2446      object: formatType.object,
2447      attributes: elementAttributes
2448    };
2449  }
2450  
2451  function toTree(_ref2) {
2452    var value = _ref2.value,
2453        multilineTag = _ref2.multilineTag,
2454        createEmpty = _ref2.createEmpty,
2455        append = _ref2.append,
2456        getLastChild = _ref2.getLastChild,
2457        getParent = _ref2.getParent,
2458        isText = _ref2.isText,
2459        getText = _ref2.getText,
2460        remove = _ref2.remove,
2461        appendText = _ref2.appendText,
2462        onStartIndex = _ref2.onStartIndex,
2463        onEndIndex = _ref2.onEndIndex,
2464        isEditableTree = _ref2.isEditableTree,
2465        placeholder = _ref2.placeholder;
2466    var formats = value.formats,
2467        replacements = value.replacements,
2468        text = value.text,
2469        start = value.start,
2470        end = value.end;
2471    var formatsLength = formats.length + 1;
2472    var tree = createEmpty();
2473    var multilineFormat = {
2474      type: multilineTag
2475    };
2476    var activeFormats = getActiveFormats(value);
2477    var deepestActiveFormat = activeFormats[activeFormats.length - 1];
2478    var lastSeparatorFormats;
2479    var lastCharacterFormats;
2480    var lastCharacter; // If we're building a multiline tree, start off with a multiline element.
2481  
2482    if (multilineTag) {
2483      append(append(tree, {
2484        type: multilineTag
2485      }), '');
2486      lastCharacterFormats = lastSeparatorFormats = [multilineFormat];
2487    } else {
2488      append(tree, '');
2489    }
2490  
2491    var _loop = function _loop(i) {
2492      var character = text.charAt(i);
2493      var shouldInsertPadding = isEditableTree && ( // Pad the line if the line is empty.
2494      !lastCharacter || lastCharacter === LINE_SEPARATOR || // Pad the line if the previous character is a line break, otherwise
2495      // the line break won't be visible.
2496      lastCharacter === '\n');
2497      var characterFormats = formats[i]; // Set multiline tags in queue for building the tree.
2498  
2499      if (multilineTag) {
2500        if (character === LINE_SEPARATOR) {
2501          characterFormats = lastSeparatorFormats = (replacements[i] || []).reduce(function (accumulator, format) {
2502            accumulator.push(format, multilineFormat);
2503            return accumulator;
2504          }, [multilineFormat]);
2505        } else {
2506          characterFormats = [].concat(Object(toConsumableArray["a" /* default */])(lastSeparatorFormats), Object(toConsumableArray["a" /* default */])(characterFormats || []));
2507        }
2508      }
2509  
2510      var pointer = getLastChild(tree);
2511  
2512      if (shouldInsertPadding && character === LINE_SEPARATOR) {
2513        var node = pointer;
2514  
2515        while (!isText(node)) {
2516          node = getLastChild(node);
2517        }
2518  
2519        append(getParent(node), ZWNBSP);
2520      } // Set selection for the start of line.
2521  
2522  
2523      if (lastCharacter === LINE_SEPARATOR) {
2524        var _node = pointer;
2525  
2526        while (!isText(_node)) {
2527          _node = getLastChild(_node);
2528        }
2529  
2530        if (onStartIndex && start === i) {
2531          onStartIndex(tree, _node);
2532        }
2533  
2534        if (onEndIndex && end === i) {
2535          onEndIndex(tree, _node);
2536        }
2537      }
2538  
2539      if (characterFormats) {
2540        characterFormats.forEach(function (format, formatIndex) {
2541          if (pointer && lastCharacterFormats && format === lastCharacterFormats[formatIndex] && ( // Do not reuse the last element if the character is a
2542          // line separator.
2543          character !== LINE_SEPARATOR || characterFormats.length - 1 !== formatIndex)) {
2544            pointer = getLastChild(pointer);
2545            return;
2546          }
2547  
2548          var type = format.type,
2549              attributes = format.attributes,
2550              unregisteredAttributes = format.unregisteredAttributes;
2551          var boundaryClass = isEditableTree && character !== LINE_SEPARATOR && format === deepestActiveFormat;
2552          var parent = getParent(pointer);
2553          var newNode = append(parent, fromFormat({
2554            type: type,
2555            attributes: attributes,
2556            unregisteredAttributes: unregisteredAttributes,
2557            boundaryClass: boundaryClass
2558          }));
2559  
2560          if (isText(pointer) && getText(pointer).length === 0) {
2561            remove(pointer);
2562          }
2563  
2564          pointer = append(newNode, '');
2565        });
2566      } // No need for further processing if the character is a line separator.
2567  
2568  
2569      if (character === LINE_SEPARATOR) {
2570        lastCharacterFormats = characterFormats;
2571        lastCharacter = character;
2572        return "continue";
2573      } // If there is selection at 0, handle it before characters are inserted.
2574  
2575  
2576      if (i === 0) {
2577        if (onStartIndex && start === 0) {
2578          onStartIndex(tree, pointer);
2579        }
2580  
2581        if (onEndIndex && end === 0) {
2582          onEndIndex(tree, pointer);
2583        }
2584      }
2585  
2586      if (character === OBJECT_REPLACEMENT_CHARACTER) {
2587        pointer = append(getParent(pointer), fromFormat(Object(objectSpread["a" /* default */])({}, replacements[i], {
2588          object: true
2589        }))); // Ensure pointer is text node.
2590  
2591        pointer = append(getParent(pointer), '');
2592      } else if (character === '\n') {
2593        pointer = append(getParent(pointer), {
2594          type: 'br',
2595          attributes: isEditableTree ? {
2596            'data-rich-text-line-break': 'true'
2597          } : undefined,
2598          object: true
2599        }); // Ensure pointer is text node.
2600  
2601        pointer = append(getParent(pointer), '');
2602      } else if (!isText(pointer)) {
2603        pointer = append(getParent(pointer), character);
2604      } else {
2605        appendText(pointer, character);
2606      }
2607  
2608      if (onStartIndex && start === i + 1) {
2609        onStartIndex(tree, pointer);
2610      }
2611  
2612      if (onEndIndex && end === i + 1) {
2613        onEndIndex(tree, pointer);
2614      }
2615  
2616      if (shouldInsertPadding && i === text.length) {
2617        append(getParent(pointer), ZWNBSP);
2618  
2619        if (placeholder && text.length === 0) {
2620          append(getParent(pointer), {
2621            type: 'span',
2622            attributes: {
2623              'data-rich-text-placeholder': placeholder,
2624              // Necessary to prevent the placeholder from catching
2625              // selection. The placeholder is also not editable after
2626              // all.
2627              contenteditable: 'false'
2628            }
2629          });
2630        }
2631      }
2632  
2633      lastCharacterFormats = characterFormats;
2634      lastCharacter = character;
2635    };
2636  
2637    for (var i = 0; i < formatsLength; i++) {
2638      var _ret = _loop(i);
2639  
2640      if (_ret === "continue") continue;
2641    }
2642  
2643    return tree;
2644  }
2645  
2646  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/to-dom.js
2647  
2648  
2649  
2650  /**
2651   * Internal dependencies
2652   */
2653  
2654  
2655  /**
2656   * Browser dependencies
2657   */
2658  
2659  var to_dom_TEXT_NODE = window.Node.TEXT_NODE;
2660  /**
2661   * Creates a path as an array of indices from the given root node to the given
2662   * node.
2663   *
2664   * @param {Node}        node     Node to find the path of.
2665   * @param {HTMLElement} rootNode Root node to find the path from.
2666   * @param {Array}       path     Initial path to build on.
2667   *
2668   * @return {Array} The path from the root node to the node.
2669   */
2670  
2671  function createPathToNode(node, rootNode, path) {
2672    var parentNode = node.parentNode;
2673    var i = 0;
2674  
2675    while (node = node.previousSibling) {
2676      i++;
2677    }
2678  
2679    path = [i].concat(Object(toConsumableArray["a" /* default */])(path));
2680  
2681    if (parentNode !== rootNode) {
2682      path = createPathToNode(parentNode, rootNode, path);
2683    }
2684  
2685    return path;
2686  }
2687  /**
2688   * Gets a node given a path (array of indices) from the given node.
2689   *
2690   * @param {HTMLElement} node Root node to find the wanted node in.
2691   * @param {Array}       path Path (indices) to the wanted node.
2692   *
2693   * @return {Object} Object with the found node and the remaining offset (if any).
2694   */
2695  
2696  
2697  function getNodeByPath(node, path) {
2698    path = Object(toConsumableArray["a" /* default */])(path);
2699  
2700    while (node && path.length > 1) {
2701      node = node.childNodes[path.shift()];
2702    }
2703  
2704    return {
2705      node: node,
2706      offset: path[0]
2707    };
2708  }
2709  /**
2710   * Returns a new instance of a DOM tree upon which RichText operations can be
2711   * applied.
2712   *
2713   * Note: The current implementation will return a shared reference, reset on
2714   * each call to `createEmpty`. Therefore, you should not hold a reference to
2715   * the value to operate upon asynchronously, as it may have unexpected results.
2716   *
2717   * @return {WPRichTextTree} RichText tree.
2718   */
2719  
2720  
2721  var to_dom_createEmpty = function createEmpty() {
2722    return createElement(document, '');
2723  };
2724  
2725  function to_dom_append(element, child) {
2726    if (typeof child === 'string') {
2727      child = element.ownerDocument.createTextNode(child);
2728    }
2729  
2730    var _child = child,
2731        type = _child.type,
2732        attributes = _child.attributes;
2733  
2734    if (type) {
2735      child = element.ownerDocument.createElement(type);
2736  
2737      for (var key in attributes) {
2738        child.setAttribute(key, attributes[key]);
2739      }
2740    }
2741  
2742    return element.appendChild(child);
2743  }
2744  
2745  function to_dom_appendText(node, text) {
2746    node.appendData(text);
2747  }
2748  
2749  function to_dom_getLastChild(_ref) {
2750    var lastChild = _ref.lastChild;
2751    return lastChild;
2752  }
2753  
2754  function to_dom_getParent(_ref2) {
2755    var parentNode = _ref2.parentNode;
2756    return parentNode;
2757  }
2758  
2759  function to_dom_isText(_ref3) {
2760    var nodeType = _ref3.nodeType;
2761    return nodeType === to_dom_TEXT_NODE;
2762  }
2763  
2764  function to_dom_getText(_ref4) {
2765    var nodeValue = _ref4.nodeValue;
2766    return nodeValue;
2767  }
2768  
2769  function to_dom_remove(node) {
2770    return node.parentNode.removeChild(node);
2771  }
2772  
2773  function toDom(_ref5) {
2774    var value = _ref5.value,
2775        multilineTag = _ref5.multilineTag,
2776        prepareEditableTree = _ref5.prepareEditableTree,
2777        _ref5$isEditableTree = _ref5.isEditableTree,
2778        isEditableTree = _ref5$isEditableTree === void 0 ? true : _ref5$isEditableTree,
2779        placeholder = _ref5.placeholder;
2780    var startPath = [];
2781    var endPath = [];
2782  
2783    if (prepareEditableTree) {
2784      value = Object(objectSpread["a" /* default */])({}, value, {
2785        formats: prepareEditableTree(value)
2786      });
2787    }
2788  
2789    var tree = toTree({
2790      value: value,
2791      multilineTag: multilineTag,
2792      createEmpty: to_dom_createEmpty,
2793      append: to_dom_append,
2794      getLastChild: to_dom_getLastChild,
2795      getParent: to_dom_getParent,
2796      isText: to_dom_isText,
2797      getText: to_dom_getText,
2798      remove: to_dom_remove,
2799      appendText: to_dom_appendText,
2800      onStartIndex: function onStartIndex(body, pointer) {
2801        startPath = createPathToNode(pointer, body, [pointer.nodeValue.length]);
2802      },
2803      onEndIndex: function onEndIndex(body, pointer) {
2804        endPath = createPathToNode(pointer, body, [pointer.nodeValue.length]);
2805      },
2806      isEditableTree: isEditableTree,
2807      placeholder: placeholder
2808    });
2809    return {
2810      body: tree,
2811      selection: {
2812        startPath: startPath,
2813        endPath: endPath
2814      }
2815    };
2816  }
2817  /**
2818   * Create an `Element` tree from a Rich Text value and applies the difference to
2819   * the `Element` tree contained by `current`. If a `multilineTag` is provided,
2820   * text separated by two new lines will be wrapped in an `Element` of that type.
2821   *
2822   * @param {Object}      $1                        Named arguments.
2823   * @param {Object}      $1.value                  Value to apply.
2824   * @param {HTMLElement} $1.current                The live root node to apply the element tree to.
2825   * @param {string}      [$1.multilineTag]         Multiline tag.
2826   * @param {Array}       [$1.multilineWrapperTags] Tags where lines can be found if nesting is possible.
2827   */
2828  
2829  function apply(_ref6) {
2830    var value = _ref6.value,
2831        current = _ref6.current,
2832        multilineTag = _ref6.multilineTag,
2833        prepareEditableTree = _ref6.prepareEditableTree,
2834        __unstableDomOnly = _ref6.__unstableDomOnly,
2835        placeholder = _ref6.placeholder;
2836  
2837    // Construct a new element tree in memory.
2838    var _toDom = toDom({
2839      value: value,
2840      multilineTag: multilineTag,
2841      prepareEditableTree: prepareEditableTree,
2842      placeholder: placeholder
2843    }),
2844        body = _toDom.body,
2845        selection = _toDom.selection;
2846  
2847    applyValue(body, current);
2848  
2849    if (value.start !== undefined && !__unstableDomOnly) {
2850      applySelection(selection, current);
2851    }
2852  }
2853  function applyValue(future, current) {
2854    var i = 0;
2855    var futureChild;
2856  
2857    while (futureChild = future.firstChild) {
2858      var currentChild = current.childNodes[i];
2859  
2860      if (!currentChild) {
2861        current.appendChild(futureChild);
2862      } else if (!currentChild.isEqualNode(futureChild)) {
2863        if (currentChild.nodeName !== futureChild.nodeName || currentChild.nodeType === to_dom_TEXT_NODE && currentChild.data !== futureChild.data) {
2864          current.replaceChild(futureChild, currentChild);
2865        } else {
2866          var currentAttributes = currentChild.attributes;
2867          var futureAttributes = futureChild.attributes;
2868  
2869          if (currentAttributes) {
2870            var ii = currentAttributes.length; // Reverse loop because `removeAttribute` on `currentChild`
2871            // changes `currentAttributes`.
2872  
2873            while (ii--) {
2874              var name = currentAttributes[ii].name;
2875  
2876              if (!futureChild.getAttribute(name)) {
2877                currentChild.removeAttribute(name);
2878              }
2879            }
2880          }
2881  
2882          if (futureAttributes) {
2883            for (var _ii = 0; _ii < futureAttributes.length; _ii++) {
2884              var _futureAttributes$_ii = futureAttributes[_ii],
2885                  name = _futureAttributes$_ii.name,
2886                  value = _futureAttributes$_ii.value;
2887  
2888              if (currentChild.getAttribute(name) !== value) {
2889                currentChild.setAttribute(name, value);
2890              }
2891            }
2892          }
2893  
2894          applyValue(futureChild, currentChild);
2895          future.removeChild(futureChild);
2896        }
2897      } else {
2898        future.removeChild(futureChild);
2899      }
2900  
2901      i++;
2902    }
2903  
2904    while (current.childNodes[i]) {
2905      current.removeChild(current.childNodes[i]);
2906    }
2907  }
2908  /**
2909   * Returns true if two ranges are equal, or false otherwise. Ranges are
2910   * considered equal if their start and end occur in the same container and
2911   * offset.
2912   *
2913   * @param {Range} a First range object to test.
2914   * @param {Range} b First range object to test.
2915   *
2916   * @return {boolean} Whether the two ranges are equal.
2917   */
2918  
2919  function isRangeEqual(a, b) {
2920    return a.startContainer === b.startContainer && a.startOffset === b.startOffset && a.endContainer === b.endContainer && a.endOffset === b.endOffset;
2921  }
2922  
2923  function applySelection(_ref7, current) {
2924    var startPath = _ref7.startPath,
2925        endPath = _ref7.endPath;
2926  
2927    var _getNodeByPath = getNodeByPath(current, startPath),
2928        startContainer = _getNodeByPath.node,
2929        startOffset = _getNodeByPath.offset;
2930  
2931    var _getNodeByPath2 = getNodeByPath(current, endPath),
2932        endContainer = _getNodeByPath2.node,
2933        endOffset = _getNodeByPath2.offset;
2934  
2935    var selection = window.getSelection();
2936    var ownerDocument = current.ownerDocument;
2937    var range = ownerDocument.createRange();
2938    range.setStart(startContainer, startOffset);
2939    range.setEnd(endContainer, endOffset); // Set back focus if focus is lost.
2940  
2941    if (ownerDocument.activeElement !== current) {
2942      current.focus();
2943    }
2944  
2945    if (selection.rangeCount > 0) {
2946      // If the to be added range and the live range are the same, there's no
2947      // need to remove the live range and add the equivalent range.
2948      if (isRangeEqual(range, selection.getRangeAt(0))) {
2949        return;
2950      }
2951  
2952      selection.removeAllRanges();
2953    }
2954  
2955    selection.addRange(range);
2956  }
2957  
2958  // EXTERNAL MODULE: external {"this":["wp","escapeHtml"]}
2959  var external_this_wp_escapeHtml_ = __webpack_require__(71);
2960  
2961  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/to-html-string.js
2962  /**
2963   * WordPress dependencies
2964   */
2965  
2966  /**
2967   * Internal dependencies
2968   */
2969  
2970  
2971  /**
2972   * Create an HTML string from a Rich Text value. If a `multilineTag` is
2973   * provided, text separated by a line separator will be wrapped in it.
2974   *
2975   * @param {Object} $1                        Named argements.
2976   * @param {Object} $1.value                  Rich text value.
2977   * @param {string} [$1.multilineTag]         Multiline tag.
2978   *
2979   * @return {string} HTML string.
2980   */
2981  
2982  function toHTMLString(_ref) {
2983    var value = _ref.value,
2984        multilineTag = _ref.multilineTag;
2985    var tree = toTree({
2986      value: value,
2987      multilineTag: multilineTag,
2988      createEmpty: to_html_string_createEmpty,
2989      append: to_html_string_append,
2990      getLastChild: to_html_string_getLastChild,
2991      getParent: to_html_string_getParent,
2992      isText: to_html_string_isText,
2993      getText: to_html_string_getText,
2994      remove: to_html_string_remove,
2995      appendText: to_html_string_appendText
2996    });
2997    return createChildrenHTML(tree.children);
2998  }
2999  
3000  function to_html_string_createEmpty() {
3001    return {};
3002  }
3003  
3004  function to_html_string_getLastChild(_ref2) {
3005    var children = _ref2.children;
3006    return children && children[children.length - 1];
3007  }
3008  
3009  function to_html_string_append(parent, object) {
3010    if (typeof object === 'string') {
3011      object = {
3012        text: object
3013      };
3014    }
3015  
3016    object.parent = parent;
3017    parent.children = parent.children || [];
3018    parent.children.push(object);
3019    return object;
3020  }
3021  
3022  function to_html_string_appendText(object, text) {
3023    object.text += text;
3024  }
3025  
3026  function to_html_string_getParent(_ref3) {
3027    var parent = _ref3.parent;
3028    return parent;
3029  }
3030  
3031  function to_html_string_isText(_ref4) {
3032    var text = _ref4.text;
3033    return typeof text === 'string';
3034  }
3035  
3036  function to_html_string_getText(_ref5) {
3037    var text = _ref5.text;
3038    return text;
3039  }
3040  
3041  function to_html_string_remove(object) {
3042    var index = object.parent.children.indexOf(object);
3043  
3044    if (index !== -1) {
3045      object.parent.children.splice(index, 1);
3046    }
3047  
3048    return object;
3049  }
3050  
3051  function createElementHTML(_ref6) {
3052    var type = _ref6.type,
3053        attributes = _ref6.attributes,
3054        object = _ref6.object,
3055        children = _ref6.children;
3056    var attributeString = '';
3057  
3058    for (var key in attributes) {
3059      if (!Object(external_this_wp_escapeHtml_["isValidAttributeName"])(key)) {
3060        continue;
3061      }
3062  
3063      attributeString += " ".concat(key, "=\"").concat(Object(external_this_wp_escapeHtml_["escapeAttribute"])(attributes[key]), "\"");
3064    }
3065  
3066    if (object) {
3067      return "<".concat(type).concat(attributeString, ">");
3068    }
3069  
3070    return "<".concat(type).concat(attributeString, ">").concat(createChildrenHTML(children), "</").concat(type, ">");
3071  }
3072  
3073  function createChildrenHTML() {
3074    var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
3075    return children.map(function (child) {
3076      return child.text === undefined ? createElementHTML(child) : Object(external_this_wp_escapeHtml_["escapeHTML"])(child.text);
3077    }).join('');
3078  }
3079  
3080  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/toggle-format.js
3081  /**
3082   * Internal dependencies
3083   */
3084  
3085  
3086  
3087  /**
3088   * Toggles a format object to a Rich Text value at the current selection.
3089   *
3090   * @param {Object} value  Value to modify.
3091   * @param {Object} format Format to apply or remove.
3092   *
3093   * @return {Object} A new value with the format applied or removed.
3094   */
3095  
3096  function toggleFormat(value, format) {
3097    if (getActiveFormat(value, format.type)) {
3098      return removeFormat(value, format.type);
3099    }
3100  
3101    return applyFormat(value, format);
3102  }
3103  
3104  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/unregister-format-type.js
3105  /**
3106   * WordPress dependencies
3107   */
3108  
3109  
3110  /**
3111   * Unregisters a format.
3112   *
3113   * @param {string} name Format name.
3114   *
3115   * @return {WPFormat|undefined} The previous format value, if it has been successfully
3116   *                              unregistered; otherwise `undefined`.
3117   */
3118  
3119  function unregisterFormatType(name) {
3120    var oldFormat = Object(external_this_wp_data_["select"])('core/rich-text').getFormatType(name);
3121  
3122    if (!oldFormat) {
3123      window.console.error("Format ".concat(name, " is not registered."));
3124      return;
3125    }
3126  
3127    if (oldFormat.__experimentalCreatePrepareEditableTree) {
3128      Object(external_this_wp_hooks_["removeFilter"])('experimentalRichText', name);
3129    }
3130  
3131    Object(external_this_wp_data_["dispatch"])('core/rich-text').removeFormatTypes(name);
3132    return oldFormat;
3133  }
3134  
3135  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/indent-list-items.js
3136  
3137  
3138  /**
3139   * Internal dependencies
3140   */
3141  
3142  
3143  /**
3144   * Gets the line index of the first previous list item with higher indentation.
3145   *
3146   * @param {Object} value      Value to search.
3147   * @param {number} lineIndex  Line index of the list item to compare with.
3148   *
3149   * @return {boolean} The line index.
3150   */
3151  
3152  function getTargetLevelLineIndex(_ref, lineIndex) {
3153    var text = _ref.text,
3154        replacements = _ref.replacements;
3155    var startFormats = replacements[lineIndex] || [];
3156    var index = lineIndex;
3157  
3158    while (index-- >= 0) {
3159      if (text[index] !== LINE_SEPARATOR) {
3160        continue;
3161      }
3162  
3163      var formatsAtIndex = replacements[index] || []; // Return the first line index that is one level higher. If the level is
3164      // lower or equal, there is no result.
3165  
3166      if (formatsAtIndex.length === startFormats.length + 1) {
3167        return index;
3168      } else if (formatsAtIndex.length <= startFormats.length) {
3169        return;
3170      }
3171    }
3172  }
3173  /**
3174   * Indents any selected list items if possible.
3175   *
3176   * @param {Object} value      Value to change.
3177   * @param {Object} rootFormat Root format.
3178   *
3179   * @return {Object} The changed value.
3180   */
3181  
3182  
3183  function indentListItems(value, rootFormat) {
3184    var lineIndex = getLineIndex(value); // There is only one line, so the line cannot be indented.
3185  
3186    if (lineIndex === undefined) {
3187      return value;
3188    }
3189  
3190    var text = value.text,
3191        replacements = value.replacements,
3192        end = value.end;
3193    var previousLineIndex = getLineIndex(value, lineIndex);
3194    var formatsAtLineIndex = replacements[lineIndex] || [];
3195    var formatsAtPreviousLineIndex = replacements[previousLineIndex] || []; // The the indentation of the current line is greater than previous line,
3196    // then the line cannot be furter indented.
3197  
3198    if (formatsAtLineIndex.length > formatsAtPreviousLineIndex.length) {
3199      return value;
3200    }
3201  
3202    var newFormats = replacements.slice();
3203    var targetLevelLineIndex = getTargetLevelLineIndex(value, lineIndex);
3204  
3205    for (var index = lineIndex; index < end; index++) {
3206      if (text[index] !== LINE_SEPARATOR) {
3207        continue;
3208      } // Get the previous list, and if there's a child list, take over the
3209      // formats. If not, duplicate the last level and create a new level.
3210  
3211  
3212      if (targetLevelLineIndex) {
3213        var targetFormats = replacements[targetLevelLineIndex] || [];
3214        newFormats[index] = targetFormats.concat((newFormats[index] || []).slice(targetFormats.length - 1));
3215      } else {
3216        var _targetFormats = replacements[previousLineIndex] || [];
3217  
3218        var lastformat = _targetFormats[_targetFormats.length - 1] || rootFormat;
3219        newFormats[index] = _targetFormats.concat([lastformat], (newFormats[index] || []).slice(_targetFormats.length));
3220      }
3221    }
3222  
3223    return Object(objectSpread["a" /* default */])({}, value, {
3224      replacements: newFormats
3225    });
3226  }
3227  
3228  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-parent-line-index.js
3229  /**
3230   * Internal dependencies
3231   */
3232  
3233  /**
3234   * Gets the index of the first parent list. To get the parent list formats, we
3235   * go through every list item until we find one with exactly one format type
3236   * less.
3237   *
3238   * @param {Object} value     Value to search.
3239   * @param {number} lineIndex Line index of a child list item.
3240   *
3241   * @return {Array} The parent list line index.
3242   */
3243  
3244  function getParentLineIndex(_ref, lineIndex) {
3245    var text = _ref.text,
3246        replacements = _ref.replacements;
3247    var startFormats = replacements[lineIndex] || [];
3248    var index = lineIndex;
3249  
3250    while (index-- >= 0) {
3251      if (text[index] !== LINE_SEPARATOR) {
3252        continue;
3253      }
3254  
3255      var formatsAtIndex = replacements[index] || [];
3256  
3257      if (formatsAtIndex.length === startFormats.length - 1) {
3258        return index;
3259      }
3260    }
3261  }
3262  
3263  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-last-child-index.js
3264  /**
3265   * Internal dependencies
3266   */
3267  
3268  /**
3269   * Gets the line index of the last child in the list.
3270   *
3271   * @param {Object} value     Value to search.
3272   * @param {number} lineIndex Line index of a list item in the list.
3273   *
3274   * @return {Array} The index of the last child.
3275   */
3276  
3277  function getLastChildIndex(_ref, lineIndex) {
3278    var text = _ref.text,
3279        replacements = _ref.replacements;
3280    var lineFormats = replacements[lineIndex] || []; // Use the given line index in case there are no next children.
3281  
3282    var childIndex = lineIndex; // `lineIndex` could be `undefined` if it's the first line.
3283  
3284    for (var index = lineIndex || 0; index < text.length; index++) {
3285      // We're only interested in line indices.
3286      if (text[index] !== LINE_SEPARATOR) {
3287        continue;
3288      }
3289  
3290      var formatsAtIndex = replacements[index] || []; // If the amout of formats is equal or more, store it, then return the
3291      // last one if the amount of formats is less.
3292  
3293      if (formatsAtIndex.length >= lineFormats.length) {
3294        childIndex = index;
3295      } else {
3296        return childIndex;
3297      }
3298    } // If the end of the text is reached, return the last child index.
3299  
3300  
3301    return childIndex;
3302  }
3303  
3304  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/outdent-list-items.js
3305  
3306  
3307  /**
3308   * Internal dependencies
3309   */
3310  
3311  
3312  
3313  
3314  /**
3315   * Outdents any selected list items if possible.
3316   *
3317   * @param {Object} value Value to change.
3318   *
3319   * @return {Object} The changed value.
3320   */
3321  
3322  function outdentListItems(value) {
3323    var text = value.text,
3324        replacements = value.replacements,
3325        start = value.start,
3326        end = value.end;
3327    var startingLineIndex = getLineIndex(value, start); // Return early if the starting line index cannot be further outdented.
3328  
3329    if (replacements[startingLineIndex] === undefined) {
3330      return value;
3331    }
3332  
3333    var newFormats = replacements.slice(0);
3334    var parentFormats = replacements[getParentLineIndex(value, startingLineIndex)] || [];
3335    var endingLineIndex = getLineIndex(value, end);
3336    var lastChildIndex = getLastChildIndex(value, endingLineIndex); // Outdent all list items from the starting line index until the last child
3337    // index of the ending list. All children of the ending list need to be
3338    // outdented, otherwise they'll be orphaned.
3339  
3340    for (var index = startingLineIndex; index <= lastChildIndex; index++) {
3341      // Skip indices that are not line separators.
3342      if (text[index] !== LINE_SEPARATOR) {
3343        continue;
3344      } // In the case of level 0, the formats at the index are undefined.
3345  
3346  
3347      var currentFormats = newFormats[index] || []; // Omit the indentation level where the selection starts.
3348  
3349      newFormats[index] = parentFormats.concat(currentFormats.slice(parentFormats.length + 1));
3350  
3351      if (newFormats[index].length === 0) {
3352        delete newFormats[index];
3353      }
3354    }
3355  
3356    return Object(objectSpread["a" /* default */])({}, value, {
3357      replacements: newFormats
3358    });
3359  }
3360  
3361  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/change-list-type.js
3362  
3363  
3364  /**
3365   * Internal dependencies
3366   */
3367  
3368  
3369  
3370  /**
3371   * Changes the list type of the selected indented list, if any. Looks at the
3372   * currently selected list item and takes the parent list, then changes the list
3373   * type of this list. When multiple lines are selected, the parent lists are
3374   * takes and changed.
3375   *
3376   * @param {Object} value     Value to change.
3377   * @param {Object} newFormat The new list format object. Choose between
3378   *                           `{ type: 'ol' }` and `{ type: 'ul' }`.
3379   *
3380   * @return {Object} The changed value.
3381   */
3382  
3383  function changeListType(value, newFormat) {
3384    var text = value.text,
3385        replacements = value.replacements,
3386        start = value.start,
3387        end = value.end;
3388    var startingLineIndex = getLineIndex(value, start);
3389    var startLineFormats = replacements[startingLineIndex] || [];
3390    var endLineFormats = replacements[getLineIndex(value, end)] || [];
3391    var startIndex = getParentLineIndex(value, startingLineIndex);
3392    var newReplacements = replacements.slice();
3393    var startCount = startLineFormats.length - 1;
3394    var endCount = endLineFormats.length - 1;
3395    var changed;
3396  
3397    for (var index = startIndex + 1 || 0; index < text.length; index++) {
3398      if (text[index] !== LINE_SEPARATOR) {
3399        continue;
3400      }
3401  
3402      if ((newReplacements[index] || []).length <= startCount) {
3403        break;
3404      }
3405  
3406      if (!newReplacements[index]) {
3407        continue;
3408      }
3409  
3410      changed = true;
3411      newReplacements[index] = newReplacements[index].map(function (format, i) {
3412        return i < startCount || i > endCount ? format : newFormat;
3413      });
3414    }
3415  
3416    if (!changed) {
3417      return value;
3418    }
3419  
3420    return Object(objectSpread["a" /* default */])({}, value, {
3421      replacements: newReplacements
3422    });
3423  }
3424  
3425  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
3426  var esm_extends = __webpack_require__(18);
3427  
3428  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
3429  var classCallCheck = __webpack_require__(12);
3430  
3431  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
3432  var createClass = __webpack_require__(11);
3433  
3434  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
3435  var possibleConstructorReturn = __webpack_require__(13);
3436  
3437  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
3438  var getPrototypeOf = __webpack_require__(14);
3439  
3440  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
3441  var assertThisInitialized = __webpack_require__(5);
3442  
3443  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
3444  var inherits = __webpack_require__(15);
3445  
3446  // EXTERNAL MODULE: ./node_modules/classnames/index.js
3447  var classnames = __webpack_require__(16);
3448  var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
3449  
3450  // EXTERNAL MODULE: external {"this":["wp","keycodes"]}
3451  var external_this_wp_keycodes_ = __webpack_require__(19);
3452  
3453  // EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]}
3454  var external_this_wp_isShallowEqual_ = __webpack_require__(41);
3455  var external_this_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_isShallowEqual_);
3456  
3457  // EXTERNAL MODULE: external {"this":["wp","deprecated"]}
3458  var external_this_wp_deprecated_ = __webpack_require__(37);
3459  var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_);
3460  
3461  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/component/format-edit.js
3462  
3463  
3464  /**
3465   * WordPress dependencies
3466   */
3467  
3468  /**
3469   * Internal dependencies
3470   */
3471  
3472  
3473  
3474  /**
3475   * Set of all interactive content tags.
3476   *
3477   * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content
3478   */
3479  
3480  var interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']);
3481  
3482  var format_edit_FormatEdit = function FormatEdit(_ref) {
3483    var formatTypes = _ref.formatTypes,
3484        onChange = _ref.onChange,
3485        value = _ref.value,
3486        allowedFormats = _ref.allowedFormats,
3487        withoutInteractiveFormatting = _ref.withoutInteractiveFormatting;
3488    return formatTypes.map(function (_ref2) {
3489      var name = _ref2.name,
3490          Edit = _ref2.edit,
3491          tagName = _ref2.tagName;
3492  
3493      if (!Edit) {
3494        return null;
3495      }
3496  
3497      if (allowedFormats && allowedFormats.indexOf(name) === -1) {
3498        return null;
3499      }
3500  
3501      if (withoutInteractiveFormatting && interactiveContentTags.has(tagName)) {
3502        return null;
3503      }
3504  
3505      var activeFormat = getActiveFormat(value, name);
3506      var isActive = activeFormat !== undefined;
3507      var activeObject = getActiveObject(value);
3508      var isObjectActive = activeObject !== undefined && activeObject.type === name;
3509      return Object(external_this_wp_element_["createElement"])(Edit, {
3510        key: name,
3511        isActive: isActive,
3512        activeAttributes: isActive ? activeFormat.attributes || {} : {},
3513        isObjectActive: isObjectActive,
3514        activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {},
3515        value: value,
3516        onChange: onChange
3517      });
3518    });
3519  };
3520  
3521  /* harmony default export */ var format_edit = (Object(external_this_wp_data_["withSelect"])(function (select) {
3522    return {
3523      formatTypes: select('core/rich-text').getFormatTypes()
3524    };
3525  })(format_edit_FormatEdit));
3526  
3527  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
3528  var objectWithoutProperties = __webpack_require__(21);
3529  
3530  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/component/aria.js
3531  /**
3532   * External dependencies
3533   */
3534  
3535  
3536  var aria_isAriaPropName = function isAriaPropName(name) {
3537    return Object(external_lodash_["startsWith"])(name, 'aria-');
3538  };
3539  
3540  var aria_pickAriaProps = function pickAriaProps(props) {
3541    return Object(external_lodash_["pickBy"])(props, function (value, key) {
3542      return aria_isAriaPropName(key) && !Object(external_lodash_["isNil"])(value);
3543    });
3544  };
3545  var aria_diffAriaProps = function diffAriaProps(props, nextProps) {
3546    var prevAriaKeys = Object(external_lodash_["keys"])(aria_pickAriaProps(props));
3547    var nextAriaKeys = Object(external_lodash_["keys"])(aria_pickAriaProps(nextProps));
3548    var removedKeys = Object(external_lodash_["difference"])(prevAriaKeys, nextAriaKeys);
3549    var updatedKeys = nextAriaKeys.filter(function (key) {
3550      return !Object(external_lodash_["isEqual"])(props[key], nextProps[key]);
3551    });
3552    return {
3553      removedKeys: removedKeys,
3554      updatedKeys: updatedKeys
3555    };
3556  };
3557  
3558  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/component/editable.js
3559  
3560  
3561  
3562  
3563  
3564  
3565  
3566  
3567  
3568  /**
3569   * External dependencies
3570   */
3571  
3572  /**
3573   * WordPress dependencies
3574   */
3575  
3576  
3577  /**
3578   * Internal dependencies
3579   */
3580  
3581  
3582  
3583  var editable_Editable =
3584  /*#__PURE__*/
3585  function (_Component) {
3586    Object(inherits["a" /* default */])(Editable, _Component);
3587  
3588    function Editable() {
3589      var _this;
3590  
3591      Object(classCallCheck["a" /* default */])(this, Editable);
3592  
3593      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(Editable).call(this));
3594      _this.bindEditorNode = _this.bindEditorNode.bind(Object(assertThisInitialized["a" /* default */])(_this));
3595      return _this;
3596    } // We must prevent rerenders because the browser will modify the DOM. React
3597    // will rerender the DOM fine, but we're losing selection and it would be
3598    // more expensive to do so as it would just set the inner HTML through
3599    // `dangerouslySetInnerHTML`. Instead RichText does it's own diffing and
3600    // selection setting.
3601    //
3602    // Because we never update the component, we have to look through props and
3603    // update the attributes on the wrapper nodes here. `componentDidUpdate`
3604    // will never be called.
3605  
3606  
3607    Object(createClass["a" /* default */])(Editable, [{
3608      key: "shouldComponentUpdate",
3609      value: function shouldComponentUpdate(nextProps) {
3610        var _this2 = this;
3611  
3612        if (!Object(external_lodash_["isEqual"])(this.props.style, nextProps.style)) {
3613          this.editorNode.setAttribute('style', '');
3614          Object.assign(this.editorNode.style, Object(objectSpread["a" /* default */])({}, nextProps.style || {}, {
3615            whiteSpace: 'pre-wrap'
3616          }));
3617        }
3618  
3619        if (!Object(external_lodash_["isEqual"])(this.props.className, nextProps.className)) {
3620          this.editorNode.className = nextProps.className;
3621        }
3622  
3623        if (this.props.start !== nextProps.start) {
3624          this.editorNode.setAttribute('start', nextProps.start);
3625        }
3626  
3627        if (this.props.reversed !== nextProps.reversed) {
3628          this.editorNode.reversed = nextProps.reversed;
3629        }
3630  
3631        var _diffAriaProps = aria_diffAriaProps(this.props, nextProps),
3632            removedKeys = _diffAriaProps.removedKeys,
3633            updatedKeys = _diffAriaProps.updatedKeys;
3634  
3635        removedKeys.forEach(function (key) {
3636          return _this2.editorNode.removeAttribute(key);
3637        });
3638        updatedKeys.forEach(function (key) {
3639          return _this2.editorNode.setAttribute(key, nextProps[key]);
3640        });
3641        return false;
3642      }
3643    }, {
3644      key: "bindEditorNode",
3645      value: function bindEditorNode(editorNode) {
3646        this.editorNode = editorNode;
3647        this.props.setRef(editorNode);
3648      }
3649    }, {
3650      key: "render",
3651      value: function render() {
3652        var _this$props = this.props,
3653            _this$props$tagName = _this$props.tagName,
3654            tagName = _this$props$tagName === void 0 ? 'div' : _this$props$tagName,
3655            _this$props$style = _this$props.style,
3656            style = _this$props$style === void 0 ? {} : _this$props$style,
3657            record = _this$props.record,
3658            valueToEditableHTML = _this$props.valueToEditableHTML,
3659            className = _this$props.className,
3660            remainingProps = Object(objectWithoutProperties["a" /* default */])(_this$props, ["tagName", "style", "record", "valueToEditableHTML", "className"]);
3661  
3662        delete remainingProps.setRef; // In HTML, leading and trailing spaces are not visible, and multiple
3663        // spaces elsewhere are visually reduced to one space. This rule
3664        // prevents spaces from collapsing so all space is visible in the editor
3665        // and can be removed.
3666        // It also prevents some browsers from inserting non-breaking spaces at
3667        // the end of a line to prevent the space from visually disappearing.
3668        // Sometimes these non breaking spaces can linger in the editor causing
3669        // unwanted non breaking spaces in between words. If also prevent
3670        // Firefox from inserting a trailing `br` node to visualise any trailing
3671        // space, causing the element to be saved.
3672        //
3673        // > Authors are encouraged to set the 'white-space' property on editing
3674        // > hosts and on markup that was originally created through these
3675        // > editing mechanisms to the value 'pre-wrap'. Default HTML whitespace
3676        // > handling is not well suited to WYSIWYG editing, and line wrapping
3677        // > will not work correctly in some corner cases if 'white-space' is
3678        // > left at its default value.
3679        // >
3680        // > https://html.spec.whatwg.org/multipage/interaction.html#best-practices-for-in-page-editors
3681  
3682        var whiteSpace = 'pre-wrap';
3683        return Object(external_this_wp_element_["createElement"])(tagName, Object(objectSpread["a" /* default */])({
3684          role: 'textbox',
3685          'aria-multiline': true,
3686          className: className,
3687          contentEditable: true,
3688          ref: this.bindEditorNode,
3689          style: Object(objectSpread["a" /* default */])({}, style, {
3690            whiteSpace: whiteSpace
3691          }),
3692          suppressContentEditableWarning: true,
3693          dangerouslySetInnerHTML: {
3694            __html: valueToEditableHTML(record)
3695          }
3696        }, remainingProps));
3697      }
3698    }]);
3699  
3700    return Editable;
3701  }(external_this_wp_element_["Component"]);
3702  
3703  
3704  
3705  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/update-formats.js
3706  /**
3707   * Internal dependencies
3708   */
3709  
3710  /**
3711   * Efficiently updates all the formats from `start` (including) until `end`
3712   * (excluding) with the active formats. Mutates `value`.
3713   *
3714   * @param  {Object} $1         Named paramentes.
3715   * @param  {Object} $1.value   Value te update.
3716   * @param  {number} $1.start   Index to update from.
3717   * @param  {number} $1.end     Index to update until.
3718   * @param  {Array}  $1.formats Replacement formats.
3719   *
3720   * @return {Object} Mutated value.
3721   */
3722  
3723  function updateFormats(_ref) {
3724    var value = _ref.value,
3725        start = _ref.start,
3726        end = _ref.end,
3727        formats = _ref.formats;
3728    var formatsBefore = value.formats[start - 1] || [];
3729    var formatsAfter = value.formats[end] || []; // First, fix the references. If any format right before or after are
3730    // equal, the replacement format should use the same reference.
3731  
3732    value.activeFormats = formats.map(function (format, index) {
3733      if (formatsBefore[index]) {
3734        if (isFormatEqual(format, formatsBefore[index])) {
3735          return formatsBefore[index];
3736        }
3737      } else if (formatsAfter[index]) {
3738        if (isFormatEqual(format, formatsAfter[index])) {
3739          return formatsAfter[index];
3740        }
3741      }
3742  
3743      return format;
3744    });
3745  
3746    while (--end >= start) {
3747      if (value.activeFormats.length > 0) {
3748        value.formats[end] = value.activeFormats;
3749      } else {
3750        delete value.formats[end];
3751      }
3752    }
3753  
3754    return value;
3755  }
3756  
3757  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/component/index.js
3758  
3759  
3760  
3761  
3762  
3763  
3764  
3765  
3766  
3767  
3768  
3769  /**
3770   * External dependencies
3771   */
3772  
3773  
3774  /**
3775   * WordPress dependencies
3776   */
3777  
3778  
3779  
3780  
3781  
3782  
3783  
3784  /**
3785   * Internal dependencies
3786   */
3787  
3788  
3789  
3790  
3791  
3792  
3793  
3794  
3795  
3796  
3797  
3798  
3799  
3800  
3801  
3802  /**
3803   * Browser dependencies
3804   */
3805  
3806  var _window = window,
3807      getSelection = _window.getSelection,
3808      getComputedStyle = _window.getComputedStyle;
3809  /**
3810   * All inserting input types that would insert HTML into the DOM.
3811   *
3812   * @see https://www.w3.org/TR/input-events-2/#interface-InputEvent-Attributes
3813   *
3814   * @type {Set}
3815   */
3816  
3817  var INSERTION_INPUT_TYPES_TO_IGNORE = new Set(['insertParagraph', 'insertOrderedList', 'insertUnorderedList', 'insertHorizontalRule', 'insertLink']);
3818  /**
3819   * Global stylesheet.
3820   */
3821  
3822  var globalStyle = document.createElement('style');
3823  document.head.appendChild(globalStyle);
3824  
3825  function createPrepareEditableTree(props, prefix) {
3826    var fns = Object.keys(props).reduce(function (accumulator, key) {
3827      if (key.startsWith(prefix)) {
3828        accumulator.push(props[key]);
3829      }
3830  
3831      return accumulator;
3832    }, []);
3833    return function (value) {
3834      return fns.reduce(function (accumulator, fn) {
3835        return fn(accumulator, value.text);
3836      }, value.formats);
3837    };
3838  }
3839  /**
3840   * If the selection is set on the placeholder element, collapse the selection to
3841   * the start (before the placeholder).
3842   */
3843  
3844  
3845  function fixPlaceholderSelection() {
3846    var selection = window.getSelection();
3847    var anchorNode = selection.anchorNode,
3848        anchorOffset = selection.anchorOffset;
3849  
3850    if (anchorNode.nodeType !== anchorNode.ELEMENT_NODE) {
3851      return;
3852    }
3853  
3854    var targetNode = anchorNode.childNodes[anchorOffset];
3855  
3856    if (!targetNode || targetNode.nodeType !== targetNode.ELEMENT_NODE || !targetNode.getAttribute('data-rich-text-placeholder')) {
3857      return;
3858    }
3859  
3860    selection.collapseToStart();
3861  }
3862  /**
3863   * See export statement below.
3864   */
3865  
3866  
3867  var component_RichText =
3868  /*#__PURE__*/
3869  function (_Component) {
3870    Object(inherits["a" /* default */])(RichText, _Component);
3871  
3872    function RichText(_ref) {
3873      var _this;
3874  
3875      var value = _ref.value,
3876          selectionStart = _ref.selectionStart,
3877          selectionEnd = _ref.selectionEnd;
3878  
3879      Object(classCallCheck["a" /* default */])(this, RichText);
3880  
3881      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(RichText).apply(this, arguments));
3882      _this.onFocus = _this.onFocus.bind(Object(assertThisInitialized["a" /* default */])(_this));
3883      _this.onBlur = _this.onBlur.bind(Object(assertThisInitialized["a" /* default */])(_this));
3884      _this.onChange = _this.onChange.bind(Object(assertThisInitialized["a" /* default */])(_this));
3885      _this.handleDelete = _this.handleDelete.bind(Object(assertThisInitialized["a" /* default */])(_this));
3886      _this.handleEnter = _this.handleEnter.bind(Object(assertThisInitialized["a" /* default */])(_this));
3887      _this.handleSpace = _this.handleSpace.bind(Object(assertThisInitialized["a" /* default */])(_this));
3888      _this.handleHorizontalNavigation = _this.handleHorizontalNavigation.bind(Object(assertThisInitialized["a" /* default */])(_this));
3889      _this.onPaste = _this.onPaste.bind(Object(assertThisInitialized["a" /* default */])(_this));
3890      _this.onCreateUndoLevel = _this.onCreateUndoLevel.bind(Object(assertThisInitialized["a" /* default */])(_this));
3891      _this.onInput = _this.onInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
3892      _this.onCompositionEnd = _this.onCompositionEnd.bind(Object(assertThisInitialized["a" /* default */])(_this));
3893      _this.onSelectionChange = _this.onSelectionChange.bind(Object(assertThisInitialized["a" /* default */])(_this));
3894      _this.createRecord = _this.createRecord.bind(Object(assertThisInitialized["a" /* default */])(_this));
3895      _this.applyRecord = _this.applyRecord.bind(Object(assertThisInitialized["a" /* default */])(_this));
3896      _this.valueToFormat = _this.valueToFormat.bind(Object(assertThisInitialized["a" /* default */])(_this));
3897      _this.setRef = _this.setRef.bind(Object(assertThisInitialized["a" /* default */])(_this));
3898      _this.valueToEditableHTML = _this.valueToEditableHTML.bind(Object(assertThisInitialized["a" /* default */])(_this));
3899      _this.onPointerDown = _this.onPointerDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
3900      _this.formatToValue = _this.formatToValue.bind(Object(assertThisInitialized["a" /* default */])(_this));
3901      _this.Editable = _this.Editable.bind(Object(assertThisInitialized["a" /* default */])(_this));
3902  
3903      _this.onKeyDown = function (event) {
3904        if (event.defaultPrevented) {
3905          return;
3906        }
3907  
3908        _this.handleDelete(event);
3909  
3910        _this.handleEnter(event);
3911  
3912        _this.handleSpace(event);
3913  
3914        _this.handleHorizontalNavigation(event);
3915      };
3916  
3917      _this.state = {};
3918      _this.lastHistoryValue = value; // Internal values are updated synchronously, unlike props and state.
3919  
3920      _this.value = value;
3921      _this.record = _this.formatToValue(value);
3922      _this.record.start = selectionStart;
3923      _this.record.end = selectionEnd;
3924      return _this;
3925    }
3926  
3927    Object(createClass["a" /* default */])(RichText, [{
3928      key: "componentWillUnmount",
3929      value: function componentWillUnmount() {
3930        document.removeEventListener('selectionchange', this.onSelectionChange);
3931        window.cancelAnimationFrame(this.rafId);
3932      }
3933    }, {
3934      key: "setRef",
3935      value: function setRef(node) {
3936        if (node) {
3937          if (false) { var computedStyle; }
3938  
3939          this.editableRef = node;
3940        } else {
3941          delete this.editableRef;
3942        }
3943      }
3944    }, {
3945      key: "createRecord",
3946      value: function createRecord() {
3947        var multilineTag = this.props.__unstableMultilineTag;
3948        var selection = getSelection();
3949        var range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;
3950        return create({
3951          element: this.editableRef,
3952          range: range,
3953          multilineTag: multilineTag,
3954          multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined,
3955          __unstableIsEditableTree: true
3956        });
3957      }
3958    }, {
3959      key: "applyRecord",
3960      value: function applyRecord(record) {
3961        var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
3962            domOnly = _ref2.domOnly;
3963  
3964        var multilineTag = this.props.__unstableMultilineTag;
3965        apply({
3966          value: record,
3967          current: this.editableRef,
3968          multilineTag: multilineTag,
3969          multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined,
3970          prepareEditableTree: createPrepareEditableTree(this.props, 'format_prepare_functions'),
3971          __unstableDomOnly: domOnly,
3972          placeholder: this.props.placeholder
3973        });
3974      }
3975      /**
3976       * Handles a paste event.
3977       *
3978       * Saves the pasted data as plain text in `pastedPlainText`.
3979       *
3980       * @param {PasteEvent} event The paste event.
3981       */
3982  
3983    }, {
3984      key: "onPaste",
3985      value: function onPaste(event) {
3986        var _this$props = this.props,
3987            formatTypes = _this$props.formatTypes,
3988            onPaste = _this$props.onPaste;
3989        var clipboardData = event.clipboardData;
3990        var items = clipboardData.items,
3991            files = clipboardData.files; // In Edge these properties can be null instead of undefined, so a more
3992        // rigorous test is required over using default values.
3993  
3994        items = Object(external_lodash_["isNil"])(items) ? [] : items;
3995        files = Object(external_lodash_["isNil"])(files) ? [] : files;
3996        var plainText = '';
3997        var html = ''; // IE11 only supports `Text` as an argument for `getData` and will
3998        // otherwise throw an invalid argument error, so we try the standard
3999        // arguments first, then fallback to `Text` if they fail.
4000  
4001        try {
4002          plainText = clipboardData.getData('text/plain');
4003          html = clipboardData.getData('text/html');
4004        } catch (error1) {
4005          try {
4006            html = clipboardData.getData('Text');
4007          } catch (error2) {
4008            // Some browsers like UC Browser paste plain text by default and
4009            // don't support clipboardData at all, so allow default
4010            // behaviour.
4011            return;
4012          }
4013        }
4014  
4015        event.preventDefault(); // Allows us to ask for this information when we get a report.
4016  
4017        window.console.log('Received HTML:\n\n', html);
4018        window.console.log('Received plain text:\n\n', plainText);
4019        var record = this.record;
4020        var transformed = formatTypes.reduce(function (accumlator, _ref3) {
4021          var __unstablePasteRule = _ref3.__unstablePasteRule;
4022  
4023          // Only allow one transform.
4024          if (__unstablePasteRule && accumlator === record) {
4025            accumlator = __unstablePasteRule(record, {
4026              html: html,
4027              plainText: plainText
4028            });
4029          }
4030  
4031          return accumlator;
4032        }, record);
4033  
4034        if (transformed !== record) {
4035          this.onChange(transformed);
4036          return;
4037        }
4038  
4039        if (onPaste) {
4040          // Only process file if no HTML is present.
4041          // Note: a pasted file may have the URL as plain text.
4042          var image = Object(external_lodash_["find"])([].concat(Object(toConsumableArray["a" /* default */])(items), Object(toConsumableArray["a" /* default */])(files)), function (_ref4) {
4043            var type = _ref4.type;
4044            return /^image\/(?:jpe?g|png|gif)$/.test(type);
4045          });
4046          onPaste({
4047            value: this.removeEditorOnlyFormats(record),
4048            onChange: this.onChange,
4049            html: html,
4050            plainText: plainText,
4051            image: image
4052          });
4053        }
4054      }
4055      /**
4056       * Handles a focus event on the contenteditable field, calling the
4057       * `unstableOnFocus` prop callback if one is defined. The callback does not
4058       * receive any arguments.
4059       *
4060       * This is marked as a private API and the `unstableOnFocus` prop is not
4061       * documented, as the current requirements where it is used are subject to
4062       * future refactoring following `isSelected` handling.
4063       *
4064       * In contrast with `setFocusedElement`, this is only triggered in response
4065       * to focus within the contenteditable field, whereas `setFocusedElement`
4066       * is triggered on focus within any `RichText` descendent element.
4067       *
4068       * @see setFocusedElement
4069       *
4070       * @private
4071       */
4072  
4073    }, {
4074      key: "onFocus",
4075      value: function onFocus() {
4076        var unstableOnFocus = this.props.unstableOnFocus;
4077  
4078        if (unstableOnFocus) {
4079          unstableOnFocus();
4080        }
4081  
4082        this.recalculateBoundaryStyle(); // We know for certain that on focus, the old selection is invalid. It
4083        // will be recalculated on the next mouseup, keyup, or touchend event.
4084  
4085        var index = undefined;
4086        var activeFormats = undefined;
4087        this.record = Object(objectSpread["a" /* default */])({}, this.record, {
4088          start: index,
4089          end: index,
4090          activeFormats: activeFormats
4091        });
4092        this.props.onSelectionChange(index, index);
4093        this.setState({
4094          activeFormats: activeFormats
4095        }); // Update selection as soon as possible, which is at the next animation
4096        // frame. The event listener for selection changes may be added too late
4097        // at this point, but this focus event is still too early to calculate
4098        // the selection.
4099  
4100        this.rafId = window.requestAnimationFrame(this.onSelectionChange);
4101        document.addEventListener('selectionchange', this.onSelectionChange);
4102  
4103        if (this.props.setFocusedElement) {
4104          external_this_wp_deprecated_default()('wp.blockEditor.RichText setFocusedElement prop', {
4105            alternative: 'selection state from the block editor store.'
4106          });
4107          this.props.setFocusedElement(this.props.instanceId);
4108        }
4109      }
4110    }, {
4111      key: "onBlur",
4112      value: function onBlur() {
4113        document.removeEventListener('selectionchange', this.onSelectionChange);
4114      }
4115      /**
4116       * Handle input on the next selection change event.
4117       *
4118       * @param {SyntheticEvent} event Synthetic input event.
4119       */
4120  
4121    }, {
4122      key: "onInput",
4123      value: function onInput(event) {
4124        // For Input Method Editor (IME), used in Chinese, Japanese, and Korean
4125        // (CJK), do not trigger a change if characters are being composed.
4126        // Browsers setting `isComposing` to `true` will usually emit a final
4127        // `input` event when the characters are composed.
4128        if (event && event.nativeEvent && event.nativeEvent.isComposing) {
4129          // Also don't update any selection.
4130          document.removeEventListener('selectionchange', this.onSelectionChange);
4131          return;
4132        }
4133  
4134        var inputType;
4135  
4136        if (event) {
4137          inputType = event.inputType;
4138        }
4139  
4140        if (!inputType) {
4141          inputType = event.nativeEvent.inputType;
4142        } // The browser formatted something or tried to insert HTML.
4143        // Overwrite it. It will be handled later by the format library if
4144        // needed.
4145  
4146  
4147        if (inputType && (inputType.indexOf('format') === 0 || INSERTION_INPUT_TYPES_TO_IGNORE.has(inputType))) {
4148          this.applyRecord(this.record);
4149          return;
4150        }
4151  
4152        var value = this.createRecord();
4153        var _this$record = this.record,
4154            start = _this$record.start,
4155            _this$record$activeFo = _this$record.activeFormats,
4156            activeFormats = _this$record$activeFo === void 0 ? [] : _this$record$activeFo; // Update the formats between the last and new caret position.
4157  
4158        var change = updateFormats({
4159          value: value,
4160          start: start,
4161          end: value.start,
4162          formats: activeFormats
4163        });
4164        this.onChange(change, {
4165          withoutHistory: true
4166        });
4167        var _this$props2 = this.props,
4168            inputRule = _this$props2.__unstableInputRule,
4169            markAutomaticChange = _this$props2.__unstableMarkAutomaticChange,
4170            formatTypes = _this$props2.formatTypes,
4171            setTimeout = _this$props2.setTimeout,
4172            clearTimeout = _this$props2.clearTimeout; // Create an undo level when input stops for over a second.
4173  
4174        clearTimeout(this.onInput.timeout);
4175        this.onInput.timeout = setTimeout(this.onCreateUndoLevel, 1000); // Only run input rules when inserting text.
4176  
4177        if (inputType !== 'insertText') {
4178          return;
4179        }
4180  
4181        if (inputRule) {
4182          inputRule(change, this.valueToFormat);
4183        }
4184  
4185        var transformed = formatTypes.reduce(function (accumlator, _ref5) {
4186          var __unstableInputRule = _ref5.__unstableInputRule;
4187  
4188          if (__unstableInputRule) {
4189            accumlator = __unstableInputRule(accumlator);
4190          }
4191  
4192          return accumlator;
4193        }, change);
4194  
4195        if (transformed !== change) {
4196          this.onCreateUndoLevel();
4197          this.onChange(Object(objectSpread["a" /* default */])({}, transformed, {
4198            activeFormats: activeFormats
4199          }));
4200          markAutomaticChange();
4201        }
4202      }
4203    }, {
4204      key: "onCompositionEnd",
4205      value: function onCompositionEnd() {
4206        // Ensure the value is up-to-date for browsers that don't emit a final
4207        // input event after composition.
4208        this.onInput({
4209          inputType: 'insertText'
4210        }); // Tracking selection changes can be resumed.
4211  
4212        document.addEventListener('selectionchange', this.onSelectionChange);
4213      }
4214      /**
4215       * Syncs the selection to local state. A callback for the `selectionchange`
4216       * native events, `keyup`, `mouseup` and `touchend` synthetic events, and
4217       * animation frames after the `focus` event.
4218       *
4219       * @param {Event|SyntheticEvent|DOMHighResTimeStamp} event
4220       */
4221  
4222    }, {
4223      key: "onSelectionChange",
4224      value: function onSelectionChange(event) {
4225        if (event.type !== 'selectionchange' && !this.props.__unstableIsSelected) {
4226          return;
4227        } // In case of a keyboard event, ignore selection changes during
4228        // composition.
4229  
4230  
4231        if (event.nativeEvent && event.nativeEvent.isComposing) {
4232          return;
4233        }
4234  
4235        var _this$createRecord = this.createRecord(),
4236            start = _this$createRecord.start,
4237            end = _this$createRecord.end,
4238            text = _this$createRecord.text;
4239  
4240        var value = this.record; // Fallback mechanism for IE11, which doesn't support the input event.
4241        // Any input results in a selection change.
4242  
4243        if (text !== value.text) {
4244          this.onInput();
4245          return;
4246        }
4247  
4248        if (start === value.start && end === value.end) {
4249          // Sometimes the browser may set the selection on the placeholder
4250          // element, in which case the caret is not visible. We need to set
4251          // the caret before the placeholder if that's the case.
4252          if (value.text.length === 0 && start === 0) {
4253            fixPlaceholderSelection();
4254          }
4255  
4256          return;
4257        }
4258  
4259        var _this$props3 = this.props,
4260            isCaretWithinFormattedText = _this$props3.__unstableIsCaretWithinFormattedText,
4261            onEnterFormattedText = _this$props3.__unstableOnEnterFormattedText,
4262            onExitFormattedText = _this$props3.__unstableOnExitFormattedText;
4263  
4264        var newValue = Object(objectSpread["a" /* default */])({}, value, {
4265          start: start,
4266          end: end,
4267          // Allow `getActiveFormats` to get new `activeFormats`.
4268          activeFormats: undefined
4269        });
4270  
4271        var activeFormats = getActiveFormats(newValue); // Update the value with the new active formats.
4272  
4273        newValue.activeFormats = activeFormats;
4274  
4275        if (!isCaretWithinFormattedText && activeFormats.length) {
4276          onEnterFormattedText();
4277        } else if (isCaretWithinFormattedText && !activeFormats.length) {
4278          onExitFormattedText();
4279        } // It is important that the internal value is updated first,
4280        // otherwise the value will be wrong on render!
4281  
4282  
4283        this.record = newValue;
4284        this.applyRecord(newValue, {
4285          domOnly: true
4286        });
4287        this.props.onSelectionChange(start, end);
4288        this.setState({
4289          activeFormats: activeFormats
4290        });
4291  
4292        if (activeFormats.length > 0) {
4293          this.recalculateBoundaryStyle();
4294        }
4295      }
4296    }, {
4297      key: "recalculateBoundaryStyle",
4298      value: function recalculateBoundaryStyle() {
4299        var boundarySelector = '*[data-rich-text-format-boundary]';
4300        var element = this.editableRef.querySelector(boundarySelector);
4301  
4302        if (!element) {
4303          return;
4304        }
4305  
4306        var computedStyle = getComputedStyle(element);
4307        var newColor = computedStyle.color.replace(')', ', 0.2)').replace('rgb', 'rgba');
4308        var selector = ".rich-text:focus ".concat(boundarySelector);
4309        var rule = "background-color: ".concat(newColor);
4310        globalStyle.innerHTML = "".concat(selector, " {").concat(rule, "}");
4311      }
4312      /**
4313       * Sync the value to global state. The node tree and selection will also be
4314       * updated if differences are found.
4315       *
4316       * @param {Object}  record            The record to sync and apply.
4317       * @param {Object}  $2                Named options.
4318       * @param {boolean} $2.withoutHistory If true, no undo level will be
4319       *                                    created.
4320       */
4321  
4322    }, {
4323      key: "onChange",
4324      value: function onChange(record) {
4325        var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
4326            withoutHistory = _ref6.withoutHistory;
4327  
4328        this.applyRecord(record);
4329        var start = record.start,
4330            end = record.end,
4331            _record$activeFormats = record.activeFormats,
4332            activeFormats = _record$activeFormats === void 0 ? [] : _record$activeFormats;
4333        var changeHandlers = Object(external_lodash_["pickBy"])(this.props, function (v, key) {
4334          return key.startsWith('format_on_change_functions_');
4335        });
4336        Object.values(changeHandlers).forEach(function (changeHandler) {
4337          changeHandler(record.formats, record.text);
4338        });
4339        this.value = this.valueToFormat(record);
4340        this.record = record;
4341        this.props.onChange(this.value);
4342        this.props.onSelectionChange(start, end);
4343        this.setState({
4344          activeFormats: activeFormats
4345        });
4346  
4347        if (!withoutHistory) {
4348          this.onCreateUndoLevel();
4349        }
4350      }
4351    }, {
4352      key: "onCreateUndoLevel",
4353      value: function onCreateUndoLevel() {
4354        // If the content is the same, no level needs to be created.
4355        if (this.lastHistoryValue === this.value) {
4356          return;
4357        }
4358  
4359        this.props.__unstableOnCreateUndoLevel();
4360  
4361        this.lastHistoryValue = this.value;
4362      }
4363      /**
4364       * Handles delete on keydown:
4365       * - outdent list items,
4366       * - delete content if everything is selected,
4367       * - trigger the onDelete prop when selection is uncollapsed and at an edge.
4368       *
4369       * @param {SyntheticEvent} event A synthetic keyboard event.
4370       */
4371  
4372    }, {
4373      key: "handleDelete",
4374      value: function handleDelete(event) {
4375        var keyCode = event.keyCode;
4376  
4377        if (keyCode !== external_this_wp_keycodes_["DELETE"] && keyCode !== external_this_wp_keycodes_["BACKSPACE"] && keyCode !== external_this_wp_keycodes_["ESCAPE"]) {
4378          return;
4379        }
4380  
4381        if (this.props.__unstableDidAutomaticChange) {
4382          event.preventDefault();
4383  
4384          this.props.__unstableUndo();
4385  
4386          return;
4387        }
4388  
4389        if (keyCode === external_this_wp_keycodes_["ESCAPE"]) {
4390          return;
4391        }
4392  
4393        var _this$props4 = this.props,
4394            onDelete = _this$props4.onDelete,
4395            multilineTag = _this$props4.__unstableMultilineTag;
4396        var _this$state$activeFor = this.state.activeFormats,
4397            activeFormats = _this$state$activeFor === void 0 ? [] : _this$state$activeFor;
4398        var value = this.createRecord();
4399        var start = value.start,
4400            end = value.end,
4401            text = value.text;
4402        var isReverse = keyCode === external_this_wp_keycodes_["BACKSPACE"];
4403  
4404        if (multilineTag) {
4405          var newValue = removeLineSeparator(value, isReverse);
4406  
4407          if (newValue) {
4408            this.onChange(newValue);
4409            event.preventDefault();
4410          }
4411        } // Always handle full content deletion ourselves.
4412  
4413  
4414        if (start === 0 && end !== 0 && end === text.length) {
4415          this.onChange(remove_remove(value));
4416          event.preventDefault();
4417          return;
4418        } // Only process delete if the key press occurs at an uncollapsed edge.
4419  
4420  
4421        if (!onDelete || !isCollapsed(value) || activeFormats.length || isReverse && start !== 0 || !isReverse && end !== text.length) {
4422          return;
4423        }
4424  
4425        onDelete({
4426          isReverse: isReverse,
4427          value: value
4428        });
4429        event.preventDefault();
4430      }
4431      /**
4432       * Triggers the `onEnter` prop on keydown.
4433       *
4434       * @param {SyntheticEvent} event A synthetic keyboard event.
4435       */
4436  
4437    }, {
4438      key: "handleEnter",
4439      value: function handleEnter(event) {
4440        if (event.keyCode !== external_this_wp_keycodes_["ENTER"]) {
4441          return;
4442        }
4443  
4444        event.preventDefault();
4445        var onEnter = this.props.onEnter;
4446  
4447        if (!onEnter) {
4448          return;
4449        }
4450  
4451        onEnter({
4452          value: this.removeEditorOnlyFormats(this.createRecord()),
4453          onChange: this.onChange,
4454          shiftKey: event.shiftKey
4455        });
4456      }
4457      /**
4458       * Indents list items on space keydown.
4459       *
4460       * @param {SyntheticEvent} event A synthetic keyboard event.
4461       */
4462  
4463    }, {
4464      key: "handleSpace",
4465      value: function handleSpace(event) {
4466        var keyCode = event.keyCode,
4467            shiftKey = event.shiftKey,
4468            altKey = event.altKey,
4469            metaKey = event.metaKey,
4470            ctrlKey = event.ctrlKey;
4471        var _this$props5 = this.props,
4472            tagName = _this$props5.tagName,
4473            multilineTag = _this$props5.__unstableMultilineTag;
4474  
4475        if ( // Only override when no modifiers are pressed.
4476        shiftKey || altKey || metaKey || ctrlKey || keyCode !== external_this_wp_keycodes_["SPACE"] || multilineTag !== 'li') {
4477          return;
4478        }
4479  
4480        var value = this.createRecord();
4481  
4482        if (!isCollapsed(value)) {
4483          return;
4484        }
4485  
4486        var text = value.text,
4487            start = value.start;
4488        var characterBefore = text[start - 1]; // The caret must be at the start of a line.
4489  
4490        if (characterBefore && characterBefore !== LINE_SEPARATOR) {
4491          return;
4492        }
4493  
4494        this.onChange(indentListItems(value, {
4495          type: tagName
4496        }));
4497        event.preventDefault();
4498      }
4499      /**
4500       * Handles horizontal keyboard navigation when no modifiers are pressed. The
4501       * navigation is handled separately to move correctly around format
4502       * boundaries.
4503       *
4504       * @param  {SyntheticEvent} event A synthetic keyboard event.
4505       */
4506  
4507    }, {
4508      key: "handleHorizontalNavigation",
4509      value: function handleHorizontalNavigation(event) {
4510        var _this2 = this;
4511  
4512        var keyCode = event.keyCode,
4513            shiftKey = event.shiftKey,
4514            altKey = event.altKey,
4515            metaKey = event.metaKey,
4516            ctrlKey = event.ctrlKey;
4517  
4518        if ( // Only override left and right keys without modifiers pressed.
4519        shiftKey || altKey || metaKey || ctrlKey || keyCode !== external_this_wp_keycodes_["LEFT"] && keyCode !== external_this_wp_keycodes_["RIGHT"]) {
4520          return;
4521        }
4522  
4523        var value = this.record;
4524        var text = value.text,
4525            formats = value.formats,
4526            start = value.start,
4527            end = value.end,
4528            _value$activeFormats = value.activeFormats,
4529            activeFormats = _value$activeFormats === void 0 ? [] : _value$activeFormats;
4530        var collapsed = isCollapsed(value); // To do: ideally, we should look at visual position instead.
4531  
4532        var _getComputedStyle = getComputedStyle(this.editableRef),
4533            direction = _getComputedStyle.direction;
4534  
4535        var reverseKey = direction === 'rtl' ? external_this_wp_keycodes_["RIGHT"] : external_this_wp_keycodes_["LEFT"];
4536        var isReverse = event.keyCode === reverseKey; // If the selection is collapsed and at the very start, do nothing if
4537        // navigating backward.
4538        // If the selection is collapsed and at the very end, do nothing if
4539        // navigating forward.
4540  
4541        if (collapsed && activeFormats.length === 0) {
4542          if (start === 0 && isReverse) {
4543            return;
4544          }
4545  
4546          if (end === text.length && !isReverse) {
4547            return;
4548          }
4549        } // If the selection is not collapsed, let the browser handle collapsing
4550        // the selection for now. Later we could expand this logic to set
4551        // boundary positions if needed.
4552  
4553  
4554        if (!collapsed) {
4555          return;
4556        } // In all other cases, prevent default behaviour.
4557  
4558  
4559        event.preventDefault();
4560        var formatsBefore = formats[start - 1] || [];
4561        var formatsAfter = formats[start] || [];
4562        var newActiveFormatsLength = activeFormats.length;
4563        var source = formatsAfter;
4564  
4565        if (formatsBefore.length > formatsAfter.length) {
4566          source = formatsBefore;
4567        } // If the amount of formats before the caret and after the caret is
4568        // different, the caret is at a format boundary.
4569  
4570  
4571        if (formatsBefore.length < formatsAfter.length) {
4572          if (!isReverse && activeFormats.length < formatsAfter.length) {
4573            newActiveFormatsLength++;
4574          }
4575  
4576          if (isReverse && activeFormats.length > formatsBefore.length) {
4577            newActiveFormatsLength--;
4578          }
4579        } else if (formatsBefore.length > formatsAfter.length) {
4580          if (!isReverse && activeFormats.length > formatsAfter.length) {
4581            newActiveFormatsLength--;
4582          }
4583  
4584          if (isReverse && activeFormats.length < formatsBefore.length) {
4585            newActiveFormatsLength++;
4586          }
4587        } // Wait for boundary class to be added.
4588  
4589  
4590        this.props.setTimeout(function () {
4591          return _this2.recalculateBoundaryStyle();
4592        });
4593  
4594        if (newActiveFormatsLength !== activeFormats.length) {
4595          var _newActiveFormats = source.slice(0, newActiveFormatsLength);
4596  
4597          var _newValue = Object(objectSpread["a" /* default */])({}, value, {
4598            activeFormats: _newActiveFormats
4599          });
4600  
4601          this.record = _newValue;
4602          this.applyRecord(_newValue);
4603          this.setState({
4604            activeFormats: _newActiveFormats
4605          });
4606          return;
4607        }
4608  
4609        var newPos = start + (isReverse ? -1 : 1);
4610        var newActiveFormats = isReverse ? formatsBefore : formatsAfter;
4611  
4612        var newValue = Object(objectSpread["a" /* default */])({}, value, {
4613          start: newPos,
4614          end: newPos,
4615          activeFormats: newActiveFormats
4616        });
4617  
4618        this.record = newValue;
4619        this.applyRecord(newValue);
4620        this.props.onSelectionChange(newPos, newPos);
4621        this.setState({
4622          activeFormats: newActiveFormats
4623        });
4624      }
4625      /**
4626       * Select object when they are clicked. The browser will not set any
4627       * selection when clicking e.g. an image.
4628       *
4629       * @param  {SyntheticEvent} event Synthetic mousedown or touchstart event.
4630       */
4631  
4632    }, {
4633      key: "onPointerDown",
4634      value: function onPointerDown(event) {
4635        var target = event.target; // If the child element has no text content, it must be an object.
4636  
4637        if (target === this.editableRef || target.textContent) {
4638          return;
4639        }
4640  
4641        var parentNode = target.parentNode;
4642        var index = Array.from(parentNode.childNodes).indexOf(target);
4643        var range = target.ownerDocument.createRange();
4644        var selection = getSelection();
4645        range.setStart(target.parentNode, index);
4646        range.setEnd(target.parentNode, index + 1);
4647        selection.removeAllRanges();
4648        selection.addRange(range);
4649      }
4650    }, {
4651      key: "componentDidUpdate",
4652      value: function componentDidUpdate(prevProps) {
4653        var _this$props6 = this.props,
4654            tagName = _this$props6.tagName,
4655            value = _this$props6.value,
4656            selectionStart = _this$props6.selectionStart,
4657            selectionEnd = _this$props6.selectionEnd,
4658            placeholder = _this$props6.placeholder,
4659            isSelected = _this$props6.__unstableIsSelected; // Check if the content changed.
4660  
4661        var shouldReapply = tagName === prevProps.tagName && value !== prevProps.value && value !== this.value; // Check if the selection changed.
4662  
4663        shouldReapply = shouldReapply || isSelected && !prevProps.isSelected && (this.record.start !== selectionStart || this.record.end !== selectionEnd);
4664        var prefix = 'format_prepare_props_';
4665  
4666        var predicate = function predicate(v, key) {
4667          return key.startsWith(prefix);
4668        };
4669  
4670        var prepareProps = Object(external_lodash_["pickBy"])(this.props, predicate);
4671        var prevPrepareProps = Object(external_lodash_["pickBy"])(prevProps, predicate); // Check if any format props changed.
4672  
4673        shouldReapply = shouldReapply || !external_this_wp_isShallowEqual_default()(prepareProps, prevPrepareProps); // Rerender if the placeholder changed.
4674  
4675        shouldReapply = shouldReapply || placeholder !== prevProps.placeholder;
4676  
4677        if (shouldReapply) {
4678          this.value = value;
4679          this.record = this.formatToValue(value);
4680          this.record.start = selectionStart;
4681          this.record.end = selectionEnd;
4682          this.applyRecord(this.record);
4683        } else if (this.record.start !== selectionStart || this.record.end !== selectionEnd) {
4684          this.record = Object(objectSpread["a" /* default */])({}, this.record, {
4685            start: selectionStart,
4686            end: selectionEnd
4687          });
4688        }
4689      }
4690      /**
4691       * Converts the outside data structure to our internal representation.
4692       *
4693       * @param {*} value The outside value, data type depends on props.
4694       * @return {Object} An internal rich-text value.
4695       */
4696  
4697    }, {
4698      key: "formatToValue",
4699      value: function formatToValue(value) {
4700        var _this$props7 = this.props,
4701            format = _this$props7.format,
4702            multilineTag = _this$props7.__unstableMultilineTag;
4703  
4704        if (format !== 'string') {
4705          return value;
4706        }
4707  
4708        var prepare = createPrepareEditableTree(this.props, 'format_value_functions');
4709        value = create({
4710          html: value,
4711          multilineTag: multilineTag,
4712          multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined
4713        });
4714        value.formats = prepare(value);
4715        return value;
4716      }
4717    }, {
4718      key: "valueToEditableHTML",
4719      value: function valueToEditableHTML(value) {
4720        var multilineTag = this.props.__unstableMultilineTag;
4721        return toDom({
4722          value: value,
4723          multilineTag: multilineTag,
4724          prepareEditableTree: createPrepareEditableTree(this.props, 'format_prepare_functions'),
4725          placeholder: this.props.placeholder
4726        }).body.innerHTML;
4727      }
4728      /**
4729       * Removes editor only formats from the value.
4730       *
4731       * Editor only formats are applied using `prepareEditableTree`, so we need to
4732       * remove them before converting the internal state
4733       *
4734       * @param {Object} value The internal rich-text value.
4735       * @return {Object} A new rich-text value.
4736       */
4737  
4738    }, {
4739      key: "removeEditorOnlyFormats",
4740      value: function removeEditorOnlyFormats(value) {
4741        this.props.formatTypes.forEach(function (formatType) {
4742          // Remove formats created by prepareEditableTree, because they are editor only.
4743          if (formatType.__experimentalCreatePrepareEditableTree) {
4744            value = removeFormat(value, formatType.name, 0, value.text.length);
4745          }
4746        });
4747        return value;
4748      }
4749      /**
4750       * Converts the internal value to the external data format.
4751       *
4752       * @param {Object} value The internal rich-text value.
4753       * @return {*} The external data format, data type depends on props.
4754       */
4755  
4756    }, {
4757      key: "valueToFormat",
4758      value: function valueToFormat(value) {
4759        var _this$props8 = this.props,
4760            format = _this$props8.format,
4761            multilineTag = _this$props8.__unstableMultilineTag;
4762        value = this.removeEditorOnlyFormats(value);
4763  
4764        if (format !== 'string') {
4765          return;
4766        }
4767  
4768        return toHTMLString({
4769          value: value,
4770          multilineTag: multilineTag
4771        });
4772      }
4773    }, {
4774      key: "Editable",
4775      value: function Editable(props) {
4776        var _this3 = this;
4777  
4778        var _this$props9 = this.props,
4779            _this$props9$tagName = _this$props9.tagName,
4780            Tagname = _this$props9$tagName === void 0 ? 'div' : _this$props9$tagName,
4781            style = _this$props9.style,
4782            className = _this$props9.className,
4783            placeholder = _this$props9.placeholder; // Generating a key that includes `tagName` ensures that if the tag
4784        // changes, we replace the relevant element. This is needed because we
4785        // prevent Editable component updates.
4786  
4787        var key = Tagname;
4788        return Object(external_this_wp_element_["createElement"])(editable_Editable, Object(esm_extends["a" /* default */])({}, props, {
4789          tagName: Tagname,
4790          style: style,
4791          record: this.record,
4792          valueToEditableHTML: this.valueToEditableHTML,
4793          "aria-label": placeholder
4794        }, aria_pickAriaProps(this.props), {
4795          className: classnames_default()('rich-text', className),
4796          key: key,
4797          onPaste: this.onPaste,
4798          onInput: this.onInput,
4799          onCompositionEnd: this.onCompositionEnd,
4800          onKeyDown: props.onKeyDown ? function (event) {
4801            props.onKeyDown(event);
4802  
4803            _this3.onKeyDown(event);
4804          } : this.onKeyDown,
4805          onFocus: this.onFocus,
4806          onBlur: this.onBlur,
4807          onMouseDown: this.onPointerDown,
4808          onTouchStart: this.onPointerDown,
4809          setRef: this.setRef // Selection updates must be done at these events as they
4810          // happen before the `selectionchange` event. In some cases,
4811          // the `selectionchange` event may not even fire, for
4812          // example when the window receives focus again on click.
4813          ,
4814          onKeyUp: this.onSelectionChange,
4815          onMouseUp: this.onSelectionChange,
4816          onTouchEnd: this.onSelectionChange
4817        }));
4818      }
4819    }, {
4820      key: "render",
4821      value: function render() {
4822        var _this$props10 = this.props,
4823            isSelected = _this$props10.__unstableIsSelected,
4824            children = _this$props10.children,
4825            allowedFormats = _this$props10.allowedFormats,
4826            withoutInteractiveFormatting = _this$props10.withoutInteractiveFormatting;
4827        return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, isSelected && Object(external_this_wp_element_["createElement"])(format_edit, {
4828          allowedFormats: allowedFormats,
4829          withoutInteractiveFormatting: withoutInteractiveFormatting,
4830          value: this.record,
4831          onChange: this.onChange
4832        }), children && children({
4833          isSelected: isSelected,
4834          value: this.record,
4835          onChange: this.onChange,
4836          Editable: this.Editable
4837        }), !children && Object(external_this_wp_element_["createElement"])(this.Editable, null));
4838      }
4839    }]);
4840  
4841    return RichText;
4842  }(external_this_wp_element_["Component"]);
4843  
4844  component_RichText.defaultProps = {
4845    format: 'string',
4846    value: ''
4847  };
4848  /**
4849   * Renders a rich content input, providing users with the option to format the
4850   * content.
4851   */
4852  
4853  /* harmony default export */ var component = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
4854    return {
4855      formatTypes: select('core/rich-text').getFormatTypes()
4856    };
4857  }), external_this_wp_compose_["withSafeTimeout"]])(component_RichText));
4858  
4859  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/index.js
4860  /* concated harmony reexport applyFormat */__webpack_require__.d(__webpack_exports__, "applyFormat", function() { return applyFormat; });
4861  /* concated harmony reexport concat */__webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
4862  /* concated harmony reexport create */__webpack_require__.d(__webpack_exports__, "create", function() { return create; });
4863  /* concated harmony reexport getActiveFormat */__webpack_require__.d(__webpack_exports__, "getActiveFormat", function() { return getActiveFormat; });
4864  /* concated harmony reexport getActiveObject */__webpack_require__.d(__webpack_exports__, "getActiveObject", function() { return getActiveObject; });
4865  /* concated harmony reexport getTextContent */__webpack_require__.d(__webpack_exports__, "getTextContent", function() { return getTextContent; });
4866  /* concated harmony reexport __unstableIsListRootSelected */__webpack_require__.d(__webpack_exports__, "__unstableIsListRootSelected", function() { return isListRootSelected; });
4867  /* concated harmony reexport __unstableIsActiveListType */__webpack_require__.d(__webpack_exports__, "__unstableIsActiveListType", function() { return isActiveListType; });
4868  /* concated harmony reexport isCollapsed */__webpack_require__.d(__webpack_exports__, "isCollapsed", function() { return isCollapsed; });
4869  /* concated harmony reexport isEmpty */__webpack_require__.d(__webpack_exports__, "isEmpty", function() { return isEmpty; });
4870  /* concated harmony reexport __unstableIsEmptyLine */__webpack_require__.d(__webpack_exports__, "__unstableIsEmptyLine", function() { return isEmptyLine; });
4871  /* concated harmony reexport join */__webpack_require__.d(__webpack_exports__, "join", function() { return join; });
4872  /* concated harmony reexport registerFormatType */__webpack_require__.d(__webpack_exports__, "registerFormatType", function() { return registerFormatType; });
4873  /* concated harmony reexport removeFormat */__webpack_require__.d(__webpack_exports__, "removeFormat", function() { return removeFormat; });
4874  /* concated harmony reexport remove */__webpack_require__.d(__webpack_exports__, "remove", function() { return remove_remove; });
4875  /* concated harmony reexport replace */__webpack_require__.d(__webpack_exports__, "replace", function() { return replace_replace; });
4876  /* concated harmony reexport insert */__webpack_require__.d(__webpack_exports__, "insert", function() { return insert; });
4877  /* concated harmony reexport __unstableInsertLineSeparator */__webpack_require__.d(__webpack_exports__, "__unstableInsertLineSeparator", function() { return insertLineSeparator; });
4878  /* concated harmony reexport __unstableRemoveLineSeparator */__webpack_require__.d(__webpack_exports__, "__unstableRemoveLineSeparator", function() { return removeLineSeparator; });
4879  /* concated harmony reexport insertObject */__webpack_require__.d(__webpack_exports__, "insertObject", function() { return insertObject; });
4880  /* concated harmony reexport slice */__webpack_require__.d(__webpack_exports__, "slice", function() { return slice; });
4881  /* concated harmony reexport split */__webpack_require__.d(__webpack_exports__, "split", function() { return split; });
4882  /* concated harmony reexport __unstableToDom */__webpack_require__.d(__webpack_exports__, "__unstableToDom", function() { return toDom; });
4883  /* concated harmony reexport toHTMLString */__webpack_require__.d(__webpack_exports__, "toHTMLString", function() { return toHTMLString; });
4884  /* concated harmony reexport toggleFormat */__webpack_require__.d(__webpack_exports__, "toggleFormat", function() { return toggleFormat; });
4885  /* concated harmony reexport __UNSTABLE_LINE_SEPARATOR */__webpack_require__.d(__webpack_exports__, "__UNSTABLE_LINE_SEPARATOR", function() { return LINE_SEPARATOR; });
4886  /* concated harmony reexport unregisterFormatType */__webpack_require__.d(__webpack_exports__, "unregisterFormatType", function() { return unregisterFormatType; });
4887  /* concated harmony reexport __unstableIndentListItems */__webpack_require__.d(__webpack_exports__, "__unstableIndentListItems", function() { return indentListItems; });
4888  /* concated harmony reexport __unstableOutdentListItems */__webpack_require__.d(__webpack_exports__, "__unstableOutdentListItems", function() { return outdentListItems; });
4889  /* concated harmony reexport __unstableChangeListType */__webpack_require__.d(__webpack_exports__, "__unstableChangeListType", function() { return changeListType; });
4890  /* concated harmony reexport __unstableCreateElement */__webpack_require__.d(__webpack_exports__, "__unstableCreateElement", function() { return createElement; });
4891  /* concated harmony reexport __experimentalRichText */__webpack_require__.d(__webpack_exports__, "__experimentalRichText", function() { return component; });
4892  /* concated harmony reexport __unstableFormatEdit */__webpack_require__.d(__webpack_exports__, "__unstableFormatEdit", function() { return format_edit; });
4893  /**
4894   * Internal dependencies
4895   */
4896  
4897  
4898  
4899  
4900  
4901  
4902  
4903  
4904  
4905  
4906  
4907  
4908  
4909  
4910  
4911  
4912  
4913  
4914  
4915  
4916  
4917  
4918  
4919  
4920  
4921  
4922  
4923  
4924  
4925  
4926  
4927  
4928  
4929  
4930  
4931  /***/ }),
4932  
4933  /***/ 36:
4934  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4935  
4936  "use strict";
4937  
4938  
4939  var LEAF_KEY, hasWeakMap;
4940  
4941  /**
4942   * Arbitrary value used as key for referencing cache object in WeakMap tree.
4943   *
4944   * @type {Object}
4945   */
4946  LEAF_KEY = {};
4947  
4948  /**
4949   * Whether environment supports WeakMap.
4950   *
4951   * @type {boolean}
4952   */
4953  hasWeakMap = typeof WeakMap !== 'undefined';
4954  
4955  /**
4956   * Returns the first argument as the sole entry in an array.
4957   *
4958   * @param {*} value Value to return.
4959   *
4960   * @return {Array} Value returned as entry in array.
4961   */
4962  function arrayOf( value ) {
4963      return [ value ];
4964  }
4965  
4966  /**
4967   * Returns true if the value passed is object-like, or false otherwise. A value
4968   * is object-like if it can support property assignment, e.g. object or array.
4969   *
4970   * @param {*} value Value to test.
4971   *
4972   * @return {boolean} Whether value is object-like.
4973   */
4974  function isObjectLike( value ) {
4975      return !! value && 'object' === typeof value;
4976  }
4977  
4978  /**
4979   * Creates and returns a new cache object.
4980   *
4981   * @return {Object} Cache object.
4982   */
4983  function createCache() {
4984      var cache = {
4985          clear: function() {
4986              cache.head = null;
4987          },
4988      };
4989  
4990      return cache;
4991  }
4992  
4993  /**
4994   * Returns true if entries within the two arrays are strictly equal by
4995   * reference from a starting index.
4996   *
4997   * @param {Array}  a         First array.
4998   * @param {Array}  b         Second array.
4999   * @param {number} fromIndex Index from which to start comparison.
5000   *
5001   * @return {boolean} Whether arrays are shallowly equal.
5002   */
5003  function isShallowEqual( a, b, fromIndex ) {
5004      var i;
5005  
5006      if ( a.length !== b.length ) {
5007          return false;
5008      }
5009  
5010      for ( i = fromIndex; i < a.length; i++ ) {
5011          if ( a[ i ] !== b[ i ] ) {
5012              return false;
5013          }
5014      }
5015  
5016      return true;
5017  }
5018  
5019  /**
5020   * Returns a memoized selector function. The getDependants function argument is
5021   * called before the memoized selector and is expected to return an immutable
5022   * reference or array of references on which the selector depends for computing
5023   * its own return value. The memoize cache is preserved only as long as those
5024   * dependant references remain the same. If getDependants returns a different
5025   * reference(s), the cache is cleared and the selector value regenerated.
5026   *
5027   * @param {Function} selector      Selector function.
5028   * @param {Function} getDependants Dependant getter returning an immutable
5029   *                                 reference or array of reference used in
5030   *                                 cache bust consideration.
5031   *
5032   * @return {Function} Memoized selector.
5033   */
5034  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
5035      var rootCache, getCache;
5036  
5037      // Use object source as dependant if getter not provided
5038      if ( ! getDependants ) {
5039          getDependants = arrayOf;
5040      }
5041  
5042      /**
5043       * Returns the root cache. If WeakMap is supported, this is assigned to the
5044       * root WeakMap cache set, otherwise it is a shared instance of the default
5045       * cache object.
5046       *
5047       * @return {(WeakMap|Object)} Root cache object.
5048       */
5049  	function getRootCache() {
5050          return rootCache;
5051      }
5052  
5053      /**
5054       * Returns the cache for a given dependants array. When possible, a WeakMap
5055       * will be used to create a unique cache for each set of dependants. This
5056       * is feasible due to the nature of WeakMap in allowing garbage collection
5057       * to occur on entries where the key object is no longer referenced. Since
5058       * WeakMap requires the key to be an object, this is only possible when the
5059       * dependant is object-like. The root cache is created as a hierarchy where
5060       * each top-level key is the first entry in a dependants set, the value a
5061       * WeakMap where each key is the next dependant, and so on. This continues
5062       * so long as the dependants are object-like. If no dependants are object-
5063       * like, then the cache is shared across all invocations.
5064       *
5065       * @see isObjectLike
5066       *
5067       * @param {Array} dependants Selector dependants.
5068       *
5069       * @return {Object} Cache object.
5070       */
5071  	function getWeakMapCache( dependants ) {
5072          var caches = rootCache,
5073              isUniqueByDependants = true,
5074              i, dependant, map, cache;
5075  
5076          for ( i = 0; i < dependants.length; i++ ) {
5077              dependant = dependants[ i ];
5078  
5079              // Can only compose WeakMap from object-like key.
5080              if ( ! isObjectLike( dependant ) ) {
5081                  isUniqueByDependants = false;
5082                  break;
5083              }
5084  
5085              // Does current segment of cache already have a WeakMap?
5086              if ( caches.has( dependant ) ) {
5087                  // Traverse into nested WeakMap.
5088                  caches = caches.get( dependant );
5089              } else {
5090                  // Create, set, and traverse into a new one.
5091                  map = new WeakMap();
5092                  caches.set( dependant, map );
5093                  caches = map;
5094              }
5095          }
5096  
5097          // We use an arbitrary (but consistent) object as key for the last item
5098          // in the WeakMap to serve as our running cache.
5099          if ( ! caches.has( LEAF_KEY ) ) {
5100              cache = createCache();
5101              cache.isUniqueByDependants = isUniqueByDependants;
5102              caches.set( LEAF_KEY, cache );
5103          }
5104  
5105          return caches.get( LEAF_KEY );
5106      }
5107  
5108      // Assign cache handler by availability of WeakMap
5109      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
5110  
5111      /**
5112       * Resets root memoization cache.
5113       */
5114  	function clear() {
5115          rootCache = hasWeakMap ? new WeakMap() : createCache();
5116      }
5117  
5118      // eslint-disable-next-line jsdoc/check-param-names
5119      /**
5120       * The augmented selector call, considering first whether dependants have
5121       * changed before passing it to underlying memoize function.
5122       *
5123       * @param {Object} source    Source object for derivation.
5124       * @param {...*}   extraArgs Additional arguments to pass to selector.
5125       *
5126       * @return {*} Selector result.
5127       */
5128  	function callSelector( /* source, ...extraArgs */ ) {
5129          var len = arguments.length,
5130              cache, node, i, args, dependants;
5131  
5132          // Create copy of arguments (avoid leaking deoptimization).
5133          args = new Array( len );
5134          for ( i = 0; i < len; i++ ) {
5135              args[ i ] = arguments[ i ];
5136          }
5137  
5138          dependants = getDependants.apply( null, args );
5139          cache = getCache( dependants );
5140  
5141          // If not guaranteed uniqueness by dependants (primitive type or lack
5142          // of WeakMap support), shallow compare against last dependants and, if
5143          // references have changed, destroy cache to recalculate result.
5144          if ( ! cache.isUniqueByDependants ) {
5145              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
5146                  cache.clear();
5147              }
5148  
5149              cache.lastDependants = dependants;
5150          }
5151  
5152          node = cache.head;
5153          while ( node ) {
5154              // Check whether node arguments match arguments
5155              if ( ! isShallowEqual( node.args, args, 1 ) ) {
5156                  node = node.next;
5157                  continue;
5158              }
5159  
5160              // At this point we can assume we've found a match
5161  
5162              // Surface matched node to head if not already
5163              if ( node !== cache.head ) {
5164                  // Adjust siblings to point to each other.
5165                  node.prev.next = node.next;
5166                  if ( node.next ) {
5167                      node.next.prev = node.prev;
5168                  }
5169  
5170                  node.next = cache.head;
5171                  node.prev = null;
5172                  cache.head.prev = node;
5173                  cache.head = node;
5174              }
5175  
5176              // Return immediately
5177              return node.val;
5178          }
5179  
5180          // No cached value found. Continue to insertion phase:
5181  
5182          node = {
5183              // Generate the result from original function
5184              val: selector.apply( null, args ),
5185          };
5186  
5187          // Avoid including the source object in the cache.
5188          args[ 0 ] = null;
5189          node.args = args;
5190  
5191          // Don't need to check whether node is already head, since it would
5192          // have been returned above already if it was
5193  
5194          // Shift existing head down list
5195          if ( cache.head ) {
5196              cache.head.prev = node;
5197              node.next = cache.head;
5198          }
5199  
5200          cache.head = node;
5201  
5202          return node.val;
5203      }
5204  
5205      callSelector.getDependants = getDependants;
5206      callSelector.clear = clear;
5207      clear();
5208  
5209      return callSelector;
5210  });
5211  
5212  
5213  /***/ }),
5214  
5215  /***/ 37:
5216  /***/ (function(module, exports) {
5217  
5218  (function() { module.exports = this["wp"]["deprecated"]; }());
5219  
5220  /***/ }),
5221  
5222  /***/ 4:
5223  /***/ (function(module, exports) {
5224  
5225  (function() { module.exports = this["wp"]["data"]; }());
5226  
5227  /***/ }),
5228  
5229  /***/ 41:
5230  /***/ (function(module, exports) {
5231  
5232  (function() { module.exports = this["wp"]["isShallowEqual"]; }());
5233  
5234  /***/ }),
5235  
5236  /***/ 5:
5237  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5238  
5239  "use strict";
5240  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
5241  function _assertThisInitialized(self) {
5242    if (self === void 0) {
5243      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5244    }
5245  
5246    return self;
5247  }
5248  
5249  /***/ }),
5250  
5251  /***/ 7:
5252  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5253  
5254  "use strict";
5255  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
5256  /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
5257  
5258  function _objectSpread(target) {
5259    for (var i = 1; i < arguments.length; i++) {
5260      var source = arguments[i] != null ? arguments[i] : {};
5261      var ownKeys = Object.keys(source);
5262  
5263      if (typeof Object.getOwnPropertySymbols === 'function') {
5264        ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
5265          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
5266        }));
5267      }
5268  
5269      ownKeys.forEach(function (key) {
5270        Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]);
5271      });
5272    }
5273  
5274    return target;
5275  }
5276  
5277  /***/ }),
5278  
5279  /***/ 71:
5280  /***/ (function(module, exports) {
5281  
5282  (function() { module.exports = this["wp"]["escapeHtml"]; }());
5283  
5284  /***/ }),
5285  
5286  /***/ 8:
5287  /***/ (function(module, exports) {
5288  
5289  (function() { module.exports = this["wp"]["compose"]; }());
5290  
5291  /***/ })
5292  
5293  /******/ });


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7