{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/shared/utilities/getUrlParams.js","webpack:///./src/shared/utilities/cookies.js","webpack:///./src/framework/segmentation.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","__webpackPublicPath","Error","e","set","newPublicPath","console","warn","s","getUrlParams","url","arguments","length","undefined","window","location","search","test","slice","split","reduce","params","param","_param$split2","_slicedToArray","decodeURIComponent","replace","getLowerCaseUrlParams","casedParams","keys","acc","val","_objectSpread","_defineProperty","toLowerCase","getCookie","cname","ca","document","cookie","charAt","substring","indexOf","setCookie","expire","path","expires","concat","Date","toUTCString","cookieRegex","getSegmentationFromParams","queryParams","segKey","toString","getSegmentationFromCookie","aamCookie","aamSegPairs","segs","seg","match","push","sort","a","b","pop","getSegmentationFromAamWpCookie","delimiter","aamSegs","filter","init","cookieName","cookieVal","cookieExpiry","getTime","updateCookies","syncSegCookies"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YA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OAAO8D,eAAiBD","file":"segmentation-e91639ab.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/content/dist/\";\n \t// WebpackRequireFrom\n \ttypeof __webpack_require__ !== \"undefined\" && Object.defineProperty(__webpack_require__, \"p\", {\n \t get: function () {\n \ttry {\n \t if (typeof __webpackPublicPath !== \"function\") {\n \t throw new Error(\"WebpackRequireFrom: '__webpackPublicPath' is not a function or not available at runtime. See https://github.com/agoldis/webpack-require-from#troubleshooting\");\n \t }\n \t return __webpackPublicPath();\n \t} catch (e) {\n \t if (!true) {\n \t console.error(e);\n \t }\n \t return \"/content/dist/\";\n \t}\n \t },\n \t set: function (newPublicPath) {\n \t console.warn(\"WebpackRequireFrom: something is trying to override webpack public path. Ignoring the new value\" + newPublicPath + \".\");\n \t}\n \t});\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 574);\n","export function getUrlParams(url = window.location.search) {\r\n\tif (!url) {\r\n\t\treturn {};\r\n\t}\r\n\r\n\treturn (/^[?#]/.test(url) ? url.slice(1) : url).split('&').reduce((params, param) => {\r\n\t\tconst [key, value] = param.split('=');\r\n\t\tif (key !== '') {\r\n\t\t\tparams[key] = value ? decodeURIComponent(value.replace(/\\+/g, ' ')) : '';\r\n\t\t}\r\n\t\treturn params;\r\n\t}, {});\r\n}\r\n\r\nexport function getLowerCaseUrlParams(url = window.location.search) {\r\n\tconst casedParams = getUrlParams(url);\r\n\r\n\treturn Object.keys(casedParams).reduce(\r\n\t\t(acc, val) => ({\r\n\t\t\t...acc,\r\n\t\t\t[val.toLowerCase()]: casedParams[val]\r\n\t\t}),\r\n\t\t{}\r\n\t);\r\n}\r\n","// eslint-disable-next-line import/no-unresolved, import/extensions\r\nexport const getCookie = cname => {\r\n\tconst name = cname + '=';\r\n\tconst decodedCookie = decodeURIComponent(document.cookie);\r\n\tconst ca = decodedCookie.split(';');\r\n\tfor (let i = 0; i < ca.length; i++) {\r\n\t\tlet c = ca[i];\r\n\t\twhile (c.charAt(0) === ' ') {\r\n\t\t\tc = c.substring(1);\r\n\t\t}\r\n\t\tif (c.indexOf(name) === 0) {\r\n\t\t\treturn c.substring(name.length, c.length);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nexport const setCookie = (name, value, expire = 0, path = '/') => {\r\n\tconst expires = expire ? `expires=${new Date(expire).toUTCString()};` : '';\r\n\tdocument.cookie = `${name}=${value};${expires}path=${path}`;\r\n};\r\n","import { getCookie, setCookie } from '../shared/utilities/cookies';\r\nimport { getUrlParams } from '../shared/utilities/getUrlParams';\r\n\r\nconst segParam = 'seg';\r\nconst segWpParam = 'segwp';\r\nconst segCookieName = 'iit_seg';\r\nconst aamSegCookieName = 'iit_seg_aam';\r\nconst segWpCookieName = 'iit_seg_wp';\r\nconst aamSegWpCookieName = 'iit_seg_aam_wp';\r\nconst cookieRegex = /^[a-zA-Z0-9-]+$/;\r\n\r\nexport function getSegmentationFromParams(queryParams, segKey) {\r\n\tif (queryParams && queryParams[segKey]) {\r\n\t\treturn cookieRegex.test(queryParams[segKey].toString()) ? queryParams[segKey] : null;\r\n\t}\r\n\r\n\treturn null;\r\n}\r\n\r\n/** This function will be deprecated in subsequent PR to support new cookie format */\r\nexport function getSegmentationFromCookie(aamCookie) {\r\n\tconst aamSegPairs = aamCookie ? decodeURIComponent(aamCookie).split('-') : null;\r\n\tif (aamSegPairs) {\r\n\t\tconst segs = [];\r\n\t\tfor (let i = 0; i < aamSegPairs.length; ++i) {\r\n\t\t\tconst seg = aamSegPairs[i].split('=');\r\n\t\t\tif (seg[1] && seg[1].match(cookieRegex)) {\r\n\t\t\t\tsegs.push(seg[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (segs.length > 0) {\r\n\t\t\tsegs.sort((a, b) => a - b);\r\n\t\t\treturn segs.pop();\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n/** This function will be used going forward to decode cookie format(pipe format) */\r\nexport function getSegmentationFromAamWpCookie(aamCookie, delimiter = '|') {\r\n\tconst aamSegs = aamCookie ? decodeURIComponent(aamCookie).split('=') : [];\r\n\r\n\tif (aamSegs[1]) {\r\n\t\tconst segs = aamSegs[1]\r\n\t\t\t.split(delimiter)\r\n\t\t\t.filter(seg => seg && seg.match(cookieRegex))\r\n\t\t\t.sort((a, b) => a - b);\r\n\t\tif (segs.length) return segs.pop();\r\n\t}\r\n\r\n\treturn null;\r\n}\r\n\r\nexport function init(cookieName, cookieVal) {\r\n\tif (cookieVal) {\r\n\t\tconst cookieExpiry = new Date('2099-01-01T00:00:00.000Z');\r\n\t\tsetCookie(cookieName, cookieVal, cookieExpiry.getTime());\r\n\t}\r\n}\r\n\r\nfunction updateCookies() {\r\n\t/** set seg cookies */\r\n\tconst segVal =\r\n\t\tgetSegmentationFromParams(getUrlParams(), segParam) ||\r\n\t\tgetSegmentationFromCookie(getCookie(aamSegCookieName));\r\n\tinit(segCookieName, segVal);\r\n\t/** set seg amm wp cookies */\r\n\tconst segWpVal =\r\n\t\tgetSegmentationFromParams(getUrlParams(), segWpParam) ||\r\n\t\tgetSegmentationFromAamWpCookie(getCookie(aamSegWpCookieName));\r\n\tinit(segWpCookieName, segWpVal);\r\n}\r\n/*\r\n * Run segmentation cookie update on initial load.\r\n * */\r\nupdateCookies();\r\n/*\r\n * Run subsequent cookie update post initial load by, allowing other scripts\r\n * to trigger update (response from inital request will be reused to update cookies).\r\n * */\r\nwindow.syncSegCookies = updateCookies;\r\n"],"sourceRoot":""}