Files
ai/charting_library/bundles/upgradeDialog.b5c7e23d29874316e21c.js
2023-02-02 13:31:14 +00:00

1 line
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[9347],{47684:(e,n,r)=>{r.r(n),r.d(n,{upgradeDialog:()=>u});var t=r(28353),a=r(11313),i=r(33040),o=r(3615),c=r(18662);async function u(e){const{fallback:n,proPlan:r,billingCycle:u}=e;let s=null;try{s=await(0,c.getUpgrade)({pro_plan:r,billing_cycle:u})}catch(e){if(["ApiError:anonymization_activated","ApiError:payments_banned"].includes(e.name))return void(0,o.showWarning)({title:(0,t.t)("Error"),text:e.message});if(["ApiError:upgrade_not_permitted"].includes(e.name))return void(0,o.showWarning)({title:(0,t.t)("Recurring payment issue"),text:(0,t.t)("Sorry, your subscription cant currently be extended, downgraded or upgraded because your payment method doesnt support recurring payments. Please head to profile settings to update your payment method, then try again.")});n()}if(!s)return void n();const{current:p,upgrade:l,next_billing:d}=s;l&&l.pro_plan?(0,a.changePlanDialog)({current:p,next:l,nextPayment:d,type:i.ChangePlanType.Upgrade,currentPayment:{currency:"USD",price:0},onSuccess:function(){e.onSuccess&&e.onSuccess()}}):n()}}}]);