tao-test/app/taoClientDiagnostic/views/js/loader/diagnostic.min.js

2 lines
47 KiB
JavaScript
Raw Normal View History

2022-08-29 20:14:13 +02:00
function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}(function(){'use strict';var loaderScript=document.getElementById("amd-loader"),configUrl=loaderScript.getAttribute("data-config"),bundle=loaderScript.getAttribute("data-bundle"),loadController=function(){var controllerOptions={},controllerPath=loaderScript.getAttribute("data-controller"),params=loaderScript.getAttribute("data-params");try{controllerOptions=JSON.parse(params)}catch(err){controllerOptions={}}window.require([controllerPath],function(controller){var startController=function(){window.started||(window.started=!0,controller.start(controllerOptions))};document.addEventListener("readystatechange",startController,!1),"complete"===document.readyState&&startController()})};window.require([configUrl],function(){window.loadBundles||(window.loaded={},window.loadBundles=function(bundles){bundles=bundles||[],bundles=bundles.concat(window.bundles),bundles=bundles.filter(function(item,index){return item&&bundles.indexOf(item)===index&&!0!==window.loaded[item]}),require(bundles,function(){bundles.forEach(function(item){window.loaded[item]=!0}),loadController()})}),bundle||window.bundles&&window.bundles.length?window.loadBundles([bundle]):loadController()})})(),define("loader/bootstrap",function(){}),define("taoClientDiagnostic/tools/fixedDecimals",[],function(){'use strict';return function(value,decimals){var shift=Math.pow(10,Math.abs(decimals||1));return Math.round(+value*shift)/shift||0}}),define("taoClientDiagnostic/tools/stats",["lodash","taoClientDiagnostic/tools/fixedDecimals"],function(_,fixedDecimals){'use strict';var _Mathfloor=Math.floor,_Mathmax=Math.max,_Mathmin=Math.min;function valueGetter(name){return"function"==typeof name?name:function(item){return item&&item[name]||0}}return function(list,fieldName,decimals){var _Mathceil=Math.ceil,_Mathsqrt=Math.sqrt,_NumberMAX_VALUE=Number.MAX_VALUE,getValue=valueGetter(fieldName),values=[],min=_NumberMAX_VALUE,max=0,count=0,sum=_.reduce(list,function(sum,item){if("undefined"!=typeof item){var value=getValue(item);return values.push(value),min=_Mathmin(min,value),max=_Mathmax(max,value),sum+=value,count++,sum}},0),average=sum/(count||1),sum2=values.reduce(function(sum,value){var diff=value-average;return sum+=diff*diff,sum},0),variance=1<count?_Mathsqrt(sum2/(count-1)):0;values.sort();var middle=count/2,median=(values[_Mathfloor(middle)]+values[_Mathceil(middle)])/2,results={min:min,max:max,sum:sum,count:count,average:average,median:median,variance:variance};return decimals&&_.forEach(results,function(value,key){results[key]=fixedDecimals(value,decimals)}),results.values=list,results}}),define("taoClientDiagnostic/tools/getConfig",["lodash"],function(_){'use strict';return function(config,defaults){return _(config||{}).omit(function(value){return null===value||"undefined"==typeof value}).defaults(defaults||{}).value()}}),define("taoClientDiagnostic/tools/getLabels",[],function(){'use strict';var _Mathmax2=Math.max,_Mathmin2=Math.min;return function(messages,level){return messages=messages||{},Array.isArray(messages)||(messages=[messages]),level=_Mathmin2(_Mathmax2(parseInt(level,10)||0,1),messages.length||1)-1,messages[level]||{}}}),define("taoClientDiagnostic/tools/getStatus",["lodash"],function(_){'use strict';var _Mathmax3=Math.max;return function(percentage,thresholds,opts){var options=opts||{},testPercentage=_Mathmax3(0,Math.min(100,Math.round(parseInt(percentage,10)||0))),globalPercentage=options.minimumGlobalPercentage?_Mathmax3(testPercentage,options.minimumGlobalPercentage):testPercentage,status={percentage:testPercentage,globalPercentage:globalPercentage,quality:{}};if(thresholds){Array.isArray(thresholds)||(thresholds=[thresholds]);for(var feedback,step,len=thresholds.length,i=0;i<len&&(step=thresholds[i],step&&(!step.threshold||status.percentage>=step.threshold));i++)fe
//# sourceMappingURL=diagnostic.min.js.map