1import{_ as w,j as v,k as x,V as S,v as D,t as B}from"./index.474d7b13.js";import{N as y,D as n,W as b,U as a,f as u,S as d,E as l,a2 as m,a0 as _,F as p,H as F}from"./vue.00f7c436.js";import"./sentry.09480738.js";const j={name:"StoreFrontCurrencySelect",components:{TmlCurrencySymbol:v,TmlDropdownContainer:x},inject:["theme","app"],props:{dropDown:Boolean,textDropDown:Boolean},computed:{selectedCurrency:{get(){return this.$store.getters["currency/get"]().code},set(r){this.$store.dispatch("currency/set",r)}},currencies(){return this.$store.getters["currency/getAvailable"]}},watch:{$route:{immediate:!0,handler(r){const i=S.get("currency");if(r.query.currency||i){const o=r.query.currency?r.query.currency:i,g=this.$store.state.currency,h=Object.keys(g.currencies).includes(o),e=this.$store.getters["subdomain/getPlugin"]("currency");h&&(this.$store.commit("subdomain/updateOrCreatePlugin",{name:"currency",enabled:!0,currency:o,currencies:[...new Set([e?e.currency:"GBP",e?e.currencies:o])].filter(s=>s).join(",")}),this.selectedCurrency=o)}}}},methods:{selectCurrency(r){this.selectedCurrency=r,D.isSmaller("md")&&setTimeout(()=>{window.scrollTo({top:0,behavior:"smooth"})},500),B.event("select-currency")}}},P={class:"currency-dropdown-options cursor-pointer"},T=["onClick"],V={class:"mx-4 mt-1"},q=["onClick"],N={class:"currency-dropdown-options cursor-pointer"},$=["onClick"],z={class:"mx-4 mt-1"},E={key:2,class:"currencies"},O=["onClick"];function A(r,i,o,g,h,e){const s=y("tml-currency-symbol"),f=y("tml-bubble"),C=y("tml-dropdown-container");return o.dropDown?(n(),b(C,{key:0,align:"left","dropdown-styles":{width:"max-content","background-color":e.theme().get("menu.background.color")}},{trigger:a(({trigger:c})=>[u(f,{color:e.theme().get("menu.text.color"),"bg-color":"#fff0","aria-label":"Select currency",onClick:c},{default:a(()=>[u(s,{class:"cursor-pointer text-2xl","currency-code":e.selectedCurrency},null,8,["currency-code"])]),_:2},1032,["color","onClick"])]),default:a(({close:c})=>[d("div",P,[(n(!0),l(p,null,m(e.currencies,t=>(n(),l("div",{key:t,class:"currency-dropdown-option py-4 px-4 flex items-center",onClick:k=>{e.selectCurrency(t),c()}},[u(s,{"currency-code":t},null,8,["currency-code"]),d("span",V,_(r.$store.getters["currency/get"](t).name),1)],8,T))),128))])]),_:1},8,["dropdown-styles"])):o.textDropDown?(n(),b(C,{key:1,align:"left","vertical-align":"top","dropdown-styles":{width:"max-content","background-color":e.theme().get("menu.background.color")}},{trigger:a(({trigger:c})=>[d("div",{class:"flex items-center cursor-pointer select-none",onClick:c},[u(s,{class:"cursor-pointer mr-[0.2rem] md:mr-1","currency-code":e.selectedCurrency},null,8,["currency-code"]),d("div",null,_(e.selectedCurrency),1)],8,q)]),default:a(({close:c})=>[d("div",N,[(n(!0),l(p,null,m(e.currencies,t=>(n(),l("div",{key:t,class:"currency-dropdown-option py-4 px-4 flex items-center",onClick:k=>{e.selectCurrency(t),c()}},[u(s,{"currency-code":t},null,8,["currency-code"]),d("span",z,_(r.$store.getters["currency/get"](t).name),1)],8,$))),128))])]),_:1},8,["dropdown-styles"])):(n(),l("div",E,[(n(!0),l(p,null,m(e.currencies,(c,t)=>(n(),l("div",{key:t,class:F(["currency",{selected:r.$store.getters["currency/get"]().code===c}]),onClick:k=>e.selectCurrency(c)},[u(s,{"currency-code":c},null,8,["currency-code"])],10,O))),128))]))}const L=w(j,[["render",A],["__scopeId","data-v-9267ba0d"]]);export{L as default}; 2//# sourceMappingURL=StoreFrontCurrencySelect.9ba679cd.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.