const socials = {
facebook: ``,
google: ``,
mailru: ``,
odnoklassniki: ``,
vkontakte: ``,
yandex: ``
}
const css = '.social-reg-wrapper{width:fit-content;display:flex;padding:15px}.social-reg-wrapper .item:last-of-type{margin:0}.social-reg-wrapper .item{margin-right:10px;width:36px;height:36px;display:flex;justify-content:center;align-items:center;border:1px solid #000000ff;border-radius:50%;box-sizing:border-box}.social-reg-wrapper .social__google{box-shadow:0 1px 4px #00000019;background:#fff;border-color:#fff;padding:9px}.social-reg-wrapper .social__yandex{background:#f8333cff;border-color:#f8333cff}.social-reg-wrapper .social__odnoklassniki{background:#f78422ff;border-color:#f78422ff}.social-reg-wrapper .social__mailru{background:#178ce2ff;border-color:#178ce2ff}.social-reg-wrapper .social__vkontakte{background:#44678dff;border-color:#44678dff}';
function initSocialReg() {
const redirectTo = encodeURIComponent('/auth/social/registration' + document.location.search);
fetch(`https://yynthdwrnifduaabg.com/api/2/socialauth?redirectTo=${redirectTo}&pid=567fb7af195c81857a38b64fb7b27906a49f4d87520d2b89a2e885e8998f77dd`).then(async (res) => {
const config = await res.json();
const items = config._items;
const wrapper = document.querySelector('[data-social-reg]');
wrapper.setAttribute('class', 'social-reg-wrapper');
items.forEach(item => {
const block = document.createElement('a');
block.setAttribute('class', `item social__${item.name}`);
block.setAttribute('href', `${item.authServerUrl}`);
block.innerHTML = socials[item.name];
wrapper.appendChild(block);
});
const linkElement = this.document.createElement('link');
linkElement.setAttribute('rel', 'stylesheet');
linkElement.setAttribute('type', 'text/css');
linkElement.setAttribute('href', 'data:text/css;charset=UTF-8,' + encodeURIComponent(css));
document.head.appendChild(linkElement);
});
}