<script>
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)) {
let popupOpen = false;
let openLink = "#popup";
if(document.location.hash==openLink) document.location.hash='';
let bodyMode = document.querySelector('.t-body');
let observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
setTimeout(function(){
if (bodyMode.classList.contains('t-body_popupshowed')) {
let path = window.location.pathname;
if( (window.location.hash=="" && !path.includes('/tproduct/') ) || window.location.hash.includes('/tproduct/') ) {
window.location.hash = openLink;
popupOpen=true;
};
}else{
// if(window.location.hash == openLink ) history.pushState("", document.title, window.location.pathname);
};
}, 100);
});
});
observer.observe( bodyMode, { attributes: true, attributeFilter: ['class'] });
window.addEventListener("hashchange", function(){
let hash = window.location.hash;
if ( hash!=openLink && popupOpen && bodyMode.classList.contains('t-body_popupshowed') ){
let popUpOpn = document.querySelector(".t-popup_show .t-popup__close");
if(popUpOpn) popUpOpn.click();
};
});
};
</script>