PageSourceSearch

https://cdn.vialibri.net/static/assets/UserSubscription-Can39b8L.js

js vialibri.net collected 2026-09-24 09:38:47 UTC 6,111 bytes, 2 lines download raw bytes

1!function(){try{var s="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new s.Error).stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="58fbdaff-76a3-4642-8440-0ed379098bd7",s._sentryDebugIdIdentifier="sentry-dbid-58fbdaff-76a3-4642-8440-0ed379098bd7")}catch(s){}}();import"./_sentry-release-injection-file-SYOkQ1Km.js";import{a as s}from"./rolldown-runtime-BBzOAo5_.js";import{t as e}from"./react-DuV36FPs.js";import{t as r}from"./useDateDisplay-CpNnMNz1.js";import{t}from"./Popover-SQcXFpwc.js";import{K as i,R as n,at as a,i as l,s as d}from"./index-CRc22cjs.js";var c=s(e()),o=a(),h=i(),x=({invoices:s})=>{const{formatDate:e}=r();return s&&s.length?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("h3",{children:(0,h.jsx)(o.T,{message:"Invoices"})}),(0,h.jsxs)("table",{className:"table",children:[(0,h.jsx)("thead",{children:(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{width:"20%",children:(0,h.jsx)(o.T,{message:"Date"})}),(0,h.jsx)("th",{width:"40%",children:(0,h.jsx)(o.T,{message:"Status"})}),(0,h.jsx)("th",{width:"20%",children:(0,h.jsx)(o.T,{message:"Total"})}),(0,h.jsx)("th",{width:"20%",children:(0,h.jsx)(o.T,{message:"Invoice"})})]})}),(0,h.jsx)("tbody",{children:s.reverse().map((s=>(0,h.jsxs)("tr",{children:[(0,h.jsx)("td",{children:e(s.start_date)}),(0,h.jsx)("td",{children:s.status}),(0,h.jsx)("td",{children:s.total}),(0,h.jsx)("td",{children:(0,h.jsxs)("a",{href:s.pdf_url,children:[(0,h.jsx)(o.T,{message:"Invoice"})," #",s.id]})})]},s.id)))})]})]}):null},j=l(null,(s=>({cancelSubscription:()=>s(d())})))((0,o.withTranslators)((({user:s,t:e,cancelSubscription:i,billingAddress:a,booksListed:l,wantsStored:d,cardRecentlyUpdated:j,invoices:u})=>{const[m,b]=(0,c.useState)(!1),[p,g]=(0,c.useState)(!1),f=(0,c.useRef)(null),y=(0,c.useRef)(null),{formatDate:T}=r(),_=s.has_valid_subscription?(0,h.jsx)("table",{className:"table table--simple",children:(0,h.jsxs)("tbody",{children:[(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:(0,h.jsx)(o.T,{message:"Subscription level:"})}),(0,h.jsxs)("td",{children:[s.subscription_level," "]})]}),(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:(0,h.jsx)(o.T,{message:"Billing period:"})}),(0,h.jsx)("td",{children:s.subscription_term})]}),(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:(0,h.jsx)(o.T,{message:"Renewal date:"})}),(0,h.jsx)("td",{children:T(s.subscription_expires)})]}),(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:(0,h.jsx)(o.T,{message:"Payment method:"})}),(0,h.jsx)("td",{children:s.uses_stripe?(0,h.jsx)(o.T,{message:"Credit card"}):(0,h.jsx)(o.T,{message:"PayPal"})})]}),(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:(0,h.jsx)(o.T,{message:"Wants limit:"})}),(0,h.jsxs)("td",{children:[n(d||0)," / ",n(s.wants_allowance)]})]}),s.subscription_max_books>0?(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:(0,h.jsx)(o.T,{message:"Books listed:"})}),(0,h.jsxs)("td",{children:[n(l||0)," / ",n(s.subscription_max_books)]})]}):null,(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{}),(0,h.jsxs)("td",{children:[(0,h.jsx)("a",{className:"button",href:"/account/subscription/edit",children:(0,h.jsx)(o.T,{message:"Change subscription details"})}),s.uses_stripe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("a",{className:"small margin-left colour--grey",ref:y,onClick:()=>b(!0),children:(0,h.jsx)(o.T,{message:"Cancel subscription"})}),m&&(0,h.jsx)(t,{parentRef:y,onHide:()=>{b(!1),g(!1)},shrinkWidth:!0,children:(0,h.jsxs)("div",{className:"stripe-subscription-cancellation",children:[(0,h.jsx)("p",{children:e("Are you sure you want to cancel your subscription?")}),(0,h.jsx)("p",{children:e("Your subscription will be cancelled immediately and you will receive a refund for the remaining period.")}),(0,h.jsx)("div",{className:"stripe-subscription-cancellation__button",children:(0,h.jsx)("button",{type:"button",className:"button button--small",onClick:()=>{g(!0),i()},disabled:p,children:p?(0,h.jsx)(o.T,{message:"Canceling subscription..."}):(0,h.jsx)(o.T,{message:"Cancel subscription"})})})]})})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("a",{className:"small margin-left colour--grey",onClick:()=>{},ref:f,children:(0,h.jsx)(o.T,{message:"Cancel subscription"})}
1),(0,h.jsx)(t,{parentRef:f,isHover:!0,closeManually:!0,children:(0,h.jsx)("p",{dangerouslySetInnerHTML:{__html:e('Please <a href="/contact-us">get in touch with us</a> if you would like to cancel.')}})})]})]})]}),(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:2,children:(0,h.jsx)("hr",{})})}),s.uses_stripe&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:(0,h.jsx)(o.T,{message:"Credit card number:"})}),(0,h.jsxs)("td",{children:["**** **** **** ",s.card_last4]})]}),(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:(0,h.jsx)(o.T,{message:"Card expires:"})}),(0,h.jsxs)("td",{children:[s.card_expiry_month," / ",s.card_expiry_year]})]}),(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:(0,h.jsx)(o.T,{message:"Billing address:"})}),(0,h.jsx)("td",{children:a})]}),(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{}),(0,h.jsx)("td",{children:(0,h.jsx)("a",{className:"button",href:"/account/update-card",children:(0,h.jsx)(o.T,{message:"Update card"})})})]}),(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:2,children:(0,h.jsx)("hr",{})})})]})]})}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("p",{children:(0,h.jsx)(o.T,{message:"You are not subscribed to Premium Services."})}),(0,h.jsx)("a",{href:"/account/subscription/edit",className:"button",children:(0,h.jsx)(o.T,{message:"Subscribe now"})}),(0,h.jsx)("br",{})]});return(0,h.jsxs)("div",{className:"account__subscription",children:[j&&(0,h.jsx)("div",{className:"form-message form-message--success margin-top--none margin-bottom",children:(0,h.jsx)(o.T,{message:"Your card details have been successfully updated. Our system is still updating your records so the information shown below might not be up to date yet."})}),_,(0,h.jsx)(x,{invoices:u})]})})));export{j as default};
2//# sourceMappingURL=UserSubscription-Can39b8L.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.