{"version":3,"file":"Search.DFL7bRMw.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/lm1KVSgaS5or05pXPBYf/97OfTlStTVayxt5aPNHg/t4zexRMXi.js","https:/framerusercontent.com/modules/T1OktFXcjKmqU1V7Pau2/X3obXskwRNp1x5PRdga3/Search.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 7 C 0 3.134 3.134 0 7 0 C 10.866 0 14 3.134 14 7 C 14 10.866 10.866 14 7 14 C 3.134 14 0 10.866 0 7 Z\" fill=\"transparent\" height=\"14px\" id=\"Ih91_mp5T\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--1df8v9o, rgb(0,0,0))\" transform=\"translate(3 3)\" width=\"14px\"/><path d=\"M 0 0 L 6 6\" fill=\"transparent\" height=\"6px\" id=\"sLV96KvxO\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--1df8v9o, rgb(0,0,0))\" transform=\"translate(15 15)\" width=\"6px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,n2nHSaXfp:stroke??props.n2nHSaXfp??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,n2nHSaXfp,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-UZLQq\",className),layoutId:layoutId,ref:ref,style:{\"--1df8v9o\":n2nHSaXfp,...style}});});const css=[`.framer-UZLQq { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--1df8v9o); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"n2nHSaXfp\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Search\",\"color\":{\"type\":\"variable\",\"value\":\"1df8v9o\"},\"set\":{\"localId\":\"vectorSet/yXo17f3GZ\",\"id\":\"yXo17f3GZ\",\"moduleId\":\"eO37kitVCMcNEgHMGd3K\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-UZLQq\");Icon.displayName=\"Search\";export default Icon;addPropertyControls(Icon,{n2nHSaXfp:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVariables\":\"{\\\"n2nHSaXfp\\\":\\\"stroke\\\"}\",\"framerDisableUnlink\":\"true\",\"framerVector\":\"{\\\"name\\\":\\\"Search\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1df8v9o\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/yXo17f3GZ\\\",\\\"id\\\":\\\"yXo17f3GZ\\\",\\\"moduleId\\\":\\\"eO37kitVCMcNEgHMGd3K\\\"}}\",\"framerImmutableVariables\":\"true\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function BroadcastSearch(props){const[searchQuery,setSearchQuery]=useState(\"\");const[debouncedSearchQuery,setDebouncedSearchQuery]=useState(\"\");const BROADCAST_ID=\"3.14px solid transparent\";const uniqueId=useRef(`broadcast-search-${Math.random().toString(36).substring(2,11)}`);// Debounce search query\nuseEffect(()=>{const timer=setTimeout(()=>{setDebouncedSearchQuery(searchQuery);},150)// 150ms debounce\n;return()=>clearTimeout(timer);},[searchQuery]);useEffect(()=>{// Apply filter when debounced query changes\nfilterItems(debouncedSearchQuery,true)// true = trigger pagination refresh\n;// Set up an interval to refresh the data (but not trigger pagination)\nconst intervalId=setInterval(()=>filterItems(debouncedSearchQuery,false),1e3);// Clean up on unmount\nreturn()=>clearInterval(intervalId);},[debouncedSearchQuery]);const triggerPaginationRefresh=()=>{// Only interact with pagination if it actually exists and is enabled\nif(window.paginationConfig?.isEnabled&&window.updatePagination){console.log(\"Search applied - refreshing pagination\");window.updatePagination({itemsPerPage:window.paginationConfig.itemsPerPage,currentPage:1,isEnabled:true});// Force pagination component to update its state\nif(window.forcePaginationUpdate){window.forcePaginationUpdate(1);}}else{console.log(\"No pagination - search applied without pagination refresh\");// Just trigger the broadcaster to refresh display without any pagination limits\nif(window.updatePagination){// This will NOT create any config, just trigger refresh\nwindow.updatePagination({isEnabled:false});}}};const filterItems=(query,shouldTriggerPagination=false)=>{// Find broadcaster elements\nconst broadcasterElements=document.querySelectorAll(`[style*=\"border: ${BROADCAST_ID}\"]`);if(broadcasterElements.length>0){const broadcaster=broadcasterElements[0];const children=window.allBroadcastItems||Array.from(broadcaster.children);// Only log when search query actually changes\nif(shouldTriggerPagination){console.log(`Searching ${children.length} total items for: \"${query}\"`);}// Tag each element with this filter's search state using data-filter- prefix\nchildren.forEach(child=>{const textContent=child.textContent||child.innerText||\"\";const matchesSearch=!query.trim()||textContent.toLowerCase().includes(query.toLowerCase());// Store matching state as a data-filter attribute (NOT data-search)\nchild.setAttribute(`data-filter-${uniqueId.current}`,matchesSearch?\"match\":\"no-match\");});// Only trigger pagination refresh when search query actually changes\nif(shouldTriggerPagination){console.log(`Search filtering complete, triggering pagination/filter refresh`);// Use setTimeout to ensure DOM updates are processed\nsetTimeout(()=>{triggerPaginationRefresh();},10);}}};const handleSearchChange=e=>{setSearchQuery(e.target.value);};// Create a style element for the placeholder color\nuseEffect(()=>{const styleEl=document.createElement(\"style\");styleEl.innerHTML=`\n            #${uniqueId.current}::placeholder {\n                color: ${props.placeholderColor};\n            }\n        `;document.head.appendChild(styleEl);return()=>{document.head.removeChild(styleEl);};},[props.placeholderColor]);return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"input\",{id:uniqueId.current,type:\"text\",value:searchQuery,onChange:handleSearchChange,placeholder:props.placeholder,style:{width:\"100%\",height:\"100%\",padding:props.inputPadding,paddingLeft:props.showSearchIcon?\"36px\":props.inputPadding,border:`${props.border.borderWidth}px ${props.border.borderStyle} ${props.border.borderColor}`,borderRadius:props.borderRadius,...props.font,color:props.fontColor,backgroundColor:props.inputBackground,outline:\"none\",boxSizing:\"border-box\"}}),props.showSearchIcon&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:\"10px\",top:\"50%\",transform:\"translateY(-50%)\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z\",stroke:props.iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]});}// Default props\nBroadcastSearch.defaultProps={placeholder:\"Search...\",placeholderColor:\"#888888\",showSearchIcon:true,iconColor:\"#888888\",fontColor:\"#000000\",inputBackground:\"white\",inputPadding:\"10px\",borderRadius:\"8px\",border:{borderWidth:1,borderStyle:\"solid\",borderColor:\"#dddddd\"},font:{family:\"Inter\",fontSize:14,fontWeight:400,lineHeight:1.5,letterSpacing:0,textAlign:\"left\"}};// Property controls\naddPropertyControls(BroadcastSearch,{placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Search...\"},placeholderColor:{type:ControlType.Color,title:\"Placeholder Color\",defaultValue:\"#888888\"},showSearchIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#888888\",hidden(props){return!props.showSearchIcon;}},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#000000\"},inputBackground:{type:ControlType.Color,title:\"Input Background\",defaultValue:\"white\"},inputPadding:{type:ControlType.Padding,title:\"Input Padding\",defaultValue:\"10px\"},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:1,borderStyle:\"solid\",borderColor:\"#dddddd\"}},borderRadius:{type:ControlType.BorderRadius,title:\"Border Radius\",defaultValue:\"8px\"},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\",defaultValue:{family:\"Inter\",fontSize:14,fontWeight:400,lineHeight:1.5,letterSpacing:0,textAlign:\"left\"},description:\"v3.0 \\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BroadcastSearch\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":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