PageSourceSearch

https://www.beiersdorf.com.br/dist/bdfcw/modules/NewsFilterAction.64502fbd.js

js beiersdorf.com.br collected 2026-10-04 02:57:20 UTC 9,175 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3486],{26577(t,e,r){r.d(e,{_:()=>o});var o=function(){function t(){}return t.all=function(t){return t.match(/[^&\?]*=[^&]*/gi)||[]},t.addWithoutDecode=function(t,e){var r=this.all(t);for(var o in e){var n=encodeURIComponent(o),i=encodeURIComponent(e[o]);-1===t.search(new RegExp(o+"=","i"))?r.push(n+"="+i):t=this.updateWithoutDecode(t,{k:i})}return[t.split("?")[0],r.join("&")].join("?")},t.removeWithoutDecode=function(t,e){for(var r=0;r<e.length;r++)t=t.replace(new RegExp(e[r]+"=.*?&|&?"+e[r]+"=[^&]*","i"),"");return t},t.updateWithoutDecode=function(t,e){for(var r in e)t=t.replace(new RegExp("("+r+")(=)([^&]*)","i"),"$1$2"+e[r]);return t},t.getWithoutDecode=function(t,e){var r={};if(void 0!==e)for(var o=0;o<e.length;o++){var n=new RegExp(e[o]+"=([^&]*)").exec(t);null!=n&&void 0!==n[1]&&(r[e[o]]=n[1])}else{var i=this.all(t);for(o=0;o<i.length;o++){var a=/([^&\?]*)=([^&]*)/i.exec(i[o]);void 0!==a[1]&&void 0!==a[2]&&(r[a[1]]=a[2])}}return r},t}()},66133(t,e,r){var o=r(20017),n=r(5440),i=r(26577),a=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,n,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a};const s=function(){function t(t,e){void 0===e&&(e={}),this.element=t,this.options=e,this.options=(0,o.$E)(this.element,Object.assign(this.getDefaultOptions(),this.options)),this.filterTag=this.element.querySelector(this.options.filterTagSelector),this.ajaxUrl=this.filterTag.dataset.ajaxUrl,this.baseContextUrl=this.getBaseUrl(),this.filterAjaxUrl=this.filterTag.dataset.filterAjaxUrl,this.init()}return t.prototype.init=function(){return this.initTagsMap(),this.update(),this},t.prototype.initTagsMap=function(){var t=this.filterTag.getAttribute(this.options.tagsMapAttrs.tagsStrAttr),e=this.filterTag.getAttribute(this.options.tagsMapAttrs.tagCountAttr),r=this.filterTag.getAttribute(this.options.tagsMapAttrs.itemsCountAttr);return this.setTagsMap(t,e,r),this},t.prototype.setTagsMap=function(t,e,r){return this.tagsMap={tagsStr:window.atob(t),tagCount:parseInt(e),itemsCount:parseInt(r)},this},t.prototype.getFilters=function(){var t=this,e=[];return Array.from(this.element.querySelectorAll(this.options.filterItemSelector)).forEach(function(r){var o=r.dataset.key,n="True"===r.dataset.isAnd,i=Array.from(r.querySelectorAll(t.options.checkboxSelector)),a=[];i.forEach(function(t){a.push({node:t,key:t.value,checked:t.checked,index:parseInt(t.dataset.index)})});var s={node:r,key:o,values:a,isAnd:n,cache:[]};e.push(s)}),e},t.prototype.isItemTagged=function(t,e){var r=t*this.tagsMap.tagCount+e;return!!(this.tagsMap.tagsStr.charCodeAt(Math.floor(r/8))&1<<r%8)},t.prototype.isItemIncludedInFilter=function(t,e){for(var r=e.values,o=e.isAnd,n=!1,i=0;i<r.length;i++){var a=r[i];if(a.checked)if(n=!0,this.isItemTagged(t,a.index)){if(!o)return!0}else if(o)return!1}return!!o||!n},t.prototype.isItemVisible=function(t){for(var e=0;e<this.filters.length;e++){var r=this.filters[e],o=r.cache[t];if(!0!==o){if(!1===o)return!1;var n=this.isItemIncludedInFilter(t,r);if(r.cache[t]=n,!n)return!1}}return!0},t.prototype.getSearchFieldValue=function(){var t=this.element.querySelector(this.options.searchFieldSelector);return void 0!==t&&null!=t?t.value:""},t.prototype.getDateFieldValue=function(){var t=this.element.querySelector(this.options.dateSelector);return void 0!==t&&null!=t?t.value:""},t.prototype.countResults=function(){for(var t=0,e=0;e<this.tagsMap.itemsCount;e++)this.isItemVisible(e)&&t++;return t},t.prototype.countSimulateChecked=function(t,e,r){var o=this.filters[t],n=o.cache;o.cache=[];var i=o.values[e],a=i.checked;i.checked=r;var s=this.countResults();return i.checked=a,o.cache=n,s},t.prototype.countSimulateOnlyThisChecked=function(t,e){var r=this.filters[t];this.filters[t]={cache:[],values:[{index:r.values[e].index,checked:!0}]};var o=this.countResults();return this.filters[t]=r,o},t.prototype.setCount=function(t,e,r){var o;return o=(0,n.rQ)(t.node,this.options.countNodeSelector)||t.node.nextSibling.nextSibling,t.node.disabled=r,o.innerText=e,this},t.prototype.anyValueChecked=function(t){for(var e=t.values,r=0;r<e.length;r++)if(e[r].checked)return!0;return!1},t.prototype.getReloadUrl=function(){var t=this.encodeParams(this.getParams());return this.ajaxUrl+"&"+t},t.prototype.getFilterAjaxUrl=function(){var t=this.encodeParams(this.getParams());return this.filterAjaxUrl+"&"+t},t.prototype.getLoadMoreUrl=function(t){var e=this.encodeParams(this.getParams(t));return this.ajaxUrl+"&"+e},t.prototype.getParams=function(t){var e=this.getFilters(),r=this.getSearchFieldValue(),o=this.getDateFieldValue(),n={};return e.forEach(function(t){var e=[];
1t.values.forEach(function(t){t.checked&&e.push(t.key)}),e.length>0&&(n[t.key]=e)}),null!=r&&""!==r&&(n.query=[r]),null!=o&&""!==o&&(n.date=[o]),null!=t&&t>0&&(n.offset=[t]),n},t.prototype.getBaseUrl=function(){var t=location.href,e=this.getParamKeys();return i._.removeWithoutDecode(t,e)},t.prototype.getParamKeys=function(){var t=this.getFilters(),e=[];return t.forEach(function(t){e.push(t.key)}),e.push("query"),e.push("date"),e.push("offset"),e},t.prototype.encodeParams=function(t){return Object.entries(t).map(function(t){var e=a(t,2),r=e[0],o=e[1];return"".concat(encodeURIComponent(r),"=").concat(o.map(function(t){return encodeURIComponent(t)}).join(","))}).join("&")},t.prototype.update=function(){var t=this;this.filters=this.getFilters();var e=this.countResults();return this.filters.forEach(function(r,o){r.values.forEach(function(n,i){var a;if(n.checked)a="";else{var s=t.countSimulateChecked(o,i,!0);a=r.isAnd||!t.anyValueChecked(r)?s.toString():0===t.countSimulateOnlyThisChecked(o,i)?"0":"+".concat(s-e)}var l="0"===a;t.setCount(n,a,l)});var i=Array.from(r.values).every(function(t){return t.node.disabled});(0,n.p1)(r.node,"cw-filter-tag--disabled",i)}),this},t.prototype.updateUrl=function(){var t=this.getParams(),e=this.baseContextUrl;return e=i._.addWithoutDecode(e,t),history.pushState("","",e),this},t.prototype.reload=function(){var t=this.getReloadUrl();return this.executeAjax(t),this},t.prototype.loadMore=function(t){var e=this.getLoadMoreUrl(t);return this.executeLoadMoreAjax(e),this},t.prototype.scrollToResultNode=function(){-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>-1?(location.href="#",location.href="#result"):this.element.querySelector(this.options.resultNodeSelector).scrollIntoView(!0);return this},t.prototype.executeLoadMoreAjax=function(t){var e=this;this.options.callbacks.loadMoreTriggered();var r=document.querySelector(this.options.gridNodeSelector),o=t,i=new XMLHttpRequest;return i.onload=function(){if(i.status>=200&&i.status<300){var t=(0,n.Uo)(i.responseText),o=t.querySelector(e.options.gridNodeSelector)||t,a=o.dataset.resultCount,s=o.dataset.offset,l=o.dataset.loaded,u=e.element.querySelector(e.options.loadedNodeSelector),c=e.element.querySelector(e.options.filterTagSelector);null!=a&&(r.dataset.resultCount=a,c.dataset.resultCount=a),null!=s&&(r.dataset.offset=s,c.dataset.offset=s),null!=l&&(u.innerText=l),Array.from(o.children).forEach(function(t){r.appendChild(t)})}else console.log("The request failed!");e.options.callbacks.loadMoreLoaded()},i.open("GET",o),i.send(),this},t.prototype.executeAjax=function(t){var e=this;this.options.callbacks.loadMoreTriggered();var r=document.querySelector(this.options.gridNodeSelector),o=t,i=new XMLHttpRequest;return i.onload=function(){if(i.status>=200&&i.status<300){var t=(0,n.Uo)(i.responseText),o=t.querySelector(e.options.gridNodeSelector)||t,a=o.dataset.resultCount,s=o.dataset.offset,l=e.element.querySelector(e.options.resultNodeSelector),u=o.dataset.loaded,c=e.element.querySelector(e.options.loadedNodeSelector),d=e.element.querySelector(e.options.filterTagSelector);null!=a&&(l.innerHTML=a,r.dataset.resultCount=a,d.dataset.resultCount=a),null!=s&&(d.dataset.offset=s,r.dataset.offset=s),null!=u&&(c.innerText=u),""!==o.innerHTML&&(r.innerHTML=o.innerHTML)}else console.log("The request failed!");e.options.callbacks.loadMoreLoaded()},i.open("GET",o),i.send(),this},t.prototype.resetState=function(){return Array.from(this.filterTag.querySelectorAll(this.options.checkboxSelector+":checked")).forEach(function(t){return t.checked=!1}),this.update(),this},t.prototype.getDefaultOptions=function(){return{tagsMapAttrs:{tagsStrAttr:"data-atob",tagCountAttr:"data-tab-count",itemsCountAttr:"data-teaser-count"},filterTagSelector:".cw-tag-filter",filterItemSelector:".cw-tag-filter__item",dateSelector:".cw-tag-filter__date",loadMoreSelector:".cw-show-more",searchFieldSelector:".cw-search",checkboxSelector:".cw-cat-item__tag-value",countNodeSelector:".cw-cat-item__count",resultNodeSelector:".cw-news-results span",gridNodeSelector:".cw-news-list",loadedNodeSelector:".cw-show-more-container .loaded-title",callbacks:{loadMoreLoaded:function(){},loadMoreTriggered:function(){}}}},t}();r.d(e,["default",0,s])}}]);
2//# sourceMappingURL=/dist/bdfcw/./modules/NewsFilterAction.64502fbd.js.26772549.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.