Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: blocks.js
* Arbitrary value used as key for referencing cache object in WeakMap tree.
[14000] Fix | Delete
*
[14001] Fix | Delete
* @type {Object}
[14002] Fix | Delete
*/
[14003] Fix | Delete
LEAF_KEY = {};
[14004] Fix | Delete
[14005] Fix | Delete
/**
[14006] Fix | Delete
* Whether environment supports WeakMap.
[14007] Fix | Delete
*
[14008] Fix | Delete
* @type {boolean}
[14009] Fix | Delete
*/
[14010] Fix | Delete
hasWeakMap = typeof WeakMap !== 'undefined';
[14011] Fix | Delete
[14012] Fix | Delete
/**
[14013] Fix | Delete
* Returns the first argument as the sole entry in an array.
[14014] Fix | Delete
*
[14015] Fix | Delete
* @param {*} value Value to return.
[14016] Fix | Delete
*
[14017] Fix | Delete
* @return {Array} Value returned as entry in array.
[14018] Fix | Delete
*/
[14019] Fix | Delete
function arrayOf( value ) {
[14020] Fix | Delete
return [ value ];
[14021] Fix | Delete
}
[14022] Fix | Delete
[14023] Fix | Delete
/**
[14024] Fix | Delete
* Returns true if the value passed is object-like, or false otherwise. A value
[14025] Fix | Delete
* is object-like if it can support property assignment, e.g. object or array.
[14026] Fix | Delete
*
[14027] Fix | Delete
* @param {*} value Value to test.
[14028] Fix | Delete
*
[14029] Fix | Delete
* @return {boolean} Whether value is object-like.
[14030] Fix | Delete
*/
[14031] Fix | Delete
function isObjectLike( value ) {
[14032] Fix | Delete
return !! value && 'object' === typeof value;
[14033] Fix | Delete
}
[14034] Fix | Delete
[14035] Fix | Delete
/**
[14036] Fix | Delete
* Creates and returns a new cache object.
[14037] Fix | Delete
*
[14038] Fix | Delete
* @return {Object} Cache object.
[14039] Fix | Delete
*/
[14040] Fix | Delete
function createCache() {
[14041] Fix | Delete
var cache = {
[14042] Fix | Delete
clear: function() {
[14043] Fix | Delete
cache.head = null;
[14044] Fix | Delete
},
[14045] Fix | Delete
};
[14046] Fix | Delete
[14047] Fix | Delete
return cache;
[14048] Fix | Delete
}
[14049] Fix | Delete
[14050] Fix | Delete
/**
[14051] Fix | Delete
* Returns true if entries within the two arrays are strictly equal by
[14052] Fix | Delete
* reference from a starting index.
[14053] Fix | Delete
*
[14054] Fix | Delete
* @param {Array} a First array.
[14055] Fix | Delete
* @param {Array} b Second array.
[14056] Fix | Delete
* @param {number} fromIndex Index from which to start comparison.
[14057] Fix | Delete
*
[14058] Fix | Delete
* @return {boolean} Whether arrays are shallowly equal.
[14059] Fix | Delete
*/
[14060] Fix | Delete
function isShallowEqual( a, b, fromIndex ) {
[14061] Fix | Delete
var i;
[14062] Fix | Delete
[14063] Fix | Delete
if ( a.length !== b.length ) {
[14064] Fix | Delete
return false;
[14065] Fix | Delete
}
[14066] Fix | Delete
[14067] Fix | Delete
for ( i = fromIndex; i < a.length; i++ ) {
[14068] Fix | Delete
if ( a[ i ] !== b[ i ] ) {
[14069] Fix | Delete
return false;
[14070] Fix | Delete
}
[14071] Fix | Delete
}
[14072] Fix | Delete
[14073] Fix | Delete
return true;
[14074] Fix | Delete
}
[14075] Fix | Delete
[14076] Fix | Delete
/**
[14077] Fix | Delete
* Returns a memoized selector function. The getDependants function argument is
[14078] Fix | Delete
* called before the memoized selector and is expected to return an immutable
[14079] Fix | Delete
* reference or array of references on which the selector depends for computing
[14080] Fix | Delete
* its own return value. The memoize cache is preserved only as long as those
[14081] Fix | Delete
* dependant references remain the same. If getDependants returns a different
[14082] Fix | Delete
* reference(s), the cache is cleared and the selector value regenerated.
[14083] Fix | Delete
*
[14084] Fix | Delete
* @param {Function} selector Selector function.
[14085] Fix | Delete
* @param {Function} getDependants Dependant getter returning an immutable
[14086] Fix | Delete
* reference or array of reference used in
[14087] Fix | Delete
* cache bust consideration.
[14088] Fix | Delete
*
[14089] Fix | Delete
* @return {Function} Memoized selector.
[14090] Fix | Delete
*/
[14091] Fix | Delete
/* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
[14092] Fix | Delete
var rootCache, getCache;
[14093] Fix | Delete
[14094] Fix | Delete
// Use object source as dependant if getter not provided
[14095] Fix | Delete
if ( ! getDependants ) {
[14096] Fix | Delete
getDependants = arrayOf;
[14097] Fix | Delete
}
[14098] Fix | Delete
[14099] Fix | Delete
/**
[14100] Fix | Delete
* Returns the root cache. If WeakMap is supported, this is assigned to the
[14101] Fix | Delete
* root WeakMap cache set, otherwise it is a shared instance of the default
[14102] Fix | Delete
* cache object.
[14103] Fix | Delete
*
[14104] Fix | Delete
* @return {(WeakMap|Object)} Root cache object.
[14105] Fix | Delete
*/
[14106] Fix | Delete
function getRootCache() {
[14107] Fix | Delete
return rootCache;
[14108] Fix | Delete
}
[14109] Fix | Delete
[14110] Fix | Delete
/**
[14111] Fix | Delete
* Returns the cache for a given dependants array. When possible, a WeakMap
[14112] Fix | Delete
* will be used to create a unique cache for each set of dependants. This
[14113] Fix | Delete
* is feasible due to the nature of WeakMap in allowing garbage collection
[14114] Fix | Delete
* to occur on entries where the key object is no longer referenced. Since
[14115] Fix | Delete
* WeakMap requires the key to be an object, this is only possible when the
[14116] Fix | Delete
* dependant is object-like. The root cache is created as a hierarchy where
[14117] Fix | Delete
* each top-level key is the first entry in a dependants set, the value a
[14118] Fix | Delete
* WeakMap where each key is the next dependant, and so on. This continues
[14119] Fix | Delete
* so long as the dependants are object-like. If no dependants are object-
[14120] Fix | Delete
* like, then the cache is shared across all invocations.
[14121] Fix | Delete
*
[14122] Fix | Delete
* @see isObjectLike
[14123] Fix | Delete
*
[14124] Fix | Delete
* @param {Array} dependants Selector dependants.
[14125] Fix | Delete
*
[14126] Fix | Delete
* @return {Object} Cache object.
[14127] Fix | Delete
*/
[14128] Fix | Delete
function getWeakMapCache( dependants ) {
[14129] Fix | Delete
var caches = rootCache,
[14130] Fix | Delete
isUniqueByDependants = true,
[14131] Fix | Delete
i, dependant, map, cache;
[14132] Fix | Delete
[14133] Fix | Delete
for ( i = 0; i < dependants.length; i++ ) {
[14134] Fix | Delete
dependant = dependants[ i ];
[14135] Fix | Delete
[14136] Fix | Delete
// Can only compose WeakMap from object-like key.
[14137] Fix | Delete
if ( ! isObjectLike( dependant ) ) {
[14138] Fix | Delete
isUniqueByDependants = false;
[14139] Fix | Delete
break;
[14140] Fix | Delete
}
[14141] Fix | Delete
[14142] Fix | Delete
// Does current segment of cache already have a WeakMap?
[14143] Fix | Delete
if ( caches.has( dependant ) ) {
[14144] Fix | Delete
// Traverse into nested WeakMap.
[14145] Fix | Delete
caches = caches.get( dependant );
[14146] Fix | Delete
} else {
[14147] Fix | Delete
// Create, set, and traverse into a new one.
[14148] Fix | Delete
map = new WeakMap();
[14149] Fix | Delete
caches.set( dependant, map );
[14150] Fix | Delete
caches = map;
[14151] Fix | Delete
}
[14152] Fix | Delete
}
[14153] Fix | Delete
[14154] Fix | Delete
// We use an arbitrary (but consistent) object as key for the last item
[14155] Fix | Delete
// in the WeakMap to serve as our running cache.
[14156] Fix | Delete
if ( ! caches.has( LEAF_KEY ) ) {
[14157] Fix | Delete
cache = createCache();
[14158] Fix | Delete
cache.isUniqueByDependants = isUniqueByDependants;
[14159] Fix | Delete
caches.set( LEAF_KEY, cache );
[14160] Fix | Delete
}
[14161] Fix | Delete
[14162] Fix | Delete
return caches.get( LEAF_KEY );
[14163] Fix | Delete
}
[14164] Fix | Delete
[14165] Fix | Delete
// Assign cache handler by availability of WeakMap
[14166] Fix | Delete
getCache = hasWeakMap ? getWeakMapCache : getRootCache;
[14167] Fix | Delete
[14168] Fix | Delete
/**
[14169] Fix | Delete
* Resets root memoization cache.
[14170] Fix | Delete
*/
[14171] Fix | Delete
function clear() {
[14172] Fix | Delete
rootCache = hasWeakMap ? new WeakMap() : createCache();
[14173] Fix | Delete
}
[14174] Fix | Delete
[14175] Fix | Delete
// eslint-disable-next-line jsdoc/check-param-names
[14176] Fix | Delete
/**
[14177] Fix | Delete
* The augmented selector call, considering first whether dependants have
[14178] Fix | Delete
* changed before passing it to underlying memoize function.
[14179] Fix | Delete
*
[14180] Fix | Delete
* @param {Object} source Source object for derivation.
[14181] Fix | Delete
* @param {...*} extraArgs Additional arguments to pass to selector.
[14182] Fix | Delete
*
[14183] Fix | Delete
* @return {*} Selector result.
[14184] Fix | Delete
*/
[14185] Fix | Delete
function callSelector( /* source, ...extraArgs */ ) {
[14186] Fix | Delete
var len = arguments.length,
[14187] Fix | Delete
cache, node, i, args, dependants;
[14188] Fix | Delete
[14189] Fix | Delete
// Create copy of arguments (avoid leaking deoptimization).
[14190] Fix | Delete
args = new Array( len );
[14191] Fix | Delete
for ( i = 0; i < len; i++ ) {
[14192] Fix | Delete
args[ i ] = arguments[ i ];
[14193] Fix | Delete
}
[14194] Fix | Delete
[14195] Fix | Delete
dependants = getDependants.apply( null, args );
[14196] Fix | Delete
cache = getCache( dependants );
[14197] Fix | Delete
[14198] Fix | Delete
// If not guaranteed uniqueness by dependants (primitive type or lack
[14199] Fix | Delete
// of WeakMap support), shallow compare against last dependants and, if
[14200] Fix | Delete
// references have changed, destroy cache to recalculate result.
[14201] Fix | Delete
if ( ! cache.isUniqueByDependants ) {
[14202] Fix | Delete
if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
[14203] Fix | Delete
cache.clear();
[14204] Fix | Delete
}
[14205] Fix | Delete
[14206] Fix | Delete
cache.lastDependants = dependants;
[14207] Fix | Delete
}
[14208] Fix | Delete
[14209] Fix | Delete
node = cache.head;
[14210] Fix | Delete
while ( node ) {
[14211] Fix | Delete
// Check whether node arguments match arguments
[14212] Fix | Delete
if ( ! isShallowEqual( node.args, args, 1 ) ) {
[14213] Fix | Delete
node = node.next;
[14214] Fix | Delete
continue;
[14215] Fix | Delete
}
[14216] Fix | Delete
[14217] Fix | Delete
// At this point we can assume we've found a match
[14218] Fix | Delete
[14219] Fix | Delete
// Surface matched node to head if not already
[14220] Fix | Delete
if ( node !== cache.head ) {
[14221] Fix | Delete
// Adjust siblings to point to each other.
[14222] Fix | Delete
node.prev.next = node.next;
[14223] Fix | Delete
if ( node.next ) {
[14224] Fix | Delete
node.next.prev = node.prev;
[14225] Fix | Delete
}
[14226] Fix | Delete
[14227] Fix | Delete
node.next = cache.head;
[14228] Fix | Delete
node.prev = null;
[14229] Fix | Delete
cache.head.prev = node;
[14230] Fix | Delete
cache.head = node;
[14231] Fix | Delete
}
[14232] Fix | Delete
[14233] Fix | Delete
// Return immediately
[14234] Fix | Delete
return node.val;
[14235] Fix | Delete
}
[14236] Fix | Delete
[14237] Fix | Delete
// No cached value found. Continue to insertion phase:
[14238] Fix | Delete
[14239] Fix | Delete
node = {
[14240] Fix | Delete
// Generate the result from original function
[14241] Fix | Delete
val: selector.apply( null, args ),
[14242] Fix | Delete
};
[14243] Fix | Delete
[14244] Fix | Delete
// Avoid including the source object in the cache.
[14245] Fix | Delete
args[ 0 ] = null;
[14246] Fix | Delete
node.args = args;
[14247] Fix | Delete
[14248] Fix | Delete
// Don't need to check whether node is already head, since it would
[14249] Fix | Delete
// have been returned above already if it was
[14250] Fix | Delete
[14251] Fix | Delete
// Shift existing head down list
[14252] Fix | Delete
if ( cache.head ) {
[14253] Fix | Delete
cache.head.prev = node;
[14254] Fix | Delete
node.next = cache.head;
[14255] Fix | Delete
}
[14256] Fix | Delete
[14257] Fix | Delete
cache.head = node;
[14258] Fix | Delete
[14259] Fix | Delete
return node.val;
[14260] Fix | Delete
}
[14261] Fix | Delete
[14262] Fix | Delete
callSelector.getDependants = getDependants;
[14263] Fix | Delete
callSelector.clear = clear;
[14264] Fix | Delete
clear();
[14265] Fix | Delete
[14266] Fix | Delete
return callSelector;
[14267] Fix | Delete
});
[14268] Fix | Delete
[14269] Fix | Delete
[14270] Fix | Delete
/***/ }),
[14271] Fix | Delete
[14272] Fix | Delete
/***/ "rePB":
[14273] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[14274] Fix | Delete
[14275] Fix | Delete
"use strict";
[14276] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
[14277] Fix | Delete
function _defineProperty(obj, key, value) {
[14278] Fix | Delete
if (key in obj) {
[14279] Fix | Delete
Object.defineProperty(obj, key, {
[14280] Fix | Delete
value: value,
[14281] Fix | Delete
enumerable: true,
[14282] Fix | Delete
configurable: true,
[14283] Fix | Delete
writable: true
[14284] Fix | Delete
});
[14285] Fix | Delete
} else {
[14286] Fix | Delete
obj[key] = value;
[14287] Fix | Delete
}
[14288] Fix | Delete
[14289] Fix | Delete
return obj;
[14290] Fix | Delete
}
[14291] Fix | Delete
[14292] Fix | Delete
/***/ }),
[14293] Fix | Delete
[14294] Fix | Delete
/***/ "rl8x":
[14295] Fix | Delete
/***/ (function(module, exports) {
[14296] Fix | Delete
[14297] Fix | Delete
(function() { module.exports = window["wp"]["isShallowEqual"]; }());
[14298] Fix | Delete
[14299] Fix | Delete
/***/ }),
[14300] Fix | Delete
[14301] Fix | Delete
/***/ "rmEH":
[14302] Fix | Delete
/***/ (function(module, exports) {
[14303] Fix | Delete
[14304] Fix | Delete
(function() { module.exports = window["wp"]["htmlEntities"]; }());
[14305] Fix | Delete
[14306] Fix | Delete
/***/ }),
[14307] Fix | Delete
[14308] Fix | Delete
/***/ "vuIU":
[14309] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[14310] Fix | Delete
[14311] Fix | Delete
"use strict";
[14312] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
[14313] Fix | Delete
function _defineProperties(target, props) {
[14314] Fix | Delete
for (var i = 0; i < props.length; i++) {
[14315] Fix | Delete
var descriptor = props[i];
[14316] Fix | Delete
descriptor.enumerable = descriptor.enumerable || false;
[14317] Fix | Delete
descriptor.configurable = true;
[14318] Fix | Delete
if ("value" in descriptor) descriptor.writable = true;
[14319] Fix | Delete
Object.defineProperty(target, descriptor.key, descriptor);
[14320] Fix | Delete
}
[14321] Fix | Delete
}
[14322] Fix | Delete
[14323] Fix | Delete
function _createClass(Constructor, protoProps, staticProps) {
[14324] Fix | Delete
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
[14325] Fix | Delete
if (staticProps) _defineProperties(Constructor, staticProps);
[14326] Fix | Delete
return Constructor;
[14327] Fix | Delete
}
[14328] Fix | Delete
[14329] Fix | Delete
/***/ }),
[14330] Fix | Delete
[14331] Fix | Delete
/***/ "wx14":
[14332] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[14333] Fix | Delete
[14334] Fix | Delete
"use strict";
[14335] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
[14336] Fix | Delete
function _extends() {
[14337] Fix | Delete
_extends = Object.assign || function (target) {
[14338] Fix | Delete
for (var i = 1; i < arguments.length; i++) {
[14339] Fix | Delete
var source = arguments[i];
[14340] Fix | Delete
[14341] Fix | Delete
for (var key in source) {
[14342] Fix | Delete
if (Object.prototype.hasOwnProperty.call(source, key)) {
[14343] Fix | Delete
target[key] = source[key];
[14344] Fix | Delete
}
[14345] Fix | Delete
}
[14346] Fix | Delete
}
[14347] Fix | Delete
[14348] Fix | Delete
return target;
[14349] Fix | Delete
};
[14350] Fix | Delete
[14351] Fix | Delete
return _extends.apply(this, arguments);
[14352] Fix | Delete
}
[14353] Fix | Delete
[14354] Fix | Delete
/***/ }),
[14355] Fix | Delete
[14356] Fix | Delete
/***/ "xTGt":
[14357] Fix | Delete
/***/ (function(module, exports) {
[14358] Fix | Delete
[14359] Fix | Delete
(function() { module.exports = window["wp"]["blob"]; }());
[14360] Fix | Delete
[14361] Fix | Delete
/***/ })
[14362] Fix | Delete
[14363] Fix | Delete
/******/ });
[14364] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function