{"version":3,"file":"AudienceSessionRestoreDetection.js","names":["AudienceSessionRestoreDetection","location","hash","removeHash","pathname","search","document","referrer","indexOf","hostname","message","currentAudience","restoreMessage","replace","investorType","country","messageTemplate","message$","$","init","showMessage","history","replaceState","title","window","e","prependTo","getBoundingClientRect","addClass","setTimeout","removeClass","cleanUp","bind","remove","initDefault"],"sources":["components/AudienceSessionRestoreDetection.js"],"sourcesContent":["import $ from 'jquery';\r\n\r\nexport class AudienceSessionRestoreDetection {\r\n\r\n constructor(){\r\n //When audience session is restored, the redirect includes a '#sessionrestored'\r\n //hash parameter. If not present, bail out.\r\n if(location.hash !== '#sessionrestored'){\r\n return;\r\n }\r\n\r\n\r\n this.removeHash();\r\n\r\n //When visiting the root homepage (ie the path `/`) when you have already selected\r\n // and audience type, the system will automatically redirect to an audience specific\r\n // homepage (intentional). We need to filter out attempts to visit homepage\r\n // from local pages since the message 'previous audience session restored'\r\n // message will not make sense.\r\n if(location.pathname.search(/^\\/[a-z]{2}\\/[a-z]{3}\\/[a-zA-Z0-9\\-\\_]+\\/?$/) >= 0 && document.referrer.indexOf(location.hostname) >= 0){\r\n //User has arrived at an audience homepage (eg '/en/gbr/investor') from a\r\n // page on the site (hence the referrer check above). Hence, the session restoration\r\n // is a false positive\r\n return;\r\n }\r\n\r\n let message = currentAudience.restoreMessage.replace(\"**%investor_type%**\", \"\" + currentAudience.investorType + \"\").replace(\"**%country%**\", \"\" + currentAudience.country + \"\")\r\n this.messageTemplate = `\r\n