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AAQE,GACvBzC,OAAOD,UAAU2C,SAASF,EAAQG,OAASJ,EAC7C,GAAC,CAAAtB,IAAA,QAAAqB,MAED,SAAMM,EAAOL,GACX,IAAKA,EAAS,OAAO,KACrBA,EAAQC,OAA4B,OAAnBxC,OAAO6C,QAAmB,KAAO7C,OAAO6C,QAEzD7C,OAAOD,UAAU+C,MAAMF,EAAOL,EAChC,GAAC,CAAAtB,IAAA,OAAAqB,MAED,SAAKM,EAAOL,GACV,OAAKA,EACO,aAATK,EAA6B,MAChCL,EAAgB,OAAuB,OAAnBvC,OAAO6C,QAAmB,KAAO7C,OAAO6C,aAE5D7C,OAAOD,UAAUgD,KAAK,CAAC,EAAGH,EAAOL,IAJZ,IAKvB,M,8EAACP,CAAA,CAzBkB,GA6BrBhC,OAAOgD,gBAAkB,IAAIhB,C","sources":["webpack://mission-frontend/./app/javascript/packs/segment.js"],"sourcesContent":["// Segment snippet\n!(function () {\n var analytics = (window.analytics = window.analytics || []);\n if (!analytics.initialize)\n if (analytics.invoked) {\n window.console && console.error && console.error(\"Segment snippet included twice.\");\n } else {\n analytics.invoked = !0;\n analytics.methods = [\n \"trackSubmit\",\n \"trackClick\",\n \"trackLink\",\n \"trackForm\",\n \"pageview\",\n \"identify\",\n \"reset\",\n \"group\",\n \"track\",\n \"ready\",\n \"alias\",\n \"debug\",\n \"page\",\n \"once\",\n \"off\",\n \"on\",\n \"addSourceMiddleware\",\n \"addIntegrationMiddleware\",\n \"setAnonymousId\",\n \"addDestinationMiddleware\",\n ];\n analytics.factory = function (e) {\n return function () {\n var t = Array.prototype.slice.call(arguments);\n t.unshift(e);\n analytics.push(t);\n return analytics;\n };\n };\n for (var e = 0; e < analytics.methods.length; e++) {\n var key = analytics.methods[e];\n analytics[key] = analytics.factory(key);\n }\n analytics.load = function (key, e) {\n var t = document.createElement(\"script\");\n t.type = \"text/javascript\";\n t.async = !0;\n t.src = \"https://sc.mission.dev/analytics.js/v1/\" + key + \"/analytics.min.js\";\n var n = document.getElementsByTagName(\"script\")[0];\n n.parentNode.insertBefore(t, n);\n analytics._loadOptions = e;\n };\n analytics._writeKey =process.env.SEGMENT_WRITE_KEY_FE;\n analytics.SNIPPET_VERSION = \"4.13.2\";\n analytics.load(process.env.SEGMENT_WRITE_KEY_FE);\n }\n})();\n\n// This is a mini-wrapper around Segment's Analytics.js that allows us to further simplify\n// instrumenting the application under its various environments\nclass AnalyticsClient {\n constructor() {\n this.environment = window.ENV || \"unknown\";\n this.shouldRelayToIntegrations = this.environment === \"production\";\n }\n\n identify(payload) {\n if (!payload) return null;\n const userId = payload.id;\n window.analytics.identify(userId, traits = payload);\n }\n\n track(event, payload) {\n if (!payload) return null;\n payload.userId = window.USER_ID === null ? null : window.USER_ID\n\n window.analytics.track(event, payload);\n }\n\n page(event, payload) {\n if (!payload) return null;\n if(event == 'undefined') return null;\n payload['userId'] = window.USER_ID === null ? null : window.USER_ID\n\n window.analytics.page({}, event, payload);\n }\n}\n\n// Analytics client\nwindow.analyticsClient = new AnalyticsClient();\n\n// Basic Page Tracking\n// document.addEventListener(\"DOMContentLoaded\", function () {\n// window.analyticsClient.page();\n// });\n"],"names":["analytics","window","initialize","invoked","console","error","methods","factory","e","t","Array","prototype","slice","call","arguments","unshift","push","length","key","load","document","createElement","type","async","src","n","getElementsByTagName","parentNode","insertBefore","_loadOptions","_writeKey","process","SNIPPET_VERSION","AnalyticsClient","_classCallCheck","this","environment","ENV","shouldRelayToIntegrations","value","payload","userId","id","identify","traits","event","USER_ID","track","page","analyticsClient"],"sourceRoot":""}