{"version":3,"file":"SessionLoggedOutDetection.js","names":["SessionLoggedOutDetection","location","hash","removeHash","message","sessionLoggedOutMessage","messageTemplate","message$","$","init","showMessage","history","replaceState","document","title","window","pathname","search","e","prependTo","getBoundingClientRect","addClass","setTimeout","removeClass","cleanUp","bind","remove","initDefault"],"sources":["components/SessionLoggedOutDetection.js"],"sourcesContent":["import $ from 'jquery';\r\n\r\nexport class SessionLoggedOutDetection {\r\n\r\n constructor(){\r\n //When current session is logged out, the redirect includes a '#sessionloggedout'\r\n //hash parameter. If not present, bail out.\r\n if(location.hash !== '#sessionloggedout'){\r\n return;\r\n }\r\n\r\n\r\n this.removeHash();\r\n\r\n let message = sessionLoggedOutMessage;\r\n this.messageTemplate = `\r\n
\r\n ${message}\r\n
\r\n `;\r\n this.message$ = $(this.messageTemplate);\r\n\r\n this.init();\r\n }\r\n\r\n init(){\r\n this.showMessage();\r\n }\r\n\r\n /**\r\n * Remove hash so URL is clean\r\n */\r\n removeHash () {\r\n try {\r\n history.replaceState('', document.title, window.location.pathname + window.location.search);\r\n } catch(e){\r\n location.hash = '';\r\n }\r\n }\r\n\r\n /**\r\n * Show toast message to user\r\n */\r\n showMessage(){\r\n //Add to header on top (CSS will have it hidden off screen)\r\n this.message$.prependTo(\"header\");\r\n\r\n //Trigger browser paint\r\n this.message$[0].getBoundingClientRect();\r\n\r\n this.message$.addClass('active');\r\n\r\n setTimeout(()=>{\r\n this.message$.removeClass('active');\r\n\r\n setTimeout(this.cleanUp.bind(this), 400);\r\n }, 4000);\r\n }\r\n\r\n cleanUp(){\r\n this.message$.remove();\r\n }\r\n}\r\n\r\nSessionLoggedOutDetection.initDefault = function(){\r\n return new SessionLoggedOutDetection();\r\n}\r\n"],"mappings":";;;;;;AAAA;AAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAEVA,yBAAyB;EAEpC,qCAAa;IAAA;IACX;IACA;IACA,IAAGC,QAAQ,CAACC,IAAI,KAAK,mBAAmB,EAAC;MACv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