1import{_ as A,o as m,b as C,w as $,x as h,t as _,e as L,B as P,f as F,j as R,l as D,g as B,m as E,c as g,z as I,A as y,a as b,n,K as V,C as w,s as v,R as O,N as U,O as q,d as T,F as M,ab as G,D as x,u as H,k as z,af as Q,aA as j,q as K}from"./goLDb2lV.js";import{F as W}from"./Bla455if.js";import{F as Y}from"./Ns1MlECa.js";import{u as Z}from"./DvUhTuKT.js";import{F as J}from"./Ds48Khsz.js";import"./y4nQ-Jyo.js";import{u as X}from"./BwJAUf0b.js";import"./Cb24bOsA.js";import"./3nKpKHZn.js";import"./BHbrrSJH.js";import"./rA9-YRhv.js";import"./Bb6d89PQ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"fbb98ac15a660e865a4b25e3fe07bb23c4aa4acf"}}catch{}})();try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="5ff404dc-9ad2-4da3-b567-15792a32902e",t._sentryDebugIdIdentifier="sentry-dbid-5ff404dc-9ad2-4da3-b567-15792a32902e")}catch{}const ee=L({name:"FancyLink",props:{text:{type:String,required:!0},link:{type:String,default:""}},computed:{translatedText(){return this.$t(this.text)},wheretoLink(){return this.whereToFindLink?.element?.uri}}},"$wrFH8_h5ta"),te={class:"relative text-md before:absolute before:bottom-0 before:right-0 before:left-0 before:bg-blackly before:h-px before:transition-all hover:before:right-full"};function ae(t,o,d,i,r,l){const f=P;return m(),C(f,{to:{path:t.$localeRootPath(t.link)}},{default:$(()=>[h("span",te,_(t.translatedText),1)]),_:1},8,["to"])}const oe=A(ee,[["render",ae]]),re={class:"shadow-xl flex flex-col max-w-screen-md mx-auto items-center mt-10"},se={class:"fluid-xl leading-tight font-medium mt-10 mb-6 text-center"},ne={class:"space-x-2 mt-2"},ie={__name:"RedeemCode",emits:["redeemed"],setup(t,{emit:o}){const d=o,{$craftRequest:i}=F(),{locale:r,t:l}=R(),{addAddon:f}=D(),p=w({}),e=Z({code:""}),s=B` 2 query GlobalRedeemQuery($site: [String!]) { 3 globalSet(site: $site, handle: "premium") { 4 ... on premium_GlobalSet { 5 whereto: cta { 6 ...LinkFragment 7 } 8 } 9 } 10 } 11`,c=v(()=>p.value?.element?.uri),u=v(()=>e.errors?.message),N=async()=>{if(e.processing=!0,e.errors={},!/^[a-zA-Z0-9]{9}$/.test(e.code)){e.errors.message=l("account.premium.notfound"),e.processing=!1;return}try{const{data:a}=await f(e.code);if(a.data.redeemCode.data.state==="NOT_FOUND"){e.errors.message=l("account.premium.notfound");return}d("redeemed",a.data.redeemCode.handle)}catch(a){e.errors=a.errors||{message:l("account.premium.error")},console.error("Error redeeming code:",a)}finally{e.processing=!1}};return E(async()=>{try{const{globalSet:{whereto:a}}=await i(s,{site:r.value});p.value=a}catch(a){console.error("Error fetching global set data:",a)}}),(a,k)=>(m(),g("div",re,[h("form",{class:"flex flex-col items-center w-full px-5 lg:w-2/3 lg:pt-10 pb-8",onSubmit:V(N,["prevent"])},[h("h3",se,[I(a.$slots,"default",{},()=>[y(_(a.$t("account.premium.gotTrainingsCode")),1)])]),b(n(Y),{modelValue:n(e).code,"onUpdate:modelValue":k[0]||(k[0]=S=>n(e).code=S),id:"redeem-code-input",placeholder:a.$t("account.premium.enterCode"),higher:!0,class:"redemCode__field",error:u.value},null,8,["modelValue","placeholder","error"]),b(n(W),{class:"self
11-center","vertical-margin":"mt-0 mb-2","is-loading":n(e).processing},{default:$(()=>[y(_(a.$t("account.premium.redeemTraining")),1)]),_:1},8,["is-loading"]),h("div",ne,[b(n(oe),{text:"account.premium.whereFindCode",link:c.value},null,8,["link"])])],32)]))}},le={class:"container"},ce={key:0,class:"max-w-expanded-md mx-auto bg-br-green-light text-center p-5 mb-10"},ue={class:"text-copy"},de={key:1,class:"mx-auto max-w-screen-md"},me={class:"fluid-xl leading-none my-10"},fe={__name:"PremiumWorkouts",setup(t){const{userDetails:o}=x(),{fetchUserTrainings:d}=X(),i=w(null),r=w([]),l=v(()=>o.value?.blackrollCustomer?.addOns?o.value.blackrollCustomer.addOns.filter(s=>s.handle).map(s=>s.handle):[]),f=async e=>{try{const{fetchUserDetails:s}=x();await s(!0),await new Promise(u=>setTimeout(u,500));const c=await d(l.value);r.value=c,i.value=c?.find(u=>u.handle===e||u.shopifyHandle===e)}catch(s){console.error("Error getting newly redeemed code:",s)}},p=async()=>{const e=await d(l.value);r.value=e};return O(()=>o.value?.blackrollCustomer?.addOns,e=>{e&&p()},{immediate:!0}),(e,s)=>(m(),g("div",le,[i.value?(m(),g("div",ce,[h("div",ue,_(e.$t("account.premium.newCode")),1),b(n(q),U({class:"font-bold"},i.value.cta),{default:$(()=>[y(_(e.$t("account.premium.seeTraining")),1)]),_:1},16)])):T("",!0),b(n(ie),{onRedeemed:f}),r.value&&r.value.length?(m(),g("div",de,[h("h2",me,_(e.$t("account.premium.activatedTraining",{count:r.value.length})),1),(m(!0),g(M,null,G(r.value,(c,u)=>(m(),g("div",{key:u},[b(n(J),{cta:[{...c.cta,text:e.$t("account.premium.viewTraining")}],heading:c.title,image:c.image,"use-compact-layout":"","full-width":""},null,8,["cta","heading","image"])]))),128))])):T("",!0)]))}},Ce={__name:"index",async setup(t){let o,d;const{$localeRootPath:i}=F(),{t:r}=R(),{gtmPushPageMeta:l,setBreadCrumb:f}=H(),{fetchUserDetails:p}=x(),{loggedIn:e}=D();f([{label:r("account.exercisesTitle"),route:{path:i("/account/exercises")}},{label:r("account.premium.premiumTitle"),route:{path:i("/account/exercises/premium")}}]),z({title:r("account.premium.premiumTitle")});const s=K();return Q(()=>{e.value===!1&&s.push("/account/login")}),e.value&&([o,d]=j(()=>p(!0)),await o,d()),E(async()=>{l({content_category:"premium"})}),(c,u)=>(m(),C(n(fe)))}};export{Ce as default}; 12//# sourceMappingURL=DNn1rm_m.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.