(function(){page.using={types:["Analysis"]};var e=false;var t;var a;var i;page.onLoad=function(){var e=this.url,a=e.get(["name","statName"])||"",r=e.get("scope","Private"),u=e.getLinkUid(),l=e.getEnumMap(["autoLoadSettings","mergeMode"],u8.Crm.AnalysisMergeFlags,"all"),d=e.getBoolean("autoStart"),g=e.get("entityId","0");if(!e.has("scope")&&e.has("Private")){r=e.get("Private")=="1"?"Private":"Public"}i=u8.services.analyses.createExecutionModel({analysis:{name:a,unitLookupScope:r,onPropertyChange:n,entityId:g},link:u,autoLoadSettings:l,onExecute:o});t=new u8.Crm.Widgets.AnalysisEditor($el("editor"),{parent:page,model:i.analysis,link:u,isDefault:true,showEditor:!d,onExecute:s});if(d){s()}else{i.load()}};function s(){if(a){a.dispose()}if(i.settings){i.settings.createDefault()}var e=$("#result").show();a=new u8.Crm.Widgets.AnalysisResult(e,{parent:page,model:i,editor:{firstRun:true}});i.execute()}function n(e,t){switch(t.propertyName){case"query":if(a){a.dispose()}break;default:break}}function o(){if(e){$widget("editor").setShowEditor(false)}}})();