1 2; /* Start:"a:4:{s:4:"full";s:93:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/script.min.js?169687285022553";s:6:"source";s:73:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/script.js";s:3:"min";s:77:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/script.min.js";s:3:"map";s:77:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/script.map.js";}"*/ 3BasketPoolQuantity=function(){this.processing=false;this.poolQuantity={};this.updateTimer=null;this.currentQuantity={};this.lastStableQuantities={};this.updateQuantity()};BasketPoolQuantity.prototype.updateQuantity=function(){var e=BX("basket_items");if(basketJSParams["USE_ENHANCED_ECOMMERCE"]==="Y"){checkAnalytics(this.lastStableQuantities,e)}if(!!e&&e.rows.length>0){for(var t=1;e.rows.length>t;t++){var a=e.rows[t].id;this.currentQuantity[a]=BX("QUANTITY_"+a).value}}this.lastStableQuantities=BX.clone(this.currentQuantity,true)};BasketPoolQuantity.prototype.changeQuantity=function(e){var t=BX("QUANTITY_"+e).value;var a=this.isPoolEmpty();if(this.currentQuantity[e]&&this.currentQuantity[e]!=t){this.poolQuantity[e]=this.currentQuantity[e]=t}if(!a){this.enableTimer(true)}else{this.trySendPool()}};BasketPoolQuantity.prototype.trySendPool=function(){if(!this.isPoolEmpty()&&!this.isProcessing()){this.enableTimer(false);recalcBasketAjax({})}};BasketPoolQuantity.prototype.isPoolEmpty=function(){return Object.keys(this.poolQuantity).length==0};BasketPoolQuantity.prototype.clearPool=function(){this.poolQuantity={}};BasketPoolQuantity.prototype.isProcessing=function(){return this.processing===true};BasketPoolQuantity.prototype.setProcessing=function(e){this.processing=e===true};BasketPoolQuantity.prototype.enableTimer=function(e){clearTimeout(this.updateTimer);if(e===false)return;this.updateTimer=setTimeout(function(){basketPoolQuantity.trySendPool()},1500)};function updateBasketTable(e,t){var a=BX("basket_items"),i,s,l,r,n,o,_=false,u=false,c=false,d=false,p,T,f,A,b,B,y,E,m,X,v,h,I,S,k,D,N,P,C,g,U,O,R,L,Q,M,Y,x,F,w,H,K,V,j,W,G,J,q,z,Z,$,ee,te;if(!a||typeof t!=="object"){return}i=a.rows;r=i[i.length-1];p=t.PARAMS.QUANTITY_FLOAT==="Y";if(e!==null&&!!t.BASKET_DATA){T=BX(e);s=t.BASKET_ID;te=BX.type.isPlainObject(t.BASKET_DATA.GRID.ROWS[s]);if(te){l=t.BASKET_DATA.GRID.ROWS[s];n=document.createElement("tr");
3n.setAttribute("id",t.BASKET_ID);n.setAttribute("data-item-name",l["NAME"]);n.setAttribute("data-item-brand",l[basketJSParams["BRAND_PROPERTY"]+"_VALUE"]);n.setAttribute("data-item-price",l["PRICE"]);n.setAttribute("data-item-currency",l["CURRENCY"]);r.parentNode.insertBefore(n,T.nextSibling)}if(t.DELETE_ORIGINAL==="Y"){T.parentNode.removeChild(T)}if(te){f=n.insertCell(-1);f.setAttribute("class","margin");o=t.COLUMNS.split(",");for(A=0;A<o.length;A++){if(o[A]==="DELETE"){_=true}else if(o[A]==="DELAY"){u=true}else if(o[A]==="PROPS"){c=true}else if(o[A]==="TYPE"){d=true}}for(A=0;A<o.length;A++){switch(o[A]){case"PROPS":case"DELAY":case"DELETE":case"TYPE":break;case"NAME":b=n.insertCell(-1);B="";y="";b.setAttribute("class","itemphoto");if(l.PREVIEW_PICTURE_SRC.length>0){B=l.PREVIEW_PICTURE_SRC}else if(l.DETAIL_PICTURE_SRC.length>0){B=l.DETAIL_PICTURE_SRC}else{B=basketJSParams.TEMPLATE_FOLDER+"/images/no_photo.png"}if(l.DETAIL_PAGE_URL.length>0){y='<div class="bx_ordercart_photo_container"> <a href="'+l.DETAIL_PAGE_URL+'"> <div class="bx_ordercart_photo" style="background-image:url(\''+B+"')\"></div> </a> </div>"}else{y='<div class="bx_ordercart_photo_container"> <div class="bx_ordercart_photo" style="background-image:url(\''+B+"')\"></div> </div>"}if(l.BRAND&&l.BRAND.length>0){y+='<div class="bx_ordercart_brand"> <img alt="" src="'+l.BRAND+'"/> </div>'}b.innerHTML=y;E=n.insertCell(-1);m="";E.setAttribute("class","item");if(l["DETAIL_PAGE_URL"].length>0)m+='<h2 class="bx_ordercart_itemtitle"><a href="'+l["DETAIL_PAGE_URL"]+'">'+l["NAME"]+"</a></h2>";else m+='<h2 class="bx_ordercart_itemtitle">'+l["NAME"]+"</h2>";m+='<div class="bx_ordercart_itemart">';if(c){for(v=0;v<l["PROPS"].length;v++){h=l["PROPS"][v];if(l.SKU_DATA){X=false;for(I in l.SKU_DATA){if(l.SKU_DATA.hasOwnProperty(I)){S=l.SKU_DATA[I];if(S["CODE"]===h["CODE"]){X=true;break}}}if(X)continue}m+=BX.util.htmlspecialchars(h["NAME"])+": <span>"+h["VALUE"]+"</span><br/>"}}m+="</div>";if(l.SKU_DATA){z={};for(Q=0;Q<l["PROPS"].length;Q++){M=l["PROPS"][Q];z[M["CODE"]]=BX.type.isNotEmptyString(M["~VALUE"])?M["~VALUE"]:M["VALUE"]}for(I in l.SKU_DATA){if(l.SKU_DATA.hasOwnProperty(I)){Z=0;S=l.SKU_DATA[I];k=false;D=BX.util.array_keys(S["VALUES"]).length;if(D>5){N="full";P=D*20+"%";C=100/D+"%"}else{N="";P="100%";C="20%"}$=0;for(U in S["VALUES"]){$++;g=S["VALUES"][U];if(BX.type.isNotEmptyString(z[S["CODE"]])){if(z[S["CODE"]]==g["NAME"]||z[S["CODE"]]==g["XML_ID"])Z=$}if(!!g&&typeof g==="object"&&!!g["PICT"]){k=true}}ee="0";if(N!==""&&Z>5)ee=(5-Z)*20+"%";if(k){m+='<div class="bx_item_detail_scu_small_noadaptive '+N+'">';
3m+='<span class="bx_item_section_name_gray">'+BX.util.htmlspecialchars(S["NAME"])+"</span>";m+='<div class="bx_scu_scroller_container">';m+='<div class="bx_scu">';m+='<ul id="prop_'+S["CODE"]+"_"+l["ID"]+'" style="width: '+P+"; margin-left: "+ee+';" class="sku_prop_list">';$=0;for(L in S["VALUES"]){$++;O=S["VALUES"][L];R=Z==$?" bx_active":"";m+='<li style="width: '+C+"; padding-top: "+C+';" class="sku_prop'+R+'" data-sku-selector="Y" data-value-id="'+O["XML_ID"]+'" data-sku-name="'+BX.util.htmlspecialchars(O["NAME"])+'" data-element="'+l["ID"]+'" data-property="'+S["CODE"]+'" > <a href="javascript:void(0)" class="cnt"><span class="cnt_item" style="background-image:url('+O["PICT"]["SRC"]+'"></span></a> </li>'}m+="</ul>";m+="</div>";m+='<div class="bx_slide_left" onclick="leftScroll(\''+S["CODE"]+"', "+l["ID"]+", "+BX.util.array_keys(S["VALUES"]).length+');"></div>';m+='<div class="bx_slide_right" onclick="rightScroll(\''+S["CODE"]+"', "+l["ID"]+", "+BX.util.array_keys(S["VALUES"]).length+');"></div>';m+="</div>";m+="</div>"}else{m+='<div class="bx_item_detail_size_small_noadaptive '+N+'">';
3m+='<span class="bx_item_section_name_gray">'+BX.util.htmlspecialchars(S["NAME"])+"</span>";m+='<div class="bx_size_scroller_container">';m+='<div class="bx_size">';m+='<ul id="prop_'+S["CODE"]+"_"+l["ID"]+'" style="width: '+P+"; margin-left: "+ee+';" class="sku_prop_list">';$=0;for(L in S["VALUES"]){$++;O=S["VALUES"][L];R=Z==$?" bx_active":"";m+='<li style="width: '+C+';" class="sku_prop '+R+'" data-sku-selector="Y" data-value-id="'+(S["TYPE"]==="S"&&S["USER_TYPE"]==="directory"?O["XML_ID"]:BX.util.htmlspecialchars(O["NAME"]))+'" data-sku-name="'+BX.util.htmlspecialchars(O["NAME"])+'" data-element="'+l["ID"]+'" data-property="'+S["CODE"]+'" > <a href="javascript:void(0)" class="cnt">'+BX.util.htmlspecialchars(O["NAME"])+"</a> </li>"}m+="</ul>";m+="</div>";m+='<div class="bx_slide_left" onclick="leftScroll(\''+S["CODE"]+"', "+l["ID"]+", "+BX.util.array_keys(S["VALUES"]).length+');"></div>';m+='<div class="bx_slide_right" onclick="rightScroll(\''+S["CODE"]+"', "+l["ID"]+", "+BX.util.array_keys(S["VALUES"]).length+');"></div>';m+="</div>";m+="</div>"}}}}E.innerHTML=m;break;case"QUANTITY":Y=n.insertCell(-1);x="";F=parseFloat(l["MEASURE_RATIO"])>0?l["MEASURE_RATIO"]:1;w=false;if(F!=0&&F!=""){H=l["QUANTITY"];l["QUANTITY"]=getCorrectRatioQuantity(l["QUANTITY"],F,p);if(H!=l["QUANTITY"]){w=true}}Y.setAttribute("class","custom");x+="<span>"+getColumnName(t,o[A])+":</span>";x+='<div class="centered">';x+='<table cellspacing="0" cellpadding="0" class="counter">';x+="<tr>";x+="<td>";x+='<input type="text" size="3" id="QUANTITY_INPUT_'+l["ID"]+'" name="QUANTITY_INPUT_'+l["ID"]+'" style="max-width: 50px" value="'+l["QUANTITY"]+'" onchange="updateQuantity(\'QUANTITY_INPUT_'+l["ID"]+"','"+l["ID"]+"', "+F+","+p+')" >';x+="</td>";if(F!=0&&F!=""){x+='<td id="basket_quantity_control"> <div class="basket_quantity_control"> <a href="javascript:void(0);" class="plus" onclick="setQuantity('+l["ID"]+", "+F+", 'up', "+p+');"></a> <a href="javascript:void(0);" class="minus" onclick="setQuantity('+l["ID"]+", "+F+", 'down', "+p+');"></a> </div> </td>'}if(l.hasOwnProperty("MEASURE_TEXT")&&l["MEASURE_TEXT"].length>0)x+='<td style="text-align: left">
3'+BX.util.htmlspecialchars(l["MEASURE_TEXT"])+"</td>";x+="</tr>";x+="</table>";x+="</div>";x+='<input type="hidden" id="QUANTITY_'+l["ID"]+'" name="QUANTITY_'+l["ID"]+'" value="'+l["QUANTITY"]+'" />';Y.innerHTML=x;if(w){updateQuantity("QUANTITY_INPUT_"+l["ID"],l["ID"],F,p)}break;case"PRICE":K=n.insertCell(-1);V=l["DISCOUNT_PRICE_PERCENT"]>0?l["FULL_PRICE_FORMATED"]:"";K.setAttribute("class","price");K.innerHTML='<div class="current_price" id="current_price_'+l["ID"]+'">'+l["PRICE_FORMATED"]+"</div>"+'<div class="old_price" id="old_price_'+l["ID"]+'">'+V+"</div>";if(d&&l["NOTES"].length>0){K.innerHTML+='<div class="type_price">'+basketJSParams["SALE_TYPE"]+"</div>";K.innerHTML+='<div class="type_price_value">'+l["NOTES"]+"</div>"}break;case"DISCOUNT":W=n.insertCell(-1);W.setAttribute("class","custom");W.innerHTML="<span>"+getColumnName(t,o[A])+":</span>";W.innerHTML+='<div id="discount_value_'+l["ID"]+'">'+l["DISCOUNT_PRICE_PERCENT_FORMATED"]+"</div>";break;case"WEIGHT":G=n.insertCell(-1);G.setAttribute("class","custom");G.innerHTML="<span>"+getColumnName(t,o[A])+":</span>";G.innerHTML+=l["WEIGHT_FORMATED"];break;default:J=n.insertCell(-1);q="";J.setAttribute("class","custom");J.innerHTML="<span>"+getColumnName(t,o[A])+":</span>";if(o[A]=="SUM")q+='<div id="sum_'+l["ID"]+'">';if(typeof l[o[A]]!="undefined"){q+=l[o[A]]}if(o[A]=="SUM")q+="</div>";J.innerHTML+=q;break}}if(_||u){var ae=n.insertCell(-1);ae.setAttribute("class","control");if(_)ae.innerHTML='<a href="'+basketJSParams["DELETE_URL"].replace("#ID#",l["ID"])+'">'+basketJSParams["SALE_DELETE"]+"</a><br />";if(u)ae.innerHTML+='<a href="'+basketJSParams["DELAY_URL"].replace("#ID#",l["ID"])+'">'+basketJSParams["SALE_DELAY"]+"</a>"}var ie=n.insertCell(-1);ie.setAttribute("class","margin")}}if(!!t.BASKET_DATA){for(j in t.BASKET_DATA.GRID.ROWS){if(t.BASKET_DATA.GRID.ROWS.hasOwnProperty(j)){var se=t.BASKET_DATA.GRID.ROWS[j];if(BX("discount_value_"+j))BX("discount_value_"+j).innerHTML=se.DISCOUNT_PRICE_PERCENT_FORMATED;if(BX("current_price_"+j))BX("current_price_"+j).innerHTML=se.PRICE_FORMATED;if(BX("old_price_"+j))BX("old_price_"+j).innerHTML=se.DISCOUNT_PRICE_PERCENT>0?se.FULL_PRICE_FORMATED:"";if(BX("sum_"+j))BX("sum_"+j).innerHTML=se.SUM;if(BX("QUANTITY_"+j)){BX("QUANTITY_INPUT_"+j).value=se.QUANTITY;BX("QUANTITY_INPUT_"+j).defaultValue=se.QUANTITY;BX("QUANTITY_"+j).value=se.QUANTITY}}}}if(!!t.BASKET_DATA)couponListUpdate(t.BASKET_DATA);if(t.hasOwnProperty("WARNING_MESSAGE")){var le="";for(A=t["WARNING_MESSAGE"].length-1;A>=0;A--)le+=t["WARNING_MESSAGE"][A]+"<br/>";BX("warning_message").innerHTML=le}if(!!t.BASKET_DATA){if(BX("allWeight_FORMATED"))BX("allWeight_FORMATED").innerHTML=t["BASKET_DATA"]["allWeight_FORMATED"].replace(/\s/g," ");if(BX("allSum_wVAT_FORMATED"))BX("allSum_wVAT_FORMATED").innerHTML=t["BASKET_DATA"]["allSum_wVAT_FORMATED"].replace(/\s/g," ");if(BX("allVATSum_FORMATED"))BX("allVATSum_FORMATED").innerHTML=t["BASKET_DATA"]["allVATSum_FORMATED"].replace(/\s/g," ");if(BX("allSum_FORMATED"))BX("allSum_FORMATED").innerHTML=t["BASKET_DATA"]["allSum_FORMATED"].replace(/\s/g," ");if(BX("PRICE_WITHOUT_DISCOUNT")){var re=t["BASKET_DATA"]["PRICE_WITHOUT_DISCOUNT"]!=t["BASKET_DATA"]["allSum_FORMATED"];BX("PRICE_WITHOUT_DISCOUNT").innerHTML=re?t["BASKET_DATA"]["PRICE_WITHOUT_DISCOUNT"].replace(/\s/g," "):"";BX.style(BX("PRICE_WITHOUT_DISCOUNT").parentNode,"display",re?"table-row":"none")}BX.onCustomEvent("OnBasketChange")}}function couponCreate(e,t){var a="disabled";if(!BX.type.isElementNode(e))return;if(t.JS_STATUS==="BAD")a="bad";else if(t.JS_STATUS==="APPLYED")a="good";e.appendChild(BX.create("div",{props:{className:"bx_ordercart_coupon"},children:[BX.create("input",{props:{className:a,type:"text",value:t.COUPON,name:"OLD_COUPON[]"},attrs:{disabled:true,readonly:true}}),BX.create("span",{props:{className:a},attrs:{"data-coupon":t.COUPON}}),BX.create("div",{props:{className:"bx_ordercart_coupon_notes"},html:t.JS_CHECK_CODE})]}))}function couponListUpdate(e){var t,a,i,s,l,r,n,o;if(!!e&&typeof e!=="object"){return}t=BX("coupons_block");if(!!t){if(!!e.COUPON_LIST&&BX.type.isArray(e.COUPON_LIST)){i=BX("coupon");if(!!i){i.value=""}s=BX.findChildren(t,{tagName:"input",property:{name:"OLD_COUPON[]"}},true);if(!!s){if(BX.type.isElementNode(s)){s=[s]}for(r=0;r<e.COUPON_LIST.length;r++){l=false;o=-1;for(n=0;n<s.length;n++){if(s[n].value===e.COUPON_LIST[r].COUPON){l=true;o=n;
3s[n].couponUpdate=true;break}}if(l){a="disabled";if(e.COUPON_LIST[r].JS_STATUS==="BAD")a="bad";else if(e.COUPON_LIST[r].JS_STATUS==="APPLYED")a="good";BX.adjust(s[o],{props:{className:a}});BX.adjust(s[o].nextSibling,{props:{className:a}});BX.adjust(s[o].nextSibling.nextSibling,{html:e.COUPON_LIST[r].JS_CHECK_CODE})}else{couponCreate(t,e.COUPON_LIST[r])}}for(n=0;n<s.length;n++){if(typeof s[n].couponUpdate==="undefined"||!s[n].couponUpdate){BX.remove(s[n].parentNode);s[n]=null}else{s[n].couponUpdate=null}}}else{for(r=0;r<e.COUPON_LIST.length;r++){couponCreate(t,e.COUPON_LIST[r])}}}}t=null}function skuPropClickHandler(){var e=this,t,a,i={},s={},l,r,n,o,_;if(!!e&&e.hasAttribute("data-value-id")){BX.showWait();t=e.getAttribute("data-element");a=e.getAttribute("data-property");l=BX("action_var").value;i[a]=BX.util.htmlspecialcharsback(e.getAttribute("data-value-id"));if(BX.hasClass(e,"bx_active")){BX.closeWait();return}r=BX.findChildren(BX(t),{tagName:"ul",className:"sku_prop_list"},true);if(!!r&&r.length>0){for(n=0;r.length>n;n++){if(r[n].id!=="prop_"+a+"_"+t){o=BX.findChildren(BX(r[n].id),{tagName:"li",className:"bx_active"},true);if(!!o&&o.length>0){for(_=0;o.length>_;_++){if(o[_].hasAttribute("data-value-id")){i[o[_].getAttribute("data-property")]=BX.util.htmlspecialcharsback(o[_].getAttribute("data-value-id"))}}}}}}s={basketItemId:t,sessid:BX.bitrix_sessid(),site_id:BX.message("SITE_ID"),props:i,action_var:l,select_props:BX("column_headers").value,offers_props:BX("offers_props").value,quantity_float:BX("quantity_float").value,price_vat_show_value:BX("price_vat_show_value").value,hide_coupon:BX("hide_coupon").value,use_prepayment:BX("use_prepayment").value};s[l]="select_item";BX.ajax({url:"/bitrix/components/bitrix/sale.basket.basket/ajax.php",method:"POST",data:s,dataType:"json",onsuccess:function(e){BX.closeWait();updateBasketTable(t,e)}})}}function getColumnName(e,t){if(BX("col_"+t)){return BX.util.trim(BX("col_"+t).innerHTML)}else{return""}}function leftScroll(e,t,a){a=parseInt(a,10);var i=BX("prop_"+e+"_"+t);if(i){var s=parseInt(i.style.marginLeft,10);if(s<=-20)i.style.marginLeft=s+20+"%"}}function rightScroll(e,t,a){a=parseInt(a,10);var i=BX("prop_"+e+"_"+t);if(i){var s=parseInt(i.style.marginLeft,10);if(s>(5-a)*20)i.style.marginLeft=s-20+"%"}}function checkOut(){if(!!BX("coupon"))BX("coupon").disabled=true;BX("basket_form").submit();return true}function updateBasket(){recalcBasketAjax({})}function enterCoupon(){var e=BX("coupon");if(!!e&&!!e.value)recalcBasketAjax({coupon:e.value})}function updateQuantity(e,t,a,i){var s=BX(e).defaultValue,l=parseFloat(BX(e).value)||0,r=false,n=BX("auto_calculation")&&BX("auto_calculation").value=="Y"||!BX("auto_calculation");if(a===0||a==1){r=true}else{var o=l*1e4,_=a*1e4,u=o%_,c=parseInt(l);if(u===0){r=true}}var d=false;if(parseInt(l)!=parseFloat(l)){d=true}l=i===false&&d===false?parseInt(l):parseFloat(l).toFixed(4);l=correctQuantity(l);if(r){BX(e).defaultValue=l;BX("QUANTITY_INPUT_"+t).value=l;BX("QUANTITY_"+t).value=l;if(n){basketPoolQuantity.changeQuantity(t)}}else{l=getCorrectRatioQuantity(l,a,i);l=correctQuantity(l);if(l!=s){BX("QUANTITY_INPUT_"+t).value=l;BX("QUANTITY_"+t).value=l;if(n){basketPoolQuantity.changeQuantity(t)}}else{BX(e).value=s}}}function setQuantity(e,t,a,i){var s=parseFloat(BX("QUANTITY_INPUT_"+e).value),l;l=a=="up"?s+t:s-t;if(l<0)l=0;if(i){l=parseFloat(l).toFixed(4)}l=correctQuantity(l);if(t>0&&l<t){l=t}if(!i&&l!=l.toFixed(4)){l=parseFloat(l).toFixed(4)}l=getCorrectRatioQuantity(l,t,i);l=correctQuantity(l);BX("QUANTITY_INPUT_"+e).value=l;BX("QUANTITY_INPUT_"+e).defaultValue=l;updateQuantity("QUANTITY_INPUT_"+e,e,t,i)}function getCorrectRatioQuantity(e,t,a){var i=e*1e4,s=t*1e4,l=(e/t-(e/t).toFixed(0)).toFixed(6),r=e,n=false,o;t=parseFloat(t);if(l==0){return r}if(t!==0&&t!=1){for(o=t,max=parseFloat(e)+parseFloat(t);o<=max;o=parseFloat(parseFloat(o)+parseFloat(t)).toFixed(4)){r=o}}else if(t===1){r=e|0}if(parseInt(r,10)!=parseFloat(r)){n=true}r=a===false&&n===false?parseInt(r,10):parseFloat(r).toFixed(4);r=correctQuantity(r);return r}function correctQuantity(e){return parseFloat((e*1).toString())}function recalcBasketAjax(e){if(basketPoolQuantity.isProcessing()){return false}BX.showWait();var t={},a=BX("action_var").value,i=BX("basket_items"),s=BX("delayed_items"),l,r;
3l={sessid:BX.bitrix_sessid(),site_id:BX.message("SITE_ID"),props:t,action_var:a,select_props:BX("column_headers").value,offers_props:BX("offers_props").value,quantity_float:BX("quantity_float").value,price_vat_show_value:BX("price_vat_show_value").value,hide_coupon:BX("hide_coupon").value,use_prepayment:BX("use_prepayment").value};l[a]="recalculate";if(!!e&&typeof e==="object"){for(r in e){if(e.hasOwnProperty(r))l[r]=e[r]}}if(!!i&&i.rows.length>0){for(r=1;i.rows.length>r;r++)l["QUANTITY_"+i.rows[r].id]=BX("QUANTITY_"+i.rows[r].id).value}if(!!s&&s.rows.length>0){for(r=1;s.rows.length>r;r++)l["DELAY_"+s.rows[r].id]="Y"}basketPoolQuantity.setProcessing(true);basketPoolQuantity.clearPool();BX.ajax({url:"/bitrix/components/bitrix/sale.basket.basket/ajax.php",method:"POST",data:l,dataType:"json",onsuccess:function(t){BX.closeWait();basketPoolQuantity.setProcessing(false);if(e.coupon){if(!!t&&!!t.BASKET_DATA&&!!t.BASKET_DATA.NEED_TO_RELOAD_FOR_GETTING_GIFTS){BX.reload()}}if(basketPoolQuantity.isPoolEmpty()){updateBasketTable(null,t);basketPoolQuantity.updateQuantity()}else{basketPoolQuantity.enableTimer(true)}}})}function showBasketItemsList(e){BX.removeClass(BX("basket_toolbar_button"),"current");BX.removeClass(BX("basket_toolbar_button_delayed"),"current");BX.removeClass(BX("basket_toolbar_button_subscribed"),"current");BX.removeClass(BX("basket_toolbar_button_not_available"),"current");BX("normal_count").style.display="inline-block";BX("delay_count").style.display="inline-block";BX("subscribe_count").style.display="inline-block";BX("not_available_count").style.display="inline-block";if(e==2){if(BX("basket_items_list"))BX("basket_items_list").style.display="none";if(BX("basket_items_delayed")){BX("basket_items_delayed").style.display="block";BX.addClass(BX("basket_toolbar_button_delayed"),"current");BX("delay_count").style.display="none"}if(BX("basket_items_subscribed"))BX("basket_items_subscribed").style.display="none";if(BX("basket_items_not_available"))BX("basket_items_not_available").style.display="none"}else if(e==3){if(BX("basket_items_list"))BX("basket_items_list").style.display="none";if(BX("basket_items_delayed"))BX("basket_items_delayed").style.display="none";if(BX("basket_items_subscribed")){BX("basket_items_subscribed").style.display="block";BX.addClass(BX("basket_toolbar_button_subscribed"),"current");BX("subscribe_count").style.display="none"}if(BX("basket_items_not_available"))BX("basket_items_not_available").style.display="none"}else if(e==4){if(BX("basket_items_list"))BX("basket_items_list").style.display="none";if(BX("basket_items_delayed"))BX("basket_items_delayed").style.display="none";if(BX("basket_items_subscribed"))BX("basket_items_subscribed").style.display="none";if(BX("basket_items_not_available")){BX("basket_items_not_available").style.display="block";BX.addClass(BX("basket_toolbar_button_not_available"),"current");BX("not_available_count").style.display="none"}}else{if(BX("basket_items_list")){BX("basket_items_list").style.display="block";BX.addClass(BX("basket_toolbar_button"),"current");BX("normal_count").style.display="none"}if(BX("basket_items_delayed"))BX("basket_items_delayed").style.display="none";if(BX("basket_items_subscribed"))BX("basket_items_subscribed").style.display="none";if(BX("basket_items_not_available"))BX("basket_items_not_available").style.display="none"}}function deleteCoupon(){var e=this,t;if(BX.type.isElementNode(e)&&e.hasAttribute("data-coupon")){t=e.getAttribute("data-coupon");if(BX.type.isNotEmptyString(t)){recalcBasketAjax({delete_coupon:t})}}}function deleteProductRow(e){var t=BX.findParent(e,{tagName:"TR"}),a,i;if(t){a=BX("QUANTITY_"+t.id);if(a){i=getCurrentItemAnalyticsInfo(t,a.value)}}setAnalyticsDataLayer([],[i]);document.location.href=e.href;return false}function checkAnalytics(e,t){if(!e||!t||BX.util.array_values(e).length===0)return;var a,i,s={},l=[],r=[],n;if(!!t&&t.rows.length){for(n=1;t.rows.length>n;n++){a=t.rows[n].id;i=BX("QUANTITY_"+a).value-e[a];if(i!=0){s=getCurrentItemAnalyticsInfo(t.rows[n],i);if(i>0){l.push(s)}else{r.push(s)}}}}if(l.length||r.length){setAnalyticsDataLayer(l,r)}}function getCurrentItemAnalyticsInfo(e,t){if(!e)return;var a,i,s=[];var l={name:e.getAttribute("data-item-name")||"",id:e.id,price:e.getAttribute("data-item-price")||0,brand:(e.getAttribute("data-item-brand")||"").split(", ").join("/"),variant:"",quantity:Math.abs(t)};a=e.querySelectorAll(".bx_active[data-sku-name]");for(i=0;i<a.length;i++){s.push(a[i].getAttribute("data-sku-name"))}l.variant=s.join("/");return l}function setAnalyticsDataLayer(e,t){window[basketJSParams["DATA_LAYER_NAME"]]=window[basketJSParams["DATA_LAYER_NAME"]]||[];if(e&&e.length){window[basketJSParams["DATA_LAYER_NAME"]].push({event:"addToCart",ecommerce:{currencyCode:getCurrencyCode(),add:{products:e}}})}if(t&&t.length){window[basketJSParams["DATA_LAYER_NAME"]].push({event:"removeFromCart",ecommerce:{currencyCode:getCurrencyCode(),remove:{products:t}}})}}function getCurrencyCode(){var e=BX("basket_items"),t,a="";if(e){t=e.querySelector("[data-item-currency");t&&(a=t.getAttribute("data-item-currency"))}return a}BX.ready(function(){basketPoolQuantity=new BasketPoolQuantity;var e=BX("coupons_block"),t=BX("basket_items");if(BX.type.isElementNode(e))BX.bindDelegate(e,"click",{attribute:"data-coupon"},deleteCoupon);if(BX.type.isElementNode(t))BX.bindDelegate(t,"click",{tagName:"li",attr:{"data-sku-selector":"Y"}},skuPropClickHandler);if(BX.type.isNotEmptyString(basketJSParams["EVENT_ONCHANGE_ON_START"])&&basketJSParams["EVENT_ONCHANGE_ON_START"]=="Y")BX.onCustomEvent("OnBasketChange")}); 4/* End */ 5; 6; /* Start:"a:4:{s:4:"full";
6s:97:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/mustache.min.js?16968728505835";s:6:"source";s:78:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/mustache.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 7(function e(t,r){if(typeof exports==="object"&&exports&&typeof exports.nodeName!=="string"){r(exports)}else if(typeof define==="function"&&define.amd){define(["exports"],r)}else{t.Mustache={};r(t.Mustache)}})(this,function e(t){var r=Object.prototype.toString;var n=Array.isArray||function e(t){return r.call(t)==="[object Array]"};function i(e){return typeof e==="function"}function s(e){return n(e)?"array":typeof e}function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return e!=null&&typeof e==="object"&&t in e}var u=RegExp.prototype.test;function l(e,t){return u.call(e,t)}var f=/\S/;function c(e){return!l(f,e)}var p={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function h(e){return String(e).replace(/[&<>"'`=\/]/g,function e(t){return p[t]})}var v=/\s*/;var d=/\s+/;var g=/\s*=/;var w=/\s*\}/;var y=/#|\^|\/|>|\{|&|=|!/;function x(e,r){if(!e)return[];var i=[];var s=[];var o=[];var u=false;var l=false;function f(){if(u&&!l){while(o.length)delete s[o.pop()]}else{o=[]}u=false;l=false}var p,h,x;function E(e){if(typeof e==="string")e=e.split(d,2);if(!n(e)||e.length!==2)throw new Error("Invalid tags: "+e);p=new RegExp(a(e[0])+"\\s*");h=new RegExp("\\s*"+a(e[1]));x=new RegExp("\\s*"+a("}"+e[1]))}E(r||t.tags);var U=new m(e);var T,j,S,V,C,A;while(!U.eos()){T=U.pos;S=U.scanUntil(p);if(S){for(var I=0,R=S.length;I<R;++I){V=S.charAt(I);if(c(V)){o.push(s.length)}else{l=true}s.push(["text",V,T,T+1]);T+=1;if(V==="\n")f()}}if(!U.scan(p))break;u=true;j=U.scan(y)||"name";U.scan(v);if(j==="="){S=U.scanUntil(g);U.scan(g);U.scanUntil(h)}else if(j==="{"){S=U.scanUntil(x);U.scan(w);U.scanUntil(h);j="&"}else{S=U.scanUntil(h)}if(!U.scan(h))throw new Error("Unclosed tag at "+U.pos);C=[j,S,T,U.pos];s.push(C);if(j==="#"||j==="^"){i.push(C)}else if(j==="/"){A=i.pop();if(!A)throw new Error('Unopened section "'+S+'" at '+T);if(A[1]!==S)throw new Error('Unclosed section "'+A[1]+'" at '+T)}else if(j==="name"||j==="{"||j==="&"){l=true}else if(j==="="){E(S)}}A=i.pop();if(A)throw new Error('Unclosed section "'+A[1]+'" at '+U.pos);return b(k(s))}function k(e){var t=[];var r,n;for(var i=0,s=e.length;i<s;++i){r=e[i];if(r){if(r[0]==="text"&&n&&n[0]==="text"){n[1]+=r[1];n[3]=r[3]}else{t.push(r);n=r}}}return t}function b(e){var t=[];var r=t;var n=[];var i,s;for(var a=0,o=e.length;a<o;++a){i=e[a];switch(i[0]){case"#":case"^":r.push(i);n.push(i);r=i[4]=[];break;case"/":s=n.pop();s[5]=i[2];r=n.length>0?n[n.length-1][4]:t;break;default:r.push(i)}}return t}function m(e){this.string=e;this.tail=e;this.pos=0}m.prototype.eos=function e(){return this.tail===""};m.prototype.scan=function e(t){var r=this.tail.match(t);if(!r||r.index!==0)return"";var n=r[0];this.tail=this.tail.substring(n.length);this.pos+=n.length;return n};m.prototype.scanUntil=function e(t){var r=this.tail.search(t),n;switch(r){case-1:n=this.tail;this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,r);this.tail=this.tail.substring(r)}this.pos+=n.length;return n};function E(e,t){this.view=e;this.cache={".":this.view};this.parent=t}E.prototype.push=function e(t){return new E(t,this)};E.prototype.lookup=function e(t){var r=this.cache;var n;if(r.hasOwnProperty(t)){n=r[t]}else{var s=this,a,u,l=false;while(s){if(t.indexOf(".")>0){n=s.view;a=t.split(".");u=0;while(n!=null&&u<a.length){if(u===a.length-1)l=o(n,a[u]);n=n[a[u++]]}}else{n=s.view[t];l=o(s.view,t)}if(l)break;s=s.parent}r[t]=n}if(i(n))n=n.call(this.view);return n};function U(){this.cache={}}U.prototype.clearCache=function e(){this.cache={}};U.prototype.parse=function e(r,n){var i=this.cache;var s=i[r];if(s==null)s=i[r+":"+(n||t.tags).join(":")]=x(r,n);return s};U.prototype.render=function e(t,r,n){var i=this.parse(t);var s=r instanceof E?r:new E(r);return this.renderTokens(i,s,n,t)};U.prototype.renderTokens=function e(t,r,n,i){var s="";var a,o,u;for(var l=0,f=t.length;l<f;++l){u=undefined;a=t[l];o=a[0];if(o==="#")u=this.renderSection(a,r,n,i);else if(o==="^")u=this.renderInverted(a,r,n,i);else if(o===">")u=this.renderPartial(a,r,n,i);else if(o==="&")u=this.unescapedValue(a,r);else if(o==="name")u=this.escapedValue(a,r);else if(o==="text")u=this.rawValue(a);if(u!==undefined)s+=u}return s};U.prototype.renderSection=function e(t,r,s,a){var o=this;var u="";var l=r.lookup(t[1]);function f(e){return o.render(e,r,s)}if(!l)return;if(n(l)){for(var c=0,p=l.length;c<p;++c){u+=this.renderTokens(t[4],r.push(l[c]),s,a)}}else if(typeof l==="object"||typeof l==="string"||typeof l==="number"){u+=this.renderTokens(t[4],r.push(l),s,a)}
7else if(i(l)){if(typeof a!=="string")throw new Error("Cannot use higher-order sections without the original template");l=l.call(r.view,a.slice(t[3],t[5]),f);if(l!=null)u+=l}else{u+=this.renderTokens(t[4],r,s,a)}return u};U.prototype.renderInverted=function e(t,r,i,s){var a=r.lookup(t[1]);if(!a||n(a)&&a.length===0)return this.renderTokens(t[4],r,i,s)};U.prototype.renderPartial=function e(t,r,n){if(!n)return;var s=i(n)?n(t[1]):n[t[1]];if(s!=null)return this.renderTokens(this.parse(s),r,n,s)};U.prototype.unescapedValue=function e(t,r){var n=r.lookup(t[1]);if(n!=null)return n};U.prototype.escapedValue=function e(r,n){var i=n.lookup(r[1]);if(i!=null)return t.escape(i)};U.prototype.rawValue=function e(t){return t[1]};t.name="mustache.js";t.version="2.3.0";t.tags=["{{","}}"];var T=new U;t.clearCache=function e(){return T.clearCache()};t.parse=function e(t,r){return T.parse(t,r)};t.render=function e(t,r,n){if(typeof t!=="string"){throw new TypeError('Invalid template! Template should be a "string" '+'but "'+s(t)+'" was given as the first '+"argument for mustache#render(template, view, partials)")}return T.render(t,r,n)};t.to_html=function e(r,n,s,a){var o=t.render(r,n,s);if(i(a)){a(o)}else{return o}};t.escape=h;t.Scanner=m;t.Context=E;t.Writer=U;return t}); 8/* End */ 9; 10; /* Start:"a:4:{s:4:"full";s:100:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/action-pool.min.js?16968728504358";s:6:"source";s:81:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/action-pool.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 11(function(){"use strict";BX.namespace("BX.Sale.BasketActionPool");BX.Sale.BasketActionPool=function(t){this.component=t;this.requestProcessing=false;this.updateTimer=null;this.isBasketRefreshed=this.component.params.DEFERRED_REFRESH!=="Y";this.needFullRecalculation=this.component.params.DEFERRED_REFRESH==="Y";this.pool={};this.lastActualPool={};this.approvedAction=["QUANTITY","DELETE","RESTORE","DELAY","OFFER","MERGE_OFFER"];this.switchTimer()};BX.Sale.BasketActionPool.prototype.setRefreshStatus=function(t){this.isBasketRefreshed=!!t};BX.Sale.BasketActionPool.prototype.getRefreshStatus=function(){return this.isBasketRefreshed};BX.Sale.BasketActionPool.prototype.isItemInPool=function(t){return!!this.pool[t]};BX.Sale.BasketActionPool.prototype.clearLastActualQuantityPool=function(t){this.lastActualPool[t]&&delete this.lastActualPool[t].QUANTITY};BX.Sale.BasketActionPool.prototype.checkItemPoolBefore=function(t){if(!t)return;this.pool[t]=this.pool[t]||{}};BX.Sale.BasketActionPool.prototype.checkItemPoolAfter=function(t){if(!t||!this.pool[t])return;if(Object.keys(this.pool[t]).length===0){delete this.pool[t]}};BX.Sale.BasketActionPool.prototype.addCoupon=function(t){this.pool.COUPON=t;this.switchTimer()};BX.Sale.BasketActionPool.prototype.removeCoupon=function(t){this.checkItemPoolBefore("REMOVE_COUPON");this.pool.REMOVE_COUPON[t]=t;this.switchTimer()};BX.Sale.BasketActionPool.prototype.changeQuantity=function(t,o,e){this.checkItemPoolBefore(t);if(this.lastActualPool[t]&&this.lastActualPool[t].QUANTITY!==o||!this.lastActualPool[t]&&o!==e){this.pool[t].QUANTITY=o}else{this.pool[t]&&delete this.pool[t].QUANTITY}this.checkItemPoolAfter(t);this.switchTimer()};BX.Sale.BasketActionPool.prototype.deleteItem=function(t){this.checkItemPoolBefore(t);if(this.pool[t].RESTORE){delete this.pool[t].RESTORE}else{this.pool[t].DELETE="Y"}this.checkItemPoolAfter(t);this.switchTimer()};BX.Sale.BasketActionPool.prototype.restoreItem=function(t,o){this.checkItemPoolBefore(t);if(this.pool[t].DELETE==="Y"){delete this.pool[t].DELETE}else{this.pool[t].RESTORE=o}this.checkItemPoolAfter(t);this.switchTimer()};BX.Sale.BasketActionPool.prototype.addDelayed=function(t){this.checkItemPoolBefore(t);this.pool[t].DELAY="Y";this.checkItemPoolAfter(t);this.switchTimer()};BX.Sale.BasketActionPool.prototype.removeDelayed=function(t){this.checkItemPoolBefore(t);this.pool[t].DELAY="N";this.checkItemPoolAfter(t);this.switchTimer()};BX.Sale.BasketActionPool.prototype.changeSku=function(t,o,e){if(JSON.stringify(o)!==JSON.stringify(e)){this.checkItemPoolBefore(t);this.pool[t].OFFER=o}else{this.pool[t]&&delete this.pool[t].OFFER;this.checkItemPoolAfter(t)}this.switchTimer()};BX.Sale.BasketActionPool.prototype.mergeSku=function(t){this.checkItemPoolBefore(t);this.pool[t].MERGE_OFFER="Y";this.switchTimer()};BX.Sale.BasketActionPool.prototype.switchTimer=function(){clearTimeout(this.updateTimer);if(this.isProcessing()){return}if(this.isPoolEmpty()){this.component.editPostponedBasketItems();this.component.fireCustomEvents()}if(!this.isPoolEmpty()){this.updateTimer=setTimeout(BX.proxy(this.trySendPool,this),300)}else if(!this.getRefreshStatus()){this.trySendPool()}};BX.Sale.BasketActionPool.prototype.trySendPool=function(){if(this.isPoolEmpty()&&this.getRefreshStatus()){return}this.doProcessing(true);if(!this.isPoolEmpty()){this.component.sendRequest("recalculateAjax",{basket:this.getPoolData()});this.lastActualPool=this.pool;this.pool={}}else if(!this.getRefreshStatus()){this.component.sendRequest("refreshAjax",{fullRecalculation:this.needFullRecalculation?"Y":"N"});this.needFullRecalculation=false}};BX.Sale.BasketActionPool.prototype.getPoolData=function(){var t={},o=this.pool;
11if(o.COUPON){t.coupon=o.COUPON;delete o.COUPON}if(o.REMOVE_COUPON){t.delete_coupon=o.REMOVE_COUPON;delete o.REMOVE_COUPON}for(var e in o){if(o.hasOwnProperty(e)){for(var i in o[e]){if(o[e].hasOwnProperty(i)&&BX.util.in_array(i,this.approvedAction)){t[i+"_"+e]=o[e][i]}}}}return t};BX.Sale.BasketActionPool.prototype.isPoolEmpty=function(){return Object.keys(this.pool).length===0};BX.Sale.BasketActionPool.prototype.doProcessing=function(t){this.requestProcessing=t===true;if(this.requestProcessing){this.component.startLoader()}else{this.component.endLoader()}};BX.Sale.BasketActionPool.prototype.isProcessing=function(){return this.requestProcessing===true}})(); 12/* End */ 13; 14; /* Start:"a:4:{s:4:"full";s:96:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/filter.min.js?169687285010511";s:6:"source";s:76:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/filter.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 15(function(){"use strict";BX.namespace("BX.Sale.BasketFilter");BX.Sale.BasketFilter=function(t){this.component=t;this.activeFilterMode=false;this.filterTimer=null;this.mouseOverClearFilter=false;this.realShownItems=[];this.realSortedItems=[];this.realScrollTop=0;this.lastShownItemsHash="";this.currentFilter={query:"",similarHash:"",warning:false,notAvailable:false,delayed:false};if(this.component.useItemsFilter){this.bindEvents()}};BX.Sale.BasketFilter.prototype.bindEvents=function(){var t;var e=this.component.getEntity(this.component.getCacheNode(this.component.ids.itemListWrapper),"basket-filter");t=this.component.getEntity(e,"basket-filter-input");if(BX.type.isDomNode(t)){BX.bind(t,"focus",function(){e.style.flex=3});BX.bind(t,"blur",BX.delegate(function(){if(!this.mouseOverClearFilter){e.style.flex=""}},this));BX.bind(t,"keyup",BX.proxy(this.onFilterInput,this));BX.bind(t,"cut",BX.proxy(this.onFilterInput,this));BX.bind(t,"paste",BX.proxy(this.onFilterInput,this))}t=this.component.getEntity(e,"basket-filter-clear-btn");if(BX.type.isDomNode(t)){BX.bind(t,"mouseenter",BX.delegate(function(){this.mouseOverClearFilter=true},this));BX.bind(t,"mouseout",BX.delegate(function(){this.mouseOverClearFilter=false},this));BX.bind(t,"click",BX.delegate(function(){if(!this.filterInputEmpty()){this.clearFilterInput();this.onFilterChange()}e.style.flex=""},this))}};BX.Sale.BasketFilter.prototype.isActive=function(){return this.activeFilterMode};BX.Sale.BasketFilter.prototype.showFilterByName=function(t){if(!t)return;switch(t){case"not-available":this.showNotAvailableItemsFilter();break;case"delayed":this.showDelayItemsFilter();break;case"warning":this.showWarningItemsFilter();break;case"similar":this.showSimilarItemsFilter();break;case"all":default:this.clearAllFiltersExcept([]);this.onFilterChange()}};BX.Sale.BasketFilter.prototype.onFilterInput=function(){var t=BX.type.isDomNode(BX.proxy_context)?BX.util.trim(BX.proxy_context.value).toLowerCase():"";if(this.currentFilter.query!==t){this.currentFilter.query=t;this.onFilterChange()}};BX.Sale.BasketFilter.prototype.clearAllFiltersExcept=function(t){if(!t||!BX.type.isArray(t))return;!BX.util.in_array("input",t)&&this.clearFilterInput();!BX.util.in_array("warning",t)&&this.clearWarningItemsFilter();!BX.util.in_array("delayed",t)&&this.clearDelayItemsFilter();!BX.util.in_array("not-available",t)&&this.clearNotAvailableItemsFilter();if(!BX.util.in_array("similar",t)){this.clearSimilarItemsFilter();this.component.showSimilarCount(false)}};BX.Sale.BasketFilter.prototype.filterInputEmpty=function(){return this.currentFilter.query.length===0};BX.Sale.BasketFilter.prototype.clearFilterInput=function(){this.currentFilter.query="";var t=this.component.getEntity(this.component.getCacheNode(this.component.ids.itemListWrapper),"basket-filter-input");if(BX.type.isDomNode(t)){t.value=""}};BX.Sale.BasketFilter.prototype.addWarningItemsFilter=function(){this.currentFilter.warning=true};BX.Sale.BasketFilter.prototype.clearWarningItemsFilter=function(){this.currentFilter.warning=false};BX.Sale.BasketFilter.prototype.showWarningItemsFilter=function(){if(!this.currentFilter.warning){this.clearAllFiltersExcept(["warning"]);this.addWarningItemsFilter();this.onFilterChange()}};BX.Sale.BasketFilter.prototype.addDelayItemsFilter=function(){this.currentFilter.delayed=true};BX.Sale.BasketFilter.prototype.clearDelayItemsFilter=function(){this.currentFilter.delayed=false};BX.Sale.BasketFilter.prototype.showDelayItemsFilter=function(){if(!this.currentFilter.delayed){this.clearAllFiltersExcept(["delayed"]);this.addDelayItemsFilter();this.onFilterChange()}};BX.Sale.BasketFilter.prototype.addNotAvailableItemsFilter=function(){this.currentFilter.notAvailable=true};BX.Sale.BasketFilter.prototype.clearNotAvailableItemsFilter=function(){this.currentFilter.notAvailable=false};BX.Sale.BasketFilter.prototype.showNotAvailableItemsFilter=function(){if(!this.currentFilter.notAvailable){this.clearAllFiltersExcept(["not-available"]);this.addNotAvailableItemsFilter();this.onFilterChange()}};BX.Sale.BasketFilter.prototype.addSimilarItemsFilter=function(t){this.currentFilter.similarHash=t.HASH};BX.Sale.BasketFilter.prototype.clearSimilarItemsFilter=function(){this.currentFilter.similarHash=""};BX.Sale.BasketFilter.prototype.showSimilarItemsFilter=function(){var t=this.component.getItemDataByTarget(BX.proxy_context);if(this.currentFilter.similarHash!==t.HASH){this.clearAllFiltersExcept(["similar"]);this.addSimilarItemsFilter(t);this.onFilterChange()}};BX.Sale.BasketFilter.prototype.getTimeoutDuration=function(){return this.component.duration.filterTimer};BX.Sale.BasketFilter.prototype.onFilterChange=function(){this.component.showItemsOverlay();if(this.currentFilter.query.length||this.currentFilter.similarHash.length||this.currentFilter.warning||this.currentFilter.notAvailable||this.currentFilter.delayed){clearTimeout(this.filterTimer);this.filterTimer=setTimeout(BX.proxy(this.enableFilterMode,this),this.getTimeoutDuration())}else{this.disableFilterMode()}};BX.Sale.BasketFilter.prototype.enableFilterMode=function(){var t;if(!this.activeFilterMode){this.activeFilterMode=true;this.realShownItems=BX.util.array_values(this.component.shownItems);this.realSortedItems=BX.util.array_values(this.component.sortedItems);this.realScrollTop=this.component.getDocumentScrollTop()}this.component.scrollToFirstItem();this.component.sortedItems=this.searchItems();t=JSON.stringify(this.component.sortedItems);if(this.lastShownItemsHash!==t){this.lastShownItemsHash=t;this.component.deleteBasketItems(BX.util.array_values(this.component.shownItems),false);
15if(this.component.sortedItems.length){this.component.initializeBasketItems();this.hideEmptyFilterResult()}else{this.showEmptyFilterResult()}if(this.currentFilter.similarHash.length){this.component.showSimilarCount(true)}}else{this.highlightFoundItems()}this.component.hideItemsOverlay()};BX.Sale.BasketFilter.prototype.disableFilterMode=function(){clearTimeout(this.filterTimer);this.lastShownItemsHash="";if(this.activeFilterMode){this.activeFilterMode=false;this.component.sortedItems=BX.util.array_values(this.realSortedItems);this.component.deleteBasketItems(BX.util.array_values(this.component.shownItems),false);this.hideEmptyFilterResult();this.component.editBasketItems(BX.util.array_values(this.realShownItems));window.scrollTo(0,this.realScrollTop)}this.component.hideItemsOverlay()};BX.Sale.BasketFilter.prototype.searchItems=function(){var t=[];for(var e=0;e<this.realSortedItems.length;e++){var i=this.component.items[this.realSortedItems[e]];if(i&&this.searchItemMatch(i)){t.push(i.ID)}}return t};BX.Sale.BasketFilter.prototype.highlightFoundItems=function(){if(!this.activeFilterMode)return;for(var t in this.component.shownItems){if(this.component.shownItems.hasOwnProperty(t)){this.highlightSearchMatch(this.component.items[this.component.shownItems[t]])}}};BX.Sale.BasketFilter.prototype.searchItemMatch=function(t){var e=false,i=false;if(this.currentFilter.notAvailable){i=!!t.NOT_AVAILABLE;if(!i){return e}}else if(this.currentFilter.delayed){i=!!t.DELAYED;if(!i){return e}}else if(this.currentFilter.warning){i=BX.util.in_array(t.ID,this.component.warningItems);if(!i){return e}}else if(BX.type.isNotEmptyString(this.currentFilter.similarHash)){i=this.currentFilter.similarHash===t.HASH;if(!i){return e}}if(BX.type.isNotEmptyString(this.currentFilter.query)){if(t.NAME.toLowerCase().indexOf(this.currentFilter.query)!==-1){e="NAME"}if(!e){var r=parseFloat(this.currentFilter.query);if(!isNaN(r)){if(parseFloat(t.PRICE)===r){e="PRICE"}else if(parseFloat(t.SUM_PRICE)===r){e="SUM_PRICE"}}}if(!e&&this.currentFilter.query.length>=3){if(t.PRICE_FORMATED.toLowerCase().indexOf(this.currentFilter.query)!==-1){e="PRICE"}else if(t.SUM_PRICE_FORMATED.toLowerCase().indexOf(this.currentFilter.query)!==-1){e="SUM_PRICE"}}var s,l;if(!e&&t.PROPS.length){for(s in t.PROPS){if(t.PROPS.hasOwnProperty(s)&&BX.type.isNotEmptyString(t.PROPS[s].VALUE)){l=t.PROPS[s].VALUE.toLowerCase();if(l===this.currentFilter.query||this.currentFilter.query.length>=3&&l.indexOf(this.currentFilter.query)!==-1){e="PROPS";break}}}}if(!e&&t.COLUMN_LIST.length){for(s in t.COLUMN_LIST){if(t.COLUMN_LIST.hasOwnProperty(s)&&BX.type.isNotEmptyString(t.COLUMN_LIST[s].VALUE)){l=t.COLUMN_LIST[s].VALUE.toLowerCase();if(l===this.currentFilter.query||this.currentFilter.query.length>=3&&l.indexOf(this.currentFilter.query)!==-1){e="COLUMNS";break}}}}}else if(i){e=true}return e};BX.Sale.BasketFilter.prototype.highlightSearchMatch=function(t){var e=this.searchItemMatch(t);if(e){var i,r,s,l;switch(e){case"NAME":i=this.component.getEntity(BX(this.component.ids.item+t.ID),"basket-item-name");if(BX.type.isDomNode(i)){i.innerHTML=t.NAME.replace(new RegExp("(.*)("+this.currentFilter.query.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+")(.*)","gi"),function(t,e,i,r){return BX.util.htmlspecialchars(e)+'<span class="basket-item-highlighted">'+BX.util.htmlspecialchars(i)+"</span>"+BX.util.htmlspecialchars(r)})}break;case"PRICE":i=BX(this.component.ids.price+t.ID);BX.addClass(i,"basket-item-highlighted");break;case"SUM_PRICE":i=BX(this.component.ids.sumPrice+t.ID);BX.addClass(i,"basket-item-highlighted");break;case"PROPS":i=this.component.getEntities(BX(this.component.ids.item+t.ID),"basket-item-property-value");for(r=0;r<i.length;r++){l=i[r].getAttribute("data-property-code");for(s in t.PROPS){if(t.PROPS.hasOwnProperty(s)&&t.PROPS[s].CODE===l){i[r].innerHTML=t.PROPS[s].VALUE.replace(new RegExp("("+this.currentFilter.query+")","gi"),'<span class="basket-item-highlighted">$1</span>')}}}break;case"COLUMNS":i=this.component.getEntities(BX(this.component.ids.item+t.ID),"basket-item-property-column-value");for(r=0;r<i.length;r++){l=i[r].getAttribute("data-column-property-code");for(s in t.COLUMN_LIST){if(t.COLUMN_LIST.hasOwnProperty(s)&&t.COLUMN_LIST[s].CODE===l){i[r].innerHTML=t.COLUMN_LIST[s].VALUE.replace(new RegExp("("+this.currentFilter.query+")","gi"),'<span class="basket-item-highlighted">$1</span>')}}}break}}};BX.Sale.BasketFilter.prototype.showEmptyFilterResult=function(){var t=this.component.getCacheNode(this.component.ids.itemList);if(BX.type.isDomNode(t)&&t.clientHeight>=500){var e=this.component.getCacheNode(this.component.ids.itemListEmptyResult);
15if(BX.type.isDomNode(e)){e.style.display=""}}};BX.Sale.BasketFilter.prototype.hideEmptyFilterResult=function(){var t=this.component.getCacheNode(this.component.ids.itemListEmptyResult);if(BX.type.isDomNode(t)){t.style.display="none"}}})(); 16/* End */ 17; 18; /* Start:"a:4:{s:4:"full";s:99:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/component.min.js?169687285037537";s:6:"source";s:79:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/component.js";s:3:"min";s:83:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/component.min.js";s:3:"map";s:83:"/bitrix/components/bitrix/sale.basket.basket/templates/.default/js/component.map.js";}"*/ 19(function(){"use strict";BX.namespace("BX.Sale.BasketComponent");BX.Sale.BasketComponent={maxItemsShowCount:30,precisionFactor:Math.pow(10,6),stickyHeaderOffset:0,duration:{priceAnimation:300,filterTimer:300},ids:{item:"basket-item-",quantity:"basket-item-quantity-",price:"basket-item-price-",sumPrice:"basket-item-sum-price-",sumPriceOld:"basket-item-sum-price-old-",sumPriceDiff:"basket-item-sum-price-difference-",itemHeightAligner:"basket-item-height-aligner-",total:"basket-total-price",basketRoot:"basket-root",itemListWrapper:"basket-items-list-wrapper",itemListContainer:"basket-items-list-container",itemList:"basket-item-list",itemListTable:"basket-item-table",itemListEmptyResult:"basket-item-list-empty-result",itemListOverlay:"basket-items-list-overlay",warning:"basket-warning"},initializePrimaryFields:function(){this.templates={};this.nodes={};this.items={};this.sortedItems=[];this.shownItems=[];this.changedItems=[];this.postponedItems=[];this.warningItems=[];this.isMobile=BX.browser.IsMobile();this.isTouch=BX.hasClass(document.documentElement,"bx-touch");this.lastAction="initialLoad";this.coupons=null;this.imagePopup=null;this.loadingScreen=null;this.quantityDelay=null;this.quantityTimer=null},init:function(t){this.initializePrimaryFields();this.params=t.params||{};this.template=t.template||"";this.signedParamsString=t.signedParamsString||"";this.siteId=t.siteId||"";this.siteTemplateId=t.siteTemplateId||"";this.ajaxUrl=this.params.AJAX_PATH||"";this.templateFolder=t.templateFolder||"";this.useDynamicScroll=this.params.USE_DYNAMIC_SCROLL==="Y";this.useItemsFilter=this.params.SHOW_FILTER==="Y"&&!this.isMobile;this.initializeFilter();this.applyBasketResult(t.result);this.initializeActionPool();if(this.useItemsFilter){this.checkHeaderDisplay();this.bindHeaderEvents()}this.initializeBasketItems();this.editTotal();this.editWarnings();this.getCacheNode(this.ids.basketRoot).style.opacity=1;this.bindInitialEvents()},getTemplate:function(t){if(!this.templates.hasOwnProperty(t)){var i=BX(t);this.templates[t]=BX.type.isDomNode(i)?i.innerHTML:""}return this.templates[t]},getCacheNode:function(t){if(!this.nodes.hasOwnProperty(t)){this.nodes[t]=BX(t)}return this.nodes[t]},getEntity:function(t,i,e){if(!t||!i)return null;e=e||"";return t.querySelector(e+'[data-entity="'+i+'"]')},getEntities:function(t,i,e){if(!t||!i)return{length:0};e=e||"";return t.querySelectorAll(e+'[data-entity="'+i+'"]')},bindInitialEvents:function(){this.bindWarningEvents();BX.bind(window,"scroll",BX.proxy(this.checkStickyHeaders,this));BX.bind(window,"scroll",BX.proxy(this.lazyLoad,this));BX.bind(window,"resize",BX.throttle(this.checkStickyHeaders,20,this))},bindWarningEvents:function(){var t=this.getEntity(BX(this.ids.warning),"basket-items-warning-count");if(BX.type.isDomNode(t)){t.style.display="";BX.bind(t,"click",BX.delegate(function(){this.toggleFilter("warning")},this))}BX.bind(this.getEntity(BX(this.ids.warning),"basket-items-warning-notification-close"),"click",BX.proxy(this.removeAllWarnings,this))},toggleFilter:function(t){var i=BX.type.isNotEmptyString(t)?this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="'+t+'"]'):BX.getEventTarget(t);if(!BX.type.isDomNode(i)||BX.hasClass(i,"active"))return;var e=i.getAttribute("data-filter");var s=i.parentNode.querySelectorAll("[data-filter]");for(var a=0;a<s.length;a++){if(s[a].getAttribute("data-filter")===e){BX.addClass(s[a],"active")}else if(BX.hasClass(s[a],"active")){BX.removeClass(s[a],"active")}}this.filter.showFilterByName(e)},scrollToFirstItem:function(){var t=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-list-header");if(BX.type.isDomNode(t)){var i=BX.pos(this.getCacheNode(this.ids.itemListContainer)).top;var e=BX.pos(t).bottom;if(i<e){window.scrollTo(0,i-this.stickyHeaderOffset)}}},showItemsOverlay:function(){var t=this.getCacheNode(this.ids.itemListOverlay);if(BX.type.isDomNode(t)){t.style.display=""}},hideItemsOverlay:function(){var t=this.getCacheNode(this.ids.itemListOverlay);if(BX.type.isDomNode(t)){t.style.display="none"}},checkHeaderDisplay:function(){var t=this.getCacheNode(this.ids.itemListWrapper);if(BX.type.isDomNode(t)){BX.removeClass(t,"basket-items-list-wrapper-light")}},bindHeaderEvents:function(){var t=this.getEntities(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count");for(var i=0;i<t.length;i++){BX.bind(t[i],"click",BX.proxy(this.toggleFilter,this))}},checkStickyHeaders:function(){if(this.isMobile)return;var t,i;var e=2,s=0;var a=this.getDocumentScrollTop();var n=BX.pos(this.getCacheNode(this.ids.basketRoot));var r=a+200>=n.bottom;if(BX.util.in_array("top",this.params.TOTAL_BLOCK_DISPLAY)){var o=this.getEntity(this.getCacheNode(this.ids.basketRoot),"basket-total-block");if(BX.type.isDomNode(o)){t=this.getEntity(o,"basket-checkout-aligner");if(BX.type.isDomNode(t)){i=BX.pos(o);if(a>
19=i.top){s+=t.clientHeight;if(!BX.hasClass(t,"basket-checkout-container-fixed")){o.style.height=i.height+"px";t.style.width=t.clientWidth+e+"px";BX.addClass(t,"basket-checkout-container-fixed")}}else if(BX.hasClass(t,"basket-checkout-container-fixed")){o.style.height="";t.style.width="";BX.removeClass(t,"basket-checkout-container-fixed")}if(r){if(!BX.hasClass(t,"basket-checkout-container-fixed-hide")){BX.addClass(t,"basket-checkout-container-fixed-hide")}}else if(BX.hasClass(t,"basket-checkout-container-fixed-hide")){BX.removeClass(t,"basket-checkout-container-fixed-hide")}}}}if(this.useItemsFilter){var h=this.getCacheNode(this.ids.itemListWrapper);t=this.getEntity(h,"basket-items-list-header");if(BX.type.isDomNode(t)){i=BX.pos(h);if(a+s>=i.top&&!r){if(!BX.hasClass(t,"basket-items-list-header-fixed")){t.style.width=t.clientWidth+e+"px";h.style.paddingTop=t.clientHeight+"px";BX.addClass(t,"basket-items-list-header-fixed")}if(s){t.style.top=s+"px"}s+=t.clientHeight}else if(BX.hasClass(t,"basket-items-list-header-fixed")){h.style.paddingTop="";t.style.width="";t.style.top="";BX.removeClass(t,"basket-items-list-header-fixed")}}}this.stickyHeaderOffset=s},getDocumentScrollTop:function(){return window.scrollY||window.pageYOffset||document.body.scrollTop+(document.documentElement&&document.documentElement.scrollTop||0)},lazyLoad:function(){var t=BX.pos(this.getCacheNode(this.ids.itemListContainer));if(this.getDocumentScrollTop()+window.innerHeight>=t.bottom-400){var i=this.getItemsAfter();if(i.length){this.editBasketItems(i)}}},fireCustomEvents:function(){if(this.result.EVENT_ONCHANGE_ON_START==="Y"){BX.onCustomEvent("OnBasketChange")}if(this.params.HIDE_COUPON!=="Y"){if(this.coupons!==null&&this.coupons!==this.result.COUPON_LIST){BX.onCustomEvent("OnCouponApply")}this.coupons=this.result.COUPON_LIST}},editTotal:function(){this.fillTotalBlocks();this.showItemsCount();this.showWarningItemsCount();this.showNotAvailableItemsCount();this.showDelayedItemsCount()},fillTotalBlocks:function(){var t=this.getEntities(this.getCacheNode(this.ids.basketRoot),"basket-total-block");if(t&&t.length){var i=this.getTemplate("basket-total-template");if(i){var e=this.render(i,this.result.TOTAL_RENDER_DATA);for(var s in t){if(t.hasOwnProperty(s)&&BX.type.isDomNode(t[s])){t[s].innerHTML=e;this.bindTotalEvents(t[s])}}}}this.checkStickyHeaders()},showItemsCount:function(){var t=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="all"]');if(BX.type.isDomNode(t)){t.innerHTML=BX.message("SBB_IN_BASKET")+" "+this.result.BASKET_ITEMS_COUNT+" "+this.getGoodsMessage(this.result.BASKET_ITEMS_COUNT);t.style.display=""}},showSimilarCount:function(t){var i=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="similar"]');if(BX.type.isDomNode(i)){if(t){i.innerHTML=this.sortedItems.length+" "+this.getGoodsMessage(this.result.BASKET_ITEMS_COUNT,"SBB_SIMILAR_ITEM");i.style.display=""}else{i.style.display="none"}}},showWarningItemsCount:function(){var t=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="warning"]');if(BX.type.isDomNode(t)){if(this.warningItems.length){t.innerHTML=this.warningItems.length+" "+BX.message("SBB_BASKET_ITEMS_WARNING");t.style.display=""}else{t.style.display="none"}}},showNotAvailableItemsCount:function(){var t=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="not-available"]');if(BX.type.isDomNode(t)){if(parseInt(this.result.NOT_AVAILABLE_BASKET_ITEMS_COUNT)){t.innerHTML=this.result.NOT_AVAILABLE_BASKET_ITEMS_COUNT+" "+this.getGoodsMessage(this.result.NOT_AVAILABLE_BASKET_ITEMS_COUNT,"SBB_NOT_AVAILABLE_ITEM");t.style.display=""}else{t.style.display="none"}}},showDelayedItemsCount:function(){var t=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="delayed"]');if(BX.type.isDomNode(t)){if(parseInt(this.result.DELAYED_BASKET_ITEMS_COUNT)){t.innerHTML=this.result.DELAYED_BASKET_ITEMS_COUNT+" "+this.getGoodsMessage(this.result.DELAYED_BASKET_ITEMS_COUNT,"SBB_DELAYED_ITEM");t.style.display=""}else{t.style.display="none"}}},getGoodsMessage:function(t,i){var e;var s=t>10&&t<20?0:t%10;if(s===1){e=i||"SBB_GOOD"}else if(s>
19=2&&s<=4){e=i?i+"_2":"SBB_GOOD_2"}else{e=i?i+"S":"SBB_GOODS"}return BX.message(e)},bindTotalEvents:function(t){if(!this.result.TOTAL_RENDER_DATA.DISABLE_CHECKOUT){BX.bind(this.getEntity(t,"basket-checkout-button"),"click",BX.proxy(this.checkOutAction,this))}BX.bind(this.getEntity(t,"basket-coupon-input"),"change",BX.proxy(this.addCouponAction,this));BX.bind(this.getEntity(t,"basket-coupon-input"),"paste",BX.proxy(this.pasteCouponAction,this));var i=this.getEntities(t,"basket-coupon-delete");for(var e=0,s=i.length;e<s;e++){BX.bind(i[e],"click",BX.proxy(this.removeCouponAction,this))}},checkOutAction:function(){document.location.href=this.params.PATH_TO_ORDER},addCouponAction:function(t){var i=BX.getEventTarget(t);if(i&&i.value){this.actionPool.addCoupon(i.value);i.disabled=true}},pasteCouponAction:function(t){setTimeout(BX.delegate(function(){this.addCouponAction(t)},this),10)},removeCouponAction:function(){var t=BX.proxy_context&&BX.util.trim(BX.proxy_context.getAttribute("data-coupon"));if(t){this.actionPool.removeCoupon(t)}},initializeActionPool:function(){this.actionPool=new BX.Sale.BasketActionPool(this)},initializeFilter:function(){this.filter=new BX.Sale.BasketFilter(this)},sendRequest:function(t,i){this.lastAction=t;if(this.lastAction==="recalculateAjax"){i.lastAppliedDiscounts=BX.util.array_keys(this.result.FULL_DISCOUNT_LIST).join(",");if(this.params.USE_ENHANCED_ECOMMERCE==="Y"){this.checkAnalytics(i)}}BX.ajax({method:"POST",dataType:"json",url:this.ajaxUrl,data:this.getData(i),onsuccess:BX.delegate(function(t){this.actionPool.doProcessing(false);if(!BX.type.isPlainObject(t))return;this.actionPool.setRefreshStatus(t.BASKET_REFRESHED);if(t.RESTORED_BASKET_ITEMS){this.restoreBasketItems(t.RESTORED_BASKET_ITEMS)}if(t.DELETED_BASKET_ITEMS){this.deleteBasketItems(t.DELETED_BASKET_ITEMS,this.params.SHOW_RESTORE==="Y")}if(t.MERGED_BASKET_ITEMS){this.deleteBasketItems(t.MERGED_BASKET_ITEMS,false,true)}this.applyBasketResult(t.BASKET_DATA);this.editBasketItems(this.getItemsToEdit());this.editTotal();this.applyPriceAnimation();this.editWarnings();this.actionPool.switchTimer();if(this.isBasketIntegrated()&&this.isBasketChanged()){BX.Sale.OrderAjaxComponent.sendRequest()}},this),onfailure:BX.delegate(function(){this.actionPool.doProcessing(false)},this)})},isBasketIntegrated:function(){return this.params.BASKET_WITH_ORDER_INTEGRATION==="Y"},isBasketChanged:function(){return this.changedItems.length},addPriceAnimationData:function(t,i,e,s){if(!BX.type.isPlainObject(this.priceAnimationData)){this.clearPriceAnimationData()}this.priceAnimationData.start[t]=parseFloat(i);this.priceAnimationData.finish[t]=parseFloat(e);this.priceAnimationData.currency[t]=s;this.priceAnimationData.int[t]=parseFloat(i)===parseInt(i)&&parseFloat(e)===parseInt(e)},clearPriceAnimationData:function(){this.priceAnimationData={start:{},finish:{},currency:{},int:{}}},applyBasketResult:function(t){this.changedItems=[];this.clearPriceAnimationData();if(!BX.type.isPlainObject(t)){return}if(t.BASKET_ITEM_RENDER_DATA){var i,e;for(i in t.BASKET_ITEM_RENDER_DATA){if(t.BASKET_ITEM_RENDER_DATA.hasOwnProperty(i)){e=t.BASKET_ITEM_RENDER_DATA[i];e.WARNINGS=this.checkBasketItemWarnings(e,t.WARNING_MESSAGE_WITH_CODE);if(this.items[e.ID]){if(JSON.stringify(this.items[e.ID])===JSON.stringify(e)){continue}}else{this.addSortedItem(e.ID,true)}this.changedItems.push(e.ID);e=this.checkBasketItemsAnimation(e);this.items[e.ID]=e}}this.changedItems=BX.util.array_unique(this.changedItems.concat(this.getChangedSimilarOffers()));if(this.isBasketChanged()){this.sortSortedItems(true)}}if(t.TOTAL_RENDER_DATA){t.TOTAL_RENDER_DATA=this.checkTotalAnimation(t.TOTAL_RENDER_DATA)}this.result=t},itemSortFunction:function(t,i){if(!this.items.hasOwnProperty(t)||!this.items.hasOwnProperty(i)){return 0}return parseFloat(this.items[t].SORT)-parseFloat(this.items[i].SORT)},getChangedSimilarOffers:function(){var t=[];var i,e;var s=this.getHashMap();for(var a in s){if(s.hasOwnProperty(a)){if(s[a].length>1){for(var n=0;n<s[a].length;n++){i=0;e=0;for(var r=0;r<s[a].length;r++){if(s[a][r]!=s[a][n]){i+=parseFloat(this.items[s[a][r]].QUANTITY)}e+=parseFloat(this.items[s[a][r]].QUANTITY)}if(!this.items[s[a][n]].HAS_SIMILAR_ITEMS||this.items[s[a][n]].SIMILAR_ITEMS_QUANTITY!=i||this.items[s[a][n]].TOTAL_SIMILAR_ITEMS_QUANTITY!=e){t.push(s[a][n]);this.items[s[a][n]].HAS_SIMILAR_ITEMS=true;this.items[s[a][n]].SIMILAR_ITEMS_QUANTITY=i;this.items[s[a][n]].TOTAL_SIMILAR_ITEMS_QUANTITY=e;this.items[s[a][n]].ALL_AVAILABLE_QUANTITY=this.items[s[a][n]].AVAILABLE_QUANTITY;this.items[s[a][n]].AVAILABLE_QUANTITY=this.items[s[a][n]].ALL_AVAILABLE_QUANTITY-i}}}else if(s[a][0]&&this.items[s[a][0]].HAS_SIMILAR_ITEMS){t.push(s[a][0]);delete this.items[s[a][0]].HAS_SIMILAR_ITEMS;delete this.items[s[a][0]].SIMILAR_ITEMS_QUANTITY;delete this.items[s[a][0]].TOTAL_SIMILAR_ITEMS_QUANTITY;this.items[s[a][0]].AVAILABLE_QUANTITY=this.items[s[a][0]].ALL_AVAILABLE_QUANTITY;delete this.items[s[a][0]].ALL_AVAILABLE_QUANTITY}}}return t},getHashMap:function(){var t={};for(var i in this.items){if(this.items.hasOwnProperty(i)&&this.isItemAvailable(i)){if
19(!t.hasOwnProperty(this.items[i].HASH)){t[this.items[i].HASH]=[]}t[this.items[i].HASH].push(i)}}return t},isItemAvailable:function(t){var i=this.filter.isActive()?this.filter.realSortedItems:this.sortedItems;return!this.items[t].NOT_AVAILABLE&&!this.items[t].SHOW_RESTORE&&BX.util.in_array(t,i)},checkTotalAnimation:function(t){if(this.result&&this.result.TOTAL_RENDER_DATA&&parseFloat(this.result.TOTAL_RENDER_DATA.PRICE)>parseFloat(t.PRICE)){t.PRICE_NEW=t.PRICE;t.PRICE=this.result.TOTAL_RENDER_DATA.PRICE;t.PRICE_FORMATED_NEW=t.PRICE_FORMATED;t.PRICE_FORMATED=this.result.TOTAL_RENDER_DATA.PRICE_FORMATED;this.addPriceAnimationData(this.ids.total,t.PRICE,t.PRICE_NEW,t.CURRENCY)}return t},checkBasketItemsAnimation:function(t){var i=t.ID;if(this.items[i]){var e=BX(this.ids.quantity+i);if(BX.type.isDomNode(e)&&!this.actionPool.isItemInPool(i)&&parseFloat(e.value)!==parseFloat(t.QUANTITY)){t.QUANTITY_ANIMATION=true;this.actionPool.clearLastActualQuantityPool(i)}if(parseFloat(this.items[i].PRICE)>parseFloat(t.PRICE)){t.PRICE_NEW=t.PRICE;t.PRICE=this.items[i].PRICE;t.PRICE_FORMATED_NEW=t.PRICE_FORMATED;t.PRICE_FORMATED=this.items[i].PRICE_FORMATED;this.addPriceAnimationData(this.ids.price+i,t.PRICE,t.PRICE_NEW,t.CURRENCY)}if(BX.util.in_array("SUM",this.params.COLUMNS_LIST)&&parseFloat(this.items[i].SUM_PRICE)>parseFloat(t.SUM_PRICE)&&parseFloat(this.items[i].QUANTITY)===parseFloat(t.QUANTITY)){t.SUM_PRICE_NEW=t.SUM_PRICE;t.SUM_PRICE=this.items[i].SUM_PRICE;t.SUM_PRICE_FORMATED_NEW=t.SUM_PRICE_FORMATED;t.SUM_PRICE_FORMATED=this.items[i].SUM_PRICE_FORMATED;this.addPriceAnimationData(this.ids.sumPrice+i,t.SUM_PRICE,t.SUM_PRICE_NEW,t.CURRENCY)}}return t},getData:function(t){t=t||{};t[this.params.ACTION_VARIABLE]=this.lastAction;t.via_ajax="Y";t.site_id=this.siteId;t.site_template_id=this.siteTemplateId;t.sessid=BX.bitrix_sessid();t.template=this.template;t.signedParamsString=this.signedParamsString;return t},startLoader:function(){},endLoader:function(){},editWarnings:function(){this.editGeneralWarnings();this.editBasketItemWarnings();this.toggleWarningBlock();this.showWarningItemsCount()},editGeneralWarnings:function(){var t=this.getEntity(this.getCacheNode(this.ids.warning),"basket-general-warnings");if(BX.type.isDomNode(t)){var i=t.innerHTML;if(this.result.WARNING_MESSAGE_WITH_CODE){for(var e in this.result.WARNING_MESSAGE_WITH_CODE){if(this.result.WARNING_MESSAGE_WITH_CODE.hasOwnProperty(e)){if(!this.items[e]&&i.indexOf(this.result.WARNING_MESSAGE_WITH_CODE[e])===-1){i+=this.result.WARNING_MESSAGE_WITH_CODE[e]+"<br/>"}}}}if(i){t.innerHTML=i;t.style.display=""}else{t.style.display="none";t.innerHTML=""}}},editBasketItemWarnings:function(){var t=this.getEntity(this.getCacheNode(this.ids.warning),"basket-item-warnings");if(BX.type.isDomNode(t)){if(this.warningItems.length){var i=this.getEntity(t,"basket-items-warning-count");if(BX.type.isDomNode(i)){i.innerHTML=this.warningItems.length+" "+this.getGoodsMessage(this.warningItems.length)}t.style.display=""}else if(t.style.display!=="none"){t.style.display="none";if(this.filter.isActive()){this.toggleFilter("all")}}}},toggleWarningBlock:function(){var t=this.getCacheNode(this.ids.warning);if(BX.type.isDomNode(t)){var i=this.getEntity(t,"basket-general-warnings");var e=this.getEntity(t,"basket-item-warnings");if((!BX.type.isDomNode(i)||i.style.display==="none")&&(!BX.type.isDomNode(e)||e.style.display==="none")){t.style.display="none"}else{t.style.display=""}}},checkBasketItemWarnings:function(t,i){if(!t)return;var e;if(this.items[t.ID]&&this.lastAction==="refreshAjax"){e=this.items[t.ID].WARNINGS}else{e=[]}if(BX.type.isArray(i[t.ID])&&i[t.ID].length){for(var s in i[t.ID]){if(i[t.ID].hasOwnProperty(s)&&!BX.util.in_array(i[t.ID][s],e)){e.push(i[t.ID][s])}}}if(e.length){if(!BX.util.in_array(t.ID,this.warningItems)){this.warningItems.push(t.ID)}}else if(BX.util.in_array(t.ID,this.warningItems)){this.warningItems.splice(BX.util.array_search(t.ID,this.warningItems),1)}return e},removeAllWarnings:function(t){this.clearGeneralWarnings();this.clearBasketItemsWarnings();this.editWarnings();t&&t.preventDefault()},clearGeneralWarnings:function(){this.result.WARNING_MESSAGE_WITH_CODE={};var t=this.getEntity(this.getCacheNode(this.ids.warning),"basket-general-warnings");if(BX.type.isDomNode(t)){t.innerHTML=""}},clearBasketItemsWarnings:function(){var t=[];for(var i in this.warningItems){if(this.warningItems.hasOwnProperty(i)){this.items[this.warningItems[i]].WARNINGS=[];if(this.isItemShown(this.warningItems[i])){t.push(this.warningItems[i])}}}this.warningItems=[];this.editBasketItems(t)},isItemShown:function(t){return BX.util.in_array(t,this.shownItems)},initializeBasketItems:function(){if(Object.keys(this.items).length===0)return;for(var t=0;t<this.sortedItems.length;t++){if(this.useDynamicScroll&&this.shownItems.length>=this.maxItemsShowCount){break}this.createBasketItem(this.sortedItems[t])}},createBasketItem:function(t){if(!this.items[t]){return}var i=this.getTemplate("basket-item-template");if(i){var e=this.renderBasketItem(i,this.items[t]);var s=BX.util.array_search(t,this.sortedItems);if(this.shownItems.length&&s>=0){if(s<BX.util.array_search(this.shownItems[0],this.sortedItems)){BX(this.ids.item+this.shownItems[0]).insertAdjacentHTML("beforebegin",e);this.shownItems.unshift(t)}else if(s>BX.util.array_search(this.shownItems[this.shownItems.length-1],this.sortedItems)){BX(this.ids.item+this.shownItems[this.shownItems.length-1]).insertAdjacentHTML("afterend",e);this.shownItems.push(t)}else{BX(this.ids.item+this.sortedItems[s+1]).insertAdjacentHTML("beforebegin",e);this.shownItems.splice(s+1,0,t)}}else{this.getCacheNode(this.ids.itemListTable).insertAdjacentHTML("beforeend",e);this.shownItems.push(t)}this.bindBasketItemEvents(this.items[t]);if(this.filter.isActive()){this.filter.highlightSearchMatch(this.items[t])}}},getItemsToEdit:function(){var t=[];if(this.isBasketChanged()){for(var i in this.changedItems){if(this.changedItems.hasOwnProperty(i)&&this.isItemShown(this.changedItems[i])){t.push(this.changedItems[i])}}}return t},getItemsAfter:function(){var t=[];if(this.useDynamicScroll){var i=this.shownItems[this.shownItems.length-1]||false;if(i){var e=0;var s=BX.util.array_search(i,this.sortedItems);while(this.sortedItems[++s]&&e++<this.maxItemsShowCount){t.push(this.sortedItems[s])}}}return t},editBasketItems:function(t){if(!t||t.length===0){return}var i,e;for(i in t){if(!t.hasOwnProperty(i)||!BX.type.isPlainObject(this.items[t[i]])){continue}e=this.items[t[i]];if(this.actionPool.isItemInPool(e.ID)){if(!BX.util.in_array(e.ID,this.postponedItems)){this.postponedItems.push(e.ID)}continue}
19if(BX.type.isDomNode(BX(this.ids.item+e.ID))){this.redrawBasketItemNode(e.ID);this.applyQuantityAnimation(e.ID)}else{this.createBasketItem(e.ID)}}},editPostponedBasketItems:function(){if(!this.postponedItems.length)return;var t=[];for(var i in this.postponedItems){if(this.postponedItems.hasOwnProperty(i)&&this.isItemShown(this.postponedItems[i])){t.push(this.postponedItems[i])}}this.postponedItems=[];this.editBasketItems(t)},applyQuantityAnimation:function(t){var i=BX(this.ids.item+t);if(BX.type.isDomNode(i)&&this.items[t]){if(this.items[t].QUANTITY_ANIMATION){BX.addClass(BX(this.ids.quantity+t),"basket-updated")}}},applyPriceAnimation:function(){if(!this.priceAnimationData||Object.keys(this.priceAnimationData.start).length===0)return;var t=this.priceAnimationData,i={};new BX.easing({duration:this.params.USE_PRICE_ANIMATION==="Y"?this.duration.priceAnimation:1,start:t.start,finish:t.finish,transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:BX.delegate(function(e){for(var s in t.start){if(t.start.hasOwnProperty(s)){if(!i[s]){if(s===this.ids.total){i[s]=this.getEntities(this.getCacheNode(this.ids.basketRoot),this.ids.total)}else{var a=BX(s);i[s]=a?[a]:[]}}if(!t.int[s]){e[s]=(e[s]+e[s]%1e3/1e3).toFixed(5)}for(var n=0;n<i[s].length;n++){i[s][n].innerHTML=this.getFormatPrice(e[s],t.currency[s])}}}},this),complete:BX.delegate(function(){var e,s,a,n;for(e in t.start){if(t.start.hasOwnProperty(e)){s=this.getFormatPrice(t.finish[e],t.currency[e]);for(var r=0;r<i[e].length;r++){i[e][r].innerHTML=s}if(e.indexOf(this.ids.sumPrice)!==-1){n="SUM_PRICE";a=e.substr(this.ids.sumPrice.length)}else if(e.indexOf(this.ids.price)!==-1){n="PRICE";a=e.substr(this.ids.price.length)}else if(e.indexOf(this.ids.total)!==-1){n="TOTAL";a=""}else{a="";n=""}if(BX.type.isNotEmptyString(n)){if(a){this.items[a][n]=t.finish[e];delete this.items[a][n+"_NEW"];this.items[a][n+"_FORMATED"]=s;delete this.items[a][n+"_FORMATED_NEW"]}else if(n==="TOTAL"){this.result.TOTAL_RENDER_DATA.PRICE=t.finish[e];delete this.result.TOTAL_RENDER_DATA.PRICE_NEW;this.result.TOTAL_RENDER_DATA.PRICE_FORMATED=s;delete this.result.TOTAL_RENDER_DATA.PRICE_FORMATED_NEW}}}}this.filter.highlightFoundItems()},this)}).animate()},getFormatPrice:function(t,i){return BX.Currency.currencyFormat(t,i,true)},deleteBasketItems:function(t,i,e){if(!t||!t.length){return}for(var s in t){if(t.hasOwnProperty(s)){this.deleteBasketItem(t[s],i,e)}}},deleteBasketItem:function(t,i,e){if(this.items[t].NOT_AVAILABLE&&i){i=false;e=true}if(i){this.items[t].SHOW_RESTORE=true;this.items[t].SHOW_LOADING=false;this.redrawBasketItemNode(t)}else{this.changeShownItem(t);BX.remove(BX(this.ids.item+t))}if(e){this.changeSortedItem(t,false,true);this.changeShownItem(t,false,true)}},addSortedItem:function(t,i){this.sortedItems.push(t.toString());if(i&&this.filter.isActive()){this.filter.realSortedItems.push(t.toString())}},changeSortedItem:function(t,i,e){var s=BX.util.array_search(t,this.sortedItems);if(s>=0){if(i){this.sortedItems.splice(s,1,i.toString())}else{this.sortedItems.splice(s,1)}}if(e&&this.filter.isActive()){s=BX.util.array_search(t,this.filter.realSortedItems);if(s>=0){if(i){this.filter.realSortedItems.splice(s,1,i.toString())}else{this.filter.realSortedItems.splice(s,1)}}}},sortSortedItems:function(t){this.sortedItems.sort(BX.proxy(this.itemSortFunction,this));if(t&&this.filter.isActive()){this.filter.realSortedItems.sort(BX.proxy(this.itemSortFunction,this))}},changeShownItem:function(t,i,e){var s=BX.util.array_search(t,this.shownItems);if(s>=0){if(i){this.shownItems.splice(s,1,i.toString())}else{this.shownItems.splice(s,1)}}if(e&&this.filter.isActive()){s=BX.util.array_search(t,this.filter.realShownItems);if(s>=0){if(i){this.filter.realShownItems.splice(s,1,i.toString())}else{this.filter.realShownItems.splice(s,1)}}}},redrawBasketItemNode:function(t){var i=BX(this.ids.item+t);if(!this.items[t]||!BX.type.isDomNode(i))return;var e=this.getTemplate("basket-item-template");if(e){var s=BX(this.ids.itemHeightAligner+t),a;if(BX.type.isDomNode(s)){a=s.clientHeight}var n=this.renderBasketItem(e,this.items[t]);i.insertAdjacentHTML("beforebegin",n);BX.remove(i);if(a){s=BX(this.ids.itemHeightAligner+t);if(BX.type.isDomNode(s)&&s.clientHeight<a){s.style.minHeight=a+"px";setTimeout(function(){s.style.minHeight="0px"},1)}}this.bindBasketItemEvents(this.items[t]);if(this.filter.isActive()){this.filter.highlightSearchMatch(this.items[t])}}},restoreBasketItems:function(t){if(!t||Object.keys(t).length===0){return}var i,e,s;for(i in t){if(t.hasOwnProperty(i)){e=t[i];if(this.isItemShown(i)){this.changeShownItem(i,e,true);s=BX(this.ids.item+i);if(BX.type.isDomNode(s)){s.id=this.ids.item+e;s.setAttribute("data-id",e)}}this.changeSortedItem(i,false,true)}}},bindBasketItemEvents:function(t){if(!t)return;var i=BX(this.ids.item+t.ID);if(BX.type.isDomNode(i)){this.bindQuantityEvents(i,t);this.bindSkuEvents(i,t);this.bindImageEvents(i,t);this.bindActionEvents(i,t);this.bindRestoreAction(i,t);this.bindItemWarningEvents(i,t)}},bindQuantityEvents:function(t,i){if(!t||!i||!this.isItemAvailable(i.ID))return;var e;var s=this.getEntity(t,"basket-item-quantity-block");if(s){var a=this.isTouch?"touchstart":"mousedown";
19var n=this.isTouch?"touchend":"mouseup";e=this.getEntity(s,"basket-item-quantity-minus");BX.bind(e,a,BX.proxy(this.startQuantityInterval,this));BX.bind(e,n,BX.proxy(this.clearQuantityInterval,this));BX.bind(e,"mouseout",BX.proxy(this.clearQuantityInterval,this));BX.bind(e,"click",BX.proxy(this.quantityMinus,this));e=this.getEntity(s,"basket-item-quantity-plus");BX.bind(e,a,BX.proxy(this.startQuantityInterval,this));BX.bind(e,n,BX.proxy(this.clearQuantityInterval,this));BX.bind(e,"mouseout",BX.proxy(this.clearQuantityInterval,this));BX.bind(e,"click",BX.proxy(this.quantityPlus,this));e=this.getEntity(s,"basket-item-quantity-field");BX.bind(e,"change",BX.proxy(this.quantityChange,this))}},startQuantityInterval:function(){var t=BX.proxy_context;var i=t.getAttribute("data-entity")==="basket-item-quantity-minus"?BX.proxy(this.quantityMinus,this):BX.proxy(this.quantityPlus,this);this.quantityDelay=setTimeout(BX.delegate(function(){this.quantityTimer=setInterval(function(){i(t)},150)},this),300)},clearQuantityInterval:function(){clearTimeout(this.quantityDelay);clearInterval(this.quantityTimer)},quantityPlus:function(t){if(!BX.type.isDomNode(t)){t=BX.proxy_context;this.clearQuantityInterval()}var i=this.getItemDataByTarget(t);if(i){var e=BX(this.ids.quantity+i.ID);var s=this.isQuantityFloat(i);var a=s?parseFloat(e.value):Math.round(e.value);var n=s?parseFloat(i.MEASURE_RATIO):parseInt(i.MEASURE_RATIO);var r=parseFloat((a+n).toFixed(5));r=this.getCorrectQuantity(i,r);this.setQuantity(i,r)}},quantityMinus:function(t){t=BX.type.isDomNode(t)?t:BX.proxy_context;var i=this.getItemDataByTarget(t);if(i){var e=BX(this.ids.quantity+i.ID);var s=this.isQuantityFloat(i);var a=s?parseFloat(e.value):Math.round(e.value);var n=s?parseFloat(i.MEASURE_RATIO):parseInt(i.MEASURE_RATIO);var r=parseFloat((a-n).toFixed(5));r=this.getCorrectQuantity(i,r);this.setQuantity(i,r)}},quantityChange:function(){var t=this.getItemDataByTarget(BX.proxy_context);if(t){var i,e;i=BX(this.ids.quantity+t.ID);e=this.getCorrectQuantity(t,i.value);this.setQuantity(t,e)}},isQuantityFloat:function(t){return this.params.QUANTITY_FLOAT==="Y"||parseInt(t.MEASURE_RATIO)!==parseFloat(t.MEASURE_RATIO)},getCorrectQuantity:function(t,i){var e=this.isQuantityFloat(t),s=e?parseFloat(t.MEASURE_RATIO):parseInt(t.MEASURE_RATIO),a=0;i=(e?parseFloat(i):parseInt(i,10))||0;if(i<0){i=0}if(s>0&&i<s){i=s}if(t.CHECK_MAX_QUANTITY==="Y"){a=e?parseFloat(t.AVAILABLE_QUANTITY):parseInt(t.AVAILABLE_QUANTITY);if(a>0&&i>a){i=a}}var n=(i/s-(i/s).toFixed(0)).toFixed(5),r;if(parseFloat(n)===0){return i}if(s!==0&&s!==1){r=i*this.precisionFactor%(s*this.precisionFactor)/this.precisionFactor;if(s>0&&r>0){if(r>=s/2&&(a===0||i+s-r<=a)){i+=s-r}else{i-=r}}}i=e?parseFloat(i):parseInt(i,10);return i},setQuantity:function(t,i){var e=BX(this.ids.quantity+t.ID),s;if(e){i=parseFloat(i);s=parseFloat(e.getAttribute("data-value"));e.value=i;if(parseFloat(t.QUANTITY)!==parseFloat(i)){this.animatePriceByQuantity(t,i);this.actionPool.changeQuantity(t.ID,i,s)}}},animatePriceByQuantity:function(t,i){var e=BX(this.ids.sumPrice+t.ID);if(!BX.type.isDomNode(e))return;var s=i/parseFloat(t.MEASURE_RATIO);var a=parseFloat(t.SUM_PRICE),n=parseFloat(t.PRICE)*s,r=parseInt(a)===parseFloat(a)&&parseInt(n)===parseFloat(n);if(a!==n){this.items[t.ID].QUANTITY=i;this.items[t.ID].SUM_PRICE=n;new BX.easing({duration:this.params.USE_PRICE_ANIMATION==="Y"?this.duration.priceAnimation:1,start:{price:a},finish:{price:n},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:BX.delegate(function(i){if(!r){i.price=(i.price+i.price%1e3/1e3).toFixed(5)}e.innerHTML=this.getFormatPrice(i.price,t.CURRENCY)},this),complete:BX.delegate(function(){var i,a;e.innerHTML=this.getFormatPrice(n,t.CURRENCY);i=BX(this.ids.sumPriceOld+t.ID);if(BX.type.isDomNode(i)){a=parseFloat(t.FULL_PRICE)*s;i.innerHTML=this.getFormatPrice(a,t.CURRENCY)}i=BX(this.ids.sumPriceDiff+t.ID);if(BX.type.isDomNode(i)){a=parseFloat(t.DISCOUNT_PRICE)*s;i.innerHTML=this.getFormatPrice(a,t.CURRENCY)}},this)}).animate()}},getItemDataByTarget:function(t){var i=false;var e;var s=BX.findParent(t,{attrs:{"data-entity":"basket-item"}});if(s){e=s.getAttribute("data-id");i=this.items[e]}return i},bindSkuEvents:function(t,i){if(!t||!i)return;var e=this.getEntities(t,"basket-item-sku-block");var s,a,n,r,o;for(a=0,n=e.length;a<n;a++){s=this.getEntities(e[a],"basket-item-sku-field");for(r=0,o=s.length;r<o;r++){BX.bind(s[r],"click",BX.proxy(this.changeSku,this))}}},changeSku:function(){var t,i;var e=BX.proxy_context;if(BX.hasClass(e,"selected"))return;var s=this.getItemDataByTarget(e);if(s){var a=BX(this.ids.item+s.ID);if(a){var n=this.getEntities(e.parentNode,"basket-item-sku-field");for(t=0,i=n.length;t<i;t++){if(n[t].isEqualNode(e)){BX.addClass(n[t],"selected")}else{BX.removeClass(n[t],"selected")}}
19this.actionPool.changeSku(s.ID,this.getSkuPropertyValues(a),this.getInitialSkuPropertyValues(a))}}},getSkuPropertyValues:function(t){var i={};var e=this.getEntities(t,"basket-item-sku-field",".selected");for(var s=0,a=e.length;s<a;s++){i[e[s].getAttribute("data-property")]=BX.util.htmlspecialcharsback(e[s].getAttribute("data-value-id"))}return i},getInitialSkuPropertyValues:function(t){var i={};var e=this.getEntities(t,"basket-item-sku-field",'[data-initial="true"]');for(var s=0,a=e.length;s<a;s++){i[e[s].getAttribute("data-property")]=BX.util.htmlspecialcharsback(e[s].getAttribute("data-value-id"))}return i},bindImageEvents:function(t,i){if(!t||!i)return;var e=t.querySelectorAll(".basket-item-custom-block-photo-item");for(var s=0,a=e.length;s<a;s++){BX.bind(e[s],"click",BX.proxy(this.showPropertyImagePopup,this))}},showPropertyImagePopup:function(){var t,i,e,s,a,n;t=BX.proxy_context;s=this.getItemDataByTarget(t);i=t.getAttribute("data-column-property-code");e=t.getAttribute("data-image-index");if(s&&s.COLUMN_LIST){for(n in s.COLUMN_LIST){if(s.COLUMN_LIST.hasOwnProperty(n)&&s.COLUMN_LIST[n].CODE===i&&s.COLUMN_LIST[n].VALUE[e]){a=s.COLUMN_LIST[n].VALUE[e].IMAGE_SRC_ORIGINAL;break}}}if(!a){return}if(this.imagePopup){this.imagePopup.destroy()}var r="bx-soa-image-popup-content";var o=this;this.imagePopup=new BX.PopupWindow("bx-soa-image-popup",null,{lightShadow:true,offsetTop:0,offsetLeft:0,closeIcon:{top:"3px",right:"10px"},autoHide:true,bindOptions:{position:"bottom"},closeByEsc:true,zIndex:100,events:{onPopupShow:function(){BX.create("IMG",{props:{src:a},events:{load:function(){var t=BX(r);if(t){var i=BX.GetWindowInnerSize(),e=o.isMobile?.5:.9,s,a;BX.cleanNode(t);t.appendChild(this);s=t.offsetHeight;a=t.offsetWidth;if(s>i.innerHeight*e){t.style.height=i.innerHeight*e+"px";t.style.width=a*(i.innerHeight*e/s)+"px";s=t.offsetHeight;a=t.offsetWidth}if(a>i.innerWidth*e){t.style.width=i.innerWidth*e+"px";t.style.height=s*(i.innerWidth*e/a)+"px"}t.style.height=t.offsetHeight+"px";t.style.width=t.offsetWidth+"px";o.imagePopup.adjustPosition()}}}})},onPopupClose:function(){this.destroy()}},content:BX.create("DIV",{props:{id:r}})});this.imagePopup.show()},bindActionEvents:function(t,i){if(!t||!i)return;var e;if(BX.util.in_array("DELETE",this.params.COLUMNS_LIST)){e=this.getEntities(t,"basket-item-delete");for(var s=0,a=e.length;s<a;s++){BX.bind(e[s],"click",BX.proxy(this.deleteAction,this))}}if(BX.util.in_array("DELAY",this.params.COLUMNS_LIST)){e=this.getEntity(t,"basket-item-add-delayed");BX.bind(e,"click",BX.proxy(this.addDelayedAction,this))}e=this.getEntity(t,"basket-item-remove-delayed");BX.bind(e,"click",BX.proxy(this.removeDelayedAction,this));e=this.getEntity(t,"basket-item-merge-sku-link");BX.bind(e,"click",BX.proxy(this.mergeAction,this));e=this.getEntity(t,"basket-item-show-similar-link");BX.bind(e,"click",BX.delegate(function(){this.toggleFilter("similar")},this))},deleteAction:function(){var t=this.getItemDataByTarget(BX.proxy_context);if(t){this.actionPool.deleteItem(t.ID);this.items[t.ID].SHOW_LOADING=true;if(this.params.SHOW_RESTORE==="Y"&&this.isItemAvailable(t.ID)){this.items[t.ID].SHOW_RESTORE=true}this.redrawBasketItemNode(t.ID)}},addDelayedAction:function(){var t=this.getItemDataByTarget(BX.proxy_context);if(t){this.actionPool.addDelayed(t.ID);this.items[t.ID].SHOW_LOADING=true;this.redrawBasketItemNode(t.ID)}},removeDelayedAction:function(){var t=this.getItemDataByTarget(BX.proxy_context);if(t){this.actionPool.removeDelayed(t.ID);this.items[t.ID].SHOW_LOADING=true;this.redrawBasketItemNode(t.ID)}},mergeAction:function(){var t=this.getItemDataByTarget(BX.proxy_context);if(t){this.actionPool.mergeSku(t.ID)}},bindRestoreAction:function(t,i){if(!t||!i||this.params.SHOW_RESTORE!=="Y")return;BX.bind(this.getEntity(t,"basket-item-restore-button"),"click",BX.delegate(function(){this.actionPool.restoreItem(i.ID,{PRODUCT_ID:i.PRODUCT_ID,QUANTITY:i.QUANTITY,PROPS:i.PROPS_ALL,SORT:i.SORT,MODULE:i.MODULE,PRODUCT_PROVIDER_CLASS:i.PRODUCT_PROVIDER_CLASS});this.items[i.ID].SHOW_RESTORE=false;this.items[i.ID].SHOW_LOADING=true;this.redrawBasketItemNode(i.ID)},this));BX.bind(this.getEntity(t,"basket-item-close-restore-button"),"click",BX.delegate(function(){this.deleteBasketItem(i.ID,false,true)},this))},bindItemWarningEvents:function(t,i){if(!t||!i)return;BX.bind(this.getEntity(BX(this.ids.item+i.ID),"basket-item-warning-close"),"click",BX.proxy(this.closeItemWarnings,this))},closeItemWarnings:function(){var t=BX.proxy_context;if(BX.type.isDomNode(t)){var i=this.getItemDataByTarget(t);this.items[i.ID].WARNINGS=[];this.warningItems.splice(BX.util.array_search(i.ID,this.warningItems),1);this.redrawBasketItemNode(i.ID);this.editWarnings()}},renderBasketItem:function(t,i){var e=BX.clone(i);if(BX.type.isPlainObject(e)){e.USE_FILTER=this.useItemsFilter&&!this.filter.currentFilter.similarHash.length}return Mustache.render(t,e)},render:function(t,i){return Mustache.render(t,i)},checkAnalytics:function(t){if(!t||!t.basket)return;var i,e={};for(var s in t.basket){if(t.basket.hasOwnProperty(s)){if(s.indexOf("QUANTITY_")>=0){i=s.substr(9);if(this.items[i]){e[i]=parseFloat(t.basket[s])-parseFloat(BX(this.ids.quantity+i).getAttribute("data-value"))}}else if(s.indexOf("DELETE_")>=0){i=s.substr(7);if(this.items[i]){e[i]=-parseFloat(this.items[i].QUANTITY)}}else if(s.indexOf("RESTORE_")>=0){i=s.substr(8);if(this.items[i]){e[i]=parseFloat(this.items[i].QUANTITY)}}}}this.setAnalyticsDataLayer(e)},setAnalyticsDataLayer:function(t){if(!t||Object.keys(t).length===0)return;window[this.params.DATA_LAYER_NAME]=window[this.params.DATA_LAYER_NAME]||[];var i=[],e=[];for(var s in t){if(t.hasOwnProperty(s)){if(t[s]>0){i.push(this.getItemAnalyticsInfo(s,t[s]))}else if(t[s]<0){e.push(this.getItemAnalyticsInfo(s,t[s]))}}}if(i.length){window[this.params.DATA_LAYER_NAME].push({event:"addToCart",ecommerce:{currencyCode:this.items[s].CURRENCY||"",add:{products:i}}})}if(e.length){window[this.params.DATA_LAYER_NAME].push({event:"removeFromCart",ecommerce:{currencyCode:this.items[s].CURRENCY||"",remove:{products:e}}})}},getItemAnalyticsInfo:function(t,i){if(!this.items[t])return{};var e=(this.items[t].BRAND||"").split(", ").join("/");var s=[];var a=this.getEntities(BX(this.ids.item+t),"basket-item-sku-field",".selected");for(var n=0,r=a.length;n<r;n++){s.push(a[n].getAttribute("data-sku-name"))}return{name:this.items[t].NAME||"",id:this.items[t].PRODUCT_ID||"",price:this.items[t].PRICE||0,brand:e,variant:s.join("/"),quantity:Math.abs(i)}}}})(); 20/* End */ 21; 22; /* Start:"a:4:{s:4:"full";
22s:110:"/bitrix/templates/aspro_next/components/bitrix/catalog.bigdata.products/next_new/script.min.js?169687294124456";s:6:"source";s:90:"/bitrix/templates/aspro_next/components/bitrix/catalog.bigdata.products/next_new/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 23function getCookie(t){var e=document.cookie.match(new RegExp("(?:^|; )"+t.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function bx_rcm_recommendation_event_attaching(t){return null}function bx_rcm_adaptive_recommendation_event_attaching(t,e){var s=function(e){var s,i=BX(this);for(s in t)if(t[s].productUrl==i.getAttribute("href")){window.JCCatalogBigdataProducts.prototype.RememberProductRecommendation(t[s].recommendationId,t[s].productId);break}},i=BX(e);i||(i=document.body);var o=BX.findChildren(i,{tag:"a"},!0);if(o){var a;for(a in o)BX.bind(o[a],"click",s)}}function bx_rcm_get_from_cloud(t,e,s){var i="https://analytics.bitrix.info/crecoms/v1_0/recoms.php",o=BX.ajax.prepareData(e);o&&(i+=(-1!==i.indexOf("?")?"&":"?")+o);var a=function(e){e.items||(e.items=[]),BX.ajax({url:"/bitrix/components/bitrix/catalog.bigdata.products/ajax.php?"+BX.ajax.prepareData({AJAX_ITEMS:e.items,RID:e.id}),method:"POST",data:s,dataType:"html",processData:!1,start:!0,onsuccess:function(e){var s=BX.processHTML(e);BX(t).innerHTML=s.HTML,BX.ajax.processScripts(s.SCRIPT),InitFlexSlider()}})};BX.ajax({method:"GET",dataType:"json",url:i,timeout:3,onsuccess:a,onfailure:a})}!function(t){if(!t.JCCatalogBigdataProducts){var e=function(t){e.superclass.constructor.apply(this,arguments),this.nameNode=BX.create("span",{props:{className:"bx_medium bx_bt_button",id:this.id},text:t.text}),this.buttonNode=BX.create("span",{attrs:{className:t.ownerClass},style:{marginBottom:"0",borderBottom:"0 none transparent"},children:[this.nameNode],events:this.contextEvents}),BX.browser.IsIE()&&this.buttonNode.setAttribute("hideFocus","hidefocus")};BX.extend(e,BX.PopupWindowButton),t.JCCatalogBigdataProducts=function(t){if(this.productType=0,this.showQuantity=!0,this.showAbsent=!0,this.secondPict=!1,this.showOldPrice=!1,this.showPercent=!1,this.showSkuProps=!1,this.visual={ID:"",PICT_ID:"",SECOND_PICT_ID:"",QUANTITY_ID:"",QUANTITY_UP_ID:"",QUANTITY_DOWN_ID:"",PRICE_ID:"",DSC_PERC:"",SECOND_DSC_PERC:"",DISPLAY_PROP_DIV:"",BASKET_PROP_DIV:""},this.product={checkQuantity:!1,maxQuantity:0,stepQuantity:1,isDblQuantity:!1,canBuy:!0,canSubscription:!0,name:"",pict:{},id:0,addUrl:"",buyUrl:""},this.basketData={useProps:!1,emptyProps:!1,quantity:"quantity",props:"prop",basketUrl:""},this.defaultPict={pict:null,secondPict:null},this.checkQuantity=!1,this.maxQuantity=0,this.stepQuantity=1,this.isDblQuantity=!1,this.canBuy=!0,this.canSubscription=!0,this.precision=6,this.precisionFactor=Math.pow(10,this.precision),this.offers=[],this.offerNum=0,this.treeProps=[],this.obTreeRows=[],this.showCount=[],this.showStart=[],this.selectedValues={},this.obProduct=null,this.obQuantity=null,this.obQuantityUp=null,this.obQuantityDown=null,this.obPict=null,this.obSecondPict=null,this.obPrice=null,this.obTree=null,this.obBuyBtn=null,this.obDscPerc=null,this.obSecondDscPerc=null,this.obSkuProps=null,this.obMeasure=null,this.obPopupWin=null,this.basketUrl="",this.basketParams={},this.treeRowShowSize=5,this.treeEnableArrow={display:"",cursor:"pointer",opacity:1},this.treeDisableArrow={display:"",cursor:"default",opacity:.2},this.lastElement=!1,this.containerHeight=0,this.errorCode=0,"object"==typeof t){switch(this.productType=parseInt(t.PRODUCT_TYPE,10),this.showQuantity=t.SHOW_QUANTITY,this.showAbsent=t.SHOW_ABSENT,this.secondPict=!!t.SECOND_PICT,this.showOldPrice=!!t.SHOW_OLD_PRICE,this.showPercent=!!t.SHOW_DISCOUNT_PERCENT,this.showSkuProps=!!t.SHOW_SKU_PROPS,this.visual=t.VISUAL,this.productType){case 1:case 2:t.PRODUCT&&"object"==typeof t.PRODUCT?(this.showQuantity&&(this.product.checkQuantity=t.PRODUCT.CHECK_QUANTITY,this.product.isDblQuantity=t.PRODUCT.QUANTITY_FLOAT,this.product.checkQuantity&&(this.product.maxQuantity=this.product.isDblQuantity?parseFloat(t.PRODUCT.MAX_QUANTITY):parseInt(t.PRODUCT.MAX_QUANTITY,10)),this.product.stepQuantity=this.product.isDblQuantity?parseFloat(t.PRODUCT.STEP_QUANTITY):parseInt(t.PRODUCT.STEP_QUANTITY,10),this.checkQuantity=this.product.checkQuantity,this.isDblQuantity=this.product.isDblQuantity,this.maxQuantity=this.product.maxQuantity,this.stepQuantity=this.product.stepQuantity,this.isDblQuantity&&(this.stepQuantity=Math.round(this.stepQuantity*this.precisionFactor)/this.precisionFactor)),this.product.canBuy=t.PRODUCT.CAN_BUY,this.product.canSubscription=t.PRODUCT.SUBSCRIPTION,this.canBuy=this.product.canBuy,this.canSubscription=this.product.canSubscription,this.product.name=t.PRODUCT.NAME,this.product.pict=t.PRODUCT.PICT,this.product.id=t.PRODUCT.ID,t.PRODUCT.ADD_URL&&(this.product.addUrl=t.PRODUCT.ADD_URL),t.PRODUCT.BUY_URL&&(this.product.buyUrl=t.PRODUCT.BUY_URL),t.BASKET&&"object"==typeof t.BASKET&&(this.basketData.useProps=!!t.BASKET.ADD_PROPS,this.basketData.emptyProps=!!t.BASKET.EMPTY_PROPS)):this.errorCode=-1;break;
23case 3:t.OFFERS&&BX.type.isArray(t.OFFERS)?(t.PRODUCT&&"object"==typeof t.PRODUCT&&(this.product.name=t.PRODUCT.NAME,this.product.id=t.PRODUCT.ID),this.offers=t.OFFERS,this.offerNum=0,t.OFFER_SELECTED&&(this.offerNum=parseInt(t.OFFER_SELECTED,10)),isNaN(this.offerNum)&&(this.offerNum=0),t.TREE_PROPS&&(this.treeProps=t.TREE_PROPS),t.DEFAULT_PICTURE&&(this.defaultPict.pict=t.DEFAULT_PICTURE.PICTURE,this.defaultPict.secondPict=t.DEFAULT_PICTURE.PICTURE_SECOND)):this.errorCode=-1;break;default:this.errorCode=-1}t.BASKET&&"object"==typeof t.BASKET&&(t.BASKET.QUANTITY&&(this.basketData.quantity=t.BASKET.QUANTITY),t.BASKET.PROPS&&(this.basketData.props=t.BASKET.PROPS),t.BASKET.BASKET_URL&&(this.basketData.basketUrl=t.BASKET.BASKET_URL)),this.lastElement=!!t.LAST_ELEMENT&&"Y"===t.LAST_ELEMENT}0===this.errorCode&&BX.ready(BX.delegate(this.Init,this))},t.JCCatalogBigdataProducts.prototype.Init=function(){var e=0,s="",i=null;if(this.obProduct=BX(this.visual.ID),this.obProduct||(this.errorCode=-1),this.obPict=BX(this.visual.PICT_ID),this.obPict||(this.errorCode=-2),this.secondPict&&this.visual.SECOND_PICT_ID&&(this.obSecondPict=BX(this.visual.SECOND_PICT_ID)),this.obPrice=BX(this.visual.PRICE_ID),this.obPrice||(this.errorCode=-16),this.showQuantity&&this.visual.QUANTITY_ID&&(this.obQuantity=BX(this.visual.QUANTITY_ID),this.visual.QUANTITY_UP_ID&&(this.obQuantityUp=BX(this.visual.QUANTITY_UP_ID)),this.visual.QUANTITY_DOWN_ID&&(this.obQuantityDown=BX(this.visual.QUANTITY_DOWN_ID))),3===this.productType){if(this.visual.TREE_ID)for(this.obTree=BX(this.visual.TREE_ID),this.obTree||(this.errorCode=-256),s=this.visual.TREE_ITEM_ID,e=0;e<this.treeProps.length;e++)if(this.obTreeRows[e]={LEFT:BX(s+this.treeProps[e].ID+"_left"),RIGHT:BX(s+this.treeProps[e].ID+"_right"),LIST:BX(s+this.treeProps[e].ID+"_list"),CONT:BX(s+this.treeProps[e].ID+"_cont")},!(this.obTreeRows[e].LEFT&&this.obTreeRows[e].RIGHT&&this.obTreeRows[e].LIST&&this.obTreeRows[e].CONT)){this.errorCode=-512;break}this.visual.QUANTITY_MEASURE&&(this.obMeasure=BX(this.visual.QUANTITY_MEASURE))}if(this.visual.BUY_ID&&(this.obBuyBtn=BX(this.visual.BUY_ID)),this.showPercent&&(this.visual.DSC_PERC&&(this.obDscPerc=BX(this.visual.DSC_PERC)),this.secondPict&&this.visual.SECOND_DSC_PERC&&(this.obSecondDscPerc=BX(this.visual.SECOND_DSC_PERC))),this.showSkuProps&&this.visual.DISPLAY_PROP_DIV&&(this.obSkuProps=BX(this.visual.DISPLAY_PROP_DIV)),0===this.errorCode){switch(this.showQuantity&&(this.obQuantityUp&&BX.bind(this.obQuantityUp,"click",BX.delegate(this.QuantityUp,this)),this.obQuantityDown&&BX.bind(this.obQuantityDown,"click",BX.delegate(this.QuantityDown,this)),this.obQuantity&&BX.bind(this.obQuantity,"change",BX.delegate(this.QuantityChange,this))),this.productType){case 1:break;case 3:if(i=BX.findChildren(this.obTree,{tagName:"li"},!0),i&&0<i.length)for(e=0;e<i.length;e++)BX.bind(i[e],"click",BX.delegate(this.SelectOfferProp,this));for(e=0;e<this.obTreeRows.length;e++)BX.bind(this.obTreeRows[e].LEFT,"click",BX.delegate(this.RowLeft,this)),BX.bind(this.obTreeRows[e].RIGHT,"click",BX.delegate(this.RowRight,this));this.SetCurrent()}this.obBuyBtn&&BX.bind(this.obBuyBtn,"click",BX.delegate(this.Basket,this)),this.lastElement&&(this.containerHeight=parseInt(this.obProduct.parentNode.offsetHeight,10),isNaN(this.containerHeight)&&(this.containerHeight=0),this.setHeight(),BX.bind(t,"resize",BX.delegate(this.checkHeight,this)),BX.bind(this.obProduct.parentNode,"mouseover",BX.delegate(this.setHeight,this)),BX.bind(this.obProduct.parentNode,"mouseout",BX.delegate(this.clearHeight,this)))}},t.JCCatalogBigdataProducts.prototype.checkHeight=function(){this.containerHeight=parseInt(this.obProduct.parentNode.offsetHeight,10),isNaN(this.containerHeight)&&(this.containerHeight=0)},t.JCCatalogBigdataProducts.prototype.setHeight=function(){0<this.containerHeight&&BX.adjust(this.obProduct.parentNode,{style:{height:this.containerHeight+"px"}})},t.JCCatalogBigdataProducts.prototype.clearHeight=function(){BX.adjust(this.obProduct.parentNode,{style:{height:"auto"}})},t.JCCatalogBigdataProducts.prototype.QuantityUp=function(){var t=0,e=!0;0===this.errorCode&&this.showQuantity&&this.canBuy&&(t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(t)||(t+=this.stepQuantity,this.checkQuantity&&t>this.maxQuantity&&(e=!1),e&&(this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t)))},t.JCCatalogBigdataProducts.prototype.QuantityDown=function(){var t=0,e=!0;0===this.errorCode&&this.showQuantity&&this.canBuy&&(t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(t)||(t-=this.stepQuantity,t<this.stepQuantity&&(e=!1),e&&(this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t)))},t.JCCatalogBigdataProducts.prototype.QuantityChange=function(){var t=0,e=!0;0===this.errorCode&&this.showQuantity&&(this.canBuy?(t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(t)?this.obQuantity.value=this.stepQuantity:(this.checkQuantity&&(t>this.maxQuantity?(e=!1,t=this.maxQuantity):t<this.stepQuantity&&(e=!1,t=this.stepQuantity)),e||(this.obQuantity.value=t))):this.obQuantity.value=this.stepQuantity)},t.JCCatalogBigdataProducts.prototype.QuantitySet=function(t){0===this.errorCode&&(this.canBuy=this.offers[t].CAN_BUY,this.canBuy?(BX.addClass(this.obBuyBtn,"bx_bt_button"),BX.removeClass(this.obBuyBtn,"bx_bt_button_type_2"),this.obBuyBtn.innerHTML=BX.message("CBD_MESS_BTN_BUY")):(BX.addClass(this.obBuyBtn,"bx_bt_button_type_2"),BX.removeClass(this.obBuyBtn,"bx_bt_button"),this.obBuyBtn.innerHTML=BX.message("CBD_MESS_NOT_AVAILABLE")),this.showQuantity&&(this.isDblQuantity=this.offers[t].QUANTITY_FLOAT,this.checkQuantity=this.offers[t].CHECK_QUANTITY,this.isDblQuantity?(this.maxQuantity=parseFloat(this.offers[t].MAX_QUANTITY),this.stepQuantity=Math.round(parseFloat(this.offers[t].STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor):(this.maxQuantity=parseInt(this.offers[t].MAX_QUANTITY,10),this.stepQuantity=parseInt(this.offers[t].STEP_QUANTITY,10)),this.obQuantity.value=this.stepQuantity,this.obQuantity.disabled=!this.canBuy,this.obMeasure&&(this.offers[t].MEASURE?BX.adjust(this.obMeasure,{html:this.offers[t].MEASURE}):BX.adjust(this.obMeasure,{html:""}))))},t.JCCatalogBigdataProducts.prototype.SelectOfferProp=function(){var t=0,e="",s="",i=[],o=null,a=BX.proxy_context;if(a&&a.hasAttribute("data-treevalue")&&(s=a.getAttribute("data-treevalue"),i=s.split("_"),this.SearchOfferPropIndex(i[0],i[1])&&(o=BX.findChildren(a.parentNode,{tagName:"li"},!1),o&&0<o.length)))for(t=0;t<o.length;t++)e=o[t].getAttribute("data-onevalue"),e===i[1]?BX.addClass(o[t],"bx_active"):BX.removeClass(o[t],"bx_active")},t.JCCatalogBigdataProducts.prototype.SearchOfferPropIndex=function(t,e){var s,i,o="",a=!1,r=[],h=-1,n={},u=[];for(s=0;s<this.treeProps.length;s++)if(this.treeProps[s].ID===t){h=s;break}if(h>-1){for(s=0;h>s;s++)o="PROP_"+this.treeProps[s].ID,n[o]=this.selectedValues[o];if(o="PROP_"+this.treeProps[h].ID,a=this.GetRowValues(n,o),!a)return!1;if(!BX.util.in_array(e,a))return!1;for(n[o]=e,s=h+1;s<this.treeProps.length;s++){if(o="PROP_"+this.treeProps[s].ID,a=this.GetRowValues(n,o),!a)return!1;
23if(this.showAbsent)for(r=[],u=[],u=BX.clone(n,!0),i=0;i<a.length;i++)u[o]=a[i],this.GetCanBuy(u)&&(r[r.length]=a[i]);else r=a;this.selectedValues[o]&&BX.util.in_array(this.selectedValues[o],r)?n[o]=this.selectedValues[o]:n[o]=r[0],this.UpdateRow(s,n[o],a,r)}this.selectedValues=n,this.ChangeInfo()}return!0},t.JCCatalogBigdataProducts.prototype.RowLeft=function(){var t=0,e="",s=-1,i=BX.proxy_context;if(i&&i.hasAttribute("data-treevalue")){for(e=i.getAttribute("data-treevalue"),t=0;t<this.treeProps.length;t++)if(this.treeProps[t].ID===e){s=t;break}s>-1&&this.treeRowShowSize<this.showCount[s]&&(0>this.showStart[s]&&(this.showStart[s]++,BX.adjust(this.obTreeRows[s].LIST,{style:{marginLeft:20*this.showStart[s]+"%"}}),BX.adjust(this.obTreeRows[s].RIGHT,{style:this.treeEnableArrow})),0<=this.showStart[s]&&BX.adjust(this.obTreeRows[s].LEFT,{style:this.treeDisableArrow}))}},t.JCCatalogBigdataProducts.prototype.RowRight=function(){var t=0,e="",s=-1,i=BX.proxy_context;if(i&&i.hasAttribute("data-treevalue")){for(e=i.getAttribute("data-treevalue"),t=0;t<this.treeProps.length;t++)if(this.treeProps[t].ID===e){s=t;break}s>-1&&this.treeRowShowSize<this.showCount[s]&&(this.treeRowShowSize-this.showStart[s]<this.showCount[s]&&(this.showStart[s]--,BX.adjust(this.obTreeRows[s].LIST,{style:{marginLeft:20*this.showStart[s]+"%"}}),BX.adjust(this.obTreeRows[s].LEFT,{style:this.treeEnableArrow})),this.treeRowShowSize-this.showStart[s]>=this.showCount[s]&&BX.adjust(this.obTreeRows[s].RIGHT,{style:this.treeDisableArrow}))}},t.JCCatalogBigdataProducts.prototype.UpdateRow=function(t,e,s,i){var o=0,a=0,r="",h=0,n="",u={},c=!1,l=!1,d=!1,p=0,P=this.treeEnableArrow,b=this.treeEnableArrow,f=0,B=null;if(t>-1&&t<this.obTreeRows.length&&(B=BX.findChildren(this.obTreeRows[t].LIST,{tagName:"li"},!1),B&&0<B.length)){for(c="PICT"===this.treeProps[t].SHOW_MODE,h=s.length,l=this.treeRowShowSize<h,n=l?100/h+"%":"20%",u={props:{className:""},style:{width:n}},c&&(u.style.paddingTop=n),o=0;o<B.length;o++)r=B[o].getAttribute("data-onevalue"),d=r===e,BX.util.in_array(r,i)?u.props.className=d?"bx_active":"":u.props.className=d?"bx_active bx_missing":"bx_missing",u.style.display="none",BX.util.in_array(r,s)&&(u.style.display="",d&&(p=a),a++),BX.adjust(B[o],u);u={style:{width:(l?20*h:100)+"%",marginLeft:"0%"}},c?BX.adjust(this.obTreeRows[t].CONT,{props:{className:l?"bx_item_detail_scu full":"bx_item_detail_scu"}}):BX.adjust(this.obTreeRows[t].CONT,{props:{className:l?"bx_item_detail_size full":"bx_item_detail_size"}}),l?(p+1===h&&(b=this.treeDisableArrow),this.treeRowShowSize<=p&&(f=this.treeRowShowSize-p-1,u.style.marginLeft=20*f+"%"),0===f&&(P=this.treeDisableArrow),BX.adjust(this.obTreeRows[t].LEFT,{style:P}),BX.adjust(this.obTreeRows[t].RIGHT,{style:b})):(BX.adjust(this.obTreeRows[t].LEFT,{style:{display:"none"}}),BX.adjust(this.obTreeRows[t].RIGHT,{style:{display:"none"}})),BX.adjust(this.obTreeRows[t].LIST,u),this.showCount[t]=h,this.showStart[t]=f}},t.JCCatalogBigdataProducts.prototype.GetRowValues=function(t,e){var s,i=0,o=[],a=!1,r=!0;if(0===t.length){for(i=0;i<this.offers.length;i++)BX.util.in_array(this.offers[i].TREE[e],o)||(o[o.length]=this.offers[i].TREE[e]);a=!0}else for(i=0;i<this.offers.length;i++){r=!0;for(s in t)if(t[s]!==this.offers[i].TREE[s]){r=!1;break}r&&(BX.util.in_array(this.offers[i].TREE[e],o)||(o[o.length]=this.offers[i].TREE[e]),a=!0)}return a?o:!1},t.JCCatalogBigdataProducts.prototype.GetCanBuy=function(t){var e,s=0,i=!1,o=!0;for(s=0;s<this.offers.length;s++){o=!0;for(e in t)if(t[e]!==this.offers[s].TREE[e]){o=!1;break}if(o&&this.offers[s].CAN_BUY){i=!0;break}}return i},t.JCCatalogBigdataProducts.prototype.SetCurrent=function(){var t=0,e=0,s=[],i="",o=!1,a={},r=[],h=this.offers[this.offerNum].TREE;for(t=0;t<this.treeProps.length&&(i="PROP_"+this.treeProps[t].ID,o=this.GetRowValues(a,i),o);t++){if(BX.util.in_array(h[i],o)?a[i]=h[i]:(a[i]=o[0],this.offerNum=0),this.showAbsent)for(s=[],r=[],r=BX.clone(a,!0),e=0;e<o.length;e++)r[i]=o[e],this.GetCanBuy(r)&&(s[s.length]=o[e]);else s=o;this.UpdateRow(t,a[i],o,s)}this.selectedValues=a,this.ChangeInfo()},t.JCCatalogBigdataProducts.prototype.ChangeInfo=function(){var t,e=0,s=-1,i={},o=!0,a="";for(e=0;e<this.offers.length;e++){o=!0;for(t in this.selectedValues)if(this.selectedValues[t]!==this.offers[e].TREE[t]){o=!1;break}if(o){s=e;break}}s>-1&&(this.obPict&&(this.offers[s].PREVIEW_PICTURE?BX.adjust(this.obPict,{style:{backgroundImage:"url("+this.offers[s].PREVIEW_PICTURE.SRC+")"}}):BX.adjust(this.obPict,{style:{backgroundImage:"url("+this.defaultPict.pict.SRC+")"}})),this.secondPict&&this.obSecondPict&&(this.offers[s].PREVIEW_PICTURE_SECOND?BX.adjust(this.obSecondPict,{style:{backgroundImage:"url("+this.offers[s].PREVIEW_PICTURE_SECOND.SRC+")"}}):this.offers[s].PREVIEW_PICTURE.SRC?BX.adjust(this.obSecondPict,{style:{backgroundImage:"url("+this.offers[s].PREVIEW_PICTURE.SRC+")"}}):this.defaultPict.secondPict?BX.adjust(this.obSecondPict,{style:{backgroundImage:"url("+this.defaultPict.secondPict.SRC+")"}}):BX.adjust(this.obSecondPict,{style:{backgroundImage:"url("+this.defaultPict.pict.SRC+")"}})),this.showSkuProps&&this.obSkuProps&&(0===this.offers[s].DISPLAY_PROPERTIES.length?BX.adjust(this.obSkuProps,{style:{display:"none"},html:""}):BX.adjust(this.obSkuProps,{style:{display:""},html:this.offers[s].DISPLAY_PROPERTIES})),this.obPrice&&(a=this.offers[s].PRICE.PRINT_DISCOUNT_VALUE,this.showOldPrice&&this.offers[s].PRICE.DISCOUNT_VALUE!==this.offers[s].PRICE.VALUE&&(a+=" <sp
23an>"+this.offers[s].PRICE.PRINT_VALUE+"</span>"),BX.adjust(this.obPrice,{html:a}),this.showPercent&&(i=this.offers[s].PRICE.DISCOUNT_VALUE!==this.offers[s].PRICE.VALUE?{style:{display:""},html:this.offers[s].PRICE.DISCOUNT_DIFF_PERCENT}:{style:{display:"none"},html:""},this.obDscPerc&&BX.adjust(this.obDscPerc,i),this.obSecondDscPerc&&BX.adjust(this.obSecondDscPerc,i))),this.offerNum=s,this.QuantitySet(this.offerNum))},t.JCCatalogBigdataProducts.prototype.InitBasketUrl=function(){switch(this.productType){case 1:case 2:this.basketUrl=this.product.addUrl;break;case 3:this.basketUrl=this.offers[this.offerNum].ADD_URL}this.basketParams={ajax_basket:"Y",rcm:"yes"},this.showQuantity&&(this.basketParams[this.basketData.quantity]=this.obQuantity.value)},t.JCCatalogBigdataProducts.prototype.FillBasketProps=function(){if(this.visual.BASKET_PROP_DIV){var t=0,e=null,s=!1,i=null;if(this.basketData.useProps&&!this.basketData.emptyProps?this.obPopupWin&&this.obPopupWin.contentContainer&&(i=this.obPopupWin.contentContainer):i=BX(this.visual.BASKET_PROP_DIV),i){if(e=i.getElementsByTagName("select"),e&&e.length)for(t=0;t<e.length;t++)if(!e[t].disabled)switch(e[t].type.toLowerCase()){case"select-one":this.basketParams[e[t].name]=e[t].value,s=!0}if(e=i.getElementsByTagName("input"),e&&e.length)for(t=0;t<e.length;t++)if(!e[t].disabled)switch(e[t].type.toLowerCase()){case"hidden":this.basketParams[e[t].name]=e[t].value,s=!0;break;case"radio":e[t].checked&&(this.basketParams[e[t].name]=e[t].value,s=!0)}s||(this.basketParams[this.basketData.props]=[],this.basketParams[this.basketData.props][0]=0)}}},t.JCCatalogBigdataProducts.prototype.SendToBasket=function(){this.canBuy&&(this.InitBasketUrl(),this.FillBasketProps(),this.product&&this.product.id&&JCCatalogBigdataProducts.productsByRecommendation&&JCCatalogBigdataProducts.productsByRecommendation[this.product.id]&&this.RememberProductRecommendation(JCCatalogBigdataProducts.productsByRecommendation[this.product.id],this.product.id),BX.ajax({method:"POST",dataType:"json",url:this.basketUrl,data:this.basketParams,onsuccess:BX.delegate(this.BasketResult,this)}))},t.JCCatalogBigdataProducts.prototype.RememberRecommendation=function(t,e){var s=BX.findParent(t,{className:"bigdata_recommended_products_items"}),i=BX.findChild(s,{attr:{name:"bigdata_recommendation_id"}},!0).value;this.RememberProductRecommendation(i,e)},t.JCCatalogBigdataProducts.prototype.RememberProductRecommendation=function(t,e){var s,i=BX.cookie_prefix+"_RCM_PRODUCT_LOG",o=getCookie(i),a=!1,r=[];o&&(r=o.split("."));for(var h=r.length;h--;)s=r[h].split("-"),s[0]==e?(s=r[h].split("-"),s[1]=t,s[2]=BX.current_server_time,r[h]=s.join("-"),a=!0):BX.current_server_time-s[2]>2592e3&&r.splice(h,1);a||r.push([e,t,BX.current_server_time].join("-"));var n=r.join("."),u=new Date((new Date).getTime()+31536e7);document.cookie=i+"="+n+"; path=/; expires="+u.toUTCString()+"; domain="+BX.cookie_domain},t.JCCatalogBigdataProducts.prototype.Basket=function(){var t="";if(this.canBuy)switch(this.productType){case 1:case 2:this.basketData.useProps&&!this.basketData.emptyProps?(this.InitPopupWindow(),this.obPopupWin.setTitleBar({content:BX.create("div",{style:{marginRight:"30px",whiteSpace:"nowrap"},text:BX.message("CBD_TITLE_BASKET_PROPS")})}),BX(this.visual.BASKET_PROP_DIV)&&(t=BX(this.visual.BASKET_PROP_DIV).innerHTML),this.obPopupWin.setContent(t),this.obPopupWin.setButtons([new e({ownerClass:this.obProduct.parentNode.parentNode.parentNode.className,text:BX.message("CBD_BTN_MESSAGE_SEND_PROPS"),events:{click:BX.delegate(this.SendToBasket,this)}})]),this.obPopupWin.show()):this.SendToBasket();break;case 3:this.SendToBasket()}},t.JCCatalogBigdataProducts.prototype.BasketResult=function(t){var s="",i="",o="",a=!0,r=[];if(this.obPopupWin&&this.obPopupWin.close(),"object"!=typeof t)return!1;if(a="OK"===t.STATUS){switch(BX.onCustomEvent("OnBasketChange"),i=this.product.name,this.productType){case 1:case 2:o=this.product.pict.SRC;break;case 3:o=this.offers[this.offerNum].PREVIEW_PICTURE?this.offers[this.offerNum].PREVIEW_PICTURE.SRC:this.defaultPict.pict.SRC}s='<div style="width: 96%; margin: 10px 2%; text-align: center;"><img src="'+o+'" height="130" style="max-height:130px"><p>'+i+"</p></div>",r=[new e({ownerClass:this.obProduct.parentNode.parentNode.parentNode.className,text:BX.message("CBD_BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(function(){location.href=this.basketData.basketUrl?this.basketData.basketUrl:BX.message("CBD_BASKET_URL")},this)}})]}else s=t.MESSAGE?t.MESSAGE:BX.message("CBD_BASKET_UNKNOWN_ERROR"),r=[new e({ownerClass:this.obProduct.parentNode.parentNode.parentNode.className,text:BX.message("CBD_BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})];this.InitPopupWindow(),this.obPopupWin.setTitleBar({content:BX.create("div",{style:{marginRight:"30px",whiteSpace:"nowrap"},text:a?BX.message("CBD_TITLE_SUCCESSFUL"):BX.message("CBD_TITLE_ERROR")})}),this.obPopupWin.setContent(s),this.obPopupWin.setButtons(r),this.obPopupWin.show()},t.JCCatalogBigdataProducts.prototype.InitPopupWindow=function(){this.obPopupWin||(this.obPopupWin=BX.PopupWindowManager.create("CatalogSectionBasket_"+this.visual.ID,null,{autoHide:!1,offsetLeft:0,offsetTop:0,overlay:!0,closeByEsc:!0,titleBar:!0,closeIcon:{top:"10px",right:"10px"}}))}}}(window),BX.addCustomEvent("onSlideInit",function(t){try{if(ignoreResize.push(!0),t){var e=t.slider;if(e&&e.hasClass("content_inner")&&void 0==$(".all_wrapp .content_inner").attr("data-hover")){var s=0;$(document).find(".all_wrapp .content_inner .footer_button").length&&($(document).find(".all_wrapp .content_inner .footer_button").css("height","auto"),s=$(document).find(".all_wrapp .content_inner .footer_button").height(),$(document).find(".all_wrapp .content_inner .footer_button").css("height",""));var i=1*$(".all_wrapp").height()+20,o=i+s+5;$(".all_wrapp .content_inner .slides").equalize({children:".item-title"}),$(".all_wrapp .content_inner .slides").equalize({children:".item_info"}),$(".all_wrapp .content_inner .slides").equalize({children:".catalog_item"}),$(".all_wrapp .content_inner").attr("data-unhover",i),$(".all_wrapp .content_inner").attr("data-hover",o),$(".all_wrapp").height(i),$(".all_wrapp .content_inner").addClass("absolute"),$(".content_inner .tabs_slider > li").hover(function(){var t=1*$(this).closest(".content_inner").attr("data-hover");$(this).closest(".content_inner").fadeTo(100,1),$(this).closest(".content_inner").stop().css({height:t}),$(this).closest(".flex-viewport").stop().css({height:t})},function(){var t=1*$(this).closest(".content_inner").attr("data-unhover");$(this).closest(".content_inner").stop().animate({height:t},100),$(this).closest(".flex-viewport").stop().animate({height:t},100)})}}}catch(a){}finally{ignoreResize.pop()}}); 24/* End */ 25;; /* /bitrix/components/bitrix/sale.basket.basket/templates/.default/script.min.js?169687285022553*/ 26; /* /bitrix/components/bitrix/sale.basket.basket/templates/.default/js/mustache.min.js?16968728505835*/ 27; /* /bitrix/components/bitrix/sale.basket.basket/templates/.default/js/action-pool.min.js?16968728504358*/ 28; /* /bitrix/components/bitrix/sale.basket.basket/templates/.default/js/filter.min.js?169687285010511*/ 29; /* /bitrix/components/bitrix/sale.basket.basket/templates/.default/js/component.min.js?169687285037537*/ 30; /* /bitrix/templates/aspro_next/components/bitrix/catalog.bigdata.products/next_new/script.min.js?169687294124456*/ 31 32//# sourceMappingURL=page_91c7f4a0da70ba81e8d161e5f0a7594a.map.js
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.