import{h as m,i as p,f as c,j as x,a_ as y,aw as g,ar as l}from"./index-OtVJl4GC.js";import"./lodash-ZyeDnt0e.js";import{f as v}from"./vendor-ClLR6ncd.js";function b(){return e=>({queryKey:["freetext-indexes",e],queryFn:async s=>{var a;const t=await p({url:c(s,"freetext/indices",e)});return{name:e,...t,graphs:(a=t.graphs)==null?void 0:a.map(r=>r===null?"default":r)}}})}function J(){const e=x(["freetext-indexes-list"],a=>p({url:c(a,"freetext/indices")})),s=b(),t=y(Array.isArray(e.data)?e.data.map(s):[]);return{indexesListQuery:e,indexesListInfoQueries:t}}function I(){const e=g();return({resetIndex:s,removeIndex:t,resetIndexesList:a=!1}={})=>{l.invalidateQueries([...e,"fti"]),t?l.removeQueries([...e,"freetext-indexes",t]):l.invalidateQueries([...e,"freetext-indexes",...s?[]:[s]]),a&&l.invalidateQueries([...e,"freetext-indexes-list"])}}function Q(e){const s=v(),t=I();return m(({name:a,reIndex:r,...f},h)=>{const o=new URLSearchParams;for(const[n,i]of Object.entries(f))if(n==="innerChars"||n==="borderChars")for(const d of i)o.append(n,d);else if(n==="stopWord"&&Array.isArray(i)&&i.length===0)o.append(n,"");else if(Array.isArray(i)){const d=i.filter(u=>typeof u=="string"&&u.trim().length>0);for(const u of d)o.append(n,u)}else i!==void 0&&o.append(n,i);return e&&o.append("reIndex",r),p({url:c(h,"freetext/indices",a),method:e?"put":"post",params:o})},{onSuccess:(a,{name:r})=>{t({resetIndexesList:e,resetIndex:r}),s(e?"./..":"./../..",{relative:"path"})}})}const S=[{label:"Default",value:"default",title:"The default tokenizer is suitable for European languages."},{label:"Japanese",value:"japanese",title:"The Japanese tokenizer uses a Japanese morphological analyzer and is suitable with Japanese text and Japanese/European mixed text.  If you use this tokenizer, you may want to decrease the minimum word size to 2 or 1"},{label:"Simple-CJK",value:"simple-cjk",title:"The Simple-CJK tokenizer uses bigrams to tokenize consecutive CJK characters. It can result in false positive hits, but it works for Chinese/Korean/Japanese text, even if they are mixed.  If you use this tokenizer, set the minimum word size to 2."}].map(e=>({...e,placement:"right"})),C=[{value:"stem.english",label:"English stem",title:"Stem is the form of a word before any inflectional affixes are added"},{value:"drop-accents",label:"Remove accents",title:"Removes the accent by replacing the combining characters with precomposed characters"},{value:"soundex",label:"Soundex",title:"Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English."}],K=new String("");export{I as a,b,Q as c,K as i,S as t,J as u,C as w};
