{"version":3,"file":"CMS_Filter.HdEbmTin.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx","__esmMin","oe","init_ssg_sandbox_shims","c","init_jsx_runtime","init_npm_react_18_3_1","window","init_framer_CaDWdxiz","DataObserverContext","applyPagination","filteredItems","filterAttributes","item","name","attr","itemsToShow","mode","startIndex","currentPage","itemsPerPage","endIndex","totalItemsToShow","initializeGlobalPagination","config","broadcasterElements","BROADCAST_ID","Broadcaster","broadcaster","withBroadcaster","C","props","init_CMS_Filter"],"sources":["https:/framerusercontent.com/modules/HelQTRHAmnWPWsCDnTyf/v12V64DpUrRWue0rvQi7/CMS_Filter.js"],"sourcesContent":["// Broadcast 3.0 Code to be used with 3.0 components\nimport{jsx as _jsx}from\"react/jsx-runtime\";// Unique identifier for the broadcaster\nconst BROADCAST_ID=\"3.14px solid transparent\";function applyPagination(broadcaster){// If no pagination config exists or is disabled, show ALL filtered items\nif(!window.paginationConfig?.isEnabled||!window.allBroadcastItems){console.log(\"No pagination - showing ALL filtered items\");if(window.allBroadcastItems){const filteredItems=window.allBroadcastItems.filter(item=>{const filterAttributes=item.getAttributeNames().filter(name=>name.startsWith(\"data-filter-\"));if(filterAttributes.length>0){return filterAttributes.every(attr=>item.getAttribute(attr)===\"match\");}else{return true;}});// Hide all items first\nwindow.allBroadcastItems.forEach(item=>{item.style.display=\"none\";});// Show ALL filtered items (no limits)\nfilteredItems.forEach(item=>{item.style.display=\"\";});console.log(`Showing ALL ${filteredItems.length} filtered items (NO LIMITS)`);}return;}// Only get here if pagination is explicitly enabled\nconst{itemsPerPage,currentPage,mode}=window.paginationConfig;// Get items that pass all filters\nconst filteredItems=window.allBroadcastItems.filter(item=>{const filterAttributes=item.getAttributeNames().filter(name=>name.startsWith(\"data-filter-\"));if(filterAttributes.length>0){return filterAttributes.every(attr=>item.getAttribute(attr)===\"match\");}else{return true;}});console.log(`Filtered ${window.allBroadcastItems.length} items down to ${filteredItems.length}`);// Apply pagination based on mode\nlet itemsToShow=[];if(mode===\"pagination\"){// Traditional pagination - show only current page\nconst startIndex=(currentPage-1)*itemsPerPage;const endIndex=startIndex+itemsPerPage;itemsToShow=filteredItems.slice(startIndex,endIndex);console.log(`Pagination mode: page ${currentPage}, items ${startIndex}-${endIndex-1} of ${filteredItems.length} filtered items`);}else if(mode===\"loadMore\"||mode===\"autoScroll\"){// Load more / auto scroll - show all items up to current page\nconst totalItemsToShow=currentPage*itemsPerPage;itemsToShow=filteredItems.slice(0,totalItemsToShow);console.log(`${mode} mode: showing first ${totalItemsToShow} items (${itemsToShow.length} available)`);}else{// Fallback to show all if mode is unknown\nitemsToShow=filteredItems;console.log(`Unknown mode \"${mode}\", showing all ${filteredItems.length} items`);}// Hide ALL items first\nwindow.allBroadcastItems.forEach(item=>{item.style.display=\"none\";});// Show selected items\nitemsToShow.forEach(item=>{item.style.display=\"\";});console.log(`Applied ${mode} pagination: showing ${itemsToShow.length} items`);}// Initialize global function safely\nfunction initializeGlobalPagination(){if(typeof window!==\"undefined\"){window.updatePagination=function(config){console.log(\"updatePagination called with:\",config);// Only create config when pagination is actually enabled\nif(config.isEnabled){if(!window.paginationConfig){window.paginationConfig={itemsPerPage:config.itemsPerPage||12,currentPage:config.currentPage||1,isEnabled:true,mode:config.mode||\"pagination\"};}else{Object.assign(window.paginationConfig,{itemsPerPage:config.itemsPerPage||window.paginationConfig.itemsPerPage,currentPage:config.currentPage||window.paginationConfig.currentPage,isEnabled:config.isEnabled??window.paginationConfig.isEnabled,mode:config.mode||window.paginationConfig.mode});}window.paginationComponentExists=true;}else{// Completely clear pagination when disabled\nconsole.log(\"Disabling pagination - clearing config\");window.paginationConfig=undefined;window.paginationComponentExists=false;}console.log(\"Pagination config:\",window.paginationConfig);// Apply pagination immediately\nconst broadcasterElements=document.querySelectorAll(`[style*=\"border: ${BROADCAST_ID}\"]`);if(broadcasterElements.length>0){applyPagination(broadcasterElements[0]);}else{console.log(\"No broadcaster found\");}};}}// Initialize on module load\ninitializeGlobalPagination();export function Broadcaster(){return{style:{border:BROADCAST_ID},animate:{scale:1,transition:{duration:.1}},onAnimationComplete(){console.log(\"Broadcaster onAnimationComplete triggered\");// Ensure global function is available\ninitializeGlobalPagination();const broadcasterElements=document.querySelectorAll(`[style*=\"border: ${BROADCAST_ID}\"]`);console.log(\"Found broadcaster elements:\",broadcasterElements.length);if(broadcasterElements.length>0){const broadcaster=broadcasterElements[0];// Store all items\nwindow.allBroadcastItems=Array.from(broadcaster.children);console.log(`Stored ${window.allBroadcastItems.length} items`);// IMMEDIATELY hide all items to prevent flash\nwindow.allBroadcastItems.forEach(item=>{item.style.display=\"none\";});console.log(\"Hidden all items initially\");// Apply initial display logic (NO DEFAULT CONFIG)\napplyPagination(broadcaster);}else{console.log(\"No broadcaster found!\");}}};}export function BroadcastListener(){return{animate:{scale:1,transition:{duration:.1}},onAnimationComplete(){console.log(\"Broadcast listener activated\");},onTap(){console.log(\"Removing last item\");if(window.allBroadcastItems&&window.allBroadcastItems.length>0){const lastItem=window.allBroadcastItems.pop();if(lastItem&&lastItem.parentNode){lastItem.parentNode.removeChild(lastItem);console.log(\"Removed item, remaining:\",window.allBroadcastItems.length);// Reapply pagination/filtering with new item count\nconst broadcasterElements=document.querySelectorAll(`[style*=\"border: ${BROADCAST_ID}\"]`);if(broadcasterElements.length>0){applyPagination(broadcasterElements[0]);}}}}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withBroadcaster(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...Broadcaster(props)});};}withBroadcaster.displayName=\"Broadcaster\";export function withBroadcastListener(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...BroadcastListener(props)});};}withBroadcastListener.displayName=\"BroadcastListener\";\nexport const __FramerMetadata__ = {\"exports\":{\"withBroadcaster\":{\"type\":\"reactHoc\",\"name\":\"withBroadcaster\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"BroadcastListener\":{\"type\":\"override\",\"name\":\"BroadcastListener\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBroadcastListener\":{\"type\":\"reactHoc\",\"name\":\"withBroadcastListener\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Broadcaster\":{\"type\":\"override\",\"name\":\"Broadcaster\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMS_Filter.map"],"mappings":"A,iLAE8C,SAASW,EAAgB,EAAY,CACnF,GAAG,CAACH,EAAO,kBAAkB,WAAW,CAACA,EAAO,kBAAkB,CAA2D,GAA1D,QAAQ,IAAI,4CAA4C,EAAKA,EAAO,kBAAkB,CAAC,IAAMI,EAAcJ,EAAO,kBAAkB,OAAO,GAAM,CAAC,IAAMK,EAAiBC,EAAK,kBAAkB,CAAC,CAAC,OAAO,GAAMC,EAAK,WAAW,cAAc,CAAC,EAA6G,OAAxGF,EAAiB,OAAO,EAAUA,EAAiB,MAAM,GAAMC,EAAK,aAAaE,CAAI,IAAI,OAAO,EAAe,EAAM,CAAC,EAC5aR,EAAO,kBAAkB,QAAQ,GAAM,CAAC,EAAK,MAAM,QAAQ,MAAO,CAAC,EACnEI,EAAc,QAAQ,GAAM,CAAC,EAAK,MAAM,QAAQ,EAAG,CAAC,EAAE,QAAQ,IAAI,eAAeA,EAAc,OAAO,4BAA4B,CAAE,CAAC,MAAO,CAC5I,GAAK,CAAC,eAAa,cAAY,QAAMJ,EAAO,iBACtCI,EAAcJ,EAAO,kBAAkB,OAAO,GAAM,CAAC,IAAMK,EAAiBC,EAAK,kBAAkB,CAAC,CAAC,OAAO,GAAMC,EAAK,WAAW,cAAc,CAAC,EAA6G,OAAxGF,EAAiB,OAAO,EAAUA,EAAiB,MAAM,GAAMC,EAAK,aAAaE,CAAI,IAAI,OAAO,EAAe,EAAM,CAAC,EAAE,QAAQ,IAAI,YA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