@duckduckgo/autoconsent 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # v3.0.3 (Fri Nov 18 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Fix borlabs tests. [#43](https://github.com/duckduckgo/autoconsent/pull/43) ([@sammacbeth](https://github.com/sammacbeth))
6
+ - Fix reddit [#46](https://github.com/duckduckgo/autoconsent/pull/46) ([@sammacbeth](https://github.com/sammacbeth))
7
+ - Add extra options for Jenkins to improve test reliability. [#48](https://github.com/duckduckgo/autoconsent/pull/48) ([@sammacbeth](https://github.com/sammacbeth))
8
+ - Fix popup showing after opt-out complete on stackoverflow.com [#41](https://github.com/duckduckgo/autoconsent/pull/41) ([@sammacbeth](https://github.com/sammacbeth))
9
+
10
+ #### Authors: 1
11
+
12
+ - Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
13
+
14
+ ---
15
+
1
16
  # v3.0.2 (Fri Nov 04 2022)
2
17
 
3
18
  #### 🐛 Bug Fix
package/Jenkinsfile CHANGED
@@ -1,14 +1,19 @@
1
- def runPlaywrightTests(resultDir) {
2
- sh 'mkdir -p ./test-results'
3
- sh """
4
- PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml npx playwright test --project webkit --project iphoneSE --reporter=junit || true
5
- """
6
- junit 'results.xml'
7
- sh """
8
- mkdir -p ${resultDir}/results/${BRANCH_NAME}/${BUILD_NUMBER}/$REGION/
9
- mkdir -p ./test-results
10
- mv ./test-results/ ${resultDir}/results/${BRANCH_NAME}/${BUILD_NUMBER}/$REGION/
11
- """
1
+ def runPlaywrightTests(resultDir, browser, grep) {
2
+ try {
3
+ timeout(20) {
4
+ sh 'mkdir -p ./test-results'
5
+ sh """
6
+ PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml npx playwright test --project $browser --reporter=junit --workers 10 --grep "$grep"|| true
7
+ """
8
+ }
9
+ } finally {
10
+ junit 'results.xml'
11
+ sh """
12
+ mkdir -p ${resultDir}/results/${BRANCH_NAME}/${BUILD_NUMBER}/$REGION/
13
+ mkdir -p ./test-results
14
+ mv ./test-results/ ${resultDir}/results/${BRANCH_NAME}/${BUILD_NUMBER}/$REGION/
15
+ """
16
+ }
12
17
  }
13
18
 
14
19
  def withEnvFile(envfile, Closure cb) {
@@ -19,9 +24,11 @@ def withEnvFile(envfile, Closure cb) {
19
24
  }
20
25
 
21
26
  pipeline {
22
- agent { label 'crawler-autoconsent' }
27
+ agent { label 'autoconsent-crawler' }
23
28
  parameters {
24
29
  string(name: 'TEST_RESULT_ROOT', defaultValue: '/mnt/efs/users/smacbeth/autoconsent/ci', description: 'Where test results and configuration are stored')
30
+ choice(name: 'BROWSER', choices: ['webkit', 'iphoneSE', 'chrome', 'firefox'], description: 'Browser')
31
+ string(name: 'GREP', defaultValue: '', description: 'filter for tests matching a specific string')
25
32
  }
26
33
  environment {
27
34
  NODENV_VERSION = "14.15.4"
@@ -41,13 +48,16 @@ pipeline {
41
48
  npm ci
42
49
  npx playwright install webkit
43
50
  '''
51
+ script {
52
+ currentBuild.description = "${params.BROWSER} - ${params.GREP}"
53
+ }
44
54
  }
45
55
  }
46
56
 
47
57
  stage('Test: DE') {
48
58
  steps {
49
59
  withEnvFile("${params.TEST_RESULT_ROOT}/de.env") {
50
- runPlaywrightTests(params.TEST_RESULT_ROOT)
60
+ runPlaywrightTests(params.TEST_RESULT_ROOT, params.BROWSER, params.GREP)
51
61
  }
52
62
  }
53
63
  }
@@ -55,7 +65,7 @@ pipeline {
55
65
  stage('Test: US') {
56
66
  steps {
57
67
  withEnvFile("${params.TEST_RESULT_ROOT}/us.env") {
58
- runPlaywrightTests(params.TEST_RESULT_ROOT)
68
+ runPlaywrightTests(params.TEST_RESULT_ROOT, params.BROWSER, params.GREP)
59
69
  }
60
70
  }
61
71
  }
@@ -63,7 +73,7 @@ pipeline {
63
73
  stage('Test: GB') {
64
74
  steps {
65
75
  withEnvFile("${params.TEST_RESULT_ROOT}/gb.env") {
66
- runPlaywrightTests(params.TEST_RESULT_ROOT)
76
+ runPlaywrightTests(params.TEST_RESULT_ROOT, params.BROWSER, params.GREP)
67
77
  }
68
78
  }
69
79
  }
@@ -71,7 +81,7 @@ pipeline {
71
81
  stage('Test: FR') {
72
82
  steps {
73
83
  withEnvFile("${params.TEST_RESULT_ROOT}/fr.env") {
74
- runPlaywrightTests(params.TEST_RESULT_ROOT)
84
+ runPlaywrightTests(params.TEST_RESULT_ROOT, params.BROWSER, params.GREP)
75
85
  }
76
86
  }
77
87
  }
@@ -1 +1 @@
1
- !function(){"use strict";class e{constructor(e,t=1e3){this.id=e,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t})),this.timer=window.setTimeout((()=>{this.reject(new Error("timeout"))}),t)}}const t={pending:new Map,sendContentMessage:null};function n(e="autoconsent-css-rules"){const t=`style#${e}`,n=document.querySelector(t);if(n&&n instanceof HTMLStyleElement)return n;{const t=document.head||document.getElementsByTagName("head")[0]||document.documentElement,n=document.createElement("style");return n.id=e,t.appendChild(n),n}}function o(e,t,n="display"){const o="opacity"===n?"opacity: 0":"display: none",i=`${t.join(",")} { ${o} !important; z-index: -1 !important; pointer-events: none !important; } `;return e instanceof HTMLStyleElement&&(e.innerText+=i,t.length>0)}async function i(e,t,n){const o=await e();return!o&&t>0?new Promise((o=>{setTimeout((async()=>{o(i(e,t-1,n))}),n)})):Promise.resolve(o)}function s(e){if(!e)return!1;if(null!==e.offsetParent)return!0;{const t=window.getComputedStyle(e);if("fixed"===t.position&&"none"!==t.display)return!0}return!1}function r(n){return function(n){let o;o=crypto&&void 0!==crypto.randomUUID?crypto.randomUUID():Math.random().toString(),t.sendContentMessage({type:"eval",id:o,code:n});const i=new e(o);return t.pending.set(i.id,i),i.promise}(n).catch((e=>!1))}function a(e,t=!1){const n=document.querySelectorAll(e);return n.length>0&&(t?n.forEach((e=>e.click())):n[0].click()),n.length>0}function c(e){return null!==document.querySelector(e)}function u(e,t){const n=document.querySelectorAll(e),o=new Array(n.length);return n.forEach(((e,t)=>{o[t]=s(e)})),"none"===t?o.every((e=>!e)):0!==o.length&&("any"===t?o.some((e=>e)):o.every((e=>e)))}function l(e,t=1e4){return i((()=>null!==document.querySelector(e)),Math.ceil(t/200),200)}async function d(e,t=1e4,n=!1){return await l(e,t),a(e,n)}function p(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}function h(){const e=n("autoconsent-prehide");return e&&e.remove(),!!e}const m={main:!0,frame:!1,urlPattern:""};class f{constructor(e){this.runContext=m,this.name=e}get hasSelfTest(){throw new Error("Not Implemented")}get isIntermediate(){throw new Error("Not Implemented")}checkRunContext(){const e={...m,...this.runContext},t=window.top===window;return!(t&&!e.main)&&(!(!t&&!e.frame)&&!(e.urlPattern&&!window.location.href.match(e.urlPattern)))}detectCmp(){throw new Error("Not Implemented")}async detectPopup(){return!1}optOut(){throw new Error("Not Implemented")}optIn(){throw new Error("Not Implemented")}openCmp(){throw new Error("Not Implemented")}async test(){return Promise.resolve(!0)}}async function y(e){const t=[];if(e.exists&&t.push(c(e.exists)),e.visible&&t.push(u(e.visible,e.check)),e.eval){const n=r(e.eval);t.push(n)}var s,h;if(e.waitFor&&t.push(l(e.waitFor,e.timeout)),e.waitForVisible&&t.push(function(e,t=1e4,n="any"){return i((()=>u(e,n)),Math.ceil(t/200),200)}(e.waitForVisible,e.timeout,e.check)),e.click&&t.push(a(e.click,e.all)),e.waitForThenClick&&t.push(d(e.waitForThenClick,e.timeout,e.all)),e.wait&&t.push(p(e.wait)),e.hide&&t.push((s=e.hide,h=e.method,o(n(),s,h))),e.if){if(!e.if.exists&&!e.if.visible)return console.error("invalid conditional rule",e.if),!1;await y(e.if)?t.push(w(e.then)):e.else&&t.push(w(e.else))}if(0===t.length)return!1;return(await Promise.all(t)).reduce(((e,t)=>e&&t),!0)}async function w(e){for(const t of e){if(!await y(t)&&!t.optional)return!1}return!0}class g extends f{constructor(e){super(e.name),this.config=e,this.runContext=e.runContext||m}get hasSelfTest(){return!!this.config.test}get isIntermediate(){return!!this.config.intermediate}get prehideSelectors(){return this.config.prehideSelectors}async detectCmp(){return!!this.config.detectCmp&&async function(e){const t=e.map((e=>y(e)));return(await Promise.all(t)).every((e=>!!e))}(this.config.detectCmp)}async detectPopup(){return!!this.config.detectPopup&&w(this.config.detectPopup)}async optOut(){return!!this.config.optOut&&w(this.config.optOut)}async optIn(){return!!this.config.optIn&&w(this.config.optIn)}async openCmp(){return!!this.config.openCmp&&w(this.config.openCmp)}async test(){return this.hasSelfTest?w(this.config.test):super.test()}}const b="#truste-show-consent",C="#truste-consent-track";const k=[new class extends f{constructor(){super("TrustArc-top"),this.prehideSelectors=[".trustarc-banner-container",`.truste_popframe,.truste_overlay,.truste_box_overlay,${C}`],this.runContext={main:!0,frame:!1},this._shortcutButton=null,this._optInDone=!1}get hasSelfTest(){return!1}get isIntermediate(){return!this._optInDone&&!this._shortcutButton}async detectCmp(){const e=c(`#truste-show-consent,${C}`);return e&&(this._shortcutButton=document.querySelector("#truste-consent-required")),e}async detectPopup(){return u(`#truste-consent-content,#trustarc-banner-overlay,${C}`,"all")}openFrame(){a(b)}async optOut(){return this._shortcutButton?(this._shortcutButton.click(),!0):(o(n(),[".truste_popframe",".truste_overlay",".truste_box_overlay",C]),a(b),setTimeout((()=>{n().remove()}),1e4),!0)}async optIn(){return this._optInDone=!0,a("#truste-consent-button")}async openCmp(){return!0}async test(){return!0}},new class extends f{constructor(){super("TrustArc-frame"),this.runContext={main:!1,frame:!0,urlPattern:"^https://consent-pref\\.trustarc\\.com/\\?"}}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){return!0}async detectPopup(){return u("#defaultpreferencemanager","any")&&u(".mainContent","any")}async navigateToSettings(){return await i((async()=>c(".shp")||u(".advance","any")||c(".switch span:first-child")),10,500),c(".shp")&&a(".shp"),await l(".prefPanel",5e3),u(".advance","any")&&a(".advance"),await i((()=>u(".switch span:first-child","any")),5,1e3)}async optOut(){return await i((()=>"complete"===document.readyState),20,100),await l(".mainContent[aria-hidden=false]",5e3),!!a(".rejectAll")||(c(".prefPanel")&&await l('.prefPanel[style="visibility: visible;"]',3e3),a("#catDetails0")?(a(".submit"),!0):(a(".required")||(await this.navigateToSettings(),a(".switch span:nth-child(1):not(.active)",!0),a(".submit"),l("#gwt-debug-close_id",3e5).then((()=>{a("#gwt-debug-close_id")}))),!0))}async optIn(){return a(".call")||(await this.navigateToSettings(),a(".switch span:nth-child(2)",!0),a(".submit"),l("#gwt-debug-close_id",3e5).then((()=>{a("#gwt-debug-close_id")}))),!0}},new class extends f{constructor(){super("Cybotcookiebot"),this.prehideSelectors=["#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookieoverlay"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("#CybotCookiebotDialogBodyLevelButtonPreferences")}async detectPopup(){return c("#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookiebanner")}async optOut(){return a(".cookie-alert-extended-detail-link")?(await l(".cookie-alert-configuration",2e3),a(".cookie-alert-configuration-input:checked",!0),a(".cookie-alert-extended-button-secondary"),!0):c("#dtcookie-container")?a(".h-dtcookie-decline"):(a(".cookiebot__button--settings")||a("#CybotCookiebotDialogBodyButtonDecline")||(a(".cookiebanner__link--details"),a('.CybotCookiebotDialogBodyLevelButton:checked:enabled,input[id*="CybotCookiebotDialogBodyLevelButton"]:checked:enabled',!0),a("#CybotCookiebotDialogBodyButtonDecline"),a("input[id^=CybotCookiebotDialogBodyLevelButton]:checked",!0),c("#CybotCookiebotDialogBodyButtonAcceptSelected")?a("#CybotCookiebotDialogBodyButtonAcceptSelected"):a("#CybotCookiebotDialogBodyLevelButtonAccept,#CybotCookiebotDialogBodyButtonAccept,#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection",!0),await r("window.CookieConsent.hasResponse !== true")&&(await r("window.Cookiebot.dialog.submitConsent()"),await p(500)),c("#cb-confirmedSettings")&&await r("endCookieProcess()")),!0)}async optIn(){return c("#dtcookie-container")?a(".h-dtcookie-accept"):(a(".CybotCookiebotDialogBodyLevelButton:not(:checked):enabled",!0),a("#CybotCookiebotDialogBodyLevelButtonAccept"),a("#CybotCookiebotDialogBodyButtonAccept"),!0)}async test(){return r("window.CookieConsent.declined === true")}},new class extends f{constructor(){super("Sourcepoint-top"),this.prehideSelectors=["div[id^='sp_message_container_'],.message-overlay"],this.runContext={main:!0,frame:!1}}get hasSelfTest(){return!0}get isIntermediate(){return!0}async detectCmp(){return c("div[id^='sp_message_container_']")}async detectPopup(){return u("div[id^='sp_message_container_']","all")}async optIn(){return!0}async optOut(){const e=document.querySelector(".sp-message-open");return e&&e.classList.remove("sp-message-open"),!0}async test(){return await r("__tcfapi('getTCData', 2, r => window.__rcsResult = r)"),await r("Object.values(window.__rcsResult.purpose.consents).every(c => !c)")}},new class extends f{constructor(){super("Sourcepoint-frame"),this.ccpaMode=!1,this.runContext={main:!1,frame:!0}}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){const e=new URL(location.href);return e.searchParams.has("message_id")&&"ccpa-notice.sp-prod.net"===e.hostname?(this.ccpaMode=!0,!0):("/index.html"===e.pathname||"/privacy-manager/index.html"===e.pathname)&&(e.searchParams.has("message_id")||e.searchParams.has("requestUUID")||e.searchParams.has("consentUUID"))}async detectPopup(){return await l(".sp_choice_type_11,.sp_choice_type_12,.sp_choice_type_13,.sp_choice_type_ACCEPT_ALL",2e3),!c(".sp_choice_type_9")}async optIn(){return await l(".sp_choice_type_11,.sp_choice_type_ACCEPT_ALL",2e3),!!a(".sp_choice_type_11")||!!a(".sp_choice_type_ACCEPT_ALL")}isManagerOpen(){return"/privacy-manager/index.html"===new URL(location.href).pathname}async optOut(){if(!this.isManagerOpen()){if(!await l(".sp_choice_type_12,.sp_choice_type_13"))return!1;if(!c(".sp_choice_type_12"))return a(".sp_choice_type_13");a(".sp_choice_type_12"),await i((()=>"/privacy-manager/index.html"===location.pathname),200,100)}await l(".type-modal",2e4);try{const e=".sp_choice_type_REJECT_ALL",t=".reject-toggle",n=await Promise.race([l(e,2e3).then((e=>e?0:-1)),l(t,2e3).then((e=>e?1:-1)),l(".pm-features",2e3).then((e=>e?2:-1))]);if(0===n)return await p(1e3),a(e);1===n?a(t):2===n&&(await l(".pm-features",1e4),a(".checked > span",!0),a(".chevron"))}catch(e){}return a(".sp_choice_type_SAVE_AND_EXIT"),!0}},new class extends f{constructor(){super("consentmanager.net"),this.prehideSelectors=["#cmpbox,#cmpbox2"],this.apiAvailable=!1}get hasSelfTest(){return this.apiAvailable}get isIntermediate(){return!1}async detectCmp(){return this.apiAvailable=await r('window.__cmp && typeof __cmp("getCMPData") === "object"'),!!this.apiAvailable||c("#cmpbox")}async detectPopup(){return this.apiAvailable?(await p(500),await r("!__cmp('consentStatus').userChoiceExists")):u("#cmpbox .cmpmore","any")}async optOut(){return await p(500),this.apiAvailable?await r("__cmp('setConsent', 0)"):!!a(".cmpboxbtnno")||(c(".cmpwelcomeprpsbtn")?(a(".cmpwelcomeprpsbtn > a[aria-checked=true]",!0),a(".cmpboxbtnsave"),!0):(a(".cmpboxbtncustom"),await l(".cmptblbox",2e3),a(".cmptdchoice > a[aria-checked=true]",!0),a(".cmpboxbtnyescustomchoices"),!0))}async optIn(){return this.apiAvailable?await r("__cmp('setConsent', 1)"):a(".cmpboxbtnyes")}async test(){if(this.apiAvailable)return await r("__cmp('consentStatus').userChoiceExists")}},new class extends f{constructor(){super("Evidon")}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){return c("#_evidon_banner")}async detectPopup(){return u("#_evidon_banner","any")}async optOut(){return a("#_evidon-decline-button")||(o(n(),["#evidon-prefdiag-overlay","#evidon-prefdiag-background"]),a("#_evidon-option-button"),await l("#evidon-prefdiag-overlay",5e3),a("#evidon-prefdiag-decline")),!0}async optIn(){return a("#_evidon-accept-button")}},new class extends f{constructor(){super("Onetrust"),this.prehideSelectors=["#onetrust-banner-sdk,#onetrust-consent-sdk,.onetrust-pc-dark-filter,.js-consent-banner"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("#onetrust-banner-sdk")}async detectPopup(){return u("#onetrust-banner-sdk","all")}async optOut(){return c("#onetrust-pc-btn-handler")?a("#onetrust-pc-btn-handler"):a(".ot-sdk-show-settings,button.js-cookie-settings"),await l("#onetrust-consent-sdk",2e3),await p(1e3),a("#onetrust-consent-sdk input.category-switch-handler:checked,.js-editor-toggle-state:checked",!0),await l(".save-preference-btn-handler,.js-consent-save",2e3),a(".save-preference-btn-handler,.js-consent-save"),await i((()=>u("#onetrust-banner-sdk","none")),10,500),!0}async optIn(){return a("#onetrust-accept-btn-handler,.js-accept-cookies")}async test(){return await r("window.OnetrustActiveGroups.split(',').filter(s => s.length > 0).length <= 1")}},new class extends f{constructor(){super("Klaro"),this.prehideSelectors=[".klaro"],this.settingsOpen=!1}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".klaro > .cookie-modal")?(this.settingsOpen=!0,!0):c(".klaro > .cookie-notice")}async detectPopup(){return u(".klaro > .cookie-notice,.klaro > .cookie-modal","any")}async optOut(){return!!a(".klaro .cn-decline")||(this.settingsOpen||(a(".klaro .cn-learn-more"),await l(".klaro > .cookie-modal",2e3),this.settingsOpen=!0),!!a(".klaro .cn-decline")||(a(".cm-purpose:not(.cm-toggle-all) > input:not(.half-checked)",!0),a(".cm-btn-accept")))}async optIn(){return!!a(".klaro .cm-btn-accept-all")||(this.settingsOpen?(a(".cm-purpose:not(.cm-toggle-all) > input.half-checked",!0),a(".cm-btn-accept")):a(".klaro .cookie-notice .cm-btn-success"))}async test(){return await r("klaro.getManager().config.services.every(c => c.required || !klaro.getManager().consents[c.name])")}},new class extends f{constructor(){super("Uniconsent")}get prehideSelectors(){return[".unic",".modal:has(.unic)"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".unic .unic-box,.unic .unic-bar")}async detectPopup(){return u(".unic .unic-box,.unic .unic-bar","any")}async optOut(){if(await l(".unic button",1e3),document.querySelectorAll(".unic button").forEach((e=>{const t=e.textContent;(t.includes("Manage Options")||t.includes("Optionen verwalten"))&&e.click()})),await l(".unic input[type=checkbox]",1e3)){await l(".unic button",1e3),document.querySelectorAll(".unic input[type=checkbox]").forEach((e=>{e.checked&&e.click()}));for(const e of document.querySelectorAll(".unic button")){const t=e.textContent;for(const n of["Confirm Choices","Save Choices","Auswahl speichern"])if(t.includes(n))return e.click(),await p(500),!0}}return!1}async optIn(){return d(".unic #unic-agree")}async test(){await p(1e3);return!c(".unic .unic-box,.unic .unic-bar")}},new class extends f{constructor(){super("Conversant"),this.prehideSelectors=[".cmp-root"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".cmp-root .cmp-receptacle")}async detectPopup(){return u(".cmp-root .cmp-receptacle","any")}async optOut(){if(!await d(".cmp-main-button:not(.cmp-main-button--primary)"))return!1;if(!await l(".cmp-view-tab-tabs"))return!1;await d(".cmp-view-tab-tabs > :first-child"),await d(".cmp-view-tab-tabs > .cmp-view-tab--active:first-child");for(const e of Array.from(document.querySelectorAll(".cmp-accordion-item"))){e.querySelector(".cmp-accordion-item-title").click(),await i((()=>!!e.querySelector(".cmp-accordion-item-content.cmp-active")),10,50);const t=e.querySelector(".cmp-accordion-item-content.cmp-active");t.querySelectorAll(".cmp-toggle-actions .cmp-toggle-deny:not(.cmp-toggle-deny--active)").forEach((e=>e.click())),t.querySelectorAll(".cmp-toggle-actions .cmp-toggle-checkbox:not(.cmp-toggle-checkbox--active)").forEach((e=>e.click()))}return await a(".cmp-main-button:not(.cmp-main-button--primary)"),!0}async optIn(){return d(".cmp-main-button.cmp-main-button--primary")}async test(){return document.cookie.includes("cmp-data=0")}},new class extends f{constructor(){super("tiktok.com"),this.runContext={urlPattern:"tiktok"}}get hasSelfTest(){return!0}get isIntermediate(){return!1}getShadowRoot(){const e=document.querySelector("tiktok-cookie-banner");return e?e.shadowRoot:null}async detectCmp(){return c("tiktok-cookie-banner")}async detectPopup(){return s(this.getShadowRoot().querySelector(".tiktok-cookie-banner"))}async optOut(){const e=this.getShadowRoot().querySelector(".button-wrapper button:first-child");return!!e&&(e.click(),!0)}async optIn(){const e=this.getShadowRoot().querySelector(".button-wrapper button:last-child");return!!e&&(e.click(),!0)}async test(){const e=document.cookie.match(/cookie-consent=([^;]+)/);if(!e)return!1;const t=JSON.parse(decodeURIComponent(e[1]));return Object.values(t).every((e=>"boolean"!=typeof e||!1===e))}},new class extends f{constructor(){super("airbnb"),this.runContext={urlPattern:"^https://(www\\.)?airbnb\\.[^/]+/"},this.prehideSelectors=["div[data-testid=main-cookies-banner-container]",'div:has(> div:first-child):has(> div:last-child):has(> section [data-testid="strictly-necessary-cookies"])']}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("div[data-testid=main-cookies-banner-container]")}async detectPopup(){return u("div[data-testid=main-cookies-banner-container","any")}async optOut(){let e;for(await d("div[data-testid=main-cookies-banner-container] button._snbhip0");e=document.querySelector("[data-testid=modal-container] button[aria-checked=true]:not([disabled])");)e.click();return d("button[data-testid=save-btn]")}async optIn(){return d("div[data-testid=main-cookies-banner-container] button._148dgdpk")}async test(){return await i((()=>!!document.cookie.match("OptanonAlertBoxClosed")),20,200)}}];class v{static setBase(e){v.base=e}static findElement(e,t=null,n=!1){let o=null;return o=null!=t?Array.from(t.querySelectorAll(e.selector)):null!=v.base?Array.from(v.base.querySelectorAll(e.selector)):Array.from(document.querySelectorAll(e.selector)),null!=e.textFilter&&(o=o.filter((t=>{let n=t.textContent.toLowerCase();if(Array.isArray(e.textFilter)){let t=!1;for(let o of e.textFilter)if(-1!==n.indexOf(o.toLowerCase())){t=!0;break}return t}if(null!=e.textFilter)return-1!==n.indexOf(e.textFilter.toLowerCase())}))),null!=e.styleFilters&&(o=o.filter((t=>{let n=window.getComputedStyle(t),o=!0;for(let t of e.styleFilters){let e=n[t.option];o=t.negated?o&&e!==t.value:o&&e===t.value}return o}))),null!=e.displayFilter&&(o=o.filter((t=>e.displayFilter?0!==t.offsetHeight:0===t.offsetHeight))),null!=e.iframeFilter&&(o=o.filter((t=>e.iframeFilter?window.location!==window.parent.location:window.location===window.parent.location))),null!=e.childFilter&&(o=o.filter((t=>{let n=v.base;v.setBase(t);let o=v.find(e.childFilter);return v.setBase(n),null!=o.target}))),n?o:(o.length>1&&console.warn("Multiple possible targets: ",o,e,t),o[0])}static find(e,t=!1){let n=[];if(null!=e.parent){let o=v.findElement(e.parent,null,t);if(null!=o){if(o instanceof Array)return o.forEach((o=>{let i=v.findElement(e.target,o,t);i instanceof Array?i.forEach((e=>{n.push({parent:o,target:e})})):n.push({parent:o,target:i})})),n;{let i=v.findElement(e.target,o,t);i instanceof Array?i.forEach((e=>{n.push({parent:o,target:e})})):n.push({parent:o,target:i})}}}else{let o=v.findElement(e.target,null,t);o instanceof Array?o.forEach((e=>{n.push({parent:null,target:e})})):n.push({parent:null,target:o})}return 0===n.length&&n.push({parent:null,target:null}),t?n:(1!==n.length&&console.warn("Multiple results found, even though multiple false",n),n[0])}}function _(e){const t=v.find(e);return"css"===e.type?!!t.target:"checkbox"===e.type?!!t.target&&t.target.checked:void 0}async function S(e,t){switch(e.type){case"click":return async function(e){const t=v.find(e);null!=t.target&&t.target.click();return x(0)}(e);case"list":return async function(e,t){for(let n of e.actions)await S(n,t)}(e,t);case"consent":return async function(e,t){for(const n of e.consents){const e=-1!==t.indexOf(n.type);if(n.matcher&&n.toggleAction){_(n.matcher)!==e&&await S(n.toggleAction)}else e?await S(n.trueAction):await S(n.falseAction)}}(e,t);case"ifcss":return async function(e,t){v.find(e).target?e.falseAction&&await S(e.falseAction,t):e.trueAction&&await S(e.trueAction,t)}(e,t);case"waitcss":return async function(e){await new Promise((t=>{let n=e.retries||10;const o=e.waitTime||250,i=()=>{const s=v.find(e);(e.negated&&s.target||!e.negated&&!s.target)&&n>0?(n-=1,setTimeout(i,o)):t()};i()}))}(e);case"foreach":return async function(e,t){const n=v.find(e,!0),o=v.base;for(const o of n)o.target&&(v.setBase(o.target),await S(e.action,t));v.setBase(o)}(e,t);case"hide":return async function(e){const t=v.find(e);t.target&&t.target.classList.add("Autoconsent-Hidden")}(e);case"slide":return async function(e){const t=v.find(e),n=v.find(e.dragTarget);if(t.target){let e=t.target.getBoundingClientRect(),o=n.target.getBoundingClientRect(),i=o.top-e.top,s=o.left-e.left;"y"===this.config.axis.toLowerCase()&&(s=0),"x"===this.config.axis.toLowerCase()&&(i=0);let r=window.screenX+e.left+e.width/2,a=window.screenY+e.top+e.height/2,c=e.left+e.width/2,u=e.top+e.height/2,l=document.createEvent("MouseEvents");l.initMouseEvent("mousedown",!0,!0,window,0,r,a,c,u,!1,!1,!1,!1,0,t.target);let d=document.createEvent("MouseEvents");d.initMouseEvent("mousemove",!0,!0,window,0,r+s,a+i,c+s,u+i,!1,!1,!1,!1,0,t.target);let p=document.createEvent("MouseEvents");p.initMouseEvent("mouseup",!0,!0,window,0,r+s,a+i,c+s,u+i,!1,!1,!1,!1,0,t.target),t.target.dispatchEvent(l),await this.waitTimeout(10),t.target.dispatchEvent(d),await this.waitTimeout(10),t.target.dispatchEvent(p)}}(e);case"close":return async function(e){window.close()}();case"wait":return async function(e){await x(e.waitTime)}(e);case"eval":return async function(e){return console.log("eval!",e.code),new Promise((t=>{try{e.async?(window.eval(e.code),setTimeout((()=>{t(window.eval("window.__consentCheckResult"))}),e.timeout||250)):t(window.eval(e.code))}catch(n){console.warn("eval error",n,e.code),t(!1)}}))}(e);default:throw"Unknown action type: "+e.type}}v.base=null;function x(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}class P{constructor(e,t){this.name=e,this.config=t,this.methods=new Map,this.runContext=m,t.methods.forEach((e=>{e.action&&this.methods.set(e.name,e.action)})),this.hasSelfTest=!1}get isIntermediate(){return!1}checkRunContext(){return!0}async detectCmp(){return this.config.detectors.map((e=>_(e.presentMatcher))).some((e=>!!e))}async detectPopup(){return this.config.detectors.map((e=>_(e.showingMatcher))).some((e=>!!e))}async executeAction(e,t){return!this.methods.has(e)||S(this.methods.get(e),t)}async optOut(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),await this.executeAction("HIDE_CMP"),await this.executeAction("DO_CONSENT",[]),await this.executeAction("SAVE_CONSENT"),!0}async optIn(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),await this.executeAction("HIDE_CMP"),await this.executeAction("DO_CONSENT",["D","A","B","E","F","X"]),await this.executeAction("SAVE_CONSENT"),!0}async openCmp(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),!0}async test(){return!0}}const A=new class{constructor(e,n=null,o=null){if(this.rules=[],this.foundCmp=null,t.sendContentMessage=e,this.sendContentMessage=e,this.rules=[...k],n)this.initialize(n,o);else{o&&this.parseRules(o);e({type:"init",url:window.location.href})}}initialize(e,t){if(this.config=e,e.enabled){if(t&&this.parseRules(t),e.disabledCmps?.length>0&&this.disableCMPs(e.disabledCmps),e.enablePrehide)if(document.documentElement)this.prehideElements();else{const e=()=>{window.removeEventListener("DOMContentLoaded",e),this.prehideElements()};window.addEventListener("DOMContentLoaded",e)}if("loading"===document.readyState){const e=()=>{window.removeEventListener("DOMContentLoaded",e),this.start()};window.addEventListener("DOMContentLoaded",e)}else this.start()}}parseRules(e){Object.keys(e.consentomatic).forEach((t=>{this.addConsentomaticCMP(t,e.consentomatic[t])})),e.autoconsent.forEach((e=>{this.addCMP(e)}))}addCMP(e){this.rules.push(function(e){return new g(e)}(e))}disableCMPs(e){this.rules=this.rules.filter((t=>!e.includes(t.name)))}addConsentomaticCMP(e,t){this.rules.push(new P(`com_${e}`,t))}start(){window.requestIdleCallback?window.requestIdleCallback((()=>this._start()),{timeout:500}):this._start()}async _start(){const e=await this.findCmp(this.config.detectRetries);if(e.length>0){const t=[];for(const n of e)this.sendContentMessage({type:"cmpDetected",url:location.href,cmp:n.name}),t.push(this.waitForPopup(n).then((e=>e?(this.foundCmp||(this.foundCmp=n),this.sendContentMessage({type:"popupFound",cmp:n.name,url:location.href}),!0):Promise.reject(`${n.name} popup not found`))));let n=!1;for(const e of t)try{await e,n=!0;break}catch(e){continue}return n?"optOut"===this.config.autoAction?await this.doOptOut():"optIn"!==this.config.autoAction||await this.doOptIn():(this.config.enablePrehide&&h(),!1)}return this.config.enablePrehide&&h(),!1}async findCmp(e){const t=[];for(const e of this.rules)try{if(!e.checkRunContext())continue;await e.detectCmp()&&t.push(e)}catch(e){}if(t.length>1){const e={msg:"Found multiple CMPs, check the detection rules.",cmps:t.map((e=>e.name))};this.sendContentMessage({type:"autoconsentError",details:e})}return 0===t.length&&e>0?new Promise((t=>{setTimeout((async()=>{const n=this.findCmp(e-1);t(n)}),500)})):t}async doOptOut(){let e;return e=!!this.foundCmp&&await this.foundCmp.optOut(),this.config.enablePrehide&&h(),this.sendContentMessage({type:"optOutResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,scheduleSelfTest:this.foundCmp&&this.foundCmp.hasSelfTest,url:location.href}),e&&!this.foundCmp.isIntermediate&&this.sendContentMessage({type:"autoconsentDone",cmp:this.foundCmp.name,url:location.href}),e}async doOptIn(){let e;return e=!!this.foundCmp&&await this.foundCmp.optIn(),this.config.enablePrehide&&h(),this.sendContentMessage({type:"optInResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,scheduleSelfTest:!1,url:location.href}),e&&!this.foundCmp.isIntermediate&&this.sendContentMessage({type:"autoconsentDone",cmp:this.foundCmp.name,url:location.href}),e}async doSelfTest(){let e;return e=!!this.foundCmp&&await this.foundCmp.test(),this.sendContentMessage({type:"selfTestResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,url:location.href}),e}async waitForPopup(e,t=5,n=500){const o=await e.detectPopup();return!o&&t>0?new Promise((o=>setTimeout((()=>o(this.waitForPopup(e,t-1,n))),n))):o}prehideElements(){return function(e){return o(n("autoconsent-prehide"),e,"opacity")}(this.rules.reduce(((e,t)=>t.prehideSelectors?[...e,...t.prehideSelectors]:e),["#didomi-popup,.didomi-popup-container,.didomi-popup-notice,.didomi-consent-popup-preferences,#didomi-notice,.didomi-popup-backdrop,.didomi-screen-medium"]))}async receiveMessageCallback(e){switch(e.type){case"initResp":this.initialize(e.config,e.rules);break;case"optIn":await this.doOptIn();break;case"optOut":await this.doOptOut();break;case"selfTest":await this.doSelfTest();break;case"evalResp":!function(e,n){const o=t.pending.get(e);o?(t.pending.delete(e),o.timer&&window.clearTimeout(o.timer),o.resolve(n)):console.warn("no eval #",e)}(e.id,e.result)}}}(chrome.runtime.sendMessage);chrome.runtime.onMessage.addListener((e=>Promise.resolve(A.receiveMessageCallback(e))))}();
1
+ !function(){"use strict";class e{constructor(e,t=1e3){this.id=e,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t})),this.timer=window.setTimeout((()=>{this.reject(new Error("timeout"))}),t)}}const t={pending:new Map,sendContentMessage:null};function n(e="autoconsent-css-rules"){const t=`style#${e}`,n=document.querySelector(t);if(n&&n instanceof HTMLStyleElement)return n;{const t=document.head||document.getElementsByTagName("head")[0]||document.documentElement,n=document.createElement("style");return n.id=e,t.appendChild(n),n}}function o(e,t,n="display"){const o="opacity"===n?"opacity: 0":"display: none",i=`${t.join(",")} { ${o} !important; z-index: -1 !important; pointer-events: none !important; } `;return e instanceof HTMLStyleElement&&(e.innerText+=i,t.length>0)}async function i(e,t,n){const o=await e();return!o&&t>0?new Promise((o=>{setTimeout((async()=>{o(i(e,t-1,n))}),n)})):Promise.resolve(o)}function s(e){if(!e)return!1;if(null!==e.offsetParent)return!0;{const t=window.getComputedStyle(e);if("fixed"===t.position&&"none"!==t.display)return!0}return!1}function r(n){return function(n){let o;o=crypto&&void 0!==crypto.randomUUID?crypto.randomUUID():Math.random().toString(),t.sendContentMessage({type:"eval",id:o,code:n});const i=new e(o);return t.pending.set(i.id,i),i.promise}(n).catch((e=>!1))}function a(e,t=!1){const n=document.querySelectorAll(e);return n.length>0&&(t?n.forEach((e=>e.click())):n[0].click()),n.length>0}function c(e){return null!==document.querySelector(e)}function u(e,t){const n=document.querySelectorAll(e),o=new Array(n.length);return n.forEach(((e,t)=>{o[t]=s(e)})),"none"===t?o.every((e=>!e)):0!==o.length&&("any"===t?o.some((e=>e)):o.every((e=>e)))}function l(e,t=1e4){return i((()=>null!==document.querySelector(e)),Math.ceil(t/200),200)}async function d(e,t=1e4,n=!1){return await l(e,t),a(e,n)}function p(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}function h(){const e=n("autoconsent-prehide");return e&&e.remove(),!!e}const m={main:!0,frame:!1,urlPattern:""};class f{constructor(e){this.runContext=m,this.name=e}get hasSelfTest(){throw new Error("Not Implemented")}get isIntermediate(){throw new Error("Not Implemented")}checkRunContext(){const e={...m,...this.runContext},t=window.top===window;return!(t&&!e.main)&&(!(!t&&!e.frame)&&!(e.urlPattern&&!window.location.href.match(e.urlPattern)))}detectCmp(){throw new Error("Not Implemented")}async detectPopup(){return!1}optOut(){throw new Error("Not Implemented")}optIn(){throw new Error("Not Implemented")}openCmp(){throw new Error("Not Implemented")}async test(){return Promise.resolve(!0)}}async function y(e){const t=[];if(e.exists&&t.push(c(e.exists)),e.visible&&t.push(u(e.visible,e.check)),e.eval){const n=r(e.eval);t.push(n)}var s,h;if(e.waitFor&&t.push(l(e.waitFor,e.timeout)),e.waitForVisible&&t.push(function(e,t=1e4,n="any"){return i((()=>u(e,n)),Math.ceil(t/200),200)}(e.waitForVisible,e.timeout,e.check)),e.click&&t.push(a(e.click,e.all)),e.waitForThenClick&&t.push(d(e.waitForThenClick,e.timeout,e.all)),e.wait&&t.push(p(e.wait)),e.hide&&t.push((s=e.hide,h=e.method,o(n(),s,h))),e.if){if(!e.if.exists&&!e.if.visible)return console.error("invalid conditional rule",e.if),!1;await y(e.if)?t.push(w(e.then)):e.else&&t.push(w(e.else))}if(0===t.length)return!1;return(await Promise.all(t)).reduce(((e,t)=>e&&t),!0)}async function w(e){for(const t of e){if(!await y(t)&&!t.optional)return!1}return!0}class g extends f{constructor(e){super(e.name),this.config=e,this.runContext=e.runContext||m}get hasSelfTest(){return!!this.config.test}get isIntermediate(){return!!this.config.intermediate}get prehideSelectors(){return this.config.prehideSelectors}async detectCmp(){return!!this.config.detectCmp&&async function(e){const t=e.map((e=>y(e)));return(await Promise.all(t)).every((e=>!!e))}(this.config.detectCmp)}async detectPopup(){return!!this.config.detectPopup&&w(this.config.detectPopup)}async optOut(){return!!this.config.optOut&&w(this.config.optOut)}async optIn(){return!!this.config.optIn&&w(this.config.optIn)}async openCmp(){return!!this.config.openCmp&&w(this.config.openCmp)}async test(){return this.hasSelfTest?w(this.config.test):super.test()}}const b="#truste-show-consent",C="#truste-consent-track";const k=[new class extends f{constructor(){super("TrustArc-top"),this.prehideSelectors=[".trustarc-banner-container",`.truste_popframe,.truste_overlay,.truste_box_overlay,${C}`],this.runContext={main:!0,frame:!1},this._shortcutButton=null,this._optInDone=!1}get hasSelfTest(){return!1}get isIntermediate(){return!this._optInDone&&!this._shortcutButton}async detectCmp(){const e=c(`#truste-show-consent,${C}`);return e&&(this._shortcutButton=document.querySelector("#truste-consent-required")),e}async detectPopup(){return u(`#truste-consent-content,#trustarc-banner-overlay,${C}`,"all")}openFrame(){a(b)}async optOut(){return this._shortcutButton?(this._shortcutButton.click(),!0):(o(n(),[".truste_popframe",".truste_overlay",".truste_box_overlay",C]),a(b),setTimeout((()=>{n().remove()}),1e4),!0)}async optIn(){return this._optInDone=!0,a("#truste-consent-button")}async openCmp(){return!0}async test(){return!0}},new class extends f{constructor(){super("TrustArc-frame"),this.runContext={main:!1,frame:!0,urlPattern:"^https://consent-pref\\.trustarc\\.com/\\?"}}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){return!0}async detectPopup(){return u("#defaultpreferencemanager","any")&&u(".mainContent","any")}async navigateToSettings(){return await i((async()=>c(".shp")||u(".advance","any")||c(".switch span:first-child")),10,500),c(".shp")&&a(".shp"),await l(".prefPanel",5e3),u(".advance","any")&&a(".advance"),await i((()=>u(".switch span:first-child","any")),5,1e3)}async optOut(){return await i((()=>"complete"===document.readyState),20,100),await l(".mainContent[aria-hidden=false]",5e3),!!a(".rejectAll")||(c(".prefPanel")&&await l('.prefPanel[style="visibility: visible;"]',3e3),a("#catDetails0")?(a(".submit"),!0):(a(".required")||(await this.navigateToSettings(),a(".switch span:nth-child(1):not(.active)",!0),a(".submit"),l("#gwt-debug-close_id",3e5).then((()=>{a("#gwt-debug-close_id")}))),!0))}async optIn(){return a(".call")||(await this.navigateToSettings(),a(".switch span:nth-child(2)",!0),a(".submit"),l("#gwt-debug-close_id",3e5).then((()=>{a("#gwt-debug-close_id")}))),!0}},new class extends f{constructor(){super("Cybotcookiebot"),this.prehideSelectors=["#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookieoverlay"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("#CybotCookiebotDialogBodyLevelButtonPreferences")}async detectPopup(){return c("#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookiebanner")}async optOut(){return a(".cookie-alert-extended-detail-link")?(await l(".cookie-alert-configuration",2e3),a(".cookie-alert-configuration-input:checked",!0),a(".cookie-alert-extended-button-secondary"),!0):c("#dtcookie-container")?a(".h-dtcookie-decline"):(a(".cookiebot__button--settings")||a("#CybotCookiebotDialogBodyButtonDecline")||(a(".cookiebanner__link--details"),a('.CybotCookiebotDialogBodyLevelButton:checked:enabled,input[id*="CybotCookiebotDialogBodyLevelButton"]:checked:enabled',!0),a("#CybotCookiebotDialogBodyButtonDecline"),a("input[id^=CybotCookiebotDialogBodyLevelButton]:checked",!0),c("#CybotCookiebotDialogBodyButtonAcceptSelected")?a("#CybotCookiebotDialogBodyButtonAcceptSelected"):a("#CybotCookiebotDialogBodyLevelButtonAccept,#CybotCookiebotDialogBodyButtonAccept,#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection",!0),await r("window.CookieConsent.hasResponse !== true")&&(await r("window.Cookiebot.dialog.submitConsent()"),await p(500)),c("#cb-confirmedSettings")&&await r("endCookieProcess()")),!0)}async optIn(){return c("#dtcookie-container")?a(".h-dtcookie-accept"):(a(".CybotCookiebotDialogBodyLevelButton:not(:checked):enabled",!0),a("#CybotCookiebotDialogBodyLevelButtonAccept"),a("#CybotCookiebotDialogBodyButtonAccept"),!0)}async test(){return r("window.CookieConsent.declined === true")}},new class extends f{constructor(){super("Sourcepoint-top"),this.prehideSelectors=["div[id^='sp_message_container_'],.message-overlay"],this.runContext={main:!0,frame:!1}}get hasSelfTest(){return!0}get isIntermediate(){return!0}async detectCmp(){return c("div[id^='sp_message_container_']")}async detectPopup(){return u("div[id^='sp_message_container_']","all")}async optIn(){return!0}async optOut(){const e=document.querySelector(".sp-message-open");return e&&e.classList.remove("sp-message-open"),!0}async test(){return await r("__tcfapi('getTCData', 2, r => window.__rcsResult = r)"),await r("Object.values(window.__rcsResult.purpose.consents).every(c => !c)")}},new class extends f{constructor(){super("Sourcepoint-frame"),this.ccpaMode=!1,this.runContext={main:!1,frame:!0}}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){const e=new URL(location.href);return e.searchParams.has("message_id")&&"ccpa-notice.sp-prod.net"===e.hostname?(this.ccpaMode=!0,!0):("/index.html"===e.pathname||"/privacy-manager/index.html"===e.pathname)&&(e.searchParams.has("message_id")||e.searchParams.has("requestUUID")||e.searchParams.has("consentUUID"))}async detectPopup(){return await l(".sp_choice_type_11,.sp_choice_type_12,.sp_choice_type_13,.sp_choice_type_ACCEPT_ALL",2e3),!c(".sp_choice_type_9")}async optIn(){return await l(".sp_choice_type_11,.sp_choice_type_ACCEPT_ALL",2e3),!!a(".sp_choice_type_11")||!!a(".sp_choice_type_ACCEPT_ALL")}isManagerOpen(){return"/privacy-manager/index.html"===new URL(location.href).pathname}async optOut(){if(!this.isManagerOpen()){if(!await l(".sp_choice_type_12,.sp_choice_type_13"))return!1;if(!c(".sp_choice_type_12"))return a(".sp_choice_type_13");a(".sp_choice_type_12"),await i((()=>"/privacy-manager/index.html"===location.pathname),200,100)}await l(".type-modal",2e4);try{const e=".sp_choice_type_REJECT_ALL",t=".reject-toggle",n=await Promise.race([l(e,2e3).then((e=>e?0:-1)),l(t,2e3).then((e=>e?1:-1)),l(".pm-features",2e3).then((e=>e?2:-1))]);if(0===n)return await p(1e3),a(e);1===n?a(t):2===n&&(await l(".pm-features",1e4),a(".checked > span",!0),a(".chevron"))}catch(e){}return a(".sp_choice_type_SAVE_AND_EXIT"),!0}},new class extends f{constructor(){super("consentmanager.net"),this.prehideSelectors=["#cmpbox,#cmpbox2"],this.apiAvailable=!1}get hasSelfTest(){return this.apiAvailable}get isIntermediate(){return!1}async detectCmp(){return this.apiAvailable=await r('window.__cmp && typeof __cmp("getCMPData") === "object"'),!!this.apiAvailable||c("#cmpbox")}async detectPopup(){return this.apiAvailable?(await p(500),await r("!__cmp('consentStatus').userChoiceExists")):u("#cmpbox .cmpmore","any")}async optOut(){return await p(500),this.apiAvailable?await r("__cmp('setConsent', 0)"):!!a(".cmpboxbtnno")||(c(".cmpwelcomeprpsbtn")?(a(".cmpwelcomeprpsbtn > a[aria-checked=true]",!0),a(".cmpboxbtnsave"),!0):(a(".cmpboxbtncustom"),await l(".cmptblbox",2e3),a(".cmptdchoice > a[aria-checked=true]",!0),a(".cmpboxbtnyescustomchoices"),!0))}async optIn(){return this.apiAvailable?await r("__cmp('setConsent', 1)"):a(".cmpboxbtnyes")}async test(){if(this.apiAvailable)return await r("__cmp('consentStatus').userChoiceExists")}},new class extends f{constructor(){super("Evidon")}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){return c("#_evidon_banner")}async detectPopup(){return u("#_evidon_banner","any")}async optOut(){return a("#_evidon-decline-button")||(o(n(),["#evidon-prefdiag-overlay","#evidon-prefdiag-background"]),a("#_evidon-option-button"),await l("#evidon-prefdiag-overlay",5e3),a("#evidon-prefdiag-decline")),!0}async optIn(){return a("#_evidon-accept-button")}},new class extends f{constructor(){super("Onetrust"),this.prehideSelectors=["#onetrust-banner-sdk,#onetrust-consent-sdk,.onetrust-pc-dark-filter,.js-consent-banner"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("#onetrust-banner-sdk")}async detectPopup(){return u("#onetrust-banner-sdk","all")}async optOut(){return c("#onetrust-pc-btn-handler")?a("#onetrust-pc-btn-handler"):a(".ot-sdk-show-settings,button.js-cookie-settings"),await l("#onetrust-consent-sdk",2e3),await p(1e3),a("#onetrust-consent-sdk input.category-switch-handler:checked,.js-editor-toggle-state:checked",!0),await p(1e3),await l(".save-preference-btn-handler,.js-consent-save",2e3),a(".save-preference-btn-handler,.js-consent-save"),await i((()=>u("#onetrust-banner-sdk","none")),10,500),!0}async optIn(){return a("#onetrust-accept-btn-handler,.js-accept-cookies")}async test(){return await r("window.OnetrustActiveGroups.split(',').filter(s => s.length > 0).length <= 1")}},new class extends f{constructor(){super("Klaro"),this.prehideSelectors=[".klaro"],this.settingsOpen=!1}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".klaro > .cookie-modal")?(this.settingsOpen=!0,!0):c(".klaro > .cookie-notice")}async detectPopup(){return u(".klaro > .cookie-notice,.klaro > .cookie-modal","any")}async optOut(){return!!a(".klaro .cn-decline")||(this.settingsOpen||(a(".klaro .cn-learn-more"),await l(".klaro > .cookie-modal",2e3),this.settingsOpen=!0),!!a(".klaro .cn-decline")||(a(".cm-purpose:not(.cm-toggle-all) > input:not(.half-checked)",!0),a(".cm-btn-accept")))}async optIn(){return!!a(".klaro .cm-btn-accept-all")||(this.settingsOpen?(a(".cm-purpose:not(.cm-toggle-all) > input.half-checked",!0),a(".cm-btn-accept")):a(".klaro .cookie-notice .cm-btn-success"))}async test(){return await r("klaro.getManager().config.services.every(c => c.required || !klaro.getManager().consents[c.name])")}},new class extends f{constructor(){super("Uniconsent")}get prehideSelectors(){return[".unic",".modal:has(.unic)"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".unic .unic-box,.unic .unic-bar")}async detectPopup(){return u(".unic .unic-box,.unic .unic-bar","any")}async optOut(){if(await l(".unic button",1e3),document.querySelectorAll(".unic button").forEach((e=>{const t=e.textContent;(t.includes("Manage Options")||t.includes("Optionen verwalten"))&&e.click()})),await l(".unic input[type=checkbox]",1e3)){await l(".unic button",1e3),document.querySelectorAll(".unic input[type=checkbox]").forEach((e=>{e.checked&&e.click()}));for(const e of document.querySelectorAll(".unic button")){const t=e.textContent;for(const n of["Confirm Choices","Save Choices","Auswahl speichern"])if(t.includes(n))return e.click(),await p(500),!0}}return!1}async optIn(){return d(".unic #unic-agree")}async test(){await p(1e3);return!c(".unic .unic-box,.unic .unic-bar")}},new class extends f{constructor(){super("Conversant"),this.prehideSelectors=[".cmp-root"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".cmp-root .cmp-receptacle")}async detectPopup(){return u(".cmp-root .cmp-receptacle","any")}async optOut(){if(!await d(".cmp-main-button:not(.cmp-main-button--primary)"))return!1;if(!await l(".cmp-view-tab-tabs"))return!1;await d(".cmp-view-tab-tabs > :first-child"),await d(".cmp-view-tab-tabs > .cmp-view-tab--active:first-child");for(const e of Array.from(document.querySelectorAll(".cmp-accordion-item"))){e.querySelector(".cmp-accordion-item-title").click(),await i((()=>!!e.querySelector(".cmp-accordion-item-content.cmp-active")),10,50);const t=e.querySelector(".cmp-accordion-item-content.cmp-active");t.querySelectorAll(".cmp-toggle-actions .cmp-toggle-deny:not(.cmp-toggle-deny--active)").forEach((e=>e.click())),t.querySelectorAll(".cmp-toggle-actions .cmp-toggle-checkbox:not(.cmp-toggle-checkbox--active)").forEach((e=>e.click()))}return await a(".cmp-main-button:not(.cmp-main-button--primary)"),!0}async optIn(){return d(".cmp-main-button.cmp-main-button--primary")}async test(){return document.cookie.includes("cmp-data=0")}},new class extends f{constructor(){super("tiktok.com"),this.runContext={urlPattern:"tiktok"}}get hasSelfTest(){return!0}get isIntermediate(){return!1}getShadowRoot(){const e=document.querySelector("tiktok-cookie-banner");return e?e.shadowRoot:null}async detectCmp(){return c("tiktok-cookie-banner")}async detectPopup(){return s(this.getShadowRoot().querySelector(".tiktok-cookie-banner"))}async optOut(){const e=this.getShadowRoot().querySelector(".button-wrapper button:first-child");return!!e&&(e.click(),!0)}async optIn(){const e=this.getShadowRoot().querySelector(".button-wrapper button:last-child");return!!e&&(e.click(),!0)}async test(){const e=document.cookie.match(/cookie-consent=([^;]+)/);if(!e)return!1;const t=JSON.parse(decodeURIComponent(e[1]));return Object.values(t).every((e=>"boolean"!=typeof e||!1===e))}},new class extends f{constructor(){super("airbnb"),this.runContext={urlPattern:"^https://(www\\.)?airbnb\\.[^/]+/"},this.prehideSelectors=["div[data-testid=main-cookies-banner-container]",'div:has(> div:first-child):has(> div:last-child):has(> section [data-testid="strictly-necessary-cookies"])']}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("div[data-testid=main-cookies-banner-container]")}async detectPopup(){return u("div[data-testid=main-cookies-banner-container","any")}async optOut(){let e;for(await d("div[data-testid=main-cookies-banner-container] button._snbhip0");e=document.querySelector("[data-testid=modal-container] button[aria-checked=true]:not([disabled])");)e.click();return d("button[data-testid=save-btn]")}async optIn(){return d("div[data-testid=main-cookies-banner-container] button._148dgdpk")}async test(){return await i((()=>!!document.cookie.match("OptanonAlertBoxClosed")),20,200)}}];class v{static setBase(e){v.base=e}static findElement(e,t=null,n=!1){let o=null;return o=null!=t?Array.from(t.querySelectorAll(e.selector)):null!=v.base?Array.from(v.base.querySelectorAll(e.selector)):Array.from(document.querySelectorAll(e.selector)),null!=e.textFilter&&(o=o.filter((t=>{let n=t.textContent.toLowerCase();if(Array.isArray(e.textFilter)){let t=!1;for(let o of e.textFilter)if(-1!==n.indexOf(o.toLowerCase())){t=!0;break}return t}if(null!=e.textFilter)return-1!==n.indexOf(e.textFilter.toLowerCase())}))),null!=e.styleFilters&&(o=o.filter((t=>{let n=window.getComputedStyle(t),o=!0;for(let t of e.styleFilters){let e=n[t.option];o=t.negated?o&&e!==t.value:o&&e===t.value}return o}))),null!=e.displayFilter&&(o=o.filter((t=>e.displayFilter?0!==t.offsetHeight:0===t.offsetHeight))),null!=e.iframeFilter&&(o=o.filter((t=>e.iframeFilter?window.location!==window.parent.location:window.location===window.parent.location))),null!=e.childFilter&&(o=o.filter((t=>{let n=v.base;v.setBase(t);let o=v.find(e.childFilter);return v.setBase(n),null!=o.target}))),n?o:(o.length>1&&console.warn("Multiple possible targets: ",o,e,t),o[0])}static find(e,t=!1){let n=[];if(null!=e.parent){let o=v.findElement(e.parent,null,t);if(null!=o){if(o instanceof Array)return o.forEach((o=>{let i=v.findElement(e.target,o,t);i instanceof Array?i.forEach((e=>{n.push({parent:o,target:e})})):n.push({parent:o,target:i})})),n;{let i=v.findElement(e.target,o,t);i instanceof Array?i.forEach((e=>{n.push({parent:o,target:e})})):n.push({parent:o,target:i})}}}else{let o=v.findElement(e.target,null,t);o instanceof Array?o.forEach((e=>{n.push({parent:null,target:e})})):n.push({parent:null,target:o})}return 0===n.length&&n.push({parent:null,target:null}),t?n:(1!==n.length&&console.warn("Multiple results found, even though multiple false",n),n[0])}}function _(e){const t=v.find(e);return"css"===e.type?!!t.target:"checkbox"===e.type?!!t.target&&t.target.checked:void 0}async function S(e,t){switch(e.type){case"click":return async function(e){const t=v.find(e);null!=t.target&&t.target.click();return x(0)}(e);case"list":return async function(e,t){for(let n of e.actions)await S(n,t)}(e,t);case"consent":return async function(e,t){for(const n of e.consents){const e=-1!==t.indexOf(n.type);if(n.matcher&&n.toggleAction){_(n.matcher)!==e&&await S(n.toggleAction)}else e?await S(n.trueAction):await S(n.falseAction)}}(e,t);case"ifcss":return async function(e,t){v.find(e).target?e.falseAction&&await S(e.falseAction,t):e.trueAction&&await S(e.trueAction,t)}(e,t);case"waitcss":return async function(e){await new Promise((t=>{let n=e.retries||10;const o=e.waitTime||250,i=()=>{const s=v.find(e);(e.negated&&s.target||!e.negated&&!s.target)&&n>0?(n-=1,setTimeout(i,o)):t()};i()}))}(e);case"foreach":return async function(e,t){const n=v.find(e,!0),o=v.base;for(const o of n)o.target&&(v.setBase(o.target),await S(e.action,t));v.setBase(o)}(e,t);case"hide":return async function(e){const t=v.find(e);t.target&&t.target.classList.add("Autoconsent-Hidden")}(e);case"slide":return async function(e){const t=v.find(e),n=v.find(e.dragTarget);if(t.target){let e=t.target.getBoundingClientRect(),o=n.target.getBoundingClientRect(),i=o.top-e.top,s=o.left-e.left;"y"===this.config.axis.toLowerCase()&&(s=0),"x"===this.config.axis.toLowerCase()&&(i=0);let r=window.screenX+e.left+e.width/2,a=window.screenY+e.top+e.height/2,c=e.left+e.width/2,u=e.top+e.height/2,l=document.createEvent("MouseEvents");l.initMouseEvent("mousedown",!0,!0,window,0,r,a,c,u,!1,!1,!1,!1,0,t.target);let d=document.createEvent("MouseEvents");d.initMouseEvent("mousemove",!0,!0,window,0,r+s,a+i,c+s,u+i,!1,!1,!1,!1,0,t.target);let p=document.createEvent("MouseEvents");p.initMouseEvent("mouseup",!0,!0,window,0,r+s,a+i,c+s,u+i,!1,!1,!1,!1,0,t.target),t.target.dispatchEvent(l),await this.waitTimeout(10),t.target.dispatchEvent(d),await this.waitTimeout(10),t.target.dispatchEvent(p)}}(e);case"close":return async function(e){window.close()}();case"wait":return async function(e){await x(e.waitTime)}(e);case"eval":return async function(e){return console.log("eval!",e.code),new Promise((t=>{try{e.async?(window.eval(e.code),setTimeout((()=>{t(window.eval("window.__consentCheckResult"))}),e.timeout||250)):t(window.eval(e.code))}catch(n){console.warn("eval error",n,e.code),t(!1)}}))}(e);default:throw"Unknown action type: "+e.type}}v.base=null;function x(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}class P{constructor(e,t){this.name=e,this.config=t,this.methods=new Map,this.runContext=m,t.methods.forEach((e=>{e.action&&this.methods.set(e.name,e.action)})),this.hasSelfTest=!1}get isIntermediate(){return!1}checkRunContext(){return!0}async detectCmp(){return this.config.detectors.map((e=>_(e.presentMatcher))).some((e=>!!e))}async detectPopup(){return this.config.detectors.map((e=>_(e.showingMatcher))).some((e=>!!e))}async executeAction(e,t){return!this.methods.has(e)||S(this.methods.get(e),t)}async optOut(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),await this.executeAction("HIDE_CMP"),await this.executeAction("DO_CONSENT",[]),await this.executeAction("SAVE_CONSENT"),!0}async optIn(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),await this.executeAction("HIDE_CMP"),await this.executeAction("DO_CONSENT",["D","A","B","E","F","X"]),await this.executeAction("SAVE_CONSENT"),!0}async openCmp(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),!0}async test(){return!0}}const A=new class{constructor(e,n=null,o=null){if(this.rules=[],this.foundCmp=null,t.sendContentMessage=e,this.sendContentMessage=e,this.rules=[...k],n)this.initialize(n,o);else{o&&this.parseRules(o);e({type:"init",url:window.location.href})}}initialize(e,t){if(this.config=e,e.enabled){if(t&&this.parseRules(t),e.disabledCmps?.length>0&&this.disableCMPs(e.disabledCmps),e.enablePrehide)if(document.documentElement)this.prehideElements();else{const e=()=>{window.removeEventListener("DOMContentLoaded",e),this.prehideElements()};window.addEventListener("DOMContentLoaded",e)}if("loading"===document.readyState){const e=()=>{window.removeEventListener("DOMContentLoaded",e),this.start()};window.addEventListener("DOMContentLoaded",e)}else this.start()}}parseRules(e){Object.keys(e.consentomatic).forEach((t=>{this.addConsentomaticCMP(t,e.consentomatic[t])})),e.autoconsent.forEach((e=>{this.addCMP(e)}))}addCMP(e){this.rules.push(function(e){return new g(e)}(e))}disableCMPs(e){this.rules=this.rules.filter((t=>!e.includes(t.name)))}addConsentomaticCMP(e,t){this.rules.push(new P(`com_${e}`,t))}start(){window.requestIdleCallback?window.requestIdleCallback((()=>this._start()),{timeout:500}):this._start()}async _start(){const e=await this.findCmp(this.config.detectRetries);if(e.length>0){const t=[];for(const n of e)this.sendContentMessage({type:"cmpDetected",url:location.href,cmp:n.name}),t.push(this.waitForPopup(n).then((e=>e?(this.foundCmp||(this.foundCmp=n),this.sendContentMessage({type:"popupFound",cmp:n.name,url:location.href}),!0):Promise.reject(`${n.name} popup not found`))));let n=!1;for(const e of t)try{await e,n=!0;break}catch(e){continue}return n?"optOut"===this.config.autoAction?await this.doOptOut():"optIn"!==this.config.autoAction||await this.doOptIn():(this.config.enablePrehide&&h(),!1)}return this.config.enablePrehide&&h(),!1}async findCmp(e){const t=[];for(const e of this.rules)try{if(!e.checkRunContext())continue;await e.detectCmp()&&t.push(e)}catch(e){}if(t.length>1){const e={msg:"Found multiple CMPs, check the detection rules.",cmps:t.map((e=>e.name))};this.sendContentMessage({type:"autoconsentError",details:e})}return 0===t.length&&e>0?new Promise((t=>{setTimeout((async()=>{const n=this.findCmp(e-1);t(n)}),500)})):t}async doOptOut(){let e;return e=!!this.foundCmp&&await this.foundCmp.optOut(),this.config.enablePrehide&&h(),this.sendContentMessage({type:"optOutResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,scheduleSelfTest:this.foundCmp&&this.foundCmp.hasSelfTest,url:location.href}),e&&!this.foundCmp.isIntermediate&&this.sendContentMessage({type:"autoconsentDone",cmp:this.foundCmp.name,url:location.href}),e}async doOptIn(){let e;return e=!!this.foundCmp&&await this.foundCmp.optIn(),this.config.enablePrehide&&h(),this.sendContentMessage({type:"optInResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,scheduleSelfTest:!1,url:location.href}),e&&!this.foundCmp.isIntermediate&&this.sendContentMessage({type:"autoconsentDone",cmp:this.foundCmp.name,url:location.href}),e}async doSelfTest(){let e;return e=!!this.foundCmp&&await this.foundCmp.test(),this.sendContentMessage({type:"selfTestResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,url:location.href}),e}async waitForPopup(e,t=5,n=500){const o=await e.detectPopup();return!o&&t>0?new Promise((o=>setTimeout((()=>o(this.waitForPopup(e,t-1,n))),n))):o}prehideElements(){return function(e){return o(n("autoconsent-prehide"),e,"opacity")}(this.rules.reduce(((e,t)=>t.prehideSelectors?[...e,...t.prehideSelectors]:e),["#didomi-popup,.didomi-popup-container,.didomi-popup-notice,.didomi-consent-popup-preferences,#didomi-notice,.didomi-popup-backdrop,.didomi-screen-medium"]))}async receiveMessageCallback(e){switch(e.type){case"initResp":this.initialize(e.config,e.rules);break;case"optIn":await this.doOptIn();break;case"optOut":await this.doOptOut();break;case"selfTest":await this.doSelfTest();break;case"evalResp":!function(e,n){const o=t.pending.get(e);o?(t.pending.delete(e),o.timer&&window.clearTimeout(o.timer),o.resolve(n)):console.warn("no eval #",e)}(e.id,e.result)}}}(chrome.runtime.sendMessage);chrome.runtime.onMessage.addListener((e=>Promise.resolve(A.receiveMessageCallback(e))))}();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 2,
3
3
  "name": "Autoconsent",
4
- "version": "2022.11.3",
4
+ "version": "2022.11.4",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"
@@ -342,9 +342,6 @@
342
342
  },
343
343
  {
344
344
  "name": "borlabs",
345
- "prehideSelectors": [
346
- "#BorlabsCookieBox"
347
- ],
348
345
  "detectCmp": [
349
346
  {
350
347
  "exists": "._brlbs-block-content"
@@ -362,7 +359,29 @@
362
359
  ],
363
360
  "optOut": [
364
361
  {
365
- "click": "a[data-cookie-refuse]"
362
+ "click": "a[data-cookie-individual]"
363
+ },
364
+ {
365
+ "waitForVisible": ".cookie-preference"
366
+ },
367
+ {
368
+ "click": "input[data-borlabs-cookie-checkbox]:checked",
369
+ "all": true,
370
+ "optional": true
371
+ },
372
+ {
373
+ "click": "#CookiePrefSave"
374
+ },
375
+ {
376
+ "wait": 500
377
+ }
378
+ ],
379
+ "prehideSelectors": [
380
+ "#BorlabsCookieBox"
381
+ ],
382
+ "test": [
383
+ {
384
+ "eval": "!JSON.parse(decodeURIComponent(document.cookie.split(';').find(c => c.indexOf('borlabs-cookie') !== -1).split('=', 2)[1])).consents.statistics"
366
385
  }
367
386
  ]
368
387
  },
@@ -2240,26 +2259,26 @@
2240
2259
  "urlPattern": "^https://www\\.reddit\\.com/"
2241
2260
  },
2242
2261
  "prehideSelectors": [
2243
- "section:has(section > span > a[href^=\"https://www.reddit.com/policies/cookies\"])"
2262
+ "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"])"
2244
2263
  ],
2245
2264
  "detectCmp": [
2246
2265
  {
2247
- "exists": "section:has(> span > a[href^=\"https://www.reddit.com/policies/cookies\"])"
2266
+ "exists": "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"])"
2248
2267
  }
2249
2268
  ],
2250
2269
  "detectPopup": [
2251
2270
  {
2252
- "visible": "section:has(> span > a[href^=\"https://www.reddit.com/policies/cookies\"])"
2271
+ "visible": "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"])"
2253
2272
  }
2254
2273
  ],
2255
2274
  "optIn": [
2256
2275
  {
2257
- "waitForThenClick": "section:has(> span > a[href^=\"https://www.reddit.com/policies/cookies\"]) section form:last-child button"
2276
+ "waitForThenClick": "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"]) section[class^='_'] > section:first-child form button"
2258
2277
  }
2259
2278
  ],
2260
2279
  "optOut": [
2261
2280
  {
2262
- "waitForThenClick": "section:has(> span > a[href^=\"https://www.reddit.com/policies/cookies\"]) section form:first-child button"
2281
+ "waitForThenClick": "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"]) section[class^='_'] > section:last-child form button"
2263
2282
  }
2264
2283
  ],
2265
2284
  "test": [
@@ -1 +1 @@
1
- !function(){"use strict";class e{constructor(e,t=1e3){this.id=e,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t})),this.timer=window.setTimeout((()=>{this.reject(new Error("timeout"))}),t)}}const t={pending:new Map,sendContentMessage:null};function n(e="autoconsent-css-rules"){const t=`style#${e}`,n=document.querySelector(t);if(n&&n instanceof HTMLStyleElement)return n;{const t=document.head||document.getElementsByTagName("head")[0]||document.documentElement,n=document.createElement("style");return n.id=e,t.appendChild(n),n}}function o(e,t,n="display"){const o="opacity"===n?"opacity: 0":"display: none",i=`${t.join(",")} { ${o} !important; z-index: -1 !important; pointer-events: none !important; } `;return e instanceof HTMLStyleElement&&(e.innerText+=i,t.length>0)}async function i(e,t,n){const o=await e();return!o&&t>0?new Promise((o=>{setTimeout((async()=>{o(i(e,t-1,n))}),n)})):Promise.resolve(o)}function s(e){if(!e)return!1;if(null!==e.offsetParent)return!0;{const t=window.getComputedStyle(e);if("fixed"===t.position&&"none"!==t.display)return!0}return!1}function r(n){return function(n){let o;o=crypto&&void 0!==crypto.randomUUID?crypto.randomUUID():Math.random().toString(),t.sendContentMessage({type:"eval",id:o,code:n});const i=new e(o);return t.pending.set(i.id,i),i.promise}(n).catch((e=>!1))}function a(e,t=!1){const n=document.querySelectorAll(e);return n.length>0&&(t?n.forEach((e=>e.click())):n[0].click()),n.length>0}function c(e){return null!==document.querySelector(e)}function u(e,t){const n=document.querySelectorAll(e),o=new Array(n.length);return n.forEach(((e,t)=>{o[t]=s(e)})),"none"===t?o.every((e=>!e)):0!==o.length&&("any"===t?o.some((e=>e)):o.every((e=>e)))}function l(e,t=1e4){return i((()=>null!==document.querySelector(e)),Math.ceil(t/200),200)}async function d(e,t=1e4,n=!1){return await l(e,t),a(e,n)}function p(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}function h(){const e=n("autoconsent-prehide");return e&&e.remove(),!!e}const m={main:!0,frame:!1,urlPattern:""};class f{constructor(e){this.runContext=m,this.name=e}get hasSelfTest(){throw new Error("Not Implemented")}get isIntermediate(){throw new Error("Not Implemented")}checkRunContext(){const e={...m,...this.runContext},t=window.top===window;return!(t&&!e.main)&&(!(!t&&!e.frame)&&!(e.urlPattern&&!window.location.href.match(e.urlPattern)))}detectCmp(){throw new Error("Not Implemented")}async detectPopup(){return!1}optOut(){throw new Error("Not Implemented")}optIn(){throw new Error("Not Implemented")}openCmp(){throw new Error("Not Implemented")}async test(){return Promise.resolve(!0)}}async function y(e){const t=[];if(e.exists&&t.push(c(e.exists)),e.visible&&t.push(u(e.visible,e.check)),e.eval){const n=r(e.eval);t.push(n)}var s,h;if(e.waitFor&&t.push(l(e.waitFor,e.timeout)),e.waitForVisible&&t.push(function(e,t=1e4,n="any"){return i((()=>u(e,n)),Math.ceil(t/200),200)}(e.waitForVisible,e.timeout,e.check)),e.click&&t.push(a(e.click,e.all)),e.waitForThenClick&&t.push(d(e.waitForThenClick,e.timeout,e.all)),e.wait&&t.push(p(e.wait)),e.hide&&t.push((s=e.hide,h=e.method,o(n(),s,h))),e.if){if(!e.if.exists&&!e.if.visible)return console.error("invalid conditional rule",e.if),!1;await y(e.if)?t.push(w(e.then)):e.else&&t.push(w(e.else))}if(0===t.length)return!1;return(await Promise.all(t)).reduce(((e,t)=>e&&t),!0)}async function w(e){for(const t of e){if(!await y(t)&&!t.optional)return!1}return!0}class g extends f{constructor(e){super(e.name),this.config=e,this.runContext=e.runContext||m}get hasSelfTest(){return!!this.config.test}get isIntermediate(){return!!this.config.intermediate}get prehideSelectors(){return this.config.prehideSelectors}async detectCmp(){return!!this.config.detectCmp&&async function(e){const t=e.map((e=>y(e)));return(await Promise.all(t)).every((e=>!!e))}(this.config.detectCmp)}async detectPopup(){return!!this.config.detectPopup&&w(this.config.detectPopup)}async optOut(){return!!this.config.optOut&&w(this.config.optOut)}async optIn(){return!!this.config.optIn&&w(this.config.optIn)}async openCmp(){return!!this.config.openCmp&&w(this.config.openCmp)}async test(){return this.hasSelfTest?w(this.config.test):super.test()}}const b="#truste-show-consent",C="#truste-consent-track";const k=[new class extends f{constructor(){super("TrustArc-top"),this.prehideSelectors=[".trustarc-banner-container",`.truste_popframe,.truste_overlay,.truste_box_overlay,${C}`],this.runContext={main:!0,frame:!1},this._shortcutButton=null,this._optInDone=!1}get hasSelfTest(){return!1}get isIntermediate(){return!this._optInDone&&!this._shortcutButton}async detectCmp(){const e=c(`#truste-show-consent,${C}`);return e&&(this._shortcutButton=document.querySelector("#truste-consent-required")),e}async detectPopup(){return u(`#truste-consent-content,#trustarc-banner-overlay,${C}`,"all")}openFrame(){a(b)}async optOut(){return this._shortcutButton?(this._shortcutButton.click(),!0):(o(n(),[".truste_popframe",".truste_overlay",".truste_box_overlay",C]),a(b),setTimeout((()=>{n().remove()}),1e4),!0)}async optIn(){return this._optInDone=!0,a("#truste-consent-button")}async openCmp(){return!0}async test(){return!0}},new class extends f{constructor(){super("TrustArc-frame"),this.runContext={main:!1,frame:!0,urlPattern:"^https://consent-pref\\.trustarc\\.com/\\?"}}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){return!0}async detectPopup(){return u("#defaultpreferencemanager","any")&&u(".mainContent","any")}async navigateToSettings(){return await i((async()=>c(".shp")||u(".advance","any")||c(".switch span:first-child")),10,500),c(".shp")&&a(".shp"),await l(".prefPanel",5e3),u(".advance","any")&&a(".advance"),await i((()=>u(".switch span:first-child","any")),5,1e3)}async optOut(){return await i((()=>"complete"===document.readyState),20,100),await l(".mainContent[aria-hidden=false]",5e3),!!a(".rejectAll")||(c(".prefPanel")&&await l('.prefPanel[style="visibility: visible;"]',3e3),a("#catDetails0")?(a(".submit"),!0):(a(".required")||(await this.navigateToSettings(),a(".switch span:nth-child(1):not(.active)",!0),a(".submit"),l("#gwt-debug-close_id",3e5).then((()=>{a("#gwt-debug-close_id")}))),!0))}async optIn(){return a(".call")||(await this.navigateToSettings(),a(".switch span:nth-child(2)",!0),a(".submit"),l("#gwt-debug-close_id",3e5).then((()=>{a("#gwt-debug-close_id")}))),!0}},new class extends f{constructor(){super("Cybotcookiebot"),this.prehideSelectors=["#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookieoverlay"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("#CybotCookiebotDialogBodyLevelButtonPreferences")}async detectPopup(){return c("#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookiebanner")}async optOut(){return a(".cookie-alert-extended-detail-link")?(await l(".cookie-alert-configuration",2e3),a(".cookie-alert-configuration-input:checked",!0),a(".cookie-alert-extended-button-secondary"),!0):c("#dtcookie-container")?a(".h-dtcookie-decline"):(a(".cookiebot__button--settings")||a("#CybotCookiebotDialogBodyButtonDecline")||(a(".cookiebanner__link--details"),a('.CybotCookiebotDialogBodyLevelButton:checked:enabled,input[id*="CybotCookiebotDialogBodyLevelButton"]:checked:enabled',!0),a("#CybotCookiebotDialogBodyButtonDecline"),a("input[id^=CybotCookiebotDialogBodyLevelButton]:checked",!0),c("#CybotCookiebotDialogBodyButtonAcceptSelected")?a("#CybotCookiebotDialogBodyButtonAcceptSelected"):a("#CybotCookiebotDialogBodyLevelButtonAccept,#CybotCookiebotDialogBodyButtonAccept,#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection",!0),await r("window.CookieConsent.hasResponse !== true")&&(await r("window.Cookiebot.dialog.submitConsent()"),await p(500)),c("#cb-confirmedSettings")&&await r("endCookieProcess()")),!0)}async optIn(){return c("#dtcookie-container")?a(".h-dtcookie-accept"):(a(".CybotCookiebotDialogBodyLevelButton:not(:checked):enabled",!0),a("#CybotCookiebotDialogBodyLevelButtonAccept"),a("#CybotCookiebotDialogBodyButtonAccept"),!0)}async test(){return r("window.CookieConsent.declined === true")}},new class extends f{constructor(){super("Sourcepoint-top"),this.prehideSelectors=["div[id^='sp_message_container_'],.message-overlay"],this.runContext={main:!0,frame:!1}}get hasSelfTest(){return!0}get isIntermediate(){return!0}async detectCmp(){return c("div[id^='sp_message_container_']")}async detectPopup(){return u("div[id^='sp_message_container_']","all")}async optIn(){return!0}async optOut(){const e=document.querySelector(".sp-message-open");return e&&e.classList.remove("sp-message-open"),!0}async test(){return await r("__tcfapi('getTCData', 2, r => window.__rcsResult = r)"),await r("Object.values(window.__rcsResult.purpose.consents).every(c => !c)")}},new class extends f{constructor(){super("Sourcepoint-frame"),this.ccpaMode=!1,this.runContext={main:!1,frame:!0}}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){const e=new URL(location.href);return e.searchParams.has("message_id")&&"ccpa-notice.sp-prod.net"===e.hostname?(this.ccpaMode=!0,!0):("/index.html"===e.pathname||"/privacy-manager/index.html"===e.pathname)&&(e.searchParams.has("message_id")||e.searchParams.has("requestUUID")||e.searchParams.has("consentUUID"))}async detectPopup(){return await l(".sp_choice_type_11,.sp_choice_type_12,.sp_choice_type_13,.sp_choice_type_ACCEPT_ALL",2e3),!c(".sp_choice_type_9")}async optIn(){return await l(".sp_choice_type_11,.sp_choice_type_ACCEPT_ALL",2e3),!!a(".sp_choice_type_11")||!!a(".sp_choice_type_ACCEPT_ALL")}isManagerOpen(){return"/privacy-manager/index.html"===new URL(location.href).pathname}async optOut(){if(!this.isManagerOpen()){if(!await l(".sp_choice_type_12,.sp_choice_type_13"))return!1;if(!c(".sp_choice_type_12"))return a(".sp_choice_type_13");a(".sp_choice_type_12"),await i((()=>"/privacy-manager/index.html"===location.pathname),200,100)}await l(".type-modal",2e4);try{const e=".sp_choice_type_REJECT_ALL",t=".reject-toggle",n=await Promise.race([l(e,2e3).then((e=>e?0:-1)),l(t,2e3).then((e=>e?1:-1)),l(".pm-features",2e3).then((e=>e?2:-1))]);if(0===n)return await p(1e3),a(e);1===n?a(t):2===n&&(await l(".pm-features",1e4),a(".checked > span",!0),a(".chevron"))}catch(e){}return a(".sp_choice_type_SAVE_AND_EXIT"),!0}},new class extends f{constructor(){super("consentmanager.net"),this.prehideSelectors=["#cmpbox,#cmpbox2"],this.apiAvailable=!1}get hasSelfTest(){return this.apiAvailable}get isIntermediate(){return!1}async detectCmp(){return this.apiAvailable=await r('window.__cmp && typeof __cmp("getCMPData") === "object"'),!!this.apiAvailable||c("#cmpbox")}async detectPopup(){return this.apiAvailable?(await p(500),await r("!__cmp('consentStatus').userChoiceExists")):u("#cmpbox .cmpmore","any")}async optOut(){return await p(500),this.apiAvailable?await r("__cmp('setConsent', 0)"):!!a(".cmpboxbtnno")||(c(".cmpwelcomeprpsbtn")?(a(".cmpwelcomeprpsbtn > a[aria-checked=true]",!0),a(".cmpboxbtnsave"),!0):(a(".cmpboxbtncustom"),await l(".cmptblbox",2e3),a(".cmptdchoice > a[aria-checked=true]",!0),a(".cmpboxbtnyescustomchoices"),!0))}async optIn(){return this.apiAvailable?await r("__cmp('setConsent', 1)"):a(".cmpboxbtnyes")}async test(){if(this.apiAvailable)return await r("__cmp('consentStatus').userChoiceExists")}},new class extends f{constructor(){super("Evidon")}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){return c("#_evidon_banner")}async detectPopup(){return u("#_evidon_banner","any")}async optOut(){return a("#_evidon-decline-button")||(o(n(),["#evidon-prefdiag-overlay","#evidon-prefdiag-background"]),a("#_evidon-option-button"),await l("#evidon-prefdiag-overlay",5e3),a("#evidon-prefdiag-decline")),!0}async optIn(){return a("#_evidon-accept-button")}},new class extends f{constructor(){super("Onetrust"),this.prehideSelectors=["#onetrust-banner-sdk,#onetrust-consent-sdk,.onetrust-pc-dark-filter,.js-consent-banner"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("#onetrust-banner-sdk")}async detectPopup(){return u("#onetrust-banner-sdk","all")}async optOut(){return c("#onetrust-pc-btn-handler")?a("#onetrust-pc-btn-handler"):a(".ot-sdk-show-settings,button.js-cookie-settings"),await l("#onetrust-consent-sdk",2e3),await p(1e3),a("#onetrust-consent-sdk input.category-switch-handler:checked,.js-editor-toggle-state:checked",!0),await l(".save-preference-btn-handler,.js-consent-save",2e3),a(".save-preference-btn-handler,.js-consent-save"),await i((()=>u("#onetrust-banner-sdk","none")),10,500),!0}async optIn(){return a("#onetrust-accept-btn-handler,.js-accept-cookies")}async test(){return await r("window.OnetrustActiveGroups.split(',').filter(s => s.length > 0).length <= 1")}},new class extends f{constructor(){super("Klaro"),this.prehideSelectors=[".klaro"],this.settingsOpen=!1}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".klaro > .cookie-modal")?(this.settingsOpen=!0,!0):c(".klaro > .cookie-notice")}async detectPopup(){return u(".klaro > .cookie-notice,.klaro > .cookie-modal","any")}async optOut(){return!!a(".klaro .cn-decline")||(this.settingsOpen||(a(".klaro .cn-learn-more"),await l(".klaro > .cookie-modal",2e3),this.settingsOpen=!0),!!a(".klaro .cn-decline")||(a(".cm-purpose:not(.cm-toggle-all) > input:not(.half-checked)",!0),a(".cm-btn-accept")))}async optIn(){return!!a(".klaro .cm-btn-accept-all")||(this.settingsOpen?(a(".cm-purpose:not(.cm-toggle-all) > input.half-checked",!0),a(".cm-btn-accept")):a(".klaro .cookie-notice .cm-btn-success"))}async test(){return await r("klaro.getManager().config.services.every(c => c.required || !klaro.getManager().consents[c.name])")}},new class extends f{constructor(){super("Uniconsent")}get prehideSelectors(){return[".unic",".modal:has(.unic)"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".unic .unic-box,.unic .unic-bar")}async detectPopup(){return u(".unic .unic-box,.unic .unic-bar","any")}async optOut(){if(await l(".unic button",1e3),document.querySelectorAll(".unic button").forEach((e=>{const t=e.textContent;(t.includes("Manage Options")||t.includes("Optionen verwalten"))&&e.click()})),await l(".unic input[type=checkbox]",1e3)){await l(".unic button",1e3),document.querySelectorAll(".unic input[type=checkbox]").forEach((e=>{e.checked&&e.click()}));for(const e of document.querySelectorAll(".unic button")){const t=e.textContent;for(const n of["Confirm Choices","Save Choices","Auswahl speichern"])if(t.includes(n))return e.click(),await p(500),!0}}return!1}async optIn(){return d(".unic #unic-agree")}async test(){await p(1e3);return!c(".unic .unic-box,.unic .unic-bar")}},new class extends f{constructor(){super("Conversant"),this.prehideSelectors=[".cmp-root"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".cmp-root .cmp-receptacle")}async detectPopup(){return u(".cmp-root .cmp-receptacle","any")}async optOut(){if(!await d(".cmp-main-button:not(.cmp-main-button--primary)"))return!1;if(!await l(".cmp-view-tab-tabs"))return!1;await d(".cmp-view-tab-tabs > :first-child"),await d(".cmp-view-tab-tabs > .cmp-view-tab--active:first-child");for(const e of Array.from(document.querySelectorAll(".cmp-accordion-item"))){e.querySelector(".cmp-accordion-item-title").click(),await i((()=>!!e.querySelector(".cmp-accordion-item-content.cmp-active")),10,50);const t=e.querySelector(".cmp-accordion-item-content.cmp-active");t.querySelectorAll(".cmp-toggle-actions .cmp-toggle-deny:not(.cmp-toggle-deny--active)").forEach((e=>e.click())),t.querySelectorAll(".cmp-toggle-actions .cmp-toggle-checkbox:not(.cmp-toggle-checkbox--active)").forEach((e=>e.click()))}return await a(".cmp-main-button:not(.cmp-main-button--primary)"),!0}async optIn(){return d(".cmp-main-button.cmp-main-button--primary")}async test(){return document.cookie.includes("cmp-data=0")}},new class extends f{constructor(){super("tiktok.com"),this.runContext={urlPattern:"tiktok"}}get hasSelfTest(){return!0}get isIntermediate(){return!1}getShadowRoot(){const e=document.querySelector("tiktok-cookie-banner");return e?e.shadowRoot:null}async detectCmp(){return c("tiktok-cookie-banner")}async detectPopup(){return s(this.getShadowRoot().querySelector(".tiktok-cookie-banner"))}async optOut(){const e=this.getShadowRoot().querySelector(".button-wrapper button:first-child");return!!e&&(e.click(),!0)}async optIn(){const e=this.getShadowRoot().querySelector(".button-wrapper button:last-child");return!!e&&(e.click(),!0)}async test(){const e=document.cookie.match(/cookie-consent=([^;]+)/);if(!e)return!1;const t=JSON.parse(decodeURIComponent(e[1]));return Object.values(t).every((e=>"boolean"!=typeof e||!1===e))}},new class extends f{constructor(){super("airbnb"),this.runContext={urlPattern:"^https://(www\\.)?airbnb\\.[^/]+/"},this.prehideSelectors=["div[data-testid=main-cookies-banner-container]",'div:has(> div:first-child):has(> div:last-child):has(> section [data-testid="strictly-necessary-cookies"])']}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("div[data-testid=main-cookies-banner-container]")}async detectPopup(){return u("div[data-testid=main-cookies-banner-container","any")}async optOut(){let e;for(await d("div[data-testid=main-cookies-banner-container] button._snbhip0");e=document.querySelector("[data-testid=modal-container] button[aria-checked=true]:not([disabled])");)e.click();return d("button[data-testid=save-btn]")}async optIn(){return d("div[data-testid=main-cookies-banner-container] button._148dgdpk")}async test(){return await i((()=>!!document.cookie.match("OptanonAlertBoxClosed")),20,200)}}];class v{static setBase(e){v.base=e}static findElement(e,t=null,n=!1){let o=null;return o=null!=t?Array.from(t.querySelectorAll(e.selector)):null!=v.base?Array.from(v.base.querySelectorAll(e.selector)):Array.from(document.querySelectorAll(e.selector)),null!=e.textFilter&&(o=o.filter((t=>{let n=t.textContent.toLowerCase();if(Array.isArray(e.textFilter)){let t=!1;for(let o of e.textFilter)if(-1!==n.indexOf(o.toLowerCase())){t=!0;break}return t}if(null!=e.textFilter)return-1!==n.indexOf(e.textFilter.toLowerCase())}))),null!=e.styleFilters&&(o=o.filter((t=>{let n=window.getComputedStyle(t),o=!0;for(let t of e.styleFilters){let e=n[t.option];o=t.negated?o&&e!==t.value:o&&e===t.value}return o}))),null!=e.displayFilter&&(o=o.filter((t=>e.displayFilter?0!==t.offsetHeight:0===t.offsetHeight))),null!=e.iframeFilter&&(o=o.filter((t=>e.iframeFilter?window.location!==window.parent.location:window.location===window.parent.location))),null!=e.childFilter&&(o=o.filter((t=>{let n=v.base;v.setBase(t);let o=v.find(e.childFilter);return v.setBase(n),null!=o.target}))),n?o:(o.length>1&&console.warn("Multiple possible targets: ",o,e,t),o[0])}static find(e,t=!1){let n=[];if(null!=e.parent){let o=v.findElement(e.parent,null,t);if(null!=o){if(o instanceof Array)return o.forEach((o=>{let i=v.findElement(e.target,o,t);i instanceof Array?i.forEach((e=>{n.push({parent:o,target:e})})):n.push({parent:o,target:i})})),n;{let i=v.findElement(e.target,o,t);i instanceof Array?i.forEach((e=>{n.push({parent:o,target:e})})):n.push({parent:o,target:i})}}}else{let o=v.findElement(e.target,null,t);o instanceof Array?o.forEach((e=>{n.push({parent:null,target:e})})):n.push({parent:null,target:o})}return 0===n.length&&n.push({parent:null,target:null}),t?n:(1!==n.length&&console.warn("Multiple results found, even though multiple false",n),n[0])}}function _(e){const t=v.find(e);return"css"===e.type?!!t.target:"checkbox"===e.type?!!t.target&&t.target.checked:void 0}async function S(e,t){switch(e.type){case"click":return async function(e){const t=v.find(e);null!=t.target&&t.target.click();return x(0)}(e);case"list":return async function(e,t){for(let n of e.actions)await S(n,t)}(e,t);case"consent":return async function(e,t){for(const n of e.consents){const e=-1!==t.indexOf(n.type);if(n.matcher&&n.toggleAction){_(n.matcher)!==e&&await S(n.toggleAction)}else e?await S(n.trueAction):await S(n.falseAction)}}(e,t);case"ifcss":return async function(e,t){v.find(e).target?e.falseAction&&await S(e.falseAction,t):e.trueAction&&await S(e.trueAction,t)}(e,t);case"waitcss":return async function(e){await new Promise((t=>{let n=e.retries||10;const o=e.waitTime||250,i=()=>{const s=v.find(e);(e.negated&&s.target||!e.negated&&!s.target)&&n>0?(n-=1,setTimeout(i,o)):t()};i()}))}(e);case"foreach":return async function(e,t){const n=v.find(e,!0),o=v.base;for(const o of n)o.target&&(v.setBase(o.target),await S(e.action,t));v.setBase(o)}(e,t);case"hide":return async function(e){const t=v.find(e);t.target&&t.target.classList.add("Autoconsent-Hidden")}(e);case"slide":return async function(e){const t=v.find(e),n=v.find(e.dragTarget);if(t.target){let e=t.target.getBoundingClientRect(),o=n.target.getBoundingClientRect(),i=o.top-e.top,s=o.left-e.left;"y"===this.config.axis.toLowerCase()&&(s=0),"x"===this.config.axis.toLowerCase()&&(i=0);let r=window.screenX+e.left+e.width/2,a=window.screenY+e.top+e.height/2,c=e.left+e.width/2,u=e.top+e.height/2,l=document.createEvent("MouseEvents");l.initMouseEvent("mousedown",!0,!0,window,0,r,a,c,u,!1,!1,!1,!1,0,t.target);let d=document.createEvent("MouseEvents");d.initMouseEvent("mousemove",!0,!0,window,0,r+s,a+i,c+s,u+i,!1,!1,!1,!1,0,t.target);let p=document.createEvent("MouseEvents");p.initMouseEvent("mouseup",!0,!0,window,0,r+s,a+i,c+s,u+i,!1,!1,!1,!1,0,t.target),t.target.dispatchEvent(l),await this.waitTimeout(10),t.target.dispatchEvent(d),await this.waitTimeout(10),t.target.dispatchEvent(p)}}(e);case"close":return async function(e){window.close()}();case"wait":return async function(e){await x(e.waitTime)}(e);case"eval":return async function(e){return console.log("eval!",e.code),new Promise((t=>{try{e.async?(window.eval(e.code),setTimeout((()=>{t(window.eval("window.__consentCheckResult"))}),e.timeout||250)):t(window.eval(e.code))}catch(n){console.warn("eval error",n,e.code),t(!1)}}))}(e);default:throw"Unknown action type: "+e.type}}v.base=null;function x(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}class P{constructor(e,t){this.name=e,this.config=t,this.methods=new Map,this.runContext=m,t.methods.forEach((e=>{e.action&&this.methods.set(e.name,e.action)})),this.hasSelfTest=!1}get isIntermediate(){return!1}checkRunContext(){return!0}async detectCmp(){return this.config.detectors.map((e=>_(e.presentMatcher))).some((e=>!!e))}async detectPopup(){return this.config.detectors.map((e=>_(e.showingMatcher))).some((e=>!!e))}async executeAction(e,t){return!this.methods.has(e)||S(this.methods.get(e),t)}async optOut(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),await this.executeAction("HIDE_CMP"),await this.executeAction("DO_CONSENT",[]),await this.executeAction("SAVE_CONSENT"),!0}async optIn(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),await this.executeAction("HIDE_CMP"),await this.executeAction("DO_CONSENT",["D","A","B","E","F","X"]),await this.executeAction("SAVE_CONSENT"),!0}async openCmp(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),!0}async test(){return!0}}const A=new class{constructor(e,n=null,o=null){if(this.rules=[],this.foundCmp=null,t.sendContentMessage=e,this.sendContentMessage=e,this.rules=[...k],n)this.initialize(n,o);else{o&&this.parseRules(o);e({type:"init",url:window.location.href})}}initialize(e,t){if(this.config=e,e.enabled){if(t&&this.parseRules(t),e.disabledCmps?.length>0&&this.disableCMPs(e.disabledCmps),e.enablePrehide)if(document.documentElement)this.prehideElements();else{const e=()=>{window.removeEventListener("DOMContentLoaded",e),this.prehideElements()};window.addEventListener("DOMContentLoaded",e)}if("loading"===document.readyState){const e=()=>{window.removeEventListener("DOMContentLoaded",e),this.start()};window.addEventListener("DOMContentLoaded",e)}else this.start()}}parseRules(e){Object.keys(e.consentomatic).forEach((t=>{this.addConsentomaticCMP(t,e.consentomatic[t])})),e.autoconsent.forEach((e=>{this.addCMP(e)}))}addCMP(e){this.rules.push(function(e){return new g(e)}(e))}disableCMPs(e){this.rules=this.rules.filter((t=>!e.includes(t.name)))}addConsentomaticCMP(e,t){this.rules.push(new P(`com_${e}`,t))}start(){window.requestIdleCallback?window.requestIdleCallback((()=>this._start()),{timeout:500}):this._start()}async _start(){const e=await this.findCmp(this.config.detectRetries);if(e.length>0){const t=[];for(const n of e)this.sendContentMessage({type:"cmpDetected",url:location.href,cmp:n.name}),t.push(this.waitForPopup(n).then((e=>e?(this.foundCmp||(this.foundCmp=n),this.sendContentMessage({type:"popupFound",cmp:n.name,url:location.href}),!0):Promise.reject(`${n.name} popup not found`))));let n=!1;for(const e of t)try{await e,n=!0;break}catch(e){continue}return n?"optOut"===this.config.autoAction?await this.doOptOut():"optIn"!==this.config.autoAction||await this.doOptIn():(this.config.enablePrehide&&h(),!1)}return this.config.enablePrehide&&h(),!1}async findCmp(e){const t=[];for(const e of this.rules)try{if(!e.checkRunContext())continue;await e.detectCmp()&&t.push(e)}catch(e){}if(t.length>1){const e={msg:"Found multiple CMPs, check the detection rules.",cmps:t.map((e=>e.name))};this.sendContentMessage({type:"autoconsentError",details:e})}return 0===t.length&&e>0?new Promise((t=>{setTimeout((async()=>{const n=this.findCmp(e-1);t(n)}),500)})):t}async doOptOut(){let e;return e=!!this.foundCmp&&await this.foundCmp.optOut(),this.config.enablePrehide&&h(),this.sendContentMessage({type:"optOutResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,scheduleSelfTest:this.foundCmp&&this.foundCmp.hasSelfTest,url:location.href}),e&&!this.foundCmp.isIntermediate&&this.sendContentMessage({type:"autoconsentDone",cmp:this.foundCmp.name,url:location.href}),e}async doOptIn(){let e;return e=!!this.foundCmp&&await this.foundCmp.optIn(),this.config.enablePrehide&&h(),this.sendContentMessage({type:"optInResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,scheduleSelfTest:!1,url:location.href}),e&&!this.foundCmp.isIntermediate&&this.sendContentMessage({type:"autoconsentDone",cmp:this.foundCmp.name,url:location.href}),e}async doSelfTest(){let e;return e=!!this.foundCmp&&await this.foundCmp.test(),this.sendContentMessage({type:"selfTestResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,url:location.href}),e}async waitForPopup(e,t=5,n=500){const o=await e.detectPopup();return!o&&t>0?new Promise((o=>setTimeout((()=>o(this.waitForPopup(e,t-1,n))),n))):o}prehideElements(){return function(e){return o(n("autoconsent-prehide"),e,"opacity")}(this.rules.reduce(((e,t)=>t.prehideSelectors?[...e,...t.prehideSelectors]:e),["#didomi-popup,.didomi-popup-container,.didomi-popup-notice,.didomi-consent-popup-preferences,#didomi-notice,.didomi-popup-backdrop,.didomi-screen-medium"]))}async receiveMessageCallback(e){switch(e.type){case"initResp":this.initialize(e.config,e.rules);break;case"optIn":await this.doOptIn();break;case"optOut":await this.doOptOut();break;case"selfTest":await this.doSelfTest();break;case"evalResp":!function(e,n){const o=t.pending.get(e);o?(t.pending.delete(e),o.timer&&window.clearTimeout(o.timer),o.resolve(n)):console.warn("no eval #",e)}(e.id,e.result)}}}(chrome.runtime.sendMessage);chrome.runtime.onMessage.addListener((e=>Promise.resolve(A.receiveMessageCallback(e))))}();
1
+ !function(){"use strict";class e{constructor(e,t=1e3){this.id=e,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t})),this.timer=window.setTimeout((()=>{this.reject(new Error("timeout"))}),t)}}const t={pending:new Map,sendContentMessage:null};function n(e="autoconsent-css-rules"){const t=`style#${e}`,n=document.querySelector(t);if(n&&n instanceof HTMLStyleElement)return n;{const t=document.head||document.getElementsByTagName("head")[0]||document.documentElement,n=document.createElement("style");return n.id=e,t.appendChild(n),n}}function o(e,t,n="display"){const o="opacity"===n?"opacity: 0":"display: none",i=`${t.join(",")} { ${o} !important; z-index: -1 !important; pointer-events: none !important; } `;return e instanceof HTMLStyleElement&&(e.innerText+=i,t.length>0)}async function i(e,t,n){const o=await e();return!o&&t>0?new Promise((o=>{setTimeout((async()=>{o(i(e,t-1,n))}),n)})):Promise.resolve(o)}function s(e){if(!e)return!1;if(null!==e.offsetParent)return!0;{const t=window.getComputedStyle(e);if("fixed"===t.position&&"none"!==t.display)return!0}return!1}function r(n){return function(n){let o;o=crypto&&void 0!==crypto.randomUUID?crypto.randomUUID():Math.random().toString(),t.sendContentMessage({type:"eval",id:o,code:n});const i=new e(o);return t.pending.set(i.id,i),i.promise}(n).catch((e=>!1))}function a(e,t=!1){const n=document.querySelectorAll(e);return n.length>0&&(t?n.forEach((e=>e.click())):n[0].click()),n.length>0}function c(e){return null!==document.querySelector(e)}function u(e,t){const n=document.querySelectorAll(e),o=new Array(n.length);return n.forEach(((e,t)=>{o[t]=s(e)})),"none"===t?o.every((e=>!e)):0!==o.length&&("any"===t?o.some((e=>e)):o.every((e=>e)))}function l(e,t=1e4){return i((()=>null!==document.querySelector(e)),Math.ceil(t/200),200)}async function d(e,t=1e4,n=!1){return await l(e,t),a(e,n)}function p(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}function h(){const e=n("autoconsent-prehide");return e&&e.remove(),!!e}const m={main:!0,frame:!1,urlPattern:""};class f{constructor(e){this.runContext=m,this.name=e}get hasSelfTest(){throw new Error("Not Implemented")}get isIntermediate(){throw new Error("Not Implemented")}checkRunContext(){const e={...m,...this.runContext},t=window.top===window;return!(t&&!e.main)&&(!(!t&&!e.frame)&&!(e.urlPattern&&!window.location.href.match(e.urlPattern)))}detectCmp(){throw new Error("Not Implemented")}async detectPopup(){return!1}optOut(){throw new Error("Not Implemented")}optIn(){throw new Error("Not Implemented")}openCmp(){throw new Error("Not Implemented")}async test(){return Promise.resolve(!0)}}async function y(e){const t=[];if(e.exists&&t.push(c(e.exists)),e.visible&&t.push(u(e.visible,e.check)),e.eval){const n=r(e.eval);t.push(n)}var s,h;if(e.waitFor&&t.push(l(e.waitFor,e.timeout)),e.waitForVisible&&t.push(function(e,t=1e4,n="any"){return i((()=>u(e,n)),Math.ceil(t/200),200)}(e.waitForVisible,e.timeout,e.check)),e.click&&t.push(a(e.click,e.all)),e.waitForThenClick&&t.push(d(e.waitForThenClick,e.timeout,e.all)),e.wait&&t.push(p(e.wait)),e.hide&&t.push((s=e.hide,h=e.method,o(n(),s,h))),e.if){if(!e.if.exists&&!e.if.visible)return console.error("invalid conditional rule",e.if),!1;await y(e.if)?t.push(w(e.then)):e.else&&t.push(w(e.else))}if(0===t.length)return!1;return(await Promise.all(t)).reduce(((e,t)=>e&&t),!0)}async function w(e){for(const t of e){if(!await y(t)&&!t.optional)return!1}return!0}class g extends f{constructor(e){super(e.name),this.config=e,this.runContext=e.runContext||m}get hasSelfTest(){return!!this.config.test}get isIntermediate(){return!!this.config.intermediate}get prehideSelectors(){return this.config.prehideSelectors}async detectCmp(){return!!this.config.detectCmp&&async function(e){const t=e.map((e=>y(e)));return(await Promise.all(t)).every((e=>!!e))}(this.config.detectCmp)}async detectPopup(){return!!this.config.detectPopup&&w(this.config.detectPopup)}async optOut(){return!!this.config.optOut&&w(this.config.optOut)}async optIn(){return!!this.config.optIn&&w(this.config.optIn)}async openCmp(){return!!this.config.openCmp&&w(this.config.openCmp)}async test(){return this.hasSelfTest?w(this.config.test):super.test()}}const b="#truste-show-consent",C="#truste-consent-track";const k=[new class extends f{constructor(){super("TrustArc-top"),this.prehideSelectors=[".trustarc-banner-container",`.truste_popframe,.truste_overlay,.truste_box_overlay,${C}`],this.runContext={main:!0,frame:!1},this._shortcutButton=null,this._optInDone=!1}get hasSelfTest(){return!1}get isIntermediate(){return!this._optInDone&&!this._shortcutButton}async detectCmp(){const e=c(`#truste-show-consent,${C}`);return e&&(this._shortcutButton=document.querySelector("#truste-consent-required")),e}async detectPopup(){return u(`#truste-consent-content,#trustarc-banner-overlay,${C}`,"all")}openFrame(){a(b)}async optOut(){return this._shortcutButton?(this._shortcutButton.click(),!0):(o(n(),[".truste_popframe",".truste_overlay",".truste_box_overlay",C]),a(b),setTimeout((()=>{n().remove()}),1e4),!0)}async optIn(){return this._optInDone=!0,a("#truste-consent-button")}async openCmp(){return!0}async test(){return!0}},new class extends f{constructor(){super("TrustArc-frame"),this.runContext={main:!1,frame:!0,urlPattern:"^https://consent-pref\\.trustarc\\.com/\\?"}}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){return!0}async detectPopup(){return u("#defaultpreferencemanager","any")&&u(".mainContent","any")}async navigateToSettings(){return await i((async()=>c(".shp")||u(".advance","any")||c(".switch span:first-child")),10,500),c(".shp")&&a(".shp"),await l(".prefPanel",5e3),u(".advance","any")&&a(".advance"),await i((()=>u(".switch span:first-child","any")),5,1e3)}async optOut(){return await i((()=>"complete"===document.readyState),20,100),await l(".mainContent[aria-hidden=false]",5e3),!!a(".rejectAll")||(c(".prefPanel")&&await l('.prefPanel[style="visibility: visible;"]',3e3),a("#catDetails0")?(a(".submit"),!0):(a(".required")||(await this.navigateToSettings(),a(".switch span:nth-child(1):not(.active)",!0),a(".submit"),l("#gwt-debug-close_id",3e5).then((()=>{a("#gwt-debug-close_id")}))),!0))}async optIn(){return a(".call")||(await this.navigateToSettings(),a(".switch span:nth-child(2)",!0),a(".submit"),l("#gwt-debug-close_id",3e5).then((()=>{a("#gwt-debug-close_id")}))),!0}},new class extends f{constructor(){super("Cybotcookiebot"),this.prehideSelectors=["#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookieoverlay"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("#CybotCookiebotDialogBodyLevelButtonPreferences")}async detectPopup(){return c("#CybotCookiebotDialog,#dtcookie-container,#cookiebanner,#cb-cookiebanner")}async optOut(){return a(".cookie-alert-extended-detail-link")?(await l(".cookie-alert-configuration",2e3),a(".cookie-alert-configuration-input:checked",!0),a(".cookie-alert-extended-button-secondary"),!0):c("#dtcookie-container")?a(".h-dtcookie-decline"):(a(".cookiebot__button--settings")||a("#CybotCookiebotDialogBodyButtonDecline")||(a(".cookiebanner__link--details"),a('.CybotCookiebotDialogBodyLevelButton:checked:enabled,input[id*="CybotCookiebotDialogBodyLevelButton"]:checked:enabled',!0),a("#CybotCookiebotDialogBodyButtonDecline"),a("input[id^=CybotCookiebotDialogBodyLevelButton]:checked",!0),c("#CybotCookiebotDialogBodyButtonAcceptSelected")?a("#CybotCookiebotDialogBodyButtonAcceptSelected"):a("#CybotCookiebotDialogBodyLevelButtonAccept,#CybotCookiebotDialogBodyButtonAccept,#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection",!0),await r("window.CookieConsent.hasResponse !== true")&&(await r("window.Cookiebot.dialog.submitConsent()"),await p(500)),c("#cb-confirmedSettings")&&await r("endCookieProcess()")),!0)}async optIn(){return c("#dtcookie-container")?a(".h-dtcookie-accept"):(a(".CybotCookiebotDialogBodyLevelButton:not(:checked):enabled",!0),a("#CybotCookiebotDialogBodyLevelButtonAccept"),a("#CybotCookiebotDialogBodyButtonAccept"),!0)}async test(){return r("window.CookieConsent.declined === true")}},new class extends f{constructor(){super("Sourcepoint-top"),this.prehideSelectors=["div[id^='sp_message_container_'],.message-overlay"],this.runContext={main:!0,frame:!1}}get hasSelfTest(){return!0}get isIntermediate(){return!0}async detectCmp(){return c("div[id^='sp_message_container_']")}async detectPopup(){return u("div[id^='sp_message_container_']","all")}async optIn(){return!0}async optOut(){const e=document.querySelector(".sp-message-open");return e&&e.classList.remove("sp-message-open"),!0}async test(){return await r("__tcfapi('getTCData', 2, r => window.__rcsResult = r)"),await r("Object.values(window.__rcsResult.purpose.consents).every(c => !c)")}},new class extends f{constructor(){super("Sourcepoint-frame"),this.ccpaMode=!1,this.runContext={main:!1,frame:!0}}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){const e=new URL(location.href);return e.searchParams.has("message_id")&&"ccpa-notice.sp-prod.net"===e.hostname?(this.ccpaMode=!0,!0):("/index.html"===e.pathname||"/privacy-manager/index.html"===e.pathname)&&(e.searchParams.has("message_id")||e.searchParams.has("requestUUID")||e.searchParams.has("consentUUID"))}async detectPopup(){return await l(".sp_choice_type_11,.sp_choice_type_12,.sp_choice_type_13,.sp_choice_type_ACCEPT_ALL",2e3),!c(".sp_choice_type_9")}async optIn(){return await l(".sp_choice_type_11,.sp_choice_type_ACCEPT_ALL",2e3),!!a(".sp_choice_type_11")||!!a(".sp_choice_type_ACCEPT_ALL")}isManagerOpen(){return"/privacy-manager/index.html"===new URL(location.href).pathname}async optOut(){if(!this.isManagerOpen()){if(!await l(".sp_choice_type_12,.sp_choice_type_13"))return!1;if(!c(".sp_choice_type_12"))return a(".sp_choice_type_13");a(".sp_choice_type_12"),await i((()=>"/privacy-manager/index.html"===location.pathname),200,100)}await l(".type-modal",2e4);try{const e=".sp_choice_type_REJECT_ALL",t=".reject-toggle",n=await Promise.race([l(e,2e3).then((e=>e?0:-1)),l(t,2e3).then((e=>e?1:-1)),l(".pm-features",2e3).then((e=>e?2:-1))]);if(0===n)return await p(1e3),a(e);1===n?a(t):2===n&&(await l(".pm-features",1e4),a(".checked > span",!0),a(".chevron"))}catch(e){}return a(".sp_choice_type_SAVE_AND_EXIT"),!0}},new class extends f{constructor(){super("consentmanager.net"),this.prehideSelectors=["#cmpbox,#cmpbox2"],this.apiAvailable=!1}get hasSelfTest(){return this.apiAvailable}get isIntermediate(){return!1}async detectCmp(){return this.apiAvailable=await r('window.__cmp && typeof __cmp("getCMPData") === "object"'),!!this.apiAvailable||c("#cmpbox")}async detectPopup(){return this.apiAvailable?(await p(500),await r("!__cmp('consentStatus').userChoiceExists")):u("#cmpbox .cmpmore","any")}async optOut(){return await p(500),this.apiAvailable?await r("__cmp('setConsent', 0)"):!!a(".cmpboxbtnno")||(c(".cmpwelcomeprpsbtn")?(a(".cmpwelcomeprpsbtn > a[aria-checked=true]",!0),a(".cmpboxbtnsave"),!0):(a(".cmpboxbtncustom"),await l(".cmptblbox",2e3),a(".cmptdchoice > a[aria-checked=true]",!0),a(".cmpboxbtnyescustomchoices"),!0))}async optIn(){return this.apiAvailable?await r("__cmp('setConsent', 1)"):a(".cmpboxbtnyes")}async test(){if(this.apiAvailable)return await r("__cmp('consentStatus').userChoiceExists")}},new class extends f{constructor(){super("Evidon")}get hasSelfTest(){return!1}get isIntermediate(){return!1}async detectCmp(){return c("#_evidon_banner")}async detectPopup(){return u("#_evidon_banner","any")}async optOut(){return a("#_evidon-decline-button")||(o(n(),["#evidon-prefdiag-overlay","#evidon-prefdiag-background"]),a("#_evidon-option-button"),await l("#evidon-prefdiag-overlay",5e3),a("#evidon-prefdiag-decline")),!0}async optIn(){return a("#_evidon-accept-button")}},new class extends f{constructor(){super("Onetrust"),this.prehideSelectors=["#onetrust-banner-sdk,#onetrust-consent-sdk,.onetrust-pc-dark-filter,.js-consent-banner"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("#onetrust-banner-sdk")}async detectPopup(){return u("#onetrust-banner-sdk","all")}async optOut(){return c("#onetrust-pc-btn-handler")?a("#onetrust-pc-btn-handler"):a(".ot-sdk-show-settings,button.js-cookie-settings"),await l("#onetrust-consent-sdk",2e3),await p(1e3),a("#onetrust-consent-sdk input.category-switch-handler:checked,.js-editor-toggle-state:checked",!0),await p(1e3),await l(".save-preference-btn-handler,.js-consent-save",2e3),a(".save-preference-btn-handler,.js-consent-save"),await i((()=>u("#onetrust-banner-sdk","none")),10,500),!0}async optIn(){return a("#onetrust-accept-btn-handler,.js-accept-cookies")}async test(){return await r("window.OnetrustActiveGroups.split(',').filter(s => s.length > 0).length <= 1")}},new class extends f{constructor(){super("Klaro"),this.prehideSelectors=[".klaro"],this.settingsOpen=!1}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".klaro > .cookie-modal")?(this.settingsOpen=!0,!0):c(".klaro > .cookie-notice")}async detectPopup(){return u(".klaro > .cookie-notice,.klaro > .cookie-modal","any")}async optOut(){return!!a(".klaro .cn-decline")||(this.settingsOpen||(a(".klaro .cn-learn-more"),await l(".klaro > .cookie-modal",2e3),this.settingsOpen=!0),!!a(".klaro .cn-decline")||(a(".cm-purpose:not(.cm-toggle-all) > input:not(.half-checked)",!0),a(".cm-btn-accept")))}async optIn(){return!!a(".klaro .cm-btn-accept-all")||(this.settingsOpen?(a(".cm-purpose:not(.cm-toggle-all) > input.half-checked",!0),a(".cm-btn-accept")):a(".klaro .cookie-notice .cm-btn-success"))}async test(){return await r("klaro.getManager().config.services.every(c => c.required || !klaro.getManager().consents[c.name])")}},new class extends f{constructor(){super("Uniconsent")}get prehideSelectors(){return[".unic",".modal:has(.unic)"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".unic .unic-box,.unic .unic-bar")}async detectPopup(){return u(".unic .unic-box,.unic .unic-bar","any")}async optOut(){if(await l(".unic button",1e3),document.querySelectorAll(".unic button").forEach((e=>{const t=e.textContent;(t.includes("Manage Options")||t.includes("Optionen verwalten"))&&e.click()})),await l(".unic input[type=checkbox]",1e3)){await l(".unic button",1e3),document.querySelectorAll(".unic input[type=checkbox]").forEach((e=>{e.checked&&e.click()}));for(const e of document.querySelectorAll(".unic button")){const t=e.textContent;for(const n of["Confirm Choices","Save Choices","Auswahl speichern"])if(t.includes(n))return e.click(),await p(500),!0}}return!1}async optIn(){return d(".unic #unic-agree")}async test(){await p(1e3);return!c(".unic .unic-box,.unic .unic-bar")}},new class extends f{constructor(){super("Conversant"),this.prehideSelectors=[".cmp-root"]}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c(".cmp-root .cmp-receptacle")}async detectPopup(){return u(".cmp-root .cmp-receptacle","any")}async optOut(){if(!await d(".cmp-main-button:not(.cmp-main-button--primary)"))return!1;if(!await l(".cmp-view-tab-tabs"))return!1;await d(".cmp-view-tab-tabs > :first-child"),await d(".cmp-view-tab-tabs > .cmp-view-tab--active:first-child");for(const e of Array.from(document.querySelectorAll(".cmp-accordion-item"))){e.querySelector(".cmp-accordion-item-title").click(),await i((()=>!!e.querySelector(".cmp-accordion-item-content.cmp-active")),10,50);const t=e.querySelector(".cmp-accordion-item-content.cmp-active");t.querySelectorAll(".cmp-toggle-actions .cmp-toggle-deny:not(.cmp-toggle-deny--active)").forEach((e=>e.click())),t.querySelectorAll(".cmp-toggle-actions .cmp-toggle-checkbox:not(.cmp-toggle-checkbox--active)").forEach((e=>e.click()))}return await a(".cmp-main-button:not(.cmp-main-button--primary)"),!0}async optIn(){return d(".cmp-main-button.cmp-main-button--primary")}async test(){return document.cookie.includes("cmp-data=0")}},new class extends f{constructor(){super("tiktok.com"),this.runContext={urlPattern:"tiktok"}}get hasSelfTest(){return!0}get isIntermediate(){return!1}getShadowRoot(){const e=document.querySelector("tiktok-cookie-banner");return e?e.shadowRoot:null}async detectCmp(){return c("tiktok-cookie-banner")}async detectPopup(){return s(this.getShadowRoot().querySelector(".tiktok-cookie-banner"))}async optOut(){const e=this.getShadowRoot().querySelector(".button-wrapper button:first-child");return!!e&&(e.click(),!0)}async optIn(){const e=this.getShadowRoot().querySelector(".button-wrapper button:last-child");return!!e&&(e.click(),!0)}async test(){const e=document.cookie.match(/cookie-consent=([^;]+)/);if(!e)return!1;const t=JSON.parse(decodeURIComponent(e[1]));return Object.values(t).every((e=>"boolean"!=typeof e||!1===e))}},new class extends f{constructor(){super("airbnb"),this.runContext={urlPattern:"^https://(www\\.)?airbnb\\.[^/]+/"},this.prehideSelectors=["div[data-testid=main-cookies-banner-container]",'div:has(> div:first-child):has(> div:last-child):has(> section [data-testid="strictly-necessary-cookies"])']}get hasSelfTest(){return!0}get isIntermediate(){return!1}async detectCmp(){return c("div[data-testid=main-cookies-banner-container]")}async detectPopup(){return u("div[data-testid=main-cookies-banner-container","any")}async optOut(){let e;for(await d("div[data-testid=main-cookies-banner-container] button._snbhip0");e=document.querySelector("[data-testid=modal-container] button[aria-checked=true]:not([disabled])");)e.click();return d("button[data-testid=save-btn]")}async optIn(){return d("div[data-testid=main-cookies-banner-container] button._148dgdpk")}async test(){return await i((()=>!!document.cookie.match("OptanonAlertBoxClosed")),20,200)}}];class v{static setBase(e){v.base=e}static findElement(e,t=null,n=!1){let o=null;return o=null!=t?Array.from(t.querySelectorAll(e.selector)):null!=v.base?Array.from(v.base.querySelectorAll(e.selector)):Array.from(document.querySelectorAll(e.selector)),null!=e.textFilter&&(o=o.filter((t=>{let n=t.textContent.toLowerCase();if(Array.isArray(e.textFilter)){let t=!1;for(let o of e.textFilter)if(-1!==n.indexOf(o.toLowerCase())){t=!0;break}return t}if(null!=e.textFilter)return-1!==n.indexOf(e.textFilter.toLowerCase())}))),null!=e.styleFilters&&(o=o.filter((t=>{let n=window.getComputedStyle(t),o=!0;for(let t of e.styleFilters){let e=n[t.option];o=t.negated?o&&e!==t.value:o&&e===t.value}return o}))),null!=e.displayFilter&&(o=o.filter((t=>e.displayFilter?0!==t.offsetHeight:0===t.offsetHeight))),null!=e.iframeFilter&&(o=o.filter((t=>e.iframeFilter?window.location!==window.parent.location:window.location===window.parent.location))),null!=e.childFilter&&(o=o.filter((t=>{let n=v.base;v.setBase(t);let o=v.find(e.childFilter);return v.setBase(n),null!=o.target}))),n?o:(o.length>1&&console.warn("Multiple possible targets: ",o,e,t),o[0])}static find(e,t=!1){let n=[];if(null!=e.parent){let o=v.findElement(e.parent,null,t);if(null!=o){if(o instanceof Array)return o.forEach((o=>{let i=v.findElement(e.target,o,t);i instanceof Array?i.forEach((e=>{n.push({parent:o,target:e})})):n.push({parent:o,target:i})})),n;{let i=v.findElement(e.target,o,t);i instanceof Array?i.forEach((e=>{n.push({parent:o,target:e})})):n.push({parent:o,target:i})}}}else{let o=v.findElement(e.target,null,t);o instanceof Array?o.forEach((e=>{n.push({parent:null,target:e})})):n.push({parent:null,target:o})}return 0===n.length&&n.push({parent:null,target:null}),t?n:(1!==n.length&&console.warn("Multiple results found, even though multiple false",n),n[0])}}function _(e){const t=v.find(e);return"css"===e.type?!!t.target:"checkbox"===e.type?!!t.target&&t.target.checked:void 0}async function S(e,t){switch(e.type){case"click":return async function(e){const t=v.find(e);null!=t.target&&t.target.click();return x(0)}(e);case"list":return async function(e,t){for(let n of e.actions)await S(n,t)}(e,t);case"consent":return async function(e,t){for(const n of e.consents){const e=-1!==t.indexOf(n.type);if(n.matcher&&n.toggleAction){_(n.matcher)!==e&&await S(n.toggleAction)}else e?await S(n.trueAction):await S(n.falseAction)}}(e,t);case"ifcss":return async function(e,t){v.find(e).target?e.falseAction&&await S(e.falseAction,t):e.trueAction&&await S(e.trueAction,t)}(e,t);case"waitcss":return async function(e){await new Promise((t=>{let n=e.retries||10;const o=e.waitTime||250,i=()=>{const s=v.find(e);(e.negated&&s.target||!e.negated&&!s.target)&&n>0?(n-=1,setTimeout(i,o)):t()};i()}))}(e);case"foreach":return async function(e,t){const n=v.find(e,!0),o=v.base;for(const o of n)o.target&&(v.setBase(o.target),await S(e.action,t));v.setBase(o)}(e,t);case"hide":return async function(e){const t=v.find(e);t.target&&t.target.classList.add("Autoconsent-Hidden")}(e);case"slide":return async function(e){const t=v.find(e),n=v.find(e.dragTarget);if(t.target){let e=t.target.getBoundingClientRect(),o=n.target.getBoundingClientRect(),i=o.top-e.top,s=o.left-e.left;"y"===this.config.axis.toLowerCase()&&(s=0),"x"===this.config.axis.toLowerCase()&&(i=0);let r=window.screenX+e.left+e.width/2,a=window.screenY+e.top+e.height/2,c=e.left+e.width/2,u=e.top+e.height/2,l=document.createEvent("MouseEvents");l.initMouseEvent("mousedown",!0,!0,window,0,r,a,c,u,!1,!1,!1,!1,0,t.target);let d=document.createEvent("MouseEvents");d.initMouseEvent("mousemove",!0,!0,window,0,r+s,a+i,c+s,u+i,!1,!1,!1,!1,0,t.target);let p=document.createEvent("MouseEvents");p.initMouseEvent("mouseup",!0,!0,window,0,r+s,a+i,c+s,u+i,!1,!1,!1,!1,0,t.target),t.target.dispatchEvent(l),await this.waitTimeout(10),t.target.dispatchEvent(d),await this.waitTimeout(10),t.target.dispatchEvent(p)}}(e);case"close":return async function(e){window.close()}();case"wait":return async function(e){await x(e.waitTime)}(e);case"eval":return async function(e){return console.log("eval!",e.code),new Promise((t=>{try{e.async?(window.eval(e.code),setTimeout((()=>{t(window.eval("window.__consentCheckResult"))}),e.timeout||250)):t(window.eval(e.code))}catch(n){console.warn("eval error",n,e.code),t(!1)}}))}(e);default:throw"Unknown action type: "+e.type}}v.base=null;function x(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}class P{constructor(e,t){this.name=e,this.config=t,this.methods=new Map,this.runContext=m,t.methods.forEach((e=>{e.action&&this.methods.set(e.name,e.action)})),this.hasSelfTest=!1}get isIntermediate(){return!1}checkRunContext(){return!0}async detectCmp(){return this.config.detectors.map((e=>_(e.presentMatcher))).some((e=>!!e))}async detectPopup(){return this.config.detectors.map((e=>_(e.showingMatcher))).some((e=>!!e))}async executeAction(e,t){return!this.methods.has(e)||S(this.methods.get(e),t)}async optOut(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),await this.executeAction("HIDE_CMP"),await this.executeAction("DO_CONSENT",[]),await this.executeAction("SAVE_CONSENT"),!0}async optIn(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),await this.executeAction("HIDE_CMP"),await this.executeAction("DO_CONSENT",["D","A","B","E","F","X"]),await this.executeAction("SAVE_CONSENT"),!0}async openCmp(){return await this.executeAction("HIDE_CMP"),await this.executeAction("OPEN_OPTIONS"),!0}async test(){return!0}}const A=new class{constructor(e,n=null,o=null){if(this.rules=[],this.foundCmp=null,t.sendContentMessage=e,this.sendContentMessage=e,this.rules=[...k],n)this.initialize(n,o);else{o&&this.parseRules(o);e({type:"init",url:window.location.href})}}initialize(e,t){if(this.config=e,e.enabled){if(t&&this.parseRules(t),e.disabledCmps?.length>0&&this.disableCMPs(e.disabledCmps),e.enablePrehide)if(document.documentElement)this.prehideElements();else{const e=()=>{window.removeEventListener("DOMContentLoaded",e),this.prehideElements()};window.addEventListener("DOMContentLoaded",e)}if("loading"===document.readyState){const e=()=>{window.removeEventListener("DOMContentLoaded",e),this.start()};window.addEventListener("DOMContentLoaded",e)}else this.start()}}parseRules(e){Object.keys(e.consentomatic).forEach((t=>{this.addConsentomaticCMP(t,e.consentomatic[t])})),e.autoconsent.forEach((e=>{this.addCMP(e)}))}addCMP(e){this.rules.push(function(e){return new g(e)}(e))}disableCMPs(e){this.rules=this.rules.filter((t=>!e.includes(t.name)))}addConsentomaticCMP(e,t){this.rules.push(new P(`com_${e}`,t))}start(){window.requestIdleCallback?window.requestIdleCallback((()=>this._start()),{timeout:500}):this._start()}async _start(){const e=await this.findCmp(this.config.detectRetries);if(e.length>0){const t=[];for(const n of e)this.sendContentMessage({type:"cmpDetected",url:location.href,cmp:n.name}),t.push(this.waitForPopup(n).then((e=>e?(this.foundCmp||(this.foundCmp=n),this.sendContentMessage({type:"popupFound",cmp:n.name,url:location.href}),!0):Promise.reject(`${n.name} popup not found`))));let n=!1;for(const e of t)try{await e,n=!0;break}catch(e){continue}return n?"optOut"===this.config.autoAction?await this.doOptOut():"optIn"!==this.config.autoAction||await this.doOptIn():(this.config.enablePrehide&&h(),!1)}return this.config.enablePrehide&&h(),!1}async findCmp(e){const t=[];for(const e of this.rules)try{if(!e.checkRunContext())continue;await e.detectCmp()&&t.push(e)}catch(e){}if(t.length>1){const e={msg:"Found multiple CMPs, check the detection rules.",cmps:t.map((e=>e.name))};this.sendContentMessage({type:"autoconsentError",details:e})}return 0===t.length&&e>0?new Promise((t=>{setTimeout((async()=>{const n=this.findCmp(e-1);t(n)}),500)})):t}async doOptOut(){let e;return e=!!this.foundCmp&&await this.foundCmp.optOut(),this.config.enablePrehide&&h(),this.sendContentMessage({type:"optOutResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,scheduleSelfTest:this.foundCmp&&this.foundCmp.hasSelfTest,url:location.href}),e&&!this.foundCmp.isIntermediate&&this.sendContentMessage({type:"autoconsentDone",cmp:this.foundCmp.name,url:location.href}),e}async doOptIn(){let e;return e=!!this.foundCmp&&await this.foundCmp.optIn(),this.config.enablePrehide&&h(),this.sendContentMessage({type:"optInResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,scheduleSelfTest:!1,url:location.href}),e&&!this.foundCmp.isIntermediate&&this.sendContentMessage({type:"autoconsentDone",cmp:this.foundCmp.name,url:location.href}),e}async doSelfTest(){let e;return e=!!this.foundCmp&&await this.foundCmp.test(),this.sendContentMessage({type:"selfTestResult",cmp:this.foundCmp?this.foundCmp.name:"none",result:e,url:location.href}),e}async waitForPopup(e,t=5,n=500){const o=await e.detectPopup();return!o&&t>0?new Promise((o=>setTimeout((()=>o(this.waitForPopup(e,t-1,n))),n))):o}prehideElements(){return function(e){return o(n("autoconsent-prehide"),e,"opacity")}(this.rules.reduce(((e,t)=>t.prehideSelectors?[...e,...t.prehideSelectors]:e),["#didomi-popup,.didomi-popup-container,.didomi-popup-notice,.didomi-consent-popup-preferences,#didomi-notice,.didomi-popup-backdrop,.didomi-screen-medium"]))}async receiveMessageCallback(e){switch(e.type){case"initResp":this.initialize(e.config,e.rules);break;case"optIn":await this.doOptIn();break;case"optOut":await this.doOptOut();break;case"selfTest":await this.doSelfTest();break;case"evalResp":!function(e,n){const o=t.pending.get(e);o?(t.pending.delete(e),o.timer&&window.clearTimeout(o.timer),o.resolve(n)):console.warn("no eval #",e)}(e.id,e.result)}}}(chrome.runtime.sendMessage);chrome.runtime.onMessage.addListener((e=>Promise.resolve(A.receiveMessageCallback(e))))}();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2022.11.3",
4
+ "version": "2022.11.4",
5
5
  "background": {
6
6
  "service_worker": "background.bundle.js"
7
7
  },
@@ -342,9 +342,6 @@
342
342
  },
343
343
  {
344
344
  "name": "borlabs",
345
- "prehideSelectors": [
346
- "#BorlabsCookieBox"
347
- ],
348
345
  "detectCmp": [
349
346
  {
350
347
  "exists": "._brlbs-block-content"
@@ -362,7 +359,29 @@
362
359
  ],
363
360
  "optOut": [
364
361
  {
365
- "click": "a[data-cookie-refuse]"
362
+ "click": "a[data-cookie-individual]"
363
+ },
364
+ {
365
+ "waitForVisible": ".cookie-preference"
366
+ },
367
+ {
368
+ "click": "input[data-borlabs-cookie-checkbox]:checked",
369
+ "all": true,
370
+ "optional": true
371
+ },
372
+ {
373
+ "click": "#CookiePrefSave"
374
+ },
375
+ {
376
+ "wait": 500
377
+ }
378
+ ],
379
+ "prehideSelectors": [
380
+ "#BorlabsCookieBox"
381
+ ],
382
+ "test": [
383
+ {
384
+ "eval": "!JSON.parse(decodeURIComponent(document.cookie.split(';').find(c => c.indexOf('borlabs-cookie') !== -1).split('=', 2)[1])).consents.statistics"
366
385
  }
367
386
  ]
368
387
  },
@@ -2240,26 +2259,26 @@
2240
2259
  "urlPattern": "^https://www\\.reddit\\.com/"
2241
2260
  },
2242
2261
  "prehideSelectors": [
2243
- "section:has(section > span > a[href^=\"https://www.reddit.com/policies/cookies\"])"
2262
+ "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"])"
2244
2263
  ],
2245
2264
  "detectCmp": [
2246
2265
  {
2247
- "exists": "section:has(> span > a[href^=\"https://www.reddit.com/policies/cookies\"])"
2266
+ "exists": "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"])"
2248
2267
  }
2249
2268
  ],
2250
2269
  "detectPopup": [
2251
2270
  {
2252
- "visible": "section:has(> span > a[href^=\"https://www.reddit.com/policies/cookies\"])"
2271
+ "visible": "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"])"
2253
2272
  }
2254
2273
  ],
2255
2274
  "optIn": [
2256
2275
  {
2257
- "waitForThenClick": "section:has(> span > a[href^=\"https://www.reddit.com/policies/cookies\"]) section form:last-child button"
2276
+ "waitForThenClick": "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"]) section[class^='_'] > section:first-child form button"
2258
2277
  }
2259
2278
  ],
2260
2279
  "optOut": [
2261
2280
  {
2262
- "waitForThenClick": "section:has(> span > a[href^=\"https://www.reddit.com/policies/cookies\"]) section form:first-child button"
2281
+ "waitForThenClick": "section:has(a[href^=\"https://www.reddit.com/policies/cookies\"]) section[class^='_'] > section:last-child form button"
2263
2282
  }
2264
2283
  ],
2265
2284
  "test": [