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P,WACIlC,KAAKqC,sBAAqB,IAGvB,YAAAD,sBAAP,WACIpC,KAAKqC,sBAAqB,IAGvB,YAAAC,uBAAP,WACI,IAAMC,EAAevC,KAAKe,UAAU,iBAEpC,OADmC,OAAjBwB,GAAyBA,EAAaf,QAAQ,qBAAuB,GAIpF,YAAAa,qBAAP,SAA4BG,GACxBxC,KAAKC,UAAU,0BAAyB,GAAKwC,WAAY,CAAEvC,KAAM,MACjEF,KAAKC,UAAU,gBAAiB,eAAiBuC,EAAU,CAAEtC,KAAM,MAC9DsC,IACDxC,KAAKF,aAAa,cAClBE,KAAKF,aAAa,YAKtB,SAAuC0C,GACnC,IAAMb,EAA0BhB,SAASiB,eAAe,wCACpDc,EAA4B/B,SAASiB,eAAe,sCACxDD,MAAAA,GAAAA,EAAyBgB,aAAa,SAAU,QAChDD,MAAAA,GAAAA,EAA2BZ,gBAAgB,UAC3C,IAAMc,EAAsBjC,SAASiB,eAAe,gCACvBjB,SAASiB,eAAe,qBAC9BiB,UAAYL,EAAW,WAAa,WAC3DI,MAAAA,GAAAA,EAAqBX,iBAAiB,SAAS,WAAcS,MAAAA,GAAAA,EAA2BC,aAAa,SAAU,WAVnHG,CAA8BN,IAatC,EAvFA,ICEA7B,SAASoC,KAAKC,UAAcrC,SAASoC,KAAc,UAAIpC,SAASoC,KAAKC,UAAY,cAAgB,aACjGnD,EAAc6B,mB","sources":["webpack:///./wwwroot/app/Services/cookieService.ts","webpack:///./wwwroot/app/layout/header.ts"],"sourcesContent":["class CookieService {\r\n public removeCookie(name: string): void {\r\n this.setCookie(name, '', { days: -1 });\r\n }\r\n\r\n public setCookie(name: string, value: string, options?: any): void {\r\n if (options == null) {\r\n options = {};\r\n }\r\n let cookieString = name + \"=\" + value + \"; path=/\";\r\n if (options.days) {\r\n const date = new Date();\r\n date.setTime(date.getTime() + (options.days * 24 * 60 * 60 * 1000));\r\n cookieString = cookieString + \"; expires=\" + date.toUTCString();\r\n }\r\n if (document.location.protocol == 'https:') {\r\n cookieString = cookieString + \"; Secure\";\r\n }\r\n document.cookie = cookieString;\r\n };\r\n \r\n public getCookie(name: string): string | null {\r\n const nameEQ = name + \"=\";\r\n const cookies = document.cookie.split(';');\r\n for (var i = 0, len = cookies.length; i < len; i++) {\r\n var cookie = cookies[i];\r\n while (cookie.charAt(0) == ' ') {\r\n cookie = cookie.substring(1, cookie.length);\r\n }\r\n if (cookie.indexOf(nameEQ) === 0) {\r\n return decodeURIComponent(cookie.substring(nameEQ.length));\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n public initCookieBanner(): void {\r\n const cookiePreferenceMessage = document.getElementById('global-cookie-preference-set-message'),\r\n cookiePreferencesValue = this.getCookie('cookie_preference_set'),\r\n showSetCookiePreference = (cookiePreferenceMessage && cookiePreferencesValue == null);\r\n\r\n if (showSetCookiePreference) {\r\n cookiePreferenceMessage?.removeAttribute('hidden');\r\n const btnAccept = document.getElementById('btn_cookies_accept'),\r\n btnReject = document.getElementById('btn_cookies_reject');\r\n \r\n btnAccept?.addEventListener('click', this.acceptOptionalCookies.bind(this));\r\n btnReject?.addEventListener('click', this.rejectOptionalCookies.bind(this));\r\n }\r\n };\r\n\r\n public acceptOptionalCookies(): void {\r\n this.allowOptionalCookies(true);\r\n }\r\n \r\n public rejectOptionalCookies(): void {\r\n this.allowOptionalCookies(false);\r\n }\r\n\r\n public optionalCookiesAllowed(): boolean {\r\n const cookiePolicy = this.getCookie('cookie_policy');\r\n const analytics = cookiePolicy !== null && cookiePolicy.indexOf('\"analytics\":true') > -1;\r\n return analytics;\r\n }\r\n\r\n public allowOptionalCookies(accepted: boolean): void {\r\n this.setCookie('cookie_preference_set', true.toString(), { days: 365 });\r\n this.setCookie('cookie_policy', '\"analytics\":' + accepted, { days: 365 });\r\n if (!accepted) {\r\n this.removeCookie('ai_session');\r\n this.removeCookie('ai_user');\r\n }\r\n\r\n showCookieConfirmationMessage(accepted);\r\n\r\n function showCookieConfirmationMessage(accepted: boolean) {\r\n const cookiePreferenceMessage = document.getElementById('global-cookie-preference-set-message'),\r\n cookieConfirmationMessage = document.getElementById('global-cookie-confirmation-message');\r\n cookiePreferenceMessage?.setAttribute('hidden', 'true');\r\n cookieConfirmationMessage?.removeAttribute('hidden');\r\n const btnConfirmationHide = document.getElementById('btn_cookie_confirmation_hide'),\r\n cookiePreferencesLabel = document.getElementById('cookie_preference') as HTMLElement;\r\n cookiePreferencesLabel.innerHTML = accepted ? 'accepted' : 'rejected';\r\n btnConfirmationHide?.addEventListener('click', function () { cookieConfirmationMessage?.setAttribute('hidden', 'true'); });\r\n }\r\n };\r\n}\r\n\r\nexport const cookieService = new CookieService();","import { cookieService } from '../Services/cookieService';\r\n\r\ndocument.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');\r\ncookieService.initCookieBanner();"],"names":["cookieService","removeCookie","name","this","setCookie","days","value","options","cookieString","date","Date","setTime","getTime","toUTCString","document","location","protocol","cookie","getCookie","nameEQ","cookies","split","i","len","length","charAt","substring","indexOf","decodeURIComponent","initCookieBanner","cookiePreferenceMessage","getElementById","cookiePreferencesValue","removeAttribute","btnAccept","btnReject","addEventListener","acceptOptionalCookies","bind","rejectOptionalCookies","allowOptionalCookies","optionalCookiesAllowed","cookiePolicy","accepted","toString","cookieConfirmationMessage","setAttribute","btnConfirmationHide","innerHTML","showCookieConfirmationMessage","body","className"],"sourceRoot":""}