GT2/GT2-iOS/node_modules/xdl/build/__sourcemaps__/Analytics.js.map

1 line
5.0 KiB
Plaintext
Raw Normal View History

2018-02-12 17:26:06 +00:00
{"version":3,"sources":["Analytics.js"],"names":["flush","setSegmentNodeKey","setSegmentWebInstance","setUserProperties","setVersionName","logEvent","let","_segmentNodeInstance","_segmentWebInstance","_userId","_version","PLATFORM_TO_ANALYTICS_PLATFORM","darwin","win32","linux","cb","key","flushAfter","instance","userId","traits","identify","context","_getContext","window","analytics","version","amplitude","getInstance","name","properties","track","event","platform","os","ip","address","device","model","brand","release","app"],"mappings":";;;;;QAkBgBA,K,GAAAA,K;QAKAC,iB,GAAAA,iB;QAKAC,qB,GAAAA,qB;QAIAC,iB,GAAAA,iB;QAqBAC,c,GAAAA,c;QAcAC,Q,GAAAA,Q;;;;AA/DhB;AAAA;AAAA;;AACA;;;;AACA;AAAA;AAAA;;;;AAEAC,IAAIC,oBAAJD;;AACAA,IAAIE,mBAAJF;AACAA,IAAIG,OAAJH;AACAA,IAAII,QAAJJ;AACA,MAAMK,iCAAiC;AACrCC,UAAQ,KAD6B;AAErCC,SAAO,SAF8B;AAGrCC,SAAO;AAH8B,CAAvC;;AAMO,SAASd,KAAT,CAAee,EAAf,EAAmB;AACxB,MAAIP,mBAAJ,EAAyBA,oBAAoBR,KAApBQ,CAA0BO,EAA1BP;AACzB,MAAID,oBAAJ,EAA0BA,qBAAqBP,KAArBO,CAA2BQ,EAA3BR;AAC5B;;AAEO,SAASN,iBAAT,CAA2Be,GAA3B,EAAwC;AAC7C;AACAT,yBAAuB,sDAAYS,GAAZ,EAAiB,EAAEC,YAAY,GAAd,EAAjB,CAAvBV;AACF;;AAEO,SAASL,qBAAT,CAA+BgB,QAA/B,EAA8C;AACnDV,wBAAsBU,QAAtBV;AACF;;AAEO,SAASL,iBAAT,CAA2BgB,MAA3B,EAA2CC,MAA3C,EAAwD;AAC7DX,YAAUU,MAAVV;;AAEA,MAAIF,oBAAJ,EAA0B;AACxBA,yBAAq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AAGM,OAAHN;AAFP,KANQ;AAUZO,SAAK;AAVO,GAAdnC;;AAaA,MAAII,QAAJ,EAAc;AACZY,YAAQmB,GAARnB,GAAc;AACZI,eAAShB;AADG,KAAdY;AAGF;;AAEA,SAAOA,OAAP;AACF","file":"../Analytics.js","sourcesContent":["/**\n * @flow\n */\n\nimport ip from './ip';\nimport os from 'os';\nimport Segment from 'analytics-node';\n\nlet _segmentNodeInstance;\nlet _segmentWebInstance;\nlet _userId;\nlet _version;\nconst PLATFORM_TO_ANALYTICS_PLATFORM = {\n darwin: 'Mac',\n win32: 'Windows',\n linux: 'Linux',\n};\n\nexport function flush(cb) {\n if (_segmentWebInstance) _segmentWebInstance.flush(cb);\n if (_segmentNodeInstance) _segmentNodeInstance.flush(cb);\n}\n\nexport function setSegmentNodeKey(key: string) {\n // Do not wait before flushing, we want node to close immediately if the programs ends\n _segmentNodeInstance = new Segment(key, { flushAfter: 300 });\n}\n\nexport function setSegmentWebInstance(instance: any) {\n _segmentWebInstance = instance;\n}\n\nexport function setUserProperties(userId: string, traits: any) {\n _userId = userId;\n\n if (_segmentNodeInstance) {\n _segmentNodeInstance.identify({\n userId,\n traits,\n context: _getContext(),\n });\n }\n\n if (_segmentWebInstance) {\n // The Amplitude SDK isn't initialized right away, so call setVersion before every call to make sure it's actually updated.\n setVersionName(_version);\n\n window.analytics.identify(userId, traits, {\n context: _getContext(),\n });\n }\n}\n\nexport function setVersionName(version: string) {\n _version = version;\n\n if (\n _segmentWebInstance &&\n window.amplitude &&\n window.amplitude.getInstance &&\n window.amplitude.getInstance()\n ) {\n // Segment injects amplitude into the window. Call this manually because