[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> server-side-render.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["serverSideRender"] =
   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 = 487);
  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  /***/ 14:
 105  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 106  
 107  "use strict";
 108  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
 109  /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43);
 110  
 111  function _objectWithoutProperties(source, excluded) {
 112    if (source == null) return {};
 113    var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
 114    var key, i;
 115  
 116    if (Object.getOwnPropertySymbols) {
 117      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
 118  
 119      for (i = 0; i < sourceSymbolKeys.length; i++) {
 120        key = sourceSymbolKeys[i];
 121        if (excluded.indexOf(key) >= 0) continue;
 122        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
 123        target[key] = source[key];
 124      }
 125    }
 126  
 127    return target;
 128  }
 129  
 130  /***/ }),
 131  
 132  /***/ 16:
 133  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 134  
 135  "use strict";
 136  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
 137  function _assertThisInitialized(self) {
 138    if (self === void 0) {
 139      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
 140    }
 141  
 142    return self;
 143  }
 144  
 145  /***/ }),
 146  
 147  /***/ 19:
 148  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 149  
 150  "use strict";
 151  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
 152  function _getPrototypeOf(o) {
 153    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
 154      return o.__proto__ || Object.getPrototypeOf(o);
 155    };
 156    return _getPrototypeOf(o);
 157  }
 158  
 159  /***/ }),
 160  
 161  /***/ 2:
 162  /***/ (function(module, exports) {
 163  
 164  (function() { module.exports = this["lodash"]; }());
 165  
 166  /***/ }),
 167  
 168  /***/ 21:
 169  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 170  
 171  "use strict";
 172  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 173  function _classCallCheck(instance, Constructor) {
 174    if (!(instance instanceof Constructor)) {
 175      throw new TypeError("Cannot call a class as a function");
 176    }
 177  }
 178  
 179  /***/ }),
 180  
 181  /***/ 22:
 182  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 183  
 184  "use strict";
 185  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 186  function _defineProperties(target, props) {
 187    for (var i = 0; i < props.length; i++) {
 188      var descriptor = props[i];
 189      descriptor.enumerable = descriptor.enumerable || false;
 190      descriptor.configurable = true;
 191      if ("value" in descriptor) descriptor.writable = true;
 192      Object.defineProperty(target, descriptor.key, descriptor);
 193    }
 194  }
 195  
 196  function _createClass(Constructor, protoProps, staticProps) {
 197    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 198    if (staticProps) _defineProperties(Constructor, staticProps);
 199    return Constructor;
 200  }
 201  
 202  /***/ }),
 203  
 204  /***/ 23:
 205  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 206  
 207  "use strict";
 208  
 209  // EXPORTS
 210  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _inherits; });
 211  
 212  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
 213  function _setPrototypeOf(o, p) {
 214    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
 215      o.__proto__ = p;
 216      return o;
 217    };
 218  
 219    return _setPrototypeOf(o, p);
 220  }
 221  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
 222  
 223  function _inherits(subClass, superClass) {
 224    if (typeof superClass !== "function" && superClass !== null) {
 225      throw new TypeError("Super expression must either be null or a function");
 226    }
 227  
 228    subClass.prototype = Object.create(superClass && superClass.prototype, {
 229      constructor: {
 230        value: subClass,
 231        writable: true,
 232        configurable: true
 233      }
 234    });
 235    if (superClass) _setPrototypeOf(subClass, superClass);
 236  }
 237  
 238  /***/ }),
 239  
 240  /***/ 24:
 241  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 242  
 243  "use strict";
 244  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
 245  /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40);
 246  /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
 247  
 248  
 249  function _possibleConstructorReturn(self, call) {
 250    if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
 251      return call;
 252    }
 253  
 254    return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
 255  }
 256  
 257  /***/ }),
 258  
 259  /***/ 3:
 260  /***/ (function(module, exports) {
 261  
 262  (function() { module.exports = this["wp"]["components"]; }());
 263  
 264  /***/ }),
 265  
 266  /***/ 31:
 267  /***/ (function(module, exports) {
 268  
 269  (function() { module.exports = this["wp"]["url"]; }());
 270  
 271  /***/ }),
 272  
 273  /***/ 36:
 274  /***/ (function(module, exports) {
 275  
 276  (function() { module.exports = this["wp"]["deprecated"]; }());
 277  
 278  /***/ }),
 279  
 280  /***/ 4:
 281  /***/ (function(module, exports) {
 282  
 283  (function() { module.exports = this["wp"]["data"]; }());
 284  
 285  /***/ }),
 286  
 287  /***/ 40:
 288  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 289  
 290  "use strict";
 291  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
 292  function _typeof(obj) {
 293    "@babel/helpers - typeof";
 294  
 295    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
 296      _typeof = function _typeof(obj) {
 297        return typeof obj;
 298      };
 299    } else {
 300      _typeof = function _typeof(obj) {
 301        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
 302      };
 303    }
 304  
 305    return _typeof(obj);
 306  }
 307  
 308  /***/ }),
 309  
 310  /***/ 43:
 311  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 312  
 313  "use strict";
 314  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
 315  function _objectWithoutPropertiesLoose(source, excluded) {
 316    if (source == null) return {};
 317    var target = {};
 318    var sourceKeys = Object.keys(source);
 319    var key, i;
 320  
 321    for (i = 0; i < sourceKeys.length; i++) {
 322      key = sourceKeys[i];
 323      if (excluded.indexOf(key) >= 0) continue;
 324      target[key] = source[key];
 325    }
 326  
 327    return target;
 328  }
 329  
 330  /***/ }),
 331  
 332  /***/ 47:
 333  /***/ (function(module, exports) {
 334  
 335  (function() { module.exports = this["wp"]["apiFetch"]; }());
 336  
 337  /***/ }),
 338  
 339  /***/ 487:
 340  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 341  
 342  "use strict";
 343  // ESM COMPAT FLAG
 344  __webpack_require__.r(__webpack_exports__);
 345  
 346  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
 347  var esm_extends = __webpack_require__(8);
 348  
 349  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 350  var defineProperty = __webpack_require__(5);
 351  
 352  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
 353  var objectWithoutProperties = __webpack_require__(14);
 354  
 355  // EXTERNAL MODULE: external {"this":["wp","element"]}
 356  var external_this_wp_element_ = __webpack_require__(0);
 357  
 358  // EXTERNAL MODULE: external {"this":["wp","data"]}
 359  var external_this_wp_data_ = __webpack_require__(4);
 360  
 361  // EXTERNAL MODULE: external {"this":["wp","deprecated"]}
 362  var external_this_wp_deprecated_ = __webpack_require__(36);
 363  var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_);
 364  
 365  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
 366  var classCallCheck = __webpack_require__(21);
 367  
 368  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
 369  var createClass = __webpack_require__(22);
 370  
 371  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
 372  var inherits = __webpack_require__(23);
 373  
 374  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
 375  var possibleConstructorReturn = __webpack_require__(24);
 376  
 377  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
 378  var getPrototypeOf = __webpack_require__(19);
 379  
 380  // EXTERNAL MODULE: external {"this":"lodash"}
 381  var external_this_lodash_ = __webpack_require__(2);
 382  
 383  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
 384  var external_this_wp_i18n_ = __webpack_require__(1);
 385  
 386  // EXTERNAL MODULE: external {"this":["wp","apiFetch"]}
 387  var external_this_wp_apiFetch_ = __webpack_require__(47);
 388  var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_);
 389  
 390  // EXTERNAL MODULE: external {"this":["wp","url"]}
 391  var external_this_wp_url_ = __webpack_require__(31);
 392  
 393  // EXTERNAL MODULE: external {"this":["wp","components"]}
 394  var external_this_wp_components_ = __webpack_require__(3);
 395  
 396  // CONCATENATED MODULE: ./node_modules/@wordpress/server-side-render/build-module/server-side-render.js
 397  
 398  
 399  
 400  
 401  
 402  
 403  
 404  
 405  
 406  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
 407  
 408  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
 409  
 410  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
 411  
 412  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
 413  
 414  /**
 415   * External dependencies
 416   */
 417  
 418  /**
 419   * WordPress dependencies
 420   */
 421  
 422  
 423  
 424  
 425  
 426  
 427  function rendererPath(block) {
 428    var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
 429    var urlQueryArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
 430    return Object(external_this_wp_url_["addQueryArgs"])("/wp/v2/block-renderer/".concat(block), _objectSpread(_objectSpread({
 431      context: 'edit'
 432    }, null !== attributes ? {
 433      attributes: attributes
 434    } : {}), urlQueryArgs));
 435  }
 436  var server_side_render_ServerSideRender = /*#__PURE__*/function (_Component) {
 437    Object(inherits["a" /* default */])(ServerSideRender, _Component);
 438  
 439    var _super = _createSuper(ServerSideRender);
 440  
 441    function ServerSideRender(props) {
 442      var _this;
 443  
 444      Object(classCallCheck["a" /* default */])(this, ServerSideRender);
 445  
 446      _this = _super.call(this, props);
 447      _this.state = {
 448        response: null
 449      };
 450      return _this;
 451    }
 452  
 453    Object(createClass["a" /* default */])(ServerSideRender, [{
 454      key: "componentDidMount",
 455      value: function componentDidMount() {
 456        this.isStillMounted = true;
 457        this.fetch(this.props); // Only debounce once the initial fetch occurs to ensure that the first
 458        // renders show data as soon as possible.
 459  
 460        this.fetch = Object(external_this_lodash_["debounce"])(this.fetch, 500);
 461      }
 462    }, {
 463      key: "componentWillUnmount",
 464      value: function componentWillUnmount() {
 465        this.isStillMounted = false;
 466      }
 467    }, {
 468      key: "componentDidUpdate",
 469      value: function componentDidUpdate(prevProps) {
 470        if (!Object(external_this_lodash_["isEqual"])(prevProps, this.props)) {
 471          this.fetch(this.props);
 472        }
 473      }
 474    }, {
 475      key: "fetch",
 476      value: function fetch(props) {
 477        var _this2 = this;
 478  
 479        if (!this.isStillMounted) {
 480          return;
 481        }
 482  
 483        if (null !== this.state.response) {
 484          this.setState({
 485            response: null
 486          });
 487        }
 488  
 489        var block = props.block,
 490            _props$attributes = props.attributes,
 491            attributes = _props$attributes === void 0 ? null : _props$attributes,
 492            _props$httpMethod = props.httpMethod,
 493            httpMethod = _props$httpMethod === void 0 ? 'GET' : _props$httpMethod,
 494            _props$urlQueryArgs = props.urlQueryArgs,
 495            urlQueryArgs = _props$urlQueryArgs === void 0 ? {} : _props$urlQueryArgs; // If httpMethod is 'POST', send the attributes in the request body instead of the URL.
 496        // This allows sending a larger attributes object than in a GET request, where the attributes are in the URL.
 497  
 498        var isPostRequest = 'POST' === httpMethod;
 499        var urlAttributes = isPostRequest ? null : attributes;
 500        var path = rendererPath(block, urlAttributes, urlQueryArgs);
 501        var data = isPostRequest ? {
 502          attributes: attributes
 503        } : null; // Store the latest fetch request so that when we process it, we can
 504        // check if it is the current request, to avoid race conditions on slow networks.
 505  
 506        var fetchRequest = this.currentFetchRequest = external_this_wp_apiFetch_default()({
 507          path: path,
 508          data: data,
 509          method: isPostRequest ? 'POST' : 'GET'
 510        }).then(function (response) {
 511          if (_this2.isStillMounted && fetchRequest === _this2.currentFetchRequest && response) {
 512            _this2.setState({
 513              response: response.rendered
 514            });
 515          }
 516        }).catch(function (error) {
 517          if (_this2.isStillMounted && fetchRequest === _this2.currentFetchRequest) {
 518            _this2.setState({
 519              response: {
 520                error: true,
 521                errorMsg: error.message
 522              }
 523            });
 524          }
 525        });
 526        return fetchRequest;
 527      }
 528    }, {
 529      key: "render",
 530      value: function render() {
 531        var response = this.state.response;
 532        var _this$props = this.props,
 533            className = _this$props.className,
 534            EmptyResponsePlaceholder = _this$props.EmptyResponsePlaceholder,
 535            ErrorResponsePlaceholder = _this$props.ErrorResponsePlaceholder,
 536            LoadingResponsePlaceholder = _this$props.LoadingResponsePlaceholder;
 537  
 538        if (response === '') {
 539          return Object(external_this_wp_element_["createElement"])(EmptyResponsePlaceholder, Object(esm_extends["a" /* default */])({
 540            response: response
 541          }, this.props));
 542        } else if (!response) {
 543          return Object(external_this_wp_element_["createElement"])(LoadingResponsePlaceholder, Object(esm_extends["a" /* default */])({
 544            response: response
 545          }, this.props));
 546        } else if (response.error) {
 547          return Object(external_this_wp_element_["createElement"])(ErrorResponsePlaceholder, Object(esm_extends["a" /* default */])({
 548            response: response
 549          }, this.props));
 550        }
 551  
 552        return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["RawHTML"], {
 553          key: "html",
 554          className: className
 555        }, response);
 556      }
 557    }]);
 558  
 559    return ServerSideRender;
 560  }(external_this_wp_element_["Component"]);
 561  server_side_render_ServerSideRender.defaultProps = {
 562    EmptyResponsePlaceholder: function EmptyResponsePlaceholder(_ref) {
 563      var className = _ref.className;
 564      return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Placeholder"], {
 565        className: className
 566      }, Object(external_this_wp_i18n_["__"])('Block rendered as empty.'));
 567    },
 568    ErrorResponsePlaceholder: function ErrorResponsePlaceholder(_ref2) {
 569      var response = _ref2.response,
 570          className = _ref2.className;
 571      var errorMessage = Object(external_this_wp_i18n_["sprintf"])( // translators: %s: error message describing the problem
 572      Object(external_this_wp_i18n_["__"])('Error loading block: %s'), response.errorMsg);
 573      return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Placeholder"], {
 574        className: className
 575      }, errorMessage);
 576    },
 577    LoadingResponsePlaceholder: function LoadingResponsePlaceholder(_ref3) {
 578      var className = _ref3.className;
 579      return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Placeholder"], {
 580        className: className
 581      }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Spinner"], null));
 582    }
 583  };
 584  /* harmony default export */ var server_side_render = (server_side_render_ServerSideRender);
 585  
 586  // CONCATENATED MODULE: ./node_modules/@wordpress/server-side-render/build-module/index.js
 587  
 588  
 589  
 590  
 591  
 592  function build_module_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
 593  
 594  function build_module_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { build_module_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { build_module_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
 595  
 596  /**
 597   * WordPress dependencies
 598   */
 599  
 600  
 601  
 602  /**
 603   * Internal dependencies
 604   */
 605  
 606  
 607  /**
 608   * Constants
 609   */
 610  
 611  var EMPTY_OBJECT = {};
 612  var ExportedServerSideRender = Object(external_this_wp_data_["withSelect"])(function (select) {
 613    var coreEditorSelect = select('core/editor');
 614  
 615    if (coreEditorSelect) {
 616      var currentPostId = coreEditorSelect.getCurrentPostId();
 617  
 618      if (currentPostId) {
 619        return {
 620          currentPostId: currentPostId
 621        };
 622      }
 623    }
 624  
 625    return EMPTY_OBJECT;
 626  })(function (_ref) {
 627    var _ref$urlQueryArgs = _ref.urlQueryArgs,
 628        urlQueryArgs = _ref$urlQueryArgs === void 0 ? EMPTY_OBJECT : _ref$urlQueryArgs,
 629        currentPostId = _ref.currentPostId,
 630        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["urlQueryArgs", "currentPostId"]);
 631  
 632    var newUrlQueryArgs = Object(external_this_wp_element_["useMemo"])(function () {
 633      if (!currentPostId) {
 634        return urlQueryArgs;
 635      }
 636  
 637      return build_module_objectSpread({
 638        post_id: currentPostId
 639      }, urlQueryArgs);
 640    }, [currentPostId, urlQueryArgs]);
 641    return Object(external_this_wp_element_["createElement"])(server_side_render, Object(esm_extends["a" /* default */])({
 642      urlQueryArgs: newUrlQueryArgs
 643    }, props));
 644  });
 645  
 646  if (window && window.wp && window.wp.components) {
 647    window.wp.components.ServerSideRender = Object(external_this_wp_element_["forwardRef"])(function (props, ref) {
 648      external_this_wp_deprecated_default()('wp.components.ServerSideRender', {
 649        alternative: 'wp.serverSideRender'
 650      });
 651      return Object(external_this_wp_element_["createElement"])(ExportedServerSideRender, Object(esm_extends["a" /* default */])({}, props, {
 652        ref: ref
 653      }));
 654    });
 655  }
 656  
 657  /* harmony default export */ var build_module = __webpack_exports__["default"] = (ExportedServerSideRender);
 658  
 659  
 660  /***/ }),
 661  
 662  /***/ 5:
 663  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 664  
 665  "use strict";
 666  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
 667  function _defineProperty(obj, key, value) {
 668    if (key in obj) {
 669      Object.defineProperty(obj, key, {
 670        value: value,
 671        enumerable: true,
 672        configurable: true,
 673        writable: true
 674      });
 675    } else {
 676      obj[key] = value;
 677    }
 678  
 679    return obj;
 680  }
 681  
 682  /***/ }),
 683  
 684  /***/ 8:
 685  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 686  
 687  "use strict";
 688  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
 689  function _extends() {
 690    _extends = Object.assign || function (target) {
 691      for (var i = 1; i < arguments.length; i++) {
 692        var source = arguments[i];
 693  
 694        for (var key in source) {
 695          if (Object.prototype.hasOwnProperty.call(source, key)) {
 696            target[key] = source[key];
 697          }
 698        }
 699      }
 700  
 701      return target;
 702    };
 703  
 704    return _extends.apply(this, arguments);
 705  }
 706  
 707  /***/ })
 708  
 709  /******/ })["default"];


Generated: Sat Nov 28 01:00:03 2020 Cross-referenced by PHPXref 0.7.1