1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,868401,e=>{"use strict";var t=e.i(456420);let r={name:"tags",size:24,node:[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]]};r.node;let s=(0,t.default)(r);e.s(["Tags",0,s],868401)},499457,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(337822),n=e.i(699375),a=e.i(584596),i=e.i(975157),l=e.i(708801),o=e.i(373207);let c=(0,r.memo)(function(e){let{value:c,onChange:d,exclusive:u=!1,onExclusiveChange:x,variant:m="field",chipIcon:p}=e,[h,g]=(0,r.useState)(!1),f=c===l.PopularityLevels.All||c===l.PopularityLevels.high||c===l.PopularityLevels.highest,b=o.POPULARITY_OPTIONS.find(e=>e.level===c)?.label??(0,o.getPopularityLabel)(c),v=c!==l.PopularityLevels.All,j=v?`Popularity \xb7 ${b}`:"Popularity";return(0,t.jsxs)(s.Popover,{open:h,onOpenChange:g,children:[(0,t.jsx)(a.PickerTrigger,{active:v,variant:m,chipIcon:p,children:"chip"===m?j:b}),(0,t.jsxs)(s.PopoverContent,{align:"start",className:"w-56 p-0",children:[(0,t.jsx)("div",{className:"border-b px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Word Popularity"})}),(0,t.jsx)(a.PickerOptionList,{children:o.POPULARITY_OPTIONS.map(e=>(0,t.jsx)(a.PickerOptionRow,{value:e.level,activeValue:c,label:e.label,description:e.description,onClick:e=>{d(e),u&&x&&(e===l.PopularityLevels.All||e===l.PopularityLevels.high||e===l.PopularityLevels.highest)&&x(!1),g(!1)}},e.level))}),x&&(0,t.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,t.jsxs)("div",{className:(0,i.cn)("flex items-start gap-2.5",f&&"opacity-40 pointer-events-none"),children:[(0,t.jsx)(n.Switch,{id:"pop-exclusive",checked:!f&&u,onCheckedChange:x,disabled:f,className:"mt-0.5 shrink-0"}),(0,t.jsxs)("label",{htmlFor:"pop-exclusive",className:(0,i.cn)("text-xs leading-snug",f?"cursor-default":"cursor-pointer"),children:["Only this tier and rarer",(0,t.jsx)("span",{className:"block text-muted-foreground",children:"Exclude more popular words"})]})]})})]})]})});e.s(["WordPopularityPicker",0,c])},319716,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(522016),n=e.i(856423),a=e.i(716327),i=e.i(63684),l=e.i(806537),o=e.i(868401),c=e.i(263676),d=e.i(793479),u=e.i(624687),x=e.i(337822),m=e.i(975157),p=e.i(189463),h=e.i(594690),g=e.i(233487),f=e.i(24071),b=e.i(867927),v=e.i(418994),j=e.i(482022),N=e.i(648119),y=e.i(325597),w=e.i(77071),C=e.i(901279),k=e.i(987968),L=e.i(584596),P=e.i(277264),I=e.i(277625);let E=(0,r.memo)(function(e){let{value:s,onChange:i,categoryId:l,conceptOnly:o,customOnly:c,extraCategories:d,triggerClassName:u}=e,[p,h]=(0,r.useState)(!1),[g,E]=(0,r.useState)(!1),[T,O]=(0,r.useState)(""),_=(0,r.useRef)(null),{categories:R,loading:M,hasNoCustom:A,findByUID:F,filtered:$}=(0,I.useWordlistCategories)({extraCategories:d,categoryId:l,conceptOnly:o,customOnly:c});(0,r.useEffect)(()=>{p?requestAnimationFrame(()=>_.current?.focus()):O("")},[p]);let U=(0,r.useMemo)(()=>$(T),[$,T]),Y=(0,r.useMemo)(()=>c?R.filter(e=>e.isCustomCategory):R,[R,c]),W=(0,r.useMemo)(()=>c?void 0:{categoryId:l,conceptOnly:o},[c,l,o]),q=(0,r.useMemo)(()=>(0,I.getWordlistNav)(Y,s,W),[Y,s,W]),K=(0,r.useCallback)(e=>{i(e),h(!1)},[i]),Q=(0,r.useCallback)(()=>{q.prev&&i(q.prev.typeUID)},[q.prev,i]),z=(0,r.useCallback)(()=>{q.next&&i(q.next.typeUID)},[q.next,i]),B=(0,r.useCallback)(()=>{let e=(0,I.getRandomWordlist)(Y,s,W);e&&i(e.typeUID),E(!1)},[Y,s,W,i]),H=q.current??(s?F(s):void 0),J=H?.name??"Select wordlist...",V=H?.count??0,G=u?.includes("wordlist-inline");return(0,t.jsxs)("div",{className:(0,m.cn)("flex items-center",u),children:[(0,t.jsxs)(x.Popover,{open:p,onOpenChange:h,children:[(0,t.jsxs)(x.PopoverTrigger,{className:(0,m.cn)("flex h-9 min-w-0 flex-1 items-center justify-between gap-1 border border-r-0 border-input bg-transparent px-2 text-sm","hover:bg-accent/50 transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","dark:bg-input/30",G&&"border-l-0 rounded-l-none",!H&&"text-muted-foreground"),children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate",children:J}),V>0&&(0,t.jsx)("span",{className:"shrink-0 text-2xs tabular-nums text-muted-foreground
1/80",children:V.toLocaleString()})]}),(0,t.jsx)(a.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),(0,t.jsxs)(L.PickerPopoverContent,{children:[(0,t.jsx)(L.PopoverSearchInput,{value:T,onChange:O,placeholder:"Search wordlists...",inputRef:_}),(0,t.jsxs)(L.ScrollablePickerList,{children:[M&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 px-3 py-8 text-xs text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{className:"h-4 w-4"}),"Loading wordlists..."]}),!M&&A&&!T&&(0,t.jsxs)("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:"No custom wordlists yet."}),(0,t.jsxs)("a",{href:P.urls.wordlistNew,className:"mt-1.5 inline-flex items-center gap-1 text-link hover:underline",children:[(0,t.jsx)(w.Plus,{className:"h-3 w-3"}),"Create a wordlist"]})]}),!M&&!A&&0===U.length&&(0,t.jsx)("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:T?`No wordlists matching "${T}"`:"No wordlists available"}),!M&&U.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"sticky top-0 z-10 bg-popover px-3 py-1.5 text-xs font-medium text-muted-foreground",children:[e.name,(0,t.jsxs)("span",{className:"ml-1 opacity-60",children:["(",e.wordlists.length,")"]})]}),e.wordlists.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>K(e.typeUID),className:(0,m.cn)("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors hover:bg-accent",s===e.typeUID&&"bg-accent/50 font-medium"),children:[e.isCustom&&(0,t.jsx)(C.User,{className:"h-3 w-3 shrink-0 text-muted-foreground/80"}),(0,t.jsx)("span",{className:"flex-1 truncate",children:e.name}),e.count>0&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.count})]},e.typeUID)),e.isCustomCategory&&(0,t.jsxs)("a",{href:P.urls.wordlists,className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-link transition-colors hover:bg-accent",children:[(0,t.jsx)(y.PenLine,{className:"h-3 w-3 shrink-0"}),"Manage custom wordlists"]})]},e.isCustomCategory?`custom-${e.id}`:e.id)),!M&&U.length>0&&!T&&(0,t.jsx)("div",{className:"border-t border-border px-3 py-2",children:(0,t.jsxs)("a",{href:P.urls.wordlistNew,className:"inline-flex items-center gap-1 text-xs text-link hover:underline",children:[(0,t.jsx)(w.Plus,{className:"h-3 w-3"}),"Create custom wordlist"]})})]})]})]}),(0,t.jsx)("button",{type:"button",onClick:z,disabled:!q.next,title:q.next?`Next: ${q.next.name}`:void 0,className:(0,m.cn)("flex h-9 w-7 shrink-0 items-center justify-center border border-r-0 border-input transition-colors","hover:bg-accent/50 disabled:opacity-30 disabled:pointer-events-none","dark:bg-input/30"),children:(0,t.jsx)(b.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsx)("div",{className:"flex h-9 items-center border-y border-input dark:bg-input/30",children:(0,t.jsx)("div",{className:"h-4 w-px bg-border"})}),(0,t.jsxs)(x.Popover,{open:g,onOpenChange:E,children:[(0,t.jsx)(x.PopoverTrigger,{className:(0,m.cn)("flex h-9 w-8 shrink-0 items-center justify-center border border-input rounded-r-md transition-colors","hover:bg-accent/50 cursor-pointer","dark:bg-input/30"),children:(0,t.jsx)(N.MoreHorizontal,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)(x.PopoverContent,{align:"end",className:"w-56 p-1",children:[q.prev&&(0,t.jsx)(D,{icon:(0,t.jsx)(f.ChevronLeft,{className:"h-4 w-4"}),label:`Previous - ${q.prev.name}`,onClick:()=>{Q(),E(!1)}}),q.next&&(0,t.jsx)(D,{icon:(0,t.jsx)(b.ChevronRight,{className:"h-4 w-4"}),label:`Next - ${q.next.name}`,onClick:()=>{z(),E(!1)}}),(0,t.jsx)(D,{icon:(0,t.jsx)(v.Shuffle,{className:"h-4 w-4"}),label:"Random List",onClick:B}),H&&V>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"my-1 border-t border-border"}),(0,t.jsx)(D,{icon:(0,t.jsx)(n.BookOpen,{className:"h-4 w-4"}),label:`${V.toLocaleString()} word${1===V?"":"s"} in list`,onClick:()=>E(!1),disabled:!0}),(0,t.jsx)(S,{icon:(0,t.jsx)(j.ExternalLink,{className:"h-4 w-4"}),label:"Wordlist Details",href:P.urls.wordlist(H.typeUID),onClick:()=>E(!1)})]}),(0,t.jsx)("div",{className:"my-1 border-t border-border"}),(0,t.jsx)(S,{icon:(0,t.jsx)(w.Plus,{className:"h-4 w-4"}),label:"Create Custom Wordlist",href:P.urls.wordlistNew,onClick:()=>E(!1)})]})]})]})});function D(e){let{icon:r,label:s,onClick:n,disabled:a}=e;return(0,t.jsxs)("button",{type:"button",onClick:n,disabled:a,className:(0,m.cn)("flex w-full items-center gap-2 rounded-sm px-2.5 py-2 text-sm transition-colors",a?"text-muted-foreground
1/50 cursor-default":"text-foreground hover:bg-accent"),children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:r}),(0,t.jsx)("span",{className:"flex-1 truncate text-left",children:s})]})}function S(e){let{icon:r,label:s,href:n,onClick:a}=e;return(0,t.jsxs)("a",{href:n,target:"_blank",rel:"noopener noreferrer",onClick:a,className:"flex w-full items-center gap-2 rounded-sm px-2.5 py-2 text-sm text-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:r}),(0,t.jsx)("span",{className:"flex-1 truncate text-left",children:s})]})}var T=e.i(761354),O=e.i(331721),_=e.i(626483);function R(e,t){return t.find(t=>t.fieldType===e)}function M(e){let{fieldType:s,choices:n,onChange:i}=e,[o,c]=(0,r.useState)(!1),d=R(s,n),u=d?.nameShort??d?.name??"Select";return(0,t.jsxs)(x.Popover,{open:o,onOpenChange:c,children:[(0,t.jsxs)(x.PopoverTrigger,{className:(0,m.cn)("flex h-9 shrink-0 items-center gap-1 rounded-l-md border border-r-0 border-input bg-muted/60 px-2.5 text-sm font-medium","hover:bg-accent/50 transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","dark:bg-input/30"),children:[(0,t.jsx)("span",{className:"whitespace-nowrap",children:u}),(0,t.jsx)(a.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(x.PopoverContent,{align:"start",className:"w-52 p-1",children:n.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{i(e.fieldType),c(!1)},className:(0,m.cn)("flex w-full items-center justify-between rounded-sm px-2.5 py-1.5 text-sm transition-colors",s===e.fieldType?"bg-primary/10 text-foreground font-medium":"text-foreground hover:bg-accent"),children:[(0,t.jsx)("span",{children:e.name}),e.isPro&&(0,t.jsx)(l.Lock,{className:"h-3 w-3 text-muted-foreground"})]},e.fieldType))})]})}let A="wordlist-inline",F=(0,r.memo)(function(e){let{fieldType:s,fieldTypeChoices:a,textValue:i,onFieldTypeChange:l,onTextChange:x,onClear:g,wordlistTypeUID:f,onWordlistChange:b,dictionaryQuery:v,onDictionaryQueryChange:j,languageId:N,onLanguageChange:y,popularityLevel:w,onPopularityChange:C,popularityExclusive:k,onPopularityExclusiveChange:L,placeholder:P,id:I,errorMessage:D,autoFocus:S,onResearchKeyword:F,project:Y=_.NO_SEARCH_PROJECT}=e,W=!!D,{user:q}=(0,h.useAuth)(),K=R(s,a),Q=P??K?.placeholder??K?.instruction??"",z=(0,r.useMemo)(()=>{let e=q?.customWordlistCategory;return e&&e.wordlists?.length?[e]:[]},[q?.customWordlistCategory]),B=(0,r.useCallback)(e=>{x(e.target.value)},[x]);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1",children:[(0,t.jsx)(M,{fieldType:s,choices:a,onChange:l}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(()=>{switch(s){case p.FIELD_TYPE_ID.KEYWORD:case p.FIELD_TYPE_ID.TOPIC:{let e=!!F&&i.trim().length>0,r=!!g&&i.length>0,s=e&&r?"pr-14":e||r?"pr-7":"";return(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)(d.Input,{id:I,autoFocus:S,value:i,onChange:B,placeholder:Q,className:(0,m.cn)("h-9 rounded-l-none border-l-0 text-sm focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-input",s,W&&"border-destructive"),"data-hj-allow":!0}),(0,t.jsxs)("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2 flex items-center gap-0.5",children:[e&&(0,t.jsx)("button",{type:"button",onClick:()=>F(i),tabIndex:-1,title:"Research this keyword","aria-label":"Research this keyword",className:"rounded-sm p-0.5 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(n.BookOpen,{className:"h-3.5 w-3.5"})}),r&&(0,t.jsx)("button",{type:"button",onClick:g,tabIndex:-1,className:"rounded-sm p-0.5 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(c.X,{className:"h-3.5 w-3.5"})})]})]})}case p.FIELD_TYPE_ID.CREATIVE_BRIEF:case p.FIELD_TYPE_ID.CUSTOM_DESCRIPTION:return(0,t.jsx)(u.Textarea,{id:I,autoFocus:S,value:i,onChange:B,placeholder:Q,className:(0,m.cn)("min-h-[72px] rounded-l-none border-l-0 text-sm resize-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-input",W&&"border-destructive"),rows:3,"data-hj-allow":!0});case p.FIELD_TYPE_ID.WORDLIST:return(0,t.jsx)(E,{value:f??"",onChange:b??(()=>{}),extraCategories:z,triggerClassName:A});case p.FIELD_TYPE_ID.CONCEPT:return(0,t.jsx)(E,{value:f??"",onChange:b??(()=>{}),conceptOnly:!0,triggerClassName:A});case p.FIELD_TYPE_ID.CUSTOM_WORDLISTS:return(0,t.jsx)(E,{value:f??"",onChange:b??(()=>{}),extraCategories:z,customOnly:!0,triggerClassName:A});case p.FIELD_TYPE_ID.PROJECT_WORDLISTS:return(0,t.jsx)(U,{project:Y});case p.FIELD_TYPE_ID.DICTIONARY:return v&&j?(0,t.jsx)(T.DictionaryQueryPicker,{value:v,onCh
1ange:j,triggerClassName:"h-9 rounded-l-none rounded-r-md border-l-0 focus-visible:ring-0 focus-visible:ring-offset-0",popularityLevel:w,onPopularityChange:C,popularityExclusive:k,onPopularityExclusiveChange:L}):(0,t.jsx)($,{icon:(0,t.jsx)("span",{}),text:"Configure dictionary query"});case p.FIELD_TYPE_ID.RANDOM_DICTIONARY:return(0,t.jsx)($,{text:"Random dictionary words"});case p.FIELD_TYPE_ID.MADEUP:return void 0!==N&&y?(0,t.jsx)(O.LanguagePicker,{value:N,onChange:y}):(0,t.jsx)($,{text:"Short random made-up words"});case p.FIELD_TYPE_ID.PROJECT_KEYWORDS:return(0,t.jsx)($,{icon:(0,t.jsx)(o.Tags,{className:"h-3.5 w-3.5 shrink-0"}),text:Y.projectName?`Preferred words saved in ${Y.projectName}`:"Preferred words saved in this project"});case p.FIELD_TYPE_ID.NONE:return(0,t.jsx)($,{text:"No input"});default:return(0,t.jsx)($,{text:K?.name??"Unknown type"})}})()})]}),W&&(0,t.jsx)("p",{className:"mt-1 text-2xs text-destructive",children:D})]})});function $(e){let{text:r,icon:s,tone:n="muted",action:a,title:i}=e;return(0,t.jsxs)("div",{className:(0,m.cn)("flex h-9 flex-1 items-center gap-1.5 overflow-hidden rounded-r-md border border-l-0 border-input bg-muted/60 px-2.5 text-sm","warning"===n?"border-warning/30 bg-warning/10 text-warning-foreground":"text-muted-foreground"),children:[s,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",title:i??r,children:r}),a]})}function U(e){let{project:r}=e,{projectId:n,projectName:a,wordlistsUrl:l}=r,{data:o,isLoading:c}=(0,g.useProjectWordlistsQuery)(n||void 0),d=(0,t.jsx)(i.ListTree,{className:"h-3.5 w-3.5 shrink-0"}),u=a?` in ${a}`:" in this project",x=o?.wordlists;if(!x||c)return(0,t.jsx)($,{icon:d,text:`All wordlists saved${u}`});if(0===x.length)return(0,t.jsx)($,{icon:d,tone:"warning",text:`No wordlists saved${u}`,action:l?(0,t.jsx)(s.default,{href:l,className:"shrink-0 whitespace-nowrap text-2xs font-medium text-brand-accent hover:underline",children:"Add wordlists"}):void 0});let m=x.reduce((e,t)=>e+(Number(t.count)||0),0),p=`${x.length}
1 wordlist${1===x.length?"":"s"}`;return(0,t.jsx)($,{icon:d,text:`All ${p}${u}`,title:m>0?`${m.toLocaleString()} words across ${p}${u}`:void 0})}e.s(["CompoundInput",0,F],319716)},331721,939547,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(566595),n=e.i(263676),a=e.i(987968),i=e.i(487486),l=e.i(793479),o=e.i(337822),c=e.i(975157),d=e.i(584596);e.i(459956);var u=e.i(939130),x=e.i(85501);let m={1:"Languages",2:"Fictional",3:"Special",4:"Names"},p={[u.LanguageIds.Klingon]:"Star Trek",[u.LanguageIds.Sindarin]:"Lord of the Rings",[u.LanguageIds.FemaleNames]:"Name-based syllables",[u.LanguageIds.MaleNames]:"Name-based syllables",[u.LanguageIds.RandomLetters]:"Random letter combos",[u.LanguageIds.Numbers]:"Numeric combinations",[u.LanguageIds.AnyCharacters]:"Letters + numbers"},h=Object.fromEntries(Object.entries(u.LanguageIds).map(e=>{let[t,r]=e;return[r,t.replace(/([a-z])([A-Z])/g,"$1 $2")]})),g=null,f=null;async function b(){return g||f||(f=x.default.Data.languages().then(e=>{let t=(e.languages||[]).map(e=>{let t=e.id??Number(e.value)??0,r=e.categoryID??e.category??1;return{id:t,label:e.label??e.name??String(t),group:m[r]||"Languages",description:p[t]}});return g=t,t}).catch(()=>(f=null,[])))}function v(e,t){return e.find(e=>e.id===t)?.label??"Unknown"}e.s(["getLanguageLabel",0,v,"loadLanguages",0,b,"useLanguageName",0,function(e){let[t,s]=(0,r.useState)(()=>h[e]??"");return(0,r.useEffect)(()=>{let t=h[e];if(t)return void s(t);let r=!1;return b().then(t=>{r||s(v(t,e))}),()=>{r=!0}},[e]),t}],939547);let j="language-picker-listbox",N=["Popular","Languages","Fictional","Names","Special"],y=new Set([u.LanguageIds.English,u.LanguageIds.Spanish,u.LanguageIds.French,u.LanguageIds.German,u.LanguageIds.Italian,u.LanguageIds.Japanese,u.LanguageIds.Latin]),w=(0,r.memo)(function(e){let{value:x,onChange:m,variant:p="field",chipIcon:h}=e,[g,f]=(0,r.useState)(!1),[w,C]=(0,r.useState)(""),[k,L]=(0,r.useState)([]),[P,I]=(0,r.useState)(!0),E=(0,r.useRef)(null);(0,r.useEffect)(()=>{b().then(L).finally(()=>I(!1))},[]),(0,r.useEffect)(()=>{g?requestAnimationFrame(()=>E.current?.focus()):C("")},[g]);let D=(0,r.useMemo)(()=>k.filter(e=>y.has(e.id)),[k]),S=(0,r.useMemo)(()=>{if(!w.trim())return k;let e=w.toLowerCase();return k.filter(t=>t.label.toLowerCase().includes(e)||t.group.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))},[w,k]),T=(0,r.useMemo)(()=>{let e=new Map;for(let t of N)e.set(t,[]);for(let t of S){let r=e.get(t.group);r&&r.push(t)}return Array.from(e.entries()).filter(e=>{let[,t]=e;return t.length>0})},[S]),O=(0,r.useMemo)(()=>{let e=0;return T.map(t=>{let[r,s]=t;return[r,s.map(t=>({lang:t,listIndex:e++}))]})},[T]),_=(0,r.useMemo)(()=>O.flatMap(e=>{let[,t]=e;return t.map(e=>{let{lang:t}=e;return t})}),[O]),[R,M]=(0,r.useState)(-1);(0,r.useEffect)(()=>{g||M(-1)},[g]),(0,r.useEffect)(()=>{g&&M(-1)},[w,g]);let A=(0,r.useCallback)(e=>{if(e<0)return;let t=_[e];t&&requestAnimationFrame(()=>{document.getElementById(`lang-opt-${t.id}`)?.scrollIntoView({block:"nearest"})})},[_]),F=e=>{m(e),f(!1)},$=R>=0&&R<_.length?`lang-opt-${_[R].id}`:void 0;return(0,t.jsxs)(o.Popover,{open:g,onOpenChange:f,children:[(0,t.jsx)(d.PickerTrigger,{active:x!==u.DEFAULT_LANGUAGE_ID,variant:p,chipIcon:h,children:P?(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,t.jsx)(a.Spinner,{className:"h-3 w-3"}),"Loading..."]}):"chip"===p?`Language \xb7 ${v(k,x)}`:v(k,x)}),(0,t.jsxs)(d.PickerPopoverContent,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2",children:[(0,t.jsx)(s.Search,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,t.jsx)(l.Input,{ref:E,value:w,onChange:e=>C(e.target.value),placeholder:"Search languages...","aria-label":"Search languages",role:"combobox","aria-expanded":g,"aria-controls":j,"aria-autocomplete":"list","aria-activedescendant":$,onKeyDown:e=>{if(!P&&0!==_.length){if("ArrowDown"===e.key){e.preventDefault(),M(e=>{let t=e<0?0:Math.min(e+1,_.length-1);return A(t),t});return}if("ArrowUp"===e.key){e.preventDefault(),M(e=>{let t=e<=0?-1:e-1;return t>=0&&A(t),t});return}if("Home"===e.key){e.preventDefault(),M(0),A(0);return}if("End"===e.key){e.preventDefault();let t=_.length-1;M(t),A(t);return}"Enter"===e.key&&R>=0&&R<_.length&&(e.preventDefault(),F(_[R].id))}},autoComplete:"off",className:"h-8 border-0 bg-transparent px-0 shadow-none focus-visible:ring-0 md:text-sm"}),w?(0,t.jsx)("button",{type:"button",onClick:()=>C(""),"aria-label":"Clear search",className:"rounded-sm p-0.5 text-muted-foreground
1/60 hover:text-foreground",children:(0,t.jsx)(n.X,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}),P&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-8 text-sm text-muted-foreground",children:[(0,t.jsx)(a.Spinner,{className:"h-4 w-4"}),"Loading languages..."]}),!P&&!w&&D.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 border-b px-3 py-2","aria-label":"Popular languages",children:D.map(e=>(0,t.jsx)(i.Badge,{variant:x===e.id?"default":"outline",className:"cursor-pointer text-xs",onClick:()=>F(e.id),children:e.label},e.id))}),!P&&(0,t.jsxs)(d.ScrollablePickerList,{id:j,maxHeight:300,role:"listbox","aria-label":"Language options",children:[0===S.length&&(0,t.jsxs)("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",role:"status",children:['No languages matching "',w,'"']}),O.map(e=>{let[r,s]=e;return(0,t.jsxs)("div",{role:"group","aria-label":`${r}`,children:[(0,t.jsxs)("div",{className:"sticky top-0 z-10 bg-popover px-3 py-1.5 text-xs font-medium text-muted-foreground","aria-hidden":!0,children:[r,(0,t.jsxs)("span",{className:"ml-1 opacity-60",children:["(",s.length,")"]})]}),s.map(e=>{let{lang:r,listIndex:s}=e,n=s===R;return(0,t.jsxs)("div",{id:`lang-opt-${r.id}`,role:"option","aria-selected":x===r.id,"data-highlighted":n?"":void 0,tabIndex:-1,onClick:()=>F(r.id),onMouseEnter:()=>M(s),className:(0,c.cn)("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors hover:bg-accent",x===r.id&&"bg-highlight/15 text-highlight font-medium",n&&"bg-accent"),children:[(0,t.jsx)("span",{className:"flex-1",children:r.label}),r.description&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:r.description})]},r.id)})]},r)})]})]})]})});e.s(["LanguagePicker",0,w],331721)},485984,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(793479),n=e.i(110204),a=e.i(337822),i=e.i(975157),l=e.i(584596);let o=[{label:"Exactly 4",description:"4 chars",min:4,max:4},{label:"Exactly 5",description:"5 chars",min:5,max:5},{label:"Exactly 6",description:"6 chars",min:6,max:6}],c=[{label:"Recommended",description:"6-8 chars",min:6,max:8},{label:"Short",description:"4-6 chars",min:4,max:6},{label:"Medium",description:"5-8 chars",min:5,max:8},{label:"Standard",description:"6-10 chars",min:6,max:10},{label:"Long",description:"8-12 chars",min:8,max:12},{label:"Any",description:"3-15 chars",min:3,max:15}];function d(e,t){return e===t?`${e} chars`:`${e}-${t} chars`}let u=(0,r.memo)(function(e){let u,{minLength:x,maxLength:m,onMinChange:p,onMaxChange:h,unsetSentinel:g=!1,defaultMin:f,defaultMax:b,variant:v="field",chipIcon:j,onApply:N}=e,[y,w]=(0,r.useState)(!1),C=(0,r.useRef)(!1),k=g&&0===x?3:x,L=g&&0===m?15:m,P=e=>p(g&&3===e?0:e),I=e=>h(g&&15===e?0:e),E=(u=[...o,...c].find(e=>e.min===k&&e.max===L),u?.label??null),D=void 0!==f&&void 0!==b?k===f&&L===b:"Any"===E,S=e=>{C.current=!1,P(e.min),I(e.max),w(!1),N?.()};return(0,t.jsxs)(a.Popover,{open:y,onOpenChange:e=>{e?C.current=!1:C.current&&(C.current=!1,N?.()),w(e)},children:[(0,t.jsx)(l.PickerTrigger,{active:!D,variant:v,chipIcon:j,children:"Any"===E?"chip"===v?"Length":"Any":"chip"===v?`Length \xb7 ${d(k,L)}`:d(k,L)}),(0,t.jsxs)(a.PopoverContent,{align:"start",className:"w-56 p-0",children:[(0,t.jsxs)("div",{className:"border-b px-3 py-2.5",children:[(0,t.jsx)("p",{className:"mb-2 text-2xs font-medium text-muted-foreground",children:"Custom range"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(n.Label,{htmlFor:"lp-min",className:"sr-only",children:"Min"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Min"}),(0,t.jsx)(s.Input,{id:"lp-min",type:"number",min:3,max:20,value:k,onChange:e=>{let t;return t=Math.max(3,Math.min(20,Number(e.target.value)||3)),void(C.current=!0,P(t),t>L&&I(t))},className:"h-7 text-sm"})]})]}),(0,t.jsx)("span",{className:"mt-0.5 text-xs text-muted-foreground",children:"-"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(n.Label,{htmlFor:"lp-max",className:"sr-only",children:"Max"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Max"}),(0,t.jsx)(s.Input,{id:"lp-max",type:"number",min:3,max:20,value:L,onChange:e=>{let t;return t=Math.max(3,Math.min(20,Number(e.target.value)||20)),void(C.current=!0,I(t),t<k&&P(t))},className:"h-7 text-sm"})]})]})]})]}),(0,t.jsx)("div",{className:"border-b px-3 py-2",children:(0,t.jsx)("p",{className:"text-2xs font-medium text-muted-foreground",children:"Range"})}),(0,t.jsx)("div",{className:"p-1",children:c.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>S(e),className:(0,i.cn)("flex w-full items-center justify-between rounded-sm px-2.5 py-1.5 text-sm transition-colors",E===e.label?"bg-primary/10 text-foreground font-medium":"text-foreground hover:bg-accent"),children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.description})]},e.label))}),(0,t.jsx)("div",{className:"border-t border-b px-3 py-2",children:(0,t.jsx)("p",{className:"text-2xs font-medium text-muted-foreground",children:"Exact length"})}),(0,t.jsx)("div",{className:"p-1",children:o.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>S(e),className:(0,i.cn)("flex w-full items-center justify-between rounded-sm px-2.5 py-1.5 text-sm transition-colors",E===e.label?"bg-primary/10 text-foreground font-medium":"text-foreground hover:bg-accent"),children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.description})]},e.label))})]})]})});e.s(["LengthPicker",0,u])},233487,e=>{"use strict";var t=e.i(266027),r=e.i(912598),s=e.i(271645),n=e.i(487432),a=e.i(461613);e.s(["useProjectWordlistsQuery",0,function(e){let i=(0,r.useQueryClient)(),l=(0,t.useQuery)({queryKey:a.queryKeys.vocabulary.wordlists(e),queryFn:async()=>n.Niche.getSharedWordlists(e),enabled:!!e}),o=(0,s.useCallback)(async()=>{e&&await i.invalidateQueries({queryKey:a.queryKeys.vocabulary.wordlists(e)})},[i,e]);return{data:l.data??null,isLoading:l.isLoading,isError:l.isError,error:l.error,invali
1date:o}},"useWordlistCategoriesQuery",0,function(e){let r=(0,t.useQuery)({queryKey:a.queryKeys.vocabulary.wordlistCategories(e),queryFn:async()=>n.Niche.wordlistCategories(e,0,!0,!1),enabled:!!e});return{categories:r.data??[],isLoading:r.isLoading}}])}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.