(()=>{function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function t(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=window.ag_stepped.age,i=t((function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n(this,"init",(function(){t.form.setAttribute("novalidate",!0),t.inputSubmit.style.display="none",t.wrapper.classList.add("age-gate--stepped"),t.inputYear.addEventListener("keyup",t.handleYear),t.inputMonth.addEventListener("keyup",t.handleMonth)})),n(this,"handleYear",(function(e){t.inputYear.value.length===t.inputYear.maxLength&&(parseInt(t.inputYear.value)!==t.minYear?t.passed||(t.passed=!0,t.inputDay.value="01",t.inputMonth.value="01",t.form.requestSubmit()):(t.inputMonth.value="",t.inputDay.value="",t.inputMonth.focus()))})),n(this,"handleMonth",(function(e){t.inputMonth.value.length===t.inputMonth.maxLength&&(t.inputMonth.value<t.minMonth?(t.inputDay.value="01",t.passed||t.form.requestSubmit()):(t.inputSubmit.style.display="",t.wrapper.classList.remove("age-gate--stepped"),t.inputYear.removeEventListener("keyup",t.handleYear),t.inputMonth.removeEventListener("keyup",t.handleMonth),t.inputDay.value="",t.inputDay.focus()))}));var i=new Date;i.setFullYear(i.getFullYear()-a);var r=i.toISOString().split("T").slice(0,1)[0].split("-");this.form=document.querySelector(".age-gate-form, .age-gate__form"),"requestSubmit"in this.form!=!1&&(this.passed=!1,this.inputDay=this.form.querySelector('[name="age_gate[d]"]'),this.inputMonth=this.form.querySelector('[name="age_gate[m]"]'),this.inputYear=this.form.querySelector('[name="age_gate[y]"]'),this.inputSubmit=this.form.querySelector(".age-gate-submit, .age-gate__submit"),this.elements=this.form.querySelector(".age-gate-form-elements, .age-gate__form-elements"),this.wrapper=this.form.parentNode,this.inputDay.tabIndex="-1",this.inputMonth.tabIndex="-1",this.current="y",this.userYear=0,this.userMonth=0,this.userDay=0,this.minYear=parseInt(r[0]),this.minMonth=parseInt(r[1]),this.minDay=parseInt(r[2]),this.init())}));window.addEventListener("age_gate_shown",(function(){new i}))})();