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AAa,EACbqC,cAAa,EACbE,aAAY,EACZrB,cAAa,EACbkB,kBAAiB,EACjB1B,yBAAwB,EACxBJ,0BAAyB,EACzBiB,mBAAkB,EAClBC,0BAAyB,EACzBF,gBAAe,EACfvD,YAAW,cACXb,kBAAiB,oBACjBuC,gBAAe,oB","sources":["webpack://cortexApp/webpack/universalModuleDefinition","webpack://cortexApp/src/D:\\git\\com.ledgerbennett.trackingScript\\src\\CortexAppConfig.ts","webpack://cortexApp/src/D:\\git\\com.ledgerbennett.trackingScript\\src\\CortexTouch.ts","webpack://cortexApp/src/D:\\git\\com.ledgerbennett.trackingScript\\src\\CortexTouchSource.ts","webpack://cortexApp/webpack/bootstrap","webpack://cortexApp/webpack/runtime/define property getters","webpack://cortexApp/webpack/runtime/hasOwnProperty shorthand","webpack://cortexApp/webpack/runtime/make namespace object","webpack://cortexApp/src/D:\\git\\com.ledgerbennett.trackingScript\\src\\cortexApp.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"cortexApp\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"cortexApp\"] = factory();\n\telse\n\t\troot[\"cortexApp\"] = factory();\n})(self, () => {\nreturn ","/** Class representing an individual Cortex touch */\nexport class CortexAppConfig {\n /**\n * Should the script automatically detect touches within the page or wait to be triggered manually?\n * If true, cortexApp.detectTouches() will be called after document.load\n * If false, cortexApp.detectTouches() should be called from a html script tag\n *\n * @type {boolean}\n * @memberof CortexAppConfig\n */\n autoDetectTouches: boolean;\n\n /**\n * Should the script automatically bind to form submit events?\n *\n * @type {boolean}\n * @memberof CortexAppConfig\n */\n autoBindToFormSubmits: boolean;\n\n /**\n * Number of minutes after which a new touch will be recorded indicated an idle session refreshing\n *\n * @type {number}\n * @memberof CortexAppConfig\n */\n sessionExpiryInMinutes: number;\n\n /**\n * Array of querystring variables that the script will detect\n *\n * @type {Array}\n * @default [\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_term\",\"utm_content\",\"gclid\",\"wbraid\",\"gbraid\",\"fbclid\"]\n * @memberof CortexAppConfig\n */\n queryStringToCheck: Array;\n\n /**\n * This is the id of the input (probably hidden) within a html form to recieve the JSON string of the touch history\n *\n * @type {string}\n * @default [\"CortexTouches\"]\n * @memberof CortexAppConfig\n */\n fieldNameToPopulate: string;\n\n /**\n * Should the JSON data passed to the form be a closed JSON array [{touch},{touch}] or a list of JSON objects {touch},{touch},\n * The latter allows for appending to previous values. Default\n *\n * @type {boolean}\n * @default [true]\n * @memberof CortexAppConfig\n */\n formDataAsArray: boolean;\n\n /**\n * Should the touches history be cleared automatically when populateFormByFormObject or populateFormBySubmitEvent is called.\n * If false, the startNewSession() function should be called as needed.\n *\n * @type {boolean}\n * @default [true]\n * @memberof CortexAppConfig\n */\n clearSessionOnFormSubmit: boolean;\n\n /**\n * Display console debug messages\n * If true, console.debug messages will be logged at hey moments.\n *\n * @type {boolean}\n * @default [false]\n * @memberof CortexAppConfig\n */\n debugMode: boolean;\n\n /**\n * Creates an instance of CortexAppConfig.\n * @memberof CortexAppConfig\n */\n constructor() {\n this.autoDetectTouches = false;\n this.autoBindToFormSubmits = false;\n this.sessionExpiryInMinutes = 20;\n this.queryStringToCheck = [\n // utm parameters\n \"utm_source\",\n \"utm_medium\",\n \"utm_campaign\",\n \"utm_term\",\n \"utm_content\",\n // google clicks\n \"gclid\",\n \"wbraid\",\n \"gbraid\",\n // facebook clicks\n \"fbclid\",\n // microsoft clicks\n \"msclkid\"\n ];\n this.fieldNameToPopulate = \"CortexTouches\";\n this.formDataAsArray = true;\n this.clearSessionOnFormSubmit = true;\n this.debugMode = false;\n }\n}","import { CortexTouchSource } from \"./CortexTouchSource\";\n\n/**\n * Cortex Session Touch Model\n *\n * @export\n * @class CortexTouch\n * @property {CortexTouchSource} touchSource\n * @property {CortexTouchGroup} touchGroup\n * @property {Date} timestamp\n * @property {string} referrer\n * @property {string} location\n * @property {object} qsValues\n * @property {string} userAgent\n */\nexport class CortexTouch {\n touchSource: CortexTouchSource;\n timestamp: Date;\n referrer: string;\n location: string;\n qsValues: object;\n userAgent: string;\n\n /**\n * Creates an instance of CortexTouch.\n * @constructor\n * @memberof CortexTouch\n */\n constructor() {\n const w: Window = window, d: Document = w.document;\n const existingSession = w.sessionStorage.getItem(\"existingCortexSession\");\n const haveReferrer: boolean = d.referrer !== \"\";\n\n\n this.touchSource = CortexTouchSource.Unknown;\n\n if (existingSession == null) {\n if (haveReferrer) {\n const likelySource: CortexTouchSource = d.location.hostname == new URL(d.referrer).hostname\n ? CortexTouchSource.Direct\n : CortexTouchSource.External;\n this.touchSource = likelySource;\n } else {\n // new session so assume direct open to url\n this.touchSource = CortexTouchSource.Direct;\n }\n w.sessionStorage.setItem(\"existingCortexSession\", this.touchSource);\n }\n else {\n if (haveReferrer) {\n const likelySource: CortexTouchSource = d.location.hostname == new URL(d.referrer).hostname\n ? CortexTouchSource.Direct\n : CortexTouchSource.External;\n this.touchSource = likelySource;\n } else {\n this.touchSource = existingSession as CortexTouchSource;\n }\n }\n\n this.timestamp = new Date(Date.now());\n this.referrer = d.referrer;\n this.location = d.location.href;\n this.qsValues = {};\n this.userAgent = w.navigator.userAgent;\n }\n}\n\nexport default {\n CortexTouch,\n CortexTouchSource\n}","\n\n/**\n * Enum to describe the http referer\n *\n * @export\n * @enum {string}\n */\nexport enum CortexTouchSource {\n /** @member {string} */\n /** The referer is the same domain as the current location */\n Direct = \"direct\",\n /** @member {string} */\n /** The referer is a different domain to the current location */\n External = \"external\",\n /** @member {string} */\n /** The referer was blank */\n Unknown = \"unknown\"\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { CortexTouch } from './CortexTouch';\nimport { CortexTouchSource } from \"./CortexTouchSource\";\nimport { CortexAppConfig } from \"./CortexAppConfig\";\n\nconst w: Window = window, ls: Storage = w.localStorage;\nconst defaultConfiguration: CortexAppConfig = new CortexAppConfig();\n\nlet configuration: CortexAppConfig = { ...defaultConfiguration };\n\n/**\n * Initialise the tracking library\n *\n * @export\n * @description This is automatically called and only needs to be called again if configuration changes are rquired.\n * @param {CortexAppConfig} configOverrides\n */\nexport function init(configOverrides?: CortexAppConfig) {\n configuration = { ...defaultConfiguration, ...configOverrides };\n\n if (configuration.debugMode) {\n console.debug(\"CortexApp: Debug mode enabled\");\n }\n configuration.autoDetectTouches\n ? w.addEventListener(\"load\", detectTouches)\n : w.removeEventListener(\"load\", detectTouches);\n\n if (configuration.debugMode) {\n console.debug(configuration.autoDetectTouches\n ? \"CortexApp: Auto touch detection\" : \"CortexApp: Manual touch detection\");\n }\n\n for (let i = 0; i < document.forms.length; i++) {\n const form: HTMLFormElement = document.forms[i];\n configuration.autoBindToFormSubmits\n ? form.addEventListener(\"submit\", populateFormBySubmitEvent)\n : form.removeEventListener(\"submit\", populateFormBySubmitEvent);\n if (configuration.debugMode) { console.debug(configuration.autoBindToFormSubmits ? \"CortexApp : Listening to form [id=\" + form.id + \"]\" : \"CortexApp : Not listening to form [id=\" + form.id + \"]\"); }\n }\n}\n\n/**\n * Attach recorded touches to form data\n *\n * @export\n * @description If the form contains an input as specified in configuration.fieldNameToPopulate then set the value of the field to be JSON string of the touch history.\n * @param {Event} submitEvent - form submit event OR submitted\n */\nexport function populateFormBySubmitEvent(submitEvent: Event) {\n let form: HTMLFormElement = null;\n if (submitEvent instanceof Event) {\n form = submitEvent.target as HTMLFormElement;\n }\n else { return; }\n\n populateFormByFormObject(form);\n}\n\n/**\n * Attach recorded touches to form data\n *\n * @export\n * @description If the form contains an input as specified in configuration.fieldNameToPopulate then set the value of the field to be JSON string of the touch history. Calling this will also call startNewSession()\n * @param {HTMLFormElement} form - form submit event OR\n */\nexport function populateFormByFormObject(form: HTMLFormElement) {\n if (form instanceof HTMLFormElement) {\n\n const element: HTMLInputElement = form.elements[configuration.fieldNameToPopulate];\n\n if (element) {\n if (configuration.debugMode) { console.debug(\"CortexApp : Populating field \" + configuration.fieldNameToPopulate + \" on form [id=\" + form.id + \"]\"); }\n const touchData: string = JSON.stringify(getAllTouches(), null, 1);\n const touchDataObjectsOnly: string = touchData.substring(1).slice(0, -1) + \",\";\n element.value = configuration.formDataAsArray ? touchData : touchDataObjectsOnly;\n if (configuration.clearSessionOnFormSubmit) {\n startNewSession();\n }\n }\n } else { return; }\n}\n\n/**\n * Manually bind to the given form's submit event element to populateFormBySubmitEvent function\n *\n * @export\n * @param {HTMLFormElement} form - html form element\n */\nexport function listenToFormSubmit(form: HTMLFormElement) {\n form.removeEventListener(\"submit\", populateFormBySubmitEvent);\n form.addEventListener(\"submit\", populateFormBySubmitEvent);\n}\n\n/**\n * Manually unbind to the given form's submit event element to populateFormBySubmitEvent function\n *\n * @export\n * @param {HTMLFormElement} form - html form element\n */\nexport function stopListeningToFormSubmit(form: HTMLFormElement) {\n form.removeEventListener(\"submit\", populateFormBySubmitEvent);\n}\n\n/**\n * Get the current Cortex Tracking Configuration\n *\n * @export\n * @return {CortexAppConfig}\n */\nexport function currentConfiguration(): CortexAppConfig {\n return configuration;\n}\n\n/**\n * Parses the current pages meta data for Cortex Touches\n *\n * @export\n */\nexport function detectTouches() {\n const queryStringVariables = new Proxy(\n new URLSearchParams(window.location.search),\n {\n get: (searchqueryStringVariables, prop: string) =>\n searchqueryStringVariables.get(prop),\n }\n );\n\n const t: CortexTouch = new CortexTouch();\n let hasValue = false;\n\n configuration.queryStringToCheck.forEach((qs: string) => {\n const v = queryStringVariables[qs];\n if (v != null) { t.qsValues[qs] = v; }\n hasValue = hasValue || (v != null);\n });\n\n addTouchToHistory(t);\n}\n\n/**\n * Get the first recorded touch object\n *\n * @export\n * @return {(CortexTouch|null)}\n */\nexport function getFirstTouch(): CortexTouch {\n const at: CortexTouch[] = getAllTouches();\n return at.length == 0 ? null : at[0];\n}\n\n/**\n * Get the last recorded touch object\n *\n * @export\n * @return {(CortexTouch|null)}\n */\nexport function getLastTouch(): CortexTouch {\n return JSON.parse(ls.getItem(\"lastTouch\"));\n}\n\n/**\n * Get all recorded touches\n *\n * @export\n * @return {(CortexTouch[]|[])}\n */\nexport function getAllTouches(): CortexTouch[] {\n const at = JSON.parse(ls.getItem(\"allTouches\")) || [];\n if (at.length > 0) {\n return at.sort((a: { timestamp: number; }, b: { timestamp: number; }) => b.timestamp - a.timestamp);\n } else {\n return at;\n }\n}\n\n/**\n * Clear all recorded touches\n *\n * @export\n */\nexport function startNewSession() {\n if (configuration.debugMode) { console.debug(\"CortexApp : Clearing touch history\"); }\n ls.removeItem(\"allTouches\");\n}\n\n/**\n * Add a touch object into the current history of touches.\n *\n * @export\n * @param {CortexTouch} oTouch\n */\nexport function addTouchToHistory(oTouch: CortexTouch) {\n const se = new Date(JSON.parse(ls.getItem(\"sessionExpires\")));\n const lt = getLastTouch();\n\n const neverLoggedTouch: boolean = (se == null || lt == null);\n const sessionExpiryPassed: boolean = se < oTouch.timestamp;\n const paramsHaveChanged: boolean = lt != null && JSON.stringify(lt.qsValues) != JSON.stringify(oTouch.qsValues);\n const externalWithoutParams: boolean = oTouch.touchSource == CortexTouchSource.External && Object.keys(oTouch.qsValues).length == 0;\n const sourceHasChanged: boolean = lt != null && lt.touchSource != oTouch.touchSource;\n\n // log only when needed\n if (\n neverLoggedTouch ||\n sessionExpiryPassed ||\n paramsHaveChanged ||\n externalWithoutParams ||\n sourceHasChanged\n ) {\n // add to touches\n const at: CortexTouch[] = getAllTouches() || [];\n at.push(oTouch);\n ls.setItem(\"allTouches\", JSON.stringify(at));\n ls.setItem(\"lastTouch\", JSON.stringify(oTouch))\n }\n const expires: Date = new Date(\n new Date(Date.now()).getTime() +\n configuration.sessionExpiryInMinutes * 60000\n );\n ls.setItem(\"sessionExpires\", JSON.stringify(expires));\n if (configuration.debugMode) { console.debug(\"CortexApp : Touch added to history\", oTouch); }\n}\n// client specific overides\n\nconst cso: CortexAppConfig = new CortexAppConfig();\n\n// default init\ninit(cso);\n\nexport default {\n init,\n currentConfiguration,\n detectTouches,\n getFirstTouch,\n getLastTouch,\n getAllTouches,\n addTouchToHistory,\n populateFormByFormObject,\n populateFormBySubmitEvent,\n listenToFormSubmit,\n stopListeningToFormSubmit,\n startNewSession,\n CortexTouch,\n CortexTouchSource,\n CortexAppConfig\n};\n"],"names":["root","factory","exports","module","define","amd","self","this","autoDetectTouches","autoBindToFormSubmits","sessionExpiryInMinutes","queryStringToCheck","fieldNameToPopulate","formDataAsArray","clearSessionOnFormSubmit","debugMode","w","window","d","document","existingSession","sessionStorage","getItem","haveReferrer","referrer","touchSource","CortexTouchSource","likelySource","location","hostname","URL","setItem","timestamp","Date","now","href","qsValues","userAgent","navigator","CortexTouch","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","ls","localStorage","defaultConfiguration","CortexAppConfig","configuration","init","configOverrides","console","debug","addEventListener","detectTouches","removeEventListener","i","forms","length","form","populateFormBySubmitEvent","id","submitEvent","Event","populateFormByFormObject","target","HTMLFormElement","element","elements","touchData","JSON","stringify","getAllTouches","touchDataObjectsOnly","substring","slice","startNewSession","listenToFormSubmit","stopListeningToFormSubmit","currentConfiguration","queryStringVariables","Proxy","URLSearchParams","search","searchqueryStringVariables","t","hasValue","forEach","qs","v","addTouchToHistory","getFirstTouch","at","getLastTouch","parse","sort","a","b","removeItem","oTouch","se","lt","neverLoggedTouch","sessionExpiryPassed","paramsHaveChanged","externalWithoutParams","keys","sourceHasChanged","push","expires","getTime"],"sourceRoot":""}