var s3,CscopeInfo=window.CscopeInfo||{};try{var isClient="undefined"!=typeof window&&window.document}catch(e){isClient=!1}try{var isLambda="undefined"!=typeof process&&!!process.env.LAMBDA_TASK_ROOT}catch(e){isLambda=!1}try{var isWebview="undefined"!=typeof Ti}catch(e){isWebview=!1}if(isWebview)log={logInfo:function(e){Ti.API.info("CScope Info: "+e)},logError:function(e){Ti.API.error("CScope Error: "+e)},logWarn:function(e){Ti.API.warn("CScope Warn: "+e)}};else var log={logInfo:function(e){console.log("CScope Info:",e)},logError:function(e){console.log("CScope Error:",e)},logWarn:function(e){console.log("CScope Warn:",e)}};!function(c){var a,g,t=!1,d=environmentVariables.envVariables().environment,f=_config[d].cognito.region,p=_config[d].s3.cscopeInfoCdf,u=_config[d].cognito.identityPoolId,y=!1,m=!1,h=!0,b=!1,v=new Date,I=0;function o(){_config[d].api.invokeUrl||c("#noApiMessage").show(),function(){log.logInfo("fileInfoDiv height "+c("#fileInfoDiv").height()),I=c("#fileInfoDiv").height()/2,c("#processed").css({maxHeight:I}),c("#processing").css({maxHeight:I}),c("#oldProcessed").css({maxHeight:I}),log.logInfo("Processing max "+document.getElementById("processing").style.maxHeight),window.onresize=function(){I=c("#fileInfoDiv").height()/2,log.logInfo("Resizing window "+I),c("#processed").css({maxHeight:I}),c("#processing").css({maxHeight:I}),c("#oldProcessed").css({maxHeight:I})},function(){var e=document.getElementById("processing-files"),t=document.createElement("h3");var o=document.createTextNode("Processing Files "),n=document.createElement("a");n.setAttribute("href","#"),n.setAttribute("id","processingToggle"),n.setAttribute("class","glyphicon cscope-icon glyphicon-triangle-bottom"),n.style.right="50px",n.style.position="absolute",t.style.position="relative",t.setAttribute("id","processingHeader"),t.setAttribute("class","survey-header"),t.appendChild(o),t.appendChild(n),e.insertBefore(t,e.firstChild);var i=document.getElementById("processed-files"),s=document.createElement("h3"),l=document.createTextNode("Processed Files "),r=document.createElement("a");r.setAttribute("href","#"),r.setAttribute("id","processedToggle"),r.setAttribute("class","glyphicon cscope-icon glyphicon-triangle-bottom"),r.style.right="50px",r.style.position="absolute",s.style.position="relative",s.setAttribute("id","processedHeader"),s.setAttribute("class","survey-header"),s.appendChild(l),s.appendChild(r),i.insertBefore(s,i.firstChild);var a=document.getElementById("old-processed-files"),c=document.createElement("h3"),g=document.createTextNode("Older Files "),d=document.createElement("a");d.setAttribute("href","#"),d.setAttribute("id","oldProcessedToggle"),d.setAttribute("class","glyphicon cscope-icon glyphicon-triangle-bottom"),d.style.right="50px",d.style.position="absolute",c.style.position="relative",c.setAttribute("id","oldProcessedHeader"),c.setAttribute("class","survey-header"),c.appendChild(g),c.appendChild(d),a.insertBefore(c,a.firstChild),A()}(),c("#processingHeader").click(function(){log.logInfo("processingToggle click"),h=!h,A("processing")}),c("#processedHeader").click(function(){log.logInfo("surveyToggle click"),y=!y,A("processed")}),c("#corruptToggle").click(function(){log.logInfo("corruptToggle click"),m=!m,A("corrupt")}),c("#oldProcessedHeader").click(function(){log.logInfo("oldProcessedToggle click"),b=!b,A("oldProcessed")}),AWS.config.region=f;var e={IdentityPoolId:u,Logins:{}};e.Logins[_config[d].cognito.Login]=g,log.logInfo("Identity Cred Params "+JSON.stringify(e)),AWS.config.credentials=new AWS.CognitoIdentityCredentials(e),log.logInfo("Creds "+JSON.stringify(AWS.config)),AWS.config.credentials.get(function(e){e?log.logError("Err getting creds "+JSON.stringify(e)):log.logInfo("Successfully got creds ")});var t=new AmazonCognitoIdentity.CognitoUserPool({UserPoolId:_config[d].cognito.userPoolId,ClientId:_config[d].cognito.userPoolClientId}).getCurrentUser().username;log.logInfo("user is "+JSON.stringify(t)),B(g,t),s3=new AWS.S3({apiVersion:"2006-03-01"});var o=D();log.logInfo("Locale "+o),n=t,i=o,s=document.getElementById("drop-zone"),l=document.getElementById("js-upload-form"),r=function(e,t){log.logInfo(t),function(e){for(var t=/(\.txt|\.cdf)$/i,o=0;or.getAttribute("value"),f=l.getAttribute("value")w(r.innerHTML),f=w(l.innerHTML)