import{D as m}from"./chunk-QZAKNZ5J.js";import{La as s,a as i,b as n}from"./chunk-WNE7PXNE.js";var p=(()=>{let r=class r{static getDotDiscount(e){let t=e?.dotDiscount;if(t){let a=JSON.parse(t.text);return n(i({},t),{config:n(i({},a),{text:a.text,type:a.type?a.type:"CLASSIC"})})}}static getModelName(e,t){return this.productNameRemoveMemory(this.productNameRemoveDualSim(this.productNameRemoveBrand(e,t)))}static productNameRemoveBrand(e,t){return e.brand&&t.displayName.indexOf(e.brand.name)>-1?t.displayName.replace(e.brand.name,"").trim():t.displayName}static productNameRemoveDualSim(e){return e.replace(/\(?dual sim\)?/i,"").trim()}static productNameRemoveMemory(e){return e.split(" ").filter(t=>!t.toUpperCase().includes("GB")&&!t.toUpperCase().includes("MB")).join(" ")}getActiveVariant(e,t){let a=e.variants?.[0];return t&&(a=e.variants?.find(c=>c.id===t)??a),n(i({},a),{capacity:e.badge?.capacity,brand:e.brand,categoryName:e.categoryName})}getBadges(e){return e.badge?Object.values(e.badge).filter(t=>!!t):[]}static outOfStock(e,t){return e==="noStock"||e==="expired"||t===m.error}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=s({token:r,factory:r.\u0275fac});let o=r;return o})();export{p as a};