// source --> https://armadillo-msk.ru/wp-content/plugins/jetpack/_inc/build/related-posts/related-posts.min.js?ver=20240116 
!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",o=document.querySelector("#jp-relatedposts");if(!o)return!1;o.hasAttribute("data-exclude")&&(a+="&relatedposts_exclude="+o.getAttribute("data-exclude")),s&&(a+="&jetpackrpcustomize=1");var r=e.pathname;return"/"!==r[0]&&(r="/"+r),""===e.search?r+"?"+a:r+e.search+"&"+a},getAnchor:function(t,e){var s=t.title,a=document.createElement("a");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);var o=document.createElement("div");o.appendChild(a);var r=o.innerHTML;return[r.substring(0,r.length-4),"</a>"]},generateMinimalHtml:function(t,e){var s=this,a="";return t.forEach(function(t,o){var r=s.getAnchor(t,"jp-relatedposts-post-a"),p="jp-relatedposts-post jp-relatedposts-post"+o;t.classes.length>0&&(p+=" "+t.classes.join(" ")),a+='<p class="'+p+'" data-post-id="'+t.id+'" data-post-format="'+t.format+'">',a+='<span class="jp-relatedposts-post-title">'+r[0]+t.title+r[1]+"</span>",e.showDate&&(a+='<time class="jp-relatedposts-post-date" datetime="'+t.date+'">'+t.date+"</time>"),e.showContext&&(a+='<span class="jp-relatedposts-post-context">'+t.context+"</span>"),a+="</p>"}),'<div class="jp-relatedposts-items jp-relatedposts-items-minimal jp-relatedposts-'+e.layout+' ">'+a+"</div>"},generateVisualHtml:function(t,e){var s=this,a="";return t.forEach(function(t,o){var r=s.getAnchor(t,"jp-relatedposts-post-a"),p="jp-relatedposts-post jp-relatedposts-post"+o;t.classes.length>0&&(p+=" "+t.classes.join(" ")),t.img.src?p+=" jp-relatedposts-post-thumbs":p+=" jp-relatedposts-post-nothumbs";var i=document.createElement("p");i.innerHTML=t.excerpt;var n=i.textContent;if(a+='<div class="'+p+'" data-post-id="'+t.id+'" data-post-format="'+t.format+'">',t.img.src)a+=r[0]+'<img class="jp-relatedposts-post-img" loading="lazy" src="'+t.img.src+'" width="'+t.img.width+'" height="'+t.img.height+(t.img.srcset?'" srcset="'+t.img.srcset:"")+(t.img.sizes?'" sizes="'+t.img.sizes:"")+'" alt="'+t.img.alt_text+'" />'+r[1];else{var l=s.getAnchor(t,"jp-relatedposts-post-a jp-relatedposts-post-aoverlay");a+=l[0]+l[1]}a+="<"+related_posts_js_options.post_heading+' class="jp-relatedposts-post-title">'+r[0]+t.title+r[1]+"</"+related_posts_js_options.post_heading+">",a+='<p class="jp-relatedposts-post-excerpt">'+n+"</p>",e.showDate&&(a+='<time class="jp-relatedposts-post-date" datetime="'+t.date+'">'+t.date+"</time>"),e.showContext&&(a+='<p class="jp-relatedposts-post-context">'+t.context+"</p>"),a+="</div>"}),'<div class="jp-relatedposts-items jp-relatedposts-items-visual jp-relatedposts-'+e.layout+' ">'+a+"</div>"},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),o=0;o<t.length;o++)t[o].style.maxHeight=5*a/s+"em"},getTrackedUrl:function(t){var e="relatedposts_hit=1";e+="&relatedposts_origin="+t.getAttribute("data-origin"),e+="&relatedposts_position="+t.getAttribute("data-position");var s=t.pathname;return"/"!==s[0]&&(s="/"+s),""===t.search?s+"?"+e:s+t.search+"&"+e},cleanupTrackedUrl:function(){if("function"==typeof history.replaceState){var t=document.location.search.replace(/\brelatedposts_[a-z]+=[0-9]*&?\b/gi,"");"?"===t&&(t=""),document.location.search!==t&&history.replaceState({},document.title,document.location.pathname+t)}}};function e(){t.setVisualExcerptHeights();var e=document.querySelectorAll("#jp-relatedposts a.jp-relatedposts-post-a");Array.prototype.forEach.call(e,function(e){document.addEventListener("click",function(){e.href=t.getTrackedUrl(e)})})}function s(){t.cleanupTrackedUrl();var s=t.getEndpointURL();if(s)if(document.querySelectorAll("#jp-relatedposts .jp-relatedposts-post").length)e();else{var a=document.querySelector("#jp-relatedposts"),o=new XMLHttpRequest;o.open("GET",s,!0),o.setRequestHeader("x-requested-with","XMLHttpRequest"),o.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&200===this.status)try{var s=JSON.parse(o.responseText);if(0===s.items.length||0===a.length)return;t.response=s;var r,p,i={};"undefined"!=typeof wp&&wp.customize?(p=wp.customize.instance("jetpack_relatedposts[show_thumbnails]").get(),i.showDate=wp.customize.instance("jetpack_relatedposts[show_date]").get(),i.showContext=wp.customize.instance("jetpack_relatedposts[show_context]").get(),i.layout=wp.customize.instance("jetpack_relatedposts[layout]").get()):(p=s.show_thumbnails,i.showDate=s.show_date,i.showContext=s.show_context,i.layout=s.layout),r=p?t.generateVisualHtml(s.items,i):t.generateMinimalHtml(s.items,i);var n=document.createElement("div");if(a.appendChild(n),n.outerHTML=r,i.showDate){var l=a.querySelectorAll(".jp-relatedposts-post-date");Array.prototype.forEach.call(l,function(t){t.style.display="block"})}a.style.display="block",e()}catch{}},o.send()}}function a(){"undefined"!=typeof wp&&wp.customize?(wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",function(t){"jetpack_relatedposts"===t.partial.id&&s()}),wp.customize.bind("preview-ready",s)):s()}"loading"!==document.readyState?a():document.addEventListener("DOMContentLoaded",a)}();
// source --> https://armadillo-msk.ru/wp-content/plugins/wp-yandex-metrika/assets/YmEc.min.js?ver=1.2.4 
function YmEc(options){const self=this;let products={};let cartItems={};let detailProductId=null;let currency=null;let hasActiveVariation=false;let sentDetails=[];let dataLayerName=options?options:"dataLayer";window[dataLayerName]=window[dataLayerName]||[];this.addData=function(data){if(!data){return}if(data.products){this.registerProducts(data.products)}if(data.cartItems){this.registerCartItems(data.cartItems)}if(data.currency){this.setCurrency(data.currency)}if(data.detailProductId){this.setDetailProductId(data.detailProductId)}if(data.hasActiveVariation){hasActiveVariation=true}if(data.actions){for(var index in data.actions){var action=data.actions[index];this.send(action.type,action.data)}}if(data.purchase){this.sendPurchase(data.purchase.actionField,data.purchase.products)}};this.registerCartItem=function(hash,data){cartItems[hash]=data};this.registerProduct=function(id,data){if(typeof data==="string"){console.log(data);try{data=JSON.parse(data)}catch(e){console.log("При регистрации товара произошла ошибка - неверная JSON строка");return}}products[id]=data};this.registerProducts=function(products){for(var productId in products){if(!products.hasOwnProperty(productId)){continue}self.registerProduct(productId,products[productId])}};this.registerCartItems=function(cartItems){for(var hash in cartItems){if(!cartItems.hasOwnProperty(hash)){continue}self.registerCartItem(hash,cartItems[hash])}};this.isDetail=function(){return!!detailProductId};this.hasActiveVariation=function(){return hasActiveVariation};this.setDetailProductId=function(productId){detailProductId=productId};this.setCurrency=function(currencyCode){currency=currencyCode};this.getCurrency=function(){return currency};this.getDetailProductId=function(){return detailProductId};this.getProduct=function(id){return products[id]||null};this.getProductByHash=function(hash){if(!cartItems.hasOwnProperty(hash)){return null}const productId=cartItems[hash].id;return products[productId]||null};this.getProducts=function(){return products};this.getCartItems=function(){return cartItems};this.clearCartItems=function(){cartItems={}};this.clearProducts=function(){products={}};this.updateCartItems=function(newCartItems){for(let hash in cartItems){const cartItem=cartItems[hash];if(typeof newCartItems[hash]==="undefined"){this.send("remove",hash,{quantity:cartItem.quantity});delete cartItems[hash]}}for(let hash in newCartItems){const newCartItem=newCartItems[hash];const lastCartItem=cartItems[hash];const quantity=Math.abs(newCartItem.quantity-lastCartItem.quantity);const type=newCartItem.quantity>lastCartItem.quantity?"add":"remove";if(quantity>0){this.send(type,hash,{quantity:quantity})}lastCartItem.quantity=newCartItem.quantity}};this.send=function(type,product,additionalData){if(["string","number"].indexOf(typeof product)>-1){product=self.getProduct(product)}if(!product){console.log("Не удалось найти данные товара для отправки в электронную коммерцию",product);return}additionalData=additionalData||{};for(let key in additionalData){if(!additionalData.hasOwnProperty(key)){continue}product[key]=additionalData[key]}const dataLayerData={ecommerce:{}};dataLayerData.ecommerce[type]={products:[product]};if(currency){dataLayerData["ecommerce"]["currencyCode"]=currency}window[dataLayerName].push(dataLayerData)};this.sendPurchase=function(actionField,products){const dataLayerData={ecommerce:{purchase:{actionField:actionField,products:products}}};if(currency){dataLayerData["ecommerce"]["currencyCode"]=currency}window[dataLayerName].push(dataLayerData)}};