marketing/autocart.js
2026-08-21 17:52:45 +03:00

1 line
31 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const _0x53b88d=_0x5445;(function(_0x417d9c,_0x32e292){const _0x58c073=_0x5445,_0x4dea6b=_0x417d9c();while(!![]){try{const _0x565155=parseInt(_0x58c073(0x146))/0x1*(parseInt(_0x58c073(0xe6))/0x2)+-parseInt(_0x58c073(0x183))/0x3*(parseInt(_0x58c073(0x10a))/0x4)+-parseInt(_0x58c073(0xee))/0x5*(parseInt(_0x58c073(0x16e))/0x6)+parseInt(_0x58c073(0x16f))/0x7+-parseInt(_0x58c073(0xf3))/0x8+parseInt(_0x58c073(0x16b))/0x9+-parseInt(_0x58c073(0x118))/0xa;if(_0x565155===_0x32e292)break;else _0x4dea6b['push'](_0x4dea6b['shift']());}catch(_0xe98ec4){_0x4dea6b['push'](_0x4dea6b['shift']());}}}(_0x50d2,0xbc9ee));function _0x50d2(){const _0x4cc02a=['forEach','.cart-footer','\x22>×</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','textContent','/api/guest/init_cookie?utm_source=hvatilo_promo','round','.tag','https://hvatilo.ru','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22item-image\x22><img\x20src=\x22','14811JUrFrN','</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22age\x22>','include','slice','{SIZE}','дней','.days-options\x20.day-btn',',\x20точность\x20','findIndex','Пожалуйста,\x20введите\x20имя.','#personModal\x20.autocomplete-list[data-type=\x22','hidden','/api/promo/get_initial_data','need_refresh','товаров','push','#personModal\x20.pref-input','log','.accordion-header','человека','currency','className','querySelectorAll','avoid','clear','payload','offsetHeight','setItem','inputName','cookie-popup','#personModal\x20.tags-wrap','classList','index','Возраст\x20должен\x20быть\x20от\x207\x20лет.','active','total-price','cart','maxHeight','resize','scroll-wrapper','application/json','show','replace','flex','from','Редактировать\x20человека','48338QSThBR','</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22item-price\x22>','reject','cookie_accepted','true','modalTitle','.day-btn','url','65KDsKpI','has','json','дня','catch','1224232bfKnVz','.show-more','cookie-accept','input','click','value','trim','reduce','RUB','\x22\x20alt=\x22\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22item-details\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22item-name\x22>','.cart-summary','flat','.subtitle','open','createElement','#personModal\x20.tags-wrap[data-target=\x22avoid\x22]','inputWeight','chunk','.reorder-btn','.menu-replace','style','precision','error_message','588HEXSyH','товар','closest','name','.menu-remove','family-list','type','/api/promo/set_option','DOMContentLoaded','stopPropagation','auto','\x22>&#8942;</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22menu-dropdown\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<ul>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li\x20class=\x22menu-replace\x22>Заменить</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li\x20class=\x22menu-remove\x22>Удалить</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</ul>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','now','waiting','6641040pcKdVR','.gender-btn[data-gender=\x22m\x22]','dataset','category','cart-item','total_price','500px','users','.menu-btn-wrapper','.menu-btn','closeModalBtn','display','.gender-btn','excess','.col-left','remove','initial_groups','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22avatar\x22>','stringify','.gender-btn.active','toLowerCase','.cart-item','/api/guest/clear_cookie','overflowY','height','weight','top','splice','map','unit','товара','/api/promo/delete_item','.menu-dropdown.active','collapsed','getBoundingClientRect','family-desc','gender','\x20&times;\x20','innerHeight','apply','children','toggle','image','none','leading','category-btn\x20','5iszkJH','expand-categories','add','status','.family-member','filter','inputAge','show-more-btn','#personModal\x20.tags-wrap[data-target=\x22','categories','family-member','button','querySelector','appendChild','.summary-days','personModal','isArray','addMemberBtn','\x20шт','inputHeight','65,fit','день','location','div','then','cart-list','человек','\x20₽</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22menu-btn-wrapper\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22menu-btn\x22\x20data-index=\x22','\x20&bull;\x20','includes','/api/guest/refresh_cookie','favorite','days','target','length','.accordion-item','POST','12925899ASscmT','inactive','tag-red','212682MBNkPb','8534519uQGpFW','addEventListener','price','/api/promo/replace_item','contains','.delete-member','nextElementSibling','trailing','innerHTML','getElementById','remaining-count'];_0x50d2=function(){return _0x4cc02a;};return _0x50d2();}const host=_0x53b88d(0x181);function throttle(_0x5ef192,_0x44a65a,_0x136433){var _0x484d0b,_0xeda83b,_0x19021f,_0x485841=null,_0x5d8398=0x0;if(!_0x136433)_0x136433={};var _0x538ccb=function(){const _0x37a112=_0x5445;_0x5d8398=_0x136433[_0x37a112(0x144)]===![]?0x0:Date['now'](),_0x485841=null,_0x19021f=_0x5ef192[_0x37a112(0x13f)](_0x484d0b,_0xeda83b);if(!_0x485841)_0x484d0b=_0xeda83b=null;};return function(){const _0x2b7ad3=_0x5445;var _0x3aab1d=Date[_0x2b7ad3(0x116)]();if(!_0x5d8398&&_0x136433[_0x2b7ad3(0x144)]===![])_0x5d8398=_0x3aab1d;var _0x5d63a7=_0x44a65a-(_0x3aab1d-_0x5d8398);_0x484d0b=this,_0xeda83b=arguments;if(_0x5d63a7<=0x0||_0x5d63a7>_0x44a65a){_0x485841&&(clearTimeout(_0x485841),_0x485841=null);_0x5d8398=_0x3aab1d,_0x19021f=_0x5ef192['apply'](_0x484d0b,_0xeda83b);if(!_0x485841)_0x484d0b=_0xeda83b=null;}else!_0x485841&&_0x136433[_0x2b7ad3(0x176)]!==![]&&(_0x485841=setTimeout(_0x538ccb,_0x5d63a7));return _0x19021f;};}function refreshToken(){const _0x2f6223=_0x53b88d;return fetch(host+_0x2f6223(0x164),{'method':_0x2f6223(0x16a),'credentials':_0x2f6223(0x185)})['then'](_0x14bc15=>{const _0x2631e9=_0x2f6223;return _0x14bc15[_0x2631e9(0xf0)]();});}function initToken(){const _0x5a1461=_0x53b88d;return fetch(host+_0x5a1461(0x17e),{'method':'POST','credentials':_0x5a1461(0x185)})['then'](_0x3712ae=>{const _0x1c909d=_0x5a1461;return _0x3712ae[_0x1c909d(0xf0)]();});}const requestWithRefresh=async function(_0x1d59c6,_0x553b50){const _0x150df0=_0x53b88d;return fetch(_0x1d59c6,{..._0x553b50,'credentials':'include'})['then'](async _0xc528a3=>_0xc528a3[_0x150df0(0xf0)]())[_0x150df0(0x15e)](async _0x4c6b55=>{const _0x54115a=_0x150df0;if(_0x4c6b55[_0x54115a(0x109)]===_0x54115a(0x190))return refreshToken()[_0x54115a(0x15e)](_0x47ddec=>{const _0x56df48=_0x54115a;return console[_0x56df48(0x194)](_0x56df48(0xed),_0x1d59c6),fetch(_0x1d59c6,{..._0x553b50,'credentials':'include'})[_0x56df48(0x15e)](_0x2a618b=>_0x2a618b['json']());});return _0x4c6b55;});},replaceProduct=async function(_0x1dee29){const _0x4d44bd=_0x53b88d;return requestWithRefresh(host+_0x4d44bd(0x172),{'method':'POST','headers':{'Content-Type':_0x4d44bd(0xe0)},'body':JSON[_0x4d44bd(0x12a)]({'product_name':_0x1dee29})})[_0x4d44bd(0x15e)](async()=>{updateCart();});},deleteProduct=async function(_0x127542){const _0x527fcd=_0x53b88d;return requestWithRefresh(host+_0x527fcd(0x137),{'method':_0x527fcd(0x16a),'headers':{'Content-Type':_0x527fcd(0xe0)},'body':JSON[_0x527fcd(0x12a)]({'product_name':_0x127542})});},updateCart=throttle(async function(){const _0x463520=_0x53b88d;return requestWithRefresh(host+'/api/promo/get_updates',{'headers':{'Content-Type':_0x463520(0xe0)}})[_0x463520(0x15e)](_0x1dc21e=>{const _0x4e9f63=_0x463520;_0x1dc21e[_0x4e9f63(0x149)]!=='complete'&&(initialData_g[_0x4e9f63(0x125)]=_0x1dc21e['payload'][_0x4e9f63(0x125)],initialData_g[_0x4e9f63(0x108)]=_0x1dc21e[_0x4e9f63(0x19c)][_0x4e9f63(0x108)],_0x1dc21e[_0x4e9f63(0x149)]===_0x4e9f63(0x19b)&&(allProducts=[],visibleProducts=[],renderProducts(),allProducts=_0x1dc21e[_0x4e9f63(0x19c)]['chunk'],visibleProducts=_0x1dc21e['payload'][_0x4e9f63(0x104)]),_0x1dc21e[_0x4e9f63(0x149)]==='data'&&_0x1dc21e[_0x4e9f63(0x19c)]['chunk']['forEach'](_0x413e2f=>{const _0x3e3d2b=_0x4e9f63;let _0x526c01=allProducts[_0x3e3d2b(0x18b)](_0x242c2b=>_0x242c2b[_0x3e3d2b(0x10d)]===_0x413e2f['name']);_0x526c01===-0x1?(allProducts['push']({..._0x413e2f,'image':_0x413e2f['image']?.[_0x3e3d2b(0xe2)](_0x3e3d2b(0x187),'65,fit')}),visibleProducts['length']===allProducts[_0x3e3d2b(0x168)]-0x1&&(visibleProducts=allProducts)):(allProducts[_0x526c01]['n']+=_0x413e2f['n'],_0x526c01<visibleProducts['length']&&(visibleProducts[_0x526c01]=allProducts[_0x526c01]));}),console[_0x4e9f63(0x194)](allProducts[_0x4e9f63(0x168)],visibleProducts[_0x4e9f63(0x168)]),_0x1dc21e[_0x4e9f63(0x149)]!==_0x4e9f63(0x117)&&renderProducts(),updateCart());})[_0x463520(0xf2)](()=>{updateCart();});},0xbb8),setOption=(_0x261ebb,_0x3fc9ae)=>{const _0x3f7690=_0x53b88d;return requestWithRefresh(host+_0x3f7690(0x111),{'method':_0x3f7690(0x16a),'headers':{'Content-Type':_0x3f7690(0xe0)},'body':JSON[_0x3f7690(0x12a)]({[_0x261ebb]:_0x3fc9ae})})[_0x3f7690(0x15e)](async _0x57714f=>{wholeRender(await loadInitData()),updateCart();});},loadInitData=async function(){const _0x5e3288=_0x53b88d;return fetch(host+_0x5e3288(0x18f),{'credentials':'include'})[_0x5e3288(0x15e)](async _0x31d0b4=>{const _0x4953b0=_0x5e3288,_0x29d5c5=await _0x31d0b4[_0x4953b0(0xf0)]();if(_0x31d0b4[_0x4953b0(0x149)]===0x191&&_0x29d5c5[_0x4953b0(0x109)]!==_0x4953b0(0x190))return await initToken()[_0x4953b0(0x15e)](_0x27148f=>{const _0x46edd3=_0x4953b0;return fetch(host+_0x46edd3(0x18f),{'credentials':'include'})[_0x46edd3(0x15e)](_0x100198=>_0x100198[_0x46edd3(0xf0)]());});if(_0x31d0b4['status']===0x193||_0x29d5c5[_0x4953b0(0x109)]===_0x4953b0(0x190))return await refreshToken()[_0x4953b0(0x15e)](_0x1f261e=>{const _0x2642aa=_0x4953b0;return fetch(host+_0x2642aa(0x18f),{'credentials':_0x2642aa(0x185)})[_0x2642aa(0x15e)](_0x4819a1=>_0x4819a1[_0x2642aa(0xf0)]());});return _0x29d5c5;})['then'](_0x54479d=>{return updateCart(),_0x54479d;})[_0x5e3288(0xf2)](_0x5c42d2=>{const _0x582d1d=_0x5e3288;return console['log'](_0x5c42d2),Promise[_0x582d1d(0xe8)]();});};function debounce(_0x127e9a,_0x1cd271){let _0x506e16;return function(..._0x5dde1d){clearTimeout(_0x506e16),_0x506e16=setTimeout(()=>{_0x127e9a['apply'](this,_0x5dde1d);},_0x1cd271);};}let allProducts,visibleProducts;function renderProduct(_0x4a3765,_0xb9a3c){const _0x497acc=_0x53b88d,_0x22d113=document[_0x497acc(0x101)]('li');_0x22d113[_0x497acc(0x198)]=_0x497acc(0x11c);const _0x32e4cd=_0x4a3765[_0x497acc(0x135)]==='g'?_0x4a3765['n']+'\x20г':_0x4a3765['n']+_0x497acc(0x158);return _0x22d113[_0x497acc(0x177)]=_0x497acc(0x182)+_0x4a3765[_0x497acc(0x142)]+_0x497acc(0xfc)+_0x4a3765[_0x497acc(0x10d)]+_0x497acc(0xe7)+_0x32e4cd+_0x497acc(0x13d)+Math[_0x497acc(0x17f)](_0x4a3765[_0x497acc(0x171)]*0x64)/0x64+_0x497acc(0x161)+_0xb9a3c+_0x497acc(0x115),_0x22d113;}let cartList,scrollWrapper,showMoreBtn,remainingSpan,initialData_g;function renderProducts(){const _0x236d11=_0x53b88d;cartList[_0x236d11(0x177)]='',visibleProducts[_0x236d11(0x17a)]((_0x812e5e,_0x4da2ef)=>{const _0x1fa53e=_0x236d11;cartList[_0x1fa53e(0x153)](renderProduct(_0x812e5e,_0x4da2ef));});const _0x25967f=allProducts[_0x236d11(0x168)]-visibleProducts[_0x236d11(0x168)];_0x25967f>0x0?(showMoreBtn[_0x236d11(0xd7)][_0x236d11(0x127)](_0x236d11(0x18e)),remainingSpan[_0x236d11(0x17d)]=_0x25967f):showMoreBtn['classList']['add'](_0x236d11(0x18e)),updateSummaryCount(),calculateListHeight();}function updateSummaryCount(){const _0x43200c=_0x53b88d,_0x3889f5=new Intl['NumberFormat']('ru-RU',{'style':_0x43200c(0x197),'currency':_0x43200c(0xfb)})['format'](Math[_0x43200c(0x17f)](allProducts[_0x43200c(0xfa)]((_0x3f618f,_0x317ee8)=>_0x3f618f+_0x317ee8[_0x43200c(0x11d)],0x0)*0x64)/0x64),_0x147fab=Math['round'](initialData_g['days']*initialData_g[_0x43200c(0x125)]+initialData_g[_0x43200c(0x166)]);document[_0x43200c(0x178)]('summary-details')[_0x43200c(0x177)]=allProducts[_0x43200c(0x168)]+'\x20'+declension(allProducts['length'],[_0x43200c(0x10b),_0x43200c(0x136),_0x43200c(0x191)])+_0x43200c(0x162)+_0x3889f5+'\x20~\x20с\x20запасами\x20на\x20'+_0x147fab+'\x20'+declension(_0x147fab,[_0x43200c(0x15b),_0x43200c(0xf1),_0x43200c(0x188)])+_0x43200c(0x18a)+Math[_0x43200c(0x17f)](initialData_g[_0x43200c(0x108)]*0x64)/0x64+'%',document[_0x43200c(0x178)](_0x43200c(0xdb))[_0x43200c(0x177)]=''+_0x3889f5,allProducts[_0x43200c(0x168)]===0x0&&(document[_0x43200c(0x178)]('summary-details')['innerHTML']='0\x20товаров\x20&bull;\x20'+_0x3889f5+'\x20₽');}function calculateListHeight(){const _0x1d3128=_0x53b88d,_0x3c8b34=document[_0x1d3128(0x152)](_0x1d3128(0x126));if(!_0x3c8b34)return;const _0x4cdc56=_0x3c8b34[_0x1d3128(0x152)]('h1'),_0x344a54=_0x3c8b34[_0x1d3128(0x152)](_0x1d3128(0xff)),_0x902a27=_0x3c8b34[_0x1d3128(0x152)](_0x1d3128(0xfd)),_0x178d86=_0x3c8b34[_0x1d3128(0x152)](_0x1d3128(0x17b)),_0x33adef=_0x3c8b34['querySelector'](_0x1d3128(0xf4));let _0x55a696=0x0;if(_0x4cdc56)_0x55a696+=_0x4cdc56[_0x1d3128(0x19d)]+0x6;if(_0x344a54)_0x55a696+=_0x344a54[_0x1d3128(0x19d)]+0x1c;if(_0x902a27)_0x55a696+=_0x902a27[_0x1d3128(0x19d)]+0x18;if(_0x33adef&&!_0x33adef[_0x1d3128(0xd7)][_0x1d3128(0x173)](_0x1d3128(0x18e)))_0x55a696+=_0x33adef[_0x1d3128(0x19d)];if(_0x178d86)_0x55a696+=_0x178d86['offsetHeight']+0x14;const _0x4d449d=0x3c,_0x49c1fa=_0x3c8b34[_0x1d3128(0x13a)](),_0x23d766=window[_0x1d3128(0x13e)]-_0x49c1fa[_0x1d3128(0x132)]-_0x4d449d-0x14,_0xc89eb9=_0x23d766-_0x55a696;_0xc89eb9>0x64&&(scrollWrapper[_0x1d3128(0x107)][_0x1d3128(0xdd)]=_0xc89eb9+'px',scrollWrapper[_0x1d3128(0x107)][_0x1d3128(0x12f)]=_0x1d3128(0x114));}function _0x5445(_0x1e96c4,_0x38b738){_0x1e96c4=_0x1e96c4-0xd7;const _0x50d2d0=_0x50d2();let _0x544563=_0x50d2d0[_0x1e96c4];return _0x544563;}function declension(_0x462ba4,_0x4ee280){const _0x3621de=[0x2,0x0,0x1,0x1,0x1,0x2],_0x2f8c46=_0x462ba4%0x64>0x4&&_0x462ba4%0x64<0x14?0x2:_0x3621de[Math['min'](_0x462ba4%0xa,0x5)];return _0x4ee280[_0x2f8c46];}function wholeRender(_0x34004c){const _0x182213=_0x53b88d;initialData_g=_0x34004c,document['querySelector'](_0x182213(0x154))['textContent']=initialData_g[_0x182213(0x166)]+'\x20'+declension(initialData_g[_0x182213(0x166)],[_0x182213(0x15b),_0x182213(0xf1),_0x182213(0x188)]),allProducts=(Array[_0x182213(0x156)](initialData_g[_0x182213(0xdc)])?initialData_g[_0x182213(0xdc)]:[]??[])[_0x182213(0xfe)]()[_0x182213(0x134)](_0x1237b2=>{const _0x5ce7cc=_0x182213;return{..._0x1237b2,'image':_0x1237b2['image']?.[_0x5ce7cc(0xe2)]('{SIZE}',_0x5ce7cc(0x15a))};}),visibleProducts=allProducts[_0x182213(0x186)](0x0,visibleProducts?visibleProducts[_0x182213(0x168)]:0x5),document[_0x182213(0x199)](_0x182213(0x189))[_0x182213(0x17a)](_0x28ad05=>{const _0x31dc2b=_0x182213;_0x28ad05['innerText'][_0x31dc2b(0xf9)]()===''+initialData_g['days']&&_0x28ad05[_0x31dc2b(0xd7)][_0x31dc2b(0x148)](_0x31dc2b(0xda));}),console['log'](initialData_g);let _0x30e5d3=initialData_g[_0x182213(0x11f)];cartList=document[_0x182213(0x178)](_0x182213(0x15f)),scrollWrapper=document[_0x182213(0x178)](_0x182213(0xdf)),showMoreBtn=document[_0x182213(0x178)](_0x182213(0x14d)),remainingSpan=document[_0x182213(0x178)](_0x182213(0x179)),renderProducts(),document[_0x182213(0x170)]('click',function(_0x57df2f){const _0x48c714=_0x182213,_0x5d2272=_0x57df2f['target'][_0x48c714(0x10c)](_0x48c714(0x121)),_0x3f85ce=_0x57df2f['target'][_0x48c714(0x10c)]('.menu-dropdown'),_0x507d43=_0x57df2f['target']['closest'](_0x48c714(0x106)),_0xbfee57=_0x57df2f[_0x48c714(0x167)][_0x48c714(0x10c)](_0x48c714(0x10e)),_0x29814b=_0x57df2f[_0x48c714(0x167)]['closest'](_0x48c714(0x105));if(_0x5d2272){const _0x50bd03=_0x5d2272[_0x48c714(0x175)],_0x153e7a=_0x50bd03[_0x48c714(0xd7)][_0x48c714(0x173)](_0x48c714(0xda));document[_0x48c714(0x199)](_0x48c714(0x138))[_0x48c714(0x17a)](_0x5609d4=>_0x5609d4['classList'][_0x48c714(0x127)]('active')),!_0x153e7a&&_0x50bd03['classList'][_0x48c714(0x148)](_0x48c714(0xda)),_0x57df2f[_0x48c714(0x113)]();}else!_0x3f85ce&&document[_0x48c714(0x199)](_0x48c714(0x138))[_0x48c714(0x17a)](_0x1806a3=>_0x1806a3[_0x48c714(0xd7)][_0x48c714(0x127)](_0x48c714(0xda)));if(_0x507d43){const _0x2b6101=_0x507d43[_0x48c714(0x10c)](_0x48c714(0x120)),_0x531c2e=_0x2b6101['closest'](_0x48c714(0x12d));_0x531c2e['classList'][_0x48c714(0x148)]('replacing');const _0x44b767=Array[_0x48c714(0xe4)](cartList[_0x48c714(0x140)])['indexOf'](_0x531c2e);replaceProduct(allProducts[_0x44b767][_0x48c714(0x10d)])[_0x48c714(0x15e)](()=>{const _0x31e0b0=_0x48c714;_0x531c2e[_0x31e0b0(0x127)](),document[_0x31e0b0(0x199)]('.menu-dropdown.active')['forEach'](_0x5b2558=>_0x5b2558[_0x31e0b0(0xd7)]['remove'](_0x31e0b0(0xda))),visibleProducts[_0x31e0b0(0x133)](_0x44b767,0x1),allProducts['splice'](_0x44b767,0x1),visibleProducts[_0x31e0b0(0x168)]<allProducts[_0x31e0b0(0x168)]&&visibleProducts['push'](allProducts[visibleProducts[_0x31e0b0(0x168)]]),renderProducts(),calculateListHeight();});}if(_0xbfee57){const _0x44059f=_0xbfee57['closest']('.menu-btn-wrapper'),_0x1b80e5=_0x44059f['closest'](_0x48c714(0x12d));_0x1b80e5[_0x48c714(0xd7)]['add']('replacing');const _0x23b4bd=Array['from'](cartList[_0x48c714(0x140)])['indexOf'](_0x1b80e5);deleteProduct(allProducts[_0x23b4bd][_0x48c714(0x10d)])[_0x48c714(0x15e)](()=>{const _0x541508=_0x48c714;_0x1b80e5[_0x541508(0x127)](),document[_0x541508(0x199)](_0x541508(0x138))[_0x541508(0x17a)](_0x407228=>_0x407228[_0x541508(0xd7)][_0x541508(0x127)](_0x541508(0xda))),visibleProducts[_0x541508(0x133)](_0x23b4bd,0x1),allProducts['splice'](_0x23b4bd,0x1),visibleProducts[_0x541508(0x168)]<allProducts[_0x541508(0x168)]&&visibleProducts['push'](allProducts[visibleProducts[_0x541508(0x168)]]),renderProducts(),calculateListHeight();});}_0x29814b&&requestWithRefresh(host+_0x48c714(0x12e),{'method':_0x48c714(0x16a)})[_0x48c714(0x15e)](_0xed15ef=>{const _0x588e53=_0x48c714;document[_0x588e53(0x15c)]['reload']();});}),showMoreBtn[_0x182213(0x170)](_0x182213(0xf7),()=>{const _0x576fe7=_0x182213;while(visibleProducts[_0x576fe7(0x168)]<allProducts[_0x576fe7(0x168)]){visibleProducts[_0x576fe7(0x192)](allProducts[visibleProducts[_0x576fe7(0x168)]]);}renderProducts(),scrollWrapper[_0x576fe7(0x107)]['maxHeight']=_0x576fe7(0x11e),calculateListHeight();}),window[_0x182213(0x170)](_0x182213(0xde),calculateListHeight),calculateListHeight(),document[_0x182213(0x199)](_0x182213(0x195))[_0x182213(0x17a)](_0x366825=>{const _0x10ecb5=_0x182213;_0x366825['addEventListener'](_0x10ecb5(0xf7),function(){const _0xf13f51=_0x10ecb5,_0x39d864=this[_0xf13f51(0x10c)](_0xf13f51(0x169)),_0x54e316=_0x39d864[_0xf13f51(0xd7)]['contains'](_0xf13f51(0x100));document[_0xf13f51(0x199)](_0xf13f51(0x169))[_0xf13f51(0x17a)](_0x4711dc=>_0x4711dc[_0xf13f51(0xd7)]['remove'](_0xf13f51(0x100))),!_0x54e316&&_0x39d864[_0xf13f51(0xd7)]['add'](_0xf13f51(0x100));});}),document['querySelectorAll'](_0x182213(0xec))[_0x182213(0x17a)](_0x5b5e92=>{const _0x3995ff=_0x182213;_0x5b5e92[_0x3995ff(0x170)](_0x3995ff(0xf7),function(){const _0x2f146a=_0x3995ff,_0x595281=this[_0x2f146a(0x10c)]('.days-options');_0x595281[_0x2f146a(0x199)](_0x2f146a(0xec))[_0x2f146a(0x17a)](_0x293171=>_0x293171['classList'][_0x2f146a(0x127)](_0x2f146a(0xda))),this[_0x2f146a(0xd7)][_0x2f146a(0x148)](_0x2f146a(0xda)),setOption(_0x2f146a(0x166),this[_0x2f146a(0x11a)]['days']),document[_0x2f146a(0x152)](_0x2f146a(0x154))[_0x2f146a(0x17d)]=this[_0x2f146a(0x11a)][_0x2f146a(0x166)]+'\x20'+declension(this[_0x2f146a(0x11a)][_0x2f146a(0x166)],[_0x2f146a(0x15b),'дня',_0x2f146a(0x188)]);});});const _0x5c48a2=document[_0x182213(0x178)](_0x182213(0x10f)),_0x1aeeed=document[_0x182213(0x178)](_0x182213(0x13b));let _0x29e63f=null;function _0x12277f(){const _0x435183=_0x182213;_0x5c48a2[_0x435183(0x177)]='',_0x30e5d3[_0x435183(0x17a)]((_0x15c642,_0x3eb824)=>{const _0x67e3a6=_0x435183,_0x1ae701='🥦',_0xe03c44=document[_0x67e3a6(0x101)]('div');_0xe03c44['className']=_0x67e3a6(0x150),_0xe03c44[_0x67e3a6(0x11a)][_0x67e3a6(0xd8)]=_0x3eb824,_0xe03c44[_0x67e3a6(0x177)]=_0x67e3a6(0x129)+_0x1ae701+'</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22name\x22>'+_0x15c642[_0x67e3a6(0x10d)]+_0x67e3a6(0x184)+_0x15c642['age']+'\x20лет</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22delete-member\x22\x20data-index=\x22'+_0x3eb824+_0x67e3a6(0x17c),_0x5c48a2[_0x67e3a6(0x153)](_0xe03c44);});const _0x2db569=_0x30e5d3['length'];_0x1aeeed[_0x435183(0x17d)]=_0x2db569+'\x20'+declension(_0x2db569,[_0x435183(0x160),_0x435183(0x196),_0x435183(0x160)]);if(_0x2db569===0x0)_0x1aeeed[_0x435183(0x17d)]='Не\x20указаны';document[_0x435183(0x199)](_0x435183(0x174))[_0x435183(0x17a)](_0x29630b=>{const _0x1ab37b=_0x435183;_0x29630b[_0x1ab37b(0x170)](_0x1ab37b(0xf7),function(_0x519b59){const _0x4b2fdf=_0x1ab37b;_0x519b59[_0x4b2fdf(0x113)]();const _0x3dc638=parseInt(this[_0x4b2fdf(0x11a)][_0x4b2fdf(0xd8)]);_0x30e5d3[_0x4b2fdf(0x133)](_0x3dc638,0x1),_0x12277f(),setOption(_0x4b2fdf(0x11f),_0x30e5d3);});});}_0x12277f(),_0x5c48a2[_0x182213(0x170)](_0x182213(0xf7),function(_0x47c938){const _0x33dd20=_0x182213,_0x4613a9=_0x47c938['target'][_0x33dd20(0x10c)](_0x33dd20(0x14a));if(!_0x4613a9)return;if(_0x47c938[_0x33dd20(0x167)][_0x33dd20(0x10c)](_0x33dd20(0x174)))return;const _0x3d19ac=parseInt(_0x4613a9[_0x33dd20(0x11a)][_0x33dd20(0xd8)]);_0x4bfdef(_0x3d19ac);});const _0x10f1a6=document[_0x182213(0x178)](_0x182213(0x155)),_0x4b1fd6=document['getElementById'](_0x182213(0x157)),_0x124487=document[_0x182213(0x178)](_0x182213(0x122)),_0x3b46cc=document[_0x182213(0x178)]('savePersonBtn'),_0x56b0e8=document[_0x182213(0x178)](_0x182213(0xeb)),_0x17e497=document['querySelectorAll'](_0x182213(0x124)),_0x5f26ef=initialData_g['available_groups'];function _0x4bfdef(_0x56b7a5=null){const _0x3fd7aa=_0x182213;_0x29e63f=_0x56b7a5,document[_0x3fd7aa(0x199)](_0x3fd7aa(0x1a1))[_0x3fd7aa(0x17a)](_0x534e76=>_0x534e76['innerHTML']='');if(_0x29e63f!==null){_0x56b0e8[_0x3fd7aa(0x17d)]=_0x3fd7aa(0xe5);const _0xfd7778=_0x30e5d3[_0x29e63f];document[_0x3fd7aa(0x178)](_0x3fd7aa(0x19f))[_0x3fd7aa(0xf8)]=_0xfd7778[_0x3fd7aa(0x10d)],document[_0x3fd7aa(0x178)]('inputAge')[_0x3fd7aa(0xf8)]=_0xfd7778['age'],document[_0x3fd7aa(0x178)](_0x3fd7aa(0x103))[_0x3fd7aa(0xf8)]=_0xfd7778[_0x3fd7aa(0x131)],document[_0x3fd7aa(0x178)]('inputHeight')[_0x3fd7aa(0xf8)]=_0xfd7778[_0x3fd7aa(0x130)],_0x17e497[_0x3fd7aa(0x17a)](_0x23b365=>{const _0x2ce4c7=_0x3fd7aa;_0x23b365[_0x2ce4c7(0xd7)][_0x2ce4c7(0x141)]('active',_0x23b365[_0x2ce4c7(0x11a)][_0x2ce4c7(0x13c)]===_0xfd7778[_0x2ce4c7(0x13c)]);});if(_0xfd7778[_0x3fd7aa(0x19a)])_0xfd7778['avoid']['forEach'](_0xdc3180=>_0x5ede89(_0xdc3180,'avoid',![]));if(_0xfd7778[_0x3fd7aa(0x165)])_0xfd7778[_0x3fd7aa(0x165)][_0x3fd7aa(0x17a)](_0x5a5334=>_0x5ede89(_0x5a5334,_0x3fd7aa(0x165),![]));}else _0x56b0e8['textContent']='Добавить\x20человека',document[_0x3fd7aa(0x178)](_0x3fd7aa(0x19f))[_0x3fd7aa(0xf8)]='',document[_0x3fd7aa(0x178)](_0x3fd7aa(0x14c))[_0x3fd7aa(0xf8)]='',document[_0x3fd7aa(0x178)](_0x3fd7aa(0x103))[_0x3fd7aa(0xf8)]='',document[_0x3fd7aa(0x178)]('inputHeight')[_0x3fd7aa(0xf8)]='',_0x17e497['forEach'](_0x40c29d=>_0x40c29d[_0x3fd7aa(0xd7)][_0x3fd7aa(0x127)](_0x3fd7aa(0xda))),document[_0x3fd7aa(0x152)](_0x3fd7aa(0x119))[_0x3fd7aa(0xd7)][_0x3fd7aa(0x148)](_0x3fd7aa(0xda));_0x10f1a6['style'][_0x3fd7aa(0x123)]=_0x3fd7aa(0xe3),calculateListHeight();}_0x4b1fd6[_0x182213(0x170)](_0x182213(0xf7),()=>_0x4bfdef(null));function _0x31663d(){const _0x3ee059=_0x182213;_0x10f1a6[_0x3ee059(0x107)][_0x3ee059(0x123)]=_0x3ee059(0x143);}_0x124487['addEventListener'](_0x182213(0xf7),_0x31663d),_0x10f1a6[_0x182213(0x170)](_0x182213(0xf7),function(_0x30d786){const _0xf9b20b=_0x182213;if(_0x30d786[_0xf9b20b(0x167)]===this)_0x31663d();}),_0x17e497[_0x182213(0x17a)](_0x24e3b6=>{const _0x235294=_0x182213;_0x24e3b6[_0x235294(0x170)]('click',function(){const _0x17f443=_0x235294;_0x17e497['forEach'](_0x62e817=>_0x62e817['classList'][_0x17f443(0x127)](_0x17f443(0xda))),this[_0x17f443(0xd7)][_0x17f443(0x148)](_0x17f443(0xda));});});function _0x5ede89(_0x1db471,_0x5465a7,_0x8dd209=!![]){const _0x37fcda=_0x182213,_0x552017=document[_0x37fcda(0x152)](_0x37fcda(0x14e)+_0x5465a7+'\x22]'),_0x4ca932=_0x552017[_0x37fcda(0x199)](_0x37fcda(0x180));for(let _0x568f63 of _0x4ca932){if(_0x568f63['textContent'][_0x37fcda(0xf9)]()[_0x37fcda(0xe2)]('×','')[_0x37fcda(0xf9)]()===_0x1db471)return;}const _0x55d687=_0x5465a7===_0x37fcda(0x19a)?_0x37fcda(0x165):'avoid',_0x6a38e6=document[_0x37fcda(0x152)](_0x37fcda(0x14e)+_0x55d687+'\x22]'),_0x486cfa=_0x6a38e6[_0x37fcda(0x199)]('.tag');for(let _0x181943 of _0x486cfa){if(_0x181943[_0x37fcda(0x17d)][_0x37fcda(0xf9)]()['replace']('×','')[_0x37fcda(0xf9)]()===_0x1db471){_0x181943[_0x37fcda(0x127)]();break;}}const _0x2657f6=document['createElement'](_0x37fcda(0x15d));_0x2657f6[_0x37fcda(0x198)]='tag\x20'+(_0x5465a7===_0x37fcda(0x19a)?_0x37fcda(0x16d):'tag-green'),_0x2657f6[_0x37fcda(0x177)]=_0x1db471+'\x20<span\x20class=\x22tag-close\x22>×</span>',_0x2657f6[_0x37fcda(0x152)]('.tag-close')[_0x37fcda(0x170)](_0x37fcda(0xf7),function(){_0x2657f6['remove']();}),_0x552017[_0x37fcda(0x153)](_0x2657f6);}document[_0x182213(0x199)](_0x182213(0x193))[_0x182213(0x17a)](_0x339f7d=>{const _0x26325d=_0x182213,_0x23aba1=_0x339f7d[_0x26325d(0x11a)][_0x26325d(0x110)],_0x1bfffe=document['querySelector'](_0x26325d(0x18d)+_0x23aba1+'\x22]'),_0x29c84c=document[_0x26325d(0x152)](_0x26325d(0x14e)+_0x23aba1+'\x22]');_0x339f7d[_0x26325d(0x170)](_0x26325d(0xf6),function(){const _0x29975c=_0x26325d,_0x57627b=this[_0x29975c(0xf8)][_0x29975c(0x12c)]();_0x1bfffe[_0x29975c(0x177)]='';const _0x4f8d82=new Set();document[_0x29975c(0x199)]('#personModal\x20.tags-wrap\x20.tag')[_0x29975c(0x17a)](_0x24d903=>{const _0x249d2a=_0x29975c,_0x108de2=_0x24d903[_0x249d2a(0x17d)]['trim']()[_0x249d2a(0xe2)]('×','')['trim']();if(_0x108de2)_0x4f8d82['add'](_0x108de2);});if(_0x57627b[_0x29975c(0x168)]>0x0){const _0x2150fc=_0x5f26ef[_0x29975c(0x14b)](_0x2401d1=>_0x2401d1[_0x29975c(0x12c)]()[_0x29975c(0x163)](_0x57627b)&&!_0x4f8d82[_0x29975c(0xef)](_0x2401d1));_0x2150fc['length']>0x0?(_0x1bfffe[_0x29975c(0xd7)]['add'](_0x29975c(0xda)),_0x2150fc[_0x29975c(0x17a)](_0x350711=>{const _0x10b548=_0x29975c,_0x41a2e9=document['createElement']('div');_0x41a2e9[_0x10b548(0x17d)]=_0x350711,_0x41a2e9[_0x10b548(0x170)](_0x10b548(0xf7),function(){const _0x3d5631=_0x10b548;_0x5ede89(_0x350711,_0x23aba1),_0x339f7d[_0x3d5631(0xf8)]='',_0x1bfffe[_0x3d5631(0xd7)][_0x3d5631(0x127)]('active');}),_0x1bfffe['appendChild'](_0x41a2e9);})):_0x1bfffe['classList'][_0x29975c(0x127)](_0x29975c(0xda));}else _0x1bfffe[_0x29975c(0xd7)][_0x29975c(0x127)](_0x29975c(0xda));}),document[_0x26325d(0x170)](_0x26325d(0xf7),function(_0x50ddda){const _0xa0a527=_0x26325d;!_0x339f7d['contains'](_0x50ddda['target'])&&!_0x1bfffe[_0xa0a527(0x173)](_0x50ddda[_0xa0a527(0x167)])&&_0x1bfffe[_0xa0a527(0xd7)][_0xa0a527(0x127)](_0xa0a527(0xda));});}),_0x3b46cc[_0x182213(0x170)]('click',()=>{const _0x5e28ee=_0x182213,_0x1cbcf7=document['getElementById'](_0x5e28ee(0x19f))[_0x5e28ee(0xf8)][_0x5e28ee(0xf9)](),_0x319448=document[_0x5e28ee(0x178)](_0x5e28ee(0x14c))['value'][_0x5e28ee(0xf9)](),_0x5139ba=document['getElementById']('inputWeight')[_0x5e28ee(0xf8)][_0x5e28ee(0xf9)](),_0x4dc005=document[_0x5e28ee(0x178)](_0x5e28ee(0x159))['value']['trim'](),_0x1b6ba1=document[_0x5e28ee(0x152)](_0x5e28ee(0x12b))[_0x5e28ee(0x11a)][_0x5e28ee(0x13c)];if(!_0x1cbcf7){alert(_0x5e28ee(0x18c));return;}if(!_0x319448||parseInt(_0x319448)<0x7){alert(_0x5e28ee(0xd9));return;}const _0x34e107=[];document['querySelector'](_0x5e28ee(0x102))[_0x5e28ee(0x199)](_0x5e28ee(0x180))[_0x5e28ee(0x17a)](_0xb201c5=>{const _0x2294a1=_0x5e28ee;_0x34e107[_0x2294a1(0x192)](_0xb201c5[_0x2294a1(0x17d)][_0x2294a1(0xf9)]()[_0x2294a1(0xe2)]('×','')[_0x2294a1(0xf9)]());});const _0x3b13e3=[];document[_0x5e28ee(0x152)]('#personModal\x20.tags-wrap[data-target=\x22favorite\x22]')[_0x5e28ee(0x199)](_0x5e28ee(0x180))[_0x5e28ee(0x17a)](_0x3e84ea=>{const _0x5b8992=_0x5e28ee;_0x3b13e3['push'](_0x3e84ea[_0x5b8992(0x17d)]['trim']()[_0x5b8992(0xe2)]('×','')[_0x5b8992(0xf9)]());});const _0x9381b6={'name':_0x1cbcf7,'age':_0x319448,'weight':_0x5139ba,'height':_0x4dc005,'gender':_0x1b6ba1,'avoid':_0x34e107,'favorite':_0x3b13e3};_0x29e63f!==null?(_0x30e5d3[_0x29e63f]=_0x9381b6,_0x29e63f=null):_0x30e5d3[_0x5e28ee(0x192)](_0x9381b6),_0x12277f(),setOption(_0x5e28ee(0x11f),_0x30e5d3),_0x31663d();});const _0x15e597=initialData_g['available_groups'],_0x464b67=initialData_g[_0x182213(0x128)];let _0x3de9b1=[..._0x464b67],_0x5f3618=![];const _0x49c8d7=0x9,_0x4deb72=debounce(async()=>{const _0x7940a2=_0x182213;return setOption(_0x7940a2(0x14f),_0x3de9b1);},0x5dc),_0x5d3f6f=document[_0x182213(0x178)]('categories-grid'),_0x2b2679=document[_0x182213(0x178)](_0x182213(0x147));function _0x14cddd(){const _0x2101d7=_0x182213;_0x5d3f6f[_0x2101d7(0x177)]='';const _0x406cb8=_0x5f3618?_0x15e597:_0x15e597[_0x2101d7(0x186)](0x0,_0x49c8d7);_0x406cb8[_0x2101d7(0x17a)](_0x2a6a2b=>{const _0x1824e3=_0x2101d7,_0x57d8c4=document['createElement'](_0x1824e3(0x151));_0x57d8c4[_0x1824e3(0x198)]=_0x1824e3(0x145)+(_0x3de9b1[_0x1824e3(0x163)](_0x2a6a2b)?_0x1824e3(0xda):_0x1824e3(0x16c)),_0x57d8c4[_0x1824e3(0x17d)]=_0x2a6a2b,_0x57d8c4[_0x1824e3(0x11a)]['category']=_0x2a6a2b,_0x57d8c4[_0x1824e3(0x170)](_0x1824e3(0xf7),function(){const _0xf414de=_0x1824e3,_0x182a0e=this[_0xf414de(0x11a)][_0xf414de(0x11b)];_0x3de9b1[_0xf414de(0x163)](_0x182a0e)?_0x3de9b1=_0x3de9b1[_0xf414de(0x14b)](_0x572807=>_0x572807!==_0x182a0e):_0x3de9b1[_0xf414de(0x192)](_0x182a0e),_0x14cddd(),_0x4deb72();}),_0x5d3f6f['appendChild'](_0x57d8c4);}),_0x5f3618?_0x2b2679[_0x2101d7(0xd7)][_0x2101d7(0x127)]('collapsed'):_0x2b2679[_0x2101d7(0xd7)][_0x2101d7(0x148)](_0x2101d7(0x139));}_0x2b2679[_0x182213(0x170)](_0x182213(0xf7),function(){_0x5f3618=!_0x5f3618,_0x14cddd();}),_0x14cddd();}document[_0x53b88d(0x170)](_0x53b88d(0x112),async()=>{wholeRender(await loadInitData());}),document[_0x53b88d(0x170)](_0x53b88d(0x112),function(){const _0x7298de=_0x53b88d,_0x2dcfdd=document['getElementById'](_0x7298de(0x1a0)),_0x5ef1a3=document[_0x7298de(0x178)](_0x7298de(0xf5));!localStorage['getItem'](_0x7298de(0xe9))&&setTimeout(()=>{const _0x573c17=_0x7298de;_0x2dcfdd[_0x573c17(0xd7)][_0x573c17(0x148)](_0x573c17(0xe1));},0x1f4),_0x5ef1a3[_0x7298de(0x170)]('click',function(){const _0x45c9db=_0x7298de;localStorage[_0x45c9db(0x19e)](_0x45c9db(0xe9),_0x45c9db(0xea)),_0x2dcfdd[_0x45c9db(0xd7)][_0x45c9db(0x127)](_0x45c9db(0xe1)),_0x2dcfdd[_0x45c9db(0xd7)][_0x45c9db(0x148)]('hide'),setTimeout(()=>{const _0x1c1690=_0x45c9db;_0x2dcfdd['style'][_0x1c1690(0x123)]='none';},0x190);});});