/*!
 * Crafted with ❤ by Salla
 */
import{h as n}from"./p-Cb4NFvMH.js";function a(n,a=(window.matchMedia("(min-width: 768px)").matches?3:2)){return n<a?n:n-n%a}function t(n=null){for(const n of document.querySelectorAll("salla-modal"))n.close();n&&requestAnimationFrame(n)}function o(n){const a=(n.prizes||[]).map((n=>({...n,items:(n.items||[]).map((a=>({...a,group_title:n.title,group_type:n.type})))}))),t={type:"all",title:salla.lang.get("pages.loyalty_program.all"),items:a.reduce(((n,a)=>n.concat(a.items)),[])};return a.unshift(t),{...n,prizes:a,prizes_count:t.items.length,points:n.points??[]}}function l(n){return[n.name.replace(/\s/g,"-"),`brand-${n.id}`].join("/")}function r(a){return"number"==typeof a?n("span",null,a," ",salla.lang.get("pages.loyalty_program.point")):function(n){for(const a of n.conditions??[])if(a.key?.endsWith("_FOR_UNIT"))return!0;return!1}(a)?n("span",null,"1 ",salla.config.currency().symbol," = ",a.points," ",salla.lang.get("pages.loyalty_program.point")):n("span",null,a.points," ",salla.lang.get("pages.loyalty_program.point"))}export{a,l as b,t as c,r as f,o as n}