{"version":3,"sources":["webpack:///./Scripts/Rollco/Components/CookieConsent.js"],"names":["values","consentRef","useRef","showConsent","cookieText","text","useEffect","setTimeout","current","classList","add","document","cookie","indexOf","Fragment","className","ref","parse","onClick","remove","currentDate","Date","setFullYear","getFullYear","buttonText"],"mappings":"yIAGA,MAqCA,EArCsB,EAAGA,aACrB,MAAMC,GAAaC,YAAO,MAC1B,IAAIC,GAAc,EAClB,MAAMC,EAAaJ,EAAOK,MAE1BC,gBAAU,KACNC,YAAW,KACPN,GAAYO,SAASC,WAAWC,IAAI,YAAY,GACjD,IAAI,IAGPC,SAASC,OAAOC,QAAQ,uBAAyB,IACjDV,GAAc,GAalB,OACI,gBAAC,EAAAW,SAAQ,KACJX,GACG,uBAAKY,UAAU,4CAA4CC,IAAKf,IAC3DgB,QAAMb,GACP,0BAAQW,UAAU,SAASG,QAfT,KAC9BjB,EAAWO,QAAQC,UAAUU,OAAO,aACpClB,EAAWO,QAAQC,UAAUC,IAAI,eAEjC,MAAMU,EAAc,IAAIC,KACxBD,EAAYE,YAAYF,EAAYG,cAAgB,GAEpDZ,SAASC,OAAS,qCAAuCQ,CAAW,GAQQpB,EAAOwB,aAGxE,C","file":"372.289421e2eda00bb3cc3e.js","sourcesContent":["import React, {Fragment, useRef, useEffect} from 'react';\r\nimport parse from 'html-react-parser';\r\n\r\nconst CookieConsent = ({ values }) => {\r\n const consentRef = useRef(null);\r\n let showConsent = true;\r\n const cookieText = values.text;\r\n\r\n useEffect(() => {\r\n setTimeout(() => { \r\n consentRef?.current?.classList?.add(\"slide--up\");\r\n }, 200);\r\n });\r\n\r\n if (document.cookie.indexOf(\"cookieconsent=true\") >= 0) {\r\n showConsent = false;\r\n }\r\n \r\n const cookieConsentClickHandler = () => {\r\n consentRef.current.classList.remove(\"slide--up\");\r\n consentRef.current.classList.add(\"slide--down\");\r\n \r\n const currentDate = new Date();\r\n currentDate.setFullYear(currentDate.getFullYear() + 1);\r\n\r\n document.cookie = \"cookieconsent=true;path=/;expires=\" + currentDate;\r\n }\r\n\r\n return (\r\n \r\n {showConsent && \r\n
\r\n {parse(cookieText)}\r\n \r\n
\r\n }\r\n
\r\n );\r\n};\r\n\r\nexport default CookieConsent;\r\n"],"sourceRoot":""}