PageSourceSearch

https://tbk-systems.ru/g/basestyle/1.0.1/cookie.message/cookie.message.js

js tbk-systems.ru collected 2026-09-29 13:44:21 UTC 6,950 bytes, 1 lines download raw bytes

1(()=>{"use strict";var t={_root:null,wasShown:localStorage.getItem("wasCookieMessageShown"),get root(){return this._root||(this._root=document.querySelector("#s3-cookie-message")),this._root},init:function(){var t=this;this.root&&!this.wasShown&&(this.show(),document.querySelector("#s3-cookie-message__btn").addEventListener("click",function(){t.hide()}))},show:function(){this.root.style.display="flex"},hide:function(){this.root.style.display="none",localStorage.setItem("wasCookieMessageShown","true")}},e={root:null,groupItemsDom:null,allowButton:null,discardButton:null,settingsButton:null,closeButton:null,settingsTextDom:null,textSettingsShow:null,textSettingsHide:null,defaultRootSelector:"#s3-cookie-message-groups",grRootSelector:"#gr-cookie-message-groups",rootOpenedClassName:"s3-cookie-message-groups--opened",rootSettingsOpenedClassName:"s3-cookie-message-groups--settings-opened",allowButtonSelector:".s3-cookie-message-groups__button--allow",discardButtonSelector:".s3-cookie-message-groups__button--discard",settingsButtonSelector:".s3-cookie-message-groups__button--settings",settingsButtonOpenedClassName:"s3-cookie-message-groups__button--settings-opened",settingsTextSelector:".s3-cookie-message-groups__button-text",closeButtonSelector:".s3-cookie-message-groups__close",groupClassName:"s3-cookie-message-groups__group",groupActiveClassName:"s3-cookie-message-groups__group--active",groupTextSelector:".s3-cookie-message-groups__group-text",groupHeadSelector:".s3-cookie-message-groups__group-head",checkboxSelector:".s3-cookie-message-groups__group-checkbox",checkboxCheckedClassName:"s3-cookie-message-groups__group-checkbox--checked",preAnimationClassName:"s3-cookie-message-groups__pre-animation",animationHeightCssVar:"--animation-height",bodySettingsOpened:"body--s3-cookie-settings-opened",settingsCookieName:"disabled_cookie_groups",groupDelimiter:",",groupsState:{analytics:!0,adv:!0},groupsStateKeys:[],init:function(){"loading"!==document.readyState?this.onDocReadyInit():document.addEventListener("DOMContentLoaded",this.onDocReadyInit.bind(this))},onDocReadyInit:function(){var t,e,o,s,i,n=document.querySelector(this.defaultRootSelector),r=document.querySelector(this.grRootSelector);this.root=null!=r?r:n,this.root&&(readCookie(this.settingsCookieName)||void 0!==(null===(t=window.parent)||void 0===t?void 0:t.ReactLPConstructor)||void 0!==(null===(e=window.parent)||void 0===e?void 0:e.LpController)?this.removeRoot():(this.groupItemsDom=this.root.querySelectorAll(".".concat(this.groupClassName)),this.allowButton=this.root.querySelector(this.allowButtonSelector),this.discardButton=this.root.querySelector(this.discardButtonSelector),this.settingsButton=this.root.querySelector(this.settingsButtonSelector),this.closeButton=this.root.querySelector(this.closeButtonSelector),this.settingsTextDom=this.settingsButton.querySelector(this.settingsTextSelector),this.textSettingsShow=(null==this||null===(o=this.settingsTextDom)||void 0===o||null===(o=o.dataset)||void 0===o?void 0:o.settings)||(null==this||null===(s=this.settingsTextDom)||void 0===s?void 0:s.textContent),this.textSettingsHide=null==this||null===(i=this.settingsTextDom)||void 0===i||null===(i=i.dataset)||void 0===i?void 0:i.settingsHide,this.groupsStateKeys=Object.keys(this.groupsState),this.setSettingsText(!1),this.readSettingsFromCookie(),this.syncCheckboxes(),this.addEvents(),this.openRoot()))},openRoot:function(){this.root.classList.add(this.rootOpenedClassName)},readSettingsFromCookie:function(){var t=this,e=readCookie(this.settingsCookieName);if(e){var o=decodeURIComponent(e).split(this.groupDelimiter);this.groupsStateKeys.forEach(function(e){var s=!o.includes(e);s||(t.groupsState[e]=s)})}},saveSettingsToCookie:function(){var t=this,e=this.groupsStateKeys.filter(function(e){return!t.groupsState[e]}).join(this.groupDelimiter);e||(e=this.groupDelimiter),createCookie(this.settingsCookieName,e,365)},discardAllGroups:function(){var t=this;this.groupsStateKeys.forEach(function(e){t.groupsState[e]=!1})},setSettingsText:function(t){this.settingsTextDom&&this.textSettingsShow&&this.textSettingsHide&&(this.settingsTextDom.textContent=t?this.textSettingsHide:this.textSettingsShow)},removeRoot:function(){document.body.classList.remove(this.bodySettingsOpened),this.root.remove()},onAllowClick:function(){this.saveSettingsToCookie(),this.removeRoot()},onDiscardClick:function(){this.discardAllGroups(),this.saveSettingsToCookie(),this.removeRoot()},toggleGroup:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=t.classList.contains(this.groupActiveClassName);if(!e||o){var s=t.querySelector(this.groupTextSelector);this.setAnimationElementHeight(s),t.classList.toggle(this.groupActiveClassName,!o)}},toggleSettings:function(){var t=this,e=!this.root.classList.contains(this.rootSettingsOpenedClassName);this.root.classList.toggle(this.rootSettingsOpenedClassName,e),document.body.classList.toggle(this.bodySettingsOpened,e),e||this.groupItemsDom.forEach(function(e){t.toggleGroup(e,!0)}),this.setSettingsText(e),this.settingsButton.classList.toggle(this.settingsButtonOpenedClassName,e)},onSettingsClick:function(){this.toggleSettings()},onCloseClick:function(){this.removeRoot()},onGroupHeadClick:function(t){var e,o=this;if(null!==(e=t.target)&&void 0!==e&&e.closest(this.groupHeadSelector)){var s=t.target.closest(".".concat(this.groupClassName));this.toggleGroup(s),this.groupItemsDom.forEach(function(t){t!==s&&o.toggleGroup(t,!0)})}},toggleCheckbox:function(t){var e=this,o=t.closest(".".concat(this.groupClassName));this.groupsStateKeys.forEach(function(s){if(o.classList.contains("".concat(e.groupClassName,"--").concat(s))){var i=!e.groupsState[s];e.groupsState[s]=i,t.classList.toggle(e.checkboxCheckedClassName,i)}})},onCheckboxClick:function(t){var e,o=null===(e=t.target)||void 0===e?void 0:e.closest(this.checkboxSelector);o&&this.toggleCheckbox(o)},syncCheckboxes:function(){var t=this;this.groupItemsDom.forEach(function(e){var o=e.querySelector(t.checkboxSelector);t.groupsStateKeys.forEach(function(s){if(e.classList.contains("".concat(t.groupClassName,"--").concat(s))){var i=t.groupsState[s];o.classList.toggle(t.checkboxCheckedClassName,i)}})})},setAnimationElementHeight:function(t){t.classList.add(this.preAnimationClassName),t.style.setProperty(this.animationHeightCssVar,"".concat(t.scrollHeight,"px")),t.classList.remove(this.preAnimationClassName)},addEvents:function(){this.allowButton.addEventListener("click",this.onAllowClick.bind(this)),this.discardButton.addEventListener("click",this.onDiscardClick.bind(this)),this.settingsButton.addEventListener("click",this.onSettingsClick.bind(this)),this.closeButton.addEventListener("click",this.onCloseClick.bind(this)),this.root.addEventListener("click",this.onGroupHeadClick.bind(this)),this.root.addEventListener("click",this.onCheckboxClick.bind(this))}};setTimeout(function(){t.wasShown||(t.root?t.init():e.init())},1e3)})();

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.