var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); ( function () { var MOBILE_BP = 900; // lrg-screen breakpoint /****************************************************************************** * HELPERS *****************************************************************************/ // Make sure the function `fn` is called only once during an interval of `wait` milliseconds. function throttle( fn, wait ) { var time = Date.now(); return function () { if ( Date.now() - time > wait ) { fn(); time = Date.now(); } } }; // Get the last focusable child of an element function getLastFocusableChild( elt ) { var focusableElts = elt.querySelectorAll( 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' ); return focusableElts.length > 0 ? focusableElts[focusableElts.length - 1] : null; } /****************************************************************************** * NAVIGATION MENUS *****************************************************************************/ // Make menus expandable jetpackMeReady( function () { function toggleMenuItem( btn, menu ) { var expanded = btn.getAttribute( 'aria-expanded' ) === 'true' || false; btn.setAttribute( 'aria-expanded', !expanded ); menu.hidden = !menu.hidden; } function collapseExpandedMenu() { var expandedBtn = document.querySelector( '.js-menu-btn[aria-expanded="true"]' ); if ( expandedBtn ) { var menu = expandedBtn.parentNode.querySelector( '.js-menu' ); if ( menu ) { toggleMenuItem( expandedBtn, menu ); } } } function initMenu( btn ) { var menu = btn.parentNode.querySelector( '.js-menu' ); if ( !menu ) { return; } menu.classList.add( 'js' ); menu.hidden = true; var toggle = function () { toggleMenuItem( btn, menu ); }; btn.addEventListener( 'click', function ( e ) { e.preventDefault(); if ( btn.getAttribute( 'aria-expanded' ) === 'false' ) { collapseExpandedMenu(); } toggle(); } ); menu.addEventListener( 'click', function ( e ) { // If user clicks menu backdrop if ( e.target === menu ) { toggle(); } } ); var backBtn = menu.querySelector( '.js-menu-back' ); if ( backBtn ) { backBtn.addEventListener( 'click', function ( e ) { toggle(); } ); } // Collapse menu when focusing out var lastFocusable = getLastFocusableChild( menu ); if ( lastFocusable ) { lastFocusable.addEventListener( 'focusout', toggle ); } } var menuBtns = document.querySelectorAll( '.js-menu-btn' ); Array.prototype.forEach.call( menuBtns, initMenu ); // Close expanded menu on Esc keypress document.addEventListener( 'keydown', function ( event ) { if ( event.key === "Escape" ) { collapseExpandedMenu(); } } ); } ); /****************************************************************************** * NAVIGATION MORE MENU *****************************************************************************/ // Display "More" button if items of the section navigation overflow jetpackMeReady( function () { function initMore() { var moreBtn = document.querySelector( '.js-more-btn' ); var moreItem = document.querySelector( '.js-more' ); var list = document.querySelector( '.js-nav-list' ); var items = list ? list.children : []; if ( !items.length || !moreBtn || !moreItem ) { return; } moreItem.classList.add( 'js' ); // Get items spacing var style = window.getComputedStyle( items[0] ); var itemMargin = style ? parseInt( style.marginLeft, 10 ) : 0; // Get "More" button width moreBtn.hidden = false; var moreWidth = moreBtn.clientWidth; moreBtn.hidden = true; // Show items back if they were hidden Array.prototype.find.call( items, function ( item ) { item.hidden = false; } ); // Get list dimensions var listRect = list.getBoundingClientRect(); var listLeft = listRect.left; var listWidth = listRect.right - listLeft; // Return early if sections navigation doesn't overflow, or if mobile if ( listWidth + 2 * itemMargin > list.scrollWidth || window.innerWidth <= MOBILE_BP ) { return; } // Store items to hide var overflowingItems = []; Array.prototype.find.call( items, function ( item ) { if ( !item.classList.contains( 'js-more' ) ) { var itemRect = item.getBoundingClientRect(); var itemWidth = itemRect.right - itemRect.left; var itemX = itemRect.left - listLeft; // Leave space to display the "More" button if ( itemX + itemWidth + moreWidth + 2 * itemMargin > listWidth ) { overflowingItems.push( item ); } } } ); if ( !overflowingItems.length ) { return; } // Hide overflowing items Array.prototype.find.call( overflowingItems, function ( item ) { item.hidden = true; } ); // Show "More" button moreBtn.hidden = false; // Create "More" menu var markup = ''; Array.prototype.find.call( overflowingItems, function ( item ) { var link = item.querySelector( 'a' ); if ( link ) { markup += '<li>' + '<a class="header__submenu-link" href="' + link.getAttribute( 'href' ) + '">' + '<span class="header__submenu-label">' + link.innerText + '</span>' + '</a>' + '</li>' } } ); var container = document.querySelector( '.js-more-container' ); if ( container ) { container.innerHTML = markup; } } initMore(); window.addEventListener( 'resize', throttle( initMore, 100 ) ); } ); /****************************************************************************** * HEADER SCROLL *****************************************************************************/ // Make header opaque as user starts to scroll jetpackMeReady( function () { var classModifier = 'is-opaque'; var threshold = 100; var nav = document.querySelector( '.js-header' ); if ( !nav ) { return; } function toggleHeaderOpacity() { if ( window.pageYOffset >= threshold ) { nav.classList.add( classModifier ); } else { nav.classList.remove( classModifier ); } }; function onResize() { if ( window.innerWidth > MOBILE_BP ) { document.addEventListener( 'scroll', onScroll ); } else { document.removeEventListener( 'scroll', onScroll ); } } var onScroll = throttle( toggleHeaderOpacity, 10 ); window.addEventListener( 'resize', onResize ); window.addEventListener( 'load', onResize ); } ); /****************************************************************************** * USER MENU *****************************************************************************/ // Make user menu expandable jetpackMeReady( function () { var menu = document.querySelector( '.js-user-menu' ); var btn = document.querySelector( '.js-user-menu-btn' ); if ( !menu || !btn ) { return; } menu.classList.add( 'js' ); menu.hidden = true; function onDocumentClick( e ) { if ( !menu.contains( e.target ) ) { btn.setAttribute( 'aria-expanded', false ); menu.hidden = true; } } function toggle() { var expanded = btn.getAttribute( 'aria-expanded' ) === 'true' || false; if ( expanded ) { document.removeEventListener( 'click', onDocumentClick ); } else { document.addEventListener( 'click', onDocumentClick ); } btn.setAttribute( 'aria-expanded', !expanded ); menu.hidden = !menu.hidden; } btn.addEventListener( 'click', function ( e ) { e.preventDefault(); e.stopPropagation(); toggle(); } ); // Collapse menu when focusing out var lastFocusable = getLastFocusableChild( menu ); if ( lastFocusable ) { lastFocusable.addEventListener( 'focusout', toggle ); } } ); /****************************************************************************** * MOBILE MENU *****************************************************************************/ // Make mobile menu expandable jetpackMeReady( function () { var menu = document.querySelector( '.js-mobile-menu' ); var btn = document.querySelector( '.js-mobile-btn' ); var body = document.querySelector( 'body' ); if ( !menu || !btn ) { return; } function toggle() { var expanded = btn.getAttribute( 'aria-expanded' ) === 'true' || false; btn.setAttribute( 'aria-expanded', !expanded ); if ( !expanded ) { menu.classList.add( 'is-expanded' ); body.classList.add( 'no-scroll' ); } else { menu.classList.remove( 'is-expanded' ); body.classList.remove( 'no-scroll' ); } } btn.addEventListener( 'click', function ( e ) { e.preventDefault(); toggle(); } ); window.addEventListener( 'resize', function () { if ( window.innerWidth > MOBILE_BP ) { body.classList.remove( 'no-scroll' ); } } ); // Collapse menu when focusing out var lastFocusable = getLastFocusableChild( menu ); if ( lastFocusable ) { lastFocusable.addEventListener( 'focusout', function () { if ( btn.getAttribute( 'aria-expanded' ) === 'true' ) { toggle(); } } ); } // Close expanded menu on Esc keypress document.addEventListener( 'keydown', function ( event ) { if ( event.key === "Escape" && btn.getAttribute( 'aria-expanded' ) === 'true' ) { toggle(); } } ); } ); /****************************************************************************** * TRACKING *****************************************************************************/ jetpackMeReady( function () { window._tkq = window._tkq || []; var map = { '.js-manage-sites': 'jetpack_com_managesites_click', '.js-login': 'jetpack_com_login_click', '.js-get-started': 'jetpack_com_getstarted_click', '.js-upgrade': 'jetpack_com_upgrade_click', } Array.prototype.forEach.call( Object.keys( map ), function ( key ) { var elt = document.querySelector( key ); if ( elt ) { elt.addEventListener( 'click', function () { window._tkq.push( [ 'recordEvent', map[key], ] ); } ); } } ); } ); } )();; var WPCOMLocaleSwitcher = ( function( document ) { // Settings var s = { locales: [], current: '', switcherTitle: '', overlayId: 'ls-overlay', overlayCloseId: 'ls-overlay-close', cookieName: 'wpcom_locale', cookieDomain: '', defaultTitle: 'Language', visible: false }, // DOM objects o = {}; function on ( evnt, el, func) { if ( el.addEventListener ) { el.addEventListener( evnt, func, false ); } else if ( el.attachEvent ) { el.attachEvent("on" + evnt, func); } } function toggleSwitcher() { if ( s.visible === false ) { s.visible = true; o.overlay.style.display = 'block'; setTimeout(function() { o.overlay.setAttribute( 'class', 'animate slide-in-up' ); }, 50); } else { s.visible = false; o.overlay.setAttribute( 'class', 'slide-in-up' ); setTimeout(function() { o.overlay.style.display = 'none'; }, 500); } } function localeMouseover() { o.heading.childNodes[0].nodeValue = this.getAttribute( 'data-locale-title' ); } function localeMouseout() { o.heading.childNodes[0].nodeValue = s.switcherTitle; } function localeClick( e ) { e.preventDefault(); if ( -1 != this.href.indexOf( '#' ) ) { toggleSwitcher(); return false; } var currentActive = o.list.querySelector('.active'); if ( typeof currentActive === 'object' && typeof currentActive === 'function' ) { currentActive.setAttribute('class', ''); } this.parentNode.setAttribute('class', 'active'); redirect( this.getAttribute( 'data-locale-code' ), this.href + window.location.search ); } function redirect( locale, redirect_url ) { createLocaleCookie( locale ); var language_change_stat = new Image(); language_change_stat.onload = function() { window.location.href = redirect_url; }; language_change_stat.onerror = language_change_stat.onload; language_change_stat.src = document.location.protocol + '//webcf.waybackmachine.org/web/20220621220826/https://stats.wordpress.com/g.gif?v=wpcom-no-pv&x_language-switcher=manual-switch-' + locale + '&rm=' + Math.random(); return false; } function createLocaleCookie( locale ) { var date = new Date(), expires =''; date.setTime( date.getTime() + ( 5 * 365 * 24 * 60 * 60 * 1000 ) ); expires = " expires=" + date.toGMTString(); document.cookie = s.cookieName + '=' + locale + ';' + expires +'; path=/; domain=' + s.cookieDomain; } function createLocalesListItem( locale ) { var li = document.createElement( 'li'), a = document.createElement( 'a' ), title; a.innerHTML = locale.locale_name; title = typeof s.titles[locale.code] === 'object' ? s.titles[locale.code]['translation'] : s.defaultTitle; a.setAttribute( 'data-locale-code', locale.code ); a.setAttribute( 'data-locale-title', title ); if ( s.current == locale.code ) { li.setAttribute( 'class', 'active' ); a.setAttribute( 'href', '#' ); s.switcherTitle = title; } else { a.setAttribute( 'href', locale.href ); } on ( 'mouseover', a, localeMouseover ); on ( 'mouseout', a, localeMouseout ); on ( 'click', a, localeClick ); li.appendChild( a ); return li; } function createLocalesList() { var localesList = document.createElement( 'ul'), listItem; for( var i = 0, x = s.locales.length; i < x ; i++ ) { listItem = createLocalesListItem( s.locales[i] ); localesList.appendChild( listItem ); } if ( '' == s.switcherTitle ) { s.switcherTitle = s.defaultTitle; } return localesList; } function createContainer() { var overlay = document.createElement( 'div' ); overlay.id = s.overlayId; overlay.className = 'slide-in-up'; return overlay; } function createHeading() { var heading = document.createElement( 'h2' ); heading.appendChild( document.createTextNode( s.switcherTitle ) ); return heading; } function createCloseButton() { var close = document.createElement( 'span' ); close.id = s.overlayCloseId; close.setAttribute( 'class', 'noticon noticon-close-alt' ); close.onclick = toggleSwitcher; return close; } function insertSwitcher() { var localeSwitcherDiv = createContainer(), localeSwitcherList = createLocalesList(), localeSwitcherHeading = createHeading(); localeSwitcherDiv.appendChild( createCloseButton() ); o.heading = localeSwitcherDiv.appendChild( localeSwitcherHeading ); o.list = localeSwitcherDiv.appendChild( localeSwitcherList ); o.overlay = document.body.appendChild( localeSwitcherDiv ); } function bindEscapeKey() { on( 'keydown', document, function( e ){ if ( e.keyCode ==27 && 'block' == o.overlay.style.display ) { toggleSwitcher(); } }, false ); } function init ( locales, current, cookieDomain ) { if ( locales.length < 1 ) { return; } s.locales = locales; s.current = current || 'en' ; s.cookieDomain = cookieDomain || '.wordpress.com'; s.titles = typeof WPCOMLocaleSwitcherTranslations === 'object' ? WPCOMLocaleSwitcherTranslations : {}; insertSwitcher(); bindEscapeKey(); } return { init: init, toggle: toggleSwitcher, redirect: redirect } })( document ); ; var WPCOMLocaleSwitcherTranslations = {"bg":{"locale":"bg","translation":"\u0415\u0437\u0438\u043a"},"ja":{"locale":"ja","translation":"\u8a00\u8a9e"},"de":{"locale":"de","translation":"Sprache"},"fr":{"locale":"fr","translation":"Langue"},"he":{"locale":"he","translation":"\u05e9\u05e4\u05d4"},"pt":{"locale":"pt","translation":"Idioma"},"ar":{"locale":"ar","translation":"\u0627\u0644\u0644\u063a\u0629"},"az":{"locale":"az","translation":"Dil"},"be":{"locale":"be","translation":"\u041c\u043e\u0432\u0430"},"bs":{"locale":"bs","translation":"Jezik"},"ca":{"locale":"ca","translation":"Llengua "},"cs":{"locale":"cs","translation":"Jazyk"},"cy":{"locale":"cy","translation":"Iaith"},"da":{"locale":"da","translation":"Sprog"},"el-po":{"locale":"el-po","translation":"\u0393\u03bb\u1ff6\u03c3\u03c3\u03b1"},"el":{"locale":"el","translation":"\u0393\u03bb\u03ce\u03c3\u03c3\u03b1"},"eo":{"locale":"eo","translation":"Lingvo"},"es":{"locale":"es","translation":"Idioma"},"et":{"locale":"et","translation":"Keel"},"fa":{"locale":"fa","translation":"\u0632\u0628\u0627\u0646"},"fi":{"locale":"fi","translation":"Kieli"},"ga":{"locale":"ga","translation":"Teanga"},"hr":{"locale":"hr","translation":"Jezik"},"gl":{"locale":"gl","translation":"Idioma"},"hu":{"locale":"hu","translation":"Nyelv"},"id":{"locale":"id","translation":"Bahasa"},"is":{"locale":"is","translation":"Tungum\u00e1l"},"it":{"locale":"it","translation":"Lingua"},"km":{"locale":"km","translation":"\u1797\u17b6\u179f\u17b6"},"lt":{"locale":"lt","translation":"Kalba"},"lv":{"locale":"lv","translation":"Valoda"},"ml":{"locale":"ml","translation":"\u0d2d\u0d3e\u0d37"},"mn":{"locale":"mn","translation":"\u0425\u044d\u043b"},"ms":{"locale":"ms","translation":"Bahasa"},"mwl":{"locale":"mwl","translation":"Lh\u00e9ngua"},"nl":{"locale":"nl","translation":"Taal"},"nn":{"locale":"nn","translation":"Spr\u00e5k"},"no":{"locale":"no","translation":"Spr\u00e5k"},"oc":{"locale":"oc","translation":"Lenga"},"pl":{"locale":"pl","translation":"J\u0119zyk"},"pt-br":{"locale":"pt-br","translation":"Idioma"},"ro":{"locale":"ro","translation":"Limb\u0103"},"ru":{"locale":"ru","translation":"\u042f\u0437\u044b\u043a"},"sk":{"locale":"sk","translation":"Jazyk"},"sq":{"locale":"sq","translation":"Gjuh\u00eb"},"sr":{"locale":"sr","translation":"\u0408\u0435\u0437\u0438\u043a"},"su":{"locale":"su","translation":"Basa"},"sv":{"locale":"sv","translation":"Spr\u00e5k"},"ta":{"locale":"ta","translation":"\u0bae\u0bca\u0bb4\u0bbf"},"te":{"locale":"te","translation":"\u0c2d\u0c3e\u0c37"},"th":{"locale":"th","translation":"\u0e20\u0e32\u0e29\u0e32"},"tl":{"locale":"tl","translation":"Wika"},"tr":{"locale":"tr","translation":"Dil"},"uk":{"locale":"uk","translation":"\u041c\u043e\u0432\u0430"},"vi":{"locale":"vi","translation":"Ng\u00f4n ng\u1eef"},"zh":{"locale":"zh","translation":"\u8a9e\u8a00"},"zh-cn":{"locale":"zh-cn","translation":"\u8bed\u8a00"},"zh-tw":{"locale":"zh-tw","translation":"\u8a9e\u8a00"},"hy":{"locale":"hy","translation":"\u053c\u0565\u0566\u0578\u0582"},"ug":{"locale":"ug","translation":"\u062a\u0649\u0644"},"br":{"locale":"br","translation":"Yezh"},"bo":{"locale":"bo","translation":"\u0f66\u0f90\u0f51\u0f0b\u0f61\u0f72\u0f42"},"ko":{"locale":"ko","translation":"\uc5b8\uc5b4"},"fr-ch":{"locale":"fr-ch","translation":"Langue"},"kk":{"locale":"kk","translation":"\u0422\u0456\u043b\u0456"},"kn":{"locale":"kn","translation":"\u0cad\u0cbe\u0cb7\u0cc6"},"hi":{"locale":"hi","translation":"\u092d\u093e\u0937\u093e"},"ne":{"locale":"ne","translation":"\u092d\u093e\u0937\u093e"},"bn":{"locale":"bn","translation":"\u09ad\u09be\u09b7\u09be"},"mk":{"locale":"mk","translation":"\u0408\u0430\u0437\u0438\u043a"},"gu":{"locale":"gu","translation":"\u0aad\u0abe\u0ab7\u0abe"},"fo":{"locale":"fo","translation":"Tungum\u00e1l"},"es-pr":{"locale":"es-pr","translation":"Idioma"},"fr-ca":{"locale":"fr-ca","translation":"Langue"},"sah":{"locale":"sah","translation":"\u0422\u0443\u0442\u0442\u0430\u0440 \u0442\u044b\u043b\u044b\u04a5"},"rup":{"locale":"rup","translation":"Limb\u00e3"},"eu":{"locale":"eu","translation":"Hizkuntza"},"rue":{"locale":"rue","translation":"\u042f\u0437\u044b\u043a"},"gd":{"locale":"gd","translation":"C\u00e0nan"},"af":{"locale":"af","translation":"Taal"},"en":{"locale":"en","translation":"Language"}};; /* 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-ab-plan-upsell' : 'plan_upsell_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://webcf.waybackmachine.org/web/20220621220826/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 ); } )(); ; } /* FILE ARCHIVED ON 22:08:26 Jun 21, 2022 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 10:12:00 Nov 16, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): captures_list: 0.695 exclusion.robots: 0.036 exclusion.robots.policy: 0.021 esindex: 0.01 cdx.remote: 5.803 LoadShardBlock: 92.412 (3) PetaboxLoader3.datanode: 164.846 (5) load_resource: 306.371 (2) PetaboxLoader3.resolve: 162.862 (2) */