/* Detect-zoom
* -----------
* Cross Browser Zoom and Pixel Ratio Detector
* Version 1.0.4 | Apr 1 2013
* dual-licensed under the WTFPL and MIT license
* Maintained by https://github/tombigel
* Original developer https://github.com/yonran
*/
//AMD and CommonJS initialization copied from https://github.com/zohararad/audio5js
(function (root, ns, factory) {
"use strict";
if (typeof (module) !== 'undefined' && module.exports) { // CommonJS
module.exports = factory(ns, root);
} else if (typeof (define) === 'function' && define.amd) { // AMD
define("factory", function () {
return factory(ns, root);
});
} else {
root[ns] = factory(ns, root);
}
}(window, 'detectZoom', function () {
/**
* Use devicePixelRatio if supported by the browser
* @return {Number}
* @private
*/
var devicePixelRatio = function () {
return window.devicePixelRatio || 1;
};
/**
* Fallback function to set default values
* @return {Object}
* @private
*/
var fallback = function () {
return {
zoom: 1,
devicePxPerCssPx: 1
};
};
/**
* IE 8 and 9: no trick needed!
* TODO: Test on IE10 and Windows 8 RT
* @return {Object}
* @private
**/
var ie8 = function () {
var zoom = Math.round((screen.deviceXDPI / screen.logicalXDPI) * 100) / 100;
return {
zoom: zoom,
devicePxPerCssPx: zoom * devicePixelRatio()
};
};
/**
* For IE10 we need to change our technique again...
* thanks https://github.com/stefanvanburen
* @return {Object}
* @private
*/
var ie10 = function () {
var zoom = Math.round((document.documentElement.offsetHeight / window.innerHeight) * 100) / 100;
return {
zoom: zoom,
devicePxPerCssPx: zoom * devicePixelRatio()
};
};
/**
* Mobile WebKit
* the trick: window.innerWIdth is in CSS pixels, while
* screen.width and screen.height are in system pixels.
* And there are no scrollbars to mess up the measurement.
* @return {Object}
* @private
*/
var webkitMobile = function () {
var deviceWidth = (Math.abs(window.orientation) == 90) ? screen.height : screen.width;
var zoom = deviceWidth / window.innerWidth;
return {
zoom: zoom,
devicePxPerCssPx: zoom * devicePixelRatio()
};
};
/**
* Desktop Webkit
* the trick: an element's clientHeight is in CSS pixels, while you can
* set its line-height in system pixels using font-size and
* -webkit-text-size-adjust:none.
* device-pixel-ratio: http://www.webkit.org/blog/55/high-dpi-web-sites/
*
* Previous trick (used before http://trac.webkit.org/changeset/100847):
* documentElement.scrollWidth is in CSS pixels, while
* document.width was in system pixels. Note that this is the
* layout width of the document, which is slightly different from viewport
* because document width does not include scrollbars and might be wider
* due to big elements.
* @return {Object}
* @private
*/
var webkit = function () {
var important = function (str) {
return str.replace(/;/g, " !important;");
};
var div = document.createElement('div');
div.innerHTML = "1
2
3
4
5
6
7
8
9
0";
div.setAttribute('style', important('font: 100px/1em sans-serif; -webkit-text-size-adjust: none; text-size-adjust: none; height: auto; width: 1em; padding: 0; overflow: visible;'));
// The container exists so that the div will be laid out in its own flow
// while not impacting the layout, viewport size, or display of the
// webpage as a whole.
// Add !important and relevant CSS rule resets
// so that other rules cannot affect the results.
var container = document.createElement('div');
container.setAttribute('style', important('width:0; height:0; overflow:hidden; visibility:hidden; position: absolute;'));
container.appendChild(div);
document.body.appendChild(container);
var zoom = 1000 / div.clientHeight;
zoom = Math.round(zoom * 100) / 100;
document.body.removeChild(container);
return{
zoom: zoom,
devicePxPerCssPx: zoom * devicePixelRatio()
};
};
/**
* no real trick; device-pixel-ratio is the ratio of device dpi / css dpi.
* (Note that this is a different interpretation than Webkit's device
* pixel ratio, which is the ratio device dpi / system dpi).
*
* Also, for Mozilla, there is no difference between the zoom factor and the device ratio.
*
* @return {Object}
* @private
*/
var firefox4 = function () {
var zoom = mediaQueryBinarySearch('min--moz-device-pixel-ratio', '', 0, 10, 20, 0.0001);
zoom = Math.round(zoom * 100) / 100;
return {
zoom: zoom,
devicePxPerCssPx: zoom
};
};
/**
* Firefox 18.x
* Mozilla added support for devicePixelRatio to Firefox 18,
* but it is affected by the zoom level, so, like in older
* Firefox we can't tell if we are in zoom mode or in a device
* with a different pixel ratio
* @return {Object}
* @private
*/
var firefox18 = function () {
return {
zoom: firefox4().zoom,
devicePxPerCssPx: devicePixelRatio()
};
};
/**
* works starting Opera 11.11
* the trick: outerWidth is the viewport width including scrollbars in
* system px, while innerWidth is the viewport width including scrollbars
* in CSS px
* @return {Object}
* @private
*/
var opera11 = function () {
var zoom = window.top.outerWidth / window.top.innerWidth;
zoom = Math.round(zoom * 100) / 100;
return {
zoom: zoom,
devicePxPerCssPx: zoom * devicePixelRatio()
};
};
/**
* Use a binary search through media queries to find zoom level in Firefox
* @param property
* @param unit
* @param a
* @param b
* @param maxIter
* @param epsilon
* @return {Number}
*/
var mediaQueryBinarySearch = function (property, unit, a, b, maxIter, epsilon) {
var matchMedia;
var head, style, div;
if (window.matchMedia) {
matchMedia = window.matchMedia;
} else {
head = document.getElementsByTagName('head')[0];
style = document.createElement('style');
head.appendChild(style);
div = document.createElement('div');
div.className = 'mediaQueryBinarySearch';
div.style.display = 'none';
document.body.appendChild(div);
matchMedia = function (query) {
style.sheet.insertRule('@media ' + query + '{.mediaQueryBinarySearch ' + '{text-decoration: underline} }', 0);
var matched = getComputedStyle(div, null).textDecoration == 'underline';
style.sheet.deleteRule(0);
return {matches: matched};
};
}
var ratio = binarySearch(a, b, maxIter);
if (div) {
head.removeChild(style);
document.body.removeChild(div);
}
return ratio;
function binarySearch(a, b, maxIter) {
var mid = (a + b) / 2;
if (maxIter <= 0 || b - a < epsilon) {
return mid;
}
var query = "(" + property + ":" + mid + unit + ")";
if (matchMedia(query).matches) {
return binarySearch(mid, b, maxIter - 1);
} else {
return binarySearch(a, mid, maxIter - 1);
}
}
};
/**
* Generate detection function
* @private
*/
var detectFunction = (function () {
var func = fallback;
//IE8+
if (!isNaN(screen.logicalXDPI) && !isNaN(screen.systemXDPI)) {
func = ie8;
}
// IE10+ / Touch
else if (window.navigator.msMaxTouchPoints) {
func = ie10;
}
//Mobile Webkit
else if ('orientation' in window && typeof document.body.style.webkitMarquee === 'string') {
func = webkitMobile;
}
//WebKit
else if (typeof document.body.style.webkitMarquee === 'string') {
func = webkit;
}
//Opera
else if (navigator.userAgent.indexOf('Opera') >= 0) {
func = opera11;
}
//Last one is Firefox
//FF 18.x
else if (window.devicePixelRatio) {
func = firefox18;
}
//FF 4.0 - 17.x
else if (firefox4().zoom > 0.001) {
func = firefox4;
}
return func;
}());
return ({
/**
* Ratios.zoom shorthand
* @return {Number} Zoom level
*/
zoom: function () {
return detectFunction().zoom;
},
/**
* Ratios.devicePxPerCssPx shorthand
* @return {Number} devicePxPerCssPx level
*/
device: function () {
return detectFunction().devicePxPerCssPx;
}
});
}));
var wpcom_img_zoomer = {
clientHintSupport: {
gravatar: false,
files: false,
photon: false,
mshots: false,
staticAssets: false,
latex: false,
imgpress: false,
},
useHints: false,
zoomed: false,
timer: null,
interval: 1000, // zoom polling interval in millisecond
// Should we apply width/height attributes to control the image size?
imgNeedsSizeAtts: function( img ) {
// Do not overwrite existing width/height attributes.
if ( img.getAttribute('width') !== null || img.getAttribute('height') !== null )
return false;
// Do not apply the attributes if the image is already constrained by a parent element.
if ( img.width < img.naturalWidth || img.height < img.naturalHeight )
return false;
return true;
},
hintsFor: function( service ) {
if ( this.useHints === false ) {
return false;
}
if ( this.hints() === false ) {
return false;
}
if ( typeof this.clientHintSupport[service] === "undefined" ) {
return false;
}
if ( this.clientHintSupport[service] === true ) {
return true;
}
return false;
},
hints: function() {
try {
var chrome = window.navigator.userAgent.match(/\sChrome\/([0-9]+)\.[.0-9]+\s/)
if (chrome !== null) {
var version = parseInt(chrome[1], 10)
if (isNaN(version) === false && version >= 46) {
return true
}
}
} catch (e) {
return false
}
return false
},
init: function() {
var t = this;
try{
t.zoomImages();
t.timer = setInterval( function() { t.zoomImages(); }, t.interval );
}
catch(e){
}
},
stop: function() {
if ( this.timer )
clearInterval( this.timer );
},
getScale: function() {
var scale = detectZoom.device();
// Round up to 1.5 or the next integer below the cap.
if ( scale <= 1.0 ) scale = 1.0;
else if ( scale <= 1.5 ) scale = 1.5;
else if ( scale <= 2.0 ) scale = 2.0;
else if ( scale <= 3.0 ) scale = 3.0;
else if ( scale <= 4.0 ) scale = 4.0;
else scale = 5.0;
return scale;
},
shouldZoom: function( scale ) {
var t = this;
// Do not operate on hidden frames.
if ( "innerWidth" in window && !window.innerWidth )
return false;
// Don't do anything until scale > 1
if ( scale == 1.0 && t.zoomed == false )
return false;
return true;
},
zoomImages: function() {
var t = this;
var scale = t.getScale();
if ( ! t.shouldZoom( scale ) ){
return;
}
t.zoomed = true;
// Loop through all the elements on the page.
var imgs = document.getElementsByTagName("img");
for ( var i = 0; i < imgs.length; i++ ) {
// Wait for original images to load
if ( "complete" in imgs[i] && ! imgs[i].complete )
continue;
// Skip images that have srcset attributes.
if ( imgs[i].hasAttribute('srcset') ) {
continue;
}
// Skip images that don't need processing.
var imgScale = imgs[i].getAttribute("scale");
if ( imgScale == scale || imgScale == "0" )
continue;
// Skip images that have already failed at this scale
var scaleFail = imgs[i].getAttribute("scale-fail");
if ( scaleFail && scaleFail <= scale )
continue;
// Skip images that have no dimensions yet.
if ( ! ( imgs[i].width && imgs[i].height ) )
continue;
// Skip images from Lazy Load plugins
if ( ! imgScale && imgs[i].getAttribute("data-lazy-src") && (imgs[i].getAttribute("data-lazy-src") !== imgs[i].getAttribute("src")))
continue;
if ( t.scaleImage( imgs[i], scale ) ) {
// Mark the img as having been processed at this scale.
imgs[i].setAttribute("scale", scale);
}
else {
// Set the flag to skip this image.
imgs[i].setAttribute("scale", "0");
}
}
},
scaleImage: function( img, scale ) {
var t = this;
var newSrc = img.src;
var isFiles = false;
var isLatex = false;
var isPhoton = false;
// Skip slideshow images
if ( img.parentNode.className.match(/slideshow-slide/) )
return false;
// Skip CoBlocks Lightbox images
if ( img.parentNode.className.match(/coblocks-lightbox__image/) )
return false;
// Scale gravatars that have ?s= or ?size=
if ( img.src.match( /^https?:\/\/([^\/]*\.)?gravatar\.com\/.+[?&](s|size)=/ ) ) {
if ( this.hintsFor( "gravatar" ) === true ) {
return false;
}
newSrc = img.src.replace( /([?&](s|size)=)(\d+)/, function( $0, $1, $2, $3 ) {
// Stash the original size
var originalAtt = "originals",
originalSize = img.getAttribute(originalAtt);
if ( originalSize === null ) {
originalSize = $3;
img.setAttribute(originalAtt, originalSize);
if ( t.imgNeedsSizeAtts( img ) ) {
// Fix width and height attributes to rendered dimensions.
img.width = img.width;
img.height = img.height;
}
}
// Get the width/height of the image in CSS pixels
var size = img.clientWidth;
// Convert CSS pixels to device pixels
var targetSize = Math.ceil(img.clientWidth * scale);
// Don't go smaller than the original size
targetSize = Math.max( targetSize, originalSize );
// Don't go larger than the service supports
targetSize = Math.min( targetSize, 512 );
return $1 + targetSize;
});
}
// Scale mshots that have width
else if ( img.src.match(/^https?:\/\/([^\/]+\.)*(wordpress|wp)\.com\/mshots\/.+[?&]w=\d+/) ) {
if ( this.hintsFor( "mshots" ) === true ) {
return false;
}
newSrc = img.src.replace( /([?&]w=)(\d+)/, function($0, $1, $2) {
// Stash the original size
var originalAtt = 'originalw', originalSize = img.getAttribute(originalAtt);
if ( originalSize === null ) {
originalSize = $2;
img.setAttribute(originalAtt, originalSize);
if ( t.imgNeedsSizeAtts( img ) ) {
// Fix width and height attributes to rendered dimensions.
img.width = img.width;
img.height = img.height;
}
}
// Get the width of the image in CSS pixels
var size = img.clientWidth;
// Convert CSS pixels to device pixels
var targetSize = Math.ceil(size * scale);
// Don't go smaller than the original size
targetSize = Math.max( targetSize, originalSize );
// Don't go bigger unless the current one is actually lacking
if ( scale > img.getAttribute("scale") && targetSize <= img.naturalWidth )
targetSize = $2;
if ( $2 != targetSize )
return $1 + targetSize;
return $0;
});
// Update height attribute to match width
newSrc = newSrc.replace( /([?&]h=)(\d+)/, function($0, $1, $2) {
if ( newSrc == img.src ) {
return $0;
}
// Stash the original size
var originalAtt = 'originalh', originalSize = img.getAttribute(originalAtt);
if ( originalSize === null ) {
originalSize = $2;
img.setAttribute(originalAtt, originalSize);
}
// Get the height of the image in CSS pixels
var size = img.clientHeight;
// Convert CSS pixels to device pixels
var targetSize = Math.ceil(size * scale);
// Don't go smaller than the original size
targetSize = Math.max( targetSize, originalSize );
// Don't go bigger unless the current one is actually lacking
if ( scale > img.getAttribute("scale") && targetSize <= img.naturalHeight )
targetSize = $2;
if ( $2 != targetSize )
return $1 + targetSize;
return $0;
});
}
// Scale simple imgpress queries (s0.wp.com) that only specify w/h/fit
else if ( img.src.match(/^https?:\/\/([^\/.]+\.)*(wp|wordpress)\.com\/imgpress\?(.+)/) ) {
if ( this.hintsFor( "imgpress" ) === true ) {
return false;
}
var imgpressSafeFunctions = ["zoom", "url", "h", "w", "fit", "filter", "brightness", "contrast", "colorize", "smooth", "unsharpmask"];
// Search the query string for unsupported functions.
var qs = RegExp.$3.split('&');
for ( var q in qs ) {
q = qs[q].split('=')[0];
if ( imgpressSafeFunctions.indexOf(q) == -1 ) {
return false;
}
}
// Fix width and height attributes to rendered dimensions.
img.width = img.width;
img.height = img.height;
// Compute new src
if ( scale == 1 )
newSrc = img.src.replace(/\?(zoom=[^&]+&)?/, '?');
else
newSrc = img.src.replace(/\?(zoom=[^&]+&)?/, '?zoom=' + scale + '&');
}
// Scale files.wordpress.com, LaTeX, or Photon images (i#.wp.com)
else if (
( isFiles = img.src.match(/^https?:\/\/([^\/]+)\.files\.wordpress\.com\/.+[?&][wh]=/) ) ||
( isLatex = img.src.match(/^https?:\/\/([^\/.]+\.)*(wp|wordpress)\.com\/latex\.php\?(latex|zoom)=(.+)/) ) ||
( isPhoton = img.src.match(/^https?:\/\/i[\d]{1}\.wp\.com\/(.+)/) )
) {
if ( false !== isFiles && this.hintsFor( "files" ) === true ) {
return false
}
if ( false !== isLatex && this.hintsFor( "latex" ) === true ) {
return false
}
if ( false !== isPhoton && this.hintsFor( "photon" ) === true ) {
return false
}
// Fix width and height attributes to rendered dimensions.
img.width = img.width;
img.height = img.height;
// Compute new src
if ( scale == 1 ) {
newSrc = img.src.replace(/\?(zoom=[^&]+&)?/, '?');
} else {
newSrc = img.src;
var url_var = newSrc.match( /([?&]w=)(\d+)/ );
if ( url_var !== null && url_var[2] ) {
newSrc = newSrc.replace( url_var[0], url_var[1] + img.width );
}
url_var = newSrc.match( /([?&]h=)(\d+)/ );
if ( url_var !== null && url_var[2] ) {
newSrc = newSrc.replace( url_var[0], url_var[1] + img.height );
}
var zoom_arg = '&zoom=2';
if ( !newSrc.match( /\?/ ) ) {
zoom_arg = '?zoom=2';
}
img.setAttribute( 'srcset', newSrc + zoom_arg + ' ' + scale + 'x' );
}
}
// Scale static assets that have a name matching *-1x.png or *@1x.png
else if ( img.src.match(/^https?:\/\/[^\/]+\/.*[-@]([12])x\.(gif|jpeg|jpg|png)(\?|$)/) ) {
if ( this.hintsFor( "staticAssets" ) === true ) {
return false;
}
// Fix width and height attributes to rendered dimensions.
img.width = img.width;
img.height = img.height;
var currentSize = RegExp.$1, newSize = currentSize;
if ( scale <= 1 )
newSize = 1;
else
newSize = 2;
if ( currentSize != newSize )
newSrc = img.src.replace(/([-@])[12]x\.(gif|jpeg|jpg|png)(\?|$)/, '$1'+newSize+'x.$2$3');
}
else {
return false;
}
// Don't set img.src unless it has changed. This avoids unnecessary reloads.
if ( newSrc != img.src ) {
// Store the original img.src
var prevSrc, origSrc = img.getAttribute("src-orig");
if ( !origSrc ) {
origSrc = img.src;
img.setAttribute("src-orig", origSrc);
}
// In case of error, revert img.src
prevSrc = img.src;
img.onerror = function(){
img.src = prevSrc;
if ( img.getAttribute("scale-fail") < scale )
img.setAttribute("scale-fail", scale);
img.onerror = null;
};
// Finally load the new image
img.src = newSrc;
}
return true;
}
};
wpcom_img_zoomer.init();
;
/*! This file is auto-generated */
!function(e,t){if("function"==typeof define&&define.amd)define("hoverintent",["module"],t);else if("undefined"!=typeof exports)t(module);else{var n={exports:{}};t(n),e.hoverintent=n.exports}}(this,function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t .ab-item").focus(),y(e,"hover"))}function f(e){var t;13!==e.which||w(e.target,".ab-sub-wrapper")||(t=w(e.target,".menupop"))&&(e.preventDefault(),(o(t,"hover")?y:b)(t,"hover"))}function p(e){var t;13===e.which&&(t=e.target.getAttribute("href"),-1 {
menuItem.addEventListener( 'touchstart', ( e ) => {
const target = e.target.closest( 'li' );
if (
target.classList.contains( 'menupop' ) &&
target.getAttribute( 'id' ) !== 'wp-admin-bar-switch-site'
) {
e.preventDefault();
document.querySelectorAll( 'li.menupop' ).forEach( ( li ) => {
if ( li !== menuItem ) {
li.classList.remove( 'hover' );
}
} );
menuItem.classList.toggle( 'hover' );
}
} );
} );
}
if ( document.readyState !== 'loading' ) {
init();
} else {
document.addEventListener( 'DOMContentLoaded', init );
}
} )();
;
/**
* File primary-navigation.js.
*
* This files only gets added to themes that support the mobile nav on side
*/
( function() {
/**
* Menu Toggle Behaviors
*
* @param {Element} element
*/
var navMenu = function ( buttonId, inputId ) {
var wrapper = document.body;
var toggleButton = document.getElementById( buttonId );
var toggleInput = document.getElementById( inputId );
if ( toggleButton ) {
toggleButton.onclick = function() {
if ( true == toggleInput.checked ) {
wrapper.classList.remove( 'lock-scrolling' );
} else {
wrapper.classList.add( 'lock-scrolling' );
}
toggleButton.focus();
}
}
document.addEventListener( 'click', function( event ) {
// If target onclick is with # within the href attribute
if ( event.target.hash && event.target.hash.includes( '#' ) ) {
wrapper.classList.remove( 'lock-scrolling' );
if (toggleInput) {
toggleInput.checked = false;
}
// Wait 550 and scroll to the anchor.
setTimeout(function () {
var anchor = document.getElementById(event.target.hash.slice(1));
anchor.scrollIntoView();
}, 550);
}
} );
}
window.addEventListener( 'load', function() {
navMenu( 'toggle-menu', 'toggle' );
navMenu( 'toggle-cart', 'woocommerce-toggle' );
} );
} )();;
!function(){"use strict";var e,t,n={998:function(e,t,n){n.d(t,{B$:function(){return f},Qf:function(){return r},Uq:function(){return u},a3:function(){return l},d6:function(){return c},hA:function(){return a},j4:function(){return s},pM:function(){return o},zq:function(){return i}});var o={NOTICE:"notice",SETTINGS:"settings",HIDDEN:""},r={PURPOSE:"purpose",VENDOR:"vendor"},i=258,l={1:!0,2:!0,3:!0,4:!0,7:!0,9:!0,10:!0},a={2:!0,3:!0,4:!0,7:!0,9:!0,10:!0},c={UI_SHOWN:"cmpuishown",LOADED:"tcloaded",USER_ACTION_COMPLETE:"useractioncomplete"},u={VISIBLE:"visible",HIDDEN:"hidden",DISABLED:"disabled"},s={STUB:"stub",LOADED:"loaded",ERROR:"error"},f="euconsent-v2"},748:function(e,t,n){n.d(t,{n4:function(){return S},Vo:function(){return O}});var o,r,i=n(400),l=[],a=i.YM.__b,c=i.YM.__r,u=i.YM.diffed,s=i.YM.__c,f=i.YM.unmount;function _(){for(var e;e=l.shift();)if(e.__P)try{e.__H.__h.forEach(p),e.__H.__h.forEach(h),e.__H.__h=[]}catch(t){e.__H.__h=[],i.YM.__e(t,e.__v)}}i.YM.__b=function(e){o=null,a&&a(e)},i.YM.__r=function(e){c&&c(e),0;var t=(o=e.__c).__H;t&&(t.__h.forEach(p),t.__h.forEach(h),t.__h=[])},i.YM.diffed=function(e){u&&u(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==l.push(t)&&r===i.YM.requestAnimationFrame||((r=i.YM.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(o),d&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);d&&(t=requestAnimationFrame(n))})(_)),o=null},i.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(p),e.__h=e.__h.filter((function(e){return!e.__||h(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],i.YM.__e(n,e.__v)}})),s&&s(e,t)},i.YM.unmount=function(e){f&&f(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{p(e)}catch(e){t=e}})),t&&i.YM.__e(t,n.__v))};var d="function"==typeof requestAnimationFrame;function p(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function h(e){var t=o;e.__c=e.__(),o=t}function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function m(e){this.props=e}(m.prototype=new i.wA).isPureReactComponent=!0,m.prototype.shouldComponentUpdate=function(e,t){return y(this.props,e)||y(this.state,t)};var b=i.YM.__b;i.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),b&&b(e)};"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var g=function(e,t){return null==e?null:(0,i.bR)((0,i.bR)(e).map(t))},k=(i.bR,i.YM.__e);i.YM.__e=function(e,t,n,o){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);k(e,t,n,o)};var w=i.YM.unmount;function S(){this.__u=0,this.t=null,this.__b=null}function C(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function O(e){var t,n,o;function r(r){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return(0,i.az)(n,r)}return r.displayName="Lazy",r.__f=!0,r}function A(){this.u=null,this.o=null}i.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),w&&w(e)},(S.prototype=new i.wA).__c=function(e,t){var n=t.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var r=C(o.__v),i=!1,l=function(){i||(i=!0,n.__R=null,r?r(a):a())};n.__R=l;var a=function(){if(!--o.__u){if(o.state.__e){var e=o.state.__e;o.__v.__k[0]=function e(t,n,o){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,o)})),t.__c&&t.__c.__P===n&&(t.__e&&o.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=o)),t}(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__e:o.__b=null});t=o.t.pop();)t.forceUpdate()}},c=!0===t.__h;o.__u++||c||o.setState({__e:o.__b=o.__v.__k[0]}),e.then(l,l)},S.prototype.componentWillUnmount=function(){this.t=[]},S.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=v({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,o)}))),t}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__e&&(0,i.az)(i.HY,null,e.fallback);return r&&(r.__h=null),[(0,i.az)(i.HY,null,t.__e?null:e.children),r]};var P=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]2&&(a.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(l in e.defaultProps)void 0===a[l]&&(a[l]=e.defaultProps[l]);return v(e,a,r,i,null)}function v(e,t,n,o,l){var a={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==l?++i:l};return null==l&&null!=r.vnode&&r.vnode(a),a}function y(){return{current:null}}function m(e){return e.children}function b(e,t){this.props=e,this.context=t}function g(e,t){if(null==t)return e.__?g(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t0?v(h.type,h.props,h.key,null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(p=w[_])||p&&h.key==p.key&&h.type===p.type)w[_]=void 0;else for(d=0;d2&&(a.children=arguments.length>3?o.call(arguments,2):n),v(e.type,a,r||e.key,i||e.ref,null)}function R(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(w)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}o=f.slice,r={__e:function(e,t,n,o){for(var r,i,l;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),l=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),l=r.__d),l)return r.__E=r}catch(t){e=t}throw e}},i=0,b.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},n),this.props)),e&&d(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),w(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),w(this))},b.prototype.render=m,l=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,S.__r=0,u=0}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={id:e,exports:{}};return n[e](i,i.exports,r),i.exports}r.m=n,r.amdO={},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=function(e){return Promise.all(Object.keys(r.f).reduce((function(t,n){return r.f[n](e,t),t}),[]))},r.u=function(e){return{143:"app",571:"settings",664:"notice"}[e]+".bundle.js?id="+{143:"432ca0b0e43c55bb1713",571:"2a75c4392d80f27a77ce",664:"580b1f18df005471bb6a"}[e]},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="a8c-cmp:",r.l=function(n,o,i,l){if(e[n])e[n].push(o);else{var a,c;if(void 0!==i)for(var u=document.getElementsByTagName("script"),s=0;se.length)&&(t=e.length);for(var n=0,o=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],i=(0,t.Vo)((function(){return r.e(143).then(r.bind(r,972))}));(0,e.sY)((0,e.h)(t.n4,null,(0,e.h)(i,{model:this.model,acceptAll:this.acceptAllHandler,rejectAll:this.rejectAllHandler,save:this.saveHandler,fetchGlobalVendorList:this.fetchGlobalVendorListHandler,path:this.config.modulePath,_:this.config._,mode:n,noticeAsModal:this.config.noticeAsModal,closable:o,closed:this.closeHandler})),this.getAppContainer())}},{key:"showUi",value:function(){this.displayStatus!==A.Uq.VISIBLE&&(this.renderApp(A.pM.SETTINGS,!0),this.bumpStat("wordads_cmp_view","cookie"),this.eventStatus=A.d6.UI_SHOWN,this.displayStatus=A.Uq.VISIBLE,this.notify())}},{key:"bumpStat",value:function(e,t){var n={};n["x_"+e]=t,window._stq=window._stq||[],window._stq.push(["extra",n])}},{key:"setConsentCookie",value:function(e){var t;if(!this.config.skipConsentSave){var n=new XMLHttpRequest;n.open("POST","/wp-admin/admin-ajax.php",!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),(e=null!==(t=e)&&void 0!==t?t:{}).action="gdpr_set_consent",e.security=this.config.ajaxNonce,e.consent=C.serialize(this.model);var o=Object.keys(e).map((function(t){return t+"="+encodeURIComponent(e[t])})).join("&");n.send(o)}}},{key:"fetchGlobalVendorListHandler",value:function(){var e=this,t=new XMLHttpRequest;return new Promise((function(n,o){t.onreadystatechange=function(){4===t.readyState&&(200===this.status?n(JSON.parse(this.response)):o({status:t.status,statusText:t.statusText}))},t.open("GET",e.config.gvlPath,!0),t.send()}))}},{key:"acceptAllHandler",value:function(){this.model.vendorListVersion=this.config.gvlVersion,this.model.created=E.getUTCDay(new Date),this.model.lastUpdated=this.model.created,this.model.purpose={consents:A.a3,legitimateInterests:A.hA},this.model.vendor={consents:this.config.vendorsAll,legitimateInterests:this.config.vendorsLegInterest},this.model.nonIABVendor={consents:this.config.nonIABVendorsAll||{}},this.eventStatus=A.d6.USER_ACTION_COMPLETE,this.displayStatus=A.Uq.HIDDEN,this.notify(),this.setConsentCookie({type:"accept_all"})}},{key:"rejectAllHandler",value:function(){this.model.vendorListVersion=this.config.gvlVersion,this.model.created=E.getUTCDay(new Date),this.model.lastUpdated=this.model.created,this.model.purpose={consents:{},legitimateInterests:A.hA},this.model.vendor={consents:{},legitimateInterests:this.config.vendorsLegInterest},this.model.nonIABVendor={consents:{}},this.eventStatus=A.d6.USER_ACTION_COMPLETE,this.displayStatus=A.Uq.HIDDEN,this.notify(),this.setConsentCookie({type:"reject_all"})}},{key:"saveHandler",value:function(e){this.model=e,this.model.vendorListVersion=this.config.gvlVersion,this.model.created=E.getUTCDay(new Date),this.model.lastUpdated=this.model.created,this.eventStatus=A.d6.USER_ACTION_COMPLETE,this.displayStatus=A.Uq.HIDDEN,this.notify(),this.setConsentCookie({type:"custom"})}},{key:"closeHandler",value:function(){this.displayStatus=A.Uq.HIDDEN}},{key:"getTCData",value:function(){return{tcString:C.serialize(this.model),tcfPolicyVersion:this.model.tcfPolicyVersion,cmpId:this.model.cmpId,cmpVersion:this.model.cmpVersion,gdprApplies:!0,eventStatus:this.eventStatus,cmpStatus:this.cmpStatus,isServiceSpecific:this.model.isServiceSpecific,useNonStandardStacks:this.model.useNonStandardStacks,publisherCC:this.model.publisherCC,purposeOneTreatment:this.model.purposeOneTreatment,purpose:this.model.purpose,vendor:this.model.vendor,specialFeatureOptIns:this.model.specialFeatureOptIns}}},{key:"getNonIABVendorConsents",value:function(){return{gdprApplies:!0,nonIabVendorConsents:this.model.nonIABVendor.consents}}},{key:"notify",value:function(){var e=this.getTCData();this.listeners.forEach((function(t){e.listenerId=t.listenerId,t.callback(e,!0)}))}},{key:"addListener",value:function(e){var t=Math.floor(999999*Math.random()),n={listenerId:t,callback:e};return this.listeners.push(n),t}},{key:"removeListener",value:function(e){this.listeners=this.listeners.filter((function(t){return t.listenerId!==e}))}},{key:"commandHandler",value:function(){var e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=2?void 0:arguments[2],n=arguments.length<=3?void 0:arguments[3];if("ping"===e){var o={gdprApplies:!0,cmpLoaded:!0,cmpStatus:this.cmpStatus,displayStatus:this.displayStatus,apiVersion:"2",cmpVersion:this.model.cmpVersion,cmpId:this.model.cmpId,gvlVersion:this.model.vendorListVersion,tcfPolicyVersion:this.model.tcfPolicyVersion};"function"==typeof t&&t(o,!0)}else if("addEventListener"===e){var r=this.addListener(t);t(M(M({},this.getTCData()),{},{listenerId:r}),!0)}else"removeEventListener"===e?(this.removeListener(n),t(!0)):"getTCData"===e?"function"==typeof t&&t(this.getTCData(),!0):"getNonIABVendorConsents"===e?"function"==typeof t&&t(this.getNonIABVendorConsents(),!0):"showUi"!==e&&"displayConsentUi"!==e||this.showUi()}}],l&&D(i.prototype,l),a&&D(i,a),Object.defineProperty(i,"prototype",{writable:!1}),n}();new V}()}();;
/* globals JSON */
( function () {
var eventName = 'wpcom_masterbar_click';
var linksTracksEvents = {
// top level items
'wp-admin-bar-blog' : 'my_sites',
'wp-admin-bar-newdash' : 'reader',
'wp-admin-bar-ab-new-post' : 'write_button',
'wp-admin-bar-my-account' : 'my_account',
'wp-admin-bar-notes' : 'notifications',
// my sites - top items
'wp-admin-bar-switch-site' : 'my_sites_switch_site',
'wp-admin-bar-blog-info' : 'my_sites_site_info',
'wp-admin-bar-site-view' : 'my_sites_view_site',
'wp-admin-bar-blog-stats' : 'my_sites_site_stats',
'wp-admin-bar-plan' : 'my_sites_plan',
'wp-admin-bar-plan-badge' : 'my_sites_plan_badge',
// my sites - manage
'wp-admin-bar-edit-page' : 'my_sites_manage_site_pages',
'wp-admin-bar-new-page-badge' : 'my_sites_manage_add_page',
'wp-admin-bar-edit-post' : 'my_sites_manage_blog_posts',
'wp-admin-bar-new-post-badge' : 'my_sites_manage_add_post',
'wp-admin-bar-edit-attachment' : 'my_sites_manage_media',
'wp-admin-bar-new-attachment-badge' : 'my_sites_manage_add_media',
'wp-admin-bar-comments' : 'my_sites_manage_comments',
'wp-admin-bar-edit-jetpack-testimonial' : 'my_sites_manage_testimonials',
'wp-admin-bar-new-jetpack-testimonial' : 'my_sites_manage_add_testimonial',
'wp-admin-bar-edit-jetpack-portfolio' : 'my_sites_manage_portfolio',
'wp-admin-bar-new-jetpack-portfolio' : 'my_sites_manage_add_portfolio',
// my sites - personalize
'wp-admin-bar-themes' : 'my_sites_personalize_themes',
'wp-admin-bar-cmz' : 'my_sites_personalize_themes_customize',
// my sites - configure
'wp-admin-bar-sharing' : 'my_sites_configure_sharing',
'wp-admin-bar-people' : 'my_sites_configure_people',
'wp-admin-bar-people-add' : 'my_sites_configure_people_add_button',
'wp-admin-bar-plugins' : 'my_sites_configure_plugins',
'wp-admin-bar-domains' : 'my_sites_configure_domains',
'wp-admin-bar-domains-add' : 'my_sites_configure_add_domain',
'wp-admin-bar-blog-settings' : 'my_sites_configure_settings',
'wp-admin-bar-legacy-dashboard' : 'my_sites_configure_wp_admin',
// reader
'wp-admin-bar-followed-sites' : 'reader_followed_sites',
'wp-admin-bar-reader-followed-sites-manage': 'reader_manage_followed_sites',
'wp-admin-bar-discover-discover' : 'reader_discover',
'wp-admin-bar-discover-search' : 'reader_search',
'wp-admin-bar-my-activity-my-likes' : 'reader_my_likes',
// account
'wp-admin-bar-user-info' : 'my_account_user_name',
// account - profile
'wp-admin-bar-my-profile' : 'my_account_profile_my_profile',
'wp-admin-bar-account-settings' : 'my_account_profile_account_settings',
'wp-admin-bar-billing' : 'my_account_profile_manage_purchases',
'wp-admin-bar-security' : 'my_account_profile_security',
'wp-admin-bar-notifications' : 'my_account_profile_notifications',
// account - special
'wp-admin-bar-get-apps' : 'my_account_special_get_apps',
'wp-admin-bar-next-steps' : 'my_account_special_next_steps',
'wp-admin-bar-help' : 'my_account_special_help',
};
var notesTracksEvents = {
openSite: function ( data ) {
return {
clicked: 'masterbar_notifications_panel_site',
site_id: data.siteId
};
},
openPost: function ( data ) {
return {
clicked: 'masterbar_notifications_panel_post',
site_id: data.siteId,
post_id: data.postId
};
},
openComment: function ( data ) {
return {
clicked: 'masterbar_notifications_panel_comment',
site_id: data.siteId,
post_id: data.postId,
comment_id: data.commentId
};
}
};
// Element.prototype.matches as a standalone function, with old browser fallback
function matches( node, selector ) {
if ( ! node ) {
return undefined;
}
if ( ! Element.prototype.matches && ! Element.prototype.msMatchesSelector ) {
throw new Error( 'Unsupported browser' );
}
return Element.prototype.matches ? node.matches( selector ) : node.msMatchesSelector( selector );
}
// Element.prototype.closest as a standalone function, with old browser fallback
function closest( node, selector ) {
if ( ! node ) {
return undefined;
}
if ( Element.prototype.closest ) {
return node.closest( selector );
}
do {
if ( matches( node, selector ) ) {
return node;
}
node = node.parentElement || node.parentNode;
} while ( node !== null && node.nodeType === 1 );
return null;
}
function recordTracksEvent( eventProps ) {
eventProps = eventProps || {};
window._tkq = window._tkq || [];
window._tkq.push( [ 'recordEvent', eventName, eventProps ] );
}
function parseJson( s, defaultValue ) {
try {
return JSON.parse( s );
} catch ( e ) {
return defaultValue;
}
}
function createTrackableLinkEventHandler( link ) {
return function () {
var parent = closest( link, 'li' );
if ( ! parent ) {
return;
}
var trackingId = link.getAttribute( 'ID' ) || parent.getAttribute( 'ID' );
if ( ! linksTracksEvents.hasOwnProperty( trackingId ) ) {
return;
}
var eventProps = { 'clicked': linksTracksEvents[ trackingId ] };
recordTracksEvent( eventProps );
}
}
function init() {
var trackableLinkSelector = '.mb-trackable .ab-item:not(div),' +
'#wp-admin-bar-notes .ab-item,' +
'#wp-admin-bar-user-info .ab-item,' +
'.mb-trackable .ab-secondary';
var trackableLinks = document.querySelectorAll( trackableLinkSelector );
for ( var i = 0; i < trackableLinks.length; i++ ) {
var link = trackableLinks[ i ];
var handler = createTrackableLinkEventHandler( link );
link.addEventListener( 'click', handler );
link.addEventListener( 'touchstart', handler );
}
}
if ( document.readyState === 'loading' ) {
document.addEventListener( 'DOMContentLoaded', init );
} else {
init();
}
// listen for postMessage events from the notifications iframe
window.addEventListener( 'message', function ( event ) {
if ( event.origin !== 'https://widgets.wp.com' ) {
return;
}
var data = ( typeof event.data === 'string' ) ? parseJson( event.data, {} ) : event.data;
if ( data.type !== 'notesIframeMessage' ) {
return;
}
var eventData = notesTracksEvents[ data.action ];
if ( ! eventData ) {
return;
}
recordTracksEvent( eventData( data ) );
}, false );
} )();
;