!function(){var e,t,r,_,n,i,a,c,o={495:function(){},7147:function(){},1418:function(){},8741:function(){},319:function(){},8386:function(){},3342:function(){},5639:function(e,t,r){"use strict";var _=r(7582);async function getCachedFile(e){let t;try{t=await caches.open("image-database");let r=await t.match(e);if(r)return await r.arrayBuffer()}catch(e){console.warn("Unable to open cache",e)}let r=await fetch(e),_=await r.arrayBuffer();if(t)try{await t.put(e,new Response(_,{headers:r.headers}))}catch(e){console.warn("Unable to cache file",e)}return _}async function getCachedJSON(e){let t=await getCachedFile(e);return JSON.parse(new TextDecoder("utf-8").decode(t))}_.OBj.allowLocalModels=!1;let ApplicationSingleton=class ApplicationSingleton{static async getInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===this.tokenizer&&(this.tokenizer=_.t25.from_pretrained(this.model_id,{progress_callback:e})),null===this.text_model&&(this.text_model=_.v3$.from_pretrained(this.model_id,{progress_callback:e})),null===this.metadata&&(this.metadata=getCachedJSON("".concat(this.BASE_URL,"metadata_").concat(10,"k.json"))),null===this.embeddings&&(this.embeddings=new Promise((e,t)=>{getCachedFile("".concat(this.BASE_URL,"image-embeddings_").concat(10,"k-768-32bit.bin")).then(t=>{e(new Float32Array(t))}).catch(t)})),Promise.all([this.tokenizer,this.text_model,this.metadata,this.embeddings])}};ApplicationSingleton.model_id="Xenova/siglip-base-patch16-224",ApplicationSingleton.BASE_URL="https://huggingface.co/datasets/Xenova/siglip-semantic-image-search-assets/resolve/main/",ApplicationSingleton.tokenizer=null,ApplicationSingleton.text_model=null,ApplicationSingleton.metadata=null,ApplicationSingleton.embeddings=null,self.addEventListener("message",async e=>{let[t,r,_,n]=await ApplicationSingleton.getInstance(self.postMessage);self.postMessage({status:"ready"});let i=t(e.data.text,{padding:"max_length",truncation:!0}),{pooler_output:a}=await r(i),c=function(e,t){let r=t.length/768,_=Array(r);for(let n=0;nt.score-e.score),o=o.slice(0,100),self.postMessage({status:"complete",output:o})})}},u={};function __webpack_require__(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}},_=!0;try{o[e](r,r.exports,__webpack_require__),_=!1}finally{_&&delete u[e]}return r.exports}__webpack_require__.m=o,__webpack_require__.x=function(){var e=__webpack_require__.O(void 0,[165,132,15,414],function(){return __webpack_require__(5639)});return __webpack_require__.O(e)},e=[],__webpack_require__.O=function(t,r,_,n){if(r){n=n||0;for(var i=e.length;i>0&&e[i-1][2]>n;i--)e[i]=e[i-1];e[i]=[r,_,n];return}for(var a=1/0,i=0;i=n&&Object.keys(__webpack_require__.O).every(function(e){return __webpack_require__.O[e](r[o])})?r.splice(o--,1):(c=!1,n