"use strict";var siteCorrectorViewModel=function(e){var t={resources:e};return t.siteSelection=ko.observable(),t.siteSelection.DOMElement=document.querySelector("#site-corrector"),t.bodyInnerElement=document.querySelector("#body-inner"),t.changeSite=function(){var e=new RegExp("(".concat(window.location.protocol,"//").concat(window.location.host,"/)([a-z-]*)(/.*)?$"));if("country-picker"!=t.siteSelection()){var o=e.exec(window.location.href),i="";4==o.length?i=window.location.href.replace(e,"$1".concat(t.siteSelection(),"$3")):3==o.length&&(i=window.location.href.replace(e,"$1".concat(t.siteSelection(),"$2"))),window.location.href=i}else window.location.href="".concat(window.location.protocol,"//").concat(window.location.host,"/l50")},t.hide=function(){t.siteSelection.DOMElement.classList.remove("open");var e=t.siteSelection.DOMElement.scrollHeight,o=t.siteSelection.DOMElement.style.transition;t.siteSelection.DOMElement.style.transition="",requestAnimationFrame((function(){t.siteSelection.DOMElement.style.height=e+"px",t.siteSelection.DOMElement.style.transition=o,requestAnimationFrame((function(){t.siteSelection.DOMElement.style.height="0px"}))})),t.siteSelection.DOMElement.setAttribute("data-collapsed","true"),t.dismiss()},t.toggle=function(e){return t.siteSelection.DOMElement.classList.contains("open")?t.hide():t.show(),e.stopPropagation(),!0},t.show=function(){t.siteSelection.DOMElement.classList.add("open");var e=t.siteSelection.DOMElement,o=e.scrollHeight;e.style.height=o+"px",e.addEventListener("transitionend",(function(t){e.removeEventListener("transitionend",arguments.callee),e.style.height="auto"})),e.setAttribute("data-collapsed","false")},t.dismiss=function(){fetch("/api/generalapi/CountryCorrectorDismissed",{method:"POST",headers:window.fetchHeaders,cache:"no-cache",credentials:"same-origin"})},t.init=function(){t.show(),window.setTimeout((function(){window.scrollTo({top:0,left:0,behavior:"auto"})}),300)},t};window.siteCorrectorModel=siteCorrectorViewModel(),window.siteCorrectorModel.init(),ko.applyBindings(window.siteCorrectorModel,document.querySelector("#site-corrector"));
///*# sourceMappingURL=https://www.designersguild.com/js/dist/models/common/site-corrector.min.js.map */
;
