1import{Ba as L,g as _,k as N}from"./chunk-WQGMJXLQ.js";import{d as H}from"./chunk-KQEDLGWJ.js";import{Ac as h,Db as C,Nd as o,Sa as m,Sc as c,Ud as b,Va as v,Vb as y,Vd as s,ab as f,ae as P,bd as D,cd as I,ed as p,oc as M,qc as k,sc as x,sd as u,xb as l,xc as g,za as d}from"./chunk-NGQXYJ5Y.js";function w(a,O){if(a&1&&h(0,"span",1),a&2){let e=c();p(u("brand-svg ",e.brandClass()," no-brand-page")),g("innerHtml",e.styles(),l)}}function B(a,O){if(a&1&&h(0,"span",2)(1,"a",3),a&2){let e=c();g("innerHtml",e.styles(),l),C(),p(u("brand-svg ",e.brandClass())),g("routerLink","/brands/"+e.brandUri()),M("aria-label",e.brandName())}}var z=(()=>{class a{constructor(){this.sanitizer=d(H),this.ref=d(P),this.element=d(f),this.brand=s.required(),this.pixelArea=s(0),this.maskImageColor=s(""),this.maskImageHover=s(""),this.brandClassPrefix=s(""),this.onImageError=b(),this.onImageLoad=b(),this.imgWidth=m(void 0),this.imgHeight=m(void 0),this.uuid=L(),this.svgPath=o(()=>this.brand().logo),this.brandName=o(()=>this.brand().name),this.brandUri=o(()=>this.brand().uri),this.isLegacy=o(()=>{if(typeof navigator>"u")return!1;let e=navigator.userAgent,n=navigator.appVersion;return e.indexOf("MSIE")!==-1||n.indexOf("Trident/")>-1||e.indexOf("Edge")!==-1}),this.brandClass=o(()=>`${this.brandClassPrefix()||"brand"}-${this.uuid}`),this.styles=o(()=>{let e=this.svgPath(),n=this.maskImageColor(),t=this.maskImageHover(),i=this.isLegacy(),r=this.brandClass(),S=n&&!i?`-webkit-mask-image: url('${e}'); mask-image: url('${e}'); background-color: ${n}`:`background-image: url('${e}');`,$=t&&!i?`background-color: ${t}`:"";return this.sanitizer.bypassSecurityTrustHtml(` 2 <style> 3 .${r} { 4 ${S} 5 } 6 7 .${r}:hover { 8 ${$} 9 } 10 </style> 11 `)}),v(()=>{let e=this.brand(),n=this.pixelArea();if(!e||this.isLegacy())return;let t=new Image;t.onload=()=>{let[i,r]=this.getDimensions(n,t.width,t.height);this.imgWidth.set(Math.round(i)),this.imgHeight.set(Math.round(r)),this.onImageLoad.emit()},t.onerror=()=>{this.onImageError.emit()},t.src=e.logo})}getDimensions(e,n,t){let i=Math.sqrt(e*n/t),r=e/i;return[i,r]}static{this.\u0275fac=function(n){return new(n||a)}}static{this.\u0275cmp=y({type:a,selectors:[["app-brand-svg"]],hostVars:6,hostBindings:function(n,t){n&2&&(D("width",t.imgWidth(),"px")("height",t.imgHeight(),"px"),I("is-legacy",t.isLegacy()))},inputs:{brand:[1,"brand"],pixelArea:[1,"pixelArea"],maskImageColor:[1,"maskImageColor"],maskImageHover:[1,"maskImageHover"],brandClassPrefix:[1,"brandClassPrefix"]},outputs:{onImageError:"onImageError",onImageLoad:"onImageLoad"},decls:2,vars:1,consts:[[3,"class","innerHtml"],[3,"innerHtml"],[1,"brand-svg-styles-container",3,"innerHtml"],["role","img",3,"routerLink"]],template:function(n,t){n&1&&k(0,w,1,4,"span",0)(1,B,2,6),n&2&&x(t.brandUri()?1:0)},dependencies:[N,_],styles:["[_nghost-%COMP%]{display:block}.brand-svg[_ngcontent-%COMP%]{background-repeat:no-repeat;background-size:contain;background-position:center;cursor:pointer;display:block;height:100%;mask-repeat:no-repeat;mask-size:contain;width:100%}.no-brand-page[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.is-legacy[_nghost-%COMP%]{height:100%;max-height:50px;max-width:120px;width:100%}.is-legacy[_nghost-%COMP%] .brand-svg[_ngcontent-%COMP%]{background-color:transparent}@media(hover:hover){.is-legacy[_nghost-%COMP%] .brand-svg[_ngcontent-%COMP%]:hover{background-color:transparent}}.brand-svg-styles-container[_ngcontent-%COMP%]{display:none}"],changeDetection:0})}}return a})();export{z as a};
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.