PageSourceSearch

https://www.ijru.live/commons-4bc6ea7c.586cd4086ab0dfc73492.chunk.js

js ijru.live collected 2026-10-02 00:40:26 UTC 119,022 bytes, 29 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="761a87f1-036c-4528-a314-a9021fa5075c",e._sentryDebugIdIdentifier="sentry-dbid-761a87f1-036c-4528-a314-a9021fa5075c")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"2067c4d6365ff315d2ba954fc1c093eb8400cbb1"}}catch(e){}}(),(self.webpackChunkstaylive_partnerplatform=self.webpackChunkstaylive_partnerplatform||[]).push([[8117],{20932:(e,t,a)=>{a.r(t),a.d(t,{CardDetails:()=>P,default:()=>_});var s=a(74848),r=a(96540),n=a(5556),o=a.n(n),i=a(67438),d=a(3279),l=a(38267),c=a(50321),u=a(24712),p=a(32689),f=a(37427),m=a(68074),x=a(39522),g=a(13446),b=a(50924),y=Object.defineProperty,h=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,v=(e,t,a)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,A=(e,t)=>{for(var a in t||(t={}))S.call(t,a)&&v(e,a,t[a]);if(h)for(var a of h(t))j.call(t,a)&&v(e,a,t[a]);return e},E=(e,t,a)=>new Promise(((s,r)=>{var n=e=>{try{i(a.next(e))}catch(e){r(e)}},o=e=>{try{i(a.throw(e))}catch(e){r(e)}},i=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);i((a=a.apply(e,t)).next())}));const T=l.Ay.div`
2  border: 1px solid #f1f1f1;
3  border-radius: 6px;
4  padding: 16px 12px;
5  margin: 5px auto;
6`,w=(0,f.c)(p.STRIPE_PUBLISHABLE_TOKEN);function P({data:e,buttonStyle:t,setupIntent:a,showActions:n=!0,intl:o}){const{brand:d,last4:l,exp_month:p,exp_year:f}=e,[y,h]=(0,r.useState)(!1),[S,j]=(0,r.useState)(!1);return(0,s.jsxs)(T,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(m.default,{as:"p",style:{padding:0,margin:0,textTransform:"uppercase"},children:d}),(0,s.jsxs)(m.default,{as:"p",style:{padding:0,margin:0},children:[(0,s.jsx)(u.default,{icon:["fa","credit-card"],className:"mr-2"}),"**** **** **** ",l]})]}),(0,s.jsx)("div",{style:{marginBottom:n?"12px":"0px"},children:(0,s.jsxs)(m.default,{as:"p",style:{fontSize:"0.9em",margin:0},children:[o.formatMessage(g.default.validThru),": ",p," / ",f]})}),S&&(0,s.jsx)("span",{className:"mt-4",children:(0,s.jsx)(b.default,{type:"error",className:"rounded-md",children:(0,s.jsx)(i.A,A({},x.default.stripeNotLoaded))})}),n&&(0,s.jsx)(c.default,{dataTestid:"change-card-button",size:"py-2 px-4",fontSize:"text-sm",loading:y,style:null==t?void 0:t.style,onClick:()=>E(this,null,(function*(){let e;h(!0),j(!1);try{e=yield w}catch(e){return console.error(e),h(!1),void j(!0)}const{paymentError:t}=yield e.redirectToCheckout({sessionId:a.id});t&&h(!1)})),children:o.formatMessage(g.default.changeCard)})]})}w.catch((()=>{}
6)),P.propTypes={data:o().object,buttonStyle:o().object,onChange:o().func,onSubmit:o().func,loading:o().bool,error:o().bool,intl:o().object,setupIntent:o().string,showActions:o().bool};const _=(0,d.Ay)(P)},71066:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var s=a(74848),r=(a(96540),a(96541)),n=a(67438),o=a(5556),i=a.n(o),d=a(51978),l=a(24712),c=a(39522),u=a(13446),p=Object.defineProperty,f=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,g=(e,t,a)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,b=(e,t)=>{for(var a in t||(t={}))m.call(t,a)&&g(e,a,t[a]);if(f)for(var a of f(t))x.call(t,a)&&g(e,a,t[a]);return e};function y({close:e,onDelete:t}){const a=(0,r.A)();return(0,s.jsx)(d.default,{open:!0,setIsOpen:t=>!t&&e(),fullScreen:!1,children:(0,s.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"delete-user-dialog-title",className:"w-full max-w-md p-6 text-black bg-white rounded-xl",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("p",{id:"delete-user-dialog-title",className:"m-0 text-2xl font-medium text-red-600",children:(0,s.jsx)(n.A,b({},u.default.deleteUserWarning))}),(0,s.jsx)("button",{type:"button",onClick:e,"aria-label":a.formatMessage(c.default.close),"data-testid":"close-delete-user",className:"flex items-center justify-center w-8 h-8 ml-4 text-gray-700 bg-transparent border border-gray-300 border-solid rounded-full cursor-pointer shrink-0 hover:bg-gray-100",children:(0,s.jsx)(l.default,{icon:["fa","times"]})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-base text-gray-900",children:(0,s.jsx)(n.A,b({},u.default.deleteUserModalText))}),(0,s.jsx)("button",{type:"button","data-testid":"delete-user",className:"px-4 py-2 text-white bg-red-700 border-red-700 border-solid rounded-md cursor-pointer hover:bg-opacity-75",onClick:t,children:(0,s.jsx)(n.A,b({},u.default.deleteUser))}),(0,s.jsx)("button",{type:"button","data-testid":"cancel-delete-user",className:"px-4 py-2 ml-2 text-gray-900 bg-white border-solid rounded-md cursor-pointer hover:bg-gray-100",onClick:e,children:(0,s.jsx)(n.A,b({},u.default.deleteUserAbortButtonText))})]})]})})}y.propTypes={close:i().func,onDelete:i().func};const h=y},41932:(e,t,a)=>{a.r(t),a.d(t,{PodcastFeed:()=>A,default:()=>E});var s=a(74848),r=a(96540),n=a(5556),o=a.n(n),i=a(67438),d=a(68074),l=a(50321),c=a(24712),u=a(39522),p=a(36249),f=a(13446),m=Object.defineProperty,x=Object.defineProperties,g=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,S=(e,t,a)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,j=(e,t)=>{for(var a in t||(t={}))y.call(t,a)&&S(e,a,t[a]);if(b)for(var a of b(t))h.call(t,a)&&S(e,a,t[a]);return e},v=(e,t)=>x(e,g(t));function A({feed:e,header:t,button:a,revokeAccess:n,loading:o}){const[m,x]=(0,r.useState)(!1);return(0,s.jsxs)("div",{className:"flex flex-col w-full gap-4 py-4 my-2 border border-gray-300 border-solid rounded-sm",children:[(0,s.jsxs)("div",{className:"flex items-center px-4",children:[(0,s.jsx)("img",{className:"w-20 h-auto",src:e.image,alt:""}),(0,s.jsxs)("div",{className:"pl-3",children:[(0,s.jsx)(d.default,v(j({as:"h4"},t),{children:e.name})),(0,s.jsx)(d.default,{as:"p",style:{margin:0},children:e.summary})]})]}),(0,s.jsx)("div",{className:"px-4",children:(0,s.jsx)("a",{href:"podcast://","data-testid":"podcast-app-link",children:(0,s.jsx)("img",{style:{width:"180px",height:"auto"},src:"https://staylive.s3-eu-west-1.amazonaws.com/partnerplatform/assets/apple_podcaster_tile.png",alt:"Apple Podcaster"})})}),(0,s.jsxs)("div",{className:"px-4",children:[(0,s.jsx)("label",{htmlFor:`podcast-${e.id}`,className:"block mb-2 font-bold",children:(0,s.jsx)(i.A,j({},f.default.podcastFeedUrl))}),(0,s.jsx)(p.default,{readOnly:!0,id:`podcast-${e.id}`,icon:"rss",width:16,fluid:!0,value:`https://podcasts.rss.staylive.tv/podcasts?token=${e.token}`})]}),(0,s.jsxs)("div",{className:"px-4",children:[!m&&(0,s.jsxs)(l.default,{dataTestid:"revoke-podcast-access-button",basic:!0,border:"solid",style:null==a?void 0:a.style,size:"py-2 px-4",fontSize:"text-base",className:"border border-red-600 !text-red-600",onClick:()=>x(!0),children:[(0,s.jsx)(c.default,{icon:["fa","trash-can"],className:"mr-2"}),(0,s.jsx)(i.A,j({},f.default.revokeAccess))]}),m&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:{marginBottom:"8px"},children:(0,s.jsx)(d.default,{children:(0,s.jsx)(i.A,j({},f.default.areYouSureRevokeAccess))})}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)(l.default,{dataTestid:"revoke-podcast-access-confirm-button",basic:!0,border:"solid",style:null==a?void 0:a.style,size:"py-2 px-4",fontSize:"text-base",className:"border border-red-600 !text-red-600",loading:o,onClick:()=>n(e.id),children:[(0,s.jsx)(c.default,{icon:["fa","trash-can"],className:"mr-2"}),(0,s.jsx)(i.A,j({},f.default.revokeAccess))]}),(0,s.jsx)(l.default,{dataTestid:"revoke-podcast-access-cancel-button",basic:!0,border:"solid",style:null==a?void 0:a.style,size:"py-2 px-4",fontSize:"text-base",className:"border border-gray-300",onClick:()=>x(!1),children:(0,s.jsx)(i.A,j({},u.default.cancel))})]})]})]})]})}
6A.propTypes={feed:o().object,button:o().object,header:o().object,revokeAccess:o().func,loading:o().bool};const E=A},91675:(e,t,a)=>{a.r(t),a.d(t,{Subscription:()=>v,default:()=>A});var s=a(74848),r=a(96540),n=a(5556),o=a.n(n),i=a(67438),d=a(50321),l=a(50924),c=a(68074),u=a(38267),p=a(26840),f=a(13446),m=Object.defineProperty,x=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,y=(e,t,a)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,h=(e,t)=>{for(var a in t||(t={}))g.call(t,a)&&y(e,a,t[a]);if(x)for(var a of x(t))b.call(t,a)&&y(e,a,t[a]);return e};const S=(0,u.Ay)(c.default)`
7  color: green;
8  border: 1px solid green;
9  border-radius: 3px;
10  padding: 4px 12px;
11  display: inline-block;
12  text-transform: uppercase;
13`,j=u.Ay.sup`
14  font-size: 0.5em;
15  color: red;
16  margin-left: 4px;
17  text-transform: uppercase;
18`;function v({data:e,stopSubscription:t,buttonStyle:a}){const[n,o]=(0,r.useState)(!1),{name:u,price:m,currency:x,inserted_at:g,id:b,invoice_hosted_url:y,active_until:v,current_period_end:A,status:E}=e;return(0,s.jsxs)("div",{className:"flex flex-wrap items-center w-full px-3 py-4 my-1 border border-gray-100 border-solid rounded-md",children:["past_due"===E&&(0,s.jsx)("div",{className:"w-full px-3 mb-3 text-center",children:(0,s.jsx)(l.default,{type:"error",className:"rounded-md",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"font-bold",children:(0,s.jsx)(i.A,h({},f.default.paymentFailedSubscription))}),(0,s.jsx)("div",{className:"mt-1",children:(0,s.jsx)(i.A,h({},f.default.paymentFailedSubscriptionDescription))}),(0,s.jsx)("a",{href:y,target:"_blank",rel:"noopener noreferrer","data-testid":"retry-payment-link",className:"self-center inline-block px-4 py-2 mt-3 text-sm font-bold text-white no-underline bg-red-600 rounded-md hover:text-white hover:bg-red-700",children:(0,s.jsx)(i.A,h({},f.default.retryPayment))})]})})}),(0,s.jsxs)("div",{className:"w-full px-3 md:w-1/2",children:[(0,s.jsxs)(c.default,{as:"p",style:{padding:0,margin:0},children:[(0,s.jsx)("span",{className:"font-medium",children:u}),"trialing"!==E&&(0,s.jsx)(j,{children:E}),"trialing"===E&&(0,s.jsx)(j,{style:{color:"orange"},children:E})]}),(0,s.jsx)(c.default,{as:"p",style:{fontSize:"0.9em",margin:0},children:(0,s.jsx)(p.default,{date:g})}),!v&&!n&&(0,s.jsx)(d.default,{dataTestid:"stop-subscription-button",style:a.style,size:"py-2 px-4",fontSize:"text-sm",className:"mt-2",onClick:()=>o(!0),children:(0,s.jsx)(i.A,h({},f.default.stopSubscription))}),!v&&n&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 mt-2 sm:flex-row",children:[(0,s.jsx)(d.default,{dataTestid:"stop-subscription-cancel-button",style:{background:"#ccc",color:"white",boxShadow:"none"},size:"py-2 px-4",fontSize:"text-sm",onClick:()=>o(!1),children:(0,s.jsx)(i.A,h({},f.default.stopSubscriptionCancel))}),(0,s.jsx)(d.default,{dataTestid:"stop-subscription-confirm-button",style:a.style,size:"py-2 px-4",fontSize:"text-sm",onClick:()=>t({id:b,name:u}),children:(0,s.jsx)(i.A,h({},f.default.stopSubscriptionConfirm))})]})]}),(0,s.jsxs)("div",{className:"w-full px-3 mt-3 text-left md:w-1/2 md:mt-0 md:text-right",children:[(0,s.jsx)(S,{as:"p",style:{margin:0},children:(0,s.jsxs)("strong",{children:[m," ",x]})}),(0,s.jsx)("br",{}),!v&&(0,s.jsxs)(S,{as:"p",style:{margin:0,fontSize:"0.8em",marginTop:"5px"},children:[(0,s.jsx)(i.A,h({},f.default.subscriptionRenewsAt)),":"," ",(0,s.jsx)(p.default,{time:!1,date:A})]}),v&&(0,s.jsxs)(S,{as:"p",style:{margin:0,fontSize:"0.8em",marginTop:"5px",color:"orange",borderColor:"orange"},children:[(0,s.jsx)(i.A,h({},f.default.subscriptionEndsAt)),":"," ",(0,s.jsx)(p.default,{time:!1,date:v})]})]})]})}v.propTypes={data:o().object,stopSubscription:o().func,buttonStyle:o().object};const A=v},64619:(e,t,a)=>{a.r(t),a.d(t,{createPodcastTokenAction:()=>E,createPodcastTokenErrorAction:()=>w,createPodcastTokenSuccessAction:()=>T,deletePodcastTokenAction:()=>P,deletePodcastTokenErrorAction:()=>C,deletePodcastTokenSuccessAction:()=>_,deleteUserAction:()=>N,deleteUserErrorAction:()=>R,deleteUserSuccessAction:()=>O,getPodcastTokensAction:()=>j,getPodcastTokensErrorAction:()=>A,getPodcastTokensSuccessAction:()=>v,getUserReceiptsAction:()=>r,getUserReceiptsErrorAction:()=>o,getUserReceiptsSuccessAction:()=>n,getUserSubscriptionsAction:()=>i,getUserSubscriptionsErrorAction:()=>l,getUserSubscriptionsSuccessAction:()=>d,stopSubscriptionAction:()=>y,stopSubscriptionErrorAction:()=>h,stopSubscriptionSuccessAction:()=>S,updatePasswordAction:()=>x,updatePasswordErrorAction:()=>g,updatePasswordSuccessAction:()=>b,updateUserAction:()=>p,updateUserCardAction:()=>c,updateUserCardErrorAction:()=>u,updateUserErrorAction:()=>f,updateUserSuccessAction:()=>m});var s=a(9701);function r(e){return{type:s.GET_USER_RECEIPTS,payload:e}}function n(e){return{type:s.GET_USER_RECEIPTS_SUCCESS,payload:e}}function o(e){return{type:s.GET_USER_RECEIPTS_ERROR,payload:e}}function i(){return{type:s.GET_USER_SUBSCRIPTIONS}}function d(e){return{type:s.GET_USER_SUBSCRIPTIONS_SUCCESS,payload:e}}function l(e){return{type:s.GET_USER_SUBSCRIPTIONS_ERROR,payload:e}}function c(e){return{type:s.UPDATE_USER_CARD,payload:e}}function u(e){return{type:s.UPDATE_USER_CARD_ERROR,payload:e}}function p(e){return{type:s.UPDATE_USER,payload:e}}function f(e){return{type:s.UPDATE_USER_ERROR,payload:e}}function m(e){return{type:s.UPDATE_USER_SUCCESS,payload:e}}function x(e){return{type:s.UPDATE_USER_PASSWORD,payload:e}}function g(e){return{type:s.UPDATE_USER_PASSWORD_ERROR,payload:e}}function b(e){return{type:s.UPDATE_USER_PASSWORD_SUCCESS,payload:e}}function y(e){return{type:s.STOP_SUBSCRIPTION,payload:e}}function h(e){return{type:s.STOP_SUBSCRIPTION_ERROR,payload:e}}function S(e){return{type:s.STOP_SUBSCRIPTION_SUCCESS,payload:e}}function j(){return{type:s.GET_PODCAST_TOKENS}}function v(e){return{type:s.GET_PODCAST_TOKENS_SUCCESS,payload:e}}function A(e){return{type:s.GET_PODCAST_TOKENS_ERROR,payload:e}}function E(e){return{type:s.CREATE_PODCAST_TOKEN,payload:e}}function T(e){return{type:s.CREATE_PODCAST_TOKEN_SUCCESS,payload:e}}function w(e){return{type:s.CREATE_PODCAST_TOKEN_ERROR,payload:e}}function P(e){return{type:s.DELETE_PODCAST_TOKEN,payload:e}}function _(e){return{type:s.DELETE_PODCAST_TOKEN_SUCCESS,payload:e}}function C(e){return{type:s.DELETE_PODCAST_TOKEN_ERROR,payload:e}}function N(){return{type:s.DELETE_USER}}function O(){return{type:s.DELETE_USER_SUCCESS}}function R(e){return{type:s.DELETE_USER_ERROR,payload:e}}},9701:(e,t,a)=>{a.r(t),a.d(t,{CREATE_PODCAST_TOKEN:()=>A,CREATE_PODCAST_TOKEN_ERROR:()=>T,CREATE_PODCAST_TOKEN_SUCCESS:()=>E,DELETE_PODCAST_TOKEN:()=>w,DELETE_PODCAST_TOKEN_ERROR:()=>
18_,DELETE_PODCAST_TOKEN_SUCCESS:()=>P,DELETE_USER:()=>C,DELETE_USER_ERROR:()=>O,DELETE_USER_SUCCESS:()=>N,GET_PODCAST_TOKENS:()=>S,GET_PODCAST_TOKENS_ERROR:()=>v,GET_PODCAST_TOKENS_SUCCESS:()=>j,GET_USER_RECEIPTS:()=>s,GET_USER_RECEIPTS_ERROR:()=>n,GET_USER_RECEIPTS_SUCCESS:()=>r,GET_USER_SUBSCRIPTIONS:()=>o,GET_USER_SUBSCRIPTIONS_ERROR:()=>d,GET_USER_SUBSCRIPTIONS_SUCCESS:()=>i,STOP_SUBSCRIPTION:()=>b,STOP_SUBSCRIPTION_ERROR:()=>h,STOP_SUBSCRIPTION_SUCCESS:()=>y,UPDATE_USER:()=>u,UPDATE_USER_CARD:()=>l,UPDATE_USER_CARD_ERROR:()=>c,UPDATE_USER_ERROR:()=>p,UPDATE_USER_PASSWORD:()=>m,UPDATE_USER_PASSWORD_ERROR:()=>x,UPDATE_USER_PASSWORD_SUCCESS:()=>g,UPDATE_USER_SUCCESS:()=>f});const s="app/AccountHandler/GET_USER_RECEIPTS",r="app/AccountHandler/GET_USER_RECEIPTS_SUCCESS",n="app/AccountHandler/GET_USER_RECEIPTS_ERROR",o="app/AccountHandler/GET_USER_SUBSCRIPTIONS",i="app/AccountHandler/GET_USER_SUBSCRIPTIONS_SUCCESS",d="app/AccountHandler/GET_USER_SUBSCRIPTIONS_ERROR",l="app/AccountHandler/UPDATE_USER_CARD",c="app/AccountHandler/UPDATE_USER_CARD_ERROR",u="app/AccountHandler/UPDATE_USER",p="app/AccountHandler/UPDATE_USER_ERROR",f="app/AccountHandler/UPDATE_USER_SUCCESS",m="app/AccountHandler/UPDATE_USER_PASSWORD",x="app/AccountHandler/UPDATE_USER_PASSWORD_ERROR",g="app/AccountHandler/UPDATE_USER_PASSWORD_SUCCESS",b="app/AccountHandler/STOP_SUBSCRIPTION",y="app/AccountHandler/STOP_SUBSCRIPTION_SUCCESS",h="app/AccountHandler/STOP_SUBSCRIPTION_ERROR",S="app/AccountHandler/GET_PODCAST_TOKENS",j="app/AccountHandler/GET_PODCAST_TOKENS_SUCCESS",v="app/AccountHandler/GET_PODCAST_TOKENS_ERROR",A="app/AccountHandler/CREATE_PODCAST_TOKEN",E="app/AccountHandler/CREATE_PODCAST_TOKEN_SUCCESS",T="app/AccountHandler/CREATE_PODCAST_TOKEN_ERROR",w="app/AccountHandler/DELETE_PODCAST_TOKEN",P="app/AccountHandler/DELETE_PODCAST_TOKEN_SUCCESS",_="app/AccountHandler/DELETE_PODCAST_TOKEN_ERROR",C="app/AccountHandler/DELETE_USER",N="app/AccountHandler/DELETE_USER_SUCCESS",O="app/AccountHandler/DELETE_USER_ERROR"},70064:(e,t,a)=>{a.r(t),a.d(t,{AccountHandler:()=>G,default:()=>V});var s=a(74848),r=a(96540),n=a(78210),o=a(16683),i=a(5556),d=a.n(i),l=a(67438),c=a(3279),u=a(17386),p=a(39522),f=a(1081),m=a(68074),x=a(51848),g=a(40260),b=a(74980),y=a(30261),h=a(6864),S=a(94686),j=a(4263),v=a(50321),A=a(24712),E=a(15422),T=a(50924),w=a(76814),P=a(64619),_=a(5508),C=a(71144),N=a(20932),O=a(41932),R=a(91675),U=a(87922),k=a(13446),$=a(71066),M=Object.defineProperty,D=Object.defineProperties,I=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,F=(e,t,a)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,z=(e,t)=>{for(var a in t||(t={}))B.call(t,a)&&F(e,a,t[a]);if(H)for(var a of H(t))L.call(t,a)&&F(e,a,t[a]);return e},K=(e,t)=>D(e,I(t));const Y=h.Ik().shape({email:h.Yj().email("A valid email is required").required("An email address is for your account"),firstname:h.Yj(),lastname:h.Yj()}),W=(0,f.j8)({accountHandler:(0,w.default)(),platform:(0,u.makeSelectPlatform)()});function G(e){const{user:t,isLoading:a}=(0,n.Jd)(),[i,d]=(0,r.useState)(""),[c,u]=(0,r.useState)(!1),f=(0,n.d7)(i,500),h=(0,o.wA)();(0,b.N)({key:"accountHandler",reducer:_.default}),(0,g.f)({key:"accountHandler",saga:U.default});const{intl:w,background:M,content:D,header:I,button:H,subscriptionInformation:B,podcastOptionActive:L={active:!1},terms:F="https://faq.staylive.io/en/article/user-terms-1vuzh4o/",privacypolicy:G="https://faq.staylive.io/en/article/privacy-policy-18sigqg/"}=e,{accountHandler:{receipts:V,loading:J,subscriptions:q,updateStates:X,podcasts:Z}}=(0,o.d4)(W);if((0,r.useEffect)((()=>{h((0,P.getUserReceiptsAction)()),h((0,P.getUserSubscriptionsAction)())}),[h]),(0,r.useEffect)((()=>{L.active&&h((0,P.getPodcastTokensAction)())}),[h,L.active]),a||!t)return"Loading...";const Q=[{menuItem:w.formatMessage(k.default.accountInformation),render:()=>(0,s.jsxs)("div",{children:[(0,s.jsx)(m.default,K(z({as:"h6"},I),{children:w.formatMessage(k.default.accountInformation).toUpperCase()})),X.updateUser.error&&(0,s.jsx)(T.default,{type:"error",className:"rounded-md",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.default,{as:"h6",style:{fontSize:"1em"},children:w.formatMessage(k.default.couldNotUpdateAccountInformation)}),(0,s.jsx)(m.default,{style:{fontSize:"1em"},children:w.formatMessage(k.default.couldNotUpdateAccountInformationSubheader)})]})}),X.updateUser.success&&(0,s.jsx)(T.default,{type:"success",className:"rounded-md",children:(0,s.jsx)(m.default,{as:"h6",style:{fontSize:"1em"},children:w.formatMessage(k.default.updateAccountInformationSuccess)})}),(0,s.jsx)(y.l1,{onSubmit:e=>h((0,P.updateUserAction)(e)),initialValues:{email:t.email,firstname:t.metadata.firstname,lastname:t.metadata.lastname},validationSchema:Y,validateOnMount:!0,children:e=>(0,s.jsxs)("form",{onSubmit:e.handleSubmit,className:"flex flex-col w-full",children:[(0,s.jsxs)("div",{className:"flex flex-col md:space-x-4 md:flex-row",children:[(0,s.jsx)("div",{className:"flex-1 my-2",children:(0,s.jsx)(j.default,{id:"firstname",name:"firstname",value:e.values.firstname,onChange:e.handleChange,error:e.errors.firstname?(0,s.jsx)(l.A,z({},k.default.firstnameIncorrect)):null,className:"w-full bg-white border border-opacity-25 border-solid rounded-md shadow-none",placeholder:w.formatMessage(p.default.firstname)})}),(0,s.jsx)("div",{className:"flex-1 my-2",children:(0,s.jsx)(j.default,{id:"lastname",name:"lastname",value:e.values.lastname,onChange:e.handleChange,error:e.errors.lastname?(0,s.jsx)(l.A,z({},k.default.lastnameIncorrect)):null,className:"w-full bg-white border border-opacity-25 border-solid rounded-md shadow-none",placeholder:w.formatMessage(p.default.lastname)})})]}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(j.default,{id:"email",name:"email",value:e.values.email,onChange:e.handleChange,error:e.errors.email?(0,s.jsx)(l.A,z({},k.default.emailIncorrect)):null,className:"bg-white border border-opacity-25 border-solid rounded-md shadow-none",placeholder:w.formatMessage(p.default.email)})}),(0,s.jsx)("div",{className:"mt-4 mb-4",children:(0,s.jsxs)("label",{htmlFor:"newsletter",className:"flex flex-row",children:[(0,s.jsx)("input",{type:"checkbox",name:"newsletter",id:"newsletter",className:"mt-1 mr-2 border border-solid form-checkbox",value:e.values.newsletter,onChange:e.handleChange}),(0,s.jsx)("div",{children:w.formatMessage(p.default.newsletterOptInMessage)})]})}),(0,s.jsx)("div",{children:(0,s.jsx)(v.default,{dataTestid:"update-account-button",type:"submit",size:"py-2.5 px-6",fontSize:"text-base",style:null==H?void 0:H.style,disabled:!e.isValid,loading:X.updateUser.loading,children:w.formatMessage(k.default.updateInformation)})})]})}),(0,s.jsx)(m.default,{as:"h6",style:K(z({},I.style),{marginTop:"20px"}),children:w.formatMessage(k.default.updatePassword)}),X.updatePassword.error&&(0,s.jsx)(T.default,{type:"error",className:"rounded-md",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.default,{as:"h6",style:{fontSize:"1em"},children:w.formatMessage(k.default.couldNotUpdatePassword)}),(0,s.jsx)(m.default,{style:{fontSize:"1em"},children:w.formatMessage(k.default.couldNotUpdatePasswordSubheader)})]})}),X.updatePassword.success&&(0,s.jsx)(T.default,{type:"success",className:"rounded-md",children:(0,s.jsx)(m.default,{as:"h6",style:{fontSize:"1em"},children:w.formatMessage(k.default.updatePasswordSuccess)})}),(0,s.jsx)(v.default,{dataTestid:"update-password-button",type:"submit",size:"py-2.5 px-6",fontSize:"text-base",style:null==H?void 0:H.style,loading:X.updatePassword.loading,children:w.formatMessage(k.default.updatePassword)}),(0,s.jsx)(m.default,{as:"h6",style:K(z({},I.style),{marginTop:"24px"}),children:w.formatMessage(p.default.termsAndConditions)}),(0,s.jsxs)(m.default,{children:[w.formatMessage(k.default.termsAndConditionsExplanation)," ",(0,s.jsx)("a",{href:F,target:"_blank",children:w.formatMessage(p.default.termsAndConditions)})," ","&"," ",(0,s.jsx)("a",{href:G,target:"_blank",children:w.formatMessage(p.default.privacyPolicy)}),"."]}),(0,s.jsx)("hr",{className:"mt-12 border-0 border-t border-gray-200 border-solid"}),(0,s.jsx)(m.default,{as:"h5",style:K(z({},I.style),{marginTop:"48px"}),children:(0,s.jsx)(l.A,z({},k.default.dangerZoneHeader))}),(0,s.jsx)(T.default,{type:"error",className:"rounded-md",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.default,{style:{fontSize:"1em",marginTop:"8px"},children:(0,s.jsx)(l.A,z({},k.default.deleteUser))}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)(m.default,{style:{fontSize:"1em",marginTop:"4px"},children:(0,s.jsx)(l.A,z({},k.default.deleteUserDescription))}),(0,s.jsx)(v.default,{dataTestid:"delete-user-button",size:"py-2.5 px-6",fontSize:"text-base",style:null==H?void 0:H.style,onClick:()=>u(!c),children:(0,s.jsx)(l.A,z({},k.default.deleteUserButtonText))})]})]})})]},"account")},{menuItem:w.formatMessage(k.default.receipts),render:()=>(0,s.jsxs)("div",{children:[(0,s.jsx)(j.default,{id:"search",name:"search",value:i,onChange:e=>d(e.target.value),placeholder:`${w.formatMessage(p.default.search)}...`}),(0,s.jsx)("div",{style:{padding:"6px"}}),J&&(0,s.jsx)(E.default,{size:8}),(0,s.jsx)(m.default,{as:"h6",style:K(z({},I.style),{marginTop:"12px"}),children:w.formatMessage(p.default.livestreams).toUpperCase()}),!J&&V.stream&&V.stream.length>0&&(0,s.jsx)("div",{className:"flex flex-col mt-2",children:V.stream.filter((e=>-1!==e.name.toLowerCase().search(f.toLowerCase()))).map((e=>(0,s.jsx)(C.default,{data:e},e.id)))}),!J&&V.stream&&0===V.stream.length&&(0,s.jsx)(m.default,{children:w.formatMessage(k.default.noReceiptsFound)}),(0,s.jsx)(m.default,{as:"h6",style:K(z({},I.style),{marginTop:"20px"}),children:w.formatMessage(p.default.videos)}),!J&&V.video&&V.video.length>0&&(0,s.jsx)("div",{className:"flex flex-col mt-2",children:V.video.filter((e=>-1!==e.name.toLowerCase().search(f.toLowerCase()))).map((e=>(0,s.jsx)(C.default,{data:e},e.id)))}),!J&&V.video&&0===V.video.length&&(0,s.jsx)(m.default,{children:w.formatMessage(k.default.noReceiptsFound)}),(0,s.jsx)(m.default,{as:"h6",style:K(z({},I.style),{marginTop:"20px"}),children:w.formatMessage(p.default.packages)}),!J&&V.package.length>0&&(0,s.jsx)("div",{className:"flex flex-col mt-2",children:V.package.filter((e=>-1!==e.name.toLowerCase().search(f.toLowerCase()))).map((e=>(0,s.jsx)(C.default,{data:e},e.id)))}),!J&&V.package&&0===V.package.length&&(0,s.jsx)(m.default,{children:w.formatMessage(k.default.noReceiptsFound)}),(0,s.jsx)(m.default,{as:"h6",style:K(z({},I.style),{marginTop:"20px"}),children:w.formatMessage(p.default.subscriptions)}),!J&&V.subscription&&V.subscription.length>0&&(0,s.jsx)("div",{className:"flex flex-col mt-2",children:V.subscription.filter((e=>-1!==e.name.toLowerCase().search(f.toLowerCase()))).map((e=>(0,s.jsx)(C.default,{data:e},e.id)))}),!J&&V.subscription&&0===V.subscription.length&&(0,s.jsx)(m.default,{children:w.formatMessage(k.default.noReceiptsFound)})]},"receipts")},{menuItem:w.formatMessage(p.default.subscriptions),render:()=>(0,s.jsxs)("div",{children:[(0,s.jsx)(m.default,K(z({as:"h6"},I),{children:w.formatMessage(p.default.subscriptions)})),!q.loading&&q.data.length>0&&(0,s.jsx)("div",{className:"flex flex-col mt-2",children:q.data.map((e=>(0,s.jsx)(R.default,{stopSubscription:e=>h((0,P.stopSubscriptionAction)(e)),buttonStyle:H,data:e},e.id)))}),q.loading&&(0,s.jsx)(E.default,{size:8}),!q.loading&&0===q.data.length&&(0,s.jsx)(m.default,{children:w.formatMessage(k.default.noSubscriptionsFound)}),(0,s.jsx)(m.default,{as:"h6",style:K(z({},I.style),{marginTop:"32px"}),children:w.formatMessage(p.default.paymentMethod)}),!q.loading&&q.data.length>0&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.default,{data:q.customer.card,setupIntent:q.session,buttonStyle:H,onSubmit:e=>h((0,P.updateUserCardAction)(e)),loading:X.updateCard.loading,error:X.updateCard.error})}),(0,s.jsx)("hr",{className:"my-4 border-0 border-t border-gray-200 border-solid"}),(0,s.jsx)(m.default,{text:B})]},"subscriptions")},L.active?{menuItem:w.formatMessage(p.default.podcastsRss),render:()=>(0,s.jsxs)("div",{children:[(0,s.jsx)(m.default,K(z({as:"h6"},I),{children:w.formatMessage(p.default.podcastsRss)})),(0,s.jsx)(m.default,{style:{lineHeight:"1.5em"},children:L.description}),Z.createState.error&&(0,s.jsx)(T.default,{type:"error",className:"rounded-md",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"font-bold",children:(0,s.jsx)(l.A,z({},k.default.createPodcastTokenErrorHeader))}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(l.A,z({},k.default.createPodcastTokenErrorDescription))})]})}),Z.createState.success&&(0,s.jsx)(T.default,{type:"success",className:"rounded-md",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"font-bold",children:(0,s.jsx)(l.A,z({},k.default.createPodcastTokenSuccessHeader))}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(l.A,z({},k.default.createPodcastTokenSuccessDescription))})]})}),Z.deleteState.success&&(0,s.jsx)(T.default,{type:"success",className:"rounded-md",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"font-bold",children:(0,s.jsx)(l.A,z({},k.default.deletePodcastTokenSuccessHeader))}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(l.A,z({},k.default.deletePodcastTokenSuccessDescription))})]})}),Z.deleteState.error&&(0,s.jsx)(T.default,{type:"error",className:"rounded-md",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"font-bold",children:(0,s.jsx)(l.A,z({},k.default.deletePodcastTokenErrorHeader))}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(l.A,z({},k.default.deletePodcastTokenErrorDescription))})]})}),(0,s.jsx)("div",{children:Z.loading&&(0,s.jsx)(E.default,{size:8})}),!Z.loading&&0===Z.data.length&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(v.default,{dataTestid:"generate-rss-url-button",size:"py-2.5 px-6",fontSize:"text-base",style:null==H?void 0:H.style,loading:Z.createState.loading,onClick:()=>h((0,P.createPodcastTokenAction)({feed:L.rssFeeds})),children:[(0,s.jsx)(A.default,{icon:["fa","plus"]}),(0,s.jsx)("span",{style:{marginLeft:"8px"},children:(0,s.jsx)(l.A,z({},k.default.generateRSSUrl))})]})}),!Z.loading&&!Z.error&&Z.data.length>0&&(0,s.jsx)("div",{className:"flex flex-col my-4",children:Z.data.map((e=>(0,s.jsx)(O.default,{feed:e,header:I,button:H,revokeAccess:e=>h((0,P.deletePodcastTokenAction)({id:e})),loading:Z.deleteState.loading},e.id)))}),(0,s.jsxs)("div",{style:{marginTop:"20px",color:"#4183C4"},children:[(0,s.jsx)(A.default,{icon:["fa","info"],className:"mr-2"}),(0,s.jsx)(m.default,{style:{display:"inline-block"},text:w.formatMessage(k.default.addRSSFeedToPodcastPlayer),as:"h9"})]})]},"podcasts")}
18:null].filter(Boolean);return(0,s.jsx)(S.default,K(z({},M),{children:(0,s.jsxs)("div",K(z({},D),{children:[(0,s.jsx)(m.default,K(z({as:"h1"},I),{children:w.formatMessage(p.default.accountSettings)})),(0,s.jsx)(m.default,{as:"p",children:!a&&t?t.email:""}),(0,s.jsxs)(x.fu,{as:"div",className:"mt-4",children:[(0,s.jsx)(x.wb,{className:"flex flex-col border-0 border-b border-gray-200 border-solid sm:flex-row",children:Q.map((e=>(0,s.jsx)(x.oz,{className:({selected:e})=>(e?"font-bold border-current border-x-0 border-t-0 border-b-2":"border-none")+" border-solid -mb-px text-left sm:text-center px-0 sm:px-4 py-2.5 bg-transparent cursor-pointer text-inherit focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:e.menuItem},e.menuItem)))}),(0,s.jsx)(x.T2,{className:"mt-4",children:Q.map((e=>(0,s.jsx)(x.Kp,{children:e.render},e.menuItem)))})]}),c&&(0,s.jsx)($.default,{close:()=>u(!1),onDelete:()=>h((0,P.deleteUserAction)())})]}))}))}G.propTypes={dispatch:d().func.isRequired,history:d().object,platform:d().object,accountHandler:d().object,background:d().object,content:d().object,header:d().object,button:d().object,subscriptionInformation:d().string,terms:d().string,podcastOptionActive:d().object,privacypolicy:d().string,intl:d().object};const V=(0,c.Ay)(G)},13446:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n,scope:()=>r});var s=a(11164);const r="app.containers.AccountHandler",n=(0,s.YK)({accountInformation:{id:`${r}.accountInformation`,defaultMessage:"Account information"},updateAccountInformationSuccess:{id:`${r}.updateAccountInformationSuccess`,defaultMessage:"Account information updated!"},couldNotUpdateAccountInformation:{id:`${r}.couldNotUpdateAccountInformation`,defaultMessage:"Could not update account information"},couldNotUpdateAccountInformationSubheader:{id:`${r}.couldNotUpdateAccountInformationSubheader`,defaultMessage:"Something went wrong when processing the information. Please check all fields and try again."},updateInformation:{id:`${r}.updateInformation`,defaultMessage:"UPDATE INFORMATION"},updatePassword:{id:`${r}.updatePassword`,defaultMessage:"UPDATE PASSWORD"},updatePasswordSuccess:{id:`${r}.updatePasswordSuccess`,defaultMessage:"Password updated!"},couldNotUpdatePassword:{id:`${r}.couldNotUpdatePassword`,defaultMessage:"Could not update password."},couldNotUpdatePasswordSubheader:{id:`${r}.couldNotUpdatePasswordSubheader`,defaultMessage:"We could not update your password. Make sure your old password is correct."},termsAndConditionsExplanation:{id:`${r}.termsAndConditionsExplanation`,defaultMessage:"The terms to use this service are found in our"},currentPassword:{id:`${r}.currentPassword`,defaultMessage:"Current Password"},newPassword:{id:`${r}.newPassword`,defaultMessage:"New Password"},receipts:{id:`${r}.receipts`,defaultMessage:"Receipts"},noReceiptsFound:{id:`${r}.noReceiptsFound`,defaultMessage:"No receipts found."},noSubscriptionsFound:{id:`${r}.noSubscriptionsFound`,defaultMessage:"No subscriptions found in your account."},refunded:{id:`${r}.refunded`,defaultMessage:"REFUNDED"},updateCardInformationHeader:{id:`${r}.updateCardInformationHeader`,defaultMessage:"UPDATE YOUR CARD INFORMATION"},changeCard:{id:`${r}.changeCard`,defaultMessage:"CHANGE CARD"},validThru:{id:`${r}.validThru`,defaultMessage:"Valid thru"},stopSubscription:{id:`${r}.stopSubscription`,defaultMessage:"STOP SUBSCRIPTION"},stopSubscriptionCancel:{id:`${r}.stopSubscriptionCancel`,defaultMessage:"NO, DO NOT CANCEL SUBSCRIPTION"},stopSubscriptionConfirm:{id:`${r}.stopSubscriptionConfirm`,defaultMessage:"YES, CANCEL SUBSCRIPTION"},subscriptionRenewsAt:{id:`${r}.subscriptionRenewsAt`,defaultMessage:"RENEWS"},subscriptionEndsAt:{id:`${r}.subscriptionEndsAt`,defaultMessage:"ENDS AT"},generateRSSUrl:{id:`${r}.generateRSSUrl`,defaultMessage:"Click here to generate your private RSS feed"},addRSSFeedToPodcastPlayer:{id:`${r}.addRSSFeedToPodcastPlayer`,defaultMessage:"<a href='https://support.staylive.se/hc/sv/articles/360011950800' target='_blank'>How do I add this to my Podcast player?</a>"},createPodcastTokenErrorHeader:{id:`${r}.createPodcastTokenErrorHeader`,defaultMessage:"Could not generate Podcast feed"},createPodcastTokenErrorDescription:{id:`${r}.createPodcastTokenErrorDescription`,defaultMessage:"Something went wrong when generating your private Podcast feed. Please try again."},createPodcastTokenSuccessHeader:{id:`${r}.createPodcastTokenSuccessHeader`,defaultMessage:"Your private feed has been created."},createPodcastTokenSuccessDescription:{id:`${r}.createPodcastTokenSuccessDescription`,defaultMessage:"We have created your own private RSS feed. You can now add this to your Podcast player to start listening."},deletePodcastTokenSuccessHeader:{id:`${r}.deletePodcastTokenSuccessHeader`,defaultMessage:"Your private feed has been revoked."},deletePodcastTokenSuccessDescription:{id:`${r}.deletePodcastTokenSuccessDescription`,defaultMessage:"Your private feed has been revoked and can no longer be used. You can always generate a new feed if you'd like."},deletePodcastTokenErrorHeader:{id:`${r}.deletePodcastTokenErrorHeader`,defaultMessage:"Something went wrong."},deletePodcastTokenErrorDescription:{id:`${r}.deletePodcastTokenErrorDescription`,defaultMessage:"Something went wrong when trying to revoke the access. Please try again."},issued:{id:`${r}.issued`,defaultMessage:"Issued"},podcastFeedUrl:{id:`${r}.podcastFeedUrl`,defaultMessage:"URL for your Podcast player"},lastSeen:{id:`${r}.lastSeen`,defaultMessage:"Last seen"},revokeAccess:{id:`${r}.revokeAccess`,defaultMessage:"Revoke access"},areYouSureRevokeAccess:{id:`${r}.areYouSureRevokeAccess`,defaultMessage:"Are you sure you want to revoke the access to this feed?"},paymentFailedSubscription:{id:`${r}.paymentFailedSubscription`,defaultMessage:"Payment failed"},paymentFailedSubscriptionDescription:{id:`${r}.paymentFailedSubscriptionDescription`,defaultMessage:"The payment for this subscription has failed and the subscription is currently inactive. Click the button below to retry the payment."},retryPayment:{id:`${r}.retryPayment`,defaultMessage:"Retry payment"},contentAvailableUntil:{id:`${r}.contentAvailableUntil`,defaultMessage:"Content available until"},emailIncorrect:{id:`${r}.emailIncorrect`,defaultMessage:"The email is not formatted correctly. Please verify and try again."},firstnameIncorrect:{id:`${r}.firstnameIncorrect`,defaultMessage:"The first name is not formatted correctly. Please verify and try again."},lastnameIncorrect:{id:`${r}.lastnameIncorrect`,defaultMessage:"The last name is not formatted correctly. Please verify and try again."},dangerZoneHeader:{id:`${r}.dangerZoneHeader`,defaultMessage:"Danger zone"},deleteUser:{id:`${r}.deleteUser`,defaultMessage:"Delete user"},deleteUserDescription:{id:`${r}.deleteUserDescription`,defaultMessage:"Your user will be permanently deleted. "},deleteUserButtonText:{id:`${r}.deleteUserButtonText`,defaultMessage:"Delete user"},deleteUserWarning:{id:`${r}.deleteUserWarning`,defaultMessage:"WARNING!"},deleteUserAbortButtonText:{id:`${r}.deleteUserAbortButtonText`,defaultMessage:"Cancel"},deleteUserModalText:{id:`${r}.deleteUserModalText`,defaultMessage:"Are you really sure you want to delete your user?"}})},71144:(e,t,a)=>{a.r(t),a.d(t,{Receipt:()=>h,default:()=>S});var s=a(74848),r=(a(96540),a(5556)),n=a.n(r),o=a(67438),i=a(68074),d=a(38267),l=a(26840),c=a(13446),u=Object.defineProperty,p=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,x=(e,t,a)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,g=(e,t)=>{for(var a in t||(t={}))f.call(t,a)&&x(e,a,t[a]);if(p)for(var a of p(t))m.call(t,a)&&x(e,a,t[a]);return e};const b=(0,d.Ay)(i.default)`
19  color: green;
20  border: 1px solid green;
21  border-radius: 3px;
22  padding: 4px 12px;
23  display: inline-block;
24  text-transform: uppercase;
25`,y=d.Ay.sup`
26  font-size: 0.5em;
27  color: red;
28  margin-left: 4px;
29`;function h({data:e}){const{name:t,created_at:a,valid_until:r,price:n,currency:d,txn:u,refunded:p,amount:f,invoice_id:m}=e;return(0,s.jsxs)("div",{className:"flex items-center w-full px-3 py-4 my-1 border border-gray-100 border-solid rounded-md",children:[(0,s.jsxs)("div",{className:"w-1/2 px-3",children:[(0,s.jsxs)(i.default,{as:"p",style:{padding:0,margin:0},children:[(0,s.jsx)("span",{className:"font-medium",children:t}),2===p&&(0,s.jsx)(y,{children:(0,s.jsx)(o.A,g({},c.default.refunded))})]}),(0,s.jsx)(i.default,{as:"p",style:{fontSize:"0.9em",margin:0},text:(0,s.jsx)(l.default,{date:a})}),r&&(0,s.jsxs)("div",{className:"mt-2 text-md sm:text-lg",children:[(0,s.jsx)(o.A,g({},c.default.contentAvailableUntil))," ",(0,s.jsx)(l.default,{date:r})]})]}),(0,s.jsxs)("div",{className:"w-1/2 px-3 text-right",children:[(f>0||n>0)&&(0,s.jsx)(b,{as:"p",style:{margin:0},children:(0,s.jsxs)("strong",{children:[n||f," ",d]})}),(0,s.jsx)("br",{}),(0,s.jsx)(b,{as:"p",style:{margin:0,fontSize:"0.8em",marginTop:"5px",wordBreak:"break-word"},children:u||m})]})]})}h.propTypes={data:n().object};const S=h},5508:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m,initialState:()=>f});var s=a(64852),r=a(32689),n=a(9701),o=Object.defineProperty,i=Object.defineProperties,d=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,t,a)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const f={loading:!0,error:null,receipts:{stream:[],video:[],package:[]},updateStates:{updatePassword:{loading:!1,error:!1,success:!1},updateCard:{loading:!1,error:!1},updateUser:{loading:!1,error:!1,success:!1}},subscriptions:{loading:!0,error:null,customer:{},setupIntent:null,session:{},data:[]},podcasts:{loading:!0,error:!1,data:[],createState:{loading:!1,success:!1,error:!1},deleteState:{loading:!1,success:!1,error:!1}}},m=(e=f,t)=>(0,s.Ay)(e,(e=>{switch(t.type){case n.GET_USER_RECEIPTS:e.loading=!0,e.error=!1,e.receipts={stream:[],video:[],package:[]};break;case n.GET_USER_RECEIPTS_SUCCESS:e.loading=!1,e.error=!1,e.receipts=t.payload.message;break;case n.GET_USER_RECEIPTS_ERROR:e.loading=!1,e.error=t.payload,e.receipts={stream:[],video:[],package:[]};break;case n.GET_USER_SUBSCRIPTIONS:e.subscriptions=f.subscriptions,e.updateStates.updateCard.loading=!1,e.updateStates.updateCard.error=!1;break;case n.GET_USER_SUBSCRIPTIONS_SUCCESS:e.subscriptions={loading:!1,error:null,updateCard:f.updateStates.updateCard,customer:t.payload.message.customer,session:t.payload.message.session,update_card:t.payload.message.update_card,data:t.payload.message.subscriptions};break;case n.GET_USER_SUBSCRIPTIONS_ERROR:e.subscriptions=(a=((e,t)=>{for(var a in t||(t={}))c.call(t,a)&&p(e,a,t[a]);if(l)for(var a of l(t))u.call(t,a)&&p(e,a,t[a]);return e})({},f.subscriptions),s={loading:!1,error:t.payload},i(a,d(s)));break;case n.UPDATE_USER_CARD:e.updateStates.updateCard.loading=!0,e.updateStates.updateCard.error=!1;break;case n.UPDATE_USER_CARD_ERROR:e.updateStates.updateCard.loading=!1,e.updateStates.updateCard.error=!0;break;case n.UPDATE_USER:e.updateStates.updateUser.loading=!0,e.updateStates.updateUser.error=!1,e.updateStates.updateUser.success=!1;break;case n.UPDATE_USER_ERROR:e.updateStates.updateUser.loading=!1,e.updateStates.updateUser.error=!0,e.updateStates.updateUser.success=!1;break;case n.UPDATE_USER_SUCCESS:e.updateStates.updateUser.loading=!1,e.updateStates.updateUser.error=!1,e.updateStates.updateUser.success=!0;break;case n.UPDATE_USER_PASSWORD:e.updateStates.updatePassword.loading=!0,e.updateStates.updatePassword.error=!1,e.updateStates.updatePassword.success=!1;break;case n.UPDATE_USER_PASSWORD_ERROR:e.updateStates.updatePassword.loading=!1,e.updateStates.updatePassword.error=!0,e.updateStates.updatePassword.success=!1;break;case n.UPDATE_USER_PASSWORD_SUCCESS:e.updateStates.updatePassword.loading=!1,e.updateStates.updatePassword.error=!1,e.updateStates.updatePassword.success=!0;break;case r.USER_LOADED_SUCCESS:e.updateStates.updatePassword.loading=!1,e.updateStates.updatePassword.error=!1,e.updateStates.updateUser.loading=!1,e.updateStates.updateUser.error=!1;break;case n.STOP_SUBSCRIPTION:e.subscriptions.loading=!0,e.subscriptions.error=!1;break;case n.STOP_SUBSCRIPTION_ERROR:e.subscriptions.loading=!1,e.subscriptions.error=!1;break;case n.GET_PODCAST_TOKENS:e.podcasts.loading=!0,e.podcasts.error=!1,e.podcasts.data=[];break;case n.GET_PODCAST_TOKENS_SUCCESS:e.podcasts.loading=!1,e.podcasts.error=!1,e.podcasts.data=t.payload.message;break;case n.GET_PODCAST_TOKENS_ERROR:e.podcasts.loading=!1,e.podcasts.error=!0,e.podcasts.data=[];break;case n.CREATE_PODCAST_TOKEN:e.podcasts.createState.loading=!0,e.podcasts.createState.error=!1,e.podcasts.deleteState.error=!1,e.podcasts.deleteState.success=!1,e.podcasts.createState.success=!1;break;case n.CREATE_PODCAST_TOKEN_SUCCESS:e.podcasts.createState.loading=!1,e.podcasts.createState.error=!1,e.podcasts.createState.success=!0;break;case n.CREATE_PODCAST_TOKEN_ERROR:e.podcasts.createState.loading=!1,e.podcasts.createState.error=!0,e.podcasts.createState.success=!1;break;case n.DELETE_PODCAST_TOKEN:e.podcasts.deleteState.loading=!0,e.podcasts.deleteState.error=!1,e.podcasts.deleteState.success=!1,e.podcasts.createState.error=!1,e.podcasts.createState.success=!1;break;case n.DELETE_PODCAST_TOKEN_SUCCESS:e.podcasts.deleteState.loading=!1,e.podcasts.deleteState.error=!1,e.podcasts.deleteState.success=!0;break;case n.DELETE_PODCAST_TOKEN_ERROR:e.podcasts.deleteState.loading=!1,e.podcasts.deleteState.error=!0,e.podcasts.deleteState.success=!1}var a,s}))},87922:(e,t,a)=>{a.r(t),a.d(t,{createPodcastToken:()=>b,default:()=>S,deletePodcastToken:()=>y,deleteUser:()=>h,getPodcastTokens:()=>g,getReceipts:()=>c,getSubscriptions:()=>u,stopSubscription:()=>x,updateCard:()=>p,updateUserInformation:()=>f,updateUserPassword:()=>m});var s=a(43786),r=a(72748),n=a(30727),o=a(32689),i=a(52549),d=a(9701),l=a(64619);function*c(){const e=yield(0,s.T1)(n.k0),t=`${o.DEFAULT_STAYLIVE_API}user/receipts`;try{if(!e)throw Error("No token provided");const a=yield(0,s.T1)(r.Ay,t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});yield(0,s.yJ)((0,l.getUserReceiptsSuccessAction)(a))}catch(e){yield(0,s.yJ)((0,l.getUserReceiptsErrorAction)(e))}}function*u(){const e=yield(0,s.T1)(n.k0,!0),t=`${o.DEFAULT_STAYLIVE_API}subscriptions`;try{if(!e)throw Error("No token provided");const a=yield(0,s.T1)(r.Ay,t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});yield(0,s.yJ)((0,l.getUserSubscriptionsSuccessAction)(a))}catch(e){yield(0,s.yJ)((0,l.getUserSubscriptionsErrorAction)(e))}}function*p(e){const t=yield(0,s.T1)(n.k0),a=e.payload.requestPayload,i=`${o.DEFAULT_STAYLIVE_API}card`;try{if(!t)throw Error("No token provided");yield(0,s.T1)(r.Ay,i,{method:"PUT",body:JSON.stringify({token:a}),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}),yield(0,s.yJ)((0,l.getUserSubscriptionsAction)())}catch(e){yield(0,s.yJ)((0,l.updateUserCardErrorAction)(e))}}function*f(e){const t=yield(0,s.T1)(n.k0),{firstname:a,lastname:i,email:d,newsletter:c,birthdate:u}=e.payload,p=`${o.DEFAULT_STAYLIVE_API}user`;try{yield(0,s.T1)(r.Ay,p,{method:"PUT",body:JSON.stringify({firstname:a,lastname:i,email:d,newsletter:1===c||c,birthdate:u||null}),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}),yield(0,s.yJ)((0,l.updateUserSuccessAction)())}catch(e){yield(0,s.yJ)((0,l.updateUserErrorAction)(e))}}function*m(e){const t=yield(0,s.T1)(n.k0),{old_password:a,new_password:i}=e.payload,d=`${o.DEFAULT_STAYLIVE_API}user`;try{yield(0,s.T1)(r.Ay,d,{method:"PUT",body:JSON.stringify({old_password:a,new_password:i}),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}),yield(0,s.yJ)((0,l.updatePasswordSuccessAction)())}catch(e){yield(0,s.yJ)((0,l.updatePasswordErrorAction)(e))}}function*x(e){const t=yield(0,s.T1)(n.k0),a=yield(0,s.T1)(n.wz),{id:i,name:d}=e.payload,c=`${o.DEFAULT_STAYLIVE_API}subscription/${i}`;try{yield(0,s.T1)(r.Ay,c,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}),yield(0,s.yJ)((0,l.getUserSubscriptionsAction)()),yield(0,s.yJ)((0,l.stopSubscriptionSuccessAction)({id:i,name:d,user:a.metadata.id}))}catch(e){yield(0,
29s.yJ)((0,l.stopSubscriptionErrorAction)(e))}}function*g(){const e=yield(0,s.T1)(n.k0),t=`${o.DEFAULT_STAYLIVE_API}rss/podcast/tokens`;try{const a=yield(0,s.T1)(r.Ay,t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});yield(0,s.yJ)((0,l.getPodcastTokensSuccessAction)(a))}catch(e){yield(0,s.yJ)((0,l.getPodcastTokensErrorAction)(e))}}function*b(e){const t=yield(0,s.T1)(n.k0),{feed:a}=e.payload,i=`${o.DEFAULT_STAYLIVE_API}rss/podcast/tokens`;try{const e=yield(0,s.T1)(r.Ay,i,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({feed:a})});yield(0,s.yJ)((0,l.createPodcastTokenSuccessAction)(e)),yield(0,s.yJ)((0,l.getPodcastTokensAction)())}catch(e){yield(0,s.yJ)((0,l.createPodcastTokenErrorAction)(e))}}function*y(e){const t=yield(0,s.T1)(n.k0),{id:a}=e.payload,i=`${o.DEFAULT_STAYLIVE_API}rss/podcast/tokens/${a}`;try{yield(0,s.T1)(r.Ay,i,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}),yield(0,s.yJ)((0,l.deletePodcastTokenSuccessAction)()),yield(0,s.yJ)((0,l.getPodcastTokensAction)())}catch(e){yield(0,s.yJ)((0,l.deletePodcastTokenErrorAction)(e))}}function*h(){const e=yield(0,s.T1)(n.k0),t=`${o.DEFAULT_STAYLIVE_API}user`;try{yield(0,s.T1)(r.Ay,t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}),yield(0,s.yJ)((0,l.deleteUserSuccessAction)()),yield(0,s.T1)(i.__),yield(0,s.T1)(n.ri)}catch(e){yield(0,s.T1)(i.QA),yield(0,s.yJ)((0,l.deleteUserErrorAction)(e))}}function*S(){yield(0,s.p8)(d.GET_USER_RECEIPTS,c),yield(0,s.p8)(d.GET_USER_SUBSCRIPTIONS,u),yield(0,s.p8)(d.UPDATE_USER_CARD,p),yield(0,s.p8)(d.UPDATE_USER,f),yield(0,s.p8)(d.UPDATE_USER_PASSWORD,m),yield(0,s.p8)(d.STOP_SUBSCRIPTION,x),yield(0,s.p8)(d.GET_PODCAST_TOKENS,g),yield(0,s.p8)(d.CREATE_PODCAST_TOKEN,b),yield(0,s.p8)(d.DELETE_PODCAST_TOKEN,y),yield(0,s.p8)(d.DELETE_USER,h)}},76814:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o,selectAccountHandlerDomain:()=>n});var s=a(1081),r=a(5508);const n=e=>e.accountHandler||r.initialState,o=()=>(0,s.Mz)(n,(e=>e))},63808:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var s=a(74848),r=a(96540),n=a(67438),o=a(5556),i=a.n(o),d=a(24712),l=a(61878),c=a(66607),u=a(64140),p=Object.defineProperty,f=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,g=(e,t,a)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,b=(e,t)=>{for(var a in t||(t={}))m.call(t,a)&&g(e,a,t[a]);if(f)for(var a of f(t))x.call(t,a)&&g(e,a,t[a]);return e};function y({verificationCodeStatus:e,onSendVerCode:t,onValidateCode:a,onModalClose:o,updateUserState:i}){const[p,f]=(0,r.useState)(""),[m,x]=(0,r.useState)(!1),[g,y]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{p.length>4?x(!0):x(!1)}),[p]),(0,r.useEffect)((()=>{i.success&&y(!0)}),[i.success]),g?(0,s.jsx)(c.default,{verificationStatus:e,mail:p,onVerify:a,onResendCode:()=>t(p)}):(0,s.jsxs)("div",{className:"max-w-md p-8 text-black bg-white rounded-xl",children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,s.jsx)("h3",{className:"m-0 text-xl font-medium ",children:(0,s.jsx)(n.A,b({},l.default.changeEmail))}),(0,s.jsx)("button",{onClick:o,className:"p-0 text-black bg-transparent border-none cursor-pointer ",type:"button",children:(0,s.jsx)(d.default,{icon:["fa","times"],className:"text-2xl"})})]}),(0,s.jsx)("div",{children:(0,s.jsx)(n.A,b({},l.default.accountChangeMailDescription))}),i.error&&(0,s.jsx)(u.ErrorIndicator,{header:l.default.verificationCodeError}),(0,s.jsx)("label",{className:"block mt-6 text-gray-700",htmlFor:"email",children:(0,s.jsx)(n.A,b({},l.default.accountEnterNewMail))}),(0,s.jsx)("input",{className:"block w-full px-4 py-2 border-gray-300 border-solid rounded-md shadow-sm",value:p,onChange:e=>f(e.target.value),name:"email",type:"email"}),(0,s.jsx)("button",{disabled:!m,onClick:()=>{t(p)},className:(m?"bg-primary hover:opacity-75":"bg-gray-400")+" mt-6 px-4 py-2 text-white whitespace-nowrap border-none rounded-md cursor-pointer",type:"button",children:(0,s.jsx)(n.A,b({},l.default.accountEmailVerificationButton))})]})}y.propTypes={verificationCodeStatus:i().object,onSendVerCode:i().func,onValidateCode:i().func,onModalClose:i().func,updateUserState:i().object};const h=y},68745:(e,t,a)=>
29{a.r(t),a.d(t,{CardDetails:()=>P,default:()=>_});var s=a(74848),r=a(96540),n=a(5556),o=a.n(n),i=a(67438),d=a(3279),l=a(24712),c=a(32689),u=a(37427),p=a(15422),f=a(50924),m=a(39522),x=a(61878),g=Object.defineProperty,b=Object.defineProperties,y=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,v=(e,t,a)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,A=(e,t)=>{for(var a in t||(t={}))S.call(t,a)&&v(e,a,t[a]);if(h)for(var a of h(t))j.call(t,a)&&v(e,a,t[a]);return e},E=(e,t)=>b(e,y(t)),T=(e,t,a)=>new Promise(((s,r)=>{var n=e=>{try{i(a.next(e))}catch(e){r(e)}},o=e=>{try{i(a.throw(e))}catch(e){r(e)}},i=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);i((a=a.apply(e,t)).next())}));const w=(0,u.c)(c.STRIPE_PUBLISHABLE_TOKEN);function P({data:e,buttonStyle:t,setupIntent:a,intl:n}){const{brand:o,last4:d,exp_month:c,exp_year:u}=e,[g,b]=(0,r.useState)(!1),[y,h]=(0,r.useState)(!1);return(0,s.jsxs)("div",{className:"inline-flex flex-col",children:[(0,s.jsxs)("div",{className:"p-6 bg-gray-100 rounded-md shadow-md ",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"m-0 mb-2 uppercase",children:o}),(0,s.jsxs)("p",{children:[(0,s.jsx)(l.default,{icon:["fa","credit-card"],className:"mr-2"}),"**** **** **** ",d]})]}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsxs)("p",{children:[n.formatMessage(x.default.validThru),": ",c," / ",u]})})]}),y&&(0,s.jsx)("span",{className:"mt-4",children:(0,s.jsx)(f.default,{type:"error",className:"rounded-md",children:(0,s.jsx)(i.A,A({},m.default.stripeNotLoaded))})}),(0,s.jsx)("button",E(A({className:"p-0 mt-4 text-left underline bg-transparent border-none cursor-pointer text-primary",type:"submit"},t),{onClick:()=>T(this,null,(function*(){let e;b(!0),h(!1);try{e=yield w}catch(e){return console.error(e),b(!1),void h(!0)}const{paymentError:t}=yield e.redirectToCheckout({sessionId:a.id});t&&b(!1)})),children:g?(0,s.jsx)(p.default,{size:8}):n.formatMessage(x.default.changeCard)}))]})}w.catch((()=>{}
29)),P.propTypes={data:o().object,buttonStyle:o().object,intl:o().object,setupIntent:o().string};const _=(0,d.Ay)(P)},28896:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var s=a(74848),r=(a(96540),a(5556)),n=a.n(r),o=a(64140),i=a(61878);function d({type:e}){let t="",a="";switch(e){case"app/AccountSettings/UPDATE_USER_SUCCESS":a=i.default.updateAccountInformationSuccess,t="success";break;case"app/AccountSettings/UPDATE_USER_ERROR":a=i.default.couldNotUpdateAccountInformation,t="error";break;case"app/AccountSettings/UPDATE_USER_PASSWORD_SUCCESS":a=i.default.updatePasswordInformationSuccess,t="success";break;case"app/AccountSettings/UPDATE_USER_PASSWORD_ERROR":a=i.default.updatePasswordInformationError,t="error";break;default:return null}return"success"===t?(0,s.jsx)(o.SuccessIndicator,{header:a}):"error"===t?(0,s.jsx)(o.ErrorIndicator,{header:a}):void 0}d.propTypes={type:n().object};const l=d},52694:(e,t,a)=>{a.r(t),a.d(t,{default:()=>z});var s=a(74848),r=a(96540),n=a(67438),o=a(16683),i=a(1081),d=a(5556),l=a.n(d),c=a(30261),u=a(45581),p=a(6864),f=a(39522),m=a(51978),x=a(15422),g=a(31689),b=a(17386),y=a(24100),h=a(77461),S=a(72748),j=a(60799),v=a(50321),A=a(21988),E=a(61878),T=a(56642),w=a(28896),P=a(13064),_=a(20715),C=a(45523),N=a(56352),O=Object.defineProperty,R=Object.defineProperties,U=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,D=(e,t,a)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,I=(e,t)=>{for(var a in t||(t={}))$.call(t,a)&&D(e,a,t[a]);if(k)for(var a of k(t))M.call(t,a)&&D(e,a,t[a]);return e},H=(e,t)=>{var a={};for(var s in e)$.call(e,s)&&t.indexOf(s)<0&&(a[s]=e[s]);if(null!=e&&k)for(var s of k(e))t.indexOf(s)<0&&M.call(e,s)&&(a[s]=e[s]);return a},B=(e,t,a)=>new Promise(((s,r)=>{var n=e=>{try{i(a.next(e))}catch(e){r(e)}},o=e=>{try{i(a.throw(e))}catch(e){r(e)}},i=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);i((a=a.apply(e,t)).next())}));const L=(0,i.j8)({platform:(0,b.makeSelectPlatform)()});function F({user:e,updateStates:t,classes:a}){var i,d,l,b,O;const[k,$]=(0,r.useState)(!1),[M,D]=(0,r.useState)(!1),F=(0,o.wA)(),{data:z,isValidating:K}=(0,h.Q)(),{baseColor:Y,BASE_COLORS:W}=(0,u.m)(),G=Y===W.dark,{getAccessTokenSilently:V}=(0,A.WB)(),{platform:J}=(0,o.d4)(L),q=null==(i=null==e?void 0:e.subscriptions)?void 0:i.filter((e=>null===e.active_until)),X=(0,g._)(),{data:Z,mutate:Q}=(0,N.n)(),ee=null==Z?void 0:Z.find((e=>"UA_newsletter"===e.attribute_uid));let te=Z?[...Z]:[];ee||null==te||te.push({answer:Number(X.newsletter),attribute_uid:"UA_newsletter",input_type:"CHECKBOX"});const ae=p.Ik().shape({name:p.Yj().min(2,"Your name needs to be at least 2 characters"),email:p.Yj().email("Invalid email address").required("Email is required")});return M?(0,s.jsx)(c.l1,{"data-testid":"verification-code-form",initialValues:{verificationCode:""},onSubmit:(e,t)=>B(this,[e,t],(function*(e,{setSubmitting:t}){t(!0);try{yield(0,S.Ku)("verify/user/access",{code:e.verificationCode}),j.Ay.success((0,s.jsx)(n.A,I({},E.default.verificationCodeSuccess))),D(!1)}catch(e){j.Ay.error((0,s.jsx)(n.A,I({},E.default.verificationCodeError)))}finally{t(!1)}})),children:({isSubmitting:e})=>(0,s.jsx)(c.lV,{children:(0,s.jsx)("div",{className:a.wrapper,children:(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"verificationCode",className:`${a.textColor} block font-medium`,children:(0,s.jsx)(n.A,I({},E.default.accountVerificationCodeHeader))}),(0,s.jsx)("p",{className:`${a.textColor} text-base`,children:(0,s.jsx)(n.A,I({},E.default.verificationCodeSent))}),(0,s.jsx)(c.D0,{name:"verificationCode",type:"text",className:"block w-full max-w-xs px-3 py-2 mt-1 border border-gray-300 border-solid rounded-md shadow-sm focus:outline-none focus:border-primary"}),(0,s.jsx)(c.Kw,{name:"verificationCode",component:"p",className:"mt-1 font-semibold text-red-500"}),(0,s.jsxs)("div",{className:"flex gap-4 mt-4",children:[(0,s.jsx)(v.default,{"data-testid":"verify-code",className:a.button,type:"submit",loading:e,disabled:e,children:(0,s.jsx)(n.A,I({},E.default.verify))}),(0,s.jsx)(v.default,{"data-testid":"cancel-verification-code",className:a.button,type:"button",color:"secondary",onClick:()=>D(!1),children:(0,s.jsx)(n.A,I({},f.default.cancel))})]})]})})})}):K&&!z||!e?(0,s.jsx)(x.default,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.default,{type:t.generalStatus}),!(null==e?void 0:e.isAuth0User)&&(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsx)("h4",{className:`${a.textColor} text-xl font-medium m-0`,children:(0,s.jsx)(n.A,I({},E.default.authType))}),(0,s.jsx)("p",{className:`${a.textColor} mb-1`,children:e.name}),(0,s.jsx)("p",{className:`${a.textColor} text-base`,children:(0,s.jsx)(n.A,(se=I({},E.default.authTypeDescription),re={values:{provider:(0,y.xr)(null==(d=null==e?void 0:e.sub)?void 0:d.split("|")[0])}},R(se,U(re))))})]}),(0,s.jsx)(c.l1,{validationSchema:ae,"data-testid":"account-information-form",initialValues:{name:e.name,email:e.email,user_attributes:null==te?void 0:te.reduce(((e,t)=>{let a=t.answer;return"CHECKBOX"===t.input_type?a=Boolean(t.answer):"SELECT"===t.input_type&&(a=Array.isArray(t.answer)&&t.answer.length>0?t.answer[0]:null),e[t.attribute_uid]=a,e}),{})},onSubmit:(t,a)=>B(this,[t,a],(function*(t,{setSubmitting:a,resetForm:r}){const o=t,{email:i,user_attributes:d}=o,l=H(o,["email","user_attributes"]),c=t,{user_attributes:u}=c,p=H(c,["user_attributes"]),f=e.isAuth0User?p:l;try{if(Object.keys(u).length>0){const e=Object.entries(u).map((([e,t])=>{var a,s;const r=null==Z?void 0:Z.find((t=>t.attribute_uid===e));let n=t;if("CHECKBOX"===(null==r?void 0:r.input_type)){const e=null==(s=null==(a=r.options)?void 0:a[0])?void 0:s.id;n=t&&e?e:null}return{attribute_id:null==r?void 0:r.id,answer:n}})).filter((e=>e.attribute_id));e.length>0&&(yield(0,S.hr)(`platforms/${J.uid}/user-attributes/answers`,{answers:e}),Q())}if(yield(0,S.hr)("user",I({},f)),i!==e.email)return j.Ay.success((0,s.jsx)(n.A,I({},E.default.verificationCodeSent))),D(!0);j.Ay.success((0,s.jsx)(n.A,I({},E.default.updateAccountInformationSuccess))),yield V({cacheMode:"off"}),r(),a(!1)}catch(e){j.Ay.error((0,s.jsx)(n.A,I({},E.default.couldNotUpdateAccountInformation))),a(!1)}})),enableReinitialize:!0,children:({dirty:t,values:r,setFieldValue:o,setFieldTouched:i,isValid:d,isSubmitting:l})=>(0,s.jsx)(c.lV,{children:(0,s.jsxs)("div",{className:"flex flex-col space-y-4",children:[e.isAuth0User&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{className:`${a.textColor} text-xl font-medium m-0`,children:(0,s.jsx)(n.A,I({},E.default.accountUserDetails))}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"email",className:`${a.textColor} block font-medium mb-1`,children:(0,s.jsx)(n.A,I({},E.default.accountEmailHeader))}),(0,s.jsx)(c.D0,{className:"block w-full px-3 rounded-md border border-solid focus:outline-none transition-colors "+(G?"bg-zinc-800 text-gray-100 border-gray-600 focus:border-primary":"bg-white text-gray-900 border-gray-300 focus:border-primary"),style:{minHeight:"42px"},name:"email",type:"email","data-testid":"account-email-input"}),(0,s.jsx)(c.Kw,{name:"email",component:"p",className:"mt-1 font-semibold text-red-500"})]})]}),(0,s.jsx)("div",{children:e.isAuth0User&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("label",{htmlFor:"name",className:`${a.textColor} block font-medium mb-1`,children:(0,s.jsx)(n.A,I({},E.default.userName))}),(0,s.jsx)(c.D0,{type:"text",className:"block w-full px-3 rounded-md border border-solid focus:outline-none transition-colors "+(G?"bg-zinc-800 text-gray-100 border-gray-600 focus:border-primary":"bg-white text-gray-900 border-gray-300 focus:border-primary"),style:{minHeight:"42px"},name:"name","data-testid":"account-name-input"}),(0,s.jsx)(c.Kw,{name:"name",component:"p",className:"mt-1 font-semibold text-red-500"})]})}),(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsx)(C.default,{whenToCollect:"SIGNUP",showOnlyEditable:!0,values:r.user_attributes,"data-testid":"user-attributes-accountTab",onCh
29ange:e=>{o("user_attributes",e),i("user_attributes",!0)},labelClasses:null==a?void 0:a.textColor,isDarkTheme:G})}),(0,s.jsx)("div",{children:(0,s.jsx)(v.default,{"data-testid":"update-account-information",className:`${t?"opacity-100 hover:opacity-75":"opacity-75"} ${a.button}`,disabled:!t||!d||l,type:"submit",loading:l,children:(0,s.jsx)(n.A,I({},E.default.accountUpdateButton))})})]})})}),e.isAuth0User&&(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h4",{className:`${a.textColor} text-xl font-medium m-0`,children:(0,s.jsx)(n.A,I({},E.default.accountPasswordHeader))}),t.generalStatus===P.UPDATE_USER_PASSWORD_SUCCESS?(0,s.jsx)(w.default,{type:t.generalStatus}):(0,s.jsx)("p",{className:`${a.textColor} text-base m-0`,children:(0,s.jsx)(n.A,I({},E.default.resetPasswordDescription))})]}),(0,s.jsx)(v.default,{"data-testid":"update-password",className:a.button,type:"button",onClick:()=>F((0,T.updatePasswordAction)({client_id:J.metadata.platform.client_id,email:e.email})),disabled:t.updatePassword.loading,loading:t.updatePassword.loading,children:(0,s.jsx)(n.A,I({},E.default.passwordButtonText))})]}),(0,s.jsx)(_.default,{classes:a}),(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsx)("h4",{className:`${a.textColor} text-xl font-medium m-0`,children:(0,s.jsx)(n.A,I({},E.default.dangerZoneHeader))}),z&&0===(null==(l=null==z?void 0:z.subscriptions)?void 0:l.length)||(null==(b=null==z?void 0:z.subscriptions)?void 0:b.every((e=>e.active_until)))?(0,s.jsxs)("div",{className:"px-4 py-2 mt-2 bg-red-100 border border-red-200 border-solid rounded",children:[(0,s.jsx)("div",{className:"text-lg font-medium text-red-700",children:(0,s.jsx)(n.A,I({},E.default.deleteUser))}),(0,s.jsxs)("div",{className:"flex flex-col items-baseline space-y-4",children:[(0,s.jsx)("span",{className:"text-red-800",children:(0,s.jsx)(n.A,I({},E.default.deleteUserDescription))}),(0,s.jsx)(m.default,{open:k,setIsOpen:$,fullScreen:!1,triggerButton:{text:(0,s.jsx)(n.A,I({},E.default.deleteUserButtonText)),classes:"px-4 py-2 text-white whitespace-nowrap bg-red-700 border-none rounded-md cursor-pointer hover:opacity-75"},children:(0,s.jsxs)("div",{className:"max-w-md p-8 text-black bg-white rounded-xl",children:[(0,s.jsx)("h3",{className:"m-0 text-xl font-medium text-red-700",children:(0,s.jsx)(n.A,I({},E.default.deleteUserWarning))}),(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("p",{className:"text-base text-gray-900",children:(0,s.jsx)(n.A,I({},E.default.deleteUserModalText))}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("button",{type:"button","data-testid":"delete-user",className:"px-4 py-2 text-white bg-red-700 border-red-700 border-solid rounded-md cursor-pointer hover:bg-opacity-75",onClick:()=>F((0,T.deleteUserAction)()),children:(0,s.jsx)(n.A,I({},E.default.deleteUser))}),(0,s.jsx)("button",{type:"button","data-testid":"cancel-delete-user",className:"px-4 py-2 ml-2 text-gray-900 bg-white border-solid rounded-md cursor-pointer hover:bg-gray-100",onClick:()=>$(!1),children:(0,s.jsx)(n.A,I({},f.default.cancel))})]})]})]})})]})]}):(0,s.jsxs)("div",{className:"px-4 py-2 bg-red-100 border border-red-200 border-solid rounded",children:[(0,s.jsx)("div",{className:"my-2 text-lg font-medium text-red-700",children:(0,s.jsx)(n.A,I({},E.default.activeSubsWarning))}),(0,s.jsx)("div",{className:"flex flex-col items-baseline space-y-4",children:(0,s.jsx)("span",{className:"text-red-800",children:q.length>1?(0,s.jsx)(n.A,I({},E.default.activeSubsModalText)):(0,s.jsx)(n.A,I({},E.default.activeSubModalText))})}),(0,s.jsx)("div",{children:(0,s.jsx)("ul",{children:null==(O=null==z?void 0:z.subscriptions)?void 0:O.map((e=>e.active_until?null:(0,s.jsx)("li",{className:"text-red-800",children:e.name},e.id)))})})]})]})]});var se,re}F.propTypes={user:l().object,updateStates:l().object,classes:l().object};const z=F},20715:(e,t,a)=>{a.r(t),a.d(t,{default:()=>T});var s=a(74848),r=a(96540),n=a(96541),o=a(67438),i=a(21988),d=a(60799),l=a(72748),c=a(16683),u=a(1081),p=a(17386),f=a(50321),m=a(5556),x=a.n(m),g=a(61878),b=Object.defineProperty,y=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,j=(e,t,a)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,v=(e,t)=>
29{for(var a in t||(t={}))h.call(t,a)&&j(e,a,t[a]);if(y)for(var a of y(t))S.call(t,a)&&j(e,a,t[a]);return e},A=(e,t,a)=>new Promise(((s,r)=>{var n=e=>{try{i(a.next(e))}catch(e){r(e)}},o=e=>{try{i(a.throw(e))}catch(e){r(e)}},i=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);i((a=a.apply(e,t)).next())}));const E=(0,u.j8)({platform:(0,p.makeSelectPlatform)()});function T({classes:e}){const{logout:t}=(0,i.WB)(),a=(0,n.A)(),{platform:u}=(0,c.d4)(E),[p,m]=(0,r.useState)(!1),x=()=>A(this,null,(function*(){try{if(m(!0),200!==(yield(0,l.tX)(`user/devices/sign-out-all?platform=${u.uid}`)).statuscode)throw new Error("Failed to sign out from all devices");t({returnTo:`${window.location.origin}${u.stayliveIoBasename?`/${u.stayliveIoBasename}`:""}?redirectTo=${window.location.pathname||""}${window.location.search||""}`}),d.Ay.success(a.formatMessage(g.default.logoutSuccess))}catch(e){console.error(e),d.Ay.error(a.formatMessage(g.default.logoutError))}finally{m(!1)}}));return(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h4",{className:`${e.textColor} text-xl font-medium m-0`,children:(0,s.jsx)(o.A,v({},g.default.signOutFromAllDevices))}),(0,s.jsx)("p",{className:`${e.textColor} text-base`,children:(0,s.jsx)(o.A,v({},g.default.signOutFromAllDevicesDescription))})]}),(0,s.jsx)(f.default,{size:"py-2 px-4",type:"button",className:e.button,"data-testid":"log-out-all",onClick:()=>x(),disabled:p,loading:p,children:(0,s.jsx)(o.A,v({},g.default.logOutAll))})]})}T.propTypes={classes:x().object}},40175:(e,t,a)=>{a.r(t),a.d(t,{default:()=>w});var s=a(74848),r=a(96540),n=a(5556),o=a.n(n),i=a(67438),d=a(39522),l=a(24712),c=a(15422),u=a(23114),p=a(36249),f=a(61878),m=a(64140),x=a(69358),g=a(59640),b=Object.defineProperty,y=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,j=(e,t,a)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,v=(e,t)=>{for(var a in t||(t={}))h.call(t,a)&&j(e,a,t[a]);if(y)for(var a of y(t))S.call(t,a)&&j(e,a,t[a]);return e};function A({podcasts:e,description:t,createPodcastToken:a,deletePodcastToken:r}){return e.loading?(0,s.jsx)(c.default,{}):(0,s.jsxs)(x.default,{children:[(0,s.jsx)(g.default,{message:d.default.podcastsRss}),(0,s.jsx)(E,{podcasts:e}),(0,s.jsx)(u.default,{text:t}),0===e.data.length&&(0,s.jsx)("button",{"data-testid":"generate-rss-url",className:"flex items-center px-4 py-2 my-5 h-10 text-white rounded border-none bg-primary",type:"button",onClick:a,children:e.createState.loading?(0,s.jsx)(c.default,{size:8}):(0,s.jsxs)("div",{className:"flex items-baseline",children:[(0,s.jsx)(l.default,{className:"mr-1",icon:["fas","plus"]}),(0,s.jsx)(i.A,v({},f.default.generateRSSUrl))]})}),!e.loading&&!e.error&&e.data.length>0&&e.data.map((e=>(0,s.jsx)(T,{feed:e,revokeAccess:r},e.id))),(0,s.jsxs)("div",{className:"mt-4 text-primary",children:[(0,s.jsx)(l.default,{className:"mr-1",icon:["fas","circle-info"]}),(0,s.jsx)("a",{href:"https://support.staylive.se/hc/sv/articles/360011950800",target:"_blank",children:(0,s.jsx)(i.A,v({},f.default.addRSSFeedToPodcastPlayer))})]})]})}const E=({podcasts:e})=>{if(e.createState){if(e.createState.error)return(0,s.jsx)(m.ErrorIndicator,{header:f.default.createPodcastTokenErrorHeader,description:f.default.createPodcastTokenErrorDescription});if(e.createState.success)return(0,s.jsx)(m.SuccessIndicator,{header:f.default.createPodcastTokenSuccessHeader,description:f.default.createPodcastTokenSuccessDescription})}if(e.deleteState){if(e.deleteState.error)return(0,s.jsx)(m.ErrorIndicator,{header:f.default.deletePodcastTokenErrorHeader,description:f.default.deletePodcastTokenErrorDescription});if(e.deleteState.success)return(0,s.jsx)(m.SuccessIndicator,{header:f.default.deletePodcastTokenSuccessHeader,description:f.default.deletePodcastTokenSuccessDescription})}return null},T=({feed:e,revokeAccess:t})=>{const[a,n]=(0,r.useState)(!1);return(0,s.jsxs)("div",{className:"mt-5",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{children:e.image&&(0,s.jsx)("img",{className:"w-auto h-24",alt:"Podcast logotype",src:e.image})}),(0,s.jsxs)("div",{className:"ml-2",children:[(0,s.jsx)("p",{className:"m-0 text-xl font-medium text-gray-900",children:e.name}),(0,s.jsx)("p",{children:e.summary})]})]}),(0,s.jsx)("a",{href:"podcast://",children:(0,s.jsx)("img",{className:"mt-4 w-auto h-10",alt:"Apple Podcaster",src:"https://staylive.s3-eu-west-1.amazonaws.com/partnerplatform/assets/apple_podcaster_tile.png"})}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("label",{htmlFor:`podcast-${e.id}`,children:(0,s.jsx)(i.A,v({},f.default.podcastFeedUrl))}),(0,s.jsx)(p.default,{readOnly:!0,id:`podcast-${e.id}`,icon:"rss",width:16,fluid:!0,value:`https://podcasts.rss.staylive.tv/podcasts?token=${e.token}`})]}),(0,s.jsxs)("div",{className:"mt-4",children:[!a&&(0,s.jsxs)("button",{"data-testid":"revoke-access",onClick:()=>n(!0),type:"button",className:"px-4 py-2 text-sm text-white bg-red-700 rounded border-none",children:[(0,s.jsx)(l.default,{className:"mr-1",icon:["fas","trash-can"]}),(0,s.jsx)(i.A,v({},f.default.revokeAccess))]}),a&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block",children:(0,s.jsx)(i.A,v({},f.default.areYouSureRevokeAccess))}),(0,s.jsxs)("button",{"data-testid":"confirm-revoke-access",onClick:()=>t(e.id),type:"button",className:"px-4 py-2 text-sm text-white bg-red-700 rounded border-none",children:[(0,s.jsx)(l.default,{className:"mr-1",icon:["fas","trash-can"]}),(0,s.jsx)(i.A,v({},f.default.revokeAccess))]}),(0,s.jsx)("button",{"data-testid":"cancel-revoke-access",onClick:()=>n(!1),type:"button",className:"px-4 py-2 ml-2 text-sm text-black bg-gray-400 rounded border-none",children:(0,s.jsx)(i.A,v({},d.default.cancel))})]})]})]})};E.propTypes={podcasts:o().object},T.propTypes={feed:o().object,revokeAccess:o().func},A.propTypes={podcasts:o().object,description:o().string,createPodcastToken:o().func,deletePodcastToken:o().func};const w=A},73569:(e,t,a)=>{a.r(t),a.d(t,{default:()=>J});var s=a(74848),r=a(96540),n=a(5556),o=a.n(n),i=a(67438),d=a(96541),l=a(24712),c=a(39522),u=a(26840),p=a(15422),f=a(51978),m=a(51058),x=a(2890),g=a(77461),b=a(72748),y=a(67481),h=a(23114),S=a(57626),j=a(16683),v=a(17386),A=a(1081),E=a(55870),T=a(50321),w=a(60799),P=a(32689),_=a(37427),C=a(6028),N=a(69358),O=a(61878),R=a(45510),U=a(50924),k=a(84976),$=Object.defineProperty,M=Object.defineProperties,D=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,L=(e,t,a)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,F=(e,t)=>{for(var a in t||(t={}))H.call(t,a)&&L(e,a,t[a]);if(I)for(var a of I(t))B.call(t,a)&&L(e,a,t[a]);return e},z=(e,t)=>M(e,D(t)),K=(e,t,a)=>new Promise(((s,r)=>{var n=e=>{try{i(a.next(e))}catch(e){r(e)}},o=e=>{try{i(a.throw(e))}catch(e){r(e)}},i=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);i((a=a.apply(e,t)).next())}));function Y({coupon:e,subscription:t}
29){if("trialing"===t.status)return(0,s.jsxs)("div",{className:"font-normal",children:[(0,s.jsx)(i.A,z(F({},c.default.freeUntil),{values:{date:(0,s.jsx)(u.default,{time:!1,date:t.trial_end})}})),(0,s.jsx)("span",{className:"block",children:(0,s.jsx)(i.A,z(F({},O.default.then),{values:{price:`${(0,x.O)(t.price,t.currency)} / `,interval:(0,s.jsx)(m.default,{billingInterval:t.billing_interval,billingIntervalCount:t.billing_interval_count})}}))})]});if(!e)return(0,s.jsxs)("div",{className:"font-normal",children:[`${(0,x.O)(t.price,t.currency)} / `,(0,s.jsx)(m.default,{billingInterval:t.billing_interval,billingIntervalCount:t.billing_interval_count})]});if(100===e.percent_off)return(0,s.jsxs)("div",{className:"font-normal",children:[(0,s.jsx)(i.A,z(F({},c.default.freeUntil),{values:{date:(0,s.jsx)(u.default,{time:!1,date:e.valid_until})}})),(0,s.jsx)("span",{className:"block",children:(0,s.jsx)(i.A,z(F({},O.default.then),{values:{price:`${(0,x.O)(t.price,t.currency)} / `,interval:(0,s.jsx)(m.default,{billingInterval:t.billing_interval,billingIntervalCount:t.billing_interval_count})}}))})]});const a=t.price*(1-e.percent_off/100);return"forever"===e.duration?(0,s.jsx)("div",{className:"font-normal",children:(0,s.jsx)(i.A,z(F({},O.default.forever),{values:{price:`${(0,x.O)(a,t.currency)} / `,interval:(0,s.jsx)(m.default,{billingInterval:t.billing_interval,billingIntervalCount:t.billing_interval_count})}}))}):"repeating"===e.duration?0===e.remaining_cycles?null:(0,s.jsxs)("div",{className:"font-normal",children:[(0,s.jsxs)("span",{children:[`${(0,x.O)(a,t.currency)} / `,(0,s.jsx)(m.default,{billingInterval:t.billing_interval,billingIntervalCount:t.billing_interval_count}),(0,s.jsx)(i.A,z(F({},O.default.until),{values:{date:(0,s.jsx)(u.default,{time:!1,date:e.valid_until})}}))]}),(0,s.jsx)("span",{className:"block",children:(0,s.jsx)(i.A,z(F({},O.default.then),{values:{price:`${(0,x.O)(t.price,t.currency)} / `,interval:(0,s.jsx)(m.default,{billingInterval:t.billing_interval,billingIntervalCount:t.billing_interval_count})}}))})]}):null}Y.propTypes={coupon:o().shape({duration:o().string,duration_in_months:o().number,percent_off:o().number,metadata:o().object,valid_until:o().number,remaining_cycles:o().number}),subscription:o().shape({price:o().number,currency:o().string,billing_interval:o().string,billing_interval_count:o().number}).isRequired},Y.defaultProps={coupon:null};const W=(0,_.c)(P.STRIPE_PUBLISHABLE_TOKEN);W.catch((()=>{}));const G=(0,A.j8)({platform:(0,v.makeSelectPlatform)(),cmsPreview:(0,v.makeSelectCmsPreviewMode)()});function V({classes:e}){const t=(0,d.A)(),{platform:{uid:a},cmsPreview:n}=(0,j.d4)(G),[o,y]=(0,r.useState)(!1),[h,v]=(0,r.useState)(!1),[A,E]=(0,r.useState)(),[P,_]=(0,r.useState)(),{data:$}=(0,C.X)(n?"accountsettings":null),{data:M,error:D,isValidating:I,mutate:H}=(0,g.Q)(!n),[B,L]=(0,r.useState)(null),V=(null==M?void 0:M.subscriptions)||(null==$?void 0:$.subscriptions),J=(null==M?void 0:M.packages)||(null==$?void 0:$.packages);if((0,r.useEffect)((()=>{a&&((0,S.uv)(`platforms/${a}/churn/options?active=true`,b.lA),(0,S.uv)(`platforms/${a}/churn/settings`,b.lA))}),[a]),I&&!M)return(0,s.jsx)(N.default,{children:(0,s.jsx)(p.default,{})});if(D)return(0,s.jsxs)(N.default,{children:[(0,s.jsx)(i.A,F({},c.default.somethingWentWrong)),(0,s.jsx)(i.A,F({},c.default.somethingWentWrongSubheader))]});const X=e=>K(this,null,(function*(){try{v(!0),yield(0,b.Ku)(`user/subscription/${e.subscription_id}/reactivate`),w.Ay.success((0,s.jsx)(i.A,z(F({},O.default.reactiveSuccess),{values:{name:e.name}})),{duration:6e3}),H()}catch(e){w.Ay.error((0,s.jsx)(i.A,F({},c.default.somethingWentWrong))),console.error(e)}finally{v(!1)}})),Z=e=>K(this,null,(function*(){try{_(e.id),yield(0,b.tX)(`platforms/${a}/switch-subscription/${e.subscription_id}`),w.Ay.success((0,s.jsx)(i.A,F({},O.default.cancelScheduledSuccess))),H()}catch(e){w.Ay.error((0,s.jsx)(i.A,F({},c.default.somethingWentWrong))),console.error(e)}finally{_(void 0)}})),Q=({sub:e})=>(0,s.jsx)(T.default,{"data-testid":"cancel-subscription",color:"red-700",type:"button",size:"py-2 px-4",onClick:()=>{E(e),y(!0)},children:(0,s.jsx)(i.A,F({},O.default.stopSubscription))}),ee=e=>K(this,[e],(function*({stripeCustomer:e,stripeSubId:t,subId:a}){L(null);try{let s;try{s=yield W}catch(e){return console.error(e),void L(a)}const{message:{stripe_session_id:r}}
29=yield(0,b.Ku)("user/card",{stripe_customer:e,subscription_id:t,return_url:window.location.href}),{error:n}=yield s.redirectToCheckout({sessionId:r});if(n)throw n}catch(e){console.error(e),w.Ay.error(e.message)}})),te=({status:e,activeUntil:t})=>"past_due"===e?(0,s.jsx)(i.A,F({},O.default.paymentFailedSubscription)):"trialing"===e?(0,s.jsx)(i.A,F({},O.default.subStatusTrialing)):"active"===e?t?(0,s.jsx)(i.A,F({},O.default.subStatusActiveUntil)):(0,s.jsx)(i.A,F({},O.default.subStatusActive)):e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{className:`text-xl font-medium m-0 ${e.textColor}`,children:(0,s.jsx)(i.A,F({},c.default.subscriptions))}),V&&0===V.length?(0,s.jsx)("p",{children:(0,s.jsx)(i.A,F({},O.default.noSubscriptionsFound))}):(0,s.jsx)("ul",{className:"flex flex-col p-0 m-0 mt-2 space-y-2 list-none",children:V&&V.map((a=>{var r,n,o,d,p,f;const[g]=a.affiliates||[];return(0,s.jsxs)("li",{className:e.card,children:[(0,s.jsxs)("div",{className:"flex flex-col items-baseline justify-between md:flex-row-reverse",children:[(0,s.jsx)("div",{className:("trialing"!==a.status?"text-white bg-green-700":"text-orange-400 bg-orange-100")+" font-medium text-sm whitespace-nowrap px-2 py-1 rounded-xl mb-4 md:mb-0",children:(0,s.jsx)(te,{status:a.status,activeUntil:a.active_until})}),(0,s.jsx)("div",{className:`mb-4 text-lg font-medium md:mb-0 truncate ${e.textColor}`,children:a.name})]}),(0,s.jsx)("div",{className:"flex items-baseline justify-between",children:(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex flex-col justify-between mt-1.5 md:items-center md:flex-row",children:[(0,s.jsx)("div",{className:`${e.textColor} font-medium`,children:(0,s.jsx)(Y,{coupon:a.coupon,subscription:a})}),!a.active_until&&(0,s.jsxs)("div",{className:`text-base ${e.textColor}`,children:[(0,s.jsx)(i.A,F({},O.default.nextBilling)),":"," ",(0,s.jsx)(u.default,{time:!1,date:(null==(r=null==a?void 0:a.coupon)?void 0:r.free_until)?null==(n=a.coupon)?void 0:n.free_until:a.current_period_end})]})]}),(0,s.jsx)("div",{className:`opacity-50 rounded-full h-0.5 mt-4 ${e.textColor.replace("text-","bg-")}`}),g&&(0,s.jsx)(R.default,{typeID:a.subscription,type:"subscription",affiliate:g,mutate:H,classes:e})]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsxs)("div",{className:`flex flex-col ${e.textColor}`,children:[(0,s.jsxs)("div",{className:"flex space-x-2 text-base",children:[(0,s.jsx)("p",{className:"mb-0 font-semibold uppercase",children:null==(o=null==a?void 0:a.card)?void 0:o.brand}),(0,s.jsxs)("p",{className:"",children:[(0,s.jsx)(l.default,{icon:["fa","credit-card"],className:"mr-2"}),"**** **** **** ",null==(d=null==a?void 0:a.card)?void 0:d.last4]})]}),(0,s.jsxs)("p",{className:"m-0 text-sm",children:[t.formatMessage(O.default.validThru),":"," ",null==(p=null==a?void 0:a.card)?void 0:p.exp_month," / ",null==(f=null==a?void 0:a.card)?void 0:f.exp_year]})]}),(0,s.jsx)(T.default,{type:"button","data-testid":"change-card",color:"secondary",onClick:()=>ee({stripeCustomer:a.customer_id,stripeSubId:a.subscription_id,subId:a.id}),size:"",className:e.secondaryButtons,children:(0,s.jsx)(i.A,F({},O.default.changeCard))})]}),B===a.id&&(0,s.jsx)("span",{className:"mt-4",children:(0,s.jsx)(U.default,{type:"error",className:"rounded-md",children:(0,s.jsx)(i.A,F({},c.default.stripeNotLoaded))})}),(0,s.jsx)("div",{className:`mt-4 ${e.textColor}`,children:a.active_until&&(0,s.jsxs)("div",{className:"",children:[(0,s.jsx)(u.default,{time:!1,date:a.active_until}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(T.default,{"data-testid":"reactivate-subscription",onClick:()=>X(a),loading:h,color:"secondary",size:"py-2 px-4 w-48",className:e.secondaryButtons,children:(0,s.jsx)(i.A,F({},O.default.reactiveSubscription))}),(0,s.jsx)("p",{className:"inline-block mt-1.5 text-sm",children:(0,s.jsx)(i.A,F({},O.default.reactivateDescription))})]})]})}),!a.active_until&&(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 mt-4",children:[(0,s.jsx)(Q,{sub:a}),a.subscription_group_id&&(a.pendingChanges?(0,s.jsx)(T.default,{type:"button","data-testid":"switch-subscription",color:"secondary",size:"py-2 px-4",className:e.secondaryButtons,disabled:!0,children:(0,s.jsx)(i.A,F({},O.default.switchSubscription))}):(0,s.jsx)(k.N_,{to:`/change-subscription/${a.subscription_group_id}?returnTo=/account`,"data-testid":"switch-subscription",className:(0,T.getButtonClassName)({color:"secondary",size:"py-2 px-4",className:e.secondaryButtons}),children:(0,s.jsx)(i.A,F({},O.default.switchSubscription))}))]}),(null==a?void 0:a.pendingChanges)&&(0,s.jsxs)("div",{className:"flex items-start gap-3 p-4 mt-8 text-white rounded-md bg-zinc-500",children:[(0,s.jsx)(l.default,{icon:["fa","exclamation-circle"],className:"mt-0.5 text-2xl text-amber-300"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("p",{className:"mb-1 text-lg font-semibold tracking-wide uppercase text-md",children:(0,s.jsx)(i.A,F({},O.default.pendingSwitchTitle))}),(0,s.jsx)("p",{className:"mb-6 text-base",children:(0,s.jsx)(i.A,z(F({},O.default.pendingDowngradeDescription),{values:{planName:(0,s.jsx)("strong",{children:a.pendingChanges.to.name}),price:(0,s.jsx)("strong",{children:(0,x.O)(a.pendingChanges.to.price,a.pendingChanges.to.currency)}),billingInterval:(0,s.jsx)(m.default,{billingInterval:a.pendingChanges.to.billingInterval}),date:(0,s.jsx)("strong",{children:(0,s.jsx)(u.default,{time:!1,date:a.pendingChanges.appliesAt})})}}))}),(0,s.jsx)(T.default,{type:"button","data-testid":"cancel-downgrade",color:"secondary",size:"py-2 px-4",className:e.secondaryButtons,loading:P===a.id,onClick:()=>Z(a),children:(0,s.jsx)(i.A,F({},O.default.cancelScheduled))})]})]}),"past_due"===a.status&&(0,s.jsx)("a",{className:`px-4 py-2 text-sm rounded border-none bg-primary ${e.textColor}`,target:"_blank",rel:"noopener noreferrer",href:a.invoice_hosted_url,children:(0,s.jsx)(i.A,F({},O.default.retryPayment))})]},a.id)}))}),(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsx)("h4",{className:`text-xl font-medium m-0 ${e.textColor}`,children:(0,s.jsx)(i.A,F({},c.default.packages))}),J&&0!==J.length?(0,s.jsx)("ul",{className:"flex flex-col p-0 m-0 mt-2 space-y-2 list-none",children:J.map((t=>(0,s.jsxs)("li",{className:e.card,children:[(0,s.jsxs)("div",{className:"items-baseline justify-between sm:flex",children:[(0,s.jsx)("div",{className:`mb-4 text-lg font-medium md:mb-0 truncate ${e.textColor}`,children:t.name}),(0,s.jsx)("div",{className:"px-2 py-1 mt-3 text-sm font-medium text-white bg-green-700 rounded-xl sm:mt-0 sm:ml-6",children:(0,s.jsx)(i.A,F({},O.default.subStatusActive))})]}),(0,s.jsxs)("div",{className:"items-baseline justify-between sm:flex",children:[(0,s.jsx)("div",{className:`font-normal ${e.textColor}`,children:`${(0,x.O)(t.price,t.currency)}`}),(0,s.jsx)("div",{className:`mt-3 ${e.textColor}`,children:t.valid_until&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A,F({},O.default.subscriptionEndsAt)),":"," ",(0,s.jsx)(u.default,{time:!1,date:t.valid_until})]})})]})]},t.id)))}):(0,s.jsx)("p",{children:(0,s.jsx)(i.A,F({},O.default.noPackagesFound))})]}),(0,s.jsx)(f.default,{open:o,setIsOpen:y,fullScreen:!1,children:(0,s.jsx)(q,{subToCancel:A,setConfirmSubCancelDialog:y,mutate:H,classes:e})})]})}V.propTypes={classes:o().object,sub:o().shape({subscription_id:o().string,name:o().string,pendingChanges:o().shape({to:o().shape({name:o().string,price:o().number,billingInterval:o().string,appliesAt:o().string})})})};const J=V;function q({setConfirmSubCancelDialog:e,subToCancel:t,mutate:a,classes:n}){const[o,l]=(0,r.useState)(null),[c,u]=(0,r.useState)(""),f=(0,d.A)(),{data:m,error:x,isValidating:g}=(0,y.a)(!0),{data:S,error:j,isValidating:v}=(0,E.H)(),A=(s=void 0)=>K(this,null,(function*(){try{yield(0,b.tX)(`subscription/${t.id}`,s)}catch(e){console.error({err:e})}finally{e(!1),a()}})),T=!S,w=!m||m&&!m.length;return g&&w||v&&T?(0,s.jsx)("div",{className:"max-w-md p-4 text-gray-900 bg-white rounded-xl",children:(0,s.jsx)(p.default,{})}
29):x||j||!g&&w||!g&&T?(0,s.jsxs)("div",{className:`p-4 max-w-md ${n.textColor} bg-white rounded-xl`,children:[(0,s.jsx)("h3",{className:`m-0 text-2xl font-medium ${n.textColor}`,children:(0,s.jsx)(i.A,F({},O.default.stopSubscription))}),(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)(i.A,F({},O.default.stopSubscriptionConfirmName))," ",'"',t&&t.name,'"',"?"]}),(0,s.jsxs)("div",{className:"flex mt-4 space-x-4",children:[(0,s.jsx)("button",{type:"button","data-testid":"stop-subscription-cancel",onClick:()=>e(!1),className:"px-8 py-3 font-bold text-gray-700 bg-gray-300 border-none rounded cursor-pointer hover:opacity-75",children:(0,s.jsx)(i.A,F({},O.default.stopSubscriptionCancel))}),(0,s.jsx)("button",{type:"button","data-testid":"stop-subscription-confirm",onClick:A,className:"px-8 py-3 font-bold text-white border-none rounded cursor-pointer bg-primary hover:opacity-75",children:(0,s.jsx)(i.A,F({},O.default.stopSubscriptionConfirm))})]})]}):(0,s.jsxs)("div",{className:"max-w-lg p-3 text-gray-900 bg-white rounded",children:[(0,s.jsx)("h3",{className:"m-0 text-2xl font-bold text-gray-900",children:(0,s.jsx)(h.default,{text:S.header})}),(0,s.jsx)("p",{className:"mt-3",children:(0,s.jsx)(h.default,{text:S.description})}),(0,s.jsx)(X,{options:m,handleClick:e=>{l(e)}}),(0,s.jsx)("textarea",{placeholder:f.formatMessage(O.default.churnTextPlaceholder),rows:8,className:"w-full p-2 border-gray-300 rounded-md mt-7 focus:ring-primary focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-offset-primary",style:{resize:"none"},onChange:e=>u(e.target.value)}),(0,s.jsxs)("div",{className:"flex justify-end mt-2 space-x-4",children:[(0,s.jsx)("button",{type:"button","data-testid":"stay-subscription",onClick:()=>e(!1),className:"px-4 py-2 text-lg text-white bg-gray-400 border-none rounded cursor-pointer hover:opacity-75",children:(0,s.jsx)(i.A,F({},O.default.staySubs))}),(0,s.jsx)("button",{type:"button","data-testid":"cancel-subscription",onClick:()=>A({churn:{option:o,freeText:c}}),className:"px-4 py-2 text-lg text-white bg-red-700 border-none rounded cursor-pointer hover:opacity-75",children:(0,s.jsx)(i.A,F({},O.default.cancelSubscriptionConfirm))})]}),(0,s.jsx)("p",{className:"mt-4 text-sm italic text-center text-gray-400 max-w-prose",children:(0,s.jsx)(i.A,F({},O.default.footerText))})]})}function X({options:e,handleClick:t}){return(0,s.jsxs)("fieldset",{className:"p-0 mt-4 border-0",children:[(0,s.jsx)("legend",{className:"sr-only",children:"Churn options"}),(0,s.jsx)("div",{className:"space-y-4",children:e.map((({option:e,id:a})=>(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsx)("input",{id:a,value:a,name:"answer",type:"radio",onClick:()=>t(a),className:"mt-1.5 w-5 h-5 border-gray-300 cursor-pointer text-primary accent-primary"}),(0,s.jsx)("label",{htmlFor:a,className:"block w-full max-w-md pl-3 text-base leading-6 text-gray-900 cursor-pointer",children:(0,s.jsx)(h.default,{className:"break-words whitespace-normal",text:e})})]},a)))})]})}q.propTypes={setConfirmSubCancelDialog:o().func,subToCancel:o().object,mutate:o().func,classes:o().object},X.propTypes={options:o().array,handleClick:o().func}},59640:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var s=a(74848),r=(a(96540),a(5556)),n=a.n(r),o=a(67438),i=Object.defineProperty,d=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(e,t,a)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,p=(e,t)=>{for(var a in t||(t={}))l.call(t,a)&&u(e,a,t[a]);if(d)for(var a of d(t))c.call(t,a)&&u(e,a,t[a]);return e};function f({message:e,isSubheader:t=!1}){return(0,s.jsx)("h3",{className:(t?"text-xl":"text-3xl")+" font-medium leading-6 text-gray-900",children:(0,s.jsx)(o.A,p({},e))})}f.propTypes={message:n().object,isSubheader:n().bool};const m=f},69358:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var s=a(74848),r=(a(96540),a(5556)),n=a.n(r);function o({children:e}){return(0,s.jsx)("div",{className:"overflow-hidden max-w-lg",children:e})}o.propTypes={children:n().any}},45510:(e,t,a)=>{a.r(t),a.d(t,{default:()=>O});var s=a(74848),r=a(96540),n=a(5556),o=a.n(n),i=a(51978),d=a(28457),l=a(14088),c=a(15422),u=a(72748),p=a(60799),f=a(1081),m=a(17386),x=a(16683),g=a(96541),b=a(67438),y=a(39522),h=a(23114),S=a(61878),j=Object.defineProperty,v=Object.defineProperties,A=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,P=(e,t,a)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,_=(e,t)=>
29{for(var a in t||(t={}))T.call(t,a)&&P(e,a,t[a]);if(E)for(var a of E(t))w.call(t,a)&&P(e,a,t[a]);return e};const C=(0,f.j8)({platform:(0,m.makeSelectPlatform)()});function N({affiliate:e,type:t,typeID:a,mutate:n,classes:o}){const{platform:{uid:f}}=(0,x.d4)(C),{data:m,error:j,isValidating:E}=(0,l.H)(e.affiliate_group),[T,w]=(0,r.useState)(!1),[P,N]=(0,r.useState)(void 0),[O,R]=(0,r.useState)(!1),U=(0,g.A)(),k={id:null,name:(0,h.default)({text:e.default_option_text,intl:U,returnElement:!1})};if(j)return console.error("[Data fetching error -",j),null;const $=O||null==P||(null==P?void 0:P.value)===e.affiliate_id;return(0,s.jsxs)("div",{className:"flex justify-between items-center mt-4",children:[(0,s.jsxs)("p",{className:`flex flex-col m-0 text-base ${o.textColor}`,children:[(0,s.jsxs)("span",{className:"font-medium",children:[(0,s.jsx)(h.default,{text:e.affiliate_group_name}),":"]}),e.affiliate_name?(0,s.jsx)(h.default,{text:e.affiliate_name}):(0,s.jsx)(h.default,{text:e.default_option_text})]}),(0,s.jsx)(i.default,{triggerButton:{text:(0,s.jsx)(b.A,_({},y.default.edit)),classes:` ${o.secondaryButtons} border-none rounded-md font-semibold cursor-pointer`},open:T,setIsOpen:w,fullScreen:!1,children:(0,s.jsxs)("div",{className:"p-4 w-96 text-gray-900 bg-white rounded-xl",children:[(0,s.jsx)("h3",{className:"m-0 text-2xl font-medium text-gray-900",children:(0,s.jsx)(b.A,(M=_({},S.default.updateAffiliate),D={values:{group:(0,s.jsx)(h.default,{text:e.affiliate_group_name})}},v(M,A(D))))}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(b.A,_({},S.default.updateModalDesc))}),(0,s.jsx)("div",{children:E?(0,s.jsx)(c.default,{size:8}):(0,s.jsx)(d.Ay,{name:"name",value:P?{label:(0,s.jsx)(h.default,{text:P.label}),value:P.value}:{label:(0,s.jsx)(h.default,{text:e.affiliate_name||e.default_option_text}),value:e.affiliate_id||null},options:[k,...m].map((({id:e,name:t})=>({label:(0,s.jsx)(h.default,{text:t}),value:e}))),onChange:t=>{t.value===e.affiliate_id?N(null):N(t)}})}),(0,s.jsxs)("div",{className:"flex mt-6 space-x-4",children:[(0,s.jsx)("button",{type:"submit",onClick:()=>{return r=this,o=function*(){R(!0);try{yield(0,u.hr)(`platforms/${f}/affiliate-groups/set-new-affiliate/${t}/${a}`,{affiliate:null==P?void 0:P.value,affiliate_group:e.affiliate_group}),p.Ay.success((0,s.jsx)(b.A,_({},S.default.successfullyUpdatedAffiliate)),{duration:3e3}),n(),w(!1)}catch(e){console.error(e),p.Ay.error((0,s.jsx)(b.A,_({},S.default.errorUpdatedAffiliate)))}finally{R(!1)}},new Promise(((e,t)=>{var a=e=>{try{n(o.next(e))}catch(e){t(e)}},s=e=>{try{n(o.throw(e))}catch(e){t(e)}},n=t=>t.done?e(t.value):Promise.resolve(t.value).then(a,s);n((o=o.apply(r,null)).next())}));var r,o},disabled:$,className:"px-4 py-2 font-bold text-white rounded border-none cursor-pointer disabled:opacity-40 bg-primary hover:opacity-75",children:(0,s.jsxs)("span",{className:"flex items-center",children:[(0,s.jsx)("span",{className:`${O?"mr-2":null}`,children:O?(0,s.jsx)(c.default,{size:4}):null}),(0,s.jsx)(b.A,_({},S.default.updateModalLabel))]})}),(0,s.jsx)("button",{type:"button",onClick:()=>w(!1),className:"px-4 py-2 font-bold text-gray-700 bg-gray-300 rounded border-none cursor-pointer hover:opacity-75",children:(0,s.jsx)(b.A,_({},y.default.cancel))})]})]})})]});var M,D}N.propTypes={affiliate:o().shape({affiliate_group_name:o().object,default_option_text:o().object,affiliate_group:o().number,affiliate_name:o().string,affiliate_id:o().number}),type:o().string,typeID:o().number,mutate:o().func,classes:o().object};const O=N},66607:(e,t,a)=>{a.r(t),a.d(t,{default:()=>S});var s=a(74848),r=a(96540),n=a(5556),o=a.n(n),i=a(24712),d=a(67438),l=a(61878),c=Object.defineProperty,u=Object.defineProperties,p=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,g=(e,t,a)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,b=(e,t)=>{for(var a in t||(t={}))m.call(t,a)&&g(e,a,t[a]);if(f)for(var a of f(t))x.call(t,a)&&g(e,a,t[a]);return e};function y({children:e}){return(0,s.jsx)("div",{className:"relative flex flex-col px-12 py-8 text-black bg-white rounded-xl",children:e})}function h({verificationStatus:e,onVerify:t,onResendCode:a,mail:n}){const[o,c]=(0,r.useState)(!1),[f,m]=(0,r.useState)(!1),[x]=(0,r.useState)(6),[g,h]=(0,r.useState)([...Array(x)].map((()=>""))),S=(0,r.useRef)([]),[j,v]=(0,r.useState)(!0);return(0,r.useEffect)((()=>{v(!f)}),[f]),e.success?(0,s.jsx)(y,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center p-8",children:[(0,s.jsx)("div",{className:"p-4 text-green-600 bg-green-200 rounded-full",children:(0,s.jsx)(i.default,{size:"4x",icon:["fas","check"]})}),(0,s.jsx)("span",{className:"mt-6 text-xl font-medium",children:(0,s.jsx)(d.A,b({},l.default.verificationCodeSuccess))})]})}):e.error?(0,s.jsx)(y,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center p-8",children:[(0,s.jsx)("div",{className:"p-4 text-yellow-600 bg-yellow-200 rounded-full",children:(0,s.jsx)(i.default,{size:"4x",icon:["fas","info"]})}),(0,s.jsx)("span",{className:"mt-6 text-xl font-medium",children:(0,s.jsx)(d.A,b({},l.default.verificationCodeError))})]})}):(0,s.jsx)(y,{children:(0,s.jsxs)("div",{className:"max-w-md",children:[(0,s.jsx)("span",{className:"font-medium",children:(0,s.jsx)(d.A,b({},l.default.accountVerificationCodeHeader))}),(0,s.jsx)("span",{className:"block",children:(0,s.jsx)(d.A,(A=b({},l.default.verificationCodeSent),E={values:{email:n}}
29,u(A,p(E))))}),(0,s.jsx)("div",{className:"flex items-start justify-between mt-2",children:g.map(((e,t)=>(0,s.jsx)("input",{className:"w-10 h-12 text-2xl text-center text-gray-900 bg-gray-100 border-gray-800 rounded-lg border-1",type:"text",inputMode:"numeric",maxLength:1,value:e,autoFocus:!g[0].length&&0===t,readOnly:o,onChange:e=>((e,t)=>{const a=e.target.value;if(/[^0-9]/.test(a))return;const s=[...g];s[t]=a,h(s),t!==x-1&&S.current[t+1].focus(),s.every((e=>""!==e))?m(!0):m(!1)})(e,t),onKeyUp:e=>((e,t)=>{if(8===e.keyCode&&!g[t]&&0!==t){const e=[...g];e[t-1]="",h(e),S.current[t-1].focus()}})(e,t),ref:e=>S.current.push(e)},t)))}),(0,s.jsx)("button",{disabled:j,type:"button",onClick:()=>{c(!0),t({code:g.join("")})},className:"w-full mt-4 inline-flex items-center justify-center px-5 py-2 text-lg leading-6 transition duration-150 ease-in-out border border-transparent rounded-md cursor-pointer "+(j?"bg-gray-400 text-black":"bg-primary text-white"),children:(0,s.jsx)(d.A,b({},l.default.verify))}),(0,s.jsx)("div",{className:"flex flex-col mt-2 space-y-1",children:(0,s.jsx)("button",{type:"button",className:"flex underline bg-transparent border-none cursor-pointer",onClick:a,children:(0,s.jsx)(d.A,b({},l.default.resendCode))})})]})});var A,E}y.propTypes={children:o().any},h.propTypes={verificationStatus:o().object,formData:o().object,onVerify:o().func,onResendCode:o().func,onEmailChange:o().func,mail:o().string};const S=h},20289:(e,t,a)=>{a.r(t),a.d(t,{AccountSettings:()=>H,default:()=>B});var s=a(74848),r=a(96540),n=a(5556),o=a.n(n),i=a(16683),d=a(67438),l=a(1081),c=a(84976),u=a(40928),p=a(40260),f=a(74980),m=a(21988),x=a(15422),g=a(78210),b=a(57644),y=a(39522),h=a(17386),S=a(72803),j=a(14737),v=a(43097),A=a(61878),E=a(52694),T=a(73569),w=a(56642),P=a(40175),_=Object.defineProperty,C=Object.defineProperties,N=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,k=(e,t,a)=>t in e?_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,$=(e,t)=>{for(var a in t||(t={}))R.call(t,a)&&k(e,a,t[a]);if(O)for(var a of O(t))U.call(t,a)&&k(e,a,t[a]);return e},M=(e,t)=>C(e,N(t)),D=(e,t,a)=>new Promise(((s,r)=>{var n=e=>{try{i(a.next(e))}catch(e){r(e)}},o=e=>{try{i(a.throw(e))}catch(e){r(e)}},i=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,o);i((a=a.apply(e,t)).next())}));const I=(0,l.j8)({accountSettings:(0,S.default)(),platform:(0,h.makeSelectPlatform)(),cmsPreview:(0,h.makeSelectCmsPreviewMode)()});function H({styling:e={wrapper:"max-w-screen-2xl p-6 mt-32 mb-14 mx-auto bg-white text-lg rounded",titleClasses:"text-2xl font-medium text-black sm:text-4xl",descriptionClasses:"mt-2 text-lg text-black",userInformationClasses:"text-black truncate",accordionSection:{wrapper:"flex flex-col space-y-2 -mx-4 mt-4",wrapperActive:"bg-gray-100 rounded",title:"text-xl font-medium",button:"flex justify-between items-center p-4 w-full text-left text-gray-900 bg-transparent rounded-lg border-none hover:bg-gray-100",icon:"text-gray-900",panel:"text-gray-500",inner:"max-w-xl mx-4"},accountTab:{textColor:"text-gray-900",wrapper:"flex flex-col space-y-4",button:"py-2 px-4"},productsTab:{textColor:"text-gray-900",card:"p-4 mb-4 rounded-md border-2 border-solid border-zinc-200",secondaryButtons:"bg-secondary px-3 py-1 text-lg text-gray-900"}},podcastOptionActive:t={active:!1}}){var a,n,o,l;(0,f.N)({key:"accountSettings",reducer:j.default}),(0,p.f)({key:"accountSettings",saga:v.default});const h=(0,i.wA)(),{platform:S,accountSettings:{updateStates:_,podcasts:C},cmsPreview:N}=(0,i.d4)(I),{getAccessTokenSilently:O}=(0,m.WB)(),{user:R,isLoading:U,isAuthenticated:k}=(0,g.Jd)();return(0,r.useEffect)((()=>{N||(()=>{D(this,null,(function*(){try{yield O()}catch(e){console.log("Error updating token",e)}}))})()}),[O,_.updateUser.updatedAt,N]),(0,r.useEffect)((()=>{!R||U||N||h((0,w.getUserReceiptsAction)())}),[h,U,R,N]),(0,r.useEffect)((()=>{t.active&&h((0,w.getPodcastTokensAction)())}),[h,t.active]),U?(0,s.jsx)(x.default,{}):k||R||N?(0,s.jsxs)("div",{className:e.wrapper,children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h4",{className:`${e.titleClasses} mb-0`,children:(0,s.jsx)(d.A,$({},y.default.myAccount))}),(0,s.jsx)("p",{className:e.userInformationClasses,children:null==R?void 0:R.email})]}),(0,s.jsx)("p",{className:e.descriptionClasses,children:(0,s.jsx)(d.A,$({},A.default.accountDescription))}),(0,s.jsx)(u.default,{defaultOpen:N,title:(0,s.jsx)(d.A,$({},A.default.accountDetails)),classes:e.accordionSection,dataTestid:"account-details-accordion",children:(0,s.jsx)(E.default,{user:R,updateStates:_,classes:e.accountTab})}),(0,s.jsx)(u.default,{defaultOpen:N,title:(0,s.jsx)(d.A,$({},A.default.subAndPackages)),classes:e.accordionSection,dataTestid:"product-details-accordion",children:(0,s.jsx)(T.default,{classes:e.productsTab})}),(null==t?void 0:t.active)&&(0,s.jsx)(u.default,{defaultOpen:N,title:(0,s.jsx)(d.A,$({},y.default.podcastsRss)),classes:e.accordionSection,children:(0,s.jsx)(P.default,{podcasts:C,description:t.description,createPodcastToken:()=>{h((0,w.createPodcastTokenAction)({feed:t.rssFeeds}))},deletePodcastToken:e=>h((0,w.deletePodcastTokenAction)({id:e}))})}),(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)(u.default,{classes:e.accordionSection,title:(0,s.jsx)(d.A,$({}
29,y.default.watchHistory)),dataTestid:"watch-history-accordion",children:(0,s.jsx)(c.N_,{to:"/watch-history",className:"hover:text-inherit"})}),(0,s.jsx)(u.default,{classes:e.accordionSection,title:(0,s.jsx)(d.A,$({},y.default.receipts)),dataTestid:"receipts-accordion",children:(0,s.jsx)(c.N_,{to:"/receipts",className:"hover:text-inherit"})}),(null==(n=null==(a=null==S?void 0:S.metadata)?void 0:a.platform)?void 0:n.name)?(0,s.jsx)("p",{className:`${e.userInformationClasses} mt-4 text-base`,children:(0,s.jsx)(d.A,M($({},A.default.signedInToPlatform),{values:{platform:null==(l=null==(o=null==S?void 0:S.metadata)?void 0:o.platform)?void 0:l.name}}))}):null]})]}):((0,b.rN)()?window.location.href=`/${(0,b.rN)()}/login`:window.location.href="/login",null)}H.propTypes={styling:o().shape({wrapper:o().string,titleClasses:o().string,descriptionClasses:o().string,accordionSection:o().shape({wrapper:o().string,wrapperActive:o().string,title:o().string,button:o().string,icon:o().string,panel:o().string,inner:o().string}),accountTab:o().shape({textColor:o().string,wrapper:o().string,button:o().string}),productsTab:o().shape({textColor:o().string,card:o().string,secondaryButtons:o().string})}),podcastOptionActive:o().shape({active:o().bool,rssFeeds:o().number,description:o().string})};const B=H},61878:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n,scope:()=>r});var s=a(11164);const r="app.containers.AccountSettings",n=(0,s.YK)({overviewHeader:{id:`${r}.overviewHeader`,defaultMessage:"Overview"},accountOverview:{id:`${r}.accountOverview`,defaultMessage:"Your account"},accountDetails:{id:`${r}.accountDetails`,defaultMessage:"Account details"},subAndPackages:{id:`${r}.subAndPackages`,defaultMessage:"Subscriptions & packages"},accountActivePackages:{id:`${r}.accountActivePackages`,defaultMessage:"Active packages"},accountActiveSubscriptions:{id:`${r}.accountActiveSubscriptions`,defaultMessage:"Active subscriptions"},accountCommunication:{id:`${r}.accountCommunication`,defaultMessage:"Communication"},accountEditButton:{id:`${r}.accountEditButton`,defaultMessage:"Edit account"},receiptsHeader:{id:`${r}.receiptsHeader`,defaultMessage:"Receipts"},subscriptionsEditButton:{id:`${r}.subscriptionsEditButton`,defaultMessage:"Edit subscriptions"},subscriptionStarted:{id:`${r}.subscriptionStarted`,defaultMessage:"Started at: "},subscriptionEndsAt:{id:`${r}.subscriptionEndsAt`,defaultMessage:"Ends at"},subscriptionRenewsAt:{id:`${r}.subscriptionRenewsAt`,defaultMessage:"Renews"},noSubscriptionsFound:{id:`${r}.noSubscriptionsFound`,defaultMessage:"No subscriptions found in your account."},noPackagesFound:{id:`${r}.noPackagesFound`,defaultMessage:"No packages found in your account."},noCardDetails:{id:`${r}.noCardDetails`,defaultMessage:"No card details found in your account."},noReceiptsFound:{id:`${r}.noReceiptsFound`,defaultMessage:"No receipts found."},noReceiptsForYear:{id:`${r}.noReceiptsForYear`,defaultMessage:"No receipts found for this year."},noActiveSubscriptions:{id:`${r}.noActiveSubscriptions`,defaultMessage:"You have no active subscriptions"},noActivePackages:{id:`${r}.noActivePackages`,defaultMessage:"You have no active packages"},changeEmail:{id:`${r}.changeEmail`,defaultMessage:"Change email"},changeCard:{id:`${r}.changeCard`,defaultMessage:"Change card"},switchSubscription:{id:`${r}.switchSubscription`,defaultMessage:"Switch subscription"},validThru:{id:`${r}.validThru`,defaultMessage:"Valid thru"},stopSubscription:{id:`${r}.stopSubscription`,defaultMessage:"Stop subscription"},pendingSwitchTitle:{id:`${r}.pendingSwitchTitle`,defaultMessage:"Switch scheduled"},pendingDowngradeDescription:{id:`${r}.pendingDowngradeDescription`,defaultMessage:"Your plan will change to {planName} ({price} / {billingInterval}) on {date}. Switching subscriptions while you already have a pending change is not allowed."},cancelScheduled:{id:`${r}.cancelScheduled`,defaultMessage:"Cancel scheduled switch"},cancelScheduledSuccess:{id:`${r}.cancelScheduledSuccess`,defaultMessage:"The scheduled switch has been cancelled."},accountSettings:{id:`${r}.accountSettings`,defaultMessage:"Account settings"},accountInformation:{id:`${r}.accountInformation`,defaultMessage:"Account information"},paymentMethod:{id:`${r}.paymentMethod`,defaultMessage:"Payment method"},updateAccountInformationSuccess:{id:`${r}.updateAccountInformationSuccess`,defaultMessage:"Account information updated!"},updatePasswordInformationSuccess:{id:`${r}.updatePasswordInformation`,defaultMessage:"We have sent you an email that tells how to update your password"},updatePasswordInformationError:{id:`${r}.updatePasswordInformationError`,defaultMessage:"Something went wrong when updating your password"},couldNotUpdateAccountInformation:{id:`${r}.couldNotUpdateAccountInformation`,defaultMessage:"Could not update account information"},resetPasswordDescription:{id:`${r}.resetPasswordDescription`,defaultMessage:"We will send you an email with instructions on how can update your password"},passwordButtonText:{id:`${r}.passwordButtonText`,defaultMessage:"Send email"},accountPasswordHeader:{id:`${r}.accountPasswordHeader`,defaultMessage:"Reset password"},accountEmailHeader:{id:`${r}.accountEmailHeader`,defaultMessage:"Email"},generalInformation:{id:`${r}.generalInformation`,defaultMessage:"General"},accountUpdateButton:{id:`${r}.accountUpdateButton`,defaultMessage:"Update information"},accountVerificationCodeHeader:{id:`${r}.accountVerificationCodeHeader`,defaultMessage:"Verification code"},accountEmailVerificationButton:{id:`${r}.accountEmailVerificationButton`,defaultMessage:"Send verification code"},accountEnterNewMail:{id:`${r}.accountEnterNewMail`,defaultMessage:"Enter new email"},accountChangeMailDescription:{id:`${r}.accountChangeMailDescription`,defaultMessage:"Enter new email address. We will send a code to the new address for verification."},verificationCodeSent:{id:`${r}.verificationCodeSent`,defaultMessage:"We have sent you a verification code to your email. Please check your inbox and validate the code in the input field below."},verificationCodeSuccess:{id:`${r}.verificationCodeSuccess`,defaultMessage:"Successfully updated your email address!"},verificationCodeError:{id:`${r}.verificationCodeError`,defaultMessage:"Something went wrong when updating your email!"},paymentFailedSubscription:{id:`${r}.paymentFailedSubscription`,defaultMessage:"Payment failed"},retryPayment:{id:`${r}.retryPayment`,defaultMessage:"Retry payment"},stopSubscriptionConfirmName:{id:`${r}.stopSubscriptionConfirmName`,defaultMessage:"Do you want to cancel the subscription"},stopSubscriptionCancel:{id:`${r}.stopSubscriptionCancel`,defaultMessage:"No, keep subscription"},stopSubscriptionConfirm:{id:`${r}.stopSubscriptionConfirm`,defaultMessage:"Yes, cancel subscription"},cancelSubscriptionConfirm:{id:`${r}.cancelSubscriptionConfirm`,defaultMessage:"Cancel subscription"},refunded:{id:`${r}.refunded`,defaultMessage:"Refunded"},generateRSSUrl:{id:`${r}.generateRSSUrl`,defaultMessage:"Click here to generate your private RSS feed"},addRSSFeedToPodcastPlayer:{id:`${r}.addRSSFeedToPodcastPlayer`,defaultMessage:"How do I add this to my Podcast player?"},createPodcastTokenErrorHeader:{id:`${r}.createPodcastTokenErrorHeader`,defaultMessage:"Could not generate Podcast feed"},createPodcastTokenErrorDescription:{id:`${r}.createPodcastTokenErrorDescription`,defaultMessage:"Something went wrong when generating your private Podcast feed. Please try again."},createPodcastTokenSuccessHeader:{id:`${r}.createPodcastTokenSuccessHeader`,defaultMessage:"Your private feed has been created."},createPodcastTokenSuccessDescription:{id:`${r}.createPodcastTokenSuccessDescription`,defaultMessage:"We have created your own private RSS feed. You can now add this to your Podcast player to start listening."},deletePodcastTokenSuccessHeader:{id:`${r}.deletePodcastTokenSuccessHeader`,defaultMessage:"Your private feed has been revoked."},deletePodcastTokenSuccessDescription:{id:`${r}.deletePodcastTokenSuccessDescription`,defaultMessage:"Your private feed has been revoked and can no longer be used. You can always generate a new feed if you'd like."},deletePodcastTokenErrorHeader:{id:`${r}.deletePodcastTokenErrorHeader`,defaultMessage:"Something went wrong."},deletePodcastTokenErrorDescription:{id:`${r}.deletePodcastTokenErrorDescription`,defaultMessage:"Something went wrong when trying to revoke the access. Please try again."},podcastFeedUrl:{id:`${r}.podcastFeedUrl`,defaultMessage:"URL for your Podcast player"},lastSeen:{id:`${r}.lastSeen`,defaultMessage:"Last seen"},revokeAccess:{id:`${r}.revokeAccess`,defaultMessage:"Revoke access"},areYouSureRevokeAccess:{id:`${r}.areYouSureRevokeAccess`,defaultMessage:"Are you sure you want to revoke the access to this feed?"},dangerZoneHeader:{id:`${r}.dangerZoneHeader`,defaultMessage:"Danger zone"},deleteUser:{id:`${r}.deleteUser`,defaultMessage:"Delete account"},deleteUserDescription:{id:`${r}.deleteUserDescription`,defaultMessage:"Your account will be permanently deleted. "},deleteUserButtonText:{id:`${r}.deleteUserButtonText`,defaultMessage:"Delete account"},deleteUserWarning:{id:`${r}.deleteUserWarning`,defaultMessage:"WARNING!"},deleteUserModalText:{id:`${r}.deleteUserModalText`,defaultMessage:"Are you really sure you want to delete your account?"},userName:{id:`${r}.userName`,defaultMessage:"Username"},nameVerificationError:{id:`${r}.nameVerificationError`,defaultMessage:"Your username needs to be at least 2 characters"},verify:{id:`${r}.verify`,defaultMessage:"Verify"},resendCode:{id:`${r}.resendCode`,defaultMessage:"Resend code"},subStatusTrialing:{id:`${r}.subStatusTrialing`,defaultMessage:"Trialing"},subStatusActive:{id:`${r}.subStatusActive`,defaultMessage:"Active"},subStatusActiveUntil:{id:`${r}.subStatusActiveUntil`,defaultMessage:"Active until"},activeSubsWarning:{id:`${r}.activeSubsWarning`,defaultMessage:"Delete account"},activeSubModalText:{id:`${r}.activeSubModalText`,defaultMessage:"Account can not be deleted, you need to cancel following subscription first:"},activeSubsModalText:{id:`${r}.activeSubsModalText`,defaultMessage:"Account can not be deleted, you need to cancel following subscriptions first:"},activeSubsAbortButtonText:{id:`${r}.activeSubsAbortButtonText`,defaultMessage:"Close"},getReceipt:{id:`${r}.getReceipt`,defaultMessage:"Get receipt"},mockedUsername:{id:`${r}.mockedUsername`,defaultMessage:"Username"},mockedEmail:{id:`${r}.mockedEmail`,defaultMessage:"[email protected]"},mockedSub:{id:`${r}.mockedSub`,defaultMessage:"Example subscription"},mockedPackage:{id:`${r}.mockedPackage`,defaultMessage:"Example package"},subscription:{id:`${r}.subscription`,defaultMessage:"Subscription"},subscriptionsAndPaymentMethod:{id:`${r}.subscriptionsAndPaymentMethod`,defaultMessage:"Subscriptions & Payment Methods"},active:{id:`${r}.active`,defaultMessage:"Active"},trialing:{id:`${r}.trialing`,defaultMessage:"Trialing"},past_due:{id:`${r}.past_due`,defaultMessage:"Past due"},churnHeader:{id:`${r}
29.churnHeader`,defaultMessage:"We're sad to see you go..."},churnDesc:{id:`${r}.churnDesc`,defaultMessage:"Before you cancel, please let us know the reason you’re leaving. Every bit of feedback helps!"},churnTextPlaceholder:{id:`${r}.churnTextPlaceholder`,defaultMessage:"Do you want to share more or leave a comment?"},secondaryHeader:{id:`${r}.secondaryHeader`,defaultMessage:"Anything else we should know?"},footerText:{id:`${r}.footerText`,defaultMessage:"By cancelling your subscription you will no longer have access after your current billing period ends"},staySubs:{id:`${r}.staySubs`,defaultMessage:"Stay subscribed"},reactiveSubscription:{id:`${r}.reactiveSubscription`,defaultMessage:"Undo cancellation"},reactivateDescription:{id:`${r}.reactivateDescription`,defaultMessage:"Changed your mind? Click on the button above to keep your subscription active"},reactiveSuccess:{id:`${r}.reactiveSuccess`,defaultMessage:"Your subscription to {name} has been reactivated again and you will no longer lose access to the content."},updateAffiliate:{id:`${r}.updateAffiliate`,defaultMessage:"{group}"},updateModalLabel:{id:`${r}.updateModalLabel`,defaultMessage:"Update"},updateModalDesc:{id:`${r}.updateModalDesc`,defaultMessage:"Change your option here"},successfullyUpdatedAffiliate:{id:`${r}.successfullyUpdatedAffiliate`,defaultMessage:"Successfully updated new option"},errorUpdatedAffiliate:{id:`${r}.errorUpdatedAffiliate`,defaultMessage:"Something went wrong trying to update new option"},signOutFromAllDevices:{id:`${r}.signOutFromAllDevices`,defaultMessage:"Log out from all devices"},logOutAll:{id:`${r}.logOutAll`,defaultMessage:"Log out all"},signOutFromAllDevicesDescription:{id:`${r}.signOutFromAllDevicesDescription`,defaultMessage:"Log out of all active sessions across all devices, including this one. Please note that you will need to log in again, and that it can take up to 30 minutes for the changes to take effect across all of your devices."},logoutError:{id:`${r}.logoutError`,defaultMessage:"Something went wrong when logging out"},logoutSuccess:{id:`${r}.logoutSuccess`,defaultMessage:"Successfully logged out from all devices"},loggingOut:{id:`${r}.loggingOut`,defaultMessage:"Logging out"},couponRepeating:{id:`${r}.couponRepeating`,defaultMessage:"{remaining_cycles} remaining cycles with {percent_off}% off"},until:{id:`${r}.until`,defaultMessage:" until {date}"},then:{id:`${r}.then`,defaultMessage:"then {price} {interval}"},nextBilling:{id:`${r}.nextBilling`,defaultMessage:"Next billing"},forever:{id:`${r}.forever`,defaultMessage:"{price} {interval} forever"},externalUser:{id:`${r}.externalUser`,defaultMessage:"Logged in from a {provider} account ({email})"},authType:{id:`${r}.authType`,defaultMessage:"Authentication type"},authTypeDescription:{id:`${r}.authTypeDescription`,defaultMessage:"You are logged in with a {provider} account. To change your email address, name or password, please log in with your {provider} account and change it there."},accountDescription:{id:`${r}.accountDescription`,defaultMessage:"Manage your account information, subscriptions and payment methods."},accountUserDetails:{id:`${r}.accountUserDetails`,defaultMessage:"User details"},signedInToPlatform:{id:`${r}.signedInToPlatform`,defaultMessage:"Signed in to {platform}"}})},47614:(e,t,a)=>{a.r(t),a.d(t,{themeProps:()=>n});var s=a(5556),r=a.n(s);const n={colors:r().shape({primaryColor:r().string,accentColor:r().string}),platform:r().shape({name:r().string}),terms:r().shape({userTerms:r().string,privacyPolicy:r().string,cookiePolicy:r().string})}},17625:(e,t,a)=>{a.r(t),a.d(t,{AppAuthPage:()=>f,default:()=>m});var s=a(74848),r=(a(96540),a(67438)),n=a(55733),o=a(19089),i=Object.defineProperty,d=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(e,t,a)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,p=(e,t)=>{for(var a in t||(t={}))l.call(t,a)&&u(e,a,t[a]);if(d)for(var a of d(t))c.call(t,a)&&u(e,a,t[a]);return e};function f(){const{appLink:e,appScheme:t}=(0,n.C)();return(0,s.jsx)("div",{className:"flex flex-col items-center pt-50% sm:pt-10% min-h-[1000px]",children:(0,s.jsxs)("div",{className:"max-w-md w-full px-6 text-center",children:[(0,s.jsx)("h1",{className:"mb-4 text-2xl font-medium text-primaryText",children:(0,s.jsx)(r.A,p({},o.default.openingApp))}),t&&e&&(0,s.jsx)("a",{"data-testid":"app-auth-open-btn",href:e,className:"inline-block w-full py-4 px-6 mb-6 rounded-md bg-primary text-white font-medium text-xl text-center hover:bg-primaryDarker transition-all duration-300",children:(0,s.jsx)(r.A,p({},o.default.openApp))}),(0,s.jsx)("p",{className:"text-sm text-primaryText opacity-75",children:(0,s.jsx)(r.A,p({},o.default.notInstalled))})]})})}const m=f},19089:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n,scope:()=>r});var s=a(11164);
29const r="app.containers.AppAuthPage",n=(0,s.YK)({openingApp:{id:`${r}.openingApp`,defaultMessage:"Opening the app…"},openApp:{id:`${r}.openApp`,defaultMessage:"Open app"},notInstalled:{id:`${r}.notInstalled`,defaultMessage:"Open this page from the app, or download it from the App Store."}})},89782:(e,t,a)=>{a.r(t),a.d(t,{AppLoginPage:()=>A,default:()=>E});var s=a(74848),r=a(96540),n=a(21988),o=a(67438),i=a(16683),d=a(1081),l=a(15422),c=a(78210),u=a(55733),p=a(17386),f=a(1802),m=a(82520),x=a(3652),g=Object.defineProperty,b=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,S=(e,t,a)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,j=(e,t)=>{for(var a in t||(t={}))y.call(t,a)&&S(e,a,t[a]);if(b)for(var a of b(t))h.call(t,a)&&S(e,a,t[a]);return e};const v=(0,d.j8)({platform:(0,p.makeSelectPlatform)()});function A(){const{platform:e}=(0,i.d4)(v),{user:t,isLoading:a,isAuthenticated:d}=(0,c.Jd)(),{logout:p}=(0,n.WB)(),{appLink:g,appScheme:b,isValidating:y}=(0,u.C)();return(0,r.useEffect)((()=>{d&&b&&g&&(window.location.href=g)}),[d,b,g]),d?(0,s.jsx)("div",{className:"flex flex-col items-center pt-50% sm:pt-10% min-h-[1000px]",children:(0,s.jsx)("div",{className:"max-w-md w-full px-6",children:(0,s.jsxs)("div",{className:`${m.defaultLoginClasses.wrapper} text-center`,children:[(0,s.jsx)("h1",{className:m.defaultLoginClasses.title,children:(0,s.jsx)(o.A,j({},x.default.signedInTitle))}),(0,s.jsx)("p",{className:m.defaultLoginClasses.subtitle,children:(0,s.jsx)(o.A,j({},x.default.signedInSubtitle))}),(null==t?void 0:t.email)&&(0,s.jsx)("p",{className:"mb-6 text-sm text-primaryText opacity-75",children:t.email}),!g&&y&&(0,s.jsx)("div",{className:"flex justify-center mb-6",children:(0,s.jsx)(l.default,{})}),g&&(0,s.jsx)("a",{"data-testid":"open-app-btn",href:g,className:"inline-block w-full py-4 px-6 mb-6 rounded-md bg-primary text-white font-medium text-xl text-center hover:bg-primaryDarker transition-all duration-300",children:(0,s.jsx)(o.A,j({},x.default.openApp))}),(0,s.jsx)("button",{type:"button","data-testid":"app-login-logout",onClick:()=>{p({logoutParams:{returnTo:`${window.location.origin}/${e.stayliveIoBasename||""}?redirectTo=${window.location.pathname||"/"}${window.location.search||""}`}})},className:"border-none bg-transparent text-primaryText underline cursor-pointer text-sm",children:(0,s.jsx)(o.A,j({},x.default.wrongAccount))})]})})}):a?(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsx)(l.default,{})}):(0,s.jsx)("div",{className:"flex flex-col items-center pt-50% sm:pt-10% min-h-[1000px]",children:(0,s.jsx)("div",{className:"max-w-2xl w-full px-6",children:(0,s.jsx)(f.default,{textCentered:!0,classes:m.defaultLoginClasses})})})}const E=A},3652:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n,scope:()=>r});var s=a(11164);const r="app.containers.AppLoginPage",n=(0,s.YK)({signedInTitle:{id:`${r}.signedInTitle`,defaultMessage:"You're signed in — continue in the app"},signedInSubtitle:{id:`${r}.signedInSubtitle`,defaultMessage:"Tap the button below to return to the app."},openApp:{id:`${r}.openApp`,defaultMessage:"Open app"},wrongAccount:{id:`${r}.wrongAccount`,defaultMessage:"Not you? Log out"}})}}]);

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.