import{r as e,c as t,h as n,H as o,g as i}from"./p-21516f8c.js";const r=":host([hidden]){display:none}:host{display:flex;position:fixed;bottom:0;flex-wrap:wrap;align-items:center;justify-content:center;width:100vw;background:white;font-size:1em;box-shadow:-14px 0 28px 0 rgba(0, 0, 0, 0.18), -10px 0 10px 0 rgba(0, 0, 0, 0.09);z-index:100000}:host .ux-gdpr__text-container{padding:1.714285714em 1.714285714em 1.571428571em;flex:0 1 26.642857143em}:host .ux-gdpr__header{margin:0 0 0.571428571em;flex:1 1 100%;font-size:inherit;font-weight:500;line-height:1}:host .ux-gdpr__description{margin:0;flex:1 1 100%;font-size:0.857142857em}:host .ux-gdpr__link,:host .ux-gdpr__link:visited{transition:box-shadow 0.2s ease-out;color:#2272bd;text-decoration:none}:host .ux-gdpr__link:focus,:host .ux-gdpr__link:visited:focus{outline:none;box-shadow:0 0 0 0.142857143em #2272bd}:host .ux-gdpr__action-container{padding:0 2em 0;display:flex;flex:0 1 17.142857143em;flex-wrap:wrap;align-items:center;justify-content:center}:host .ux-gdpr__button_revoke,:host .ux-gdpr__button_grant{border-radius:0.142857143em;margin:0 0 2em 0;padding:0;height:2.833333333em;transition:box-shadow 0.2s ease-out;border:none;background:none;font-family:inherit;font-size:0.857142857em;font-weight:300}:host .ux-gdpr__button_revoke:focus,:host .ux-gdpr__button_grant:focus{outline:none;box-shadow:0 0 0 0.142857143em #2272bd}:host .ux-gdpr__button_revoke{order:0;width:9.166666667em;background-color:white;color:#2272bd;box-shadow:inset 0 0 0 0.071428571em #c6c7c9}:host .ux-gdpr__button_grant{order:1;width:13.333333333em;background-color:#2272bd;color:white}@media all and (min-width: 21.375em){:host .ux-gdpr__action-container{flex:0 1 20.428571429em;justify-content:space-between}}@media all and (min-width: 45em){:host{flex-wrap:nowrap}:host .ux-gdpr__text-container{padding:1.714285714em 2.285714286em 1.571428571em;flex:1 1 100%;max-width:82.428571429em}:host .ux-gdpr__action-container{padding:0 2.285714286em 0 0;flex:0 0 20.428571429em;flex-wrap:nowrap}:host .ux-gdpr__button_revoke,:host .ux-gdpr__button_grant{margin:0}}";const s=class{constructor(n){e(this,n);this.consentEmitter=t(this,"gdpr-consent",7);this.cookieName="gdpr-consent";this.hidden=true}async componentWillLoad(){this.consent=this.parseConsentCookieValue(this.getConsentCookie());if(this.URLRevokedConsent(window.location.search)){this.consent="revoked"}if(this.URLResetConsent(window.location.search)){this.consent="indeterminate"}switch(this.consent){case"revoked":this.revokeConsentCookie();break;case"granted":this.grantConsentCookie();break;case"indeterminate":default:this.isEU=await fetch(`https://geoip-js.maxmind.com/geoip/v2.1/country/me?referrer=${encodeURIComponent(`${location.protocol}//${location.hostname}`)}`).then((e=>{if(!e.ok){return true}return e.json().then((e=>e.country.hasOwnProperty("is_in_european_union")))})).catch((e=>{console.error(e);return true}));this.isEU?this.resetConsentCookie():this.grantConsentCookie()}}handleRevoke(){this.revokeConsentCookie()}handleReset(){this.resetConsentCookie()}URLResetConsent(e){return e.indexOf("gdpr-consent=reset")!==-1}URLRevokedConsent(e){return e.indexOf("gdpr-consent=revoke")!==-1}getConsentCookie(){const[e]=document.cookie.split(";").filter((e=>e.indexOf(this.cookieName)!==-1));return e}parseConsentCookieValue(e){const t=e?e.split("=")[1]:"indeterminate";switch(t){case"true":return"granted";case"false":return"revoked";case"indeterminate":default:return"indeterminate"}}async grantConsentCookie(){document.cookie=`${this.cookieName}=true; max-age=${60*60*24*365};`;this.hidden=true;this.consentEmitter.emit({isConsentGranted:true})}async revokeConsentCookie(){document.cookie=`${this.cookieName}=false; max-age=${60*60*24*7};`;this.hidden=true;this.consentEmitter.emit({isConsentGranted:false})}async resetConsentCookie(){document.cookie=`${this.cookieName}=; max-age=0;`;this.hidden=false}render(){return n(o,{hidden:this.hidden,role:"dialog","aria-modal":"false","aria-labelledby":"ux-gdpr__label","aria-describedby":"ux-gdpr__description"},n("div",{class:"ux-gdpr__text-container"},n("h2",{class:"ux-gdpr__header",id:"ux-gdpr__label"},"Do you agree to Liberty University’s use of cookies?"),n("p",{class:"ux-gdpr__description",id:"ux-gdpr__description"},"We use cookies to deliver online services, customize your experience, and assist with communication. For more information see the"," ",n("a",{href:"#",class:"ux-gdpr__link"},"Privacy Policy")," ","and"," ",n("a",{href:"#",class:"ux-gdpr__link"},"GDPR Privacy Notice"),".")),n("div",{class:"ux-gdpr__action-container"},n("button",{class:"ux-gdpr__button_grant",onClick:()=>this.grantConsentCookie(),"aria-describedby":"ux-gdpr__description"},"I Agree"),n("button",{class:"ux-gdpr__button_revoke",onClick:()=>this.revokeConsentCookie(),"aria-describedby":"ux-gdpr__description"},"I Do Not Agree")))}get el(){return i(this)}};s.style=r;export{s as lu_gdpr_consent};
//# sourceMappingURL=p-4059a265.entry.js.map