PageSourceSearch

https://btrace.ru/local/templates/btrace/components/bitrix/sale.ba…/js/action-pool.min.js?16971056784227

js btrace.ru collected 2026-10-08 00:34:25 UTC 4,227 bytes, 1 lines download raw bytes

1!function(){"use strict";BX.namespace("BX.Sale.BasketActionPool"),BX.Sale.BasketActionPool=function(t){this.component=t,this.requestProcessing=!1,this.updateTimer=null,this.isBasketRefreshed="Y"!==this.component.params.DEFERRED_REFRESH,this.needFullRecalculation="Y"===this.component.params.DEFERRED_REFRESH,this.pool={},this.lastActualPool={},this.approvedAction=["QUANTITY","DELETE","RESTORE","DELAY","OFFER","MERGE_OFFER"],this.switchTimer()},BX.Sale.BasketActionPool.prototype.setRefreshStatus=function(t){this.isBasketRefreshed=!!t},BX.Sale.BasketActionPool.prototype.getRefreshStatus=function(){return this.isBasketRefreshed},BX.Sale.BasketActionPool.prototype.isItemInPool=function(t){return!!this.pool[t]},BX.Sale.BasketActionPool.prototype.clearLastActualQuantityPool=function(t){this.lastActualPool[t]&&delete this.lastActualPool[t].QUANTITY},BX.Sale.BasketActionPool.prototype.checkItemPoolBefore=function(t){t&&(this.pool[t]=this.pool[t]||{})},BX.Sale.BasketActionPool.prototype.checkItemPoolAfter=function(t){t&&this.pool[t]&&0===Object.keys(this.pool[t]).length&&delete this.pool[t]},BX.Sale.BasketActionPool.prototype.addCoupon=function(t){this.pool.COUPON=t,this.switchTimer()},BX.Sale.BasketActionPool.prototype.removeCoupon=function(t){this.checkItemPoolBefore("REMOVE_COUPON"),this.pool.REMOVE_COUPON[t]=t,this.switchTimer()},BX.Sale.BasketActionPool.prototype.changeQuantity=function(t,o,e){this.checkItemPoolBefore(t),this.lastActualPool[t]&&this.lastActualPool[t].QUANTITY!==o||!this.lastActualPool[t]&&o!==e?this.pool[t].QUANTITY=o:this.pool[t]&&delete this.pool[t].QUANTITY,this.checkItemPoolAfter(t),this.switchTimer()},BX.Sale.BasketActionPool.prototype.deleteItem=function(t){this.checkItemPoolBefore(t),this.pool[t].RESTORE?delete this.pool[t].RESTORE:this.pool[t].DELETE="Y",this.checkItemPoolAfter(t),this.switchTimer()},BX.Sale.BasketActionPool.prototype.restoreItem=function(t,o){this.checkItemPoolBefore(t),"Y"===this.pool[t].DELETE?delete this.pool[t].DELETE:this.pool[t].RESTORE=o,this.checkItemPoolAfter(t),this.switchTimer()},BX.Sale.BasketActionPool.prototype.addDelayed=function(t){this.checkItemPoolBefore(t),this.pool[t].DELAY="Y",this.checkItemPoolAfter(t),this.switchTimer()},BX.Sale.BasketActionPool.prototype.removeDelayed=function(t){this.checkItemPoolBefore(t),this.pool[t].DELAY="N",this.checkItemPoolAfter(t),this.switchTimer()},BX.Sale.BasketActionPool.prototype.changeSku=function(t,o,e){JSON.stringify(o)!==JSON.stringify(e)?(this.checkItemPoolBefore(t),this.pool[t].OFFER=o):(this.pool[t]&&delete this.pool[t].OFFER,this.checkItemPoolAfter(t)),this.switchTimer()},BX.Sale.BasketActionPool.prototype.mergeSku=function(t){this.checkItemPoolBefore(t),this.pool[t].MERGE_OFFER="Y",this.switchTimer()},BX.Sale.BasketActionPool.prototype.switchTimer=function(){clearTimeout(this.updateTimer),this.isProcessing()||(this.isPoolEmpty()&&(this.component.editPostponedBasketItems(),this.component.fireCustomEvents()),this.isPoolEmpty()?this.getRefreshStatus()||this.trySendPool():this.updateTimer=setTimeout(BX.proxy(this.trySendPool,this),300))},BX.Sale.BasketActionPool.prototype.trySendPool=function(){this.isPoolEmpty()&&this.getRefreshStatus()||(this.doProcessing(!0),this.isPoolEmpty()?this.getRefreshStatus()||(this.component.sendRequest("refreshAjax",{fullRecalculation:this.needFullRecalculation?"Y":"N"}),this.needFullRecalculation=!1):(this.component.sendRequest("recalculateAjax",{basket:this.getPoolData()}),this.lastActualPool=this.pool,this.pool={}))},BX.Sale.BasketActionPool.prototype.getPoolData=function(){var t={},o=this.pool;for(var e in o.COUPON&&(t.coupon=o.COUPON,delete o.COUPON),o.REMOVE_COUPON&&(t.delete_coupon=o.REMOVE_COUPON,delete o.REMOVE_COUPON),o)if(o.hasOwnProperty(e))for(var s in o[e])o[e].hasOwnProperty(s)&&BX.util.in_array(s,this.approvedAction)&&(t[s+"_"+e]=o[e][s]);return t},BX.Sale.BasketActionPool.prototype.isPoolEmpty=function(){return 0===Object.keys(this.pool).length},BX.Sale.BasketActionPool.prototype.doProcessing=function(t){this.requestProcessing=!0===t,this.requestProcessing?this.component.startLoader():this.component.endLoader()},BX.Sale.BasketActionPool.prototype.isProcessing=function(){return!0===this.requestProcessing}}();

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.