text: (function(){if(typeof BX.ui!="object")BX.ui={};BX.ui.loader=function(t,e){this.parentConstruct(BX.ui.loader,t);BX.merge(this,{opts:{timeout:100},sys:{code:"loader"}});this.handleInitStack(e,BX.ui.loader,t)};BX.extend(BX.ui.loader,BX.ui.widget);BX.merge(BX.ui.loader.prototype,{init:function(){},show:function(){var t=this;var e=this.vars;e.timer=setTimeout(function(){t.fireEvent("toggle",[true]);e.timer=null},this.opts.timeout)},hide:function(){clearTimeout(this.vars.timer);if(this.vars.timer==null)this.fireEvent("toggle",[false])}});BX.ui.scrollPaneNative=function(t,e){this.parentConstruct(BX.ui.scrollPaneNative,t);BX.merge(this,{opts:{eventTimeout:150,scrollError:30},vars:{prevScrollTop:0,atBottom:false},sys:{code:"scrollpanenative"}});this.handleInitStack(e,BX.ui.scrollPaneNative,t)};BX.extend(BX.ui.scrollPaneNative,BX.ui.widget);BX.merge(BX.ui.scrollPaneNative.prototype,{init:function(){this.ctrls.container=this.getControl("container");this.pushFuncStack("bindEvents",BX.ui.scrollPaneNative)},bindEvents:function(){var t=this,e=this.ctrls;BX.bind(e.container,"scroll",function(){t.checkScrollState()});BX.bind(e.container,"mousewheel",function(e){var i=BX.getWheelData(e);var n=false;var r=t.ctrls.container.scrollTop;var o=t.ctrls.container.scrollHeight;var s=t.ctrls.container.clientHeight;if(i>0&&r==0)n=true;if(i<0&&r>=o-s)n=true;if(n){BX.PreventDefault(e);BX.eventCancelBubble(e);return false}});BX.bind(window,"resize",function(){t.checkScrollState()});BX(function(){t.checkScrollState()})},informContentChanged:function(){this.vars.prevScrollTop=this.ctrls.container.scrollTop;this.vars.atBottom=false;this.checkScrollState()},dropScrollTop:function(){this.ctrls.container.scrollTop=0;this.checkScrollState()},scrollTo:function(t){var e=false;if(typeof t.y=="number")e=t.y;else if(typeof t.dy=="number")e=this.ctrls.container.scrollTop+t.dy;if(e!==false){this.ctrls.container.scrollTop=e}},checkFreeBottomSpace:function(){var t=this.ctrls;return t.container.scrollHeight<=t.container.clientHeight},checkScrolledToEnd:function(){var t=this.ctrls,e=this.vars,i=this.opts;var n=t.container.scrollTop;if(e.prevScrollTop==n)return;var r=t.container.scrollTop>=t.container.scrollHeight-t.container.clientHeight-i.scrollError;if(r==e.atBottom)return;e.atBottom=r;return e.atBottom},checkScrollState:function(){var t=this;if(!BX.type.isFunction(this.vars.checkFn)){this.vars.checkFn=BX.throttle(function(){if(t.checkFreeBottomSpace())t.fireEvent("has-free-space");if(t.checkScrolledToEnd())t.fireEvent("scroll-to-end")},t.opts.eventTimeout,t)}this.vars.checkFn()}});BX.ui.networkIOWidget=function(t,e){this.parentConstruct(BX.ui.networkIOWidget,t);BX.merge(this,{opts:{source:"/somewhere.php",pageSize:5,paginatedRequest:true},vars:{lastPage:0,loader:{show:BX.DoNothing,hide:BX.DoNothing}},ctrls:{},sys:{code:"network-io-widget"}});this.handleInitStack(e,BX.ui.networkIOWidget,t)};BX.extend(BX.ui.networkIOWidget,BX.ui.widget);BX.merge(BX.ui.networkIOWidget.prototype,{init:function(){},downloadBundle:function(t){var e=this.opts,i=this.vars,n=this.ctrls,r=this;i.loader.show(t.options);BX.ajax({url:e.source,method:"post",dataType:"json",async:true,processData:true,emulateOnload:true,start:true,data:BX.merge(r.refineRequest(t.request,t.options),r.getNavParams(t.options)),onsuccess:function(e){i.loader.hide(t.options);if(e.result){e.data=r.refineResponce(e.data,t.request,t.options);if(typeof e.data=="undefined")e.data=[];if(BX.type.isFunction(t.callbacks.onLoad))t.callbacks.onLoad.apply(r,[e.data])}else r.showError({errors:e.errors,type:"server-logic",options:t.options});if(BX.type.isFunction(t.callbacks.onComplete))t.callbacks.onComplete.call(r)},onfailure:function(e,n){i.loader.hide(t.options);r.showError({errors:[n.message],type:e,options:t.options,exception:n});if(BX.type.isFunction(t.callbacks.onComplete))t.callbacks.onComplete.call(r);if(BX.type.isFunction(t.callbacks.onError))t.callbacks.onError.apply(r,[e,n])}})},getNavParams:function(t){return this.opts.paginatedRequest?{PAGE_SIZE:this.opts.pageSize,PAGE:this.vars.lastPage}:{}},showError:function(t){BX.debug(t)},refineRequest:function(t,e){return t},refineResponce:function(t,e,i){return t}});BX.deferred=function(t){this.timer=null;this.actions={done:[],fail:[]};this.result=null;this.done=function(t){if(BX.type.isFunction(t))this.actions.done.push(t)};this.fail=function(t){if(BX.type.isFunction(t))this.actions.fail.push(t)};this.resolve=function(){if(this.result===false)return;this.result=true;this.callActions("done",arguments)};this.reject=function(){if(this.result===true)return;this.result=false;this.callActions("fail",arguments)};this.startRace=function(t,e){var i=this;this.timer=setTimeout(function(){e?i.resolve():i.reject()},t||300)};this.stopRace=function(){clearTimeout(this.timer)};this.callActions=function(t,e){for(var i in this.actions[t])if(this.actions[t].hasOwnProperty(i))this.actions[t][i].apply(this,e)};return this};BX.semaphore=function(t,e,i){var n=false;return function(){e=e||this;if(n)return;n=true;t.apply(e,arguments);n=false}};BX.util.wrapSubstring=function(t,e,i,n){if(t.length==0)return"";if(n){t=BX.util.htmlspecialchars(t);i=BX.util.htmlspecialchars(i)}if(e.length==0)return t;var r="";var o="";var s={};for(var a in e){if(!e.hasOwnProperty(a))continue;o=e[a].toString().toLowerCase();r=t.toLowerCase();if(typeof s[o]!="undefined")continue;var c=r.indexOf(o);if(c>=0){var l=t.slice(0,c);var u=t.slice(c,c+o.length);var h=t.slice(c+o.length,t.length);t=l+"#A#"+u+"#B#"+h}s[o]=true}return t.replace(/#A#/g,"<"+i+">").replace(/#B#/g,"</"+i+">")};BX.util.getObjectLength=function(t){if(typeof t!="object")return 0;if("length"in t)return t.length;var e=0;for(var i in t){if(t.hasOwnProperty(i))e++}return e}})();
  //# sourceMappingURL=core_ui_etc.map.js