chefcookie 2.8.4 → 2.8.6

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
@@ -4,7 +4,21 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- #### [2.8.3](https://github.com/vielhuber/chefcookie/compare/2.8.3...2.8.3)
7
+ #### [2.8.5](https://github.com/vielhuber/chefcookie/compare/2.8.5...2.8.5)
8
+
9
+ #### [2.8.5](https://github.com/vielhuber/chefcookie/compare/2.8.4...2.8.5)
10
+
11
+ > 27 September 2023
12
+
13
+ - Upgrade linkedin insights tag. [`6b82e0e`](https://github.com/vielhuber/chefcookie/commit/6b82e0ef84c95655066c1bc9e0b8b2b2759bad1b)
14
+ - Update changelog. [`d5e6443`](https://github.com/vielhuber/chefcookie/commit/d5e64438acbb2aef9efc08014e345ae8aa17794b)
15
+
16
+ #### [2.8.4](https://github.com/vielhuber/chefcookie/compare/2.8.3...2.8.4)
17
+
18
+ > 14 September 2023
19
+
20
+ - Add bypass_parameter option. [`cb3c72f`](https://github.com/vielhuber/chefcookie/commit/cb3c72f1feb6a1837ba963ccce7c2d5d3c2c0be7)
21
+ - Update changelog. [`19180a4`](https://github.com/vielhuber/chefcookie/commit/19180a4ba5da39762408fbcb9a1d6b0e79d25f1e)
8
22
 
9
23
  #### [2.8.3](https://github.com/vielhuber/chefcookie/compare/2.8.2...2.8.3)
10
24
 
package/README.md CHANGED
@@ -440,6 +440,7 @@ here you can also use the following code:
440
440
  you can programmatically control chefcookie via javascript:
441
441
 
442
442
  - `cc.open()`: open the cookie banner manually
443
+ - `cc.openWithSettings()`: open the cookie banner including settings manually
443
444
  - `cc.isOpen()`: check if cookie banner is opened
444
445
  - `cc.close()`: close the cookie banner manually
445
446
  - `cc.isClosed()`: check if cookie banner is closed
package/_build/script.js CHANGED
@@ -101,6 +101,16 @@ var chefcookie = /*#__PURE__*/function () {
101
101
  this.fixMaxHeight();
102
102
  this.logTracking('open');
103
103
  }
104
+ }, {
105
+ key: "openWithSettings",
106
+ value: function openWithSettings() {
107
+ var _this2 = this;
108
+ this.open();
109
+ setTimeout(function () {
110
+ _this2.showSettings();
111
+ _this2.switchSettingsLabelsOpen();
112
+ }, this.animationSpeed);
113
+ }
104
114
  }, {
105
115
  key: "close",
106
116
  value: function close() {
@@ -154,7 +164,7 @@ var chefcookie = /*#__PURE__*/function () {
154
164
  }, {
155
165
  key: "animationIn",
156
166
  value: function animationIn() {
157
- var _this2 = this;
167
+ var _this3 = this;
158
168
  document.querySelector('.chefcookie__inner').style.overflowY = 'hidden';
159
169
  if (this.config.style.layout === 'topbar') {
160
170
  document.querySelector('.chefcookie').style.marginTop = -1 * document.querySelector('.chefcookie').offsetHeight + 'px';
@@ -167,22 +177,22 @@ var chefcookie = /*#__PURE__*/function () {
167
177
  }
168
178
  requestAnimationFrame(function () {
169
179
  setTimeout(function () {
170
- document.querySelector('.chefcookie').style.transition = 'opacity ' + _this2.animationSpeed / 1000 + 's ease-in-out, margin ' + _this2.animationSpeed / 1000 + 's ease-in-out';
171
- document.querySelector('.chefcookie__box').style.transition = 'transform ' + _this2.animationSpeed / 1000 + 's ease-in-out';
180
+ document.querySelector('.chefcookie').style.transition = 'opacity ' + _this3.animationSpeed / 1000 + 's ease-in-out, margin ' + _this3.animationSpeed / 1000 + 's ease-in-out';
181
+ document.querySelector('.chefcookie__box').style.transition = 'transform ' + _this3.animationSpeed / 1000 + 's ease-in-out';
172
182
  document.querySelector('.chefcookie').classList.remove('chefcookie--hidden');
173
- if (_this2.config.style.layout === 'topbar') {
183
+ if (_this3.config.style.layout === 'topbar') {
174
184
  document.querySelector('.chefcookie').style.marginTop = 0 + 'px';
175
185
  }
176
- if (_this2.config.style.layout === 'bottombar') {
186
+ if (_this3.config.style.layout === 'bottombar') {
177
187
  document.querySelector('.chefcookie').style.marginBottom = 0 + 'px';
178
188
  }
179
- if (_this2.config.style.layout === 'overlay') {
189
+ if (_this3.config.style.layout === 'overlay') {
180
190
  document.querySelector('.chefcookie__box').style.transform = 'none';
181
191
  }
182
192
  requestAnimationFrame(function () {
183
193
  setTimeout(function () {
184
194
  document.querySelector('.chefcookie__inner').style.overflowY = 'auto';
185
- }, _this2.animationSpeed + 30);
195
+ }, _this3.animationSpeed + 30);
186
196
  });
187
197
  }, 30);
188
198
  });
@@ -236,17 +246,17 @@ var chefcookie = /*#__PURE__*/function () {
236
246
  }, {
237
247
  key: "bindOptOutOptIn",
238
248
  value: function bindOptOutOptIn() {
239
- var _this3 = this;
249
+ var _this4 = this;
240
250
  // bind opt out
241
251
  this.registerEventListener(document, 'click', function (e) {
242
252
  if (e.target.hasAttribute('data-cc-disable') || e.target.tagName !== 'A' && e.target.closest('[data-cc-disable]')) {
243
253
  var el = e.target.closest('[data-cc-disable]');
244
- if (!_this3.isAccepted(el.getAttribute('data-cc-disable'))) {
245
- _this3.accept(el.getAttribute('data-cc-disable'), true);
254
+ if (!_this4.isAccepted(el.getAttribute('data-cc-disable'))) {
255
+ _this4.accept(el.getAttribute('data-cc-disable'), true);
246
256
  } else {
247
- _this3.decline(el.getAttribute('data-cc-disable'), true);
257
+ _this4.decline(el.getAttribute('data-cc-disable'), true);
248
258
  }
249
- _this3.updateOptOutOptIn();
259
+ _this4.updateOptOutOptIn();
250
260
  e.preventDefault();
251
261
  }
252
262
  });
@@ -255,10 +265,10 @@ var chefcookie = /*#__PURE__*/function () {
255
265
  this.registerEventListener(document, 'click', function (e) {
256
266
  if (e.target.hasAttribute('data-cc-enable') || e.target.tagName !== 'A' && e.target.closest('[data-cc-enable]')) {
257
267
  var el = e.target.closest('[data-cc-enable]');
258
- if (!_this3.isAccepted(el.getAttribute('data-cc-enable'))) {
259
- _this3.accept(el.getAttribute('data-cc-enable'), true);
268
+ if (!_this4.isAccepted(el.getAttribute('data-cc-enable'))) {
269
+ _this4.accept(el.getAttribute('data-cc-enable'), true);
260
270
  }
261
- _this3.updateOptOutOptIn();
271
+ _this4.updateOptOutOptIn();
262
272
  e.preventDefault();
263
273
  }
264
274
  });
@@ -266,7 +276,7 @@ var chefcookie = /*#__PURE__*/function () {
266
276
  // bind open
267
277
  this.registerEventListener(document, 'click', function (e) {
268
278
  if (e.target.hasAttribute('data-cc-open') || e.target.tagName !== 'A' && e.target.closest('[data-cc-open]')) {
269
- _this3.open();
279
+ _this4.open();
270
280
  e.preventDefault();
271
281
  }
272
282
  });
@@ -274,7 +284,7 @@ var chefcookie = /*#__PURE__*/function () {
274
284
  }, {
275
285
  key: "updateOptOutOptIn",
276
286
  value: function updateOptOutOptIn() {
277
- var _this4 = this;
287
+ var _this5 = this;
278
288
  // legacy: support old attribute names
279
289
  if (document.querySelector('[data-disable]') !== null) {
280
290
  [].forEach.call(document.querySelectorAll('[data-disable]'), function (el) {
@@ -303,7 +313,7 @@ var chefcookie = /*#__PURE__*/function () {
303
313
  // update opt out
304
314
  if (document.querySelector('[data-cc-disable]') !== null) {
305
315
  [].forEach.call(document.querySelectorAll('[data-cc-disable]'), function (el) {
306
- if (_this4.isAccepted(el.getAttribute('data-cc-disable'))) {
316
+ if (_this5.isAccepted(el.getAttribute('data-cc-disable'))) {
307
317
  el.textContent = el.getAttribute('data-cc-message-original');
308
318
  el.classList.remove('disabled');
309
319
  } else {
@@ -316,7 +326,7 @@ var chefcookie = /*#__PURE__*/function () {
316
326
  // update opt in
317
327
  if (document.querySelector('[data-cc-enable]') !== null) {
318
328
  [].forEach.call(document.querySelectorAll('[data-cc-enable]'), function (el) {
319
- if (_this4.isAccepted(el.getAttribute('data-cc-enable'))) {
329
+ if (_this5.isAccepted(el.getAttribute('data-cc-enable'))) {
320
330
  el.remove();
321
331
  }
322
332
  });
@@ -376,10 +386,10 @@ var chefcookie = /*#__PURE__*/function () {
376
386
  }, {
377
387
  key: "buildDom",
378
388
  value: function buildDom() {
379
- var _this5 = this;
389
+ var _this6 = this;
380
390
  document.body.insertAdjacentHTML('afterbegin', "\n <div class=\"chefcookie chefcookie--".concat(this.config.style.layout, " chefcookie--columns-").concat('columns' in this.config.style ? this.config.style.columns : 'auto').concat('scripts_selection' in this.config && this.config.scripts_selection !== false ? " chefcookie--has-scripts" : "", " chefcookie--hidden\">\n <div class=\"chefcookie__inner\">\n <div class=\"chefcookie__box\">\n <div class=\"chefcookie__message\">").concat(this.translate(this.config.message), "</div>\n <div class=\"chefcookie__settings-container\">\n <ul class=\"chefcookie__groups chefcookie__groups--count-").concat(this.config.settings.length, "\">\n ").concat(this.config.settings.map(function (group, i) {
381
- return "\n <li class=\"chefcookie__group".concat(group.cannot_be_modified ? " chefcookie__group--disabled" : "", "\">\n <label class=\"chefcookie__group-label\" for=\"chefcookie_group_").concat(i, "\">\n <input").concat(group.cannot_be_modified ? " disabled=\"disabled\"" : "", " class=\"chefcookie__group-checkbox\" data-status=\"").concat(_this5.isCheckboxActiveForGroup(i), "\" id=\"chefcookie_group_").concat(i, "\" type=\"checkbox\" name=\"chefcookie_group[]\" value=\"").concat(i, "\"").concat(_this5.isCheckboxActiveForGroup(i) === 2 ? " checked=\"checked\"" : "", " />\n <span class=\"chefcookie__group-title\">").concat(_this5.translate(group.title), "</span>\n <span class=\"chefcookie__group-checkbox-icon\"></span>\n ").concat('description' in group && group.description != '' ? "\n <span class=\"chefcookie__group-description\">".concat(_this5.translate(group.description), "</span>\n ") : "", "\n ").concat('scripts_selection' in _this5.config && _this5.config.scripts_selection === 'collapse' && 'scripts' in group && Object.keys(group.scripts).length > 0 && Object.keys(group.scripts)[0].indexOf('dummy_') === -1 ? "\n <a href=\"#\" class=\"chefcookie__group-collapse\">".concat(_this5.getLabel('group_open') != '' ? _this5.getLabel('group_open') : _this5.getLabel('settings_open'), "</a>\n ") : "", "\n </label>\n ").concat('scripts_selection' in _this5.config && _this5.config.scripts_selection !== false && 'scripts' in group && Object.keys(group.scripts).length > 0 && Object.keys(group.scripts)[0].indexOf('dummy_') === -1 ? "\n <ul class=\"chefcookie__scripts chefcookie__scripts--count-".concat(Object.keys(group.scripts).length).concat(_this5.config.scripts_selection !== 'collapse' ? " chefcookie__scripts--visible" : "", "\">\n ").concat(Object.keys(group.scripts).map(function (j) {
382
- return "\n <li class=\"chefcookie__script".concat(group.cannot_be_modified ? " chefcookie__script--disabled" : "", "\">\n <label class=\"chefcookie__script-label\" for=\"chefcookie_script_").concat(i, "_").concat(j, "\">\n <input").concat(group.cannot_be_modified ? " disabled=\"disabled\"" : "", " class=\"chefcookie__script-checkbox\" id=\"chefcookie_script_").concat(i, "_").concat(j, "\" type=\"checkbox\" name=\"chefcookie_script[]\" value=\"").concat(i, "|").concat(j, "\"").concat(_this5.isCheckboxActiveForProvider(i, j) ? " checked=\"checked\"" : "", " />\n <span class=\"chefcookie__script-title\">").concat((0, _typeof2.default)(group.scripts[j]) === 'object' && group.scripts[j] !== null && 'title' in group.scripts[j] && group.scripts[j].title != '' ? _this5.translate(group.scripts[j].title) : j, "</span>\n <span class=\"chefcookie__script-checkbox-icon\"></span>\n </label>\n ").concat((0, _typeof2.default)(group.scripts[j]) === 'object' && group.scripts[j] !== null && 'description' in group.scripts[j] && group.scripts[j].description != '' ? '<div class="chefcookie__script-description">' + '<a href="#" class="chefcookie__script-description-collapse">' + _this5.getLabel('details_open') + '</a>' + '<div class="chefcookie__script-description-content">' + _this5.translate(group.scripts[j].description) + '</div>' + '</div>' : '', "\n </li>\n ");
391
+ return "\n <li class=\"chefcookie__group".concat(group.cannot_be_modified ? " chefcookie__group--disabled" : "", "\">\n <label class=\"chefcookie__group-label\" for=\"chefcookie_group_").concat(i, "\">\n <input").concat(group.cannot_be_modified ? " disabled=\"disabled\"" : "", " class=\"chefcookie__group-checkbox\" data-status=\"").concat(_this6.isCheckboxActiveForGroup(i), "\" id=\"chefcookie_group_").concat(i, "\" type=\"checkbox\" name=\"chefcookie_group[]\" value=\"").concat(i, "\"").concat(_this6.isCheckboxActiveForGroup(i) === 2 ? " checked=\"checked\"" : "", " />\n <span class=\"chefcookie__group-title\">").concat(_this6.translate(group.title), "</span>\n <span class=\"chefcookie__group-checkbox-icon\"></span>\n ").concat('description' in group && group.description != '' ? "\n <span class=\"chefcookie__group-description\">".concat(_this6.translate(group.description), "</span>\n ") : "", "\n ").concat('scripts_selection' in _this6.config && _this6.config.scripts_selection === 'collapse' && 'scripts' in group && Object.keys(group.scripts).length > 0 && Object.keys(group.scripts)[0].indexOf('dummy_') === -1 ? "\n <a href=\"#\" class=\"chefcookie__group-collapse\">".concat(_this6.getLabel('group_open') != '' ? _this6.getLabel('group_open') : _this6.getLabel('settings_open'), "</a>\n ") : "", "\n </label>\n ").concat('scripts_selection' in _this6.config && _this6.config.scripts_selection !== false && 'scripts' in group && Object.keys(group.scripts).length > 0 && Object.keys(group.scripts)[0].indexOf('dummy_') === -1 ? "\n <ul class=\"chefcookie__scripts chefcookie__scripts--count-".concat(Object.keys(group.scripts).length).concat(_this6.config.scripts_selection !== 'collapse' ? " chefcookie__scripts--visible" : "", "\">\n ").concat(Object.keys(group.scripts).map(function (j) {
392
+ return "\n <li class=\"chefcookie__script".concat(group.cannot_be_modified ? " chefcookie__script--disabled" : "", "\">\n <label class=\"chefcookie__script-label\" for=\"chefcookie_script_").concat(i, "_").concat(j, "\">\n <input").concat(group.cannot_be_modified ? " disabled=\"disabled\"" : "", " class=\"chefcookie__script-checkbox\" id=\"chefcookie_script_").concat(i, "_").concat(j, "\" type=\"checkbox\" name=\"chefcookie_script[]\" value=\"").concat(i, "|").concat(j, "\"").concat(_this6.isCheckboxActiveForProvider(i, j) ? " checked=\"checked\"" : "", " />\n <span class=\"chefcookie__script-title\">").concat((0, _typeof2.default)(group.scripts[j]) === 'object' && group.scripts[j] !== null && 'title' in group.scripts[j] && group.scripts[j].title != '' ? _this6.translate(group.scripts[j].title) : j, "</span>\n <span class=\"chefcookie__script-checkbox-icon\"></span>\n </label>\n ").concat((0, _typeof2.default)(group.scripts[j]) === 'object' && group.scripts[j] !== null && 'description' in group.scripts[j] && group.scripts[j].description != '' ? '<div class="chefcookie__script-description">' + '<a href="#" class="chefcookie__script-description-collapse">' + _this6.getLabel('details_open') + '</a>' + '<div class="chefcookie__script-description-content">' + _this6.translate(group.scripts[j].description) + '</div>' + '</div>' : '', "\n </li>\n ");
383
393
  }).join(''), "\n </ul>\n ") : "", "\n </li>\n ");
384
394
  }).join(''), "\n </ul>\n </div>\n <div class=\"chefcookie__buttons chefcookie__buttons--count-").concat('show_decline_button' in this.config && this.config.show_decline_button === true ? '3' : '2', "\">\n <a href=\"#chefcookie__settings\" class=\"chefcookie__button chefcookie__button--settings\">").concat(this.getLabel('settings_open'), "</a>\n <a href=\"#chefcookie__accept\" class=\"chefcookie__button chefcookie__button--accept cookie-compliance-ok-btn\">").concat(this.getLabel(this.config.accept_all_if_settings_closed === undefined || this.config.accept_all_if_settings_closed === false ? 'accept' : 'accept_all'), "</a>\n ").concat('show_decline_button' in this.config && this.config.show_decline_button === true ? "\n <a href=\"#chefcookie__decline\" class=\"chefcookie__button chefcookie__button--decline\">".concat(this.getLabel('decline'), "</a>\n ") : '', "\n </div>\n </div>\n </div>\n </div>\n "));
385
395
  }
@@ -394,49 +404,49 @@ var chefcookie = /*#__PURE__*/function () {
394
404
  }, {
395
405
  key: "bindButtons",
396
406
  value: function bindButtons() {
397
- var _this6 = this;
407
+ var _this7 = this;
398
408
  if (document.querySelector('a[href="#chefcookie__decline"]') !== null) {
399
409
  [].forEach.call(document.querySelectorAll('a[href="#chefcookie__decline"]'), function (el) {
400
- _this6.registerEventListener(el, 'click', function (e) {
401
- _this6.logTracking('decline');
402
- _this6.uncheckAllOptIns();
403
- _this6.saveInCookie();
404
- _this6.close();
405
- _this6.setCookieToHideOverlay();
406
- _this6.updateOptOutOptIn();
410
+ _this7.registerEventListener(el, 'click', function (e) {
411
+ _this7.logTracking('decline');
412
+ _this7.uncheckAllOptIns();
413
+ _this7.saveInCookie();
414
+ _this7.close();
415
+ _this7.setCookieToHideOverlay();
416
+ _this7.updateOptOutOptIn();
407
417
  e.preventDefault();
408
418
  });
409
419
  });
410
420
  }
411
421
  if (document.querySelector('a[href="#chefcookie__accept"]') !== null) {
412
422
  [].forEach.call(document.querySelectorAll('a[href="#chefcookie__accept"]'), function (el) {
413
- _this6.registerEventListener(el, 'click', function (e) {
414
- if (_this6.isOpened === false) {
423
+ _this7.registerEventListener(el, 'click', function (e) {
424
+ if (_this7.isOpened === false) {
415
425
  return;
416
426
  }
417
- if (!('accept_all_if_settings_closed' in _this6.config) || _this6.config.accept_all_if_settings_closed === true) {
418
- if (!_this6.settingsVisible()) {
419
- _this6.checkAllOptIns();
427
+ if (!('accept_all_if_settings_closed' in _this7.config) || _this7.config.accept_all_if_settings_closed === true) {
428
+ if (!_this7.settingsVisible()) {
429
+ _this7.checkAllOptIns();
420
430
  }
421
431
  }
422
- _this6.saveInCookie();
423
- _this6.addEnabledScripts(true);
424
- _this6.close();
425
- _this6.setCookieToHideOverlay();
426
- _this6.updateOptOutOptIn();
432
+ _this7.saveInCookie();
433
+ _this7.addEnabledScripts(true);
434
+ _this7.close();
435
+ _this7.setCookieToHideOverlay();
436
+ _this7.updateOptOutOptIn();
427
437
  e.preventDefault();
428
438
  });
429
439
  });
430
440
  }
431
441
  if (document.querySelector('a[href="#chefcookie__settings"]') !== null) {
432
442
  [].forEach.call(document.querySelectorAll('a[href="#chefcookie__settings"]'), function (el) {
433
- _this6.registerEventListener(el, 'click', function (e) {
434
- if (!_this6.settingsVisible()) {
435
- _this6.showSettings();
436
- _this6.switchSettingsLabelsOpen();
443
+ _this7.registerEventListener(el, 'click', function (e) {
444
+ if (!_this7.settingsVisible()) {
445
+ _this7.showSettings();
446
+ _this7.switchSettingsLabelsOpen();
437
447
  } else {
438
- _this6.hideSettings();
439
- _this6.switchSettingsLabelsClose();
448
+ _this7.hideSettings();
449
+ _this7.switchSettingsLabelsClose();
440
450
  }
441
451
  e.preventDefault();
442
452
  });
@@ -444,7 +454,7 @@ var chefcookie = /*#__PURE__*/function () {
444
454
  }
445
455
  if (document.querySelector('.chefcookie__script-checkbox') !== null) {
446
456
  [].forEach.call(document.querySelectorAll('.chefcookie__script-checkbox'), function (el) {
447
- _this6.registerEventListener(el, 'change', function (e) {
457
+ _this7.registerEventListener(el, 'change', function (e) {
448
458
  var group_checkbox = el.closest('.chefcookie__group').querySelector('.chefcookie__group-checkbox'),
449
459
  c1 = el.closest('.chefcookie__group').querySelectorAll('.chefcookie__script-checkbox:checked').length,
450
460
  c2 = el.closest('.chefcookie__group').querySelectorAll('.chefcookie__script-checkbox').length;
@@ -461,7 +471,7 @@ var chefcookie = /*#__PURE__*/function () {
461
471
  }
462
472
  if (document.querySelector('.chefcookie__group-checkbox') !== null) {
463
473
  [].forEach.call(document.querySelectorAll('.chefcookie__group-checkbox'), function (el) {
464
- _this6.registerEventListener(el, 'change', function (e) {
474
+ _this7.registerEventListener(el, 'change', function (e) {
465
475
  el.setAttribute('data-status', el.checked ? 2 : 0);
466
476
  if (el.closest('.chefcookie__group').querySelector('.chefcookie__script-checkbox') !== null) {
467
477
  [].forEach.call(el.closest('.chefcookie__group').querySelectorAll('.chefcookie__script-checkbox'), function (el2) {
@@ -474,14 +484,14 @@ var chefcookie = /*#__PURE__*/function () {
474
484
  }
475
485
  if (document.querySelector('.chefcookie__group-collapse') !== null) {
476
486
  [].forEach.call(document.querySelectorAll('.chefcookie__group-collapse'), function (el) {
477
- _this6.registerEventListener(el, 'click', function (e) {
487
+ _this7.registerEventListener(el, 'click', function (e) {
478
488
  var group = el.closest('.chefcookie__group');
479
- if (!_this6.scriptsVisible(group)) {
480
- _this6.showScripts(group);
481
- _this6.switchScriptsLabelsOpen(group);
489
+ if (!_this7.scriptsVisible(group)) {
490
+ _this7.showScripts(group);
491
+ _this7.switchScriptsLabelsOpen(group);
482
492
  } else {
483
- _this6.hideScripts(group);
484
- _this6.switchScriptsLabelsClose(group);
493
+ _this7.hideScripts(group);
494
+ _this7.switchScriptsLabelsClose(group);
485
495
  }
486
496
  e.preventDefault();
487
497
  });
@@ -489,14 +499,14 @@ var chefcookie = /*#__PURE__*/function () {
489
499
  }
490
500
  if (document.querySelector('.chefcookie__script-description-collapse') !== null) {
491
501
  [].forEach.call(document.querySelectorAll('.chefcookie__script-description-collapse'), function (el) {
492
- _this6.registerEventListener(el, 'click', function (e) {
502
+ _this7.registerEventListener(el, 'click', function (e) {
493
503
  var desc = el.closest('.chefcookie__script-description');
494
- if (!_this6.scriptDescriptionVisible(desc)) {
495
- _this6.showScriptDescription(desc);
496
- _this6.switchScriptDescriptionLabelsOpen(desc);
504
+ if (!_this7.scriptDescriptionVisible(desc)) {
505
+ _this7.showScriptDescription(desc);
506
+ _this7.switchScriptDescriptionLabelsOpen(desc);
497
507
  } else {
498
- _this6.hideScriptDescription(desc);
499
- _this6.switchScriptDescriptionLabelsClose(desc);
508
+ _this7.hideScriptDescription(desc);
509
+ _this7.switchScriptDescriptionLabelsClose(desc);
500
510
  }
501
511
  e.preventDefault();
502
512
  });
@@ -593,7 +603,7 @@ var chefcookie = /*#__PURE__*/function () {
593
603
  }, {
594
604
  key: "isCheckboxActiveForGroup",
595
605
  value: function isCheckboxActiveForGroup(group_index) {
596
- var _this7 = this;
606
+ var _this8 = this;
597
607
  var group;
598
608
  if (this.config.settings[group_index] !== undefined) {
599
609
  group = this.config.settings[group_index];
@@ -604,10 +614,10 @@ var chefcookie = /*#__PURE__*/function () {
604
614
  var group_accepted = true,
605
615
  group_partly_accepted = false;
606
616
  Object.keys(group.scripts).forEach(function (provider) {
607
- if (!_this7.isAccepted(provider)) {
617
+ if (!_this8.isAccepted(provider)) {
608
618
  group_accepted = false;
609
619
  }
610
- if (_this7.isAccepted(provider)) {
620
+ if (_this8.isAccepted(provider)) {
611
621
  group_partly_accepted = true;
612
622
  }
613
623
  });
@@ -652,13 +662,13 @@ var chefcookie = /*#__PURE__*/function () {
652
662
  }, {
653
663
  key: "saveInCookie",
654
664
  value: function saveInCookie() {
655
- var _this8 = this;
665
+ var _this9 = this;
656
666
  var providers = [];
657
667
  [].forEach.call(document.querySelectorAll('.chefcookie__group-checkbox'), function (el) {
658
668
  if (el.closest('.chefcookie__group').querySelector('.chefcookie__script-checkbox') === null) {
659
669
  if (el.checked === true) {
660
- if (_this8.config.settings[el.value].scripts !== undefined) {
661
- Object.entries(_this8.config.settings[el.value].scripts).forEach(function (_ref2) {
670
+ if (_this9.config.settings[el.value].scripts !== undefined) {
671
+ Object.entries(_this9.config.settings[el.value].scripts).forEach(function (_ref2) {
662
672
  var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
663
673
  scripts__key = _ref3[0],
664
674
  scripts__value = _ref3[1];
@@ -669,7 +679,7 @@ var chefcookie = /*#__PURE__*/function () {
669
679
  } else {
670
680
  [].forEach.call(el.closest('.chefcookie__group').querySelectorAll('.chefcookie__script-checkbox'), function (el2) {
671
681
  if (el2.checked === true) {
672
- if (_this8.config.settings[el2.value.split('|')[0]].scripts[el2.value.split('|')[1]] !== undefined) {
682
+ if (_this9.config.settings[el2.value.split('|')[0]].scripts[el2.value.split('|')[1]] !== undefined) {
673
683
  providers.push(el2.value.split('|')[1]);
674
684
  }
675
685
  }
@@ -715,7 +725,7 @@ var chefcookie = /*#__PURE__*/function () {
715
725
  }, {
716
726
  key: "addEnabledScripts",
717
727
  value: function addEnabledScripts() {
718
- var _this9 = this;
728
+ var _this10 = this;
719
729
  var isInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
720
730
  if (this.getCookie('accepted_providers') === undefined) {
721
731
  return;
@@ -735,7 +745,7 @@ var chefcookie = /*#__PURE__*/function () {
735
745
  accept_all = false;
736
746
  return;
737
747
  }
738
- _this9.load(scripts__key, scripts__value, isInit);
748
+ _this10.load(scripts__key, scripts__value, isInit);
739
749
  });
740
750
  }
741
751
  });
@@ -746,7 +756,7 @@ var chefcookie = /*#__PURE__*/function () {
746
756
  }, {
747
757
  key: "addScript",
748
758
  value: function addScript(provider) {
749
- var _this10 = this;
759
+ var _this11 = this;
750
760
  var isInit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
751
761
  if (this.getCookie('accepted_providers') === undefined) {
752
762
  return;
@@ -767,7 +777,7 @@ var chefcookie = /*#__PURE__*/function () {
767
777
  if (settings.indexOf(scripts__key) === -1) {
768
778
  return;
769
779
  }
770
- _this10.load(scripts__key, scripts__value, isInit);
780
+ _this11.load(scripts__key, scripts__value, isInit);
771
781
  });
772
782
  }
773
783
  });
@@ -775,14 +785,14 @@ var chefcookie = /*#__PURE__*/function () {
775
785
  }, {
776
786
  key: "autoAcceptBasicScripts",
777
787
  value: function autoAcceptBasicScripts() {
778
- var _this11 = this;
788
+ var _this12 = this;
779
789
  this.config.settings.forEach(function (settings__value) {
780
790
  if (settings__value.scripts !== undefined && settings__value.initial_tracking === true) {
781
791
  Object.entries(settings__value.scripts).forEach(function (_ref8) {
782
792
  var _ref9 = (0, _slicedToArray2.default)(_ref8, 2),
783
793
  scripts__key = _ref9[0],
784
794
  scripts__value = _ref9[1];
785
- _this11.accept(scripts__key, false);
795
+ _this12.accept(scripts__key, false);
786
796
  });
787
797
  }
788
798
  });
@@ -790,7 +800,7 @@ var chefcookie = /*#__PURE__*/function () {
790
800
  }, {
791
801
  key: "autoAcceptAllScripts",
792
802
  value: function autoAcceptAllScripts() {
793
- var _this12 = this;
803
+ var _this13 = this;
794
804
  var providers = [];
795
805
  this.config.settings.forEach(function (settings__value) {
796
806
  if (settings__value.scripts !== undefined) {
@@ -798,7 +808,7 @@ var chefcookie = /*#__PURE__*/function () {
798
808
  var _ref11 = (0, _slicedToArray2.default)(_ref10, 2),
799
809
  scripts__key = _ref11[0],
800
810
  scripts__value = _ref11[1];
801
- _this12.accept(scripts__key, false);
811
+ _this13.accept(scripts__key, false);
802
812
  });
803
813
  }
804
814
  });
@@ -806,7 +816,7 @@ var chefcookie = /*#__PURE__*/function () {
806
816
  }, {
807
817
  key: "load",
808
818
  value: function load(provider, id) {
809
- var _this13 = this;
819
+ var _this14 = this;
810
820
  var isInit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
811
821
  if (this.isLoaded(provider)) {
812
822
  return;
@@ -824,9 +834,9 @@ var chefcookie = /*#__PURE__*/function () {
824
834
  this.loadAuto(provider, id.id);
825
835
  } else if ((0, _typeof2.default)(id) === 'object' && id !== null && 'accept' in id && typeof id.accept === 'function') {
826
836
  new Promise(function (resolve) {
827
- id.accept(_this13, resolve, isInit);
837
+ id.accept(_this14, resolve, isInit);
828
838
  }).then(function () {
829
- _this13.setLoaded(provider);
839
+ _this14.setLoaded(provider);
830
840
  });
831
841
  } else {
832
842
  this.setLoaded(provider);
@@ -836,11 +846,11 @@ var chefcookie = /*#__PURE__*/function () {
836
846
  }, {
837
847
  key: "loadAuto",
838
848
  value: function loadAuto(provider, id) {
839
- var _this14 = this;
849
+ var _this15 = this;
840
850
  if (provider === 'analytics' || provider === 'google') {
841
851
  var script = document.createElement('script');
842
852
  script.onload = function () {
843
- _this14.setLoaded(provider);
853
+ _this15.setLoaded(provider);
844
854
  };
845
855
  script.src = 'https://www.googletagmanager.com/gtag/js?id=' + id;
846
856
  document.head.appendChild(script);
@@ -868,7 +878,7 @@ var chefcookie = /*#__PURE__*/function () {
868
878
  if (provider === 'twitter') {
869
879
  var _script3 = document.createElement('script');
870
880
  _script3.onload = function () {
871
- _this14.setLoaded(provider);
881
+ _this15.setLoaded(provider);
872
882
  };
873
883
  _script3.src = '//platform.twitter.com/oct.js';
874
884
  document.head.appendChild(_script3);
@@ -882,7 +892,7 @@ var chefcookie = /*#__PURE__*/function () {
882
892
  if (provider === 'match2one') {
883
893
  var _script5 = document.createElement('script');
884
894
  _script5.onload = function () {
885
- _this14.setLoaded(provider);
895
+ _this15.setLoaded(provider);
886
896
  };
887
897
  _script5.src = 'https://secure.adnxs.com/seg?add=' + id + '&t=1';
888
898
  document.head.appendChild(_script5);
@@ -901,7 +911,7 @@ var chefcookie = /*#__PURE__*/function () {
901
911
  _script7.innerHTML = "\n _linkedin_partner_id = \"".concat(id, "\";\n window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];\n window._linkedin_data_partner_ids.push(_linkedin_partner_id);\n ");
902
912
  document.body.appendChild(_script7);
903
913
  _script7 = document.createElement('script');
904
- _script7.innerHTML = "\n (function(){var s = document.getElementsByTagName(\"script\")[0];\n var b = document.createElement(\"script\");\n b.type = \"text/javascript\";b.async = true;\n b.src = \"https://snap.licdn.com/li.lms-analytics/insight.min.js\";\n s.parentNode.insertBefore(b, s);})();\n ";
914
+ _script7.innerHTML = "\n (function(l) {if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])};\n window.lintrk.q=[]}\n var s = document.getElementsByTagName(\"script\")[0];\n var b = document.createElement(\"script\");\n b.type = \"text/javascript\";b.async = true;\n b.src = \"https://snap.licdn.com/li.lms-analytics/insight.min.js\";\n s.parentNode.insertBefore(b, s);})(window.lintrk);\n ";
905
915
  document.body.appendChild(_script7);
906
916
  _script7 = document.createElement('noscript');
907
917
  _script7.innerHTML = "\n <img height=\"1\" width=\"1\" style=\"display:none;\" alt=\"\" src=\"https://px.ads.linkedin.com/collect/?pid=".concat(id, "&fmt=gif\" />\n ");
@@ -917,7 +927,7 @@ var chefcookie = /*#__PURE__*/function () {
917
927
  if (provider === 'crazyegg') {
918
928
  var _script9 = document.createElement('script');
919
929
  _script9.onload = function () {
920
- _this14.setLoaded(provider);
930
+ _this15.setLoaded(provider);
921
931
  };
922
932
  _script9.src = '//script.crazyegg.com/pages/scripts/' + id + '.js';
923
933
  document.head.appendChild(_script9);
@@ -928,7 +938,7 @@ var chefcookie = /*#__PURE__*/function () {
928
938
  _script10.defer = true;
929
939
  _script10.async = true;
930
940
  window.initMapCC = function () {
931
- _this14.setLoaded(provider);
941
+ _this15.setLoaded(provider);
932
942
  };
933
943
  document.head.appendChild(_script10);
934
944
  }
@@ -939,7 +949,7 @@ var chefcookie = /*#__PURE__*/function () {
939
949
  document.head.appendChild(_script11);
940
950
  _script11 = document.createElement('script');
941
951
  _script11.onload = function () {
942
- _this14.setLoaded(provider);
952
+ _this15.setLoaded(provider);
943
953
  };
944
954
  _script11.id = '_etLoader';
945
955
  _script11.type = 'text/javascript';
@@ -1174,16 +1184,16 @@ var chefcookie = /*#__PURE__*/function () {
1174
1184
  }, {
1175
1185
  key: "trackScrollDepth",
1176
1186
  value: function trackScrollDepth() {
1177
- var _this15 = this;
1187
+ var _this16 = this;
1178
1188
  this.eventAnalytics('scroll_depth', '0%');
1179
1189
  this.eventEtracker('scroll_depth', '0%');
1180
1190
  this.registerEventListener(window, 'scroll', function () {
1181
- var scroll = _this15.scrollPos();
1182
- for (var scrollDepthTriggered__key in _this15.scrollDepthTriggered) {
1183
- if (_this15.scrollDepthTriggered[scrollDepthTriggered__key] === false && scroll >= scrollDepthTriggered__key) {
1184
- _this15.scrollDepthTriggered[scrollDepthTriggered__key] = true;
1185
- _this15.eventAnalytics('scroll_depth', scrollDepthTriggered__key + '%');
1186
- _this15.eventEtracker('scroll_depth', scrollDepthTriggered__key + '%');
1191
+ var scroll = _this16.scrollPos();
1192
+ for (var scrollDepthTriggered__key in _this16.scrollDepthTriggered) {
1193
+ if (_this16.scrollDepthTriggered[scrollDepthTriggered__key] === false && scroll >= scrollDepthTriggered__key) {
1194
+ _this16.scrollDepthTriggered[scrollDepthTriggered__key] = true;
1195
+ _this16.eventAnalytics('scroll_depth', scrollDepthTriggered__key + '%');
1196
+ _this16.eventEtracker('scroll_depth', scrollDepthTriggered__key + '%');
1187
1197
  }
1188
1198
  }
1189
1199
  });
@@ -1208,11 +1218,11 @@ var chefcookie = /*#__PURE__*/function () {
1208
1218
  }, {
1209
1219
  key: "trackScrollDepthCustom",
1210
1220
  value: function trackScrollDepthCustom(percent, callback) {
1211
- var _this16 = this;
1221
+ var _this17 = this;
1212
1222
  this.registerEventListener(window, 'scroll', function () {
1213
- var scroll = _this16.scrollPos();
1214
- if (_this16.scrollDepthTriggeredOnce === false && scroll >= percent) {
1215
- _this16.scrollDepthTriggeredOnce = true;
1223
+ var scroll = _this17.scrollPos();
1224
+ if (_this17.scrollDepthTriggeredOnce === false && scroll >= percent) {
1225
+ _this17.scrollDepthTriggeredOnce = true;
1216
1226
  callback();
1217
1227
  }
1218
1228
  });
@@ -1229,11 +1239,11 @@ var chefcookie = /*#__PURE__*/function () {
1229
1239
  }, {
1230
1240
  key: "waitFor",
1231
1241
  value: function waitFor(provider) {
1232
- var _this17 = this;
1242
+ var _this18 = this;
1233
1243
  var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1234
1244
  return new Promise(function (resolve, reject) {
1235
1245
  var timeout = setInterval(function () {
1236
- if (_this17.isLoaded(provider)) {
1246
+ if (_this18.isLoaded(provider)) {
1237
1247
  window.clearInterval(timeout);
1238
1248
  if (callback !== null && typeof callback === 'function') {
1239
1249
  callback();
@@ -1385,17 +1395,17 @@ var chefcookie = /*#__PURE__*/function () {
1385
1395
  }, {
1386
1396
  key: "trackFirstUserInteraction",
1387
1397
  value: function trackFirstUserInteraction() {
1388
- var _this18 = this;
1398
+ var _this19 = this;
1389
1399
  if (!this.logTrackingActive()) {
1390
1400
  return;
1391
1401
  }
1392
1402
  ['mousedown', 'mousemove', 'keydown', 'scroll', 'touchstart', 'click'].forEach(function (eventName) {
1393
1403
  document.addEventListener(eventName, function () {
1394
- if (_this18.first_user_interaction === true) {
1404
+ if (_this19.first_user_interaction === true) {
1395
1405
  return;
1396
1406
  }
1397
- _this18.first_user_interaction = true;
1398
- _this18.logTracking('first_user_interaction');
1407
+ _this19.first_user_interaction = true;
1408
+ _this19.logTracking('first_user_interaction');
1399
1409
  }, true);
1400
1410
  });
1401
1411
  }