1this.BX=this.BX||{},function(t){"use strict";class e{constructor(t,e){this.config=t,this.options=e}async saveConsent(){return this.fetch(e.SAVE_CONSENT,{url:window.location.href,originId:this.config.originId,originatorId:this.config.originatorId})}async getText(){return(await this.fetch(e.GET_TEXT,{},this.options.textUrl)).text}async fetch(t,e,i=null){const s=await fetch(i||this.config.actionUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(Object.assign({},{action:t,id:this.config.id,sec:this.config.sec||"",sessid:BX.message("bitrix_sessid")},e))});if(!s.ok)throw new Error("Failed to execute "+t);const n=await s.json();if(n.error)throw new Error(n.text);return n}}e.SAVE_CONSENT="saveConsent",e.GET_TEXT="getText";class i{constructor(t){this.messages=t}get(t){return this.messages[t]||t}}const s=window.BX||top.BX;class n{constructor(t,s){this.onAccept=t=>{const e=t.currentTarget;e.disabled||(e.disabled=!0,this.hide(),this.accept())},this.el=t,this.options=Object.assign({},n.defaults,this.el.dataset,s),this.locale=new i(this.options.locale),this.transport=new e(this.options.config,this.options.transport)}start(){this.alreadyGiven()?this.remove():this.show()}bind(){this.handleAccept(!0)}unbind(){this.handleAccept(!1)}handleAccept(t){this.el.querySelector(this.options.acceptElement)[t?"addEventListener":"removeEventListener"]("click",this.onAccept)}handleDetails(t){this.el.querySelector(this.options.detailsElement)[t?"addEventListener":"removeEventListener"]("click",this.onDetails)}remove(){this.el.remove(),this.el=null}show(){this.bind(),this.animateIn()}hide(){this.unbind(),this.animateOut().then(()=>{this.remove()})}animateIn(){this.wrapTransition(()=>{this.el.classList.add("is--active")})}animateOut(){return this.wrapTransition(()=>{this.el.classList.remove("is--active")})}wrapTransition(t){return new Promise(e=>{this.el.classList.add("transition--process"),requestAnimationFrame(()=>{t(),setTimeout(()=>{this.el.classList.remove("transition--process"),e()},this.options.transitionDuration)})})}async accept(){this.options.config.autoSave?(await this.transport.saveConsent(),this.markAccept()):this.markAccept()}alreadyGiven(){return"Y"===s.getCookie("COOKIE_CONSENT")||"N"===localStorage.getItem("COOKIE_CONSENT")}markAccept(){s.setCookie("COOKIE_CONSENT","Y",{expires:this.options.cookieExpires,path:"/"})}}n.defaults={acceptElement:'[data-action="accept"]',detailsElement:'[data-action="details"]',transitionDuration:300,cookieExpires:31536e3,config:null,transport:{}},t.ConsentToast=n}(this.BX.Techdir=this.BX.Techdir||{}); 2//# sourceMappingURL=script.js.map
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.