1 2; /* Start:"a:4:{s:4:"full";s:98:"/bitrix/components/bitrix/catalog.compare.list/templates/bootstrap_v4/script.min.js?17535211702543";s:6:"source";s:79:"/bitrix/components/bitrix/catalog.compare.list/templates/bootstrap_v4/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 3(function(t){if(!!t.JCCatalogCompareList){return}t.JCCatalogCompareList=function(t){this.obCompare=null;this.obAdminPanel=null;this.visual=t.VISUAL;this.ajax=t.AJAX;this.position=t.POSITION;BX.ready(BX.proxy(this.init,this))};t.JCCatalogCompareList.prototype.init=function(){this.obCompare=BX(this.visual.ID);if(BX.type.isElementNode(this.obCompare)){BX.addCustomEvent(t,"OnCompareChange",BX.proxy(this.reload,this));BX.bindDelegate(this.obCompare,"click",{tagName:"a"},BX.proxy(this.deleteCompare,this));if(this.position.fixed&&this.position.align.vertical==="top"){this.obAdminPanel=BX("bx-panel");if(BX.type.isElementNode(this.obAdminPanel)){this.setVerticalAlign();BX.addCustomEvent(t,"onTopPanelCollapse",BX.proxy(this.setVerticalAlign,this))}}}};t.JCCatalogCompareList.prototype.reload=function(){BX.showWait(this.obCompare);BX.ajax.post(this.ajax.url,this.ajax.reload,BX.proxy(this.reloadResult,this))};t.JCCatalogCompareList.prototype.reloadResult=function(t){var e="none";BX.closeWait();this.obCompare.innerHTML=t;if(BX.type.isNotEmptyString(t)){if(t.indexOf("<table")>=0)e="block"}BX.style(this.obCompare,"display",e)};t.JCCatalogCompareList.prototype.deleteCompare=function(){var t=BX.proxy_context,e,
3i;if(!!t&&t.hasAttribute("data-id")){e=parseInt(t.getAttribute("data-id"),10);if(!isNaN(e)){BX.showWait(this.obCompare);i=this.ajax.url+this.ajax.templates.delete+e.toString();BX.ajax.loadJSON(i,this.ajax.params,BX.proxy(this.deleteCompareResult,this))}}};t.JCCatalogCompareList.prototype.deleteCompareResult=function(t){var e,i,o,a;BX.closeWait();if(BX.type.isPlainObject(t)){if(BX.type.isNotEmptyString(t.STATUS)&&t.STATUS==="OK"&&!!t.ID){BX.onCustomEvent("onCatalogDeleteCompare",[t.ID]);e=this.obCompare.querySelector('table[data-block="item-list"]');if(BX.type.isElementNode(e)){if(e.rows.length>1){for(i=0;i<e.rows.length;i++){if(e.rows[i].hasAttribute("data-row-id")&&e.rows[i].getAttribute("data-row-id")==="row"+t.ID){e.deleteRow(i)}}if(BX.type.isNotEmptyString(t.COUNT)||BX.type.isNumber(t.COUNT)){a=parseInt(t.COUNT,10);if(!isNaN(a)){o=this.obCompare.querySelector('span[data-block="count"]');if(BX.type.isElementNode(o)){o.innerHTML=a.toString()}o=null;BX.style(this.obCompare,"display",a>0?"block":"none")}}}else{this.reload()}}e=null}}};t.JCCatalogCompareList.prototype.setVerticalAlign=function(){var t;if(BX.type.isElementNode(this.obCompare)&&BX.type.isElementNode(this.obAdminPanel)){t=parseInt(this.obAdminPanel.offsetHeight,10);if(isNaN(t)){t=0}t+=5;BX.style(this.obCompare,"top",t.toString()+"px")}}})(window); 4/* End */ 5; 6; /* Start:"a:4:{s:4:"full";s:95:"/local/templates/okoptica/components/bitrix/catalog.element/main2/script.min.js?177263889756954";s:6:"source";s:75:"/local/templates/okoptica/components/bitrix/catalog.element/main2/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 7(()=>{(function(c){"use strict";if(!c.JCCatalogElement){var u=function(t){u.superclass.constructor.apply(this,arguments),this.buttonNode=BX.create("SPAN",{props:{className:"btn btn-primary btn-buy btn-sm",id:this.id},style:typeof t.style=="object"?t.style:{},text:t.text,events:this.contextEvents}),BX.browser.IsIE()&&this.buttonNode.setAttribute("hideFocus","hidefocus")};BX.extend(u,BX.PopupWindowButton),c.JCCatalogElement=function(t){if(this.productType=0,this.config={useCatalog:!0,showQuantity:!0,showPrice:!0,showAbsent:!0,showOldPrice:!1,showPercent:!1,showSkuProps:!1,showOfferGroup:!1,useCompare:!1,useStickers:!1,useSubscribe:!1,usePopup:!1,useMagnifier:!1,usePriceRanges:!1,basketAction:["BUY"],showClosePopup:!1,templateTheme:"",showSlider:!1,sliderInterval:5e3,useEnhancedEcommerce:!1,dataLayerName:"dataLayer",brandProperty:!1,alt:"",title:"",magnifierZoomPercent:200},this.checkQuantity=!1,this.maxQuantity=0,this.minQuantity=0,this.stepQuantity=1,this.isDblQuantity=!1,this.canBuy=!0,this.isGift=!1,this.canSubscription=!0,this.currentIsSet=!1,this.updateViewedCount=!1,this.currentPriceMode="",this.currentPrices=[],this.currentPriceSelected=0,this.currentQuantityRanges=[],this.currentQuantityRangeSelected=0,this.precision=6,this.precisionFactor=Math.pow(10,this.precision),this.visual={},this.basketMode="",this.product={checkQuantity:!1,maxQuantity:0,stepQuantity:1,startQuantity:1,isDblQuantity:!1,canBuy:!0,canSubscription:!0,name:"",pict:{},id:0,addUrl:"",buyUrl:"",slider:{},sliderCount:0,useSlider:!1,sliderPict:[]},this.mess={},this.basketData={useProps:!1,emptyProps:!1,quantity:"quantity",props:"prop",basketUrl:"",sku_props:"",sku_props_var:"basket_props",add_url:"",buy_url:""},this.compareData={compareUrl:"",compareDeleteUrl:"",comparePath:""},this.defaultPict={preview:null,detail:null},this.offers=[],this.offerNum=0,this.treeProps=[],this.selectedValues={},this.mouseTimer=null,this.isTouchDevice=BX.hasClass(document.documentElement,"bx-touch"),this.touch=null,this.slider={interval:null,progress:null,paused:null,controls:[]},this.quantityDelay=null,this.quantityTimer=null,this.obProduct=null,this.obQuantity=null,this.obQuantityUp=null,this.obQuantityDown=null,this.obPrice={price:null,full:null,discount:null,percent:null,total:null},this.obTree=null,this.obPriceRanges=null,this.obBuyBtn=null,this.obAddToBasketBtn=null,this.obBasketActions=null,this.obNotAvail=null,this.obSubscribe=null,this.obSkuProps=null,this.obMainSkuProps=null,this.obBigSlider=null,this.obMeasure=null,this.obQuantityLimit={all:null,value:null},this.obCompare=null,this.obTabsPanel=null,this.node={},this.smallCardNodes={},this.magnify={enabled:!1,obBigImg:null,obBigSlider:null,height:0,width:0,timer:0},this.currentImg={id:0,src:"",width:0,height:0}
7,this.viewedCounter={path:"/bitrix/components/bitrix/catalog.element/ajax.php",params:{AJAX:"Y",SITE_ID:"",PRODUCT_ID:0,PARENT_ID:0}},this.obPopupWin=null,this.basketUrl="",this.basketParams={},this.errorCode=0,typeof t=="object"){switch(this.params=t,this.initConfig(),this.params.MESS&&(this.mess=this.params.MESS),this.productType){case 0:case 1:case 2:this.initProductData();break;case 3:this.initOffersData();break;default:this.errorCode=-1}this.initBasketData(),this.initCompareData()}this.errorCode===0&&BX.ready(BX.delegate(this.init,this)),this.params={},BX.addCustomEvent("onSaleProductIsGift",BX.delegate(this.onSaleProductIsGift,this)),BX.addCustomEvent("onSaleProductIsNotGift",BX.delegate(this.onSaleProductIsNotGift,this))},c.JCCatalogElement.prototype={getEntity:function(t,i,s){return!t||!i?null:(s=s||"",t.querySelector(s+'[data-entity="'+i+'"]'))},getEntities:function(t,i,s){return!t||!i?{length:0}:(s=s||"",t.querySelectorAll(s+'[data-entity="'+i+'"]'))},onSaleProductIsGift:function(t,i){i&&this.offers&&this.offers[this.offerNum].ID==i&&this.setGift()},onSaleProductIsNotGift:function(t,i){i&&this.offers&&this.offers[this.offerNum].ID==i&&(this.restoreSticker(),this.isGift=!1,this.setPrice())},reloadGiftInfo:function(){this.productType===3&&(this.checkQuantity=!0,this.maxQuantity=1,this.setPrice(),this.redrawSticker({text:BX.message("PRODUCT_GIFT_LABEL")}))},setGift:function(){this.productType===3&&(this.isGift=!0),(this.productType===1||this.productType===2)&&(this.isGift=!0),this.productType===0&&(this.isGift=!1),this.reloadGiftInfo()},setOffer:function(t){this.offerNum=parseInt(t),this.setCurrent()},init:function(){var t=0,i=0,s=null;if(this.obProduct=BX(this.visual.ID),this.obProduct||(this.errorCode=-1),this.obBigSlider=BX(this.visual.BIG_SLIDER_ID),this.node.imageContainer=this.getEntity(this.obProduct,"images-container"),this.node.imageSliderBlock=this.getEntity(this.obProduct,"images-slider-block"),this.node.sliderProgressBar=this.getEntity(this.obProduct,"slider-progress-bar"),this.node.sliderControlLeft=this.getEntity(this.obBigSlider,"slider-control-left"),this.node.sliderControlRight=this.getEntity(this.obBigSlider,"slider-control-right"),(!this.obBigSlider||!this.node.imageContainer||!this.node.imageContainer)&&(this.errorCode=-2),this.config.showPrice&&(this.obPrice.price=BX(this.visual.PRICE_ID),!this.obPrice.price&&this.config.useCatalog?this.errorCode=-16:(this.obPrice.total=BX(this.visual.PRICE_TOTAL),this.config.showOldPrice&&(this.obPrice.full=BX(this.visual.OLD_PRICE_ID),this.obPrice.discount=BX(this.visual.DISCOUNT_PRICE_ID),(!this.obPrice.full||!this.obPrice.discount)&&(this.config.showOldPrice=!1)),this.config.showPercent&&(this.obPrice.percent=BX(this.visual.DISCOUNT_PERCENT_ID),this.obPrice.percent||(this.config.showPercent=!1))),this.obBasketActions=BX(this.visual.BASKET_ACTIONS_ID),this.obBasketActions&&(BX.util.in_array("BUY",this.config.basketAction)&&(this.obBuyBtn=BX(this.visual.BUY_LINK)),BX.util.in_array("ADD",this.config.basketAction)&&(this.obAddToBasketBtn=BX(this.visual.ADD_BASKET_LINK))),this.obNotAvail=BX(this.visual.NOT_AVAILABLE_MESS)),this.config.showQuantity&&(this.obQuantity=BX(this.visual.QUANTITY_ID),this.node.quantity=this.getEntity(this.obProduct,"quantity-block"),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))),this.productType===3&&(this.visual.TREE_ID&&(this.obTree=BX(this.visual.TREE_ID),this.obTree||(this.errorCode=-256)),this.visual.QUANTITY_MEASURE&&(this.obMeasure=BX(this.visual.QUANTITY_MEASURE)),this.visual.QUANTITY_LIMIT&&this.config.showMaxQuantity!=="N"&&(this.obQuantityLimit.all=BX(this.visual.QUANTITY_LIMIT),this.obQuantityLimit.all&&(this.obQuantityLimit.value=this.getEntity(this.obQuantityLimit.all,"quantity-limit-value"),this.obQuantityLimit.value||(this.obQuantityLimit.all=null))),this.config.usePriceRanges&&(this.obPriceRanges=this.getEntity(this.obProduct,"price-ranges-block"))),this.config.showSkuProps&&(this.obSkuProps=BX(this.visual.DISPLAY_PROP_DIV),this.obMainSkuProps=BX(this.visual.DISPLAY_MAIN_PROP_DIV)),this.config.useCompare&&(this.obCompare=BX(this.visual.COMPARE_LINK)),this.config.useSubscribe&&(this.obSubscribe=BX(this.visual.SUBSCRIBE_LINK)),this.obTabs=BX(this.visual.TABS_ID),this.obTabContainers=BX(this.visual.TAB_CONTAINERS_ID),this.obTabsPanel=BX(this.visual.TABS_PANEL_ID),this.smallCardNodes.panel=BX(this.visual.SMALL_CARD_PANEL_ID),this.smallCardNodes.panel&&(this.smallCardNodes.picture=this.getEntity(this.smallCardNodes.panel,"panel-picture"),this.smallCardNodes.title=this.getEntity(this.smallCardNodes.panel,"panel-title"),this.smallCardNodes.price=this.getEntity(this.smallCardNodes.panel,"panel-price"),this.smallCardNodes.sku=this.getEntity(this.smallCardNodes.panel,"panel-sku-container"),this.smallCardNodes.oldPrice=this.getEntity(this.smallCardNodes.panel,"panel-old-price"),this.smallCardNodes.buyButton=this.getEntity(this.smallCardNodes.panel,"panel-buy-button"),this.smallCardNodes.addButton=this.getEntity(this.smallCardNodes.panel,"panel-add-button"),this.smallCardNodes.notAvailableButton=this.getEntity(this.smallCardNodes.panel,"panel-not-available-button"),this.smallCardNodes.aligner=this.getEntity(this.obProduct,"main-button-container")),this.initPopup(),this.initTabs(),this.smallCardNodes.panel&&(this.smallCardNodes.picture&&BX.bind(this.smallCardNodes.picture.parentNode,"click",BX.proxy(this.scrollToProduct,this)),this.smallCardNodes.title&&BX.bind(this.smallCardNodes.title,"click",BX.proxy(this.scrollToProduct,this)),this.smallCardNodes.sku&&BX.bind(this.smallCardNodes.sku,"click",BX.proxy(this.scrollToProduct,this))),(this.obTabsPanel||this.smallCardNodes.panel)&&(this.checkTopPanels(),BX.bind(c,"scroll",BX.proxy(this.checkTopPanels,this))),this.errorCode===0){if(this.config.showSlider&&!this.isTouchDevice&&(BX.bind(this.obBigSlider,"mouseenter",BX.proxy(this.stopSlider,this)),BX.bind(this.obBigSlider,"mouseleave",BX.proxy(this.cycleSlider,this))),this.isTouchDevice&&(BX.bind(this.node.imageContainer,"touchstart",BX.proxy(this.touchStartEvent,this)),BX.bind(this.node.imageContainer,"touchend",BX.proxy(this.touchEndEvent,this)),BX.bind(this.node.imageContainer,"touchcancel",BX.proxy(this.touchEndEvent,this))),BX.bind(this.node.sliderControlLeft,"click",BX.proxy(this.slidePrev,this)),BX.bind(this.node.sliderControlRight,"click",BX.proxy(this.slideNext,this)),this.config.showQuantity){var e=this.isTouchDevice?"touchstart":"mousedown",a=this.isTouchDevice?"touchend":"mou
7seup";this.obQuantityUp&&(BX.bind(this.obQuantityUp,e,BX.proxy(this.startQuantityInterval,this)),BX.bind(this.obQuantityUp,a,BX.proxy(this.clearQuantityInterval,this)),BX.bind(this.obQuantityUp,"mouseout",BX.proxy(this.clearQuantityInterval,this)),BX.bind(this.obQuantityUp,"click",BX.delegate(this.quantityUp,this))),this.obQuantityDown&&(BX.bind(this.obQuantityDown,e,BX.proxy(this.startQuantityInterval,this)),BX.bind(this.obQuantityDown,a,BX.proxy(this.clearQuantityInterval,this)),BX.bind(this.obQuantityDown,"mouseout",BX.proxy(this.clearQuantityInterval,this)),BX.bind(this.obQuantityDown,"click",BX.delegate(this.quantityDown,this))),this.obQuantity&&BX.bind(this.obQuantity,"change",BX.delegate(this.quantityChange,this))}switch(this.productType){case 0:case 1:case 2:if(this.product.useSlider){for(this.product.slider={ID:this.visual.SLIDER_CONT_ID,CONT:BX(this.visual.SLIDER_CONT_ID),COUNT:this.product.sliderCount},this.product.slider.ITEMS=this.getEntities(this.product.slider.CONT,"slider-control"),i=0;i<this.product.slider.ITEMS.length;i++)BX.bind(this.product.slider.ITEMS[i],"mouseenter",BX.delegate(this.onSliderControlHover,this)),BX.bind(this.product.slider.ITEMS[i],"mouseleave",BX.delegate(this.onSliderControlLeave,this)),BX.bind(this.product.slider.ITEMS[i],"click",BX.delegate(this.selectSliderImg,this));this.setCurrentImg(this.product.sliderPict[0],!0,!0),this.checkSliderControls(this.product.sliderCount),this.product.slider.ITEMS.length>1&&this.initSlider()}this.checkQuantityControls(),this.fixFontCheck(),this.setAnalyticsDataLayer("showDetail");break;case 3:for(s=this.obTree.querySelectorAll("li"),t=0;t<s.length;t++)BX.bind(s[t],"click",BX.delegate(this.selectOfferProp,this));for(t=0;t<this.offers.length;t++)if(this.offers[t].SLIDER_COUNT=parseInt(this.offers[t].SLIDER_COUNT,10)||0,this.offers[t].SLIDER_COUNT===0)this.slider.controls[t]={ID:"",COUNT:this.offers[t].SLIDER_COUNT,ITEMS:[]};else{for(i=0;i<this.offers[t].SLIDER.length;i++)this.offers[t].SLIDER[i].WIDTH=parseInt(this.offers[t].SLIDER[i].WIDTH,10),this.offers[t].SLIDER[i].HEIGHT=parseInt(this.offers[t].SLIDER[i].HEIGHT,10);for(this.slider.controls[t]={ID:this.visual.SLIDER_CONT_OF_ID+this.offers[t].ID,OFFER_ID:this.offers[t].ID,CONT:BX(this.visual.SLIDER_CONT_OF_ID+this.offers[t].ID),COUNT:this.offers[t].SLIDER_COUNT},this.slider.controls[t].ITEMS=this.getEntities(this.slider.controls[t].CONT,"slider-control"),i=0;i<this.slider.controls[t].ITEMS.length;i++)BX.bind(this.slider.controls[t].ITEMS[i],"mouseenter",BX.delegate(this.onSliderControlHover,this)),BX.bind(this.slider.controls[t].ITEMS[i],"mouseleave",BX.delegate(this.onSliderControlLeave,this)),BX.bind(this.slider.controls[t].ITEMS[i],"click",BX.delegate(this.selectSliderImg,this))}this.setCurrent();break}this.obBuyBtn&&BX.bind(this.obBuyBtn,"click",BX.proxy(this.buyBasket,this)),this.smallCardNodes.buyButton&&BX.bind(this.smallCardNodes.buyButton,"click",BX.proxy(this.buyBasket,this)),this.obAddToBasketBtn&&BX.bind(this.obAddToBasketBtn,"click",BX.proxy(this.add2Basket,this)),this.smallCardNodes.addButton&&BX.bind(this.smallCardNodes.addButton,"click",BX.proxy(this.add2Basket,this)),this.obCompare&&(BX.bind(this.obCompare,"click",BX.proxy(this.compare,this)),BX.addCustomEvent("onCatalogDeleteCompare",BX.proxy(this.checkDeletedCompare,this)))}},initConfig:function(){if(this.params.PRODUCT_TYPE&&(this.productType=parseInt(this.params.PRODUCT_TYPE,10)),this.params.CONFIG.USE_CATALOG!=="undefined"&&BX.type.isBoolean(this.params.CONFIG.USE_CATALOG)&&(this.config.useCatalog=this.params.CONFIG.USE_CATALOG),this.config.showQuantity=this.params.CONFIG.SHOW_QUANTITY,this.config.showPrice=this.params.CONFIG.SHOW_PRICE,this.config.showPercent=this.params.CONFIG.SHOW_DISCOUNT_PERCENT,this.config.showOldPrice=this.params.CONFIG.SHOW_OLD_PRICE,this.config.showSkuProps=this.params.CONFIG.SHOW_SKU_PROPS,this.config.showOfferGroup=this.params.CONFIG.OFFER_GROUP,this.config.useCompare=this.params.CONFIG.DISPLAY_COMPARE,this.config.useStickers=this.params.CONFIG.USE_STICKERS,this.config.useSubscribe=this.params.CONFIG.USE_SUBSCRIBE,this.config.showMaxQuantity=this.params.CONFIG.SHOW_MAX_QUANTITY,this.config.relativeQuantityFactor=parseInt(this.params.CONFIG.RELATIVE_QUANTITY_FACTOR),this.config.usePriceRanges=this.params.CONFIG.USE_PRICE_COUNT,this.params.CONFIG.MAIN_PICTURE_MODE&&(this.config.usePopup=BX.util.in_array("POPUP",this.params.CONFIG.MAIN_PICTURE_MODE),this.config.useMagnifier=BX.util.in_array("MAGNIFIER",this.params.CONFIG.MAIN_PICTURE_MODE)),this.params.CONFIG.ADD_TO_BASKET_ACTION&&(this.config.basketAction=this.params.CONFIG.ADD_TO_BASKET_ACTION),this.config.showClosePopup=this.params.CONFIG.SHOW_CLOSE_POPUP,this.config.templateTheme=this.params.CONFIG.TEMPLATE_THEME||"",this.config.showSlider=this.params.CONFIG.SHOW_SLIDER==="Y",this.config.showSlider&&!this.isTouchDevice?this.config.sliderInterval=parseInt(this.params.CONFIG.SLIDER_INTERVAL)||5e3:this.config.sliderInterval=!1,this.config.useEnhancedEcommerce=this.params.CONFIG.USE_ENHANCED_ECOMMERCE==="Y",this.config.dataLayerName=this.params.CONFIG.DATA_LAYER_NAME,this.config.brandProperty=this.params.CONFIG.BRAND_PROPERTY,this.config.alt=this.params.CONFIG.ALT||"",this.config.title=this.params.CONFIG.TITLE||"",this.config.magnifierZoomPercent=parseInt(this.params.CONFIG.MAGNIFIER_ZOOM_PERCENT)||200,!this.params.VISUAL||typeof this.params.VISUAL!="object"||!this.params.VISUAL.ID){this.errorCode=-1;return}this.visual=this.params.VISUAL},initProductData:function(){var t=0;if(this.params.PRODUCT&&typeof this.params.PRODUCT=="object"){if(this.config.showPrice&&(this.currentPriceMode=this.params.PRODUCT.ITEM_PRICE_MODE,this.currentPrices=this.params.PRODUCT.ITEM_PRICES,this.currentPriceSelected=this.params.PRODUCT.ITEM_PRICE_SELECTED,this.currentQuantityRanges=this.params.PRODUCT.ITEM_QUANTITY_RANGES,this.currentQuantityRangeSelected=this.params.PRODUCT.ITEM_QUANTITY_RANGE_SELECTED),this.config.showQuantity&&(this.product.checkQuantity=this.params.PRODUCT.CHECK_QUANTITY,this.product.isDblQuantity=this.params.PRODUCT.QUANTITY_FLOAT,this.product.checkQuantity&&(this.product.maxQuantity=this.product.isDblQuantity?parseFloat(this.params.PRODUCT.MAX_QUANTITY):parseInt(this.params.PRODUCT.MAX_QUANTITY,10)),this.product.stepQuantity=this.product.isDblQuantity?parseFloat(this.params.PRODUCT.STEP_QUANTITY):parseInt(this.params.PRODUCT.STEP_QUANTITY,10),this.checkQuantity=this.product.checkQuantity,this.isDblQuantity=this.product.isDblQuantity,this.stepQuantity=this.product.stepQuantity,this.maxQuantity=this.product.maxQuantity,this.minQuantity=this.currentPriceMode==="Q"?parseFloat(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity,this.isDblQuantity&&(this.stepQuantity=Math.round(this.stepQuantity*this.precisionFactor)/this.precisionFactor)),this.product.canBuy=this.params.PRODUCT.CAN_BUY,this.canSubscription=this.product.canSubscription=this.params.PRODUCT.SUBSCRIPTION,this.product.name=this.params.PRODUCT.NAME,this.product.pict=this.params.PRODUCT.PICT,this.product.id=this.params.PRODUCT.ID,this.product.category=this.params.PRODUCT.CATEGORY,this.params.PRODUCT.ADD_URL&&(this.product.addUrl=this.params.PRODUCT.ADD_URL),this.params.PRODUCT.BUY_URL&&(this.product.buyUrl=this.params.PRODUCT.BUY_URL),this.params.PRODUCT.SLIDER_COUNT&&(this.product.sliderCount=parseInt(this.params.PRODUCT.SLIDER_COUNT,10)||0,this.product.sliderCount>0&&this.params.PRODUCT.SLIDER.length)){for(t=0;t<this.params.PRODUCT.SLIDER.length;t++)this.product.useSlider=!0,this.params.PRODUCT.SLIDER[t].WIDTH=parseInt(this.params.PRODUCT.SLIDER[t].WIDTH,10),this.params.PRODUCT.SLIDER[t].HEIGHT=parseInt(this.params.PRODUCT.SLIDER[t].HEIGHT,10);this.product.sliderPict=this.params.PRODUCT.SLIDER,this.setCurrentImg(this.product.sliderPict[0],!1)}this.currentIsSet=!0}else this.errorCode=-1},initOffersData:function(){this.params.OFFERS&&BX.type.isArray(this.params.OFFERS)?(this.offers=this.params.OFFERS,this.offerNum=0,this.params.OFFER_SELECTED&&(this.offerNum=parseInt(this.params.OFFER_SELECTED,10)||0),this.params.TREE_PROPS&&(this.treeProps=this.params.TREE_PROPS),this.params.DEFAULT_PICTURE&&(this.defaultPict.preview=this.params.DEFAULT_PICTURE.PREVIEW_PICTURE,this.defaultPict.detail=this.params.DEFAULT_PICTURE.DETAIL_PICTURE),this.params.PRODUCT&&typeof this.params.PRODUCT=="object"&&(this.product.id=parseInt(this.params.PRODUCT.ID,10),this.product.name=this.params.PRODUCT.NAME,this.product.category=this.params.PRODUCT.CATEGORY)):this.errorCode=-1},initBasketData:function(){this.params.BASKET&&typeof this.params.BASKET=="object"&&((this.productType===1||this.productType===2)&&(this.basketData.useProps=this.params.BASKET.ADD_PROPS,this.basketData.emptyProps=this.params.BASKET.EMPTY_PROPS),this.params.BASKET.QUANTITY&&(this.basketData.quantity=this.params.BASKET.QUANTITY),this.params.BASKET.PROPS&&(this.basketData.props=this.params.BASKET.PROPS),this.params.BASKET.BASKET_URL&&(this.basketData.basketUrl=this.params.BASKET.BASKET_URL),this.productType===3&&this.params.BASKET.SKU_PROPS&&(this.basketData.sku_props=this.params.BASKET.SKU_PROPS),this.params.BASKET.ADD_URL_TEMPLATE&&(this.basketData.add_url=this.params.BASKET.ADD_URL_TEMPLATE),this.params.BASKET.BUY_URL_TEMPLATE&&(this.basketData.buy_url=this.params.BASKET.BUY_URL_TEMPLATE),this.basketData.add_url===""&&this.basketData.buy_url===""&&(this.errorCode=-1024))},initCompareData:function(){this.config.useCompare&&(this.params.COMPARE&&t
7ypeof this.params.COMPARE=="object"?(this.params.COMPARE.COMPARE_PATH&&(this.compareData.comparePath=this.params.COMPARE.COMPARE_PATH),this.params.COMPARE.COMPARE_URL_TEMPLATE?this.compareData.compareUrl=this.params.COMPARE.COMPARE_URL_TEMPLATE:this.config.useCompare=!1,this.params.COMPARE.COMPARE_DELETE_URL_TEMPLATE?this.compareData.compareDeleteUrl=this.params.COMPARE.COMPARE_DELETE_URL_TEMPLATE:this.config.useCompare=!1):this.config.useCompare=!1)},initSlider:function(){this.node.sliderProgressBar&&(this.slider.progress?this.resetProgress():this.slider.progress=new BX.easing({transition:BX.easing.transitions.linear,step:BX.delegate(function(t){this.node.sliderProgressBar.style.width=t.width/10+"%"},this)})),this.cycleSlider()},setAnalyticsDataLayer:function(t){if(!(!this.config.useEnhancedEcommerce||!this.config.dataLayerName)){var i={},s={},e=[],a,r,n,o,h,l;switch(this.productType){case 0:case 1:case 2:i={id:this.product.id,name:this.product.name,price:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].PRICE,category:this.product.category,brand:BX.type.isArray(this.config.brandProperty)?this.config.brandProperty.join("/"):this.config.brandProperty};break;case 3:for(a in this.offers[this.offerNum].TREE)if(this.offers[this.offerNum].TREE.hasOwnProperty(a)){o=a.substring(5),h=this.offers[this.offerNum].TREE[a];for(r in this.treeProps)if(this.treeProps.hasOwnProperty(r)&&this.treeProps[r].ID==o){for(n in this.treeProps[r].VALUES)if(l=this.treeProps[r].VALUES[n],l.ID==h){e.push(l.NAME);break}}}i={id:this.offers[this.offerNum].ID,name:this.offers[this.offerNum].NAME,price:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].PRICE,category:this.product.category,brand:BX.type.isArray(this.config.brandProperty)?this.config.brandProperty.join("/"):this.config.brandProperty,variant:e.join("/")};break}switch(t){case"showDetail":s={event:"showDetail",ecommerce:{currencyCode:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].CURRENCY||"",detail:{products:[{name:i.name||"",id:i.id||"",price:i.price||0,brand:i.brand||"",category:i.category||"",variant:i.variant||""}]}}};break;case"addToCart":s={event:"addToCart",ecommerce:{currencyCode:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].CURRENCY||"",add:{products:[{name:i.name||"",id:i.id||"",price:i.price||0,brand:i.brand||"",category:i.category||"",variant:i.variant||"",quantity:this.config.showQuantity&&this.obQuantity?this.obQuantity.value:1}]}}};break}c[this.config.dataLayerName]=c[this.config.dataLayerName]||[],c[this.config.dataLayerName].push(s)}},initTabs:function(){var t=this.getEntities(this.obTabs,"tab"),i=this.getEntities(this.obTabsPanel,"tab"),s,e,a=!1;if(t.length===i.length)for(var r in t)t.hasOwnProperty(r)&&BX.type.isDomNode(t[r])&&(s=t[r].getAttribute("data-value"),s&&(e=this.obTabContainers.querySelector('[data-value="'+s+'"]'),BX.type.isDomNode(e)&&(BX.bind(t[r],"click",BX.proxy(this.changeTab,this)),BX.bind(i[r],"click",BX.proxy(this.changeTab,this)),a?(BX.removeClass(t[r],"active"),BX.removeClass(i[r],"active"),BX.hide(e)):(BX.addClass(t[r],"active"),BX.addClass(i[r],"active"),BX.show(e),a=!0))))},checkTouch:function(t){return!t||!t.changedTouches?!1:t.changedTouches[0].identifier===this.touch.identifier},touchStartEvent:function(t){t.touches.length==1&&(this.touch=t.changedTouches[0])},touchEndEvent:function(t){if(this.checkTouch(t)){var i=this.touch.pageX-t.changedTouches[0].pageX,s=this.touch.pageY-t.changedTouches[0].pageY;Math.abs(i)>=Math.abs(s)+10&&(i>0&&this.slideNext(),i<0&&this.slidePrev())}},cycleSlider:function(t){if(t||(this.slider.paused=!1),this.slider.interval&&clearInterval(this.slider.interval),this.config.sliderInterval&&!this.slider.paused)if(this.slider.progress){this.slider.progress.stop();var i=parseInt(this.node.sliderProgressBar.style.width);this.slider.progress.options.duration=this.config.sliderInterval*(100-i)/100,this.slider.progress.options.start={width:i*10},this.slider.progress.options.finish={width:1e3},this.slider.progress.options.complete=BX.delegate(function(){this.slider.interval=!0,this.slideNext()},this),this.slider.progress.animate()}else this.slider.interval=setInterval(BX.proxy(this.slideNext,this),this.config.sliderInterval)},stopSlider:function(t){if(t||(this.slider.paused=!0),this.slider.interval&&(this.slider.interval=clearInterval(this.slider.interval)),this.slider.progress){this.slider.progress.stop();var i=parseInt(this.node.sliderProgressBar.style.width);this.slider.progress.options.duration=this.config.sliderInterval*i/200,this.slider.progress.options.start={width:i*10},this.slider.progress.options.finish={width:0},this.slider.progress.options.complete=null,this.slider.progress.animate()}},resetProgress:function(){this.slider.progress&&this.slider.progress.stop(),this.node.sliderProgressBar.style.width=0},slideNext:function(){return this.slide("next")},slidePrev:function(){return this.slide("prev")},slide:function(t){if(!(!this.product.slider||!this.product.slider.CONT)){var i=this.getEntity(this.product.slider.CONT,"slider-control",".active"),s=this.getItemForDirection(t,i);BX.removeClass(i,"active"),this.selectSliderImg(s),this.slider.interval&&this.cycleSlider()}},getItemForDirection:function(t,i){var s=this.getItemIndex(i),e=t==="prev"?-1:1,a=(s+e)%this.product.slider.COUNT;return this.eq(this.product.slider.ITEMS,a)},getItemIndex:function(t){return BX.util.array_values(this.product.slider.ITEMS).indexOf(t)},eq:function(t,i){var s=t.length,e=+i+(i<0?s:0);return e>=0&&e<s?t[e]:{}},scrollToProduct:function(){var t=BX.GetWindowScrollPos().scrollTop,i=BX.pos(this.obProduct).top-30;t>i&&new BX.easing({duration:500,start:{scroll:t},finish:{scroll:i},transition:BX.easing.makeEaseOut(BX.easing.transitions.quint),step:BX.delegate(function(s){c.scrollTo(0,s.scroll)},this)}).animate()},checkTopPanels:function(){var t=BX.GetWindowScrollPos().scrollTop,i;this.smallCardNodes.panel&&(i=BX.pos(this.smallCardNodes.aligner).bottom-50,t>i?BX.addClass(this.smallCardNodes.panel,"active"):BX.hasClass(this.smallCardNodes.panel,"active")&&BX.removeClass(this.smallCardNodes.panel,"active")),this.obTabsPanel&&(i=BX.pos(this.obTabs).top,t+73>i?BX.addClass(this.obTabsPanel,"active"):BX.hasClass(this.obTabsPanel,"active")&&BX.removeClass(this.obTabsPanel,"active"))},changeTab:function(t){BX.PreventDefault(t);var i=BX.proxy_context&&BX.proxy_context.getAttribute("data-value"),s,e,a;if(!BX.hasClass(BX.proxy_context,"active")&&i){s=this.getEntities(this.obTabContainers,"tab-container");for(var r in s)s.hasOwnProperty(r)&&BX.type.isDomNode(s[r])&&(s[r].getAttribute("data-value")===i?BX.show(s[r]):BX.hide(s[r]));e=this.getEntities(this.obTabs,"tab"),a=this.getEntities(this.obTabsPanel,"tab");for(r in e)e.hasOwnProperty(r)&&BX.type.isDomNode(e[r])&&(e[r].getAttribute("data-value")===i?(BX.addClass(e[r],"active"),BX.addClass(a[r],"active")):(BX.removeClass(e[r],"active"),BX.removeClass(a[r],"active")))}var n=BX.GetWindowScrollPos().scrollTop,o=BX.pos(this.obTabContainers
7).top;n+150>o&&new BX.easing({duration:500,start:{scroll:n},finish:{scroll:o-150},transition:BX.easing.makeEaseOut(BX.easing.transitions.quint),step:BX.delegate(function(h){c.scrollTo(0,h.scroll)},this)}).animate()},initPopup:function(){this.config.usePopup&&(this.node.imageContainer.style.cursor="zoom-in",BX.bind(this.node.imageContainer,"click",BX.delegate(this.toggleMainPictPopup,this)),BX.bind(document,"keyup",BX.proxy(this.closeByEscape,this)),BX.bind(this.getEntity(this.obBigSlider,"close-popup"),"click",BX.proxy(this.hideMainPictPopup,this)))},checkSliderControls:function(t){var i=t>1?"":"none";this.node.sliderControlLeft&&(this.node.sliderControlLeft.style.display=i),this.node.sliderControlRight&&(this.node.sliderControlRight.style.display=i)},setCurrentImg:function(t,i,s){var e,a;if(this.currentImg.id=t.ID,this.currentImg.src=t.SRC,this.currentImg.width=t.WIDTH,this.currentImg.height=t.HEIGHT,i&&this.node.imageContainer)for(e=this.getEntities(this.node.imageContainer,"image"),a=e.length;a--;)e[a].getAttribute("data-id")==t.ID?(BX.hasClass(e[a],"active")||this.node.sliderProgressBar&&this.resetProgress(),BX.addClass(e[a],"active")):BX.hasClass(e[a],"active")&&BX.removeClass(e[a],"active");s&&this.smallCardNodes.picture&&this.smallCardNodes.picture.setAttribute("src",this.currentImg.src),this.config.useMagnifier&&!this.isTouchDevice&&i&&this.disableMagnifier(!0)},setMagnifierParams:function(){for(var t=this.getEntities(this.node.imageContainer,"image"),i=t.length,s;i--;)s=t[i].querySelector("img"),s.setAttribute("data-title",s.getAttribute("title")||""),s.removeAttribute("title"),t[i].getAttribute("data-id")==this.currentImg.id&&(BX.unbind(this.currentImg.node,"mouseover",BX.proxy(this.enableMagnifier,this)),this.currentImg.node=s,this.currentImg.node.style.backgroundImage="url('"+this.currentImg.src+"')",this.currentImg.node.style.backgroundSize="100% auto",BX.bind(this.currentImg.node,"mouseover",BX.proxy(this.enableMagnifier,this)))},enableMagnifier:function(){BX.bind(document,"mousemove",BX.proxy(this.moveMagnifierArea,this))},disableMagnifier:function(t){this.magnify.enabled&&(clearTimeout(this.magnify.timer),BX.removeClass(this.obBigSlider,"magnified"),this.magnify.enabled=!1,this.currentImg.node.style.backgroundSize="100% auto",t?(this.currentImg.node.style.height=this.magnify.height+"px",this.currentImg.node.style.width=this.magnify.width+"px",this.magnify.timer=setTimeout(BX.delegate(function(){this.currentImg.node.src=this.currentImg.src,this.currentImg.node.style.height="",this.currentImg.node.style.width=""},this),250)):(this.currentImg.node.src=this.currentImg.src,this.currentImg.node.style.height="",this.currentImg.node.style.width=""),BX.unbind(document,"mousemove",BX.proxy(this.moveMagnifierArea,this)))},moveMagnifierArea:function(t){var i=BX.pos(this.currentImg.node),s=this.inRect(t,i);if(this.inBound(i,s)){var e=s.X/this.currentImg.node.width*100,a=s.Y/this.currentImg.node.height*100,r,n,o,h,l;this.currentImg.node.style.backgroundPosition=e+"% "+a+"%",this.magnify.enabled||(clearTimeout(this.magnify.timer),BX.addClass(this.obBigSlider,"magnified"),this.currentImg.node.style.height=(this.magnify.height=this.currentImg.node.clientHeight)+"px",this.currentImg.node.style.width=(this.magnify.width=this.currentImg.node.offsetWidth)+"px",r=this.currentImg.width/this.currentImg.height,n=this.obBigSlider.offsetWidth,n>this.currentImg.width&&!BX.hasClass(this.obBigSlider,"popup")?(o=n,h=o/r,l=100):(o=this.currentImg.width,h=this.currentImg.height,l=this.config.magnifierZoomPercent>100?this.config.magnifierZoomPercent:100),this.currentImg.node.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQI12P4zwAAAgEBAKrChTYAAAAASUVORK5CYII=",this.currentImg.node.style.backgroundSize=l+"% auto",this.magnify.timer=setTimeout(BX.delegate(function(){this.currentImg.node.style.height=h+"px",this.currentImg.node.style.width=o+"px"},this),10)),this.magnify.enabled=!0}else this.disableMagnifier(!0)},inBound:function(t,i){return i.Y>=0&&t.height>=i.Y&&i.X>=0&&t.width>=i.X},inRect:function(t,i){var s=BX.GetWindowSize(),e={X:0,Y:0,globalX:0,globalY:0};return e.globalX=t.clientX+s.scrollLeft,t.offsetX&&t.offsetX<0&&(e.globalX-=t.offsetX),e.X=e.globalX-i.left,e.globalY=t.clientY+s.scrollTop,t.offsetY&&t.offsetY<0&&(e.globalY-=t.offsetY),e.Y=e.globalY-i.top,e},setProductMainPict:function(t){var i=-1,s=0,e=0,a="";if(this.product.sliderCount){for(e=0;e<this.product.sliderPict.length;e++)if(t===this.product.sliderPict[e].ID){i=e;break}if(i>-1)for(this.product.sliderPict[i]&&this.setCurrentImg(this.product.sliderPict[i],!0),s=0;s<this.product.slider.ITEMS.length;s++)a=this.product.slider.ITEMS[s].getAttribute("data-value"),a===t?BX.addClass(this.product.slider.ITEMS[s],"active"):BX.hasClass(this.product.slider.ITEMS[s],"active")&&BX.removeClass(this.product.slider.ITEMS[s],"active")}},onSliderControlHover:function(){var t=BX.proxy_context;this.mouseTimer=setTimeout(BX.delegate(function(){this.selectSliderImg(t)},this),200)},onSliderControlLeave:function(){clearTimeout(this.mouseTimer),this.mouseTimer=null},selectSliderImg:function(t){var i="",s=[];t=BX.type.isDomNode(t)?t:BX.proxy_context,t&&t.hasAttribute("data-value")&&(i=t.getAttribute("data-value"),i.indexOf("_")!==-1?(s=i.split("_"),this.setMainPict(s[0],s[1])):this.setProductMainPict(i))},setMainPict:function(t,i,s){var e=-1,a=-1,r,n,o="",h="";for(r=0;r<this.offers.length;r++)if(t===this.offers[r].ID){e=r;break}if(e>-1&&this.offers[e].SLIDER_COUNT>0){for(n=0;n<this.offers[e].SLIDER.length;n++)if(i===this.offers[e].SLIDER[n].ID){a=n;break}if(a>-1)for(this.offers[e].SLIDER[a]&&this.setCurrentImg(this.offers[e].SLIDER[a],!0,s),h=t+"_"+i,r=0;r<this.product.slider.ITEMS.length;r++)o=this.product.slider.ITEMS[r].getAttribute("data-value"),o===h?BX.addClass(this.product.slider.ITEMS[r],"active"):BX.hasClass(this.product.slider.ITEMS[r],"active")&&BX.removeClass(this.product.slider.ITEMS[r],"active")}},setMainPictFromItem:function(t){if(this.node.imageContainer){var i=!1,s={};this.offers[t]&&(this.offers[t].DETAIL_PICTURE?(s=this.offers[t].DETAIL_PICTURE,i=!0):this.offers[t].PREVIEW_PICTURE&&(s=this.offers[t].PREVIEW_PICTURE,i=!0)),i||(this.defaultPict.detail?(s=this.defaultPict.detail,i=!0):this.defaultPict.preview&&(s=this.defaultPict.preview,i=!0)),i&&this.setCurrentImg(s,!0,!0)}},toggleMainPictPopup:function(){BX.hasClass(this.obBigSlider,"popup")?this.hideMainPictPopup():this.showMainPictPopup()},showMainPictPopup:function(){this.config.useMagnifier&&this.disableMagnifier(!1),BX.addClass(this.obBigSlider,"popup"),this.node.imageContainer.style.cursor="",document.body.style.overflow="hidden"},hideMainPictPopup:function(){this.config.useMagnifier&&this.disableMagnifier(!1),BX.removeClass(this.obBigSlider,"popup"),this.node.imageContainer.style.cursor="zoom-in",document.body.style.overflow=""},closeByEscape:function(t){t=t||c.event,t.keyCode==27&&this.hideMainPictPopup()},startQuantityInterval:function(){var t=BX.proxy_context,i=t.id===this.visual.QUANTITY_DOWN_ID?BX.proxy(this.quantityDown,this):BX.proxy(this.quantityUp,this);this.quantityDelay=setTimeout(BX.delegate(function(){this.quantityTimer=setInterval(i,150)},this),300)},clearQuantityInterval:function(){clearTimeout(this.quantityDelay),clearInterval(this.quantityTimer)},quantityUp:function(){var t=0,i=!0;this.errorCode===0&&this.config.showQuantity&&this.canBuy&&!this.isGift&&(t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(t)||(t+=this.stepQuantity,t=this.checkQuantityRange(t,"up"),this.checkQuantity&&t>this.maxQuantity&&(i=!1),i&&(this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t,this.setPrice())))},quantityDown:function(){var t=0,i=!0;this.errorCode===0&&this.config.showQuantity&&this.canBuy&&!this.isGift&&(t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(t)||(t-=this.stepQuantity,t=this.checkQuantityRange(t,"down"),t<this.minQuantity&&(i=!1),i&&(this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t,this.setPrice())))},quantityChange:function(){var t=0,i;this.errorCode===0&&this.config.showQuantity&&(this.canBuy?(t=this.isDblQuantity?parseFloat(this.obQuantity.value):Math.round(this.obQuantity.value),isNaN(t)?this.obQuantity.value=this.minQuantity:(t=this.checkQuantityRange(t),this.checkQuantity&&t>this.maxQuantity&&(t=this.maxQuantity),this.checkPriceRange(t),i=Math.floor(Math.round(t*this.precisionFactor/this.stepQuantity)/this.precisionFactor)||1,t=i<=1?this.stepQuantity:i*this.stepQuantity,t=Math.round(t*this.precisionFactor)/this.precisionFactor,t<this.minQuantity&&(t=this.minQuantity),this.obQuantity.value=t)):this.obQuantity.value=this.minQuantity,this.setPrice())},quantitySet:function(t){var i,s,e=this.offers[t],a=this.offers[this.offerNum];
7if(this.errorCode===0){if(this.canBuy=e.CAN_BUY,this.currentPriceMode=e.ITEM_PRICE_MODE,this.currentPrices=e.ITEM_PRICES,this.currentPriceSelected=e.ITEM_PRICE_SELECTED,this.currentQuantityRanges=e.ITEM_QUANTITY_RANGES,this.currentQuantityRangeSelected=e.ITEM_QUANTITY_RANGE_SELECTED,this.canBuy?(this.node.quantity&&BX.style(this.node.quantity,"display",""),this.obBasketActions&&BX.style(this.obBasketActions,"display",""),this.smallCardNodes.buyButton&&BX.style(this.smallCardNodes.buyButton,"display",""),this.smallCardNodes.addButton&&BX.style(this.smallCardNodes.addButton,"display",""),this.obNotAvail&&BX.style(this.obNotAvail,"display","none"),this.smallCardNodes.notAvailableButton&&BX.style(this.smallCardNodes.notAvailableButton,"display","none"),this.obSubscribe&&BX.style(this.obSubscribe,"display","none")):(this.node.quantity&&BX.style(this.node.quantity,"display","none"),this.obBasketActions&&BX.style(this.obBasketActions,"display","none"),this.smallCardNodes.buyButton&&BX.style(this.smallCardNodes.buyButton,"display","none"),this.smallCardNodes.addButton&&BX.style(this.smallCardNodes.addButton,"display","none"),this.obNotAvail&&BX.style(this.obNotAvail,"display",""),this.smallCardNodes.notAvailableButton&&BX.style(this.smallCardNodes.notAvailableButton,"display",""),this.obSubscribe&&(e.CATALOG_SUBSCRIBE==="Y"?(BX.style(this.obSubscribe,"display",""),this.obSubscribe.setAttribute("data-item",e.ID),BX(this.visual.SUBSCRIBE_LINK+"_hidden").click()):BX.style(this.obSubscribe,"display","none"))),this.isDblQuantity=e.QUANTITY_FLOAT,this.checkQuantity=e.CHECK_QUANTITY,this.isDblQuantity?(this.stepQuantity=Math.round(parseFloat(e.STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor,this.maxQuantity=parseFloat(e.MAX_QUANTITY),this.minQuantity=this.currentPriceMode==="Q"?parseFloat(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity):(this.stepQuantity=parseInt(e.STEP_QUANTITY,10),this.maxQuantity=parseInt(e.MAX_QUANTITY,10),this.minQuantity=this.currentPriceMode==="Q"?parseInt(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity),this.config.showQuantity){var r=a.ITEM_PRICES.length&&a.ITEM_PRICES[a.ITEM_PRICE_SELECTED]&&a.ITEM_PRICES[a.ITEM_PRICE_SELECTED].MIN_QUANTITY!=this.minQuantity;this.isDblQuantity?s=Math.round(parseFloat(a.STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor!==this.stepQuantity||r||a.MEASURE!==e.MEASURE||this.checkQuantity&&parseFloat(a.MAX_QUANTITY)>this.maxQuantity&&parseFloat(this.obQuantity.value)>this.maxQuantity:s=parseInt(a.STEP_QUANTITY,10)!==this.stepQuantity||r||a.MEASURE!==e.MEASURE||this.checkQuantity&&parseInt(a.MAX_QUANTITY,10)>this.maxQuantity&&parseInt(this.obQuantity.value,10)>this.maxQuantity,this.obQuantity.disabled=!this.canBuy,s&&(this.obQuantity.value=this.minQuantity),this.obMeasure&&(e.MEASURE?BX.adjust(this.obMeasure,{html:e.MEASURE}):BX.adjust(this.obMeasure,{html:""}))}if(this.obQuantityLimit.all&&(!this.checkQuantity||this.maxQuantity==0?(BX.adjust(this.obQuantityLimit.value,{html:""}),BX.adjust(this.obQuantityLimit.all,{style:{display:"none"}})):(this.config.showMaxQuantity==="M"?i=this.maxQuantity/this.stepQuantity>=this.config.relativeQuantityFactor?BX.message("RELATIVE_QUANTITY_MANY"):BX.message("RELATIVE_QUANTITY_FEW"):(i=this.maxQuantity,e.MEASURE&&(i+=" "+e.MEASURE)),BX.adjust(this.obQuantityLimit.value,{html:i}),BX.adjust(this.obQuantityLimit.all,{style:{display:""}}))),this.config.usePriceRanges&&this.obPriceRanges)if(this.currentPriceMode==="Q"&&e.PRICE_RANGES_HTML){var n=this.getEntity(this.obPriceRanges,"price-ranges-body"),o=this.getEntity(this.obPriceRanges,"price-ranges-ratio-header");n&&(n.innerHTML=e.PRICE_RANGES_HTML),o&&(o.innerHTML=e.PRICE_RANGES_RATIO_HTML),this.obPriceRanges.style.display=""}else this.obPriceRanges.style.display="none"}},selectOfferProp:function(){var t=0,i="",s=[],e=null,a=BX.proxy_context,r;if(a&&a.hasAttribute("data-treevalue")){if(BX.hasClass(a,"selected"))return;if(typeof document.activeElement=="object"&&document.activeElement.blur(),i=a.getAttribute("data-treevalue"),s=i.split("_"),this.searchOfferPropIndex(s[0],s[1]),e=BX.findChildren(a.parentNode,{tagName:"li"},!1),e&&e.length)for(t=0;t<e.length;t++)BX.removeClass(e[t],"selected");if(BX.addClass(a,"selected"),this.smallCardNodes.panel&&(r=this.smallCardNodes.panel.querySelector('[data-treevalue="'+i+'"]'),r)){for(e=this.smallCardNodes.panel.querySelectorAll('[data-sku-line="'+r.getAttribute("data-sku-line")+'"]'),t=0;t<e.length;t++)e[t].style.display="none";r.style.display=""}}},searchOfferPropIndex:function(t,i){var s="",e=!1,a=[],r=[],n=-1,o,h,l={},d=[];for(o=0;o<this.treeProps.length;o++)if(this.treeProps[o].ID===t){n=o;break}if(n>-1){for(o=0;o<n;o++)s="PROP_"+this.treeProps[o].ID,l[s]=this.selectedValues[s];for(s="PROP_"+this.treeProps[n].ID,l[s]=i,o=n+1;o<this.treeProps.length&&(s="PROP_"+this.treeProps[o].ID,e=this.getRowValues(l,s),!!e);o++){if(r=[],this.config.showAbsent)for(a=[],d=[],d=BX.clone(l,!0),h=0;h<e.length;h++)d[s]=e[h],r[r.length]=e[h],this.getCanBuy(d)&&(a[a.length]=e[h]);else a=e;this.selectedValues[s]&&BX.util.in_array(this.selectedValues[s],a)?l[s]=this.selectedValues[s]:this.config.showAbsent?l[s]=a.length?a[0]:r[0]:l[s]=a[0],this.updateRow(o,l[s],e,a)}this.selectedValues=l,this.changeInfo()}},updateRow:function(t,i,s,e){var a=0,r="",n=!1,o=null,h=this.getEntities(this.obTree,"sku-line-block");if(t>-1&&t<h.length){for(o=h[t].querySelectorAll("li"),a=0;a<o.length;a++)r=o[a].getAttribute("data-onevalue"),n=r===i,n?BX.addClass(o[a],"selected"):BX.removeClass(o[a],"selected"),BX.util.in_array(r,e)?BX.removeClass(o[a],"notallowed"):BX.addClass(o[a],"notallowed"),o[a].style.display=BX.util.in_array(r,s)?"":"none",n&&(h[t].style.display=r==0&&e.length==1?"none":"");
7if(this.smallCardNodes.panel)for(o=this.smallCardNodes.panel.querySelectorAll('[data-sku-line="'+t+'"]'),a=0;a<o.length;a++)r=o[a].getAttribute("data-onevalue"),n=r===i,n?o[a].style.display="":o[a].style.display="none",BX.util.in_array(r,e)?BX.removeClass(o[a],"notallowed"):BX.addClass(o[a],"notallowed"),n&&(o[a].style.display=r==0&&e.length==1?"none":"")}},getRowValues:function(t,i){var s=[],e=0,a=0,r=!1,n=!0;if(t.length===0){for(e=0;e<this.offers.length;e++)BX.util.in_array(this.offers[e].TREE[i],s)||(s[s.length]=this.offers[e].TREE[i]);r=!0}else for(e=0;e<this.offers.length;e++){n=!0;for(a in t)if(t[a]!==this.offers[e].TREE[a]){n=!1;break}n&&(BX.util.in_array(this.offers[e].TREE[i],s)||(s[s.length]=this.offers[e].TREE[i]),r=!0)}return r?s:!1},getCanBuy:function(t){var i,s=0,e=!0,a=!1;for(i=0;i<this.offers.length;i++){e=!0;for(s in t)if(t[s]!==this.offers[i].TREE[s]){e=!1;break}if(e&&this.offers[i].CAN_BUY){a=!0;break}}return a},setCurrent:function(){var t,i=0,s="",e=!1,a=[],r={},n=[],o=this.offers[this.offerNum].TREE;for(t=0;t<this.treeProps.length&&(s="PROP_"+this.treeProps[t].ID,e=this.getRowValues(r,s),!!e);t++){if(BX.util.in_array(o[s],e)?r[s]=o[s]:(r[s]=e[0],this.offerNum=0),this.config.showAbsent)for(a=[],n=[],n=BX.clone(r,!0),i=0;i<e.length;i++)n[s]=e[i],this.getCanBuy(n)&&(a[a.length]=e[i]);else a=e;this.updateRow(t,r[s],e,a)}this.selectedValues=r,this.changeInfo()},changeInfo:function(){var t=-1,i=0,s=!0,e={currentId:this.offerNum>-1?this.offers[this.offerNum].ID:0,newId:0},a,r;for(a=0;a<this.offers.length;a++){s=!0;for(i in this.selectedValues)if(this.selectedValues[i]!==this.offers[a].TREE[i]){s=!1;break}if(s){t=a;break}}if(t>-1){for(t!=this.offerNum&&(this.isGift=!1),this.checkSliderControls(this.offers[t].SLIDER_COUNT),a=0;a<this.offers.length;a++)this.config.showOfferGroup&&this.offers[a].OFFER_GROUP&&(r=BX(this.visual.OFFER_GROUP+this.offers[a].ID))&&(r.style.display=a==t?"":"none"),this.slider.controls[a].ID?a===t?(this.product.slider=this.slider.controls[a],this.slider.controls[a].CONT&&BX.show(this.slider.controls[a].CONT)):this.slider.controls[a].CONT&&BX.hide(this.slider.controls[a].CONT):a===t&&(this.product.slider={});this.offers[t].SLIDER_COUNT>0?this.setMainPict(this.offers[t].ID,this.offers[t].SLIDER[0].ID,!0):this.setMainPictFromItem(t),this.offers[t].SLIDER_COUNT>1?this.initSlider():this.stopSlider(),this.config.showSkuProps&&(this.obSkuProps&&(this.offers[t].DISPLAY_PROPERTIES?BX.adjust(this.obSkuProps,{style:{display:""},html:this.offers[t].DISPLAY_PROPERTIES}):BX.adjust(this.obSkuProps,{style:{display:"none"},html:""})),this.obMainSkuProps&&(this.offers[t].DISPLAY_PROPERTIES_MAIN_BLOCK?BX.adjust(this.obMainSkuProps,{style:{display:""},html:this.offers[t].DISPLAY_PROPERTIES_MAIN_BLOCK}):BX.adjust(this.obMainSkuProps,{style:{display:"none"},html:""}))),this.quantitySet(t),this.setPrice(),this.setCompared(this.offers[t].COMPARED),this.offerNum=t,this.fixFontCheck(),this.setAnalyticsDataLayer("showDetail"),this.incViewedCounter(),e.newId=this.offers[this.offerNum].ID,BX.onCustomEvent("onCatalogStoreProductChange",[this.offers[this.offerNum].ID]),BX.onCustomEvent("onCatalogElementChangeOffer",[e]),e=null}},drawImages:function(t){if(this.node.imageContainer){var i,s,e=this.getEntities(this.node.imageContainer,"image");for(i in e)e.hasOwnProperty(i)&&BX.type.isDomNode(e[i])&&BX.remove(e[i]);for(i=0;i<t.length;i++)s=BX.create("IMG",{props:{src:t[i].SRC,alt:this.config.alt,title:this.config.title}}),i==0&&s.setAttribute("itemprop","image"),this.node.imageContainer.appendChild(BX.create("DIV",{attrs:{"data-entity":"image","data-id":t[i].ID},props:{className:"product-item-detail-slider-image"+(i==0?" active":"")},children:[s]}))}},restoreSticker:function(){this.previousStickerText?this.redrawSticker({text:this.previousStickerText}):this.hideSticker()},hideSticker:function(){BX.hide(BX(this.visual.STICKER_ID))},redrawSticker:function(t){t=t||{};var i=t.text||"",s=BX(this.visual.STICKER_ID);if(s){BX.show(s);var e=s.getAttribute("title");e&&e!=i&&(this.previousStickerText=e),BX.adjust(s,{text:i,attrs:{title:i}})}},checkQuantityRange:function(t,i){if(typeof t=="undefined"||this.currentPriceMode!=="Q")return t;t=parseFloat(t);var s=t,e,a,r,n,o,h;for(var l in this.currentQuantityRanges)if(this.currentQuantityRanges.hasOwnProperty(l))if(e=this.currentQuantityRanges[l],parseFloat(t)>=parseFloat(e.SORT_FROM)&&(e.SORT_TO==="INF"||parseFloat(t)<=parseFloat(e.SORT_TO))){s=t;break}else a=parseFloat(e.SORT_FROM)-t,r=Math.abs(a),n=parseFloat(e.SORT_TO)-t,o=Math.abs(n),(h===void 0||h>r)&&(i===void 0||i==="up"&&a>0||i==="down"&&a<0)&&(h=r,s=parseFloat(e.SORT_FROM)),(h===void 0||h>o)&&(i===void 0||i==="up"&&a>0||i==="down"&&a<0)&&(h=o,s=parseFloat(e.SORT_TO));return s},checkPriceRange:function(t){if(!(typeof t=="undefined"||this.currentPriceMode!=="Q")){var i,s=!1;for(var e in this.currentQuantityRanges)if(this.currentQuantityRanges.hasOwnProperty(e)&&(i=this.currentQuantityRanges[e],parseFloat(t)>=parseFloat(i.SORT_FROM)&&(i.SORT_TO==="INF"||parseFloat(t)<=parseFloat(i.SORT_TO)))){s=!0,this.currentQuantityRangeSelected=i.HASH;break}!s&&(i=this.getMinPriceRange())&&(this.currentQuantityRangeSelected=i.HASH);for(var a in this.currentPrices)if(this.currentPrices.hasOwnProperty(a)&&this.currentPrices[a].QUANTITY_HASH==this.currentQuantityRangeSelected){this.currentPriceSelected=a;break}}},getMinPriceRange:function(){var t;for(var i in this.currentQuantityRanges)this.currentQuantityRanges.hasOwnProperty(i)&&(!t||parseInt(this.currentQuantityRanges[i].SORT_FROM)<parseInt(t.SORT_FROM))&&(t=this.currentQuantityRanges[i]);return t}
7,checkQuantityControls:function(){if(this.obQuantity){var t=this.checkQuantity&&parseFloat(this.obQuantity.value)+this.stepQuantity>this.maxQuantity,i=parseFloat(this.obQuantity.value)-this.stepQuantity<this.minQuantity;t?BX.addClass(this.obQuantityUp,"product-item-amount-field-btn-disabled"):BX.hasClass(this.obQuantityUp,"product-item-amount-field-btn-disabled")&&BX.removeClass(this.obQuantityUp,"product-item-amount-field-btn-disabled"),i?BX.addClass(this.obQuantityDown,"product-item-amount-field-btn-disabled"):BX.hasClass(this.obQuantityDown,"product-item-amount-field-btn-disabled")&&BX.removeClass(this.obQuantityDown,"product-item-amount-field-btn-disabled"),t&&i?this.obQuantity.setAttribute("disabled","disabled"):this.obQuantity.removeAttribute("disabled")}},setPrice:function(){var t="",i;this.obQuantity&&this.checkPriceRange(this.obQuantity.value),this.checkQuantityControls(),i=this.currentPrices[this.currentPriceSelected],this.isGift&&(i.PRICE=0,i.DISCOUNT=i.BASE_PRICE,i.PERCENT=100),this.obPrice.price&&(i?(BX.adjust(this.obPrice.price,{html:BX.Currency.currencyFormat(i.RATIO_PRICE,i.CURRENCY,!0)}),this.smallCardNodes.price&&BX.adjust(this.smallCardNodes.price,{html:BX.Currency.currencyFormat(i.RATIO_PRICE,i.CURRENCY,!0)})):(BX.adjust(this.obPrice.price,{html:""}),this.smallCardNodes.price&&BX.adjust(this.smallCardNodes.price,{html:""})),i&&i.RATIO_PRICE!==i.RATIO_BASE_PRICE?(this.config.showOldPrice&&(this.obPrice.full&&BX.adjust(this.obPrice.full,{style:{display:""},html:BX.Currency.currencyFormat(i.RATIO_BASE_PRICE,i.CURRENCY,!0)}),this.smallCardNodes.oldPrice&&BX.adjust(this.smallCardNodes.oldPrice,{style:{display:""},html:BX.Currency.currencyFormat(i.RATIO_BASE_PRICE,i.CURRENCY,!0)}),this.obPrice.discount&&(t=BX.message("ECONOMY_INFO_MESSAGE"),t=t.replace("#ECONOMY#",BX.Currency.currencyFormat(i.RATIO_DISCOUNT,i.CURRENCY,!0)),BX.adjust(this.obPrice.discount,{style:{display:""},html:t}))),this.config.showPercent&&this.obPrice.percent&&BX.adjust(this.obPrice.percent,{style:{display:""},html:-i.PERCENT+"%"})):(this.config.showOldPrice&&(this.obPrice.full&&BX.adjust(this.obPrice.full,{style:{display:"none"},html:""}),this.smallCardNodes.oldPrice&&BX.adjust(this.smallCardNodes.oldPrice,{style:{display:"none"},html:""}),this.obPrice.discount&&BX.adjust(this.obPrice.discount,{style:{display:"none"},html:""})),this.config.showPercent&&this.obPrice.percent&&BX.adjust(this.obPrice.percent,{style:{display:"none"},html:""})),this.obPrice.total&&(i&&this.obQuantity&&this.obQuantity.value!=this.stepQuantity?BX.adjust(this.obPrice.total,{html:BX.message("PRICE_TOTAL_PREFIX")+" <strong>"+BX.Currency.currencyFormat(i.PRICE*this.obQuantity.value,i.CURRENCY,!0)+"</strong>",style:{display:""}}):BX.adjust(this.obPrice.total,{html:"",style:{display:"none"}})))},compare:function(t){var i=this.obCompare.querySelector('[data-entity="compare-checkbox"]'),s=BX.getEventTarget(t),e=!0;i&&(e=s===i?i.checked:!i.checked);var a=e?this.compareData.compareUrl:this.compareData.compareDeleteUrl,r;if(a){switch(s!==i&&(BX.PreventDefault(t),this.setCompared(e)),this.productType){case 0:case 1:case 2:r=a.replace("#ID#",this.product.id.toString());break;case 3:r=a.replace("#ID#",this.offers[this.offerNum].ID);break}BX.ajax({method:"POST",dataType:e?"json":"html",url:r+(r.indexOf("?")!==-1?"&":"?")+"ajax_action=Y",onsuccess:e?BX.proxy(this.compareResult,this):BX.proxy(this.compareDeleteResult,this)})}},compareResult:function(t){var i,s;this.obPopupWin&&this.obPopupWin.close(),BX.type.isPlainObject(t)&&(this.initPopupWindow(),this.offers.length>0&&(this.offers[this.offerNum].COMPARED=t.STATUS==="OK"),t.STATUS==="OK"?(BX.onCustomEvent("OnCompareChange"),i='<div style="width: 100%; margin: 0; text-align: center;"><p>'+BX.message("COMPARE_MESSAGE_OK")+"</p></div>",this.config.showClosePopup?s=[new u({text:BX.message("BTN_MESSAGE_COMPARE_REDIRECT"),events:{click:BX.delegate(this.compareRedirect,this)},style:{marginRight:"10px"}}),new u({text:BX.message("BTN_MESSAGE_CLOSE_POPUP"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]:s=[new u({text:BX.message("BTN_MESSAGE_COMPARE_REDIRECT"),events:{click:BX.delegate(this.compareRedirect,this)}})]):(i='<div style="width: 100%; margin: 0; text-align: center;"><p>'+(t.MESSAGE?t.MESSAGE:BX.message("COMPARE_UNKNOWN_ERROR"))+"</p></div>",s=[new u({text:BX.message("BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]),this.obPopupWin.setTitleBar(BX.message("COMPARE_TITLE")),this.obPopupWin.setContent(i),this.obPopupWin.setButtons(s),this.obPopupWin.show())},compareDeleteResult:function(){BX.onCustomEvent("OnCompareChange"),this.offers&&this.offers.length&&(this.offers[this.offerNum].COMPARED=!1)},setCompared:function(t){if(this.obCompare){var i=this.getEntity(this.obCompare,"compare-checkbox");i&&(i.checked=t)}},setCompareInfo:function(t){if(BX.type.isArray(t))for(var i in this.offers)this.offers.hasOwnProperty(i)&&(this.offers[i].COMPARED=BX.util.in_array(this.offers[i].ID,t))},compareRedirect:function(){this.compareData.comparePath?location.href=this.compareData.comparePath:this.obPopupWin.close()},checkDeletedCompare:function(t){switch(this.productType){case 0:case 1:case 2:this.product.id==t&&this.setCompared(!1);break;case 3:for(var i=this.offers.length;i--;)if(this.offers[i].ID==t){this.offers[i].COMPARED=!1,this.offerNum==i&&this.setCompared(!1);break}}},initBasketUrl:function(){switch(this.basketUrl=this.basketMode==="ADD"?this.basketData.add_url:this.basketData.buy_url,this.productType){case 1:case 2:this.basketUrl=this.basketUrl.replace("#ID#",this.product.id.toString());break;case 3:this.basketUrl=this.basketUrl.replace("#ID#",this.offers[this.offerNum].ID);break}this.basketParams={ajax_basket:"Y"},this.config.showQuantity&&(this.basketParams[this.basketData.quantity]=this.obQuantity.value),this.basketData.sku_props&&(this.basketParams[this.basketData.sku_props_var]=this.basketData.sku_props)},fillBasketProps:function(){if(this.visual.BASKET_PROP_DIV){var t=0,i=null,s=!1,e=null;if(this.basketData.useProps&&!this.basketData.emptyProps?this.obPopupWin&&this.obPopupWin.contentContainer&&(e=this.obPopupWin.contentContainer):e=BX(this.visual.BASKET_PROP_DIV),e){if(i=e.getElementsByTagName("select"),i&&i.length){for(t=0;t<i.length;t++)if(!i[t].disabled)switch(i[t].type.toLowerCase()){case"select-one":this.basketParams[i[t].name]=i[t].value,s=!0;break;default:break}}if(i=e.getElementsByTagName("input"),i&&i.length){for(t=0;t<i.length;t++)if(!i[t].disabled)switch(i[t].type.toLowerCase()){case"hidden":this.basketParams[i[t].name]=i[t].value,s=!0;break;case"radio":i[t].checked&&(this.basketParams[i[t].name]=i[t].value,s=!0);break;default:break}}}s||(this.basketParams[this.basketData.props]=[],this.basketParams[this.basketData.props][0]=0)}},sendToBasket:function(){this.canBuy&&(this.initBasketUrl(),this.fillBasketProps(),BX.ajax({method:"POST",dataType:"json",url:this.basketUrl,data:this.basketParams,onsuccess:BX.proxy(this.basketResult,this)}))},add2Basket:function(){this.basketMode="ADD",this.basket()},buyBasket:function(){this.basketMode="BUY",this.basket()},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(BX.message("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 u({text:BX.message("BTN_SEND_PROPS"),events:{click:BX.delegate(this.sendToBasket,this)}})]),this.obPopupWin.show()):this.sendToBasket();break;case 3:this.sendToBasket();break}},basketResult:function(t){var i,s,e;if(this.obPopupWin&&this.obPopupWin.close(),!!BX.type.isPlainObject(t))if(t.STATUS==="OK"&&this.setAnalyticsDataLayer("addToCart"),t.STATUS==="OK"&&this.basketMode==="BUY")this.basketRedirect();else{if(this.initPopupWindow(),t.STATUS==="OK"){switch(BX.onCustomEvent("OnBasketChange"),this.productType){case 1:case 2:e=this.product.pict.SRC;break;case 3:e=this.offers[this.offerNum].PREVIEW_PICTURE?this.offers[this.offerNum].PREVIEW_PICTURE.SRC:this.defaultPict.pict.SRC;break}i='<div style="width: 100%; margin: 0; text-align: center;"><img src="'+e+'" height="130" style="max-height:130px"><p>'+this.product.name+"</p></div>",this.config.showClosePopup?s=[new u({text:BX.message("BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(this.basketRedirect,this)},style:{marginRight:"10px"}}),new u({text:BX.message("BTN_MESSAGE_CLOSE_POPUP"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]:s=[new u({text:BX.message("BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(this.basketRedirect,this)}})]}else i='<div style="width: 100%; margin: 0; text-align: center;"><p>'+(t.MESSAGE?t.MESSAGE:BX.message("BASKET_UNKNOWN_ERROR"))+"</p></div>",s=[new u({text:BX.message("BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})];this.obPopupWin.setTitleBar(t.STATUS==="OK"?BX.message("TITLE_SUCCESSFUL"):BX.message("TITLE_ERROR")),this.obPopupWin.setContent(i),this.obPopupWin.setButtons(s),this.obPopupWin.show()}},basketRedirect:function(){location.href=this.basketData.basketUrl?this.basketData.basketUrl:BX.message("BASKET_URL")},initPopupWindow:function(){this.obPopupWin||(this.obPopupWin=BX.PopupWindowManager.create("CatalogElementBasket_"+this.visual.ID,null,{autoHide:!1,offsetLeft:0,offsetTop:0,overlay:!0,closeByEsc:!0,titleBar:!0,closeIcon:!0,contentColor:"white",className:this.config.templateTheme?"bx-"+this.config.templateTheme:""}))},incViewedCounter:function(){if(this.currentIsSet&&!this.updateViewedCount){switch(this.productType){case 1:case 2:this.viewedCounter.params.PRODUCT_ID=this.product.id,this.viewedCounter.params.PARENT_ID=this.product.id;break;case 3:this.viewedCounter.params.PARENT_ID=this.product.id,this.viewedCounter.params.PRODUCT_ID=this.offers[this.offerNum].ID;break;default:return}
7this.viewedCounter.params.SITE_ID=BX.message("SITE_ID"),this.updateViewedCount=!0,BX.ajax.post(this.viewedCounter.path,this.viewedCounter.params,BX.delegate(function(){this.updateViewedCount=!1},this))}},allowViewedCount:function(t){this.currentIsSet=!0,t&&this.incViewedCounter()},fixFontCheck:function(){BX.type.isDomNode(this.obPrice.price)&&BX.FixFontSize&&BX.FixFontSize.init({objList:[{node:this.obPrice.price,maxFontSize:28,smallestValue:!1,scaleBy:this.obPrice.price.parentNode}],onAdaptiveResize:!0})}}}})(window);})(); 8 9/* End */ 10; 11; /* Start:"a:4:{s:4:"full";s:103:"/bitrix/components/bitrix/sale.prediction.product.detail/templates/.default/script.min.js?1753521173394";s:6:"source";s:85:"/bitrix/components/bitrix/sale.prediction.product.detail/templates/.default/script.js";s:3:"min";s:89:"/bitrix/components/bitrix/sale.prediction.product.detail/templates/.default/script.min.js";s:3:"map";s:89:"/bitrix/components/bitrix/sale.prediction.product.detail/templates/.default/script.map.js";}"*/ 12(function(t){})(window);function bx_sale_prediction_product_detail_load(t,a,e){a=a||{};e=e||{};BX.ajax({url:"/bitrix/components/bitrix/sale.prediction.product.detail/ajax.php",method:"POST",data:BX.merge(a,e),dataType:"html",processData:false,start:true,onsuccess:function(a){var e=BX.processHTML(a);BX(t).innerHTML=e.HTML;BX.ajax.processScripts(e.SCRIPT)}})} 13/* End */ 14; 15; /* Start:"a:4:{s:4:"full";s:96:"/bitrix/components/bitrix/sale.products.gift/templates/bootstrap_v4/script.min.js?17535211733303";s:6:"source";s:77:"/bitrix/components/bitrix/sale.products.gift/templates/bootstrap_v4/script.js";s:3:"min";s:81:"/bitrix/components/bitrix/sale.products.gift/templates/bootstrap_v4/script.min.js";s:3:"map";s:81:"/bitrix/components/bitrix/sale.products.gift/templates/bootstrap_v4/script.map.js";}"*/ 16(function(){"use strict";if(!!window.JCSaleProductsGiftComponent)return;window.JCSaleProductsGiftComponent=function(t){this.formPosting=false;this.siteId=t.siteId||"";this.template=t.template||"";this.componentPath=t.componentPath||"";this.parameters=t.parameters||"";this.container=document.querySelector('[data-entity="'+t.container+'"]');this.currentProductId=t.currentProductId;if(t.initiallyShowHeader){BX.ready(BX.delegate(this.showHeader,this))}if(t.deferredLoad){BX.ready(BX.delegate(this.deferredLoad,this))}BX.addCustomEvent("onCatalogStoreProductChange",BX.delegate(function(t){t=parseInt(t);if(this.currentProductId===t){return}this.currentProductId=t;this.offerChangedEvent()},this))};window.JCSaleProductsGiftComponent.prototype={offerChangedEvent:function(){this.sendRequest({action:"deferredLoad",offerId:this.currentProductId})},deferredLoad:function(){this.sendRequest({action:"deferredLoad"})},sendRequest:function(t){var e={siteId:this.siteId,template:this.template,parameters:this.parameters};BX.ajax({url:this.componentPath+"/ajax.php"+(document.location.href.indexOf("clear_cache=Y")!==-1?"?clear_cache=Y":""),method:"POST",dataType:"json",timeout:60,data:BX.merge(e,t),onsuccess:BX.delegate(function(e){if(!e||!e.JS){this.hideHeader();BX.cleanNode(this.container);return}BX.ajax.processScripts(BX.processHTML(e.JS).SCRIPT,false,BX.delegate(function(){this.showAction(e,t)},this))},this)})},showAction:function(t,e){if(!e)return;switch(e.action){case"deferredLoad":this.processDeferredLoadAction(t);break}},processDeferredLoadAction:function(t){if(!t)return;this.processItems(t.items)},processItems:function(t){if(!t)return;var e=BX.processHTML(t,false),i=BX.create("DIV");var a,n,r;i.innerHTML=e.HTML;r=this.container.querySelectorAll('[data-entity="items-row"]');if(r.length){BX.cleanNode(this.container);this.showHeader(false)}else{this.showHeader(true)}a=i.querySelectorAll('[data-entity="items-row"]');for(n in a){if(a.hasOwnProperty(n)){a[n].style.opacity=0;this.container.appendChild(a[n])}}new BX.easing({duration:2e3,start:{opacity:0}
16,finish:{opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:function(t){for(var e in a){if(a.hasOwnProperty(e)){a[e].style.opacity=t.opacity/100}}},complete:function(){for(var t in a){if(a.hasOwnProperty(t)){a[t].removeAttribute("style")}}}}).animate();BX.ajax.processScripts(e.SCRIPT)},showHeader:function(t){var e=BX.findParent(this.container,{attr:{"data-entity":"parent-container"}}),i;if(e&&BX.type.isDomNode(e)){i=e.querySelector('[data-entity="header"]');if(i&&i.getAttribute("data-showed")==="false"){i.style.display="";if(t){this.animation=new BX.easing({duration:2e3,start:{opacity:0},finish:{opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:function(t){i.style.opacity=t.opacity/100},complete:function(){i.removeAttribute("style");i.setAttribute("data-showed","true")}});this.animation.animate()}else{i.style.opacity=100}}}},hideHeader:function(){var t=BX.findParent(this.container,{attr:{"data-entity":"parent-container"}}),e;if(t&&BX.type.isDomNode(t)){e=t.querySelector('[data-entity="header"]');if(e){if(this.animation){this.animation.stop()}e.style.display="none";e.style.opacity=0;e.setAttribute("data-showed","false")}}}}})(); 17/* End */ 18; 19; /* Start:"a:4:{s:4:"full";s:99:"/local/templates/okoptica/components/bitrix/catalog.item/bootstrap_v4/script.min.js?177263889739736";s:6:"source";s:79:"/local/templates/okoptica/components/bitrix/catalog.item/bootstrap_v4/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 20(()=>{(function(c){"use strict";if(!c.JCCatalogItem){var u=function(t){u.superclass.constructor.apply(this,arguments),this.buttonNode=BX.create("button",{props:{className:"btn btn-primary btn-buy btn-sm",id:this.id},style:typeof t.style=="object"?t.style:{},text:t.text,events:this.contextEvents}),BX.browser.IsIE()&&this.buttonNode.setAttribute("hideFocus","hidefocus")};BX.extend(u,BX.PopupWindowButton),c.JCCatalogItem=function(t){if(this.productType=0,this.showQuantity=!0,this.showAbsent=!0,this.secondPict=!1,this.showOldPrice=!1,this.showMaxQuantity="N",this.relativeQuantityFactor=5,this.showPercent=!1,this.showSkuProps=!1,this.basketAction="ADD",this.showClosePopup=!1,this.useCompare=!1,this.showSubscription=!1,this.visual={ID:"",PICT_ID:"",SECOND_PICT_ID:"",PICT_SLIDER_ID:"",QUANTITY_ID:"",QUANTITY_UP_ID:"",QUANTITY_DOWN_ID:"",PRICE_ID:"",PRICE_OLD_ID:"",DSC_PERC:"",SECOND_DSC_PERC:"",DISPLAY_PROP_DIV:"",BASKET_PROP_DIV:"",SUBSCRIBE_ID:""},this.product={checkQuantity:!1,maxQuantity:0,stepQuantity:1,isDblQuantity:!1,canBuy:!0,name:"",pict:{},id:0,addUrl:"",buyUrl:""},this.basketMode="",this.basketData={useProps:!1,emptyProps:!1,quantity:"quantity",props:"prop",basketUrl:"",sku_props:"",sku_props_var:"basket_props",add_url:"",buy_url:""},this.compareData={compareUrl:"",compareDeleteUrl:"",comparePath:""},this.defaultPict={pict:null,secondPict:null},this.defaultSliderOptions={interval:3e3,wrap:!0},this.slider={options:{},items:[],active:null,sliding:null,paused:null,interval:null,progress:null},this.touch=null,this.quantityDelay=null,this.quantityTimer=null,this.checkQuantity=!1,this.maxQuantity=0,this.minQuantity=0,this.stepQuantity=1,this.isDblQuantity=!1,this.canBuy=!0,this.precision=6,this.precisionFactor=Math.pow(10,this.precision),this.bigData=!1,this.fullDisplayMode=!1,this.viewMode="",this.templateTheme="",this.currentPriceMode="",this.currentPrices=[],this.currentPriceSelected=0,this.currentQuantityRanges=[],this.currentQuantityRangeSelected=0,this.offers=[],this.offerNum=0,this.treeProps=[],this.selectedValues={},this.obProduct=null,this.blockNodes={},this.obQuantity=null,this.obQuantityUp=null,this.obQuantityDown=null,this.obQuantityLimit={},this.obPict=null,this.obSecondPict=null,this.obPictSlider=null,this.obPictSliderIndicator=null,this.obPrice=null,this.obTree=null,this.obBuyBtn=null,this.obBasketActions=null,this.obNotAvail=null,this.obSubscribe=null,this.obDscPerc=null,this.obSecondDscPerc=null,this.obSkuProps=null,this.obMeasure=null,this.obCompare=null,this.obPopupWin=null,this.basketUrl="",this.basketParams={},this.isTouchDevice=BX.hasClass(document.documentElement,"bx-touch"),this.hoverTimer=null,this.hoverStateChangeForbidden=!1,this.mouseX=null,this.mouseY=null,this.useEnhancedEcommerce=!1,this.dataLayerName="dataLayer",this.brandProperty=!1,this.errorCode=0,typeof t=="object"){switch(t.PRODUCT_TYPE&&(this.productType=parseInt(t.PRODUCT_TYPE,10)),this.showQuantity=t.SHOW_QUANTITY,this.showAb
20sent=t.SHOW_ABSENT,this.secondPict=t.SECOND_PICT,this.showOldPrice=t.SHOW_OLD_PRICE,this.showMaxQuantity=t.SHOW_MAX_QUANTITY,this.relativeQuantityFactor=parseInt(t.RELATIVE_QUANTITY_FACTOR),this.showPercent=t.SHOW_DISCOUNT_PERCENT,this.showSkuProps=t.SHOW_SKU_PROPS,this.showSubscription=t.USE_SUBSCRIBE,t.ADD_TO_BASKET_ACTION&&(this.basketAction=t.ADD_TO_BASKET_ACTION),this.showClosePopup=t.SHOW_CLOSE_POPUP,this.useCompare=t.DISPLAY_COMPARE,this.fullDisplayMode=t.PRODUCT_DISPLAY_MODE==="Y",this.bigData=t.BIG_DATA,this.viewMode=t.VIEW_MODE||"",this.templateTheme=t.TEMPLATE_THEME||"",this.useEnhancedEcommerce=t.USE_ENHANCED_ECOMMERCE==="Y",this.dataLayerName=t.DATA_LAYER_NAME,this.brandProperty=t.BRAND_PROPERTY,this.visual=t.VISUAL,this.productType){case 0:case 1:case 2:t.PRODUCT&&typeof t.PRODUCT=="object"?(this.currentPriceMode=t.PRODUCT.ITEM_PRICE_MODE,this.currentPrices=t.PRODUCT.ITEM_PRICES,this.currentPriceSelected=t.PRODUCT.ITEM_PRICE_SELECTED,this.currentQuantityRanges=t.PRODUCT.ITEM_QUANTITY_RANGES,this.currentQuantityRangeSelected=t.PRODUCT.ITEM_QUANTITY_RANGE_SELECTED,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.stepQuantity=this.product.stepQuantity,this.maxQuantity=this.product.maxQuantity,this.minQuantity=this.currentPriceMode==="Q"?parseFloat(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity,this.isDblQuantity&&(this.stepQuantity=Math.round(this.stepQuantity*this.precisionFactor)/this.precisionFactor)),this.product.canBuy=t.PRODUCT.CAN_BUY,t.PRODUCT.MORE_PHOTO_COUNT&&(this.product.morePhotoCount=t.PRODUCT.MORE_PHOTO_COUNT,this.product.morePhoto=t.PRODUCT.MORE_PHOTO),t.PRODUCT.RCM_ID&&(this.product.rcmId=t.PRODUCT.RCM_ID),this.canBuy=this.product.canBuy,this.product.name=t.PRODUCT.NAME,this.product.pict=t.PRODUCT.PICT,this.product.id=t.PRODUCT.ID,this.product.DETAIL_PAGE_URL=t.PRODUCT.DETAIL_PAGE_URL,t.PRODUCT.ADD_URL&&(this.product.addUrl=t.PRODUCT.ADD_URL),t.PRODUCT.BUY_URL&&(this.product.buyUrl=t.PRODUCT.BUY_URL),t.BASKET&&typeof t.BASKET=="object"&&(this.basketData.useProps=t.BASKET.ADD_PROPS,this.basketData.emptyProps=t.BASKET.EMPTY_PROPS)):this.errorCode=-1;break;case 3:t.PRODUCT&&typeof t.PRODUCT=="object"&&(this.product.name=t.PRODUCT.NAME,this.product.id=t.PRODUCT.ID,this.product.DETAIL_PAGE_URL=t.PRODUCT.DETAIL_PAGE_URL,this.product.morePhotoCount=t.PRODUCT.MORE_PHOTO_COUNT,this.product.morePhoto=t.PRODUCT.MORE_PHOTO,t.PRODUCT.RCM_ID&&(this.product.rcmId=t.PRODUCT.RCM_ID)),t.OFFERS&&BX.type.isArray(t.OFFERS)&&(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));break;default:this.errorCode=-1}t.BASKET&&typeof t.BASKET=="object"&&(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.productType===3&&t.BASKET.SKU_PROPS&&(this.basketData.sku_props=t.BASKET.SKU_PROPS),t.BASKET.ADD_URL_TEMPLATE&&(this.basketData.add_url=t.BASKET.ADD_URL_TEMPLATE),t.BASKET.BUY_URL_TEMPLATE&&(this.basketData.buy_url=t.BASKET.BUY_URL_TEMPLATE),this.basketData.add_url===""&&this.basketData.buy_url===""&&(this.errorCode=-1024)),this.useCompare&&(t.COMPARE&&typeof t.COMPARE=="object"?(t.COMPARE.COMPARE_PATH&&(this.compareData.comparePath=t.COMPARE.COMPARE_PATH),t.COMPARE.COMPARE_URL_TEMPLATE?this.compareData.compareUrl=t.COMPARE.COMPARE_URL_TEMPLATE:this.useCompare=!1,t.COMPARE.COMPARE_DELETE_URL_TEMPLATE?this.compareData.compareDeleteUrl=t.COMPARE.COMPARE_DELETE_URL_TEMPLATE:this.useCompare=!1):this.useCompare=!1)}this.errorCode===0&&BX.ready(BX.delegate(this.init,this))},c.JCCatalogItem.prototype={init:function(){var t=0,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.obPictSlider=BX(this.visual.PICT_SLIDER_ID),this.obPictSliderIndicator=BX(this.visual.PICT_SLIDER_ID+"_indicator"),this.obPictSliderProgressBar=BX(this.visual.PICT_SLIDER_ID+"_progress_bar"),this.obPictSlider||(this.errorCode=-4),this.obPrice=BX(this.visual.PRICE_ID),this.obPriceOld=BX(this.visual.PRICE_OLD_ID),this.obPriceTotal=BX(this.visual.PRICE_TOTAL_ID),this.obPrice||(this.errorCode=-16),this.showQuantity&&this.visual.QUANTITY_ID&&(this.obQuantity=BX(this.visual.QUANTITY_ID),this.blockNodes.quantity=this.obProduct.querySelector('[data-entity="quantity-block"]'),this.isTouchDevice||(BX.bind(this.obQuantity,"focus",BX.proxy(this.onFocus,this)),BX.bind(this.obQuantity,"blur",BX.proxy(this.onBlur,this))),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))),this.visual.QUANTITY_LIMIT&&this.showMaxQuantity!=="N"&&(this.obQuantityLimit.all=BX(this.visual.QUANTITY_LIMIT),this.obQuantityLimit.all&&(this.obQuantityLimit.value=this.obQuantityLimit.all.querySelector('[data-entity="quantity-limit-value"]'),this.obQuantityLimit.value||(this.obQuantityLimit.all=null))),this.productType===3&&this.fullDisplayMode&&(this.visual.TREE_ID&&(this.obTree=BX(this.visual.TREE_ID),this.obTree||(this.errorCode=-256)),this.visual.QUANTITY_MEASURE&&(this.obMeasure=BX(this.visual.QUANTITY_MEASURE))),this.obBasketActions=BX(this.visual.BASKET_ACTIONS_ID),this.obBasketActions&&this.visual.BUY_ID&&(this.obBuyBtn=BX(this.visual.BUY_ID)),this.obNotAvail=BX(this.visual.NOT_AVAILABLE_MESS),this.showSubscription&&(this.obSubscribe=BX(this.visual.SUBSCRIBE_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)),this.errorCode===0){if(this.isTouchDevice?(BX.bind(this.obPictSlider,"touchstart",BX.proxy(this.touchStartEvent,this)),BX.bind(this.obPictSlider,"touchend",BX.proxy(this.touchEndEvent,this)),BX.bind(this.obPictSlider,"touchcancel",BX.proxy(this.touchEndEvent,this))):(this.viewMode==="CARD"&&(BX.bind(this.obProduct,"mouseenter",BX.proxy(this.hoverOn,this)),BX.bind(this.obProduct,"mouseleave",BX.proxy(this.hoverOff,this))),BX.bind(this.obProduct,"mouseenter",BX.proxy(this.cycleSlider,this)),BX.bind(this.obProduct,"mouseleave",BX.proxy(this.stopSlider,this))),this.bigData){var e=BX.findChildren(this.obProduct,{tag:"a"},!0);if(e)for(t in e)e.hasOwnProperty(t)&&e[t].getAttribute("href")==this.product.DETAIL_PAGE_URL&&BX.bind(e[t],"click",BX.proxy(this.rememberProductRecommendation,this))}if(this.showQuantity){var s=this.isTouchDevice?"touchstart":"mousedown",o=this.isTouchDevice?"touchend":"mou
20seup";this.obQuantityUp&&(BX.bind(this.obQuantityUp,s,BX.proxy(this.startQuantityInterval,this)),BX.bind(this.obQuantityUp,o,BX.proxy(this.clearQuantityInterval,this)),BX.bind(this.obQuantityUp,"mouseout",BX.proxy(this.clearQuantityInterval,this)),BX.bind(this.obQuantityUp,"click",BX.delegate(this.quantityUp,this))),this.obQuantityDown&&(BX.bind(this.obQuantityDown,s,BX.proxy(this.startQuantityInterval,this)),BX.bind(this.obQuantityDown,o,BX.proxy(this.clearQuantityInterval,this)),BX.bind(this.obQuantityDown,"mouseout",BX.proxy(this.clearQuantityInterval,this)),BX.bind(this.obQuantityDown,"click",BX.delegate(this.quantityDown,this))),this.obQuantity&&BX.bind(this.obQuantity,"change",BX.delegate(this.quantityChange,this))}switch(this.productType){case 0:case 1:case 2:parseInt(this.product.morePhotoCount)>1&&this.obPictSlider&&this.initializeSlider(),this.checkQuantityControls();break;case 3:if(this.offers.length>0){if(i=BX.findChildren(this.obTree,{tagName:"li"},!0),i&&i.length)for(t=0;t<i.length;t++)BX.bind(i[t],"click",BX.delegate(this.selectOfferProp,this));this.setCurrent()}else parseInt(this.product.morePhotoCount)>1&&this.obPictSlider&&this.initializeSlider();break}this.obBuyBtn&&(this.basketAction==="ADD"?BX.bind(this.obBuyBtn,"click",BX.proxy(this.add2Basket,this)):BX.bind(this.obBuyBtn,"click",BX.proxy(this.buyBasket,this))),this.useCompare&&(this.obCompare=BX(this.visual.COMPARE_LINK_ID),this.obCompare&&BX.bind(this.obCompare,"click",BX.proxy(this.compare,this)),BX.addCustomEvent("onCatalogDeleteCompare",BX.proxy(this.checkDeletedCompare,this)))}},setAnalyticsDataLayer:function(t){if(!(!this.useEnhancedEcommerce||!this.dataLayerName)){var i={},e={},s=[],o,r,h,a,l,n;switch(this.productType){case 0:case 1:case 2:i={id:this.product.id,name:this.product.name,price:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].PRICE,brand:BX.type.isArray(this.brandProperty)?this.brandProperty.join("/"):this.brandProperty};break;case 3:for(o in this.offers[this.offerNum].TREE)if(this.offers[this.offerNum].TREE.hasOwnProperty(o)){a=o.substring(5),l=this.offers[this.offerNum].TREE[o];for(r in this.treeProps)if(this.treeProps.hasOwnProperty(r)&&this.treeProps[r].ID==a){for(h in this.treeProps[r].VALUES)if(n=this.treeProps[r].VALUES[h],n.ID==l){s.push(n.NAME);break}}}i={id:this.offers[this.offerNum].ID,name:this.offers[this.offerNum].NAME,price:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].PRICE,brand:BX.type.isArray(this.brandProperty)?this.brandProperty.join("/"):this.brandProperty,variant:s.join("/")};break}switch(t){case"addToCart":e={event:"addToCart",ecommerce:{currencyCode:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].CURRENCY||"",add:{products:[{name:i.name||"",id:i.id||"",price:i.price||0,brand:i.brand||"",category:i.category||"",variant:i.variant||"",quantity:this.showQuantity&&this.obQuantity?this.obQuantity.value:1}]}}};break}c[this.dataLayerName]=c[this.dataLayerName]||[],c[this.dataLayerName].push(e)}},hoverOn:function(t){clearTimeout(this.hoverTimer),this.obProduct.style.height=getComputedStyle(this.obProduct).height,BX.addClass(this.obProduct,"hover"),BX.PreventDefault(t)},hoverOff:function(t){this.hoverStateChangeForbidden||(BX.removeClass(this.obProduct,"hover"),this.hoverTimer=setTimeout(BX.delegate(function(){this.obProduct.style.height="auto"},this),300),BX.PreventDefault(t))},onFocus:function(){this.hoverStateChangeForbidden=!0,BX.bind(document,"mousemove",BX.proxy(this.captureMousePosition,this))},onBlur:function(){this.hoverStateChangeForbidden=!1,BX.unbind(document,"mousemove",BX.proxy(this.captureMousePosition,this));var t=document.elementFromPoint(this.mouseX,this.mouseY);(!t||!this.obProduct.contains(t))&&this.hoverOff()},captureMousePosition:function(t){this.mouseX=t.clientX,this.mouseY=t.clientY},getCookie:function(t){var i=document.cookie.match(new RegExp("(?:^|; )"+t.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return i?decodeURIComponent(i[1]):null},rememberProductRecommendation:function(){var t=BX.cookie_prefix+"_RCM_PRODUCT_LOG",i=this.getCookie(t),e=!1,s=[],o;i&&(s=i.split("."));for(var r=s.length;r--;)o=s[r].split("-"),o[0]==this.product.id?(o=s[r].split("-"),o[1]=this.product.rcmId,o[2]=BX.current_server_time,s[r]=o.join("-"),e=!0):BX.current_server_time-o[2]>3600*24*30&&s.splice(r,1);e||s.push([this.product.id,this.product.rcmId,BX.current_server_time].join("-"));var h=s.join("."),a=new Date(new Date().getTime()+1e3*3600*24*365*10).toUTCString();document.cookie=t+"="+h+"; path=/; expires="+a+"; domain="+BX.cookie_domain},startQuantityInterval:function(){var t=BX.proxy_context,i=t.id===this.visual.QUANTITY_DOWN_ID?BX.proxy(this.quantityDown,this):BX.proxy(this.quantityUp,this);this.quantityDelay=setTimeout(BX.delegate(function(){this.quantityTimer=setInterval(i,150)},this),300)},clearQuantityInterval:function(){clearTimeout(this.quantityDelay),clearInterval(this.quantityTimer)},quantityUp:function(){var t=0,i=!0;this.errorCode===0&&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&&(i=!1),i&&(this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t,this.setPrice())))},quantityDown:function(){var t=0,i=!0;this.errorCode===0&&this.showQuantity&&this.canBuy&&(t=this.isDblQuantity?parseFloat(this.obQuantity.value):parseInt(this.obQuantity.value,10),isNaN(t)||(t-=this.stepQuantity,this.checkPriceRange(t),t<this.minQuantity&&(i=!1),i&&(this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t,this.setPrice())))},quantityChange:function(){var t=0,i;this.errorCode===0&&this.showQuantity&&(this.canBuy?(t=this.isDblQuantity?parseFloat(this.obQuantity.value):Math.round(this.obQuantity.value),isNaN(t)?this.obQuantity.value=this.minQuantity:(this.checkQuantity&&t>this.maxQuantity&&(t=this.maxQuantity),this.checkPriceRange(t),i=Math.floor(Math.round(t*this.precisionFactor/this.stepQuantity)/this.precisionFactor)||1,t=i<=1?this.stepQuantity:i*this.stepQuantity,t=Math.round(t*this.precisionFactor)/this.precisionFactor,t<this.minQuantity&&(t=this.minQuantity),this.obQuantity.value=t)):this.obQuantity.value=this.minQuantity,this.setPrice())},quantitySet:function(t){var i,e,s=this.offers[t],o=this.offers[this.offerNum];
20if(this.errorCode===0){if(this.canBuy=s.CAN_BUY,this.currentPriceMode=s.ITEM_PRICE_MODE,this.currentPrices=s.ITEM_PRICES,this.currentPriceSelected=s.ITEM_PRICE_SELECTED,this.currentQuantityRanges=s.ITEM_QUANTITY_RANGES,this.currentQuantityRangeSelected=s.ITEM_QUANTITY_RANGE_SELECTED,this.canBuy?(this.blockNodes.quantity&&BX.style(this.blockNodes.quantity,"display",""),this.obBasketActions&&BX.style(this.obBasketActions,"display",""),this.obNotAvail&&BX.style(this.obNotAvail,"display","none"),this.obSubscribe&&BX.style(this.obSubscribe,"display","none")):(this.blockNodes.quantity&&BX.style(this.blockNodes.quantity,"display","none"),this.obBasketActions&&BX.style(this.obBasketActions,"display","none"),this.obNotAvail&&BX.style(this.obNotAvail,"display",""),this.obSubscribe&&(s.CATALOG_SUBSCRIBE==="Y"?(BX.style(this.obSubscribe,"display",""),this.obSubscribe.setAttribute("data-item",s.ID),BX(this.visual.SUBSCRIBE_ID+"_hidden").click()):BX.style(this.obSubscribe,"display","none"))),this.isDblQuantity=s.QUANTITY_FLOAT,this.checkQuantity=s.CHECK_QUANTITY,this.isDblQuantity?(this.stepQuantity=Math.round(parseFloat(s.STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor,this.maxQuantity=parseFloat(s.MAX_QUANTITY),this.minQuantity=this.currentPriceMode==="Q"?parseFloat(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity):(this.stepQuantity=parseInt(s.STEP_QUANTITY,10),this.maxQuantity=parseInt(s.MAX_QUANTITY,10),this.minQuantity=this.currentPriceMode==="Q"?parseInt(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity),this.showQuantity){var r=o.ITEM_PRICES.length&&o.ITEM_PRICES[o.ITEM_PRICE_SELECTED]&&o.ITEM_PRICES[o.ITEM_PRICE_SELECTED].MIN_QUANTITY!=this.minQuantity;this.isDblQuantity?i=Math.round(parseFloat(o.STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor!==this.stepQuantity||r||o.MEASURE!==s.MEASURE||this.checkQuantity&&parseFloat(o.MAX_QUANTITY)>this.maxQuantity&&parseFloat(this.obQuantity.value)>this.maxQuantity:i=parseInt(o.STEP_QUANTITY,10)!==this.stepQuantity||r||o.MEASURE!==s.MEASURE||this.checkQuantity&&parseInt(o.MAX_QUANTITY,10)>this.maxQuantity&&parseInt(this.obQuantity.value,10)>this.maxQuantity,this.obQuantity.disabled=!this.canBuy,i&&(this.obQuantity.value=this.minQuantity),this.obMeasure&&(s.MEASURE?BX.adjust(this.obMeasure,{html:s.MEASURE}):BX.adjust(this.obMeasure,{html:""}))}this.obQuantityLimit.all&&(!this.checkQuantity||this.maxQuantity==0?(BX.adjust(this.obQuantityLimit.value,{html:""}),BX.adjust(this.obQuantityLimit.all,{style:{display:"none"}})):(this.showMaxQuantity==="M"?e=this.maxQuantity/this.stepQuantity>=this.relativeQuantityFactor?BX.message("RELATIVE_QUANTITY_MANY"):BX.message("RELATIVE_QUANTITY_FEW"):(e=this.maxQuantity,s.MEASURE&&(e+=" "+s.MEASURE)),BX.adjust(this.obQuantityLimit.value,{html:e}),BX.adjust(this.obQuantityLimit.all,{style:{display:""}})))}},initializeSlider:function(){var t=this.obPictSlider.getAttribute("data-slider-wrap");if(t?this.slider.options.wrap=t==="true":this.slider.options.wrap=this.defaultSliderOptions.wrap,this.isTouchDevice)this.slider.options.interval=!1;else{if(this.slider.options.interval=parseInt(this.obPictSlider.getAttribute("data-slider-interval"))||this.defaultSliderOptions.interval,this.slider.options.interval<700&&(this.slider.options.interval=700),this.obPictSliderIndicator){var i=this.obPictSliderIndicator.querySelectorAll("[data-go-to]");for(var e in i)i.hasOwnProperty(e)&&BX.bind(i[e],"click",BX.proxy(this.sliderClickHandler,this))}this.obPictSliderProgressBar&&(this.slider.progress?(this.resetProgress(),this.cycleSlider()):this.slider.progress=new BX.easing({transition:BX.easing.transitions.linear,step:BX.delegate(function(s){this.obPictSliderProgressBar.style.width=s.width/10+"%"},this)}))}},checkTouch:function(t){return!t||!t.changedTouches?!1:t.changedTouches[0].identifier===this.touch.identifier},touchStartEvent:function(t){t.touches.length==1&&(this.touch=t.changedTouches[0])},touchEndEvent:function(t){if(this.checkTouch(t)){var i=this.touch.pageX-t.changedTouches[0].pageX,e=this.touch.pageY-t.changedTouches[0].pageY;Math.abs(i)>=Math.abs(e)+10&&(i>0&&this.slideNext(),i<0&&this.slidePrev())}},sliderClickHandler:function(t){var i=BX.getEventTarget(t),e=i.getAttribute("data-go-to");e&&this.slideTo(e),BX.PreventDefault(t)},slideNext:function(){if(!this.slider.sliding)return this.slide("next")},slidePrev:function(){if(!this.slider.sliding)return this.slide("prev")},slideTo:function(t){this.slider.active=BX.findChild(this.obPictSlider,{className:"item active"},!0,!1),this.slider.progress&&(this.slider.interval=!0);var i=this.getItemIndex(this.slider.active);if(!(t>this.slider.items.length-1||t<0)){if(this.slider.sliding)return!1;if(i==t){this.stopSlider(),this.cycleSlider();return}return this.slide(t>i?"next":"prev",this.eq(this.slider.items,t))}},slide:function(t,i){var e=BX.findChild(this.obPictSlider,{className:"item active"}
20,!0,!1),s=this.slider.interval,o=t==="next"?"left":"right";if(i=i||this.getItemForDirection(t,e),BX.hasClass(i,"active"))return this.slider.sliding=!1;if(this.slider.sliding=!0,s&&this.stopSlider(),this.obPictSliderIndicator){BX.removeClass(this.obPictSliderIndicator.querySelector(".active"),"active");var r=this.obPictSliderIndicator.querySelectorAll("[data-go-to]")[this.getItemIndex(i)];r&&BX.addClass(r,"active")}if(BX.hasClass(this.obPictSlider,"slide")&&!BX.browser.IsIE()){var h=this;BX.addClass(i,t),i.offsetWidth,BX.addClass(e,o),BX.addClass(i,o),setTimeout(function(){BX.addClass(i,"active"),BX.removeClass(e,"active"),BX.removeClass(e,o),BX.removeClass(i,t),BX.removeClass(i,o),h.slider.sliding=!1},700)}else BX.addClass(i,"active"),this.slider.sliding=!1;this.obPictSliderProgressBar&&this.resetProgress(),s&&this.cycleSlider()},stopSlider:function(t){if(t||(this.slider.paused=!0),this.slider.interval&&clearInterval(this.slider.interval),this.slider.progress){this.slider.progress.stop();var i=parseInt(this.obPictSliderProgressBar.style.width);this.slider.progress.options.duration=this.slider.options.interval*i/200,this.slider.progress.options.start={width:i*10},this.slider.progress.options.finish={width:0},this.slider.progress.options.complete=null,this.slider.progress.animate()}},cycleSlider:function(t){if(t||(this.slider.paused=!1),this.slider.interval&&clearInterval(this.slider.interval),this.slider.options.interval&&!this.slider.paused)if(this.slider.progress){this.slider.progress.stop();var i=parseInt(this.obPictSliderProgressBar.style.width);this.slider.progress.options.duration=this.slider.options.interval*(100-i)/100,this.slider.progress.options.start={width:i*10},this.slider.progress.options.finish={width:1e3},this.slider.progress.options.complete=BX.delegate(function(){this.slider.interval=!0,this.slideNext()},this),this.slider.progress.animate()}else this.slider.interval=setInterval(BX.proxy(this.slideNext,this),this.slider.options.interval)},resetProgress:function(){this.slider.progress&&this.slider.progress.stop(),this.obPictSliderProgressBar.style.width=0},getItemForDirection:function(t,i){var e=this.getItemIndex(i),s=t==="prev"&&e===0||t==="next"&&e==this.slider.items.length-1;if(s&&!this.slider.options.wrap)return i;var o=t==="prev"?-1:1,r=(e+o)%this.slider.items.length;return this.eq(this.slider.items,r)},getItemIndex:function(t){return this.slider.items=BX.findChildren(t.parentNode,{className:"item"},!0),this.slider.items.indexOf(t||this.slider.active)},eq:function(t,i){var e=t.length,s=+i+(i<0?e:0);return s>=0&&s<e?t[s]:{}},selectOfferProp:function(){var t=0,i="",e="",s=[],o=null,r=BX.proxy_context;if(r&&r.hasAttribute("data-treevalue")){if(BX.hasClass(r,"selected"))return;if(e=r.getAttribute("data-treevalue"),s=e.split("_"),this.searchOfferPropIndex(s[0],s[1])&&(o=BX.findChildren(r.parentNode,{tagName:"li"},!1),o&&0<o.length))for(t=0;t<o.length;t++)i=o[t].getAttribute("data-onevalue"),i===s[1]?BX.addClass(o[t],"selected"):BX.removeClass(o[t],"selected")}},searchOfferPropIndex:function(t,i){var e="",s=!1,o,r,h=[],a=[],l=-1,n={},d=[];for(o=0;o<this.treeProps.length;o++)if(this.treeProps[o].ID===t){l=o;break}if(-1<l){for(o=0;o<l;o++)e="PROP_"+this.treeProps[o].ID,n[e]=this.selectedValues[e];if(e="PROP_"+this.treeProps[l].ID,s=this.getRowValues(n,e),!s||!BX.util.in_array(i,s))return!1;for(n[e]=i,o=l+1;o<this.treeProps.length;o++){if(e="PROP_"+this.treeProps[o].ID,s=this.getRowValues(n,e),!s)return!1;if(a=[],this.showAbsent)for(h=[],d=[],d=BX.clone(n,!0),r=0;r<s.length;r++)d[e]=s[r],a[a.length]=s[r],this.getCanBuy(d)&&(h[h.length]=s[r]);else h=s;this.selectedValues[e]&&BX.util.in_array(this.selectedValues[e],h)?n[e]=this.selectedValues[e]:this.showAbsent?n[e]=h.length>0?h[0]:a[0]:n[e]=h[0],this.updateRow(o,n[e],s,h)}this.selectedValues=n,this.changeInfo()}return!0},updateRow:function(t,i,e,s){var o=0,r="",h=!1,a=null,l=this.obTree.querySelectorAll('[data-entity="sku-line-block"]'),n;if(t>-1&&t<l.length&&(n=l[t].querySelector("ul"),a=BX.findChildren(n,{tagName:"li"},!1),a&&0<a.length))for(o=0;o<a.length;o++)r=a[o].getAttribute("data-onevalue"),h=r===i,h?BX.addClass(a[o],"selected"):BX.removeClass(a[o],"selected"),BX.util.in_array(r,s)?BX.removeClass(a[o],"notallowed"):BX.addClass(a[o],"notallowed"),a[o].style.display=BX.util.in_array(r,e)?"":"none",h&&(l[t].style.display=r==0&&s.length==1?"none":"")},getRowValues:function(t,i){var e=0,s,o=[],r=!1,h=!0;if(t.length===0){for(e=0;e<this.offers.length;e++)BX.util.in_array(this.offers[e].TREE[i],o)||(o[o.length]=this.offers[e].TREE[i]);r=!0}else for(e=0;e<this.offers.length;e++){h=!0;for(s in t)if(t[s]!==this.offers[e].TREE[s]){h=!1;break}h&&(BX.util.in_array(this.offers[e].TREE[i],o)||(o[o.length]=this.offers[e].TREE[i]),r=!0)}return r?o:!1},getCanBuy:function(t){var i,e,s=!1,o=!0;for(i=0;i<this.offers.length;i++){o=!0;for(e in t)if(t[e]!==this.offers[i].TREE[e]){o=!1;break}if(o&&this.offers[i].CAN_BUY){s=!0;break}}return s},setCurrent:function(){var t,i=0,e=[],s="",o=!1,r={},h=[],a=this.offers[this.offerNum].TREE;for(t=0;t<this.treeProps.length&&(s="PROP_"+this.treeProps[t].ID,o=this.getRowValues(r,s),!!o);t++){if(BX.util.in_array(a[s],o)?r[s]=a[s]:(r[s]=o[0],this.offerNum=0),this.showAb
20sent)for(e=[],h=[],h=BX.clone(r,!0),i=0;i<o.length;i++)h[s]=o[i],this.getCanBuy(h)&&(e[e.length]=o[i]);else e=o;this.updateRow(t,r[s],o,e)}this.selectedValues=r,this.changeInfo()},changeInfo:function(){var t,i,e=-1,s=!0,o;for(t=0;t<this.offers.length;t++){s=!0;for(i in this.selectedValues)if(this.selectedValues[i]!==this.offers[t].TREE[i]){s=!1;break}if(s){e=t;break}}if(e>-1){if(parseInt(this.offers[e].MORE_PHOTO_COUNT)>1&&this.obPictSlider){this.obPict&&(this.obPict.style.display="none"),this.obSecondPict&&(this.obSecondPict.style.display="none"),BX.cleanNode(this.obPictSlider);for(t in this.offers[e].MORE_PHOTO)this.offers[e].MORE_PHOTO.hasOwnProperty(t)&&this.obPictSlider.appendChild(BX.create("SPAN",{props:{className:"product-item-image-slide item"+(t==0?" active":"")},style:{backgroundImage:"url('"+this.offers[e].MORE_PHOTO[t].SRC+"')"}}));if(this.obPictSliderIndicator){BX.cleanNode(this.obPictSliderIndicator);for(t in this.offers[e].MORE_PHOTO)this.offers[e].MORE_PHOTO.hasOwnProperty(t)&&(this.obPictSliderIndicator.appendChild(BX.create("DIV",{attrs:{"data-go-to":t},props:{className:"product-item-image-slider-control"+(t==0?" active":"")}})),this.obPictSliderIndicator.appendChild(document.createTextNode(" ")));this.obPictSliderIndicator.style.display=""}this.obPictSliderProgressBar&&(this.obPictSliderProgressBar.style.display=""),this.obPictSlider.style.display="",this.initializeSlider()}else this.obPictSlider&&(this.obPictSlider.style.display="none"),this.obPictSliderIndicator&&(this.obPictSliderIndicator.style.display="none"),this.obPictSliderProgressBar&&(this.obPictSliderProgressBar.style.display="none"),this.obPict&&(this.offers[e].PREVIEW_PICTURE?BX.adjust(this.obPict,{style:{backgroundImage:"url('"+this.offers[e].PREVIEW_PICTURE.SRC+"')"}}):BX.adjust(this.obPict,{style:{backgroundImage:"url('"+this.defaultPict.pict.SRC+"')"}}),this.obPict.style.display=""),this.secondPict&&this.obSecondPict&&(this.offers[e].PREVIEW_PICTURE_SECOND?BX.adjust(this.obSecondPict,{style:{backgroundImage:"url('"+this.offers[e].PREVIEW_PICTURE_SECOND.SRC+"')"}}):this.offers[e].PREVIEW_PICTURE.SRC?BX.adjust(this.obSecondPict,{style:{backgroundImage:"url('"+this.offers[e].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.obSecondPict.style.display="");this.showSkuProps&&this.obSkuProps&&(this.offers[e].DISPLAY_PROPERTIES.length?BX.adjust(this.obSkuProps,{style:{display:""},html:this.offers[e].DISPLAY_PROPERTIES}):BX.adjust(this.obSkuProps,{style:{display:"none"},html:""})),this.quantitySet(e),this.setPrice(),this.setCompared(this.offers[e].COMPARED),this.offerNum=e}},checkPriceRange:function(t){if(!(typeof t=="undefined"||this.currentPriceMode!="Q")){var i,e=!1;for(var s in this.currentQuantityRanges)if(this.currentQuantityRanges.hasOwnProperty(s)&&(i=this.currentQuantityRanges[s],parseInt(t)>=parseInt(i.SORT_FROM)&&(i.SORT_TO=="INF"||parseInt(t)<=parseInt(i.SORT_TO)))){e=!0,this.currentQuantityRangeSelected=i.HASH;break}!e&&(i=this.getMinPriceRange())&&(this.currentQuantityRangeSelected=i.HASH);for(var o in this.currentPrices)if(this.currentPrices.hasOwnProperty(o)&&this.currentPrices[o].QUANTITY_HASH==this.currentQuantityRangeSelected){this.currentPriceSelected=o;break}}},getMinPriceRange:function(){var t;for(var i in this.currentQuantityRanges)this.currentQuantityRanges.hasOwnProperty(i)&&(!t||parseInt(this.currentQuantityRanges[i].SORT_FROM)<parseInt(t.SORT_FROM))&&(t=this.currentQuantityRanges[i]);return t},checkQuantityControls:function(){if(this.obQuantity){var t=this.checkQuantity&&parseFloat(this.obQuantity.value)+this.stepQuantity>this.maxQuantity,i=parseFloat(this.obQuantity.value)-this.stepQuantity<this.minQuantity;t?BX.addClass(this.obQuantityUp,"product-item-amount-field-btn-disabled"):BX.hasClass(this.obQuantityUp,"product-item-amount-field-btn-disabled")&&BX.removeClass(this.obQuantityUp,"product-item-amount-field-btn-disabled"),i?BX.addClass(this.obQuantityDown,"product-item-amount-field-btn-disabled"):BX.hasClass(this.obQuantityDown,"product-item-amount-field-btn-disabled")&&BX.removeClass(this.obQuantityDown,"product-item-amount-field-btn-disabled"),t&&i?this.obQuantity.setAttribute("disabled","disabled"):this.obQuantity.removeAttribute("disabled")}},setPrice:function(){var t,i;this.obQuantity&&this.checkPriceRange(this.obQuantity.value),this.checkQuantityControl
20s(),i=this.currentPrices[this.currentPriceSelected],this.obPrice&&(i?BX.adjust(this.obPrice,{html:BX.Currency.currencyFormat(i.RATIO_PRICE,i.CURRENCY,!0)}):BX.adjust(this.obPrice,{html:""}),this.showOldPrice&&this.obPriceOld&&(i&&i.RATIO_PRICE!==i.RATIO_BASE_PRICE?BX.adjust(this.obPriceOld,{style:{display:""},html:BX.Currency.currencyFormat(i.RATIO_BASE_PRICE,i.CURRENCY,!0)}):BX.adjust(this.obPriceOld,{style:{display:"none"},html:""})),this.obPriceTotal&&(i&&this.obQuantity&&this.obQuantity.value!=this.stepQuantity?BX.adjust(this.obPriceTotal,{html:BX.message("PRICE_TOTAL_PREFIX")+" <strong>"+BX.Currency.currencyFormat(i.PRICE*this.obQuantity.value,i.CURRENCY,!0)+"</strong>",style:{display:""}}):BX.adjust(this.obPriceTotal,{html:"",style:{display:"none"}})),this.showPercent&&(i&&parseInt(i.DISCOUNT)>0?t={style:{display:""},html:-i.PERCENT+"%"}:t={style:{display:"none"},html:""},this.obDscPerc&&BX.adjust(this.obDscPerc,t),this.obSecondDscPerc&&BX.adjust(this.obSecondDscPerc,t)))},compare:function(t){var i=this.obCompare.querySelector('[data-entity="compare-checkbox"]'),e=BX.getEventTarget(t),s=!0;i&&(s=e===i?i.checked:!i.checked);var o=s?this.compareData.compareUrl:this.compareData.compareDeleteUrl,r;if(o){switch(e!==i&&(BX.PreventDefault(t),this.setCompared(s)),this.productType){case 0:case 1:case 2:r=o.replace("#ID#",this.product.id.toString());break;case 3:r=o.replace("#ID#",this.offers[this.offerNum].ID);break}BX.ajax({method:"POST",dataType:s?"json":"html",url:r+(r.indexOf("?")!==-1?"&":"?")+"ajax_action=Y",onsuccess:s?BX.proxy(this.compareResult,this):BX.proxy(this.compareDeleteResult,this)})}},compareResult:function(t){var i,e;this.obPopupWin&&this.obPopupWin.close(),BX.type.isPlainObject(t)&&(this.initPopupWindow(),this.offers.length>0&&(this.offers[this.offerNum].COMPARED=t.STATUS==="OK"),t.STATUS==="OK"?(BX.onCustomEvent("OnCompareChange"),i='<div style="width: 100%; margin: 0; text-align: center;"><p>'+BX.message("COMPARE_MESSAGE_OK")+"</p></div>",this.showClosePopup?e=[new u({text:BX.message("BTN_MESSAGE_COMPARE_REDIRECT"),events:{click:BX.delegate(this.compareRedirect,this)},style:{marginRight:"10px"}}),new u({text:BX.message("BTN_MESSAGE_CLOSE_POPUP"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]:e=[new u({text:BX.message("BTN_MESSAGE_COMPARE_REDIRECT"),events:{click:BX.delegate(this.compareRedirect,this)}})]):(i='<div style="width: 100%; margin: 0; text-align: center;"><p>'+(t.MESSAGE?t.MESSAGE:BX.message("COMPARE_UNKNOWN_ERROR"))+"</p></div>",e=[new u({text:BX.message("BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]),this.obPopupWin.setTitleBar(BX.message("COMPARE_TITLE")),this.obPopupWin.setContent(i),this.obPopupWin.setButtons(e),this.obPopupWin.show())},compareDeleteResult:function(){BX.onCustomEvent("OnCompareChange"),this.offers&&this.offers.length&&(this.offers[this.offerNum].COMPARED=!1)},setCompared:function(t){if(this.obCompare){var i=this.obCompare.querySelector('[data-entity="compare-checkbox"]');i&&(i.checked=t)}},setCompareInfo:function(t){if(BX.type.isArray(t))for(var i in this.offers)this.offers.hasOwnProperty(i)&&(this.offers[i].COMPARED=BX.util.in_array(this.offers[i].ID,t))},compareRedirect:function(){this.compareData.comparePath?location.href=this.compareData.comparePath:this.obPopupWin.close()},checkDeletedCompare:function(t){switch(this.productType){case 0:case 1:case 2:this.product.id==t&&this.setCompared(!1);break;case 3:for(var i=this.offers.length;i--;)if(this.offers[i].ID==t){this.offers[i].COMPARED=!1,this.offerNum==i&&this.setCompared(!1);break}}},initBasketUrl:function(){switch(this.basketUrl=this.basketMode==="ADD"?this.basketData.add_url:this.basketData.buy_url,this.productType){case 1:case 2:this.basketUrl=this.basketUrl.replace("#ID#",this.product.id.toString());break;case 3:this.basketUrl=this.basketUrl.replace("#ID#",this.offers[this.offerNum].ID);break}this.basketParams={ajax_basket:"Y"},this.showQuantity&&(this.basketParams[this.basketData.quantity]=this.obQuantity.value),this.basketData.sku_props&&(this.basketParams[this.basketData.sku_props_var]=this.basketData.sku_props)},fillBasketProps:function(){if(this.visual.BASKET_PROP_DIV){var t=0,i=null,e=!1,s=null;if(this.basketData.useProps&&!this.basketData.emptyProps?this.obPopupWin&&this.obPopupWin.contentContainer&&(s=this.obPopupWin.contentContainer):s=BX(this.visual.BASKET_PROP_DIV),s){if(i=s.getElementsByTagName("select"),i&&i.length){for(t=0;t<i.length;t++)if(!i[t].disabled)switch(i[t].type.toLowerCase()){case"select-one":this.basketParams[i[t].name]=i[t].value,e=!0;break;default:break}}if(i=s.getElementsByTagName("input"),i&&i.length){for(t=0;t<i.length;t++)if(!i[t].disabled)switch(i[t].type.toLowerCase()){case"hidden":this.basketParams[i[t].name]=i[t].value,e=!0;break;case"radio":i[t].checked&&(this.basketParams[i[t].name]=i[t].value,e=!0);break;default:break}}}e||(this.basketParams[this.basketData.props]=[],this.basketParams[this.basketData.props][0]=0)}},add2Basket:function(){this.basketMode="ADD",this.basket()},buyBasket:function(){this.basketMode="BUY",this.basket()},sendToBasket:function(){this.canBuy&&(this.product&&this.product.id&&this.bigData&&this.rememberProductRecommendation(),this.initBasketUrl(),this.fillBasketProps(),BX.ajax({method:"POST",dataType:"json",url:this.basketUrl,data:this.basketParams,onsuccess:BX.proxy(this.basketResult,this)}))},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(BX.message("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 u({text:BX.message("BTN_MESSAGE_SEND_PROPS"),events:{click:BX.delegate(this.sendToBasket,this)}})]),this.obPopupWin.show()):this.sendToBasket();break;case 3:this.sendToBasket();break}},basketResult:function(t){var i="",e="",s,o=[];if(this.obPopupWin&&this.obPopupWin.close(),!!BX.type.isPlainObject(t))if(s=t.STATUS==="OK",s&&this.setAnalyticsDataLayer("addToCart"),s&&this.basketAction==="BUY")this.basketRedirect();else{if(this.initPopupWindow(),s){switch(BX.onCustomEvent("OnBasketChange"),BX.findParent(this.obProduct,{className:"bx_sale_gift_main_products"},10)&&BX.onCustomEvent("onAddToBasketMainProduct",[this]),this.productType){case 1:case 2:e=this.product.pict.SRC;break;case 3:e=this.offers[this.offerNum].PREVIEW_PICTURE?this.offers[this.offerNum].PREVIEW_PICTURE.SRC:this.defaultPict.pict.SRC;break}i='<div style="width: 100%; margin: 0; text-align: center;"><img src="'+e+'" height="130" style="max-height:130px"><p>'+this.product.name+"</p></div>",this.showClosePopup?o=[new u({text:BX.message("BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(this.basketRedirect,this)},style:{marginRight:"10px"}}),new u({text:BX.message("BTN_MESSAGE_CLOSE_POPUP"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})]:o=[new u({text:BX.message("BTN_MESSAGE_BASKET_REDIRECT"),events:{click:BX.delegate(this.basketRedirect,this)}})]}else i='<div style="width: 100%; margin: 0; text-align: center;"><p>'+(t.MESSAGE?t.MESSAGE:BX.message("BASKET_UNKNOWN_ERROR"))+"</p></div>",o=[new u({text:BX.message("BTN_MESSAGE_CLOSE"),events:{click:BX.delegate(this.obPopupWin.close,this.obPopupWin)}})];this.obPopupWin.setTitleBar(s?BX.message("TITLE_SUCCESSFUL"):BX.message("TITLE_ERROR")),this.obPopupWin.setContent(i),this.obPopupWin.setButtons(o),this.obPopupWin.show()}},basketRedirect:function(){location.href=this.basketData.basketUrl?this.basketData.basketUrl:BX.message("BASKET_URL")},initPopupWindow:function(){this.obPopupWin||(this.obPopupWin=BX.PopupWindowManager.create("CatalogSectionBasket_"+this.visual.ID,null,{autoHide:!0,offsetLeft:0,offsetTop:0,overlay:!0,closeByEsc:!0,titleBar:!0,closeIcon:!0,contentColor:"white",className:this.templateTheme?"bx-"+this.templateTheme:""}))}}}})(window);})(); 21 22/* End */ 23; 24; /* Start:"a:4:{s:4:"full";
24s:101:"/bitrix/components/bitrix/sale.gift.main.products/templates/bootstrap_v4/script.min.js?17535211732626";s:6:"source";s:82:"/bitrix/components/bitrix/sale.gift.main.products/templates/bootstrap_v4/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 25BX.namespace("BX.Sale");BX.Sale.GiftMainProductsClass=function(){var t=function(t){this.ajaxUrl="/bitrix/components/bitrix/sale.gift.main.products/ajax.php";this.contextAjaxData=t.contextAjaxData||{};this.mainProductState=t.mainProductState||null;this.injectId=t.injectId||null;this.isGift=!!t.isGift;this.productId=t.productId;this.offerId=t.offerId;this.offers=t.offers||[];this.setEvents();if(document.location.hash.match(/as_gift/g)){if(this.isGift){this.enableGift()}else{this.raiseNonGiftEvent()}}BX.bindDelegate(BX(this.injectId),"click",{tagName:"a"},BX.proxy(this.clickNavLink,this))};t.prototype.clickNavLink=function(t){if(this.onPageNavigationByLink(BX.proxy_context)){return BX.PreventDefault(t)}};t.prototype.setEvents=function(){BX.addCustomEvent("onCatalogStoreProductChange",BX.proxy(this.onCatalogStoreProductChange,this));BX.addCustomEvent("onAddToBasketMainProduct",BX.proxy(this.onAddToBasketMainProduct,this))};t.prototype.unsubscribeEvents=function(){BX.removeCustomEvent("onCatalogStoreProductChange",BX.proxy(this.onCatalogStoreProductChange,this))};t.prototype.onAddToBasketMainProduct=function(t){this.enableGift()};t.prototype.onCatalogStoreProductChange=function(t){if(t==this.offerId){return}BX.ajax({url:this.ajaxUrl,method:"POST",data:BX.merge(this.contextAjaxData,{offerId:t,mainProductState:this.mainProductState,SITE_ID:BX.message("SITE_ID")}),dataType:"html",processData:false,start:true,onsuccess:BX.delegate(function(e){this.offerId=t;var i=BX.processHTML(e);if(!i.HTML){if(document.location.hash.match(/as_gift/g)){if(this.isGift){this.raiseGiftEvent()}else{this.raiseNonGiftEvent()}}return}this.unsubscribeEvents();BX(this.injectId).innerHTML=i.HTML;BX.ajax.processScripts(i.SCRIPT)},this)})};t.prototype.onPageNavigationByLink=function(t){var e=BX.delegate(function(t){if(!BX.type.isElementNode(t)||!t.href){return false}if(t.href.indexOf(this.ajaxUrl)>=0){return true}return t.href.indexOf("PAGEN_")!==-1},this);if(!e(t)){return false}BX.ajax({url:t.href,method:"POST",data:BX.merge(this.contextAjaxData,{SITE_ID:BX.message("SITE_ID")}),dataType:"html",processData:false,start:true,onsuccess:BX.delegate(function(t){var e=BX.processHTML(t);if(!e.HTML){return}this.unsubscribeEvents();BX(this.injectId).innerHTML=e.HTML;BX.ajax.processScripts(e.SCRIPT)},this)});return true};t.prototype.enableGift=function(){this.isGift=true;this.raiseGiftEvent()};t.prototype.raiseGiftEvent=function(){BX.onCustomEvent("onSaleProductIsGift",[this.productId,this.offerId])};t.prototype.raiseNonGiftEvent=function(){BX.onCustomEvent("onSaleProductIsNotGift",[this.productId,this.offerId])};return t}(); 26/* End */ 27;; /* /bitrix/components/bitrix/catalog.compare.list/templates/bootstrap_v4/script.min.js?17535211702543*/ 28; /* /local/templates/okoptica/components/bitrix/catalog.element/main2/script.min.js?177263889756954*/ 29; /* /bitrix/components/bitrix/sale.prediction.product.detail/templates/.default/script.min.js?1753521173394*/ 30; /* /bitrix/components/bitrix/sale.products.gift/templates/bootstrap_v4/script.min.js?17535211733303*/ 31; /* /local/templates/okoptica/components/bitrix/catalog.item/bootstrap_v4/script.min.js?177263889739736*/ 32; /* /bitrix/components/bitrix/sale.gift.main.products/templates/bootstrap_v4/script.min.js?17535211732626*/ 33 34//# sourceMappingURL=page_974bdf2cee86ec63ab69df402caadb94.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.