try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`a8e8a3d2-6001-443c-8e34-3584bfcd49ef`,e._sentryDebugIdIdentifier=`sentry-dbid-a8e8a3d2-6001-443c-8e34-3584bfcd49ef`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{Ag as t,Fg as n,Ig as r,ch as i,eh as a,gr as o,hn as s,lh as c,p as l,w as u}from"./entry.client-dr7r6s9a.js";import{n as d}from"./purchasePageReadyUtils-n2r38x2a.js";import{t as f}from"./NarrowPurchaseShell-lkyxvfta.js";import{t as p}from"./imageUtils-fgnptyto.js";var m=n(),h=e(r(),1),g=t(),_=e=>{let t=(0,m.c)(32),{t:n}=c(`SubscriptionUpgradeButtonPanel`),{locCancel:r,locContinue:l}=a(),{trackUserAction:u}=i(),d;t[0]!==u||t[1]!==e.confirm?(d=()=>{u(`ConfirmButton`,{},`Press`,{location:`SubscriptionUpgrade`}),e.confirm?.()},t[0]=u,t[1]=e.confirm,t[2]=d):d=t[2];let f=d,p;t[3]!==u||t[4]!==e.learnMoreUri?(p=()=>{u(`LearnMoreButton`,{learnMoreLink:e.learnMoreUri},`Press`,{location:`SubscriptionUpgrade`}),window.open(e.learnMoreUri,`_blank`)},t[3]=u,t[4]=e.learnMoreUri,t[5]=p):p=t[5];let h=p,_;t[6]!==u||t[7]!==e.cancel?(_=()=>{u(`CancelButton`,{},`Press`,{location:`SubscriptionUpgrade`}),e.cancel?.()},t[6]=u,t[7]=e.cancel,t[8]=_):_=t[8];let v=_,y=!e.confirm,b;t[9]===l?b=t[10]:(b=l(),t[9]=l,t[10]=b);let x;t[11]!==f||t[12]!==y||t[13]!==b?(x=(0,g.jsx)(s,{as:`button`,kind:`brand`,onPress:f,isDisabled:y,size:`standard`,className:`w-full grow lg-10:min-w-[var(--V1UN)]`,"data-auto-focus":!0,children:b}),t[11]=f,t[12]=y,t[13]=b,t[14]=x):x=t[14];let S=!e.cancel,C;t[15]===r?C=t[16]:(C=r(),t[15]=r,t[16]=C);let w;t[17]!==v||t[18]!==S||t[19]!==C?(w=(0,g.jsx)(s,{as:`button`,kind:`standard`,onPress:v,isDisabled:S,size:`standard`,className:`w-full grow lg-10:min-w-[var(--V1UN)]`,children:C}),t[17]=v,t[18]=S,t[19]=C,t[20]=w):w=t[20];let T=!e.learnMoreUri,E;t[21]!==e.learnMoreText||t[22]!==n?(E=e.learnMoreText||n(`Learn More`,{shortKey:`learn_more_button_text`}),t[21]=e.learnMoreText,t[22]=n,t[23]=E):E=t[23];let D;t[24]!==h||t[25]!==T||t[26]!==E?(D=(0,g.jsx)(s,{as:`button`,kind:`standard`,onPress:h,isDisabled:T,size:`standard`,className:`w-full grow lg-10:min-w-[var(--V1UN)]`,children:E}),t[24]=h,t[25]=T,t[26]=E,t[27]=D):D=t[27];let O;return t[28]!==x||t[29]!==w||t[30]!==D?(O=(0,g.jsx)(o,{location:`SubscriptionUpgradeButtonPanel`,children:(0,g.jsxs)(`div`,{className:`flex flex-col gap-layout-horizontal-gap sm-10:flex-row`,children:[x,w,D]})}),t[28]=x,t[29]=w,t[30]=D,t[31]=O):O=t[31],O},v=e=>{let{trackAppAction:t}=i(),{t:n}=c(`SubscriptionUpgrade`);d(e.onPurchasePageReady),(0,h.useEffect)(()=>{e.timeToInteractiveSpan?.end()},[e.timeToInteractiveSpan]),(0,h.useEffect)(()=>{t(`ShowSubscriptionUpgradeInterstitial`,{productId:e.productId},{location:`SubscriptionUpgrade`})},[t,e.productId]);let r=e.body.join(`

`);return e.newRenewalDate&&(r=r.replace(`{0}`,new Date(e.newRenewalDate).toLocaleDateString())),(0,g.jsxs)(f,{children:[(0,g.jsxs)(`div`,{className:`m-layout-vertical-related-content-in-a-section-tight shrink-0`,children:[(0,g.jsx)(`h1`,{className:`mb-layout-vertical-title-and-row-regular text-2xl font-semibold text-noninteractive-content-primary-content`,children:n(`Subscribe`,{shortKey:`subscription_upgrade_header`})}),(0,g.jsx)(`h2`,{className:`type-subtitle1`,children:n(`You're changing your plan:`,{shortKey:`subscription_upgrade_subheader`})})]}),(0,g.jsx)(`div`,{className:`shrink-0 px-layout-vertical-related-content-in-a-section-tight`,children:(0,g.jsx)(`hr`,{className:`bar-divider-standard w-full border-action-standard-default-border-rest`})}),(0,g.jsxs)(`div`,{className:`m-layout-vertical-related-content-in-a-section-tight flex flex-col gap-internal-gap-regular`,children:[(0,g.jsxs)(`div`,{className:`mb-internal-gap-regular flex items-center gap-internal-icon-and-text-gap-action-separator text-2xl font-semibold`,children:[(0,g.jsx)(u,{src:e.poster?.url,alt:e.title,className:`max-w-[96px] rounded`,aspectRatio:p(e.poster?.width,e.poster?.height)||`1/1`,getResizedImageUrl:l,constraintSet:{entries:[{query:`LG_10`,size:{width:96},imageType:`jpg`}],defaultEntry:{size:{width:96},imageType:`jpg`}}}),e.title]}),(0,g.jsx)(`div`,{className:`min-w-0`,children:(0,g.jsx)(`p`,{className:`text-noninteractive-content-primary-content`,children:r})}),(0,g.jsx)(`div`,{className:`pt-internal-gap-regular`,children:(0,g.jsx)(_,{confirm:e.confirm,cancel:e.exit,learnMoreUri:e.learnMoreUri,learnMoreText:e.learnMoreButtonText})})]})]})};export{v as default};