import{h as O,u as k,aM as I,aN as f,aO as C,j as a,k as n}from"./llFuKhWI.js";import{f as S}from"./Bmq57C4o.js";const o="USD",c=[{label:"EUR",value:"EUR"},{label:"GBP",value:"GBP"},{label:"USD",value:"USD"}],p=()=>{const u=O(),i=k(),t=I(C.CURRENCY,{path:"/",maxAge:f.ONE_DAY,sameSite:"none",secure:!0,default:()=>o}),g=a("currency",()=>t.value??o),v=n({get(){return g.value},set(e){y(e)}}),r=a("currencyOptions",()=>c),d=n(()=>S(t.value)),b=n(()=>{var s;const l={"store-slug":{loggedIn:"visible",loggedOut:"visible"},"company-slug":{loggedIn:"visible",loggedOut:"visible"},"marketplace-slug":{loggedIn:"visible",loggedOut:"visible"},"ranking-stores-country-category":{loggedIn:"visible",loggedOut:"visible"},"ranking-companies-country-category":{loggedIn:"visible",loggedOut:"visible"},"ranking-marketplaces-country-category":{loggedIn:"visible",loggedOut:"visible"},"markets-country-overview":{loggedIn:"visible",loggedOut:"visible"},"ranking-markets-country-category":{loggedIn:"visible",loggedOut:"visible"},"markets-category-overview":{loggedIn:"visible",loggedOut:"visible"},"ranking-markets-category-country":{loggedIn:"visible",loggedOut:"visible"},"markets-isoCode-slug":{loggedIn:"visible",loggedOut:"visible"},"benchmarks-isoCode-slug":{loggedIn:"visible",loggedOut:"visible"}}[((s=i==null?void 0:i.name)==null?void 0:s.toString())??""]??{};return{visible:l[u.hasPermission("core")?"loggedIn":"loggedOut"]==="visible",disabled:l[u.hasPermission("core")?"loggedIn":"loggedOut"]==="disabled"}});function y(e=o){let l=Array.isArray(e)?e[0]:e;r.value.find(s=>s.value===l)||(l=o),g.value=l??o,t.value=g.value}function m(e=c){e!=null&&e.length&&(r.value=e)}return{currency:v,defaultCurrency:o,currencyOptions:r,formattedCurrency:d,isCurrencySelect:b,setCurrencyOptions:m}};export{p as u};