{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/A55TPw8oJtDToWtsjcDZ/efvR3aKErSMemVA7DBdP/filterMappings.js", "ssg:https://framerusercontent.com/modules/Hk0F8C2ru2KtdcLr7KmL/Ba9AVEeoCsQss96dqmUA/FC_CatalogDisplay.js"],
  "sourcesContent": ["export const getFilterValue=(property,options)=>{if(property.startsWith(\"variant_\")){return{type:\"variant\",value:{[property]:options.value}};}switch(property){case\"product_type\":case\"product_tag\":case\"collection\":return{type:property,value:options.value};case\"price\":return{type:\"price\",// value: options.price_ranges.map((range: string) => {\n//     const [min, max] = range.split('-').map(Number);\n//     return { min, max };\n// }),\nvalue:options.values.map(value=>{if(value.priceType===\"Under\"){return{min:null,max:value.max}// Handle \"Under\" case\n;}else if(value.priceType===\"Over\"){return{min:value.min,max:null}// Handle \"Over\" case\n;}else{const[min,max]=value.split(\"-\").map(Number);return{min,max}// Handle regular range\n;}})};case\"discount_amount\":return{type:\"discount_amount\",value:options.discount_amount_min?{min:options.discount_amount_min,max:options.discount_amount_max}:options.discount_amount};case\"discount_percent\":return{type:\"discount_percent\",value:options.discount_percent_min?{min:options.discount_percent_min,max:options.discount_percent_max}:options.discount_percent};case\"on_sale\":case\"in_stock\":case\"bundle\":case\"subscription\":return{type:property,value:options.value===\"true\"};default:return{type:property,value:\"\"};}};/**\n * Convert legacy filter names to new format and vice versa\n */export const convertFilterName=(name,toLegacy=false)=>{//console.log('convertFilterName input:', name, 'toLegacy:', toLegacy);\nconst mappings={// New format to legacy format\nproduct_type:\"product-type\",product_tag:\"product-tag\",on_sale:\"on-sale\",in_stock:\"in-stock\",bundle:\"bundles\",subscription:\"subscriptions\"};if(toLegacy){const result=mappings[name]||name;//console.log('convertFilterName output (toLegacy):', result);\nreturn result;}else{// Legacy format to new format\nconst reverseMappings={};Object.entries(mappings).forEach(([key,value])=>{reverseMappings[value]=key;});const result=reverseMappings[name]||name;//console.log('convertFilterName output (fromLegacy):', result);\nreturn result;}};/**\n * Parses URL parameters and converts them into filter state\n *\n * URL format conventions:\n * 1. Between different filter types: Always use AND logic with separate parameters\n *    (e.g., ?product_type=shirts&collection=summer)\n *\n * 2. Within the same filter type:\n *    - For collection, product_type, product_tag: Use comma-separated values for OR logic\n *      (e.g., ?product_type=shirts,pants,jackets means products that are shirts OR pants OR jackets)\n *    - For variant filters:\n *      a) Comma-separated values indicate OR logic\n *         (e.g., ?variant_color=blue,red,green means blue OR red OR green)\n *      b) Repeated parameters indicate AND logic\n *         (e.g., ?variant_color=blue&variant_size=large means blue AND large)\n */export const parseUrlFilters=urlParams=>{console.log(\"Parsing URL filters from:\",urlParams.toString());const filters={collection:{active:false,values:[]},product_type:{active:false,values:[]},product_tag:{active:false,values:[]},variant:{active:false,values:[]},price:{active:false,values:[]},discount_amount:{active:false,values:[]},discount_percent:{active:false,values:[]},on_sale:{active:false,value:true},in_stock:{active:false,value:true},bundle:{active:false,value:true},subscription:{active:false,value:true}};[\"collection\",\"product_type\",\"product_tag\",\"product-type\",\"product-tag\"].forEach(filterType=>{const value=urlParams.get(filterType);if(value){const normalizedType=convertFilterName(filterType);console.log(`Found filter ${filterType}, normalized to ${normalizedType}:`,value);// Split by comma for OR logic between values\nconst values=value.split(\",\").filter(Boolean);filters[normalizedType].values=values;filters[normalizedType].active=values.length>0;}});// Process variant filters (variant_color, variant_size, etc.)\n// Support both comma-separated values (OR logic) and multiple params with same name (AND logic between different options)\nArray.from(urlParams.keys()).forEach(key=>{if(key.startsWith(\"variant_\")){const variantName=key.replace(\"variant_\",\"\");const value=urlParams.get(key);if(value){// Decode the value first to handle any URL encoding\nconst decodedValue=decodeURIComponent(value);// Log the variant filter values being processed\nconsole.log(`Parsing variant filter ${key}:`,{rawValue:value,decodedValue,isMultiValue:decodedValue.includes(\",\")});// Split by comma for OR logic between values of the same option\nconst values=decodedValue.split(\",\").filter(Boolean);// Each value is an OR option for this variant type\nvalues.forEach(val=>{filters.variant.values.push({name:variantName,value:val.trim()});});console.log(`Found variant filter ${key}:`,{values,orLogic:\"Values within same variant type use OR logic\"});}}});filters.variant.active=filters.variant.values.length>0;// Process price filters\nconst priceRanges=urlParams.get(\"price\");const priceMax=urlParams.get(\"price_max\");const priceMin=urlParams.get(\"price_min\");filters.price={active:false,values:[]};if(priceRanges){// Handle regular price ranges\nconst ranges=priceRanges.split(\",\").map(range=>{const[min,max]=range.split(\"-\").map(Number);return{min,max,priceType:\"Range\"};});filters.price.values.push(...ranges);filters.price.active=true;}if(priceMax){// Handle \"Under\" price ranges\nconst maxValues=priceMax.split(\",\").map(Number);const underRanges=maxValues.map(max=>({min:null,max,priceType:\"Under\"}));filters.price.values.push(...underRanges);filters.price.active=true;}// Handle \"Over\" price ranges\nif(priceMin){const minValues=priceMin.split(\",\").map(Number);minValues.forEach(min=>{filters.price.values.push({min,max:null,priceType:\"Over\"});});filters.price.active=true;}// Process discount filters\nconst discountAmount=urlParams.get(\"discount_amount\");if(discountAmount){const ranges=discountAmount.split(\",\").map(range=>{const[min,max]=range.split(\"-\").map(Number);return{min,max};});filters.discount_amount={active:true,values:ranges};}const discountAmountMin=urlParams.get(\"discount_amount_min\");if(discountAmountMin){const minValues=discountAmountMin.split(\",\").map(Number);if(!filters.discount_amount){filters.discount_amount={active:true,values:[]};}// Add each min value as a range with null max\nminValues.forEach(min=>{filters.discount_amount.values.push({min,max:null});});filters.discount_amount.active=true;}const discountPercent=urlParams.get(\"discount_percent\");if(discountPercent){const ranges=discountPercent.split(\",\").map(range=>{const[min,max]=range.split(\"-\").map(Number);return{min,max};});filters.discount_percent={active:true,values:ranges};}const discountPercentMin=urlParams.get(\"discount_percent_min\");if(discountPercentMin){const minValues=discountPercentMin.split(\",\").map(Number);if(!filters.discount_percent){filters.discount_percent={active:true,values:[]};}// Add each min value as a range with null max\nminValues.forEach(min=>{filters.discount_percent.values.push({min,max:null});});filters.discount_percent.active=true;}[\"on_sale\",\"in_stock\",\"bundle\",\"subscription\"].forEach(filterType=>{const value=urlParams.get(filterType);if(value===\"true\"){filters[filterType]={active:true,value:true};}});return filters;};/**\n * Updates URL parameters based on current filter state\n *\n * URL format conventions:\n * 1. Between different filter types: Always use AND logic with separate parameters\n *\n * 2. Within the same filter type:\n *    - For collection, product_type, product_tag: Use comma-separated values for OR logic\n *    - For variant filters:\n *      a) Group variants by name and use comma-separated values for OR logic within same variant type\n *      b) Different variant types use AND logic with separate parameters\n */export const updateUrlWithFilters=(filters,url)=>{console.log(\"Updating URL with filters:\",filters);// Clear existing filter params\nArray.from(url.searchParams.keys()).filter(key=>key.startsWith(\"variant_\")||[\"product_type\",\"product_tag\",\"collection\",\"price\",\"price_min\",\"price_max\",\"discount_amount\",\"discount_amount_min\",\"discount_percent\",\"discount_percent_min\",\"on_sale\",\"in_stock\",\"bundle\",\"subscription\",// Also include legacy filter names\n    \"product-type\",\"product-tag\",\"on-sale\",\"in-stock\",\"bundles\",\"subscriptions\"].includes(key)).forEach(key=>url.searchParams.delete(key));[\"collection\",\"product_type\",\"product_tag\"].forEach(filterType=>{if(filters[filterType]?.active&&filters[filterType]?.values?.length>0){url.searchParams.set(filterType,filters[filterType].values.join(\",\"));console.log(`Set URL param ${filterType}=`,filters[filterType].values.join(\",\"));}});// Add variant filters\n// Group variant values by name, and each group uses comma-separated values for OR logic\nif(filters.variant?.active&&filters.variant?.values?.length>0){// Group variant values by name\nconst variantGroups={};filters.variant.values.forEach(variant=>{// Use lowercase name for case-insensitive grouping\nconst normalizeName=`variant_${variant.name}`;if(!variantGroups[normalizeName]){variantGroups[normalizeName]=[];}// Avoid adding duplicate values\nif(!variantGroups[normalizeName].some(v=>v.toLowerCase()===variant.value.toLowerCase())){variantGroups[normalizeName].push(variant.value);}});// Add each variant group to URL with comma-separated values (OR logic)\nObject.entries(variantGroups).forEach(([key,values])=>{// Don't encode the values here as URLSearchParams will handle that\nurl.searchParams.set(key,values.join(\",\"));console.log(`Set URL param ${key}=`,values.join(\",\"),\"(OR logic between values)\");});}// Add price filters\nif(filters.price?.active&&filters.price.values?.length>0){// const regularRanges = [];\n// const underMaxValues = [];\n// const overMinValues = [];\nconst regularRanges=[];const underMaxValues=[];const overMinValues=[];filters.price.values.forEach(range=>{if(range.priceType===\"Under\"){underMaxValues.push(range.max);}else if(range.priceType===\"Over\"){overMinValues.push(range.min);}else{regularRanges.push(`${range.min}-${range.max}`);}});if(regularRanges.length>0){url.searchParams.set(\"price\",regularRanges.join(\",\"));}if(underMaxValues.length>0){url.searchParams.set(\"price_max\",underMaxValues.join(\",\"));}if(overMinValues.length>0){url.searchParams.set(\"price_min\",overMinValues.join(\",\"));}}// Add discount filters\nif(filters.discount_amount?.active&&filters.discount_amount.values?.length>0){const discountRanges=[];const discountMinValues=[];filters.discount_amount.values.forEach(range=>{if(range.max===null){// This is an \"Over\" type discount\ndiscountMinValues.push(range.min);}else{// This is a regular range\ndiscountRanges.push(`${range.min}-${range.max}`);}});if(discountRanges.length>0){url.searchParams.set(\"discount_amount\",discountRanges.join(\",\"));}if(discountMinValues.length>0){url.searchParams.set(\"discount_amount_min\",discountMinValues.join(\",\"));}}if(filters.discount_percent?.active&&filters.discount_percent.values?.length>0){const discountPercentRanges=[];const discountPercentMinValues=[];filters.discount_percent.values.forEach(range=>{if(range.max===null){// This is an \"Over\" type discount\ndiscountPercentMinValues.push(range.min);}else{// This is a regular range\ndiscountPercentRanges.push(`${range.min}-${range.max}`);}});if(discountPercentRanges.length>0){url.searchParams.set(\"discount_percent\",discountPercentRanges.join(\",\"));}if(discountPercentMinValues.length>0){url.searchParams.set(\"discount_percent_min\",discountPercentMinValues.join(\",\"));}}[\"on_sale\",\"in_stock\",\"bundle\",\"subscription\"].forEach(filterType=>{if(filters[filterType]?.active){url.searchParams.set(filterType,\"true\");}});};\nexport const __FramerMetadata__ = {\"exports\":{\"getFilterValue\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"FilterValue\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"updateUrlWithFilters\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"parseUrlFilters\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"convertFilterName\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./filterMappings.map", "/*\n * Framer Commerce\n * Confidential and Proprietary - All Rights Reserved\n * Unauthorized use, reproduction, distribution, or disclosure of this\n * source code or any related information is strictly prohibited.\n *\n * This software is the exclusive property of Framer Commerce (\"Company\").\n * It is considered highly confidential and proprietary information.\n *\n * Any use, copying, modification, distribution, or sharing of this software,\n * in whole or in part, without the express written permission of the Company\n * is strictly prohibited and may result in legal action.\n *\n * DISCLAIMER: This software does not provide any express or\n * implied warranties, including, but not limited to, the implied warranties\n * of merchantability and fitness for a particular purpose. In no event shall\n * Framer Commerce be liable for any direct, indirect, incidental, special,\n * exemplary, or consequential damages (including, but not limited to, procurement\n * of substitute goods or services; loss of use, data, or profits; or business\n * interruption) however caused and on any theory of liability, whether in\n * contract, strict liability, or tort (including negligence or otherwise)\n * arising in any way out of the use of this software, even if advised of\n * the possibility of such damage.\n *\n * Any unauthorized possession, use, copying, distribution, or dissemination\n * of this software will be considered a breach of confidentiality and may\n * result in legal action.\n *\n * For inquiries, contact:\n * Framer Commerce\n * Email: hello@framercommerce.com\n *\n * \u00A9 2025 Butter Supply Inc. All Rights Reserved.\n */function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{debounce}from\"lodash-es\";import{parseUrlFilters,updateUrlWithFilters}from\"https://framerusercontent.com/modules/A55TPw8oJtDToWtsjcDZ/efvR3aKErSMemVA7DBdP/filterMappings.js\";// Global state management to prevent duplicate instances\nconst globalSortState={instances:new Set,eventListeners:new Map,cleanup:()=>{globalSortState.instances.clear();globalSortState.eventListeners.forEach((listener,event)=>{window.removeEventListener(event,listener);});globalSortState.eventListeners.clear();},lastUrl:typeof window!==\"undefined\"?window.location.href:\"\",isBackToFilter:false};// Ensure cleanup on page unload\nif(typeof window!==\"undefined\"){window.addEventListener(\"beforeunload\",globalSortState.cleanup);}// Helper function to find 13-digit number\nfunction findDeep13DigitNumber(obj){if(typeof obj===\"string\"){const match=obj.match(/\\d{12,}/);if(match)return match[0];return null;}if(!obj||typeof obj!==\"object\")return null;for(const key in obj){if(Array.isArray(obj[key])||typeof obj[key]===\"object\"){const found=findDeep13DigitNumber(obj[key]);if(found)return found;}else if(typeof obj[key]===\"string\"){const match=obj[key].match(/\\d{12,}/);if(match)return match[0];}}return null;}class ErrorBoundary extends React.Component{static getDerivedStateFromError(error){return{hasError:true,error};}componentDidCatch(error,errorInfo){console.error(\"CMS Error:\",error,errorInfo);}render(){if(this.state.hasError){return /*#__PURE__*/_jsx(\"div\",{style:{padding:20,color:\"red\"},children:\"Something went wrong loading the CMS content.\"});}// @ts-ignore: TypeScript doesn't recognize props in this context\nreturn this.props.children;}constructor(props){super(props);_define_property(this,\"state\",{hasError:false,error:null});}}// Let's add a helper function for consistent logging\nconst logDebug=(component,action,data)=>{// console.log(`\uD83D\uDD0D [${component}] ${action}:`, data)\n};// Helper function to get active search fields based on scope settings\nfunction getActiveSearchFields(scope){const fields=[];if(scope?.title)fields.push(\"title\");if(scope?.productType)fields.push(\"productType\");if(scope?.productTag)fields.push(\"tags\");if(scope?.collection)fields.push(\"collections\");if(scope?.vendor)fields.push(\"vendor\");if(scope?.variants)fields.push(\"variants\");return fields;}/**\n * @framerDisableUnlink\n */export default function FC_CatalogDisplay(props){// State declarations at the top of the component\nconst[isLoading,setIsLoading]=React.useState(true);const[sortedChildren,setSortedChildren]=React.useState(null);const[products,setProducts]=React.useState([]);const[favorites,setFavorites]=React.useState([]);const[isTransitioning,setIsTransitioning]=React.useState(false);const[isSettling,setIsSettling]=React.useState(false);// console.log(\"\uD83D\uDEA8\uD83D\uDEA8\uD83D\uDEA8 COMPONENT MOUNTED \uD83D\uDEA8\uD83D\uDEA8\uD83D\uDEA8\", {\n//     hasCollection: !!props.Collection,\n//     hasProducts:\n//         typeof window !== \"undefined\" && !!window.shopXtools?.products,\n//     url: typeof window !== \"undefined\" ? window.location.href : null,\n// })\n// Keep a log of component initialization\nlogDebug(\"ProductSort\",\"Component initializing\",{props:Object.keys(props)});const{Collection,pageType}=props;// console.log(\"initialSearchState\", props.Search.initialSearchState)\nconst transitionTimeoutRef=React.useRef(null);const settlingTimeoutRef=React.useRef(null);const lastUpdateRef=React.useRef(null);const urlParams=typeof window!==\"undefined\"?new URLSearchParams(window.location.search):new URLSearchParams;// Add pagination state\nconst[currentPage,setCurrentPage]=React.useState(()=>{if(typeof window!==\"undefined\"){const pageParam=urlParams.get(\"page\");return pageParam?parseInt(pageParam):1;}return 1;});const[hasMore,setHasMore]=React.useState(false);const observerRef=React.useRef(null);const loadMoreRef=React.useRef(null);const itemsPerPage=props.Pagination?.itemsPerPage||8;// Add state to maintain full product list\nconst[allProducts,setAllProducts]=React.useState([]);const[displayedProducts,setDisplayedProducts]=React.useState([]);// Function to get paginated products\nconst getPaginatedProducts=React.useCallback(products=>{if(!props.Pagination?.enable||!Array.isArray(products))return products;const startIndex=0// Always start from beginning for infinite scroll\n;const endIndex=currentPage*itemsPerPage;// console.log(\"[CMS] Paginating products:\", {\n//     type: props.Pagination.type,\n//     currentPage,\n//     itemsPerPage,\n//     startIndex,\n//     endIndex,\n//     totalProducts: products.length,\n// })\n// Update hasMore based on remaining products\nconst hasMoreItems=endIndex<products.length;setHasMore(hasMoreItems);const paginatedProducts=products.slice(0,endIndex);// console.log(\"[CMS] Pagination result:\", {\n//     inputLength: products.length,\n//     outputLength: paginatedProducts.length,\n//     startIndex,\n//     endIndex,\n//     hasMore: hasMoreItems,\n// })\nreturn paginatedProducts;},[currentPage,itemsPerPage,props.Pagination?.enable]);// Add effect to handle URL pagination parameters\nReact.useEffect(()=>{if(typeof window===\"undefined\"||!props.Pagination?.enable)return;const url=new URL(window.location.href);const urlParams=new URLSearchParams(url.search);// // Update page parameter\n// if (props.Pagination?.enable) {\n//     if (currentPage > 1) {\n//         urlParams.set(\"page\", currentPage.toString())\n//     } else {\n//         urlParams.delete(\"page\")\n//     }\n// } else {\n//     urlParams.delete(\"page\")\n// }\n// // Update URL without triggering a page reload\n// window.history.pushState(\n//     { page: currentPage },\n//     \"\",\n//     url.toString()\n// )\nif(currentPage>1){urlParams.set(\"page\",currentPage.toString());}else{urlParams.delete(\"page\");}const newUrl=`${url.pathname}?${urlParams.toString()}`;if(newUrl!==window.location.pathname+window.location.search){//console.log(\"\uD83D\uDCCC Pushing new page URL:\", newUrl)\nwindow.history.pushState({page:currentPage},\"\",newUrl);}},[currentPage,props.Pagination?.enable]);// Update the infinite scroll effect\nReact.useEffect(()=>{if(!props.Pagination?.enable||props.Pagination?.type!==\"infinite\"||typeof window===\"undefined\")return;// console.log(\"[CMS] Setting up infinite scroll observer\", {\n//     hasMore,\n//     isLoading,\n//     currentPage,\n//     loadMoreRefExists: !!loadMoreRef.current,\n// })\nconst observer=new IntersectionObserver(entries=>{const target=entries[0];// console.log(\"[CMS] Intersection observed:\", {\n//     isIntersecting: target.isIntersecting,\n//     hasMore,\n//     isLoading,\n//     currentPage,\n// })\nif(target.isIntersecting&&hasMore&&!isLoading){//console.log(\"[CMS] Loading more items, incrementing page\")\nsetCurrentPage(prev=>prev+1);}},{root:null,rootMargin:\"100px\",threshold:.1});if(loadMoreRef.current){//console.log(\"[CMS] Observing load more trigger element\")\nobserver.observe(loadMoreRef.current);}return()=>{if(observer){//console.log(\"[CMS] Cleaning up observer\")\nobserver.disconnect();}};},[hasMore,props.Pagination?.enable,props.Pagination?.type,isLoading,currentPage]);// Update the sorted children wrapper to include the infinite scroll trigger\nconst updateSortedChildrenWithTransition=newChildren=>{if(!newChildren){console.warn(\"[CMS] Received null/undefined children\");return;}// console.log(\"[CMS] Starting transition update:\", {\n//     totalChildren: newChildren.length,\n//     currentPage,\n//     paginationType: props.Pagination?.type,\n//     hasMore,\n// })\n// Store the full list\nsetAllProducts(newChildren);// Get paginated subset for display\nconst paginatedChildren=getPaginatedProducts(newChildren);// Add infinite scroll trigger if needed\nif(props.Pagination?.enable&&props.Pagination?.type===\"infinite\"&&hasMore&&paginatedChildren.length>0){//console.log(\"[CMS] Adding infinite scroll trigger\")\npaginatedChildren.push(/*#__PURE__*/_jsx(\"div\",{ref:loadMoreRef,style:{width:\"100%\",height:\"50px\",gridColumn:\"1 / -1\",opacity:0,pointerEvents:\"none\"}},\"infinite-scroll-trigger\"));}logDebug(\"ProductSort\",\"Updating sorted children with transition\",{totalChildren:newChildren.length,paginatedChildren:paginatedChildren.length,currentPage,isSettling,hasMore});const now=Date.now();if(lastUpdateRef.current&&now-lastUpdateRef.current<100){setIsSettling(true);if(settlingTimeoutRef.current){clearTimeout(settlingTimeoutRef.current);}//console.log(\"[CMS] Delaying transition\")\nsettlingTimeoutRef.current=setTimeout(()=>{setIsSettling(false);setDisplayedProducts(paginatedChildren);performTransition(paginatedChildren);},150);}else{//console.log(\"[CMS] Immediate transition\")\nsetDisplayedProducts(paginatedChildren);performTransition(paginatedChildren);}lastUpdateRef.current=now;};// Add logging for URL parameters\nif(typeof window!==\"undefined\"){logDebug(\"ProductSort\",\"URL parameters on init\",{url:window.location.href,params:Object.fromEntries(urlParams.entries())});}const[sortConfig,setSortConfig]=React.useState(()=>{// First try to get sort from URL parameter\nif(typeof window!==\"undefined\"){const urlParams=new URLSearchParams(window.location.search);const sortParam=urlParams.get(\"sort\");logDebug(\"ProductSort\",\"Sort parameter from URL\",{sortParam});if(sortParam){// Map URL sort parameter to internal sort configuration\nswitch(sortParam){case\"relevance\":return{type:\"relevancy\",sortBy:\"relevancy\",sortDirection:null};case\"title_asc\":return{type:\"name\",sortBy:\"name\",sortDirection:\"aToZ\"};case\"title_desc\":return{type:\"name\",sortBy:\"name\",sortDirection:\"zToA\"};case\"price_asc\":return{type:\"price\",sortBy:\"price\",sortDirection:\"lowToHigh\"};case\"price_desc\":return{type:\"price\",sortBy:\"price\",sortDirection:\"highToLow\"};case\"newest\":return{type:\"created\",sortBy:\"created\",sortDirection:\"newest\"};case\"best_selling\":return{type:\"best-selling\",sortBy:\"best-selling\",sortDirection:null};}}// Then check session storage\nconst storedSort=sessionStorage.getItem(\"sortBy\");if(storedSort){switch(storedSort){case\"relevance\":return{type:\"relevancy\",sortBy:\"relevancy\",sortDirection:null};case\"title_asc\":return{type:\"name\",sortBy:\"name\",sortDirection:\"aToZ\"};case\"title_desc\":return{type:\"name\",sortBy:\"name\",sortDirection:\"zToA\"};case\"price_asc\":return{type:\"price\",sortBy:\"price\",sortDirection:\"lowToHigh\"};case\"price_desc\":return{type:\"price\",sortBy:\"price\",sortDirection:\"highToLow\"};case\"newest\":return{type:\"created\",sortBy:\"created\",sortDirection:\"newest\"};case\"best_selling\":return{type:\"best-selling\",sortBy:\"best-selling\",sortDirection:null};}}}// If no URL parameter or session storage, use the default sort from props\nswitch(props.defaultSort){case\"relevance\":return{type:\"relevancy\",sortBy:\"relevancy\",sortDirection:null};case\"title_asc\":return{type:\"name\",sortBy:\"name\",sortDirection:\"aToZ\"};case\"title_desc\":return{type:\"name\",sortBy:\"name\",sortDirection:\"zToA\"};case\"price_asc\":return{type:\"price\",sortBy:\"price\",sortDirection:\"lowToHigh\"};case\"price_desc\":return{type:\"price\",sortBy:\"price\",sortDirection:\"highToLow\"};case\"newest\":return{type:\"created\",sortBy:\"created\",sortDirection:\"newest\"};case\"best_selling\":return{type:\"best-selling\",sortBy:\"best-selling\",sortDirection:null};default:return{type:\"relevancy\",sortBy:\"relevancy\",sortDirection:null};}});const[filters,setFilters]=React.useState(()=>{//console.log(\"props.display for scopes\", props.display)\n// Create the initial filter state based on props\nconst initialFilters={collection:{active:props.display===\"Collection\"&&props.value?true:false,values:props.display===\"Collection\"&&props.value?[props.value]:[]},product_type:{active:props.display===\"Product Type\"&&props.value?true:false,values:props.display===\"Product Type\"&&props.value?[props.value]:[]},product_tag:{active:props.display===\"Product Tag\"&&props.value?true:false,values:props.display===\"Product Tag\"&&props.value?[props.value]:[]},on_sale:{active:false,value:true},in_stock:{active:false,value:true},bundle:{active:false,value:true},subscription:{active:false,value:true},price:{active:false,values:[]},discount_amount:{active:false,values:[]},discount_percent:{active:false,values:[]},variant:{active:false,values:[]}};// Log the initial filter state\nlogDebug(\"ProductSort\",\"Initial filter state created\",{display:props.display,value:props.value,filters:initialFilters,activeFilters:Object.entries(initialFilters).filter(([key,filter])=>filter.active).reduce((acc,[key,filter])=>({...acc,[key]:filter}),{})});// First try to parse filters directly from URL\nif(typeof window!==\"undefined\"){const url=new URL(window.location.href);logDebug(\"ProductSort\",\"Attempting to parse filters from URL for scopes\",{url:url.toString(),search:url.search});try{const urlFilters=parseUrlFilters(url.searchParams);logDebug(\"ProductSort\",\"Filters parsed from URL for scopes\",urlFilters);if(urlFilters&&Object.keys(urlFilters).length>0){const activeFilters=Object.entries(urlFilters).filter(([key,filter])=>filter.active).reduce((acc,[key,filter])=>({...acc,[key]:filter}),{});logDebug(\"ProductSort\",\"Active filters from URL for scopes\",activeFilters);if(Object.keys(activeFilters).length>0){// Merge URL filters with initial scope instead of replacing them\nconst mergedFilters={...initialFilters};logDebug(\"ProductSort\",\"Merged filters from URL for scopes\",mergedFilters);// For each filter type that has an initial scope, ensure it's preserved\nif(props.display===\"Collection\"&&props.value){mergedFilters.collection={active:true,values:[props.value]};}else if(props.display===\"Product Type\"&&props.value){mergedFilters.product_type={active:true,values:[props.value]};}else if(props.display===\"Product Tag\"&&props.value){mergedFilters.product_tag={active:true,values:[props.value]};}// console.log(\"Props - Tag:\", {\n//     active:\n//         props.display === \"Product Tag\" && props.value\n//             ? true\n//             : false,\n//     values:\n//         props.display === \"Product Tag\" && props.value\n//             ? [props.value]\n//             : [],\n// })\n// console.log(\"Props:\", props.display)\n// Then apply URL filters for other filter types\nObject.entries(urlFilters).forEach(([key,filter])=>{if(key===\"collection\"&&props.display===\"Collection\"&&props.value||key===\"product_type\"&&props.display===\"Product Type\"&&props.value||key===\"product_tag\"&&props.display===\"Product Tag\"&&props.value){// Merge values for the scoped filter\nmergedFilters[key]={active:true,values:[...new Set([...mergedFilters[key].values,...filter.values||[]])]};}else{// For non-scoped filters, use the URL filter\nmergedFilters[key]=filter;}});logDebug(\"ProductSort\",\"Merged filters\",mergedFilters);return mergedFilters;}}}catch(error){console.error(\"\u274C Error parsing URL filters:\",error);}}// If no URL filters or error, return the initial filters\nreturn initialFilters;});// Add search state\nconst[searchConfig,setSearchConfig]=React.useState(()=>{// Initialize from URL parameter if it exists\nif(typeof window!==\"undefined\"){const urlParams=new URLSearchParams(window.location.search);const searchParam=urlParams.get(\"search\");// console.log(\"\uD83D\uDD0D Initializing search from URL:\", {\n//     url: window.location.href,\n//     searchParam,\n//     allParams: Object.fromEntries(urlParams.entries()),\n// })\nif(searchParam){return{term:searchParam,fields:getActiveSearchFields(props.Search?.Scope),active:true};}}return{term:\"\",fields:getActiveSearchFields(props.Search?.Scope),active:false};});// Add effect to update search fields when scope changes\nReact.useEffect(()=>{setSearchConfig(prev=>({...prev,fields:getActiveSearchFields(props.Search?.Scope)}));},[props.Search?.Scope]);// Adjust initial state based on search settings\nReact.useEffect(()=>{if(props.Search.initialSearchState===\"none\"&&props.Search.enableSearch&&!searchConfig.term){// console.log(\"Applying initial 'none' state\")\nsetSortedChildren([])// Start with no products displayed\n;}},[props.Search.initialSearchState,props.Search.enableSearch,searchConfig.term]);// Memoize event handlers\nconst handleProductsReady=React.useCallback(e=>{logDebug(\"ProductSort\",\"Products ready event received\",{eventType:e.type,shopXToolsAvailable:typeof window!==\"undefined\"&&!!window.shopXtools,shopXProductsCount:typeof window!==\"undefined\"?window.shopXtools?.products?.length:0});// First try to get products from shopXtools\nif(typeof window!==\"undefined\"&&window.shopXtools?.products){// console.log(\"\uD83D\uDEA8 Setting products from shopXtools \uD83D\uDEA8\", {\n//     count: window.shopXtools.products.length,\n//     sample: window.shopXtools.products[0]?.node,\n//     sampleTitle:\n//         window.shopXtools.products[0]?.node?.title ||\n//         \"No title\",\n//     hasNode: !!window.shopXtools.products[0]?.node,\n//     searchConfig: searchConfig,\n//     searchActive: searchConfig.active,\n//     searchTerm: searchConfig.term,\n// })\n// Important: shopXtools.products is already in the correct format with node structure\nsetProducts(window.shopXtools.products);// After setting products, force a re-filter if search is active\nif(searchConfig.active&&searchConfig.term){// console.log(\n//     \"\uD83D\uDD0D Active search detected during product load, forcing re-filter\"\n// )\nsetSortedChildren(null);}}else if(Array.isArray(e.detail.products)){// console.log(\"\uD83D\uDEA8 Setting products from event \uD83D\uDEA8\", {\n//     count: e.detail.products.length,\n//     sample: e.detail.products[0],\n//     sampleTitle:\n//         e.detail.products[0]?.node?.title || \"No title\",\n//     hasNode: !!e.detail.products[0]?.node,\n//     searchConfig: searchConfig,\n//     searchActive: searchConfig.active,\n//     searchTerm: searchConfig.term,\n// })\nsetProducts(e.detail.products);// After setting products, force a re-filter if search is active\nif(searchConfig.active&&searchConfig.term){// console.log(\n//     \"\uD83D\uDD0D Active search detected during product load, forcing re-filter\"\n// )\nsetSortedChildren(null);}}},[searchConfig]);const handleSortChange=React.useCallback(e=>{setSortConfig(e.detail);setSortedChildren(null)// Reset sorted children to trigger resort\n;},[]);const handleFilterReset=React.useCallback(e=>{// console.log(\"Resetting filters\", e)\n// Check if we should reset to initial scope\nconst shouldResetToInitialScope=e?.detail?.resetToInitialScope===true;// console.log(\n//     \"Should reset to initial scope:\",\n//     shouldResetToInitialScope\n// )\nif(shouldResetToInitialScope){// Create a reset state that respects the initial filter scope\nconst resetFilters={collection:{active:props.display===\"Collection\"&&props.value?true:false,values:props.display===\"Collection\"&&props.value?[props.value]:[]},product_type:{active:props.display===\"Product Type\"&&props.value?true:false,values:props.display===\"Product Type\"&&props.value?[props.value]:[]},product_tag:{active:props.display===\"Product Tag\"&&props.value?true:false,values:props.display===\"Product Tag\"&&props.value?[props.value]:[]},on_sale:{active:false,value:true},in_stock:{active:false,value:true},bundle:{active:false,value:true},subscription:{active:false,value:true},price:{active:false,values:[]},discount_amount:{active:false,values:[]},discount_percent:{active:false,values:[]},variant:{active:false,values:[]}};// console.log(\"Resetting to initial filter scope:\", resetFilters)\nsetFilters(resetFilters);}else{// Reset all filters to inactive\nsetFilters({collection:{active:false,values:[]},product_type:{active:false,values:[]},product_tag:{active:false,values:[]},on_sale:{active:false,value:true},in_stock:{active:false,value:true},bundle:{active:false,value:true},subscription:{active:false,value:true},price:{active:false,values:[]},discount_amount:{active:false,values:[]},discount_percent:{active:false,values:[]},variant:{active:false,values:[]}});}setSortedChildren(null)// Reset sorted children to trigger filter reset\n;},[props.display,props.value]);const handleFilter=React.useCallback(e=>{const{type,value,active}=e.detail;// console.log(\n//     \"Received filter event:\",\n//     e?.detail || \"Reset filter event is not receieved\"\n// )\nlogDebug(\"ProductSort\",\"Processing filter event\",{type:e.detail.type,group:e.detail.group,active:e.detail.active,value:e.detail.value,filterType:e.detail.filterType,componentId:e.detail.componentId});// Check if this filter matches the initial filter scope\nconst isInitialFilter=type===\"collection\"&&props.display===\"Collection\"&&props.value===value||type===\"product_type\"&&props.display===\"Product Type\"&&props.value===value||type===\"product_tag\"&&props.display===\"Product Tag\"&&props.value===value;// If this is the initial filter and we're trying to deactivate it, ignore the event\nif(isInitialFilter&&!active){// console.log(\"Ignoring deactivation of initial filter scope\")\nreturn;}// Continue with normal filter handling\nsetFilters(prev=>{const newFilters={...prev};const{type,group,active,value,filterType,variantStockFilter}=e.detail;// console.log(\"Processing filter:\", {\n//     type,\n//     group,\n//     active,\n//     value,\n//     filterType,\n//     variantStockFilter,\n// })\n// Log previous state of this filter\nlogDebug(\"ProductSort\",\"Filter state before update\",{filterType:type,previousState:prev[type]||\"not set\",newActive:active,newValue:value});// Use filterMappings to handle the filter\nif(type.startsWith(\"variant_\")){// Handle dynamic variant filters\nconst variantName=type.replace(\"variant_\",\"\");// Add more comprehensive debugging for variant filters\n// console.log(\"\uD83D\uDEA8 Processing variant filter:\", {\n//     type,\n//     variantName,\n//     active,\n//     variantStockFilter,\n//     value,\n//     isMultiValue:\n//         typeof value === \"string\" && value.includes(\",\"),\n//     multipleValues:\n//         typeof value === \"string\" && value.includes(\",\")\n//             ? value.split(\",\").filter(Boolean)\n//             : null,\n//     currentVariantValues:\n//         newFilters.variant?.values?.filter(\n//             (v) => v.name === variantName\n//         ) || [],\n//     rawValue: value,\n//     decodedValue:\n//         typeof value === \"string\"\n//             ? decodeURIComponent(value)\n//             : value,\n// })\nif(active){if(!newFilters.variant){newFilters.variant={active:true,values:[],variantStockFilter:variantStockFilter||undefined};}else if(variantStockFilter){newFilters.variant.variantStockFilter=variantStockFilter;}// Check if value is a comma-separated list - support both encoded and decoded commas\n// Both %2C and , should be treated as delimiters\nlet valueToProcess=value;if(typeof value===\"string\"){// First decode the value to handle any URL encoding\nvalueToProcess=decodeURIComponent(value);}if(typeof valueToProcess===\"string\"&&valueToProcess.includes(\",\")){// Handle multiple comma-separated values (OR condition)\nconst variantValues=valueToProcess.split(\",\").filter(Boolean);// console.log(\"Processing multiple variant values:\", {\n//     variantName,\n//     variantValues,\n//     original: valueToProcess,\n// })\n// Add each value as a separate entry\nvariantValues.forEach(val=>{// Check if this value already exists to avoid duplicates\nconst exists=newFilters.variant.values.some(v=>v.name.toLowerCase()===variantName.toLowerCase()&&v.value.toLowerCase()===val.trim().toLowerCase());if(!exists){newFilters.variant.values.push({name:variantName,value:val.trim()});}});}else{// Handle single value\n// Check if this value already exists\nconst exists=newFilters.variant.values.some(v=>v.name.toLowerCase()===variantName.toLowerCase()&&v.value.toLowerCase()===String(valueToProcess).toLowerCase());if(!exists){newFilters.variant.values.push({name:variantName,value:valueToProcess});}}newFilters.variant.active=true;}else{if(newFilters.variant&&newFilters.variant.values){// console.log(\n//     \"[Variant Removal] Initial variant values:\",\n//     newFilters.variant.values\n// )\n// Check if we're removing a comma-separated list - support both encoded and decoded commas\nlet valueToProcess=value;// console.log(\n//     \"[Variant Removal] Value to process\",\n//     valueToProcess\n// )\nif(typeof value===\"string\"){// First decode the value to handle any URL encoding\nvalueToProcess=decodeURIComponent(value);// console.log(\n//     \"[Variant Removal] Value to process (decoded)\",\n//     valueToProcess\n// )\n}if(typeof valueToProcess===\"string\"&&valueToProcess.includes(\",\")){const variantValues=valueToProcess.split(\",\").filter(Boolean);// console.log(\n//     \"[Variant Removal] Comma-separated variant values:\",\n//     variantValues\n// )\n// Remove each value individually (case-insensitive)\nnewFilters.variant.values=newFilters.variant.values.filter(v=>{const nameMatches=v.name.toLowerCase()===variantName.toLowerCase();const valueMatches=v.value.toLowerCase()===String(valueToProcess).toLowerCase();const shouldRemove=nameMatches&&valueMatches;// console.log(\n//     \"[Variant Removal] Checking variant:\",\n//     {\n//         variant: v,\n//         nameMatches,\n//         valueMatches,\n//         shouldRemove,\n//     }\n// )\nreturn!shouldRemove;});}else{// Remove single value (case-insensitive)\nnewFilters.variant.values=newFilters.variant.values.filter(v=>{const nameMatches=v.name.toLowerCase()===variantName.toLowerCase();const valueMatches=v.value.toLowerCase()===String(valueToProcess).toLowerCase();const shouldRemove=nameMatches&&valueMatches;// console.log(\n//     \"[Variant Removal] Checking variant:\",\n//     {\n//         variant: v,\n//         nameMatches,\n//         valueMatches,\n//         shouldRemove,\n//     }\n// )\nreturn!shouldRemove;});}// console.log(\n//     \"[Variant Removal] Updated variant values:\",\n//     newFilters.variant.values\n// )\nnewFilters.variant.active=newFilters.variant.values.length>0;// console.log(\n//     \"[Variant Removal] Variant active state:\",\n//     newFilters.variant.active\n// )\n}}}else{// Handle other filter types\nswitch(type){case\"product_type\":case\"product_tag\":case\"collection\":logDebug(\"ProductSort\",`Processing ${type} filter`,{active,value,currentValues:newFilters[type].values});if(active){newFilters[type].values=[...newFilters[type].values||[],value];}else{newFilters[type].values=newFilters[type].values.filter(v=>v!==value);}newFilters[type].active=newFilters[type].values.length>0;logDebug(\"ProductSort\",`${type} filter updated`,{newActive:newFilters[type].active,newValues:newFilters[type].values});break;case\"price\":if(active){// console.log(\n//     \"\uD83C\uDFF7\uFE0F Processing ACTIVE price filter:\",\n//     {\n//         currentPriceFilter:\n//             newFilters.price.values,\n//         incomingValue: value,\n//     }\n// )\nif(!newFilters.price){newFilters.price={active:active,values:[]};}// Always ensure active state is set when adding ranges\nnewFilters.price.active=active;const newRange=value?.values?.[0];if(newRange){// console.log(\n//     \"\uD83C\uDFAF Processing new price range:\",\n//     {\n//         newRange,\n//         priceType: newRange.priceType,\n//         currentRanges:\n//             newFilters.price.values,\n//     }\n// )\n// Format the range based on priceType\nconst formattedRange={priceType:newRange.priceType,min:newRange.priceType===\"Under\"?null:newRange.min,max:newRange.priceType===\"Over\"?null:newRange.max};const rangeExists=newFilters.price.values.some(range=>range.priceType===formattedRange.priceType&&range.min===formattedRange.min&&range.max===formattedRange.max);if(!rangeExists){newFilters.price.values.push(formattedRange);// console.log(\n//     \"\u2705 Added new price range. Updated ranges:\",\n//     newFilters.price.values\n// )\n}}}else{// console.log(\n//     \"\uD83C\uDFF7\uFE0F Processing INACTIVE price filter:\",\n//     {\n//         currentPriceFilter: newFilters.price,\n//         incomingValue: value,\n//     }\n// )\nif(newFilters.price.active&&newFilters.price.values){// Loop through incoming values and remove them from current filters\nvalue.values?.forEach(valueRange=>{newFilters.price.values=newFilters.price.values.filter(currentRange=>{// Check if the current range matches the incoming range\nconst isMatchingRange=currentRange.priceType===valueRange.priceType&&currentRange.min===valueRange.min&&currentRange.max===valueRange.max;return!isMatchingRange// Remove only the matching range\n;});});}// Update the active state based on remaining ranges\nnewFilters.price.active=newFilters.price.values.length>0;}break;case\"discount_amount\":case\"discount_percent\":const discountType=type;if(!newFilters[discountType]){newFilters[discountType]={active:false,values:[]};}if(active){// Add new discount range\nnewFilters[discountType].values.push(...value.values);}else{// Remove discount range\nnewFilters[discountType].values=newFilters[discountType].values.filter(range=>!value.values.some(v=>v.min===range.min&&v.max===range.max));}// Update active state\nnewFilters[discountType].active=newFilters[discountType].values.length>0;break;case\"on_sale\":case\"in_stock\":case\"bundle\":case\"subscription\":newFilters[type]={active:active,value:true};break;default:console.warn(\"Unhandled filter type:\",type);}}logDebug(\"ProductSort\",\"Updated filters\",{filterType:type,newFilterState:newFilters[type],allActiveFilters:Object.entries(newFilters).filter(([key,filter])=>filter.active).reduce((acc,[key,filter])=>({...acc,[key]:filter}),{})});return newFilters;});// Force reset sorted children to trigger re-filter and re-sort\nlogDebug(\"ProductSort\",\"Resetting sorted children to trigger re-filtering\",null);setSortedChildren(null);},[props.display,props.value]);// Add a new handler for search events\nconst handleSearch=React.useCallback(e=>{// Only process search if it's enabled\nif(!props.Search?.enableSearch){return;}setSearchConfig({term:e.detail.term,fields:getActiveSearchFields(props.Search?.Scope),active:!!e.detail.term});setSortedChildren(null);},[props.Search?.enableSearch,props.Search?.Scope]);// Load favorites from localStorage\nReact.useEffect(()=>{if(typeof window===\"undefined\")return;const loadFavorites=()=>{const storedFavorites=JSON.parse(localStorage.getItem(\"favorites\")||\"[]\");// console.log(\"Loaded favorites:\", storedFavorites)\nsetFavorites(storedFavorites);};loadFavorites();const handleFavoritesUpdate=e=>{// console.log(\"favorites_updated event\", e.detail)\nconst{favorites:newFavorites,action,productId}=e.detail||{};// Set isTransitioning early to prevent flash\nif(pageType===\"favorites\"&&action===\"remove\"){setIsTransitioning(true);}if(action===\"remove\"&&productId){// console.log(\"Removing from favorites:\", productId)\nsetFavorites(prev=>{const updatedFavorites=prev.filter(id=>id!==productId);// Only retrigger UI if we're in favorites display mode\nif(pageType===\"favorites\"){// If we have sorted children already, prepare for a smoother transition\nif(sortedChildren&&sortedChildren.length>0){// Filter out the removed product from current view without setting to null\nconst updatedChildren=sortedChildren.filter(child=>{const key=child.key||\"\";return key!==productId;});if(updatedChildren.length>0){performTransition(updatedChildren);}else{// If all items removed, then do a full reset\nsetSortedChildren(null);}}else{setSortedChildren(null);}}return updatedFavorites;});}else if(action===\"add\"&&productId){// console.log(\"Adding to favorites:\", productId)\nsetFavorites(prev=>{const updatedFavorites=[...prev,productId];// Only retrigger UI if we're in favorites display mode\nif(pageType===\"favorites\"){setSortedChildren(null);}return updatedFavorites;});}else{//(\"Loading favorites with loadFavorites\")\nloadFavorites();// Only retrigger UI if we're in favorites display mode\nif(pageType===\"favorites\"){setSortedChildren(null);}}};document.addEventListener(\"favorites-updated\",handleFavoritesUpdate);return()=>{document.removeEventListener(\"favorites-updated\",handleFavoritesUpdate);};},[pageType,sortedChildren]);// Use global state management for event listeners\nReact.useEffect(()=>{// console.log(\"\uD83D\uDEA8 Setting up event listeners \uD83D\uDEA8\", {\n//     hasShopXTools: typeof window !== \"undefined\" && !!window.shopXtools,\n//     hasProducts:\n//         typeof window !== \"undefined\" && !!window.shopXtools?.products,\n//     productsCount:\n//         typeof window !== \"undefined\"\n//             ? window.shopXtools?.products?.length\n//             : 0,\n// })\n// Use global state management\nglobalSortState.instances.add(\"FC_CatalogDisplay\");// Add event listeners with proper typing\nconst handleProductsReadyEvent=e=>{// console.log(\"\uD83D\uDEA8 Received data__products-ready event \uD83D\uDEA8\", {\n//     hasEventDetail: !!e,\n//     hasProducts: !!(e as any).detail?.products,\n//     productsCount: (e as any).detail?.products?.length || 0,\n// })\nconst customEvent=e;logDebug(\"ProductSort\",\"data__products-ready event received\",{hasProducts:!!customEvent.detail?.products,count:customEvent.detail?.products?.length||0});handleProductsReady(customEvent);};const handleSortChangeEvent=e=>{const customEvent=e;logDebug(\"ProductSort\",\"product-sort-change event received\",customEvent.detail);handleSortChange(customEvent);};const handleFilterResetEvent=e=>{const customEvent=e;logDebug(\"ProductSort\",\"filter-reset for reset event received\",customEvent.detail);handleFilterReset(customEvent);};const handleFilterChangeEvent=e=>{const customEvent=e;logDebug(\"ProductSort\",\"product-filter-change event received\",customEvent.detail);handleFilter(customEvent);};const handleSearchChangeEvent=e=>{const customEvent=e;logDebug(\"ProductSort\",\"product-search-change event received\",customEvent.detail);handleSearch(customEvent);};document.addEventListener(\"filter-reset\",handleFilterResetEvent);document.addEventListener(\"data__products-ready\",handleProductsReadyEvent);document.addEventListener(\"product-sort-change\",handleSortChangeEvent);document.addEventListener(\"product-filter-change\",handleFilterChangeEvent);document.addEventListener(\"product-search-change\",handleSearchChangeEvent);// Cleanup\nreturn()=>{globalSortState.instances.delete(\"FC_CatalogDisplay\");document.removeEventListener(\"data__products-ready\",handleProductsReadyEvent);document.removeEventListener(\"product-sort-change\",handleSortChangeEvent);document.removeEventListener(\"product-filter-change\",handleFilterChangeEvent);document.removeEventListener(\"product-search-change\",handleSearchChangeEvent);document.removeEventListener(\"filter-reset\",handleFilterReset);logDebug(\"ProductSort\",\"Event listeners cleaned up\",null);};},[handleProductsReady,handleSortChange,handleFilter,handleSearch,handleFilterReset]);// At the top of your component, add this debug log\nReact.useEffect(()=>{if(products.length>0){// console.log(\"Products data structure:\", {\n//     totalProducts: products.length,\n//     sampleProduct: products[0]?.node,\n//     allFields: products[0]?.node\n//         ? Object.keys(products[0].node)\n//         : [],\n//     allProductTypes: products\n//         .slice(0, 10)\n//         .map((p) => p.node?.productType), // Log first 10 product types\n//     activeFilters: Object.entries(filters)\n//         .filter(([key, filter]: [string, any]) => filter.active)\n//         .reduce(\n//             (acc, [key, filter]: [string, any]) => ({\n//                 ...acc,\n//                 [key]: filter,\n//             }),\n//             {}\n//         ),\n// })\n// Log a specific check for the filter value\nif(filters.product_type?.active){const filterValues=filters.product_type.values;const matchingProducts=products.filter(p=>{const productType=p.node?.productType;if(!productType)return false;return filterValues.some(filterValue=>productType.toLowerCase().includes(filterValue.toLowerCase()));});// console.log(\"Filter match check:\", {\n//     filterValues: filterValues,\n//     totalProducts: products.length,\n//     matchingProductsCount: matchingProducts.length,\n//     sampleMatches: matchingProducts.slice(0, 3).map((p) => ({\n//         title: p.node?.title,\n//         productType: p.node?.productType,\n//     })),\n// })\n}}},[products]);// At the top of your component, add this debug log\n// React.useEffect(() => {\n//     if (products.length > 0) {\n//         console.log(\"\uD83D\uDD0D Debugging Product Structure:\", {\n//             firstProduct: products[0]?.node,\n//             hasSellingPlanGroups:\n//                 products[0]?.node?.sellingPlanGroups?.edges?.length > 0,\n//             variants: products[0]?.node?.variants?.edges?.map((edge) => ({\n//                 title: edge.node.title,\n//                 hasSellingPlans:\n//                     edge.node.sellingPlanAllocations?.edges?.length > 0,\n//                 sellingPlans: edge.node.sellingPlanAllocations?.edges,\n//             })),\n//         })\n//     }\n// }, [products])\n// Helper to get product details\nconst getProductDetails=React.useCallback(productId=>{logDebug(\"ProductSort\",\"Looking up product details\",{searchingForId:productId,fullId:`gid://shopify/Product/${productId}`,productsCount:products.length,usingShopXTools:typeof window!==\"undefined\"&&!!window.shopXtools});const fullId=`gid://shopify/Product/${productId}`;let product;// First try to find product in shopXtools\nif(typeof window!==\"undefined\"&&window.shopXtools?.products){product=window.shopXtools.products.find(({node})=>node.id===fullId)?.node;if(product){logDebug(\"ProductSort\",\"Found product in shopXtools\",{id:product.id,title:product.title});}}// Fall back to products state if not found in shopXtools\nif(!product){product=products.find(({node})=>node.id===fullId)?.node;}if(product){logDebug(\"ProductSort\",\"Raw product data found\",{id:product.id,title:product.title,rawProductType:product.productType,rawTags:product.tags,rawCollections:product.collections,fromShopXTools:!!window.shopXtools});return{id:product.id,title:product.title||\"\",price:product.priceRange?.minVariantPrice?.amount?parseFloat(product.priceRange.minVariantPrice.amount):0,productType:product.productType||\"\",tags:product.tags||[],compareAtPrice:product.compareAtPriceRange?.minVariantPrice?.amount?parseFloat(product.compareAtPriceRange.minVariantPrice.amount):0,isOnSale:product.compareAtPriceRange?.minVariantPrice?.amount?parseFloat(product.compareAtPriceRange.minVariantPrice.amount)>parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\"):false,collections:Array.isArray(product.collections)?product.collections.map(c=>c.title):[],options:product.options||[],variants:product.variants?.edges||[],sellingPlanGroups:product.sellingPlanGroups?.edges||[],hasProductLevelPlans:product.sellingPlanGroups?.edges?.length>0,hasVariantLevelPlans:product.variants?.edges?.some(edge=>edge.node.sellingPlanAllocations?.edges?.length>0)};}logDebug(\"ProductSort\",\"Product not found in any source\",{searchId:productId});return{id:\"\",title:\"\",price:0,productType:\"\",tags:[],compareAtPrice:0,isOnSale:false,collections:[],options:[],variants:[],sellingPlanGroups:[],hasProductLevelPlans:false,hasVariantLevelPlans:false};},[products]);// Helper function to perform the actual transition\nconst performTransition=newChildren=>{logDebug(\"ProductSort\",\"Performing transition\",{childrenCount:newChildren?newChildren.length:0});if(transitionTimeoutRef.current){clearTimeout(transitionTimeoutRef.current);}setIsTransitioning(true);// transitionTimeoutRef.current = setTimeout(() => {\n//     logDebug(\"ProductSort\", \"Setting sorted children\", {\n//         childrenCount: newChildren ? newChildren.length : 0,\n//     })\n//     setSortedChildren(newChildren)\n//     setTimeout(() => {\n//         setIsTransitioning(false)\n//         setIsSettling(false)\n//     }, 200) // Fade in duration\n// }, 200) // Fade out duration\n// Directly set sorted children without fade out\nsetSortedChildren(newChildren);setTimeout(()=>{setIsTransitioning(false);setIsSettling(false);},200)// Fade in duration\n;};// Cleanup timeouts\nReact.useEffect(()=>{return()=>{if(transitionTimeoutRef.current){clearTimeout(transitionTimeoutRef.current);}if(settlingTimeoutRef.current){clearTimeout(settlingTimeoutRef.current);}};},[]);// Add a debug log to show which filters are active when filtering products\n// After the getProductDetails function, add this useEffect for debugging\n// React.useEffect(() => {\n//     console.log(\n//         \"Active filters:\",\n//         Object.entries(filters)\n//             .filter(([key, filter]: [string, any]) => filter.active)\n//             .reduce(\n//                 (acc, [key, filter]: [string, any]) => ({\n//                     ...acc,\n//                     [key]: filter,\n//                 }),\n//                 {}\n//             )\n//     )\n// }, [filters])\n// Add this function to check if a product matches the filters\nconst productMatchesFilters=React.useCallback(product=>{/**\n             * Determines if a product matches all active filters\n             * Returns details about which filters matched or failed\n             */const filterResults={};// Log active filters at the beginning\nconst activeFilters={search:searchConfig.active?{term:searchConfig.term,fields:searchConfig.fields}:null,collection:filters.collection?.active?{values:filters.collection.values}:null,product_type:filters.product_type?.active?{values:filters.product_type.values}:null,product_tag:filters.product_tag?.active?{values:filters.product_tag.values}:null,price:filters.price?.active?{values:filters.price.values}:null,on_sale:filters.on_sale?.active||null,in_stock:filters.in_stock?.active||null,bundle:filters.bundle?.active||null,subscription:filters.subscription?.active||null,variant:filters.variant?.active?{values:filters.variant.values}:null,discount_amount:filters.discount_amount?.active?{values:filters.discount_amount.values}:null,discount_percent:filters.discount_percent?.active?{values:filters.discount_percent.values}:null};// console.log(\"Active filters (line 1128):\", activeFilters)\n// Only log if we have any active filters\nif(Object.values(activeFilters).some(v=>v!==null)){// console.log(\n//     `\uD83D\uDD0D FILTERING PRODUCT \"${product.title}\" with active filters:`,\n//     Object.fromEntries(\n//         Object.entries(activeFilters).filter(\n//             ([_, v]) => v !== null\n//         )\n//     )\n// )\n}// ---- SEARCH TERM FILTER ----\nif(searchConfig.active&&searchConfig.term&&props.Search?.enableSearch){const searchTerm=searchConfig.term.toLowerCase();let matches=false;// Add debug log for search filtering\n// console.log(\"\uD83D\uDD0D FILTERING PRODUCT by search term\", {\n//     productTitle: product.title,\n//     searchTerm: searchTerm,\n//     searchFields: searchConfig.fields,\n// })\n// Map search fields to shopX product structure\nfor(const field of searchConfig.fields){// console.log(`\uD83D\uDD0D Checking search field:`, {\n//     field,\n//     searchTerm,\n//     productTitle: product.title\n// });\nswitch(field){case\"variants\":// Search through variant values with proper null checks\nif(product?.variants?.edges&&Array.isArray(product.variants.edges))try{// First check variant colors\nconst variantMatches=product.variants.edges.some(edge=>{if(!edge?.node?.selectedOptions||!Array.isArray(edge.node.selectedOptions)){return false;}return edge.node.selectedOptions.some(option=>{return option?.value&&typeof option.value===\"string\"&&option.value.toLowerCase().includes(searchTerm);});});// Then check custom color metafields\nlet customColorMatches=false;// Check both metafield formats, just like in the filter\nlet customColor=product.metafields?.edges?.find(edge=>edge.node?.key===\"item_color\")?.node?.value;// If not found in edges format, check direct format\nif(!customColor&&product.metafield?.value){customColor=product.metafield.value;}if(customColor){customColorMatches=customColor.toLowerCase().includes(searchTerm);if(customColorMatches){// console.log(`\u2705 Found custom color match:`, {\n//     product: product.title,\n//     customColor,\n//     searchTerm\n// })\n}}matches=matches||variantMatches||customColorMatches;if(matches){// console.log(`\uD83C\uDFAF Final match found for \"${product.title}\"`, {\n//     variantMatches,\n//     customColorMatches\n// })\n}}catch(error){console.error(\"Error searching variants and custom color:\",error);return false;}break;case\"title\":// Product title is directly accessible on the product object\nif(product.title){const titleMatches=product.title.toLowerCase().includes(searchTerm);if(titleMatches){// Only log matches to reduce console noise\n// console.log(\n//     `\uD83C\uDFAF Title match: \"${product.title}\" includes \"${searchTerm}\"`\n// )\n}matches=matches||titleMatches;}else{// console.log(\n//     `\u26A0\uFE0F Product has no title property:`,\n//     product\n// )\n}break;case\"productType\":// Product type is under productType\nif(product.productType){const typeMatches=product.productType.toLowerCase().includes(searchTerm);if(typeMatches){// console.log(\n//     `\uD83C\uDFAF Product Type match: \"${product.productType}\" includes \"${searchTerm}\"`\n// )\n}matches=matches||typeMatches;}break;case\"tags\":// Tags are in an array\nif(Array.isArray(product.tags)){const tagMatches=product.tags.some(tag=>tag&&tag.toLowerCase().includes(searchTerm));if(tagMatches){// console.log(\n//     `\uD83C\uDFAF Tag match: \"${product.tags.join(\", \")}\" includes \"${searchTerm}\"`\n// )\n}matches=matches||tagMatches;}break;case\"collections\":// Collections are in an array\nif(Array.isArray(product.collections)){const collectionMatches=product.collections.some(collection=>{const collectionTitle=collection?.title||collection;return typeof collectionTitle===\"string\"&&collectionTitle.toLowerCase().includes(searchTerm);});if(collectionMatches){// console.log(\n//     `\uD83C\uDFAF Collection match: \"${product.collections\n//         .map((c) => c?.title || c)\n//         .filter(Boolean)\n//         .join(\n//             \", \"\n//         )}\" includes \"${searchTerm}\"`\n// )\n}matches=matches||collectionMatches;}break;case\"vendor\":// Vendor is under product.vendor\nif(product.vendor){const vendorMatches=product.vendor.toLowerCase().includes(searchTerm);if(vendorMatches){// console.log(\n//     `\uD83C\uDFAF Vendor match: \"${product.vendor}\" includes \"${searchTerm}\"`\n// )\n}matches=matches||vendorMatches;}break;case\"customColor\":// Search through custom color metafields\nif(product?.metafields?.edges){try{const customColorMatches=product.metafields.edges.some(edge=>{const node=edge?.node;return node?.namespace===\"custom\"&&(node?.key===\"color\"||node?.key===\"item_color\")&&node?.value&&typeof node.value===\"string\"&&node.value.toLowerCase().includes(searchTerm);});if(customColorMatches){// console.log(\n//     `\uD83C\uDFAF Custom color match found in product \"${product.title}\"`\n// )\n}matches=matches||customColorMatches;}catch(error){console.error(\"Error searching custom color:\",error);return false;}}break;}// If we found a match, no need to check other fields\nif(matches)break;}filterResults.search={active:true,term:searchConfig.term,matches};// If search is active but we don't match, return early\nif(!matches){return{matches:false,filterResults};}}// ----- COLLECTION FILTER -----\nif(filters.collection?.active&&filters.collection.values?.length>0){const collectionValues=filters.collection.values;let matches=false;// Get the collection titles from the new nested structure\nconst productCollections=product.collections.map(collection=>collection.node?.title||collection.node?.handle||collection);// Use OR logic (some) for collections if not scoped to collections\n// Use AND logic (every) only if scoped to collections\nif(props.display===\"Collection\"){matches=collectionValues.every(collectionValue=>productCollections.includes(collectionValue));}else{matches=collectionValues.some(collectionValue=>productCollections.includes(collectionValue));}filterResults.collection={active:true,values:collectionValues,matches};if(!matches){return{matches:false,filterResults};}}// ----- PRODUCT TYPE FILTER -----\nif(filters.product_type?.active&&filters.product_type.values?.length>0){const productTypeValues=filters.product_type.values;let matches=false;if(product.productType){// Use OR logic (some) for product types if not scoped to product types\n// Use AND logic (every) only if scoped to product types\nif(props.display===\"Product Type\"){matches=productTypeValues.every(type=>product.productType.toLowerCase().includes(type.toLowerCase()));}else{matches=productTypeValues.some(type=>product.productType.toLowerCase().includes(type.toLowerCase()));}}filterResults.product_type={active:true,values:productTypeValues,matches};if(!matches){return{matches:false,filterResults};}}// ----- PRODUCT TAG FILTER -----\nif(filters.product_tag?.active&&filters.product_tag.values?.length>0){const tagValues=filters.product_tag.values;let matches=false;if(Array.isArray(product.tags)){// Use OR logic (some) for tags if not scoped to tags\n// Use AND logic (every) only if scoped to tags\nif(props.display===\"Product Tag\"){matches=tagValues.every(tagValue=>product.tags.some(tag=>tag.toLowerCase().includes(tagValue.toLowerCase())));}else{matches=tagValues.some(tagValue=>product.tags.some(tag=>tag.toLowerCase().includes(tagValue.toLowerCase())));}}filterResults.product_tag={active:true,values:tagValues,matches};if(!matches){return{matches:false,filterResults};}}// ----- PRICE FILTER -----\nif(filters.price?.active&&filters.price.values?.length>0){const productPrice=parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\");let matches=false;// Check if product matches any of the active price ranges\nmatches=filters.price.values.some(range=>{if(range.min===null){// Handle \"Under\" price range\nreturn productPrice<=range.max;}else if(range.max===null){// Handle \"Over\" price range\nreturn productPrice>=range.min;}else{// Handle regular price range\nreturn productPrice>=range.min&&productPrice<=range.max;}});filterResults.price={active:true,values:filters.price.values,productPrice,matches};if(!matches){return{matches:false,filterResults};}}// ----- DISCOUNT FILTER -----\nif(filters.discount_amount?.active&&filters.discount_amount.values?.length>0){const productPrice=parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\");const compareAtPrice=parseFloat(product.compareAtPriceRange?.minVariantPrice?.amount||\"0\");const discountAmount=compareAtPrice>productPrice?compareAtPrice-productPrice:0;let matches=false;// console.log(\"\uD83D\uDD0D Checking discount amount:\", {\n//     productPrice,\n//     compareAtPrice,\n//     discountAmount,\n//     ranges: filters.discount_amount.values,\n// })\n// Check if product matches any of the active discount ranges\nmatches=filters.discount_amount.values.some(range=>{if(range.min===null){// Handle \"Under\" discount range\nreturn discountAmount<=range.max;}else if(range.max===null){// Handle \"Over\" discount range\nreturn discountAmount>=range.min;}else{// Handle regular discount range\nreturn discountAmount>=range.min&&discountAmount<=range.max;}});filterResults.discount_amount={active:true,values:filters.discount_amount.values,discountAmount,matches};if(!matches){return{matches:false,filterResults};}}if(filters.discount_percent?.active&&filters.discount_percent.values?.length>0){const productPrice=parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\");const compareAtPrice=parseFloat(product.compareAtPriceRange?.minVariantPrice?.amount||\"0\");const discountPercent=compareAtPrice>productPrice?(compareAtPrice-productPrice)/compareAtPrice*100:0;let matches=false;// console.log(\"\uD83D\uDD0D Checking discount percent:\", {\n//     productPrice,\n//     compareAtPrice,\n//     discountPercent,\n//     ranges: filters.discount_percent.values,\n// })\n// Check if product matches any of the active discount percentage ranges\nmatches=filters.discount_percent.values.some(range=>{if(range.min===null){// Handle \"Under\" discount percentage range\nreturn discountPercent<=range.max;}else if(range.max===null){// Handle \"Over\" discount percentage range\nreturn discountPercent>=range.min;}else{// Handle regular discount percentage range\nreturn discountPercent>=range.min&&discountPercent<=range.max;}});filterResults.discount_percent={active:true,values:filters.discount_percent.values,discountPercent,matches};if(!matches){return{matches:false,filterResults};}}// ----- DISCOUNT FILTER -----\nif(filters.discount_amount?.active&&filters.discount_amount.values?.length>0){const productPrice=parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\");const compareAtPrice=parseFloat(product.compareAtPriceRange?.minVariantPrice?.amount||\"0\");const discountAmount=compareAtPrice>productPrice?compareAtPrice-productPrice:0;let matches=false;// console.log(\"\uD83D\uDD0D Checking discount amount:\", {\n//     productPrice,\n//     compareAtPrice,\n//     discountAmount,\n//     ranges: filters.discount_amount.values,\n// })\n// Check if product matches any of the active discount ranges\nmatches=filters.discount_amount.values.some(range=>{if(range.min===null){// Handle \"Under\" discount range\nreturn discountAmount<=range.max;}else if(range.max===null){// Handle \"Over\" discount range\nreturn discountAmount>=range.min;}else{// Handle regular discount range\nreturn discountAmount>=range.min&&discountAmount<=range.max;}});filterResults.discount_amount={active:true,values:filters.discount_amount.values,discountAmount,matches};if(!matches){return{matches:false,filterResults};}}if(filters.discount_percent?.active&&filters.discount_percent.values?.length>0){const productPrice=parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\");const compareAtPrice=parseFloat(product.compareAtPriceRange?.minVariantPrice?.amount||\"0\");const discountPercent=compareAtPrice>productPrice?(compareAtPrice-productPrice)/compareAtPrice*100:0;let matches=false;// console.log(\"\uD83D\uDD0D Checking discount percent:\", {\n//     productPrice,\n//     compareAtPrice,\n//     discountPercent,\n//     ranges: filters.discount_percent.values,\n// })\n// Check if product matches any of the active discount percentage ranges\nmatches=filters.discount_percent.values.some(range=>{if(range.min===null){// Handle \"Under\" discount percentage range\nreturn discountPercent<=range.max;}else if(range.max===null){// Handle \"Over\" discount percentage range\nreturn discountPercent>=range.min;}else{// Handle regular discount percentage range\nreturn discountPercent>=range.min&&discountPercent<=range.max;}});filterResults.discount_percent={active:true,values:filters.discount_percent.values,discountPercent,matches};if(!matches){return{matches:false,filterResults};}}// ----- DISCOUNT FILTER -----\nif(filters.discount_amount?.active&&filters.discount_amount.values?.length>0){const productPrice=parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\");const compareAtPrice=parseFloat(product.compareAtPriceRange?.minVariantPrice?.amount||\"0\");const discountAmount=compareAtPrice>productPrice?compareAtPrice-productPrice:0;let matches=false;// console.log(\"\uD83D\uDD0D Checking discount amount:\", {\n//     productPrice,\n//     compareAtPrice,\n//     discountAmount,\n//     ranges: filters.discount_amount.values,\n// })\n// Check if product matches any of the active discount ranges\nmatches=filters.discount_amount.values.some(range=>{if(range.min===null){// Handle \"Under\" discount range\nreturn discountAmount<=range.max;}else if(range.max===null){// Handle \"Over\" discount range\nreturn discountAmount>=range.min;}else{// Handle regular discount range\nreturn discountAmount>=range.min&&discountAmount<=range.max;}});filterResults.discount_amount={active:true,values:filters.discount_amount.values,discountAmount,matches};if(!matches){return{matches:false,filterResults};}}if(filters.discount_percent?.active&&filters.discount_percent.values?.length>0){const productPrice=parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\");const compareAtPrice=parseFloat(product.compareAtPriceRange?.minVariantPrice?.amount||\"0\");const discountPercent=compareAtPrice>productPrice?(compareAtPrice-productPrice)/compareAtPrice*100:0;let matches=false;// console.log(\"\uD83D\uDD0D Checking discount percent:\", {\n//     productPrice,\n//     compareAtPrice,\n//     discountPercent,\n//     ranges: filters.discount_percent.values,\n// })\n// Check if product matches any of the active discount percentage ranges\nmatches=filters.discount_percent.values.some(range=>{if(range.min===null){// Handle \"Under\" discount percentage range\nreturn discountPercent<=range.max;}else if(range.max===null){// Handle \"Over\" discount percentage range\nreturn discountPercent>=range.min;}else{// Handle regular discount percentage range\nreturn discountPercent>=range.min&&discountPercent<=range.max;}});filterResults.discount_percent={active:true,values:filters.discount_percent.values,discountPercent,matches};if(!matches){return{matches:false,filterResults};}}// ----- ON SALE FILTER -----\nif(filters.on_sale?.active){let matches=false;if(product.compareAtPriceRange?.minVariantPrice?.amount&&product.priceRange?.minVariantPrice?.amount){const comparePrice=parseFloat(product.compareAtPriceRange.minVariantPrice.amount);const price=parseFloat(product.priceRange.minVariantPrice.amount);matches=comparePrice>price;}filterResults.on_sale={active:true,matches};if(!matches){return{matches:false,filterResults};}}// ----- IN STOCK FILTER -----\nif(filters.in_stock?.active){let matches=false;// Check if any variant is available for sale\nif(product.variants?.edges?.some(edge=>edge.node.availableForSale)){matches=true;}filterResults.in_stock={active:true,matches};if(!matches){return{matches:false,filterResults};}}// ----- SUBSCRIPTION FILTER -----\nif(filters.subscription?.active){let matches=false;const sellingPlanGroups=product.sellingPlanGroups?.edges||[];// Check if the product has subscription plans\nif(sellingPlanGroups&&product.sellingPlanGroups?.edges?.length>0){matches=true;}// Check for variant-level subscription plans\nif(product.variants?.edges?.some(edge=>edge.node.sellingPlanAllocations?.edges?.length>0)){matches=true;}filterResults.subscription={active:true,matches};// console.log(\n//     \"filterResults.subscription\",\n//     filterResults.subscription\n// )\nif(!matches){return{matches:false,filterResults};}}// ----- VARIANT FILTER -----\nif(filters.variant?.active&&filters.variant.values?.length>0){const variantFilters=filters.variant.values;let matches=false;// Check if any variant matches the filter criteria\nif(product.variants?.edges){// Add detailed logging for variant filtering\n// console.log(\n//     `\uD83D\uDD0D VARIANT FILTERING: Checking product \"${product.title}\" variants against filter:`,\n//     {\n//         filterCriteria: variantFilters.map((filter) => ({\n//             name: filter.name,\n//             value: filter.value,\n//         })),\n//         hasVariants: product.variants.edges.length > 0,\n//         variantCount: product.variants.edges.length,\n//     }\n// )\n// First check variant options\nmatches=product.variants.edges.some(edge=>{const variant=edge.node;if(!variant.selectedOptions){// console.log(\n//     `\u26A0\uFE0F Variant has no selectedOptions:`,\n//     variant\n// )\nreturn false;}// Optional stock filter for variant match\nconst shouldCheckStock=filters.variant?.variantStockFilter===\"in_stock\";const isAvailable=variant.availableForSale;if(shouldCheckStock&&!isAvailable){return false// Skip this variant if it's not available\n;}// Log variant options for debugging\n// console.log(`\uD83D\uDC49 Checking variant:`, {\n//     variantOptions: variant.selectedOptions.map(\n//         (opt) => `${opt.name}: ${opt.value}`\n//     ),\n//     filterValues: variantFilters.map(\n//         (f) => `${f.name}: ${f.value}`\n//     ),\n// })\n// For OR logic within same variant type, we need to group filters by name\nconst variantFiltersByName={};variantFilters.forEach(filter=>{if(!variantFiltersByName[filter.name]){variantFiltersByName[filter.name]=[];}variantFiltersByName[filter.name].push(filter.value);});// Log grouped filters\n// console.log(\n//     `\uD83D\uDD0D Grouped variant filters:`,\n//     variantFiltersByName\n// )\n// A variant matches if it satisfies at least one value from each variant type\n// (AND between different variant types, OR between values of same type)\nconst matchesByType=Object.entries(variantFiltersByName).map(([name,values])=>{// Find the option that matches the filter name\nconst matchingOption=variant.selectedOptions.find(option=>option.name.toLowerCase()===name.toLowerCase());if(!matchingOption){// console.log(\n//     `\u274C No matching option found for ${name}`\n// )\nreturn false;}// Check if the option value matches any of the filter values (case-insensitive)\nconst valueMatches=values.some(value=>matchingOption.value.toLowerCase()===value.toLowerCase());// console.log(\n//     `${valueMatches ? \"\u2705\" : \"\u274C\"} ${name} = ${matchingOption.value}`,\n//     {\n//         acceptableValues: values,\n//         matches: valueMatches,\n//     }\n// )\nreturn valueMatches;});// True if ALL filter types have at least one matching value\nconst allTypesMatch=matchesByType.every(matches=>matches);// console.log(\n//     `${allTypesMatch ? \"\u2705\" : \"\u274C\"} Overall match result: ${allTypesMatch}`\n// )\nreturn allTypesMatch;});// If no variant matches and we're looking for a color, check custom metadata\nif(!matches){const colorFilters=variantFilters.filter(filter=>filter.name.toLowerCase()===\"color\");if(colorFilters.length>0){// Add detailed logging for metadata inspection\n// console.log(\n//     \"\uD83D\uDD0D Checking product metadata for colors:\",\n//     {\n//         productTitle: product.title,\n//         hasMetafields: !!product.metafields,\n//         hasDirectMetafield: !!product.metafield,\n//         metafieldEdges: product.metafields?.edges,\n//         directMetafieldValue:\n//             product.metafield?.value,\n//         activeColorFilters: colorFilters\n//     }\n// )\n// Check both metafield formats\nlet customColor=product.metafields?.edges?.find(edge=>edge.node?.key===\"item_color\")?.node?.value;// If not found in edges format, check direct format\nif(!customColor&&product.metafield?.value){customColor=product.metafield.value;}if(customColor){// Check if custom color matches ANY of the active color filters\nmatches=colorFilters.some(colorFilter=>customColor.toLowerCase().includes(colorFilter.value.toLowerCase()));// console.log(\"\uD83C\uDFA8 Custom color check result:\", {\n//     filterColors: colorFilters.map(f => f.value),\n//     customColor,\n//     matches\n// })\n}}}}filterResults.variant={active:true,values:variantFilters,matches};if(!matches){return{matches:false,filterResults};}}// Log final result\n// console.log(\n//     `\uD83D\uDD0D FILTER RESULT for \"${product.title}\": ${JSON.stringify({ matches: true, filterResults })}`\n// )\n// All tests passed\nreturn{matches:true,filterResults};},[filters,searchConfig]);// Add this after the handleFilter useCallback\nReact.useEffect(()=>{// console.log(\"\uD83D\uDEA8 Products state changed \uD83D\uDEA8\", {\n//     hasProducts: products.length > 0,\n//     count: products.length,\n//     firstProduct: products[0]?.node\n//         ? {\n//               title: products[0].node.title,\n//               productType: products[0].node.productType,\n//           }\n//         : null,\n//     sortedChildrenExists: !!sortedChildren,\n// })\n// Dispatch product-search-results event when filtered products change\nif(sortedChildren&&searchConfig.active||!searchConfig.active){const searchResultsEvent=new CustomEvent(\"product-search-results\",{detail:{count:sortedChildren?sortedChildren.length:products.length,term:searchConfig.term||\"\"}});document.dispatchEvent(searchResultsEvent);//console.log(\"product-search-results dispatched\", searchResultsEvent);\n}},[products,sortedChildren,searchConfig]);// Add this after the URL parameters useEffect\nReact.useEffect(()=>{// Check if we're in a browser environment\nif(typeof window===\"undefined\")return;// Check for shopXtools and products\nconst hasShopXTools=!!window.shopXtools;const products=window.shopXtools?.products;// Log initial state\n// console.log(\"\uD83D\uDEA8 Checking for initial shopXtools products \uD83D\uDEA8\", {\n//     hasShopXTools,\n//     hasProducts: !!products,\n//     productsCount: products?.length || 0,\n// })\n// Set products if available\nif(products){// console.log(\"\uD83D\uDEA8 Setting initial products from shopXtools \uD83D\uDEA8\", {\n//     count: products.length,\n//     sample: products[0]?.node,\n// })\nsetProducts(products);}},[])// Only run on mount\n;if(!Collection?.[0]){logDebug(\"ProductSort\",\"No collection instance found\",null);return /*#__PURE__*/_jsx(\"div\",{style:{height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#666\",fontSize:\"14px\"},children:\"Connect instance\"});}const collectionInstance=Collection[0];const emptyStateInstance=props.EmptyState?.[0];const sizedInstance=/*#__PURE__*/React.cloneElement(collectionInstance,{style:{...collectionInstance.props?.style||{},width:\"100%\",height:\"100%\"}});// Update the layout styling logic\nlet layoutStyle={};if(props.layout){const layout=props.layout;switch(layout.type){case\"stack\":const isVertical=layout.direction===\"vertical\";layoutStyle={display:\"flex\",flexDirection:isVertical?\"column\":\"row\",flexWrap:layout.wrap?\"wrap\":\"nowrap\",alignItems:isVertical?layout.align:layout.alignH,justifyContent:layout.distribute,gap:layout.gap,padding:layout.paddingPerSide?`${layout.paddingTop}px ${layout.paddingRight}px ${layout.paddingBottom}px ${layout.paddingLeft}px`:`${layout.padding}px`,width:\"100%\",\"& > *\":{minWidth:layout.stackMinWidth,flexGrow:1,flexShrink:1,flexBasis:0}};break;case\"grid\":let gridTemplateColumns=\"\";if(layout.columns===\"auto\"){// Combine auto-fit with a calculated minmax to respect both gridWidth and maxColumns.\n// The min value ensures columns are at least gridWidth, but also effectively caps\n// the column count at maxColumns by calculating the width required for that many columns.\ngridTemplateColumns=`repeat(auto-fit, minmax(max(${layout.gridWidth}px, calc((100% - ${layout.gap*(layout.maxColumns-1)}px) / ${layout.maxColumns})), 1fr))`;}else{gridTemplateColumns=`repeat(${layout.columnCount}, 1fr)`;}layoutStyle={display:\"grid\",gridTemplateColumns,justifyItems:layout.gridAlign,gap:layout.gap,padding:layout.paddingPerSide?`${layout.paddingTop}px ${layout.paddingRight}px ${layout.paddingBottom}px ${layout.paddingLeft}px`:`${layout.padding}px`,width:\"100%\"};break;}}// Create the styled instance with layout\nconst styledInstance=/*#__PURE__*/React.cloneElement(sizedInstance,{style:{...sizedInstance.props.style,...layoutStyle}});if(RenderTarget.current()===RenderTarget.canvas){return styledInstance;}const[isBackNavigation,setIsBackNavigation]=React.useState(false);React.useEffect(()=>{if(typeof window===\"undefined\")return;const handleUrlChange=event=>{// console.log(\"popstate\", event)\nconst url=new URL(window.location.href);const urlParams=new URLSearchParams(url.search);// Handle page parameter\nconst pageParam=urlParams.get(\"page\");const newPage=pageParam?parseInt(pageParam,10):1;//console.log(\"[CMS] Checking page change:\", { currentPage, newPage })\nif(newPage!==currentPage){//console.log(\"[CMS] Updating to page:\", newPage)\nsetCurrentPage(newPage);setSortedChildren(null)// Reset sorted children to trigger re-render\n;}setIsLoading(true);logDebug(\"ProductSort\",\"URL changed\",{url:url.toString(),search:url.search,eventType:event?.type||\"direct\",currentPage:currentPage,newPage:newPage});if(event.type===\"popstate\"){//console.log(\"Reloading the page\")\nwindow.location.reload();}// Set loading to false after a short delay to prevent flash\nsetTimeout(()=>{setIsLoading(false);setIsBackNavigation(false);},150);};// Run initial check\nhandleUrlChange({});// Listen for both popstate and pagination events\nwindow.addEventListener(\"popstate\",handleUrlChange);document.addEventListener(\"product-pagination-change\",handleUrlChange);return()=>{// window.removeEventListener(\"popstate\", handleUrlChange)\ndocument.removeEventListener(\"product-pagination-change\",handleUrlChange);};},[currentPage]);try{logDebug(\"ProductSort\",\"Rendering collection\",{hasCollection:!!Collection[0],productsCount:products.length,sortedChildrenCount:sortedChildren?sortedChildren.length:0,isBackNavigation,isLoading});return /*#__PURE__*/React.cloneElement(styledInstance,{...styledInstance.props,style:{...styledInstance.props.style,opacity:isLoading?0:1,transition:\"opacity 0.2s ease-in-out\",visibility:isLoading?\"hidden\":\"visible\"},children:/*#__PURE__*/React.cloneElement(styledInstance.props.children,{...styledInstance.props.children.props,children:/*#__PURE__*/React.cloneElement(styledInstance.props.children.props.children,{...styledInstance.props.children.props.children.props,children:collection=>{logDebug(\"ProductSort\",\"Collection render function called\",{collectionSize:collection?.length||0});const originalRender=styledInstance.props.children.props.children.props.children(collection);if(!originalRender?.props?.children){logDebug(\"ProductSort\",\"No children in original render\",null);return originalRender;}if(!sortedChildren&&products.length>0){// console.log(\n//     \"\uD83D\uDEA8\uD83D\uDEA8\uD83D\uDEA8 STARTING FILTERING PROCESS \uD83D\uDEA8\uD83D\uDEA8\uD83D\uDEA8\",\n//     {\n//         productsLength: products.length,\n//         hasShopXTools:\n//             typeof window !== \"undefined\" &&\n//             !!window.shopXtools,\n//         activeFilters: Object.entries(filters)\n//             .filter(\n//                 ([key, filter]: [\n//                     string,\n//                     any,\n//                 ]) => filter.active\n//             )\n//             .reduce(\n//                 (\n//                     acc,\n//                     [key, filter]: [string, any]\n//                 ) => ({\n//                     ...acc,\n//                     [key]: filter,\n//                 }),\n//                 {}\n//             ),\n//         firstProduct: products[0]?.node,\n//     }\n// )\n// First filter all shopXtools products\nconst filteredShopXProducts=products.filter(({node})=>{// Add debug log for products being filtered\n// console.log(\n//     \"\uD83D\uDD0D Checking product for filtering:\",\n//     {\n//         title:\n//             node?.title || \"No title\",\n//         hasNode: !!node,\n//         nodeType: node\n//             ? typeof node\n//             : \"undefined\",\n//         productType:\n//             node?.productType ||\n//             \"No product type\",\n//         filterActive:\n//             searchConfig.active,\n//     }\n// )\n// Ensure node exists\nif(!node){// console.log(\n//     \"\u26A0\uFE0F No node found for product, skipping\"\n// )\nreturn false;}const matches=productMatchesFilters(node);// console.log(\n//     \"\uD83D\uDD0D Product filter result:\",\n//     {\n//         title: node.title,\n//         productType: node.productType,\n//         matches: matches.matches,\n//         searchActive:\n//             searchConfig.active,\n//         searchTerm: searchConfig.term,\n//     }\n// )\nreturn matches.matches;});// console.log(\n//     \"\uD83D\uDD0D Filtered shopX products results:\",\n//     {\n//         totalBefore: products.length,\n//         totalAfter:\n//             filteredShopXProducts.length,\n//         firstProduct: filteredShopXProducts[0]\n//             ?.node\n//             ? {\n//                   title: filteredShopXProducts[0]\n//                       .node.title,\n//                   productType:\n//                       filteredShopXProducts[0]\n//                           .node.productType,\n//               }\n//             : null,\n//         activeFilters: Object.entries(filters)\n//             .filter(\n//                 ([key, filter]: [\n//                     string,\n//                     any,\n//                 ]) => filter.active\n//             )\n//             .reduce(\n//                 (\n//                     acc,\n//                     [key, filter]: [string, any]\n//                 ) => ({\n//                     ...acc,\n//                     [key]: filter,\n//                 }),\n//                 {}\n//             ),\n//         searchActive: searchConfig.active,\n//         searchTerm: searchConfig.term,\n//     }\n// )\n// Add additional debugging if no products match\n// if (\n//     filteredShopXProducts.length === 0 &&\n//     products.length > 0\n// ) {\n//     console.log(\n//         \"\u26A0\uFE0F NO PRODUCTS MATCHED FILTERS! Active filters:\",\n//         {\n//             searchConfig: searchConfig.active\n//                 ? searchConfig\n//                 : null,\n//             otherFilters: Object.entries(\n//                 filters\n//             )\n//                 .filter(\n//                     ([key, filter]: [\n//                         string,\n//                         any,\n//                     ]) => filter.active\n//                 )\n//                 .reduce(\n//                     (\n//                         acc,\n//                         [key, filter]: [\n//                             string,\n//                             any,\n//                         ]\n//                     ) => ({\n//                         ...acc,\n//                         [key]: filter,\n//                     }),\n//                     {}\n//                 ),\n//         }\n//     )\n//     // Log some sample products to help diagnose\n//     console.log(\n//         \"Sample products that didn't match:\",\n//         products.slice(0, 3).map((p) => ({\n//             title: p.node?.title,\n//             productType: p.node?.productType,\n//             tags: p.node?.tags?.slice(0, 3),\n//             collections: p.node?.collections\n//                 ?.map((c) => c.title || c)\n//                 .slice(0, 3),\n//         }))\n//     )\n// }\nconst filteredForPage=pageType===\"favorites\"?filteredShopXProducts.filter(({node})=>{const productId=findDeep13DigitNumber(node);return productId&&favorites.includes(productId);}):filteredShopXProducts;// If no items match, render the empty state directly\nif(filteredForPage.length===0){if(emptyStateInstance){const styledEmptyState=/*#__PURE__*/React.cloneElement(emptyStateInstance,{style:{...emptyStateInstance.props?.style||{},width:\"100%\",height:\"100%\",maxWidth:\"100%\",transform:\"none\"}});// Create a wrapper that completely overrides any grid styles\nconst EmptyStateWrapper=()=>/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",padding:props.layout?.padding?`${props.layout.padding}px`:\"0px\",// Override any grid properties\n    gridColumn:\"1 / -1\",gridRow:\"1 / -1\",// Ensure it spans the full container\n    position:\"relative\",minWidth:\"100%\",maxWidth:\"100%\"},children:styledEmptyState});// Return the wrapper component directly\nreturn{...originalRender,props:{...originalRender.props,style:{...originalRender.props.style,// Override grid properties at the container level\ndisplay:\"flex\",gridTemplateColumns:\"none\",gridAutoColumns:\"none\",gridTemplateRows:\"none\",gap:0},children:/*#__PURE__*/_jsx(EmptyStateWrapper,{})}};}return null;}// Then map the filtered products to collection items\nconst items=originalRender.props.children.map(child=>{const item=collection.find(collectionItem=>collectionItem.id===child.key);const productId=item?findDeep13DigitNumber(item):null;// Find the product in our filtered shopX products\nconst fullId=`gid://shopify/Product/${productId}`;const matchingProduct=filteredForPage.find(({node})=>node.id===fullId);// Only include items that exist in our filtered products\nif(!matchingProduct){logDebug(\"ProductSort\",\"Product filtered out\",{id:fullId,productId});return null;}const details={id:matchingProduct.node.id,title:matchingProduct.node.title||\"\",price:matchingProduct.node.priceRange?.minVariantPrice?.amount?parseFloat(matchingProduct.node.priceRange.minVariantPrice.amount):0,productType:matchingProduct.node.productType||\"\",tags:matchingProduct.node.tags||[],compareAtPrice:matchingProduct.node.compareAtPriceRange?.minVariantPrice?.amount?parseFloat(matchingProduct.node.compareAtPriceRange.minVariantPrice.amount):0,collections:Array.isArray(matchingProduct.node.collections)?matchingProduct.node.collections.map(c=>c.title):[]};return{child,productId:productId||\"0\",price:details.price,title:details.title,originalIndex:originalRender.props.children.indexOf(child),details};}).filter(Boolean)// Remove null items\n;logDebug(\"ProductSort\",\"Final filtered items\",{totalProducts:products.length,filteredForPage:filteredForPage.length,finalItems:items.length,finalItemsList:items,sample:items[0]?{title:items[0].title,productType:items[0].details.productType}:null});// Use React.memo for components that do not change\nconst OptimizedChild=/*#__PURE__*/React.memo(({child,...props})=>{return /*#__PURE__*/React.cloneElement(child,props);});// Ensure debouncing is applied effectively\nconst debouncedUpdateSort=React.useCallback(debounce(newSortConfig=>{setSortConfig(newSortConfig);},150),[]);const debouncedUpdateFilter=React.useCallback(debounce(newFilters=>{setFilters(newFilters);},150),[]);// Add detailed logging around transition logic\n// console.log(\n//     \"\uD83D\uDD0D Transition state before rendering\",\n//     {\n//         isTransitioning,\n//         isSettling,\n//         itemsLength: items.length,\n//         emptyStateInstanceExists:\n//             !!emptyStateInstance,\n//     }\n// )\n// Modify the child wrapper styles to include settling state\nconst getTransitionStyles=baseStyles=>({...baseStyles,opacity:isTransitioning||isSettling?0:1,transition:`opacity ${isSettling?\"0.5s\":\"0.3s\"} ease-in-out`,pointerEvents:isTransitioning||isSettling?\"none\":\"auto\"});// Render sorted items\n// console.log(\"\uD83D\uDD0D Rendering sorted items\", {\n//     sortedItemsCount: items.length,\n//     sortedItems: items,\n//     isTransitioning,\n//     isSettling,\n// })\n// Sort the filtered items\nconst sorted=[...items].sort((a,b)=>{if(sortConfig.type===\"relevancy\"){return a.originalIndex-b.originalIndex;}if(sortConfig.type===\"price\"){const result=sortConfig.sortDirection===\"highToLow\"?b.price-a.price:a.price-b.price;return result||a.originalIndex-b.originalIndex;}else if(sortConfig.type===\"name\"){// sort by name\nconst result=sortConfig.sortDirection===\"aToZ\"?a.title.localeCompare(b.title):b.title.localeCompare(a.title);return result||a.originalIndex-b.originalIndex;}else if(sortConfig.type===\"created\"){// For \"newest\", we try to use the product ID as a proxy\n// since Shopify IDs are sequential\n// Higher ID = newer product\nconst aId=parseInt(a.productId);const bId=parseInt(b.productId);if(!isNaN(aId)&&!isNaN(bId)){return bId-aId// Newest first\n;}// Fall back to original order if we can't parse IDs\nreturn a.originalIndex-b.originalIndex;}else if(sortConfig.type===\"best-selling\"){// For best-selling, maintain the original order\n// as we assume Shopify has already sorted by best-selling\nreturn a.originalIndex-b.originalIndex;}else{// Default to original order for unknown types\nreturn a.originalIndex-b.originalIndex;}});// Apply pagination if enabled\nlet paginatedItems=sorted;if(props.Pagination?.enable){const itemsPerPage=props.Pagination.items;const startIndex=(currentPage-1)*itemsPerPage;const endIndex=startIndex+itemsPerPage;paginatedItems=sorted.slice(0,endIndex);setHasMore(endIndex<sorted.length);const hasMoreItems=endIndex<sorted.length;//console.log(\"hasMoreItems\", hasMoreItems)\nif(!hasMoreItems){const hasMoreItemsEvent=new CustomEvent(\"hide-loadmore-button\",{detail:{hasMoreItems}});document.dispatchEvent(hasMoreItemsEvent);// console.log(\n//     \"hide-loadmore-button dispatched\",\n//     hasMoreItemsEvent\n// )\n}// console.log(\"Pagination Debug:\", {\n//     currentPage,\n//     itemsPerPage,\n//     startIndex,\n//     endIndex,\n//     totalItems: sorted.length,\n//     hasMore: endIndex < sorted.length,\n//     paginatedItemsCount:\n//         paginatedItems.length,\n// })\n}// Update the product items wrapper with a standard list instead of virtualized one\nconst wrappedChildren=paginatedItems.map(item=>/*#__PURE__*/React.cloneElement(item.child,{style:getTransitionStyles(item.child.props.style),key:item.productId||item.originalIndex}));// Update sorted children state which triggers re-render\nupdateSortedChildrenWithTransition(wrappedChildren);// Return the placeholder structure expected by the outer cloneElement\n// The actual content will be replaced by sortedChildren on re-render\nreturn{...originalRender,props:{...originalRender.props,// Use the original children length initially\nchildren:originalRender.props.children}};}// Initial render or while loading/filtering\nreturn{...originalRender,props:{...originalRender.props,children:sortedChildren||originalRender.props.children}};}})})});}catch(error){console.error(\"Error in ProductSort:\",error);logDebug(\"ProductSort\",\"Render error\",{error:error.message});return styledInstance;}// Update URL state management\nReact.useEffect(()=>{if(typeof window===\"undefined\")return;const url=new URL(window.location.href);// Use the updateUrlWithFilters function to update URL parameters\nupdateUrlWithFilters(filters,url);// Add search term to URL\nif(searchConfig.active&&searchConfig.term){url.searchParams.set(\"search\",searchConfig.term);}else if(url.searchParams.has(\"search\")){url.searchParams.delete(\"search\");}// Add sort configuration to URL using the simplified sort parameter\nif(sortConfig){// Map internal sort configuration to URL sort parameter\nlet sortParam;if(sortConfig.type===\"relevancy\"){sortParam=\"relevance\";}else if(sortConfig.type===\"name\"){sortParam=sortConfig.sortDirection===\"aToZ\"?\"title_asc\":\"title_desc\";}else if(sortConfig.type===\"price\"){sortParam=sortConfig.sortDirection===\"lowToHigh\"?\"price_asc\":\"price_desc\";}else if(sortConfig.type===\"created\"){sortParam=\"newest\";}else if(sortConfig.type===\"best-selling\"){sortParam=\"best_selling\";}if(sortParam){url.searchParams.set(\"sort\",sortParam);// Remove legacy sortConfig parameter if it exists\nif(url.searchParams.has(\"sortConfig\")){url.searchParams.delete(\"sortConfig\");}}else{// Fallback to the old format if we can't map to a simple parameter\nurl.searchParams.set(\"sortConfig\",JSON.stringify(sortConfig));}}// Update history state with search config\nwindow.history.pushState({filters,sortConfig,searchConfig},\"\",url.toString());},[sortConfig,filters,searchConfig]);// Update the useEffect for initializing state from URL\nReact.useEffect(()=>{if(typeof window===\"undefined\")return;const handleUrlChange=event=>{const url=new URL(window.location.href);const urlParams=new URLSearchParams(window.location.search);logDebug(\"ProductSort\",\"URL changed\",{url:url.toString(),search:url.search,eventType:event?.type||\"direct\"});// Handle search parameter\nconst searchParam=urlParams.get(\"search\");if(searchParam){setSearchConfig({term:searchParam,fields:getActiveSearchFields(props.Search?.Scope),active:true});setSortedChildren(null)// Force re-filter when search changes\n;}else if(searchConfig.active){setSearchConfig({term:\"\",fields:getActiveSearchFields(props.Search?.Scope),active:false});setSortedChildren(null)// Force re-filter when search is cleared\n;}// Log all variant parameters in URL for debugging\nconst variantParams=Array.from(urlParams.keys()).filter(key=>key.startsWith(\"variant_\")).reduce((acc,key)=>{const value=urlParams.get(key);// Decode values to see what's actually stored\nacc[key]={raw:value,decoded:value?decodeURIComponent(value):null,values:value?decodeURIComponent(value).split(\",\").filter(Boolean):[]};return acc;},{});//console.log(\"\uD83D\uDCCA VARIANT PARAMS IN URL:\", variantParams)\n// Handle sort parameter\nconst sortParam=urlParams.get(\"sort\");if(sortParam){let newSortConfig;// Map URL sort parameter to internal sort configuration\nswitch(sortParam){case\"relevance\":newSortConfig={type:\"relevancy\",sortBy:\"relevancy\",sortDirection:null};break;case\"title_asc\":newSortConfig={type:\"name\",sortBy:\"name\",sortDirection:\"aToZ\"};break;case\"title_desc\":newSortConfig={type:\"name\",sortBy:\"name\",sortDirection:\"zToA\"};break;case\"price_asc\":newSortConfig={type:\"price\",sortBy:\"price\",sortDirection:\"lowToHigh\"};break;case\"price_desc\":newSortConfig={type:\"price\",sortBy:\"price\",sortDirection:\"highToLow\"};break;case\"newest\":newSortConfig={type:\"created\",sortBy:\"created\",sortDirection:\"newest\"};break;case\"best_selling\":newSortConfig={type:\"best-selling\",sortBy:\"best-selling\",sortDirection:null};break;}if(newSortConfig){logDebug(\"ProductSort\",\"Updating sort config from URL parameter\",{sortParam,newSortConfig});setSortConfig(newSortConfig);setSortedChildren(null)// Reset sorted children to trigger resort\n;}}try{// Use parseUrlFilters to get filters from URL\nconst urlFilters=parseUrlFilters(url.searchParams);// Check if we have active filters\nconst hasActiveFilters=urlFilters&&Object.keys(urlFilters).some(key=>urlFilters[key]?.active);logDebug(\"ProductSort\",\"URL filters parsed\",{hasActiveFilters,filters:urlFilters,activeFilters:hasActiveFilters?Object.entries(urlFilters).filter(([key,filter])=>filter.active).reduce((acc,[key,filter])=>({...acc,[key]:filter}),{}):null});// Only update if we have filters in the URL\nif(hasActiveFilters){setFilters(urlFilters);setSortedChildren(null);}}catch(error){console.error(\"\u274C Error handling URL change:\",error);}};// Run initial check\nlogDebug(\"ProductSort\",\"Running initial URL check\",{url:window.location.href});handleUrlChange({})// Removed event listener for now\n;// Listen for popstate events\nwindow.addEventListener(\"popstate\",handleUrlChange);return()=>{window.removeEventListener(\"popstate\",handleUrlChange);};},[props.Search?.Scope]);// Add error state management\nconst[error,setError]=React.useState(null);// Create the content to render\nconst content=error?/*#__PURE__*/_jsx(\"div\",{style:{padding:20,color:\"red\"},children:error.message}):// Original render content with layout styling\n/*#__PURE__*/_jsx(\"div\",{...props,style:{...props.style,width:\"100%\",height:\"100%\",...(!products?.length||pageType===\"favorites\"&&!favorites?.length)&&{display:\"flex\",gridTemplateColumns:\"none\",gridAutoColumns:\"none\",gridTemplateRows:\"none\",gap:0}},children:styledInstance.props.children});// Wrap the main content in error boundary\nreturn /*#__PURE__*/_jsx(ErrorBoundary,{children:content});}addPropertyControls(FC_CatalogDisplay,{Collection:{type:ControlType.ComponentInstance,title:\"CMS Source\",description:\"Connect to CMS collection off-page\"},EmptyState:{type:ControlType.ComponentInstance,title:\"Empty State\",description:\"Connect to design off-page\"},pageType:{type:ControlType.Enum,title:\"Display\",options:[\"default\",\"favorites\"],optionTitles:[\"All\",\"Favorites\"],defaultValue:\"default\",displaySegmentedControl:true},display:{type:ControlType.Enum,title:\"Filter Type\",options:[\"All\",\"Collection\",\"Product Tag\",\"Product Type\"],defaultValue:\"All\"},value:{type:ControlType.String,title:\"Filter Value\",placeholder:\"New Arrivals\"},defaultSort:{type:ControlType.Enum,title:\"Default Sort\",options:[\"relevance\",\"title_asc\",\"title_desc\",\"price_asc\",\"price_desc\",\"newest\",\"best_selling\"],optionTitles:[\"Relevance\",\"Title A-Z\",\"Title Z-A\",\"Price Low-High\",\"Price High-Low\",\"Newest\",\"Best Selling\"],defaultValue:\"relevance\"},Search:{type:ControlType.Object,title:\"Search\",controls:{enableSearch:{type:ControlType.Boolean,title:\"Allow\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},initialSearchState:{type:ControlType.Enum,title:\"Initial State\",options:[\"all\",\"none\"],optionTitles:[\"Full\",\"Empty\"],defaultValue:\"all\",displaySegmentedControl:true,hidden:props=>!props.enableSearch},Scope:{type:ControlType.Object,title:\"Scope\",hidden:props=>!props.enableSearch,controls:{title:{type:ControlType.Boolean,title:\"Title\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},productType:{type:ControlType.Boolean,title:\"Product Type\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},productTag:{type:ControlType.Boolean,title:\"Tags\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},collection:{type:ControlType.Boolean,title:\"Collections\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},vendor:{type:ControlType.Boolean,title:\"Vendor\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},variants:{type:ControlType.Boolean,title:\"Variants\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},customColor:{type:ControlType.Boolean,title:\"Custom Color\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"}}}}},Pagination:{type:ControlType.Object,title:\"Pagination\",controls:{enable:{type:ControlType.Boolean,title:\"Enable\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},type:{type:ControlType.Enum,title:\"Type\",options:[\"load_more\"/*, \"next_prev\", \"infinite\" */],optionTitles:[\"Load More\"/*, \"Next/Prev\", \"Infinite Scroll\" */],defaultValue:\"load_more\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\",hidden:({enable})=>!enable},items:{type:ControlType.Number,title:\"Items\",defaultValue:12,min:1,step:1,displayStepper:true,hidden:({enable})=>!enable}}},layout:{type:ControlType.Object,optional:true,controls:{type:{type:ControlType.Enum,defaultValue:\"grid\",options:[\"stack\",\"grid\"],optionTitles:[\"Stack\",\"Grid\"],displaySegmentedControl:true},// Stack specific controls\ndirection:{type:ControlType.Enum,defaultValue:\"vertical\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"],optionIcons:[\"direction-horizontal\",\"direction-vertical\"],displaySegmentedControl:true,hidden:props=>props.type!==\"stack\"},wrap:{type:ControlType.Boolean,defaultValue:false,title:\"Wrap\",hidden:props=>props.type!==\"stack\"},stackMinWidth:{type:ControlType.Number,defaultValue:200,min:1,max:1e3,step:1,title:\"Min Width\",hidden:props=>props.type!==\"stack\"||!props.wrap},distribute:{type:ControlType.Enum,defaultValue:\"start\",options:[\"start\",\"center\",\"end\",\"space-between\",\"space-around\",\"space-evenly\"],optionTitles:[\"Start\",\"Center\",\"End\",\"Space Between\",\"Space Around\",\"Space Evenly\"],hidden:props=>props.type!==\"stack\"},align:{type:ControlType.Enum,defaultValue:\"start\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"],optionIcons:[\"align-left\",\"align-center\",\"align-right\"],displaySegmentedControl:true,hidden:props=>props.type!==\"stack\"||props.direction!==\"vertical\"},alignH:{type:ControlType.Enum,defaultValue:\"start\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Top\",\"Center\",\"Bottom\"],optionIcons:[\"align-top\",\"align-middle\",\"align-bottom\"],displaySegmentedControl:true,title:\"Align\",hidden:props=>props.type!==\"stack\"||props.direction!==\"horizontal\"},// Grid specific controls\ncolumns:{type:ControlType.Enum,defaultValue:\"fixed\",options:[\"auto\",\"fixed\"],optionTitles:[\"Auto\",\"Fixed\"],displaySegmentedControl:true,hidden:props=>props.type!==\"grid\"},columnCount:{type:ControlType.Number,defaultValue:3,min:1,step:1,displayStepper:true,title:\"Columns\",hidden:props=>props.type!==\"grid\"||props.columns===\"auto\"},gridWidth:{type:ControlType.Number,defaultValue:300,min:1,max:1e3,step:1,title:\"Min Width\",hidden:props=>props.type!==\"grid\"||props.columns===\"fixed\"},maxColumns:{type:ControlType.Number,defaultValue:4,min:1,step:1,title:\"Max Col\",displayStepper:true,hidden:props=>props.type!==\"grid\"||props.columns===\"fixed\"},gridAlign:{type:ControlType.Enum,defaultValue:\"center\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true,title:\"Align\",hidden:props=>props.type!==\"grid\"},// Common controls\ngap:{type:ControlType.Number,defaultValue:20,min:0,step:1,title:\"Gap\"},padding:{type:ControlType.FusedNumber,title:\"Padding\",defaultValue:0,min:0,toggleKey:\"paddingPerSide\",toggleTitles:[\"All\",\"Sides\"],valueKeys:[\"paddingTop\",\"paddingRight\",\"paddingBottom\",\"paddingLeft\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"]}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FC_CatalogDisplay\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FC_CatalogDisplay.map"],
  "mappings": "wOASU,IAAMA,GAAkB,CAACC,EAAKC,EAAS,KAAQ,CACzD,IAAMC,EAAS,CACf,aAAa,eAAe,YAAY,cAAc,QAAQ,UAAU,SAAS,WAAW,OAAO,UAAU,aAAa,eAAe,EAAE,GAAGD,EAC9I,OADqKC,EAASF,CAAI,GAAGA,EAClK,CACnB,IAAMG,EAAgB,CAAC,EAAE,cAAO,QAAQD,CAAQ,EAAE,QAAQ,CAAC,CAACE,EAAIC,CAAK,IAAI,CAACF,EAAgBE,CAAK,EAAED,CAAI,CAAC,EAAeD,EAAgBH,CAAI,GAAGA,CAC9H,CAAC,EAeCM,GAAgBC,GAAW,CAAC,QAAQ,IAAI,4BAA4BA,EAAU,SAAS,CAAC,EAAE,IAAMC,EAAQ,CAAC,WAAW,CAAC,OAAO,GAAM,OAAO,CAAC,C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M,YAAY,OAAOnN,GAAOA,EAAM,OAAO,QAAQA,EAAM,UAAU,OAAO,EAAE,WAAW,CAAC,KAAKmN,EAAY,OAAO,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,eAAe,GAAK,OAAOnN,GAAOA,EAAM,OAAO,QAAQA,EAAM,UAAU,OAAO,EAAE,UAAU,CAAC,KAAKmN,EAAY,KAAK,aAAa,SAAS,QAAQ,CAAC,QAAQ,SAAS,KAAK,EAAE,aAAa,CAAC,OAAO,SAAS,OAAO,EAAE,wBAAwB,GAAK,MAAM,QAAQ,OAAOnN,GAAOA,EAAM,OAAO,MAAM,EAC70B,IAAI,CAAC,KAAKmN,EAAY,OAAO,aAAa,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,EAAE,QAAQ,CAAC,KAAKA,EAAY,YAAY,MAAM,UAAU,aAAa,EAAE,IAAI,EAAE,UAAU,iBAAiB,aAAa,CAAC,MAAM,OAAO,EAAE,UAAU,CAAC,aAAa,eAAe,gBAAgB,aAAa,EAAE,YAAY,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC",
  "names": ["convertFilterName", "name", "toLegacy", "mappings", "reverseMappings", "key", "value", "parseUrlFilters", "urlParams", "filters", "filterType", "normalizedType", "values", "variantName", "decodedValue", "val", "priceRanges", "priceMax", "priceMin", "ranges", "range", "min", "max", "underRanges", "discountAmount", "discountAmountMin", "minValues", "discountPercent", "discountPercentMin", "updateUrlWithFilters", "url", "variantGroups", "variant", "normalizeName", "v", "regularRanges", "underMaxValues", "overMinValues", "discountRanges", "discountMinValues", "discountPercentRanges", "discountPercentMinValues", "_define_property", "obj", "key", "value", "globalSortState", "listener", "event", "window", "findDeep13DigitNumber", "match", "found", "ErrorBoundary", "I", "error", "errorInfo", "p", "props", "logDebug", "component", "action", "data", "getActiveSearchFields", "scope", "fields", "FC_CatalogDisplay", "isLoading", "setIsLoading", "ye", "sortedChildren", "setSortedChildren", "products", "setProducts", "favorites", "setFavorites", "isTransitioning", "setIsTransitioning", "isSettling", "setIsSettling", "Collection", "pageType", "transitionTimeoutRef", "pe", "settlingTimeoutRef", "lastUpdateRef", "urlParams", "currentPage", "setCurrentPage", "pageParam", "hasMore", "setHasMore", "observerRef", "loadMoreRef", "itemsPerPage", "allProducts", "setAllProducts", "displayedProducts", "setDisplayedProducts", "getPaginatedProducts", "te", "startIndex", "endIndex", "hasMoreItems", "ue", "url", "newUrl", "observer", "entries", "prev", "updateSortedChildrenWithTransition", "newChildren", "paginatedChildren", "now", "performTransition", "sortConfig", "setSortConfig", "sortParam", "storedSort", "filters", "setFilters", "initialFilters", "filter", "acc", "urlFilters", "parseUrlFilters", "activeFilters", "mergedFilters", "searchConfig", "setSearchConfig", "searchParam", "handleProductsReady", "e", "handleSortChange", "handleFilterReset", "resetFilters", "handleFilter", "type", "active", "newFilters", "group", "filterType", "variantStockFilter", "variantName", "valueToProcess", "val", "v", "variantValues", "nameMatches", "valueMatches", "newRange", "formattedRange", "range", "valueRange", "currentRange", "discountType", "handleSearch", "loadFavorites", "storedFavorites", "handleFavoritesUpdate", "newFavorites", "productId", "updatedFavorites", "id", "updatedChildren", "child", "handleProductsReadyEvent", "customEvent", "handleSortChangeEvent", "handleFilterResetEvent", "handleFilterChangeEvent", "handleSearchChangeEvent", "filterValues", "matchingProducts", "productType", "filterValue", "getProductDetails", "fullId", "product", "node", "c", "edge", "productMatchesFilters", "filterResults", "searchTerm", "matches", "field", "variantMatches", "option", "customColorMatches", "customColor", "titleMatches", "typeMatches", "tagMatches", "tag", "collectionMatches", "collection", "collectionTitle", "vendorMatches", "collectionValues", "productCollections", "collectionValue", "productTypeValues", "tagValues", "tagValue", "productPrice", "compareAtPrice", "discountAmount", "discountPercent", "comparePrice", "price", "variantFilters", "variant", "shouldCheckStock", "isAvailable", "variantFiltersByName", "name", "values", "matchingOption", "colorFilters", "colorFilter", "searchResultsEvent", "hasShopXTools", "collectionInstance", "emptyStateInstance", "sizedInstance", "q", "layoutStyle", "layout", "isVertical", "gridTemplateColumns", "styledInstance", "RenderTarget", "isBackNavigation", "setIsBackNavigation", "handleUrlChange", "newPage", "originalRender", "filteredShopXProducts", "filteredForPage", "styledEmptyState", "EmptyStateWrapper", "items", "item", "collectionItem", "matchingProduct", "details", "OptimizedChild", "X", "debouncedUpdateSort", "debounce_default", "newSortConfig", "debouncedUpdateFilter", "getTransitionStyles", "baseStyles", "sorted", "a", "b", "aId", "bId", "paginatedItems", "hasMoreItemsEvent", "wrappedChildren", "updateUrlWithFilters", "variantParams", "hasActiveFilters", "setError", "content", "addPropertyControls", "ControlType", "enable"]
}
