[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> block-editor.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["blockEditor"] =
   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 = 343);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = this["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 1:
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = this["wp"]["i18n"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ 10:
 105  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 106  
 107  "use strict";
 108  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 109  function _classCallCheck(instance, Constructor) {
 110    if (!(instance instanceof Constructor)) {
 111      throw new TypeError("Cannot call a class as a function");
 112    }
 113  }
 114  
 115  /***/ }),
 116  
 117  /***/ 11:
 118  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 119  
 120  "use strict";
 121  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
 122  /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32);
 123  /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
 124  
 125  
 126  function _possibleConstructorReturn(self, call) {
 127    if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
 128      return call;
 129    }
 130  
 131    return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
 132  }
 133  
 134  /***/ }),
 135  
 136  /***/ 111:
 137  /***/ (function(module, exports, __webpack_require__) {
 138  
 139  "use strict";
 140  
 141  var __extends = (this && this.__extends) || (function () {
 142      var extendStatics = Object.setPrototypeOf ||
 143          ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
 144          function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
 145      return function (d, b) {
 146          extendStatics(d, b);
 147          function __() { this.constructor = d; }
 148          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
 149      };
 150  })();
 151  var __assign = (this && this.__assign) || Object.assign || function(t) {
 152      for (var s, i = 1, n = arguments.length; i < n; i++) {
 153          s = arguments[i];
 154          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
 155              t[p] = s[p];
 156      }
 157      return t;
 158  };
 159  var __rest = (this && this.__rest) || function (s, e) {
 160      var t = {};
 161      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
 162          t[p] = s[p];
 163      if (s != null && typeof Object.getOwnPropertySymbols === "function")
 164          for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
 165              t[p[i]] = s[p[i]];
 166      return t;
 167  };
 168  exports.__esModule = true;
 169  var React = __webpack_require__(27);
 170  var PropTypes = __webpack_require__(31);
 171  var autosize = __webpack_require__(112);
 172  var _getLineHeight = __webpack_require__(113);
 173  var getLineHeight = _getLineHeight;
 174  var UPDATE = 'autosize:update';
 175  var DESTROY = 'autosize:destroy';
 176  var RESIZED = 'autosize:resized';
 177  /**
 178   * A light replacement for built-in textarea component
 179   * which automaticaly adjusts its height to match the content
 180   */
 181  var TextareaAutosize = /** @class */ (function (_super) {
 182      __extends(TextareaAutosize, _super);
 183      function TextareaAutosize() {
 184          var _this = _super !== null && _super.apply(this, arguments) || this;
 185          _this.state = {
 186              lineHeight: null
 187          };
 188          _this.dispatchEvent = function (EVENT_TYPE) {
 189              var event = document.createEvent('Event');
 190              event.initEvent(EVENT_TYPE, true, false);
 191              _this.textarea.dispatchEvent(event);
 192          };
 193          _this.updateLineHeight = function () {
 194              _this.setState({
 195                  lineHeight: getLineHeight(_this.textarea)
 196              });
 197          };
 198          _this.onChange = function (e) {
 199              var onChange = _this.props.onChange;
 200              _this.currentValue = e.currentTarget.value;
 201              onChange && onChange(e);
 202          };
 203          _this.saveDOMNodeRef = function (ref) {
 204              var innerRef = _this.props.innerRef;
 205              if (innerRef) {
 206                  innerRef(ref);
 207              }
 208              _this.textarea = ref;
 209          };
 210          _this.getLocals = function () {
 211              var _a = _this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef"]), lineHeight = _a.state.lineHeight, saveDOMNodeRef = _a.saveDOMNodeRef;
 212              var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
 213              return __assign({}, props, { saveDOMNodeRef: saveDOMNodeRef, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, onChange: _this.onChange });
 214          };
 215          return _this;
 216      }
 217      TextareaAutosize.prototype.componentDidMount = function () {
 218          var _this = this;
 219          var _a = this.props, onResize = _a.onResize, maxRows = _a.maxRows;
 220          if (typeof maxRows === 'number') {
 221              this.updateLineHeight();
 222          }
 223          /*
 224            the defer is needed to:
 225              - force "autosize" to activate the scrollbar when this.props.maxRows is passed
 226              - support StyledComponents (see #71)
 227          */
 228          setTimeout(function () { return autosize(_this.textarea); });
 229          if (onResize) {
 230              this.textarea.addEventListener(RESIZED, onResize);
 231          }
 232      };
 233      TextareaAutosize.prototype.componentWillUnmount = function () {
 234          var onResize = this.props.onResize;
 235          if (onResize) {
 236              this.textarea.removeEventListener(RESIZED, onResize);
 237          }
 238          this.dispatchEvent(DESTROY);
 239      };
 240      TextareaAutosize.prototype.render = function () {
 241          var _a = this.getLocals(), children = _a.children, saveDOMNodeRef = _a.saveDOMNodeRef, locals = __rest(_a, ["children", "saveDOMNodeRef"]);
 242          return (React.createElement("textarea", __assign({}, locals, { ref: saveDOMNodeRef }), children));
 243      };
 244      TextareaAutosize.prototype.componentDidUpdate = function (prevProps) {
 245          if (this.props.value !== this.currentValue || this.props.rows !== prevProps.rows) {
 246              this.dispatchEvent(UPDATE);
 247          }
 248      };
 249      TextareaAutosize.defaultProps = {
 250          rows: 1
 251      };
 252      TextareaAutosize.propTypes = {
 253          rows: PropTypes.number,
 254          maxRows: PropTypes.number,
 255          onResize: PropTypes.func,
 256          innerRef: PropTypes.func
 257      };
 258      return TextareaAutosize;
 259  }(React.Component));
 260  exports["default"] = TextareaAutosize;
 261  
 262  
 263  /***/ }),
 264  
 265  /***/ 112:
 266  /***/ (function(module, exports, __webpack_require__) {
 267  
 268  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
 269      autosize 4.0.2
 270      license: MIT
 271      http://www.jacklmoore.com/autosize
 272  */
 273  (function (global, factory) {
 274      if (true) {
 275          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
 276                  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
 277                  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
 278                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
 279      } else { var mod; }
 280  })(this, function (module, exports) {
 281      'use strict';
 282  
 283      var map = typeof Map === "function" ? new Map() : function () {
 284          var keys = [];
 285          var values = [];
 286  
 287          return {
 288              has: function has(key) {
 289                  return keys.indexOf(key) > -1;
 290              },
 291              get: function get(key) {
 292                  return values[keys.indexOf(key)];
 293              },
 294              set: function set(key, value) {
 295                  if (keys.indexOf(key) === -1) {
 296                      keys.push(key);
 297                      values.push(value);
 298                  }
 299              },
 300              delete: function _delete(key) {
 301                  var index = keys.indexOf(key);
 302                  if (index > -1) {
 303                      keys.splice(index, 1);
 304                      values.splice(index, 1);
 305                  }
 306              }
 307          };
 308      }();
 309  
 310      var createEvent = function createEvent(name) {
 311          return new Event(name, { bubbles: true });
 312      };
 313      try {
 314          new Event('test');
 315      } catch (e) {
 316          // IE does not support `new Event()`
 317          createEvent = function createEvent(name) {
 318              var evt = document.createEvent('Event');
 319              evt.initEvent(name, true, false);
 320              return evt;
 321          };
 322      }
 323  
 324  	function assign(ta) {
 325          if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
 326  
 327          var heightOffset = null;
 328          var clientWidth = null;
 329          var cachedHeight = null;
 330  
 331  		function init() {
 332              var style = window.getComputedStyle(ta, null);
 333  
 334              if (style.resize === 'vertical') {
 335                  ta.style.resize = 'none';
 336              } else if (style.resize === 'both') {
 337                  ta.style.resize = 'horizontal';
 338              }
 339  
 340              if (style.boxSizing === 'content-box') {
 341                  heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
 342              } else {
 343                  heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
 344              }
 345              // Fix when a textarea is not on document body and heightOffset is Not a Number
 346              if (isNaN(heightOffset)) {
 347                  heightOffset = 0;
 348              }
 349  
 350              update();
 351          }
 352  
 353  		function changeOverflow(value) {
 354              {
 355                  // Chrome/Safari-specific fix:
 356                  // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
 357                  // made available by removing the scrollbar. The following forces the necessary text reflow.
 358                  var width = ta.style.width;
 359                  ta.style.width = '0px';
 360                  // Force reflow:
 361                  /* jshint ignore:start */
 362                  ta.offsetWidth;
 363                  /* jshint ignore:end */
 364                  ta.style.width = width;
 365              }
 366  
 367              ta.style.overflowY = value;
 368          }
 369  
 370  		function getParentOverflows(el) {
 371              var arr = [];
 372  
 373              while (el && el.parentNode && el.parentNode instanceof Element) {
 374                  if (el.parentNode.scrollTop) {
 375                      arr.push({
 376                          node: el.parentNode,
 377                          scrollTop: el.parentNode.scrollTop
 378                      });
 379                  }
 380                  el = el.parentNode;
 381              }
 382  
 383              return arr;
 384          }
 385  
 386  		function resize() {
 387              if (ta.scrollHeight === 0) {
 388                  // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
 389                  return;
 390              }
 391  
 392              var overflows = getParentOverflows(ta);
 393              var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
 394  
 395              ta.style.height = '';
 396              ta.style.height = ta.scrollHeight + heightOffset + 'px';
 397  
 398              // used to check if an update is actually necessary on window.resize
 399              clientWidth = ta.clientWidth;
 400  
 401              // prevents scroll-position jumping
 402              overflows.forEach(function (el) {
 403                  el.node.scrollTop = el.scrollTop;
 404              });
 405  
 406              if (docTop) {
 407                  document.documentElement.scrollTop = docTop;
 408              }
 409          }
 410  
 411  		function update() {
 412              resize();
 413  
 414              var styleHeight = Math.round(parseFloat(ta.style.height));
 415              var computed = window.getComputedStyle(ta, null);
 416  
 417              // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
 418              var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
 419  
 420              // The actual height not matching the style height (set via the resize method) indicates that 
 421              // the max-height has been exceeded, in which case the overflow should be allowed.
 422              if (actualHeight < styleHeight) {
 423                  if (computed.overflowY === 'hidden') {
 424                      changeOverflow('scroll');
 425                      resize();
 426                      actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 427                  }
 428              } else {
 429                  // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
 430                  if (computed.overflowY !== 'hidden') {
 431                      changeOverflow('hidden');
 432                      resize();
 433                      actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 434                  }
 435              }
 436  
 437              if (cachedHeight !== actualHeight) {
 438                  cachedHeight = actualHeight;
 439                  var evt = createEvent('autosize:resized');
 440                  try {
 441                      ta.dispatchEvent(evt);
 442                  } catch (err) {
 443                      // Firefox will throw an error on dispatchEvent for a detached element
 444                      // https://bugzilla.mozilla.org/show_bug.cgi?id=889376
 445                  }
 446              }
 447          }
 448  
 449          var pageResize = function pageResize() {
 450              if (ta.clientWidth !== clientWidth) {
 451                  update();
 452              }
 453          };
 454  
 455          var destroy = function (style) {
 456              window.removeEventListener('resize', pageResize, false);
 457              ta.removeEventListener('input', update, false);
 458              ta.removeEventListener('keyup', update, false);
 459              ta.removeEventListener('autosize:destroy', destroy, false);
 460              ta.removeEventListener('autosize:update', update, false);
 461  
 462              Object.keys(style).forEach(function (key) {
 463                  ta.style[key] = style[key];
 464              });
 465  
 466              map.delete(ta);
 467          }.bind(ta, {
 468              height: ta.style.height,
 469              resize: ta.style.resize,
 470              overflowY: ta.style.overflowY,
 471              overflowX: ta.style.overflowX,
 472              wordWrap: ta.style.wordWrap
 473          });
 474  
 475          ta.addEventListener('autosize:destroy', destroy, false);
 476  
 477          // IE9 does not fire onpropertychange or oninput for deletions,
 478          // so binding to onkeyup to catch most of those events.
 479          // There is no way that I know of to detect something like 'cut' in IE9.
 480          if ('onpropertychange' in ta && 'oninput' in ta) {
 481              ta.addEventListener('keyup', update, false);
 482          }
 483  
 484          window.addEventListener('resize', pageResize, false);
 485          ta.addEventListener('input', update, false);
 486          ta.addEventListener('autosize:update', update, false);
 487          ta.style.overflowX = 'hidden';
 488          ta.style.wordWrap = 'break-word';
 489  
 490          map.set(ta, {
 491              destroy: destroy,
 492              update: update
 493          });
 494  
 495          init();
 496      }
 497  
 498  	function destroy(ta) {
 499          var methods = map.get(ta);
 500          if (methods) {
 501              methods.destroy();
 502          }
 503      }
 504  
 505  	function update(ta) {
 506          var methods = map.get(ta);
 507          if (methods) {
 508              methods.update();
 509          }
 510      }
 511  
 512      var autosize = null;
 513  
 514      // Do nothing in Node.js environment and IE8 (or lower)
 515      if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
 516          autosize = function autosize(el) {
 517              return el;
 518          };
 519          autosize.destroy = function (el) {
 520              return el;
 521          };
 522          autosize.update = function (el) {
 523              return el;
 524          };
 525      } else {
 526          autosize = function autosize(el, options) {
 527              if (el) {
 528                  Array.prototype.forEach.call(el.length ? el : [el], function (x) {
 529                      return assign(x, options);
 530                  });
 531              }
 532              return el;
 533          };
 534          autosize.destroy = function (el) {
 535              if (el) {
 536                  Array.prototype.forEach.call(el.length ? el : [el], destroy);
 537              }
 538              return el;
 539          };
 540          autosize.update = function (el) {
 541              if (el) {
 542                  Array.prototype.forEach.call(el.length ? el : [el], update);
 543              }
 544              return el;
 545          };
 546      }
 547  
 548      exports.default = autosize;
 549      module.exports = exports['default'];
 550  });
 551  
 552  /***/ }),
 553  
 554  /***/ 113:
 555  /***/ (function(module, exports, __webpack_require__) {
 556  
 557  // Load in dependencies
 558  var computedStyle = __webpack_require__(114);
 559  
 560  /**
 561   * Calculate the `line-height` of a given node
 562   * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM.
 563   * @returns {Number} `line-height` of the element in pixels
 564   */
 565  function lineHeight(node) {
 566    // Grab the line-height via style
 567    var lnHeightStr = computedStyle(node, 'line-height');
 568    var lnHeight = parseFloat(lnHeightStr, 10);
 569  
 570    // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em')
 571    if (lnHeightStr === lnHeight + '') {
 572      // Save the old lineHeight style and update the em unit to the element
 573      var _lnHeightStyle = node.style.lineHeight;
 574      node.style.lineHeight = lnHeightStr + 'em';
 575  
 576      // Calculate the em based height
 577      lnHeightStr = computedStyle(node, 'line-height');
 578      lnHeight = parseFloat(lnHeightStr, 10);
 579  
 580      // Revert the lineHeight style
 581      if (_lnHeightStyle) {
 582        node.style.lineHeight = _lnHeightStyle;
 583      } else {
 584        delete node.style.lineHeight;
 585      }
 586    }
 587  
 588    // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt)
 589    // DEV: `em` units are converted to `pt` in IE6
 590    // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length
 591    if (lnHeightStr.indexOf('pt') !== -1) {
 592      lnHeight *= 4;
 593      lnHeight /= 3;
 594    // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm)
 595    } else if (lnHeightStr.indexOf('mm') !== -1) {
 596      lnHeight *= 96;
 597      lnHeight /= 25.4;
 598    // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm)
 599    } else if (lnHeightStr.indexOf('cm') !== -1) {
 600      lnHeight *= 96;
 601      lnHeight /= 2.54;
 602    // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in)
 603    } else if (lnHeightStr.indexOf('in') !== -1) {
 604      lnHeight *= 96;
 605    // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc)
 606    } else if (lnHeightStr.indexOf('pc') !== -1) {
 607      lnHeight *= 16;
 608    }
 609  
 610    // Continue our computation
 611    lnHeight = Math.round(lnHeight);
 612  
 613    // If the line-height is "normal", calculate by font-size
 614    if (lnHeightStr === 'normal') {
 615      // Create a temporary node
 616      var nodeName = node.nodeName;
 617      var _node = document.createElement(nodeName);
 618      _node.innerHTML = '&nbsp;';
 619  
 620      // If we have a text area, reset it to only 1 row
 621      // https://github.com/twolfson/line-height/issues/4
 622      if (nodeName.toUpperCase() === 'TEXTAREA') {
 623        _node.setAttribute('rows', '1');
 624      }
 625  
 626      // Set the font-size of the element
 627      var fontSizeStr = computedStyle(node, 'font-size');
 628      _node.style.fontSize = fontSizeStr;
 629  
 630      // Remove default padding/border which can affect offset height
 631      // https://github.com/twolfson/line-height/issues/4
 632      // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight
 633      _node.style.padding = '0px';
 634      _node.style.border = '0px';
 635  
 636      // Append it to the body
 637      var body = document.body;
 638      body.appendChild(_node);
 639  
 640      // Assume the line height of the element is the height
 641      var height = _node.offsetHeight;
 642      lnHeight = height;
 643  
 644      // Remove our child from the DOM
 645      body.removeChild(_node);
 646    }
 647  
 648    // Return the calculated height
 649    return lnHeight;
 650  }
 651  
 652  // Export lineHeight
 653  module.exports = lineHeight;
 654  
 655  
 656  /***/ }),
 657  
 658  /***/ 114:
 659  /***/ (function(module, exports) {
 660  
 661  // This code has been refactored for 140 bytes
 662  // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js
 663  var computedStyle = function (el, prop, getComputedStyle) {
 664    getComputedStyle = window.getComputedStyle;
 665  
 666    // In one fell swoop
 667    return (
 668      // If we have getComputedStyle
 669      getComputedStyle ?
 670        // Query it
 671        // TODO: From CSS-Query notes, we might need (node, null) for FF
 672        getComputedStyle(el) :
 673  
 674      // Otherwise, we are in IE and use currentStyle
 675        el.currentStyle
 676    )[
 677      // Switch to camelCase for CSSOM
 678      // DEV: Grabbed from jQuery
 679      // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
 680      // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
 681      prop.replace(/-(\w)/gi, function (word, letter) {
 682        return letter.toUpperCase();
 683      })
 684    ];
 685  };
 686  
 687  module.exports = computedStyle;
 688  
 689  
 690  /***/ }),
 691  
 692  /***/ 115:
 693  /***/ (function(module, exports, __webpack_require__) {
 694  
 695  "use strict";
 696  
 697  
 698  var util = __webpack_require__(116);
 699  
 700  function scrollIntoView(elem, container, config) {
 701    config = config || {};
 702    // document 归一化到 window
 703    if (container.nodeType === 9) {
 704      container = util.getWindow(container);
 705    }
 706  
 707    var allowHorizontalScroll = config.allowHorizontalScroll;
 708    var onlyScrollIfNeeded = config.onlyScrollIfNeeded;
 709    var alignWithTop = config.alignWithTop;
 710    var alignWithLeft = config.alignWithLeft;
 711    var offsetTop = config.offsetTop || 0;
 712    var offsetLeft = config.offsetLeft || 0;
 713    var offsetBottom = config.offsetBottom || 0;
 714    var offsetRight = config.offsetRight || 0;
 715  
 716    allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;
 717  
 718    var isWin = util.isWindow(container);
 719    var elemOffset = util.offset(elem);
 720    var eh = util.outerHeight(elem);
 721    var ew = util.outerWidth(elem);
 722    var containerOffset = undefined;
 723    var ch = undefined;
 724    var cw = undefined;
 725    var containerScroll = undefined;
 726    var diffTop = undefined;
 727    var diffBottom = undefined;
 728    var win = undefined;
 729    var winScroll = undefined;
 730    var ww = undefined;
 731    var wh = undefined;
 732  
 733    if (isWin) {
 734      win = container;
 735      wh = util.height(win);
 736      ww = util.width(win);
 737      winScroll = {
 738        left: util.scrollLeft(win),
 739        top: util.scrollTop(win)
 740      };
 741      // elem 相对 container 可视视窗的距离
 742      diffTop = {
 743        left: elemOffset.left - winScroll.left - offsetLeft,
 744        top: elemOffset.top - winScroll.top - offsetTop
 745      };
 746      diffBottom = {
 747        left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,
 748        top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom
 749      };
 750      containerScroll = winScroll;
 751    } else {
 752      containerOffset = util.offset(container);
 753      ch = container.clientHeight;
 754      cw = container.clientWidth;
 755      containerScroll = {
 756        left: container.scrollLeft,
 757        top: container.scrollTop
 758      };
 759      // elem 相对 container 可视视窗的距离
 760      // 注意边框, offset 是边框到根节点
 761      diffTop = {
 762        left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,
 763        top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop
 764      };
 765      diffBottom = {
 766        left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,
 767        top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom
 768      };
 769    }
 770  
 771    if (diffTop.top < 0 || diffBottom.top > 0) {
 772      // 强制向上
 773      if (alignWithTop === true) {
 774        util.scrollTop(container, containerScroll.top + diffTop.top);
 775      } else if (alignWithTop === false) {
 776        util.scrollTop(container, containerScroll.top + diffBottom.top);
 777      } else {
 778        // 自动调整
 779        if (diffTop.top < 0) {
 780          util.scrollTop(container, containerScroll.top + diffTop.top);
 781        } else {
 782          util.scrollTop(container, containerScroll.top + diffBottom.top);
 783        }
 784      }
 785    } else {
 786      if (!onlyScrollIfNeeded) {
 787        alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;
 788        if (alignWithTop) {
 789          util.scrollTop(container, containerScroll.top + diffTop.top);
 790        } else {
 791          util.scrollTop(container, containerScroll.top + diffBottom.top);
 792        }
 793      }
 794    }
 795  
 796    if (allowHorizontalScroll) {
 797      if (diffTop.left < 0 || diffBottom.left > 0) {
 798        // 强制向上
 799        if (alignWithLeft === true) {
 800          util.scrollLeft(container, containerScroll.left + diffTop.left);
 801        } else if (alignWithLeft === false) {
 802          util.scrollLeft(container, containerScroll.left + diffBottom.left);
 803        } else {
 804          // 自动调整
 805          if (diffTop.left < 0) {
 806            util.scrollLeft(container, containerScroll.left + diffTop.left);
 807          } else {
 808            util.scrollLeft(container, containerScroll.left + diffBottom.left);
 809          }
 810        }
 811      } else {
 812        if (!onlyScrollIfNeeded) {
 813          alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;
 814          if (alignWithLeft) {
 815            util.scrollLeft(container, containerScroll.left + diffTop.left);
 816          } else {
 817            util.scrollLeft(container, containerScroll.left + diffBottom.left);
 818          }
 819        }
 820      }
 821    }
 822  }
 823  
 824  module.exports = scrollIntoView;
 825  
 826  /***/ }),
 827  
 828  /***/ 116:
 829  /***/ (function(module, exports, __webpack_require__) {
 830  
 831  "use strict";
 832  
 833  
 834  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
 835  
 836  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
 837  
 838  var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
 839  
 840  function getClientPosition(elem) {
 841    var box = undefined;
 842    var x = undefined;
 843    var y = undefined;
 844    var doc = elem.ownerDocument;
 845    var body = doc.body;
 846    var docElem = doc && doc.documentElement;
 847    // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
 848    box = elem.getBoundingClientRect();
 849  
 850    // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
 851    // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
 852    // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
 853  
 854    x = box.left;
 855    y = box.top;
 856  
 857    // In IE, most of the time, 2 extra pixels are added to the top and left
 858    // due to the implicit 2-pixel inset border.  In IE6/7 quirks mode and
 859    // IE6 standards mode, this border can be overridden by setting the
 860    // document element's border to zero -- thus, we cannot rely on the
 861    // offset always being 2 pixels.
 862  
 863    // In quirks mode, the offset can be determined by querying the body's
 864    // clientLeft/clientTop, but in standards mode, it is found by querying
 865    // the document element's clientLeft/clientTop.  Since we already called
 866    // getClientBoundingRect we have already forced a reflow, so it is not
 867    // too expensive just to query them all.
 868  
 869    // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
 870    // 窗口边框标准是设 documentElement ,quirks 时设置 body
 871    // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
 872    // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
 873    // 标准 ie 下 docElem.clientTop 就是 border-top
 874    // ie7 html 即窗口边框改变不了。永远为 2
 875    // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
 876  
 877    x -= docElem.clientLeft || body.clientLeft || 0;
 878    y -= docElem.clientTop || body.clientTop || 0;
 879  
 880    return {
 881      left: x,
 882      top: y
 883    };
 884  }
 885  
 886  function getScroll(w, top) {
 887    var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
 888    var method = 'scroll' + (top ? 'Top' : 'Left');
 889    if (typeof ret !== 'number') {
 890      var d = w.document;
 891      // ie6,7,8 standard mode
 892      ret = d.documentElement[method];
 893      if (typeof ret !== 'number') {
 894        // quirks mode
 895        ret = d.body[method];
 896      }
 897    }
 898    return ret;
 899  }
 900  
 901  function getScrollLeft(w) {
 902    return getScroll(w);
 903  }
 904  
 905  function getScrollTop(w) {
 906    return getScroll(w, true);
 907  }
 908  
 909  function getOffset(el) {
 910    var pos = getClientPosition(el);
 911    var doc = el.ownerDocument;
 912    var w = doc.defaultView || doc.parentWindow;
 913    pos.left += getScrollLeft(w);
 914    pos.top += getScrollTop(w);
 915    return pos;
 916  }
 917  function _getComputedStyle(elem, name, computedStyle_) {
 918    var val = '';
 919    var d = elem.ownerDocument;
 920    var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);
 921  
 922    // https://github.com/kissyteam/kissy/issues/61
 923    if (computedStyle) {
 924      val = computedStyle.getPropertyValue(name) || computedStyle[name];
 925    }
 926  
 927    return val;
 928  }
 929  
 930  var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
 931  var RE_POS = /^(top|right|bottom|left)$/;
 932  var CURRENT_STYLE = 'currentStyle';
 933  var RUNTIME_STYLE = 'runtimeStyle';
 934  var LEFT = 'left';
 935  var PX = 'px';
 936  
 937  function _getComputedStyleIE(elem, name) {
 938    // currentStyle maybe null
 939    // http://msdn.microsoft.com/en-us/library/ms535231.aspx
 940    var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
 941  
 942    // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
 943    // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
 944    // 在 ie 下不对,需要直接用 offset 方式
 945    // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
 946  
 947    // From the awesome hack by Dean Edwards
 948    // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
 949    // If we're not dealing with a regular pixel number
 950    // but a number that has a weird ending, we need to convert it to pixels
 951    // exclude left right for relativity
 952    if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
 953      // Remember the original values
 954      var style = elem.style;
 955      var left = style[LEFT];
 956      var rsLeft = elem[RUNTIME_STYLE][LEFT];
 957  
 958      // prevent flashing of content
 959      elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
 960  
 961      // Put in the new values to get a computed value out
 962      style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
 963      ret = style.pixelLeft + PX;
 964  
 965      // Revert the changed values
 966      style[LEFT] = left;
 967  
 968      elem[RUNTIME_STYLE][LEFT] = rsLeft;
 969    }
 970    return ret === '' ? 'auto' : ret;
 971  }
 972  
 973  var getComputedStyleX = undefined;
 974  if (typeof window !== 'undefined') {
 975    getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
 976  }
 977  
 978  function each(arr, fn) {
 979    for (var i = 0; i < arr.length; i++) {
 980      fn(arr[i]);
 981    }
 982  }
 983  
 984  function isBorderBoxFn(elem) {
 985    return getComputedStyleX(elem, 'boxSizing') === 'border-box';
 986  }
 987  
 988  var BOX_MODELS = ['margin', 'border', 'padding'];
 989  var CONTENT_INDEX = -1;
 990  var PADDING_INDEX = 2;
 991  var BORDER_INDEX = 1;
 992  var MARGIN_INDEX = 0;
 993  
 994  function swap(elem, options, callback) {
 995    var old = {};
 996    var style = elem.style;
 997    var name = undefined;
 998  
 999    // Remember the old values, and insert the new ones
1000    for (name in options) {
1001      if (options.hasOwnProperty(name)) {
1002        old[name] = style[name];
1003        style[name] = options[name];
1004      }
1005    }
1006  
1007    callback.call(elem);
1008  
1009    // Revert the old values
1010    for (name in options) {
1011      if (options.hasOwnProperty(name)) {
1012        style[name] = old[name];
1013      }
1014    }
1015  }
1016  
1017  function getPBMWidth(elem, props, which) {
1018    var value = 0;
1019    var prop = undefined;
1020    var j = undefined;
1021    var i = undefined;
1022    for (j = 0; j < props.length; j++) {
1023      prop = props[j];
1024      if (prop) {
1025        for (i = 0; i < which.length; i++) {
1026          var cssProp = undefined;
1027          if (prop === 'border') {
1028            cssProp = prop + which[i] + 'Width';
1029          } else {
1030            cssProp = prop + which[i];
1031          }
1032          value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
1033        }
1034      }
1035    }
1036    return value;
1037  }
1038  
1039  /**
1040   * A crude way of determining if an object is a window
1041   * @member util
1042   */
1043  function isWindow(obj) {
1044    // must use == for ie8
1045    /* eslint eqeqeq:0 */
1046    return obj != null && obj == obj.window;
1047  }
1048  
1049  var domUtils = {};
1050  
1051  each(['Width', 'Height'], function (name) {
1052    domUtils['doc' + name] = function (refWin) {
1053      var d = refWin.document;
1054      return Math.max(
1055      // firefox chrome documentElement.scrollHeight< body.scrollHeight
1056      // ie standard mode : documentElement.scrollHeight> body.scrollHeight
1057      d.documentElement['scroll' + name],
1058      // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
1059      d.body['scroll' + name], domUtils['viewport' + name](d));
1060    };
1061  
1062    domUtils['viewport' + name] = function (win) {
1063      // pc browser includes scrollbar in window.innerWidth
1064      var prop = 'client' + name;
1065      var doc = win.document;
1066      var body = doc.body;
1067      var documentElement = doc.documentElement;
1068      var documentElementProp = documentElement[prop];
1069      // 标准模式取 documentElement
1070      // backcompat 取 body
1071      return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
1072    };
1073  });
1074  
1075  /*
1076   得到元素的大小信息
1077   @param elem
1078   @param name
1079   @param {String} [extra]  'padding' : (css width) + padding
1080   'border' : (css width) + padding + border
1081   'margin' : (css width) + padding + border + margin
1082   */
1083  function getWH(elem, name, extra) {
1084    if (isWindow(elem)) {
1085      return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
1086    } else if (elem.nodeType === 9) {
1087      return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
1088    }
1089    var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
1090    var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;
1091    var computedStyle = getComputedStyleX(elem);
1092    var isBorderBox = isBorderBoxFn(elem, computedStyle);
1093    var cssBoxValue = 0;
1094    if (borderBoxValue == null || borderBoxValue <= 0) {
1095      borderBoxValue = undefined;
1096      // Fall back to computed then un computed css if necessary
1097      cssBoxValue = getComputedStyleX(elem, name);
1098      if (cssBoxValue == null || Number(cssBoxValue) < 0) {
1099        cssBoxValue = elem.style[name] || 0;
1100      }
1101      // Normalize '', auto, and prepare for extra
1102      cssBoxValue = parseFloat(cssBoxValue) || 0;
1103    }
1104    if (extra === undefined) {
1105      extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
1106    }
1107    var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
1108    var val = borderBoxValue || cssBoxValue;
1109    if (extra === CONTENT_INDEX) {
1110      if (borderBoxValueOrIsBorderBox) {
1111        return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
1112      }
1113      return cssBoxValue;
1114    }
1115    if (borderBoxValueOrIsBorderBox) {
1116      var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);
1117      return val + (extra === BORDER_INDEX ? 0 : padding);
1118    }
1119    return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
1120  }
1121  
1122  var cssShow = {
1123    position: 'absolute',
1124    visibility: 'hidden',
1125    display: 'block'
1126  };
1127  
1128  // fix #119 : https://github.com/kissyteam/kissy/issues/119
1129  function getWHIgnoreDisplay(elem) {
1130    var val = undefined;
1131    var args = arguments;
1132    // in case elem is window
1133    // elem.offsetWidth === undefined
1134    if (elem.offsetWidth !== 0) {
1135      val = getWH.apply(undefined, args);
1136    } else {
1137      swap(elem, cssShow, function () {
1138        val = getWH.apply(undefined, args);
1139      });
1140    }
1141    return val;
1142  }
1143  
1144  function css(el, name, v) {
1145    var value = v;
1146    if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
1147      for (var i in name) {
1148        if (name.hasOwnProperty(i)) {
1149          css(el, i, name[i]);
1150        }
1151      }
1152      return undefined;
1153    }
1154    if (typeof value !== 'undefined') {
1155      if (typeof value === 'number') {
1156        value += 'px';
1157      }
1158      el.style[name] = value;
1159      return undefined;
1160    }
1161    return getComputedStyleX(el, name);
1162  }
1163  
1164  each(['width', 'height'], function (name) {
1165    var first = name.charAt(0).toUpperCase() + name.slice(1);
1166    domUtils['outer' + first] = function (el, includeMargin) {
1167      return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
1168    };
1169    var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
1170  
1171    domUtils[name] = function (elem, val) {
1172      if (val !== undefined) {
1173        if (elem) {
1174          var computedStyle = getComputedStyleX(elem);
1175          var isBorderBox = isBorderBoxFn(elem);
1176          if (isBorderBox) {
1177            val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
1178          }
1179          return css(elem, name, val);
1180        }
1181        return undefined;
1182      }
1183      return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
1184    };
1185  });
1186  
1187  // 设置 elem 相对 elem.ownerDocument 的坐标
1188  function setOffset(elem, offset) {
1189    // set position first, in-case top/left are set even on static elem
1190    if (css(elem, 'position') === 'static') {
1191      elem.style.position = 'relative';
1192    }
1193  
1194    var old = getOffset(elem);
1195    var ret = {};
1196    var current = undefined;
1197    var key = undefined;
1198  
1199    for (key in offset) {
1200      if (offset.hasOwnProperty(key)) {
1201        current = parseFloat(css(elem, key)) || 0;
1202        ret[key] = current + offset[key] - old[key];
1203      }
1204    }
1205    css(elem, ret);
1206  }
1207  
1208  module.exports = _extends({
1209    getWindow: function getWindow(node) {
1210      var doc = node.ownerDocument || node;
1211      return doc.defaultView || doc.parentWindow;
1212    },
1213    offset: function offset(el, value) {
1214      if (typeof value !== 'undefined') {
1215        setOffset(el, value);
1216      } else {
1217        return getOffset(el);
1218      }
1219    },
1220  
1221    isWindow: isWindow,
1222    each: each,
1223    css: css,
1224    clone: function clone(obj) {
1225      var ret = {};
1226      for (var i in obj) {
1227        if (obj.hasOwnProperty(i)) {
1228          ret[i] = obj[i];
1229        }
1230      }
1231      var overflow = obj.overflow;
1232      if (overflow) {
1233        for (var i in obj) {
1234          if (obj.hasOwnProperty(i)) {
1235            ret.overflow[i] = obj.overflow[i];
1236          }
1237        }
1238      }
1239      return ret;
1240    },
1241    scrollLeft: function scrollLeft(w, v) {
1242      if (isWindow(w)) {
1243        if (v === undefined) {
1244          return getScrollLeft(w);
1245        }
1246        window.scrollTo(v, getScrollTop(w));
1247      } else {
1248        if (v === undefined) {
1249          return w.scrollLeft;
1250        }
1251        w.scrollLeft = v;
1252      }
1253    },
1254    scrollTop: function scrollTop(w, v) {
1255      if (isWindow(w)) {
1256        if (v === undefined) {
1257          return getScrollTop(w);
1258        }
1259        window.scrollTo(getScrollLeft(w), v);
1260      } else {
1261        if (v === undefined) {
1262          return w.scrollTop;
1263        }
1264        w.scrollTop = v;
1265      }
1266    },
1267  
1268    viewportWidth: 0,
1269    viewportHeight: 0
1270  }, domUtils);
1271  
1272  /***/ }),
1273  
1274  /***/ 12:
1275  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1276  
1277  "use strict";
1278  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
1279  function _getPrototypeOf(o) {
1280    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
1281      return o.__proto__ || Object.getPrototypeOf(o);
1282    };
1283    return _getPrototypeOf(o);
1284  }
1285  
1286  /***/ }),
1287  
1288  /***/ 13:
1289  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1290  
1291  "use strict";
1292  
1293  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
1294  function _setPrototypeOf(o, p) {
1295    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
1296      o.__proto__ = p;
1297      return o;
1298    };
1299  
1300    return _setPrototypeOf(o, p);
1301  }
1302  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
1303  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
1304  
1305  function _inherits(subClass, superClass) {
1306    if (typeof superClass !== "function" && superClass !== null) {
1307      throw new TypeError("Super expression must either be null or a function");
1308    }
1309  
1310    subClass.prototype = Object.create(superClass && superClass.prototype, {
1311      constructor: {
1312        value: subClass,
1313        writable: true,
1314        configurable: true
1315      }
1316    });
1317    if (superClass) _setPrototypeOf(subClass, superClass);
1318  }
1319  
1320  /***/ }),
1321  
1322  /***/ 137:
1323  /***/ (function(module, exports) {
1324  
1325  (function() { module.exports = this["wp"]["tokenList"]; }());
1326  
1327  /***/ }),
1328  
1329  /***/ 14:
1330  /***/ (function(module, exports) {
1331  
1332  (function() { module.exports = this["wp"]["blocks"]; }());
1333  
1334  /***/ }),
1335  
1336  /***/ 15:
1337  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1338  
1339  "use strict";
1340  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
1341  function _defineProperty(obj, key, value) {
1342    if (key in obj) {
1343      Object.defineProperty(obj, key, {
1344        value: value,
1345        enumerable: true,
1346        configurable: true,
1347        writable: true
1348      });
1349    } else {
1350      obj[key] = value;
1351    }
1352  
1353    return obj;
1354  }
1355  
1356  /***/ }),
1357  
1358  /***/ 16:
1359  /***/ (function(module, exports, __webpack_require__) {
1360  
1361  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
1362    Copyright (c) 2017 Jed Watson.
1363    Licensed under the MIT License (MIT), see
1364    http://jedwatson.github.io/classnames
1365  */
1366  /* global define */
1367  
1368  (function () {
1369      'use strict';
1370  
1371      var hasOwn = {}.hasOwnProperty;
1372  
1373  	function classNames () {
1374          var classes = [];
1375  
1376          for (var i = 0; i < arguments.length; i++) {
1377              var arg = arguments[i];
1378              if (!arg) continue;
1379  
1380              var argType = typeof arg;
1381  
1382              if (argType === 'string' || argType === 'number') {
1383                  classes.push(arg);
1384              } else if (Array.isArray(arg) && arg.length) {
1385                  var inner = classNames.apply(null, arg);
1386                  if (inner) {
1387                      classes.push(inner);
1388                  }
1389              } else if (argType === 'object') {
1390                  for (var key in arg) {
1391                      if (hasOwn.call(arg, key) && arg[key]) {
1392                          classes.push(key);
1393                      }
1394                  }
1395              }
1396          }
1397  
1398          return classes.join(' ');
1399      }
1400  
1401      if ( true && module.exports) {
1402          classNames.default = classNames;
1403          module.exports = classNames;
1404      } else if (true) {
1405          // register as 'classnames', consistent with npm package name
1406          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
1407              return classNames;
1408          }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
1409                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
1410      } else {}
1411  }());
1412  
1413  
1414  /***/ }),
1415  
1416  /***/ 17:
1417  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1418  
1419  "use strict";
1420  
1421  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
1422  function _arrayWithoutHoles(arr) {
1423    if (Array.isArray(arr)) {
1424      for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
1425        arr2[i] = arr[i];
1426      }
1427  
1428      return arr2;
1429    }
1430  }
1431  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
1432  var iterableToArray = __webpack_require__(34);
1433  
1434  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
1435  function _nonIterableSpread() {
1436    throw new TypeError("Invalid attempt to spread non-iterable instance");
1437  }
1438  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
1439  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
1440  
1441  
1442  
1443  function _toConsumableArray(arr) {
1444    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread();
1445  }
1446  
1447  /***/ }),
1448  
1449  /***/ 18:
1450  /***/ (function(module, exports) {
1451  
1452  (function() { module.exports = this["wp"]["keycodes"]; }());
1453  
1454  /***/ }),
1455  
1456  /***/ 19:
1457  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1458  
1459  "use strict";
1460  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
1461  function _extends() {
1462    _extends = Object.assign || function (target) {
1463      for (var i = 1; i < arguments.length; i++) {
1464        var source = arguments[i];
1465  
1466        for (var key in source) {
1467          if (Object.prototype.hasOwnProperty.call(source, key)) {
1468            target[key] = source[key];
1469          }
1470        }
1471      }
1472  
1473      return target;
1474    };
1475  
1476    return _extends.apply(this, arguments);
1477  }
1478  
1479  /***/ }),
1480  
1481  /***/ 2:
1482  /***/ (function(module, exports) {
1483  
1484  (function() { module.exports = this["lodash"]; }());
1485  
1486  /***/ }),
1487  
1488  /***/ 20:
1489  /***/ (function(module, exports) {
1490  
1491  (function() { module.exports = this["wp"]["richText"]; }());
1492  
1493  /***/ }),
1494  
1495  /***/ 201:
1496  /***/ (function(module, exports, __webpack_require__) {
1497  
1498  /*!
1499  
1500   diff v3.5.0
1501  
1502  Software License Agreement (BSD License)
1503  
1504  Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
1505  
1506  All rights reserved.
1507  
1508  Redistribution and use of this software in source and binary forms, with or without modification,
1509  are permitted provided that the following conditions are met:
1510  
1511  * Redistributions of source code must retain the above
1512    copyright notice, this list of conditions and the
1513    following disclaimer.
1514  
1515  * Redistributions in binary form must reproduce the above
1516    copyright notice, this list of conditions and the
1517    following disclaimer in the documentation and/or other
1518    materials provided with the distribution.
1519  
1520  * Neither the name of Kevin Decker nor the names of its
1521    contributors may be used to endorse or promote products
1522    derived from this software without specific prior
1523    written permission.
1524  
1525  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
1526  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
1527  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
1528  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1529  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1530  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
1531  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
1532  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1533  @license
1534  */
1535  (function webpackUniversalModuleDefinition(root, factory) {
1536      if(true)
1537          module.exports = factory();
1538      else {}
1539  })(this, function() {
1540  return /******/ (function(modules) { // webpackBootstrap
1541  /******/     // The module cache
1542  /******/     var installedModules = {};
1543  
1544  /******/     // The require function
1545  /******/ 	function __webpack_require__(moduleId) {
1546  
1547  /******/         // Check if module is in cache
1548  /******/         if(installedModules[moduleId])
1549  /******/             return installedModules[moduleId].exports;
1550  
1551  /******/         // Create a new module (and put it into the cache)
1552  /******/         var module = installedModules[moduleId] = {
1553  /******/             exports: {},
1554  /******/             id: moduleId,
1555  /******/             loaded: false
1556  /******/         };
1557  
1558  /******/         // Execute the module function
1559  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1560  
1561  /******/         // Flag the module as loaded
1562  /******/         module.loaded = true;
1563  
1564  /******/         // Return the exports of the module
1565  /******/         return module.exports;
1566  /******/     }
1567  
1568  
1569  /******/     // expose the modules object (__webpack_modules__)
1570  /******/     __webpack_require__.m = modules;
1571  
1572  /******/     // expose the module cache
1573  /******/     __webpack_require__.c = installedModules;
1574  
1575  /******/     // __webpack_public_path__
1576  /******/     __webpack_require__.p = "";
1577  
1578  /******/     // Load entry module and return exports
1579  /******/     return __webpack_require__(0);
1580  /******/ })
1581  /************************************************************************/
1582  /******/ ([
1583  /* 0 */
1584  /***/ (function(module, exports, __webpack_require__) {
1585  
1586      /*istanbul ignore start*/'use strict';
1587  
1588      exports.__esModule = true;
1589      exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.merge = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffArrays = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined;
1590  
1591      /*istanbul ignore end*/var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
1592  
1593      /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
1594  
1595      /*istanbul ignore end*/var /*istanbul ignore start*/_character = __webpack_require__(2) /*istanbul ignore end*/;
1596  
1597      var /*istanbul ignore start*/_word = __webpack_require__(3) /*istanbul ignore end*/;
1598  
1599      var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/;
1600  
1601      var /*istanbul ignore start*/_sentence = __webpack_require__(6) /*istanbul ignore end*/;
1602  
1603      var /*istanbul ignore start*/_css = __webpack_require__(7) /*istanbul ignore end*/;
1604  
1605      var /*istanbul ignore start*/_json = __webpack_require__(8) /*istanbul ignore end*/;
1606  
1607      var /*istanbul ignore start*/_array = __webpack_require__(9) /*istanbul ignore end*/;
1608  
1609      var /*istanbul ignore start*/_apply = __webpack_require__(10) /*istanbul ignore end*/;
1610  
1611      var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/;
1612  
1613      var /*istanbul ignore start*/_merge = __webpack_require__(13) /*istanbul ignore end*/;
1614  
1615      var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/;
1616  
1617      var /*istanbul ignore start*/_dmp = __webpack_require__(16) /*istanbul ignore end*/;
1618  
1619      var /*istanbul ignore start*/_xml = __webpack_require__(17) /*istanbul ignore end*/;
1620  
1621      /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
1622  
1623      /* See LICENSE file for terms of use */
1624  
1625      /*
1626       * Text diff implementation.
1627       *
1628       * This library supports the following APIS:
1629       * JsDiff.diffChars: Character by character diff
1630       * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
1631       * JsDiff.diffLines: Line based diff
1632       *
1633       * JsDiff.diffCss: Diff targeted at CSS content
1634       *
1635       * These methods are based on the implementation proposed in
1636       * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
1637       * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
1638       */
1639      exports. /*istanbul ignore end*/Diff = _base2['default'];
1640      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = _character.diffChars;
1641      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = _word.diffWords;
1642      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = _word.diffWordsWithSpace;
1643      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = _line.diffLines;
1644      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = _line.diffTrimmedLines;
1645      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = _sentence.diffSentences;
1646      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = _css.diffCss;
1647      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = _json.diffJson;
1648      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffArrays = _array.diffArrays;
1649      /*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = _create.structuredPatch;
1650      /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = _create.createTwoFilesPatch;
1651      /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = _create.createPatch;
1652      /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = _apply.applyPatch;
1653      /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = _apply.applyPatches;
1654      /*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = _parse.parsePatch;
1655      /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = _merge.merge;
1656      /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = _dmp.convertChangesToDMP;
1657      /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = _xml.convertChangesToXML;
1658      /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = _json.canonicalize;
1659      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJEaWZmIiwiZGlmZkNoYXJzIiwiZGlmZldvcmRzIiwiZGlmZldvcmRzV2l0aFNwYWNlIiwiZGlmZkxpbmVzIiwiZGlmZlRyaW1tZWRMaW5lcyIsImRpZmZTZW50ZW5jZXMiLCJkaWZmQ3NzIiwiZGlmZkpzb24iLCJkaWZmQXJyYXlzIiwic3RydWN0dXJlZFBhdGNoIiwiY3JlYXRlVHdvRmlsZXNQYXRjaCIsImNyZWF0ZVBhdGNoIiwiYXBwbHlQYXRjaCIsImFwcGx5UGF0Y2hlcyIsInBhcnNlUGF0Y2giLCJtZXJnZSIsImNvbnZlcnRDaGFuZ2VzVG9ETVAiLCJjb252ZXJ0Q2hhbmdlc1RvWE1MIiwiY2Fub25pY2FsaXplIl0sIm1hcHBpbmdzIjoiOzs7Ozt1QkFnQkE7Ozs7dUJBQ0E7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBRUE7O0FBQ0E7O0FBRUE7O0FBRUE7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBRUE7O0FBQ0E7Ozs7QUFqQ0E7O0FBRUE7Ozs7Ozs7Ozs7Ozs7O2dDQWtDRUEsSTt5REFFQUMsUzt5REFDQUMsUzt5REFDQUMsa0I7eURBQ0FDLFM7eURBQ0FDLGdCO3lEQUNBQyxhO3lEQUVBQyxPO3lE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R1cmVkUGF0Y2gsXG4gIGNyZWF0ZVR3b0ZpbGVzUGF0Y2gsXG4gIGNyZWF0ZVBhdGNoLFxuICBhcHBseVBhdGNoLFxuICBhcHBseVBhdGNoZXMsXG4gIHBhcnNlUGF0Y2gsXG4gIG1lcmdlLFxuICBjb252ZXJ0Q2hhbmdlc1RvRE1QLFxuICBjb252ZXJ0Q2hhbmdlc1RvWE1MLFxuICBjYW5vbmljYWxpemVcbn07XG4iXX0=
1660  
1661  
1662  /***/ }),
1663  /* 1 */
1664  /***/ (function(module, exports) {
1665  
1666      /*istanbul ignore start*/'use strict';
1667  
1668      exports.__esModule = true;
1669      exports['default'] = /*istanbul ignore end*/Diff;
1670  	function Diff() {}
1671  
1672      Diff.prototype = {
1673        /*istanbul ignore start*/ /*istanbul ignore end*/diff: function diff(oldString, newString) {
1674          /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1675  
1676          var callback = options.callback;
1677          if (typeof options === 'function') {
1678            callback = options;
1679            options = {};
1680          }
1681          this.options = options;
1682  
1683          var self = this;
1684  
1685  	    function done(value) {
1686            if (callback) {
1687              setTimeout(function () {
1688                callback(undefined, value);
1689              }, 0);
1690              return true;
1691            } else {
1692              return value;
1693            }
1694          }
1695  
1696          // Allow subclasses to massage the input prior to running
1697          oldString = this.castInput(oldString);
1698          newString = this.castInput(newString);
1699  
1700          oldString = this.removeEmpty(this.tokenize(oldString));
1701          newString = this.removeEmpty(this.tokenize(newString));
1702  
1703          var newLen = newString.length,
1704              oldLen = oldString.length;
1705          var editLength = 1;
1706          var maxEditLength = newLen + oldLen;
1707          var bestPath = [{ newPos: -1, components: [] }];
1708  
1709          // Seed editLength = 0, i.e. the content starts with the same values
1710          var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
1711          if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
1712            // Identity per the equality and tokenizer
1713            return done([{ value: this.join(newString), count: newString.length }]);
1714          }
1715  
1716          // Main worker method. checks all permutations of a given edit length for acceptance.
1717  	    function execEditLength() {
1718            for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
1719              var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
1720              var addPath = bestPath[diagonalPath - 1],
1721                  removePath = bestPath[diagonalPath + 1],
1722                  _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
1723              if (addPath) {
1724                // No one else is going to attempt to use this value, clear it
1725                bestPath[diagonalPath - 1] = undefined;
1726              }
1727  
1728              var canAdd = addPath && addPath.newPos + 1 < newLen,
1729                  canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
1730              if (!canAdd && !canRemove) {
1731                // If this path is a terminal then prune
1732                bestPath[diagonalPath] = undefined;
1733                continue;
1734              }
1735  
1736              // Select the diagonal that we want to branch from. We select the prior
1737              // path whose position in the new string is the farthest from the origin
1738              // and does not pass the bounds of the diff graph
1739              if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
1740                basePath = clonePath(removePath);
1741                self.pushComponent(basePath.components, undefined, true);
1742              } else {
1743                basePath = addPath; // No need to clone, we've pulled it from the list
1744                basePath.newPos++;
1745                self.pushComponent(basePath.components, true, undefined);
1746              }
1747  
1748              _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
1749  
1750              // If we have hit the end of both strings, then we are done
1751              if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
1752                return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
1753              } else {
1754                // Otherwise track this path as a potential candidate and continue.
1755                bestPath[diagonalPath] = basePath;
1756              }
1757            }
1758  
1759            editLength++;
1760          }
1761  
1762          // Performs the length of edit iteration. Is a bit fugly as this has to support the
1763          // sync and async mode which is never fun. Loops over execEditLength until a value
1764          // is produced.
1765          if (callback) {
1766            (function exec() {
1767              setTimeout(function () {
1768                // This should not happen, but we want to be safe.
1769                /* istanbul ignore next */
1770                if (editLength > maxEditLength) {
1771                  return callback();
1772                }
1773  
1774                if (!execEditLength()) {
1775                  exec();
1776                }
1777              }, 0);
1778            })();
1779          } else {
1780            while (editLength <= maxEditLength) {
1781              var ret = execEditLength();
1782              if (ret) {
1783                return ret;
1784              }
1785            }
1786          }
1787        },
1788        /*istanbul ignore start*/ /*istanbul ignore end*/pushComponent: function pushComponent(components, added, removed) {
1789          var last = components[components.length - 1];
1790          if (last && last.added === added && last.removed === removed) {
1791            // We need to clone here as the component clone operation is just
1792            // as shallow array clone
1793            components[components.length - 1] = { count: last.count + 1, added: added, removed: removed };
1794          } else {
1795            components.push({ count: 1, added: added, removed: removed });
1796          }
1797        },
1798        /*istanbul ignore start*/ /*istanbul ignore end*/extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
1799          var newLen = newString.length,
1800              oldLen = oldString.length,
1801              newPos = basePath.newPos,
1802              oldPos = newPos - diagonalPath,
1803              commonCount = 0;
1804          while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
1805            newPos++;
1806            oldPos++;
1807            commonCount++;
1808          }
1809  
1810          if (commonCount) {
1811            basePath.components.push({ count: commonCount });
1812          }
1813  
1814          basePath.newPos = newPos;
1815          return oldPos;
1816        },
1817        /*istanbul ignore start*/ /*istanbul ignore end*/equals: function equals(left, right) {
1818          if (this.options.comparator) {
1819            return this.options.comparator(left, right);
1820          } else {
1821            return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
1822          }
1823        },
1824        /*istanbul ignore start*/ /*istanbul ignore end*/removeEmpty: function removeEmpty(array) {
1825          var ret = [];
1826          for (var i = 0; i < array.length; i++) {
1827            if (array[i]) {
1828              ret.push(array[i]);
1829            }
1830          }
1831          return ret;
1832        },
1833        /*istanbul ignore start*/ /*istanbul ignore end*/castInput: function castInput(value) {
1834          return value;
1835        },
1836        /*istanbul ignore start*/ /*istanbul ignore end*/tokenize: function tokenize(value) {
1837          return value.split('');
1838        },
1839        /*istanbul ignore start*/ /*istanbul ignore end*/join: function join(chars) {
1840          return chars.join('');
1841        }
1842      };
1843  
1844  	function buildValues(diff, components, newString, oldString, useLongestToken) {
1845        var componentPos = 0,
1846            componentLen = components.length,
1847            newPos = 0,
1848            oldPos = 0;
1849  
1850        for (; componentPos < componentLen; componentPos++) {
1851          var component = components[componentPos];
1852          if (!component.removed) {
1853            if (!component.added && useLongestToken) {
1854              var value = newString.slice(newPos, newPos + component.count);
1855              value = value.map(function (value, i) {
1856                var oldValue = oldString[oldPos + i];
1857                return oldValue.length > value.length ? oldValue : value;
1858              });
1859  
1860              component.value = diff.join(value);
1861            } else {
1862              component.value = diff.join(newString.slice(newPos, newPos + component.count));
1863            }
1864            newPos += component.count;
1865  
1866            // Common case
1867            if (!component.added) {
1868              oldPos += component.count;
1869            }
1870          } else {
1871            component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
1872            oldPos += component.count;
1873  
1874            // Reverse add and remove so removes are output first to match common convention
1875            // The diffing algorithm is tied to add then remove output and this is the simplest
1876            // route to get the desired output with minimal overhead.
1877            if (componentPos && components[componentPos - 1].added) {
1878              var tmp = components[componentPos - 1];
1879              components[componentPos - 1] = components[componentPos];
1880              components[componentPos] = tmp;
1881            }
1882          }
1883        }
1884  
1885        // Special case handle for when one terminal is ignored (i.e. whitespace).
1886        // For this case we merge the terminal into the prior string and drop the change.
1887        // This is only available for string mode.
1888        var lastComponent = components[componentLen - 1];
1889        if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
1890          components[componentLen - 2].value += lastComponent.value;
1891          components.pop();
1892        }
1893  
1894        return components;
1895      }
1896  
1897  	function clonePath(path) {
1898        return { newPos: path.newPos, components: path.components.slice(0) };
1899      }
1900      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOlsiRGlmZiIsIn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CBjb21wb25lbnRQb3MgPSAwLFxuICAgICAgY29tcG9uZW50TGVuID0gY29tcG9uZW50cy5sZW5ndGgsXG4gICAgICBuZXdQb3MgPSAwLFxuICAgICAgb2xkUG9zID0gMDtcblxuICBmb3IgKDsgY29tcG9uZW50UG9zIDwgY29tcG9uZW50TGVuOyBjb21wb25lbnRQb3MrKykge1xuICAgIGxldCBjb21wb25lbnQgPSBjb21wb25lbnRzW2NvbXBvbmVudFBvc107XG4gICAgaWYgKCFjb21wb25lbnQucmVtb3ZlZCkge1xuICAgICAgaWYgKCFjb21wb25lbnQuYWRkZWQgJiYgdXNlTG9uZ2VzdFRva2VuKSB7XG4gICAgICAgIGxldCB2YWx1ZSA9IG5ld1N0cmluZy5zbGljZShuZXdQb3MsIG5ld1BvcyArIGNvbXBvbmVudC5jb3VudCk7XG4gICAgICAgIHZhbHVlID0gdmFsdWUubWFwKGZ1bmN0aW9uKHZhbHVlLCBpKSB7XG4gICAgICAgICAgbGV0IG9sZFZhbHVlID0gb2xkU3RyaW5nW29sZFBvcyArIGldO1xuICAgICAgICAgIHJldHVybiBvbGRWYWx1ZS5sZW5ndGggPiB2YWx1ZS5sZW5ndGggPyBvbGRWYWx1ZSA6IHZhbHVlO1xuICAgICAgICB9KTtcblxuICAgICAgICBjb21wb25lbnQudmFsdWUgPSBkaWZmLmpvaW4odmFsdWUpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29tcG9uZW50LnZhbHVlID0gZGlmZi5qb2luKG5ld1N0cmluZy5zbGljZShuZXdQb3MsIG5ld1BvcyArIGNvbXBvbmVudC5jb3VudCkpO1xuICAgICAgfVxuICAgICAgbmV3UG9zICs9IGNvbXBvbmVudC5jb3VudDtcblxuICAgICAgLy8gQ29tbW9uIGNhc2VcbiAgICAgIGlmICghY29tcG9uZW50LmFkZGVkKSB7XG4gICAgICAgIG9sZFBvcyArPSBjb21wb25lbnQuY291bnQ7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIG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IGxldCBsYXN0Q29tcG9uZW50ID0gY29tcG9uZW50c1tjb21wb25lbnRMZW4gLSAxXTtcbiAgaWYgKGNvbXBvbmVudExlbiA+IDFcbiAgICAgICYmIHR5cGVvZiBsYXN0Q29tcG9uZW50LnZhbHVlID09PSAnc3RyaW5nJ1xuICAgICAgJiYgKGxhc3RDb21wb25lbnQuYWRkZWQgfHwgbGFzdENvbXBvbmVudC5yZW1vdmVkKVxuICAgICAgJiYgZGlmZi5lcXVhbHMoJycsIGxhc3RDb21wb25lbnQudmFsdWUpKSB7XG4gICAgY29tcG9uZW50c1tjb21wb25lbnRMZW4gLSAyXS52YWx1ZSArPSBsYXN0Q29tcG9uZW50LnZhbHVlO1xuICAgIGNvbXBvbmVudHMucG9wKCk7XG4gIH1cblxuICByZXR1cm4gY29tcG9uZW50cztcbn1cblxuZnVuY3Rpb24gY2xvbmVQYXRoKHBhdGgpIHtcbiAgcmV0dXJuIHsgbmV3UG9zOiBwYXRoLm5ld1BvcywgY29tcG9uZW50czogcGF0aC5jb21wb25lbnRzLnNsaWNlKDApIH07XG59XG4iXX0=
1901  
1902  
1903  /***/ }),
1904  /* 2 */
1905  /***/ (function(module, exports, __webpack_require__) {
1906  
1907      /*istanbul ignore start*/'use strict';
1908  
1909      exports.__esModule = true;
1910      exports.characterDiff = undefined;
1911      exports. /*istanbul ignore end*/diffChars = diffChars;
1912  
1913      var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
1914  
1915      /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
1916  
1917  	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
1918  
1919      /*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
1920  	function diffChars(oldStr, newStr, options) {
1921        return characterDiff.diff(oldStr, newStr, options);
1922      }
1923      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6WyJkaWZmQ2hhcnMiLCJjaGFyYWN0ZXJEaWZmIiwib2xkU3RyIiwibmV3U3RyIiwib3B0aW9ucyIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBR2dCQSxTLEdBQUFBLFM7O0FBSGhCOzs7Ozs7dUJBRU8sSUFBTUMseUZBQWdCLHdFQUF0QjtBQUNBLFNBQVNELFNBQVQsQ0FBbUJFLE1BQW5CLEVBQTJCQyxNQUEzQixFQUFtQ0MsT0FBbkMsRUFBNEM7QUFBRSxTQUFPSCxjQUFjSSxJQUFkLENBQW1CSCxNQUFuQixFQUEyQkMsTUFBM0IsRUFBbUNDLE9BQW5DLENBQVA7QUFBcUQiLCJmaWxlIjoiY2hhcmFjdGVyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcblxuZXhwb3J0IGNvbnN0IGNoYXJhY3RlckRpZmYgPSBuZXcgRGlmZigpO1xuZXhwb3J0IGZ1bmN0aW9uIGRpZmZDaGFycyhvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucykgeyByZXR1cm4gY2hhcmFjdGVyRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTsgfVxuIl19
1924  
1925  
1926  /***/ }),
1927  /* 3 */
1928  /***/ (function(module, exports, __webpack_require__) {
1929  
1930      /*istanbul ignore start*/'use strict';
1931  
1932      exports.__esModule = true;
1933      exports.wordDiff = undefined;
1934      exports. /*istanbul ignore end*/diffWords = diffWords;
1935      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace;
1936  
1937      var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
1938  
1939      /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
1940  
1941      /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/;
1942  
1943      /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
1944  
1945      /*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
1946      //
1947      // Ranges and exceptions:
1948      // Latin-1 Supplement, 0080–00FF
1949      //  - U+00D7  × Multiplication sign
1950      //  - U+00F7  ÷ Division sign
1951      // Latin Extended-A, 0100–017F
1952      // Latin Extended-B, 0180–024F
1953      // IPA Extensions, 0250–02AF
1954      // Spacing Modifier Letters, 02B0–02FF
1955      //  - U+02C7  ˇ &#711;  Caron
1956      //  - U+02D8  ˘ &#728;  Breve
1957      //  - U+02D9  ˙ &#729;  Dot Above
1958      //  - U+02DA  ˚ &#730;  Ring Above
1959      //  - U+02DB  ˛ &#731;  Ogonek
1960      //  - U+02DC  ˜ &#732;  Small Tilde
1961      //  - U+02DD  ˝ &#733;  Double Acute Accent
1962      // Latin Extended Additional, 1E00–1EFF
1963      var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
1964  
1965      var reWhitespace = /\S/;
1966  
1967      var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
1968      wordDiff.equals = function (left, right) {
1969        if (this.options.ignoreCase) {
1970          left = left.toLowerCase();
1971          right = right.toLowerCase();
1972        }
1973        return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
1974      };
1975      wordDiff.tokenize = function (value) {
1976        var tokens = value.split(/(\s+|\b)/);
1977  
1978        // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
1979        for (var i = 0; i < tokens.length - 1; i++) {
1980          // If we have an empty string in the next field and we have only word chars before and after, merge
1981          if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
1982            tokens[i] += tokens[i + 2];
1983            tokens.splice(i + 1, 2);
1984            i--;
1985          }
1986        }
1987  
1988        return tokens;
1989      };
1990  
1991  	function diffWords(oldStr, newStr, options) {
1992        options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(options, { ignoreWhitespace: true });
1993        return wordDiff.diff(oldStr, newStr, options);
1994      }
1995  
1996  	function diffWordsWithSpace(oldStr, newStr, options) {
1997        return wordDiff.diff(oldStr, newStr, options);
1998      }
1999      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOlsiZGlmZldvcmRzIiwiZGlmZldvcmRzV2l0aFNwYWNlIiwiZXh0ZW5kZWRXb3JkQ2hhcnMiLCJyZVdoaXRlc3BhY2UiLCJ3b3JkRGlmZiIsImVxdWFscyIsImxlZnQiLCJyaWdodCIsIm9wdGlvbnMiLCJpZ25vcmVDYXNlIiwidG9Mb3dlckNhc2UiLCJpZ25vcmVXaGl0ZXNwYWNlIiwidGVzdCIsInRva2VuaXplIiwidmFsdWUiLCJ0b2tlbnMiLCJzcGxpdCIsImkiLCJsZW5ndGgiLCJzcGxpY2UiLCJvbGRTdHIiLCJuZXdTdHIiLCJkaWZmIl0sIm1hcHBpbmdzIjoiOzs7O2dDQW1EZ0JBLFMsR0FBQUEsUzt5REFLQUMsa0IsR0FBQUEsa0I7O0FBeERoQjs7Ozt1QkFDQTs7Ozt3QkFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFNQyxvQkFBb0IsK0RBQTFCOztBQUVBLElBQU1DLGVBQWUsSUFBckI7O0FBRU8sSUFBTUMsK0VBQVcsd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3Jkc1dpdGhTcGFjZShvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucykge1xuICByZXR1cm4gd29yZERpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7XG59XG4iXX0=
2000  
2001  
2002  /***/ }),
2003  /* 4 */
2004  /***/ (function(module, exports) {
2005  
2006      /*istanbul ignore start*/'use strict';
2007  
2008      exports.__esModule = true;
2009      exports. /*istanbul ignore end*/generateOptions = generateOptions;
2010  	function generateOptions(options, defaults) {
2011        if (typeof options === 'function') {
2012          defaults.callback = options;
2013        } else if (options) {
2014          for (var name in options) {
2015            /* istanbul ignore else */
2016            if (options.hasOwnProperty(name)) {
2017              defaults[name] = options[name];
2018            }
2019          }
2020        }
2021        return defaults;
2022      }
2023      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3BhcmFtcy5qcyJdLCJuYW1lcyI6WyJnZW5lcmF0ZU9wdGlvbnMiLCJvcHRpb25zIiwiZGVmYXVsdHMiLCJjYWxsYmFjayIsIm5hbWUiLCJoYXNPd25Qcm9wZXJ0eSJdLCJtYXBwaW5ncyI6Ijs7O2dDQUFnQkEsZSxHQUFBQSxlO0FBQVQsU0FBU0EsZUFBVCxDQUF5QkMsT0FBekIsRUFBa0NDLFFBQWxDLEVBQTRDO0FBQ2pELE1BQUksT0FBT0QsT0FBUCxLQUFtQixVQUF2QixFQUFtQztBQUNqQ0MsYUFBU0MsUUFBVCxHQUFvQkYsT0FBcEI7QUFDRCxHQUZELE1BRU8sSUFBSUEsT0FBSixFQUFhO0FBQ2xCLFNBQUssSUFBSUcsSUFBVCxJQUFpQkgsT0FBakIsRUFBMEI7QUFDeEI7QUFDQSxVQUFJQSxRQUFRSSxjQUFSLENBQXVCRCxJQUF2QixDQUFKLEVBQWtDO0FBQ2hDRixpQkFBU0UsSUFBVCxJQUFpQkgsUUFBUUcsSUFBUixDQUFqQjtBQUNEO0FBQ0Y7QUFDRjtBQUNELFNBQU9GLFFBQVA7QUFDRCIsImZpbGUiOiJwYXJhbXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gZ2VuZXJhdGVPcHRpb25zKG9wdGlvbnMsIGRlZmF1bHRzKSB7XG4gIGlmICh0eXBlb2Ygb3B0aW9ucyA9PT0gJ2Z1bmN0aW9uJykge1xuICAgIGRlZmF1bHRzLmNhbGxiYWNrID0gb3B0aW9ucztcbiAgfSBlbHNlIGlmIChvcHRpb25zKSB7XG4gICAgZm9yIChsZXQgbmFtZSBpbiBvcHRpb25zKSB7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgaWYgKG9wdGlvbnMuaGFzT3duUHJvcGVydHkobmFtZSkpIHtcbiAgICAgICAgZGVmYXVsdHNbbmFtZV0gPSBvcHRpb25zW25hbWVdO1xuICAgICAgfVxuICAgIH1cbiAgfVxuICByZXR1cm4gZGVmYXVsdHM7XG59XG4iXX0=
2024  
2025  
2026  /***/ }),
2027  /* 5 */
2028  /***/ (function(module, exports, __webpack_require__) {
2029  
2030      /*istanbul ignore start*/'use strict';
2031  
2032      exports.__esModule = true;
2033      exports.lineDiff = undefined;
2034      exports. /*istanbul ignore end*/diffLines = diffLines;
2035      /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines;
2036  
2037      var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
2038  
2039      /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
2040  
2041      /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/;
2042  
2043      /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2044  
2045      /*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
2046      lineDiff.tokenize = function (value) {
2047        var retLines = [],
2048            linesAndNewlines = value.split(/(\n|\r\n)/);
2049  
2050        // Ignore the final empty token that occurs if the string ends with a new line
2051        if (!linesAndNewlines[linesAndNewlines.length - 1]) {
2052          linesAndNewlines.pop();
2053        }
2054  
2055        // Merge the content and line separators into single tokens
2056        for (var i = 0; i < linesAndNewlines.length; i++) {
2057          var line = linesAndNewlines[i];
2058  
2059          if (i % 2 && !this.options.newlineIsToken) {
2060            retLines[retLines.length - 1] += line;
2061          } else {
2062            if (this.options.ignoreWhitespace) {
2063              line = line.trim();
2064            }
2065            retLines.push(line);
2066          }
2067        }
2068  
2069        return retLines;
2070      };
2071  
2072  	function diffLines(oldStr, newStr, callback) {
2073        return lineDiff.diff(oldStr, newStr, callback);
2074      }
2075  	function diffTrimmedLines(oldStr, newStr, callback) {
2076        var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true });
2077        return lineDiff.diff(oldStr, newStr, options);
2078      }
2079      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOlsiZGlmZkxpbmVzIiwiZGlmZlRyaW1tZWRMaW5lcyIsImxpbmVEaWZmIiwidG9rZW5pemUiLCJ2YWx1ZSIsInJldExpbmVzIiwibGluZXNBbmROZXdsaW5lcyIsInNwbGl0IiwibGVuZ3RoIiwicG9wIiwiaSIsImxpbmUiLCJvcHRpb25zIiwibmV3bGluZUlzVG9rZW4iLCJpZ25vcmVXaGl0ZXNwYWNlIiwidHJpbSIsInB1c2giLCJvbGRTdHIiLCJuZXdTdHIiLCJjYWxsYmFjayIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBOEJnQkEsUyxHQUFBQSxTO3lEQUNBQyxnQixHQUFBQSxnQjs7QUEvQmhCOzs7O3VCQUNBOzs7O3VC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RMaW5lc1tyZXRMaW5lcy5sZW5ndGggLSAxXSArPSBsaW5lO1xuICAgIH0gZWxzZSB7XG4gICAgICBpZiAodGhpcy5vcHRpb25zLmlnbm9yZVdoaXRlc3BhY2UpIHtcbiAgICAgICAgbGluZSA9IGxpbmUudHJpbSgpO1xuICAgICAgfVxuICAgICAgcmV0TGluZXMucHVzaChsaW5lKTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gcmV0TGluZXM7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkxpbmVzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gbGluZURpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spOyB9XG5leHBvcnQgZnVuY3Rpb24gZGlmZlRyaW1tZWRMaW5lcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHtcbiAgbGV0IG9wdGlvbnMgPSBnZW5lcmF0ZU9wdGlvbnMoY2FsbGJhY2ssIHtpZ25vcmVXaGl0ZXNwYWNlOiB0cnVlfSk7XG4gIHJldHVybiBsaW5lRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbn1cbiJdfQ==
2080  
2081  
2082  /***/ }),
2083  /* 6 */
2084  /***/ (function(module, exports, __webpack_require__) {
2085  
2086      /*istanbul ignore start*/'use strict';
2087  
2088      exports.__esModule = true;
2089      exports.sentenceDiff = undefined;
2090      exports. /*istanbul ignore end*/diffSentences = diffSentences;
2091  
2092      var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
2093  
2094      /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
2095  
2096  	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2097  
2098      /*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
2099      sentenceDiff.tokenize = function (value) {
2100        return value.split(/(\S.+?[.!?])(?=\s+|$)/);
2101      };
2102  
2103  	function diffSentences(oldStr, newStr, callback) {
2104        return sentenceDiff.diff(oldStr, newStr, callback);
2105      }
2106      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3NlbnRlbmNlLmpzIl0sIm5hbWVzIjpbImRpZmZTZW50ZW5jZXMiLCJzZW50ZW5jZURpZmYiLCJ0b2tlbml6ZSIsInZhbHVlIiwic3BsaXQiLCJvbGRTdHIiLCJuZXdTdHIiLCJjYWxsYmFjayIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBUWdCQSxhLEdBQUFBLGE7O0FBUmhCOzs7Ozs7dUJBR08sSUFBTUMsdUZBQWUsd0VBQXJCO0FBQ1BBLGFBQWFDLFFBQWIsR0FBd0IsVUFBU0MsS0FBVCxFQUFnQjtBQUN0QyxTQUFPQSxNQUFNQyxLQUFOLENBQVksdUJBQVosQ0FBUDtBQUNELENBRkQ7O0FBSU8sU0FBU0osYUFBVCxDQUF1QkssTUFBdkIsRUFBK0JDLE1BQS9CLEVBQXVDQyxRQUF2QyxFQUFpRDtBQUFFLFNBQU9OLGFBQWFPLElBQWIsQ0FBa0JILE1BQWxCLEVBQTBCQyxNQUExQixFQUFrQ0MsUUFBbEMsQ0FBUDtBQUFxRCIsImZpbGUiOiJzZW50ZW5jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cblxuZXhwb3J0IGNvbnN0IHNlbnRlbmNlRGlmZiA9IG5ldyBEaWZmKCk7XG5zZW50ZW5jZURpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhcXFMuKz9bLiE/XSkoPz1cXHMrfCQpLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZlNlbnRlbmNlcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIHNlbnRlbmNlRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ==
2107  
2108  
2109  /***/ }),
2110  /* 7 */
2111  /***/ (function(module, exports, __webpack_require__) {
2112  
2113      /*istanbul ignore start*/'use strict';
2114  
2115      exports.__esModule = true;
2116      exports.cssDiff = undefined;
2117      exports. /*istanbul ignore end*/diffCss = diffCss;
2118  
2119      var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
2120  
2121      /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
2122  
2123  	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2124  
2125      /*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
2126      cssDiff.tokenize = function (value) {
2127        return value.split(/([{}:;,]|\s+)/);
2128      };
2129  
2130  	function diffCss(oldStr, newStr, callback) {
2131        return cssDiff.diff(oldStr, newStr, callback);
2132      }
2133      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Nzcy5qcyJdLCJuYW1lcyI6WyJkaWZmQ3NzIiwiY3NzRGlmZiIsInRva2VuaXplIiwidmFsdWUiLCJzcGxpdCIsIm9sZFN0ciIsIm5ld1N0ciIsImNhbGxiYWNrIiwiZGlmZiJdLCJtYXBwaW5ncyI6Ijs7OztnQ0FPZ0JBLE8sR0FBQUEsTzs7QUFQaEI7Ozs7Ozt1QkFFTyxJQUFNQyw2RUFBVSx3RUFBaEI7QUFDUEEsUUFBUUMsUUFBUixHQUFtQixVQUFTQyxLQUFULEVBQWdCO0FBQ2pDLFNBQU9BLE1BQU1DLEtBQU4sQ0FBWSxlQUFaLENBQVA7QUFDRCxDQUZEOztBQUlPLFNBQVNKLE9BQVQsQ0FBaUJLLE1BQWpCLEVBQXlCQyxNQUF6QixFQUFpQ0MsUUFBakMsRUFBMkM7QUFBRSxTQUFPTixRQUFRTyxJQUFSLENBQWFILE1BQWIsRUFBcUJDLE1BQXJCLEVBQTZCQyxRQUE3QixDQUFQO0FBQWdEIiwiZmlsZSI6ImNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBjc3NEaWZmID0gbmV3IERpZmYoKTtcbmNzc0RpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhbe306OyxdfFxccyspLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkNzcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIGNzc0RpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spOyB9XG4iXX0=
2134  
2135  
2136  /***/ }),
2137  /* 8 */
2138  /***/ (function(module, exports, __webpack_require__) {
2139  
2140      /*istanbul ignore start*/'use strict';
2141  
2142      exports.__esModule = true;
2143      exports.jsonDiff = undefined;
2144  
2145      var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
2146  
2147      exports. /*istanbul ignore end*/diffJson = diffJson;
2148      /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = canonicalize;
2149  
2150      var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
2151  
2152      /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
2153  
2154      /*istanbul ignore end*/var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/;
2155  
2156      /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2157  
2158      /*istanbul ignore end*/var objectPrototypeToString = Object.prototype.toString;
2159  
2160      var jsonDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/jsonDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
2161      // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
2162      // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
2163      jsonDiff.useLongestToken = true;
2164  
2165      jsonDiff.tokenize = /*istanbul ignore start*/_line.lineDiff /*istanbul ignore end*/.tokenize;
2166      jsonDiff.castInput = function (value) {
2167        /*istanbul ignore start*/var _options = /*istanbul ignore end*/this.options,
2168            undefinedReplacement = _options.undefinedReplacement,
2169            _options$stringifyRep = _options.stringifyReplacer,
2170            stringifyReplacer = _options$stringifyRep === undefined ? function (k, v) /*istanbul ignore start*/{
2171          return (/*istanbul ignore end*/typeof v === 'undefined' ? undefinedReplacement : v
2172          );
2173        } : _options$stringifyRep;
2174  
2175  
2176        return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, '  ');
2177      };
2178      jsonDiff.equals = function (left, right) {
2179        return (/*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'))
2180        );
2181      };
2182  
2183  	function diffJson(oldObj, newObj, options) {
2184        return jsonDiff.diff(oldObj, newObj, options);
2185      }
2186  
2187      // This function handles the presence of circular references by bailing out when encountering an
2188      // object that is already on the "stack" of items being processed. Accepts an optional replacer
2189  	function canonicalize(obj, stack, replacementStack, replacer, key) {
2190        stack = stack || [];
2191        replacementStack = replacementStack || [];
2192  
2193        if (replacer) {
2194          obj = replacer(key, obj);
2195        }
2196  
2197        var i = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
2198  
2199        for (i = 0; i < stack.length; i += 1) {
2200          if (stack[i] === obj) {
2201            return replacementStack[i];
2202          }
2203        }
2204  
2205        var canonicalizedObj = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
2206  
2207        if ('[object Array]' === objectPrototypeToString.call(obj)) {
2208          stack.push(obj);
2209          canonicalizedObj = new Array(obj.length);
2210          replacementStack.push(canonicalizedObj);
2211          for (i = 0; i < obj.length; i += 1) {
2212            canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
2213          }
2214          stack.pop();
2215          replacementStack.pop();
2216          return canonicalizedObj;
2217        }
2218  
2219        if (obj && obj.toJSON) {
2220          obj = obj.toJSON();
2221        }
2222  
2223        if ( /*istanbul ignore start*/(typeof /*istanbul ignore end*/obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) {
2224          stack.push(obj);
2225          canonicalizedObj = {};
2226          replacementStack.push(canonicalizedObj);
2227          var sortedKeys = [],
2228              _key = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
2229          for (_key in obj) {
2230            /* istanbul ignore else */
2231            if (obj.hasOwnProperty(_key)) {
2232              sortedKeys.push(_key);
2233            }
2234          }
2235          sortedKeys.sort();
2236          for (i = 0; i < sortedKeys.length; i += 1) {
2237            _key = sortedKeys[i];
2238            canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
2239          }
2240          stack.pop();
2241          replacementStack.pop();
2242        } else {
2243          canonicalizedObj = obj;
2244        }
2245        return canonicalizedObj;
2246      }
2247      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2pzb24uanMiXSwibmFtZXMiOlsiZGlmZkpzb24iLCJjYW5vbmljYWxpemUiLCJvYmplY3RQcm90b3R5cGVUb1N0cmluZyIsIk9iamVjdCIsInByb3RvdHlwZSIsInRvU3RyaW5nIiwianNvbkRpZmYiLCJ1c2VMb25nZXN0VG9rZW4iLCJ0b2tlbml6ZSI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nRTdGFjay5wb3AoKTtcbiAgICByZXR1cm4gY2Fub25pY2FsaXplZE9iajtcbiAgfVxuXG4gIGlmIChvYmogJiYgb2JqLnRvSlNPTikge1xuICAgIG9iaiA9IG9iai50b0pTT04oKTtcbiAgfVxuXG4gIGlmICh0eXBlb2Ygb2JqID09PSAnb2JqZWN0JyAmJiBvYmogIT09IG51bGwpIHtcbiAgICBzdGFjay5wdXNoKG9iaik7XG4gICAgY2Fub25pY2FsaXplZE9iaiA9IHt9O1xuICAgIHJlcGxhY2VtZW50U3RhY2sucHVzaChjYW5vbmljYWxpemVkT2JqKTtcbiAgICBsZXQgc29ydGVkS2V5cyA9IFtdLFxuICAgICAgICBrZXk7XG4gICAgZm9yIChrZXkgaW4gb2JqKSB7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgIHNvcnRlZEtleXMucHVzaChrZXkpO1xuICAgICAgfVxuICAgIH1cbiAgICBzb3J0ZWRLZXlzLnNvcnQoKTtcbiAgICBmb3IgKGkgPSAwOyBpIDwgc29ydGVkS2V5cy5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAga2V5ID0gc29ydGVkS2V5c1tpXTtcbiAgICAgIGNhbm9uaWNhbGl6ZWRPYmpba2V5XSA9IGNhbm9uaWNhbGl6ZShvYmpba2V5XSwgc3RhY2ssIHJlcGxhY2VtZW50U3RhY2ssIHJlcGxhY2VyLCBrZXkpO1xuICAgIH1cbiAgICBzdGFjay5wb3AoKTtcbiAgICByZXBsYWNlbWVudFN0YWNrLnBvcCgpO1xuICB9IGVsc2Uge1xuICAgIGNhbm9uaWNhbGl6ZWRPYmogPSBvYmo7XG4gIH1cbiAgcmV0dXJuIGNhbm9uaWNhbGl6ZWRPYmo7XG59XG4iXX0=
2248  
2249  
2250  /***/ }),
2251  /* 9 */
2252  /***/ (function(module, exports, __webpack_require__) {
2253  
2254      /*istanbul ignore start*/'use strict';
2255  
2256      exports.__esModule = true;
2257      exports.arrayDiff = undefined;
2258      exports. /*istanbul ignore end*/diffArrays = diffArrays;
2259  
2260      var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
2261  
2262      /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
2263  
2264  	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2265  
2266      /*istanbul ignore end*/var arrayDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
2267      arrayDiff.tokenize = function (value) {
2268        return value.slice();
2269      };
2270      arrayDiff.join = arrayDiff.removeEmpty = function (value) {
2271        return value;
2272      };
2273  
2274  	function diffArrays(oldArr, newArr, callback) {
2275        return arrayDiff.diff(oldArr, newArr, callback);
2276      }
2277      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2FycmF5LmpzIl0sIm5hbWVzIjpbImRpZmZBcnJheXMiLCJhcnJheURpZmYiLCJ0b2tlbml6ZSIsInZhbHVlIiwic2xpY2UiLCJqb2luIiwicmVtb3ZlRW1wdHkiLCJvbGRBcnIiLCJuZXdBcnIiLCJjYWxsYmFjayIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBVWdCQSxVLEdBQUFBLFU7O0FBVmhCOzs7Ozs7dUJBRU8sSUFBTUMsaUZBQVksd0VBQWxCO0FBQ1BBLFVBQVVDLFFBQVYsR0FBcUIsVUFBU0MsS0FBVCxFQUFnQjtBQUNuQyxTQUFPQSxNQUFNQyxLQUFOLEVBQVA7QUFDRCxDQUZEO0FBR0FILFVBQVVJLElBQVYsR0FBaUJKLFVBQVVLLFdBQVYsR0FBd0IsVUFBU0gsS0FBVCxFQUFnQjtBQUN2RCxTQUFPQSxLQUFQO0FBQ0QsQ0FGRDs7QUFJTyxTQUFTSCxVQUFULENBQW9CTyxNQUFwQixFQUE0QkMsTUFBNUIsRUFBb0NDLFFBQXBDLEVBQThDO0FBQUUsU0FBT1IsVUFBVVMsSUFBVixDQUFlSCxNQUFmLEVBQXVCQyxNQUF2QixFQUErQkMsUUFBL0IsQ0FBUDtBQUFrRCIsImZpbGUiOiJhcnJheS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBhcnJheURpZmYgPSBuZXcgRGlmZigpO1xuYXJyYXlEaWZmLnRva2VuaXplID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlLnNsaWNlKCk7XG59O1xuYXJyYXlEaWZmLmpvaW4gPSBhcnJheURpZmYucmVtb3ZlRW1wdHkgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWU7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkFycmF5cyhvbGRBcnIsIG5ld0FyciwgY2FsbGJhY2spIHsgcmV0dXJuIGFycmF5RGlmZi5kaWZmKG9sZEFyciwgbmV3QXJyLCBjYWxsYmFjayk7IH1cbiJdfQ==
2278  
2279  
2280  /***/ }),
2281  /* 10 */
2282  /***/ (function(module, exports, __webpack_require__) {
2283  
2284      /*istanbul ignore start*/'use strict';
2285  
2286      exports.__esModule = true;
2287      exports. /*istanbul ignore end*/applyPatch = applyPatch;
2288      /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = applyPatches;
2289  
2290      var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/;
2291  
2292      var /*istanbul ignore start*/_distanceIterator = __webpack_require__(12) /*istanbul ignore end*/;
2293  
2294      /*istanbul ignore start*/var _distanceIterator2 = _interopRequireDefault(_distanceIterator);
2295  
2296  	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2297  
2298      /*istanbul ignore end*/function applyPatch(source, uniDiff) {
2299        /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2300  
2301        if (typeof uniDiff === 'string') {
2302          uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);
2303        }
2304  
2305        if (Array.isArray(uniDiff)) {
2306          if (uniDiff.length > 1) {
2307            throw new Error('applyPatch only works with a single input.');
2308          }
2309  
2310          uniDiff = uniDiff[0];
2311        }
2312  
2313        // Apply the diff to the input
2314        var lines = source.split(/\r\n|[\n\v\f\r\x85]/),
2315            delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [],
2316            hunks = uniDiff.hunks,
2317            compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) /*istanbul ignore start*/{
2318          return (/*istanbul ignore end*/line === patchContent
2319          );
2320        },
2321            errorCount = 0,
2322            fuzzFactor = options.fuzzFactor || 0,
2323            minLine = 0,
2324            offset = 0,
2325            removeEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
2326            addEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
2327  
2328        /**
2329         * Checks if the hunk exactly fits on the provided location
2330         */
2331  	  function hunkFits(hunk, toPos) {
2332          for (var j = 0; j < hunk.lines.length; j++) {
2333            var line = hunk.lines[j],
2334                operation = line.length > 0 ? line[0] : ' ',
2335                content = line.length > 0 ? line.substr(1) : line;
2336  
2337            if (operation === ' ' || operation === '-') {
2338              // Context sanity check
2339              if (!compareLine(toPos + 1, lines[toPos], operation, content)) {
2340                errorCount++;
2341  
2342                if (errorCount > fuzzFactor) {
2343                  return false;
2344                }
2345              }
2346              toPos++;
2347            }
2348          }
2349  
2350          return true;
2351        }
2352  
2353        // Search best fit offsets for each hunk based on the previous ones
2354        for (var i = 0; i < hunks.length; i++) {
2355          var hunk = hunks[i],
2356              maxLine = lines.length - hunk.oldLines,
2357              localOffset = 0,
2358              toPos = offset + hunk.oldStart - 1;
2359  
2360          var iterator = /*istanbul ignore start*/(0, _distanceIterator2['default']) /*istanbul ignore end*/(toPos, minLine, maxLine);
2361  
2362          for (; localOffset !== undefined; localOffset = iterator()) {
2363            if (hunkFits(hunk, toPos + localOffset)) {
2364              hunk.offset = offset += localOffset;
2365              break;
2366            }
2367          }
2368  
2369          if (localOffset === undefined) {
2370            return false;
2371          }
2372  
2373          // Set lower text limit to end of the current hunk, so next ones don't try
2374          // to fit over already patched text
2375          minLine = hunk.offset + hunk.oldStart + hunk.oldLines;
2376        }
2377  
2378        // Apply patch hunks
2379        var diffOffset = 0;
2380        for (var _i = 0; _i < hunks.length; _i++) {
2381          var _hunk = hunks[_i],
2382              _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1;
2383          diffOffset += _hunk.newLines - _hunk.oldLines;
2384  
2385          if (_toPos < 0) {
2386            // Creating a new file
2387            _toPos = 0;
2388          }
2389  
2390          for (var j = 0; j < _hunk.lines.length; j++) {
2391            var line = _hunk.lines[j],
2392                operation = line.length > 0 ? line[0] : ' ',
2393                content = line.length > 0 ? line.substr(1) : line,
2394                delimiter = _hunk.linedelimiters[j];
2395  
2396            if (operation === ' ') {
2397              _toPos++;
2398            } else if (operation === '-') {
2399              lines.splice(_toPos, 1);
2400              delimiters.splice(_toPos, 1);
2401              /* istanbul ignore else */
2402            } else if (operation === '+') {
2403              lines.splice(_toPos, 0, content);
2404              delimiters.splice(_toPos, 0, delimiter);
2405              _toPos++;
2406            } else if (operation === '\\') {
2407              var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;
2408              if (previousOperation === '+') {
2409                removeEOFNL = true;
2410              } else if (previousOperation === '-') {
2411                addEOFNL = true;
2412              }
2413            }
2414          }
2415        }
2416  
2417        // Handle EOFNL insertion/removal
2418        if (removeEOFNL) {
2419          while (!lines[lines.length - 1]) {
2420            lines.pop();
2421            delimiters.pop();
2422          }
2423        } else if (addEOFNL) {
2424          lines.push('');
2425          delimiters.push('\n');
2426        }
2427        for (var _k = 0; _k < lines.length - 1; _k++) {
2428          lines[_k] = lines[_k] + delimiters[_k];
2429        }
2430        return lines.join('');
2431      }
2432  
2433      // Wrapper that supports multiple file patches via callbacks.
2434  	function applyPatches(uniDiff, options) {
2435        if (typeof uniDiff === 'string') {
2436          uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);
2437        }
2438  
2439        var currentIndex = 0;
2440  	  function processIndex() {
2441          var index = uniDiff[currentIndex++];
2442          if (!index) {
2443            return options.complete();
2444          }
2445  
2446          options.loadFile(index, function (err, data) {
2447            if (err) {
2448              return options.complete(err);
2449            }
2450  
2451            var updatedContent = applyPatch(data, index, options);
2452            options.patched(index, updatedContent, function (err) {
2453              if (err) {
2454                return options.complete(err);
2455              }
2456  
2457              processIndex();
2458            });
2459          });
2460        }
2461        processIndex();
2462      }
2463      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9hcHBseS5qcyJdLCJuYW1lcyI6WyJhcHBseVBhdGNoIiwiYXBwbHlQYXRjaGVzIiwic291cmNlIiwidW5pRGlmZiIsIm9wdGlvbnMiLCJBcnJheSIsImlzQXJyYXkiLCJsZW5ndGgiLCJFcnJvciIsImxpbmVzIiwic3BsaXQiLCJkZWxpbWl0ZXJzIiwibWF0Y2giLCJodW5rcyIsImNvbXBhcmVMaW5lIiwibGluZU51bWJlciIsImxpbmUiLCJvcGVyYXRpb24iLCJwYXRjaENvbnRlbnQiLCJlcnJvckNvdW50IiwiZnV6ekZhY3RvciIsIm1pbkxpbmUiLCJvZmZzZXQiLCJyZW1vdmVFT0ZOTCIsImFkZEVPRk5MIiwiaHVua0ZpdHMiLCJodW5rIiwidG9Qb3MiLCJqIiwiY29udGVudCIsInN1YnN0ciIsImkiLCJtYXhMaW5lIiwib2xkTGluZXMiLCJsb2NhbE9mZnNldCIsIm9sZFN0YXJ0IiwiaXRlcmF0b3Ii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ubGluZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgIGxldCBsaW5lID0gaHVuay5saW5lc1tqXSxcbiAgICAgICAgICBvcGVyYXRpb24gPSAobGluZS5sZW5ndGggPiAwID8gbGluZVswXSA6ICcgJyksXG4gICAgICAgICAgY29udGVudCA9IChsaW5lLmxlbmd0aCA+IDAgPyBsaW5lLnN1YnN0cigxKSA6IGxpbmUpO1xuXG4gICAgICBpZiAob3BlcmF0aW9uID09PSAnICcgfHwgb3BlcmF0aW9uID09PSAnLScpIHtcbiAgICAgICAgLy8gQ29udGV4dCBzYW5pdHkgY2hlY2tcbiAgICAgICAgaWYgKCFjb21wYXJlTGluZSh0b1BvcyArIDEsIGxpbmVzW3RvUG9zXSwgb3BlcmF0aW9uLCBjb250ZW50KSkge1xuICAgICAgICAgIGVycm9yQ291bnQrKztcblxuICAgICAgICAgIGlmIChlcnJvckNvdW50ID4gZnV6ekZhY3Rvcikge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0b1BvcysrO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB0cnVlO1xuICB9XG5cbiAgLy8gU2VhcmNoIGJlc3QgZml0IG9mZnNldHMgZm9yIGVhY2ggaHVuayBiYXNlZCBvbiB0aGUgcHJldmlvdXMgb25lc1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGh1bmtzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGh1bmsgPSBodW5rc1tpXSxcbiAgICAgICAgbWF4TGluZSA9IGxpbmVzLmxlbmd0aCAtIGh1bmsub2xkTGluZXMsXG4gICAgICAgIGxvY2FsT2Zmc2V0ID0gMCxcbiAgICAgICAgdG9Qb3MgPSBvZmZzZXQgKyBodW5rLm9sZFN0YXJ0IC0gMTtcblxuICAgIGxldCBpdGVyYXRvciA9IGRpc3RhbmNlSXRlcmF0b3IodG9Qb3MsIG1pbkxpbmUsIG1heExpbmUpO1xu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cGxldGUoZXJyKTtcbiAgICAgIH1cblxuICAgICAgbGV0IHVwZGF0ZWRDb250ZW50ID0gYXBwbHlQYXRjaChkYXRhLCBpbmRleCwgb3B0aW9ucyk7XG4gICAgICBvcHRpb25zLnBhdGNoZWQoaW5kZXgsIHVwZGF0ZWRDb250ZW50LCBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKGVycik7XG4gICAgICAgIH1cblxuICAgICAgICBwcm9jZXNzSW5kZXgoKTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9XG4gIHByb2Nlc3NJbmRleCgpO1xufVxuIl19
2464  
2465  
2466  /***/ }),
2467  /* 11 */
2468  /***/ (function(module, exports) {
2469  
2470      /*istanbul ignore start*/'use strict';
2471  
2472      exports.__esModule = true;
2473      exports. /*istanbul ignore end*/parsePatch = parsePatch;
2474  	function parsePatch(uniDiff) {
2475        /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2476  
2477        var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/),
2478            delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [],
2479            list = [],
2480            i = 0;
2481  
2482  	  function parseIndex() {
2483          var index = {};
2484          list.push(index);
2485  
2486          // Parse diff metadata
2487          while (i < diffstr.length) {
2488            var line = diffstr[i];
2489  
2490            // File header found, end parsing diff metadata
2491            if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
2492              break;
2493            }
2494  
2495            // Diff index
2496            var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
2497            if (header) {
2498              index.index = header[1];
2499            }
2500  
2501            i++;
2502          }
2503  
2504          // Parse file headers if they are defined. Unified diff requires them, but
2505          // there's no technical issues to have an isolated hunk without file header
2506          parseFileHeader(index);
2507          parseFileHeader(index);
2508  
2509          // Parse hunks
2510          index.hunks = [];
2511  
2512          while (i < diffstr.length) {
2513            var _line = diffstr[i];
2514  
2515            if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) {
2516              break;
2517            } else if (/^@@/.test(_line)) {
2518              index.hunks.push(parseHunk());
2519            } else if (_line && options.strict) {
2520              // Ignore unexpected content unless in strict mode
2521              throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
2522            } else {
2523              i++;
2524            }
2525          }
2526        }
2527  
2528        // Parses the --- and +++ headers, if none are found, no lines
2529        // are consumed.
2530  	  function parseFileHeader(index) {
2531          var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]);
2532          if (fileHeader) {
2533            var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
2534            var data = fileHeader[2].split('\t', 2);
2535            var fileName = data[0].replace(/\\\\/g, '\\');
2536            if (/^".*"$/.test(fileName)) {
2537              fileName = fileName.substr(1, fileName.length - 2);
2538            }
2539            index[keyPrefix + 'FileName'] = fileName;
2540            index[keyPrefix + 'Header'] = (data[1] || '').trim();
2541  
2542            i++;
2543          }
2544        }
2545  
2546        // Parses a hunk
2547        // This assumes that we are at the start of a hunk.
2548  	  function parseHunk() {
2549          var chunkHeaderIndex = i,
2550              chunkHeaderLine = diffstr[i++],
2551              chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
2552  
2553          var hunk = {
2554            oldStart: +chunkHeader[1],
2555            oldLines: +chunkHeader[2] || 1,
2556            newStart: +chunkHeader[3],
2557            newLines: +chunkHeader[4] || 1,
2558            lines: [],
2559            linedelimiters: []
2560          };
2561  
2562          var addCount = 0,
2563              removeCount = 0;
2564          for (; i < diffstr.length; i++) {
2565            // Lines starting with '---' could be mistaken for the "remove line" operation
2566            // But they could be the header for the next file. Therefore prune such cases out.
2567            if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) {
2568              break;
2569            }
2570            var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
2571  
2572            if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
2573              hunk.lines.push(diffstr[i]);
2574              hunk.linedelimiters.push(delimiters[i] || '\n');
2575  
2576              if (operation === '+') {
2577                addCount++;
2578              } else if (operation === '-') {
2579                removeCount++;
2580              } else if (operation === ' ') {
2581                addCount++;
2582                removeCount++;
2583              }
2584            } else {
2585              break;
2586            }
2587          }
2588  
2589          // Handle the empty block count case
2590          if (!addCount && hunk.newLines === 1) {
2591            hunk.newLines = 0;
2592          }
2593          if (!removeCount && hunk.oldLines === 1) {
2594            hunk.oldLines = 0;
2595          }
2596  
2597          // Perform optional sanity checking
2598          if (options.strict) {
2599            if (addCount !== hunk.newLines) {
2600              throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
2601            }
2602            if (removeCount !== hunk.oldLines) {
2603              throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
2604            }
2605          }
2606  
2607          return hunk;
2608        }
2609  
2610        while (i < diffstr.length) {
2611          parseIndex();
2612        }
2613  
2614        return list;
2615      }
2616      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9wYXJzZS5qcyJdLCJuYW1lcyI6WyJwYXJzZVBhdGNoIiwidW5pRGlmZiIsIm9wdGlvbnMiLCJkaWZmc3RyIiwic3BsaXQiLCJkZWxpbWl0ZXJzIiwibWF0Y2giLCJsaXN0IiwiaSIsInBhcnNlSW5kZXgiLCJpbmRleCIsInB1c2giLCJsZW5ndGgiLCJsaW5lIiwidGVzdCIsImhlYWRlciIsImV4ZWMiLCJwYXJzZUZpbGVIZWFkZXIiLCJodW5rcyIsInBhcnNlSHVuayIsInN0cmljdCIsIkVycm9yIiwiSlNPTiIsInN0cmluZ2lmeSIsImZpb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ICAvLyBCdXQgdGhleSBjb3VsZCBiZSB0aGUgaGVhZGVyIGZvciB0aGUgbmV4dCBmaWxlLiBUaGVyZWZvcmUgcHJ1bmUgc3VjaCBjYXNlcyBvdXQuXG4gICAgICBpZiAoZGlmZnN0cltpXS5pbmRleE9mKCctLS0gJykgPT09IDBcbiAgICAgICAgICAgICYmIChpICsgMiA8IGRpZmZzdHIubGVuZ3RoKVxuICAgICAgICAgICAgJiYgZGlmZnN0cltpICsgMV0uaW5kZXhPZignKysrICcpID09PSAwXG4gICAgICAgICAgICAmJiBkaWZmc3RyW2kgKyAyXS5pbmRleE9mKCdAQCcpID09PSAwKSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBsZXQgb3BlcmF0aW9uID0gKGRpZmZzdHJbaV0ubGVuZ3RoID09IDAgJiYgaSAhPSAoZGlmZnN0ci5sZW5ndGggLSAxKSkgPyAnICcgOiBkaWZmc3RyW2ldWzBdO1xuXG4gICAgICBpZiAob3BlcmF0aW9uID09PSAnKycgfHwgb3BlcmF0aW9uID09PSAnLScgfHwgb3BlcmF0aW9uID09PSAnICcgfHwgb3BlcmF0aW9uID09PSAnXFxcXCcpIHtcbiAgICAgICAgaHVuay5saW5lcy5wdXNoKGRpZmZzdHJbaV0pO1xuICAgICAgICBodW5rLmxpbmVkZWxpbWl0ZXJzLnB1c2goZGVsaW1pdGVyc1tpXSB8fCAnXFxuJyk7XG5cbiAgICAgICAgaWYgKG9wZXJhdGlvbiA9PT0gJysnKSB7XG4gICAgICAgICAgYWRkQ291bnQrKztcbiAgICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICAgIHJlbW92ZUNvdW50Kys7XG4gICAgICAgIH0gZWxzZSBpZiAob3BlcmF0aW9uID09PSAnICcpIHtcbiAgICAgICAgICBhZGRDb3VudCsrO1xuICAgICAgICAgIHJlbW92ZUNvdW50Kys7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIEhhbmRsZSB0aGUgZW1wdHkgYmxvY2sgY291bnQgY2FzZVxuICAgIGlmICghYWRkQ291bnQgJiYgaHVuay5uZXdMaW5lcyA9PT0gMSkge1xuICAgICAgaHVuay5uZXdMaW5lcyA9IDA7XG4gICAgfVxuICAgIGlmICghcmVtb3ZlQ291bnQgJiYgaHVuay5vbGRMaW5lcyA9PT0gMSkge1xuICAgICAgaHVuay5vbGRMaW5lcyA9IDA7XG4gICAgfVxuXG4gICAgLy8gUGVyZm9ybSBvcHRpb25hbCBzYW5pdHkgY2hlY2tpbmdcbiAgICBpZiAob3B0aW9ucy5zdHJpY3QpIHtcbiAgICAgIGlmIChhZGRDb3VudCAhPT0gaHVuay5uZXdMaW5lcykge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0FkZGVkIGxpbmUgY291bnQgZGlkIG5vdCBtYXRjaCBmb3IgaHVuayBhdCBsaW5lICcgKyAoY2h1bmtIZWFkZXJJbmRleCArIDEpKTtcbiAgICAgIH1cbiAgICAgIGlmIChyZW1vdmVDb3VudCAhPT0gaHVuay5vbGRMaW5lcykge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1JlbW92ZWQgbGluZSBjb3VudCBkaWQgbm90IG1hdGNoIGZvciBodW5rIGF0IGxpbmUgJyArIChjaHVua0hlYWRlckluZGV4ICsgMSkpO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBodW5rO1xuICB9XG5cbiAgd2hpbGUgKGkgPCBkaWZmc3RyLmxlbmd0aCkge1xuICAgIHBhcnNlSW5kZXgoKTtcbiAgfVxuXG4gIHJldHVybiBsaXN0O1xufVxuIl19
2617  
2618  
2619  /***/ }),
2620  /* 12 */
2621  /***/ (function(module, exports) {
2622  
2623      /*istanbul ignore start*/"use strict";
2624  
2625      exports.__esModule = true;
2626  
2627      exports["default"] = /*istanbul ignore end*/function (start, minLine, maxLine) {
2628        var wantForward = true,
2629            backwardExhausted = false,
2630            forwardExhausted = false,
2631            localOffset = 1;
2632  
2633        return function iterator() {
2634          if (wantForward && !forwardExhausted) {
2635            if (backwardExhausted) {
2636              localOffset++;
2637            } else {
2638              wantForward = false;
2639            }
2640  
2641            // Check if trying to fit beyond text length, and if not, check it fits
2642            // after offset location (or desired location on first iteration)
2643            if (start + localOffset <= maxLine) {
2644              return localOffset;
2645            }
2646  
2647            forwardExhausted = true;
2648          }
2649  
2650          if (!backwardExhausted) {
2651            if (!forwardExhausted) {
2652              wantForward = true;
2653            }
2654  
2655            // Check if trying to fit before text beginning, and if not, check it fits
2656            // before offset location
2657            if (minLine <= start - localOffset) {
2658              return -localOffset++;
2659            }
2660  
2661            backwardExhausted = true;
2662            return iterator();
2663          }
2664  
2665          // We tried to fit hunk before text beginning and beyond text length, then
2666          // hunk can't fit on the text. Return undefined
2667        };
2668      };
2669      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbInN0YXJ0IiwibWluTGluZSIsIm1heExpbmUiLCJ3YW50Rm9yd2FyZCIsImJhY2t3YXJkRXhoYXVzdGVkIiwiZm9yd2FyZEV4aGF1c3RlZCIsImxvY2FsT2Zmc2V0IiwiaXRlcmF0b3IiXSwibWFwcGluZ3MiOiI7Ozs7NENBR2UsVUFBU0EsS0FBVCxFQUFnQkMsT0FBaEIsRUFBeUJDLE9BQXpCLEVBQWtDO0FBQy9DLE1BQUlDLGNBQWMsSUFBbEI7QUFBQSxNQUNJQyxvQkFBb0IsS0FEeEI7QUFBQSxNQUVJQyxtQkFBbUIsS0FGdkI7QUFBQSxNQUdJQyxjQUFjLENBSGxCOztBQUtBLFNBQU8sU0FBU0MsUUFBVCxHQUFvQjtBQUN6QixRQUFJSixlQUFlLENBQUNFLGdCQUFwQixFQUFzQztBQUN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gICAgICByZXR1cm4gaXRlcmF0b3IoKTtcbiAgICB9XG5cbiAgICAvLyBXZSB0cmllZCB0byBmaXQgaHVuayBiZWZvcmUgdGV4dCBiZWdpbm5pbmcgYW5kIGJleW9uZCB0ZXh0IGxlbmd0aCwgdGhlblxuICAgIC8vIGh1bmsgY2FuJ3QgZml0IG9uIHRoZSB0ZXh0LiBSZXR1cm4gdW5kZWZpbmVkXG4gIH07XG59XG4iXX0=
2670  
2671  
2672  /***/ }),
2673  /* 13 */
2674  /***/ (function(module, exports, __webpack_require__) {
2675  
2676      /*istanbul ignore start*/'use strict';
2677  
2678      exports.__esModule = true;
2679      exports. /*istanbul ignore end*/calcLineCount = calcLineCount;
2680      /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = merge;
2681  
2682      var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/;
2683  
2684      var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/;
2685  
2686      var /*istanbul ignore start*/_array = __webpack_require__(15) /*istanbul ignore end*/;
2687  
2688      /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
2689  
2690      /*istanbul ignore end*/function calcLineCount(hunk) {
2691        /*istanbul ignore start*/var _calcOldNewLineCount = /*istanbul ignore end*/calcOldNewLineCount(hunk.lines),
2692            oldLines = _calcOldNewLineCount.oldLines,
2693            newLines = _calcOldNewLineCount.newLines;
2694  
2695        if (oldLines !== undefined) {
2696          hunk.oldLines = oldLines;
2697        } else {
2698          delete hunk.oldLines;
2699        }
2700  
2701        if (newLines !== undefined) {
2702          hunk.newLines = newLines;
2703        } else {
2704          delete hunk.newLines;
2705        }
2706      }
2707  
2708  	function merge(mine, theirs, base) {
2709        mine = loadPatch(mine, base);
2710        theirs = loadPatch(theirs, base);
2711  
2712        var ret = {};
2713  
2714        // For index we just let it pass through as it doesn't have any necessary meaning.
2715        // Leaving sanity checks on this to the API consumer that may know more about the
2716        // meaning in their own context.
2717        if (mine.index || theirs.index) {
2718          ret.index = mine.index || theirs.index;
2719        }
2720  
2721        if (mine.newFileName || theirs.newFileName) {
2722          if (!fileNameChanged(mine)) {
2723            // No header or no change in ours, use theirs (and ours if theirs does not exist)
2724            ret.oldFileName = theirs.oldFileName || mine.oldFileName;
2725            ret.newFileName = theirs.newFileName || mine.newFileName;
2726            ret.oldHeader = theirs.oldHeader || mine.oldHeader;
2727            ret.newHeader = theirs.newHeader || mine.newHeader;
2728          } else if (!fileNameChanged(theirs)) {
2729            // No header or no change in theirs, use ours
2730            ret.oldFileName = mine.oldFileName;
2731            ret.newFileName = mine.newFileName;
2732            ret.oldHeader = mine.oldHeader;
2733            ret.newHeader = mine.newHeader;
2734          } else {
2735            // Both changed... figure it out
2736            ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
2737            ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
2738            ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
2739            ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
2740          }
2741        }
2742  
2743        ret.hunks = [];
2744  
2745        var mineIndex = 0,
2746            theirsIndex = 0,
2747            mineOffset = 0,
2748            theirsOffset = 0;
2749  
2750        while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
2751          var mineCurrent = mine.hunks[mineIndex] || { oldStart: Infinity },
2752              theirsCurrent = theirs.hunks[theirsIndex] || { oldStart: Infinity };
2753  
2754          if (hunkBefore(mineCurrent, theirsCurrent)) {
2755            // This patch does not overlap with any of the others, yay.
2756            ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
2757            mineIndex++;
2758            theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
2759          } else if (hunkBefore(theirsCurrent, mineCurrent)) {
2760            // This patch does not overlap with any of the others, yay.
2761            ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
2762            theirsIndex++;
2763            mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
2764          } else {
2765            // Overlap, merge as best we can
2766            var mergedHunk = {
2767              oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
2768              oldLines: 0,
2769              newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
2770              newLines: 0,
2771              lines: []
2772            };
2773            mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
2774            theirsIndex++;
2775            mineIndex++;
2776  
2777            ret.hunks.push(mergedHunk);
2778          }
2779        }
2780  
2781        return ret;
2782      }
2783  
2784  	function loadPatch(param, base) {
2785        if (typeof param === 'string') {
2786          if (/^@@/m.test(param) || /^Index:/m.test(param)) {
2787            return (/*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(param)[0]
2788            );
2789          }
2790  
2791          if (!base) {
2792            throw new Error('Must provide a base reference or pass in a patch');
2793          }
2794          return (/*istanbul ignore start*/(0, _create.structuredPatch) /*istanbul ignore end*/(undefined, undefined, base, param)
2795          );
2796        }
2797  
2798        return param;
2799      }
2800  
2801  	function fileNameChanged(patch) {
2802        return patch.newFileName && patch.newFileName !== patch.oldFileName;
2803      }
2804  
2805  	function selectField(index, mine, theirs) {
2806        if (mine === theirs) {
2807          return mine;
2808        } else {
2809          index.conflict = true;
2810          return { mine: mine, theirs: theirs };
2811        }
2812      }
2813  
2814  	function hunkBefore(test, check) {
2815        return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
2816      }
2817  
2818  	function cloneHunk(hunk, offset) {
2819        return {
2820          oldStart: hunk.oldStart, oldLines: hunk.oldLines,
2821          newStart: hunk.newStart + offset, newLines: hunk.newLines,
2822          lines: hunk.lines
2823        };
2824      }
2825  
2826  	function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
2827        // This will generally result in a conflicted hunk, but there are cases where the context
2828        // is the only overlap where we can successfully merge the content here.
2829        var mine = { offset: mineOffset, lines: mineLines, index: 0 },
2830            their = { offset: theirOffset, lines: theirLines, index: 0 };
2831  
2832        // Handle any leading content
2833        insertLeading(hunk, mine, their);
2834        insertLeading(hunk, their, mine);
2835  
2836        // Now in the overlap content. Scan through and select the best changes from each.
2837        while (mine.index < mine.lines.length && their.index < their.lines.length) {
2838          var mineCurrent = mine.lines[mine.index],
2839              theirCurrent = their.lines[their.index];
2840  
2841          if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
2842            // Both modified ...
2843            mutualChange(hunk, mine, their);
2844          } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
2845            /*istanbul ignore start*/var _hunk$lines;
2846  
2847            /*istanbul ignore end*/ // Mine inserted
2848            /*istanbul ignore start*/(_hunk$lines = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(mine)));
2849          } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
2850            /*istanbul ignore start*/var _hunk$lines2;
2851  
2852            /*istanbul ignore end*/ // Theirs inserted
2853            /*istanbul ignore start*/(_hunk$lines2 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(their)));
2854          } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
2855            // Mine removed or edited
2856            removal(hunk, mine, their);
2857          } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
2858            // Their removed or edited
2859            removal(hunk, their, mine, true);
2860          } else if (mineCurrent === theirCurrent) {
2861            // Context identity
2862            hunk.lines.push(mineCurrent);
2863            mine.index++;
2864            their.index++;
2865          } else {
2866            // Context mismatch
2867            conflict(hunk, collectChange(mine), collectChange(their));
2868          }
2869        }
2870  
2871        // Now push anything that may be remaining
2872        insertTrailing(hunk, mine);
2873        insertTrailing(hunk, their);
2874  
2875        calcLineCount(hunk);
2876      }
2877  
2878  	function mutualChange(hunk, mine, their) {
2879        var myChanges = collectChange(mine),
2880            theirChanges = collectChange(their);
2881  
2882        if (allRemoves(myChanges) && allRemoves(theirChanges)) {
2883          // Special case for remove changes that are supersets of one another
2884          if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
2885            /*istanbul ignore start*/var _hunk$lines3;
2886  
2887            /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines3 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges));
2888            return;
2889          } else if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
2890            /*istanbul ignore start*/var _hunk$lines4;
2891  
2892            /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines4 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines4 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges));
2893            return;
2894          }
2895        } else if ( /*istanbul ignore start*/(0, _array.arrayEqual) /*istanbul ignore end*/(myChanges, theirChanges)) {
2896          /*istanbul ignore start*/var _hunk$lines5;
2897  
2898          /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines5 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines5 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges));
2899          return;
2900        }
2901  
2902        conflict(hunk, myChanges, theirChanges);
2903      }
2904  
2905  	function removal(hunk, mine, their, swap) {
2906        var myChanges = collectChange(mine),
2907            theirChanges = collectContext(their, myChanges);
2908        if (theirChanges.merged) {
2909          /*istanbul ignore start*/var _hunk$lines6;
2910  
2911          /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines6 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines6 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges.merged));
2912        } else {
2913          conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
2914        }
2915      }
2916  
2917  	function conflict(hunk, mine, their) {
2918        hunk.conflict = true;
2919        hunk.lines.push({
2920          conflict: true,
2921          mine: mine,
2922          theirs: their
2923        });
2924      }
2925  
2926  	function insertLeading(hunk, insert, their) {
2927        while (insert.offset < their.offset && insert.index < insert.lines.length) {
2928          var line = insert.lines[insert.index++];
2929          hunk.lines.push(line);
2930          insert.offset++;
2931        }
2932      }
2933  	function insertTrailing(hunk, insert) {
2934        while (insert.index < insert.lines.length) {
2935          var line = insert.lines[insert.index++];
2936          hunk.lines.push(line);
2937        }
2938      }
2939  
2940  	function collectChange(state) {
2941        var ret = [],
2942            operation = state.lines[state.index][0];
2943        while (state.index < state.lines.length) {
2944          var line = state.lines[state.index];
2945  
2946          // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
2947          if (operation === '-' && line[0] === '+') {
2948            operation = '+';
2949          }
2950  
2951          if (operation === line[0]) {
2952            ret.push(line);
2953            state.index++;
2954          } else {
2955            break;
2956          }
2957        }
2958  
2959        return ret;
2960      }
2961  	function collectContext(state, matchChanges) {
2962        var changes = [],
2963            merged = [],
2964            matchIndex = 0,
2965            contextChanges = false,
2966            conflicted = false;
2967        while (matchIndex < matchChanges.length && state.index < state.lines.length) {
2968          var change = state.lines[state.index],
2969              match = matchChanges[matchIndex];
2970  
2971          // Once we've hit our add, then we are done
2972          if (match[0] === '+') {
2973            break;
2974          }
2975  
2976          contextChanges = contextChanges || change[0] !== ' ';
2977  
2978          merged.push(match);
2979          matchIndex++;
2980  
2981          // Consume any additions in the other block as a conflict to attempt
2982          // to pull in the remaining context after this
2983          if (change[0] === '+') {
2984            conflicted = true;
2985  
2986            while (change[0] === '+') {
2987              changes.push(change);
2988              change = state.lines[++state.index];
2989            }
2990          }
2991  
2992          if (match.substr(1) === change.substr(1)) {
2993            changes.push(change);
2994            state.index++;
2995          } else {
2996            conflicted = true;
2997          }
2998        }
2999  
3000        if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
3001          conflicted = true;
3002        }
3003  
3004        if (conflicted) {
3005          return changes;
3006        }
3007  
3008        while (matchIndex < matchChanges.length) {
3009          merged.push(matchChanges[matchIndex++]);
3010        }
3011  
3012        return {
3013          merged: merged,
3014          changes: changes
3015        };
3016      }
3017  
3018  	function allRemoves(changes) {
3019        return changes.reduce(function (prev, change) {
3020          return prev && change[0] === '-';
3021        }, true);
3022      }
3023  	function skipRemoveSuperset(state, removeChanges, delta) {
3024        for (var i = 0; i < delta; i++) {
3025          var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
3026          if (state.lines[state.index + i] !== ' ' + changeContent) {
3027            return false;
3028          }
3029        }
3030  
3031        state.index += delta;
3032        return true;
3033      }
3034  
3035  	function calcOldNewLineCount(lines) {
3036        var oldLines = 0;
3037        var newLines = 0;
3038  
3039        lines.forEach(function (line) {
3040          if (typeof line !== 'string') {
3041            var myCount = calcOldNewLineCount(line.mine);
3042            var theirCount = calcOldNewLineCount(line.theirs);
3043  
3044            if (oldLines !== undefined) {
3045              if (myCount.oldLines === theirCount.oldLines) {
3046                oldLines += myCount.oldLines;
3047              } else {
3048                oldLines = undefined;
3049              }
3050            }
3051  
3052            if (newLines !== undefined) {
3053              if (myCount.newLines === theirCount.newLines) {
3054                newLines += myCount.newLines;
3055              } else {
3056                newLines = undefined;
3057              }
3058            }
3059          } else {
3060            if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
3061              newLines++;
3062            }
3063            if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
3064              oldLines++;
3065            }
3066          }
3067        });
3068  
3069        return { oldLines: oldLines, newLines: newLines };
3070      }
3071      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9tZXJnZS5qcyJdLCJuYW1lcyI6WyJjYWxjTGluZUNvdW50IiwibWVyZ2UiLCJodW5rIiwiY2FsY09sZE5ld0xpbmVDb3VudCIsImxpbmVzIiwib2xkTGluZXMiLCJuZXdMaW5lcyIsInVuZGVmaW5lZCIsIm1pbmUiLCJ0aGVpcnMiLCJiYXNlIiwibG9hZFBhdGNoIiwicmV0IiwiaW5kZXgiLCJuZXdGaWxlTmFtZSIsImZpbGVOYW1lQ2hhbmdlZCIsIm9sZEZpbGVOYW1lIiwib2xkSGVhZGVyIiwibmV3SGVhZGVyIiwic2VsZWN0RmllbGQiLCJodW5rcyIsIm1pbmVJbmRleCIsInRoZWlyc0luZGV4IiwibWluZU9mZnNldCIsInRoZWlyc09mZnNldCIsImxlbmd0aCIsIm1pbmVDdXJyZW50Iiwib2xkU3RhcnQiLCJJbmZpbml0eSIsInRoZWlyc0N1cnJlbnQiLCJodW5rQmVmb3JlIiwicHVzaCIsImNsb25lSHVuayIsIm1lcmdlZEh1bmsiLCJNYXRoIiwibWluIiwibmV3U3RhcnQiLCJtZXJnZUxpbmVzIiwicGFyYW0iLCJ0ZXN0IiwiRXJyb3IiLCJwYXRjaCIsImNvbmZsaWN0IiwiY2hlY2siLCJvZmZzZXQiLCJtaW5lTGluZXMiLCJ0aGVpck9mZnNldCIsInRoZWlyTGluZXMiLCJ0aGVpciIsImluc2Vyd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b3VudC5uZXdMaW5lcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBuZXdMaW5lcyA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAobmV3TGluZXMgIT09IHVuZGVmaW5lZCAmJiAobGluZVswXSA9PT0gJysnIHx8IGxpbmVbMF0gPT09ICcgJykpIHtcbiAgICAgICAgbmV3TGluZXMrKztcbiAgICAgIH1cbiAgICAgIGlmIChvbGRMaW5lcyAhPT0gdW5kZWZpbmVkICYmIChsaW5lWzBdID09PSAnLScgfHwgbGluZVswXSA9PT0gJyAnKSkge1xuICAgICAgICBvbGRMaW5lcysrO1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG5cbiAgcmV0dXJuIHtvbGRMaW5lcywgbmV3TGluZXN9O1xufVxuIl19
3072  
3073  
3074  /***/ }),
3075  /* 14 */
3076  /***/ (function(module, exports, __webpack_require__) {
3077  
3078      /*istanbul ignore start*/'use strict';
3079  
3080      exports.__esModule = true;
3081      exports. /*istanbul ignore end*/structuredPatch = structuredPatch;
3082      /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = createTwoFilesPatch;
3083      /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = createPatch;
3084  
3085      var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/;
3086  
3087      /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
3088  
3089      /*istanbul ignore end*/function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
3090        if (!options) {
3091          options = {};
3092        }
3093        if (typeof options.context === 'undefined') {
3094          options.context = 4;
3095        }
3096  
3097        var diff = /*istanbul ignore start*/(0, _line.diffLines) /*istanbul ignore end*/(oldStr, newStr, options);
3098        diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier
3099  
3100  	  function contextLines(lines) {
3101          return lines.map(function (entry) {
3102            return ' ' + entry;
3103          });
3104        }
3105  
3106        var hunks = [];
3107        var oldRangeStart = 0,
3108            newRangeStart = 0,
3109            curRange = [],
3110            oldLine = 1,
3111            newLine = 1;
3112  
3113        /*istanbul ignore start*/var _loop = function _loop( /*istanbul ignore end*/i) {
3114          var current = diff[i],
3115              lines = current.lines || current.value.replace(/\n$/, '').split('\n');
3116          current.lines = lines;
3117  
3118          if (current.added || current.removed) {
3119            /*istanbul ignore start*/var _curRange;
3120  
3121            /*istanbul ignore end*/ // If we have previous context, start with that
3122            if (!oldRangeStart) {
3123              var prev = diff[i - 1];
3124              oldRangeStart = oldLine;
3125              newRangeStart = newLine;
3126  
3127              if (prev) {
3128                curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
3129                oldRangeStart -= curRange.length;
3130                newRangeStart -= curRange.length;
3131              }
3132            }
3133  
3134            // Output our changes
3135            /*istanbul ignore start*/(_curRange = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/lines.map(function (entry) {
3136              return (current.added ? '+' : '-') + entry;
3137            })));
3138  
3139            // Track the updated file position
3140            if (current.added) {
3141              newLine += lines.length;
3142            } else {
3143              oldLine += lines.length;
3144            }
3145          } else {
3146            // Identical context lines. Track line changes
3147            if (oldRangeStart) {
3148              // Close out any changes that have been output (or join overlapping)
3149              if (lines.length <= options.context * 2 && i < diff.length - 2) {
3150                /*istanbul ignore start*/var _curRange2;
3151  
3152                /*istanbul ignore end*/ // Overlapping
3153                /*istanbul ignore start*/(_curRange2 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines)));
3154              } else {
3155                /*istanbul ignore start*/var _curRange3;
3156  
3157                /*istanbul ignore end*/ // end the range and output
3158                var contextSize = Math.min(lines.length, options.context);
3159                /*istanbul ignore start*/(_curRange3 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines.slice(0, contextSize))));
3160  
3161                var hunk = {
3162                  oldStart: oldRangeStart,
3163                  oldLines: oldLine - oldRangeStart + contextSize,
3164                  newStart: newRangeStart,
3165                  newLines: newLine - newRangeStart + contextSize,
3166                  lines: curRange
3167                };
3168                if (i >= diff.length - 2 && lines.length <= options.context) {
3169                  // EOF is inside this hunk
3170                  var oldEOFNewline = /\n$/.test(oldStr);
3171                  var newEOFNewline = /\n$/.test(newStr);
3172                  if (lines.length == 0 && !oldEOFNewline) {
3173                    // special case: old has no eol and no trailing context; no-nl can end up before adds
3174                    curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file');
3175                  } else if (!oldEOFNewline || !newEOFNewline) {
3176                    curRange.push('\\ No newline at end of file');
3177                  }
3178                }
3179                hunks.push(hunk);
3180  
3181                oldRangeStart = 0;
3182                newRangeStart = 0;
3183                curRange = [];
3184              }
3185            }
3186            oldLine += lines.length;
3187            newLine += lines.length;
3188          }
3189        };
3190  
3191        for (var i = 0; i < diff.length; i++) {
3192          /*istanbul ignore start*/_loop( /*istanbul ignore end*/i);
3193        }
3194  
3195        return {
3196          oldFileName: oldFileName, newFileName: newFileName,
3197          oldHeader: oldHeader, newHeader: newHeader,
3198          hunks: hunks
3199        };
3200      }
3201  
3202  	function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
3203        var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
3204  
3205        var ret = [];
3206        if (oldFileName == newFileName) {
3207          ret.push('Index: ' + oldFileName);
3208        }
3209        ret.push('===================================================================');
3210        ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
3211        ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
3212  
3213        for (var i = 0; i < diff.hunks.length; i++) {
3214          var hunk = diff.hunks[i];
3215          ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
3216          ret.push.apply(ret, hunk.lines);
3217        }
3218  
3219        return ret.join('\n') + '\n';
3220      }
3221  
3222  	function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
3223        return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
3224      }
3225      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9jcmVhdGUuanMiXSwibmFtZXMiOlsic3RydWN0dXJlZFBhdGNoIiwiY3JlYXRlVHdvRmlsZXNQYXRjaCIsImNyZWF0ZVBhdGNoIiwib2xkRmlsZU5hbWUiLCJuZXdGaWxlTmFtZSIsIm9sZFN0ciIsIm5ld1N0ciIsIm9sZEhlYWRlciIsIm5ld0hlYWRlciIsIm9wdGlvbnMiLCJjb250ZXh0IiwiZGlmZiIsInB1c2giLCJ2YWx1ZSIsImxpbmVzIiwiY29udGV4dExpbmVzIiwibWFwIiwiZW50cnkiLCJodW5rcyIsIm9sZFJhbmdlU3RhcnQiLCJuZXdSYW5nZVN0YXJ0IiwiY3VyUmFuZ2UiLCJvbGRMaW5lIiwibmV3TGluZSIsImkiLCJjdXJyZW50IiwicmVwbGFjZSIsInNwbGl0IiwiYWRkZWQiLCJyZW1vdmVkIiwicHJldiIsInNsaWNlIiwibGVuZ3RoIiwiY29udGV4dFNpemUiLCJNYXRoIiwibWluIiwiaHVuayIsIm9sZFN0YXJ0Iiwib2xkTGluZXMiLC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KCctLS0gJyArIGRpZmYub2xkRmlsZU5hbWUgKyAodHlwZW9mIGRpZmYub2xkSGVhZGVyID09PSAndW5kZWZpbmVkJyA/ICcnIDogJ1xcdCcgKyBkaWZmLm9sZEhlYWRlcikpO1xuICByZXQucHVzaCgnKysrICcgKyBkaWZmLm5ld0ZpbGVOYW1lICsgKHR5cGVvZiBkaWZmLm5ld0hlYWRlciA9PT0gJ3VuZGVmaW5lZCcgPyAnJyA6ICdcXHQnICsgZGlmZi5uZXdIZWFkZXIpKTtcblxuICBmb3IgKGxldCBpID0gMDsgaSA8IGRpZmYuaHVua3MubGVuZ3RoOyBpKyspIHtcbiAgICBjb25zdCBodW5rID0gZGlmZi5odW5rc1tpXTtcbiAgICByZXQucHVzaChcbiAgICAgICdAQCAtJyArIGh1bmsub2xkU3RhcnQgKyAnLCcgKyBodW5rLm9sZExpbmVzXG4gICAgICArICcgKycgKyBodW5rLm5ld1N0YXJ0ICsgJywnICsgaHVuay5uZXdMaW5lc1xuICAgICAgKyAnIEBAJ1xuICAgICk7XG4gICAgcmV0LnB1c2guYXBwbHkocmV0LCBodW5rLmxpbmVzKTtcbiAgfVxuXG4gIHJldHVybiByZXQuam9pbignXFxuJykgKyAnXFxuJztcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGNyZWF0ZVBhdGNoKGZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpIHtcbiAgcmV0dXJuIGNyZWF0ZVR3b0ZpbGVzUGF0Y2goZmlsZU5hbWUsIGZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpO1xufVxuIl19
3226  
3227  
3228  /***/ }),
3229  /* 15 */
3230  /***/ (function(module, exports) {
3231  
3232      /*istanbul ignore start*/"use strict";
3233  
3234      exports.__esModule = true;
3235      exports. /*istanbul ignore end*/arrayEqual = arrayEqual;
3236      /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayStartsWith = arrayStartsWith;
3237  	function arrayEqual(a, b) {
3238        if (a.length !== b.length) {
3239          return false;
3240        }
3241  
3242        return arrayStartsWith(a, b);
3243      }
3244  
3245  	function arrayStartsWith(array, start) {
3246        if (start.length > array.length) {
3247          return false;
3248        }
3249  
3250        for (var i = 0; i < start.length; i++) {
3251          if (start[i] !== array[i]) {
3252            return false;
3253          }
3254        }
3255  
3256        return true;
3257      }
3258      //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2FycmF5LmpzIl0sIm5hbWVzIjpbImFycmF5RXF1YWwiLCJhcnJheVN0YXJ0c1dpdGgiLCJhIiwiYiIsImxlbmd0aCIsImFycmF5Iiwic3RhcnQiLCJpIl0sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCQSxVLEdBQUFBLFU7eURBUUFDLGUsR0FBQUEsZTtBQVJULFNBQVNELFVBQVQsQ0FBb0JFLENBQXBCLEVBQXVCQyxDQUF2QixFQUEwQjtBQUMvQixNQUFJRCxFQUFFRSxNQUFGLEtBQWFELEVBQUVDLE1BQW5CLEVBQTJCO0FBQ3pCLFdBQU8sS0FBUDtBQUNEOztBQUVELFNBQU9ILGdCQUFnQkMsQ0FBaEIsRUFBbUJDLENBQW5CLENBQVA7QUFDRDs7QUFFTSxTQUFTRixlQUFULENBQXlCSSxLQUF6QixFQUFnQ0MsS0FBaEMsRUFBdUM7QUFDNUMsTUFBSUEsTUFBTUYsTUFBTixHQUFlQyxNQUFNRCxNQUF6QixFQUFpQztBQUMvQixXQUFPLEtBQVA7QUFDRDs7QUFFRCxPQUFLLElBQUlHLElBQUksQ0FBYixFQUFnQkEsSUFBSUQsTUFBTUYsTUFBMUIsRUFBa0NHLEdBQWxDLEVBQXVDO0FBQ3JDLFFBQUlELE1BQU1DLENBQU4sTUFBYUYsTUFBTUUsQ0FBTixDQUFqQixFQUEyQjtBQUN6QixhQUFPLEtBQVA7QUFDRDtBQUNGOztBQUVELFNBQU8sSUFBUDtBQUNEIiwiZmlsZSI6ImFycmF5LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGFycmF5RXF1YWwoYSwgYikge1xuICBpZiAoYS5sZW5ndGggIT09IGIubGVuZ3RoKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgcmV0dXJuIGFycmF5U3RhcnRzV2l0aChhLCBiKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGFycmF5U3RhcnRzV2l0aChhcnJheSwgc3RhcnQpIHtcbiAgaWYgKHN0YXJ0Lmxlbmd0aCA+IGFycmF5Lmxlbmd0aCkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgc3RhcnQubGVuZ3RoOyBpKyspIHtcbiAgICBpZiAoc3RhcnRbaV0gIT09IGFycmF5W2ldKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHRydWU7XG59XG4iXX0=
3259  
3260  
3261  /***/ }),
3262  /* 16 */
3263  /***/ (function(module, exports) {
3264  
3265      /*istanbul ignore start*/"use strict";
3266  
3267      exports.__esModule = true;
3268      exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP;
3269      // See: http://code.google.com/p/google-diff-match-patch/wiki/API
3270  	function convertChangesToDMP(changes) {
3271        var ret = [],
3272            change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
3273            operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
3274        for (var i = 0; i < changes.length; i++) {
3275          change = changes[i];
3276          if (change.added) {
3277            operation = 1;
3278          } else if (change.removed) {
3279            operation = -1;
3280          } else {
3281            operation = 0;
3282          }
3283  
3284          ret.push([operation, change.value]);
3285        }
3286        return ret;
3287      }
3288      //# sourceMappingURL=data:application/json;charset=utf-8;base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mV0ID0gW10sXG4gICAgICBjaGFuZ2UsXG4gICAgICBvcGVyYXRpb247XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhbmdlcy5sZW5ndGg7IGkrKykge1xuICAgIGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgb3BlcmF0aW9uID0gMTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAtMTtcbiAgICB9IGVsc2Uge1xuICAgICAgb3BlcmF0aW9uID0gMDtcbiAgICB9XG5cbiAgICByZXQucHVzaChbb3BlcmF0aW9uLCBjaGFuZ2UudmFsdWVdKTtcbiAgfVxuICByZXR1cm4gcmV0O1xufVxuIl19
3289  
3290  
3291  /***/ }),
3292  /* 17 */
3293  /***/ (function(module, exports) {
3294  
3295      /*istanbul ignore start*/'use strict';
3296  
3297      exports.__esModule = true;
3298      exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML;
3299  	function convertChangesToXML(changes) {
3300        var ret = [];
3301        for (var i = 0; i < changes.length; i++) {
3302          var change = changes[i];
3303          if (change.added) {
3304            ret.push('<ins>');
3305          } else if (change.removed) {
3306            ret.push('<del>');
3307          }
3308  
3309          ret.push(escapeHTML(change.value));
3310  
3311          if (change.added) {
3312            ret.push('</ins>');
3313          } else if (change.removed) {
3314            ret.push('</del>');
3315          }
3316        }
3317        return ret.join('');
3318      }
3319  
3320  	function escapeHTML(s) {
3321        var n = s;
3322        n = n.replace(/&/g, '&amp;');
3323        n = n.replace(/</g, '&lt;');
3324        n = n.replace(/>/g, '&gt;');
3325        n = n.replace(/"/g, '&quot;');
3326  
3327        return n;
3328      }
3329      
3330  
3331  /***/ })
3332  /******/ ])
3333  });
3334  ;
3335  
3336  /***/ }),
3337  
3338  /***/ 21:
3339  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3340  
3341  "use strict";
3342  
3343  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
3344  function _objectWithoutPropertiesLoose(source, excluded) {
3345    if (source == null) return {};
3346    var target = {};
3347    var sourceKeys = Object.keys(source);
3348    var key, i;
3349  
3350    for (i = 0; i < sourceKeys.length; i++) {
3351      key = sourceKeys[i];
3352      if (excluded.indexOf(key) >= 0) continue;
3353      target[key] = source[key];
3354    }
3355  
3356    return target;
3357  }
3358  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
3359  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
3360  
3361  function _objectWithoutProperties(source, excluded) {
3362    if (source == null) return {};
3363    var target = _objectWithoutPropertiesLoose(source, excluded);
3364    var key, i;
3365  
3366    if (Object.getOwnPropertySymbols) {
3367      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
3368  
3369      for (i = 0; i < sourceSymbolKeys.length; i++) {
3370        key = sourceSymbolKeys[i];
3371        if (excluded.indexOf(key) >= 0) continue;
3372        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
3373        target[key] = source[key];
3374      }
3375    }
3376  
3377    return target;
3378  }
3379  
3380  /***/ }),
3381  
3382  /***/ 23:
3383  /***/ (function(module, exports, __webpack_require__) {
3384  
3385  module.exports = __webpack_require__(54);
3386  
3387  
3388  /***/ }),
3389  
3390  /***/ 24:
3391  /***/ (function(module, exports) {
3392  
3393  (function() { module.exports = this["wp"]["dom"]; }());
3394  
3395  /***/ }),
3396  
3397  /***/ 25:
3398  /***/ (function(module, exports) {
3399  
3400  (function() { module.exports = this["wp"]["url"]; }());
3401  
3402  /***/ }),
3403  
3404  /***/ 26:
3405  /***/ (function(module, exports) {
3406  
3407  (function() { module.exports = this["wp"]["hooks"]; }());
3408  
3409  /***/ }),
3410  
3411  /***/ 27:
3412  /***/ (function(module, exports) {
3413  
3414  (function() { module.exports = this["React"]; }());
3415  
3416  /***/ }),
3417  
3418  /***/ 28:
3419  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3420  
3421  "use strict";
3422  
3423  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
3424  var arrayWithHoles = __webpack_require__(37);
3425  
3426  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
3427  function _iterableToArrayLimit(arr, i) {
3428    var _arr = [];
3429    var _n = true;
3430    var _d = false;
3431    var _e = undefined;
3432  
3433    try {
3434      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
3435        _arr.push(_s.value);
3436  
3437        if (i && _arr.length === i) break;
3438      }
3439    } catch (err) {
3440      _d = true;
3441      _e = err;
3442    } finally {
3443      try {
3444        if (!_n && _i["return"] != null) _i["return"]();
3445      } finally {
3446        if (_d) throw _e;
3447      }
3448    }
3449  
3450    return _arr;
3451  }
3452  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
3453  var nonIterableRest = __webpack_require__(38);
3454  
3455  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
3456  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
3457  
3458  
3459  
3460  function _slicedToArray(arr, i) {
3461    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(nonIterableRest["a" /* default */])();
3462  }
3463  
3464  /***/ }),
3465  
3466  /***/ 3:
3467  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3468  
3469  "use strict";
3470  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
3471  function _assertThisInitialized(self) {
3472    if (self === void 0) {
3473      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
3474    }
3475  
3476    return self;
3477  }
3478  
3479  /***/ }),
3480  
3481  /***/ 30:
3482  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3483  
3484  "use strict";
3485  
3486  
3487  var LEAF_KEY, hasWeakMap;
3488  
3489  /**
3490   * Arbitrary value used as key for referencing cache object in WeakMap tree.
3491   *
3492   * @type {Object}
3493   */
3494  LEAF_KEY = {};
3495  
3496  /**
3497   * Whether environment supports WeakMap.
3498   *
3499   * @type {boolean}
3500   */
3501  hasWeakMap = typeof WeakMap !== 'undefined';
3502  
3503  /**
3504   * Returns the first argument as the sole entry in an array.
3505   *
3506   * @param {*} value Value to return.
3507   *
3508   * @return {Array} Value returned as entry in array.
3509   */
3510  function arrayOf( value ) {
3511      return [ value ];
3512  }
3513  
3514  /**
3515   * Returns true if the value passed is object-like, or false otherwise. A value
3516   * is object-like if it can support property assignment, e.g. object or array.
3517   *
3518   * @param {*} value Value to test.
3519   *
3520   * @return {boolean} Whether value is object-like.
3521   */
3522  function isObjectLike( value ) {
3523      return !! value && 'object' === typeof value;
3524  }
3525  
3526  /**
3527   * Creates and returns a new cache object.
3528   *
3529   * @return {Object} Cache object.
3530   */
3531  function createCache() {
3532      var cache = {
3533          clear: function() {
3534              cache.head = null;
3535          },
3536      };
3537  
3538      return cache;
3539  }
3540  
3541  /**
3542   * Returns true if entries within the two arrays are strictly equal by
3543   * reference from a starting index.
3544   *
3545   * @param {Array}  a         First array.
3546   * @param {Array}  b         Second array.
3547   * @param {number} fromIndex Index from which to start comparison.
3548   *
3549   * @return {boolean} Whether arrays are shallowly equal.
3550   */
3551  function isShallowEqual( a, b, fromIndex ) {
3552      var i;
3553  
3554      if ( a.length !== b.length ) {
3555          return false;
3556      }
3557  
3558      for ( i = fromIndex; i < a.length; i++ ) {
3559          if ( a[ i ] !== b[ i ] ) {
3560              return false;
3561          }
3562      }
3563  
3564      return true;
3565  }
3566  
3567  /**
3568   * Returns a memoized selector function. The getDependants function argument is
3569   * called before the memoized selector and is expected to return an immutable
3570   * reference or array of references on which the selector depends for computing
3571   * its own return value. The memoize cache is preserved only as long as those
3572   * dependant references remain the same. If getDependants returns a different
3573   * reference(s), the cache is cleared and the selector value regenerated.
3574   *
3575   * @param {Function} selector      Selector function.
3576   * @param {Function} getDependants Dependant getter returning an immutable
3577   *                                 reference or array of reference used in
3578   *                                 cache bust consideration.
3579   *
3580   * @return {Function} Memoized selector.
3581   */
3582  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
3583      var rootCache, getCache;
3584  
3585      // Use object source as dependant if getter not provided
3586      if ( ! getDependants ) {
3587          getDependants = arrayOf;
3588      }
3589  
3590      /**
3591       * Returns the root cache. If WeakMap is supported, this is assigned to the
3592       * root WeakMap cache set, otherwise it is a shared instance of the default
3593       * cache object.
3594       *
3595       * @return {(WeakMap|Object)} Root cache object.
3596       */
3597  	function getRootCache() {
3598          return rootCache;
3599      }
3600  
3601      /**
3602       * Returns the cache for a given dependants array. When possible, a WeakMap
3603       * will be used to create a unique cache for each set of dependants. This
3604       * is feasible due to the nature of WeakMap in allowing garbage collection
3605       * to occur on entries where the key object is no longer referenced. Since
3606       * WeakMap requires the key to be an object, this is only possible when the
3607       * dependant is object-like. The root cache is created as a hierarchy where
3608       * each top-level key is the first entry in a dependants set, the value a
3609       * WeakMap where each key is the next dependant, and so on. This continues
3610       * so long as the dependants are object-like. If no dependants are object-
3611       * like, then the cache is shared across all invocations.
3612       *
3613       * @see isObjectLike
3614       *
3615       * @param {Array} dependants Selector dependants.
3616       *
3617       * @return {Object} Cache object.
3618       */
3619  	function getWeakMapCache( dependants ) {
3620          var caches = rootCache,
3621              isUniqueByDependants = true,
3622              i, dependant, map, cache;
3623  
3624          for ( i = 0; i < dependants.length; i++ ) {
3625              dependant = dependants[ i ];
3626  
3627              // Can only compose WeakMap from object-like key.
3628              if ( ! isObjectLike( dependant ) ) {
3629                  isUniqueByDependants = false;
3630                  break;
3631              }
3632  
3633              // Does current segment of cache already have a WeakMap?
3634              if ( caches.has( dependant ) ) {
3635                  // Traverse into nested WeakMap.
3636                  caches = caches.get( dependant );
3637              } else {
3638                  // Create, set, and traverse into a new one.
3639                  map = new WeakMap();
3640                  caches.set( dependant, map );
3641                  caches = map;
3642              }
3643          }
3644  
3645          // We use an arbitrary (but consistent) object as key for the last item
3646          // in the WeakMap to serve as our running cache.
3647          if ( ! caches.has( LEAF_KEY ) ) {
3648              cache = createCache();
3649              cache.isUniqueByDependants = isUniqueByDependants;
3650              caches.set( LEAF_KEY, cache );
3651          }
3652  
3653          return caches.get( LEAF_KEY );
3654      }
3655  
3656      // Assign cache handler by availability of WeakMap
3657      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
3658  
3659      /**
3660       * Resets root memoization cache.
3661       */
3662  	function clear() {
3663          rootCache = hasWeakMap ? new WeakMap() : createCache();
3664      }
3665  
3666      // eslint-disable-next-line jsdoc/check-param-names
3667      /**
3668       * The augmented selector call, considering first whether dependants have
3669       * changed before passing it to underlying memoize function.
3670       *
3671       * @param {Object} source    Source object for derivation.
3672       * @param {...*}   extraArgs Additional arguments to pass to selector.
3673       *
3674       * @return {*} Selector result.
3675       */
3676  	function callSelector( /* source, ...extraArgs */ ) {
3677          var len = arguments.length,
3678              cache, node, i, args, dependants;
3679  
3680          // Create copy of arguments (avoid leaking deoptimization).
3681          args = new Array( len );
3682          for ( i = 0; i < len; i++ ) {
3683              args[ i ] = arguments[ i ];
3684          }
3685  
3686          dependants = getDependants.apply( null, args );
3687          cache = getCache( dependants );
3688  
3689          // If not guaranteed uniqueness by dependants (primitive type or lack
3690          // of WeakMap support), shallow compare against last dependants and, if
3691          // references have changed, destroy cache to recalculate result.
3692          if ( ! cache.isUniqueByDependants ) {
3693              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
3694                  cache.clear();
3695              }
3696  
3697              cache.lastDependants = dependants;
3698          }
3699  
3700          node = cache.head;
3701          while ( node ) {
3702              // Check whether node arguments match arguments
3703              if ( ! isShallowEqual( node.args, args, 1 ) ) {
3704                  node = node.next;
3705                  continue;
3706              }
3707  
3708              // At this point we can assume we've found a match
3709  
3710              // Surface matched node to head if not already
3711              if ( node !== cache.head ) {
3712                  // Adjust siblings to point to each other.
3713                  node.prev.next = node.next;
3714                  if ( node.next ) {
3715                      node.next.prev = node.prev;
3716                  }
3717  
3718                  node.next = cache.head;
3719                  node.prev = null;
3720                  cache.head.prev = node;
3721                  cache.head = node;
3722              }
3723  
3724              // Return immediately
3725              return node.val;
3726          }
3727  
3728          // No cached value found. Continue to insertion phase:
3729  
3730          node = {
3731              // Generate the result from original function
3732              val: selector.apply( null, args ),
3733          };
3734  
3735          // Avoid including the source object in the cache.
3736          args[ 0 ] = null;
3737          node.args = args;
3738  
3739          // Don't need to check whether node is already head, since it would
3740          // have been returned above already if it was
3741  
3742          // Shift existing head down list
3743          if ( cache.head ) {
3744              cache.head.prev = node;
3745              node.next = cache.head;
3746          }
3747  
3748          cache.head = node;
3749  
3750          return node.val;
3751      }
3752  
3753      callSelector.getDependants = getDependants;
3754      callSelector.clear = clear;
3755      clear();
3756  
3757      return callSelector;
3758  });
3759  
3760  
3761  /***/ }),
3762  
3763  /***/ 31:
3764  /***/ (function(module, exports, __webpack_require__) {
3765  
3766  /**
3767   * Copyright (c) 2013-present, Facebook, Inc.
3768   *
3769   * This source code is licensed under the MIT license found in the
3770   * LICENSE file in the root directory of this source tree.
3771   */
3772  
3773  if (false) { var throwOnDirectAccess, ReactIs; } else {
3774    // By explicitly using `prop-types` you are opting into new production behavior.
3775    // http://fb.me/prop-types-in-prod
3776    module.exports = __webpack_require__(88)();
3777  }
3778  
3779  
3780  /***/ }),
3781  
3782  /***/ 32:
3783  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3784  
3785  "use strict";
3786  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
3787  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); }
3788  
3789  function _typeof(obj) {
3790    if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
3791      _typeof = function _typeof(obj) {
3792        return _typeof2(obj);
3793      };
3794    } else {
3795      _typeof = function _typeof(obj) {
3796        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
3797      };
3798    }
3799  
3800    return _typeof(obj);
3801  }
3802  
3803  /***/ }),
3804  
3805  /***/ 33:
3806  /***/ (function(module, exports) {
3807  
3808  (function() { module.exports = this["wp"]["apiFetch"]; }());
3809  
3810  /***/ }),
3811  
3812  /***/ 34:
3813  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3814  
3815  "use strict";
3816  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
3817  function _iterableToArray(iter) {
3818    if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
3819  }
3820  
3821  /***/ }),
3822  
3823  /***/ 343:
3824  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3825  
3826  "use strict";
3827  __webpack_require__.r(__webpack_exports__);
3828  var actions_namespaceObject = {};
3829  __webpack_require__.r(actions_namespaceObject);
3830  __webpack_require__.d(actions_namespaceObject, "resetBlocks", function() { return resetBlocks; });
3831  __webpack_require__.d(actions_namespaceObject, "receiveBlocks", function() { return receiveBlocks; });
3832  __webpack_require__.d(actions_namespaceObject, "updateBlockAttributes", function() { return updateBlockAttributes; });
3833  __webpack_require__.d(actions_namespaceObject, "updateBlock", function() { return updateBlock; });
3834  __webpack_require__.d(actions_namespaceObject, "selectBlock", function() { return actions_selectBlock; });
3835  __webpack_require__.d(actions_namespaceObject, "selectPreviousBlock", function() { return selectPreviousBlock; });
3836  __webpack_require__.d(actions_namespaceObject, "selectNextBlock", function() { return selectNextBlock; });
3837  __webpack_require__.d(actions_namespaceObject, "startMultiSelect", function() { return startMultiSelect; });
3838  __webpack_require__.d(actions_namespaceObject, "stopMultiSelect", function() { return stopMultiSelect; });
3839  __webpack_require__.d(actions_namespaceObject, "multiSelect", function() { return actions_multiSelect; });
3840  __webpack_require__.d(actions_namespaceObject, "clearSelectedBlock", function() { return clearSelectedBlock; });
3841  __webpack_require__.d(actions_namespaceObject, "toggleSelection", function() { return toggleSelection; });
3842  __webpack_require__.d(actions_namespaceObject, "replaceBlocks", function() { return actions_replaceBlocks; });
3843  __webpack_require__.d(actions_namespaceObject, "replaceBlock", function() { return replaceBlock; });
3844  __webpack_require__.d(actions_namespaceObject, "moveBlocksDown", function() { return actions_moveBlocksDown; });
3845  __webpack_require__.d(actions_namespaceObject, "moveBlocksUp", function() { return actions_moveBlocksUp; });
3846  __webpack_require__.d(actions_namespaceObject, "moveBlockToPosition", function() { return moveBlockToPosition; });
3847  __webpack_require__.d(actions_namespaceObject, "insertBlock", function() { return actions_insertBlock; });
3848  __webpack_require__.d(actions_namespaceObject, "insertBlocks", function() { return actions_insertBlocks; });
3849  __webpack_require__.d(actions_namespaceObject, "showInsertionPoint", function() { return actions_showInsertionPoint; });
3850  __webpack_require__.d(actions_namespaceObject, "hideInsertionPoint", function() { return actions_hideInsertionPoint; });
3851  __webpack_require__.d(actions_namespaceObject, "setTemplateValidity", function() { return setTemplateValidity; });
3852  __webpack_require__.d(actions_namespaceObject, "synchronizeTemplate", function() { return synchronizeTemplate; });
3853  __webpack_require__.d(actions_namespaceObject, "mergeBlocks", function() { return mergeBlocks; });
3854  __webpack_require__.d(actions_namespaceObject, "removeBlocks", function() { return actions_removeBlocks; });
3855  __webpack_require__.d(actions_namespaceObject, "removeBlock", function() { return removeBlock; });
3856  __webpack_require__.d(actions_namespaceObject, "replaceInnerBlocks", function() { return actions_replaceInnerBlocks; });
3857  __webpack_require__.d(actions_namespaceObject, "toggleBlockMode", function() { return toggleBlockMode; });
3858  __webpack_require__.d(actions_namespaceObject, "startTyping", function() { return startTyping; });
3859  __webpack_require__.d(actions_namespaceObject, "stopTyping", function() { return stopTyping; });
3860  __webpack_require__.d(actions_namespaceObject, "enterFormattedText", function() { return enterFormattedText; });
3861  __webpack_require__.d(actions_namespaceObject, "exitFormattedText", function() { return exitFormattedText; });
3862  __webpack_require__.d(actions_namespaceObject, "insertDefaultBlock", function() { return actions_insertDefaultBlock; });
3863  __webpack_require__.d(actions_namespaceObject, "updateBlockListSettings", function() { return updateBlockListSettings; });
3864  __webpack_require__.d(actions_namespaceObject, "updateSettings", function() { return updateSettings; });
3865  __webpack_require__.d(actions_namespaceObject, "__unstableSaveReusableBlock", function() { return __unstableSaveReusableBlock; });
3866  __webpack_require__.d(actions_namespaceObject, "__unstableMarkLastChangeAsPersistent", function() { return __unstableMarkLastChangeAsPersistent; });
3867  var selectors_namespaceObject = {};
3868  __webpack_require__.r(selectors_namespaceObject);
3869  __webpack_require__.d(selectors_namespaceObject, "INSERTER_UTILITY_HIGH", function() { return INSERTER_UTILITY_HIGH; });
3870  __webpack_require__.d(selectors_namespaceObject, "INSERTER_UTILITY_MEDIUM", function() { return INSERTER_UTILITY_MEDIUM; });
3871  __webpack_require__.d(selectors_namespaceObject, "INSERTER_UTILITY_LOW", function() { return INSERTER_UTILITY_LOW; });
3872  __webpack_require__.d(selectors_namespaceObject, "INSERTER_UTILITY_NONE", function() { return INSERTER_UTILITY_NONE; });
3873  __webpack_require__.d(selectors_namespaceObject, "getBlockDependantsCacheBust", function() { return getBlockDependantsCacheBust; });
3874  __webpack_require__.d(selectors_namespaceObject, "getBlockName", function() { return selectors_getBlockName; });
3875  __webpack_require__.d(selectors_namespaceObject, "isBlockValid", function() { return selectors_isBlockValid; });
3876  __webpack_require__.d(selectors_namespaceObject, "getBlockAttributes", function() { return getBlockAttributes; });
3877  __webpack_require__.d(selectors_namespaceObject, "getBlock", function() { return selectors_getBlock; });
3878  __webpack_require__.d(selectors_namespaceObject, "__unstableGetBlockWithoutInnerBlocks", function() { return selectors_unstableGetBlockWithoutInnerBlocks; });
3879  __webpack_require__.d(selectors_namespaceObject, "getBlocks", function() { return getBlocks; });
3880  __webpack_require__.d(selectors_namespaceObject, "getClientIdsOfDescendants", function() { return selectors_getClientIdsOfDescendants; });
3881  __webpack_require__.d(selectors_namespaceObject, "getClientIdsWithDescendants", function() { return getClientIdsWithDescendants; });
3882  __webpack_require__.d(selectors_namespaceObject, "getGlobalBlockCount", function() { return getGlobalBlockCount; });
3883  __webpack_require__.d(selectors_namespaceObject, "getBlocksByClientId", function() { return selectors_getBlocksByClientId; });
3884  __webpack_require__.d(selectors_namespaceObject, "getBlockCount", function() { return selectors_getBlockCount; });
3885  __webpack_require__.d(selectors_namespaceObject, "getBlockSelectionStart", function() { return getBlockSelectionStart; });
3886  __webpack_require__.d(selectors_namespaceObject, "getBlockSelectionEnd", function() { return getBlockSelectionEnd; });
3887  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlockCount", function() { return selectors_getSelectedBlockCount; });
3888  __webpack_require__.d(selectors_namespaceObject, "hasSelectedBlock", function() { return hasSelectedBlock; });
3889  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlockClientId", function() { return selectors_getSelectedBlockClientId; });
3890  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlock", function() { return selectors_getSelectedBlock; });
3891  __webpack_require__.d(selectors_namespaceObject, "getBlockRootClientId", function() { return selectors_getBlockRootClientId; });
3892  __webpack_require__.d(selectors_namespaceObject, "getBlockHierarchyRootClientId", function() { return getBlockHierarchyRootClientId; });
3893  __webpack_require__.d(selectors_namespaceObject, "getAdjacentBlockClientId", function() { return getAdjacentBlockClientId; });
3894  __webpack_require__.d(selectors_namespaceObject, "getPreviousBlockClientId", function() { return getPreviousBlockClientId; });
3895  __webpack_require__.d(selectors_namespaceObject, "getNextBlockClientId", function() { return getNextBlockClientId; });
3896  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlocksInitialCaretPosition", function() { return selectors_getSelectedBlocksInitialCaretPosition; });
3897  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlockClientIds", function() { return selectors_getMultiSelectedBlockClientIds; });
3898  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocks", function() { return getMultiSelectedBlocks; });
3899  __webpack_require__.d(selectors_namespaceObject, "getFirstMultiSelectedBlockClientId", function() { return getFirstMultiSelectedBlockClientId; });
3900  __webpack_require__.d(selectors_namespaceObject, "getLastMultiSelectedBlockClientId", function() { return getLastMultiSelectedBlockClientId; });
3901  __webpack_require__.d(selectors_namespaceObject, "isFirstMultiSelectedBlock", function() { return selectors_isFirstMultiSelectedBlock; });
3902  __webpack_require__.d(selectors_namespaceObject, "isBlockMultiSelected", function() { return selectors_isBlockMultiSelected; });
3903  __webpack_require__.d(selectors_namespaceObject, "isAncestorMultiSelected", function() { return selectors_isAncestorMultiSelected; });
3904  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksStartClientId", function() { return getMultiSelectedBlocksStartClientId; });
3905  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksEndClientId", function() { return getMultiSelectedBlocksEndClientId; });
3906  __webpack_require__.d(selectors_namespaceObject, "getBlockOrder", function() { return selectors_getBlockOrder; });
3907  __webpack_require__.d(selectors_namespaceObject, "getBlockIndex", function() { return selectors_getBlockIndex; });
3908  __webpack_require__.d(selectors_namespaceObject, "isBlockSelected", function() { return selectors_isBlockSelected; });
3909  __webpack_require__.d(selectors_namespaceObject, "hasSelectedInnerBlock", function() { return selectors_hasSelectedInnerBlock; });
3910  __webpack_require__.d(selectors_namespaceObject, "isBlockWithinSelection", function() { return isBlockWithinSelection; });
3911  __webpack_require__.d(selectors_namespaceObject, "hasMultiSelection", function() { return selectors_hasMultiSelection; });
3912  __webpack_require__.d(selectors_namespaceObject, "isMultiSelecting", function() { return selectors_isMultiSelecting; });
3913  __webpack_require__.d(selectors_namespaceObject, "isSelectionEnabled", function() { return selectors_isSelectionEnabled; });
3914  __webpack_require__.d(selectors_namespaceObject, "getBlockMode", function() { return selectors_getBlockMode; });
3915  __webpack_require__.d(selectors_namespaceObject, "isTyping", function() { return selectors_isTyping; });
3916  __webpack_require__.d(selectors_namespaceObject, "isCaretWithinFormattedText", function() { return selectors_isCaretWithinFormattedText; });
3917  __webpack_require__.d(selectors_namespaceObject, "getBlockInsertionPoint", function() { return getBlockInsertionPoint; });
3918  __webpack_require__.d(selectors_namespaceObject, "isBlockInsertionPointVisible", function() { return isBlockInsertionPointVisible; });
3919  __webpack_require__.d(selectors_namespaceObject, "isValidTemplate", function() { return isValidTemplate; });
3920  __webpack_require__.d(selectors_namespaceObject, "getTemplate", function() { return getTemplate; });
3921  __webpack_require__.d(selectors_namespaceObject, "getTemplateLock", function() { return selectors_getTemplateLock; });
3922  __webpack_require__.d(selectors_namespaceObject, "canInsertBlockType", function() { return selectors_canInsertBlockType; });
3923  __webpack_require__.d(selectors_namespaceObject, "getInserterItems", function() { return selectors_getInserterItems; });
3924  __webpack_require__.d(selectors_namespaceObject, "hasInserterItems", function() { return hasInserterItems; });
3925  __webpack_require__.d(selectors_namespaceObject, "getBlockListSettings", function() { return getBlockListSettings; });
3926  __webpack_require__.d(selectors_namespaceObject, "getSettings", function() { return selectors_getSettings; });
3927  __webpack_require__.d(selectors_namespaceObject, "isLastBlockChangePersistent", function() { return isLastBlockChangePersistent; });
3928  __webpack_require__.d(selectors_namespaceObject, "__unstableIsLastBlockChangeIgnored", function() { return __unstableIsLastBlockChangeIgnored; });
3929  
3930  // EXTERNAL MODULE: external {"this":["wp","blocks"]}
3931  var external_this_wp_blocks_ = __webpack_require__(14);
3932  
3933  // EXTERNAL MODULE: external {"this":["wp","coreData"]}
3934  var external_this_wp_coreData_ = __webpack_require__(72);
3935  
3936  // EXTERNAL MODULE: external {"this":["wp","richText"]}
3937  var external_this_wp_richText_ = __webpack_require__(20);
3938  
3939  // EXTERNAL MODULE: external {"this":["wp","viewport"]}
3940  var external_this_wp_viewport_ = __webpack_require__(40);
3941  
3942  // EXTERNAL MODULE: external {"this":["wp","data"]}
3943  var external_this_wp_data_ = __webpack_require__(5);
3944  
3945  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
3946  var objectSpread = __webpack_require__(7);
3947  
3948  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
3949  var objectWithoutProperties = __webpack_require__(21);
3950  
3951  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
3952  var toConsumableArray = __webpack_require__(17);
3953  
3954  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
3955  var defineProperty = __webpack_require__(15);
3956  
3957  // EXTERNAL MODULE: external "lodash"
3958  var external_lodash_ = __webpack_require__(2);
3959  
3960  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
3961  var external_this_wp_i18n_ = __webpack_require__(1);
3962  
3963  // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/defaults.js
3964  /**
3965   * WordPress dependencies
3966   */
3967  
3968  var PREFERENCES_DEFAULTS = {
3969    insertUsage: {}
3970  };
3971  /**
3972   * The default editor settings
3973   *
3974   *  alignWide                     boolean       Enable/Disable Wide/Full Alignments
3975   *  availableLegacyWidgets        Array         Array of objects representing the legacy widgets available.
3976   *  colors                        Array         Palette colors
3977   *  disableCustomColors           boolean       Whether or not the custom colors are disabled
3978   *  fontSizes                     Array         Available font sizes
3979   *  disableCustomFontSizes        boolean       Whether or not the custom font sizes are disabled
3980   *  imageSizes                    Array         Available image sizes
3981   *  maxWidth                      number        Max width to constraint resizing
3982   *  allowedBlockTypes             boolean|Array Allowed block types
3983   *  hasFixedToolbar               boolean       Whether or not the editor toolbar is fixed
3984   *  hasPermissionsToManageWidgets boolean       Whether or not the user is able to manage widgets.
3985   *  focusMode                     boolean       Whether the focus mode is enabled or not
3986   *  styles                        Array         Editor Styles
3987   *  isRTL                         boolean       Whether the editor is in RTL mode
3988   *  bodyPlaceholder               string        Empty post placeholder
3989   *  titlePlaceholder              string        Empty title placeholder
3990   */
3991  
3992  var SETTINGS_DEFAULTS = {
3993    alignWide: false,
3994    colors: [{
3995      name: Object(external_this_wp_i18n_["__"])('Pale pink'),
3996      slug: 'pale-pink',
3997      color: '#f78da7'
3998    }, {
3999      name: Object(external_this_wp_i18n_["__"])('Vivid red'),
4000      slug: 'vivid-red',
4001      color: '#cf2e2e'
4002    }, {
4003      name: Object(external_this_wp_i18n_["__"])('Luminous vivid orange'),
4004      slug: 'luminous-vivid-orange',
4005      color: '#ff6900'
4006    }, {
4007      name: Object(external_this_wp_i18n_["__"])('Luminous vivid amber'),
4008      slug: 'luminous-vivid-amber',
4009      color: '#fcb900'
4010    }, {
4011      name: Object(external_this_wp_i18n_["__"])('Light green cyan'),
4012      slug: 'light-green-cyan',
4013      color: '#7bdcb5'
4014    }, {
4015      name: Object(external_this_wp_i18n_["__"])('Vivid green cyan'),
4016      slug: 'vivid-green-cyan',
4017      color: '#00d084'
4018    }, {
4019      name: Object(external_this_wp_i18n_["__"])('Pale cyan blue'),
4020      slug: 'pale-cyan-blue',
4021      color: '#8ed1fc'
4022    }, {
4023      name: Object(external_this_wp_i18n_["__"])('Vivid cyan blue'),
4024      slug: 'vivid-cyan-blue',
4025      color: '#0693e3'
4026    }, {
4027      name: Object(external_this_wp_i18n_["__"])('Very light gray'),
4028      slug: 'very-light-gray',
4029      color: '#eeeeee'
4030    }, {
4031      name: Object(external_this_wp_i18n_["__"])('Cyan bluish gray'),
4032      slug: 'cyan-bluish-gray',
4033      color: '#abb8c3'
4034    }, {
4035      name: Object(external_this_wp_i18n_["__"])('Very dark gray'),
4036      slug: 'very-dark-gray',
4037      color: '#313131'
4038    }],
4039    fontSizes: [{
4040      name: Object(external_this_wp_i18n_["_x"])('Small', 'font size name'),
4041      size: 13,
4042      slug: 'small'
4043    }, {
4044      name: Object(external_this_wp_i18n_["_x"])('Normal', 'font size name'),
4045      size: 16,
4046      slug: 'normal'
4047    }, {
4048      name: Object(external_this_wp_i18n_["_x"])('Medium', 'font size name'),
4049      size: 20,
4050      slug: 'medium'
4051    }, {
4052      name: Object(external_this_wp_i18n_["_x"])('Large', 'font size name'),
4053      size: 36,
4054      slug: 'large'
4055    }, {
4056      name: Object(external_this_wp_i18n_["_x"])('Huge', 'font size name'),
4057      size: 48,
4058      slug: 'huge'
4059    }],
4060    imageSizes: [{
4061      slug: 'thumbnail',
4062      label: Object(external_this_wp_i18n_["__"])('Thumbnail')
4063    }, {
4064      slug: 'medium',
4065      label: Object(external_this_wp_i18n_["__"])('Medium')
4066    }, {
4067      slug: 'large',
4068      label: Object(external_this_wp_i18n_["__"])('Large')
4069    }, {
4070      slug: 'full',
4071      label: Object(external_this_wp_i18n_["__"])('Full Size')
4072    }],
4073    // This is current max width of the block inner area
4074    // It's used to constraint image resizing and this value could be overridden later by themes
4075    maxWidth: 580,
4076    // Allowed block types for the editor, defaulting to true (all supported).
4077    allowedBlockTypes: true,
4078    // Maximum upload size in bytes allowed for the site.
4079    maxUploadFileSize: 0,
4080    // List of allowed mime types and file extensions.
4081    allowedMimeTypes: null,
4082    availableLegacyWidgets: {},
4083    hasPermissionsToManageWidgets: false
4084  };
4085  
4086  // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/array.js
4087  
4088  
4089  /**
4090   * External dependencies
4091   */
4092  
4093  /**
4094   * Insert one or multiple elements into a given position of an array.
4095   *
4096   * @param {Array}  array    Source array.
4097   * @param {*}      elements Elements to insert.
4098   * @param {number} index    Insert Position.
4099   *
4100   * @return {Array}          Result.
4101   */
4102  
4103  function insertAt(array, elements, index) {
4104    return [].concat(Object(toConsumableArray["a" /* default */])(array.slice(0, index)), Object(toConsumableArray["a" /* default */])(Object(external_lodash_["castArray"])(elements)), Object(toConsumableArray["a" /* default */])(array.slice(index)));
4105  }
4106  /**
4107   * Moves an element in an array.
4108   *
4109   * @param {Array}  array Source array.
4110   * @param {number} from  Source index.
4111   * @param {number} to    Destination index.
4112   * @param {number} count Number of elements to move.
4113   *
4114   * @return {Array}       Result.
4115   */
4116  
4117  function moveTo(array, from, to) {
4118    var count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
4119  
4120    var withoutMovedElements = Object(toConsumableArray["a" /* default */])(array);
4121  
4122    withoutMovedElements.splice(from, count);
4123    return insertAt(withoutMovedElements, array.slice(from, from + count), to);
4124  }
4125  
4126  // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/reducer.js
4127  
4128  
4129  
4130  
4131  
4132  /**
4133   * External dependencies
4134   */
4135  
4136  /**
4137   * WordPress dependencies
4138   */
4139  
4140  
4141  
4142  /**
4143   * Internal dependencies
4144   */
4145  
4146  
4147  
4148  /**
4149   * Given an array of blocks, returns an object where each key is a nesting
4150   * context, the value of which is an array of block client IDs existing within
4151   * that nesting context.
4152   *
4153   * @param {Array}   blocks       Blocks to map.
4154   * @param {?string} rootClientId Assumed root client ID.
4155   *
4156   * @return {Object} Block order map object.
4157   */
4158  
4159  function mapBlockOrder(blocks) {
4160    var rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4161  
4162    var result = Object(defineProperty["a" /* default */])({}, rootClientId, []);
4163  
4164    blocks.forEach(function (block) {
4165      var clientId = block.clientId,
4166          innerBlocks = block.innerBlocks;
4167      result[rootClientId].push(clientId);
4168      Object.assign(result, mapBlockOrder(innerBlocks, clientId));
4169    });
4170    return result;
4171  }
4172  /**
4173   * Helper method to iterate through all blocks, recursing into inner blocks,
4174   * applying a transformation function to each one.
4175   * Returns a flattened object with the transformed blocks.
4176   *
4177   * @param {Array} blocks Blocks to flatten.
4178   * @param {Function} transform Transforming function to be applied to each block.
4179   *
4180   * @return {Object} Flattened object.
4181   */
4182  
4183  
4184  function flattenBlocks(blocks, transform) {
4185    var result = {};
4186  
4187    var stack = Object(toConsumableArray["a" /* default */])(blocks);
4188  
4189    while (stack.length) {
4190      var _stack$shift = stack.shift(),
4191          innerBlocks = _stack$shift.innerBlocks,
4192          block = Object(objectWithoutProperties["a" /* default */])(_stack$shift, ["innerBlocks"]);
4193  
4194      stack.push.apply(stack, Object(toConsumableArray["a" /* default */])(innerBlocks));
4195      result[block.clientId] = transform(block);
4196    }
4197  
4198    return result;
4199  }
4200  /**
4201   * Given an array of blocks, returns an object containing all blocks, without
4202   * attributes, recursing into inner blocks. Keys correspond to the block client
4203   * ID, the value of which is the attributes object.
4204   *
4205   * @param {Array} blocks Blocks to flatten.
4206   *
4207   * @return {Object} Flattened block attributes object.
4208   */
4209  
4210  
4211  function getFlattenedBlocksWithoutAttributes(blocks) {
4212    return flattenBlocks(blocks, function (block) {
4213      return Object(external_lodash_["omit"])(block, 'attributes');
4214    });
4215  }
4216  /**
4217   * Given an array of blocks, returns an object containing all block attributes,
4218   * recursing into inner blocks. Keys correspond to the block client ID, the
4219   * value of which is the attributes object.
4220   *
4221   * @param {Array} blocks Blocks to flatten.
4222   *
4223   * @return {Object} Flattened block attributes object.
4224   */
4225  
4226  
4227  function getFlattenedBlockAttributes(blocks) {
4228    return flattenBlocks(blocks, function (block) {
4229      return block.attributes;
4230    });
4231  }
4232  /**
4233   * Given a block order map object, returns *all* of the block client IDs that are
4234   * a descendant of the given root client ID.
4235   *
4236   * Calling this with `rootClientId` set to `''` results in a list of client IDs
4237   * that are in the post. That is, it excludes blocks like fetched reusable
4238   * blocks which are stored into state but not visible.
4239   *
4240   * @param {Object}  blocksOrder  Object that maps block client IDs to a list of
4241   *                               nested block client IDs.
4242   * @param {?string} rootClientId The root client ID to search. Defaults to ''.
4243   *
4244   * @return {Array} List of descendant client IDs.
4245   */
4246  
4247  
4248  function getNestedBlockClientIds(blocksOrder) {
4249    var rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4250    return Object(external_lodash_["reduce"])(blocksOrder[rootClientId], function (result, clientId) {
4251      return [].concat(Object(toConsumableArray["a" /* default */])(result), [clientId], Object(toConsumableArray["a" /* default */])(getNestedBlockClientIds(blocksOrder, clientId)));
4252    }, []);
4253  }
4254  /**
4255   * Returns an object against which it is safe to perform mutating operations,
4256   * given the original object and its current working copy.
4257   *
4258   * @param {Object} original Original object.
4259   * @param {Object} working  Working object.
4260   *
4261   * @return {Object} Mutation-safe object.
4262   */
4263  
4264  
4265  function getMutateSafeObject(original, working) {
4266    if (original === working) {
4267      return Object(objectSpread["a" /* default */])({}, original);
4268    }
4269  
4270    return working;
4271  }
4272  /**
4273   * Returns true if the two object arguments have the same keys, or false
4274   * otherwise.
4275   *
4276   * @param {Object} a First object.
4277   * @param {Object} b Second object.
4278   *
4279   * @return {boolean} Whether the two objects have the same keys.
4280   */
4281  
4282  
4283  function hasSameKeys(a, b) {
4284    return Object(external_lodash_["isEqual"])(Object(external_lodash_["keys"])(a), Object(external_lodash_["keys"])(b));
4285  }
4286  /**
4287   * Returns true if, given the currently dispatching action and the previously
4288   * dispatched action, the two actions are updating the same block attribute, or
4289   * false otherwise.
4290   *
4291   * @param {Object} action     Currently dispatching action.
4292   * @param {Object} lastAction Previously dispatched action.
4293   *
4294   * @return {boolean} Whether actions are updating the same block attribute.
4295   */
4296  
4297  function isUpdatingSameBlockAttribute(action, lastAction) {
4298    return action.type === 'UPDATE_BLOCK_ATTRIBUTES' && lastAction !== undefined && lastAction.type === 'UPDATE_BLOCK_ATTRIBUTES' && action.clientId === lastAction.clientId && hasSameKeys(action.attributes, lastAction.attributes);
4299  }
4300  /**
4301   * Higher-order reducer intended to augment the blocks reducer, assigning an
4302   * `isPersistentChange` property value corresponding to whether a change in
4303   * state can be considered as persistent. All changes are considered persistent
4304   * except when updating the same block attribute as in the previous action.
4305   *
4306   * @param {Function} reducer Original reducer function.
4307   *
4308   * @return {Function} Enhanced reducer function.
4309   */
4310  
4311  function withPersistentBlockChange(reducer) {
4312    var lastAction;
4313    return function (state, action) {
4314      var nextState = reducer(state, action);
4315      var isExplicitPersistentChange = action.type === 'MARK_LAST_CHANGE_AS_PERSISTENT'; // Defer to previous state value (or default) unless changing or
4316      // explicitly marking as persistent.
4317  
4318      if (state === nextState && !isExplicitPersistentChange) {
4319        var nextIsPersistentChange = Object(external_lodash_["get"])(state, ['isPersistentChange'], true);
4320  
4321        if (state.isPersistentChange === nextIsPersistentChange) {
4322          return state;
4323        }
4324  
4325        return Object(objectSpread["a" /* default */])({}, nextState, {
4326          isPersistentChange: nextIsPersistentChange
4327        });
4328      }
4329  
4330      nextState = Object(objectSpread["a" /* default */])({}, nextState, {
4331        isPersistentChange: isExplicitPersistentChange || !isUpdatingSameBlockAttribute(action, lastAction)
4332      }); // In comparing against the previous action, consider only those which
4333      // would have qualified as one which would have been ignored or not
4334      // have resulted in a changed state.
4335  
4336      lastAction = action;
4337      return nextState;
4338    };
4339  }
4340  /**
4341   * Higher-order reducer intended to augment the blocks reducer, assigning an
4342   * `isIgnoredChange` property value corresponding to whether a change in state
4343   * can be considered as ignored. A change is considered ignored when the result
4344   * of an action not incurred by direct user interaction.
4345   *
4346   * @param {Function} reducer Original reducer function.
4347   *
4348   * @return {Function} Enhanced reducer function.
4349   */
4350  
4351  
4352  function withIgnoredBlockChange(reducer) {
4353    /**
4354     * Set of action types for which a blocks state change should be ignored.
4355     *
4356     * @type {Set}
4357     */
4358    var IGNORED_ACTION_TYPES = new Set(['RECEIVE_BLOCKS']);
4359    return function (state, action) {
4360      var nextState = reducer(state, action);
4361  
4362      if (nextState !== state) {
4363        nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type);
4364      }
4365  
4366      return nextState;
4367    };
4368  }
4369  /**
4370   * Higher-order reducer targeting the combined blocks reducer, augmenting
4371   * block client IDs in remove action to include cascade of inner blocks.
4372   *
4373   * @param {Function} reducer Original reducer function.
4374   *
4375   * @return {Function} Enhanced reducer function.
4376   */
4377  
4378  
4379  var reducer_withInnerBlocksRemoveCascade = function withInnerBlocksRemoveCascade(reducer) {
4380    return function (state, action) {
4381      if (state && action.type === 'REMOVE_BLOCKS') {
4382        var clientIds = Object(toConsumableArray["a" /* default */])(action.clientIds); // For each removed client ID, include its inner blocks to remove,
4383        // recursing into those so long as inner blocks exist.
4384  
4385  
4386        for (var i = 0; i < clientIds.length; i++) {
4387          clientIds.push.apply(clientIds, Object(toConsumableArray["a" /* default */])(state.order[clientIds[i]]));
4388        }
4389  
4390        action = Object(objectSpread["a" /* default */])({}, action, {
4391          clientIds: clientIds
4392        });
4393      }
4394  
4395      return reducer(state, action);
4396    };
4397  };
4398  /**
4399   * Higher-order reducer which targets the combined blocks reducer and handles
4400   * the `RESET_BLOCKS` action. When dispatched, this action will replace all
4401   * blocks that exist in the post, leaving blocks that exist only in state (e.g.
4402   * reusable blocks) alone.
4403   *
4404   * @param {Function} reducer Original reducer function.
4405   *
4406   * @return {Function} Enhanced reducer function.
4407   */
4408  
4409  
4410  var reducer_withBlockReset = function withBlockReset(reducer) {
4411    return function (state, action) {
4412      if (state && action.type === 'RESET_BLOCKS') {
4413        var visibleClientIds = getNestedBlockClientIds(state.order);
4414        return Object(objectSpread["a" /* default */])({}, state, {
4415          byClientId: Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state.byClientId, visibleClientIds), getFlattenedBlocksWithoutAttributes(action.blocks)),
4416          attributes: Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state.attributes, visibleClientIds), getFlattenedBlockAttributes(action.blocks)),
4417          order: Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state.order, visibleClientIds), mapBlockOrder(action.blocks))
4418        });
4419      }
4420  
4421      return reducer(state, action);
4422    };
4423  };
4424  /**
4425   * Higher-order reducer which targets the combined blocks reducer and handles
4426   * the `REPLACE_INNER_BLOCKS` action. When dispatched, this action the state should become equivalent
4427   * to the execution of a `REMOVE_BLOCKS` action containing all the child's of the root block followed by
4428   * the execution of `INSERT_BLOCKS` with the new blocks.
4429   *
4430   * @param {Function} reducer Original reducer function.
4431   *
4432   * @return {Function} Enhanced reducer function.
4433   */
4434  
4435  
4436  var reducer_withReplaceInnerBlocks = function withReplaceInnerBlocks(reducer) {
4437    return function (state, action) {
4438      if (action.type !== 'REPLACE_INNER_BLOCKS') {
4439        return reducer(state, action);
4440      }
4441  
4442      var stateAfterBlocksRemoval = state;
4443  
4444      if (state.order[action.rootClientId]) {
4445        stateAfterBlocksRemoval = reducer(stateAfterBlocksRemoval, {
4446          type: 'REMOVE_BLOCKS',
4447          clientIds: state.order[action.rootClientId]
4448        });
4449      }
4450  
4451      var stateAfterInsert = stateAfterBlocksRemoval;
4452  
4453      if (action.blocks.length) {
4454        stateAfterInsert = reducer(stateAfterInsert, Object(objectSpread["a" /* default */])({}, action, {
4455          type: 'INSERT_BLOCKS',
4456          index: 0
4457        }));
4458      }
4459  
4460      return stateAfterInsert;
4461    };
4462  };
4463  /**
4464   * Higher-order reducer which targets the combined blocks reducer and handles
4465   * the `SAVE_REUSABLE_BLOCK_SUCCESS` action. This action can't be handled by
4466   * regular reducers and needs a higher-order reducer since it needs access to
4467   * both `byClientId` and `attributes` simultaneously.
4468   *
4469   * @param {Function} reducer Original reducer function.
4470   *
4471   * @return {Function} Enhanced reducer function.
4472   */
4473  
4474  
4475  var reducer_withSaveReusableBlock = function withSaveReusableBlock(reducer) {
4476    return function (state, action) {
4477      if (state && action.type === 'SAVE_REUSABLE_BLOCK_SUCCESS') {
4478        var id = action.id,
4479            updatedId = action.updatedId; // If a temporary reusable block is saved, we swap the temporary id with the final one
4480  
4481        if (id === updatedId) {
4482          return state;
4483        }
4484  
4485        state = Object(objectSpread["a" /* default */])({}, state);
4486        state.attributes = Object(external_lodash_["mapValues"])(state.attributes, function (attributes, clientId) {
4487          var name = state.byClientId[clientId].name;
4488  
4489          if (name === 'core/block' && attributes.ref === id) {
4490            return Object(objectSpread["a" /* default */])({}, attributes, {
4491              ref: updatedId
4492            });
4493          }
4494  
4495          return attributes;
4496        });
4497      }
4498  
4499      return reducer(state, action);
4500    };
4501  };
4502  /**
4503   * Reducer returning the blocks state.
4504   *
4505   * @param {Object} state  Current state.
4506   * @param {Object} action Dispatched action.
4507   *
4508   * @returns {Object} Updated state.
4509   */
4510  
4511  
4512  var reducer_blocks = Object(external_lodash_["flow"])(external_this_wp_data_["combineReducers"], reducer_withInnerBlocksRemoveCascade, reducer_withReplaceInnerBlocks, // needs to be after withInnerBlocksRemoveCascade
4513  reducer_withBlockReset, reducer_withSaveReusableBlock, withPersistentBlockChange, withIgnoredBlockChange)({
4514    byClientId: function byClientId() {
4515      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4516      var action = arguments.length > 1 ? arguments[1] : undefined;
4517  
4518      switch (action.type) {
4519        case 'RESET_BLOCKS':
4520          return getFlattenedBlocksWithoutAttributes(action.blocks);
4521  
4522        case 'RECEIVE_BLOCKS':
4523          return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlocksWithoutAttributes(action.blocks));
4524  
4525        case 'UPDATE_BLOCK':
4526          // Ignore updates if block isn't known
4527          if (!state[action.clientId]) {
4528            return state;
4529          } // Do nothing if only attributes change.
4530  
4531  
4532          var changes = Object(external_lodash_["omit"])(action.updates, 'attributes');
4533  
4534          if (Object(external_lodash_["isEmpty"])(changes)) {
4535            return state;
4536          }
4537  
4538          return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.clientId, Object(objectSpread["a" /* default */])({}, state[action.clientId], changes)));
4539  
4540        case 'INSERT_BLOCKS':
4541          return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlocksWithoutAttributes(action.blocks));
4542  
4543        case 'REPLACE_BLOCKS':
4544          if (!action.blocks) {
4545            return state;
4546          }
4547  
4548          return Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state, action.clientIds), getFlattenedBlocksWithoutAttributes(action.blocks));
4549  
4550        case 'REMOVE_BLOCKS':
4551          return Object(external_lodash_["omit"])(state, action.clientIds);
4552      }
4553  
4554      return state;
4555    },
4556    attributes: function attributes() {
4557      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4558      var action = arguments.length > 1 ? arguments[1] : undefined;
4559  
4560      switch (action.type) {
4561        case 'RESET_BLOCKS':
4562          return getFlattenedBlockAttributes(action.blocks);
4563  
4564        case 'RECEIVE_BLOCKS':
4565          return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlockAttributes(action.blocks));
4566  
4567        case 'UPDATE_BLOCK':
4568          // Ignore updates if block isn't known or there are no attribute changes.
4569          if (!state[action.clientId] || !action.updates.attributes) {
4570            return state;
4571          }
4572  
4573          return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.clientId, Object(objectSpread["a" /* default */])({}, state[action.clientId], action.updates.attributes)));
4574  
4575        case 'UPDATE_BLOCK_ATTRIBUTES':
4576          // Ignore updates if block isn't known
4577          if (!state[action.clientId]) {
4578            return state;
4579          } // Consider as updates only changed values
4580  
4581  
4582          var nextAttributes = Object(external_lodash_["reduce"])(action.attributes, function (result, value, key) {
4583            if (value !== result[key]) {
4584              result = getMutateSafeObject(state[action.clientId], result);
4585              result[key] = value;
4586            }
4587  
4588            return result;
4589          }, state[action.clientId]); // Skip update if nothing has been changed. The reference will
4590          // match the original block if `reduce` had no changed values.
4591  
4592          if (nextAttributes === state[action.clientId]) {
4593            return state;
4594          } // Otherwise replace attributes in state
4595  
4596  
4597          return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.clientId, nextAttributes));
4598  
4599        case 'INSERT_BLOCKS':
4600          return Object(objectSpread["a" /* default */])({}, state, getFlattenedBlockAttributes(action.blocks));
4601  
4602        case 'REPLACE_BLOCKS':
4603          if (!action.blocks) {
4604            return state;
4605          }
4606  
4607          return Object(objectSpread["a" /* default */])({}, Object(external_lodash_["omit"])(state, action.clientIds), getFlattenedBlockAttributes(action.blocks));
4608  
4609        case 'REMOVE_BLOCKS':
4610          return Object(external_lodash_["omit"])(state, action.clientIds);
4611      }
4612  
4613      return state;
4614    },
4615    order: function order() {
4616      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4617      var action = arguments.length > 1 ? arguments[1] : undefined;
4618  
4619      switch (action.type) {
4620        case 'RESET_BLOCKS':
4621          return mapBlockOrder(action.blocks);
4622  
4623        case 'RECEIVE_BLOCKS':
4624          return Object(objectSpread["a" /* default */])({}, state, Object(external_lodash_["omit"])(mapBlockOrder(action.blocks), ''));
4625  
4626        case 'INSERT_BLOCKS':
4627          {
4628            var _action$rootClientId = action.rootClientId,
4629                rootClientId = _action$rootClientId === void 0 ? '' : _action$rootClientId;
4630            var subState = state[rootClientId] || [];
4631            var mappedBlocks = mapBlockOrder(action.blocks, rootClientId);
4632            var _action$index = action.index,
4633                index = _action$index === void 0 ? subState.length : _action$index;
4634            return Object(objectSpread["a" /* default */])({}, state, mappedBlocks, Object(defineProperty["a" /* default */])({}, rootClientId, insertAt(subState, mappedBlocks[rootClientId], index)));
4635          }
4636  
4637        case 'MOVE_BLOCK_TO_POSITION':
4638          {
4639            var _objectSpread7;
4640  
4641            var _action$fromRootClien = action.fromRootClientId,
4642                fromRootClientId = _action$fromRootClien === void 0 ? '' : _action$fromRootClien,
4643                _action$toRootClientI = action.toRootClientId,
4644                toRootClientId = _action$toRootClientI === void 0 ? '' : _action$toRootClientI,
4645                clientId = action.clientId;
4646  
4647            var _action$index2 = action.index,
4648                _index = _action$index2 === void 0 ? state[toRootClientId].length : _action$index2; // Moving inside the same parent block
4649  
4650  
4651            if (fromRootClientId === toRootClientId) {
4652              var _subState = state[toRootClientId];
4653  
4654              var fromIndex = _subState.indexOf(clientId);
4655  
4656              return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, toRootClientId, moveTo(state[toRootClientId], fromIndex, _index)));
4657            } // Moving from a parent block to another
4658  
4659  
4660            return Object(objectSpread["a" /* default */])({}, state, (_objectSpread7 = {}, Object(defineProperty["a" /* default */])(_objectSpread7, fromRootClientId, Object(external_lodash_["without"])(state[fromRootClientId], clientId)), Object(defineProperty["a" /* default */])(_objectSpread7, toRootClientId, insertAt(state[toRootClientId], clientId, _index)), _objectSpread7));
4661          }
4662  
4663        case 'MOVE_BLOCKS_UP':
4664          {
4665            var clientIds = action.clientIds,
4666                _action$rootClientId2 = action.rootClientId,
4667                _rootClientId = _action$rootClientId2 === void 0 ? '' : _action$rootClientId2;
4668  
4669            var firstClientId = Object(external_lodash_["first"])(clientIds);
4670            var _subState2 = state[_rootClientId];
4671  
4672            if (!_subState2.length || firstClientId === Object(external_lodash_["first"])(_subState2)) {
4673              return state;
4674            }
4675  
4676            var firstIndex = _subState2.indexOf(firstClientId);
4677  
4678            return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, _rootClientId, moveTo(_subState2, firstIndex, firstIndex - 1, clientIds.length)));
4679          }
4680  
4681        case 'MOVE_BLOCKS_DOWN':
4682          {
4683            var _clientIds = action.clientIds,
4684                _action$rootClientId3 = action.rootClientId,
4685                _rootClientId2 = _action$rootClientId3 === void 0 ? '' : _action$rootClientId3;
4686  
4687            var _firstClientId = Object(external_lodash_["first"])(_clientIds);
4688  
4689            var lastClientId = Object(external_lodash_["last"])(_clientIds);
4690            var _subState3 = state[_rootClientId2];
4691  
4692            if (!_subState3.length || lastClientId === Object(external_lodash_["last"])(_subState3)) {
4693              return state;
4694            }
4695  
4696            var _firstIndex = _subState3.indexOf(_firstClientId);
4697  
4698            return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, _rootClientId2, moveTo(_subState3, _firstIndex, _firstIndex + 1, _clientIds.length)));
4699          }
4700  
4701        case 'REPLACE_BLOCKS':
4702          {
4703            var _clientIds2 = action.clientIds;
4704  
4705            if (!action.blocks) {
4706              return state;
4707            }
4708  
4709            var _mappedBlocks = mapBlockOrder(action.blocks);
4710  
4711            return Object(external_lodash_["flow"])([function (nextState) {
4712              return Object(external_lodash_["omit"])(nextState, _clientIds2);
4713            }, function (nextState) {
4714              return Object(objectSpread["a" /* default */])({}, nextState, Object(external_lodash_["omit"])(_mappedBlocks, ''));
4715            }, function (nextState) {
4716              return Object(external_lodash_["mapValues"])(nextState, function (subState) {
4717                return Object(external_lodash_["reduce"])(subState, function (result, clientId) {
4718                  if (clientId === _clientIds2[0]) {
4719                    return [].concat(Object(toConsumableArray["a" /* default */])(result), Object(toConsumableArray["a" /* default */])(_mappedBlocks['']));
4720                  }
4721  
4722                  if (_clientIds2.indexOf(clientId) === -1) {
4723                    result.push(clientId);
4724                  }
4725  
4726                  return result;
4727                }, []);
4728              });
4729            }])(state);
4730          }
4731  
4732        case 'REMOVE_BLOCKS':
4733          return Object(external_lodash_["flow"])([// Remove inner block ordering for removed blocks
4734          function (nextState) {
4735            return Object(external_lodash_["omit"])(nextState, action.clientIds);
4736          }, // Remove deleted blocks from other blocks' orderings
4737          function (nextState) {
4738            return Object(external_lodash_["mapValues"])(nextState, function (subState) {
4739              return external_lodash_["without"].apply(void 0, [subState].concat(Object(toConsumableArray["a" /* default */])(action.clientIds)));
4740            });
4741          }])(state);
4742      }
4743  
4744      return state;
4745    }
4746  });
4747  /**
4748   * Reducer returning typing state.
4749   *
4750   * @param {boolean} state  Current state.
4751   * @param {Object}  action Dispatched action.
4752   *
4753   * @return {boolean} Updated state.
4754   */
4755  
4756  function reducer_isTyping() {
4757    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
4758    var action = arguments.length > 1 ? arguments[1] : undefined;
4759  
4760    switch (action.type) {
4761      case 'START_TYPING':
4762        return true;
4763  
4764      case 'STOP_TYPING':
4765        return false;
4766    }
4767  
4768    return state;
4769  }
4770  /**
4771   * Reducer returning whether the caret is within formatted text.
4772   *
4773   * @param {boolean} state  Current state.
4774   * @param {Object}  action Dispatched action.
4775   *
4776   * @return {boolean} Updated state.
4777   */
4778  
4779  function reducer_isCaretWithinFormattedText() {
4780    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
4781    var action = arguments.length > 1 ? arguments[1] : undefined;
4782  
4783    switch (action.type) {
4784      case 'ENTER_FORMATTED_TEXT':
4785        return true;
4786  
4787      case 'EXIT_FORMATTED_TEXT':
4788        return false;
4789    }
4790  
4791    return state;
4792  }
4793  /**
4794   * Reducer returning the block selection's state.
4795   *
4796   * @param {Object} state  Current state.
4797   * @param {Object} action Dispatched action.
4798   *
4799   * @return {Object} Updated state.
4800   */
4801  
4802  function blockSelection() {
4803    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
4804      start: null,
4805      end: null,
4806      isMultiSelecting: false,
4807      isEnabled: true,
4808      initialPosition: null
4809    };
4810    var action = arguments.length > 1 ? arguments[1] : undefined;
4811  
4812    switch (action.type) {
4813      case 'CLEAR_SELECTED_BLOCK':
4814        if (state.start === null && state.end === null && !state.isMultiSelecting) {
4815          return state;
4816        }
4817  
4818        return Object(objectSpread["a" /* default */])({}, state, {
4819          start: null,
4820          end: null,
4821          isMultiSelecting: false,
4822          initialPosition: null
4823        });
4824  
4825      case 'START_MULTI_SELECT':
4826        if (state.isMultiSelecting) {
4827          return state;
4828        }
4829  
4830        return Object(objectSpread["a" /* default */])({}, state, {
4831          isMultiSelecting: true,
4832          initialPosition: null
4833        });
4834  
4835      case 'STOP_MULTI_SELECT':
4836        if (!state.isMultiSelecting) {
4837          return state;
4838        }
4839  
4840        return Object(objectSpread["a" /* default */])({}, state, {
4841          isMultiSelecting: false,
4842          initialPosition: null
4843        });
4844  
4845      case 'MULTI_SELECT':
4846        return Object(objectSpread["a" /* default */])({}, state, {
4847          start: action.start,
4848          end: action.end,
4849          initialPosition: null
4850        });
4851  
4852      case 'SELECT_BLOCK':
4853        if (action.clientId === state.start && action.clientId === state.end) {
4854          return state;
4855        }
4856  
4857        return Object(objectSpread["a" /* default */])({}, state, {
4858          start: action.clientId,
4859          end: action.clientId,
4860          initialPosition: action.initialPosition
4861        });
4862  
4863      case 'REPLACE_INNER_BLOCKS': // REPLACE_INNER_BLOCKS and INSERT_BLOCKS should follow the same logic.
4864  
4865      case 'INSERT_BLOCKS':
4866        {
4867          if (action.updateSelection) {
4868            return Object(objectSpread["a" /* default */])({}, state, {
4869              start: action.blocks[0].clientId,
4870              end: action.blocks[0].clientId,
4871              initialPosition: null,
4872              isMultiSelecting: false
4873            });
4874          }
4875  
4876          return state;
4877        }
4878  
4879      case 'REMOVE_BLOCKS':
4880        if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.start) === -1) {
4881          return state;
4882        }
4883  
4884        return Object(objectSpread["a" /* default */])({}, state, {
4885          start: null,
4886          end: null,
4887          initialPosition: null,
4888          isMultiSelecting: false
4889        });
4890  
4891      case 'REPLACE_BLOCKS':
4892        if (action.clientIds.indexOf(state.start) === -1) {
4893          return state;
4894        } // If there are replacement blocks, assign last block as the next
4895        // selected block, otherwise set to null.
4896  
4897  
4898        var lastBlock = Object(external_lodash_["last"])(action.blocks);
4899        var nextSelectedBlockClientId = lastBlock ? lastBlock.clientId : null;
4900  
4901        if (nextSelectedBlockClientId === state.start && nextSelectedBlockClientId === state.end) {
4902          return state;
4903        }
4904  
4905        return Object(objectSpread["a" /* default */])({}, state, {
4906          start: nextSelectedBlockClientId,
4907          end: nextSelectedBlockClientId,
4908          initialPosition: null,
4909          isMultiSelecting: false
4910        });
4911  
4912      case 'TOGGLE_SELECTION':
4913        return Object(objectSpread["a" /* default */])({}, state, {
4914          isEnabled: action.isSelectionEnabled
4915        });
4916    }
4917  
4918    return state;
4919  }
4920  function blocksMode() {
4921    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4922    var action = arguments.length > 1 ? arguments[1] : undefined;
4923  
4924    if (action.type === 'TOGGLE_BLOCK_MODE') {
4925      var clientId = action.clientId;
4926      return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, clientId, state[clientId] && state[clientId] === 'html' ? 'visual' : 'html'));
4927    }
4928  
4929    return state;
4930  }
4931  /**
4932   * Reducer returning the block insertion point visibility, either null if there
4933   * is not an explicit insertion point assigned, or an object of its `index` and
4934   * `rootClientId`.
4935   *
4936   * @param {Object} state  Current state.
4937   * @param {Object} action Dispatched action.
4938   *
4939   * @return {Object} Updated state.
4940   */
4941  
4942  function insertionPoint() {
4943    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
4944    var action = arguments.length > 1 ? arguments[1] : undefined;
4945  
4946    switch (action.type) {
4947      case 'SHOW_INSERTION_POINT':
4948        var rootClientId = action.rootClientId,
4949            index = action.index;
4950        return {
4951          rootClientId: rootClientId,
4952          index: index
4953        };
4954  
4955      case 'HIDE_INSERTION_POINT':
4956        return null;
4957    }
4958  
4959    return state;
4960  }
4961  /**
4962   * Reducer returning whether the post blocks match the defined template or not.
4963   *
4964   * @param {Object} state  Current state.
4965   * @param {Object} action Dispatched action.
4966   *
4967   * @return {boolean} Updated state.
4968   */
4969  
4970  function reducer_template() {
4971    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
4972      isValid: true
4973    };
4974    var action = arguments.length > 1 ? arguments[1] : undefined;
4975  
4976    switch (action.type) {
4977      case 'SET_TEMPLATE_VALIDITY':
4978        return Object(objectSpread["a" /* default */])({}, state, {
4979          isValid: action.isValid
4980        });
4981    }
4982  
4983    return state;
4984  }
4985  /**
4986   * Reducer returning the editor setting.
4987   *
4988   * @param {Object} state  Current state.
4989   * @param {Object} action Dispatched action.
4990   *
4991   * @return {Object} Updated state.
4992   */
4993  
4994  function reducer_settings() {
4995    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SETTINGS_DEFAULTS;
4996    var action = arguments.length > 1 ? arguments[1] : undefined;
4997  
4998    switch (action.type) {
4999      case 'UPDATE_SETTINGS':
5000        return Object(objectSpread["a" /* default */])({}, state, action.settings);
5001    }
5002  
5003    return state;
5004  }
5005  /**
5006   * Reducer returning the user preferences.
5007   *
5008   * @param {Object}  state                 Current state.
5009   * @param {Object}  action                Dispatched action.
5010   *
5011   * @return {string} Updated state.
5012   */
5013  
5014  function preferences() {
5015    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PREFERENCES_DEFAULTS;
5016    var action = arguments.length > 1 ? arguments[1] : undefined;
5017  
5018    switch (action.type) {
5019      case 'INSERT_BLOCKS':
5020      case 'REPLACE_BLOCKS':
5021        return action.blocks.reduce(function (prevState, block) {
5022          var id = block.name;
5023          var insert = {
5024            name: block.name
5025          };
5026  
5027          if (Object(external_this_wp_blocks_["isReusableBlock"])(block)) {
5028            insert.ref = block.attributes.ref;
5029            id += '/' + block.attributes.ref;
5030          }
5031  
5032          return Object(objectSpread["a" /* default */])({}, prevState, {
5033            insertUsage: Object(objectSpread["a" /* default */])({}, prevState.insertUsage, Object(defineProperty["a" /* default */])({}, id, {
5034              time: action.time,
5035              count: prevState.insertUsage[id] ? prevState.insertUsage[id].count + 1 : 1,
5036              insert: insert
5037            }))
5038          });
5039        }, state);
5040    }
5041  
5042    return state;
5043  }
5044  /**
5045   * Reducer returning an object where each key is a block client ID, its value
5046   * representing the settings for its nested blocks.
5047   *
5048   * @param {Object} state  Current state.
5049   * @param {Object} action Dispatched action.
5050   *
5051   * @return {Object} Updated state.
5052   */
5053  
5054  var reducer_blockListSettings = function blockListSettings() {
5055    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5056    var action = arguments.length > 1 ? arguments[1] : undefined;
5057  
5058    switch (action.type) {
5059      // Even if the replaced blocks have the same client ID, our logic
5060      // should correct the state.
5061      case 'REPLACE_BLOCKS':
5062      case 'REMOVE_BLOCKS':
5063        {
5064          return Object(external_lodash_["omit"])(state, action.clientIds);
5065        }
5066  
5067      case 'UPDATE_BLOCK_LIST_SETTINGS':
5068        {
5069          var clientId = action.clientId;
5070  
5071          if (!action.settings) {
5072            if (state.hasOwnProperty(clientId)) {
5073              return Object(external_lodash_["omit"])(state, clientId);
5074            }
5075  
5076            return state;
5077          }
5078  
5079          if (Object(external_lodash_["isEqual"])(state[clientId], action.settings)) {
5080            return state;
5081          }
5082  
5083          return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, clientId, action.settings));
5084        }
5085    }
5086  
5087    return state;
5088  };
5089  /* harmony default export */ var store_reducer = (Object(external_this_wp_data_["combineReducers"])({
5090    blocks: reducer_blocks,
5091    isTyping: reducer_isTyping,
5092    isCaretWithinFormattedText: reducer_isCaretWithinFormattedText,
5093    blockSelection: blockSelection,
5094    blocksMode: blocksMode,
5095    blockListSettings: reducer_blockListSettings,
5096    insertionPoint: insertionPoint,
5097    template: reducer_template,
5098    settings: reducer_settings,
5099    preferences: preferences
5100  }));
5101  
5102  // EXTERNAL MODULE: ./node_modules/refx/refx.js
5103  var refx = __webpack_require__(70);
5104  var refx_default = /*#__PURE__*/__webpack_require__.n(refx);
5105  
5106  // EXTERNAL MODULE: ./node_modules/redux-multi/lib/index.js
5107  var lib = __webpack_require__(96);
5108  var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
5109  
5110  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
5111  var slicedToArray = __webpack_require__(28);
5112  
5113  // EXTERNAL MODULE: external {"this":["wp","a11y"]}
5114  var external_this_wp_a11y_ = __webpack_require__(48);
5115  
5116  // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
5117  var regenerator = __webpack_require__(23);
5118  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
5119  
5120  // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/controls.js
5121  
5122  
5123  /**
5124   * WordPress dependencies
5125   */
5126  
5127  /**
5128   * Calls a selector using the current state.
5129   *
5130   * @param {string} storeName    Store name.
5131   * @param {string} selectorName Selector name.
5132   * @param  {Array} args         Selector arguments.
5133   *
5134   * @return {Object} control descriptor.
5135   */
5136  
5137  function controls_select(storeName, selectorName) {
5138    for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
5139      args[_key - 2] = arguments[_key];
5140    }
5141  
5142    return {
5143      type: 'SELECT',
5144      storeName: storeName,
5145      selectorName: selectorName,
5146      args: args
5147    };
5148  }
5149  var controls_controls = {
5150    SELECT: Object(external_this_wp_data_["createRegistryControl"])(function (registry) {
5151      return function (_ref) {
5152        var _registry$select;
5153  
5154        var storeName = _ref.storeName,
5155            selectorName = _ref.selectorName,
5156            args = _ref.args;
5157        return (_registry$select = registry.select(storeName))[selectorName].apply(_registry$select, Object(toConsumableArray["a" /* default */])(args));
5158      };
5159    })
5160  };
5161  /* harmony default export */ var store_controls = (controls_controls);
5162  
5163  // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/actions.js
5164  
5165  
5166  var _marked =
5167  /*#__PURE__*/
5168  regenerator_default.a.mark(ensureDefaultBlock),
5169      _marked2 =
5170  /*#__PURE__*/
5171  regenerator_default.a.mark(selectPreviousBlock),
5172      _marked3 =
5173  /*#__PURE__*/
5174  regenerator_default.a.mark(selectNextBlock),
5175      _marked4 =
5176  /*#__PURE__*/
5177  regenerator_default.a.mark(actions_replaceBlocks),
5178      _marked5 =
5179  /*#__PURE__*/
5180  regenerator_default.a.mark(moveBlockToPosition),
5181      _marked6 =
5182  /*#__PURE__*/
5183  regenerator_default.a.mark(actions_insertBlocks),
5184      _marked7 =
5185  /*#__PURE__*/
5186  regenerator_default.a.mark(actions_removeBlocks);
5187  
5188  /**
5189   * External dependencies
5190   */
5191  
5192  /**
5193   * WordPress dependencies
5194   */
5195  
5196  
5197  /**
5198   * Internal dependencies
5199   */
5200  
5201  
5202  /**
5203   * Generator which will yield a default block insert action if there
5204   * are no other blocks at the root of the editor. This generator should be used
5205   * in actions which may result in no blocks remaining in the editor (removal,
5206   * replacement, etc).
5207   */
5208  
5209  function ensureDefaultBlock() {
5210    var count;
5211    return regenerator_default.a.wrap(function ensureDefaultBlock$(_context) {
5212      while (1) {
5213        switch (_context.prev = _context.next) {
5214          case 0:
5215            _context.next = 2;
5216            return controls_select('core/block-editor', 'getBlockCount');
5217  
5218          case 2:
5219            count = _context.sent;
5220  
5221            if (!(count === 0)) {
5222              _context.next = 6;
5223              break;
5224            }
5225  
5226            _context.next = 6;
5227            return actions_insertDefaultBlock();
5228  
5229          case 6:
5230          case "end":
5231            return _context.stop();
5232        }
5233      }
5234    }, _marked, this);
5235  }
5236  /**
5237   * Returns an action object used in signalling that blocks state should be
5238   * reset to the specified array of blocks, taking precedence over any other
5239   * content reflected as an edit in state.
5240   *
5241   * @param {Array} blocks Array of blocks.
5242   *
5243   * @return {Object} Action object.
5244   */
5245  
5246  
5247  function resetBlocks(blocks) {
5248    return {
5249      type: 'RESET_BLOCKS',
5250      blocks: blocks
5251    };
5252  }
5253  /**
5254   * Returns an action object used in signalling that blocks have been received.
5255   * Unlike resetBlocks, these should be appended to the existing known set, not
5256   * replacing.
5257   *
5258   * @param {Object[]} blocks Array of block objects.
5259   *
5260   * @return {Object} Action object.
5261   */
5262  
5263  function receiveBlocks(blocks) {
5264    return {
5265      type: 'RECEIVE_BLOCKS',
5266      blocks: blocks
5267    };
5268  }
5269  /**
5270   * Returns an action object used in signalling that the block attributes with
5271   * the specified client ID has been updated.
5272   *
5273   * @param {string} clientId   Block client ID.
5274   * @param {Object} attributes Block attributes to be merged.
5275   *
5276   * @return {Object} Action object.
5277   */
5278  
5279  function updateBlockAttributes(clientId, attributes) {
5280    return {
5281      type: 'UPDATE_BLOCK_ATTRIBUTES',
5282      clientId: clientId,
5283      attributes: attributes
5284    };
5285  }
5286  /**
5287   * Returns an action object used in signalling that the block with the
5288   * specified client ID has been updated.
5289   *
5290   * @param {string} clientId Block client ID.
5291   * @param {Object} updates  Block attributes to be merged.
5292   *
5293   * @return {Object} Action object.
5294   */
5295  
5296  function updateBlock(clientId, updates) {
5297    return {
5298      type: 'UPDATE_BLOCK',
5299      clientId: clientId,
5300      updates: updates
5301    };
5302  }
5303  /**
5304   * Returns an action object used in signalling that the block with the
5305   * specified client ID has been selected, optionally accepting a position
5306   * value reflecting its selection directionality. An initialPosition of -1
5307   * reflects a reverse selection.
5308   *
5309   * @param {string}  clientId        Block client ID.
5310   * @param {?number} initialPosition Optional initial position. Pass as -1 to
5311   *                                  reflect reverse selection.
5312   *
5313   * @return {Object} Action object.
5314   */
5315  
5316  function actions_selectBlock(clientId) {
5317    var initialPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
5318    return {
5319      type: 'SELECT_BLOCK',
5320      initialPosition: initialPosition,
5321      clientId: clientId
5322    };
5323  }
5324  /**
5325   * Yields action objects used in signalling that the block preceding the given
5326   * clientId should be selected.
5327   *
5328   * @param {string} clientId Block client ID.
5329   */
5330  
5331  function selectPreviousBlock(clientId) {
5332    var previousBlockClientId;
5333    return regenerator_default.a.wrap(function selectPreviousBlock$(_context2) {
5334      while (1) {
5335        switch (_context2.prev = _context2.next) {
5336          case 0:
5337            _context2.next = 2;
5338            return controls_select('core/block-editor', 'getPreviousBlockClientId', clientId);
5339  
5340          case 2:
5341            previousBlockClientId = _context2.sent;
5342            _context2.next = 5;
5343            return actions_selectBlock(previousBlockClientId, -1);
5344  
5345          case 5:
5346          case "end":
5347            return _context2.stop();
5348        }
5349      }
5350    }, _marked2, this);
5351  }
5352  /**
5353   * Yields action objects used in signalling that the block following the given
5354   * clientId should be selected.
5355   *
5356   * @param {string} clientId Block client ID.
5357   */
5358  
5359  function selectNextBlock(clientId) {
5360    var nextBlockClientId;
5361    return regenerator_default.a.wrap(function selectNextBlock$(_context3) {
5362      while (1) {
5363        switch (_context3.prev = _context3.next) {
5364          case 0:
5365            _context3.next = 2;
5366            return controls_select('core/block-editor', 'getNextBlockClientId', clientId);
5367  
5368          case 2:
5369            nextBlockClientId = _context3.sent;
5370            _context3.next = 5;
5371            return actions_selectBlock(nextBlockClientId);
5372  
5373          case 5:
5374          case "end":
5375            return _context3.stop();
5376        }
5377      }
5378    }, _marked3, this);
5379  }
5380  /**
5381   * Returns an action object used in signalling that a block multi-selection has started.
5382   *
5383   * @return {Object} Action object.
5384   */
5385  
5386  function startMultiSelect() {
5387    return {
5388      type: 'START_MULTI_SELECT'
5389    };
5390  }
5391  /**
5392   * Returns an action object used in signalling that block multi-selection stopped.
5393   *
5394   * @return {Object} Action object.
5395   */
5396  
5397  function stopMultiSelect() {
5398    return {
5399      type: 'STOP_MULTI_SELECT'
5400    };
5401  }
5402  /**
5403   * Returns an action object used in signalling that block multi-selection changed.
5404   *
5405   * @param {string} start First block of the multi selection.
5406   * @param {string} end   Last block of the multiselection.
5407   *
5408   * @return {Object} Action object.
5409   */
5410  
5411  function actions_multiSelect(start, end) {
5412    return {
5413      type: 'MULTI_SELECT',
5414      start: start,
5415      end: end
5416    };
5417  }
5418  /**
5419   * Returns an action object used in signalling that the block selection is cleared.
5420   *
5421   * @return {Object} Action object.
5422   */
5423  
5424  function clearSelectedBlock() {
5425    return {
5426      type: 'CLEAR_SELECTED_BLOCK'
5427    };
5428  }
5429  /**
5430   * Returns an action object that enables or disables block selection.
5431   *
5432   * @param {boolean} [isSelectionEnabled=true] Whether block selection should
5433   *                                            be enabled.
5434  
5435   * @return {Object} Action object.
5436   */
5437  
5438  function toggleSelection() {
5439    var isSelectionEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
5440    return {
5441      type: 'TOGGLE_SELECTION',
5442      isSelectionEnabled: isSelectionEnabled
5443    };
5444  }
5445  /**
5446   * Returns an action object signalling that a blocks should be replaced with
5447   * one or more replacement blocks.
5448   *
5449   * @param {(string|string[])} clientIds Block client ID(s) to replace.
5450   * @param {(Object|Object[])} blocks    Replacement block(s).
5451   *
5452   * @yields {Object} Action object.
5453   */
5454  
5455  function actions_replaceBlocks(clientIds, blocks) {
5456    var rootClientId, index, block, canInsertBlock;
5457    return regenerator_default.a.wrap(function replaceBlocks$(_context4) {
5458      while (1) {
5459        switch (_context4.prev = _context4.next) {
5460          case 0:
5461            clientIds = Object(external_lodash_["castArray"])(clientIds);
5462            blocks = Object(external_lodash_["castArray"])(blocks);
5463            _context4.next = 4;
5464            return controls_select('core/block-editor', 'getBlockRootClientId', Object(external_lodash_["first"])(clientIds));
5465  
5466          case 4:
5467            rootClientId = _context4.sent;
5468            index = 0;
5469  
5470          case 6:
5471            if (!(index < blocks.length)) {
5472              _context4.next = 16;
5473              break;
5474            }
5475  
5476            block = blocks[index];
5477            _context4.next = 10;
5478            return controls_select('core/block-editor', 'canInsertBlockType', block.name, rootClientId);
5479  
5480          case 10:
5481            canInsertBlock = _context4.sent;
5482  
5483            if (canInsertBlock) {
5484              _context4.next = 13;
5485              break;
5486            }
5487  
5488            return _context4.abrupt("return");
5489  
5490          case 13:
5491            index++;
5492            _context4.next = 6;
5493            break;
5494  
5495          case 16:
5496            _context4.next = 18;
5497            return {
5498              type: 'REPLACE_BLOCKS',
5499              clientIds: clientIds,
5500              blocks: blocks,
5501              time: Date.now()
5502            };
5503  
5504          case 18:
5505            return _context4.delegateYield(ensureDefaultBlock(), "t0", 19);
5506  
5507          case 19:
5508          case "end":
5509            return _context4.stop();
5510        }
5511      }
5512    }, _marked4, this);
5513  }
5514  /**
5515   * Returns an action object signalling that a single block should be replaced
5516   * with one or more replacement blocks.
5517   *
5518   * @param {(string|string[])} clientId Block client ID to replace.
5519   * @param {(Object|Object[])} block    Replacement block(s).
5520   *
5521   * @return {Object} Action object.
5522   */
5523  
5524  function replaceBlock(clientId, block) {
5525    return actions_replaceBlocks(clientId, block);
5526  }
5527  /**
5528   * Higher-order action creator which, given the action type to dispatch creates
5529   * an action creator for managing block movement.
5530   *
5531   * @param {string} type Action type to dispatch.
5532   *
5533   * @return {Function} Action creator.
5534   */
5535  
5536  function createOnMove(type) {
5537    return function (clientIds, rootClientId) {
5538      return {
5539        clientIds: Object(external_lodash_["castArray"])(clientIds),
5540        type: type,
5541        rootClientId: rootClientId
5542      };
5543    };
5544  }
5545  
5546  var actions_moveBlocksDown = createOnMove('MOVE_BLOCKS_DOWN');
5547  var actions_moveBlocksUp = createOnMove('MOVE_BLOCKS_UP');
5548  /**
5549   * Returns an action object signalling that an indexed block should be moved
5550   * to a new index.
5551   *
5552   * @param  {?string} clientId         The client ID of the block.
5553   * @param  {?string} fromRootClientId Root client ID source.
5554   * @param  {?string} toRootClientId   Root client ID destination.
5555   * @param  {number}  index            The index to move the block into.
5556   *
5557   * @yields {Object} Action object.
5558   */
5559  
5560  function moveBlockToPosition(clientId, fromRootClientId, toRootClientId, index) {
5561    var templateLock, action, blockName, canInsertBlock;
5562    return regenerator_default.a.wrap(function moveBlockToPosition$(_context5) {
5563      while (1) {
5564        switch (_context5.prev = _context5.next) {
5565          case 0:
5566            _context5.next = 2;
5567            return controls_select('core/block-editor', 'getTemplateLock', fromRootClientId);
5568  
5569          case 2:
5570            templateLock = _context5.sent;
5571  
5572            if (!(templateLock === 'all')) {
5573              _context5.next = 5;
5574              break;
5575            }
5576  
5577            return _context5.abrupt("return");
5578  
5579          case 5:
5580            action = {
5581              type: 'MOVE_BLOCK_TO_POSITION',
5582              fromRootClientId: fromRootClientId,
5583              toRootClientId: toRootClientId,
5584              clientId: clientId,
5585              index: index
5586            }; // If moving inside the same root block the move is always possible.
5587  
5588            if (!(fromRootClientId === toRootClientId)) {
5589              _context5.next = 10;
5590              break;
5591            }
5592  
5593            _context5.next = 9;
5594            return action;
5595  
5596          case 9:
5597            return _context5.abrupt("return");
5598  
5599          case 10:
5600            _context5.next = 12;
5601            return controls_select('core/block-editor', 'getBlockName', clientId);
5602  
5603          case 12:
5604            blockName = _context5.sent;
5605            _context5.next = 15;
5606            return controls_select('core/block-editor', 'canInsertBlockType', blockName, toRootClientId);
5607  
5608          case 15:
5609            canInsertBlock = _context5.sent;
5610  
5611            if (!canInsertBlock) {
5612              _context5.next = 19;
5613              break;
5614            }
5615  
5616            _context5.next = 19;
5617            return action;
5618  
5619          case 19:
5620          case "end":
5621            return _context5.stop();
5622        }
5623      }
5624    }, _marked5, this);
5625  }
5626  /**
5627   * Returns an action object used in signalling that a single block should be
5628   * inserted, optionally at a specific index respective a root block list.
5629   *
5630   * @param {Object}  block            Block object to insert.
5631   * @param {?number} index            Index at which block should be inserted.
5632   * @param {?string} rootClientId     Optional root client ID of block list on which to insert.
5633   * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true.
5634   *
5635   * @return {Object} Action object.
5636   */
5637  
5638  function actions_insertBlock(block, index, rootClientId) {
5639    var updateSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
5640    return actions_insertBlocks([block], index, rootClientId, updateSelection);
5641  }
5642  /**
5643   * Returns an action object used in signalling that an array of blocks should
5644   * be inserted, optionally at a specific index respective a root block list.
5645   *
5646   * @param {Object[]} blocks          Block objects to insert.
5647   * @param {?number}  index           Index at which block should be inserted.
5648   * @param {?string}  rootClientId    Optional root client ID of block list on which to insert.
5649   * @param {?boolean} updateSelection If true block selection will be updated.  If false, block selection will not change. Defaults to true.
5650   *
5651   *  @return {Object} Action object.
5652   */
5653  
5654  function actions_insertBlocks(blocks, index, rootClientId) {
5655    var updateSelection,
5656        allowedBlocks,
5657        _iteratorNormalCompletion,
5658        _didIteratorError,
5659        _iteratorError,
5660        _iterator,
5661        _step,
5662        block,
5663        isValid,
5664        _args6 = arguments;
5665  
5666    return regenerator_default.a.wrap(function insertBlocks$(_context6) {
5667      while (1) {
5668        switch (_context6.prev = _context6.next) {
5669          case 0:
5670            updateSelection = _args6.length > 3 && _args6[3] !== undefined ? _args6[3] : true;
5671            blocks = Object(external_lodash_["castArray"])(blocks);
5672            allowedBlocks = [];
5673            _iteratorNormalCompletion = true;
5674            _didIteratorError = false;
5675            _iteratorError = undefined;
5676            _context6.prev = 6;
5677            _iterator = blocks[Symbol.iterator]();
5678  
5679          case 8:
5680            if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {
5681              _context6.next = 17;
5682              break;
5683            }
5684  
5685            block = _step.value;
5686            _context6.next = 12;
5687            return controls_select('core/block-editor', 'canInsertBlockType', block.name, rootClientId);
5688  
5689          case 12:
5690            isValid = _context6.sent;
5691  
5692            if (isValid) {
5693              allowedBlocks.push(block);
5694            }
5695  
5696          case 14:
5697            _iteratorNormalCompletion = true;
5698            _context6.next = 8;
5699            break;
5700  
5701          case 17:
5702            _context6.next = 23;
5703            break;
5704  
5705          case 19:
5706            _context6.prev = 19;
5707            _context6.t0 = _context6["catch"](6);
5708            _didIteratorError = true;
5709            _iteratorError = _context6.t0;
5710  
5711          case 23:
5712            _context6.prev = 23;
5713            _context6.prev = 24;
5714  
5715            if (!_iteratorNormalCompletion && _iterator.return != null) {
5716              _iterator.return();
5717            }
5718  
5719          case 26:
5720            _context6.prev = 26;
5721  
5722            if (!_didIteratorError) {
5723              _context6.next = 29;
5724              break;
5725            }
5726  
5727            throw _iteratorError;
5728  
5729          case 29:
5730            return _context6.finish(26);
5731  
5732          case 30:
5733            return _context6.finish(23);
5734  
5735          case 31:
5736            if (!allowedBlocks.length) {
5737              _context6.next = 33;
5738              break;
5739            }
5740  
5741            return _context6.abrupt("return", {
5742              type: 'INSERT_BLOCKS',
5743              blocks: allowedBlocks,
5744              index: index,
5745              rootClientId: rootClientId,
5746              time: Date.now(),
5747              updateSelection: updateSelection
5748            });
5749  
5750          case 33:
5751          case "end":
5752            return _context6.stop();
5753        }
5754      }
5755    }, _marked6, this, [[6, 19, 23, 31], [24,, 26, 30]]);
5756  }
5757  /**
5758   * Returns an action object used in signalling that the insertion point should
5759   * be shown.
5760   *
5761   * @param {?string} rootClientId Optional root client ID of block list on
5762   *                               which to insert.
5763   * @param {?number} index        Index at which block should be inserted.
5764   *
5765   * @return {Object} Action object.
5766   */
5767  
5768  function actions_showInsertionPoint(rootClientId, index) {
5769    return {
5770      type: 'SHOW_INSERTION_POINT',
5771      rootClientId: rootClientId,
5772      index: index
5773    };
5774  }
5775  /**
5776   * Returns an action object hiding the insertion point.
5777   *
5778   * @return {Object} Action object.
5779   */
5780  
5781  function actions_hideInsertionPoint() {
5782    return {
5783      type: 'HIDE_INSERTION_POINT'
5784    };
5785  }
5786  /**
5787   * Returns an action object resetting the template validity.
5788   *
5789   * @param {boolean}  isValid  template validity flag.
5790   *
5791   * @return {Object} Action object.
5792   */
5793  
5794  function setTemplateValidity(isValid) {
5795    return {
5796      type: 'SET_TEMPLATE_VALIDITY',
5797      isValid: isValid
5798    };
5799  }
5800  /**
5801   * Returns an action object synchronize the template with the list of blocks
5802   *
5803   * @return {Object} Action object.
5804   */
5805  
5806  function synchronizeTemplate() {
5807    return {
5808      type: 'SYNCHRONIZE_TEMPLATE'
5809    };
5810  }
5811  /**
5812   * Returns an action object used in signalling that two blocks should be merged
5813   *
5814   * @param {string} firstBlockClientId  Client ID of the first block to merge.
5815   * @param {string} secondBlockClientId Client ID of the second block to merge.
5816   *
5817   * @return {Object} Action object.
5818   */
5819  
5820  function mergeBlocks(firstBlockClientId, secondBlockClientId) {
5821    return {
5822      type: 'MERGE_BLOCKS',
5823      blocks: [firstBlockClientId, secondBlockClientId]
5824    };
5825  }
5826  /**
5827   * Yields action objects used in signalling that the blocks corresponding to
5828   * the set of specified client IDs are to be removed.
5829   *
5830   * @param {string|string[]} clientIds      Client IDs of blocks to remove.
5831   * @param {boolean}         selectPrevious True if the previous block should be
5832   *                                         selected when a block is removed.
5833   */
5834  
5835  function actions_removeBlocks(clientIds) {
5836    var selectPrevious,
5837        _args7 = arguments;
5838    return regenerator_default.a.wrap(function removeBlocks$(_context7) {
5839      while (1) {
5840        switch (_context7.prev = _context7.next) {
5841          case 0:
5842            selectPrevious = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : true;
5843            clientIds = Object(external_lodash_["castArray"])(clientIds);
5844  
5845            if (!selectPrevious) {
5846              _context7.next = 5;
5847              break;
5848            }
5849  
5850            _context7.next = 5;
5851            return selectPreviousBlock(clientIds[0]);
5852  
5853          case 5:
5854            _context7.next = 7;
5855            return {
5856              type: 'REMOVE_BLOCKS',
5857              clientIds: clientIds
5858            };
5859  
5860          case 7:
5861            return _context7.delegateYield(ensureDefaultBlock(), "t0", 8);
5862  
5863          case 8:
5864          case "end":
5865            return _context7.stop();
5866        }
5867      }
5868    }, _marked7, this);
5869  }
5870  /**
5871   * Returns an action object used in signalling that the block with the
5872   * specified client ID is to be removed.
5873   *
5874   * @param {string}  clientId       Client ID of block to remove.
5875   * @param {boolean} selectPrevious True if the previous block should be
5876   *                                 selected when a block is removed.
5877   *
5878   * @return {Object} Action object.
5879   */
5880  
5881  function removeBlock(clientId, selectPrevious) {
5882    return actions_removeBlocks([clientId], selectPrevious);
5883  }
5884  /**
5885   * Returns an action object used in signalling that the inner blocks with the
5886   * specified client ID should be replaced.
5887   *
5888   * @param {string}   rootClientId    Client ID of the block whose InnerBlocks will re replaced.
5889   * @param {Object[]} blocks          Block objects to insert as new InnerBlocks
5890   * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true.
5891   *
5892   * @return {Object} Action object.
5893   */
5894  
5895  function actions_replaceInnerBlocks(rootClientId, blocks) {
5896    var updateSelection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
5897    return {
5898      type: 'REPLACE_INNER_BLOCKS',
5899      rootClientId: rootClientId,
5900      blocks: blocks,
5901      updateSelection: updateSelection,
5902      time: Date.now()
5903    };
5904  }
5905  /**
5906   * Returns an action object used to toggle the block editing mode between
5907   * visual and HTML modes.
5908   *
5909   * @param {string} clientId Block client ID.
5910   *
5911   * @return {Object} Action object.
5912   */
5913  
5914  function toggleBlockMode(clientId) {
5915    return {
5916      type: 'TOGGLE_BLOCK_MODE',
5917      clientId: clientId
5918    };
5919  }
5920  /**
5921   * Returns an action object used in signalling that the user has begun to type.
5922   *
5923   * @return {Object} Action object.
5924   */
5925  
5926  function startTyping() {
5927    return {
5928      type: 'START_TYPING'
5929    };
5930  }
5931  /**
5932   * Returns an action object used in signalling that the user has stopped typing.
5933   *
5934   * @return {Object} Action object.
5935   */
5936  
5937  function stopTyping() {
5938    return {
5939      type: 'STOP_TYPING'
5940    };
5941  }
5942  /**
5943   * Returns an action object used in signalling that the caret has entered formatted text.
5944   *
5945   * @return {Object} Action object.
5946   */
5947  
5948  function enterFormattedText() {
5949    return {
5950      type: 'ENTER_FORMATTED_TEXT'
5951    };
5952  }
5953  /**
5954   * Returns an action object used in signalling that the user caret has exited formatted text.
5955   *
5956   * @return {Object} Action object.
5957   */
5958  
5959  function exitFormattedText() {
5960    return {
5961      type: 'EXIT_FORMATTED_TEXT'
5962    };
5963  }
5964  /**
5965   * Returns an action object used in signalling that a new block of the default
5966   * type should be added to the block list.
5967   *
5968   * @param {?Object} attributes   Optional attributes of the block to assign.
5969   * @param {?string} rootClientId Optional root client ID of block list on which
5970   *                               to append.
5971   * @param {?number} index        Optional index where to insert the default block
5972   *
5973   * @return {Object} Action object
5974   */
5975  
5976  function actions_insertDefaultBlock(attributes, rootClientId, index) {
5977    var block = Object(external_this_wp_blocks_["createBlock"])(Object(external_this_wp_blocks_["getDefaultBlockName"])(), attributes);
5978    return actions_insertBlock(block, index, rootClientId);
5979  }
5980  /**
5981   * Returns an action object that changes the nested settings of a given block.
5982   *
5983   * @param {string} clientId Client ID of the block whose nested setting are
5984   *                          being received.
5985   * @param {Object} settings Object with the new settings for the nested block.
5986   *
5987   * @return {Object} Action object
5988   */
5989  
5990  function updateBlockListSettings(clientId, settings) {
5991    return {
5992      type: 'UPDATE_BLOCK_LIST_SETTINGS',
5993      clientId: clientId,
5994      settings: settings
5995    };
5996  }
5997  /*
5998   * Returns an action object used in signalling that the block editor settings have been updated.
5999   *
6000   * @param {Object} settings Updated settings
6001   *
6002   * @return {Object} Action object
6003   */
6004  
6005  function updateSettings(settings) {
6006    return {
6007      type: 'UPDATE_SETTINGS',
6008      settings: settings
6009    };
6010  }
6011  /**
6012   * Returns an action object used in signalling that a temporary reusable blocks have been saved
6013   * in order to switch its temporary id with the real id.
6014   *
6015   * @param {string} id        Reusable block's id.
6016   * @param {string} updatedId Updated block's id.
6017   *
6018   * @return {Object} Action object.
6019   */
6020  
6021  function __unstableSaveReusableBlock(id, updatedId) {
6022    return {
6023      type: 'SAVE_REUSABLE_BLOCK_SUCCESS',
6024      id: id,
6025      updatedId: updatedId
6026    };
6027  }
6028  /**
6029   * Returns an action object used in signalling that the last block change should be marked explicitely as persistent.
6030   *
6031   * @return {Object} Action object.
6032   */
6033  
6034  function __unstableMarkLastChangeAsPersistent() {
6035    return {
6036      type: 'MARK_LAST_CHANGE_AS_PERSISTENT'
6037    };
6038  }
6039  
6040  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
6041  var rememo = __webpack_require__(30);
6042  
6043  // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js
6044  
6045  
6046  
6047  /**
6048   * External dependencies
6049   */
6050  
6051  
6052  /**
6053   * WordPress dependencies
6054   */
6055  
6056  
6057  /***
6058   * Module constants
6059   */
6060  
6061  var INSERTER_UTILITY_HIGH = 3;
6062  var INSERTER_UTILITY_MEDIUM = 2;
6063  var INSERTER_UTILITY_LOW = 1;
6064  var INSERTER_UTILITY_NONE = 0;
6065  var MILLISECONDS_PER_HOUR = 3600 * 1000;
6066  var MILLISECONDS_PER_DAY = 24 * 3600 * 1000;
6067  var MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000;
6068  /**
6069   * Shared reference to an empty array for cases where it is important to avoid
6070   * returning a new array reference on every invocation, as in a connected or
6071   * other pure component which performs `shouldComponentUpdate` check on props.
6072   * This should be used as a last resort, since the normalized data should be
6073   * maintained by the reducer result in state.
6074   *
6075   * @type {Array}
6076   */
6077  
6078  var EMPTY_ARRAY = [];
6079  /**
6080   * Shared reference to an empty object for cases where it is important to avoid
6081   * returning a new object reference on every invocation.
6082   *
6083   * @type {Object}
6084   */
6085  
6086  var EMPTY_OBJECT = {};
6087  /**
6088   * Returns a new reference when the inner blocks of a given block client ID
6089   * change. This is used exclusively as a memoized selector dependant, relying
6090   * on this selector's shared return value and recursively those of its inner
6091   * blocks defined as dependencies. This abuses mechanics of the selector
6092   * memoization to return from the original selector function only when
6093   * dependants change.
6094   *
6095   * @param {Object} state    Editor state.
6096   * @param {string} clientId Block client ID.
6097   *
6098   * @return {*} A value whose reference will change only when inner blocks of
6099   *             the given block client ID change.
6100   */
6101  
6102  var getBlockDependantsCacheBust = Object(rememo["a" /* default */])(function () {
6103    return [];
6104  }, function (state, clientId) {
6105    return Object(external_lodash_["map"])(selectors_getBlockOrder(state, clientId), function (innerBlockClientId) {
6106      return selectors_getBlock(state, innerBlockClientId);
6107    });
6108  });
6109  /**
6110   * Returns a block's name given its client ID, or null if no block exists with
6111   * the client ID.
6112   *
6113   * @param {Object} state    Editor state.
6114   * @param {string} clientId Block client ID.
6115   *
6116   * @return {string} Block name.
6117   */
6118  
6119  function selectors_getBlockName(state, clientId) {
6120    var block = state.blocks.byClientId[clientId];
6121    return block ? block.name : null;
6122  }
6123  /**
6124   * Returns whether a block is valid or not.
6125   *
6126   * @param {Object} state    Editor state.
6127   * @param {string} clientId Block client ID.
6128   *
6129   * @return {boolean} Is Valid.
6130   */
6131  
6132  function selectors_isBlockValid(state, clientId) {
6133    var block = state.blocks.byClientId[clientId];
6134    return !!block && block.isValid;
6135  }
6136  /**
6137   * Returns a block's attributes given its client ID, or null if no block exists with
6138   * the client ID.
6139   *
6140   * @param {Object} state    Editor state.
6141   * @param {string} clientId Block client ID.
6142   *
6143   * @return {Object?} Block attributes.
6144   */
6145  
6146  var getBlockAttributes = Object(rememo["a" /* default */])(function (state, clientId) {
6147    var block = state.blocks.byClientId[clientId];
6148  
6149    if (!block) {
6150      return null;
6151    }
6152  
6153    var attributes = state.blocks.attributes[clientId]; // Inject custom source attribute values.
6154    //
6155    // TODO: Create generic external sourcing pattern, not explicitly
6156    // targeting meta attributes.
6157  
6158    var type = Object(external_this_wp_blocks_["getBlockType"])(block.name);
6159  
6160    if (type) {
6161      attributes = Object(external_lodash_["reduce"])(type.attributes, function (result, value, key) {
6162        if (value.source === 'meta') {
6163          if (result === attributes) {
6164            result = Object(objectSpread["a" /* default */])({}, result);
6165          }
6166  
6167          result[key] = getPostMeta(state, value.meta);
6168        }
6169  
6170        return result;
6171      }, attributes);
6172    }
6173  
6174    return attributes;
6175  }, function (state, clientId) {
6176    return [state.blocks.byClientId[clientId], state.blocks.attributes[clientId], getPostMeta(state)];
6177  });
6178  /**
6179   * Returns a block given its client ID. This is a parsed copy of the block,
6180   * containing its `blockName`, `clientId`, and current `attributes` state. This
6181   * is not the block's registration settings, which must be retrieved from the
6182   * blocks module registration store.
6183   *
6184   * @param {Object} state    Editor state.
6185   * @param {string} clientId Block client ID.
6186   *
6187   * @return {Object} Parsed block object.
6188   */
6189  
6190  var selectors_getBlock = Object(rememo["a" /* default */])(function (state, clientId) {
6191    var block = state.blocks.byClientId[clientId];
6192  
6193    if (!block) {
6194      return null;
6195    }
6196  
6197    return Object(objectSpread["a" /* default */])({}, block, {
6198      attributes: getBlockAttributes(state, clientId),
6199      innerBlocks: getBlocks(state, clientId)
6200    });
6201  }, function (state, clientId) {
6202    return [].concat(Object(toConsumableArray["a" /* default */])(getBlockAttributes.getDependants(state, clientId)), [getBlockDependantsCacheBust(state, clientId)]);
6203  });
6204  var selectors_unstableGetBlockWithoutInnerBlocks = Object(rememo["a" /* default */])(function (state, clientId) {
6205    var block = state.blocks.byClientId[clientId];
6206  
6207    if (!block) {
6208      return null;
6209    }
6210  
6211    return Object(objectSpread["a" /* default */])({}, block, {
6212      attributes: getBlockAttributes(state, clientId)
6213    });
6214  }, function (state, clientId) {
6215    return [state.blocks.byClientId[clientId]].concat(Object(toConsumableArray["a" /* default */])(getBlockAttributes.getDependants(state, clientId)));
6216  });
6217  /**
6218   * Returns all block objects for the current post being edited as an array in
6219   * the order they appear in the post.
6220   *
6221   * Note: It's important to memoize this selector to avoid return a new instance
6222   * on each call
6223   *
6224   * @param {Object}  state        Editor state.
6225   * @param {?String} rootClientId Optional root client ID of block list.
6226   *
6227   * @return {Object[]} Post blocks.
6228   */
6229  
6230  var getBlocks = Object(rememo["a" /* default */])(function (state, rootClientId) {
6231    return Object(external_lodash_["map"])(selectors_getBlockOrder(state, rootClientId), function (clientId) {
6232      return selectors_getBlock(state, clientId);
6233    });
6234  }, function (state) {
6235    return [state.blocks.byClientId, state.blocks.order, state.blocks.attributes];
6236  });
6237  /**
6238   * Returns an array containing the clientIds of all descendants
6239   * of the blocks given.
6240   *
6241   * @param {Object} state Global application state.
6242   * @param {Array} clientIds Array of blocks to inspect.
6243   *
6244   * @return {Array} ids of descendants.
6245   */
6246  
6247  var selectors_getClientIdsOfDescendants = function getClientIdsOfDescendants(state, clientIds) {
6248    return Object(external_lodash_["flatMap"])(clientIds, function (clientId) {
6249      var descendants = selectors_getBlockOrder(state, clientId);
6250      return [].concat(Object(toConsumableArray["a" /* default */])(descendants), Object(toConsumableArray["a" /* default */])(getClientIdsOfDescendants(state, descendants)));
6251    });
6252  };
6253  /**
6254   * Returns an array containing the clientIds of the top-level blocks
6255   * and their descendants of any depth (for nested blocks).
6256   *
6257   * @param {Object} state Global application state.
6258   *
6259   * @return {Array} ids of top-level and descendant blocks.
6260   */
6261  
6262  var getClientIdsWithDescendants = Object(rememo["a" /* default */])(function (state) {
6263    var topLevelIds = selectors_getBlockOrder(state);
6264    return [].concat(Object(toConsumableArray["a" /* default */])(topLevelIds), Object(toConsumableArray["a" /* default */])(selectors_getClientIdsOfDescendants(state, topLevelIds)));
6265  }, function (state) {
6266    return [state.blocks.order];
6267  });
6268  /**
6269   * Returns the total number of blocks, or the total number of blocks with a specific name in a post.
6270   * The number returned includes nested blocks.
6271   *
6272   * @param {Object}  state     Global application state.
6273   * @param {?String} blockName Optional block name, if specified only blocks of that type will be counted.
6274   *
6275   * @return {number} Number of blocks in the post, or number of blocks with name equal to blockName.
6276   */
6277  
6278  var getGlobalBlockCount = Object(rememo["a" /* default */])(function (state, blockName) {
6279    var clientIds = getClientIdsWithDescendants(state);
6280  
6281    if (!blockName) {
6282      return clientIds.length;
6283    }
6284  
6285    return Object(external_lodash_["reduce"])(clientIds, function (count, clientId) {
6286      var block = state.blocks.byClientId[clientId];
6287      return block.name === blockName ? count + 1 : count;
6288    }, 0);
6289  }, function (state) {
6290    return [state.blocks.order, state.blocks.byClientId];
6291  });
6292  /**
6293   * Given an array of block client IDs, returns the corresponding array of block
6294   * objects.
6295   *
6296   * @param {Object}   state     Editor state.
6297   * @param {string[]} clientIds Client IDs for which blocks are to be returned.
6298   *
6299   * @return {WPBlock[]} Block objects.
6300   */
6301  
6302  var selectors_getBlocksByClientId = Object(rememo["a" /* default */])(function (state, clientIds) {
6303    return Object(external_lodash_["map"])(Object(external_lodash_["castArray"])(clientIds), function (clientId) {
6304      return selectors_getBlock(state, clientId);
6305    });
6306  }, function (state) {
6307    return [getPostMeta(state), state.blocks.byClientId, state.blocks.order, state.blocks.attributes];
6308  });
6309  /**
6310   * Returns the number of blocks currently present in the post.
6311   *
6312   * @param {Object}  state        Editor state.
6313   * @param {?string} rootClientId Optional root client ID of block list.
6314   *
6315   * @return {number} Number of blocks in the post.
6316   */
6317  
6318  function selectors_getBlockCount(state, rootClientId) {
6319    return selectors_getBlockOrder(state, rootClientId).length;
6320  }
6321  /**
6322   * Returns the current block selection start. This value may be null, and it
6323   * may represent either a singular block selection or multi-selection start.
6324   * A selection is singular if its start and end match.
6325   *
6326   * @param {Object} state Global application state.
6327   *
6328   * @return {?string} Client ID of block selection start.
6329   */
6330  
6331  function getBlockSelectionStart(state) {
6332    return state.blockSelection.start;
6333  }
6334  /**
6335   * Returns the current block selection end. This value may be null, and it
6336   * may represent either a singular block selection or multi-selection end.
6337   * A selection is singular if its start and end match.
6338   *
6339   * @param {Object} state Global application state.
6340   *
6341   * @return {?string} Client ID of block selection end.
6342   */
6343  
6344  function getBlockSelectionEnd(state) {
6345    return state.blockSelection.end;
6346  }
6347  /**
6348   * Returns the number of blocks currently selected in the post.
6349   *
6350   * @param {Object} state Global application state.
6351   *
6352   * @return {number} Number of blocks selected in the post.
6353   */
6354  
6355  function selectors_getSelectedBlockCount(state) {
6356    var multiSelectedBlockCount = selectors_getMultiSelectedBlockClientIds(state).length;
6357  
6358    if (multiSelectedBlockCount) {
6359      return multiSelectedBlockCount;
6360    }
6361  
6362    return state.blockSelection.start ? 1 : 0;
6363  }
6364  /**
6365   * Returns true if there is a single selected block, or false otherwise.
6366   *
6367   * @param {Object} state Editor state.
6368   *
6369   * @return {boolean} Whether a single block is selected.
6370   */
6371  
6372  function hasSelectedBlock(state) {
6373    var _state$blockSelection = state.blockSelection,
6374        start = _state$blockSelection.start,
6375        end = _state$blockSelection.end;
6376    return !!start && start === end;
6377  }
6378  /**
6379   * Returns the currently selected block client ID, or null if there is no
6380   * selected block.
6381   *
6382   * @param {Object} state Editor state.
6383   *
6384   * @return {?string} Selected block client ID.
6385   */
6386  
6387  function selectors_getSelectedBlockClientId(state) {
6388    var _state$blockSelection2 = state.blockSelection,
6389        start = _state$blockSelection2.start,
6390        end = _state$blockSelection2.end; // We need to check the block exists because the current blockSelection
6391    // reducer doesn't take into account when blocks are reset via undo. To be
6392    // removed when that's fixed.
6393  
6394    return start && start === end && !!state.blocks.byClientId[start] ? start : null;
6395  }
6396  /**
6397   * Returns the currently selected block, or null if there is no selected block.
6398   *
6399   * @param {Object} state Global application state.
6400   *
6401   * @return {?Object} Selected block.
6402   */
6403  
6404  function selectors_getSelectedBlock(state) {
6405    var clientId = selectors_getSelectedBlockClientId(state);
6406    return clientId ? selectors_getBlock(state, clientId) : null;
6407  }
6408  /**
6409   * Given a block client ID, returns the root block from which the block is
6410   * nested, an empty string for top-level blocks, or null if the block does not
6411   * exist.
6412   *
6413   * @param {Object} state    Editor state.
6414   * @param {string} clientId Block from which to find root client ID.
6415   *
6416   * @return {?string} Root client ID, if exists
6417   */
6418  
6419  var selectors_getBlockRootClientId = Object(rememo["a" /* default */])(function (state, clientId) {
6420    var order = state.blocks.order;
6421  
6422    for (var rootClientId in order) {
6423      if (Object(external_lodash_["includes"])(order[rootClientId], clientId)) {
6424        return rootClientId;
6425      }
6426    }
6427  
6428    return null;
6429  }, function (state) {
6430    return [state.blocks.order];
6431  });
6432  /**
6433   * Given a block client ID, returns the root of the hierarchy from which the block is nested, return the block itself for root level blocks.
6434   *
6435   * @param {Object} state    Editor state.
6436   * @param {string} clientId Block from which to find root client ID.
6437   *
6438   * @return {string} Root client ID
6439   */
6440  
6441  var getBlockHierarchyRootClientId = Object(rememo["a" /* default */])(function (state, clientId) {
6442    var rootClientId = clientId;
6443    var current = clientId;
6444  
6445    while (rootClientId) {
6446      current = rootClientId;
6447      rootClientId = selectors_getBlockRootClientId(state, current);
6448    }
6449  
6450    return current;
6451  }, function (state) {
6452    return [state.blocks.order];
6453  });
6454  /**
6455   * Returns the client ID of the block adjacent one at the given reference
6456   * startClientId and modifier directionality. Defaults start startClientId to
6457   * the selected block, and direction as next block. Returns null if there is no
6458   * adjacent block.
6459   *
6460   * @param {Object}  state         Editor state.
6461   * @param {?string} startClientId Optional client ID of block from which to
6462   *                                search.
6463   * @param {?number} modifier      Directionality multiplier (1 next, -1
6464   *                                previous).
6465   *
6466   * @return {?string} Return the client ID of the block, or null if none exists.
6467   */
6468  
6469  function getAdjacentBlockClientId(state, startClientId) {
6470    var modifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
6471  
6472    // Default to selected block.
6473    if (startClientId === undefined) {
6474      startClientId = selectors_getSelectedBlockClientId(state);
6475    } // Try multi-selection starting at extent based on modifier.
6476  
6477  
6478    if (startClientId === undefined) {
6479      if (modifier < 0) {
6480        startClientId = getFirstMultiSelectedBlockClientId(state);
6481      } else {
6482        startClientId = getLastMultiSelectedBlockClientId(state);
6483      }
6484    } // Validate working start client ID.
6485  
6486  
6487    if (!startClientId) {
6488      return null;
6489    } // Retrieve start block root client ID, being careful to allow the falsey
6490    // empty string top-level root by explicitly testing against null.
6491  
6492  
6493    var rootClientId = selectors_getBlockRootClientId(state, startClientId);
6494  
6495    if (rootClientId === null) {
6496      return null;
6497    }
6498  
6499    var order = state.blocks.order;
6500    var orderSet = order[rootClientId];
6501    var index = orderSet.indexOf(startClientId);
6502    var nextIndex = index + 1 * modifier; // Block was first in set and we're attempting to get previous.
6503  
6504    if (nextIndex < 0) {
6505      return null;
6506    } // Block was last in set and we're attempting to get next.
6507  
6508  
6509    if (nextIndex === orderSet.length) {
6510      return null;
6511    } // Assume incremented index is within the set.
6512  
6513  
6514    return orderSet[nextIndex];
6515  }
6516  /**
6517   * Returns the previous block's client ID from the given reference start ID.
6518   * Defaults start to the selected block. Returns null if there is no previous
6519   * block.
6520   *
6521   * @param {Object}  state         Editor state.
6522   * @param {?string} startClientId Optional client ID of block from which to
6523   *                                search.
6524   *
6525   * @return {?string} Adjacent block's client ID, or null if none exists.
6526   */
6527  
6528  function getPreviousBlockClientId(state, startClientId) {
6529    return getAdjacentBlockClientId(state, startClientId, -1);
6530  }
6531  /**
6532   * Returns the next block's client ID from the given reference start ID.
6533   * Defaults start to the selected block. Returns null if there is no next
6534   * block.
6535   *
6536   * @param {Object}  state         Editor state.
6537   * @param {?string} startClientId Optional client ID of block from which to
6538   *                                search.
6539   *
6540   * @return {?string} Adjacent block's client ID, or null if none exists.
6541   */
6542  
6543  function getNextBlockClientId(state, startClientId) {
6544    return getAdjacentBlockClientId(state, startClientId, 1);
6545  }
6546  /**
6547   * Returns the initial caret position for the selected block.
6548   * This position is to used to position the caret properly when the selected block changes.
6549   *
6550   * @param {Object} state Global application state.
6551   *
6552   * @return {?Object} Selected block.
6553   */
6554  
6555  function selectors_getSelectedBlocksInitialCaretPosition(state) {
6556    var _state$blockSelection3 = state.blockSelection,
6557        start = _state$blockSelection3.start,
6558        end = _state$blockSelection3.end;
6559  
6560    if (start !== end || !start) {
6561      return null;
6562    }
6563  
6564    return state.blockSelection.initialPosition;
6565  }
6566  /**
6567   * Returns the current multi-selection set of block client IDs, or an empty
6568   * array if there is no multi-selection.
6569   *
6570   * @param {Object} state Editor state.
6571   *
6572   * @return {Array} Multi-selected block client IDs.
6573   */
6574  
6575  var selectors_getMultiSelectedBlockClientIds = Object(rememo["a" /* default */])(function (state) {
6576    var _state$blockSelection4 = state.blockSelection,
6577        start = _state$blockSelection4.start,
6578        end = _state$blockSelection4.end;
6579  
6580    if (start === end) {
6581      return [];
6582    } // Retrieve root client ID to aid in retrieving relevant nested block
6583    // order, being careful to allow the falsey empty string top-level root
6584    // by explicitly testing against null.
6585  
6586  
6587    var rootClientId = selectors_getBlockRootClientId(state, start);
6588  
6589    if (rootClientId === null) {
6590      return [];
6591    }
6592  
6593    var blockOrder = selectors_getBlockOrder(state, rootClientId);
6594    var startIndex = blockOrder.indexOf(start);
6595    var endIndex = blockOrder.indexOf(end);
6596  
6597    if (startIndex > endIndex) {
6598      return blockOrder.slice(endIndex, startIndex + 1);
6599    }
6600  
6601    return blockOrder.slice(startIndex, endIndex + 1);
6602  }, function (state) {
6603    return [state.blocks.order, state.blockSelection.start, state.blockSelection.end];
6604  });
6605  /**
6606   * Returns the current multi-selection set of blocks, or an empty array if
6607   * there is no multi-selection.
6608   *
6609   * @param {Object} state Editor state.
6610   *
6611   * @return {Array} Multi-selected block objects.
6612   */
6613  
6614  var getMultiSelectedBlocks = Object(rememo["a" /* default */])(function (state) {
6615    var multiSelectedBlockClientIds = selectors_getMultiSelectedBlockClientIds(state);
6616  
6617    if (!multiSelectedBlockClientIds.length) {
6618      return EMPTY_ARRAY;
6619    }
6620  
6621    return multiSelectedBlockClientIds.map(function (clientId) {
6622      return selectors_getBlock(state, clientId);
6623    });
6624  }, function (state) {
6625    return [].concat(Object(toConsumableArray["a" /* default */])(selectors_getMultiSelectedBlockClientIds.getDependants(state)), [state.blocks.byClientId, state.blocks.order, state.blocks.attributes, getPostMeta(state)]);
6626  });
6627  /**
6628   * Returns the client ID of the first block in the multi-selection set, or null
6629   * if there is no multi-selection.
6630   *
6631   * @param {Object} state Editor state.
6632   *
6633   * @return {?string} First block client ID in the multi-selection set.
6634   */
6635  
6636  function getFirstMultiSelectedBlockClientId(state) {
6637    return Object(external_lodash_["first"])(selectors_getMultiSelectedBlockClientIds(state)) || null;
6638  }
6639  /**
6640   * Returns the client ID of the last block in the multi-selection set, or null
6641   * if there is no multi-selection.
6642   *
6643   * @param {Object} state Editor state.
6644   *
6645   * @return {?string} Last block client ID in the multi-selection set.
6646   */
6647  
6648  function getLastMultiSelectedBlockClientId(state) {
6649    return Object(external_lodash_["last"])(selectors_getMultiSelectedBlockClientIds(state)) || null;
6650  }
6651  /**
6652   * Checks if possibleAncestorId is an ancestor of possibleDescendentId.
6653   *
6654   * @param {Object} state                Editor state.
6655   * @param {string} possibleAncestorId   Possible ancestor client ID.
6656   * @param {string} possibleDescendentId Possible descent client ID.
6657   *
6658   * @return {boolean} True if possibleAncestorId is an ancestor
6659   *                   of possibleDescendentId, and false otherwise.
6660   */
6661  
6662  var isAncestorOf = Object(rememo["a" /* default */])(function (state, possibleAncestorId, possibleDescendentId) {
6663    var idToCheck = possibleDescendentId;
6664  
6665    while (possibleAncestorId !== idToCheck && idToCheck) {
6666      idToCheck = selectors_getBlockRootClientId(state, idToCheck);
6667    }
6668  
6669    return possibleAncestorId === idToCheck;
6670  }, function (state) {
6671    return [state.blocks.order];
6672  });
6673  /**
6674   * Returns true if a multi-selection exists, and the block corresponding to the
6675   * specified client ID is the first block of the multi-selection set, or false
6676   * otherwise.
6677   *
6678   * @param {Object} state    Editor state.
6679   * @param {string} clientId Block client ID.
6680   *
6681   * @return {boolean} Whether block is first in multi-selection.
6682   */
6683  
6684  function selectors_isFirstMultiSelectedBlock(state, clientId) {
6685    return getFirstMultiSelectedBlockClientId(state) === clientId;
6686  }
6687  /**
6688   * Returns true if the client ID occurs within the block multi-selection, or
6689   * false otherwise.
6690   *
6691   * @param {Object} state    Editor state.
6692   * @param {string} clientId Block client ID.
6693   *
6694   * @return {boolean} Whether block is in multi-selection set.
6695   */
6696  
6697  function selectors_isBlockMultiSelected(state, clientId) {
6698    return selectors_getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1;
6699  }
6700  /**
6701   * Returns true if an ancestor of the block is multi-selected, or false
6702   * otherwise.
6703   *
6704   * @param {Object} state    Editor state.
6705   * @param {string} clientId Block client ID.
6706   *
6707   * @return {boolean} Whether an ancestor of the block is in multi-selection
6708   *                   set.
6709   */
6710  
6711  var selectors_isAncestorMultiSelected = Object(rememo["a" /* default */])(function (state, clientId) {
6712    var ancestorClientId = clientId;
6713    var isMultiSelected = false;
6714  
6715    while (ancestorClientId && !isMultiSelected) {
6716      ancestorClientId = selectors_getBlockRootClientId(state, ancestorClientId);
6717      isMultiSelected = selectors_isBlockMultiSelected(state, ancestorClientId);
6718    }
6719  
6720    return isMultiSelected;
6721  }, function (state) {
6722    return [state.blocks.order, state.blockSelection.start, state.blockSelection.end];
6723  });
6724  /**
6725   * Returns the client ID of the block which begins the multi-selection set, or
6726   * null if there is no multi-selection.
6727   *
6728   * This is not necessarily the first client ID in the selection.
6729   *
6730   * @see getFirstMultiSelectedBlockClientId
6731   *
6732   * @param {Object} state Editor state.
6733   *
6734   * @return {?string} Client ID of block beginning multi-selection.
6735   */
6736  
6737  function getMultiSelectedBlocksStartClientId(state) {
6738    var _state$blockSelection5 = state.blockSelection,
6739        start = _state$blockSelection5.start,
6740        end = _state$blockSelection5.end;
6741  
6742    if (start === end) {
6743      return null;
6744    }
6745  
6746    return start || null;
6747  }
6748  /**
6749   * Returns the client ID of the block which ends the multi-selection set, or
6750   * null if there is no multi-selection.
6751   *
6752   * This is not necessarily the last client ID in the selection.
6753   *
6754   * @see getLastMultiSelectedBlockClientId
6755   *
6756   * @param {Object} state Editor state.
6757   *
6758   * @return {?string} Client ID of block ending multi-selection.
6759   */
6760  
6761  function getMultiSelectedBlocksEndClientId(state) {
6762    var _state$blockSelection6 = state.blockSelection,
6763        start = _state$blockSelection6.start,
6764        end = _state$blockSelection6.end;
6765  
6766    if (start === end) {
6767      return null;
6768    }
6769  
6770    return end || null;
6771  }
6772  /**
6773   * Returns an array containing all block client IDs in the editor in the order
6774   * they appear. Optionally accepts a root client ID of the block list for which
6775   * the order should be returned, defaulting to the top-level block order.
6776   *
6777   * @param {Object}  state        Editor state.
6778   * @param {?string} rootClientId Optional root client ID of block list.
6779   *
6780   * @return {Array} Ordered client IDs of editor blocks.
6781   */
6782  
6783  function selectors_getBlockOrder(state, rootClientId) {
6784    return state.blocks.order[rootClientId || ''] || EMPTY_ARRAY;
6785  }
6786  /**
6787   * Returns the index at which the block corresponding to the specified client
6788   * ID occurs within the block order, or `-1` if the block does not exist.
6789   *
6790   * @param {Object}  state        Editor state.
6791   * @param {string}  clientId     Block client ID.
6792   * @param {?string} rootClientId Optional root client ID of block list.
6793   *
6794   * @return {number} Index at which block exists in order.
6795   */
6796  
6797  function selectors_getBlockIndex(state, clientId, rootClientId) {
6798    return selectors_getBlockOrder(state, rootClientId).indexOf(clientId);
6799  }
6800  /**
6801   * Returns true if the block corresponding to the specified client ID is
6802   * currently selected and no multi-selection exists, or false otherwise.
6803   *
6804   * @param {Object} state    Editor state.
6805   * @param {string} clientId Block client ID.
6806   *
6807   * @return {boolean} Whether block is selected and multi-selection exists.
6808   */
6809  
6810  function selectors_isBlockSelected(state, clientId) {
6811    var _state$blockSelection7 = state.blockSelection,
6812        start = _state$blockSelection7.start,
6813        end = _state$blockSelection7.end;
6814  
6815    if (start !== end) {
6816      return false;
6817    }
6818  
6819    return start === clientId;
6820  }
6821  /**
6822   * Returns true if one of the block's inner blocks is selected.
6823   *
6824   * @param {Object}  state    Editor state.
6825   * @param {string}  clientId Block client ID.
6826   * @param {boolean} deep     Perform a deep check.
6827   *
6828   * @return {boolean} Whether the block as an inner block selected
6829   */
6830  
6831  function selectors_hasSelectedInnerBlock(state, clientId) {
6832    var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6833    return Object(external_lodash_["some"])(selectors_getBlockOrder(state, clientId), function (innerClientId) {
6834      return selectors_isBlockSelected(state, innerClientId) || selectors_isBlockMultiSelected(state, innerClientId) || deep && selectors_hasSelectedInnerBlock(state, innerClientId, deep);
6835    });
6836  }
6837  /**
6838   * Returns true if the block corresponding to the specified client ID is
6839   * currently selected but isn't the last of the selected blocks. Here "last"
6840   * refers to the block sequence in the document, _not_ the sequence of
6841   * multi-selection, which is why `state.blockSelection.end` isn't used.
6842   *
6843   * @param {Object} state    Editor state.
6844   * @param {string} clientId Block client ID.
6845   *
6846   * @return {boolean} Whether block is selected and not the last in the
6847   *                   selection.
6848   */
6849  
6850  function isBlockWithinSelection(state, clientId) {
6851    if (!clientId) {
6852      return false;
6853    }
6854  
6855    var clientIds = selectors_getMultiSelectedBlockClientIds(state);
6856    var index = clientIds.indexOf(clientId);
6857    return index > -1 && index < clientIds.length - 1;
6858  }
6859  /**
6860   * Returns true if a multi-selection has been made, or false otherwise.
6861   *
6862   * @param {Object} state Editor state.
6863   *
6864   * @return {boolean} Whether multi-selection has been made.
6865   */
6866  
6867  function selectors_hasMultiSelection(state) {
6868    var _state$blockSelection8 = state.blockSelection,
6869        start = _state$blockSelection8.start,
6870        end = _state$blockSelection8.end;
6871    return start !== end;
6872  }
6873  /**
6874   * Whether in the process of multi-selecting or not. This flag is only true
6875   * while the multi-selection is being selected (by mouse move), and is false
6876   * once the multi-selection has been settled.
6877   *
6878   * @see hasMultiSelection
6879   *
6880   * @param {Object} state Global application state.
6881   *
6882   * @return {boolean} True if multi-selecting, false if not.
6883   */
6884  
6885  function selectors_isMultiSelecting(state) {
6886    return state.blockSelection.isMultiSelecting;
6887  }
6888  /**
6889   * Selector that returns if multi-selection is enabled or not.
6890   *
6891   * @param {Object} state Global application state.
6892   *
6893   * @return {boolean} True if it should be possible to multi-select blocks, false if multi-selection is disabled.
6894   */
6895  
6896  function selectors_isSelectionEnabled(state) {
6897    return state.blockSelection.isEnabled;
6898  }
6899  /**
6900   * Returns the block's editing mode, defaulting to "visual" if not explicitly
6901   * assigned.
6902   *
6903   * @param {Object} state    Editor state.
6904   * @param {string} clientId Block client ID.
6905   *
6906   * @return {Object} Block editing mode.
6907   */
6908  
6909  function selectors_getBlockMode(state, clientId) {
6910    return state.blocksMode[clientId] || 'visual';
6911  }
6912  /**
6913   * Returns true if the user is typing, or false otherwise.
6914   *
6915   * @param {Object} state Global application state.
6916   *
6917   * @return {boolean} Whether user is typing.
6918   */
6919  
6920  function selectors_isTyping(state) {
6921    return state.isTyping;
6922  }
6923  /**
6924   * Returns true if the caret is within formatted text, or false otherwise.
6925   *
6926   * @param {Object} state Global application state.
6927   *
6928   * @return {boolean} Whether the caret is within formatted text.
6929   */
6930  
6931  function selectors_isCaretWithinFormattedText(state) {
6932    return state.isCaretWithinFormattedText;
6933  }
6934  /**
6935   * Returns the insertion point, the index at which the new inserted block would
6936   * be placed. Defaults to the last index.
6937   *
6938   * @param {Object} state Editor state.
6939   *
6940   * @return {Object} Insertion point object with `rootClientId`, `index`.
6941   */
6942  
6943  function getBlockInsertionPoint(state) {
6944    var rootClientId, index;
6945    var insertionPoint = state.insertionPoint,
6946        blockSelection = state.blockSelection;
6947  
6948    if (insertionPoint !== null) {
6949      return insertionPoint;
6950    }
6951  
6952    var end = blockSelection.end;
6953  
6954    if (end) {
6955      rootClientId = selectors_getBlockRootClientId(state, end) || undefined;
6956      index = selectors_getBlockIndex(state, end, rootClientId) + 1;
6957    } else {
6958      index = selectors_getBlockOrder(state).length;
6959    }
6960  
6961    return {
6962      rootClientId: rootClientId,
6963      index: index
6964    };
6965  }
6966  /**
6967   * Returns true if we should show the block insertion point.
6968   *
6969   * @param {Object} state Global application state.
6970   *
6971   * @return {?boolean} Whether the insertion point is visible or not.
6972   */
6973  
6974  function isBlockInsertionPointVisible(state) {
6975    return state.insertionPoint !== null;
6976  }
6977  /**
6978   * Returns whether the blocks matches the template or not.
6979   *
6980   * @param {boolean} state
6981   * @return {?boolean} Whether the template is valid or not.
6982   */
6983  
6984  function isValidTemplate(state) {
6985    return state.template.isValid;
6986  }
6987  /**
6988   * Returns the defined block template
6989   *
6990   * @param {boolean} state
6991   * @return {?Array}        Block Template
6992   */
6993  
6994  function getTemplate(state) {
6995    return state.settings.template;
6996  }
6997  /**
6998   * Returns the defined block template lock. Optionally accepts a root block
6999   * client ID as context, otherwise defaulting to the global context.
7000   *
7001   * @param {Object}  state        Editor state.
7002   * @param {?string} rootClientId Optional block root client ID.
7003   *
7004   * @return {?string} Block Template Lock
7005   */
7006  
7007  function selectors_getTemplateLock(state, rootClientId) {
7008    if (!rootClientId) {
7009      return state.settings.templateLock;
7010    }
7011  
7012    var blockListSettings = getBlockListSettings(state, rootClientId);
7013  
7014    if (!blockListSettings) {
7015      return null;
7016    }
7017  
7018    return blockListSettings.templateLock;
7019  }
7020  /**
7021   * Determines if the given block type is allowed to be inserted into the block list.
7022   * This function is not exported and not memoized because using a memoized selector
7023   * inside another memoized selector is just a waste of time.
7024   *
7025   * @param {Object}  state        Editor state.
7026   * @param {string}  blockName    The name of the block type, e.g.' core/paragraph'.
7027   * @param {?string} rootClientId Optional root client ID of block list.
7028   *
7029   * @return {boolean} Whether the given block type is allowed to be inserted.
7030   */
7031  
7032  var selectors_canInsertBlockTypeUnmemoized = function canInsertBlockTypeUnmemoized(state, blockName) {
7033    var rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
7034  
7035    var checkAllowList = function checkAllowList(list, item) {
7036      var defaultResult = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
7037  
7038      if (Object(external_lodash_["isBoolean"])(list)) {
7039        return list;
7040      }
7041  
7042      if (Object(external_lodash_["isArray"])(list)) {
7043        return Object(external_lodash_["includes"])(list, item);
7044      }
7045  
7046      return defaultResult;
7047    };
7048  
7049    var blockType = Object(external_this_wp_blocks_["getBlockType"])(blockName);
7050  
7051    if (!blockType) {
7052      return false;
7053    }
7054  
7055    var _getSettings = selectors_getSettings(state),
7056        allowedBlockTypes = _getSettings.allowedBlockTypes;
7057  
7058    var isBlockAllowedInEditor = checkAllowList(allowedBlockTypes, blockName, true);
7059  
7060    if (!isBlockAllowedInEditor) {
7061      return false;
7062    }
7063  
7064    var isLocked = !!selectors_getTemplateLock(state, rootClientId);
7065  
7066    if (isLocked) {
7067      return false;
7068    }
7069  
7070    var parentBlockListSettings = getBlockListSettings(state, rootClientId);
7071    var parentAllowedBlocks = Object(external_lodash_["get"])(parentBlockListSettings, ['allowedBlocks']);
7072    var hasParentAllowedBlock = checkAllowList(parentAllowedBlocks, blockName);
7073    var blockAllowedParentBlocks = blockType.parent;
7074    var parentName = selectors_getBlockName(state, rootClientId);
7075    var hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName);
7076  
7077    if (hasParentAllowedBlock !== null && hasBlockAllowedParent !== null) {
7078      return hasParentAllowedBlock || hasBlockAllowedParent;
7079    } else if (hasParentAllowedBlock !== null) {
7080      return hasParentAllowedBlock;
7081    } else if (hasBlockAllowedParent !== null) {
7082      return hasBlockAllowedParent;
7083    }
7084  
7085    return true;
7086  };
7087  /**
7088   * Determines if the given block type is allowed to be inserted into the block list.
7089   *
7090   * @param {Object}  state        Editor state.
7091   * @param {string}  blockName    The name of the block type, e.g.' core/paragraph'.
7092   * @param {?string} rootClientId Optional root client ID of block list.
7093   *
7094   * @return {boolean} Whether the given block type is allowed to be inserted.
7095   */
7096  
7097  
7098  var selectors_canInsertBlockType = Object(rememo["a" /* default */])(selectors_canInsertBlockTypeUnmemoized, function (state, blockName, rootClientId) {
7099    return [state.blockListSettings[rootClientId], state.blocks.byClientId[rootClientId], state.settings.allowedBlockTypes, state.settings.templateLock];
7100  });
7101  /**
7102   * Returns information about how recently and frequently a block has been inserted.
7103   *
7104   * @param {Object} state Global application state.
7105   * @param {string} id    A string which identifies the insert, e.g. 'core/block/12'
7106   *
7107   * @return {?{ time: number, count: number }} An object containing `time` which is when the last
7108   *                                            insert occurred as a UNIX epoch, and `count` which is
7109   *                                            the number of inserts that have occurred.
7110   */
7111  
7112  function getInsertUsage(state, id) {
7113    return state.preferences.insertUsage[id] || null;
7114  }
7115  /**
7116   * Returns whether we can show a block type in the inserter
7117   *
7118   * @param {Object} state Global State
7119   * @param {Object} blockType BlockType
7120   * @param {?string} rootClientId Optional root client ID of block list.
7121   *