define(["Ti/_","Ti/API","Ti/_/analytics","Ti/App","Ti/_/Evented","Ti/_/has","Ti/_/lang","Ti/_/ready","Ti/_/style","Ti/Buffer","Ti/Platform","Ti/UI","Ti/Locale","Ti/_/include"],function(e,t,n,i,o,r,a,s,l,u,d,c){function p(){}function f(){m||(m=1,i.fireEvent("close"),n.add("ti.end","ti.end"))}var h,m,y,g,T=window,v=require,A=v.config,b=i.deployType,w=A.ti.version,_=(v.is,v.on),O=[],E=a.setObject("Ti",o,{constants:{buildDate:A.ti.buildDate,buildHash:A.ti.buildHash,version:w},properties:{userAgent:function(){return navigator.userAgent}},createBuffer:function(e){return new u(e)},include:function(e){"array"==typeof e||(e=[].concat(Array.prototype.slice.call(arguments,0))),e.forEach(function(e){require("Ti/_/include!"+e)})},deferStart:function(){if(!h){var e=Math.round(1e12*Math.random());return O.push(e),function(){var t=O.indexOf(e);~t&&O.splice(t,1),h=1,O.length||(r("ti-instrumentation")&&instrumentation.stopTest(instrumentation.systemLoadTimeTest),require(A.main||["app.js"]))}}t.warn("app.js already loaded!")}}),N=E.deferStart();if(r("function-bind")||(Function.prototype.bind=function(e){var t=this,n=Array.prototype.slice,i=n.call(arguments,1),o=function(){var r,a=i.concat(n.call(arguments));return this instanceof o?(r=t.apply(this,a),Object(r)===r?r:this):t.apply(e,a)};return t.prototype&&(p.prototype=t.prototype,o.prototype=new p,p.prototype=null),o}),!r("js-btoa")){var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",C=String.fromCharCode;T.btoa=function(e){for(var t,n,i,o,r,a,s,l=[],u=0,d=e.length;d>u;)t=e.charCodeAt(u++),n=e.charCodeAt(u++),i=e.charCodeAt(u++),o=t>>2,r=(3&t)<<4|n>>4,a=(15&n)<<2|i>>6,s=63&i,isNaN(n)?a=s=64:isNaN(i)&&(s=64),l.push(x.charAt(o)+x.charAt(r)+x.charAt(a)+x.charAt(s));return l.join("")},T.atob=function(e){var t,n,i,o,r=[],a=0,s=e.length;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");s>a;)t=x.indexOf(e.charAt(a++)),n=x.indexOf(e.charAt(a++)),i=x.indexOf(e.charAt(a++)),o=x.indexOf(e.charAt(a++)),r.push(C(t<<2|n>>4)),64!==i&&r.push(C((15&n)<<4|i>>2)),64!==o&&r.push(C((3&i)<<6|o));return r.join("")}}return r("winstore_extensions")&&(T.alert=function(e){g?t.warn("Cannot show more than one alert at a time"):(g=1,new Windows.UI.Popups.MessageDialog(e).showAsync().done(function(){g=0}))}),Object.defineProperty(T,"Ti",{value:E,writable:!1}),Object.defineProperty(T,"Titanium",{value:E,writable:!1}),t.info("Appcelerator Titanium "+w+" Mobile Web"),A.vendorPrefixes||(A.vendorPrefixes=["","Moz","Webkit","O","ms"]),E.parse=JSON.parse,E.stringify=JSON.stringify,_(T,"beforeunload",f),_(T,"unload",f),r("ti-show-errors")&&_(T,"error",function(e){function t(e,t,n,i){l.add(c.createLabel({color:n,font:{fontSize:i,fontWeight:"bold"},height:t,left:10,right:10,textAlign:c.TEXT_ALIGNMENT_CENTER,text:e}))}if(!y){y=1;var n,i,o=e.filename||"",r=o.match(/:\/\/.+(\/.*)/),a=r?r[1]:e.filename,s=e.lineno,l=c.createWindow({backgroundColor:"#f00",top:"100%",height:"100%",layout:c._LAYOUT_CONSTRAINING_VERTICAL});t("Application Error","15%","#0f0","24pt"),t((e.message||"Unknown error").trim()+(a&&"undefined"!==a?" at "+a:"")+(s?" (line "+s+")":""),"45%","#fff","16pt"),l.add(n=c.createView({height:"12%"})),n.add(i=c.createButton({title:"Dismiss"})),l.addEventListener("close",function(){l.destroy()}),i.addEventListener("singletap",function(){l.animate({duration:500,top:"100%"},function(){l.close(),y=0})}),t("Error messages will only be displayed during development. When your app is packaged for final distribution, no error screen will appear. Test your code!","28%","#000","10pt"),_.once(l,"postlayout",function(){setTimeout(function(){l.animate({duration:500,top:0},function(){l.top=0,l.height="100%"})},100)}),l.open()}return!0}),s(function(){l.set(document.body,{margin:0,padding:0}),i.analytics&&(null===localStorage.getItem("ti:enrolled")&&(n.add("ti.enroll","ti.enroll",{app_name:i.name,app_version:i.version,oscpu:1,mac_addr:null,deploytype:b,ostype:d.osname,osarch:null,app_id:i.id,platform:d.name,model:d.model}),localStorage.setItem("ti:enrolled",!0)),n.add("ti.start","ti.start",{tz:(new Date).getTimezoneOffset(),deploytype:b,os:d.osname,osver:d.ostype,version:A.ti.version,platform:d.name,model:d.model,un:null,app_version:i.version,nettype:null}),n.send()),setTimeout(N,1)}),E});