window.Tilda=window.Tilda||{},function(){function e(){var e=navigator.userAgent.toLowerCase(),t=-1!==e.indexOf("msie")&&parseInt(e.split("msie")[1]);if(8===t||9===t){var r=document.querySelectorAll(".t-btn");Array.prototype.forEach.call(r,(function(e){var t=e.getAttribute("href");e.querySelector("table")&&t&&-1===t.indexOf("#popup:")&&-1===t.indexOf("#price:")&&e.addEventListener("click",(function(e){var t=e.target.getAttribute("href");e.preventDefault(),window.location.href=t}))}))}try{var a=document.getElementById("allrecords"),i=a?a.getAttribute("data-tilda-cookie"):null;a&&"no"===i||Tilda.saveUTM()}catch(e){}var o=document.querySelectorAll(".r");function d(e){var t=e.target.closest("a.js-click-stat")||e.target.closest(".js-click-zero-stat");if(e.target&&t){var r=t.getAttribute("data-tilda-event-name"),a=t.textContent,i=t.getAttribute("href")||"",o=t.getAttribute("target");if(!r){var d=t.closest(".r"),c;r="/tilda/click/"+(d?d.getAttribute("id"):"")+"/?url="+i}if(Tilda.sendEventToStatistics(r,a),"http"===i.substring(0,4)&&-1===i.indexOf(".typeform.com/"))return window.setTimeout((function(){var e="",t="";if("_blank"===o){if(-1!==i.indexOf("?")&&(e=i.split("?"),i=e[0],-1!==(e=e[1]).indexOf("#")&&(e=e.split("#"),i=i+"#"+e[1],e=e[0]),e=e.split("&")),document.getElementById("tildaredirectform")?(document.getElementById("tildaredirectform").setAttribute("method","GET"),document.getElementById("tildaredirectform").setAttribute("action",i)):document.body.insertAdjacentHTML("beforeend",''),t="",e.length>0)for(var r in e){var a=e[r].indexOf("=");if(a>-1){var d=e[r].substring(0,a),c=e[r].substring(a+1);d&&(t+='')}}if(""===t)window.open(i,"_blank");else{var n=document.getElementById("tildaredirectform");n&&(n.innerHTML=t,n.submit())}}else window.location.href=i}),300),e.preventDefault(),!1}}Array.prototype.forEach.call(o,(function(e){e.removeEventListener("click",d),e.addEventListener("click",d)}));var c=document.querySelectorAll("input.js-amount");Array.prototype.forEach.call(c,(function(e){var t=e.value;t=t.replace(/,/g,"."),t=parseFloat(t.replace(/[^0-9\.]/g,"")),e.value=t}))}Tilda.sendEcommerceEvent=function(e,t){if(void 0===t||0===t.length)return!1;if(void 0===e||"add"!==e&&"remove"!==e&&"purchase"!==e&&"detail"!==e)return!1;for(var r,a="",i=0,o=[],d,c,n="",m="",l="",u=0;u""&&(a+=", "),a+=(c=t[u]).name,i+=c.price,d="",void 0!==c.options&&c.options.length>0&&Array.prototype.forEach.call(c.options,(function(e){d+=e.option+": "+e.variant+"; "}));var p={name:c.name,price:c.price,variant:d,quantity:1};c.id&&c.id>0&&(id=c.id,p.id=c.id),c.uid&&c.uid>0&&(m=c.uid,p.uid=c.uid),c.recid&&c.recid>0&&(n=c.recid,p.recid=c.recid),c.lid&&c.lid>0&&(l=c.lid,p.lid=c.lid),c.sku&&c.sku>0&&(p.sku=c.sku),o[o.length]=p}var p;"add"!==e&&"remove"!==e||(r="/tilda/cart/"+e+"/",n>0&&(r+=""+n),m>0?r+="-u"+m:l>0&&(r+="-"+l)),"detail"===e&&(r="/tilda/product/detail/",m>0?r+=m+"/":(n>0&&(r+="r"+n),l>0&&(r+="-l"+l))),"purchase"===e&&(r="/tilda/rec"+n+"/payment/"),(p={ecommerce:{}}).ecommerce[e]={products:o},Tilda.sendEventToStatistics(r,a,p,i)},Tilda.sendEventToStatistics=function(e,t,r,a){var i="/"===e.substring(0,1),o=[],d,c;(d=document.getElementById("allrecords"))&&(c=null!==d.getAttribute("data-fb-event")?d.getAttribute("data-fb-event"):window.jQuery&&void 0!==$("#allrecords").data("fb-event")?$("#allrecords").data("fb-event"):null);var n=!(!c||"nosend"!==c),m=d?d.getAttribute("data-vk-event"):null;d&&(m=null!==d.getAttribute("data-vk-event")?d.getAttribute("data-vk-event"):window.jQuery&&void 0!==$("#allrecords").data("vk-event")?$("#allrecords").data("vk-event"):null);var l=!(!m||"nosend"!==m),u="",p=document.querySelector(".t706");if(u=d.getAttribute("data-tilda-currency")?d.getAttribute("data-tilda-currency"):p&&p.getAttribute("data-project-currency-code")?p.getAttribute("data-project-currency-code"):"RUB",r||(r=window.location.href),(a=a?parseFloat(a):0)>0)if(window.dataLayer||(window.dataLayer=[]),-1!==e.indexOf("/tilda/")&&-1!==e.indexOf("/payment/")&&window.tildaForm&&window.tildaForm.orderIdForStat>"")r={ecommerce:{purchase:{actionField:{id:window.tildaForm.orderIdForStat,revenue:window.tildaForm.amountForStat},products:window.tildaForm.arProductsForStat}}},window.tildaForm.tildapayment&&window.tildaForm.tildapayment.promocode&&(r.ecommerce.purchase.actionField.coupon=window.tildaForm.tildapayment.promocode),r.event="purchase";else if(r&&r.ecommerce&&(r.ecommerce.add&&r.ecommerce.add.products?o=r.ecommerce.add.products:r.ecommerce.remove&&r.ecommerce.remove.products?o=r.ecommerce.remove.products:r.ecommerce.detail&&r.ecommerce.detail.products&&(o=r.ecommerce.detail.products),o&&o.length>0)){for(var s=0;s0?r&&r.ecommerce?window.dataLayer.push(r):window.dataLayer.push({event:"pageView",eventAction:e,title:t,value:a,product:r}):window.dataLayer.push({event:"pageView",eventAction:e,title:t,referer:r}):r&&r.ecommerce?window.dataLayer.push(r):window.dataLayer.push({event:e,eventAction:t,value:a,referer:r}));try{var v;if(window.gtagTrackerID&&"gtag"===window.mainTracker)if(i)if(r&&r.event)if("purchase"===r.event){for(var o=r.ecommerce.purchase.products,w=0,f=0;f0&&"function"==typeof ym)if(i){var h={title:t};a>0?(h.params={order_price:a},u&&(h.params.currency=u),ym(window.mainMetrikaId,"hit",e,h)):ym(window.mainMetrikaId,"hit",e,h)}else a>0?(h={order_price:a},u&&(h.currency=u),ym(window.mainMetrikaId,"reachGoal",e,h)):ym(window.mainMetrikaId,"reachGoal",e);if(window.mainMetrika>""&&window[window.mainMetrika]&&(i?a>0?window[window.mainMetrika].hit(e,{title:t,order_price:a,params:r}):window[window.mainMetrika].hit(e,{title:t}):a>0?window[window.mainMetrika].reachGoal(e,{title:t,params:r,order_price:a}):window[window.mainMetrika].reachGoal(e,{title:t,referer:r})),void 0!==window.fbq&&!1===n)try{if(i)if(-1===e.indexOf("tilda/")||-1===e.indexOf("/payment/")&&-1===e.indexOf("/submitted/"))if(r&&r.event&&a>0)if("addToCart"===r.event&&r.ecommerce.add){for(var g,y=r.ecommerce.add.products.length,k=[],f=0;f0&&u?window.fbq("track","InitiateCheckout",{content_name:t,content_category:e,value:a,currency:u}):window.fbq("track","Lead",{content_name:t,content_category:e});else window.fbq("track",e,{content_name:t,value:a})}catch(e){}if(void 0!==window.VK&&void 0!==window.VK.Retargeting&&!1===l)try{if(i){var d,b=(d=document.getElementById("allrecords"))?d.getAttribute("data-vk-price-list-id"):null,_=b&&parseInt(b)||0,T="",A=!1,E,E,E,E,E;if(r&&r.event)if(A={products:[],currency_code:"",total_price:0},"purchase"===r.event&&r.ecommerce.purchase)if(a>0&&_>0){var g;A.currency_code=u;for(var y=r.ecommerce.purchase.products.length,k=[],f=0;f0&&_>0){var g;A.currency_code=u;for(var y=r.ecommerce.add.products.length,k=[],f=0;f0&&_>0){var g;A.currency_code=u;for(var y=r.ecommerce.detail.products.length,k=[],f=0;f0&&_>0){var g;A.currency_code=u;for(var y=r.ecommerce.remove.products.length,k=[],f=0;f0&&A&&A.currency_code?(VK.Retargeting.Event("purchase"),VK.Retargeting.ProductEvent(_,T,A)):(VK.Retargeting.Event(T),"t-purchase"===T.substring(0,10)?VK.Goal("purchase"):"t-lead"===T.substring(0,6)&&VK.Goal("lead"))}else VK.Retargeting.Event(e)}catch(e){}if(window.mainMailruId>"0"){var F=window._tmr||(window._tmr=[]);i?a>0?F.push({id:""+window.mainMailruId,type:"pageView",url:e,value:a,start:(new Date).getTime()}):F.push({id:""+window.mainMailruId,type:"pageView",url:e,start:(new Date).getTime()}):a>0?F.push({id:""+window.mainMailruId,type:"reachGoal",goal:e,value:a}):F.push({id:""+window.mainMailruId,type:"reachGoal",goal:e})}"function"==typeof window.tildastat&&(i?(e.indexOf("payment")>0&&e.indexOf("tilda/form")>-1&&(e=e.replace("tilda/form","tilda/rec")),window.tildastat("pageview",{page:e})):window.tildastat("pageview",{page:"/tilda/event/"+e}))},Tilda.saveUTM=function(){try{var e=window.location.href,t="",r="";if(-1!==e.toLowerCase().indexOf("utm_")&&"string"==typeof(t=(t=(e=e.toLowerCase()).split("?"))[1])){var a,i=t.split("&");for(var o in i)"amp;"===(a=i[o].split("="))[0].substring(0,4)&&(a[0]=a[0].substring(4)),"utm_"===a[0].substring(0,4)&&(r=r+i[o]+"|||");if(r.length>0){var d=new Date;d.setDate(d.getDate()+30),document.cookie="TILDAUTM="+encodeURIComponent(r)+"; path=/; expires="+d.toUTCString()}}}catch(e){}},"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)}(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}return null});