!function(){"use strict";var t={response:null,getEndpointURL:function(t){var e,s="undefined"!=typeof wp&&wp.customize&&wp.customize.settings&&wp.customize.settings.url&&wp.customize.settings.url.self;s?(e=document.createElement("a")).href=wp.customize.settings.url.self:e=document.location,"string"==typeof t&&t.match(/^https?:\/\//)&&((e=document.createElement("a")).href=t);var a="relatedposts=1",r=document.querySelector("#jp-relatedposts");if(!r)return!1;r.hasAttribute("data-exclude")&&(a+="&relatedposts_exclude="+r.getAttribute("data-exclude")),s&&(a+="&jetpackrpcustomize=1");var o=e.pathname;return"/"!==o[0]&&(o="/"+o),""===e.search?o+"?"+a:o+e.search+"&"+a},getAnchor:function(t,e){var s=t.title,a=document.createElement("a");return a.setAttribute("class",e),a.setAttribute("href",t.url),a.setAttribute("title",s),a.setAttribute("data-origin",t.url_meta.origin),a.setAttribute("data-position",t.url_meta.position),""!==t.rel&&a.setAttribute("rel",t.rel),a},cleanHtml:function(t){var e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""},generateMinimalDiv:function(t,e){var s=this,a=document.createElement("div");return a.setAttribute("class","jp-relatedposts-items jp-relatedposts-items-minimal jp-relatedposts-"+e.layout),t.forEach(function(t,r){var o="jp-relatedposts-post jp-relatedposts-post"+r;t.classes.length>0&&(o+=" "+t.classes.join(" "));var n=document.createElement("p");n.setAttribute("class",o),n.setAttribute("data-post-id",t.id),n.setAttribute("data-post-format",t.format),a.appendChild(n);var i=document.createElement("span");i.setAttribute("class","jp-relatedposts-post-title"),n.appendChild(i);var p=s.getAnchor(t,"jp-relatedposts-post-a");if(i.appendChild(p),p.textContent=s.cleanHtml(t.title),e.showDate){var l=document.createElement("time");l.setAttribute("class","jp-relatedposts-post-date"),l.setAttribute("datetime",t.date),l.textContent=t.date,n.appendChild(l)}if(e.showContext){var c=document.createElement("span");c.setAttribute("class","jp-relatedposts-post-context"),c.textContent=s.cleanHtml(t.context),n.appendChild(c)}}),a},generateVisualDiv:function(t,e){var s=this,a=document.createElement("div");return a.setAttribute("class","jp-relatedposts-items jp-relatedposts-items-visual jp-relatedposts-"+e.layout),t.forEach(function(t,r){var o="jp-relatedposts-post jp-relatedposts-post"+r;t.classes.length>0&&(o+=" "+t.classes.join(" ")),t.img.src?o+=" jp-relatedposts-post-thumbs":o+=" jp-relatedposts-post-nothumbs";var n=document.createElement("div");if(n.setAttribute("class",o),n.setAttribute("data-post-id",t.id),n.setAttribute("data-post-format",t.format),a.appendChild(n),t.img.src){var i=s.getAnchor(t,"jp-relatedposts-post-a");n.appendChild(i);var p=document.createElement("img");p.setAttribute("class","jp-relatedposts-post-img"),p.setAttribute("loading","lazy"),p.setAttribute("src",t.img.src),p.setAttribute("width",t.img.width),p.setAttribute("height",t.img.height),t.img.srcset&&p.setAttribute("srcset",t.img.srcset),t.img.sizes&&p.setAttribute("sizes",t.img.sizes),p.setAttribute("alt",t.img.alt_text),i.appendChild(p)}else{var l=s.getAnchor(t,"jp-relatedposts-post-a jp-relatedposts-post-aoverlay");n.appendChild(l)}var c=document.createElement(related_posts_js_options.post_heading);c.setAttribute("class","jp-relatedposts-post-title"),n.appendChild(c);var d=s.getAnchor(t,"jp-relatedposts-post-a");d.textContent=s.cleanHtml(t.title),c.appendChild(d);var u=document.createElement("p");if(u.setAttribute("class","jp-relatedposts-post-excerpt"),u.textContent=s.cleanHtml(t.excerpt),n.appendChild(u),e.showDate){var m=document.createElement("time");m.setAttribute("class","jp-relatedposts-post-date"),m.setAttribute("datetime",t.date),m.textContent=t.date,n.appendChild(m)}if(e.showContext){var h=document.createElement("p");h.setAttribute("class","jp-relatedposts-post-context"),h.textContent=s.cleanHtml(t.context),n.appendChild(h)}}),a},setVisualExcerptHeights:function(){var t=document.querySelectorAll("#jp-relatedposts .jp-relatedposts-post-nothumbs .jp-relatedposts-post-excerpt");if(t.length)for(var e=getComputedStyle(t[0]),s=parseInt(e.fontSize,10),a=parseInt(e.lineHeight,10),r=0;r