@neevaco/cookie-cutter-engine
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CookieEngine=t():e.CookieEngine=t()}(self,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(...e){return H._methods.notifyNoticeHandledOnPage(...e)}function o(e){return new Promise((t=>setTimeout(t,e)))}async function a(e,t,n=0){for(;void 0!==t?CookieControl.getCategoryConsent(n)!==t:null===CookieControl.getCategoryConsent(n);)e(),await o(1e3)}e.r(t),e.d(t,{CookieCategoryType:()=>r,CookieEngine:()=>H});const i={name:"CivicUK",isInUse:()=>!!window.CookieControl?.acceptAll,acceptAll:()=>a(CookieControl.acceptAll,!0),rejectAll:()=>a(CookieControl.rejectAll,!1),getCategories:()=>("function"==typeof CookieControl.config?CookieControl.config():CookieControl.config).optionalCookies.map(((e,t)=>({type:P(e.name),platformIdentifier:t}))),setCategoryConsent:(e,t)=>a((()=>CookieControl.changeCategory(e.platformIdentifier,t)),t,e.platformIdentifier)};let r;!function(e){e[e.Essential=0]="Essential",e[e.Preferences=1]="Preferences",e[e.Marketing=2]="Marketing",e[e.Analytics=3]="Analytics",e[e.Social=4]="Social",e[e.DoNotSell=5]="DoNotSell",e[e.Unknown=6]="Unknown"}(r||(r={}));const s={categories:{},cookies:{},vendors:{}};let c=!1;const l={name:"Evidon",isInUse:()=>!!window.evidon?.notice,acceptAll:()=>evidon.notice.consentGiven(),rejectAll:()=>evidon.notice.declineGiven(),getCategories:async()=>{const e=await new Promise((e=>evidon.notice.getOptOutCategories(((t,n)=>e(n)))));return Object.keys(e).map((t=>({platformIdentifier:{name:t,vendors:e[t].vendors},type:P(t)})))},setCategoryConsent(e,t){s.categories[e.platformIdentifier.name]=t,e.platformIdentifier.vendors.forEach((e=>{s.vendors[e.CompanyId.toString()]=t})),c=!0},flush(){c&&evidon.notice.consentChanged(s.categories,s.vendors,s.cookies)}};let d={1:!1,2:!1,3:!1};async function u(e){let t=null,n=0;for(;!(t=document.getElementById(e))&&n<5;)await o(500),n++;t?.click()}const f={name:"HubSpot",isInUse:()=>!!document.getElementById("hs-eu-cookie-confirmation")||!!window._hsq?.push,acceptAll:async()=>{await u("hs-eu-confirmation-button"),d={1:!0,2:!0,3:!0}},rejectAll:async()=>{await u("hs-eu-decline-button"),d={1:!1,2:!1,3:!1}},getCategories:()=>[{type:r.Analytics,platformIdentifier:1},{type:r.Marketing,platformIdentifier:2},{type:r.Preferences,platformIdentifier:3}],setCategoryConsent(e,t){d[e.platformIdentifier]=t},flush(){const e=Object.keys(d).map((e=>`${e}:${d[parseInt(e)]}`)).join(",");document.cookie=`__hs_cookie_cat_pref=${e}`}},m={name:"OneTrust",isInUse:()=>!!window.OneTrust?.AllowAll,acceptAll:()=>OneTrust.AllowAll(),rejectAll:()=>OneTrust.RejectAll(),getCategories:()=>OneTrust.GetDomainData().Groups.map((e=>({platformIdentifier:e.PurposeId,type:P(e.GroupName)}))),setCategoryConsent(e,t){const n={identifier:OneTrust.getDataSubjectId?.apply(this)??"",isAnonymous:!1,purposes:[{Id:e.platformIdentifier,TransactionType:t?"CONFIRMED":"OPT_OUT"}]};OneTrust.setConsentProfile(n)},flush(){const e=document.createElement("style");e.innerHTML="#onetrust-consent-sdk, .optanon-alert-box-wrapper { display: none !important; }",document.head.appendChild(e)}};let g=!1;function p(){return new Promise((e=>{window.Osano.cm.addEventListener("osano-cm-initialized",(()=>{g||(g=!0,window.Osano.cm.showDrawer(),window.Osano.cm.hideDrawer()),e()}))}))}async function w(e){await p(),document.querySelectorAll("input[data-category]").forEach((t=>{t.checked=e,t.dispatchEvent(new Event("change"))})),await y()}function y(){return new Promise((e=>{const t=n=>{e(n),window.Osano.cm.removeEventListener("osano-cm-consent-saved",t)};window.Osano.cm.addEventListener("osano-cm-consent-saved",t),document.querySelector(".osano-cm-save").click()}))}const C={name:"Osano",isInUse:()=>!!window.Osano?.cm,acceptAll:()=>w(!0),rejectAll:()=>w(!1),getCategories:()=>[{type:r.Essential,platformIdentifier:"ESSENTIAL"},{type:r.Unknown,platformIdentifier:"OPT_OUT"},{type:r.Marketing,platformIdentifier:"MARKETING"},{type:r.Preferences,platformIdentifier:"PERSONALIZATION"},{type:r.Analytics,platformIdentifier:"ANALYTICS"}],setCategoryConsent:async function(e,t){await p();const n=document.querySelector(`input[data-category=${e.platformIdentifier}]`);null===n&&console.warn("Unable to set consent for category",e,"Desired:",t,"Actual: Element not found"),n.checked=t,n.dispatchEvent(new Event("change")),await y();const o=window.Osano.cm.getConsent();t!==("ACCEPT"===o[e.platformIdentifier])&&console.warn("Unable to set consent for category",e,"Desired:",t,"Actual:",o[e.platformIdentifier])}};function h(){return document.getElementById("ifrmPrivacyBanner")?.contentDocument}function E(e){return new Promise((async t=>{for(;;)try{return e(),void t()}catch{await o(1e3)}}))}const k={name:"SecurePrivacy",isInUse:()=>!!window.initialize_secure_privacy,acceptAll:()=>E((()=>sp.saveAllConsents("cookieBanner",!0))),rejectAll:()=>E((()=>sp.saveAllConsents("cookieBanner",!1))),async getCategories(){const e=h()?.querySelectorAll("input[id^=tracker]"),t=[];return e&&0!==e.length?(e.forEach((e=>{const n=P(e.getAttribute("data-compliancetype"));t.push({platformIdentifier:e.id,type:n})})),t):(await o(1e3),await this.getCategories())},setCategoryConsent(e,t){const n=h()?.getElementById(e.platformIdentifier);n.checked=t,sp.saveAllConsents("privacyBanner",!1)}},A={};async function I(){let e=null;for(;!(e=bannerConfigUtils.getLanguageConfigMap().en);)await o(500);return e.categories}const v={name:"Securiti",isInUse:()=>!!window.TCFUtils?.updateConsentFromBanner,acceptAll:async()=>(await I()).forEach((e=>A[e.name]=!0)),rejectAll:async()=>(await I()).forEach((e=>A[e.name]=!1)),getCategories:async()=>(await I()).map((e=>({type:P(e.name),platformIdentifier:e.name}))),setCategoryConsent(e,t){A[e.platformIdentifier]=t},flush:async()=>{await bannerGenerator.dropPrivaciCookies(A),await o(500),await bannerGenerator.dropPrivaciCookies(A)}},b={name:"Stack Exchange",isInUse:()=>!!window.StackExchange,init:()=>new Promise((e=>{const t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("charset","UTF-8"),t.setAttribute("data-domain-script",StackExchange.settings.legal.oneTrustConfigId),t.setAttribute("async","true"),t.setAttribute("src","https://cdn.cookielaw.org/scripttemplates/otSDKStub.js"),t.onload=function(){const t=window.setInterval((function(){Object.prototype.hasOwnProperty.call(window,"OneTrust")&&(window.clearInterval(t),e())}),20)},document.body.appendChild(t)})),acceptAll:m.acceptAll,rejectAll:m.rejectAll,getCategories:m.getCategories,setCategoryConsent:m.setCategoryConsent,flush(){m.flush();const e=document.createElement("style");e.innerHTML=".js-consent-banner { display: none !important; }",document.head.appendChild(e)}};function S(){truste.bn.isConsentTrack=!1;const e=truste.eu.bindMap.params.c||"teconsent";truste.bn.show(document.getElementById(e)),truste.bn.hide(document.getElementById("truste-consent-track"))}let O=[];const T={name:"TrustArc",isInUse:()=>!!window.truste?.bn?.show,acceptAll:()=>{O=[0,1,2],truste.eu.ccpa?.dropCcpaCookie(!1)},rejectAll:()=>{O=[0]},getCategories:async()=>{S();const e=(await new Promise((e=>truste.util.callCMEndpoint("/defaultconsentmanager/getOptOutDomains?",null,e)))).responseText,t=JSON.parse(e);return truste.util.setStorage(truste.eu.COOKIE_CATEGORY_NAME,e,!1),Object.keys(t).map((e=>({platformIdentifier:t[e].value,type:P(e)})))},setCategoryConsent(e,t){t&&O.push(e.platformIdentifier)},flush(){var e;O.length>0&&(O=O.filter(((e,t,n)=>n.indexOf(e)===t)),e=O,truste.eu.actmessage({source:"preference_manager",message:"submit_preferences",data:{value:e.join(",")}}),S())}},U={[r.Essential]:["essential","necessary"],[r.Marketing]:["marketing","targeting","functional","advertising"],[r.Preferences]:["preference","personalization"],[r.Analytics]:["analytic"],[r.Social]:["social"],[r.DoNotSell]:["do not sell"],[r.Unknown]:["other"]};function P(e){if(!e)return r.Unknown;const t=Object.keys(U).length,n=e.toLowerCase();for(let e=0;e<t;e++)if(U[e].some((e=>n.includes(e))))return e;return r.Unknown}const _=[m,i,C,k,f,v,T,l,b];async function j(e){e.flush&&await e.flush()}async function N(e){if(!await e.isInUse())return!1;if(await function(...e){return H._methods.incrementCookieStats(...e)}(),function(...e){H._methods.logProviderUsage(...e)}(e.name),function(){const e=async()=>{const e=await function(...e){return H._methods.getHostname(...e)}();e&&window.localStorage.setItem(M,e)};window.addEventListener("beforeunload",e),setTimeout((()=>window.removeEventListener("beforeunload",e)),2e3)}(),await async function(e){e.init&&await e.init()}(e),await function(...e){return H._methods.areAllEnabled(...e)}())return await e.acceptAll(),await j(e),!0;await e.rejectAll();try{(await e.getCategories()).forEach((async t=>{const n=await function(...e){return H._methods.isTypeEnabled(...e)}(t.type);await e.setCategoryConsent(t,n)}))}catch(e){console.error(e)}return await j(e),!0}const M="neeva_pending_flag",D=async function e(t=5){if(await async function(){const e=window.localStorage.getItem(M);e&&(window.localStorage.removeItem(M),await function(...e){return H._methods.flagSite(...e)}(e))}(),await function(...e){return H._methods.isCookieConsentingEnabled(...e)}()&&!await function(...e){return H._methods.isFlaggedSite(...e)}()&&0!==t){for(let e=0;e<_.length;e++)if(await N(_[e]))return void(window===window.top&&n(!0));await o(1e3),e(t-1)}};class H{static _methods={areAllEnabled(){throw new Error("Undefined method areAllEnabled")},isCookieConsentingEnabled(){throw new Error("Undefined method isCookieConsentingEnabled")},isTypeEnabled(e){throw new Error("Undefined method isTypeEnabled")},getHostname(){throw new Error("Undefined method getHostname")},flagSite(e){throw new Error("Undefined method flagSite")},isFlaggedSite(){throw new Error("Undefined method isFlaggedSite")},incrementCookieStats(){throw new Error("Undefined method incrementCookieStats")},notifyNoticeHandledOnPage(e){throw new Error("Undefined method notifyNoticeHandledOnPage")},logProviderUsage(e){throw new Error("Undefined method logProviderUsage")}};static areAllEnabled(e){H._methods.areAllEnabled=e}static isCookieConsentingEnabled(e){H._methods.isCookieConsentingEnabled=e}static isTypeEnabled(e){H._methods.isTypeEnabled=e}static getHostname(e){H._methods.getHostname=e}static flagSite(e){H._methods.flagSite=e}static isFlaggedSite(e){H._methods.isFlaggedSite=e}static incrementCookieStats(e){H._methods.incrementCookieStats=e}static notifyNoticeHandledOnPage(e){H._methods.notifyNoticeHandledOnPage=e}static logProviderUsage(e){H._methods.logProviderUsage=e}static runCookieCutter(){D()}}return t})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CookieEngine=t():e.CookieEngine=t()}(self,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(...e){return R._methods.notifyNoticeHandledOnPage(...e)}function o(e){return new Promise((t=>setTimeout(t,e)))}async function i(e,t,n=0){for(;void 0!==t?CookieControl.getCategoryConsent(n)!==t:null===CookieControl.getCategoryConsent(n);)e(),await o(1e3)}e.r(t),e.d(t,{CookieCategoryType:()=>s,CookieEngine:()=>R});const a={name:"CivicUK",isInUse:()=>!!window.CookieControl?.acceptAll,acceptAll:()=>i(CookieControl.acceptAll,!0),rejectAll:()=>i(CookieControl.rejectAll,!1),getCategories:()=>("function"==typeof CookieControl.config?CookieControl.config():CookieControl.config).optionalCookies.map(((e,t)=>({type:H(e.name),platformIdentifier:t}))),setCategoryConsent:(e,t)=>i((()=>CookieControl.changeCategory(e.platformIdentifier,t)),t,e.platformIdentifier)},r={name:"Consent Manager",isInUse:()=>!!window.cmpmngr?.setPurpose,async init(){for(;!cmpmngr.cnfDone;)await o(100)},acceptAll:()=>cmpmngr.setConsentViaBtn(1),rejectAll:()=>cmpmngr.setConsentViaBtn(0),getCategories:()=>cmpmngr.purposes.map((e=>({platformIdentifier:e.id,type:H(e.getName())}))),setCategoryConsent(e,t){cmpmngr.setPurpose(e.platformIdentifier,t?1:0)}};let s;!function(e){e[e.Essential=0]="Essential",e[e.Preferences=1]="Preferences",e[e.Marketing=2]="Marketing",e[e.Analytics=3]="Analytics",e[e.Social=4]="Social",e[e.DoNotSell=5]="DoNotSell",e[e.Unknown=6]="Unknown"}(s||(s={}));const c={preferences:!1,statistics:!1,marketing:!1},l={name:"CookieBot",isInUse:()=>!!window.CookieConsent?.submitCustomConsent,acceptAll:()=>CookieConsent.submitCustomConsent(!0,!0,!0),rejectAll:()=>CookieConsent.submitCustomConsent(!1,!1,!1),getCategories:()=>[{type:s.Preferences,platformIdentifier:"preferences"},{type:s.Analytics,platformIdentifier:"statistics"},{type:s.Marketing,platformIdentifier:"marketing"}],setCategoryConsent(e,t){c[e.platformIdentifier]=t},flush(){CookieConsent.submitCustomConsent(c.preferences,c.statistics,c.marketing),CookieConsent.hide()}},d=[],m=[],f={name:"Didomi",isInUse:()=>!!window.Didomi,acceptAll:()=>Didomi.setUserAgreeToAll(),rejectAll:()=>Didomi.setUserDisagreeToAll(),getCategories:()=>Didomi.getRequiredPurposes().map((e=>({type:H(e.id),platformIdentifier:e.id}))),setCategoryConsent(e,t){(t?d:m).push(e.platformIdentifier)},flush(){Didomi.setUserConsentStatusForAll(d,m)}},u={categories:{},cookies:{},vendors:{}};let p=!1;const g={name:"Evidon",isInUse:()=>!!window.evidon?.notice,acceptAll:()=>evidon.notice.consentGiven(),rejectAll:()=>evidon.notice.declineGiven(),getCategories:async()=>{const e=await new Promise((e=>evidon.notice.getOptOutCategories(((t,n)=>e(n)))));return Object.keys(e).map((t=>({platformIdentifier:{name:t,vendors:e[t].vendors},type:H(t)})))},setCategoryConsent(e,t){u.categories[e.platformIdentifier.name]=t,e.platformIdentifier.vendors.forEach((e=>{u.vendors[e.CompanyId.toString()]=t})),p=!0},flush(){p&&evidon.notice.consentChanged(u.categories,u.vendors,u.cookies)}};let C={1:!1,2:!1,3:!1};async function w(e){let t=null,n=0;for(;!(t=document.getElementById(e))&&n<5;)await o(500),n++;t?.click()}const y={name:"HubSpot",isInUse:()=>!!document.getElementById("hs-eu-cookie-confirmation")||!!window._hsq?.push,acceptAll:async()=>{await w("hs-eu-confirmation-button"),C={1:!0,2:!0,3:!0}},rejectAll:async()=>{await w("hs-eu-decline-button"),C={1:!1,2:!1,3:!1}},getCategories:()=>[{type:s.Analytics,platformIdentifier:1},{type:s.Marketing,platformIdentifier:2},{type:s.Preferences,platformIdentifier:3}],setCategoryConsent(e,t){C[e.platformIdentifier]=t},flush(){const e=Object.keys(C).map((e=>`${e}:${C[parseInt(e)]}`)).join(",");document.cookie=`__hs_cookie_cat_pref=${e}`}},h={name:"OneTrust",isInUse:()=>!!window.OneTrust?.AllowAll,acceptAll:()=>OneTrust.AllowAll(),rejectAll:()=>OneTrust.RejectAll(),getCategories:()=>OneTrust.GetDomainData().Groups.map((e=>({platformIdentifier:e.PurposeId,type:H(e.GroupName)}))),setCategoryConsent(e,t){const n={identifier:OneTrust.getDataSubjectId?.apply(this)??"",isAnonymous:!1,purposes:[{Id:e.platformIdentifier,TransactionType:t?"CONFIRMED":"OPT_OUT"}]};OneTrust.setConsentProfile(n)},flush(){const e=document.createElement("style");e.innerHTML="#onetrust-consent-sdk, .optanon-alert-box-wrapper { display: none !important; }",document.head.appendChild(e)}};let I=!1;function A(){return new Promise((e=>{window.Osano.cm.addEventListener("osano-cm-initialized",(()=>{I||(I=!0,window.Osano.cm.showDrawer(),window.Osano.cm.hideDrawer()),e()}))}))}async function k(e){await A(),document.querySelectorAll("input[data-category]").forEach((t=>{t.checked=e,t.dispatchEvent(new Event("change"))})),await E()}function E(){return new Promise((e=>{const t=n=>{e(n),window.Osano.cm.removeEventListener("osano-cm-consent-saved",t)};window.Osano.cm.addEventListener("osano-cm-consent-saved",t),document.querySelector(".osano-cm-save").click()}))}const b={name:"Osano",isInUse:()=>!!window.Osano?.cm,acceptAll:()=>k(!0),rejectAll:()=>k(!1),getCategories:()=>[{type:s.Essential,platformIdentifier:"ESSENTIAL"},{type:s.Unknown,platformIdentifier:"OPT_OUT"},{type:s.Marketing,platformIdentifier:"MARKETING"},{type:s.Preferences,platformIdentifier:"PERSONALIZATION"},{type:s.Analytics,platformIdentifier:"ANALYTICS"}],setCategoryConsent:async function(e,t){await A();const n=document.querySelector(`input[data-category=${e.platformIdentifier}]`);null===n&&console.warn("Unable to set consent for category",e,"Desired:",t,"Actual: Element not found"),n.checked=t,n.dispatchEvent(new Event("change")),await E();const o=window.Osano.cm.getConsent();t!==("ACCEPT"===o[e.platformIdentifier])&&console.warn("Unable to set consent for category",e,"Desired:",t,"Actual:",o[e.platformIdentifier])}};function v(){return document.getElementById("ifrmPrivacyBanner")?.contentDocument}function U(e){return new Promise((async t=>{for(;;)try{return e(),void t()}catch{await o(1e3)}}))}const S={name:"SecurePrivacy",isInUse:()=>!!window.initialize_secure_privacy,acceptAll:()=>U((()=>sp.saveAllConsents("cookieBanner",!0))),rejectAll:()=>U((()=>sp.saveAllConsents("cookieBanner",!1))),async getCategories(){const e=v()?.querySelectorAll("input[id^=tracker]"),t=[];return e&&0!==e.length?(e.forEach((e=>{const n=H(e.getAttribute("data-compliancetype"));t.push({platformIdentifier:e.id,type:n})})),t):(await o(1e3),await this.getCategories())},setCategoryConsent(e,t){const n=v()?.getElementById(e.platformIdentifier);n.checked=t,sp.saveAllConsents("privacyBanner",!1)}},O={};async function _(){let e=null;for(;!(e=bannerConfigUtils.getLanguageConfigMap().en);)await o(500);return e.categories}const P={name:"Securiti",isInUse:()=>!!window.TCFUtils?.updateConsentFromBanner,acceptAll:async()=>(await _()).forEach((e=>O[e.name]=!0)),rejectAll:async()=>(await _()).forEach((e=>O[e.name]=!1)),getCategories:async()=>(await _()).map((e=>({type:H(e.name),platformIdentifier:e.name}))),setCategoryConsent(e,t){O[e.platformIdentifier]=t},flush:async()=>{await bannerGenerator.dropPrivaciCookies(O),await o(500),await bannerGenerator.dropPrivaciCookies(O)}},T={name:"Stack Exchange",isInUse:()=>!!window.StackExchange,init:()=>new Promise((e=>{const t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("charset","UTF-8"),t.setAttribute("data-domain-script",StackExchange.settings.legal.oneTrustConfigId),t.setAttribute("async","true"),t.setAttribute("src","https://cdn.cookielaw.org/scripttemplates/otSDKStub.js"),t.onload=function(){const t=window.setInterval((function(){Object.prototype.hasOwnProperty.call(window,"OneTrust")&&(window.clearInterval(t),e())}),20)},document.body.appendChild(t)})),acceptAll:h.acceptAll,rejectAll:h.rejectAll,getCategories:h.getCategories,setCategoryConsent:h.setCategoryConsent,flush(){h.flush();const e=document.createElement("style");e.innerHTML=".js-consent-banner { display: none !important; }",document.head.appendChild(e)}};function j(){truste.bn.isConsentTrack=!1;const e=truste.eu.bindMap.params.c||"teconsent";truste.bn.show(document.getElementById(e)),truste.bn.hide(document.getElementById("truste-consent-track"))}let D=[];const M={name:"TrustArc",isInUse:()=>!!window.truste?.bn?.show,acceptAll:()=>{D=[0,1,2],truste.eu.ccpa?.dropCcpaCookie(!1)},rejectAll:()=>{D=[0]},getCategories:async()=>{j();const e=(await new Promise((e=>truste.util.callCMEndpoint("/defaultconsentmanager/getOptOutDomains?",null,e)))).responseText,t=JSON.parse(e);return truste.util.setStorage(truste.eu.COOKIE_CATEGORY_NAME,e,!1),Object.keys(t).map((e=>({platformIdentifier:t[e].value,type:H(e)})))},setCategoryConsent(e,t){t&&D.push(e.platformIdentifier)},flush(){var e;D.length>0&&(D=D.filter(((e,t,n)=>n.indexOf(e)===t)),e=D,truste.eu.actmessage({source:"preference_manager",message:"submit_preferences",data:{value:e.join(",")}}),j())}},N={name:"Usercentrics",isInUse:()=>!!window.UC_UI?.acceptAllConsents,acceptAll:()=>UC_UI.acceptAllConsents(),rejectAll:()=>UC_UI.denyAllConsents(),getCategories:()=>UC_UI.getServicesBaseInfo().map((e=>({platformIdentifier:e.id,type:H(e.categorySlug)}))),setCategoryConsent:(e,t)=>t?UC_UI.acceptService(e.platformIdentifier):UC_UI.rejectService(e.platformIdentifier),flush(){UC_UI.closeCMP()}},B={[s.Essential]:["essential","necessary"],[s.Marketing]:["marketing","targeting","function","advertising","personalization","personalize","ads","geolocation"],[s.Analytics]:["analytic","measurement","statistics","research"],[s.Preferences]:["preference","personalization"],[s.Social]:["social"],[s.DoNotSell]:["do not sell"],[s.Unknown]:["other"]};function H(e){if(!e)return s.Unknown;const t=Object.keys(B).length,n=e.toLowerCase();for(let e=0;e<t;e++)if(B[e].some((e=>n.includes(e))))return e;return s.Unknown}const L=[h,a,b,S,P,M,g,l,r,T,f,N,y];async function x(e){e.flush&&await e.flush()}async function F(e){if(!await e.isInUse())return!1;if(await function(...e){return R._methods.incrementCookieStats(...e)}(),function(...e){R._methods.logProviderUsage(...e)}(e.name),function(){const e=async()=>{const e=await function(...e){return R._methods.getHostname(...e)}();e&&window.localStorage.setItem(G,e)};window.addEventListener("beforeunload",e),setTimeout((()=>window.removeEventListener("beforeunload",e)),2e3)}(),await async function(e){e.init&&await e.init()}(e),await function(...e){return R._methods.areAllEnabled(...e)}())return await e.acceptAll(),await x(e),!0;await e.rejectAll();try{(await e.getCategories()).forEach((async t=>{const n=await function(...e){return R._methods.isTypeEnabled(...e)}(t.type);await e.setCategoryConsent(t,n)}))}catch(e){console.error(e)}return await x(e),!0}const G="neeva_pending_flag",q=async function e(t=5){if(await async function(){const e=window.localStorage.getItem(G);e&&(window.localStorage.removeItem(G),await function(...e){return R._methods.flagSite(...e)}(e))}(),await function(...e){return R._methods.isCookieConsentingEnabled(...e)}()&&!await function(...e){return R._methods.isFlaggedSite(...e)}()&&0!==t){for(let e=0;e<L.length;e++)if(await F(L[e]))return void(window===window.top&&n(!0));await o(1e3),e(t-1)}};class R{static _methods={areAllEnabled(){throw new Error("Undefined method areAllEnabled")},isCookieConsentingEnabled(){throw new Error("Undefined method isCookieConsentingEnabled")},isTypeEnabled(e){throw new Error("Undefined method isTypeEnabled")},getHostname(){throw new Error("Undefined method getHostname")},flagSite(e){throw new Error("Undefined method flagSite")},isFlaggedSite(){throw new Error("Undefined method isFlaggedSite")},incrementCookieStats(){throw new Error("Undefined method incrementCookieStats")},notifyNoticeHandledOnPage(e){throw new Error("Undefined method notifyNoticeHandledOnPage")},logProviderUsage(e){throw new Error("Undefined method logProviderUsage")}};static areAllEnabled(e){R._methods.areAllEnabled=e}static isCookieConsentingEnabled(e){R._methods.isCookieConsentingEnabled=e}static isTypeEnabled(e){R._methods.isTypeEnabled=e}static getHostname(e){R._methods.getHostname=e}static flagSite(e){R._methods.flagSite=e}static isFlaggedSite(e){R._methods.isFlaggedSite=e}static incrementCookieStats(e){R._methods.incrementCookieStats=e}static notifyNoticeHandledOnPage(e){R._methods.notifyNoticeHandledOnPage=e}static logProviderUsage(e){R._methods.logProviderUsage=e}static runCookieCutter(){q()}}return t})())); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5naW5lLmpzIiwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQ29va2llRW5naW5lL3dlYnBhY2svdW5pdmVyc2FsTW9kdWxlRGVmaW5pdGlvbiJdLCJzb3VyY2VzQ29udGVudCI6WyIoZnVuY3Rpb24gd2VicGFja1VuaXZlcnNhbE1vZHVsZURlZmluaXRpb24ocm9vdCwgZmFjdG9yeSkge1xuXHRpZih0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZSA9PT0gJ29iamVjdCcpXG5cdFx0bW9kdWxlLmV4cG9ydHMgPSBmYWN0b3J5KCk7XG5cdGVsc2UgaWYodHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kKVxuXHRcdGRlZmluZShbXSwgZmFjdG9yeSk7XG5cdGVsc2UgaWYodHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnKVxuXHRcdGV4cG9ydHNbXCJDb29raWVFbmdpbmVcIl0gPSBmYWN0b3J5KCk7XG5cdGVsc2Vcblx0XHRyb290W1wiQ29va2llRW5naW5lXCJdID0gZmFjdG9yeSgpO1xufSkoc2VsZiwgKCkgPT4ge1xucmV0dXJuICJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== |
@@ -6,3 +6,6 @@ // Copyright 2022 Neeva Inc. All rights reserved. | ||
import { CivicCookieControl } from './providers/CivicCookieControl'; | ||
import { ConsentManager } from './providers/ConsentManager'; | ||
import { CookieBot } from './providers/CookieBot'; | ||
import { CookieCategoryType } from './categories'; | ||
import { DidomiProvider } from './providers/Didomi'; | ||
import { Evidon } from './providers/Evidon'; | ||
@@ -17,2 +20,3 @@ import { HubSpot } from './providers/HubSpot'; | ||
import { TrustArc } from './providers/TrustArc'; | ||
import { Usercentrics } from './providers/Usercentrics'; | ||
@@ -47,7 +51,16 @@ export interface IProvider { | ||
'targeting', | ||
'functional', | ||
'function', | ||
'advertising', | ||
'personalization', | ||
'personalize', | ||
'ads', | ||
'geolocation', | ||
], | ||
[CookieCategoryType.Analytics]: [ | ||
'analytic', | ||
'measurement', | ||
'statistics', | ||
'research', | ||
], | ||
[CookieCategoryType.Preferences]: ['preference', 'personalization'], | ||
[CookieCategoryType.Analytics]: ['analytic'], | ||
[CookieCategoryType.Social]: ['social'], | ||
@@ -79,7 +92,11 @@ [CookieCategoryType.DoNotSell]: ['do not sell'], | ||
SecurePrivacy, | ||
HubSpot, | ||
Securiti, | ||
TrustArc, | ||
Evidon, | ||
CookieBot, | ||
ConsentManager, | ||
StackExchangeProvider, | ||
DidomiProvider, | ||
Usercentrics, | ||
HubSpot, // this is by far the broadest provider. Keep it for last | ||
]; |
{ | ||
"name": "@neevaco/cookie-cutter-engine", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "engine/dist/engine.js", | ||
@@ -15,3 +15,4 @@ "typings": "engine/dist/engine.d.ts", | ||
"format-check": "prettier --check '{**/*.ts,**/*.tsx}'", | ||
"format": "prettier --write '{**/*.ts,**/*.tsx}'" | ||
"format": "prettier --write '{**/*.ts,**/*.tsx}'", | ||
"ensure-version": "node ./checkVersion.js" | ||
}, | ||
@@ -37,2 +38,5 @@ "author": "", | ||
"html-webpack-plugin": "^5.5.0", | ||
"node-fetch": "^3.2.4", | ||
"prettier": "^2.6.2", | ||
"semver": "^7.3.7", | ||
"typescript": "^4.6.2", | ||
@@ -39,0 +43,0 @@ "webpack": "^5.70.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267626
84
2372
17
1