(function() {
    "use strict";

    console.log('AAA login page');
   
  const select = (el, all = false) => {
    el = el.trim()
    if (all) {
      return [...document.querySelectorAll(el)]
    } else {
      return document.querySelector(el)
    }
  }
    
  const on = (type, el, listener, all = false) => {
    let selectEl = select(el, all)
    if (selectEl) {
      if (all) {
        selectEl.forEach(e => e.addEventListener(type, listener))
      } else {
        selectEl.addEventListener(type, listener)
      }
    }
  }
  
    let email = select('.b-email');
    let social = select('.b-social');
    
    function ToggleAuthBlock()
    {
        email.classList.toggle('m-hide');
        social.classList.toggle('m-hide');
    }
    
    on('click', '.btn-email', function(e) {
        ToggleAuthBlock();
    });

    on('click', '.b-email_back', function(e) {
        ToggleAuthBlock();
    });

    
    

})()