varbT=Object.create;varUl=Object.defineProperty;var_T=Object.getOwnPropertyDescriptor;varET=Object.getOwnPropertyNames;varvT=Object.getPrototypeOf,xT=Object.prototype.hasOwnProperty;varC=(e,t)=>()=>(e&&(t=e(e=0)),t);varka=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_n=(e,t)=>{for(varrint)Ul(e,r,{get:t[r],enumerable:!0})},Yg=(e,t,r,n)=>{if(t&&typeoft=="object"||typeoft=="function")for(letiofET(t))!xT.call(e,i)&&i!==r&&Ul(e,i,{get:()=>t[i],enumerable:!(n=_T(t,i))||n.enumerable});returne};varQn=(e,t,r)=>(r=e!=null?bT(vT(e)):{},Yg(t||!e||!e.__esModule?Ul(r,"default",{value:e,enumerable:!0}):r,e)),eh=e=>Yg(Ul({},"__esModule",{value:!0}),e);varKg=C(()=>{});varAi=C(()=>{Kg();typeofwindow<"u"&&((window.__svelte??={}).v??=newSet).add("5")});varUi,Tt,En,$l,Fo,th,ft=C(()=>{Ui={},Tt=Symbol("uninitialized"),En=Symbol("filename"),$l="http://www.w3.org/1999/xhtml",Fo="http://www.w3.org/2000/svg",th="http://www.w3.org/1998/Math/MathML"});varYl,Qg=C(()=>{Yl=!0});varWg,G,Gg=C(()=>{Wg=globalThis.process?.env?.NODE_ENV,G=Wg&&!Wg.toLowerCase().startsWith("prod")});varVg=C(()=>{});varXe=C(()=>{Qg();Gg();Vg()});functionGu(e){returntypeofe=="function"}functionJg(e){returne()}functionTs(e){for(vart=0;t<e.length;t++)e[t]()}functionQl(){vare,t,r=newPromise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}vargi,qg,Wu,ys,rh,br,Rr,Kl,nh,zg,Ra,ih,Mt,st=C(()=>{gi=Array.isArray,qg=Array.prototype.indexOf,Wu=Array.prototype.includes,ys=Array.from,rh=Object.keys,br=Object.defineProperty,Rr=Object.getOwnPropertyDescriptor,Kl=Object.getOwnPropertyDescriptors,nh=Object.prototype,zg=Array.prototype,Ra=Object.getPrototypeOf,ih=Object.isExtensible;Mt=()=>{}});vartr,ws,jg,Wl,Gl,Po,Mo,Ho,Vu,uh,lu,ah,Oa,Dn,Ve=C(()=>{tr=Symbol("$state"),ws=Symbol("legacy props"),jg=Symbol(""),Wl=Symbol("proxy path"),Gl=Symbol("attributes"),Po=Symbol("class"),Mo=Symbol("style"),Ho=Symbol("text"),Vu=Symbol("form reset"),uh=Symbol("hmr anchor"),lu=newclassextendsError{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ah=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),Oa=3,Dn=8});functionZg(e){if(G){lett=newError(`invariant_violation
An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${e}"
https://svelte.dev/e/lifecycle_outside_component`);throwt.name="Svelte error",t}elsethrownewError("https://svelte.dev/e/lifecycle_outside_component")}varUo=C(()=>{Xe()});functione1(){if(G){lete=newError("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/async_derived_orphan")}functionsh(){if(G){lete=newError("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/bind_invalid_checkbox_value")}functiont1(){if(G){lete=newError(`derived_references_self
Keyed each block has key that is not idempotent \u2014 the key for item at index ${e} was \`${t}\` but is now \`${r}\`. Keys must be the same each time for a given item
\`${e}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throwt.name="Svelte error",t}elsethrownewError("https://svelte.dev/e/effect_in_teardown")}functioni1(){if(G){lete=newError("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/effect_in_unowned_derived")}functionu1(e){if(G){lett=newError(`effect_orphan
\`${e}\` can only be used inside an effect (e.g. during component initialisation)
https://svelte.dev/e/rune_outside_svelte`);throwt.name="Svelte error",t}elsethrownewError("https://svelte.dev/e/rune_outside_svelte")}functionl1(){if(G){lete=newError("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/state_descriptors_fixed")}functionf1(){if(G){lete=newError("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/state_prototype_fixed")}functiond1(){if(G){lete=newError("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/state_unsafe_mutation")}functionh1(){if(G){lete=newError("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/svelte_boundary_reset_onerror")}var_r=C(()=>{Xe();Uo()});functionp1(e){G?console.warn(`%c[svelte] await_reactivity_loss
%cAn async derived, \`${e}\` (${t}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
%cThe \`${e}\` attribute on \`${t}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value
%c${e?`The value of an \`{@html ...}\` block ${e} changed between server and client renders. The client value will be ignored in favour of the server value`:"The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}
%c${e?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${e}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results
https://svelte.dev/e/state_proxy_unmount`,$i,Yi):console.warn("https://svelte.dev/e/state_proxy_unmount")}functionv1(){G?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",$i,Yi):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var$i,Yi,fr=C(()=>{Xe();$i="font-weight: bold",Yi="font-weight: normal"});functionGt(e){de=e}functionct(e){if(e===null)throwqu(),Ui;returnke=e}functionrr(){returnct(vr(ke))}functionEe(e){if(de){if(vr(ke)!==null)throwqu(),Ui;ke=e}}functionBr(e=1){if(de){for(vart=e,r=ke;t--;)r=vr(r);ke=r}}functionbi(e=!0){for(vart=0,r=ke;;){if(r.nodeType===Dn){varn=r.data;if(n==="]"){if(t===0)returnr;t-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}vari=vr(r);e&&r.remove(),r=i}}functionDs(e){if(!e||e.nodeType!==Dn)throwqu(),Ui;returne.data}varde,ke,gt=C(()=>{Ve();ft();fr();nr();de=!1});functionql(e){returne===this.v}function$o(e,t){returne!=e?t==t:e!==t||e!==null&&typeofe=="object"||typeofe=="function"}functionzl(e){return!$o(e,this.v)}varYo=C(()=>{});functionx1(){Ki=!0}varir,Ki,_i,cn=C(()=>{ir=!1,Ki=!1,_i=!1});varch=C(()=>{Xe()});varks=C(()=>{Xe();ch();st()});functionGr(e,t){returne.label=t,jl(e.v,t),e}functionjl(e,t){returne?.[Wl]?.(t),e}varKo,zu=C(()=>{ft();ks();Ve();Be();Ke();Ko=null});functionEi(e){lett=newError,r=TT();returnr.length===0?null:(r.unshift(`
`),n=[];for(leti=0;i<r.length;i++){letu=r[i],o=u.replaceAll("\\","/");if(u.trim()!=="Error"){if(u.includes("validate_each_keys"))return[];o.includes("svelte/src/internal")||o.includes("node_modules/.vite")||n.push(u)}}returnn}functionT1(e,t){if(!G)thrownewError("invariant(...) was not guarded by if (DEV)");e||Zg(t)}varBa=C(()=>{Xe();st();Uo()});functiondu(e){Ue=e}functionRs(e){Qi=e}functionZl(e){kn=e}functiondr(e,t=!1,r){Ue={p:Ue,i:!1,c:null,e:null,s:e,x:null,r:fe,l:Ki&&!t?{s:null,u:null,$:[]}:null},G&&(Ue.function=r,kn=r)}functionhr(e){vart=Ue,r=t.e;if(r!==null){t.e=null;for(varnofr)lh(n)}returne!==void0&&(t.x=e),t.i=!0,Ue=t.p,G&&(kn=Ue?.function??null),e??{}}functionWi(){return!Ki||Ue!==null&&Ue.l===null}varUe,Qi,kn,Bt=C(()=>{Xe();_r();Ke();Be();cn();ft();Ve();Ue=null;Qi=null;kn=null});functionw1(){vare=La;La=[],Ts(e)}functionHt(e){if(La.length===0&&!Fa){vart=La;queueMicrotask(()=>{t===La&&w1()})}La.push(e)}functionI1(){for(;La.length>0;)w1()}varLa,Gn=C(()=>{st();Lr();La=[]});functionXl(e){vart=fe;if(t===null)returnSe.f|=8388608,e;if(G&&einstanceofError&&!fh.has(e)&&fh.set(e,wT(e,t)),(t.f&32768)===0&&(t.f&4)===0)throwG&&!t.parent&&einstanceofError&&C1(e),e;xi(e,t)}functionxi(e,t){if(!(t!==null&&(t.f&16384)!==0)){for(;t!==null;){if((t.f&128)!==0){if((t.f&32768)===0)throwe;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throwG&&einstanceofError&&C1(e),e}}functionwT(e,t){letr=Rr(e,"message");if(!(r&&!r.configurable)){for(varn=Go?" ":" ",i=`
Enablethisoptiontocompletelyhidethem.`).addToggle(i=>i.setValue(t.hideExcluded).onChange(async u=>{t.hideExcluded=u,await He(e)})),new Mn.Setting(r).setName("Folders to downrank in search results").setDesc("Folders to downrank in search results. Files in these folders will be downranked in results. They will still be indexed for tags, unlike excluded files. Folders should be comma delimited.").addText(i=>{i.setValue(t.downrankedFoldersFilters.join(",")).setPlaceholder("Example: src,p2/dir").onChange(async u=>{let o=u.split(",");o=o.map(c=>c.trim()),t.downrankedFoldersFilters=o,await He(e)})}),new Mn.Setting(r).setName("Split CamelCaseWords").setDesc(Kt(`EnablethisifyouwanttobeabletosearchforCamelCaseWordsasseparatewords.<br/>
Wordsshorterthan3characterswon't be used as prefixes; this can reduce search delay but will return fewer results.`).addToggle(i=>i.setValue(t.simpleSearch).onChange(async u=>{t.simpleSearch=u,await He(e)})),Mn.Platform.isIosApp||new Mn.Setting(r).setName("Tokenize URLs").setDesc(`Enable this if you want to be able to search for URLs as separate words.
This setting has a strong impact on indexing performance, and can crash Obsidian under certain conditions.`).addToggle(i=>i.setValue(t.tokenizeUrls).onChange(async u=>{t.tokenizeUrls=u,await He(e)})),new Mn.Setting(r).setName("Set Vim like navigation keys").setDesc(`Navigate down the results with ${Jn()} + J/N, or navigate up with ${Jn()} + K/P.`).addToggle(i=>i.setValue(t.vimLikeNavigationShortcut).onChange(async u=>{t.vimLikeNavigationShortcut=u,await He(e)})),new Mn.Setting(r).setName("Fuzziness").setDesc("Define the level of fuzziness for the search. The higher the fuzziness, the more results you'llget.").addDropdown(i=>i.addOptions({0:"Exactmatch",1:"Nottoofuzzy",2:"Fuzzyenough"}).setValue(t.fuzziness).onChange(async u=>{["0","1","2"].includes(u)||(u="2"),t.fuzziness=u,await He(e)}))}var Mn,H_=C(()=>{Mn=require("obsidian");Hr();Ri()});function U_(e,t,r){let n=e.database;new ru.Setting(r).setName("DangerZone").setHeading(),new ru.Setting(r).setName("Ignorediacritics").setDesc(Kt(`Normalize diacritics in search terms. Words like "br\xFBl\xE9e" or "\u017Elu\u0165ou\u010Dk\xFD" will be indexed as "brulee" and "zlutoucky".<br/>
${Ws}`)).addToggle(u=>u.setValue(t.ignoreDiacritics).onChange(async o=>{await n.clearCache(),t.ignoreDiacritics=o,await He(e)})),new ru.Setting(r).setName("IgnoreArabicdiacritics(beta)").addToggle(u=>u.setValue(t.ignoreArabicDiacritics).onChange(async o=>{await n.clearCache(),t.ignoreArabicDiacritics=o,await He(e)}));let i=Kt(`Disable Omnisearch on this device only.<br>
${Ws}`);new ru.Setting(r).setName("Disableonthisdevice").setDesc(i).addToggle(u=>u.setValue(Uf(e.app)).onChange(async o=>{o?(e.app.saveLocalStorage(ts,"1"),new ru.Notice("Omnisearch-Disabled.PleaserestartObsidian.")):(e.app.saveLocalStorage(ts),new ru.Notice("Omnisearch-Enabled.PleaserestartObsidian."))})),new ru.Setting(r).setName("Forcesavethecache").setDesc(Kt(`Omnisearch has a security feature that automatically disables cache writing if it cannot fully perform the operation.<br>
\u26A0\uFE0F <span style="color:var(--text-accent)">Enabling this setting could lead to crash loops</span>`)).addToggle(u=>u.setValue(t.DANGER_forceSaveCache).onChange(async o=>{t.DANGER_forceSaveCache=o,await He(e)})),wu()&&new ru.Setting(r).setName("Clearcachedata").setDesc(Kt(`Erase all Omnisearch cache data.
${Ws}`)).addButton(u=>{u.setButtonText("Clearcache"),u.onClick(async()=>{await n.clearCache()})})}var ru,$_=C(()=>{ru=require("obsidian");wn();Ri()});function Y_(e,t,r){ns.Platform.isMobile||(new ns.Setting(r).setName("APIAccessThroughHTTP").setHeading().setDesc(Kt('Omnisearch can be used through a simple HTTP server (<a href="https://publish.obsidian.md/omnisearch/Public+API+%26+URL+Scheme#HTTP+Server">more information</a>).')),new ns.Setting(r).setName("Enable the HTTP server").addToggle(n=>n.setValue(t.httpApiEnabled).onChange(async i=>{t.httpApiEnabled=i,i?e.apiHttpServer.listen(t.httpApiPort):e.apiHttpServer.close(),await He(e)})),new ns.Setting(r).setName("HTTP Port").addText(n=>{n.setValue(t.httpApiPort).setPlaceholder("51361").onChange(async i=>{parseInt(i)>65535&&(i=t.httpApiPort,n.setValue(t.httpApiPort)),t.httpApiPort=i,t.httpApiEnabled&&(e.apiHttpServer.close(),e.apiHttpServer.listen(t.httpApiPort)),await He(e)})}),new ns.Setting(r).setName("Show a notification when the server starts").setDesc("Will display a notification if the server is enabled, at Obsidian startup.").addToggle(n=>n.setValue(t.httpApiNotice).onChange(async i=>{t.httpApiNotice=i,await He(e)})))}var ns,K_=C(()=>{ns=require("obsidian");Ri()});function Q_(e,t,r){let n=e.getTextExtractor(),i=e.getAIImageAnalyzer(),u=e.database,o=(0,Zn.debounce)(async()=>{await u.clearCache()},1e3);new Zn.Setting(r).setName("Indexing").setHeading().setDesc(Kt(`<div style="margin-top: 1em; color: var(--text-accent)">\u26A0\uFE0F Changing indexing settings will clear the cache, and requires a restart of Obsidian.</div><br/>
${n?`\u{1F44D} You have installed <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a>, Omnisearch can use it to index PDFs and images contents.
<br />Text extraction only works on desktop, but the cache can be synchronized with your mobile device.`:'\u26A0\uFE0F Omnisearch requires <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a> to index PDFs and images.'}
${i?'<br/>\u{1F44D} You have installed <a href="https://github.com/Swaggeroo/obsidian-ai-image-analyzer">AI Image Analyzer</a>, Omnisearch can use it to index images contents with AI.':'<br/>\u26A0\uFE0F Omnisearch requires <a href="https://github.com/Swaggeroo/obsidian-ai-image-analyzer">AI Image Analyzer</a> to index images with AI.'}`)),new Zn.Setting(r).setName(`PDFscontentindexing${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(Kt("Omnisearch will use Text Extractor to index the content of your PDFs.")).addToggle(p=>p.setValue(t.PDFIndexing).onChange(async A=>{await u.clearCache(),t.PDFIndexing=A,await He(e)})).setDisabled(!n),new Zn.Setting(r).setName(`ImagesOCRindexing${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(Kt("Omnisearch will use Text Extractor to OCR your images and index their content.")).addToggle(p=>p.setValue(t.imagesIndexing).onChange(async A=>{await u.clearCache(),t.imagesIndexing=A,await He(e)})).setDisabled(!n);let c=Kt('Omnisearch will use Text Extractor to index the content of your office documents (currently <pre style="display:inline">.docx</pre> and <pre style="display:inline">.xlsx</pre>).');new Zn.Setting(r).setName(`Documentscontentindexing${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(c).addToggle(p=>p.setValue(t.officeIndexing).onChange(async A=>{await u.clearCache(),t.officeIndexing=A,await He(e)})).setDisabled(!n);let d=Kt(`OmnisearchwilluseAIImageAnalyzertoindexthecontentofyourimageswithAI.<br/>
\u26A0\uFE0F<spanstyle="color: var(--text-accent)">IfbothAIImageAnalyzerandTextExtractorareenabled,TextExtractorwillonlybeusedasafallback.</span>`);new Zn.Setting(r).setName(`Images AI indexing ${i?"":"\u26A0\uFE0F Disabled"}`).setDesc(d).addToggle(p=>p.setValue(t.aiImageIndexing).onChange(async A=>{await u.clearCache(),t.aiImageIndexing=A,await He(e)})).setDisabled(!i),new Zn.Setting(r).setName("Index paths of unsupported files").setDesc(Kt(`
"Obsidian setting"willrespectthevalueof"Files & Links > Detect all file extensions".`)).addDropdown(p=>{p.addOptions({yes:"Yes",no:"No",default:"Obsidian setting"}).setValue(t.unsupportedFilesIndexing).onChange(async A=>{await o(),t.unsupportedFilesIndexing=A,await He(e)})}),new Zn.Setting(r).setName("Set frontmatter property key as title").setDesc(Kt(`Ifyouhaveacustompropertyinyournotesthatyouwanttouseasthetitleinsearchresults.Ifyousetthisto'#heading',thenusethefirstheadingfromafileasthetitle.<br>
Leaveemptytodisable.`)).addText(p=>{p.setValue(t.displayTitle).onChange(async A=>{await o(),t.displayTitle=A,await He(e)})}),new Zn.Setting(r).setName("Additional TEXT files to index").setDesc(Kt(`Inadditiontostandard<code>md</code> files, Omnisearch can also index other <strong style="color: var(--text-accent)">PLAINTEXT</strong> files.<br/>
becauseOmnisearchwilltrytoindextheircontent.</span>`)).addText(p=>{p.setValue(t.indexedFileTypes.join(" ")).setPlaceholder("Example: txt org csv").onChange(async A=>{await u.clearCache(),t.indexedFileTypes=A.split(" "),await He(e)})}),new Zn.Setting(r).setName("Index files without extension").setDesc(Kt(`Enable this to also index files that have <strong style="color: var(--text-accent)">no file extension</strong>.<br/>
Thesefileswillbeindexedasplaintextfiles.`)).addToggle(p=>{p.setValue(t.indexFilesWithoutExtension).onChange(async A=>{await u.clearCache(),t.indexFilesWithoutExtension=A,await He(e)})})}var Zn,W_=C(()=>{Zn=require("obsidian");Ri()});function G_(e,t,r){new ua.Setting(r).setName("User Interface").setHeading(),new ua.Setting(r).setName("Show ribbon button").setDesc("Add a button on the sidebar to open the Vault search modal.").addToggle(n=>n.setValue(t.ribbonIcon).onChange(async i=>{t.ribbonIcon=i,await He(e),i?e.addRibbonButton():e.removeRibbonButton()})),new ua.Setting(r).setName("Show excerpts").setDesc("Shows the contextual part of the note that matches the search. Disable this to only show filenames in results.").addToggle(n=>n.setValue(t.showExcerpt).onChange(async i=>{aa.set(i)})),new ua.Setting(r).setName("Show embed references").setDesc(Kt(`Someresultsare<ahref="https://help.obsidian.md/Linking+notes+and+files/Embed+files">embedded</a> in other notes.<br>
AlsoworkswithTextExtractorforembeddedimagesanddocuments.`)).addSlider(n=>{n.setLimits(0,10,1).setValue(t.maxEmbeds).setDynamicTooltip().onChange(async i=>{t.maxEmbeds=i,await He(e)})}),new ua.Setting(r).setName("Render line return in excerpts").setDesc("Activate this option to render line returns in result excerpts.").addToggle(n=>n.setValue(t.renderLineReturnInExcerpts).onChange(async i=>{t.renderLineReturnInExcerpts=i,await He(e)})),new ua.Setting(r).setName('Show "Create note" button').setDesc(Kt(`Showsabuttonnexttothesearchinput,tocreateanote.
Actsthesameasthe<code>shift\u21B5</code> shortcut, can be useful for mobile device users.`)).addToggle(n=>n.setValue(t.showCreateButton).onChange(async i=>{t.showCreateButton=i,await He(e)})),new ua.Setting(r).setName("Highlight matching words in results").setDesc("Will highlight matching results when enabled. See README for more customization options.").addToggle(n=>n.setValue(t.highlight).onChange(async i=>{t.highlight=i,await He(e)}))}var ua,V_=C(()=>{ua=require("obsidian");Gs();Ri()});function z_(e,t,r,n){function i(o,c){o.setLimits(1,10,.5).setValue(t[c]).setDynamicTooltip().onChange(async d=>{t[c]=d,await He(e)})}let u=wc(e.app);new Xn.Setting(r).setName("Results weighting").setHeading(),new Xn.Setting(r).setName(`File name & declared aliases (default: ${u.weightBasename})`).addSlider(o=>i(o,"weightBasename")),new Xn.Setting(r).setName(`File directory (default: ${u.weightDirectory})`).addSlider(o=>i(o,"weightDirectory")),new Xn.Setting(r).setName(`Headings level 1 (default: ${u.weightH1})`).addSlider(o=>i(o,"weightH1")),new Xn.Setting(r).setName(`Headings level 2 (default: ${u.weightH2})`).addSlider(o=>i(o,"weightH2")),new Xn.Setting(r).setName(`Headings level 3 (default: ${u.weightH3})`).addSlider(o=>i(o,"weightH3")),new Xn.Setting(r).setName(`Tags (default: ${u.weightUnmarkedTags})`).addSlider(o=>i(o,"weightUnmarkedTags")),new Xn.Setting(r).setName("Header properties fields").setDesc('You can set custom weights for values of header properties (e.g. "keywords"). Weights under 1.0 will downrank the results.');for(let o=0;o<t.weightCustomProperties.length;o++){let c=t.weightCustomProperties[o],d=new Xn.Setting(r).setName((o+1).toString()+".");d.settingEl.style.paddingLeft="2em",d.addText(p=>{p.setPlaceholder("Property name").setValue(c.name).onChange(async A=>{c.name=A,await He(e)})}).addSlider(p=>{p.setLimits(.1,5,.1).setValue(c.weight).setDynamicTooltip().onChange(async A=>{c.weight=A,await He(e)})}).addButton(p=>{p.setButtonText("Remove"),p.onClick(async()=>{t.weightCustomProperties.splice(o,1),await He(e),n()})})}new Xn.Setting(r).addButton(o=>{o.setButtonText("Add a new property"),o.onClick(c=>{t.weightCustomProperties.push({name:"",weight:1}),n()})}),new Xn.Setting(r).setName("Recency boost (experimental)").setDesc("Files that have been modified more recently than [selected cutoff] are given a higher rank.").addDropdown(o=>o.addOptions({"0":"Disabled","1":"24 hours","2":"7 days","3":"30 days"}).setValue(t.recencyBoost).onChange(async c=>{t.recencyBoost=c,await He(e)}))}var Xn,J_=C(()=>{Xn=require("obsidian");wn();Gs();Ri()});function wc(e){return{useCache:!0,hideExcluded:!1,recencyBoost:"0",downrankedFoldersFilters:[],ignoreDiacritics:!0,ignoreArabicDiacritics:!1,indexedFileTypes:[],indexFilesWithoutExtension:!1,displayTitle:"",PDFIndexing:!1,officeIndexing:!1,imagesIndexing:!1,aiImageIndexing:!1,unsupportedFilesIndexing:"default",splitCamelCase:!1,vimLikeNavigationShortcut:e.vault.getConfig("vimMode"),ribbonIcon:!0,showExcerpt:!0,maxEmbeds:5,renderLineReturnInExcerpts:!0,showCreateButton:!1,highlight:!0,showPreviousQueryResults:!0,simpleSearch:!1,tokenizeUrls:!1,fuzziness:"1",weightBasename:10,weightDirectory:7,weightH1:6,weightH2:5,weightH3:4,weightUnmarkedTags:2,weightCustomProperties:[],httpApiEnabled:!1,httpApiPort:"51361",httpApiNotice:!0,welcomeMessage:"",verboseLogging:!1,DANGER_httpHost:null,DANGER_forceSaveCache:!1}}async function j_(e){return Xr=Object.assign({},wc(e.app),await e.loadData()),aa.set(Xr.showExcerpt),xp(Xr.verboseLogging),Xr}var Ic,aa,$f,Xr,Gs=C(()=>{Ic=require("obsidian");Ap();wn();Hr();H_();$_();K_();W_();V_();J_();Ri();aa=Ls(!1),$f=class extends Ic.PluginSettingTab{constructor(t){super(t.app,t),this.plugin=t,aa.subscribe(async r=>{Xr.showExcerpt=r,await He(this.plugin)})}display(){let{containerEl:t}=this;if(t.empty(),this.app.loadLocalStorage(ts)=="1"){let o=t.createEl("span"),c=document.createElement("strong");c.style.color="var(--text-accent)",c.textContent="\u26A0\uFE0F OMNISEARCH IS DISABLED \u26A0\uFE0F",o.appendChild(c)}t.createEl("h1",{text:"Omnisearch"});let
`,"<br>")),t}catch(i){return new lE.Notice("Omnisearch - Error while creating excerpt, see developer console"),console.error("Omnisearch - Error while creating excerpt"),console.error(i),""}}}});async function fE(e){let t=e.app;if(!t.plugins.getPlugin("obsidian-icon-folder"))return{};let n=`${t.vault.configDir}/plugins/obsidian-icon-folder/data.json`;try{let i=await t.vault.adapter.read(n),u=JSON.parse(i),o={};for(let c in u){let d=(0,qs.normalizePath)(c);o[d]=u[c]}return o}catch(i){return ki("Failed to read data.json:",i),{}}}async function dE(e){let t={Li:"lucide-icons"},r="icons",n=e.app,i=n.plugins.getPlugin("obsidian-icon-folder");if(i){r=i.settings?.iconPacksPath||"icons";let o=`${n.vault.configDir}/${r}`;try{let c=await n.vault.adapter.list(o);if(c.folders&&c.folders.length>0)for(let d of c.folders){let p=d.split("/"),A=p[p.length-1],g=jw(A);t[g]=A}}catch(c){ki("Failed to list icon packs:",c)}}return{prefixToIconPack:t,iconsPath:r}}function jw(e){if(e.includes("-")){let t=e.split("-"),r=t[0].charAt(0).toUpperCase();for(let n=1;n<t.length;n++)r+=t[n].charAt(0).toLowerCase();return r}return e.charAt(0).toUpperCase()+e.charAt(1).toLowerCase()}function Sp(e,t){let r=(0,qs.normalizePath)(e),n=t[r];if(n){if(typeof n=="string")return n;if(typeof n=="object"&&n.iconName)return n.iconName}return null}function Zw(e){let t=e.match(/^[A-Z][a-z]*/);if(t){let r=t[0],n=e.substring(r.length);return{prefix:r,name:n}}else return{prefix:"",name:e}}async function Np(e,t,r,n){let i=Zw(e),{prefix:u,name:o}=i;if(!u)return`<spanclass="omnisearch-result__icon--emoji">${Kf(o)}</span>`;let c=n[u];if(!c)return ki(`No icon pack found for prefix: ${u}`),null;if(c==="lucide-icons"){let d=o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),p=(0,qs.getIcon)(d);returnp?p.outerHTML:(ki(`Lucide icon not found: ${d}`),null)}else{if(!r)returnki("Icons path is not set. Cannot load icon SVG."),null;letd=`${t.app.vault.configDir}/${r}/${c}/${o}.svg`;try{returnawaitt.app.vault.adapter.read(d)}catch(p){returnki(`Failed to load icon SVG for ${e} at ${d}:`,p),null}}}functionDp(e){lett="file";e==="folder"?t="folder":jn(e)?t="image":Di(e)?t="file-text":(tu(e)||gc(e)||rs(e))&&(t="layout-dashboard");letr=(0,qs.getIcon)(t);returnr?r.outerHTML:""}varqs,hE=C(()=>{qs=require("obsidian");Hr();Cp()});functionkp(e,t){dr(t,!1);letr=()=>Vo(aa,"$showExcerpt",n),[n,i]=qo(),u=et(),o=et(),c=et(),d=et(),p=ze(t,"selected",8,!1),A=ze(t,"note",8),g=ze(t,"plugin",8),_=et(null),v=et(""),w=et(""),D={},L=et(null),Q=et(null),H={},se,ce=et(!1),me=et([]);Ja(async()=>{D=awaitfE(g());letat=awaitdE(g());H=at.prefixToIconPack,se=at.iconsPath,ie(ce,!0)});asyncfunctionve(){letat=Sp(B(w),D);at?ie(L,awaitNp(at,g(),se,H)):ie(L,Dp("folder"));letot=Sp(A().path,D);ot?ie(Q,awaitNp(ot,g(),se,H)):ie(Q,Dp(A().path))}functionle(at,ot){let_t=newDOMParser,kt=_t.parseFromString(ot,"image/svg+xml").documentElement;returnat.appendChild(kt),{update(Ft){letO=_t.parseFromString(Ft,"image/svg+xml").documentElement;at.replaceChild(O,kt),kt=O},destroy(){at.firstElementChild&&at.removeChild(at.firstElementChild)}}}letQe=null,je=null,$e=et(null);sr(()=>(Pe(A()),B(ce),Ac),()=>{A()&&A().path&&B(ce)&&(async()=>(ie(v,A().displayTitle||A().basename),ie(w,Ac(A().path)),awaitve()))()}),sr(()=>(jn,Pe(A()),Pe(g()),Oi.TFile),()=>{if(ie(_,null),jn(A().path)){letat=g().app.vault.getAbstractFileByPath(A().path);atinstanceofOi.TFile&&ie(_,g().app.vault.getResourcePath(at))}}),sr(()=>(Pe(A()),Ac,Oi.setIcon,jn,Di,tu,gc,rs,B($e)),()=>{ie(v,A().displayTitle||A().basename),ie(w,Ac(A().path)),Qe&&(0,Oi.setIcon)(Qe,"folder-open"),je&&(jn(A().path)?(0,Oi.setIcon)(je,"image"):Di(A().path)?(0,Oi.setIcon)(je,"file-text"):tu(A().path)||gc(A().path)||rs(A().path)?(0,Oi.setIcon)(je,"layout-dashboard"):(0,Oi.setIcon)(je,"file")),B($e)&&(0,Oi.setIcon)(B($e),"corner-down-right")}),sr(()=>(Pe(g()),B(v),Pe(A())),()=>{ie(u,g().textProcessor.getMatches(B(v),A().foundWords))}),sr(()=>(Pe(g()),B(w),Pe(A())),()=>{ie(o,g().textProcessor.getMatches(B(w),A().foundWords))}),sr(()=>(Pe(A()),Pe(g())),()=>{A().matches.length>0
Inordertobeiterable,non-arrayobjectsmusthavea[Symbol.iterator]()method.`)}var Le=!0,We=!1,ht;return{s:function(){q=q.call(O)},n:function(){var Qt=q.next();return Le=Qt.done,Qt},e:function(Qt){We=!0,ht=Qt},f:function(){try{!Le&&q.return!=null&&q.return()}finally{if(We)throw ht}}}}function p(O,Y){if(O){if(typeof O=="string")return A(O,Y);var q=Object.prototype.toString.call(O).slice(8,-1);if(q==="Object"&&O.constructor&&(q=O.constructor.name),q==="Map"||q==="Set")return Array.from(O);if(q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(q))return A(O,Y)}}function A(O,Y){(Y==null||Y>O.length)&&(Y=O.length);for(var q=0,re=new Array(Y);q<Y;q++)re[q]=O[q];return re}function g(O,Y){if(!(O instanceof Y))throw new TypeError("Cannot call a class as a function")}function _(O,Y){for(var q=0;q<Y.length;q++){var re=Y[q];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(O,re.key,re)}}function v(O,Y,q){return Y&&_(O.prototype,Y),q&&_(O,q),Object.defineProperty(O,"prototype",{writable:!1}),O}function w(O,Y,q){return Y in O?Object.defineProperty(O,Y,{value:q,enumerable:!0,configurable:!0,writable:!0}):O[Y]=q,O}function D(O,Y,q){L(O,Y),Y.set(O,q)}function L(O,Y){if(Y.has(O))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Q(O,Y){var q=ce(O,Y,"get");return H(O,q)}function H(O,Y){return Y.get?Y.get.call(O):Y.value}function se(O,Y,q){var re=ce(O,Y,"set");return me(O,re,q),q}function ce(O,Y,q){if(!Y.has(O))throw new TypeError("attempted to "+q+" private field on non-instance");return Y.get(O)}function me(O,Y,q){if(Y.set)Y.set.call(O,q);else{if(!Y.writable)throw new TypeError("attempted to set read only private field");Y.value=q}}var ve=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",le=new WeakMap,Qe=new WeakMap,je=(function(){function O(Y){var q=Y.executor,re=q===void 0?function(){}:q,Ye=Y.internals,Le=Ye===void 0?Ie():Ye,We=Y.promise,ht=We===void 0?new Promise(function(Rt,Qt){return re(Rt,Qt,function(Zt){Le.onCancelList.push(Zt)})}):We;g(this,O),D(this,le,{writable:!0,value:void 0}),D(this,Qe,{writable:!0,value:void 0}),w(this,ve,"CancelablePromise"),this.cancel=this.cancel.bind(this),se(this,le,Le),se(this,Qe,ht||new Promise(function(Rt,Qt){return re(Rt,Qt,function(Zt){Le.onCancelList.push(Zt)})}))}return v(O,[{key:"then",value:function(q,re){return kt(Q(this,Qe).then(Et(q,Q(this,le)),Et(re,Q(this,le))),Q(this,le))}},{key:"catch",value:function(q){return kt(Q(this,Qe).catch(Et(q,Q(this,le))),Q(this,le))}},{key:"finally",value:function(q,re){var Ye=this;return re&&Q(this,le).onCancelList.push(q),kt(Q(this,Qe).finally(Et(function(){if(q)return re&&(Q(Ye,le).onCancelList=Q(Ye,le).onCancelList.filter(function(Le){return Le!==q})),q()},Q(this,le))),Q(this,le))}},{key:"cancel",value:function(){Q(this,le).isCanceled=!0;var q=Q(this,le).onCancelList;Q(this,le).onCancelList=[];var re=d(q),Ye;try{for(re.s();!(Ye=re.n()).done;){var Le=Ye.value;if(typeof Le=="function")try{Le()}catch(We){console.error(We)}}}catch(We){re.e(We)}finally{re.f()}}},{key:"isCanceled",value:function(){return Q(this,le).isCanceled===!0}}]),O})(),$e=(function(O){t(q,O);var Y=n(q);function q(re){return g(this,q),Y.call(this,{executor:re})}return v(q)})(je);e.CancelablePromise=$e,w($e,"all",function(Y){return Ft(Y,Promise.all(Y))}),w($e,"allSettled",function(Y){return Ft(Y,Promise.allSettled(Y))}),w($e,"any",function(Y){return Ft(Y,Promise.any(Y))}),w($e,"race",function(Y){return Ft(Y,Promise.race(Y))}),w($e,"resolve",function(Y){return ot(Promise.resolve(Y))}),w($e,"reject",function(Y){return ot(Promise.reject(Y))}),w($e,"isCancelable",_t);var at=$e;e.default=at;function ot(O){return kt(O,Ie())}function _t(O){return O instanceof $e||O instanceof je}function Et(O,Y){if(O)return function(q){if(!Y.isCanceled){var re=O(q);return _t(re)&&Y.onCancelList.push(re.cancel),re}return q}}function kt(O,Y){return new je({internals:Y,promise:O})}function Ft(O,Y){var q=Ie();return q.onCancelList.push(function(){var re=d(O),Ye;try{for(re.s();!(Ye=re.n()).done;){var L
characters.</span>`,1),b6=Me("We found 0 results for your search here. <!>",1),_6=Me('<!> <div style="text-align: center;"><!></div>',1),E6=Me('<div class="prompt-instruction"><span class="prompt-instruction-command">hold</span> <span>to open in a new pane</span></div>'),v6=Me('<!> <!> <!> <div class="prompt-instructions"><div class="prompt-instruction"><span class="prompt-instruction-command">\u2191\u2193</span><span>to navigate</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to cycle history</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"></span> <span>to open</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command">Tab</span> <span>to switch to In-File Search</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open in a new pane</span></div> <!> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open in a new split</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open in the background</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"></span> <span>to create</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to create in a new pane</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to insert a link</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to toggle excerpts</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command">Esc</span><span>to close</span></div></div>',1);xf(["click"])});functionFp(e,t){dr(t,!1);letr=et(),n=ze(t,"plugin",8),i=ze(t,"offset",8),u=ze(t,"note",8),o=ze(t,"index",8,0),c=ze(t,"selected",8,!1);sr(()=>(Pe(n()),Pe(u()),Pe(i())),()=>{ie(r,n().textProcessor.makeExcerpt(u()?.content??"",i()))}),Ci(),mn();{letd=Bn(()=>(Pe(o()),Te(()=>o().toString())));Cc(e,{getid(){returnB(d)},getselected(){returnc()},$$events:{auxclick(p){Mr.call(this,t,p)},click(p){Mr.call(this,t,p)},longpress(p){Mr.call(this,t,p)},mousemove(p){Mr.call(this,t,p)}},children:(p,A)=>{varg=x6();Za(g,()=>(Pe(n()),B(r),Pe(u()),Te(()=>n().textProcessor.highlightText(B(r),u().matches))),!0),Ee(g),we(p,g)},$$slots:{default:!0}})}hr()}varx6,SE=C(()=>{Ai();Zi();Pn();Ip();x6=Me('<div class="omnisearch-result__body"></div>')});functionPp(e,t){dr(t,!1);letr=ze(t,"plugin",8),n=ze(t,"modal",8),i=ze(t,"parent",8,null),u=ze(t,"singleFilePath",8,""),o=ze(t,"previousQuery",8),c=et(),d=et([]),p=et(0),A=et(),g=et();Ja(()=>{Ge.enable("infile"),Ge.on("infile","enter",H),Ge.on("infile","open-in-new-pane",L),Ge.on("infile","arrow-up",()=>w(-1)),Ge.on("infile","arrow-down",()=>w(1)),Ge.on("infile","tab",se)}),Sf(()=>{Ge.disable("infile")});function_(Ie){letO=[],Y=-1,q=0;for(;++q<100;){letre=v(Ie,Y,mc);if(!re.length)break;Y=re.last().offset,O.push(re)}returnO}functionv(Ie,O,Y){letq=Ie.find(re=>re.offset>O);returnq?Ie.filter(re=>re.offset>O&&re.offset<=q.offset+Y):[]}functionw(Ie){ie(p,Ff(B(p)+Ie,B(d).length)),D()}asyncfunctionD(){awaitSi(),document.querySelector(`[data-result-id="${B(p)}"]`)?.scrollIntoView({behavior:"auto",block:"nearest"})}asyncfunctionL(){returnH(!0)}asyncfunctionQ(Ie){returnH(Mf(Ie))}asyncfunctionH(Ie=!1){if(B(A)){n().close(),i()&&i().close();letO=B(d)[B(p)]??0;awaitHf(r(),B(A),O,Ie)}}functionse(){newCu(r(),B(c)??o()).open(),n().close()}sr(()=>Pe(o()),()=>{ie(c,o()??"")}),sr(()=>(B(c),B(g),Iu,Pe(r()),Pe(u())),()=>{(async()=>(B(c)&&(ie(g,newIu(B(c),{ignoreDiacritics:r().settings.ignoreDiacritics,ignoreArabicDiacritics:r().settings.ignoreArabicDiacritics})),ie(A,(awaitr().searchEngine.getSuggestions(B(g),{singleFilePath:u()}))[0]??null)),ie(p,0),awaitD()))()}),sr(()=>(B(A),B(g)),()=>{if(B(A)){letIe=_(B(A).matches),O=B(g).getExactTerms();O.length&&(Ie=Ie.filter(Y=>O.every(q=>Y.some(re=>re.match.includes(q))))),ie(d,Ie.ma
`,e=e.substring(me.length+1),g=ve.slice(w)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(o=!0)),i.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(A),loose:!1,text:A,tokens:[]}),i.raw+=p}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let d of i.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let p=d.tokens[0];if(d.task&&(p?.type==="text"||p?.type==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}let A=this.rules.other.listTaskCheckbox.exec(d.raw);if(A){let g={type:"checkbox",raw:A[0]+" ",checked:A[0]!=="[ ]"};d.checked=g.checked,i.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=g.raw+d.tokens[0].raw,d.tokens[0].text=g.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(g)):d.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):d.tokens.unshift(g)}}else d.task&&(d.task=!1);if(!i.loose){let A=d.tokens.filter(_=>_.type==="space"),g=A.length>0&&A.some(_=>this.rules.other.anyLine.test(_.raw));i.loose=g}}if(i.loose)for(let d of i.items){d.loose=!0;for(let p of d.tokens)p.type==="text"&&(p.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let r=T2(t[0]);return{type:"html",block:!0,raw:r,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:r}}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:sa(t[0],`
`),header:[],align:[],rows:[]};if(r.length===n.length){for(let o of n)this.rules.other.tableAlignRight.test(o)?u.align.push("right"):this.rules.other.tableAlignCenter.test(o)?u.align.push("center"):this.rules.other.tableAlignLeft.test(o)?u.align.push("left"):u.align.push(null);for(let o=0;o<r.length;o++)u.header.push({text:r[o],tokens:this.lexer.inline(r[o]),header:!0,align:u.align[o]});for(let o of i)u.rows.push(y2(o,u.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:u.align[d]})));return u}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let r=t[1].trim();return{type:"heading",raw:sa(t[0],`
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(u);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}returnthis.state.top=!0,r}inline(t,r=[]){returnthis.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){this.tokenizer.lexer=this;letn=t;if(this.tokens.links){letc=Object.keys(this.tokens.links);c.length>0&&(n=n.replace(this.tokenizer.rules.inline.reflinkSearch,d=>c.includes(d.slice(d.lastIndexOf("[")+1,-1))?"["+"a".repeat(d.length-2)+"]":d))}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),n=n.replace(this.tokenizer.rules.inline.blockSkip,(c,d,p)=>{letA=p?p.length:0;returnc.slice(0,A)+"["+"a".repeat(c.length-A-2)+"]"}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;leti=!1,u="",o=1/0;for(;t;){if(t.length<o)o=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}i||(u=""),i=!1;letc;if(this.options.extensions?.inline?.some(p=>(c=p.call({lexer:this},t,r))?(t=t.substring(c.raw.length),r.push(c),!0):!1))continue;if(c=this.tokenizer.escape(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.tag(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.link(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(c.raw.length);letp=r.at(-1);c.type==="text"&&p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):r.push(c);continue}if(c=this.tokenizer.emStrong(t,n,u)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.codespan(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.br(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.del(t,n,u)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.autolink(t)){t=t.substring(c.raw.length),r.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(t))){t=t.substring(c.raw.length),r.push(c);continue}letd=t;if(this.options.extensions?.startInline){letp=1/0,A=t.slice(1),g;this.options.extensions.startInline.forEach(_=>{g=_.call({lexer:this},A),typeofg=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(d=t.substring(0,p+1))}if(c=this.tokenizer.inlineText(d)){t=t.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(u=c.raw.slice(-1)),i=!0;letp=r.at(-1);p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):r.push(c);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}returnr}infiniteLoopError(t){letr="Infinite loop on byte: "+t;if(this.options.silent)console.error(r);elsethrownewError(r)}},Bc=class{options;parser;constructor(e){this.options=e||oa}space(e){return""}code({text:e,lang:t,escaped:r}){letn=(t||"").match(en.notSpaceStart)?.[0],i=e.replace(en.endingNewline,"")+`
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${nu(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){letn=this.parser.parseInline(r),i=x2(e);if(i===null)returnn;e=i;letu='<a href="'+e+'"';returnt&&(u+=' title="'+nu(t)+'"'),u+=">"+n+"</a>",u}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));leti=x2(e);if(i===null)returnnu(r);e=i;letu=`<img src="${e}" alt="${nu(r)}"`;returnt&&(u+=` title="${nu(t)}"`),u+=">",u}text(e){return"tokens"ine&&e.tokens?this.parser.parseInline(e.tokens):"escaped"ine&&e.escaped?e.text:nu(e.text)}},s0=class{strong({text:e}){returne}em({text:e}){returne}codespan({text:e}){returne}del({text:e}){returne}html({text:e}){returne}text({text:e}){returne}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){returne}},ti=classim{options;renderer;textRenderer;constructor(t){this.options=t||oa,this.options.renderer=this.options.renderer||newBc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=news0}staticparse(t,r){returnnewim(r).parse(t)}staticparseInline(t,r){returnnewim(r).parseInline(t)}parse(t){this.renderer.parser=this;letr="";for(letn=0;n<t.length;n++){leti=t[n];if(this.options.extensions?.renderers?.[i.type]){leto=i,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){r+=c||"";continue}}letu=i;switch(u.type){case"space":{r+=this.renderer.space(u);break}case"hr":{r+=this.renderer.hr(u);break}case"heading":{r+=this.renderer.heading(u);break}case"code":{r+=this.renderer.code(u);break}case"table":{r+=this.renderer.table(u);break}case"blockquote":{r+=this.renderer.blockquote(u);break}case"list":{r+=this.renderer.list(u);break}case"checkbox":{r+=this.renderer.checkbox(u);break}case"html":{r+=this.renderer.html(u);break}case"def":{r+=this.renderer.def(u);break}case"paragraph":{r+=this.renderer.paragraph(u);break}case"text":{r+=this.renderer.text(u);break}default:{leto='Token with "'+u.type+'" type was not found.';if(this.options.silent)returnconsole.error(o),"";thrownewError(o)}}}returnr}parseInline(t,r=this.renderer){this.renderer.parser=this;letn="";for(leti=0;i<t.length;i++){letu=t[i];if(this.options.extensions?.renderers?.[u.type]){letc=this.options.extensions.renderers[u.type].call({parser:this},u);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){n+=c||"";continue}}leto=u;switch(o.type){case"escape":{n+=r.text(o);break}case"html":{n+=r.html(o);break}case"link":{n+=r.link(o);break}case"image":{n+=r.image(o);break}case"checkbox":{n+=r.checkbox(o);break}case"strong":{n+=r.strong(o);break}case"em":{n+=r.em(o);break}case"codespan":{n+=r.codespan(o);break}case"br":{n+=r.br(o);break}case"del":{n+=r.del(o);break}case"text":{n+=r.text(o);break}default:{letc='Token with "'+o.type+'" type was not found.';if(this.options.silent)returnconsole.error(c),"";thrownewError(c)}}}returnn}},Zs=class{options;block;constructor(e){this.options=e||oa}staticpassThroughHooks=newSet(["preprocess","postprocess","processAllTokens","emStrongMask"]);staticpassThroughHooksRespectAsync=newSet(["preprocess","postprocess","processAllTokens"]);preprocess(e){returne}postprocess(e){returne}processAllTokens(e){returne}emStrongMask(e){returne}provideLexer(e=this.block){returne?ei.lex:ei.lexInline}provideParser(e=this.block){returne?ti.parse:ti.parseInline}},F2=class{defaults=i0();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ti;Renderer=Bc;TextRenderer=s0;Lexer=ei;Tokenizer=Oc;Hooks=Zs;constructor(...e){this.use(...e)}walkTokens(e,t){letr=[];for(letnofe)switch(r=r.concat(t.call(this,n)),n.type){case"table":
)`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}});functiongA(e,t){returne===si.default.falseFunc?si.default.falseFunc:r=>t.isTag(r)&&e(r)}functionbA(e,t){letr=t.getSiblings(e);if(r.length<=1)return[];letn=r.indexOf(e);returnn<0||n===r.length-1?[]:r.slice(n+1).filter(t.isTag)}functionmA(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}varsi,AA,pA,R0,O0=C(()=>{si=Qn(ha(),1);lA();AA={};pA=(e,t,r,n,i)=>{letu=i(t,mA(r),n);returnu===si.default.trueFunc?e:u===si.default.falseFunc?si.default.falseFunc:o=>u(o)&&e(o)},R0={is:pA,matches:pA,where:pA,not(e,t,r,n,i){letu=i(t,mA(r),n);returnu===si.default.falseFunc?e:u===si.default.trueFunc?si.default.falseFunc:o=>!u(o)&&e(o)},has(e,t,r,n,i){let{adapter:u}=r,o=mA(r);o.relativeSelector=!0;letc=t.some(A=>A.some(Jc))?[AA]:void0,d=i(t,o,c);if(d===si.default.falseFunc)returnsi.default.falseFunc;letp=gA(d,u);if(c&&d!==si.default.trueFunc){let{shouldTestNextSiblings:A=!1}=d;returng=>{if(!e(g))return!1;c[0]=g;let_=u.getChildren(g),v=A?[..._,...bA(g,u)]:_;returnu.existsOne(p,v)}}returnA=>e(A)&&u.existsOne(p,u.getChildren(A))}}});functionXv(e,t,r,n,i){varu;let{name:o,data:c}=t;if(Array.isArray(c)){if(!(oinR0))thrownewError(`Unknown pseudo-class :${o}(${c})`);returnR0[o](e,c,r,n,i)}letd=(u=r.pseudos)===null||u===void0?void0:u[o],p=typeofd=="string"?d:k0[o];if(typeofp=="string"){if(c!=null)thrownewError(`Pseudo ${o} doesn't have any arguments`);letA=Ru(p);returnR0.is(e,A,r,n,i)}if(typeofd=="function")returnhA(d,o,c,1),A=>d(A,c)&&e(A);if(oinpo)returnpo[o](e,c,r,n);if(oinZc){letA=Zc[o];returnhA(A,o,c,2),g=>A(g,r,c)&&e(g)}thrownewError(`Unknown pseudo-class :${o}`)}var_A=C(()=>{fo();Jv();jv();Zv();O0()});functionEA(e,t){letr=t.getParent(e);returnr&&t.isTag(r)?r:null}functionex(e,t,r,n,i){let{adapter:u,equals:o}=r;switch(t.type){case_e.PseudoElement:thrownewError("Pseudo-elements are not supported by css-select");case_e.ColumnCombinator:thrownewError("Column combinators are not yet supported by css-select");case_e.Attribute:{if(t.namespace!=null)thrownewError("Namespaced attributes are not yet supported by css-select");return(!r.xmlMode||r.lowerCaseAttributeNames)&&(t.name=t.name.toLowerCase()),Yv[t.action](e,t,r)}case_e.Pseudo:returnXv(e,t,r,n,i);case_e.Tag:{if(t.namespace!=null)thrownewError("Namespaced tag names are not yet supported by css-select");let{name:c}=t;return(!r.xmlMode||r.lowerCaseTags)&&(c=c.toLowerCase()),function(p){returnu.getName(p)===c&&e(p)}}case_e.Descendant:{if(r.cacheResults===!1||typeofWeakSet>"u")returnfunction(p){letA=p;for(;A=EA(A,u);)if(e(A))return!0;return!1};letc=newWeakSet;returnfunction(p){letA=p;for(;A=EA(A,u);)if(!c.has(A)){if(u.isTag(A)&&e(A))return!0;c.add(A)}return!1}}case"_flexibleDescendant":returnfunction(d){letp=d;doif(e(p))return!0;while(p=EA(p,u));return!1};case_e.Parent:returnfunction(d){returnu.getChildren(d).some(p=>u.isTag(p)&&e(p))};case_e.Child:returnfunction(d){letp=u.getParent(d);returnp!=null&&u.isTag(p)&&e(p)};case_e.Sibling:returnfunction(d){letp=u.getSiblings(d);for(letA=0;A<p.length;A++){letg=p[A];if(o(d,g))break;if(u.isTag(g)&&e(g))return!0}return!1};case_e.Adjacent:returnu.prevElementSibling?function(d){letp=u.prevElementSibling(d);returnp!=null&&e(p)}:funct
`)})):{name:i,value:u.replace(wx,`\r
`)}}).toArray()}var Tx,TS,wx,Ix=C(()=>{$r();Tx="input,select,textarea,keygen",TS=/%20/g,wx=/\r?\n/g});var HA={};_n(HA,{extract:()=>SS});function CS(e){var t;return typeof e=="string"?{selector:e,value:"textContent"}:{selector:e.selector,value:(t=e.value)!==null&&t!==void 0?t:"textContent"}}function SS(e){let t={};for(let r in e){let n=e[r],i=Array.isArray(n),{selector:u,value:o}=CS(i?n[0]:n),c=typeof o=="function"?o:typeof o=="string"?d=>this._make(d).prop(o):d=>this._make(d).extract(o);if(i)t[r]=this._findBySelector(u,Number.POSITIVE_INFINITY).map((d,p)=>c(p,r,t)).get();else{let d=this._findBySelector(u,1);t[r]=d.length>0?c(d[0],r,t):void 0}}return t}var Cx=C(()=>{});var Aa,Sx=C(()=>{Ov();Ax();Ex();yx();Ix();Cx();Aa=class{constructor(t,r,n){if(this.length=0,this.options=n,this._root=r,t){for(let i=0;i<t.length;i++)this[i]=t[i];this.length=t.length}}};Aa.prototype.cheerio="[cheerio object]";Aa.prototype.splice=Array.prototype.splice;Aa.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator];Object.assign(Aa.prototype,aA,BA,FA,PA,MA,HA)});function Nx(e,t){return function r(n,i,u=!0){if(n==null)throw new Error("cheerio.load() expects a string");let o=$c(i),c=e(n,o,u,null);class d extends Aa{_make(g,_){let v=p(g,_);return v.prevObject=this,v}_parse(g,_,v,w){return e(g,_,v,w)}_render(g){return t(g,this.options)}}function p(A,g,_=c,v){if(A&&ui(A))return A;let w=$c(v,o),D=typeof _=="string"?[e(_,w,!1,null)]:"length"in _?_:[_],L=ui(D)?D:new d(D,null,w);if(L._root=L,!A)return new d(void 0,L,w);let Q=typeof A=="string"&&Kc(A)?e(A,w,!1,null).children:NS(A)?[A]:Array.isArray(A)?A:void 0,H=new d(Q,L,w);if(Q)return H;if(typeof A!="string")throw new TypeError("Unexpected type of selector");let se=A,ce=g?typeof g=="string"?Kc(g)?new d([e(g,w,!1,null)],L,w):(se=`${g}${se}`,L):ui(g)?g:new d(Array.isArray(g)?g:[g],L,w):L;return ce?ce.find(se):H}return Object.assign(p,Wm,{load:r,_root:c,_options:o,fn:d.prototype,prototype:d.prototype}),p}}function NS(e){return!!e.name||e.type===ri.Root||e.type===ri.Text||e.type===ri.Comment}var Dx=C(()=>{Km();ao();Sx();so();Gc()});function $0(e){return e>=55296&&e<=57343}function kx(e){return e>=56320&&e<=57343}function Rx(e,t){return(e-55296)*1024+9216+t}function Y0(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function K0(e){return e>=64976&&e<=65007||DS.has(e)}var DS,St,x,An,Q0=C(()=>{DS=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),St="\uFFFD";(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(x||(x={}));An={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"}});var $,tl=C(()=>{(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.
`)}catch(A){console.error("Omnisearch: Error while parsing Dataloom file",t),console.error(A)}elsejn(t)?this.plugin.settings.aiImageIndexing&&o?.canBeAnalyzed(n)?i=awaito.analyzeImage(n):this.plugin.settings.imagesIndexing&&u?.canFileBeExtracted(t)&&(i=awaitu.extractText(n)):Di(t)&&this.plugin.settings.PDFIndexing&&u?.canFileBeExtracted(t)?i=awaitu.extractText(n):N_(t)&&this.plugin.settings.officeIndexing&&u?.canFileBeExtracted(t)?i=awaitu.extractText(n):this.plugin.notesIndexer.isFilenameIndexable(t)&&(i=n.path);i==null&&(ki(`Omnisearch: ${i} content for file`,n.path),i="");letc=r.metadataCache.getFileCache(n);if(c&&c.frontmatter?.["excalidraw-plugin"]){letA=c.sections?.filter(g=>g.type==="comment")??[];for(let{start:g,end:_}ofA.map(v=>v.position))i=i.substring(0,g.offset-1)+i.substring(_.offset)}letd;this.plugin.settings.displayTitle==="#heading"?d=c?.headings?.find(A=>A.level===1)?.heading??"":d=c?.frontmatter?.[this.plugin.settings.displayTitle]??"";letp=S_(c);return{basename:n.basename,displayTitle:d,content:i,path:n.path,mtime:n.stat.mtime,tags:p,unmarkedTags:p.map(A=>A.replace("#","")),aliases:C_(c).join(""),headings1:c?Lf(c,1).join(" "):"",headings2:c?Lf(c,2).join(" "):"",headings3:c?Lf(c,3).join(" "):""}}}});varpd,zy=C(()=>{Tc();Hr();pd=class{constructor(t){this.plugin=t;this.notesToReindex=newSet}flagNoteForReindex(t){this.notesToReindex.add(t)}asyncrefreshIndex(){lett=[...this.notesToReindex],r=t.filter(u=>this.plugin.app.vault.getAbstractFileByPath(u.path));for(letuofr)Je("Updating file",u.path),awaitthis.plugin.documentsRepository.addDocument(u.path);letn=r.map(u=>u.path);n.length&&(this.plugin.searchEngine.removeFromPaths(n),awaitthis.plugin.searchEngine.addFromPaths(n));leti=t.filter(u=>!r.includes(u)).map(u=>u.path);i.length&&this.plugin.searchEngine.removeFromPaths(i),this.notesToReindex.clear()}isFileIndexable(t){returnthis.plugin.settings.hideExcluded&&this.plugin.app.metadataCache.isUserIgnored&&this.plugin.app.metadataCache.isUserIgnored(t)?!1:this.isFilenameIndexable(t)||this.isContentIndexable(t)}isContentIndexable(t){letr=this.plugin.settings,n=!!this.plugin.getTextExtractor(),i=!!this.plugin.getAIImageAnalyzer(),u=n&&r.PDFIndexing,o=n&&r.imagesIndexing,c=i&&r.aiImageIndexing;returnthis.isFilePlaintext(t)||tu(t)||bc(t)||u&&Di(t)||o&&jn(t)||c&&jn(t)}isFilenameIndexable(t){returnthis.canIndexUnsupportedFiles()||this.isFilePlaintext(t)||tu(t)||rs(t)||bc(t)}canIndexUnsupportedFiles(){returnthis.plugin.settings.unsupportedFilesIndexing==="yes"||this.plugin.settings.unsupportedFilesIndexing==="default"&&!!this.plugin.app.vault.getConfig("showUnsupportedFiles")}generateIndexableNonexistingDocument(t,r){returnt=L_(t),{path:t+(t.endsWith(".md")?"":".md"),basename:t,displayTitle:"",mtime:0,content:"",tags:[],unmarkedTags:[],aliases:"",headings1:"",headings2:"",headings3:"",doesNotExist:!0,parent:r}}isFilePlaintext(t){return[...this.plugin.settings.indexedFileTypes,"md"].some(r=>t.endsWith(`.${r}`))||this.plugin.settings.indexFilesWithoutExtension&&!t.includes(".")}}});varAd,md,Jy=C(()=>{Ad=require("obsidian");Hr();md=class{constructor(t){this.plugin=t;this.embeds=newMap}addEmbed(t,r){this.embeds.has(t)||this.embeds.set(t,newSet),this.embeds.get(t).add(r)}removeFile(t){this.embeds.delete(t),this.embeds.forEach(r=>r.delete(t))}renameFile(t,r){this.embeds.has(t)&&(this.embeds.set(r,this.embeds.get(t)),this.embeds.delete(t)),this.embeds.forEach((n,i)=>{n.has(t)&&(n.delete(t),n.add(r))})}refreshEmbedsForNote(t){this.embeds.forEach((r,n)=>{r.has(t)&&r.delete(t)}),this.addEmbedsForNote(t)}getEmbeds(t){returnthis.embeds.has(t)?[...this.embeds.get(t)]:[]}asyncwriteToCache(){Je("Writing embeds to cache");lett=this.plugin.database,r=[];for(let[n,i]ofthis.embeds)r.push({embedded:n,referencedBy:[...i]});awaitt.embeds.clear(),awaitt.embeds.bulkAdd(r)}asyncloadFromCache(){try{lett=this.plugin.database;if(!t.embeds){Je("No embeds in cache");return}Je("Loading embeds from cache");letr=awaitt.embeds.toArray();for(let{embedded:n,referencedBy:i}ofr)for(letuofi)this.addEmbed(n,u)}cat