1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory();
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define([], factory);
|
6 | else {
|
7 | var a = factory();
|
8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
9 | }
|
10 | })(this, function() {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId])
|
20 | return installedModules[moduleId].exports;
|
21 |
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | exports: {},
|
25 | id: moduleId,
|
26 | loaded: false
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.loaded = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.p = "";
|
48 |
|
49 |
|
50 | return __webpack_require__(0);
|
51 | })
|
52 |
|
53 | ({
|
54 |
|
55 | 0:
|
56 | function(module, exports, __webpack_require__) {
|
57 |
|
58 | 'use strict';
|
59 |
|
60 | var _require = __webpack_require__(14),
|
61 | Segment = _require.Segment;
|
62 |
|
63 | module.exports = { Segment: Segment };
|
64 |
|
65 | },
|
66 |
|
67 | 14:
|
68 | function(module, exports) {
|
69 |
|
70 | 'use strict';
|
71 |
|
72 | |
73 |
|
74 |
|
75 | function sendSegmentEvent(events) {
|
76 | if (!window) return;
|
77 | if (!window.analytics) {
|
78 | throw new Error('window.analytics is not defined, Have you forgotten to include the Segment tracking snippet?');
|
79 | }
|
80 | events.forEach(function (event) {
|
81 | switch (event.hitType) {
|
82 | case 'identify':
|
83 | window.analytics.identify(event.userId, event);
|
84 | break;
|
85 | case 'group':
|
86 | window.analytics.group(event.groupId, event);
|
87 | break;
|
88 | case 'pageview':
|
89 | window.analytics.page(event.page);
|
90 | break;
|
91 | case 'event':
|
92 | window.analytics.track(event.eventAction, event);
|
93 | break;
|
94 | case 'alias':
|
95 | window.analytics.alias(event.userId);
|
96 | break;
|
97 | default:
|
98 | break;
|
99 | }
|
100 | });
|
101 | }
|
102 |
|
103 | module.exports = {
|
104 | Segment: sendSegmentEvent
|
105 | };
|
106 |
|
107 | }
|
108 |
|
109 | })
|
110 | });
|
111 | ; |
\ | No newline at end of file |