!function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);throw(f=new Error("Cannot find module '"+i+"'")).code="MODULE_NOT_FOUND",f}c=n[i]={exports:{}},e[i][0].call(c.exports,function(r){return o(e[i][1][r]||r)},c,c.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},Cloneable=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.Cloneable=void 0,e.prototype.clone=function(){var e=this,r=new this.constructor;return Object.keys(this).forEach(function(t){var n=e.deepClone(e[t]);void 0!==n&&(r[t]=n)}),r},e.prototype.deepClone=function(e){var r,t,n=typeof e;if("number"==n||"string"==n||"boolean"==n)return e;if(null!==e&&"object"==n){if("function"==typeof e.clone)return e.clone();if(e instanceof Date)return new Date(e.getTime());if(void 0!==e[Symbol.iterator]){var o=[];try{for(var i=__values(e),l=i.next();!l.done;l=i.next()){var a=l.value;o.push(this.deepClone(a))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(t=i.return)&&t.call(i)}finally{if(r)throw r.error}}return e instanceof Array?o:new e.constructor(o)}var f,u={};for(f in e)e.hasOwnProperty(f)&&(u[f]=this.deepClone(e[f]));return u}},e);function e(){}exports.Cloneable=Cloneable},{}],2:[function(require,module,exports){var e,__extends=this&&this.__extends||(e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}),__awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r=r||Promise)(function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,a)}u((n=n.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var r,n,s,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o={next:a(0),throw:a(1),return:a(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return(o=>{if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(s=2&o[0]?n.return:o[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,o[1])).done)return s;switch(n=0,(o=s?[2&o[0],s.value]:o)[0]){case 0:case 1:s=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!((s=0<(s=i.trys).length&&s[s.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]{function t(r){var n=e.call(this)||this,s=(n.isReady_=!1,n.isLatest=!1,t.baseUrl);if(n.lang_=t.DEFAULT_LANGUAGE,n.isVendorList(r))n.populate(r),n.readyPromise=Promise.resolve();else{if(!s)throw new index_js_1.GVLError("must specify GVL.baseUrl before loading GVL json");0{function t(t){var n=e.call(this)||this;return n.isServiceSpecific_=!1,n.supportOOB_=!0,n.useNonStandardStacks_=!1,n.purposeOneTreatment_=!1,n.publisherCountryCode_="AA",n.version_=2,n.consentScreen_=0,n.policyVersion_=2,n.consentLanguage_="EN",n.cmpId_=0,n.cmpVersion_=0,n.vendorListVersion_=0,n.numCustomPurposes_=0,n.specialFeatureOptins=new index_js_2.Vector,n.purposeConsents=new index_js_2.Vector,n.purposeLegitimateInterests=new index_js_2.Vector,n.publisherConsents=new index_js_2.Vector,n.publisherLegitimateInterests=new index_js_2.Vector,n.publisherCustomConsents=new index_js_2.Vector,n.publisherCustomLegitimateInterests=new index_js_2.Vector,n.vendorConsents=new index_js_2.Vector,n.vendorLegitimateInterests=new index_js_2.Vector,n.vendorsDisclosed=new index_js_2.Vector,n.vendorsAllowed=new index_js_2.Vector,n.publisherRestrictions=new index_js_2.PurposeRestrictionVector,t&&(n.gvl=t),n.updated(),n}return __extends(t,e),Object.defineProperty(t.prototype,"gvl",{get:function(){return this.gvl_},set:function(e){GVL_js_1.GVL.isInstanceOf(e)||(e=new GVL_js_1.GVL(e)),this.gvl_=e,this.publisherRestrictions.gvl=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cmpId",{get:function(){return this.cmpId_},set:function(e){if(e=Number(e),!(Number.isInteger(e)&&1>0)<0)throw new index_js_1.TCModelError("vendorListVersion",e);this.vendorListVersion_=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"policyVersion",{get:function(){return this.gvl?this.gvl.tcfPolicyVersion:this.policyVersion_},set:function(e){if(this.policyVersion_=parseInt(e,10),this.policyVersion_<0)throw new index_js_1.TCModelError("policyVersion",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this.version_},set:function(e){this.version_=parseInt(e,10)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isServiceSpecific",{get:function(){return this.isServiceSpecific_},set:function(e){this.isServiceSpecific_=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useNonStandardStacks",{get:function(){return this.useNonStandardStacks_},set:function(e){this.useNonStandardStacks_=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"supportOOB",{get:function(){return this.supportOOB_},set:function(e){this.supportOOB_=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"purposeOneTreatment",{get:function(){return this.purposeOneTreatment_},set:function(e){this.purposeOneTreatment_=e},enumerable:!1,configurable:!0}),t.prototype.setAllVendorConsents=function(){this.vendorConsents.set(this.gvl.vendors)},t.prototype.unsetAllVendorConsents=function(){this.vendorConsents.empty()},t.prototype.setAllVendorsDisclosed=function(){this.vendorsDisclosed.set(this.gvl.vendors)},t.prototype.unsetAllVendorsDisclosed=function(){this.vendorsDisclosed.empty()},t.prototype.setAllVendorsAllowed=function(){this.vendorsAllowed.set(this.gvl.vendors)},t.prototype.unsetAllVendorsAllowed=function(){this.vendorsAllowed.empty()},t.prototype.setAllVendorLegitimateInterests=function(){this.vendorLegitimateInterests.set(this.gvl.vendors)},t.prototype.unsetAllVendorLegitimateInterests=function(){this.vendorLegitimateInterests.empty()},t.prototype.setAllPurposeConsents=function(){this.purposeConsents.set(this.gvl.purposes)},t.prototype.unsetAllPurposeConsents=function(){this.purposeConsents.empty()},t.prototype.setAllPurposeLegitimateInterests=function(){this.purposeLegitimateInterests.set(this.gvl.purposes)},t.prototype.unsetAllPurposeLegitimateInterests=function(){this.purposeLegitimateInterests.empty()},t.prototype.setAllSpecialFeatureOptins=function(){this.specialFeatureOptins.set(this.gvl.specialFeatures)},t.prototype.unsetAllSpecialFeatureOptins=function(){this.specialFeatureOptins.empty()},t.prototype.setAll=function(){this.setAllVendorConsents(),this.setAllPurposeLegitimateInterests(),this.setAllSpecialFeatureOptins(),this.setAllPurposeConsents(),this.setAllVendorLegitimateInterests()},t.prototype.unsetAll=function(){this.unsetAllVendorConsents(),this.unsetAllPurposeLegitimateInterests(),this.unsetAllSpecialFeatureOptins(),this.unsetAllPurposeConsents(),this.unsetAllVendorLegitimateInterests()},Object.defineProperty(t.prototype,"numCustomPurposes",{get:function(){var t,e=this.numCustomPurposes_;return"object"==typeof this.customPurposes&&(t=Object.keys(this.customPurposes).sort(function(e,t){return Number(e)-Number(t)}),e=parseInt(t.pop(),10)),e},set:function(e){if(this.numCustomPurposes_=parseInt(e,10),this.numCustomPurposes_<0)throw new index_js_1.TCModelError("numCustomPurposes",e)},enumerable:!1,configurable:!0}),t.prototype.updated=function(){var e=new Date,e=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));this.created=e,this.lastUpdated=e},t.consentLanguages=GVL_js_1.GVL.consentLanguages,t})(Cloneable_js_1.Cloneable);exports.TCModel=require},{"./Cloneable.js":1,"./GVL.js":2,"./errors/index.js":30,"./model/index.js":55}],5:[function(require,module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.TCString=void 0;var index_js_1=require("./encoder/index.js"),index_js_2=require("./model/index.js"),IntEncoder_js_1=require("./encoder/field/IntEncoder.js"),TCModel_js_1=require("./TCModel.js");function e(){}e.encode=function(e,n){var r,t="";return e=index_js_1.SemanticPreEncoder.process(e,n),(r=Array.isArray(null==n?void 0:n.segments)?n.segments:new index_js_1.SegmentSequence(e,n)[""+e.version]).forEach(function(n,d){var s="";d").concat(s,": ").concat(e.message))}}),Base64Url_js_1.Base64Url.encode(r)},e.decode=function(e,n,s){var i=this,r=Base64Url_js_1.Base64Url.decode(e),t=0,e=(s===index_js_4.Segment.CORE&&(n.version=index_js_1.IntEncoder.decode(r.substr(t,BitLength_js_1.BitLength[Fields_js_1.Fields.version]),BitLength_js_1.BitLength[Fields_js_1.Fields.version])),s!==index_js_4.Segment.CORE&&(t+=BitLength_js_1.BitLength.segmentType),this.fieldSequence[String(n.version)][s]),o=(0,index_js_1.FieldEncoderMap)();return e.forEach(function(e){var s=o[e],d=BitLength_js_1.BitLength[e];if(0!==(d=void 0===d&&i.isPublisherCustom(e)?Number(n[Fields_js_1.Fields.numCustomPurposes]):d)){var _=r.substr(t,d);if(s===index_js_1.VendorVectorEncoder?n[e]=s.decode(_,n.version):n[e]=s.decode(_,d),Number.isInteger(d))t+=d;else{if(!Number.isInteger(n[e].bitLength))throw new index_js_3.DecodingError(e);t+=n[e].bitLength}}}),n},e.isPublisherCustom=function(e){return 0===e.indexOf("publisherCustom")},e.fieldSequence=new index_js_2.FieldSequence,e);function e(){}exports.SegmentEncoder=require},{"../errors/index.js":30,"../model/Fields.js":36,"../model/index.js":55,"./Base64Url.js":6,"./BitLength.js":7,"./field/index.js":20,"./sequence/index.js":25}],10:[function(require,module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.SemanticPreEncoder=void 0;var index_js_1=require("../errors/index.js"),index_js_2=require("../model/index.js");function e(){}e.process=function(e,r){var s=e.gvl;if(!s)throw new index_js_1.EncodingError("Unable to encode TCModel without a GVL");if(!s.isReady)throw new index_js_1.EncodingError("Unable to encode TCModel tcModel.gvl.readyPromise is not resolved");(e=e.clone()).consentLanguage=s.language.toUpperCase(),0<(null==r?void 0:r.version)&&(null==r?void 0:r.version)<=this.processor.length?e.version=r.version:e.version=this.processor.length;r=e.version-1;if(this.processor[r])return this.processor[r](e,s);throw new index_js_1.EncodingError("Invalid version: ".concat(e.version))},e.processor=[function(e){return e},function(e,r){e.publisherRestrictions.gvl=r,e.purposeLegitimateInterests.unset(1);var s=new Map;return s.set("legIntPurposes",e.vendorLegitimateInterests),s.set("purposes",e.vendorConsents),s.forEach(function(s,n){s.forEach(function(o,t){if(o){o=r.vendors[t];if(!o||o.deletedDate)s.unset(t);else if(0===o[n].length&&!("legIntPurposes"===n&&0===o.purposes.length&&0===o.legIntPurposes.length&&0n||e<0)throw new index_js_1.EncodingError("".concat(e," too large to encode into ").concat(n));return t=t.length{var t=r[n],_=(0===s&&(i++,s=t),r[o-1]),c=e.gvl.vendorIds;(n===o-1||r[n+1]>(e=>{for(;++e<=_&&!c.has(e););return e})(t))&&(n=!(t===s),d=(d+=BooleanEncoder_js_1.BooleanEncoder.encode(n))+IntEncoder_js_1.IntEncoder.encode(s,BitLength_js_1.BitLength.vendorId),n&&(d+=IntEncoder_js_1.IntEncoder.encode(t,BitLength_js_1.BitLength.vendorId)),s=0)})(c);n=(n+=IntEncoder_js_1.IntEncoder.encode(i,BitLength_js_1.BitLength.numEntries))+d}),n},e.decode=function(e){var n=0,t=new index_js_2.PurposeRestrictionVector,r=IntEncoder_js_1.IntEncoder.decode(e.substr(n,BitLength_js_1.BitLength.numRestrictions),BitLength_js_1.BitLength.numRestrictions);n+=BitLength_js_1.BitLength.numRestrictions;for(var o=0;os&&c<_)&&t&&(e.has(i+1)?0===r.length&&(r.push(i),c=(c+=index_js_2.BitLength.singleOrRange)+index_js_2.BitLength.vendorId):(r.push(i),c+=index_js_2.BitLength.vendorId,d.push(r),r=[]))}),n?t=(t+=String(VectorEncodingType_js_1.VectorEncodingType.RANGE))+this.buildRangeEncoding(d):t=(t+=String(VectorEncodingType_js_1.VectorEncodingType.FIELD))+o,t},e.decode=function(e,n){var d,r=0,t=IntEncoder_js_1.IntEncoder.decode(e.substr(r,index_js_2.BitLength.maxId),index_js_2.BitLength.maxId),o=(r+=index_js_2.BitLength.maxId,IntEncoder_js_1.IntEncoder.decode(e.charAt(r),index_js_2.BitLength.encodingType));if(r+=index_js_2.BitLength.encodingType,o===VectorEncodingType_js_1.VectorEncodingType.RANGE){if(d=new index_js_1.Vector,1===n){if("1"===e.substr(r,1))throw new index_js_3.DecodingError("Unable to decode default consent=1");r++}var i=IntEncoder_js_1.IntEncoder.decode(e.substr(r,index_js_2.BitLength.numEntries),index_js_2.BitLength.numEntries);r+=index_js_2.BitLength.numEntries;for(var _=0;_{function t(t){t=r.call(this,t)||this;return t.name="DecodingError",t}return __extends(t,r),t})(Error));exports.DecodingError=DecodingError},{}],27:[function(require,module,exports){var r,__extends=this&&this.__extends||(r=function(t,o){return(r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,t){r.__proto__=t}:function(r,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}))(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}r(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),EncodingError=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.EncodingError=void 0,(r=>{function t(t){t=r.call(this,t)||this;return t.name="EncodingError",t}return __extends(t,r),t})(Error));exports.EncodingError=EncodingError},{}],28:[function(require,module,exports){var r,__extends=this&&this.__extends||(r=function(t,o){return(r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,t){r.__proto__=t}:function(r,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}))(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function e(){this.constructor=t}r(t,o),t.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}),GVLError=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.GVLError=void 0,(r=>{function t(t){t=r.call(this,t)||this;return t.name="GVLError",t}return __extends(t,r),t})(Error));exports.GVLError=GVLError},{}],29:[function(require,module,exports){var r,__extends=this&&this.__extends||(r=function(t,o){return(r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(r,t){r.__proto__=t}:function(r,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}))(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function e(){this.constructor=t}r(t,o),t.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}),TCModelError=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.TCModelError=void 0,(r=>{function t(t,o,e){void 0===e&&(e="");o=r.call(this,"invalid value ".concat(o," passed for ").concat(t," ").concat(e))||this;return o.name="TCModelError",o}return __extends(t,r),t})(Error));exports.TCModelError=TCModelError},{}],30:[function(require,module,exports){var __createBinding=this&&this.__createBinding||(Object.create?function(r,e,t,o){void 0===o&&(o=t),Object.defineProperty(r,o,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,o){r[o=void 0===o?t:o]=e[t]}),__exportStar=this&&this.__exportStar||function(r,e){for(var t in r)"default"===t||Object.prototype.hasOwnProperty.call(e,t)||__createBinding(e,r,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./DecodingError.js"),exports),__exportStar(require("./EncodingError.js"),exports),__exportStar(require("./GVLError.js"),exports),__exportStar(require("./TCModelError.js"),exports)},{"./DecodingError.js":26,"./EncodingError.js":27,"./GVLError.js":28,"./TCModelError.js":29}],31:[function(require,module,exports){var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t),Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,o){e[o=void 0===o?t:o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./encoder/index.js"),exports),__exportStar(require("./errors/index.js"),exports),__exportStar(require("./model/index.js"),exports),__exportStar(require("./Cloneable.js"),exports),__exportStar(require("./GVL.js"),exports),__exportStar(require("./Json.js"),exports),__exportStar(require("./TCModel.js"),exports),__exportStar(require("./TCString.js"),exports)},{"./Cloneable.js":1,"./GVL.js":2,"./Json.js":3,"./TCModel.js":4,"./TCString.js":5,"./encoder/index.js":21,"./errors/index.js":30,"./model/index.js":55}],32:[function(require,module,exports){var t,__extends=this&&this.__extends||(t=function(e,r){return(t=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}))(e,r)},function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)});Object.defineProperty(exports,"__esModule",{value:!0}),exports.BinarySearchTree=void 0;require=(t=>{function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.root=null,e}return __extends(e,t),e.prototype.getRoot=function(){return this.root},e.prototype.isEmpty=function(){return!this.root},e.prototype.add=function(t){var e,r={value:t,left:null,right:null};if(this.isEmpty())this.root=r;else for(e=this.root;;)if(te.value))break;if(null===e.right){e.right=r;break}e=e.right}},e.prototype.get=function(){for(var t=[],e=this.root;e;)if(e.left){for(var r=e.left;r.right&&r.right!=e;)r=r.right;e=r.right==e?(r.right=null,t.push(e.value),e.right):(r.right=e).left}else t.push(e.value),e=e.right;return t},e.prototype.contains=function(t){for(var e=!1,r=this.root;r;){if(r.value===t){e=!0;break}t>r.value?r=r.right:te.value?(e=(r=e).right,o="right"):(e.left||e.right?e.left?e.right?(i=this.min(e.right),this.remove(i,e.right),e.value=i):r?r[o]=e.left:this.root=e.left:r?r[o]=e.right:this.root=e.right:r?r[o]=null:this.root=null,e=null)},e.build=function(t){var r,o,i,l;return t&&0!==t.length?(1===t.length?(r=new e).add(t[0]):(o=t.length>>1,(r=new e).add(t[o]),(i=r.getRoot())&&(1+o{function t(t,r){var o=e.call(this)||this;return void 0!==t&&(o.purposeId=t),void 0!==r&&(o.restrictionType=r),o}return __extends(t,e),t.unHash=function(e){var r=e.split(this.hashSeparator),o=new t;if(2!==r.length)throw new index_js_1.TCModelError("hash",e);return o.purposeId=parseInt(r[0],10),o.restrictionType=parseInt(r[1],10),o},Object.defineProperty(t.prototype,"hash",{get:function(){if(this.isValid())return"".concat(this.purposeId).concat(t.hashSeparator).concat(this.restrictionType);throw new Error("cannot hash invalid PurposeRestriction")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"purposeId",{get:function(){return this.purposeId_},set:function(e){this.purposeId_=e},enumerable:!1,configurable:!0}),t.prototype.isValid=function(){return Number.isInteger(this.purposeId)&&0=e.length?void 0:e)&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},__read=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),s=[];try{for(;(void 0===t||0{function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.bitLength=0,t.map=new Map,t}return __extends(t,e),t.prototype.has=function(e){return this.map.has(e)},t.prototype.isOkToHave=function(e,t,r){var o,n=!0;if(null!=(o=this.gvl)&&o.vendors){var i=this.gvl.vendors[r];if(i)if(e===RestrictionType_js_1.RestrictionType.NOT_ALLOWED)n=i.legIntPurposes.includes(t)||i.purposes.includes(t);else if(i.flexiblePurposes.length)switch(e){case RestrictionType_js_1.RestrictionType.REQUIRE_CONSENT:n=i.flexiblePurposes.includes(t)&&i.legIntPurposes.includes(t);break;case RestrictionType_js_1.RestrictionType.REQUIRE_LI:n=i.flexiblePurposes.includes(t)&&i.purposes.includes(t)}else n=!1;else n=!1}return n},t.prototype.add=function(e,t){this.isOkToHave(t.restrictionType,t.purposeId,e)&&(t=t.hash,this.has(t)||(this.map.set(t,new BinarySearchTree_js_1.BinarySearchTree),this.bitLength=0),this.map.get(t).add(e))},t.prototype.restrictPurposeToLegalBasis=function(e){for(var t=this.gvl.vendorIds,r=e.hash,o=(()=>{var e,r,o;try{for(var n=__values(t),i=n.next();!i.done;i=n.next())o=i.value}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return o})(),n=__spreadArray([],__read(Array(o).keys()),!1).map(function(e){return e+1}),i=1;i<=o;i++)this.has(r)||(this.map.set(r,BinarySearchTree_js_1.BinarySearchTree.build(n)),this.bitLength=0),this.map.get(r).add(i)},t.prototype.getVendors=function(e){var o,t=[];return e?(e=e.hash,this.has(e)&&(t=this.map.get(e).get())):(o=new Set,this.map.forEach(function(e){e.get().forEach(function(e){o.add(e)})}),t=Array.from(o)),t},t.prototype.getRestrictionType=function(e,t){var r;return this.getRestrictions(e).forEach(function(e){e.purposeId===t&&(void 0===r||r>e.restrictionType)&&(r=e.restrictionType)}),r},t.prototype.vendorHasRestriction=function(e,t){for(var r=!1,o=this.getRestrictions(e),n=0;n{if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,(i=o?[2&i[0],o.value]:i)[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=0<(o=s.trys).length&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bitLength=0,e.maxId_=0,e.set_=new Set,e}return __extends(e,t),e.prototype[Symbol.iterator]=function(){var t;return __generator(this,function(e){switch(e.label){case 0:t=1,e.label=1;case 1:return t<=this.maxId?[4,[t,this.has(t)]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},e.prototype.values=function(){return this.set_.values()},Object.defineProperty(e.prototype,"maxId",{get:function(){return this.maxId_},enumerable:!1,configurable:!0}),e.prototype.has=function(t){return this.set_.has(t)},e.prototype.unset=function(t){var e=this;Array.isArray(t)?t.forEach(function(t){return e.unset(t)}):"object"==typeof t?this.unset(Object.keys(t).map(function(t){return Number(t)})):(this.set_.delete(Number(t)),this.bitLength=0,t===this.maxId&&(this.maxId_=0,this.set_.forEach(function(t){e.maxId_=Math.max(e.maxId,t)})))},e.prototype.isIntMap=function(t){var e=this,r="object"==typeof t;return r&&Object.keys(t).every(function(r){var n=Number.isInteger(parseInt(r,10));return(n=n&&e.isValidNumber(t[r].id))&&void 0!==t[r].name})},e.prototype.isValidNumber=function(t){return 0, or IntMap");this.set_.add(t),this.maxId_=Math.max(this.maxId,t),this.bitLength=0}},e.prototype.empty=function(){this.set_=new Set},e.prototype.forEach=function(t){for(var e=1;e<=this.maxId;e++)t(this.has(e),e)},Object.defineProperty(e.prototype,"size",{get:function(){return this.set_.size},enumerable:!1,configurable:!0}),e.prototype.setAll=function(t){this.set(t)},e})(Cloneable_js_1.Cloneable);exports.Vector=require},{"../Cloneable.js":1,"../errors/index.js":30}],45:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],46:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],47:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],48:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],49:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],50:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],51:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],52:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],53:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],54:[function(require,module,exports){var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t),Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,o){e[o=void 0===o?t:o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./ByPurposeVendorMap.js"),exports),__exportStar(require("./Declarations.js"),exports),__exportStar(require("./Feature.js"),exports),__exportStar(require("./GVLMapItem.js"),exports),__exportStar(require("./IDSetMap.js"),exports),__exportStar(require("./Purpose.js"),exports),__exportStar(require("./Stack.js"),exports),__exportStar(require("./Vendor.js"),exports),__exportStar(require("./VendorList.js"),exports)},{"./ByPurposeVendorMap.js":45,"./Declarations.js":46,"./Feature.js":47,"./GVLMapItem.js":48,"./IDSetMap.js":49,"./Purpose.js":50,"./Stack.js":51,"./Vendor.js":52,"./VendorList.js":53}],55:[function(require,module,exports){var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t),Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,o){e[o=void 0===o?t:o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./BinarySearchTree.js"),exports),__exportStar(require("./ConsentLanguages.js"),exports),__exportStar(require("./Fields.js"),exports),__exportStar(require("./IntMap.js"),exports),__exportStar(require("./KeyMap.js"),exports),__exportStar(require("./PurposeRestriction.js"),exports),__exportStar(require("./PurposeRestrictionVector.js"),exports),__exportStar(require("./DeviceDisclosureStorageAccessType.js"),exports),__exportStar(require("./DeviceDisclosure.js"),exports),__exportStar(require("./RestrictionType.js"),exports),__exportStar(require("./Segment.js"),exports),__exportStar(require("./SegmentIDs.js"),exports),__exportStar(require("./Vector.js"),exports),__exportStar(require("./gvl/index.js"),exports)},{"./BinarySearchTree.js":32,"./ConsentLanguages.js":33,"./DeviceDisclosure.js":34,"./DeviceDisclosureStorageAccessType.js":35,"./Fields.js":36,"./IntMap.js":37,"./KeyMap.js":38,"./PurposeRestriction.js":39,"./PurposeRestrictionVector.js":40,"./RestrictionType.js":41,"./Segment.js":42,"./SegmentIDs.js":43,"./Vector.js":44,"./gvl/index.js":54}],56:[function(require,module,exports){var TCString=require("@iabtcf/core").TCString;window.DEBUG=!0,window.sasCookieSync=window.sasCookieSync||((window,document)=>({protocol:(window.location.protocol||"").replace(":",""),cookies:{},qs:{},cmpObj:null,init:function(){this.cookies=this.parseCookies(document.cookie),this.qs=this.parseQueryString(window.location.search.slice(1))},parseQueryString:function(str){for(var a=str.split("&"),qs={},i=0;i