function dataCollection(){function b(){w(),O()}function w(){r={},s={},o={},a=new Date,f=0,l=0,c="",v=!0,m=!1,g=1e4,y=5}function E(){S(),x(),T()}function S(e){e==null?r.envelope=M():r.envelope=e}function x(e){e==null?r.payload=_():r.payload=e}function T(){}function N(e){r.payload&&r.payload.events&&(e!=undefined&&r.payload.events.push(e),v||m?H():B()&&r.payload.events.length>=y&&H())}function C(){return v}function k(e){v=e}function L(){m=!0,inSetupWizard&&H(m)}function A(){return a}function O(){}function M(){return s.protocolVersion=e,s.payloadType="stapp",s.payloadProtocolVersion=n,s.uniqueId=guid,s.time=a,s}function _(){return inSetupWizard?o.boseID=funcObj.setupWizard.get_bose_accountID():o.boseID=funcObj.margeComm.getAccountID(),o.language=curLang,o.frameVersion=frame_version,o.guiVersion=gui_version,o.protocolVersion=protocol_version,o.devicePlatform=platform,o.deviceManufacturer=manufacturer,o.deviceSize=screenSize,o.deviceModel=deviceModel,o.deviceOSversion=osversion,o.events||(o.events=[]),o}function D(e){inSetupWizard?new dcSetup(e,null):new dcEvent(e)}function P(e){var t=!1,n=$(e.target).parents();for(var r in n)n[r].id=="wizard_right"&&(t=!0);return t}function H(){if(r.payload.boseID==undefined)return;if(r.payload.events.length===0)return;d==undefined&&(inSetupWizard?d=funcObj.setupWizard.get_bose_userAuthToken():d=funcObj.margeComm.getAuthToken());var e={Authorization:d},t="";try{t=JSON.stringify(r)}catch(n){showDebug===2&&console.error("Data Collection Error: Data inappropriate "+n);return}showDebug>=2&&console.log("dcString: "+t),$.ajax({type:"post",url:BASE_DATACOLLECTION_URL+r.payload.boseID,headers:funcObj.UIMain.prepareAjaxHeaders(e),contentType:"application/json",data:t}).done(function(e,t,n){m=!1}).fail(function(e,t,n){showDebug===2&&console.log("Data Collection: Failed to send data to server. Reason: ",t)}),r.payload.events=[]}function B(){var e=r.payload.events;for(i=0;i<e.length;i++)if(e[i].data.catalyst!=undefined&&e[i].data.snapshot==undefined)return!1;return!0}var e="1.0",t="stapp",n="60.0",r,s,o,u,a,f,l,c,h,p,d,v,m,g,y;this.setup=E,this.setEnvelope=S,this.setPayload=x,this.appOpen=T,this.addEvent=N,this.getSendEach=C,this.setSendEach=k,this.forceSendData=L,this.getStartTime=A,this.sendData=H,this.getPayload=_,b()};