PageSourceSearch

https://falando.app/_next/static/chunks/26472-d76934be773bdd68.js

js falando.app collected 2026-09-24 14:09:06 UTC 25,552 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9324a923-04f3-40b0-b249-9a1fbf9a8322",e._sentryDebugIdIdentifier="sentry-dbid-9324a923-04f3-40b0-b249-9a1fbf9a8322")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[26472,28887],{20915:(e,t,r)=>{r.d(t,{r:()=>a});function a(e,t){let r=new Map(e.map(e=>[e.id,e]));for(let e of t)r.set(e.id,e);return Array.from(r.values())}},21347:(e,t,r)=>{r.d(t,{a:()=>n});var a=r(40585),l=r(61524);function o(e,t){return{...e??{},lastSync:t,lastDeltaCheckAt:new Date().toISOString()}}async function n(e){let t=(0,l.eF)(),r=e.lifetime?.persist??a.persistentSet;try{e.lifetime?.check();let t=await (e.lifetime?.read??a.persistentGet)(e.metaKey);e.lifetime?.check();let l=t?.lastSync;if(!l||function(e,t){if("admin"===t||!e?.lastDeltaCheckAt)return!1;let r=Date.parse(e.lastDeltaCheckAt);return Number.isFinite(r)&&Date.now()-r<9e5}(t,e.role))return;let n=await fetch(e.buildUrl(l)),i=await n.json();if(e.lifetime?.check(),!i?.success||!Array.isArray(i.data))return;if(i.data.length){let a=await e.processDelta(i.data);e.lifetime?.check();let l=e.applyToStore(a);await r(e.cacheKey,e.toCacheValue?e.toCacheValue(l):l,e.ttlMs),e.lifetime?.check(),await r(e.metaKey,o(t,new Date().toISOString()),e.ttlMs)}else await r(e.metaKey,o(t,l),e.ttlMs)}catch(t){e.onError(t)}finally{t()}}},24623:(e,t,r)=>{function a(e){return{id:e.id,level:e.level,portuguese:e.portuguese,english:e.english,pronunciation:e.pronunciation,ipa:e.ipa,localePronunciation:e.localePronunciation,partOfSpeech:e.partOfSpeech,gender:e.gender,frequency:e.frequency,synonymGroupId:e.synonymGroupId,isTop1000:e.isTop1000,explicit:e.explicit,verbInfo:e.verbInfo?{infinitive:e.verbInfo.infinitive,regular:e.verbInfo.regular}:void 0,imageAltAnswers:e.imageAltAnswers}}function l(e){return!!e&&!0!==e.isCatalogProjection}r.d(t,{Hk:()=>l,W0:()=>a,yx:()=>o});let o=["noun","verb","adjective","adverb","preposition","conjunction","interjection","phrase","idiom","numeral","pronoun","article","contraction","expression","determiner","discourse marker"]},26472:(e,t,r)=>{let a;r.r(t),r.d(t,{applyVocabTranslations:()=>k,useSupabaseVocabularyStore:()=>P,vocabularyResidency:()=>D});var l=r(43672),o=r(11699),n=r(61524),i=r(39686),s=r(40585),c=r(21347),u=r(62059);async function d(){let[{useSupabaseAuthStore:e},{useSupabaseSettingsStore:t}]=await Promise.all([Promise.resolve().then(r.bind(r,53584)),Promise.all([r.e(19720),r.e(52594),r.e(99492)]).then(r.bind(r,52594))]);return()=>{let{isAuthenticated:r,user:a}=e.getState();if(!r||!a)return null;let l=a.role,o="admin"===l||function(e){if(!e)return!1;let t=e instanceof Date?e:new Date(e);if(isNaN(t.getTime()))return!1;let r=new Date,a=r.getFullYear()-t.getFullYear(),l=r.getMonth()-t.getMonth();return(l<0||0===l&&r.getDate()<t.getDate())&&a--,a>=18}(a.dateOfBirth)&&!!t.getState().learning.explicitContent,n=(0,u.getClientLocale)(),i=a.id,s=l??"unknown";return{userId:i,role:l,roleKey:s,allowExplicit:o,locale:n,isFree:"free user"===l,key:JSON.stringify([i,s,n,o])}}}
1class p extends Error{constructor(){super("Vocabulary load cancelled")}}var f=r(41134);function y(e,t){let r=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=r.get(e.id);r.set(e.id,t?function(e,t){if(!0!==t.isCatalogProjection||!0===e.isCatalogProjection)return t;let r={examples:e.examples,audio:e.audio,origin:e.origin,imageAuditNote:e.imageAuditNote,imageAuditedAt:e.imageAuditedAt,imageColdNames:e.imageColdNames,imageProductionEligible:e.imageProductionEligible},{isCatalogProjection:a,...l}=t;return{...l,...r}}(t,e):e)}return Array.from(r.values())}var h=r(28887),g=r(89470),b=r(20915),v=r(16014),w=r(80567),m=r(24623),S=r(49723);let x=()=>new Date().toISOString(),L=(a=new WeakMap,(e,t,r)=>{if(r||0===e.length)return t;let l=a.get(e);l||(l=new WeakMap,a.set(e,l));let o=l.get(t);return o||(o=(0,b.r)(e,t),l.set(t,o)),o}),A=null;function W(e){return A?.source===e?A:A=(0,w.wr)(e)}function C(e){return L(e.catalogIndex,e.vocabularyWords,e.hasAllLoaded)}async function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,u.getClientLocale)();return(0,f.applyContentTranslations)(e,f.fetchVocabularyTranslations,(e,t)=>({...e,english:t.translation||e.english,localePronunciation:t.pronunciation??null,examples:null===t.examples||void 0===t.examples?e.examples:(0,v.d)(e.examples,t.examples)}),t)}async function F(e,t){return(0,f.applyContentTranslations)(e,f.fetchVocabularyIndexTranslations,(e,t)=>({...e,english:t.translation||e.english,localePronunciation:t.pronunciation??null}),t)}let I=function(e){let t,r=0,a=0,l=null,o=0,n=Promise.resolve();function i(e){let t=n.then(e);return n=t.then(()=>void 0,()=>void 0),t}function f(){r++,o=0,l=null,e.resetState()}return{reset:()=>(a++,f(),i(()=>(0,s.clearPersistentByPrefix)("falando:vocabulary:"))),persistResident(e,t,a){let l=r;return i(()=>l===r?(0,s.persistentSetConfirmed)(e,t,a):Promise.resolve(!1))},async run(y,h){let g,b=a,v=t?.()?.key,w=(0,u.getClientLocale)(),m=["all","user","search","level"].includes(y);try{let y,S,x,L;if(t??=await d(),b!==a||w!==(0,u.getClientLocale)()||void 0!==v&&v!==t()?.key)throw new p;let A=t();if(!A)return{success:!0,error:void 0};null!==l&&l!==A.key&&f(),l=A.key,y=r,S=()=>{if(y!==r||l!==A.key)throw new p;if(t?.()?.key!==A.key)throw f(),new p},x=async e=>{S();let t=await e();return S(),t},L={get:e=>i(()=>x(()=>(0,s.persistentGet)(e))),getStale:e=>i(()=>x(()=>(0,s.persistentGetStale)(e))),set:(e,t,r)=>i(()=>x(()=>(0,s.persistentSet)(e,t,r)))},g={scope:A,generation:y,check:S,read:x,cache:L,publish(t){S(),e.publish(t)},sync:e=>(0,c.a)({...e,lifetime:{check:S,read:L.get,persist:L.set},onError:t=>{t instanceof p||e.onError(t)}})},await g.read(()=>n),m&&(o++,e.publish({isLoading:!0,error:null}));let W=await h(g);return g.check(),W}catch(e){return{success:!1,error:e instanceof Error?e.message:"Failed to fetch vocabulary"}}finally{m&&g&&g.generation===r&&l===g.scope.key&&(o=Math.max(0,o-1),e.publish({isLoading:o>0}))}}}}({publish:e=>P.setState(e),resetState:()=>{D.reset(),P.setState({vocabularyWords:[],catalogIndex:[],hasIndexLoaded:!1,isLoading:!1,error:null,lastFetched:null,hasAllLoaded:!1,contentLocale:null}),A=null}}),P=(0,S.v)((e,t)=>(0,n.wl)({vocabularyWords:[],catalogIndex:[],hasIndexLoaded:!1,isLoading:!1,error:null,lastFetched:null,hasAllLoaded:!1,contentLocale:null,fetchCatalogIndex:()=>I.run("index",async e=>{let{userId:t,isFree:a,roleKey:o,allowExplicit:n,locale:i}=e.scope,c=(0,h.z)("vocabulary-index",t,o,{generation:e.generation,level:a?"A1":"all",locale:i,explicit:n?"1":"0"});return(0,h.deduplicateRequest)(c,async()=>{let c=(0,s.buildScopedKey)("vocabulary",{scope:"index",projection:"answers-v1",level:a?"A1":"all",uid:t,role:o,locale:i,explicit:n?"1":"0"}),u=t=>0!==t.length&&(e.publish({catalogIndex:t,hasIndexLoaded:!0,contentLocale:i}),!0);try{let d="u">typeof navigator&&!1===navigator.onLine,p=d?await e.cache.getStale(c):await e.cache.get(c);if(p&&u(n?p:p.filter(e=>!e.explicit)))return{success:!0};if(d){let{readOfflineApi:l}=await Promise.resolve().then(r.bind(r,93263)),{readActivePackage:d}=await Promise.resolve().then(r.bind(r,391)),p=await e.read(()=>d(t))?await e.read(()=>l("/api/vocabulary?shape=lean",{})):null;if(p){let t=p.data,r=await e.read(()=>F(t.filter(e=>n||!e.explicit).map(m.W0),i));if(u(r))return{success:!0}}
1let f=await e.cache.getStale((0,s.buildScopedKey)("vocabulary",{scope:"all",level:a?"A1":"all",uid:t,role:o,locale:i,explicit:n?"1":"0"}));if(f){let t=f.filter(e=>(!a||"A1"===e.level)&&(n||!e.explicit)).map(m.W0);if(u(t))return await e.cache.set(c,t,216e5),{success:!0}}let y=await e.cache.getStale((0,s.buildScopedKey)("vocabulary",{scope:"index",level:a?"A1":"all",uid:t,role:o,locale:i,explicit:n?"1":"0"}));throw y&&e.publish({catalogIndex:y,hasIndexLoaded:!1,contentLocale:i}),Error("Vocabulary answer index is not cached for offline use")}let f=new URLSearchParams({shape:"lean",locale:i});a&&f.set("level","A1");let y=await e.read(()=>(0,l.apiFetch)(`/api/vocabulary?${f}`))??[],h=a?y.filter(e=>"A1"===e.level):y;if(n||(h=h.filter(e=>!e.explicit)),!u(h))throw Error("Vocabulary index came back empty; refusing to cache it");return await e.cache.set(c,h,216e5),{success:!0}}catch(r){e.check();let t=r instanceof Error?r.message:"Failed to fetch vocabulary index";return console.error("Vocabulary Store: Error fetching catalog index:",t),{success:!1,error:t}}})}),fetchAllVocabulary:()=>I.run("all",async e=>{let{role:r,userId:a,isFree:o,roleKey:n,allowExplicit:i,locale:c}=e.scope;if(await e.read(()=>D.restore())&&"u">typeof navigator&&!1===navigator.onLine&&t().hasAllLoaded)return{success:!0};let u=(0,h.z)("vocabulary-all",a,n,{generation:e.generation,level:o?"A1":"all",locale:c,explicit:i?"1":"0"});return(0,h.deduplicateRequest)(u,async()=>{try{let u=(0,s.buildScopedKey)("vocabulary",{scope:"all",level:o?"A1":"all",uid:a,role:n,locale:c,explicit:i?"1":"0"}),d=await e.cache.get(u);if(d){let l=i?d:d.filter(e=>!e.explicit);return e.publish({vocabularyWords:l,error:null,lastFetched:new Date,hasAllLoaded:!0,contentLocale:c}),e.sync({metaKey:(0,s.buildScopedKey)("vocabulary",{scope:"meta",sub:"all",level:o?"A1":"all",uid:a,role:n,locale:c,explicit:i?"1":"0"}),cacheKey:u,ttlMs:216e5,role:r,buildUrl:e=>{let t=new URLSearchParams({locale:c});return o&&t.set("level","A1"),t.set("updated_since",e),`/api/vocabulary?${t}`},processDelta:async e=>{let t=o?e.filter(e=>"A1"===e.level):e;return i||(t=t.filter(e=>!e.explicit)),t},applyToStore:r=>{let a=y(t().vocabularyWords,r);return e.publish({vocabularyWords:a,lastFetched:new Date,contentLocale:c}),a},onError:e=>console.warn("Vocabulary Store: background delta failed",e)}),{success:!0}}let p=new URLSearchParams({locale:c});o&&p.set("level","A1");let f=`/api/vocabulary${p.toString()?`?${p.toString()}`:""}`,h=await e.read(()=>(0,l.apiFetch)(f))??[],g=o?h.filter(e=>"A1"===e.level):h;i||(g=g.filter(e=>!e.explicit)),e.publish({vocabularyWords:g,error:null,lastFetched:new Date,hasAllLoaded:!0,contentLocale:c}),await e.cache.set(u,g,216e5);let b=(0,s.buildScopedKey)("vocabulary",{scope:"meta",sub:"all",level:o?"A1":"all",uid:a,role:n,locale:c,explicit:i?"1":"0"});return await e.cache.set(b,{lastSync:x()},216e5),{success:!0}}catch(r){e.check();let t=r instanceof Error?r.message:"Failed to fetch vocabulary";return e.publish({error:t}),console.error("Vocabulary Store: Error fetching vocabulary:",r),{success:!1,error:t}}})}),fetchVocabularyForUser:()=>I.run("user",async e=>{let{userId:a,isFree:o,roleKey:n,allowExplicit:i,locale:c}=e.scope;await e.read(()=>D.restore());let{useSupabaseSRSStore:u}=await Promise.all([r.e(19720),r.e(35610),r.e(35920),r.e(52594),r.e(95256),r.e(69409),r.e(54623),r.e(75540),r.e(87018)]).then(r.bind(r,1573)),d=(0,h.z)("vocabulary-user",a,n,{generation:e.generation,scope:"srs-and-progress",locale:c,explicit:i?"1":"0"});return(0,h.deduplicateRequest)(d,async()=>{try{let r=(0,s.buildScopedKey)("vocabulary",{scope:"user",uid:a,role:n,locale:c,explicit:i?"1":"0"});if("u">typeof navigator&&!1===navigator.onLine){let a=await e.cache.getStale(r);if(a&&a.length>0){let r=i?a:a.filter(e=>!e.explicit),l=y(t().vocabularyWords,r);return e.publish({vocabularyWords:l,error:null,lastFetched:new Date,contentLocale:c}),{success:!0,error:void 0}}}let d=await e.cache.get(r);if(d){let r=i?d:d.filter(e=>!e.explicit),a=y(t().vocabularyWords,r);return e.publish({vocabularyWords:a,error:null,lastFetched:new Date,contentLocale:c}
1),{success:!0,error:void 0}}let{srsItems:p,userProgress:f}=u.getState(),h=p.filter(e=>e.userId===a&&"vocabulary"===e.type&&e.vocabularyId).map(e=>e.vocabularyId).filter(Boolean),g=f.filter(e=>e.userId===a&&e.vocabularyId).map(e=>e.vocabularyId).filter(Boolean),b=o?[...new Set([...h])]:[...new Set([...h,...g])];if(0===b.length)return e.publish({error:null,lastFetched:new Date}),await e.cache.set(r,[],216e5),{success:!0,error:void 0};let v=[];for(let t=0;t<b.length;t+=500){let r=b.slice(t,t+500),a=await e.read(()=>(0,l.apiFetch)("/api/vocabulary",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:r})}));v=v.concat(a)}i||(v=v.filter(e=>!e.explicit)),v=await e.read(()=>k(v,c));let w=y(t().vocabularyWords,v);e.publish({vocabularyWords:w,error:null,lastFetched:new Date,contentLocale:c}),await e.cache.set(r,v,216e5);let m=(0,s.buildScopedKey)("vocabulary",{scope:"meta",sub:"user",uid:a,role:n,locale:c,explicit:i?"1":"0"});return await e.cache.set(m,{lastSync:x()},216e5),{success:!0,error:void 0}}catch(r){e.check();let t=r instanceof Error?r.message:"Unknown error";return console.error("Vocabulary Store: Error in fetchVocabularyForUser:",r),e.publish({error:t}),{success:!1,error:t}}})}),fetchVocabularyBySearch:(e,r)=>I.run("search",async a=>{let{userId:o,roleKey:n,allowExplicit:i,locale:s}=a.scope;await a.read(()=>D.restore());let c=(0,g.oz)(e);if(!c)return{success:!0,error:void 0};let u=r&&r.length>0?r:void 0,d=(0,h.z)("vocabulary-search",o,n,{generation:a.generation,query:c,levels:u?.join(",")||"all",locale:s,explicit:i?"1":"0"});return(0,h.deduplicateRequest)(d,async()=>{try{let r=new URLSearchParams({locale:s});r.set("search",e),u&&u.length>0&&u.forEach(e=>r.append("level",e));let o=await a.read(()=>(0,l.apiFetch)(`/api/vocabulary?${r}`));if(u&&u.length>0&&(o=o.filter(e=>u.includes(e.level))),i||(o=o.filter(e=>!e.explicit)),o.length>0){let e=y(t().vocabularyWords,o);a.publish({vocabularyWords:e,error:null,lastFetched:new Date,contentLocale:s})}else a.publish({contentLocale:s});return{success:!0,error:void 0}}catch(t){a.check();let e=t instanceof Error?t.message:"Unknown error";return console.error("Vocabulary Store: Error in fetchVocabularyBySearch:",t),a.publish({error:e}),{success:!1,error:e}}})}),fetchVocabularyByLevel:(e,r)=>I.run("level",async a=>{let{role:o,userId:n,isFree:i,roleKey:c,allowExplicit:u,locale:d}=a.scope;await a.read(()=>D.restore());try{let p=i?"A1":e,f=(0,s.buildScopedKey)("vocabulary",{scope:"level",level:p,pos:r,uid:n,role:c,locale:d,explicit:u?"1":"0"}),h=await a.cache.get(f);if(h){let{vocabularyWords:e}=t(),l=u?h:h.filter(e=>!e.explicit),g=y(e,l);return a.publish({vocabularyWords:g,error:null,lastFetched:new Date,contentLocale:d}),a.sync({metaKey:(0,s.buildScopedKey)("vocabulary",{scope:"meta",sub:"level",level:p,pos:r,uid:n,role:c,locale:d,explicit:u?"1":"0"}),cacheKey:f,ttlMs:216e5,role:o,buildUrl:e=>{let t=new URLSearchParams({level:p,locale:d});return r&&t.append("partOfSpeech",r),t.set("updated_since",e),`/api/vocabulary?${t}`},processDelta:async e=>{let t=i?e.filter(e=>"A1"===e.level):e;return u||(t=t.filter(e=>!e.explicit)),t},applyToStore:e=>{let r=y(t().vocabularyWords,e);return a.publish({vocabularyWords:r,lastFetched:new Date,contentLocale:d}),r},toCacheValue:e=>e.filter(e=>e.level===p&&(!r||e.partOfSpeech===r)),onError:e=>console.warn("Vocabulary Store: background level delta failed",e)}),{success:!0}}let g=new URLSearchParams({level:p,locale:d});r&&g.append("partOfSpeech",r);let b=await a.read(()=>(0,l.apiFetch)(`/api/vocabulary?${g}`))??[];i&&(b=b.filter(e=>"A1"===e.level)),u||(b=b.filter(e=>!e.explicit));let{vocabularyWords:v}=t(),w=y(v,b);a.publish({vocabularyWords:w,error:null,lastFetched:new Date,contentLocale:d}),await a.cache.set(f,b,216e5);let m=(0,s.buildScopedKey)("vocabulary",{scope:"meta",sub:"level",level:p,pos:r,uid:n,role:c,locale:d,explicit:u?"1":"0"});return await a.cache.set(m,{lastSync:x()},216e5),{success:!0}}catch(t){a.check();let e=t instanceof Error?t.message:"Failed to fetch vocabulary";return a.publish({error:e}),console.error("Vocabulary Store: Error fetching vocabulary by level:",t),{success:!1,error:e}}}),fetchVocabularyById:e=>I.run("id",async a=>
1{let{userId:o,isFree:n,roleKey:i,allowExplicit:c,locale:u}=a.scope;if(await a.read(()=>D.restore())&&"u">typeof navigator&&!1===navigator.onLine){let r=t().vocabularyWords.find(t=>t.id===e);if(r)return{success:!0,data:r}}try{let d=(0,s.buildScopedKey)("vocabulary",{scope:"id",id:e,uid:o,role:i,locale:u,explicit:c?"1":"0"}),p=await a.cache.get(d);if(p){if(!c&&p.explicit)return{success:!1,error:"Access restricted to explicit content"};let{vocabularyWords:r}=t(),l=r.findIndex(t=>t.id===e);if(l>=0){let e=[...r];e[l]=p,a.publish({vocabularyWords:e,contentLocale:u})}else a.publish({vocabularyWords:[...r,p],contentLocale:u});return{success:!0,data:p}}let f=await a.read(()=>(0,l.apiFetch)(`/api/vocabulary/${e}`)),[y]=await a.read(()=>k([f],u));if(f=y||f,!c&&f.explicit)return{success:!1,error:"Access restricted to explicit content"};if(n&&"A1"!==f.level)try{let{useSupabaseSRSStore:t}=await Promise.all([r.e(19720),r.e(35610),r.e(35920),r.e(52594),r.e(95256),r.e(69409),r.e(54623),r.e(75540),r.e(87018)]).then(r.bind(r,1573)),a=t.getState(),l=a.srsItems.some(t=>t.userId===o&&"vocabulary"===t.type&&t.vocabularyId===e),n=a.srsItems.some(t=>t.userId===o&&"vocabulary"===t.type&&t.vocabularyId===e&&t.forMistakeReview);if(!l&&!n)return{success:!1,error:"Access restricted to A1 for free users"}}catch(e){return a.check(),console.warn("SRS membership check failed; denying non-A1 fetch for free user:",e),{success:!1,error:"Access restricted to A1 for free users"}}let{vocabularyWords:h}=t(),g=h.findIndex(t=>t.id===e);if(g>=0){let e=[...h];e[g]=f,a.publish({vocabularyWords:e,contentLocale:u})}else a.publish({vocabularyWords:[...h,f],contentLocale:u});return await a.cache.set(d,f,216e5),{success:!0,data:f}}catch(t){a.check();let e=t instanceof Error?t.message:"Failed to fetch vocabulary";return console.error("Vocabulary Store: Error fetching vocabulary by ID:",t),{success:!1,error:e}}}),fetchVocabularyByIds:e=>I.run("ids",async r=>{let{locale:a}=r.scope;if(await r.read(()=>D.restore())&&"u">typeof navigator&&!1===navigator.onLine){let r=t().vocabularyWords.filter(t=>e.includes(t.id));if(new Set(r.map(e=>e.id)).size===new Set(e).size)return{success:!0,data:r}}if(!e.length)return{success:!0,data:[]};try{let o=await r.read(()=>(0,l.apiFetch)("/api/vocabulary",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}));o=await r.read(()=>k(o,a));let{vocabularyWords:n}=t(),i=y(n,o);return r.publish({vocabularyWords:i,contentLocale:a}),{success:!0,data:o}}catch(e){return r.check(),{success:!1,error:e instanceof Error?e.message:"Failed to fetch vocabulary"}}}),fetchSynonyms:(e,r)=>I.run("synonyms",async a=>{let{locale:o}=a.scope;if(await a.read(()=>D.restore()),!e)return{success:!0,data:[]};try{let n=new URLSearchParams({groupId:e});r&&n.set("excludeId",r);let i=await a.read(()=>(0,l.apiFetch)(`/api/vocabulary/synonyms?${n.toString()}`))??[];i=await a.read(()=>k(i,o));let{vocabularyWords:s}=t();return a.publish({vocabularyWords:y(s,i),contentLocale:o}),{success:!0,data:i}}catch(e){return a.check(),{success:!1,error:e instanceof Error?e.message:"Failed to fetch synonyms"}}}),getVocabularyByLevel:e=>{let{vocabularyWords:r}=t();return"Mixed"===e?r:"EX"===e?r.filter(t=>t.level===e&&!t.explicit):r.filter(t=>t.level===e)},getVocabularyWordById:e=>{let{vocabularyWords:r}=t();return r.find(t=>t.id===e)},getVocabularyWordByPortuguese:e=>(0,w.nD)(W(C(t())),e)[0],getVocabularyWordsByPortugueseAll:e=>(0,w.nD)(W(C(t())),e).slice(),getVocabularyWordsByPortuguesePrioritized:e=>(0,w.WO)(W(C(t())),e),getVocabularyWordsByInflectedForm:e=>(0,w.dy)(W(C(t())),e),getAllVocabularyWords:()=>{let{vocabularyWords:e}=t();return e},getVocabularyCandidateWords:()=>{let{catalogIndex:e,vocabularyWords:r,hasAllLoaded:a,hasIndexLoaded:l}=t();return L(l?e:[],r,a)},getTop1000Words:()=>{let{vocabularyWords:e}=t();return e.filter(e=>e.isTop1000)},getVocabularyByPartOfSpeech:e=>{let{vocabularyWords:r}=t();return r.filter(t=>t.partOfSpeech===e)},getVocabularyByLevelAndPartOfSpeech:(e,r)=>{let{vocabularyWords:a}=t();return a.filter(t=>t.level===e&&t.partOfSpeech===r)},getAllTags:()=>{let{vocabularyWords:e}=t(),r=new Set;
1return e.forEach(e=>{e.tags&&(Array.isArray(e.tags)?e.tags.forEach(e=>{if(e&&e.trim()){let t=e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();r.add(t)}}):console.warn("Non-array tags found:",e.tags,typeof e.tags))}),Array.from(r).sort()},clearCache:()=>{I.reset().catch(e=>console.warn("clearCache persistent failed",e))},refreshCache:async()=>{await I.reset();let[e,r]=await Promise.all([t().fetchCatalogIndex(),t().fetchVocabularyForUser()]);return r.success?r:e}})),D=(0,o.k)({persist:I.persistResident,key:()=>(0,i.D)("vocabulary"),snapshot:()=>{let{vocabularyWords:e,hasAllLoaded:t,contentLocale:r,lastFetched:a}=P.getState();return{vocabularyWords:e,hasAllLoaded:t,contentLocale:r,lastFetched:a}},canRelease:e=>e.vocabularyWords.length>500&&e.contentLocale===(0,u.getClientLocale)()&&!P.getState().isLoading,isUnchanged:e=>e.vocabularyWords===P.getState().vocabularyWords&&!P.getState().isLoading,release:()=>{A=null,P.setState({vocabularyWords:[],hasAllLoaded:!1})},restore:e=>P.setState({...e,vocabularyWords:y(e.vocabularyWords,P.getState().vocabularyWords)})})},28887:(e,t,r)=>{r.d(t,{deduplicateRequest:()=>n,z:()=>i});var a=r(78219);class l{pendingRequests=new Map;TIMEOUT_MS=3e4;async deduplicate(e,t){this.cleanup();let r=this.pendingRequests.get(e);if(r)return a.a.warn(`🔄 Request deduplication: Reusing pending request for key: ${e}`),r.promise;a.a.warn(`🚀 Request deduplication: Starting new request for key: ${e}`);let l=t().finally(()=>{this.pendingRequests.delete(e)});return this.pendingRequests.set(e,{promise:l,timestamp:Date.now()}),l}cleanup(){let e=Date.now();for(let[t,r]of this.pendingRequests.entries())e-r.timestamp>this.TIMEOUT_MS&&(a.a.warn(`⚠️ Request deduplication: Cleaning up expired request for key: ${t}`),this.pendingRequests.delete(t))}clear(){this.pendingRequests.clear()}getPendingCount(){return this.pendingRequests.size}getPendingKeys(){return Array.from(this.pendingRequests.keys())}}let o=new l;function n(e,t){return o.deduplicate(e,t)}function i(e,t,r,a){let l=`${e}:${t}:${r}`;if(!a)return l;let o=Object.entries(a).sort((e,t)=>{let[r]=e,[a]=t;return r.localeCompare(a)}).map(e=>{let[t,r]=e;return`${t}=${r}`}).join("&");return`${l}:${o}`}},80567:(e,t,r)=>{r.d(t,{WO:()=>f,dy:()=>d,ew:()=>y,nD:()=>u,wr:()=>c});var a=r(98832),l=r(99970);let o=new Map([["por","por"],["p\xf4r","p\xf4r"]]),n=[];function i(e){let t=String(e??"").toLowerCase().trim();try{return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}catch{return t}}function s(e,t,r){let a=e.get(t);a?a.push(r):e.set(t,[r])}function c(e){let t=new Map,r=new Map;for(let a of e){let e=a.portuguese?.toLowerCase().trim();if(!e)continue;s(t,e,a);let l=i(e);l&&s(r,l,a)}return{source:e,exact:t,stripped:r}}function u(e,t){let r=t.normalize("NFC").toLowerCase().trim(),a=e.exact.get(r);if(a)return a;if(o.has(r)||r.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC")!==r)return n;let l=i(r);return l&&e.stripped.get(l)||n}function d(e,t){if(!e.inflected)for(let t of(e.inflected=new Map,e.source))for(let r of(0,a.h)(t))s(e.inflected,r,t);let r=t.normalize("NFC").trim().toLowerCase(),o=new Map;for(let t of(0,l.$)(r))for(let a of e.inflected.get(t)??[])(t===r||"verb"===a.partOfSpeech)&&o.set(a.id,a);return[...o.values()]}let p={A1:1,A2:2,B1:3,B2:4,C1:5,C2:6,EX:7,Mixed:100};function f(e,t){let r=t.toLowerCase().trim(),a=o.get(r);if(a)return(e.exact.get(a)||n).slice();var l=u(e,t);if(l.length<=1)return l.slice();let i=1/0;return l.forEach(e=>{let t=p[e.level]??100;t<i&&(i=t)}),l.filter(e=>(p[e.level]??100)===i)}function y(e,t){return{getVocabularyWordByPortuguese:t=>u(e,t)[0],getVocabularyWordsByPortuguesePrioritized:t=>f(e,t),getVocabularyWordsByInflectedForm:t=>d(e,t),getVerbById:t}}},89470:(e,t,r)=>{r.d(t,{R:()=>c,oz:()=>i});var a=r(27722),l=r(16070),o=r(98832),n=r(99970);function i(e){return(0,a.d1)(e).replace(/[^\p{L}\p{N}]+/gu,"")}let s=new WeakMap;function c(e){let t=e.trim(),r=t.length>=2&&(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")),a=r?t.slice(1,-1):t,c=i(a),u=(0,n.$)(a).map(i),d=e=>{if(!c||!(0,l.df)(e))return 1/0;let t=[e.portuguese,e.english,e.pronunciation].map(i);if(t.some(e=>e===c))return 0;let a=function(e){let t=s.get(e);if(t)return t;let r=new Set([...(0,o.h)(e)].map(i));return s.set(e,r),r}(e);if(a.has(c)||"verb"===e.partOfSpeech&&u.some(e=>a.has(e)))return 1;if(!r){if(t.some(e=>e.startsWith(c)))return 2;if(t.some(e=>e.includes(c)))return 3}return 1/0};return{term:c,rank:d,matches:e=>Number.isFinite(d(e))}}},98832:(e,t,r)=>{r.d(t,{h:()=>s});var a=r(16070),l=r(73785),o=r(81316),n=r(72661);let i=new WeakMap;function s(e){let t=i.get(e);if(t)return t;let r=new Set([e.portuguese.normalize("NFC").trim().toLowerCase()]),s=e=>{e&&r.add(e.normalize("NFC").trim().toLowerCase())},c=(0,o.Nt)(e);if(c)for(let e of c)s(e);else if("verb"===e.partOfSpeech){let t=e.portuguese.normalize("NFC").toLowerCase().trim().replace(/-se$/,"");if(/(ar|er|ir)$/.test(t)||l.RH.has(t)){let e=(0,l.LM)(t);if(e){for(let t of Object.values(e.byTense))for(let e of Object.values(t))e&&s(e);for(let t of Object.values(e.nonFinite))s(t);let r=[e.nonFinite.participle];for(let e of(new Set(["aceitar","acender","entregar","eleger","gan
1har","gastar","pagar","limpar","prender","suspender","salvar","expulsar","soltar"]).has(t)&&r.push(t.slice(0,-2)+(t.endsWith("ar")?"ado":"ido")),r))for(let t of[e,(0,a.iS)(e)])for(let e of(s(t),(0,a.xM)(t,!0)))s(e)}}}else{for(let t of(0,a.KA)(e))s(t.form);for(let t of n.p[e.portuguese.normalize("NFC").trim().toLowerCase()]??[])s(t.form)}return i.set(e,r),r}}}]);

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.