(function(window){if(window.BX.frameCache)return;var BX=window.BX;var localStorageKey="compositeCache";var lolalStorageTTL=1440;var compositeMessageIds=["bitrix_sessid","USER_ID","SERVER_TIME","USER_TZ_OFFSET","USER_TZ_AUTO"];var compositeDataFile="/bitrix/tools/composite_data.php";var sessidWasUpdated=false;BX.frameCache=function(){};if(BX.browser.IsIE8()){BX.frameCache.localStorage=new BX.localStorageIE8}else if(typeof localStorage!=="undefined"){BX.frameCache.localStorage=new BX.localStorage}else{BX.frameCache.localStorage={set:BX.DoNothing,get:function(){return null},remove:BX.DoNothing}}BX.frameCache.localStorage.prefix=function(){return"bx-"};BX.frameCache.init=function(){this.cacheDataBase=null;this.tableParams={tableName:"composite",fields:[{name:"id",unique:true},"content","hash","props"]};this.frameDataReceived=false;this.frameDataInserted=false;if(BX.type.isString(window.frameDataString)&&window.frameDataString.length>0){BX.frameCache.onFrameDataReceived(window.frameDataString)}this.vars=window.frameCacheVars?window.frameCacheVars:{dynamicBlocks:{},page_url:"",params:{},storageBlocks:[]};var e=BX.frameCache.localStorage.get(localStorageKey)||{};for(var a=0;a{o=true;l()}));function f(a){let t=c.styles;if(BX.type.isArray(e.PROPS.CSS)&&e.PROPS.CSS.length>0){t=e.PROPS.CSS.concat(t)}let r=c.externalJS;if(BX.type.isArray(e.PROPS.JS)&&e.PROPS.JS.length>0){r=r.concat(e.PROPS.JS)}const s=t.concat(r);if(s.length>0){BX.load(s,a)}else{a()}}function l(){if(t){if(e.PROPS.USE_ANIMATION){t.style.opacity=0;t.innerHTML=e.CONTENT;new BX.easing({duration:1500,start:{opacity:0},finish:{opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){t.style.opacity=e.opacity/100},complete:function(){t.style.cssText=""}}).animate()}else{t.innerHTML=e.CONTENT}}else{BX.frameCache.removeNodes(r,s);r.insertAdjacentHTML("afterEnd",e.CONTENT)}n=true;if(o){m()}}function h(){if(BX.Type.isStringFilled(c.html)){document.head.insertAdjacentHTML("beforeend",c.html)}BX.evalGlobal(c.inlineJS.join(";"))}function u(){var a={styles:[],inlineJS:[],externalJS:[],html:""};if(!BX.type.isArray(e.PROPS.STRINGS)||e.PROPS.STRINGS.length<1){return a}var t=BX.processHTML(e.PROPS.STRINGS.join(""),false);for(var r=0,s=t.SCRIPT.length;r0){BX.onCustomEvent(this,"onCacheInvokeBefore",[this.vars.storageBlocks]);this.readCacheWithID(this.vars.storageBlocks,BX.proxy(this.insertFromCache,this))}};BX.frameCache.handleResponse=function(e){if(e==null)return;BX.onCustomEvent("onFrameDataReceivedBefore",[e]);if(e.dynamicBlocks&&e.dynamicBlocks.length>0){this.insertBlocks(e.dynamicBlocks,false);this.writeCache(e.dynamicBlocks)}BX.onCustomEvent("onFrameDataReceived",[e]);if(e.isManifestUpdated=="1"&&this.vars.CACHE_MODE==="APPCACHE"&&window.applicationCache&&(window.applicationCache.status==window.applicationCache.IDLE||window.applicationCache.status==window.applicationCache.UPDATEREADY)){window.applicationCache.update()}if(e.htmlCacheChanged===true&&this.vars.CACHE_MODE==="HTMLCACHE"){BX.onCustomEvent("onHtmlCacheChanged",[e])}if(BX.type.isArray(e.spread)){for(var a=0;a0){var a=Date.parse(document.lastModified);if(!isNaN(a)){var t=(new Date).getTime();if(a+this.vars.AUTO_UPDATE_TTL*1e30){r=r.substring(0,s)}r+=(r.indexOf("?")>=0?"&":"?")+"bxrand="+(new Date).getTime();BX.ajax({timeout:60,method:"GET",url:r,data:{},headers:e,skipBxHeader:true,processData:false,onsuccess:BX.proxy(BX.frameCache.onFrameDataReceived,this),onfailure:function(){window.frameRequestFail={error:true,reason:"bad_response",url:r,xhr:this.xhr,status:this.xhr?this.xhr.status:0};BX.onCustomEvent("onFrameDataRequestFail",[window.frameRequestFail])}})};BX.frameCache.onFrameDataReceived=function(response){var result=null;try{eval("result = "+response)}catch(e){var error={error:true,reason:"bad_eval",response:response};window.frameRequestFail=error;BX.ready((function(){setTimeout((function(){BX.onCustomEvent("onFrameDataRequestFail",[error])}),0)}));return}this.frameDataReceived=true;if(result&&BX.type.isNotEmptyString(result.redirect_url)){window.location=result.redirect_url;return}if(result&&result.error===true){window.frameRequestFail=result;BX.ready(BX.proxy((function(){setTimeout(BX.proxy((function(){BX.onCustomEvent("onFrameDataRequestFail",[result])}),this),0)}),this));return}BX.frameCache.setCompositeVars(result);BX.ready(BX.proxy((function(){this.handleResponse(result);this.tryUpdateSessid()}),this))};BX.frameCache.insertFromCache=function(e,a){if(!this.frameDataReceived){var t=e.items;if(t.length>0){for(var r=0;r{if(window.performance){var t=performance.getEntries();for(var r=0;r0&&i[0].duration){this.lcp=Math.ceil(i[0].duration)}}}BX.onCustomEvent("onFrameDataProcessed",[e,a]);this.frameDataInserted=true};const o=()=>{if(++i===t.size){n()}};if(t.size===0){n()}else{t.forEach((function(e){if(e&&e.HASH&&e.PROPS&&e.PROPS.ID){this.vars.dynamicBlocks[e.PROPS.ID]=e.HASH}this.insertBlock(e,o)}),this)}};BX.frameCache.writeCache=function(e){for(var a=0;a