1import{_ as V}from"./-5ohK5Qy.js";import{d as X,U as F,b as W,f as G,e as K,c as z,g as J,aC as Q,j as Y,i as a,ev as Z,a8 as tt,J as b,l as d,m as et,w as y,p as l,bK as st,q as o,s as f,O as ot,R as nt,al as at,r as h,n as e,t as w,A as rt,aH as it,E as c,N as lt,X as ct,bj as ut,ew as dt,ex as wt,T as pt}from"./BzxC8KJp.js";import{_ as mt}from"./bSstmYj3.js";import{u as xt}from"./Bf1GoMOb.js";import"./DSnsU7XE.js";import"./DuY8ssJU.js";const _t={key:0,class:"tw-flex tw-flex-row tw-justify-end tw-gap-2 tw-bg-[#182b50] dark:tw-bg-[#101828] tw-px-2"},gt={key:1,class:"tw-bg-[#182b50] dark:tw-bg-[#101828] tw-px-8 tw-pb-20 md:tw-pb-8 tw-font-[sans-serif] tw-max-h-[72vh] md:tw-max-h-none tw-rounded-xl scroll"},bt={class:"tw-max-w-6xl tw-mx-auto tw-grid md:tw-grid-cols-[auto_1fr_auto] tw-justify-center tw-items-center tw-gap-12"},ft={class:"tw-text-center"},ht={class:"tw-text-left tw-mb-5"},St={class:"tw-text-lg lg:tw-text-xl tw-text-white dark:tw-text-gray-300"},vt={class:"tw-text-2xl tw-font-medium tw-leading-none tw-mt-3"},yt={class:"tw-font-semibold tw-px-1 tw-text-muted-400"},kt={class:"tw-text-muted-400 tw-text-sm"},Pt={key:0,class:"tw-text-xl tw-font-medium tw-leading-none tw-mt-3"},Ct={class:"tw-font-semibold tw-px-1 tw-text-muted-400"},Ut={class:"tw-text-left -tw-mt-4 md:tw-mt-0"},Nt={class:"tw-flex tw-flex-col tw-items-start tw-p-2 md:tw-p-4 lg:tw-p-6"},At=X({__name:"SubscribeCtaModal",props:{post:{default:void 0}},setup(k){const r=k,P=F(),S=W(),{$callApi:C}=G(),U=K(),i=z(),N=J(),{isDarkMode:A}=Q(),D=Y(),{trackEvent:O}=xt(),v=c("");a(()=>i.currentSite.advancedOptions.stripePublishableKey);const u=c(null),{onLoaded:Dt}=Z();tt(()=>{u.value!==null&&(u.value.unmount(),u.value.destroy(),u.value=null)});const n=a(()=>i.currentSite.advancedOptions.plans),I=c(null),p=c(null),m=c(!1),T=a(()=>{if(!r.post)return window.location.href;const s=D.getIsLiveVideo(r.post),t=new URL(window.location.href),g=s?"stream/watch":"post";return`${t.origin}/${g}/${r.post.guid}`}),E=async()=>{const s={siteId:i.currentSite.id,postId:r.post?.id,postGuid:r.post?.guid,priceId:n.value[0].stripePriceId,purchaseType:wt.Subscription,productName:n.value[0].name,planName:n.value[0].name,uiMode:dt.Hosted,originatingUrl:T.value,trialPeriodDays:_.value?x.value:0,frontendSessionId:v.value};m.value=!0;try{const t=await C("api/services/app/Sportsee/CreateSportseeStripeSession","POST",{body:s},"EXTERNAL",0);N.logDebug("CreateSportseeStripeSession",t),t.success&&t.result?(I.value=t.result.clientSecret,p.value=t.result.url):console.error(t.error)}catch(t){console.error(t),pt.alert("Problem with Purchase",`Sorry, but there was a problem preparing for your purchase.<br/>${t.message}<br/><br/>Please try again later.`),m.value=!1}},M=async(s=!1)=>{await E(),await lt(),O("subscribe-cta",{originatingPage:P.fullPath}),!b.isNullOrWhitespace(p.value)&&ct.openWebSite(p.value,s)},$=async()=>{v.value=ut()};a(()=>{const s={};return A.value?s.theme="night":s.theme="stripe",s});const x=a(()=>n.value[0].trialDays),_=a(()=>x.value>0&&b.isNullOrWhitespace(U.subscriber?.subscriptionForCurrentSite?.subscriptionId));return(s,t)=>{const g=nt,j=V,q=rt,B=mt,L=st,H=it,R=at;return d(),et(H,{onShow:$,width:"AUTO",title:"Subscribe","show-title":o(S).screen.xs,"show-card-actions":!1,"container-classes":"tw-w-screen md:tw-min-w-[780px] lg:tw-min-w-[960px]"},{default:y(()=>[l(L,{class:"tw-bg-[#182b50] dark:tw-bg-[#101828]"},{default:y(()=>[o(S).screen.gt.xs?(d(),f("div",_t,[ot(l(g,{flat:"",dense:"",icon:"close",color:"grey-6",class:"q-mt-sm q-ml-md"},null,512),[[R]])])):h("",!0),o(n)?(d(),f("div",gt,[e("div",bt,[e("div",ft,[e("div",ht,[l(j,{src:o(i).currentSite.themeOptions.logoDark,width:"130px",height:"130px",class:"tw-mx-auto"},null,8,["src"])]),t[3]||(t[3]=e("h2",{class:"tw-text-4xl lg:tw-text-5xl tw-font-extrabold tw-text-white dark:tw-text-gray-100 tw-mb-6 md:!tw-leading-[55px]"}," Unlock Premium Features ",-1)),e("p",St," Get access to thousands of articles, photos, and videos by subscribing to "+w(o(i).currentSite.name)+". ",1),e("h3",vt,[t[0]||(t[0]=e("span",{class:"tw-text-muted-400 tw-text-sm"},"Only",-1)),e("span",yt,w(("strUtils"in s?s.strUtils:o(b)).toCurrency(o(n)[0].amount)),1),e("span",kt,"/per "+w(o(n)[0].interval),1)]),o(_)?(d(),f("h3",Pt,[t[1]||(t[1]=e("span",{class:"tw-text-muted-400 tw-text-sm"},"Enjoy a",-1)),e("span",Ct,"FREE "+w(o(x))+" DAYS",1),t[2]||(t[2]=e("span",{class:"tw-text-muted-400 tw-text-sm"},"trial first!",-1))])):h("",!0),l(q,{label:o(_)?"Start Trial":"Subscribe",color:"secondary",size:"lg",XXXpadding:"10px 20px",loading:o(m),class:"tw-w-full tw-transition tw-duration-300 tw-ease-in-out tw-transform hover:tw-scale-105 tw-mt-10",onClick:M},null,8,["label","loading"])]),t[6]||(t[6]=e("div",{class:"tw-border tw-border-muted-600 tw-w-full md:tw-w-[1px] md:tw-h-full tw-bg-muted-600"},null,-1)),e("div",Ut,[e("div",Nt,[t[4]||(t[4]=e("h2",{class:"tw-text-2xl tw-font-medium tw-text-white tw-mt-4"},"Subscribe Now",-1)),t[5]||(t[5]=e("p",{class:"tw-text-sm tw-text-muted-500 dark:tw-text-muted-400"}," By upgrading to a paid subscription, you will enjoy the following benefits: ",-1)),l(B)])])])])):h("",!0)]),_:1})]),_:1},8,["show-title"])}}}),jt=Object.assign(At,{__name:"AccountSubscribeCtaModal"});export{jt as default};
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.