UNPKG

@usercentrics/cmp-browser-sdk

Version:
1 lines 337 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UC_SDK={})}(this,function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function n(e,t,n,i,s,r,o){try{var a=e[r](o),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(i,s)}function i(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var o=e.apply(t,i);function a(e){n(o,s,r,a,c,"next",e)}function c(e){n(o,s,r,a,c,"throw",e)}a(void 0)})}}function s(e,t,n){return t=d(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,T(i.key),i)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=A(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,s=function(){};return{s:s,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw r}}}}function u(e,t,n){return(t=T(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(arguments.length<3?e:n):s.value}},l.apply(null,arguments)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&E(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(n,i,s,r){var c=i&&i.prototype instanceof a?i:a,u=Object.create(c.prototype);return S(u,"_invoke",function(n,i,s){var r,a,c,u=0,l=s||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return r=t,a=0,c=e,h.n=n,o}};function p(n,i){for(a=n,c=i,t=0;!d&&u&&!s&&t<l.length;t++){var s,r=l[t],p=h.p,g=r[2];n>3?(s=g===i)&&(c=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((s=n<2&&p<r[1])?(a=0,h.v=i,h.n=r[1]):p<g&&(s=n<3||r[0]>i||i>g)&&(r[4]=n,r[5]=i,h.n=g,a=0))}if(s||n>1)return o;throw d=!0,i}return function(s,l,g){if(u>1)throw TypeError("Generator is already running");for(d&&1===l&&p(l,g),a=l,c=g;(t=a<2?e:c)||!d;){r||(a?a<3?(a>1&&(h.n=-1),p(a,c)):h.n=c:h.v=c);try{if(u=2,r){if(a||(s="next"),t=r[s]){if(!(t=t.call(r,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(c=TypeError("The iterator does not provide a '"+s+"' method"),a=1);r=e}else if((t=(d=h.n<0)?c:n.call(i,h))!==o)break}catch(t){r=e,a=1,c=t}finally{u=1}}return{value:t,done:d}}}(n,s,r),!0),u}var o={};function a(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(S(t={},i,function(){return this}),t),d=u.prototype=a.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,S(e,s,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=u,S(d,"constructor",u),S(u,"constructor",c),c.displayName="GeneratorFunction",S(u,s,"GeneratorFunction"),S(d),S(d,s,"Generator"),S(d,i,function(){return this}),S(d,"toString",function(){return"[object Generator]"}),(v=function(){return{w:r,m:h}})()}function S(e,t,n,i){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}S=function(e,t,n,i){if(t)s?s(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n;else{function r(t,n){S(e,t,function(e){return this._invoke(t,n,e)})}r("next",0),r("throw",1),r("return",2)}},S(e,t,n,i)}function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},E(e,t)}function I(e,t,n,i){var s=l(d(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof s?function(e){return s.apply(n,e)}:s}function C(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||A(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function A(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}function _(e){var t="function"==typeof Map?new Map:void 0;return _=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(p())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var s=new(e.bind.apply(e,i));return n&&E(s,n.prototype),s}(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),E(n,e)},_(e)}var m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},m(e,t)};function O(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var N,b,D,L=function(){return L=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},L.apply(this,arguments)};function w(e,t,n,i){return new(n||(n=Promise))(function(s,r){function o(e){try{c(i.next(e))}catch(t){r(t)}}function a(e){try{c(i.throw(e))}catch(t){r(t)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}c((i=i.apply(e,t||[])).next())})}function R(e,t){var n,i,s,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(r=0)),r;)try{if(n=1,i&&(s=2&a[0]?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(s=r.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(6===a[0]&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(c){a=[6,c],i=0}finally{n=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function P(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function V(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,s,r=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function U(e,t,n){if(n||2===arguments.length)for(var i,s=0,r=t.length;s<r;s++)!i&&s in t||(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}function M(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=P(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise(function(i,s){(function(e,t,n,i){Promise.resolve(i).then(function(t){e({value:t,done:n})},t)})(i,s,(t=e[n](t)).done,t.value)})}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.CONSENT_RESPONSE="consent-response",e.CONSENT_UI="consent-ui"}(N||(N={})),function(e){e.ACCEPT="accept",e.REJECT="reject",e.DISMISS="dismiss",e.FULLSCREEN="enter-fullscreen",e.READY="ready"}(b||(b={})),function(e){e[e.TCF_V2=2]="TCF_V2",e[e.CCPA=3]="CCPA"}(D||(D={}));var k,F,G,B,x,H,j,Y,J,W,K,z,Q,q;!function(e){e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE"}(k||(k={})),function(e){e[e.DATA_LAYER=0]="DATA_LAYER",e[e.WINDOW_EVENT=1]="WINDOW_EVENT"}(F||(F={})),function(e){e[e.MAJOR=0]="MAJOR",e[e.MINOR=1]="MINOR",e[e.PATCH=2]="PATCH"}(G||(G={})),function(e){e.CALL_INIT="Usercentrics: You have to call the init method before!",e.DATA_LOCAL="Usercentrics: disableServerConsents and controllerId should not be present at the same time in the InitOptions!",e.UNKNOWN_VARIANT="Usercentrics: Unknown variant",e.NOT_CCPA="Usercentrics: CCPA was not initialized",e.NOT_DEFAULT="Usercentrics: GDPR was not initialized",e.NOT_TCF="Usercentrics: TCF was not initialized"}(B||(B={})),e.FIRST_LAYER_VARIANT=void 0,(x=e.FIRST_LAYER_VARIANT||(e.FIRST_LAYER_VARIANT={})).BANNER="BANNER",x.WALL="WALL",e.SECOND_LAYER_VARIANT=void 0,(H=e.SECOND_LAYER_VARIANT||(e.SECOND_LAYER_VARIANT={})).CENTER="CENTER",H.SIDE="SIDE",e.THEME=void 0,(j=e.THEME||(e.THEME={}))[j.DARK=0]="DARK",j[j.LIGHT=1]="LIGHT",e.SECOND_LAYER_TRIGGER=void 0,(Y=e.SECOND_LAYER_TRIGGER||(e.SECOND_LAYER_TRIGGER={})).LINK="LINK",Y.BUTTON="BUTTON",Y.MORE_LINK_BUTTON="MORE_LINK_BUTTON",e.SECOND_LAYER_SIDE=void 0,(J=e.SECOND_LAYER_SIDE||(e.SECOND_LAYER_SIDE={})).LEFT="LEFT",J.RIGHT="RIGHT",e.BUTTON_ALIGNMENT=void 0,(W=e.BUTTON_ALIGNMENT||(e.BUTTON_ALIGNMENT={})).HORIZONTAL="HORIZONTAL",W.VERTICAL="VERTICAL",e.DPS_DISPLAY_FORMAT=void 0,(K=e.DPS_DISPLAY_FORMAT||(e.DPS_DISPLAY_FORMAT={})).ALL="ALL",K.SHORT="SHORT",function(e){e.CROSS_DEVICE_DATA_NOT_AVAILABLE="Usercentrics: Cross Device Consents data is not available",e.CROSS_DEVICE_TCF_DATA_NOT_AVAILABLE="Usercentrics: Cross Device TCF data is not available",e.CROSS_DEVICE_FEATURE_DISABLED="Usercentrics: The `Cross-Device Consent Sharing` feature is not enabled. Please contact the support team in order to enable this feature for your configuration"}(z||(z={})),function(e){e.CROSS_DOMAIN_DATA_NOT_AVAILABLE="Usercentrics: Cross Domain Consents data is not available",e.CROSS_DOMAIN_TCF_DATA_NOT_AVAILABLE="Usercentrics: Cross Domain TCF data is not available",e.CROSS_DOMAIN_FEATURE_NOT_AVAILABLE="Usercentrics: Cross Domain Consent Sharing is not available.",e.CROSS_DOMAIN_LANGUAGE_NOT_AVAILABLE="Usercentrics: Cross Domain Consent language is not available",e.CROSS_DOMAIN_SET_DATA_FAILURE="Usercentrics: Unable to set Cross Domain data",e.CROSS_DOMAIN_SET_TCF_DATA_FAILURE="Usercentrics: Unable to set Cross Domain TCF data",e.CROSS_DOMAIN_IFRAME_ERROR="Usercentrics: Iframe error",e.CROSS_DOMAIN_IFRAME_NOT_FOUND="Usercentrics: Cross Domain iFrame not found",e.CROSS_DOMAIN_IFRAME_LOAD_ERROR="Usercentrics: IFrame did not load"}(Q||(Q={})),function(e){e.CLEAR="clear",e.GET_CROSS_DOMAIN_LANGUAGE="getCrossDomainLanguage",e.GET_CROSS_DOMAIN_SESSION_DATA="getCrossDomainSessionData",e.GET_CROSS_DOMAIN_TCF_DATA="getCrossDomainTcfData",e.GET_CROSS_DOMAIN_CCPA_DATA="getCrossDomainCcpaData",e.GET_TC_STRING="getTCString",e.PING="ping",e.SET_CROSS_DOMAIN_DATA="setCrossDomainData",e.SET_CROSS_DOMAIN_TCF_DATA="setCrossDomainTcfData",e.SET_CROSS_DOMAIN_CCPA_DATA="setCrossDomainCcpaData",e.SET_TC_STRING="setTCString"}(q||(q={}));var X,$,Z="ucMobileSdk",ee=["*.usercentrics-sandbox.eu","*.usercentrics.eu"],te="4.48.0",ne="1---",ie="__uspapiLocator",se=/^[1][nNyY-][nNyY-][nNyY-]$/,re="__uspapi";!function(e){e.CCPA="uc_usprivacy",e.CCPA_DATA="uc_ccpa",e.CONSENTS_BUFFER="uc_consents_buffer",e.CONSENTS_V2_BUFFER="uc_consents_v2_buffer",e.GCM_DATA="uc_gcm",e.LEGACY_SETTINGS="ucSettings",e.SERVICES="uc_services",e.SETTINGS="uc_settings",e.TCF="uc_tcf",e.USER_INTERACTION="uc_user_interaction",e.AB_TEST_VARIANT="uc_ab_variant"}(X||(X={})),function(e){e.USER_COUNTRY="uc_user_country"}($||($={}));var oe,ae,ce,ue,le="uc-cross-domain-bridge",de="".concat("https://app.usercentrics.eu","/browser-sdk/").concat(te,"/cross-domain-bridge.html"),he="".concat("https://app.eu.usercentrics.eu","/browser-sdk/").concat(te,"/cross-domain-bridge.html"),pe=function(){function e(){}return e.setDomainBridgeUri=function(t){var n="";t&&(t.crossDomainConsentSharingIFrame?n=t.crossDomainConsentSharingIFrame:t.app&&(n="".concat(t.app,"/browser-sdk/").concat(te,"/cross-domain-bridge.html")));var i=""!==n?n:de,s=he;e.domainBridgeUri=e.useEuCdn?s:i},e.getDomainBridgeUri=function(){return e.domainBridgeUri},e.init=function(t,n){return w(this,void 0,void 0,function(){return R(this,function(i){return e.setDomainBridgeUri(n),e.setUseEuCdn((null==t?void 0:t.useEuCdn)||!1),e.setDomainBridgeUri(n),[2,this.initIFrame(e.getDomainBridgeUri(),le)]})})},e.initIFrame=function(t,n){return w(this,void 0,void 0,function(){var i=this;return R(this,function(s){return[2,new Promise(function(s,r){var o=e.createIFrame(t,n);o.onload=function(){return w(i,void 0,void 0,function(){var i;return R(this,function(a){return i=setTimeout(function(){o={},r(new Error(Q.CROSS_DOMAIN_IFRAME_LOAD_ERROR))},1e3),e.queryIFrame(t,n,q.PING).then(function(){clearTimeout(i),s(!0)}).catch(function(e){clearTimeout(i),r(e)}),[2]})})},o.onerror=function(){return w(i,void 0,void 0,function(){return R(this,function(e){return r(new Error(Q.CROSS_DOMAIN_IFRAME_ERROR)),[2]})})},e.appendIFrame(o)})]})})},e.setIsCrossDomainAvailable=function(t){e.crossDomainAvailable=t},e.isCookieBridgeAvailable=function(){return e.cookieBridgeAvailable},e.setIsCookieBridgeAvailable=function(t){e.cookieBridgeAvailable=t},e.isCrossDomainAvailable=function(){return e.crossDomainAvailable},e.getCrossDomainId=function(){return e.crossDomainId},e.setCrossDomainId=function(t){e.crossDomainId="".concat("uc_cross_domain_data","_").concat(t)},e.setCookieBridgeDomain=function(e,t){this.cookieBridgeDomain="".concat(e).concat(t)},e.setUseEuCdn=function(t){e.useEuCdn=t},e.createIFrame=function(t,n){e.removeIFrame(n);var i=document.createElement("iframe");return i.style.display="none",i.id=n,i.src=t,i},e.removeIFrame=function(e){var t=document.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)},e.queryIFrame=function(e,t,n,i,s){return w(this,void 0,void 0,function(){var r;return R(this,function(o){if(!(r=document.getElementById(t))||!r.id)throw new Error(Q.CROSS_DOMAIN_IFRAME_NOT_FOUND);return[2,new Promise(function(t,o){var a=JSON.stringify({crossDomainId:s,method:n,payload:i}),c=new MessageChannel;c.port1.onmessage=function(e){var n=JSON.parse(e.data),i=n.success,s=n.data;i?t(s):o(e)},r&&r.contentWindow&&r.contentWindow.postMessage(a,e,[c.port2])})]})})},e.appendIFrame=function(e){try{document.body?document.body.appendChild(e):document.addEventListener("DOMContentLoaded",function(){document.body.appendChild(e)})}catch(t){return new Error(Q.CROSS_DOMAIN_IFRAME_ERROR)}return null},e.query=function(t,n){return w(this,void 0,void 0,function(){return R(this,function(i){return[2,e.queryIFrame(e.getDomainBridgeUri(),le,t,n,e.crossDomainId)]})})},e.getCrossDomainLanguage=function(){return e.query(q.GET_CROSS_DOMAIN_LANGUAGE)},e.setCrossDomainData=function(t){return w(this,void 0,void 0,function(){return R(this,function(n){return[2,e.query(q.SET_CROSS_DOMAIN_DATA,(i=t,{consents:i.services.map(function(e){return e.history.map(function(t){return{action:t.action,consentId:"",settingsVersion:t.versions.settings,status:t.status,templateId:e.id,timestamp:"".concat(t.timestamp),updatedBy:t.type}})}).reduce(function(e,t){return e.concat(t)},[]).sort(function(e,t){return parseInt(e.timestamp,10)-parseInt(t.timestamp,10)}),controllerId:i.controllerId,language:i.language}))];var i})})},e.setCrossDomainCcpaData=function(t){return w(this,void 0,void 0,function(){return R(this,function(n){return[2,e.query(q.SET_CROSS_DOMAIN_CCPA_DATA,t)]})})},e.getCrossDomainCcpaData=function(){return w(this,void 0,void 0,function(){return R(this,function(t){return[2,e.query(q.GET_CROSS_DOMAIN_CCPA_DATA)]})})},e.getCrossDomainSessionData=function(){return w(this,void 0,void 0,function(){return R(this,function(t){return[2,e.query(q.GET_CROSS_DOMAIN_SESSION_DATA)]})})},e.getCrossDomainTcfData=function(){return w(this,void 0,void 0,function(){return R(this,function(t){return[2,e.query(q.GET_CROSS_DOMAIN_TCF_DATA)]})})},e.setCrossDomainTcfData=function(t){return w(this,void 0,void 0,function(){return R(this,function(n){return[2,e.query(q.SET_CROSS_DOMAIN_TCF_DATA,t)]})})},e.clearCrossDomainStorage=function(){return w(this,void 0,void 0,function(){return R(this,function(t){return[2,e.query(q.CLEAR)]})})},e.crossDomainId="",e.cookieBridgeDomain="",e.domainBridgeUri=de,e.useEuCdn=!1,e.cookieBridgeAvailable=!1,e.crossDomainAvailable=!1,e}(),ge=function(){function e(){this.length=0,this.data={}}return e.prototype.updateLength=function(){this.length=Object.keys(this.data).length},e.prototype.key=function(e){var t=Object.keys(this.data)[e];return void 0===y(t)?null:t},e.prototype.getItem=function(e){return void 0!==this.data[e]?this.data[e]:null},e.prototype.setItem=function(e,t){this.data[e]=String(t),this.updateLength()},e.prototype.removeItem=function(e){delete this.data[e],this.updateLength()},e.prototype.clear=function(){this.data={},this.updateLength()},e}();!function(e){e.COOKIE_BRIDGE_NOT_AVAILABLE="Usercentrics: Cookie bridge is not available.",e.COOKIE_BRIDGE_OPTIONS_NOT_SET="Usercentrics: Cookie bridge options are not set",e.GET_GLOBAL_TC_STRING_FAILURE="Usercentrics: Unable to get the Global TC string",e.INIT_TCF_ERROR="Usercentrics: Unable to init TCF",e.RESET_GVL_FAILURE="Usercentrics: Unable to reset Global Vendor List",e.SET_GLOBAL_TC_STRING_FAILURE="Usercentrics: Unable to set the Global TC string",e.VENDOR_REMOVED="Usercentrics: The following vendor is not part of the official vendors list anymore: ",e.TC_MODEL_UNDEFINED="Usercentrics: tcModel can not be null.",e.SELECTED_LANGUAGE_UNDEFINED="Usercentrics: Selected language can not be undefined"}(oe||(oe={})),function(e){e.LEGITIMATE_INTEREST="legIntPurposes",e.PURPOSES="purposes"}(ae||(ae={})),function(e){e[e.ID=0]="ID",e[e.LEGITIMATE_INTEREST=1]="LEGITIMATE_INTEREST",e[e.PURPOSES=2]="PURPOSES",e[e.SPECIAL_PURPOSES=3]="SPECIAL_PURPOSES"}(ce||(ce={})),e.TCF_DECISION_UI_LAYER=void 0,(ue=e.TCF_DECISION_UI_LAYER||(e.TCF_DECISION_UI_LAYER={}))[ue.FIRST_LAYER=1]="FIRST_LAYER",ue[ue.SECOND_LAYER=2]="SECOND_LAYER";var fe=function(e){switch(e){case"onAcceptAllBtnClick":case"onSpecialFunctionAcceptAllConsentTrigger":return"onAcceptAllServices";case"onDenyAllAnchorClick":case"onDenyAllBtnClick":return"onDenyAllServices";case"onNonEURegion":return"onNonEURegion";case"onInitialPageLoad":case"onCountdownFinished":default:return"onInitialPageLoad";case"onToggleCategory":case"onToggleConsent":case"onToggleSelectAll":return"onEssentialChange";case"onWindowFunctionUpdateConsent":case"bySettingsUpdate":case"onSaveBtnClick":return"onUpdateServices"}},ve=function(e){switch(e){case"update":case"implicit":default:return"implicit";case"explicit":return"explicit"}},Se="RAMDOM_KEY_LOCAL_STORAGE",Ee=function(){function e(){this.localStorage=null,this.sessionStorage=null,this.storeServiceIdToNameMapping=!1}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.localStorage=null,e.instance.sessionStorage=null},e.prototype.setStoreServiceIdToNameMapping=function(e){this.storeServiceIdToNameMapping=e},e.prototype.getStoreServiceIdToNameMapping=function(){return this.storeServiceIdToNameMapping},e.prototype.init=function(){try{localStorage.setItem(Se,Se),localStorage.removeItem(Se),this.localStorage=localStorage}catch(e){this.localStorage=new ge}try{sessionStorage.setItem(Se,Se),sessionStorage.removeItem(Se),this.sessionStorage=sessionStorage}catch(e){this.sessionStorage=new ge}},e.appendToConsentsBuffer=function(t){var n,i=e.fetchConsentsBuffer(),s=(new Date).valueOf();i.push({consents:t,timestamp:s}),null===(n=e.getInstance().localStorage)||void 0===n||n.setItem(X.CONSENTS_BUFFER,JSON.stringify(i))},e.appendToConsentsV2Buffer=function(t){var n,i=e.fetchConsentsV2Buffer(),s=(new Date).valueOf();i.push({consents:t,timestamp:s}),null===(n=e.getInstance().localStorage)||void 0===n||n.setItem(X.CONSENTS_V2_BUFFER,JSON.stringify(i))},e.clearOnNewSettingsId=function(t){t!==e.fetchSettingsId()&&e.clear()},e.findBufferItem=function(t){return e.fetchConsentsBuffer().slice().find(function(e){return JSON.stringify(e.consents)===JSON.stringify(t)})},e.findV2BufferItem=function(t){return e.fetchConsentsV2Buffer().slice().find(function(e){return JSON.stringify(e.consents)===JSON.stringify(t)})},e.removeConsentsBufferItem=function(t){var n,i,s=e.fetchConsentsBuffer(),r=s.length+0;(s=s.filter(function(e){return JSON.stringify(e)!==JSON.stringify(t)})).length&&s.length!==r?null===(n=e.getInstance().localStorage)||void 0===n||n.setItem(X.CONSENTS_BUFFER,JSON.stringify(s)):null===(i=e.getInstance().localStorage)||void 0===i||i.removeItem(X.CONSENTS_BUFFER)},e.removeConsentsV2BufferItem=function(t){var n,i,s=e.fetchConsentsV2Buffer(),r=s.length+0;(s=s.filter(function(e){return JSON.stringify(e)!==JSON.stringify(t)})).length&&s.length!==r?null===(n=e.getInstance().localStorage)||void 0===n||n.setItem(X.CONSENTS_V2_BUFFER,JSON.stringify(s)):null===(i=e.getInstance().localStorage)||void 0===i||i.removeItem(X.CONSENTS_V2_BUFFER)},e.getCcpaString=function(){var t,n=null===(t=e.getInstance().localStorage)||void 0===t?void 0:t.getItem(X.CCPA);return n&&se.test(n)?n:ne},e.getCcpaData=function(){var t,n=null===(t=e.getInstance().localStorage)||void 0===t?void 0:t.getItem(X.CCPA_DATA);return n?JSON.parse(n):null},e.fetchConsentsBuffer=function(){var t,n=null===(t=e.getInstance().localStorage)||void 0===t?void 0:t.getItem(X.CONSENTS_BUFFER);return n?JSON.parse(n):[]},e.fetchConsentsV2Buffer=function(){var t,n=null===(t=e.getInstance().localStorage)||void 0===t?void 0:t.getItem(X.CONSENTS_V2_BUFFER);return n?JSON.parse(n):[]},e.fetchControllerId=function(){var t=e.fetchSettings();return t?t.controllerId:""},e.fetchLanguage=function(){var t=e.fetchSettings();return t?t.language:""},e.fetchServices=function(){var t=e.fetchSettings();return t?t.services:[]},e.fetchLegacySettings=function(){var t,n=null===(t=e.getInstance().localStorage)||void 0===t?void 0:t.getItem(X.LEGACY_SETTINGS);return n?JSON.parse(n):null},e.fetchSettings=function(){var t,n=null===(t=e.getInstance().localStorage)||void 0===t?void 0:t.getItem(X.SETTINGS);return n?JSON.parse(n):{}},e.fetchSettingsId=function(){var t=e.fetchSettings();return t?t.id:""},e.fetchSettingsVersion=function(){var t=e.fetchSettings();return t?t.version:""},e.fetchTCFData=function(){var t,n=null===(t=e.getInstance().localStorage)||void 0===t?void 0:t.getItem(X.TCF),i=n?JSON.parse(n):{acString:"",tcString:"",timestamp:Date.now(),vendors:[]};return i.vendors||(i.vendors=[]),i},e.fetchTCFVendorsDisclosedObject=function(t){var n,i=e.fetchTCFData(),s=i.acString,r=i.tcString,o=i.vendors,a=i.vendorsDisclosed;if(!o&&!a)return{};if((a||!a&&!o.length&&r)&&t){var c=Object.keys(t).map(Number);n=(a||c).filter(function(e){return t[e]}).map(function(e){var n=t[e];return[n.id,n.legIntPurposes,n.purposes,n.specialPurposes]}),e.saveTCFData({acString:s,tcString:r,timestamp:Date.now(),vendors:n})}else n=o;return n.reduce(function(e,t){var n;return L(L({},e),((n={})[t[ce.ID]]=!0,n))},{})},e.fetchTCString=function(){return e.fetchTCFData().tcString||""},e.fetchACString=function(){return e.fetchTCFData().acString||""},e.fetchUserActionPerformed=function(){var t;return"true"===(null===(t=e.getInstance().localStorage)||void 0===t?void 0:t.getItem(X.USER_INTERACTION))},e.fetchUserCountryResponse=function(){var t;try{return JSON.parse((null===(t=e.getInstance().sessionStorage)||void 0===t?void 0:t.getItem($.USER_COUNTRY))||"null")}catch(n){return null}},e.setUserCountryResponse=function(t){var n;null===(n=e.getInstance().sessionStorage)||void 0===n||n.setItem($.USER_COUNTRY,JSON.stringify(t))},e.mapServices=function(e){return e.map(function(e){return{history:e.consent.history,id:e.id,processorId:e.processorId,status:e.consent.status}})},e.mapSettings=function(t,n){return{controllerId:t.controllerId,id:t.id,language:t.selectedLanguage,services:e.mapServices(n),version:t.version}},e.migrateLegacySettings=function(t){if(!e.settingsExist()){var n,i,s=e.fetchLegacySettings();if(e.clearLegacySettings(),null==s?void 0:s[t]){var r=(n=s[t])&&Te(n.ucConsents.consents)?((i={})[X.SETTINGS]={controllerId:n.ucConsents.consents[0].controllerId,id:n.usercentrics.settings.settingsId,language:n.usercentrics.settings.language,services:n.ucConsents.consents.map(function(e){return{history:e.history.map(function(e){return{action:fe(e.action),language:e.language,status:e.consentStatus,timestamp:e.updatedAt,type:ve(e.updatedBy),versions:{application:e.appVersion,service:e.consentTemplateVersion,settings:e.settingsVersion}}}),id:e.templateId,processorId:e.processorId,status:e.consentStatus}}),version:n.usercentrics.settings.version},i[X.USER_INTERACTION]=n.usercentrics.firstUserInteraction.stateSaved,i):null;r&&(e.saveSettings(r[X.SETTINGS]),r[X.USER_INTERACTION]&&e.setUserActionPerformed(!0))}}},e.saveSettings=function(t,n){var i,s;if(null===(i=e.getInstance().localStorage)||void 0===i||i.setItem(X.SETTINGS,JSON.stringify(t)),e.getInstance().getStoreServiceIdToNameMapping()&&n&&n.length){var r=n.reduce(function(e,t){return e[t.id]=t.name,e},{});null===(s=e.getInstance().localStorage)||void 0===s||s.setItem(X.SERVICES,JSON.stringify(r))}pe.isCrossDomainAvailable()&&pe.setCrossDomainData(t).catch(function(){console.warn(Q.CROSS_DOMAIN_SET_DATA_FAILURE)})},e.saveTCFData=function(t){var n;null===(n=e.getInstance().localStorage)||void 0===n||n.setItem(X.TCF,JSON.stringify(t)),pe.isCrossDomainAvailable()&&pe.setCrossDomainTcfData(t).catch(function(){console.warn(Q.CROSS_DOMAIN_SET_TCF_DATA_FAILURE)})},e.fetchGcmData=function(){var t,n=null===(t=e.getInstance().localStorage)||void 0===t?void 0:t.getItem(X.GCM_DATA);return n?JSON.parse(n):null},e.saveGcmData=function(t){var n;null===(n=e.getInstance().localStorage)||void 0===n||n.setItem(X.GCM_DATA,JSON.stringify(t))},e.saveTCString=function(t){var n=e.fetchTCFData();this.saveTCFData(L(L({},n),{tcString:t}))},e.setCcpaTimeStamp=function(t){var n,i=t||{ccpaString:this.getCcpaString()||"",timestamp:(new Date).getTime()};null===(n=e.getInstance().localStorage)||void 0===n||n.setItem(X.CCPA_DATA,JSON.stringify(i))},e.getCcpaTimeStamp=function(){var e=this.getCcpaData();return e&&e.timestamp?e.timestamp:(new Date).getTime()},e.setCcpaString=function(t){var n;null===(n=e.getInstance().localStorage)||void 0===n||n.setItem(X.CCPA,t),this.setCcpaTimeStamp()},e.settingsExist=function(){return ye(e.fetchSettings())},e.setUserActionPerformed=function(t){var n;null===(n=e.getInstance().localStorage)||void 0===n||n.setItem(X.USER_INTERACTION,JSON.stringify(t))},e.clearCcpa=function(){var t;this.clearCcpaData(),null===(t=e.getInstance().localStorage)||void 0===t||t.removeItem(X.CCPA)},e.clearCcpaData=function(){var t;null===(t=e.getInstance().localStorage)||void 0===t||t.removeItem(X.CCPA_DATA)},e.clearTcf=function(){var t;null===(t=e.getInstance().localStorage)||void 0===t||t.removeItem(X.TCF)},e.clearGcm=function(){var t;null===(t=e.getInstance().localStorage)||void 0===t||t.removeItem(X.GCM_DATA)},e.clear=function(){var t,n;e.clearCcpa(),e.clearTcf(),e.clearGcm(),null===(t=e.getInstance().localStorage)||void 0===t||t.removeItem(X.SETTINGS),null===(n=e.getInstance().localStorage)||void 0===n||n.removeItem(X.USER_INTERACTION)},e.clearAll=function(){return w(this,void 0,void 0,function(){return R(this,function(e){switch(e.label){case 0:return this.clear(),pe.isCrossDomainAvailable()?[4,pe.clearCrossDomainStorage()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},e.fetchAbTestVariant=function(t){var n,i,s=(null===(n=e.getInstance().localStorage)||void 0===n?void 0:n.getItem(X.AB_TEST_VARIANT))||"";if(t.includes(s))return s;var r=t[Math.floor(Math.random()*t.length)];return null===(i=e.getInstance().localStorage)||void 0===i||i.setItem(X.AB_TEST_VARIANT,r),r},e.clearLegacySettings=function(){var t;null===(t=e.getInstance().localStorage)||void 0===t||t.removeItem(X.LEGACY_SETTINGS)},e}(),Ie=function(e,t){return-1!==e.indexOf(t)},Ce=function(){return"SDK-".concat(te)},Te=function(e){return Array.isArray(e)&&e.length>0},ye=function(e){return"object"===y(e)&&null!==e&&Object.keys(e).length>0},Ae=function(e,t){if(void 0===t)throw new Error("altElement of nullishOperation can not be undefined");return null!=e?e:t},_e=function(e,t,n,i,s,r){return{applicationVersion:Ce(),consent:{action:n,status:t.consent.status,type:i},service:{categorySlug:s||"",id:t.id,name:t.name,processorId:t.processorId,version:t.version},settings:{controllerId:e.controllerId,id:e.id,language:e.selectedLanguage,referrerControllerId:Ae(null==r?void 0:r.referrerControllerId,""),version:e.version},timestamp:Ae(null==r?void 0:r.timestamp,(new Date).valueOf())}},me=function(e){var t=e.dataTransferSettings,n=e.services,i=void 0===n?[]:n,s=e.consentAction,r=e.consentString,o=e.isCcpa,a=e.isTcf,c=e.isAnalyticsEnabled,u=e.isConsentXDeviceEnabled,l=i.map(function(e){return{consentStatus:e.consent.status,consentTemplateId:e.id,consentTemplateVersion:e.version}}),d="",h="",p="";if(a){var g=Ee.fetchTCFData(),f=g.acString,v=g.tcString,S=g.timestamp,E=g.vendors,I=g.vendorsDisclosed;h=Ae(h?null==r?void 0:r.TCF2:v,""),p=JSON.stringify({timestamp:S,vendors:E,vendorsDisclosed:I}),f&&(d=f)}else o&&(h=Ae(null==r?void 0:r.CCPA,""));return L(L(L(L(L({action:s,analytics:Ae(c,!1),appVersion:Ce().replace("SDK-","")},p&&{consentMeta:p}),{consents:l}),h&&{consentString:h}),d&&{acString:d}),{controllerId:t.controllerId,language:t.selectedLanguage,settingsId:t.id,settingsVersion:t.version,xdevice:Ae(u,!1)})},Oe=function(e,t){return e.reduce(function(e,n){var i=t[n];if(!(null==i?void 0:i.name))return e;var s=i.name;return U(U([],V(e),!1),[{id:n,name:s}],!1)},[])};function Ne(e){return U([],V(new Set(e)),!1)}var be,De,Le,we,Re,Pe,Ve,Ue,Me,ke,Fe=function(e){return e.filter(function(e){return["onAcceptAllServices","onDenyAllServices","onUpdateServices"].indexOf(e.action)>-1}).sort(function(e,t){return t.timestamp-e.timestamp})},Ge=function(e){return e&&"object"===y(e)},Be=function(e,t,n){void 0===n&&(n=!1);var i=L({},t);if(!Ge(i))throw new Error("Source param should be an object");return Ge(e)?(Object.keys(e).forEach(function(t){var s,r,o,a,c,u=e[t],l=i[t];void 0!==l&&(i=Array.isArray(u)&&Array.isArray(l)?L(L({},i),n?((s={})[t]=(c=u.concat(l)).filter(function(e,t){return c.indexOf(e)===t}),s):((r={})[t]=u,r)):Ge(u)&&Ge(l)?L(L({},i),((o={})[t]=Be(L({},u),l),o)):L(L({},i),((a={})[t]=u,a)))}),i):i},xe=function(e,t,n,i){return void 0===n&&(n=2e4),void 0===i&&(i=5),new Promise(function(s,r){var o=setInterval(function(){e()&&(clearTimeout(a),clearInterval(o),s())},i),a=setTimeout(function(){clearTimeout(a),clearInterval(o),r(new Error(t))},n)})},He=function(e,t){for(var n=e.split("."),i=t.split("."),s=Math.min(n.length,i.length),r=0;r<s;r+=1){var o=Number(n[r])||0,a=Number(i[r])||0;if(o!==a)return o>a?1:-1}return i.length-n.length};!function(e){e[e.COOKIE=0]="COOKIE",e[e.WEB=1]="WEB",e[e.APP=2]="APP"}(be||(be={})),function(e){e.LEFT="LEFT",e.CENTER="CENTER",e.RIGHT="RIGHT"}(De||(De={})),function(e){e.CAT="CAT",e.SRV="SRV"}(Le||(Le={})),function(e){e.AVAILABLE_LANGUAGES_NOT_FOUND="Unable to find available languages using given settingsId and version.",e.FETCH_ACM_VENDORS="Something went wrong while fetching the atp vendors.",e.FETCH_AVAILABLE_LANGUAGES="Something went wrong while fetching the available languages.",e.FETCH_DATA_PROCESSING_SERVICES="Something went wrong while fetching the data processing services.",e.FETCH_LEGAL_BASIS="Something went wrong while fetching the legal data translations.",e.FETCH_SETTINGS="Something went wrong while fetching the settings.",e.FETCH_USER_CONSENTS="Something went wrong while fetching the user's consents.",e.FETCH_USER_COUNTRY="Something went wrong while fetching the user's country.",e.FETCH_USER_TCF_DATA="Something went wrong while fetching the user's tcf data.",e.GENERATE_DATA_PROCESSING_SERVICES="Something went wrong while generating the data processing services.",e.RULESET_NOT_FOUND="Config Map not found!",e.TAGLOGGER="Tag logger API is being called just before browser unload, some browsers like firefox cancel the api call and throw the error.",e.SAVE_CONSENTS="Something went wrong while saving user consents.",e.SAVE_CONSENTS_RETRY="Number of retries exceeded for saving user consents.",e.SETTINGS_NOT_FOUND="Unable to find settings using given settingsId and version.",e.CUSTOM_REFERRER_NOT_VALID="A custom referrer was passed to setTrackingPixel but it is not a valid URL. Origin and pathname will be passed instead."}(we||(we={})),function(e){e.US_CA_ONLY="US_CA_ONLY",e.US="US"}(Re||(Re={})),function(e){e[e.FIRST_LAYER=1]="FIRST_LAYER",e[e.SECOND_LAYER=3]="SECOND_LAYER"}(Pe||(Pe={})),function(e){e[e.DATA_LAYER=1]="DATA_LAYER",e[e.WINDOW_EVENT=4]="WINDOW_EVENT"}(Ve||(Ve={})),function(e){e.DATA_COLLECTED_LIST="dataCollectedList",e.DATA_PURPOSES_LIST="dataPurposesList",e.DATA_RECIPIENTS_LIST="dataRecipientsList",e.TECHNOLOGY_USED="technologyUsed"}(Ue||(Ue={})),function(e){e.MAJOR="major",e.MINOR="minor",e.PATCH="patch"}(Me||(Me={})),e.CLOSE_OPTION=void 0,(ke=e.CLOSE_OPTION||(e.CLOSE_OPTION={})).ICON="ICON",ke.LINK="LINK";var je,Ye={acceptAllButton:"Accept All",ccpaButton:"Agree to CCPA",ccpaMoreInformation:"More Information",closeButton:"Close",collapse:"Collapse",cookiePolicyButton:"Open Cookie Policy",copyControllerId:"Copy Controller ID",denyAllButton:"Deny all",expand:"Expand",fullscreenButton:"Enter full screen",imprintButton:"Open Imprint",languageSelector:"Select language",privacyButton:"Open",privacyPolicyButton:"Open Privacy Policy",saveButton:"Save",serviceInCategoryDetails:"View Service details",servicesInCategory:"List of Services in this category",tabButton:"Tab",usercentricsCard:"Card",usercentricsCMPButtons:"Footer including buttons",usercentricsCMPContent:"Content",usercentricsCMPHeader:"Header including language selection and external links",usercentricsCMPUI:"Consent Management Platform Interface",usercentricsList:"List",vendorConsentToggle:"Consent",vendorDetailedStorageInformation:"Detailed Storage Information",vendorLegIntToggle:"Legitimate Interest"},Je=function(e,t){return"boolean"==typeof e?e:t},We=function(e){if(!e)return null;var t=e.startsWith("#")?e:"#".concat(e);return Ke(t)?t:"#0045A5"},Ke=function(e){if(""===e||!e)return!1;return/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(e)},ze=function(e){if(null!=e.firstLayer.isOverlayEnabled)return e.firstLayer.isOverlayEnabled;var t=e.backgroundOverlay.find(function(e){var t;return(null===(t=e.target)||void 0===t?void 0:t[0])===Pe.FIRST_LAYER});return!!t&&(null==t?void 0:t.darken)>0},Qe=function(e){if(null!=e.secondLayer.isOverlayEnabled)return e.secondLayer.isOverlayEnabled;var t=e.backgroundOverlay.find(function(e){var t;return(null===(t=e.target)||void 0===t?void 0:t[0])===Pe.SECOND_LAYER});return!!t&&(null==t?void 0:t.darken)>0},qe=function(e){return"number"==typeof e||"string"==typeof e&&!e.includes("px")?"".concat(e,"px"):e},Xe=function(e){switch(e){case De.CENTER:return"center";case De.RIGHT:return"right";case De.LEFT:default:return"left"}},$e={description:"",id:"",legalBasis:[],name:""},Ze=function(e,t){return e.reduce(function(e,n){var i=t.find(function(e){return e.id===n.id});return i?U(U([],V(e),!1),[{categorySlug:n.categorySlug,consent:n.consent,id:n.id,language:n.language,name:i.name,processorId:n.processorId,version:n.version}],!1):U([],V(e),!1)},[])},et=function(e,t){return e.map(function(e){var n=t.find(function(t){return t.id===e.id});return L(L(L({},e),n||$e),{description:e.description||(null==n?void 0:n.description)||$e.description,id:e.id,subServices:et(e.subServices,t)})})},tt=function(e){return null!=e&&null!=e.region},nt=function(e){return null!=e&&null!=e.changedPurposes},it=function(e){return null!=e&&!tt(e)&&!nt(e)},st=function(e){var t;return null!=e&&null!=(null===(t=e.buttons)||void 0===t?void 0:t.optOutNotice)},rt=function(e){return null!=e&&null!=e.vendor},ot=function(e){var t;return null!=e&&null!=(null===(t=e.buttons)||void 0===t?void 0:t.showSecondLayer)},at=function(e){return null!=e&&(st(e)||ot(e)||rt(e))},ct=function(e){var t,n;return null!=e&&null!=(null===(t=e.firstLayer)||void 0===t?void 0:t.showShortDescriptionOnMobile)&&null==(null===(n=e.firstLayer)||void 0===n?void 0:n.isCategoryTogglesEnabled)},ut=function(e){var t;return null!=e&&null!=(null===(t=e.firstLayer)||void 0===t?void 0:t.hideNonIabPurposes)},lt=function(e){var t;return null!=e&&null!=(null===(t=e.firstLayer)||void 0===t?void 0:t.isCategoryTogglesEnabled)},dt=function(){function e(){this.ampEnabled=!1}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.ampEnabled=!1},e.prototype.isAmpEnabled=function(){return this.ampEnabled},e.prototype.setIsAmpEnabled=function(e){this.ampEnabled=e},e}(),ht="latest",pt={EU_URI:{AGGREGATOR:"https://aggregator.eu.usercentrics.eu/aggregate/",CDN:"https://config.eu.usercentrics.eu",FETCH_CONSENTS:"https://consents.eu.usercentrics.eu/consentsHistory",FETCH_CONSENTS_V2:"https://consent-rt-ret.service.consent.eu1.usercentrics.eu",FETCH_TCF_DATA:"https://consents.eu.usercentrics.eu/consentsHistoryTCF",FETCH_TCF_DATA_V2:"https://consents.eu.usercentrics.eu/consentState",GRAPHQL:"https://api.eu.usercentrics.eu/graphql",SAVE_CONSENTS_V2:"https://consent-api.service.consent.eu1.usercentrics.eu/consent",TRACK_EVENT:"https://uct.eu.usercentrics.eu/uct",TRACK_SESSION:"https://app.eu.usercentrics.eu/session/1px.png"},FOLDER:{RULESET:"ruleSet",SETTINGS:"settings",TEMPLATES:"consent-templates",TRANSLATIONS:"translations"},URI:{AGGREGATOR:"https://aggregator.service.usercentrics.eu/aggregate/",CDN:"https://api.usercentrics.eu",FETCH_CONSENTS:"https://consents.usercentrics.eu/consentsHistory",FETCH_CONSENTS_V2:"https://consent-rt-ret.service.consent.usercentrics.eu",FETCH_TCF_DATA:"https://consents.usercentrics.eu/consentsHistoryTCF",FETCH_TCF_DATA_V2:"https://consents.usercentrics.eu/consentState",GRAPHQL:"https://graphql.usercentrics.eu/graphql",RULESET:"https://api.usercentrics.eu",SAVE_CONSENTS_V2:"https://consent-api.service.consent.usercentrics.eu/consent",TRACK_EVENT:"https://uct.service.usercentrics.eu/uct",TRACK_SESSION:"https://app.usercentrics.eu/session/1px.png"}},gt={EU_URI:{AGGREGATOR:"https://aggregator.service.usercentrics-sandbox.eu/aggregate/",CDN:"https://api.usercentrics-sandbox.eu",FETCH_CONSENTS:"https://api-consent-sandbox-dot-usercentrics-playground.nw.r.appspot.com/consentsHistory",FETCH_CONSENTS_V2:"https://consent-rt-ret.service.consent.eu1.usercentrics-staging.eu",FETCH_TCF_DATA:"https://api-consent-sandbox-dot-usercentrics-playground.nw.r.appspot.com/consentsHistoryTCF",FETCH_TCF_DATA_V2:"https://api-consent-sandbox-dot-usercentrics-playground.nw.r.appspot.com/consentState",GRAPHQL:"https://api-v2-sandbox-consent-dot-usercentrics-playground.nw.r.appspot.com/",SAVE_CONSENTS_V2:"https://consent-api.service.consent.eu1.usercentrics-staging.eu/consent",TRACK_EVENT:"https://uct.eu.usercentrics.eu/uct",TRACK_SESSION:"https://app.usercentrics-sandbox.eu/session/1px.png"},FOLDER:{RULESET:"ruleSet",SETTINGS:"settings",TEMPLATES:"consent-templates",TRANSLATIONS:"translations"},URI:{AGGREGATOR:"https://aggregator.service.usercentrics-sandbox.eu/aggregate/",CDN:"https://api.usercentrics-sandbox.eu",FETCH_CONSENTS:"https://api-consent-sandbox-dot-usercentrics-playground.nw.r.appspot.com/consentsHistory",FETCH_CONSENTS_V2:"https://consent-rt-ret.service.consent.usercentrics-staging.eu",FETCH_TCF_DATA:"https://api-consent-sandbox-dot-usercentrics-playground.nw.r.appspot.com/consentsHistoryTCF",FETCH_TCF_DATA_V2:"https://api-consent-sandbox-dot-usercentrics-playground.nw.r.appspot.com/consentState",GRAPHQL:"https://api-v2-sandbox-consent-dot-usercentrics-playground.nw.r.appspot.com/",RULESET:"https://api.usercentrics-sandbox.eu",SAVE_CONSENTS_V2:"https://consent-api.service.consent.usercentrics-staging.eu/consent",TRACK_EVENT:"https://uct.service.usercentrics.eu/uct",TRACK_SESSION:"https://app.usercentrics-sandbox.eu/session/1px.png"}},ft="DE",vt="Germany (default)",St="",Et=["onEssentialChange","onInitialPageLoad","onNonEURegion"],It=["onSessionRestored","onMobileSessionRestore"],Ct=function(e,t,n){return w(void 0,void 0,void 0,function(){return R(this,function(i){return[2,yt(e,t,null,n)]})})},Tt=function(e,t,n,i){return w(void 0,void 0,void 0,function(){return R(this,function(s){return[2,yt(e,n,t,i)]})})},yt=function(e,t,n,i){return w(void 0,void 0,void 0,function(){var s,r;return R(this,function(o){return s={"Content-Type":"application/json"},r=L(L({},i),{headers:s,method:n?"POST":"GET"}),n&&(r.body=JSON.stringify(n)),(null==i?void 0:i.headers)&&(r.headers=L(L({},s),i.headers)),[2,fetch(e,r).then(function(e){return w(void 0,void 0,void 0,function(){return R(this,function(n){if(e.ok)return[2,_t(e)];throw At(t,e.status)})})})]})})},At=function(e,t){return{errorMessage:e,statusCode:t}},_t=function(e){return w(void 0,void 0,void 0,function(){return R(this,function(t){switch(t.label){case 0:return[4,mt(e)];case 1:return[2,{data:t.sent(),location:e.headers.get("x-client-geo-location"),statusCode:e.status}]}})})},mt=function(e){return w(void 0,void 0,void 0,function(){var t,n;return R(this,function(i){switch(i.label){case 0:return[4,e.text()];case 1:return t=i.sent(),[2,(n=""===t?{}:JSON.parse(t)).data||n]}})})};!function(e){e[e.RESOURCE_NOT_FOUND=403]="RESOURCE_NOT_FOUND"}(je||(je={}));var Ot="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var Nt={exports:{}},bt={exports:{}};!function(e){var t;e.exports=(t=t||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==Ot&&Ot.crypto&&(n=Ot.crypto),!n)try{n=require("crypto")}catch(f){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(f){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(f){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},o=r.lib={},a=o.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,s=e.sigBytes;if(this.clamp(),i%4)for(var r=0;r<s;r++){var o=n[r>>>2]>>>24-r%4*8&255;t[i+r>>>2]|=o<<24-(i+r)%4*8}else for(var a=0;a<s;a+=4)t[i+a>>>2]=n[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new c.init(t,e)}}),u=r.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],s=0;s<n;s++){var r=t[s>>>2]>>>24-s%4*8&255;i.push((r>>>4).toString(16)),i.push((15&r).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new c.init(n,t/2)}},d=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],s=0;s<n;s++){var r=t[s>>>2]>>>24-s%4*8&255;i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new c.init(n,t)}},h=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,i=this._data,s=i.words,r=i.sigBytes,o=this.blockSize,a=r/(4*o),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*u,r);if(u){for(var d=0;d<u;d+=o)this._doProcessBlock(s,d);n=s.splice(0,u),i.sigBytes-=l}return new c.init(n,l)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=p.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=r.algo={};return r}(Math),t)}(bt),function(e){var t;e.exports=(t=bt.exports,function(e){var n=t,i=n.lib,s=i.WordArray,r=i.Hasher,o=n.algo,a=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),i=2;i<=n;i++)if(!(t%i))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var i=2,s=0;s<64;)t(i)&&(s<8&&(a[s]=n(e.pow(i,.5))),c[s]=n(e.pow(i,1/3)),s++),i++}();var u=[],l=o.SHA256=r.extend({_doReset:function(){this._hash=new s.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],s=n[1],r=n[2],o=n[3],a=n[4],l=n[5],d=n[6],h=n[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var g=u[p-15],f=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,v=u[p-2],S=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[p]=f+u[p-7]+S+u[p-16]}var E=i&s^i&r^s&r,I=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),C=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&d)+c[p]+u[p];h=d,d=l,l=a,a=o+C|0,o=r,r=s,s=i,i=C+(I+E)|0}n[0]=n[0]+i|0,n[1]=n