@indxsearch/intrface 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -54,6 +54,8 @@ Import the CSS file in your app entry point:
54
54
  import '@indxsearch/intrface/styles.css';
55
55
  ```
56
56
 
57
+ **Note:** The intrface styles include scoped CSS resets to ensure consistent spacing and appearance regardless of your application's global styles. These resets are automatically applied to all intrface components and won't affect the rest of your application.
58
+
57
59
  ### 3. Basic Implementation
58
60
 
59
61
  ```typescript
package/dist/index.es.js CHANGED
@@ -803,7 +803,7 @@ const Xt = ({
803
803
  setDebounceDelay: O,
804
804
  setSearchSettings: P
805
805
  },
806
- children: r
806
+ children: /* @__PURE__ */ e.jsx("div", { className: "indx-search-provider", children: r })
807
807
  }
808
808
  );
809
809
  }, Ee = () => {
package/dist/index.umd.js CHANGED
@@ -19,4 +19,4 @@
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,E,V,re,V),k[V+E]=!0)}if(V=null,S!==void 0&&(g(S),V=""+S),_(a)&&(g(a.key),V=""+a.key),"key"in a){S={};for(var xe in a)xe!=="key"&&(S[xe]=a[xe])}else S=a;return V&&x(S,typeof t=="function"?t.displayName||t.name||"Unknown":t),w(t,V,S,u(),ae,ve)}function M(t){L(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===ue&&(t._payload.status==="fulfilled"?L(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function L(t){return typeof t=="object"&&t!==null&&t.$$typeof===K}var y=o,K=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),n=Symbol.for("react.consumer"),F=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ue=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),de=Symbol.for("react.client.reference"),O=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe=Object.prototype.hasOwnProperty,I=Array.isArray,C=console.createTask?console.createTask:function(){return null};y={react_stack_bottom_frame:function(t){return t()}};var U,me={},he=y.react_stack_bottom_frame.bind(y,v)(),h=C(i(v)),k={};Me.Fragment=b,Me.jsx=function(t,a,S){var E=1e4>O.recentlyCreatedOwnerStacks++;return q(t,a,S,!1,E?Error("react-stack-top-frame"):he,E?C(i(t)):h)},Me.jsxs=function(t,a,S){var E=1e4>O.recentlyCreatedOwnerStacks++;return q(t,a,S,!0,E?Error("react-stack-top-frame"):he,E?C(i(t)):h)}})()),Me}var We;function rt(){return We||(We=1,process.env.NODE_ENV==="production"?Ae.exports=et():Ae.exports=tt()),Ae.exports}var e=rt();const qe=o.createContext(void 0);function nt(r,l){let g;const i=(...u)=>{clearTimeout(g),g=setTimeout(()=>r(...u),l)};return i.cancel=()=>clearTimeout(g),i}const st=({children:r,email:l,password:g,url:i,dataset:u,allowEmptySearch:v=!1,maxResults:_=10,facetDebounceDelayMillis:x=500,enableFacets:s=!0,coverageDepth:w=500,removeDuplicates:q=!0,enableCoverage:M=!0,initialCoverageSetup:L={},enableDebugLogs:y=!1,preAuthenticatedToken:K})=>{const z=o.useRef(0),b=o.useRef(void 0),R=o.useRef(!1),p=o.useRef(!1),[n,F]=o.useState({query:"",results:null,isLoading:!1,resultsSuppressed:!v,facetDebounceDelayMillis:x,filters:{},rangeFilters:{},facetStats:{},searchSettings:{maxNumberOfRecordsToReturn:_,coverageDepth:w,enableCoverage:M,removeDuplicates:q,minimumScore:0,showScore:!0,placeholderText:"Type to search",coverageSetup:{levenshteinMaxWordSize:20,minWordSize:2,coverageMinWordHitsAbs:1,coverageMinWordHitsRelative:0,coverageQLimitForErrorTolerance:5,coverageLcsErrorToleranceRelativeq:.2,coverWholeQuery:!0,coverWholeWords:!0,coverFuzzyWords:!0,coverJoinedWords:!0,coverPrefixSuffix:!0,truncate:!0,...L}}});o.useEffect(()=>{y&&console.log("SearchContext mounted on client")},[y]),o.useEffect(()=>{F(c=>({...c,facetDebounceDelayMillis:x}))},[x]);const[A,D]=o.useState(null),[m]=o.useState(s),J=o.useCallback((c,d={})=>{if(!A)throw new Error("No authentication token available");return fetch(c,{...d,headers:{...d.headers,Authorization:`Bearer ${A}`},credentials:"include"})},[A]),[ue,G]=o.useState([]),[de,O]=o.useState([]),[pe,I]=o.useState([]),[C,U]=o.useState(!0),[me,he]=o.useState({}),[h,k]=o.useState({}),[t,a]=o.useState({}),[S,E]=o.useState(""),[ae,ve]=o.useState(""),[V,re]=o.useState({}),xe=o.useRef(null),Ce=o.useCallback(c=>{F(d=>({...d,query:c,filters:{},rangeFilters:{}}))},[]),H=o.useCallback(c=>{F(d=>({...d,facetDebounceDelayMillis:c}))},[]),$=o.useCallback(c=>{F(d=>({...d,searchSettings:{...d.searchSettings,...c,coverageSetup:{...d.searchSettings.coverageSetup,...c.coverageSetup||{}}}}))},[]),Q=o.useCallback((c,d)=>{F(j=>{const N={...j.filters},B=N[c]||[],Y=B.includes(d)?B.filter(X=>X!==d):[...B,d];return Y.length?N[c]=Y:delete N[c],{...j,filters:N}})},[]),we=o.useCallback((c,d,j)=>{F(N=>({...N,rangeFilters:{...N.rangeFilters,[c]:{min:d,max:j}}}))},[]),Fe=o.useCallback(()=>{F(c=>({...c,filters:{},rangeFilters:{}}))},[]),ke=o.useCallback((c,d)=>{F(j=>{const N={...j.filters},B={...j.rangeFilters};if(d!==void 0){const X=(N[c]||[]).filter(le=>le!==d);X.length>0?N[c]=X:delete N[c]}else delete B[c];return{...j,filters:N,rangeFilters:B}})},[]),He=o.useCallback((c,d)=>{F(j=>({...j,sortBy:c||void 0,sortAscending:c?d:void 0}))},[]),Ve=o.useCallback(async(c,d,j)=>{if(c.length===0)return null;if(c.length===1)return c[0];let N=c[0];for(let B=1;B<c.length;B++){const Y=await J(`${d}/api/CombineFilters/${j}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({A:N,B:c[B],useAndOperation:!0})});if(!Y.ok){const X=await Y.json();throw console.error("CombineFilters failed:",X),new Error("CombineFilters failed")}N=await Y.json()}return N},[J]),Le=n.searchSettings.maxNumberOfRecordsToReturn,Ue=n.searchSettings.enableCoverage,Ge=n.searchSettings.removeDuplicates,Xe=n.searchSettings.coverageDepth,Je=n.searchSettings.minimumScore,Pe=n.sortBy,Oe=n.sortAscending,Qe=o.useMemo(()=>n.searchSettings.coverageSetup,[n.searchSettings.coverageSetup.levenshteinMaxWordSize,n.searchSettings.coverageSetup.minWordSize,n.searchSettings.coverageSetup.coverageMinWordHitsAbs,n.searchSettings.coverageSetup.coverageMinWordHitsRelative,n.searchSettings.coverageSetup.coverageQLimitForErrorTolerance,n.searchSettings.coverageSetup.coverageLcsErrorToleranceRelativeq,n.searchSettings.coverageSetup.coverWholeQuery,n.searchSettings.coverageSetup.coverWholeWords,n.searchSettings.coverageSetup.coverFuzzyWords,n.searchSettings.coverageSetup.coverJoinedWords,n.searchSettings.coverageSetup.coverPrefixSuffix,n.searchSettings.coverageSetup.truncate]),Ye=o.useCallback(async({enableFacets:c})=>{if(!A)return;const d=++z.current;F(j=>({...j,isLoading:!0}));try{const j=Object.entries(n.filters??{}),B=(await Promise.all(j.map(async([W,Z])=>Promise.all(Z.map(ee=>J(`${i}/api/CreateValueFilter/${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({FieldName:W,Value:ee})}).then(fe=>fe.json())))))).flat(),Y=Object.entries(n.rangeFilters??{}),X=await Promise.all(Y.map(([W,{min:Z,max:ee}])=>J(`${i}/api/CreateRangeFilter/${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({FieldName:W,LowerLimit:Z,UpperLimit:ee})}).then(fe=>fe.json()))),le=[...B,...X].filter(W=>W&&typeof W.hashString=="string"),ne=await Ve(le,i,u),Ne=v||n.query.trim()!=="",Re={text:n.query,maxNumberOfRecordsToReturn:Ne?Le:0,enableFacets:c,...ne?{filter:ne}:{},...Pe?{sortBy:Pe}:{},...Oe!==void 0?{sortAscending:Oe}:{},enableCoverage:Ue,removeDuplicates:Ge,coverageDepth:Xe,coverageSetup:Qe};y&&console.log("[performSearch] request body:",JSON.stringify(Re,null,2));const se=await(await J(`${i}/api/Search/${u}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Re)})).json(),ye=se.truncationIndex??-1,Ee=se.records||[],T=Ee.map(W=>W.documentKey),ce=Ee.map(W=>W.score);let oe=[];Ne&&T.length>0&&(oe=(await(await J(`${i}/api/GetJson/${u}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})).json()).map((ee,fe)=>({document:ee,documentKey:T[fe],score:ce[fe]})));let Se={};if(c&&se.facets){for(const[W,Z]of Object.entries(se.facets))if(Array.isArray(Z)&&Z.length>0){const ee=Z.map(fe=>Number(fe.key)).filter(fe=>!isNaN(fe));ee.length>0&&(Se[W]={min:Math.min(...ee),max:Math.max(...ee)})}}const jt=n.query!==S,yt=n.query!==ae;let Ie=n.facetStats??{};if(jt?(Ie={...me,...Se},a(Ie),E(n.query)):Ie={...t,...Se},yt&&c){const W={...V};for(const[Z,ee]of Object.entries(Se))W[Z]=ee;re(W),ve(n.query)}let _e=se.facets;if(c&&(!_e||Object.keys(_e).length===0)){_e={};for(const[W,Z]of Object.entries(h))_e[W]=Z.map(ee=>({key:ee,value:null}))}if(d!==z.current)return;const Ct=oe.filter(W=>{const Z=n.query.trim();return Z===""||Z.length===1?!0:W.score>=Je});F(W=>({...W,results:Ct,resultsSuppressed:!Ne,...c?{facets:_e,facetStats:Ie}:{},isLoading:!1,truncationIndex:ye}))}catch(j){if(console.error("[Search] ❌ Search failed:",j),j instanceof TypeError&&j.message.includes("fetch")?(console.error("[Search] ❌ Network error - cannot reach INDX server"),console.error("[Search] 💡 Check if server is running at:",i)):j instanceof Error&&(j.message.includes("401")?(console.error("[Search] ❌ Authentication failed"),console.error("[Search] 💡 Your token may have expired. Get a fresh token with:"),console.error('[Search] 💡 curl -X POST "'+i+`/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`)):j.message.includes("404")?(console.error("[Search] ❌ Dataset not found"),console.error('[Search] 💡 Check that dataset "'+u+'" exists')):console.error("[Search] 💡 Error:",j.message)),d!==z.current)return;F(N=>({...N,results:null,isLoading:!1,resultsSuppressed:!1,error:j instanceof Error?j.message:"Search failed"}))}},[n.query,n.filters,n.rangeFilters,Pe,Oe,Le,Ue,Ge,Xe,Qe,Je,J,Ve,i,u,v,A]);o.useEffect(()=>{b.current=Ye},[Ye]),o.useCallback(()=>{var c;y&&console.log("Search fired"),(c=b.current)==null||c.call(b,{enableFacets:!1})},[]);const ie=o.useRef(null);return o.useEffect(()=>{var c;return(c=ie.current)==null||c.cancel(),ie.current=nt(()=>{var d;y&&console.log("Debounced searchWithFacets fired"),(d=b.current)==null||d.call(b,{enableFacets:!0})},n.facetDebounceDelayMillis??500),()=>{var d;(d=ie.current)==null||d.cancel()}},[n.facetDebounceDelayMillis]),o.useCallback(()=>{var c;(c=ie.current)==null||c.call(ie)},[]),o.useEffect(()=>{var c;!C&&A&&!R.current&&(v&&((c=b.current)==null||c.call(b,{enableFacets:m})),R.current=!0)},[C,A,v,m]),o.useEffect(()=>{var N,B,Y,X,le;if(!A||!R.current)return;const c=n.query.trim(),d=c===""&&v;if(c===""&&!v){n.resultsSuppressed||F(ne=>({...ne,resultsSuppressed:!0}));return}return d?((N=ie.current)==null||N.cancel(),(B=b.current)==null||B.call(b,{enableFacets:m})):m?(y&&console.log("Search fired"),(Y=b.current)==null||Y.call(b,{enableFacets:!1}),(X=ie.current)==null||X.call(ie)):(le=b.current)==null||le.call(b,{enableFacets:!1}),()=>{var ne;(ne=ie.current)==null||ne.cancel()}},[n.query,v,m]),o.useEffect(()=>{var j;if(!R.current||!A)return;if(!p.current){p.current=!0,y&&console.log("[Filter effect] First run, skipping");return}if(n.query!==S){y&&console.log("[Filter effect] Skipping because query changed");return}const c=n.query.trim();m&&!(!v&&c==="")&&(y&&console.log("[Filter effect] Firing search"),(j=b.current)==null||j.call(b,{enableFacets:!0}))},[n.filters,n.rangeFilters]),o.useEffect(()=>{var j;if(!R.current||!A)return;const c=n.query.trim();m&&!(!v&&c==="")&&((j=b.current)==null||j.call(b,{enableFacets:!0}))},[Pe,Oe]),o.useEffect(()=>{(async()=>{try{let d;if(K)y&&console.log("[Auth] ✅ Using pre-authenticated token"),d=K,D(K);else{if(!l||!g)throw console.error("[Auth] ❌ Missing credentials"),l||(console.error("[Auth] ❌ Missing email"),console.error('[Auth] 💡 Pass email="your@email.com" to SearchProvider')),g||(console.error("[Auth] ❌ Missing password"),console.error('[Auth] 💡 Pass password="yourpassword" to SearchProvider')),new Error("Email and password are required. Check console for instructions.");if(!i)throw console.error("[Auth] ❌ Missing INDX server URL"),console.error("[Auth] 💡 Add NEXT_PUBLIC_INDX_URL to your .env.local file"),new Error("INDX server URL is required. Check console for instructions.");if(!u)throw console.error("[Auth] ❌ Missing dataset name"),console.error('[Auth] 💡 Pass dataset="your-dataset-name" to SearchProvider'),new Error("Dataset name is required. Check console for instructions.");y&&console.log("[Auth] 🔐 Logging in to get session token...");const T=await fetch(`${i}/api/Login`,{method:"POST",headers:{"Content-Type":"application/json",accept:"*/*"},credentials:"include",body:JSON.stringify({userEmail:l,userPassWord:g})});if(!T.ok)throw console.error("[Auth] ❌ Login failed:",T.status,await T.text()),new Error("Login failed. Check your email and password.");if(d=(await T.json()).token,!d)throw console.error("[Auth] ❌ No token received from login response"),new Error("No token received from login.");y&&console.log("[Auth] ✅ Login successful, bearer token received (length:",d.length,")"),y&&console.log("[Auth] 🔓 Opening dataset session...");const oe=await fetch(`${i}/api/CreateOrOpen/${u}/400`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`},credentials:"include",body:'""'});if(!oe.ok)throw console.error("[Auth] ❌ CreateOrOpen failed:",oe.status,await oe.text()),new Error("Failed to open dataset session.");D(d),y&&console.log("[Auth] ✅ Dataset session established")}const j=T=>fetch(T,{method:"GET",headers:{accept:"text/plain",Authorization:`Bearer ${d}`},credentials:"include"});y&&console.log("[Auth] 🔍 Checking dataset status...");const N=await j(`${i}/api/GetStatus/${u}`);if(!N.ok){if(N.status===401)throw console.error("[Auth] ❌ Authentication failed (401 Unauthorized)"),console.error("[Auth] 💡 Your token may be expired or invalid"),console.error('[Auth] 💡 Get a fresh token with: curl -X POST "'+i+`/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`),new Error("Authentication failed (401). Token may be expired. Check console for instructions.");if(N.status===404)throw console.error('[Auth] ❌ Dataset "'+u+'" not found (404)'),console.error('[Auth] 💡 Available datasets can be checked with: curl -X GET "'+i+'/api/GetUserDataSets" -H "Authorization: Bearer YOUR_TOKEN"'),console.error("[Auth] 💡 Make sure you spelled the dataset name correctly"),new Error('Dataset "'+u+'" not found. Check console for instructions.');{const T=await N.text();throw console.error("[Auth] ❌ Failed to get dataset status:",N.status,T),console.error("[Auth] 💡 Check if your INDX server is running at:",i),new Error("Failed to connect to INDX server. Check console for details.")}}const B=await N.json();y&&console.log("[Auth] 📊 Dataset status:",B),B.state&&B.state!=="Ready"&&(console.warn("[Auth] ⚠️ Dataset is not ready yet. Current state:",B.state),console.warn("[Auth] 💡 Wait for indexing to complete before searching"));const Y=B.documentCount??B.numberOfRecords??0;Y===0?(console.warn('[Auth] ⚠️ Dataset "'+u+'" is empty (0 records)'),console.warn("[Auth] 💡 Add documents to your dataset before searching"),console.warn("[Auth] 💡 Search will work but return no results")):y&&console.log("[Auth] ✅ Dataset has",Y,"records");const[X,le,ne]=await Promise.all([j(`${i}/api/GetFilterableFields/${u}`),j(`${i}/api/GetFacetableFields/${u}`),j(`${i}/api/GetSortableFields/${u}`)]);if(!X.ok)throw console.error("[Auth] ❌ GetFilterableFields failed:",X.status,await X.text()),new Error("Failed to get filterable fields. Check console for details.");if(!le.ok)throw console.error("[Auth] ❌ GetFacetableFields failed:",le.status,await le.text()),new Error("Failed to get facetable fields. Check console for details.");if(!ne.ok)throw console.error("[Auth] ❌ GetSortableFields failed:",ne.status,await ne.text()),new Error("Failed to get sortable fields. Check console for details.");const Ne=await X.json().catch(T=>(console.error("Failed to parse GetFilterableFields response:",T),[])),Re=await le.json().catch(T=>(console.error("Failed to parse GetFacetableFields response:",T),[])),Ze=await ne.json().catch(T=>(console.error("Failed to parse GetSortableFields response:",T),[]));G(Ne||[]),O(Re||[]),I(Ze||[]);let se={facets:{}};try{const T=await fetch(`${i}/api/Search/${u}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`},credentials:"include",body:JSON.stringify({text:"",maxNumberOfRecordsToReturn:0,enableFacets:!0})});T.ok?se=await T.json().catch(ce=>(console.warn("Failed to parse blank search response:",ce),{facets:{}})):(console.warn("Blank search failed:",T.status,T.statusText),console.warn("Continuing without initial facet data - facets will be populated after first search"))}catch(T){console.warn("Blank search error:",T),console.warn("Continuing without initial facet data - facets will be populated after first search")}const ye={};if(se.facets){for(const[T,ce]of Object.entries(se.facets))if(Array.isArray(ce)&&ce.length>0){const oe=ce.map(Se=>Number(Se.key)).filter(Se=>!isNaN(Se));oe.length>0&&(ye[T]={min:Math.min(...oe),max:Math.max(...oe)})}}const Ee={};if(se.facets)for(const[T,ce]of Object.entries(se.facets))Array.isArray(ce)&&(Ee[T]=ce.map(oe=>oe.key));xe.current={facets:se.facets,facetStats:ye,facetKeys:Ee},he(ye),k(Ee),re(ye),F(T=>({...T,facetStats:ye})),y&&console.log("[Auth] ✅ Initialization complete")}catch(d){throw console.error("[Auth] ❌ Initialization failed:",d),(d instanceof Error||typeof d=="object"&&d!==null&&"message"in d)&&console.error("[Auth] 💡 Error:",d.message),d instanceof TypeError&&d.message.includes("fetch")&&(console.error("[Auth] ❌ Network error - cannot connect to INDX server"),console.error("[Auth] 💡 Check if the server is running at:",i),console.error("[Auth] 💡 Check your NEXT_PUBLIC_INDX_URL in .env.local"),console.error("[Auth] 💡 For local development, it should be: http://localhost:38171")),d}finally{U(!1)}})()},[l,g,i,u]),e.jsx(qe.Provider,{value:{state:{...n,filterableFields:ue,facetableFields:de,sortableFields:pe,rangeBounds:V},isFetchingInitial:C,allowEmptySearch:v,setQuery:Ce,toggleFilter:Q,setRangeFilter:we,resetFilters:Fe,resetSingleFilter:ke,setSort:He,setDebounceDelay:H,setSearchSettings:$},children:r})},ge=()=>{const r=o.useContext(qe);if(!r)throw new Error("useSearchContext must be used within a SearchProvider");return r},ot=({className:r="",autoFocus:l=!1,inputSize:g="default",showClear:i=!0,showFocus:u=!1,...v})=>{const{state:{query:_,filters:x,rangeFilters:s,searchSettings:w},setQuery:q}=ge();Object.keys(x).length>0||Object.keys(s).length>0;const M=_.length>0;return e.jsx(f.SearchField,{type:"text",value:_,onChange:L=>q(L.target.value),placeholder:w.placeholderText,autoFocus:l,className:r,showSearchIcon:!0,inputSize:g,showFocusBorder:u,...v,children:i&&M&&e.jsx(f.Button,{variant:"ghost",size:"micro",onClick:()=>q(""),"aria-label":"Clear search",children:"Clear"})})},be={placeholder:"_placeholder_bcpqa_1",invalid:"_invalid_bcpqa_10",row:"_row_bcpqa_14",indexNumber:"_indexNumber_bcpqa_42",scoreNumber:"_scoreNumber_bcpqa_49"},at=({color:r="black",size:l=21})=>{const g=.7142857142857143,i=l,u=typeof l=="number"?l*g:`calc(${l} * 0.7142857142857143)`;return e.jsx("svg",{width:i,height:u,viewBox:"0 0 7 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 0H3V1V2V3H2V2H1V3H2V4H3V5H4V4H5V3H6V2H5V3H4V2V1V0ZM4 3V4H3V3H4Z",fill:r})})},it=({color:r="black",size:l=21})=>{const g=.7142857142857143,i=l,u=typeof l=="number"?l*g:`calc(${l} * 0.7142857142857143)`;return e.jsx("svg",{width:i,height:u,viewBox:"0 0 7 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 0H4V1H5V2H4H3H2H1V3H2H3H4H5V4H4V5H5V4H6V3H7V2H6V1H5V0ZM6 2H5V3H6V2Z",fill:r})})},lt=({color:r="black",size:l=21})=>{const g=.7142857142857143,i=l,u=typeof l=="number"?l*g:`calc(${l} * 0.7142857142857143)`;return e.jsx("svg",{width:i,height:u,viewBox:"0 0 7 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 0H6V1H5V0ZM6 1H7V2H6V1ZM0 1H1V2H0V1ZM1 1V0H2V1H1ZM6 3H7V4H6V3ZM6 4V5H5V4H6ZM1 4H2V5H1V4ZM1 4H0V3H1V4ZM2 2H5V3H2V2Z",fill:r})})},De=({color:r="black",size:l=21})=>{const g=.7142857142857143,i=l,u=typeof l=="number"?l*g:`calc(${l} * 0.7142857142857143)`;return e.jsx("svg",{width:i,height:u,viewBox:"0 0 7 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 0H2V1H1V0ZM3 2H2V1H3V2ZM4 2H3V3H2V4H1V5H2V4H3V3H4V4H5V5H6V4H5V3H4V2ZM5 1V2H4V1H5ZM5 1V0H6V1H5Z",fill:r})})},ct=({fields:r,resultsPerPage:l,children:g})=>{const{state:{results:i,resultsSuppressed:u,searchSettings:v,truncationIndex:_},isFetchingInitial:x}=ge(),s=l??30,[w,q]=o.useState(s);o.useEffect(()=>{q(s)},[i]);const M=i&&i.length>w,L=()=>{q(y=>y+s)};return x||u||i===null?e.jsx("div",{className:be.placeholder,children:e.jsx(lt,{size:350,color:"var(--lv5)"})}):i.length===0?e.jsx("div",{className:be.invalid,children:e.jsx("p",{children:"No results found."})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:be.container,children:(i??[]).slice(0,w).map((y,K)=>{const z=y.document,b=y.score;let R;try{R=typeof z=="string"?JSON.parse(z):z}catch{return e.jsx("div",{className:be.invalid,children:e.jsx("p",{children:"Invalid JSON"})},K)}let p;if(r&&r.length>0){p={};for(const n of r)n in R&&(p[n]=R[n])}else p={...R};for(const n in p){const F=p[n];if(typeof F=="string"&&F.startsWith("[")&&F.endsWith("]")){const D=F.replace(/^\[|\]$/g,"").split(",").map(m=>m.trim().replace(/^'|'$/g,"")).filter(m=>m.length>0);p[n]=D}}return e.jsxs("div",{className:be.row,children:[e.jsx("div",{className:be.indexNumber,children:K}),g(p),v.showScore&&e.jsx("div",{className:be.scoreNumber,children:b})]},K)})}),M&&e.jsx("div",{style:{textAlign:"center",marginTop:"20px"},children:e.jsxs(f.Button,{variant:"secondary",size:"micro",onClick:L,children:["Load more ",_]})})]})},je={list:"_list_mwzqq_2",count:"_count_mwzqq_7",grid:"_grid_mwzqq_16"},ut=({field:r,label:l,preserveBlankFacetState:g=!1,preserveBlankFacetStateOrder:i=!1,sortFacetsBy:u="histogram",limit:v=10,collapsible:_=!0,startCollapsed:x=!1,displayType:s="checkbox",layout:w="list",showActivePanel:q=!1,showCount:M=!0,showNull:L=!1,displayIfEmptyQuery:y=!0,displayCondition:K=z=>!0})=>{const{state:{facets:z,filterableFields:b,facetableFields:R,filters:p,query:n},toggleFilter:F,isFetchingInitial:A,allowEmptySearch:D}=ge(),m=o.useRef(null),[J,ue]=o.useState(!1);if(!D&&!n||A||!z||!K({query:n??"",filters:p,facets:z})||!y&&!n&&Object.keys(p).length<1)return null;if(!(b!=null&&b.includes(r))||!(R!=null&&R.includes(r))){const h=[];return b!=null&&b.includes(r)||h.push("filterable"),R!=null&&R.includes(r)||h.push("facetable"),e.jsx(f.FilterPanelBase,{collapsible:!1,children:e.jsxs("div",{style:{color:"red",fontSize:"12px"},children:['Cannot render filter for "',r,'": missing ',h.join(" and "),"."]})})}const G=z==null?void 0:z[r];if(!G||!Array.isArray(G))return null;const de=(p==null?void 0:p[r])??[];g&&!m.current&&G.length>0&&(m.current=G.reduce((h,k)=>(h[k.key]=k.value,h),{}));const O=new Map;g&&m.current?(Object.keys(m.current).forEach(h=>{O.set(h,0)}),G.forEach(h=>{O.set(h.key,h.value)})):G.forEach(h=>{O.set(h.key,h.value)});const pe=s==="toggle"&&O.size===2&&O.has("true")&&(O.has("false")||O.has("null"));if(O.has("null")){const h=O.get("null")??0,k=O.get("false")??0;O.set("false",(k??0)+h),O.delete("null")}if(s==="toggle"&&!pe)return e.jsx(f.FilterPanelBase,{collapsible:!1,children:e.jsx("div",{className:je.count,children:e.jsx(f.ToggleSwitch,{label:l,checked:!1,onChange:()=>{},disabled:!0})})});if(pe){const h=O.get("true"),k=typeof h=="number"?h:null,t=de.includes("true"),a=k===0,S=M&&(k??0)>0?`${k}`:"";return e.jsx(f.FilterPanelBase,{collapsible:!1,children:e.jsxs("div",{className:je.count,children:[e.jsx(f.ToggleSwitch,{label:l,checked:t,onChange:()=>F(r,"true"),disabled:a})," ",S]})})}let I=Array.from(O.entries());if(L||(I=I.filter(([h])=>h!=="null")),I.length===0&&!g)return null;if(!i)if(u==="alphabetical"){const h=I.filter(([,t])=>typeof t=="number"&&t>0).sort(([t],[a])=>t.localeCompare(a)),k=I.filter(([,t])=>t===0||t===null).sort(([t],[a])=>t.localeCompare(a));I=[...h,...k]}else if(u==="numeric"){const h=(a,S)=>{const E=Number(a),ae=Number(S),ve=!isNaN(E),V=!isNaN(ae);return ve&&V?E-ae:a.localeCompare(S)},k=I.filter(([,a])=>typeof a=="number"&&a>0).sort(([a],[S])=>h(a,S)),t=I.filter(([,a])=>a===0||a===null).sort(([a],[S])=>h(a,S));I=[...k,...t]}else{const h=I.filter(([,t])=>typeof t=="number"&&t>0),k=I.filter(([,t])=>t===0||t===null);I=[...h,...k]}const C=typeof v=="number"&&I.length>v,U=C&&!J?I.slice(0,v):I,me=(h,k)=>{const t=de.includes(h),a=k===0,S=M&&(k??0)>0?` (${k})`:"",E=M&&(k??0)>0?k:"";switch(s){case"button":return w==="list"?e.jsxs("div",{className:je.count,children:[e.jsx(f.Button,{variant:t?"primary":"secondary",onClick:()=>F(r,h),disabled:a,size:"micro",children:h}),e.jsx("span",{children:E})]}):e.jsx(f.Button,{variant:t?"primary":"secondary",onClick:()=>F(r,h),disabled:a,size:"micro",children:`${h}${S}`});case"toggle":return e.jsx(f.ToggleSwitch,{label:h,checked:t,onChange:()=>F(r,h),disabled:a});case"checkbox":default:return w==="list"?e.jsxs("div",{className:je.count,children:[e.jsx(f.Checkbox,{label:h,score:"",checked:t,onChange:()=>F(r,h),disabled:a}),e.jsx("span",{children:E})]}):e.jsx(f.Checkbox,{label:h,score:S,checked:t,onChange:()=>F(r,h),disabled:a})}},he=_?x:!1;return e.jsx(f.FilterPanelBase,{title:l,collapsible:_,collapsed:he,children:e.jsxs("ul",{className:w==="grid"?je.grid:je.list,style:{listStyle:"none",padding:0,margin:0},children:[U.map(([h,k])=>e.jsx("li",{children:me(h,k)},h)),C&&e.jsx("li",{className:je.toggleItem,children:e.jsx(f.Button,{variant:"ghost",size:"micro",onClick:()=>ue(h=>!h),children:J?"Show less":`Show ${I.length-(v??0)} more`})})]})})},ze={disabledMessage:"_disabledMessage_o89gh_1"},dt=({field:r,label:l,expectedMin:g=0,expectedMax:i=1e3,displayType:u="input",collapsible:v=!0,startCollapsed:_=!1})=>{const{state:{rangeFilters:x,rangeBounds:s,facetStats:w,query:q,facetDebounceDelayMillis:M},setRangeFilter:L,resetSingleFilter:y,allowEmptySearch:K,isFetchingInitial:z}=ge(),b=(s==null?void 0:s[r])!==void 0,R=(s==null?void 0:s[r])??{min:g,max:i},p=R.min,n=R.max,F=(w==null?void 0:w[r])??R,A=F.min,D=F.max,m=b&&p===n,J=m?g:p,ue=m?i:n,G=x==null?void 0:x[r],de=G?G.min:p,O=G?G.max:n,pe=G!==void 0,I=A!==p||D!==n,[C,U]=o.useState([de,O]),[me,he]=o.useState(!1),[h,k]=o.useState(!1),{finalMin:t,finalMax:a,isValidMin:S,isValidMax:E}=o.useMemo(()=>{const[H,$]=C,Q=Math.max(p,Math.min(n,H)),we=Math.max(p,Math.min(n,$)),Fe=Math.min(Q,we),ke=Math.max(Q,we),He=Fe>=p&&Fe<ke,Ve=ke<=n&&ke>Fe;return{finalMin:Fe,finalMax:ke,isValidMin:He,isValidMax:Ve}},[C,p,n]);o.useEffect(()=>{if(m)return;if(C[0]===p&&C[1]===n){he(!1),k(!1);return}const $=M??500,Q=setTimeout(()=>{he(!S),k(!E)},300),we=setTimeout(()=>{S&&E&&(t===p&&a===n?y(r):L(r,t,a))},$);return()=>{clearTimeout(Q),clearTimeout(we)}},[t,a,S,E,p,n,r,y,L,M,m]),o.useEffect(()=>{U([de,O]),he(!1),k(!1)},[de,O,r]);const ae=o.useCallback(H=>{if(m)return;const $=Math.max(p,Math.min(D,H[0])),Q=Math.max(A,Math.min(n,H[1]));U([$,Q])},[m,p,n,A,D]),ve=o.useCallback(H=>{if(m)return;const $=Math.max(p,Math.min(D,H[0])),Q=Math.max(A,Math.min(n,H[1]));$===p&&Q===n?(U([p,n]),y(r)):U([$,Q])},[m,p,n,A,D,r,y]),V=o.useCallback(H=>{if(m)return;const $=Number(H.target.value);if(!isNaN($)){const Q=Math.max(p,Math.min(D,$));U([Q,C[1]])}},[m,C,p,D]),re=o.useCallback(H=>{if(m)return;const $=Number(H.target.value);if(!isNaN($)){const Q=Math.max(A,Math.min(n,$));U([C[0],Q])}},[m,C,A,n]),xe=o.useCallback(()=>{const H=C[0],$=Math.max(p,Math.min(D,H));$<C[1]?U([$,C[1]]):U([p,C[1]])},[C,p,D]),Ce=o.useCallback(()=>{const H=C[1],$=Math.max(A,Math.min(n,H));$>C[0]?U([C[0],$]):U([C[0],n])},[C,A,n]);return z||!K&&!q?null:u==="slider"?e.jsxs(f.FilterPanelBase,{title:l,collapsed:_,collapsible:v,children:[m&&e.jsxs("div",{className:ze.disabledMessage,children:["No adjustable range (all results have the same value: ",p,")."]}),e.jsx("div",{style:{padding:"10px 10px 20px 10px"},children:e.jsx(f.Slider,{min:J,max:ue,value:m?[J,ue]:[t,a],isRange:!0,onChange:H=>ae(H),onFinalChange:H=>ve(H),disabled:m,activeMin:A,activeMax:D,isFaceted:I,highlightFaceted:pe})}),e.jsxs("div",{style:{display:"flex",flex:"flex-grow",gap:"10px",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(f.InputField,{type:"number",value:m?p:C[0],min:p,max:Math.min(D,C[1]-1),onChange:V,onBlur:xe,disabled:m,isValid:m||!me}),e.jsx(f.InputField,{type:"number",value:m?n:C[1],min:Math.max(A,C[0]+1),max:n,onChange:re,onBlur:Ce,disabled:m,isValid:m||!h})]})]}):e.jsxs(f.FilterPanelBase,{title:l,children:[m&&e.jsxs("div",{className:ze.disabledMessage,children:["No adjustable range (all results have the same value: ",p,")."]}),e.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"flex-start"},children:[e.jsx(f.InputField,{label:"Min:",type:"number",value:m?p:C[0],min:p,max:Math.min(D,C[1]-1),onChange:V,onBlur:xe,disabled:m,isValid:m||!me}),e.jsx(f.InputField,{label:"Max:",type:"number",value:m?n:C[1],min:Math.max(A,C[0]+1),max:n,onChange:re,onBlur:Ce,disabled:m,isValid:m||!h})]})]})},ht={grid:"_grid_nvpmn_2"},ft=o.memo(({field:r,value:l,onReset:g})=>e.jsx("li",{children:e.jsxs(f.Button,{onClick:g,iconRight:e.jsx(De,{}),variant:"primary",size:"micro",children:[r,": ",l]})})),gt=o.memo(({field:r,min:l,max:g,onReset:i})=>e.jsx("li",{children:e.jsxs(f.Button,{onClick:i,iconRight:e.jsx(De,{}),variant:"primary",size:"micro",children:[r,": ",l," – ",g]})}));function pt(){const{state:{filters:r,rangeFilters:l},resetFilters:g,resetSingleFilter:i}=ge(),u=o.useMemo(()=>Object.entries(r).map(([x,s])=>s.map(w=>({field:x,value:w}))).flat(),[r]),v=o.useMemo(()=>Object.entries(l).map(([x,{min:s,max:w}])=>({field:x,min:s,max:w})),[l]);return o.useMemo(()=>Object.keys(r).length>0||Object.keys(l).length>0,[r,l])?e.jsx(f.FilterPanelBase,{collapsible:!1,title:"Active filters",children:e.jsxs("ul",{className:ht.grid,children:[u.map(({field:x,value:s})=>e.jsx(ft,{field:x,value:s,onReset:()=>i(x,s)},`${x}-${s}`)),v.map(({field:x,min:s,max:w})=>e.jsx(gt,{field:x,min:s,max:w,onReset:()=>i(x)},x)),e.jsx("li",{children:e.jsx(f.Button,{onClick:g,size:"micro",variant:"ghost",children:"Reset"})})]})}):null}const mt={radioGroup:"_radioGroup_nwf7i_6"},vt=({displayType:r="dropdown",collapsible:l=!0,startCollapsed:g=!1})=>{const{state:{sortableFields:i,sortBy:u,sortAscending:v},setSort:_}=ge();if(!i||i.length===0)return null;const x=u?`${u}:${v?"asc":"desc"}`:"none",s=[{label:"None",value:"none"},...i.flatMap(M=>[{label:`${M} (asc)`,value:`${M}:asc`},{label:`${M} (desc)`,value:`${M}:desc`}])],w=M=>{if(M==="none"||M==="")_(null,!0);else{const[L,y]=M.split(":");_(L,y==="asc")}},q=l?g:!1;return e.jsx(f.FilterPanelBase,{title:"Sort by",collapsible:l,collapsed:q,children:r==="dropdown"?e.jsx(f.Select,{value:x,onValueChange:w,options:s,placeholder:"Select sort..."}):e.jsx("div",{className:mt.radioGroup,children:s.map(M=>e.jsx(f.RadioButton,{id:`sort-${M.value}`,name:"sort-by",value:M.value,label:M.label,checked:x===M.value,onChange:L=>w(L.target.value)},M.value))})})},xt={list:"_list_1y4fk_1"};function St(){const{state:{searchSettings:r},setSearchSettings:l}=ge(),[g,i]=o.useState(!1),u=(s,w)=>{const q=parseInt(w,10);isNaN(q)||l({[s]:q})},v=(s,w)=>{l({[s]:w})},_=(s,w)=>{const q=parseInt(w,10);isNaN(q)||l({coverageSetup:{...r.coverageSetup,[s]:q}})},x=(s,w)=>{l({coverageSetup:{...r.coverageSetup,[s]:w}})};return e.jsx(f.FilterPanelBase,{collapsed:!0,title:"Settings",children:e.jsxs("ul",{className:xt.list,children:[e.jsx("li",{children:e.jsx(f.InputField,{label:"Max Results",type:"number",value:r.maxNumberOfRecordsToReturn.toString(),onChange:s=>u("maxNumberOfRecordsToReturn",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage Depth",type:"number",value:r.coverageDepth.toString(),onChange:s=>u("coverageDepth",s.target.value)})}),e.jsxs("li",{children:[e.jsx(f.InputField,{label:"Minimum Score",type:"number",value:r.minimumScore.toString(),onChange:s=>{const w=parseFloat(s.target.value);isNaN(w)||l({minimumScore:w})}}),e.jsx("div",{style:{padding:"10px 10px 20px 10px"},children:e.jsx(f.Slider,{min:0,max:255,step:1,value:r.minimumScore,onChange:s=>{l({minimumScore:s})}})})]}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Placeholder text",type:"text",value:r.placeholderText,onChange:s=>{l({placeholderText:s.target.value})}})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Show score",checked:r.showScore,onChange:s=>v("showScore",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Enable Coverage",checked:r.enableCoverage,onChange:s=>v("enableCoverage",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Remove Duplicates",checked:r.removeDuplicates,onChange:s=>v("removeDuplicates",s)})}),e.jsx("li",{children:e.jsx(f.Button,{variant:"ghost",size:"micro",iconRight:g?e.jsx(at,{}):e.jsx(it,{}),onClick:()=>i(s=>!s),children:g?"Hide Coverage Setup":"Show Coverage Setup"})}),g&&e.jsxs(e.Fragment,{children:[e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Whole Query",checked:r.coverageSetup.coverWholeQuery,onChange:s=>x("coverWholeQuery",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Whole Words",checked:r.coverageSetup.coverWholeWords,onChange:s=>x("coverWholeWords",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Fuzzy Words",checked:r.coverageSetup.coverFuzzyWords,onChange:s=>x("coverFuzzyWords",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Joined Words",checked:r.coverageSetup.coverJoinedWords,onChange:s=>x("coverJoinedWords",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Prefix Suffix",checked:r.coverageSetup.coverPrefixSuffix,onChange:s=>x("coverPrefixSuffix",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Truncate list",checked:r.coverageSetup.truncate,onChange:s=>x("truncate",s)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Levenshtein Max Word Size",type:"number",value:r.coverageSetup.levenshteinMaxWordSize.toString(),onChange:s=>_("levenshteinMaxWordSize",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Min Word Size",type:"number",value:r.coverageSetup.minWordSize.toString(),onChange:s=>_("minWordSize",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage Min Word Hits Abs",type:"number",value:r.coverageSetup.coverageMinWordHitsAbs.toString(),onChange:s=>_("coverageMinWordHitsAbs",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage Min Word Hits Relative",type:"number",value:r.coverageSetup.coverageMinWordHitsRelative.toString(),onChange:s=>_("coverageMinWordHitsRelative",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage Q Limit For Error Tolerance",type:"number",value:r.coverageSetup.coverageQLimitForErrorTolerance.toString(),onChange:s=>_("coverageQLimitForErrorTolerance",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage LCS Error Tolerance Relative Q",type:"number",value:r.coverageSetup.coverageLcsErrorToleranceRelativeq.toString(),onChange:s=>_("coverageLcsErrorToleranceRelativeq",s.target.value)})})]})]})})}class bt extends o.Component{constructor(g){super(g);Ke(this,"reset",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(g){return{hasError:!0,error:g}}componentDidCatch(g,i){console.error("[SearchErrorBoundary] Caught error:",g,i)}render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.reset):e.jsxs("div",{style:{padding:"2rem",backgroundColor:"#fee",border:"2px solid #c33",borderRadius:"8px",maxWidth:"600px",margin:"2rem auto"},children:[e.jsx("h2",{style:{color:"#c33",marginTop:0},children:"⚠️ Search Initialization Error"}),e.jsxs("p",{style:{marginBottom:"1rem"},children:[e.jsx("strong",{children:"Error:"})," ",this.state.error.message]}),e.jsxs("div",{style:{backgroundColor:"#fff",padding:"1rem",borderRadius:"4px",marginBottom:"1rem",fontSize:"0.9rem"},children:[e.jsx("strong",{children:"💡 Common fixes:"}),e.jsxs("ul",{style:{marginBottom:0,paddingLeft:"1.5rem"},children:[e.jsx("li",{children:"Check browser console for detailed error messages"}),e.jsx("li",{children:"Verify NEXT_PUBLIC_INDX_URL is correct in .env.local"}),e.jsx("li",{children:"Verify NEXT_PUBLIC_INDX_EMAIL and NEXT_PUBLIC_INDX_PASSWORD are correct"}),e.jsx("li",{children:"Ensure INDX server is running"}),e.jsx("li",{children:"Check dataset name spelling"})]})]}),e.jsx("button",{onClick:this.reset,style:{padding:"0.5rem 1rem",backgroundColor:"#c33",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontWeight:"bold"},children:"Try Again"})]}):this.props.children}}P.ActiveFiltersPanel=pt,P.RangeFilterPanel=dt,P.SearchErrorBoundary=bt,P.SearchInput=ot,P.SearchProvider=st,P.SearchResults=ct,P.SearchSettingsPanel=St,P.SortByPanel=vt,P.ValueFilterPanel=ut,P.useSearch=ge,P.useSearchContext=ge,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
22
+ <%s key={someKey} {...props} />`,E,V,re,V),k[V+E]=!0)}if(V=null,S!==void 0&&(g(S),V=""+S),_(a)&&(g(a.key),V=""+a.key),"key"in a){S={};for(var xe in a)xe!=="key"&&(S[xe]=a[xe])}else S=a;return V&&x(S,typeof t=="function"?t.displayName||t.name||"Unknown":t),w(t,V,S,u(),ae,ve)}function M(t){L(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===ue&&(t._payload.status==="fulfilled"?L(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function L(t){return typeof t=="object"&&t!==null&&t.$$typeof===K}var y=o,K=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),n=Symbol.for("react.consumer"),F=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ue=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),de=Symbol.for("react.client.reference"),O=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe=Object.prototype.hasOwnProperty,I=Array.isArray,C=console.createTask?console.createTask:function(){return null};y={react_stack_bottom_frame:function(t){return t()}};var U,me={},he=y.react_stack_bottom_frame.bind(y,v)(),h=C(i(v)),k={};Me.Fragment=b,Me.jsx=function(t,a,S){var E=1e4>O.recentlyCreatedOwnerStacks++;return q(t,a,S,!1,E?Error("react-stack-top-frame"):he,E?C(i(t)):h)},Me.jsxs=function(t,a,S){var E=1e4>O.recentlyCreatedOwnerStacks++;return q(t,a,S,!0,E?Error("react-stack-top-frame"):he,E?C(i(t)):h)}})()),Me}var We;function rt(){return We||(We=1,process.env.NODE_ENV==="production"?Ae.exports=et():Ae.exports=tt()),Ae.exports}var e=rt();const qe=o.createContext(void 0);function nt(r,l){let g;const i=(...u)=>{clearTimeout(g),g=setTimeout(()=>r(...u),l)};return i.cancel=()=>clearTimeout(g),i}const st=({children:r,email:l,password:g,url:i,dataset:u,allowEmptySearch:v=!1,maxResults:_=10,facetDebounceDelayMillis:x=500,enableFacets:s=!0,coverageDepth:w=500,removeDuplicates:q=!0,enableCoverage:M=!0,initialCoverageSetup:L={},enableDebugLogs:y=!1,preAuthenticatedToken:K})=>{const z=o.useRef(0),b=o.useRef(void 0),R=o.useRef(!1),p=o.useRef(!1),[n,F]=o.useState({query:"",results:null,isLoading:!1,resultsSuppressed:!v,facetDebounceDelayMillis:x,filters:{},rangeFilters:{},facetStats:{},searchSettings:{maxNumberOfRecordsToReturn:_,coverageDepth:w,enableCoverage:M,removeDuplicates:q,minimumScore:0,showScore:!0,placeholderText:"Type to search",coverageSetup:{levenshteinMaxWordSize:20,minWordSize:2,coverageMinWordHitsAbs:1,coverageMinWordHitsRelative:0,coverageQLimitForErrorTolerance:5,coverageLcsErrorToleranceRelativeq:.2,coverWholeQuery:!0,coverWholeWords:!0,coverFuzzyWords:!0,coverJoinedWords:!0,coverPrefixSuffix:!0,truncate:!0,...L}}});o.useEffect(()=>{y&&console.log("SearchContext mounted on client")},[y]),o.useEffect(()=>{F(c=>({...c,facetDebounceDelayMillis:x}))},[x]);const[A,D]=o.useState(null),[m]=o.useState(s),J=o.useCallback((c,d={})=>{if(!A)throw new Error("No authentication token available");return fetch(c,{...d,headers:{...d.headers,Authorization:`Bearer ${A}`},credentials:"include"})},[A]),[ue,G]=o.useState([]),[de,O]=o.useState([]),[pe,I]=o.useState([]),[C,U]=o.useState(!0),[me,he]=o.useState({}),[h,k]=o.useState({}),[t,a]=o.useState({}),[S,E]=o.useState(""),[ae,ve]=o.useState(""),[V,re]=o.useState({}),xe=o.useRef(null),Ce=o.useCallback(c=>{F(d=>({...d,query:c,filters:{},rangeFilters:{}}))},[]),H=o.useCallback(c=>{F(d=>({...d,facetDebounceDelayMillis:c}))},[]),$=o.useCallback(c=>{F(d=>({...d,searchSettings:{...d.searchSettings,...c,coverageSetup:{...d.searchSettings.coverageSetup,...c.coverageSetup||{}}}}))},[]),Q=o.useCallback((c,d)=>{F(j=>{const N={...j.filters},B=N[c]||[],Y=B.includes(d)?B.filter(X=>X!==d):[...B,d];return Y.length?N[c]=Y:delete N[c],{...j,filters:N}})},[]),we=o.useCallback((c,d,j)=>{F(N=>({...N,rangeFilters:{...N.rangeFilters,[c]:{min:d,max:j}}}))},[]),Fe=o.useCallback(()=>{F(c=>({...c,filters:{},rangeFilters:{}}))},[]),ke=o.useCallback((c,d)=>{F(j=>{const N={...j.filters},B={...j.rangeFilters};if(d!==void 0){const X=(N[c]||[]).filter(le=>le!==d);X.length>0?N[c]=X:delete N[c]}else delete B[c];return{...j,filters:N,rangeFilters:B}})},[]),He=o.useCallback((c,d)=>{F(j=>({...j,sortBy:c||void 0,sortAscending:c?d:void 0}))},[]),Ve=o.useCallback(async(c,d,j)=>{if(c.length===0)return null;if(c.length===1)return c[0];let N=c[0];for(let B=1;B<c.length;B++){const Y=await J(`${d}/api/CombineFilters/${j}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({A:N,B:c[B],useAndOperation:!0})});if(!Y.ok){const X=await Y.json();throw console.error("CombineFilters failed:",X),new Error("CombineFilters failed")}N=await Y.json()}return N},[J]),Le=n.searchSettings.maxNumberOfRecordsToReturn,Ue=n.searchSettings.enableCoverage,Ge=n.searchSettings.removeDuplicates,Xe=n.searchSettings.coverageDepth,Je=n.searchSettings.minimumScore,Pe=n.sortBy,Oe=n.sortAscending,Qe=o.useMemo(()=>n.searchSettings.coverageSetup,[n.searchSettings.coverageSetup.levenshteinMaxWordSize,n.searchSettings.coverageSetup.minWordSize,n.searchSettings.coverageSetup.coverageMinWordHitsAbs,n.searchSettings.coverageSetup.coverageMinWordHitsRelative,n.searchSettings.coverageSetup.coverageQLimitForErrorTolerance,n.searchSettings.coverageSetup.coverageLcsErrorToleranceRelativeq,n.searchSettings.coverageSetup.coverWholeQuery,n.searchSettings.coverageSetup.coverWholeWords,n.searchSettings.coverageSetup.coverFuzzyWords,n.searchSettings.coverageSetup.coverJoinedWords,n.searchSettings.coverageSetup.coverPrefixSuffix,n.searchSettings.coverageSetup.truncate]),Ye=o.useCallback(async({enableFacets:c})=>{if(!A)return;const d=++z.current;F(j=>({...j,isLoading:!0}));try{const j=Object.entries(n.filters??{}),B=(await Promise.all(j.map(async([W,Z])=>Promise.all(Z.map(ee=>J(`${i}/api/CreateValueFilter/${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({FieldName:W,Value:ee})}).then(fe=>fe.json())))))).flat(),Y=Object.entries(n.rangeFilters??{}),X=await Promise.all(Y.map(([W,{min:Z,max:ee}])=>J(`${i}/api/CreateRangeFilter/${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({FieldName:W,LowerLimit:Z,UpperLimit:ee})}).then(fe=>fe.json()))),le=[...B,...X].filter(W=>W&&typeof W.hashString=="string"),ne=await Ve(le,i,u),Ne=v||n.query.trim()!=="",Re={text:n.query,maxNumberOfRecordsToReturn:Ne?Le:0,enableFacets:c,...ne?{filter:ne}:{},...Pe?{sortBy:Pe}:{},...Oe!==void 0?{sortAscending:Oe}:{},enableCoverage:Ue,removeDuplicates:Ge,coverageDepth:Xe,coverageSetup:Qe};y&&console.log("[performSearch] request body:",JSON.stringify(Re,null,2));const se=await(await J(`${i}/api/Search/${u}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Re)})).json(),ye=se.truncationIndex??-1,Ee=se.records||[],T=Ee.map(W=>W.documentKey),ce=Ee.map(W=>W.score);let oe=[];Ne&&T.length>0&&(oe=(await(await J(`${i}/api/GetJson/${u}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})).json()).map((ee,fe)=>({document:ee,documentKey:T[fe],score:ce[fe]})));let Se={};if(c&&se.facets){for(const[W,Z]of Object.entries(se.facets))if(Array.isArray(Z)&&Z.length>0){const ee=Z.map(fe=>Number(fe.key)).filter(fe=>!isNaN(fe));ee.length>0&&(Se[W]={min:Math.min(...ee),max:Math.max(...ee)})}}const jt=n.query!==S,yt=n.query!==ae;let Ie=n.facetStats??{};if(jt?(Ie={...me,...Se},a(Ie),E(n.query)):Ie={...t,...Se},yt&&c){const W={...V};for(const[Z,ee]of Object.entries(Se))W[Z]=ee;re(W),ve(n.query)}let _e=se.facets;if(c&&(!_e||Object.keys(_e).length===0)){_e={};for(const[W,Z]of Object.entries(h))_e[W]=Z.map(ee=>({key:ee,value:null}))}if(d!==z.current)return;const Ct=oe.filter(W=>{const Z=n.query.trim();return Z===""||Z.length===1?!0:W.score>=Je});F(W=>({...W,results:Ct,resultsSuppressed:!Ne,...c?{facets:_e,facetStats:Ie}:{},isLoading:!1,truncationIndex:ye}))}catch(j){if(console.error("[Search] ❌ Search failed:",j),j instanceof TypeError&&j.message.includes("fetch")?(console.error("[Search] ❌ Network error - cannot reach INDX server"),console.error("[Search] 💡 Check if server is running at:",i)):j instanceof Error&&(j.message.includes("401")?(console.error("[Search] ❌ Authentication failed"),console.error("[Search] 💡 Your token may have expired. Get a fresh token with:"),console.error('[Search] 💡 curl -X POST "'+i+`/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`)):j.message.includes("404")?(console.error("[Search] ❌ Dataset not found"),console.error('[Search] 💡 Check that dataset "'+u+'" exists')):console.error("[Search] 💡 Error:",j.message)),d!==z.current)return;F(N=>({...N,results:null,isLoading:!1,resultsSuppressed:!1,error:j instanceof Error?j.message:"Search failed"}))}},[n.query,n.filters,n.rangeFilters,Pe,Oe,Le,Ue,Ge,Xe,Qe,Je,J,Ve,i,u,v,A]);o.useEffect(()=>{b.current=Ye},[Ye]),o.useCallback(()=>{var c;y&&console.log("Search fired"),(c=b.current)==null||c.call(b,{enableFacets:!1})},[]);const ie=o.useRef(null);return o.useEffect(()=>{var c;return(c=ie.current)==null||c.cancel(),ie.current=nt(()=>{var d;y&&console.log("Debounced searchWithFacets fired"),(d=b.current)==null||d.call(b,{enableFacets:!0})},n.facetDebounceDelayMillis??500),()=>{var d;(d=ie.current)==null||d.cancel()}},[n.facetDebounceDelayMillis]),o.useCallback(()=>{var c;(c=ie.current)==null||c.call(ie)},[]),o.useEffect(()=>{var c;!C&&A&&!R.current&&(v&&((c=b.current)==null||c.call(b,{enableFacets:m})),R.current=!0)},[C,A,v,m]),o.useEffect(()=>{var N,B,Y,X,le;if(!A||!R.current)return;const c=n.query.trim(),d=c===""&&v;if(c===""&&!v){n.resultsSuppressed||F(ne=>({...ne,resultsSuppressed:!0}));return}return d?((N=ie.current)==null||N.cancel(),(B=b.current)==null||B.call(b,{enableFacets:m})):m?(y&&console.log("Search fired"),(Y=b.current)==null||Y.call(b,{enableFacets:!1}),(X=ie.current)==null||X.call(ie)):(le=b.current)==null||le.call(b,{enableFacets:!1}),()=>{var ne;(ne=ie.current)==null||ne.cancel()}},[n.query,v,m]),o.useEffect(()=>{var j;if(!R.current||!A)return;if(!p.current){p.current=!0,y&&console.log("[Filter effect] First run, skipping");return}if(n.query!==S){y&&console.log("[Filter effect] Skipping because query changed");return}const c=n.query.trim();m&&!(!v&&c==="")&&(y&&console.log("[Filter effect] Firing search"),(j=b.current)==null||j.call(b,{enableFacets:!0}))},[n.filters,n.rangeFilters]),o.useEffect(()=>{var j;if(!R.current||!A)return;const c=n.query.trim();m&&!(!v&&c==="")&&((j=b.current)==null||j.call(b,{enableFacets:!0}))},[Pe,Oe]),o.useEffect(()=>{(async()=>{try{let d;if(K)y&&console.log("[Auth] ✅ Using pre-authenticated token"),d=K,D(K);else{if(!l||!g)throw console.error("[Auth] ❌ Missing credentials"),l||(console.error("[Auth] ❌ Missing email"),console.error('[Auth] 💡 Pass email="your@email.com" to SearchProvider')),g||(console.error("[Auth] ❌ Missing password"),console.error('[Auth] 💡 Pass password="yourpassword" to SearchProvider')),new Error("Email and password are required. Check console for instructions.");if(!i)throw console.error("[Auth] ❌ Missing INDX server URL"),console.error("[Auth] 💡 Add NEXT_PUBLIC_INDX_URL to your .env.local file"),new Error("INDX server URL is required. Check console for instructions.");if(!u)throw console.error("[Auth] ❌ Missing dataset name"),console.error('[Auth] 💡 Pass dataset="your-dataset-name" to SearchProvider'),new Error("Dataset name is required. Check console for instructions.");y&&console.log("[Auth] 🔐 Logging in to get session token...");const T=await fetch(`${i}/api/Login`,{method:"POST",headers:{"Content-Type":"application/json",accept:"*/*"},credentials:"include",body:JSON.stringify({userEmail:l,userPassWord:g})});if(!T.ok)throw console.error("[Auth] ❌ Login failed:",T.status,await T.text()),new Error("Login failed. Check your email and password.");if(d=(await T.json()).token,!d)throw console.error("[Auth] ❌ No token received from login response"),new Error("No token received from login.");y&&console.log("[Auth] ✅ Login successful, bearer token received (length:",d.length,")"),y&&console.log("[Auth] 🔓 Opening dataset session...");const oe=await fetch(`${i}/api/CreateOrOpen/${u}/400`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`},credentials:"include",body:'""'});if(!oe.ok)throw console.error("[Auth] ❌ CreateOrOpen failed:",oe.status,await oe.text()),new Error("Failed to open dataset session.");D(d),y&&console.log("[Auth] ✅ Dataset session established")}const j=T=>fetch(T,{method:"GET",headers:{accept:"text/plain",Authorization:`Bearer ${d}`},credentials:"include"});y&&console.log("[Auth] 🔍 Checking dataset status...");const N=await j(`${i}/api/GetStatus/${u}`);if(!N.ok){if(N.status===401)throw console.error("[Auth] ❌ Authentication failed (401 Unauthorized)"),console.error("[Auth] 💡 Your token may be expired or invalid"),console.error('[Auth] 💡 Get a fresh token with: curl -X POST "'+i+`/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`),new Error("Authentication failed (401). Token may be expired. Check console for instructions.");if(N.status===404)throw console.error('[Auth] ❌ Dataset "'+u+'" not found (404)'),console.error('[Auth] 💡 Available datasets can be checked with: curl -X GET "'+i+'/api/GetUserDataSets" -H "Authorization: Bearer YOUR_TOKEN"'),console.error("[Auth] 💡 Make sure you spelled the dataset name correctly"),new Error('Dataset "'+u+'" not found. Check console for instructions.');{const T=await N.text();throw console.error("[Auth] ❌ Failed to get dataset status:",N.status,T),console.error("[Auth] 💡 Check if your INDX server is running at:",i),new Error("Failed to connect to INDX server. Check console for details.")}}const B=await N.json();y&&console.log("[Auth] 📊 Dataset status:",B),B.state&&B.state!=="Ready"&&(console.warn("[Auth] ⚠️ Dataset is not ready yet. Current state:",B.state),console.warn("[Auth] 💡 Wait for indexing to complete before searching"));const Y=B.documentCount??B.numberOfRecords??0;Y===0?(console.warn('[Auth] ⚠️ Dataset "'+u+'" is empty (0 records)'),console.warn("[Auth] 💡 Add documents to your dataset before searching"),console.warn("[Auth] 💡 Search will work but return no results")):y&&console.log("[Auth] ✅ Dataset has",Y,"records");const[X,le,ne]=await Promise.all([j(`${i}/api/GetFilterableFields/${u}`),j(`${i}/api/GetFacetableFields/${u}`),j(`${i}/api/GetSortableFields/${u}`)]);if(!X.ok)throw console.error("[Auth] ❌ GetFilterableFields failed:",X.status,await X.text()),new Error("Failed to get filterable fields. Check console for details.");if(!le.ok)throw console.error("[Auth] ❌ GetFacetableFields failed:",le.status,await le.text()),new Error("Failed to get facetable fields. Check console for details.");if(!ne.ok)throw console.error("[Auth] ❌ GetSortableFields failed:",ne.status,await ne.text()),new Error("Failed to get sortable fields. Check console for details.");const Ne=await X.json().catch(T=>(console.error("Failed to parse GetFilterableFields response:",T),[])),Re=await le.json().catch(T=>(console.error("Failed to parse GetFacetableFields response:",T),[])),Ze=await ne.json().catch(T=>(console.error("Failed to parse GetSortableFields response:",T),[]));G(Ne||[]),O(Re||[]),I(Ze||[]);let se={facets:{}};try{const T=await fetch(`${i}/api/Search/${u}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`},credentials:"include",body:JSON.stringify({text:"",maxNumberOfRecordsToReturn:0,enableFacets:!0})});T.ok?se=await T.json().catch(ce=>(console.warn("Failed to parse blank search response:",ce),{facets:{}})):(console.warn("Blank search failed:",T.status,T.statusText),console.warn("Continuing without initial facet data - facets will be populated after first search"))}catch(T){console.warn("Blank search error:",T),console.warn("Continuing without initial facet data - facets will be populated after first search")}const ye={};if(se.facets){for(const[T,ce]of Object.entries(se.facets))if(Array.isArray(ce)&&ce.length>0){const oe=ce.map(Se=>Number(Se.key)).filter(Se=>!isNaN(Se));oe.length>0&&(ye[T]={min:Math.min(...oe),max:Math.max(...oe)})}}const Ee={};if(se.facets)for(const[T,ce]of Object.entries(se.facets))Array.isArray(ce)&&(Ee[T]=ce.map(oe=>oe.key));xe.current={facets:se.facets,facetStats:ye,facetKeys:Ee},he(ye),k(Ee),re(ye),F(T=>({...T,facetStats:ye})),y&&console.log("[Auth] ✅ Initialization complete")}catch(d){throw console.error("[Auth] ❌ Initialization failed:",d),(d instanceof Error||typeof d=="object"&&d!==null&&"message"in d)&&console.error("[Auth] 💡 Error:",d.message),d instanceof TypeError&&d.message.includes("fetch")&&(console.error("[Auth] ❌ Network error - cannot connect to INDX server"),console.error("[Auth] 💡 Check if the server is running at:",i),console.error("[Auth] 💡 Check your NEXT_PUBLIC_INDX_URL in .env.local"),console.error("[Auth] 💡 For local development, it should be: http://localhost:38171")),d}finally{U(!1)}})()},[l,g,i,u]),e.jsx(qe.Provider,{value:{state:{...n,filterableFields:ue,facetableFields:de,sortableFields:pe,rangeBounds:V},isFetchingInitial:C,allowEmptySearch:v,setQuery:Ce,toggleFilter:Q,setRangeFilter:we,resetFilters:Fe,resetSingleFilter:ke,setSort:He,setDebounceDelay:H,setSearchSettings:$},children:e.jsx("div",{className:"indx-search-provider",children:r})})},ge=()=>{const r=o.useContext(qe);if(!r)throw new Error("useSearchContext must be used within a SearchProvider");return r},ot=({className:r="",autoFocus:l=!1,inputSize:g="default",showClear:i=!0,showFocus:u=!1,...v})=>{const{state:{query:_,filters:x,rangeFilters:s,searchSettings:w},setQuery:q}=ge();Object.keys(x).length>0||Object.keys(s).length>0;const M=_.length>0;return e.jsx(f.SearchField,{type:"text",value:_,onChange:L=>q(L.target.value),placeholder:w.placeholderText,autoFocus:l,className:r,showSearchIcon:!0,inputSize:g,showFocusBorder:u,...v,children:i&&M&&e.jsx(f.Button,{variant:"ghost",size:"micro",onClick:()=>q(""),"aria-label":"Clear search",children:"Clear"})})},be={placeholder:"_placeholder_bcpqa_1",invalid:"_invalid_bcpqa_10",row:"_row_bcpqa_14",indexNumber:"_indexNumber_bcpqa_42",scoreNumber:"_scoreNumber_bcpqa_49"},at=({color:r="black",size:l=21})=>{const g=.7142857142857143,i=l,u=typeof l=="number"?l*g:`calc(${l} * 0.7142857142857143)`;return e.jsx("svg",{width:i,height:u,viewBox:"0 0 7 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 0H3V1V2V3H2V2H1V3H2V4H3V5H4V4H5V3H6V2H5V3H4V2V1V0ZM4 3V4H3V3H4Z",fill:r})})},it=({color:r="black",size:l=21})=>{const g=.7142857142857143,i=l,u=typeof l=="number"?l*g:`calc(${l} * 0.7142857142857143)`;return e.jsx("svg",{width:i,height:u,viewBox:"0 0 7 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 0H4V1H5V2H4H3H2H1V3H2H3H4H5V4H4V5H5V4H6V3H7V2H6V1H5V0ZM6 2H5V3H6V2Z",fill:r})})},lt=({color:r="black",size:l=21})=>{const g=.7142857142857143,i=l,u=typeof l=="number"?l*g:`calc(${l} * 0.7142857142857143)`;return e.jsx("svg",{width:i,height:u,viewBox:"0 0 7 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 0H6V1H5V0ZM6 1H7V2H6V1ZM0 1H1V2H0V1ZM1 1V0H2V1H1ZM6 3H7V4H6V3ZM6 4V5H5V4H6ZM1 4H2V5H1V4ZM1 4H0V3H1V4ZM2 2H5V3H2V2Z",fill:r})})},De=({color:r="black",size:l=21})=>{const g=.7142857142857143,i=l,u=typeof l=="number"?l*g:`calc(${l} * 0.7142857142857143)`;return e.jsx("svg",{width:i,height:u,viewBox:"0 0 7 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 0H2V1H1V0ZM3 2H2V1H3V2ZM4 2H3V3H2V4H1V5H2V4H3V3H4V4H5V5H6V4H5V3H4V2ZM5 1V2H4V1H5ZM5 1V0H6V1H5Z",fill:r})})},ct=({fields:r,resultsPerPage:l,children:g})=>{const{state:{results:i,resultsSuppressed:u,searchSettings:v,truncationIndex:_},isFetchingInitial:x}=ge(),s=l??30,[w,q]=o.useState(s);o.useEffect(()=>{q(s)},[i]);const M=i&&i.length>w,L=()=>{q(y=>y+s)};return x||u||i===null?e.jsx("div",{className:be.placeholder,children:e.jsx(lt,{size:350,color:"var(--lv5)"})}):i.length===0?e.jsx("div",{className:be.invalid,children:e.jsx("p",{children:"No results found."})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:be.container,children:(i??[]).slice(0,w).map((y,K)=>{const z=y.document,b=y.score;let R;try{R=typeof z=="string"?JSON.parse(z):z}catch{return e.jsx("div",{className:be.invalid,children:e.jsx("p",{children:"Invalid JSON"})},K)}let p;if(r&&r.length>0){p={};for(const n of r)n in R&&(p[n]=R[n])}else p={...R};for(const n in p){const F=p[n];if(typeof F=="string"&&F.startsWith("[")&&F.endsWith("]")){const D=F.replace(/^\[|\]$/g,"").split(",").map(m=>m.trim().replace(/^'|'$/g,"")).filter(m=>m.length>0);p[n]=D}}return e.jsxs("div",{className:be.row,children:[e.jsx("div",{className:be.indexNumber,children:K}),g(p),v.showScore&&e.jsx("div",{className:be.scoreNumber,children:b})]},K)})}),M&&e.jsx("div",{style:{textAlign:"center",marginTop:"20px"},children:e.jsxs(f.Button,{variant:"secondary",size:"micro",onClick:L,children:["Load more ",_]})})]})},je={list:"_list_mwzqq_2",count:"_count_mwzqq_7",grid:"_grid_mwzqq_16"},ut=({field:r,label:l,preserveBlankFacetState:g=!1,preserveBlankFacetStateOrder:i=!1,sortFacetsBy:u="histogram",limit:v=10,collapsible:_=!0,startCollapsed:x=!1,displayType:s="checkbox",layout:w="list",showActivePanel:q=!1,showCount:M=!0,showNull:L=!1,displayIfEmptyQuery:y=!0,displayCondition:K=z=>!0})=>{const{state:{facets:z,filterableFields:b,facetableFields:R,filters:p,query:n},toggleFilter:F,isFetchingInitial:A,allowEmptySearch:D}=ge(),m=o.useRef(null),[J,ue]=o.useState(!1);if(!D&&!n||A||!z||!K({query:n??"",filters:p,facets:z})||!y&&!n&&Object.keys(p).length<1)return null;if(!(b!=null&&b.includes(r))||!(R!=null&&R.includes(r))){const h=[];return b!=null&&b.includes(r)||h.push("filterable"),R!=null&&R.includes(r)||h.push("facetable"),e.jsx(f.FilterPanelBase,{collapsible:!1,children:e.jsxs("div",{style:{color:"red",fontSize:"12px"},children:['Cannot render filter for "',r,'": missing ',h.join(" and "),"."]})})}const G=z==null?void 0:z[r];if(!G||!Array.isArray(G))return null;const de=(p==null?void 0:p[r])??[];g&&!m.current&&G.length>0&&(m.current=G.reduce((h,k)=>(h[k.key]=k.value,h),{}));const O=new Map;g&&m.current?(Object.keys(m.current).forEach(h=>{O.set(h,0)}),G.forEach(h=>{O.set(h.key,h.value)})):G.forEach(h=>{O.set(h.key,h.value)});const pe=s==="toggle"&&O.size===2&&O.has("true")&&(O.has("false")||O.has("null"));if(O.has("null")){const h=O.get("null")??0,k=O.get("false")??0;O.set("false",(k??0)+h),O.delete("null")}if(s==="toggle"&&!pe)return e.jsx(f.FilterPanelBase,{collapsible:!1,children:e.jsx("div",{className:je.count,children:e.jsx(f.ToggleSwitch,{label:l,checked:!1,onChange:()=>{},disabled:!0})})});if(pe){const h=O.get("true"),k=typeof h=="number"?h:null,t=de.includes("true"),a=k===0,S=M&&(k??0)>0?`${k}`:"";return e.jsx(f.FilterPanelBase,{collapsible:!1,children:e.jsxs("div",{className:je.count,children:[e.jsx(f.ToggleSwitch,{label:l,checked:t,onChange:()=>F(r,"true"),disabled:a})," ",S]})})}let I=Array.from(O.entries());if(L||(I=I.filter(([h])=>h!=="null")),I.length===0&&!g)return null;if(!i)if(u==="alphabetical"){const h=I.filter(([,t])=>typeof t=="number"&&t>0).sort(([t],[a])=>t.localeCompare(a)),k=I.filter(([,t])=>t===0||t===null).sort(([t],[a])=>t.localeCompare(a));I=[...h,...k]}else if(u==="numeric"){const h=(a,S)=>{const E=Number(a),ae=Number(S),ve=!isNaN(E),V=!isNaN(ae);return ve&&V?E-ae:a.localeCompare(S)},k=I.filter(([,a])=>typeof a=="number"&&a>0).sort(([a],[S])=>h(a,S)),t=I.filter(([,a])=>a===0||a===null).sort(([a],[S])=>h(a,S));I=[...k,...t]}else{const h=I.filter(([,t])=>typeof t=="number"&&t>0),k=I.filter(([,t])=>t===0||t===null);I=[...h,...k]}const C=typeof v=="number"&&I.length>v,U=C&&!J?I.slice(0,v):I,me=(h,k)=>{const t=de.includes(h),a=k===0,S=M&&(k??0)>0?` (${k})`:"",E=M&&(k??0)>0?k:"";switch(s){case"button":return w==="list"?e.jsxs("div",{className:je.count,children:[e.jsx(f.Button,{variant:t?"primary":"secondary",onClick:()=>F(r,h),disabled:a,size:"micro",children:h}),e.jsx("span",{children:E})]}):e.jsx(f.Button,{variant:t?"primary":"secondary",onClick:()=>F(r,h),disabled:a,size:"micro",children:`${h}${S}`});case"toggle":return e.jsx(f.ToggleSwitch,{label:h,checked:t,onChange:()=>F(r,h),disabled:a});case"checkbox":default:return w==="list"?e.jsxs("div",{className:je.count,children:[e.jsx(f.Checkbox,{label:h,score:"",checked:t,onChange:()=>F(r,h),disabled:a}),e.jsx("span",{children:E})]}):e.jsx(f.Checkbox,{label:h,score:S,checked:t,onChange:()=>F(r,h),disabled:a})}},he=_?x:!1;return e.jsx(f.FilterPanelBase,{title:l,collapsible:_,collapsed:he,children:e.jsxs("ul",{className:w==="grid"?je.grid:je.list,style:{listStyle:"none",padding:0,margin:0},children:[U.map(([h,k])=>e.jsx("li",{children:me(h,k)},h)),C&&e.jsx("li",{className:je.toggleItem,children:e.jsx(f.Button,{variant:"ghost",size:"micro",onClick:()=>ue(h=>!h),children:J?"Show less":`Show ${I.length-(v??0)} more`})})]})})},ze={disabledMessage:"_disabledMessage_o89gh_1"},dt=({field:r,label:l,expectedMin:g=0,expectedMax:i=1e3,displayType:u="input",collapsible:v=!0,startCollapsed:_=!1})=>{const{state:{rangeFilters:x,rangeBounds:s,facetStats:w,query:q,facetDebounceDelayMillis:M},setRangeFilter:L,resetSingleFilter:y,allowEmptySearch:K,isFetchingInitial:z}=ge(),b=(s==null?void 0:s[r])!==void 0,R=(s==null?void 0:s[r])??{min:g,max:i},p=R.min,n=R.max,F=(w==null?void 0:w[r])??R,A=F.min,D=F.max,m=b&&p===n,J=m?g:p,ue=m?i:n,G=x==null?void 0:x[r],de=G?G.min:p,O=G?G.max:n,pe=G!==void 0,I=A!==p||D!==n,[C,U]=o.useState([de,O]),[me,he]=o.useState(!1),[h,k]=o.useState(!1),{finalMin:t,finalMax:a,isValidMin:S,isValidMax:E}=o.useMemo(()=>{const[H,$]=C,Q=Math.max(p,Math.min(n,H)),we=Math.max(p,Math.min(n,$)),Fe=Math.min(Q,we),ke=Math.max(Q,we),He=Fe>=p&&Fe<ke,Ve=ke<=n&&ke>Fe;return{finalMin:Fe,finalMax:ke,isValidMin:He,isValidMax:Ve}},[C,p,n]);o.useEffect(()=>{if(m)return;if(C[0]===p&&C[1]===n){he(!1),k(!1);return}const $=M??500,Q=setTimeout(()=>{he(!S),k(!E)},300),we=setTimeout(()=>{S&&E&&(t===p&&a===n?y(r):L(r,t,a))},$);return()=>{clearTimeout(Q),clearTimeout(we)}},[t,a,S,E,p,n,r,y,L,M,m]),o.useEffect(()=>{U([de,O]),he(!1),k(!1)},[de,O,r]);const ae=o.useCallback(H=>{if(m)return;const $=Math.max(p,Math.min(D,H[0])),Q=Math.max(A,Math.min(n,H[1]));U([$,Q])},[m,p,n,A,D]),ve=o.useCallback(H=>{if(m)return;const $=Math.max(p,Math.min(D,H[0])),Q=Math.max(A,Math.min(n,H[1]));$===p&&Q===n?(U([p,n]),y(r)):U([$,Q])},[m,p,n,A,D,r,y]),V=o.useCallback(H=>{if(m)return;const $=Number(H.target.value);if(!isNaN($)){const Q=Math.max(p,Math.min(D,$));U([Q,C[1]])}},[m,C,p,D]),re=o.useCallback(H=>{if(m)return;const $=Number(H.target.value);if(!isNaN($)){const Q=Math.max(A,Math.min(n,$));U([C[0],Q])}},[m,C,A,n]),xe=o.useCallback(()=>{const H=C[0],$=Math.max(p,Math.min(D,H));$<C[1]?U([$,C[1]]):U([p,C[1]])},[C,p,D]),Ce=o.useCallback(()=>{const H=C[1],$=Math.max(A,Math.min(n,H));$>C[0]?U([C[0],$]):U([C[0],n])},[C,A,n]);return z||!K&&!q?null:u==="slider"?e.jsxs(f.FilterPanelBase,{title:l,collapsed:_,collapsible:v,children:[m&&e.jsxs("div",{className:ze.disabledMessage,children:["No adjustable range (all results have the same value: ",p,")."]}),e.jsx("div",{style:{padding:"10px 10px 20px 10px"},children:e.jsx(f.Slider,{min:J,max:ue,value:m?[J,ue]:[t,a],isRange:!0,onChange:H=>ae(H),onFinalChange:H=>ve(H),disabled:m,activeMin:A,activeMax:D,isFaceted:I,highlightFaceted:pe})}),e.jsxs("div",{style:{display:"flex",flex:"flex-grow",gap:"10px",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(f.InputField,{type:"number",value:m?p:C[0],min:p,max:Math.min(D,C[1]-1),onChange:V,onBlur:xe,disabled:m,isValid:m||!me}),e.jsx(f.InputField,{type:"number",value:m?n:C[1],min:Math.max(A,C[0]+1),max:n,onChange:re,onBlur:Ce,disabled:m,isValid:m||!h})]})]}):e.jsxs(f.FilterPanelBase,{title:l,children:[m&&e.jsxs("div",{className:ze.disabledMessage,children:["No adjustable range (all results have the same value: ",p,")."]}),e.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"flex-start"},children:[e.jsx(f.InputField,{label:"Min:",type:"number",value:m?p:C[0],min:p,max:Math.min(D,C[1]-1),onChange:V,onBlur:xe,disabled:m,isValid:m||!me}),e.jsx(f.InputField,{label:"Max:",type:"number",value:m?n:C[1],min:Math.max(A,C[0]+1),max:n,onChange:re,onBlur:Ce,disabled:m,isValid:m||!h})]})]})},ht={grid:"_grid_nvpmn_2"},ft=o.memo(({field:r,value:l,onReset:g})=>e.jsx("li",{children:e.jsxs(f.Button,{onClick:g,iconRight:e.jsx(De,{}),variant:"primary",size:"micro",children:[r,": ",l]})})),gt=o.memo(({field:r,min:l,max:g,onReset:i})=>e.jsx("li",{children:e.jsxs(f.Button,{onClick:i,iconRight:e.jsx(De,{}),variant:"primary",size:"micro",children:[r,": ",l," – ",g]})}));function pt(){const{state:{filters:r,rangeFilters:l},resetFilters:g,resetSingleFilter:i}=ge(),u=o.useMemo(()=>Object.entries(r).map(([x,s])=>s.map(w=>({field:x,value:w}))).flat(),[r]),v=o.useMemo(()=>Object.entries(l).map(([x,{min:s,max:w}])=>({field:x,min:s,max:w})),[l]);return o.useMemo(()=>Object.keys(r).length>0||Object.keys(l).length>0,[r,l])?e.jsx(f.FilterPanelBase,{collapsible:!1,title:"Active filters",children:e.jsxs("ul",{className:ht.grid,children:[u.map(({field:x,value:s})=>e.jsx(ft,{field:x,value:s,onReset:()=>i(x,s)},`${x}-${s}`)),v.map(({field:x,min:s,max:w})=>e.jsx(gt,{field:x,min:s,max:w,onReset:()=>i(x)},x)),e.jsx("li",{children:e.jsx(f.Button,{onClick:g,size:"micro",variant:"ghost",children:"Reset"})})]})}):null}const mt={radioGroup:"_radioGroup_nwf7i_6"},vt=({displayType:r="dropdown",collapsible:l=!0,startCollapsed:g=!1})=>{const{state:{sortableFields:i,sortBy:u,sortAscending:v},setSort:_}=ge();if(!i||i.length===0)return null;const x=u?`${u}:${v?"asc":"desc"}`:"none",s=[{label:"None",value:"none"},...i.flatMap(M=>[{label:`${M} (asc)`,value:`${M}:asc`},{label:`${M} (desc)`,value:`${M}:desc`}])],w=M=>{if(M==="none"||M==="")_(null,!0);else{const[L,y]=M.split(":");_(L,y==="asc")}},q=l?g:!1;return e.jsx(f.FilterPanelBase,{title:"Sort by",collapsible:l,collapsed:q,children:r==="dropdown"?e.jsx(f.Select,{value:x,onValueChange:w,options:s,placeholder:"Select sort..."}):e.jsx("div",{className:mt.radioGroup,children:s.map(M=>e.jsx(f.RadioButton,{id:`sort-${M.value}`,name:"sort-by",value:M.value,label:M.label,checked:x===M.value,onChange:L=>w(L.target.value)},M.value))})})},xt={list:"_list_1y4fk_1"};function St(){const{state:{searchSettings:r},setSearchSettings:l}=ge(),[g,i]=o.useState(!1),u=(s,w)=>{const q=parseInt(w,10);isNaN(q)||l({[s]:q})},v=(s,w)=>{l({[s]:w})},_=(s,w)=>{const q=parseInt(w,10);isNaN(q)||l({coverageSetup:{...r.coverageSetup,[s]:q}})},x=(s,w)=>{l({coverageSetup:{...r.coverageSetup,[s]:w}})};return e.jsx(f.FilterPanelBase,{collapsed:!0,title:"Settings",children:e.jsxs("ul",{className:xt.list,children:[e.jsx("li",{children:e.jsx(f.InputField,{label:"Max Results",type:"number",value:r.maxNumberOfRecordsToReturn.toString(),onChange:s=>u("maxNumberOfRecordsToReturn",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage Depth",type:"number",value:r.coverageDepth.toString(),onChange:s=>u("coverageDepth",s.target.value)})}),e.jsxs("li",{children:[e.jsx(f.InputField,{label:"Minimum Score",type:"number",value:r.minimumScore.toString(),onChange:s=>{const w=parseFloat(s.target.value);isNaN(w)||l({minimumScore:w})}}),e.jsx("div",{style:{padding:"10px 10px 20px 10px"},children:e.jsx(f.Slider,{min:0,max:255,step:1,value:r.minimumScore,onChange:s=>{l({minimumScore:s})}})})]}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Placeholder text",type:"text",value:r.placeholderText,onChange:s=>{l({placeholderText:s.target.value})}})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Show score",checked:r.showScore,onChange:s=>v("showScore",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Enable Coverage",checked:r.enableCoverage,onChange:s=>v("enableCoverage",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Remove Duplicates",checked:r.removeDuplicates,onChange:s=>v("removeDuplicates",s)})}),e.jsx("li",{children:e.jsx(f.Button,{variant:"ghost",size:"micro",iconRight:g?e.jsx(at,{}):e.jsx(it,{}),onClick:()=>i(s=>!s),children:g?"Hide Coverage Setup":"Show Coverage Setup"})}),g&&e.jsxs(e.Fragment,{children:[e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Whole Query",checked:r.coverageSetup.coverWholeQuery,onChange:s=>x("coverWholeQuery",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Whole Words",checked:r.coverageSetup.coverWholeWords,onChange:s=>x("coverWholeWords",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Fuzzy Words",checked:r.coverageSetup.coverFuzzyWords,onChange:s=>x("coverFuzzyWords",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Joined Words",checked:r.coverageSetup.coverJoinedWords,onChange:s=>x("coverJoinedWords",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Cover Prefix Suffix",checked:r.coverageSetup.coverPrefixSuffix,onChange:s=>x("coverPrefixSuffix",s)})}),e.jsx("li",{children:e.jsx(f.ToggleSwitch,{label:"Truncate list",checked:r.coverageSetup.truncate,onChange:s=>x("truncate",s)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Levenshtein Max Word Size",type:"number",value:r.coverageSetup.levenshteinMaxWordSize.toString(),onChange:s=>_("levenshteinMaxWordSize",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Min Word Size",type:"number",value:r.coverageSetup.minWordSize.toString(),onChange:s=>_("minWordSize",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage Min Word Hits Abs",type:"number",value:r.coverageSetup.coverageMinWordHitsAbs.toString(),onChange:s=>_("coverageMinWordHitsAbs",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage Min Word Hits Relative",type:"number",value:r.coverageSetup.coverageMinWordHitsRelative.toString(),onChange:s=>_("coverageMinWordHitsRelative",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage Q Limit For Error Tolerance",type:"number",value:r.coverageSetup.coverageQLimitForErrorTolerance.toString(),onChange:s=>_("coverageQLimitForErrorTolerance",s.target.value)})}),e.jsx("li",{children:e.jsx(f.InputField,{label:"Coverage LCS Error Tolerance Relative Q",type:"number",value:r.coverageSetup.coverageLcsErrorToleranceRelativeq.toString(),onChange:s=>_("coverageLcsErrorToleranceRelativeq",s.target.value)})})]})]})})}class bt extends o.Component{constructor(g){super(g);Ke(this,"reset",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(g){return{hasError:!0,error:g}}componentDidCatch(g,i){console.error("[SearchErrorBoundary] Caught error:",g,i)}render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.reset):e.jsxs("div",{style:{padding:"2rem",backgroundColor:"#fee",border:"2px solid #c33",borderRadius:"8px",maxWidth:"600px",margin:"2rem auto"},children:[e.jsx("h2",{style:{color:"#c33",marginTop:0},children:"⚠️ Search Initialization Error"}),e.jsxs("p",{style:{marginBottom:"1rem"},children:[e.jsx("strong",{children:"Error:"})," ",this.state.error.message]}),e.jsxs("div",{style:{backgroundColor:"#fff",padding:"1rem",borderRadius:"4px",marginBottom:"1rem",fontSize:"0.9rem"},children:[e.jsx("strong",{children:"💡 Common fixes:"}),e.jsxs("ul",{style:{marginBottom:0,paddingLeft:"1.5rem"},children:[e.jsx("li",{children:"Check browser console for detailed error messages"}),e.jsx("li",{children:"Verify NEXT_PUBLIC_INDX_URL is correct in .env.local"}),e.jsx("li",{children:"Verify NEXT_PUBLIC_INDX_EMAIL and NEXT_PUBLIC_INDX_PASSWORD are correct"}),e.jsx("li",{children:"Ensure INDX server is running"}),e.jsx("li",{children:"Check dataset name spelling"})]})]}),e.jsx("button",{onClick:this.reset,style:{padding:"0.5rem 1rem",backgroundColor:"#c33",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontWeight:"bold"},children:"Try Again"})]}):this.props.children}}P.ActiveFiltersPanel=pt,P.RangeFilterPanel=dt,P.SearchErrorBoundary=bt,P.SearchInput=ot,P.SearchProvider=st,P.SearchResults=ct,P.SearchSettingsPanel=St,P.SortByPanel=vt,P.ValueFilterPanel=ut,P.useSearch=ge,P.useSearchContext=ge,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
package/dist/intrface.css CHANGED
@@ -1 +1 @@
1
- ._placeholder_bcpqa_1{min-height:600px;height:100%;max-height:1000px;opacity:.05;display:flex;align-items:center;justify-content:center}._invalid_bcpqa_10 p{padding:25px;font:var(--text-base)}._row_bcpqa_14{padding:20px 25px 20px 30px;border-bottom:1px solid var(--lv0);font:var(--text-xs);position:relative;color:var(--lv4)}@media(prefers-color-scheme:dark){._row_bcpqa_14{border-color:var(--lv2)}}._row_bcpqa_14:last-child{border-bottom:none}._row_bcpqa_14 h2{font:var(--text-base);color:var(--lv8)}._row_bcpqa_14>div{display:flex;flex-direction:column;gap:10px}._indexNumber_bcpqa_42{position:absolute;top:25px;left:5px;font:var(--text-2xs);color:var(--lv4)}._scoreNumber_bcpqa_49{position:absolute;top:25px;right:5px;font:var(--text-2xs);color:var(--lv4)}._row_bcpqa_14 span{color:var(--lv6);background-color:var(--lv0);font:var(--text-xs);margin-right:5px;border-radius:10px;padding:2px 6px}._list_mwzqq_2{display:flex;flex-direction:column;gap:10px}._count_mwzqq_7{display:flex;justify-content:space-between;align-items:center;font:var(--text-xs);color:var(--lv5)}._grid_mwzqq_16{display:flex;flex-wrap:wrap;gap:10px}._grid_mwzqq_16 li{flex:0 0 auto}._disabledMessage_o89gh_1{font:var(--text-2xs);margin-bottom:10px}._grid_nvpmn_2{display:flex;flex-wrap:wrap;gap:10px;list-style:none}._grid_nvpmn_2 li{flex:0 0 auto}._select_nwf7i_1{padding:6px 10px;font-size:14px}._radioGroup_nwf7i_6{display:flex;flex-direction:column;gap:6px}._list_1y4fk_1{display:flex;flex-direction:column;gap:15px;list-style-type:none}
1
+ .indx-search-provider{box-sizing:border-box}.indx-search-provider *,.indx-search-provider *:before,.indx-search-provider *:after{box-sizing:border-box}.indx-search-provider h1,.indx-search-provider h2,.indx-search-provider h3,.indx-search-provider h4,.indx-search-provider h5,.indx-search-provider h6,.indx-search-provider p,.indx-search-provider ol,.indx-search-provider ul{margin:0;padding:0}.indx-search-provider p{margin-bottom:1em;line-height:1.5}.indx-search-provider h1,.indx-search-provider h2,.indx-search-provider h3,.indx-search-provider h4,.indx-search-provider h5,.indx-search-provider h6{margin-bottom:.5em;line-height:1.2}.indx-search-provider ul,.indx-search-provider ol{list-style:none}._placeholder_bcpqa_1{min-height:600px;height:100%;max-height:1000px;opacity:.05;display:flex;align-items:center;justify-content:center}._invalid_bcpqa_10 p{padding:25px;font:var(--text-base)}._row_bcpqa_14{padding:20px 25px 20px 30px;border-bottom:1px solid var(--lv0);font:var(--text-xs);position:relative;color:var(--lv4)}@media(prefers-color-scheme:dark){._row_bcpqa_14{border-color:var(--lv2)}}._row_bcpqa_14:last-child{border-bottom:none}._row_bcpqa_14 h2{font:var(--text-base);color:var(--lv8)}._row_bcpqa_14>div{display:flex;flex-direction:column;gap:10px}._indexNumber_bcpqa_42{position:absolute;top:25px;left:5px;font:var(--text-2xs);color:var(--lv4)}._scoreNumber_bcpqa_49{position:absolute;top:25px;right:5px;font:var(--text-2xs);color:var(--lv4)}._row_bcpqa_14 span{color:var(--lv6);background-color:var(--lv0);font:var(--text-xs);margin-right:5px;border-radius:10px;padding:2px 6px}._list_mwzqq_2{display:flex;flex-direction:column;gap:10px}._count_mwzqq_7{display:flex;justify-content:space-between;align-items:center;font:var(--text-xs);color:var(--lv5)}._grid_mwzqq_16{display:flex;flex-wrap:wrap;gap:10px}._grid_mwzqq_16 li{flex:0 0 auto}._disabledMessage_o89gh_1{font:var(--text-2xs);margin-bottom:10px}._grid_nvpmn_2{display:flex;flex-wrap:wrap;gap:10px;list-style:none}._grid_nvpmn_2 li{flex:0 0 auto}._select_nwf7i_1{padding:6px 10px;font-size:14px}._radioGroup_nwf7i_6{display:flex;flex-direction:column;gap:6px}._list_1y4fk_1{display:flex;flex-direction:column;gap:15px;list-style-type:none}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indxsearch/intrface",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "source": "./src/index.tsx",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",