Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/dist
File: api-fetch.js
this["wp"] = this["wp"] || {}; this["wp"]["apiFetch"] =
[0] Fix | Delete
/******/ (function(modules) { // webpackBootstrap
[1] Fix | Delete
/******/ // The module cache
[2] Fix | Delete
/******/ var installedModules = {};
[3] Fix | Delete
/******/
[4] Fix | Delete
/******/ // The require function
[5] Fix | Delete
/******/ function __webpack_require__(moduleId) {
[6] Fix | Delete
/******/
[7] Fix | Delete
/******/ // Check if module is in cache
[8] Fix | Delete
/******/ if(installedModules[moduleId]) {
[9] Fix | Delete
/******/ return installedModules[moduleId].exports;
[10] Fix | Delete
/******/ }
[11] Fix | Delete
/******/ // Create a new module (and put it into the cache)
[12] Fix | Delete
/******/ var module = installedModules[moduleId] = {
[13] Fix | Delete
/******/ i: moduleId,
[14] Fix | Delete
/******/ l: false,
[15] Fix | Delete
/******/ exports: {}
[16] Fix | Delete
/******/ };
[17] Fix | Delete
/******/
[18] Fix | Delete
/******/ // Execute the module function
[19] Fix | Delete
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
[20] Fix | Delete
/******/
[21] Fix | Delete
/******/ // Flag the module as loaded
[22] Fix | Delete
/******/ module.l = true;
[23] Fix | Delete
/******/
[24] Fix | Delete
/******/ // Return the exports of the module
[25] Fix | Delete
/******/ return module.exports;
[26] Fix | Delete
/******/ }
[27] Fix | Delete
/******/
[28] Fix | Delete
/******/
[29] Fix | Delete
/******/ // expose the modules object (__webpack_modules__)
[30] Fix | Delete
/******/ __webpack_require__.m = modules;
[31] Fix | Delete
/******/
[32] Fix | Delete
/******/ // expose the module cache
[33] Fix | Delete
/******/ __webpack_require__.c = installedModules;
[34] Fix | Delete
/******/
[35] Fix | Delete
/******/ // define getter function for harmony exports
[36] Fix | Delete
/******/ __webpack_require__.d = function(exports, name, getter) {
[37] Fix | Delete
/******/ if(!__webpack_require__.o(exports, name)) {
[38] Fix | Delete
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
[39] Fix | Delete
/******/ }
[40] Fix | Delete
/******/ };
[41] Fix | Delete
/******/
[42] Fix | Delete
/******/ // define __esModule on exports
[43] Fix | Delete
/******/ __webpack_require__.r = function(exports) {
[44] Fix | Delete
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
[45] Fix | Delete
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
[46] Fix | Delete
/******/ }
[47] Fix | Delete
/******/ Object.defineProperty(exports, '__esModule', { value: true });
[48] Fix | Delete
/******/ };
[49] Fix | Delete
/******/
[50] Fix | Delete
/******/ // create a fake namespace object
[51] Fix | Delete
/******/ // mode & 1: value is a module id, require it
[52] Fix | Delete
/******/ // mode & 2: merge all properties of value into the ns
[53] Fix | Delete
/******/ // mode & 4: return value when already ns object
[54] Fix | Delete
/******/ // mode & 8|1: behave like require
[55] Fix | Delete
/******/ __webpack_require__.t = function(value, mode) {
[56] Fix | Delete
/******/ if(mode & 1) value = __webpack_require__(value);
[57] Fix | Delete
/******/ if(mode & 8) return value;
[58] Fix | Delete
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
[59] Fix | Delete
/******/ var ns = Object.create(null);
[60] Fix | Delete
/******/ __webpack_require__.r(ns);
[61] Fix | Delete
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
[62] Fix | Delete
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
[63] Fix | Delete
/******/ return ns;
[64] Fix | Delete
/******/ };
[65] Fix | Delete
/******/
[66] Fix | Delete
/******/ // getDefaultExport function for compatibility with non-harmony modules
[67] Fix | Delete
/******/ __webpack_require__.n = function(module) {
[68] Fix | Delete
/******/ var getter = module && module.__esModule ?
[69] Fix | Delete
/******/ function getDefault() { return module['default']; } :
[70] Fix | Delete
/******/ function getModuleExports() { return module; };
[71] Fix | Delete
/******/ __webpack_require__.d(getter, 'a', getter);
[72] Fix | Delete
/******/ return getter;
[73] Fix | Delete
/******/ };
[74] Fix | Delete
/******/
[75] Fix | Delete
/******/ // Object.prototype.hasOwnProperty.call
[76] Fix | Delete
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
[77] Fix | Delete
/******/
[78] Fix | Delete
/******/ // __webpack_public_path__
[79] Fix | Delete
/******/ __webpack_require__.p = "";
[80] Fix | Delete
/******/
[81] Fix | Delete
/******/
[82] Fix | Delete
/******/ // Load entry module and return exports
[83] Fix | Delete
/******/ return __webpack_require__(__webpack_require__.s = "jqrR");
[84] Fix | Delete
/******/ })
[85] Fix | Delete
/************************************************************************/
[86] Fix | Delete
/******/ ({
[87] Fix | Delete
[88] Fix | Delete
/***/ "Ff2n":
[89] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[90] Fix | Delete
[91] Fix | Delete
"use strict";
[92] Fix | Delete
[93] Fix | Delete
// EXPORTS
[94] Fix | Delete
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _objectWithoutProperties; });
[95] Fix | Delete
[96] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
[97] Fix | Delete
function _objectWithoutPropertiesLoose(source, excluded) {
[98] Fix | Delete
if (source == null) return {};
[99] Fix | Delete
var target = {};
[100] Fix | Delete
var sourceKeys = Object.keys(source);
[101] Fix | Delete
var key, i;
[102] Fix | Delete
[103] Fix | Delete
for (i = 0; i < sourceKeys.length; i++) {
[104] Fix | Delete
key = sourceKeys[i];
[105] Fix | Delete
if (excluded.indexOf(key) >= 0) continue;
[106] Fix | Delete
target[key] = source[key];
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
return target;
[110] Fix | Delete
}
[111] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
[112] Fix | Delete
[113] Fix | Delete
function _objectWithoutProperties(source, excluded) {
[114] Fix | Delete
if (source == null) return {};
[115] Fix | Delete
var target = _objectWithoutPropertiesLoose(source, excluded);
[116] Fix | Delete
var key, i;
[117] Fix | Delete
[118] Fix | Delete
if (Object.getOwnPropertySymbols) {
[119] Fix | Delete
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
[120] Fix | Delete
[121] Fix | Delete
for (i = 0; i < sourceSymbolKeys.length; i++) {
[122] Fix | Delete
key = sourceSymbolKeys[i];
[123] Fix | Delete
if (excluded.indexOf(key) >= 0) continue;
[124] Fix | Delete
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
[125] Fix | Delete
target[key] = source[key];
[126] Fix | Delete
}
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
return target;
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
/***/ }),
[133] Fix | Delete
[134] Fix | Delete
/***/ "HaE+":
[135] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[136] Fix | Delete
[137] Fix | Delete
"use strict";
[138] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
[139] Fix | Delete
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
[140] Fix | Delete
try {
[141] Fix | Delete
var info = gen[key](arg);
[142] Fix | Delete
var value = info.value;
[143] Fix | Delete
} catch (error) {
[144] Fix | Delete
reject(error);
[145] Fix | Delete
return;
[146] Fix | Delete
}
[147] Fix | Delete
[148] Fix | Delete
if (info.done) {
[149] Fix | Delete
resolve(value);
[150] Fix | Delete
} else {
[151] Fix | Delete
Promise.resolve(value).then(_next, _throw);
[152] Fix | Delete
}
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
function _asyncToGenerator(fn) {
[156] Fix | Delete
return function () {
[157] Fix | Delete
var self = this,
[158] Fix | Delete
args = arguments;
[159] Fix | Delete
return new Promise(function (resolve, reject) {
[160] Fix | Delete
var gen = fn.apply(self, args);
[161] Fix | Delete
[162] Fix | Delete
function _next(value) {
[163] Fix | Delete
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
function _throw(err) {
[167] Fix | Delete
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
[168] Fix | Delete
}
[169] Fix | Delete
[170] Fix | Delete
_next(undefined);
[171] Fix | Delete
});
[172] Fix | Delete
};
[173] Fix | Delete
}
[174] Fix | Delete
[175] Fix | Delete
/***/ }),
[176] Fix | Delete
[177] Fix | Delete
/***/ "Mmq9":
[178] Fix | Delete
/***/ (function(module, exports) {
[179] Fix | Delete
[180] Fix | Delete
(function() { module.exports = window["wp"]["url"]; }());
[181] Fix | Delete
[182] Fix | Delete
/***/ }),
[183] Fix | Delete
[184] Fix | Delete
/***/ "dvlR":
[185] Fix | Delete
/***/ (function(module, exports) {
[186] Fix | Delete
[187] Fix | Delete
(function() { module.exports = window["regeneratorRuntime"]; }());
[188] Fix | Delete
[189] Fix | Delete
/***/ }),
[190] Fix | Delete
[191] Fix | Delete
/***/ "jqrR":
[192] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[193] Fix | Delete
[194] Fix | Delete
"use strict";
[195] Fix | Delete
// ESM COMPAT FLAG
[196] Fix | Delete
__webpack_require__.r(__webpack_exports__);
[197] Fix | Delete
[198] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
[199] Fix | Delete
var defineProperty = __webpack_require__("rePB");
[200] Fix | Delete
[201] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
[202] Fix | Delete
var objectWithoutProperties = __webpack_require__("Ff2n");
[203] Fix | Delete
[204] Fix | Delete
// EXTERNAL MODULE: external ["wp","i18n"]
[205] Fix | Delete
var external_wp_i18n_ = __webpack_require__("l3Sj");
[206] Fix | Delete
[207] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js
[208] Fix | Delete
[209] Fix | Delete
[210] Fix | Delete
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; }
[211] Fix | Delete
[212] Fix | Delete
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; }
[213] Fix | Delete
[214] Fix | Delete
function createNonceMiddleware(nonce) {
[215] Fix | Delete
function middleware(options, next) {
[216] Fix | Delete
var _options$headers = options.headers,
[217] Fix | Delete
headers = _options$headers === void 0 ? {} : _options$headers; // If an 'X-WP-Nonce' header (or any case-insensitive variation
[218] Fix | Delete
// thereof) was specified, no need to add a nonce header.
[219] Fix | Delete
[220] Fix | Delete
for (var headerName in headers) {
[221] Fix | Delete
if (headerName.toLowerCase() === 'x-wp-nonce' && headers[headerName] === middleware.nonce) {
[222] Fix | Delete
return next(options);
[223] Fix | Delete
}
[224] Fix | Delete
}
[225] Fix | Delete
[226] Fix | Delete
return next(_objectSpread(_objectSpread({}, options), {}, {
[227] Fix | Delete
headers: _objectSpread(_objectSpread({}, headers), {}, {
[228] Fix | Delete
'X-WP-Nonce': middleware.nonce
[229] Fix | Delete
})
[230] Fix | Delete
}));
[231] Fix | Delete
}
[232] Fix | Delete
[233] Fix | Delete
middleware.nonce = nonce;
[234] Fix | Delete
return middleware;
[235] Fix | Delete
}
[236] Fix | Delete
[237] Fix | Delete
/* harmony default export */ var nonce = (createNonceMiddleware);
[238] Fix | Delete
[239] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js
[240] Fix | Delete
[241] Fix | Delete
[242] Fix | Delete
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; }
[243] Fix | Delete
[244] Fix | Delete
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; }
[245] Fix | Delete
[246] Fix | Delete
var namespaceAndEndpointMiddleware = function namespaceAndEndpointMiddleware(options, next) {
[247] Fix | Delete
var path = options.path;
[248] Fix | Delete
var namespaceTrimmed, endpointTrimmed;
[249] Fix | Delete
[250] Fix | Delete
if (typeof options.namespace === 'string' && typeof options.endpoint === 'string') {
[251] Fix | Delete
namespaceTrimmed = options.namespace.replace(/^\/|\/$/g, '');
[252] Fix | Delete
endpointTrimmed = options.endpoint.replace(/^\//, '');
[253] Fix | Delete
[254] Fix | Delete
if (endpointTrimmed) {
[255] Fix | Delete
path = namespaceTrimmed + '/' + endpointTrimmed;
[256] Fix | Delete
} else {
[257] Fix | Delete
path = namespaceTrimmed;
[258] Fix | Delete
}
[259] Fix | Delete
}
[260] Fix | Delete
[261] Fix | Delete
delete options.namespace;
[262] Fix | Delete
delete options.endpoint;
[263] Fix | Delete
return next(namespace_endpoint_objectSpread(namespace_endpoint_objectSpread({}, options), {}, {
[264] Fix | Delete
path: path
[265] Fix | Delete
}));
[266] Fix | Delete
};
[267] Fix | Delete
[268] Fix | Delete
/* harmony default export */ var namespace_endpoint = (namespaceAndEndpointMiddleware);
[269] Fix | Delete
[270] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js
[271] Fix | Delete
[272] Fix | Delete
[273] Fix | Delete
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; }
[274] Fix | Delete
[275] Fix | Delete
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; }
[276] Fix | Delete
[277] Fix | Delete
/**
[278] Fix | Delete
* Internal dependencies
[279] Fix | Delete
*/
[280] Fix | Delete
[281] Fix | Delete
[282] Fix | Delete
var root_url_createRootURLMiddleware = function createRootURLMiddleware(rootURL) {
[283] Fix | Delete
return function (options, next) {
[284] Fix | Delete
return namespace_endpoint(options, function (optionsWithPath) {
[285] Fix | Delete
var url = optionsWithPath.url;
[286] Fix | Delete
var path = optionsWithPath.path;
[287] Fix | Delete
var apiRoot;
[288] Fix | Delete
[289] Fix | Delete
if (typeof path === 'string') {
[290] Fix | Delete
apiRoot = rootURL;
[291] Fix | Delete
[292] Fix | Delete
if (-1 !== rootURL.indexOf('?')) {
[293] Fix | Delete
path = path.replace('?', '&');
[294] Fix | Delete
}
[295] Fix | Delete
[296] Fix | Delete
path = path.replace(/^\//, ''); // API root may already include query parameter prefix if site is
[297] Fix | Delete
// configured to use plain permalinks.
[298] Fix | Delete
[299] Fix | Delete
if ('string' === typeof apiRoot && -1 !== apiRoot.indexOf('?')) {
[300] Fix | Delete
path = path.replace('?', '&');
[301] Fix | Delete
}
[302] Fix | Delete
[303] Fix | Delete
url = apiRoot + path;
[304] Fix | Delete
}
[305] Fix | Delete
[306] Fix | Delete
return next(root_url_objectSpread(root_url_objectSpread({}, optionsWithPath), {}, {
[307] Fix | Delete
url: url
[308] Fix | Delete
}));
[309] Fix | Delete
});
[310] Fix | Delete
};
[311] Fix | Delete
};
[312] Fix | Delete
[313] Fix | Delete
/* harmony default export */ var root_url = (root_url_createRootURLMiddleware);
[314] Fix | Delete
[315] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js
[316] Fix | Delete
/**
[317] Fix | Delete
* Given a path, returns a normalized path where equal query parameter values
[318] Fix | Delete
* will be treated as identical, regardless of order they appear in the original
[319] Fix | Delete
* text.
[320] Fix | Delete
*
[321] Fix | Delete
* @param {string} path Original path.
[322] Fix | Delete
*
[323] Fix | Delete
* @return {string} Normalized path.
[324] Fix | Delete
*/
[325] Fix | Delete
function getStablePath(path) {
[326] Fix | Delete
var splitted = path.split('?');
[327] Fix | Delete
var query = splitted[1];
[328] Fix | Delete
var base = splitted[0];
[329] Fix | Delete
[330] Fix | Delete
if (!query) {
[331] Fix | Delete
return base;
[332] Fix | Delete
} // 'b=1&c=2&a=5'
[333] Fix | Delete
[334] Fix | Delete
[335] Fix | Delete
return base + '?' + query // [ 'b=1', 'c=2', 'a=5' ]
[336] Fix | Delete
.split('&') // [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]
[337] Fix | Delete
.map(function (entry) {
[338] Fix | Delete
return entry.split('=');
[339] Fix | Delete
}) // [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]
[340] Fix | Delete
.sort(function (a, b) {
[341] Fix | Delete
return a[0].localeCompare(b[0]);
[342] Fix | Delete
}) // [ 'a=5', 'b=1', 'c=2' ]
[343] Fix | Delete
.map(function (pair) {
[344] Fix | Delete
return pair.join('=');
[345] Fix | Delete
}) // 'a=5&b=1&c=2'
[346] Fix | Delete
.join('&');
[347] Fix | Delete
}
[348] Fix | Delete
[349] Fix | Delete
function createPreloadingMiddleware(preloadedData) {
[350] Fix | Delete
var cache = Object.keys(preloadedData).reduce(function (result, path) {
[351] Fix | Delete
result[getStablePath(path)] = preloadedData[path];
[352] Fix | Delete
return result;
[353] Fix | Delete
}, {});
[354] Fix | Delete
return function (options, next) {
[355] Fix | Delete
var _options$parse = options.parse,
[356] Fix | Delete
parse = _options$parse === void 0 ? true : _options$parse;
[357] Fix | Delete
[358] Fix | Delete
if (typeof options.path === 'string') {
[359] Fix | Delete
var method = options.method || 'GET';
[360] Fix | Delete
var path = getStablePath(options.path);
[361] Fix | Delete
[362] Fix | Delete
if ('GET' === method && cache[path]) {
[363] Fix | Delete
var cacheData = cache[path]; // Unsetting the cache key ensures that the data is only preloaded a single time
[364] Fix | Delete
[365] Fix | Delete
delete cache[path];
[366] Fix | Delete
return Promise.resolve(parse ? cacheData.body : new window.Response(JSON.stringify(cacheData.body), {
[367] Fix | Delete
status: 200,
[368] Fix | Delete
statusText: 'OK',
[369] Fix | Delete
headers: cacheData.headers
[370] Fix | Delete
}));
[371] Fix | Delete
} else if ('OPTIONS' === method && cache[method] && cache[method][path]) {
[372] Fix | Delete
return Promise.resolve(cache[method][path]);
[373] Fix | Delete
}
[374] Fix | Delete
}
[375] Fix | Delete
[376] Fix | Delete
return next(options);
[377] Fix | Delete
};
[378] Fix | Delete
}
[379] Fix | Delete
[380] Fix | Delete
/* harmony default export */ var preloading = (createPreloadingMiddleware);
[381] Fix | Delete
[382] Fix | Delete
// EXTERNAL MODULE: external "regeneratorRuntime"
[383] Fix | Delete
var external_regeneratorRuntime_ = __webpack_require__("dvlR");
[384] Fix | Delete
var external_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_regeneratorRuntime_);
[385] Fix | Delete
[386] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
[387] Fix | Delete
var asyncToGenerator = __webpack_require__("HaE+");
[388] Fix | Delete
[389] Fix | Delete
// EXTERNAL MODULE: external ["wp","url"]
[390] Fix | Delete
var external_wp_url_ = __webpack_require__("Mmq9");
[391] Fix | Delete
[392] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js
[393] Fix | Delete
[394] Fix | Delete
[395] Fix | Delete
[396] Fix | Delete
[397] Fix | Delete
[398] Fix | Delete
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; }
[399] Fix | Delete
[400] Fix | Delete
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; }
[401] Fix | Delete
[402] Fix | Delete
/**
[403] Fix | Delete
* WordPress dependencies
[404] Fix | Delete
*/
[405] Fix | Delete
[406] Fix | Delete
/**
[407] Fix | Delete
* Internal dependencies
[408] Fix | Delete
*/
[409] Fix | Delete
[410] Fix | Delete
// Apply query arguments to both URL and Path, whichever is present.
[411] Fix | Delete
[412] Fix | Delete
var fetch_all_middleware_modifyQuery = function modifyQuery(_ref, queryArgs) {
[413] Fix | Delete
var path = _ref.path,
[414] Fix | Delete
url = _ref.url,
[415] Fix | Delete
options = Object(objectWithoutProperties["a" /* default */])(_ref, ["path", "url"]);
[416] Fix | Delete
[417] Fix | Delete
return fetch_all_middleware_objectSpread(fetch_all_middleware_objectSpread({}, options), {}, {
[418] Fix | Delete
url: url && Object(external_wp_url_["addQueryArgs"])(url, queryArgs),
[419] Fix | Delete
path: path && Object(external_wp_url_["addQueryArgs"])(path, queryArgs)
[420] Fix | Delete
});
[421] Fix | Delete
}; // Duplicates parsing functionality from apiFetch.
[422] Fix | Delete
[423] Fix | Delete
[424] Fix | Delete
var parseResponse = function parseResponse(response) {
[425] Fix | Delete
return response.json ? response.json() : Promise.reject(response);
[426] Fix | Delete
};
[427] Fix | Delete
[428] Fix | Delete
var parseLinkHeader = function parseLinkHeader(linkHeader) {
[429] Fix | Delete
if (!linkHeader) {
[430] Fix | Delete
return {};
[431] Fix | Delete
}
[432] Fix | Delete
[433] Fix | Delete
var match = linkHeader.match(/<([^>]+)>; rel="next"/);
[434] Fix | Delete
return match ? {
[435] Fix | Delete
next: match[1]
[436] Fix | Delete
} : {};
[437] Fix | Delete
};
[438] Fix | Delete
[439] Fix | Delete
var getNextPageUrl = function getNextPageUrl(response) {
[440] Fix | Delete
var _parseLinkHeader = parseLinkHeader(response.headers.get('link')),
[441] Fix | Delete
next = _parseLinkHeader.next;
[442] Fix | Delete
[443] Fix | Delete
return next;
[444] Fix | Delete
};
[445] Fix | Delete
[446] Fix | Delete
var requestContainsUnboundedQuery = function requestContainsUnboundedQuery(options) {
[447] Fix | Delete
var pathIsUnbounded = options.path && options.path.indexOf('per_page=-1') !== -1;
[448] Fix | Delete
var urlIsUnbounded = options.url && options.url.indexOf('per_page=-1') !== -1;
[449] Fix | Delete
return pathIsUnbounded || urlIsUnbounded;
[450] Fix | Delete
}; // The REST API enforces an upper limit on the per_page option. To handle large
[451] Fix | Delete
// collections, apiFetch consumers can pass `per_page=-1`; this middleware will
[452] Fix | Delete
// then recursively assemble a full response array from all available pages.
[453] Fix | Delete
[454] Fix | Delete
[455] Fix | Delete
var fetchAllMiddleware = /*#__PURE__*/function () {
[456] Fix | Delete
var _ref2 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_regeneratorRuntime_default.a.mark(function _callee(options, next) {
[457] Fix | Delete
var response, results, nextPage, mergedResults, nextResponse, nextResults;
[458] Fix | Delete
return external_regeneratorRuntime_default.a.wrap(function _callee$(_context) {
[459] Fix | Delete
while (1) {
[460] Fix | Delete
switch (_context.prev = _context.next) {
[461] Fix | Delete
case 0:
[462] Fix | Delete
if (!(options.parse === false)) {
[463] Fix | Delete
_context.next = 2;
[464] Fix | Delete
break;
[465] Fix | Delete
}
[466] Fix | Delete
[467] Fix | Delete
return _context.abrupt("return", next(options));
[468] Fix | Delete
[469] Fix | Delete
case 2:
[470] Fix | Delete
if (requestContainsUnboundedQuery(options)) {
[471] Fix | Delete
_context.next = 4;
[472] Fix | Delete
break;
[473] Fix | Delete
}
[474] Fix | Delete
[475] Fix | Delete
return _context.abrupt("return", next(options));
[476] Fix | Delete
[477] Fix | Delete
case 4:
[478] Fix | Delete
_context.next = 6;
[479] Fix | Delete
return build_module(fetch_all_middleware_objectSpread(fetch_all_middleware_objectSpread({}, fetch_all_middleware_modifyQuery(options, {
[480] Fix | Delete
per_page: 100
[481] Fix | Delete
})), {}, {
[482] Fix | Delete
// Ensure headers are returned for page 1.
[483] Fix | Delete
parse: false
[484] Fix | Delete
}));
[485] Fix | Delete
[486] Fix | Delete
case 6:
[487] Fix | Delete
response = _context.sent;
[488] Fix | Delete
_context.next = 9;
[489] Fix | Delete
return parseResponse(response);
[490] Fix | Delete
[491] Fix | Delete
case 9:
[492] Fix | Delete
results = _context.sent;
[493] Fix | Delete
[494] Fix | Delete
if (Array.isArray(results)) {
[495] Fix | Delete
_context.next = 12;
[496] Fix | Delete
break;
[497] Fix | Delete
}
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function