import{c as e,e as t,K as i}from"./p-ae1fa3d6.js";import"./p-c55c67b2.js";import"./p-c2e91ee8.js";function o(i,o){return{klevuModifierId:"sendMerchandisingViewEvent",onResult:(r,n)=>{var s,d,a,c;if(!n.params){return r}const{id:u,abtest:l}=n.params;if(n.klevuFunctionId!=="categoryMerchandising"||!u){return r}const v=(s=n.queries)===null||s===void 0?void 0:s.find((e=>{var t,i;return Boolean((i=(t=e.settings)===null||t===void 0?void 0:t.query)===null||i===void 0?void 0:i.categoryPath)}));const g=(c=(a=(d=v===null||v===void 0?void 0:v.settings)===null||d===void 0?void 0:d.query)===null||a===void 0?void 0:a.categoryPath)!==null&&c!==void 0?c:"unknown";const p=r.queriesById(u);if(!p){return r}e.categoryMerchandisingView({categoryTitle:i,klevuCategory:g,products:p.records,pageStartsFrom:p.meta.offset,abTestId:l===null||l===void 0?void 0:l.abTestId,abTestVariantId:l===null||l===void 0?void 0:l.abTestVariantId,activeFilters:t(p),override:o});return r}}}const r={id:"categoryMerchandising",searchTerm:"*",limit:24};function n(e,t,...o){const n=Object.assign(Object.assign({},r),t);const s={id:n.id,typeOfRequest:i.CategoryNavigation,settings:Object.assign({query:{categoryPath:e,term:n.searchTerm}},n)};return{klevuFunctionId:"categoryMerchandising",queries:[s],modifiers:o,params:Object.assign(Object.assign({},n),{category:e})}}export{n as c,o as s};
//# sourceMappingURL=p-06379b33.js.map