1import{a as m,f as y}from"./chunk-XEXWZOGE.js";import{y as p,z as v}from"./chunk-O574CAJ5.js";import{de as u,na as g,sa as d}from"./chunk-AAE36BVF.js";import{d as w}from"./chunk-YZFYTRZT.js";var b,c,E=w(()=>{"use strict";u();y();v();u();b=(()=>{class o{constructor(){this.configuration=d(p),this.defaultImageSize=600,this.allowedTypes=["webp","jpg","png"],this.parseProductImage=a=>{let e,s,n=new c,h;if(!a?.variants?.length)return[e,s]=this.resolveEmptyImage(),[e,s,n,void 0,void 0];let i={};if(this.allowedTypes.forEach(t=>{i[t]=[]}),a.variants.forEach(t=>{let r=t.filename.split(".")[1];i[r]&&i[r].push(t)}),m(i).forEach(t=>{let r=i[t].sort((l,f)=>l.width-f.width);if(r.length&&t in n&&(n[t]=r.map(l=>`${this.imageBasePath}${a.basePath}/${l.filename} ${l.width}w`).join(", "),e||(e=n[t]),!s)){let l=r.find(f=>f.width===this.defaultImageSize)||r[0];s=`${this.imageBasePath}${a.basePath}/${l.filename}`,h={height:l.height,width:l.width}}}),m(n).forEach(t=>{n[t]&&(!i[t]||!i[t].length)&&(n[t]="")}),!s){let[t,r]=this.resolveEmptyImage();return e||(e=t),[e,r,n,void 0,a.imageAltText]}return[e,s,n,h,a.imageAltText]},this.parseProductImageThumbnail=(a,e=100)=>{if(!a?.variants?.length){let[,i]=this.resolveEmptyImage();return{url:i,alt:a?.imageAltText??""}}let s=i=>{let t=i.split(".").pop()??"",r=this.allowedTypes.indexOf(t);return r===-1?this.allowedTypes.length:r},n=[...a.variants].sort((i,t)=>s(i.filename)-s(t.filename)||i.width-t.width),h=n.find(i=>i.width>=e)??n[0];return{url:`${this.imageBasePath}${a.basePath}/${h.filename}`,alt:a.imageAltText??""}},this.resolveEmptyImage=a=>{let e;return a?e=this.configuration.EmptyImageUrlTransparent:e=this.configuration.EmptyImageUrl,[e,e]}}get imageBasePath(){return this.configuration.appSettings.imagePathPrefix}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275prov=g({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),c=class{constructor(){this.webp="",this.jpg="",this.png=""}}});export{b as a,c as b,E as c}; 2//# sourceMappingURL=chunk-M66LVL6E.js.map
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.