PageSourceSearch

https://bettybarclay.com/theme/0a79a29a39a199e238a87d616f6f570f/js…/did-find.tracking-snippet.ts.1d0bda.js

js bettybarclay.com collected 2026-09-26 04:47:11 UTC 11,145 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdid_find=self.webpackChunkdid_find||[]).push([[35038],{38(t,e,i){i.r(e),i.d(e,{default:()=>r});var n=i(502);class r extends n.A{constructor(t,e,i){super(t,e,i),this.initTracking=()=>{let t=document.querySelector(".js-didfind-tracking"),e=document.querySelector(".js-didfind-tracking-group"),i=window.performance.getEntriesByType("navigation")[0];if(this.didFi_tracking.didttfb=Math.round(i.responseStart-i.requestStart),this.didFi_tracking.diddi=Math.round(i.domInteractive),t){this.didFi_tracking.didfiid=t?.getAttribute("data-id")??null,this.didFi_tracking.didfiendpoint=t?.getAttribute("data-endpoint")??null,this.didFi_tracking.didfiterm=t?.getAttribute("data-term")??null,this.didFi_tracking.didfihost=t?.getAttribute("data-host")??null,this.didFi_tracking.didfifilter=t?.getAttribute("data-filter")??null,this.didFi_tracking.didficount=t?.getAttribute("data-count")??null,this.didFi_tracking.controller=t?.getAttribute("data-controller")??null,this.didFi_tracking.searchGroup=e?.getAttribute("data-ipgroup")??null,this.didFi_tracking.GLOBAL_PAGE_VIEW_ID=this.didFi_tracking.GLOBAL_PAGE_VIEW_ID||this.getCookie("__didpx_uid")+document.location.pathname+Math.round(1e10*Math.random()),window.DidFind=window.DidFind||{},window.DidFind.tracking={term:this.didFi_tracking.didfiterm,host:this.didFi_tracking.didfihost,filter:this.didFi_tracking.didfifilter,di:this.didFi_tracking.diddi,ttfb:this.didFi_tracking.didttfb,count:this.didFi_tracking.didficount,GLOBAL_PAGE_VIEW_ID:this.didFi_tracking.GLOBAL_PAGE_VIEW_ID,firedCampaignEvents:[]};let i={term:this.didFi_tracking.didfiterm,host:this.didFi_tracking.didfihost,filter:this.didFi_tracking.didfifilter,searchGroup:this.didFi_tracking.searchGroup,di:this.didFi_tracking.diddi,ttfb:this.didFi_tracking.didttfb,pagetype:this.didFi_tracking.controller};""!==this.didFi_tracking.didficount&&(i.count=this.didFi_tracking.didficount||null);try{((t,e,i,n,r,a,s)=>{t[n]||((r=t[n]=function(){r.process?r.process.apply(r,arguments):r.queue.push(arguments)}).queue=[],r.t=+new Date,(a=e.createElement(i)).async=1,a.src=this.didFi_tracking.didfiendpoint+"/src/didtrack.js?t="+864e5*Math.ceil(new Date/864e5),(s=e.getElementsByTagName(i)[0]).parentNode?.insertBefore(a,s))})(window,document,"script","didpx"),didpx("init",this.didFi_tracking.didfiid),didpx("event","pageload",i),this.didFi_tracking.listenToBasketButtons()}catch(t){console.error("Failed to initialize didFi_tracking.\n"+t)}}},this.getCookie=function(t){let e=("; "+document.cookie).split("; "+t+"=")??void 0;return e?.pop()?.split(";").shift()},this.listenToBasketButtons=()=>{let t=document.querySelector(".tobasket button");t?.addEventListener("click",this.didFi_tracking.createTrackingPixel)},this.createTrackingPixel=()=>{let t=$(this).parents(".js-oxProductForm").first();if(t.length>0){let e=t.find('[name="aid"]').val(),i=t.find('[name="parentid"]').val(),n=t.find(".js-didfind-params").attr("data-price"),r=$("#amountToBasket").val();setTimeout(function(){didpx("event","did_to_basket",{price:n,productid:e,amount:r,parentid:i})},250)}},this.initListingEventlistener=()=>{let t=document.querySelector(".cms-element-product-listing-wrapper");t&&window.PluginManager.getPluginInstanceFromElement(t,"Listing").$emitter.subscribe("Listing/afterRenderResponse",()=>{this.collectListingData(),this.collectFilterData()})},this.collectListingData=()=>{let t=document.querySelector(".js-didfind-helper"),e=document.querySelector(".js-didfind-helper"),i=document.querySelector(".js-didfind-tracking");if(t&&i){let e=t.getAttribute("data-result-count");e&&i.setAttribute("data-count",e)}if(e&&i){let t=e.getAttribute("data-result-filters");t&&i.setAttribute("data-filter",t)}},this.collectFilterData=()=>{let t={itemsContainer:".filter-panel-items-container",panel:".filter-panel-item",range:".filter-range",trackNode:".js-didfind-tracking"},e=["data-filter-multi-select-options","data-filter-boolean-options","data-filter-range-options","data-filter-price-options","data-filter-options"],i=function(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=t.querySelector?.(e);return n||i||console.warn(`Element not found: ${e}`),n},n=(t,e)=>Array.from(t.querySelectorAll?.(e)||[]),r=t=>{if(!t)return null;try{return JSON.parse(t.replace(/"/g,'"'))}catch{return null}},a=e=>e.closest(t.panel)??null,s=t=>{if(!t)return"";for(let i of e){let e=r(t.getAttribute(i))?.name;if(e&&String(e).trim())return String(e).trim()}return t.getAttribute("data-filter-name")||t.dataset?.filterName||""},o=(t,e)=>{let n=t.nextElementSibling;if(n&&"LABEL"===n.tagName)return(n.textContent||"").replace(/\s+/g," ").trim();if(t.id){let n=i(e,`label[for="${t.id}"]`)||document.querySelector(`label[for="${t.id}"]`);if(n)return(n.textContent||"").replace(/\s+/g," ").trim()}return""},d=t=>{if(!t)return!1;let e=t.name||"",i=t.id||"";return!!(/^(order|sort|sorting)$/i.test(e)||/sorting|order|sort/i.test(i))||!!t.closest(".sorting, [data-listing-sorting], .product-listing-sorting, .filter-sorting")},l=i(document,t.itemsContainer);if(!l){console.warn("[Filter] container not found:",t.itemsContainer);return}let c=new Map,u=(t,e)=>{let i=(t||"").trim(),n=(e||"").trim();i&&n&&(c.has(i)||c.set(i,new Set),c.get(i).add(n))};n(l,'input[type="checkbox"]:checked').forEach(t=>{u(s(a(t)),o(t,l))}),n(l,'input[type="radio"]:checked').forEach(t=>{d(t)||u(s(a(t)),o(t,l))}),n(l,"select").forEach(t=>{if(d(t))return;let e=s(a(t));
1Array.from(t.selectedOptions).forEach(t=>{u(e,(t.textContent||"").replace(/\s+/g," ").trim())})});let g=n(l,t.range);if(0===g.length&&n(l,t.panel).forEach(t=>{t.querySelectorAll('input[type="number"], input[type="text"]').length>=2&&g.push(t)}),g.forEach(e=>{let i=s(a(e)||e.closest(t.panel)),n=e.querySelector(".min-input")?.value?.trim()||"",r=e.querySelector(".max-input")?.value?.trim()||"";(n||r)&&u(i,n&&r?`${n} - ${r}`:n?`>= ${n}`:`<= ${r}`)}),0===c.size){console.warn("[Filter] no active filters found.");return}let h=i(document,t.trackNode),p=h?.getAttribute("data-category")?.trim()||null,f={};for(let[t,e]of(p&&(f.categories=p),c.entries()))f[t]=Array.from(e).join(", ");let m=performance.getEntriesByType("navigation")[0],b=m?Math.round(m.responseStart-m.requestStart):null,_=m?Math.round(m.domInteractive):null;this.didFi_tracking.didttfb=b,this.didFi_tracking.diddi=_;let k={term:h?.getAttribute("data-term")??null,gender_term:h?.getAttribute("data-gender-term")??null,host:h?.getAttribute("data-host")??null,filter:JSON.stringify(f),di:_,ttfb:b,count:h?.getAttribute("data-count")??null,customboost:null,pagetype:h?.getAttribute("data-controller")??null,language:(()=>{let t=t=>t?t.replace("_","-").toLowerCase().match(/^[a-z]{2}/)?.[0]??null:null;return t(document.documentElement.getAttribute("lang")||document.documentElement.lang)||t(document.querySelector('meta[http-equiv="content-language"], meta[name="language"]')?.content)||t(navigator.language||navigator.userLanguage)})()};window.DidFind&&window.DidFind.config?.TrackingHeaderIntegration&&setTimeout(()=>didpx("event","pageview",{...k}),250)},this.options={...e},this.didFi_tracking={createTrackingPixel(){},listenToBasketButtons(){}},this.setup()}init(){window.DidFind&&window.DidFind.config?.FindActive&&window.DidFind.config?.TrackingHeaderIntegration&&(void 0===this.didFi_tracking&&(this.didFi_tracking={createTrackingPixel(){},listenToBasketButtons(){}}),this.initTracking()),window.DidFind&&window.DidFind.config?.FindActive&&(this.initListingEventlistener(),this.collectListingData())}}},156(t){var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?o(Array.isArray(t)?[]:{},t,e):t}function r(t,e,i){return t.concat(e).map(function(t){return n(t,i)})}function a(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function s(t,e){try{return e in t}catch(t){return!1}}function o(t,i,d){(d=d||{}).arrayMerge=d.arrayMerge||r,d.isMergeableObject=d.isMergeableObject||e,d.cloneUnlessOtherwiseSpecified=n;var l,c,u=Array.isArray(i);return u!==Array.isArray(t)?n(i,d):u?d.arrayMerge(t,i,d):(c={},(l=d).isMergeableObject(t)&&a(t).forEach(function(e){c[e]=n(t[e],l)}
1),a(i).forEach(function(e){(!s(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(s(t,e)&&l.isMergeableObject(i[e])?c[e]=(function(t,e){if(!e.customMerge)return o;var i=e.customMerge(t);return"function"==typeof i?i:o})(e,l)(t[e],i[e],l):c[e]=n(i[e],l))}),c)}o.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return o(t,i,e)},{})},t.exports=o},502(t,e,i){i.d(e,{A:()=>s});class n{constructor(t){this._el=t,t.$emitter=this,this._listeners=[]}publish(t,e={},i=!1){let n=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(n),n}subscribe(t,e,i={}){let n=this,r=t.split("."),a=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=a;a=function(i){n.unsubscribe(t),e(i)}}return this.el.addEventListener(r[0],a),this.listeners.push({splitEventName:r,opts:i,cb:a}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>(i.splitEventName.sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}var r=i(156),a=i.n(r);class s{constructor(t,e={},i=!1){this.initialOptions={},this.options={},this.el=t,this.$emitter=new n(this.el),this._pluginName=this._getPluginName(i),this._initialized=!0,this.initialOptions=e,this._registerInstance()}setup(){this.options=this._mergeOptions(this.initialOptions),this.init()}_update(){this._initialized&&this.update()}update(){}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this);let t=window.PluginManager.getPlugin(this._pluginName,!1);t.has("instances")&&t.get("instances").push(this)}_getPluginName(t){return!1===t?this.constructor.name:t}_mergeOptions(t){let e=this._pluginName.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase(),i=this.parseJsonOrFail(e),n="";"function"==typeof this.el.getAttribute&&(n=this.el.getAttribute("data-".concat(e,"-options"))||"");let r=[this.constructor.options,this.options,t];i&&r.push(window.PluginConfigManager.get(this._pluginName,i));try{n&&r.push(JSON.parse(n))}catch(t){throw Error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message||""}`)}return a().all(r.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}parseJsonOrFail(t){if("function"!=typeof this.el.getAttribute)return"";let e=this.el.getAttribute(`data-${t}-config`)||"";try{return JSON.parse(e)}catch(t){return e}}}}}]);

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.