import{b,c as T}from"./chunk-J5DDNCDX.js";import{a as c,b as k}from"./chunk-AJ7ODGYR.js";import{m as u,n as C,q as v,r as D}from"./chunk-SM7EQ7ST.js";import{m as g,q as y}from"./chunk-HTXYTVN4.js";import{O as h,Sa as U,be as p,na as S,r as l,ta as f,x as m,ya as a}from"./chunk-WL5U2YIT.js";import{e as I}from"./chunk-ADEKKGI2.js";var L,j=I(()=>{p();y();T();S();U();k();C();D();p();L=(()=>{let r=class r{constructor(){this.http=a(g),this.serverInformationService=a(u),this.themeService=a(v)}get baseUrl(){return this.serverInformationService.privateServerInformation?.useIconCacheStaging??!1?c.iconCacheUrlStaging:c.iconCacheUrl}isAvailable(){let e=this.serverInformationService.privateServerInformation;return(e?.enableInternetAccess??!0)&&(e?.enableBrandfetch??!0)}searchDomains(e,n=.9){let o=`${this.baseUrl}/domains?search=${encodeURIComponent(e)}`;return this.http.get(o,{context:b()}).pipe(m(i=>i.filter(t=>(t.qualityScore??0)>=n).map(t=>({domainName:t.name,displayName:t.brandName,iconUrl:t.iconUrl,qualityScore:t.qualityScore,fallback:t.fallback}))),h(()=>l([])))}getIconUrl(e,n=64,o="png",i="transparent",t="dark"){if(!e||e.length<1||e.length>253)return"";let d=encodeURIComponent(e),$=t?`&theme=${t}`:"";return`${this.baseUrl}/domains/${d}/symbol?size=${n}&format=${o}&fallback=${i}${$}`}getLogoUrl(e,n=128,o="png",i="transparent"){if(!e||e.length<1||e.length>253)return"";let t=encodeURIComponent(e);return`${this.baseUrl}/domains/${t}/logo?width=${n}&format=${o}&fallback=${i}&theme=${this.contrastTheme()}`}contrastTheme(){return this.themeService.isDarkTheme?"light":"dark"}};r.\u0275fac=function(n){return new(n||r)},r.\u0275prov=f({token:r,factory:r.\u0275fac,providedIn:"root"});let s=r;return s})()});export{L as a,j as b};
