var CDNCheckerViewModel=function(){function n(n){var t=this;this.url=ko.observable("");this.selectedCheckpoints=ko.observable("");this.selectedCheckpointsDescription=ko.observable("");this.followRedirects=ko.observable(!0);this.newRequestHeader=ko.observable({key:"",value:""});this.displayState=ko.observable(CDNDisplayState.DETAILS);this.isExecuting=ko.observable(!1);this.isFinished=ko.observable(!1);this.showAdvancedSettings=ko.observable(!1);this.showSignupForm=ko.observable(!1);this.showSignupFormIntro=ko.observable(!0);this.showInputs=ko.observable(!0);this.message=ko.observable("");this.messageType=ko.observable("");this.helpUrl=ko.observable("");this.requestHeaders=ko.observableArray([]);this.addressIsValid=ko.observable(!0);this.fromMarketingSite=ko.observable(!1);this.sharedResult=ko.observable(!0);this.sharedResultInfo=ko.observable(null);this.useNewSignup=!1;this.currentRequestGuid=ko.observable("");this.toolRequestGuid=ko.observable("");this.ctaContentParams=ko.observable({});this.advancedSettingsAllowed=ko.observable(!0);this.signupFrameUrl=ko.computed(function(){var n=t.url(),i;return n.indexOf("http://")===-1&&n.indexOf("https://")===-1&&(n="https://"+n),i=document.documentElement.lang,window.location.origin+"/Account/Register?lang="+i+"&mode=50&formtype=TwoStepForm&url="+n});this.userInputFormDisabled=ko.observable(!1);this.submitButtonText=ko.computed(function(){var n=t.isExecuting();return n?Resources.Tools.Busy:Resources.Tools["HTTP.Start"]});this.results=ko.observableArray([]);this.selectedCheckpointsList=ko.computed(function(){var n=t.selectedCheckpoints();return n?n.split(","):[]});this.useNewSignup=n;handleSignupFrameEvents(this);this.setInitialDisplayState();this.fromMarketingSite(!(CdnHelper.getQueryStringParameter("app")==="1"));window.requestAnimationFrame(function(){FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})});FrameEventsBus.notify(FrameEventType.RequestParentParams,{paramNames:["toolRequestGuid","ctaTitle","ctaText","ctaButtonText"]});FrameEventsBus.subscribe(FrameEventType.ParentParamsResponse,null,function(n){n.params.toolRequestGuid?(t.sharedResult(!0),t.toolRequestGuid(n.params.toolRequestGuid),t.getResponses(),t.showInputs(!1)):(t.sharedResult(!1),t.showInputs(!0));t.ctaContentParams({title:n.params.ctaTitle,text:n.params.ctaText,buttonText:n.params.ctaButtonText})})}return n.prototype.requestCheckStart=function(){this.isExecuting()||this.startCheck()},n.prototype.reset=function(){this.resetState()},n.prototype.showSignup=function(){this.showSignupForm(!0);FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})},n.prototype.startCheck=function(){var n=this,t=$.trim(this.url()),i,r;if(validateAddress(t))this.addressIsValid(!0);else return this.addressIsValid(!1),!1;this.resetState();this.userInputFormDisabled(!0);i={Url:t,CheckPointIds:this.selectedCheckpointsList(),RequestHeaders:this.requestHeaders(),FollowRedirects:this.followRedirects(),SelectedCheckpointName:this.selectedCheckpointsDescription()};this.isExecuting(!0);this.showAdvancedSettings(!1);this.results([]);r=new SignalRClient.Client({onException:function(t){n.onFinish(t);n.messageType(MessageType.ERROR)},onSignalRError:function(t){n.onFinish(t);n.messageType(MessageType.ERROR)},onFinish:function(t){n.onFinish(t)},onProgress:function(t){n.onProgress(t)}},"contentUpdateHub",!1);r.start("ToolHTTP",JSON.stringify(i),"undefined",Formatting.Culture)},n.prototype.onProgress=function(n){if(this.message(n.Message||""),n.Data){var t=this.parseReponses(n.Data);this.results(t.sort(function(n,t){return n.totalTime-t.totalTime}))}FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})},n.prototype.onFinish=function(n){if(n.Message)this.results([]),this.message(n.Message),this.helpUrl(n.HelpUrl),this.messageType(MessageType.WARNING);else{n.Data.length>0&&this.currentRequestGuid(n.Data[0].RequestGuid);this.onProgress(n);this.message("");this.isFinished(!0)}this.fromMarketingSite()||this.userInputFormDisabled(!1);this.isExecuting(!1);FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})},n.prototype.getResponses=function(){var n=this;$.ajax({type:"GET",url:UrlHelper.ToolResponses,data:{toolRequestGuid:this.toolRequestGuid(),toolType:ToolType.Http},success:function(t){if(t){var i=n.parseReponses(t);n.results(i.sort(function(n,t){return n.totalTime-t.totalTime}));n.sharedResultInfo({timeStamp:parseDateFromBackendString(t[0].RequestDateTimeUtc),url:t[0].ResultJson.Url,multipleCheckpoints:t.length>1,checkpointName:t[0].ResultJson.SelectedCheckpointName,allCheckpoints:t[0].ResultJson.SelectedAllCheckpoints})}n.isFinished(!0)},error:function(t){n.results([]);n.message(t.statusText);n.messageType(MessageType.ERROR);n.isFinished(!0)}})},n.prototype.parseReponses=function(n){for(var u,t=0,i=0,r=n.filter(function(n){return n.StatusId===ToolResponseStatusEnum.Finished});i<r.length;i++)u=r[i],t=Math.max(u.ResultJson.MsTotalTime,t);return n.map(function(n){var i=CdnHelper.formatBytes(n.ResultJson.TotalBytes);return{maxTotalTime:n.StatusId===ToolResponseStatusEnum.Finished?t:n.ResultJson.MsTotalTime,httpStatus:n.ResultJson.HttpErrorCode?n.ResultJson.HttpErrorCode.toString():"-",httpStatusCode:n.ResultJson.HttpErrorCode+" "+n.ResultJson.ErrorCode,httpErrorCode:n.ResultJson.ErrorMessage,locationName:n.ResultJson.CheckPointName,requestStatusDescription:CdnHelper.getStatusDescriptionForStatusId(n.StatusId,n.ResultJson.ErrorMessage!=""?n.ResultJson.ErrorMessage:n.ResultJson.ErrorCode),totalSize:i.kb+" kB ("+i.b+" bytes)",totalTime:n.ResultJson.MsTotalTime,resolveTime:n.ResultJson.MsToResolve,connectionTime:n.ResultJson.MsConnectTime,downloadTime:n.ResultJson.MsDownloadTime,ipAddress:n.ResultJson.ResolvedIPAddress||"-",status:CdnHelper.getResultStatusByStatusId(n.StatusId),headers:CdnHelper.parseServerHeaders(n.ResultJson.Headers),lat:n.ResultJson.Info?n.ResultJson.Info.Latitude:null,lon:n.ResultJson.Info?n.ResultJson.Info.Longitude:null}})},n.prototype.setInitialDisplayState=function(){var n=CdnHelper.getQueryStringParameter("view");n&&CDNDisplayState[n.toUpperCase()]?this.displayState(n.toUpperCase()):this.displayState(CDNDisplayState.DETAILS)},n.prototype.resetState=function(){this.isExecuting(!1);this.isFinished(!1);this.showSignupForm(!1);this.showSignupFormIntro(!0);this.showInputs(!0);this.message("");this.messageType("");this.helpUrl("");this.resetNewRequestHeader();this.userInputFormDisabled(!1);this.sharedResult(!1);FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})},n.prototype.resetHeaders=function(){this.requestHeaders([]);this.resetNewRequestHeader()},n.prototype.resetNewRequestHeader=function(){this.newRequestHeader({key:"",value:""})},n}(),CDNDisplayState,CDNResult,CDNTable,CdnTooltip,GeologicalResults,WorldMapToggle,WorldMap,CdnAdvancedOptions,CdnHelper;(function(n){n.OVERVIEW="OVERVIEW";n.DETAILS="DETAILS"})(CDNDisplayState||(CDNDisplayState={}));CDNResult=function(){function n(n){if(this.resolvePercentage=ko.observable(0),this.connectPercentage=ko.observable(0),this.downloadPercentage=ko.observable(0),this.totalTimeDisplay=ko.observable(""),this.tooltipVisible=ko.observable(!1),this.result=n.result,this.tooltipVisible.subscribe(function(){window.requestAnimationFrame(function(){FrameEventsBus.notify("SIZE",{height:window.innerHeight})})}),!this.result.maxTotalTime||!this.isDone()){this.totalTimeDisplay("-.-");return}this.result.totalTime?this.totalTimeDisplay(this.round(this.result.totalTime/1e3,1)+"s"):this.totalTimeDisplay("-.-");this.calculateSizes()}return n.prototype.showTooltip=function(){this.isDone()&&this.tooltipVisible(!0)},n.prototype.hideTooltip=function(){this.tooltipVisible(!1)},n.prototype.isDone=function(){var n=[ContentUpdateToolResultStatus.PENDING,ContentUpdateToolResultStatus.BUSY];return n.indexOf(this.result.status)===-1},n.prototype.calculateSizes=function(){var n=this.result.maxTotalTime*.01;n!==0&&(this.resolvePercentage(Math.round(this.result.resolveTime/n)),this.connectPercentage(Math.round(this.result.connectionTime/n)),this.downloadPercentage(Math.round(this.result.downloadTime/n)))},n.prototype.round=function(n,t){return Number(Math.round(n+"e"+t)+"e-"+t)},n}();$(document).ready(function(){ko.components.register("cdn-result",{viewModel:CDNResult,template:document.querySelector("#template-cdnresult").innerHTML})});CDNTable=function(){function n(n){var t=this;this.selectedResult=ko.observable(null);this.expandHeaderValues=ko.observable(!1);this.selectedHeaderKey=ko.observable("");this.singleMode=!1;this.results=n.results;this.isFinished=n.isFinished;this.singleMode=n.singleMode;this.selectedResult.subscribe(function(){FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})});this.ipAddresses=ko.computed(function(){var n=t.results(),i;return n?(i=n.map(function(n){return n.ipAddress}),i.filter(function(n,t,i){return i.indexOf(n)===t})):[]});this.colorCodeIpAddresses=ko.computed(function(){return t.shouldColorCode(t.ipAddresses())});this.headerKeys=ko.computed(function(){var o=t.results(),n,i,u,s,r,f,e;if(!o)return[];for(n=[],i=0,u=o;i<u.length;i++)for(s=u[i],r=0,f=s.headers;r<f.length;r++)e=f[r],n.indexOf(e.key)===-1&&n.push(e.key);return!n.length||t.selectedHeaderKey.peek()||t.selectedHeaderKey(n[0]),n});this.selectedHeaderValues=ko.computed(function(){var f=t.results(),o=t.selectedHeaderKey(),i,n,r,e,u;if(!f||!o)return[];for(i=[],n=0,r=f;n<r.length;n++)e=r[n],u=t.getResultSelectedHeaderValue(e),u&&i.push(u);return i.filter(function(n,t,i){return i.indexOf(n)===t})});this.colorCodeHeaderValue=ko.computed(function(){return t.shouldColorCode(t.selectedHeaderValues())});this.selectedHeaderKey.subscribe(function(){t.expandHeaderValues(!1);window.requestAnimationFrame(function(){FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})})});this.expandHeaderValues.subscribe(function(){FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})});this.expandOptionVisible=ko.computed(function(){return t.getFirstFilledSelectedHeaderValue().length>360})}return n.prototype.shouldColorCode=function(n){return n.length===2&&!n[0]||!n[1]?!1:n.length===1||n.length>10?!1:n.length===this.results().length?!1:!0},n.prototype.toggleExpand=function(n){if(!this.singleMode){var t=this.selectedResult();t===n?this.selectedResult(null):this.selectedResult(n);FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})}},n.prototype.toggleHeaderValues=function(){this.expandHeaderValues(!this.expandHeaderValues.peek())},n.prototype.rowViewState=function(n){var t=[n.status];return this.selectedResult()===n&&t.push("is-expanded"),t.join(" ")},n.prototype.classList=function(n){var t=this.rowViewState(n);return this.singleMode&&(t=t+" is-expanded single-mode"),t},n.prototype.ipAddressViewState=function(n){var t=[],i;return this.colorCodeIpAddresses()&&(t.push("colored-groups"),i=this.ipAddresses().indexOf(n.ipAddress),t.push("color-group-"+i)),t.join(" ")},n.prototype.headerViewState=function(n){var t=[],i=this.getResultSelectedHeaderValue(n),r;return this.colorCodeHeaderValue()&&(t.push("colored-groups"),i&&(r=this.selectedHeaderValues().indexOf(i),t.push("color-group-"+r))),i===null&&t.push("no-header-value"),this.expandHeaderValues()&&t.push("is-expanded"),this.expandOptionVisible()&&t.push("is-expandable"),t.join(" ")},n.prototype.getFirstFilledSelectedHeaderValue=function(){for(var r,t,n=0,i=this.results();n<i.length;n++)if(r=i[n],t=this.getResultSelectedHeaderValue(r),t&&t.length)return t;return""},n.prototype.getResultSelectedHeaderValue=function(n){var i=this,t;return n.headers&&(t=n.headers.find(function(n){return n.key===i.selectedHeaderKey()}),t)?t.value:null},n}();$(document).ready(function(){ko.components.register("cdn-table",{viewModel:CDNTable,template:document.querySelector("#template-cdn-table").innerHTML})});CdnTooltip=function(){function n(n){this.result=n.result}return n}();$(document).ready(function(){ko.components.register("cdn-tooltip",{viewModel:CdnTooltip,template:document.querySelector("#template-cdntooltip").innerHTML})});GeologicalResults=function(){function n(n){this.showMap=ko.observable(!1);this.results=n.results}return n}();$(document).ready(function(){ko.components.register("geological-results",{viewModel:GeologicalResults,template:document.querySelector("#template-geologicalresults").innerHTML})});WorldMapToggle=function(){function n(n){this.showMap=n.showMap}return n.prototype.openMap=function(){this.showMap(!0)},n}();$(document).ready(function(){ko.components.register("worldmap-toggle",{viewModel:WorldMapToggle,template:document.querySelector("#template-worldmaptoggle").innerHTML})});WorldMap=function(){function n(t){var i=this;this.minTime=Number.MAX_VALUE;this.maxTime=0;this.minSize=5;this.maxSize=10;window.Highcharts.SVGRenderer.prototype.symbols.customMarker=n.buildCustomMarker;window.Highcharts.VMLRenderer&&(window.Highcharts.VMLRenderer.prototype.symbols.customMarker=window.Highcharts.SVGRenderer.prototype.symbols.customMarker);this.results=t.results;this.data=ko.computed(function(){return i.results().map(function(n){return{httpStatus:n.httpStatus,httpErrorCode:n.httpErrorCode,requestStatusDescription:n.requestStatusDescription,locationName:n.locationName,totalSize:n.totalSize,totalTime:n.totalTime,resolveTime:n.resolveTime,connectionTime:n.connectionTime,downloadTime:n.downloadTime,ipAddress:n.ipAddress,status:n.status,lat:n.lat,lon:n.lon,z:n.totalTime}})});this.ok=ko.computed(function(){return i.data().filter(function(n){return n.status===ContentUpdateToolResultStatus.FINISHED})});this.error=ko.computed(function(){return i.data().filter(function(n){return n.status===ContentUpdateToolResultStatus.ERROR||n.status===ContentUpdateToolResultStatus.CANCELED||n.status===ContentUpdateToolResultStatus.TIMEOUT})});this.busy=ko.computed(function(){return i.data().filter(function(n){return n.status===ContentUpdateToolResultStatus.BUSY||n.status===ContentUpdateToolResultStatus.PENDING})});$.getJSON("/PublicContent/Maps/world-highres.json",function(n){i.chart=i.chartOptions(n);i.prepareOkData(i.ok());i.prepareErrorData(i.error())})}return n.prototype.checkForMaximum=function(n){n>this.maxTime&&(this.maxTime=n)},n.prototype.checkForMinimum=function(n){n<this.minTime&&(this.minTime=n)},n.prototype.prepareOkData=function(n){this.chart.series[1].setData(n,!0);this.setMarkerSizeBounds(this.chart.series[1]);this.setMarkerSizes(this.chart.series[1])},n.prototype.prepareErrorData=function(n){this.chart.series[2].setData(n,!0);this.setMarkerSizeBounds(this.chart.series[2]);this.setMarkerSizes(this.chart.series[2])},n.prototype.setMarkerSize=function(n){var i=n.totalTime>0?n.totalTime:(this.minTime+this.maxTime)/2,t;t=this.maxTime-this.minTime<=0?(this.minSize+this.maxSize)/2:(i-this.minTime)/(this.maxTime-this.minTime)*(this.maxSize-this.minSize)+this.minSize;n.graphic.mRadius=t},n.prototype.setMarkerSizeBounds=function(n){for(var i,t=0,r=n.points;t<r.length;t++)(i=r[t],i.totalTime!==0)&&(this.checkForMaximum(i.totalTime),this.checkForMinimum(i.totalTime))},n.prototype.setMarkerSizes=function(n){for(var r,t=0,i=n.points;t<i.length;t++)r=i[t],this.setMarkerSize(r);this.chart.redraw()},n.prototype.subscribeToData=function(){var n=this;this.ok.subscribe(function(t){n.prepareOkData(t)});this.error.subscribe(function(t){n.prepareErrorData(t)})},n.buildTooltip=function(n){var t=n.httpErrorCode?'<div class="error-code">'+n.httpStatus+'<\/div><div class="error-description">'+n.httpErrorCode+"<\/div>":"";return'<div class="custom-tooltip">\n              <div class="tooltip-grid">\n                <div class="location-title">'+n.locationName+'<\/div>\n                <div class="description no-legend">'+n.httpStatus+" ("+n.requestStatusDescription+')<\/div>\n                <div class="separator"><\/div>\n                <div class="legend">\n                  <div class="resolve-time"> <\/div>\n                <\/div>\n                <div class="description"> Resolve time <\/div>\n                <div class="value"> '+n.resolveTime+'ms <\/div>\n                <div class="legend">\n                  <div class="connection-time"> <\/div>\n                <\/div>\n                <div class="description"> Connection time <\/div>\n                <div class="value"> '+n.connectionTime+'ms <\/div>\n                <div class="legend">\n                  <div class="download-time"> <\/div>\n                <\/div>\n                <div class="description"> Download time <\/div>\n                <div class="value"> '+n.downloadTime+'ms <\/div>\n                <div class="separator"><\/div>\n                <div class="description no-legend"> Total time <\/div>\n                <div class="value"> '+n.totalTime+'ms <\/div>\n                <div class="description no-legend"> Total size <\/div>\n                <div class="value"> '+n.totalSize+" <\/div>\n                "+t+"\n              <\/div>\n            <\/div>"},n.buildCustomMarker=function(n,t,i,r,u){if(u.mRadius){var o=u.mRadius,e=n+i/2,s=e-o,h=e+o,f=t+r/2;return["M",s,f,"A",1,1,0,0,0,h,f,"M",s,f,"A",1,1,0,0,1,h,f,"M",e-1,f,"A",1,1,0,0,0,e+1,f,"M",e-1,f,"A",1,1,0,0,1,e+1,f,"M",e-.5,f,"A",1,1,0,0,0,e+.5,f,"M",e-.5,f,"A",1,1,0,0,1,e+.5,f]}return[]},n.prototype.chartOptions=function(t){var i=this;return window.Highcharts.mapChart("mapContainer",{credits:{enabled:!1},legend:{enabled:!1},chart:{events:{load:function(){i.subscribeToData()}},styledMode:!1},tooltip:{useHTML:!0,hideDelay:50,formatter:function(){return n.buildTooltip(this.point)},shadow:!1},title:!0,mapNavigation:{enabled:!0,enableButtons:!0},series:[{mapData:t,name:"Basemap",borderColor:"transparent",nullColor:"#e9eef1",showInLegend:!1},{type:"mappoint",name:"successes",dataLabels:!0,data:this.ok(),className:"successBubble",zIndex:1,marker:{symbol:"customMarker",lineColor:null,fillColor:null,lineWidth:1}},{type:"mappoint",name:"failures",dataLabels:!0,data:this.error(),className:"failureBubble",zIndex:2,marker:{symbol:"customMarker",lineColor:null,fillColor:null,lineWidth:2}}],accessibility:{enabled:!1}})},n}();ko.bindingHandlers.highcharts={init:function(n,t){if($(n).highcharts===undefined){$(n).text("Highcharts not found, is the library loaded?");return}var i=t(),r=i!=null&&i.options!=null?i.options:i;$(n).highcharts(r)},update:function(){return}};$(document).ready(function(){ko.components.register("worldmap",{viewModel:WorldMap,template:document.querySelector("#template-worldmap").innerHTML})});CdnAdvancedOptions=function(){function n(n){var t=this;this.followRedirects=ko.observable(!0);this.selectedCdnProvider=ko.observable("");this.selectedRequestHeaderExplanation=ko.computed(function(){var i=t.selectedCdnProvider(),n;switch(i){case"custom":return Resources.Tools["HTTP.CdnProviders.Custom.Info"];case"":return Resources.Tools["HTTP.CdnProviders.None.Info"];default:try{if(n=JSON.parse(i),n&&n.DebugHeaders&&Object.keys(n.DebugHeaders).length)return Resources.Tools["HTTP.CdnProviders.WithRequestHeaders.Info"]}catch(r){}return Resources.Tools["HTTP.CdnProviders.WithoutRequestHeaders.Info"]}});this.showAdvancedSettings=n.showAdvancedSettings;this.formDisabled=n.formDisabled;this.newRequestHeader=n.newRequestHeader;this.requestHeaders=n.requestHeaders;this.canAddNewRequestHeader=ko.computed(function(){return!t.formDisabled()&&t.requestHeaders().length<150});this.selectedCdnProvider.subscribe(function(n){t.onSelectedProviderChanged(n)})}return n.prototype.toggleAdvancedSettings=function(){this.showAdvancedSettings(!this.showAdvancedSettings());FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})},n.prototype.addNewRequestHeader=function(){var n,t;this.canAddNewRequestHeader()&&(n=this.newRequestHeader(),n.key)&&(this.requestHeaders.push(n),this.resetNewRequestHeader(),FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight}),t=".request-headers-table .request-header-input-row input:first-child",document.querySelector(t).focus())},n.prototype.removeRequestHeader=function(n){this.requestHeaders.remove(function(t){return t===n})},n.prototype.resetHeaders=function(){this.requestHeaders([]);this.resetNewRequestHeader()},n.prototype.resetNewRequestHeader=function(){this.newRequestHeader({key:"",value:""})},n.prototype.onSelectedProviderChanged=function(n){var i,t,r,u;if(n&&(this.resetHeaders(),n!=="custom")){for(i=JSON.parse(n),t=0,r=Object.keys(i.DebugHeaders);t<r.length;t++)u=r[t],this.requestHeaders.push({key:u,value:i.DebugHeaders[u]});window.requestAnimationFrame(function(){FrameEventsBus.notify("SIZE",{height:document.body.scrollHeight})})}},n}();ko.components.register("cdn-advanced-options",{viewModel:CdnAdvancedOptions,template:{element:"template-cdnadvancedoptions"}});CdnHelper=function(){function n(){}return n.getResultStatusByStatusId=function(n){switch(n){case ToolResponseStatusEnum.Busy:return ContentUpdateToolResultStatus.BUSY;case ToolResponseStatusEnum.Canceled:return ContentUpdateToolResultStatus.CANCELED;case ToolResponseStatusEnum.Error:return ContentUpdateToolResultStatus.ERROR;case ToolResponseStatusEnum.Finished:return ContentUpdateToolResultStatus.FINISHED;case ToolResponseStatusEnum.Pending:return ContentUpdateToolResultStatus.PENDING;case ToolResponseStatusEnum.Timeout:return ContentUpdateToolResultStatus.TIMEOUT}return ContentUpdateToolResultStatus.BUSY},n.getStatusDescriptionForStatusId=function(n,t){switch(n){case ToolResponseStatusEnum.Busy:return Resources.Tools["HTTP.Result.Status.Busy"];case ToolResponseStatusEnum.Finished:return Resources.Tools["HTTP.Result.Status.Ok"];case ToolResponseStatusEnum.Timeout:return t||Resources.Tools["HTTP.Result.Status.Timeout"];default:return t||Resources.Tools["HTTP.Result.Status.Error"]}},n.parseServerHeaders=function(n){var u,e,i,f,t,r;if(!n)return[];for(u=[],e=n.split(/[\r\n]+/).filter(function(n){return!!n.length}),i=0,f=e;i<f.length;i++){if(t=f[i],r=t.indexOf(": "),r<0){console.warn("Could not extract header key and value from "+t+". Skipped string from "+n+".");continue}u.push({key:t.substring(0,r),value:t.substring(r+2)})}return u},n.formatBytes=function(n){return{b:this.formatNumber(n),kb:this.formatNumber(Math.round(n/1e3))}},n.formatNumber=function(n){return n.toLocaleString(Formatting.Culture)},n.getQueryStringParameter=function(n){var f=window.location.toString().split("?")[1],e,i,t,r,o,u;if(!f)return null;for(e=f.split("&"),i=[],t=0,r=e;t<r.length;t++)o=r[t],u=o.split("="),i[u[0]]=u[1];return i[n]},n}()