1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[69197],{9197:(e,t,i)=>{i.r(t),i.d(t,{COOKIE_CONFIGURATION_CLOSE_OFF_CANVAS:()=>h,COOKIE_CONFIGURATION_UPDATE:()=>c,default:()=>f});var o=i(9568),n=i(1374),s=i(7),a=i(9062),l=i(3107),r=i(3327);let c="CookieConfiguration_Update",h="CookieConfiguration_CloseOffCanvas";class f extends o.Z{init(){this.lastState={active:[],inactive:[]},this._httpClient=new l.Z,this._registerEvents()}_registerEvents(){let{submitEvent:e2,buttonOpenSelector:t2,customLinkSelector:i2,globalButtonAcceptAllSelector:o2}=this.options;Array.from(document.querySelectorAll(t2)).forEach(t3=>{t3.addEventListener(e2,this.openOffCanvas.bind(this))}),Array.from(document.querySelectorAll(i2)).forEach(t3=>{t3.addEventListener(e2,this._handleCustomLink.bind(this))}),Array.from(document.querySelectorAll(o2)).forEach(t3=>{t3.addEventListener(e2,this._acceptAllCookiesFromCookieBar.bind(this))})}_registerOffCanvasEvents(){let{submitEvent:e2,buttonSubmitSelector:t2,buttonAcceptAllSelector:i2}=this.options,o2=this._getOffCanvas();if(o2){let s2=o2.querySelector(t2),a2=o2.querySelector(i2),l2=Array.from(o2.querySelectorAll('input[type="checkbox"]'));s2&&s2.addEventListener(e2,this._handleSubmit.bind(this,n.Z)),a2&&a2.addEventListener(e2,this._acceptAllCookiesFromOffCanvas.bind(this,n.Z)),l2.forEach(t3=>{t3.addEventListener(e2,this._handleCheckbox.bind(this))})}}_handleCustomLink(e2){e2.preventDefault(),this.openOffCanvas()}_handleUpdateListener(e2,t2){let i2=this._getUpdatedCookies(e2,t2);document.$emitter.publish(c,i2)}_getUpdatedCookies(e2,t2){let{lastState:i2}=this,o2={};return e2.forEach(e3=>{i2.inactive.includes(e3)&&(o2[e3]=!0)}),t2.forEach(e3=>{i2.active.includes(e3)&&(o2[e3]=!1)}),o2}openOffCanvas(e2){let{offCanvasPosition:t2}=this.options,i2=window.router["frontend.cookie.offcanvas"];this._hideCookieBar(),s.Z.open(i2,!1,this._onOffCanvasOpened.bind(this,e2),t2)}closeOffCanvas(e2){s.Z.close(),typeof e2=="function"&&e2()}_onOffCanvasOpened(e2){this._registerOffCanvasEvents(),this._setInitialState(),this._setInitialOffcanvasState(),PluginManager.initializePlugins(),typeof e2=="function"&&e2()}_hideCookieBar(){let e2=PluginManager.getPluginInstances("CookiePermission");e2&&e2[0]&&(e2[0]._hideCookieBar(),e2[0]._removeBodyPadding())}_setInitialState(){let e2=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t2=e2||this._getCookies("all"),i2=[],o2=[];t2.forEach(e3=>{let{cookie:t3,required:s2}=e3;n.Z.getItem(t3)||s2?i2.push(t3):o2.push(t3)}),this.lastState={active:i2,inactive:o2}}_setInitialOffcanvasState(){let e2=this.lastState.active,t2=this._getOffCanvas();e2.forEach(e3=>{let i2=t2.querySelector('[data-cookie="'.concat(e3,'"]'));i2.checked=!0,this._childCheckboxEvent(i2)})}_handleCheckbox(e2){let{parentInputClass:t2}=this.options,{target:i2}=e2;(i2.classList.contains(t2)?this._parentCheckboxEvent:this._childCheckboxEvent).call(this,i2)}_findParentEl(e2,t2){let i2=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;for(;e2&&!e2.classList.contains(i2);){if(e2.classList.contains(t2))return e2;e2=e2.parentElement}return null}_isChecked(e2){return!!e2.checked}_parentCheckboxEvent(e2){let{groupClass:t2}=this.options,i2=this._isChecked(e2),o2=this._findParentEl(e2,t2);this._toggleWholeGroup(i2,o2)}_childCheckboxEvent(e2){let{groupClass:t2}=this.options,i2=this._isChecked(e2),o2=this._findParentEl(e2,t2);this._toggleParentCheckbox(i2,o2)}_toggleWholeGroup(e2,t2){Array.from(t2.querySelectorAll("input")).forEach(t3=>{t3.checked=e2})}_toggleParentCheckbox(e2,t2){let{parentInputSelector:i2}=this.options,o2=Array.from(t2.querySelectorAll("input:not(".concat(i2,")"))),n2=Array.from(t2.querySelectorAll("input:not(".concat(i2,"):checked")));if(o2.length>0){let e3=t2.querySelector(i2);if(e3){let t3=n2.length>0,i3=t3&&n2.length!==o2.length;e3.checked=t3,e3.indeterminate=i3}}}_handleSubmit(){let e2=this._getCookies("active"),t2=this._getCookies("inactive"),{cookiePreference:i2}=this.options,o2=[],s2=[];t2.forEach(e3=>{let{cookie:t3}=e3;s2.push(t3),n.Z.getItem(t3)&&n.Z.removeItem(t3)}),e2.forEach(e3=>{let{cookie:t3,value:i3,expiration:s3}=e3;o2.push(t3),t3&&i3&&n.Z.setItem(t3,i3,s3)}),n.Z.setItem(i2,"1","30"),this._handleUpdateListener(o2,s2),this.closeOffCanvas(document.$emitter.publish(h))}
1acceptAllCookies(){if(!(arguments.length>0&&arguments[0]!==void 0&&arguments[0])){this._handleAcceptAll(),this.closeOffCanvas();return}r.Z.create(this.el);let t2=window.router["frontend.cookie.offcanvas"];this._httpClient.get(t2,e3=>{let t3=new DOMParser().parseFromString(e3,"text/html");this._handleAcceptAll(t3),r.Z.remove(this.el),this._hideCookieBar()})}_acceptAllCookiesFromCookieBar(){return this.acceptAllCookies(!0)}_acceptAllCookiesFromOffCanvas(){return this.acceptAllCookies()}_handleAcceptAll(){let e2=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t2=this._getCookies("all",e2);this._setInitialState(t2);let{cookiePreference:i2}=this.options;t2.forEach(e3=>{let{cookie:t3,value:i3,expiration:o2}=e3;t3&&i3&&n.Z.setItem(t3,i3,o2)}),n.Z.setItem(i2,"1","30"),this._handleUpdateListener(t2.map(e3=>{let{cookie:t3}=e3;return t3}),[])}_getCookies(){let e2=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"all",t2=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,{cookieSelector:i2}=this.options;return t2||(t2=this._getOffCanvas()),Array.from(t2.querySelectorAll(i2)).filter(t3=>{switch(e2){case"all":return!0;case"active":return this._isChecked(t3);case"inactive":return!this._isChecked(t3);default:return!1}}).map(e3=>{let{cookie:t3,cookieValue:i3,cookieExpiration:o2,cookieRequired:n2}=e3.dataset;return{cookie:t3,value:i3,expiration:o2,required:n2}})}_getOffCanvas(){let e2=a.Z?a.Z.getOffCanvas():[];return!!e2&&e2.length>0&&e2[0]}}f.options={offCanvasPosition:"left",submitEvent:"click",cookiePreference:"cookie-preference",cookieSelector:"[data-cookie]",buttonOpenSelector:".js-cookie-configuration-button button",buttonSubmitSelector:".js-offcanvas-cookie-submit",buttonAcceptAllSelector:".js-offcanvas-cookie-accept-all",globalButtonAcceptAllSelector:".js-cookie-accept-all-button",parentInputSelector:".offcanvas-cookie-parent-input",customLinkSelector:'[href="'.concat(window.router["frontend.cookie.offcanvas"],'"]'),entriesActiveClass:"offcanvas-cookie-entries--active",entriesClass:"offcanvas-cookie-entries",groupClass:"offcanvas-cookie-group",parentInputClass:"offcanvas-cookie-parent-input"}}}]);
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.