this["wp"] = this["wp"] || {}; this["wp"]["apiFetch"] =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "jqrR");
/************************************************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _objectWithoutProperties; });
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var sourceKeys = Object.keys(source);
for (i = 0; i < sourceKeys.length; i++) {
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
var info = gen[key](arg);
Promise.resolve(value).then(_next, _throw);
function _asyncToGenerator(fn) {
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["url"]; }());
/***/ (function(module, exports) {
(function() { module.exports = window["regeneratorRuntime"]; }());
/***/ (function(module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__("rePB");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
var objectWithoutProperties = __webpack_require__("Ff2n");
// EXTERNAL MODULE: external ["wp","i18n"]
var external_wp_i18n_ = __webpack_require__("l3Sj");
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js
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; }
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; }
function createNonceMiddleware(nonce) {
function middleware(options, next) {
var _options$headers = options.headers,
headers = _options$headers === void 0 ? {} : _options$headers; // If an 'X-WP-Nonce' header (or any case-insensitive variation
// thereof) was specified, no need to add a nonce header.
for (var headerName in headers) {
if (headerName.toLowerCase() === 'x-wp-nonce' && headers[headerName] === middleware.nonce) {
return next(_objectSpread(_objectSpread({}, options), {}, {
headers: _objectSpread(_objectSpread({}, headers), {}, {
'X-WP-Nonce': middleware.nonce
middleware.nonce = nonce;
/* harmony default export */ var nonce = (createNonceMiddleware);
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js
function namespace_endpoint_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; }
function namespace_endpoint_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { namespace_endpoint_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 { namespace_endpoint_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var namespaceAndEndpointMiddleware = function namespaceAndEndpointMiddleware(options, next) {
var namespaceTrimmed, endpointTrimmed;
if (typeof options.namespace === 'string' && typeof options.endpoint === 'string') {
namespaceTrimmed = options.namespace.replace(/^\/|\/$/g, '');
endpointTrimmed = options.endpoint.replace(/^\//, '');
path = namespaceTrimmed + '/' + endpointTrimmed;
delete options.namespace;
return next(namespace_endpoint_objectSpread(namespace_endpoint_objectSpread({}, options), {}, {
/* harmony default export */ var namespace_endpoint = (namespaceAndEndpointMiddleware);
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js
function root_url_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; }
function root_url_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { root_url_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 { root_url_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var root_url_createRootURLMiddleware = function createRootURLMiddleware(rootURL) {
return function (options, next) {
return namespace_endpoint(options, function (optionsWithPath) {
var url = optionsWithPath.url;
var path = optionsWithPath.path;
if (typeof path === 'string') {
if (-1 !== rootURL.indexOf('?')) {
path = path.replace('?', '&');
path = path.replace(/^\//, ''); // API root may already include query parameter prefix if site is
// configured to use plain permalinks.
if ('string' === typeof apiRoot && -1 !== apiRoot.indexOf('?')) {
path = path.replace('?', '&');
return next(root_url_objectSpread(root_url_objectSpread({}, optionsWithPath), {}, {
/* harmony default export */ var root_url = (root_url_createRootURLMiddleware);
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js
* Given a path, returns a normalized path where equal query parameter values
* will be treated as identical, regardless of order they appear in the original
* @param {string} path Original path.
* @return {string} Normalized path.
function getStablePath(path) {
var splitted = path.split('?');
return base + '?' + query // [ 'b=1', 'c=2', 'a=5' ]
.split('&') // [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]
}) // [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]
return a[0].localeCompare(b[0]);
}) // [ 'a=5', 'b=1', 'c=2' ]
function createPreloadingMiddleware(preloadedData) {
var cache = Object.keys(preloadedData).reduce(function (result, path) {
result[getStablePath(path)] = preloadedData[path];
return function (options, next) {
var _options$parse = options.parse,
parse = _options$parse === void 0 ? true : _options$parse;
if (typeof options.path === 'string') {
var method = options.method || 'GET';
var path = getStablePath(options.path);
if ('GET' === method && cache[path]) {
var cacheData = cache[path]; // Unsetting the cache key ensures that the data is only preloaded a single time
return Promise.resolve(parse ? cacheData.body : new window.Response(JSON.stringify(cacheData.body), {
headers: cacheData.headers
} else if ('OPTIONS' === method && cache[method] && cache[method][path]) {
return Promise.resolve(cache[method][path]);
/* harmony default export */ var preloading = (createPreloadingMiddleware);
// EXTERNAL MODULE: external "regeneratorRuntime"
var external_regeneratorRuntime_ = __webpack_require__("dvlR");
var external_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_regeneratorRuntime_);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("HaE+");
// EXTERNAL MODULE: external ["wp","url"]
var external_wp_url_ = __webpack_require__("Mmq9");
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js
function fetch_all_middleware_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; }
function fetch_all_middleware_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { fetch_all_middleware_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 { fetch_all_middleware_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
// Apply query arguments to both URL and Path, whichever is present.
var fetch_all_middleware_modifyQuery = function modifyQuery(_ref, queryArgs) {
options = Object(objectWithoutProperties["a" /* default */])(_ref, ["path", "url"]);
return fetch_all_middleware_objectSpread(fetch_all_middleware_objectSpread({}, options), {}, {
url: url && Object(external_wp_url_["addQueryArgs"])(url, queryArgs),
path: path && Object(external_wp_url_["addQueryArgs"])(path, queryArgs)
}; // Duplicates parsing functionality from apiFetch.
var parseResponse = function parseResponse(response) {
return response.json ? response.json() : Promise.reject(response);
var parseLinkHeader = function parseLinkHeader(linkHeader) {
var match = linkHeader.match(/<([^>]+)>; rel="next"/);
var getNextPageUrl = function getNextPageUrl(response) {
var _parseLinkHeader = parseLinkHeader(response.headers.get('link')),
next = _parseLinkHeader.next;
var requestContainsUnboundedQuery = function requestContainsUnboundedQuery(options) {
var pathIsUnbounded = options.path && options.path.indexOf('per_page=-1') !== -1;
var urlIsUnbounded = options.url && options.url.indexOf('per_page=-1') !== -1;
return pathIsUnbounded || urlIsUnbounded;
}; // The REST API enforces an upper limit on the per_page option. To handle large
// collections, apiFetch consumers can pass `per_page=-1`; this middleware will
// then recursively assemble a full response array from all available pages.
var fetchAllMiddleware = /*#__PURE__*/function () {
var _ref2 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_regeneratorRuntime_default.a.mark(function _callee(options, next) {
var response, results, nextPage, mergedResults, nextResponse, nextResults;
return external_regeneratorRuntime_default.a.wrap(function _callee$(_context) {
switch (_context.prev = _context.next) {
if (!(options.parse === false)) {
return _context.abrupt("return", next(options));
if (requestContainsUnboundedQuery(options)) {
return _context.abrupt("return", next(options));
return build_module(fetch_all_middleware_objectSpread(fetch_all_middleware_objectSpread({}, fetch_all_middleware_modifyQuery(options, {
// Ensure headers are returned for page 1.
response = _context.sent;
return parseResponse(response);
if (Array.isArray(results)) {