1// source --> https://www.licatanet.it/wp-content/plugins/cookie-law-info/legacy/public/js/cookie-law-info-public.js?ver=3.4.2 2const CLI_ACCEPT_COOKIE_NAME = (window.CLI_ACCEPT_COOKIE_NAME !== undefined ? window.CLI_ACCEPT_COOKIE_NAME : 'viewed_cookie_policy'); 3const CLI_PREFERENCE_COOKIE = (window.CLI_PREFERENCE_COOKIE !== undefined ? window.CLI_PREFERENCE_COOKIE : 'CookieLawInfoConsent'); 4const CLI_ACCEPT_COOKIE_EXPIRE = (window.CLI_ACCEPT_COOKIE_EXPIRE !== undefined ? window.CLI_ACCEPT_COOKIE_EXPIRE : 365); 5let CLI_COOKIEBAR_AS_POPUP = (window.CLI_COOKIEBAR_AS_POPUP !== undefined ? window.CLI_COOKIEBAR_AS_POPUP : false); 6const CLI_Cookie = { 7 set: function (name, value, days) { 8 var secure = ""; 9 if (true === Boolean(Cli_Data.secure_cookies)) { 10 secure = ";secure"; 11 } 12 if (days) { 13 var date = new Date(); 14 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 15 var expires = "; expires=" + date.toGMTString(); 16 } else { 17 var expires = ""; 18 } 19 document.cookie = name + "=" + value + secure + expires + "; path=/"; 20 if (days < 1) { 21 let host_name = window.location.hostname; 22 document.cookie = name + "=" + value + expires + "; path=/; domain=." + host_name + ";"; 23 if (host_name.indexOf("www") != 1) { 24 var host_name_withoutwww = host_name.replace('www', ''); 25 document.cookie = name + "=" + value + secure + expires + "; path=/; domain=" + host_name_withoutwww + ";"; 26 } 27 host_name = host_name.substring(host_name.lastIndexOf(".", host_name.lastIndexOf(".") - 1)); 28 document.cookie = name + "=" + value + secure + expires + "; path=/; domain=" + host_name + ";"; 29 } 30 }, 31 read: function (name) { 32 var nameEQ = name + "="; 33 var ca = document.cookie.split(';'); 34 for (var i = 0; i < ca.length; i++) { 35 var c = ca[i]; 36 while (c.charAt(0) == ' ') { 37 c = c.substring(1, c.length); 38 } 39 if (c.indexOf(nameEQ) === 0) { 40 return c.substring(nameEQ.length, c.length); 41 } 42 } 43 return null; 44 }, 45 erase: function (name) { 46 this.set(name, "", -10); 47 }, 48 exists: function (name) { 49 return (this.read(name) !== null); 50 }, 51 getallcookies: function () { 52 var pairs = document.cookie.split(";"); 53 var cookieslist = {}; 54 for (var i = 0; i < pairs.length; i++) { 55 var pair = pairs[i].split("="); 56 cookieslist[(pair[0] + '').trim()] = unescape(pair[1]); 57 } 58 return cookieslist; 59 } 60} 61var CLI = 62{ 63 bar_config: {}, 64 showagain_config: {}, 65 allowedCategories: [], 66 js_blocking_enabled: false, 67 set: function (args) { 68 if (typeof JSON.parse !== "function") { 69 console.log("CookieLawInfo requires JSON.parse but your browser doesn't support it"); 70 return; 71 } 72 if (typeof args.settings !== 'object') { 73 this.settings = JSON.parse(args.settings); 74 } else { 75 this.settings = args.settings; 76 } 77 this.js_blocking_enabled = Boolean(Cli_Data.js_blocking); 78 this.settings = args.settings; 79 this.bar_elm = jQuery(this.settings.notify_div_id); 80 this.showagain_elm = jQuery(this.settings.showagain_div_id); 81 this.settingsModal = jQuery('#cliSettingsPopup'); 82 83 /* buttons */ 84 this.main_button = jQuery('.cli-plugin-main-button'); 85 this.main_link = jQuery('.cli-plugin-main-link'); 86 this.reject_link = jQuery('.cookie_action_close_header_reject'); 87 this.delete_link = jQuery(".cookielawinfo-cookie-delete"); 88 this.settings_button = jQuery('.cli_settings_button'); 89 this.accept_all_button = jQuery('.wt-cli-accept-all-btn'); 90 if (this.settings.cookie_bar_as == 'popup') { 91 CLI_COOKIEBAR_AS_POPUP = true; 92 } 93 this.mayBeSetPreferenceCookie(); 94 this.addStyleAttribute(); 95 this.configBar(); 96 this.toggleBar(); 97 this.attachDelete(); 98 this.attachEvents(); 99 this.configButtons(); 100 this.reviewConsent(); 101 var cli_hidebar_on_readmore = this.hideBarInReadMoreLink(); 102 if (Boolean(this.settings.scroll_close) === true && cli_hidebar_on_readmore === false) { 103 window.addEventListener("scroll", CLI.closeOnScroll, false); 104 } 105 106 }, 107 hideBarInReadMoreLink: function () { 108 if (Boolean(CLI.settings.button_2_hidebar) === true && this.main_link.length > 0 && this.main_link.hasClass('cli-minimize-bar')) { 109 this.hideHeader(); 110 cliBlocker.cookieBar(false); 111 this.showagain_elm.slideDown(this.settings.animate_speed_show); 112 return true; 113 } 114 return false;
115 }, 116 attachEvents: function () { 117 jQuery(document).on( 118 'click', 119 '.wt-cli-privacy-btn', 120 function (e) { 121 e.preventDefault(); 122 CLI.accept_close(); 123 CLI.settingsPopUpClose(); 124 } 125 ); 126 127 jQuery('.wt-cli-accept-btn').on( 128 "click", 129 function (e) { 130 e.preventDefault(); 131 CLI.acceptRejectCookies(jQuery(this)); 132 }); 133 jQuery('.wt-cli-accept-all-btn').on( 134 "click", 135 function (e) { 136 e.preventDefault(); 137 CLI.acceptRejectCookies(jQuery(this), 'accept'); 138 }); 139 jQuery('.wt-cli-reject-btn').on( 140 "click", 141 function (e) { 142 e.preventDefault(); 143 CLI.acceptRejectCookies(jQuery(this), 'reject'); 144 }); 145 this.settingsPopUp(); 146 this.settingsTabbedAccordion(); 147 this.toggleUserPreferenceCheckBox(); 148 this.hideCookieBarOnClose(); 149 this.cookieLawInfoRunCallBacks(); 150 151 }, 152 acceptRejectCookies(element, action = 'custom') { 153 var open_link = element[0].hasAttribute("href") && element.attr("href") != '#' ? true : false; 154 var new_window = false; 155 if (action == 'accept') { 156 this.enableAllCookies(); 157 this.accept_close(); 158 new_window = CLI.settings.button_7_new_win ? true : false; 159 160 } else if (action == 'reject') { 161 this.disableAllCookies(); 162 this.reject_close(); 163 new_window = Boolean(this.settings.button_3_new_win) ? true : false; 164 } else { 165 this.accept_close(); 166 new_window = Boolean(this.settings.button_1_new_win) ? true : false; 167 } 168 if (open_link) { 169 if (new_window) { 170 window.open(element.attr("href"), '_blank'); 171 } else { 172 window.location.href = element.attr("href"); 173 } 174 } 175 }, 176 toggleUserPreferenceCheckBox: function () { 177 178 jQuery('.cli-user-preference-checkbox').each( 179 function () { 180 181 const categoryCookie = 'cookielawinfo-' + jQuery(this).attr('data-id'); 182 const categoryCookieValue = CLI_Cookie.read(categoryCookie); 183 if (categoryCookieValue == null) { 184 if (jQuery(this).is(':checked')) { 185 CLI_Cookie.set(categoryCookie, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); 186 } else { 187 CLI_Cookie.set(categoryCookie, 'no', CLI_ACCEPT_COOKIE_EXPIRE); 188 } 189 } else { 190 if (categoryCookieValue == "yes") { 191 jQuery(this).prop("checked", true); 192 } else { 193 jQuery(this).prop("checked", false); 194 } 195 196 } 197 198 } 199 ); 200 jQuery('.cli-user-preference-checkbox').on( 201 "click", 202 function (e) { 203 var dataID = jQuery(this).attr('data-id'); 204 var currentToggleElm = jQuery('.cli-user-preference-checkbox[data-id=' + dataID + ']'); 205 if (jQuery(this).is(':checked')) { 206 CLI_Cookie.set('cookielawinfo-' + dataID, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); 207 currentToggleElm.prop('checked', true); 208 } else { 209 CLI_Cookie.set('cookielawinfo-' + dataID, 'no', CLI_ACCEPT_COOKIE_EXPIRE); 210 currentToggleElm.prop('checked', false); 211 } 212 CLI.checkCategories(); 213 CLI.generateConsent(); 214 } 215 ); 216 217 }, 218 settingsPopUp: function () { 219 jQuery(document).on( 220 'click', 221 '.cli_settings_button', 222 function (e) { 223 e.preventDefault(); 224 CLI.settingsModal.addClass("cli-show").css({ 'opacity': 0 }).animate({ 'opacity': 1 }); 225 CLI.settingsModal.removeClass('cli-blowup cli-out').addClass("cli-blowup"); 226 jQuery('body').addClass("cli-modal-open"); 227 jQuery(".cli-settings-overlay").addClass("cli-show"); 228 jQuery("#cookie-law-info-bar").css({ 'opacity': .1 }); 229 if (!jQuery('.cli-settings-mobile').is(':visible')) { 230 CLI.settingsModal.find('.cli-nav-link:eq(0)').trigger("click"); 231 } 232 } 233 ); 234 jQuery('#cliModalClose').on( 235 "click", 236 function (e) { 237 CLI.settingsPopUpClose(); 238 } 239 ); 240 CLI.settingsModal.on( 241 "click", 242 function (e) { 243 if (!(document.getElementsByClassName('cli-modal-dialog')[0].contains(e.target))) { 244 CLI.settingsPopUpClose(); 245 } 246 } 247 ); 248 jQuery('.cli_enable_all_btn').on( 249 "click", 250 function (e) { 251 var cli_toggle_btn = jQuery(this); 252 var enable_text = cli_toggle_btn.attr('data-enable-text'); 253 var disable_text = cli_toggle_btn.attr('data-disable-text'); 254 if (cli_toggle_btn.hasClass('cli-enabled')) { 255 CLI.disableAllCookies(); 256 cli_toggle_btn.html(enable_text); 257 } else { 258 CLI.enableAllCookies(); 259 cli_toggle_btn.html(disable_text); 260 261 } 262 jQuery(this).toggleClass('cli-enabled'); 263 } 264 ); 265 266 this.privacyReadmore(); 267 }, 268 settingsTabbedAccordion: function () { 269 jQuery(".cli-tab-header").on( 270 "click", 271 function (e) { 272 if (!(jQuery(e.target).hasClass('cli-slider') || jQuery(e.target).hasClass('cli-user-preference-checkbox'))) { 273 if (jQuery(this).hasClass("cli-tab-active")) { 274 jQuery(this).removeClass("cli-tab-active"); 275 jQuery(this) 276 .siblings(".cli-tab-content") 277 .slideUp(200); 278 279 } else { 280 jQuery(".cli-tab-header").removeClass("cli-tab-active"); 281 jQuery(this).addClass("cli-tab-active"); 282 jQuery(".cli-tab-content").slideUp(200); 283 jQuery(this) 284 .siblings(".cli-tab-content") 285 .slideDown(200); 286 } 287 } 288 } 289 ); 290 }, 291 settingsPopUpClose: function () { 292 this.settingsModal.removeClass('cli-show'); 293 this.settingsModal.addClass('cli-out'); 294 jQuery('body').removeClass("cli-modal-open"); 295 jQuery(".cli-settings-overlay").removeClass("cli-show"); 296 jQuery("#cookie-law-info-bar").css({ 'opacity': 1 }); 297 }, 298 privacyReadmore: function () { 299 var el = jQuery('.cli-privacy-content .cli-privacy-content-text'); 300 if (el.length > 0) { 301 var clone = el.clone(), 302 originalHtml = clone.html(), 303 originalHeight = el.outerHeight(), 304 Trunc = { 305 addReadmore: function (textBlock) { 306 if (textBlock.html().length > 250) { 307 jQuery('.cli-privacy-readmore').show(); 308 } else { 309 jQuery('.cli-privacy-readmore').hide(); 310 } 311 }, 312 truncateText: function (textBlock) { 313 var strippedText = jQuery('<div />').html(textBlock.html()); 314 strippedText.find('table').remove(); 315 textBlock.html(strippedText.html()); 316 const currentText = textBlock.text(); 317 if (currentText.trim().length > 250) { 318 var newStr = currentText.substring(0, 250); 319 textBlock.empty().html(newStr).append('...'); 320 } 321 }, 322 replaceText: function (textBlock, original) { 323 return textBlock.html(original); 324 } 325 326 }; 327 Trunc.addReadmore(el); 328 Trunc.truncateText(el); 329 jQuery('a.cli-privacy-readmore').on( 330 "click", 331 function (e) { 332 e.preventDefault(); 333 if (jQuery('.cli-privacy-overview').hasClass('cli-collapsed')) { 334 Trunc.truncateText(el); 335 jQuery('.cli-privacy-overview').removeClass('cli-collapsed'); 336 el.css('height', '100%'); 337 } else { 338 jQuery('.cli-privacy-overview').addClass('cli-collapsed'); 339 Trunc.replaceText(el, originalHtml); 340 } 341 342 } 343 ); 344 } 345 346 }, 347 attachDelete: function () { 348 this.delete_link.on( 349 "click", 350 function (e) { 351 CLI_Cookie.erase(CLI_ACCEPT_COOKIE_NAME); 352 for (var k in Cli_Data.nn_cookie_ids) { 353 CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); 354 } 355 CLI.generateConsent(); 356 return false;
357 } 358 ); 359 360 }, 361 configButtons: function () { 362 /*[cookie_button] */ 363 this.main_button.css('color', this.settings.button_1_link_colour); 364 if (Boolean(this.settings.button_1_as_button)) { 365 this.main_button.css('background-color', this.settings.button_1_button_colour); 366 367 this.main_button.on( 368 'mouseenter', 369 function () { 370 jQuery(this).css('background-color', CLI.settings.button_1_button_hover); 371 } 372 ) 373 .on( 374 'mouseleave', 375 function () { 376 jQuery(this).css('background-color', CLI.settings.button_1_button_colour); 377 } 378 ); 379 } 380 381 /* [cookie_link] */ 382 this.main_link.css('color', this.settings.button_2_link_colour); 383 if (Boolean(this.settings.button_2_as_button)) { 384 this.main_link.css('background-color', this.settings.button_2_button_colour); 385 386 this.main_link.on( 387 'mouseenter', 388 function () { 389 jQuery(this).css('background-color', CLI.settings.button_2_button_hover); 390 } 391 ) 392 .on( 393 'mouseleave', 394 function () { 395 jQuery(this).css('background-color', CLI.settings.button_2_button_colour); 396 } 397 ); 398 399 } 400 /* [cookie_reject] */ 401 this.reject_link.css('color', this.settings.button_3_link_colour); 402 if (Boolean(this.settings.button_3_as_button)) { 403 404 this.reject_link.css('background-color', this.settings.button_3_button_colour); 405 this.reject_link.on( 406 'mouseenter', 407 function () { 408 jQuery(this).css('background-color', CLI.settings.button_3_button_hover); 409 } 410 ) 411 .on( 412 'mouseleave', 413 function () { 414 jQuery(this).css('background-color', CLI.settings.button_3_button_colour); 415 } 416 ); 417 } 418 /* [cookie_settings] */ 419 this.settings_button.css('color', this.settings.button_4_link_colour); 420 if (Boolean(this.settings.button_4_as_button)) { 421 this.settings_button.css('background-color', this.settings.button_4_button_colour); 422 this.settings_button.on( 423 'mouseenter', 424 function () { 425 jQuery(this).css('background-color', CLI.settings.button_4_button_hover); 426 } 427 ) 428 .on( 429 'mouseleave', 430 function () { 431 jQuery(this).css('background-color', CLI.settings.button_4_button_colour); 432 } 433 ); 434 } 435 /* [cookie_accept_all] */ 436 this.accept_all_button.css('color', this.settings.button_7_link_colour); 437 if (this.settings.button_7_as_button) { 438 this.accept_all_button.css('background-color', this.settings.button_7_button_colour); 439 this.accept_all_button.on( 440 'mouseenter', 441 function () { 442 jQuery(this).css('background-color', CLI.settings.button_7_button_hover); 443 } 444 ) 445 .on( 446 'mouseleave', 447 function () { 448 jQuery(this).css('background-color', CLI.settings.button_7_button_colour); 449 } 450 ); 451 } 452 }, 453 toggleBar: function () { 454 if (CLI_COOKIEBAR_AS_POPUP) { 455 this.barAsPopUp(1); 456 } 457 if (CLI.settings.cookie_bar_as == 'widget') { 458 this.barAsWidget(1); 459 } 460 if (!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) { 461 this.displayHeader(); 462 } else { 463 this.hideHeader(); 464 } 465 if (Boolean(this.settings.show_once_yn)) { 466 setTimeout( 467 function () { 468 CLI.close_header(); 469 }, 470 CLI.settings.show_once 471 ); 472 } 473 if (CLI.js_blocking_enabled === false) { 474 if (Boolean(Cli_Data.ccpaEnabled) === true) { 475 if (Cli_Data.ccpaType === 'ccpa' && Boolean(Cli_Data.ccpaBarEnabled) === false) { 476 cliBlocker.cookieBar(false); 477 } 478 } else { 479 jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); 480 } 481 } 482 483 this.showagain_elm.on( 484 "click", 485 function (e) { 486 e.preventDefault(); 487 CLI.showagain_elm.slideUp( 488 CLI.settings.animate_speed_hide, 489 function () { 490 CLI.bar_elm.slideDown(CLI.settings.animate_speed_show); 491 if (CLI_COOKIEBAR_AS_POPUP) { 492 CLI.showPopupOverlay(); 493 } 494 } 495 ); 496 } 497 ); 498 }, 499 configShowAgain: function () { 500 this.showagain_config = { 501 'background-color': this.settings.background, 502 'color': this.l1hs(this.settings.text), 503 'position': 'fixed', 504 'font-family': this.settings.font_family 505 }; 506 if (Boolean(this.settings.border_on)) { 507 var border_to_hide = 'border-' + this.settings.notify_position_vertical; 508 this.showagain_config['border'] = '1px solid ' + this.l1hs(this.settings.border); 509 this.showagain_config[border_to_hide] = 'none'; 510 } 511 var cli_win = jQuery(window); 512 var cli_winw = cli_win.width(); 513 var showagain_x_pos = this.settings.showagain_x_position; 514 if (cli_winw < 300) { 515 showagain_x_pos = 10; 516 this.showagain_config.width = cli_winw - 20; 517 } else { 518 this.showagain_config.width = 'auto'; 519 } 520 var cli_defw = cli_winw > 400 ? 500 : cli_winw - 20; 521 if (CLI_COOKIEBAR_AS_POPUP) { /* cookie bar as popup */ 522 var sa_pos = this.settings.popup_showagain_position; 523 var sa_pos_arr = sa_pos.split('-'); 524 if (sa_pos_arr[1] == 'left') { 525 this.showagain_config.left = showagain_x_pos; 526 } else if (sa_pos_arr[1] == 'right') { 527 this.showagain_config.right = showagain_x_pos; 528 } 529 if (sa_pos_arr[0] == 'top') { 530 this.showagain_config.top = 0; 531 532 } else if (sa_pos_arr[0] == 'bottom') { 533 this.showagain_config.bottom = 0; 534 } 535 this.bar_config['position'] = 'fixed'; 536 537 } else if (this.settings.cookie_bar_as == 'widget') { 538 this.showagain_config.bottom = 0; 539 if (this.settings.widget_position == 'left') { 540 this.showagain_config.left = showagain_x_pos; 541 } else if (this.settings.widget_position == 'right') { 542 this.showagain_config.right = showagain_x_pos; 543 } 544 } else { 545 if (this.settings.notify_position_vertical == "top") { 546 this.showagain_config.top = '0'; 547 } else if (this.settings.notify_position_vertical == "bottom") { 548 this.bar_config['position'] = 'fixed'; 549 this.bar_config['bottom'] = '0'; 550 this.showagain_config.bottom = '0'; 551 } 552 if (this.settings.notify_position_horizontal == "left") { 553 this.showagain_config.left = showagain_x_pos; 554 } else if (this.settings.notify_position_horizontal == "right") { 555 this.showagain_config.right = showagain_x_pos; 556 } 557 } 558 this.showagain_elm.css(this.showagain_config); 559 }, 560 configBar: function () { 561 this.bar_config = { 562 'background-color': this.settings.background, 563 'color': this.settings.text, 564 'font-family': this.settings.font_family 565 }; 566 if (this.settings.notify_position_vertical == "top") { 567 this.bar_config['top'] = '0'; 568 if (Boolean(this.settings.header_fix) === true) { 569 this.bar_config['position'] = 'fixed'; 570 } 571 } else { 572 this.bar_config['bottom'] = '0'; 573 } 574 this.configShowAgain(); 575 this.bar_elm.css(this.bar_config).hide(); 576 }, 577 l1hs: function (str) { 578 if (str.charAt(0) == "#") { 579 str = str.substring(1, str.length); 580 } else { 581 return "#" + str; 582 } 583 return this.l1hs(str); 584 }, 585 close_header: function () { 586 CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); 587 this.hideHeader(); 588 }, 589 accept_close: function () { 590 this.hidePopupOverlay(); 591 this.generateConsent(); 592 this.cookieLawInfoRunCallBacks(); 593 594 CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); 595 if (Boolean(this.settings.notify_animate_hide)) { 596 if (CLI.js_blocking_enabled === true) { 597 this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts); 598 } else { 599 this.bar_elm.slideUp(this.settings.animate_speed_hide); 600 } 601 602 } else { 603 if (CLI.js_blocking_enabled === true) { 604 this.bar_elm.hide(0, cliBlocker.runScripts); 605 606 } else { 607 this.bar_elm.hide(); 608 } 609 } 610 if (Boolean(this.settings.showagain_tab)) { 611 this.showagain_elm.slideDown(this.settings.animate_speed_show); 612 } 613 if (Boolean(this.settings.accept_close_reload) === true) { 614 this.reload_current_page(); 615 } 616 return false;
617 }, 618 reject_close: function () { 619 this.hidePopupOverlay(); 620 this.generateConsent(); 621 this.cookieLawInfoRunCallBacks(); 622 for (var k in Cli_Data.nn_cookie_ids) { 623 CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); 624 } 625 CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME, 'no', CLI_ACCEPT_COOKIE_EXPIRE); 626 627 if (Boolean(this.settings.notify_animate_hide)) { 628 if (CLI.js_blocking_enabled === true) { 629 630 this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts); 631 632 } else { 633 634 this.bar_elm.slideUp(this.settings.animate_speed_hide); 635 } 636 637 } else { 638 if (CLI.js_blocking_enabled === true) { 639 640 this.bar_elm.hide(cliBlocker.runScripts); 641 642 } else { 643 644 this.bar_elm.hide(); 645 646 } 647 648 } 649 if (Boolean(this.settings.showagain_tab)) { 650 this.showagain_elm.slideDown(this.settings.animate_speed_show); 651 } 652 if (Boolean(this.settings.reject_close_reload) === true) { 653 this.reload_current_page(); 654 } 655 return false; 656 }, 657 reload_current_page: function () { 658 659 window.location.reload(true); 660 }, 661 closeOnScroll: function () { 662 if (window.pageYOffset > 100 && !CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)) { 663 CLI.accept_close(); 664 if (Boolean(CLI.settings.scroll_close_reload) === true) { 665 window.location.reload(); 666 } 667 window.removeEventListener("scroll", CLI.closeOnScroll, false); 668 } 669 }, 670 displayHeader: function () { 671 if (Boolean(this.settings.notify_animate_show)) { 672 this.bar_elm.slideDown(this.settings.animate_speed_show); 673 } else { 674 this.bar_elm.show(); 675 } 676 this.showagain_elm.hide(); 677 if (CLI_COOKIEBAR_AS_POPUP) { 678 this.showPopupOverlay(); 679 } 680 }, 681 hideHeader: function () { 682 if (Boolean(this.settings.showagain_tab)) { 683 if (Boolean(this.settings.notify_animate_show)) { 684 this.showagain_elm.slideDown(this.settings.animate_speed_show); 685 } else { 686 this.showagain_elm.show(); 687 } 688 } else { 689 this.showagain_elm.hide(); 690 } 691 this.bar_elm.slideUp(this.settings.animate_speed_show); 692 this.hidePopupOverlay(); 693 }, 694 hidePopupOverlay: function () { 695 jQuery('body').removeClass("cli-barmodal-open"); 696 jQuery(".cli-popupbar-overlay").removeClass("cli-show"); 697 }, 698 showPopupOverlay: function () { 699 if (this.bar_elm.length) { 700 if (Boolean(this.settings.popup_overlay)) { 701 jQuery('body').addClass("cli-barmodal-open"); 702 jQuery(".cli-popupbar-overlay").addClass("cli-show"); 703 } 704 } 705 706 }, 707 barAsWidget: function (a) { 708 var cli_elm = this.bar_elm; 709 cli_elm.attr('data-cli-type', 'widget'); 710 var cli_win = jQuery(window); 711 var cli_winh = cli_win.height() - 40; 712 var cli_winw = cli_win.width(); 713 var cli_defw = cli_winw > 400 ? 300 : cli_winw - 30; 714 cli_elm.css( 715 { 716 'width': cli_defw, 'height': 'auto', 'max-height': cli_winh, 'overflow': 'auto', 'position': 'fixed', 'box-sizing': 'border-box' 717 } 718 ); 719 if (this.checkifStyleAttributeExist() === false) { 720 cli_elm.css({ 'padding': '25px 15px' }); 721 } 722 if (this.settings.widget_position == 'left') { 723 cli_elm.css( 724 { 725 'left': '15px', 'right': 'auto', 'bottom': '15px', 'top': 'auto' 726 } 727 ); 728 } else { 729 cli_elm.css( 730 { 731 'left': 'auto', 'right': '15px', 'bottom': '15px', 'top': 'auto' 732 } 733 ); 734 } 735 if (a) { 736 this.setResize(); 737 } 738 }, 739 barAsPopUp: function (a) { 740 if (typeof cookie_law_info_bar_as_popup === 'function') { 741 return false; 742 } 743 var cli_elm = this.bar_elm; 744 cli_elm.attr('data-cli-type', 'popup'); 745 var cli_win = jQuery(window); 746 var cli_winh = cli_win.height() - 40; 747 var cli_winw = cli_win.width(); 748 var cli_defw = cli_winw > 700 ? 500 : cli_winw - 20; 749 750 cli_elm.css( 751 { 752 'width': cli_defw, 'height': 'auto', 'max-height': cli_winh, 'bottom': '', 'top': '50%', 'left': '50%', 'margin-left': (cli_defw / 2) * -1, 'margin-top': '-100px', 'overflow': 'auto' 753 } 754 ).addClass('cli-bar-popup cli-modal-content'); 755 if (this.checkifStyleAttributeExist() === false) { 756 cli_elm.css({ 'padding': '25px 15px' }); 757 } 758 const cli_h = cli_elm.height(); 759 cli_elm.css({ 'top': '50%', 'margin-top': ((cli_h / 2) + 30) * -1 }); 760 setTimeout( 761 function () { 762 cli_elm.css( 763 { 764 'bottom': '' 765 } 766 ); 767 }, 768 100 769 ); 770 if (a) { 771 this.setResize(); 772 } 773 }, 774 setResize: function () { 775 var resizeTmr = null; 776 jQuery(window).resize( 777 function () { 778 clearTimeout(resizeTmr); 779 resizeTmr = setTimeout( 780 function () { 781 if (CLI_COOKIEBAR_AS_POPUP) { 782 CLI.barAsPopUp(); 783 } 784 if (CLI.settings.cookie_bar_as == 'widget') { 785 CLI.barAsWidget(); 786 } 787 CLI.configShowAgain(); 788 }, 789 500 790 ); 791 } 792 ); 793 }, 794 enableAllCookies: function () { 795 796 jQuery('.cli-user-preference-checkbox').each( 797 function () { 798 var cli_chkbox_elm = jQuery(this); 799 var cli_chkbox_data_id = cli_chkbox_elm.attr('data-id'); 800 if (cli_chkbox_data_id != 'checkbox-necessary') { 801 cli_chkbox_elm.prop('checked', true); 802 CLI_Cookie.set('cookielawinfo-' + cli_chkbox_data_id, 'yes', CLI_ACCEPT_COOKIE_EXPIRE); 803 } 804 } 805 ); 806 }, 807 disableAllCookies: function () { 808 jQuery('.cli-user-preference-checkbox').each( 809 function () { 810 811 var cli_chkbox_elm = jQuery(this); 812 var cli_chkbox_data_id = cli_chkbox_elm.attr('data-id'); 813 const cliCategorySlug = cli_chkbox_data_id.replace('checkbox-', ''); 814 if (Cli_Data.strictlyEnabled.indexOf(cliCategorySlug) === -1) { 815 cli_chkbox_elm.prop('checked', false); 816 CLI_Cookie.set('cookielawinfo-' + cli_chkbox_data_id, 'no', CLI_ACCEPT_COOKIE_EXPIRE); 817 } 818 } 819 ); 820 }, 821 hideCookieBarOnClose: function () { 822 jQuery(document).on( 823 'click',
824 '.cli_cookie_close_button', 825 function (e) { 826 e.preventDefault(); 827 var elm = jQuery(this); 828 if (Cli_Data.ccpaType === 'ccpa') { 829 CLI.enableAllCookies(); 830 } 831 CLI.accept_close(); 832 } 833 ); 834 }, 835 checkCategories: function () { 836 var cliAllowedCategories = []; 837 var cli_categories = {}; 838 jQuery('.cli-user-preference-checkbox').each( 839 function () { 840 var status = false; 841 const cli_chkbox_elm = jQuery(this); 842 let cli_chkbox_data_id = cli_chkbox_elm.attr('data-id'); 843 cli_chkbox_data_id = cli_chkbox_data_id.replace('checkbox-', ''); 844 const cli_chkbox_data_id_trimmed = cli_chkbox_data_id.replace('-', '_') 845 if (jQuery(cli_chkbox_elm).is(':checked')) { 846 status = true; 847 cliAllowedCategories.push(cli_chkbox_data_id); 848 } 849 850 cli_categories[cli_chkbox_data_id_trimmed] = status; 851 } 852 ); 853 CLI.allowedCategories = cliAllowedCategories; 854 }, 855 cookieLawInfoRunCallBacks: function () { 856 this.checkCategories(); 857 if (CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == 'yes') { 858 if ("function" == typeof CookieLawInfo_Accept_Callback) { 859 CookieLawInfo_Accept_Callback(); 860 } 861 } 862 }, 863 generateConsent: function () { 864 var preferenceCookie = CLI_Cookie.read(CLI_PREFERENCE_COOKIE); 865 let cliConsent = {}; 866 if (preferenceCookie !== null) { 867 cliConsent = window.atob(preferenceCookie); 868 cliConsent = JSON.parse(cliConsent); 869 } 870 cliConsent.ver = Cli_Data.consentVersion; 871 jQuery('.cli-user-preference-checkbox').each( 872 function () { 873 let categoryVal = ''; 874 let cli_chkbox_data_id = jQuery(this).attr('data-id'); 875 cli_chkbox_data_id = cli_chkbox_data_id.replace('checkbox-', ''); 876 if (jQuery(this).is(':checked')) { 877 categoryVal = true; 878 } else { 879 categoryVal = false;
880 } 881 cliConsent[cli_chkbox_data_id] = categoryVal; 882 } 883 ); 884 cliConsent = JSON.stringify(cliConsent); 885 cliConsent = window.btoa(cliConsent); 886 CLI_Cookie.set(CLI_PREFERENCE_COOKIE, cliConsent, CLI_ACCEPT_COOKIE_EXPIRE); 887 }, 888 addStyleAttribute: function () { 889 var bar = this.bar_elm; 890 var styleClass = ''; 891 if (jQuery(bar).find('.cli-bar-container').length > 0) { 892 styleClass = jQuery('.cli-bar-container').attr('class'); 893 styleClass = styleClass.replace('cli-bar-container', ''); 894 styleClass = styleClass.trim(); 895 jQuery(bar).attr('data-cli-style', styleClass); 896 } 897 }, 898 getParameterByName: function (name, url) { 899 if (!url) { 900 url = window.location.href; 901 } 902 name = name.replace(/[\[\]]/g, '\\$&'); 903 var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), 904 results = regex.exec(url); 905 if (!results) { 906 return null; 907 } 908 if (!results[2]) { 909 return ''; 910 } 911 return decodeURIComponent(results[2].replace(/\+/g, ' ')); 912 }, 913 CookieLawInfo_Callback: function (enableBar, enableBlocking) { 914 enableBar = typeof enableBar !== 'undefined' ? enableBar : true; 915 enableBlocking = typeof enableBlocking !== 'undefined' ? enableBlocking : true; 916 if (CLI.js_blocking_enabled === true && Boolean(Cli_Data.custom_integration) === true) { 917 cliBlocker.cookieBar(enableBar); 918 cliBlocker.runScripts(enableBlocking); 919 } 920 }, 921 checkifStyleAttributeExist: function () { 922 var exist = false; 923 var attr = this.bar_elm.attr('data-cli-style'); 924 if (typeof attr !== typeof undefined && attr !== false) { 925 exist = true; 926 } 927 return exist; 928 }, 929 reviewConsent: function () { 930 jQuery(document).on( 931 'click', 932 '.cli_manage_current_consent,.wt-cli-manage-consent-link', 933 function () { 934 CLI.displayHeader(); 935 } 936 ); 937 }, 938 mayBeSetPreferenceCookie: function () { 939 if (CLI.getParameterByName('cli_bypass') === "1") { 940 CLI.generateConsent(); 941 } 942 } 943} 944var cliBlocker = 945{ 946 blockingStatus: true, 947 scriptsLoaded: false, 948 ccpaEnabled: false, 949 ccpaRegionBased: false, 950 ccpaApplicable: false, 951 ccpaBarEnabled: false, 952 cliShowBar: true, 953 isBypassEnabled: CLI.getParameterByName('cli_bypass'), 954 checkPluginStatus: function (callbackA, callbackB) { 955 this.ccpaEnabled = Boolean(Cli_Data.ccpaEnabled); 956 this.ccpaRegionBased = Boolean(Cli_Data.ccpaRegionBased); 957 this.ccpaBarEnabled = Boolean(Cli_Data.ccpaBarEnabled); 958 959 if (Boolean(Cli_Data.custom_integration) === true) { 960 callbackA(false); 961 } else { 962 if (this.ccpaEnabled === true) { 963 this.ccpaApplicable = true; 964 if (Cli_Data.ccpaType === 'ccpa') { 965 if (this.ccpaBarEnabled !== true) { 966 this.cliShowBar = false; 967 this.blockingStatus = false; 968 } 969 } 970 } else { 971 jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); 972 } 973 if (cliBlocker.isBypassEnabled === "1") { 974 cliBlocker.blockingStatus = false; 975 } 976 callbackA(this.cliShowBar); 977 callbackB(this.blockingStatus); 978 } 979 980 }, 981 cookieBar: function (showbar) { 982 showbar = typeof showbar !== 'undefined' ? showbar : true; 983 cliBlocker.cliShowBar = showbar; 984 if (cliBlocker.cliShowBar === false) { 985 CLI.bar_elm.hide(); 986 CLI.showagain_elm.hide(); 987 CLI.settingsModal.removeClass('cli-blowup cli-out'); 988 CLI.hidePopupOverlay(); 989 jQuery(".cli-settings-overlay").removeClass("cli-show"); 990 } else { 991 if (!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) { 992 CLI.displayHeader(); 993 } else { 994 CLI.hideHeader(); 995 } 996 } 997 }, 998 removeCookieByCategory: function () { 999 1000 if (cliBlocker.blockingStatus === true) { 1001 if (CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) !== null) { 1002 var non_necessary_cookies = Cli_Data.non_necessary_cookies; 1003 for (var key in non_necessary_cookies) { 1004 const currentCategory = key; 1005 if (CLI.allowedCategories.indexOf(currentCategory) === -1) {
1006 var nonNecessaryCookies = non_necessary_cookies[currentCategory]; 1007 for (var i = 0; i < nonNecessaryCookies.length; i++) { 1008 if (CLI_Cookie.read(nonNecessaryCookies[i]) !== null) { 1009 CLI_Cookie.erase(nonNecessaryCookies[i]); 1010 } 1011 1012 } 1013 } 1014 } 1015 } 1016 } 1017 }, 1018 runScripts: function (blocking) { 1019 blocking = typeof blocking !== 'undefined' ? blocking : true; 1020 cliBlocker.blockingStatus = blocking; 1021 var genericFuncs = 1022 { 1023 1024 renderByElement: function (callback) { 1025 cliScriptFuncs.renderScripts(); 1026 callback(); 1027 cliBlocker.scriptsLoaded = true; 1028 }, 1029 1030 }; 1031 var cliScriptFuncs = 1032 { 1033 // trigger DOMContentLoaded 1034 scriptsDone: function () { 1035 if (typeof Cli_Data.triggerDomRefresh !== 'undefined') { 1036 if (Boolean(Cli_Data.triggerDomRefresh) === true) { 1037 var DOMContentLoadedEvent = document.createEvent('Event') 1038 DOMContentLoadedEvent.initEvent('DOMContentLoaded', true, true) 1039 window.document.dispatchEvent(DOMContentLoadedEvent); 1040 } 1041 } 1042 }, 1043 seq: function (arr, callback, index) { 1044 // first call, without an index 1045 if (typeof index === 'undefined') { 1046 index = 0 1047 } 1048 1049 arr[index]( 1050 function () { 1051 index++ 1052 if (index === arr.length) { 1053 callback() 1054 } else { 1055 cliScriptFuncs.seq(arr, callback, index) 1056 } 1057 } 1058 ) 1059 }, 1060 /* script runner */ 1061 insertScript: function ($script, callback) { 1062 var s = ''; 1063 var scriptType = $script.getAttribute('data-cli-script-type'); 1064 var elementPosition = $script.getAttribute('data-cli-element-position'); 1065 var isBlock = $script.getAttribute('data-cli-block'); 1066 var s = document.createElement('script'); 1067 var ccpaOptedOut = cliBlocker.ccpaOptedOut(); 1068 s.type = 'text/plain'; 1069 if ($script.async) { 1070 s.async = $script.async; 1071 } 1072 if ($script.defer) { 1073 s.defer = $script.defer; 1074 } 1075 if ($script.src) { 1076 s.onload = callback 1077 s.onerror = callback 1078 s.src = $script.src 1079 } else { 1080 s.textContent = $script.innerText 1081 } 1082 var attrs = jQuery($script).prop("attributes"); 1083 for (var ii = 0; ii < attrs.length; ++ii) { 1084 if (attrs[ii].nodeName !== 'id') { 1085 s.setAttribute(attrs[ii].nodeName, attrs[ii].value); 1086 } 1087 } 1088 if (cliBlocker.blockingStatus === true) { 1089 1090 if ((CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == 'yes' && CLI.allowedCategories.indexOf(scriptType) !== -1)) { 1091 s.setAttribute('data-cli-consent', 'accepted'); 1092 s.type = 'text/javascript'; 1093 } 1094 if (cliBlocker.ccpaApplicable === true) { 1095 if (ccpaOptedOut === true || CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == null) { 1096 s.type = 'text/plain'; 1097 } 1098 } 1099 } else { 1100 s.type = 'text/javascript'; 1101 } 1102 1103 if ($script.type != s.type) { 1104 if (elementPosition === 'head') { 1105 document.head.appendChild(s); 1106 } else { 1107 document.body.appendChild(s); 1108 } 1109 if (!$script.src) { 1110 callback() 1111 } 1112 $script.parentNode.removeChild($script); 1113 1114 } else { 1115 1116 callback(); 1117 } 1118 }, 1119 renderScripts: function () { 1120 var $scripts = document.querySelectorAll('script[data-cli-class="cli-blocker-script"]'); 1121 if ($scripts.length > 0) { 1122 var runList = [] 1123 var typeAttr 1124 Array.prototype.forEach.call( 1125 $scripts, 1126 function ($script) { 1127 // only run script tags without the type attribute 1128 // or with a javascript mime attribute value 1129 typeAttr = $script.getAttribute('type') 1130 runList.push( 1131 function (callback) { 1132 cliScriptFuncs.insertScript($script, callback) 1133 } 1134 ) 1135 } 1136 ) 1137 cliScriptFuncs.seq(runList, cliScriptFuncs.scriptsDone); 1138 } 1139 } 1140 }; 1141 genericFuncs.renderByElement(cliBlocker.removeCookieByCategory); 1142 }, 1143 ccpaOptedOut: function () { 1144 var ccpaOptedOut = false; 1145 var preferenceCookie = CLI_Cookie.read(CLI_PREFERENCE_COOKIE); 1146 if (preferenceCookie !== null) { 1147 let cliConsent = window.atob(preferenceCookie); 1148 cliConsent = JSON.parse(cliConsent); 1149 if (typeof cliConsent.ccpaOptout !== 'undefined') { 1150 ccpaOptedOut = cliConsent.ccpaOptout; 1151 } 1152 } 1153 return ccpaOptedOut; 1154 } 1155} 1156jQuery(document).ready( 1157 function () { 1158 if (typeof cli_cookiebar_settings != 'undefined') { 1159 CLI.set( 1160 { 1161 settings: cli_cookiebar_settings 1162 } 1163 ); 1164 if (CLI.js_blocking_enabled === true) { 1165 cliBlocker.checkPluginStatus(cliBlocker.cookieBar, cliBlocker.runScripts); 1166 } 1167 } 1168 } 1169);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.