(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[1566],{2742:e=>{e.exports={body:"body-sm3KMBIc"}},13520:e=>{e.exports={header:"header-Dtkdqc5O",close:"close-Dtkdqc5O"}},82561:e=>{e.exports={message:"message-d3vP5HJI",error:"error-d3vP5HJI"}},64402:e=>{e.exports={actions:"actions-9KDBaBYj","hide-btn-text":"hide-btn-text-9KDBaBYj"}},30516:e=>{e.exports={content:"content-X3KKyG5H",checkboxes:"checkboxes-X3KKyG5H"}},69236:e=>{e.exports={"plans-container":"plans-container-GAQ9CocC","plan-box":"plan-box-GAQ9CocC","one-card-layout":"one-card-layout-GAQ9CocC","plan--next":"plan--next-GAQ9CocC","plan--current":"plan--current-GAQ9CocC","plan-box--title":"plan-box--title-GAQ9CocC","plan-box--description":"plan-box--description-GAQ9CocC","plan-box--days-left":"plan-box--days-left-GAQ9CocC",arrow:"arrow-GAQ9CocC"}},29856:e=>{e.exports={"checkbox-wrap":"checkbox-wrap-e1ycFYBm",checkbox:"checkbox-e1ycFYBm","label-p":"label-p-e1ycFYBm"}},35855:e=>{e.exports={dialog:"dialog-xQE4WxzT","change-plan":"change-plan-xQE4WxzT",body:"body-xQE4WxzT","close-button":"close-button-xQE4WxzT"}},82587:e=>{e.exports={"billing-date":"billing-date-EEnD87dn"}},96240:e=>{e.exports={footer:"footer-N3Bb7EMK",separator:"separator-N3Bb7EMK"}},64331:e=>{e.exports={"info-block":"info-block-pdxqWuDM","info-block-title":"info-block-title-pdxqWuDM","info-block-description":"info-block-description-pdxqWuDM"}},37050:e=>{e.exports={total:"total-JkT5MEd7","description-container":"description-container-JkT5MEd7",price:"price-JkT5MEd7",description:"description-JkT5MEd7",title:"title-JkT5MEd7"}},29883:e=>{e.exports={title:"title-iyvXI0en"}},37062:e=>{e.exports={footer:"footer-hDDUbPct"}},55701:(e,n,t)=>{"use strict";t.r(n),t.d(n,{ChangePlanDialog:()=>ve,changePlanDialog:()=>Pe});var a=t(59496),l=t(87995),r=t(97754),o=t(28353),c=t(9423),i=t(88216),s=t(67844),p=t(9182),d=t(3767),u=t(91955);function h(e,n,t,a,l){(0,u.getTracker)().then(r=>{r&&r.trackChangeProPlan(e,n,t,a,l)})}var y=t(33040),m=t(53402);function g(e){const{currency:n,price:t}=e;if("USD"===n)return a.createElement("span",{className:"i-no-break"},"$",(0,m.round2)(t)," ",(0,o.t)("US"));let l=t.toString();return"TVC"===n&&(l=(0,o.t)("{value} coin",{plural:"{value} coins",count:t,replace:{value:t.toString()}})),a.createElement("span",{className:"i-no-break"},l)}var v=t(82587);function f(e){const n=(0,o.t)("Payable on {billing_date}").split(/{billing_date}/);return a.createElement("div",{className:v["billing-date"]},n[0]," ",a.createElement("span",{className:"i-no-break"},e.billingDate))}var P=t(64464),x=t(33666),C=t(19514),b=t(15510);var E=t(7043);function w(e){return(0,o.t)("{daysCount} day",{plural:"{daysCount} days",count:e,replace:{daysCount:e.toString()}})}var T=t(83317),_=t(37050);function M(e){const{type:n,billingCycle:t,current:l,next:r}=e;if(!(l.days_left&&l.pro_plan&&r.days_left&&r.pro_plan&&n!==y.ChangePlanType.TvcoinsUpgrade))return null;const c=(0,m.isTrialProduct)(l.pro_plan),i=c?(0,m.getProductForTrial)(l.pro_plan):l.pro_plan,s=(0, m.humanizeProPlan)(i,c),p=w(l.days_left),d=(0,m.humanizeProPlan)(r.pro_plan),u=w(r.days_left);let h=(0,o.t)("Your {currentDays} {currentProPlan} convert to {nextDays} of {nextProPlan}",{replace:{currentDays:p,currentProPlan:s,nextDays:u,nextProPlan:d}});return n===y.ChangePlanType.TvcoinsExtend&&(h=(0,o.t)("Your {currentProPlan} extend for a {billingCycle}",{replace:{currentProPlan:s,billingCycle:(0,m.billingCycleToTimeUnit)(t)}})),a.createElement("div",{className:_.description},h)}function k(e){const{currentPayment:n,...t}=e;return a.createElement("div",{className:_.total},a.createElement("div",{className:_["description-container"]},a.createElement("div",{className:_.title},(0,o.t)("Payable today")),a.createElement(M,{...t})),a.createElement("div",{className:_.price},a.createElement(g,{...n})))}function z(e){var n,t,l,r,c;const{nextPayment:i,type:s,productId:p,next:d}=e;let u=new Date(i.date);if(s===y.ChangePlanType.Upgrade||s===y.ChangePlanType.TvcoinsUpgrade||s===y.ChangePlanType.TvcoinsExtend){const e=null!==(n=d.days_left)&&void 0!==n?n:0;u=new Date(Date.now()),u.setDate(u.getDate()+e)}const h=E.dateFormatFunctions["MMM dd, yyyy"](u,!1),v=i.price,w=null!==(l=null===(t=null==v?void 0:v.tax)||void 0===t?void 0:t.tax)&&void 0!==l?l:0,M=0!==w,k=null==i?void 0:i.payment_method_details;let z;k&&(z=null===(r=function(e){const n=e.hint;if("P"===n){const e=(0,o.t)("PayPal account");return{icon:P,hint:e,fullHint:e}}if("A"===n){const e="Apple Pay";return{icon:b,hint:e,fullHint:e}}if("G"===n){const e="Google Pay";return{icon:C,hint:e,fullHint:e}}if(n){const e="*"+n,t=(0,o.t)("card *{paymentHint}",{replace:{paymentHint:n}});return{icon:x,hint:e,fullHint:t}}if(["apple","google"].includes(e.merchant)){const e="Mobile App";return{hint:e,fullHint:e}}return null}(k))||void 0===r?void 0:r.fullHint);const D=s===y.ChangePlanType.TvcoinsExtend||s===y.ChangePlanType.TvcoinsUpgrade,N=(0,m.humanizeProPlan)(p),A=(0,m.getReadableNumericCycle)(e.billingCycle),B=M?".":"";let S=(0,o.t)("{plan} plan ({billingCycle}){point}",{replace:{plan:N,billingCycle:A,point:B}});D&&z&&(S=(0,o.t)("{plan} plan ({billingCycle}), payment method - {paymentMethodHint}{point}",{replace:{plan:N,billingCycle:A,paymentMethodHint:z,point:B}}));const H=null!==(c=null==v?void 0:v.currency)&&void 0!==c?c:"",U=(0,T.getCurrencySign)(H),I=(0,o.t)("Tax included {currencySign}{tax} {currency}").format({tax:(0,m.round2)(w),currency:H,currencySign:U});return a.createElement("div",{className:_.total},a.createElement("div",{className:_["description-container"]},a.createElement(f,{billingDate:h}),a.createElement("div",{className:_.description},S," ",M&&I)),v&&a.createElement("div",{className:_.price},a.createElement(g,{price:v.total,currency:H})))}var D=t(64331),N=t.n(D);function A(e){var n;const{type:t,current:l,next:r}=e,c=void 0===l.pro_plan,i={title:(0,o.t)("You won't be billed today"),description:(0,o.t)("We'll just update the number of days left on your new subscription.")},s={title:(0,o.t)("Your subscription will change on the next billing cycle"),description:(0, o.t)("We'll switch you onto your new plan after your current one finishes")};let p="";if(l.pro_plan&&l.days_left){const e=(0,m.isTrialProduct)(l.pro_plan),n=e?(0,m.getProductForTrial)(l.pro_plan):l.pro_plan,t=(0,m.humanizeProPlan)(n,e);p=(0,o.t)("Your account has {currentDays} day left in the current {currentProPlan} plan.",{plural:"Your account has {currentDays} days left in the current {currentProPlan} plan.",count:l.days_left,replace:{currentDays:l.days_left.toString(),currentProPlan:t}})}const d=(0,o.t)("We'll convert this remaining time into an equivalent value of days on your new plan.");let u="";if(r.pro_plan&&r.days_left){const e=(0,m.humanizeProPlan)(r.pro_plan);u=(0,o.t)("Your {nextProPlan} plan will have {nextDays} day after the purchase.",{plural:"Your {nextProPlan} plan will have {nextDays} days after the purchase.",count:r.days_left,replace:{nextDays:r.days_left.toString(),nextProPlan:e}})}const h={description:`${p} ${d} ${u}`,title:null},g=null!==(n=r.days_left)&&void 0!==n?n:0,v=new Date(Date.now());v.setDate(v.getDate()+g);const f={title:(0,o.t)("Your subscription will not auto renew"),description:(0,o.t)("You will have access until {date}.",{replace:{date:E.dateFormatFunctions["MMM dd, yyyy"](v,!1)}})},P={[y.ChangePlanType.Downgrade]:s,[y.ChangePlanType.Switch]:s,[y.ChangePlanType.Reactivate]:s,[y.ChangePlanType.Upgrade]:i,[y.ChangePlanType.TvcoinsUpgrade]:c?f:h,[y.ChangePlanType.TvcoinsExtend]:i}[t];return a.createElement("div",{className:N()["info-block"]},P.title&&a.createElement("h3",{className:N()["info-block-title"]},P.title),a.createElement("p",{className:N()["info-block-description"]},P.description))}var B=t(96240);function S(e){const{productData:n,billingCycle:t,current:l,next:r,type:o,nextPayment:c,currentPayment:i}=e,s=o===y.ChangePlanType.Upgrade||o===y.ChangePlanType.TvcoinsUpgrade||o===y.ChangePlanType.TvcoinsExtend,p=null!=c,d=o!==y.ChangePlanType.TvcoinsExtend;return a.createElement("div",{className:B.footer},s&&a.createElement(k,{currentPayment:i,current:l,next:r,billingCycle:t,type:o}),s&&p&&a.createElement("div",{className:B.separator}),c&&a.createElement(z,{billingCycle:t,productId:n.text_id,nextPayment:c,type:o,next:r}),d&&a.createElement(A,{type:o,current:l,next:r}))}var H=t(29883);function U(e){const n=(0,o.t)("Upgrade subscription to the next level"),t={[y.ChangePlanType.Reactivate]:(0,o.t)("Reactivate subscription"),[y.ChangePlanType.Downgrade]:(0,o.t)("Downgrade subscription"),[y.ChangePlanType.Upgrade]:n,[y.ChangePlanType.TvcoinsUpgrade]:n,[y.ChangePlanType.TvcoinsExtend]:(0,o.t)("Extend current subscription"),[y.ChangePlanType.Switch]:(0,o.t)("Switch subscription's billing cycle")}[e.type];return a.createElement("h2",{className:H.title},t)}var I,R=t(44943),F=t(15294),V=t(86629),Y=t(78540),O=t(76266),L=t(1405),G=t(29856);function Q(e){const n=(0,o.t)("I have read and agreed with the {policiesLinkTag}Terms of Use{linkCloseTag} and {pivacyPolicyLinkTag}Privacy Policy{linkCloseTag}"),t=(0, o.t)("I authorize TradingView to charge me automatically every year until I cancel my subscription."),l=(0,o.t)("I authorize TradingView to charge me automatically every month until I cancel my subscription."),r=(0,o.t)("I acknowledge that refunds are NOT available for monthly payments."),c=(0,o.t)("If the auto renewal fails for an annual plan I will automatically be switched to a monthly plan for {cost} per month.").split(/{cost}/),{billingCycle:i,productData:s}=e,p=n.split(/{policiesLinkTag}|{linkCloseTag}|{pivacyPolicyLinkTag}/),d=window.pro.getCost(s,Y.BillingCycle.Monthly);return a.createElement("div",null,a.createElement("p",{className:G["label-p"]},i===Y.BillingCycle.OneYear?t:l),a.createElement("p",{className:G["label-p"]},i===Y.BillingCycle.Monthly&&r,i===Y.BillingCycle.OneYear&&!(0,O.isFeatureEnabled)("switching_trial_year_to_month_disabled")&&a.createElement("span",null,c[0]," ",a.createElement(g,{price:d,currency:"USD"})," ",c[2]),a.createElement("span",null,p[0],a.createElement("a",{target:"_blank",tabIndex:-1,href:"/policies/"},p[1]),p[2],a.createElement("a",{target:"_blank",tabIndex:-1,href:"/privacy-policy/"},p[3]),p[4])))}!function(e){e.ReadAndAcceptTerms="read_and_accept_terms"}(I||(I={}));const W={[I.ReadAndAcceptTerms]:!1};function K(e){const{validationResults:n,value:t,onChange:l,billingCycle:r,productData:o}=e,c=(0,V.useControlValidationLayout)({hasErrors:!n.isValid,errors:n.errors,messagesPosition:V.MessagesPosition.Attached,customErrorsAttachment:{attachment:L.anchors.top.attachment,targetAttachment:L.anchors.top.targetAttachment,attachmentOffsetY:-4}});return a.createElement("div",{className:G["checkbox-wrap"],onFocus:c.onFocus,onBlur:c.onBlur,onMouseOver:c.onMouseOver,onMouseOut:c.onMouseOut,ref:c.containerReference},a.createElement(F.Checkbox,{className:G.checkbox,checked:t,label:a.createElement(Q,{billingCycle:r,productData:o}),name:I.ReadAndAcceptTerms.toString(),onChange:l,intent:n.isValid?"primary":"danger"}),c.renderedErrors)}var q=t(46198);const J=(0,o.t)("You need to accept our Terms of Use and Privacy Policy to continue");function $(e=!1){const n=Boolean(e);return{isValid:n,errors:n?[]:[J]}}function j(e){var n;return null!==(n={[q.ProPlans.Pro]:(0,o.t)("Distraction-free trading and investing, with more charts, intervals and indicators"),[q.ProPlans.ProRealtime]:(0,o.t)("Intraday technical analysis for day traders looking to take things to the next level"),[q.ProPlans.ProPremium]:(0,o.t)("Highest precision and maximum data to capture all possible opportunities")}[e])&&void 0!==n?n:""}function X(e){return(0,o.t)("{daysCount} day",{plural:"{daysCount} days",count:e}).format({daysCount:e.toString()})}var Z=t(26996),ee=t(18662),ne=t(71036),te=t(76974),ae=t(64402);function le(e){const{validateForm:n,type:t,onSuccess:l,onError:c,next:i,offer:s}=e,[p,d]=(0,a.useState)(!1),u=i.pro_plan?(0,o.t)("Upgrade to {proPlan}",{replace:{proPlan:(0,m.humanizeProPlan)(i.pro_plan)}}):void 0,h={[y.ChangePlanType.Reactivate]:(0,o.t)("Reactivate"),[y.ChangePlanType.Downgrade]:(0,o.t)("Downgrade"), [y.ChangePlanType.Upgrade]:u,[y.ChangePlanType.TvcoinsUpgrade]:u,[y.ChangePlanType.TvcoinsExtend]:(0,o.t)("Extend"),[y.ChangePlanType.Switch]:(0,o.t)("Switch")}[t],g=(0,te.useIsMounted)(),v=(0,a.useCallback)(async()=>{if(n()&&!p){d(!0);try{t===y.ChangePlanType.Upgrade?await(0,ee.postUpgrade)({pro_plan:i.pro_plan,billing_cycle:i.billing_cycle}):t===y.ChangePlanType.Downgrade||t===y.ChangePlanType.Reactivate||t===y.ChangePlanType.Switch?await(0,ee.postDowngrade)({pro_plan:i.pro_plan,billing_cycle:i.billing_cycle,offer:s}):t!==y.ChangePlanType.TvcoinsUpgrade&&t!==y.ChangePlanType.TvcoinsExtend||await(0,ee.postTvcoinsProPlan)({pro_plan:i.pro_plan,billing_cycle:i.billing_cycle}),l()}catch(e){c(e.message)}finally{g.current&&d(!1)}}},[p,n,t,i,s]);return a.createElement("div",{className:ae.actions},a.createElement(ne.SquareButton,{className:ae["footer-button"],onClick:v},a.createElement("span",{className:r(p&&ae["hide-btn-text"])},h),p&&a.createElement(Z.Loader,{color:"white"})))}var re=t(9745),oe=t(4585),ce=t(69236);const ie=E.dateFormatFunctions["MMM dd, yyyy"];function se(e){var n,t;const{type:l,current:c,next:i,nextPayment:s}=e,p=l===y.ChangePlanType.Reactivate,d=l===y.ChangePlanType.Downgrade,u=i.pro_plan,h=void 0!==c.pro_plan&&(0,m.isTrialProduct)(c.pro_plan),g=c.pro_plan&&h?(0,m.getProductForTrial)(c.pro_plan):c.pro_plan,v=p||!g;let f=X(null!==(n=c.days_left)&&void 0!==n?n:0),P=X(null!==(t=i.days_left)&&void 0!==t?t:0);const x=r(ce["plan--current"],ce["plan-box"],v&&ce["one-card-layout"]),C=r(ce["plan--next"],ce["plan-box"],v&&ce["one-card-layout"]);if(d&&s){const e=new Date(s.date);e.setDate(e.getDate()-1),f=(0,o.t)("Until {date}",{replace:{date:ie(e,!1)}});const n=new Date(s.date);P=(0,o.t)("Starting from {date}",{replace:{date:ie(n,!1)}})}return a.createElement("div",{className:ce["plans-container"]},g&&a.createElement("div",{className:x},a.createElement("span",{className:ce["plan-box--title"]},(0,m.humanizeProPlan)(g,h)),a.createElement("span",{className:ce["plan-box--description"]},j(g)),a.createElement("span",{className:ce["plan-box--days-left"]},f)),!v&&a.createElement(re.Icon,{icon:oe,className:ce.arrow}),!p&&u&&a.createElement("div",{className:C},a.createElement("span",{className:ce["plan-box--title"]},(0,m.humanizeProPlan)(u)),a.createElement("span",{className:ce["plan-box--description"]},j(u)),a.createElement("span",{className:ce["plan-box--days-left"]},P)))}var pe=t(30516);const de=[I.ReadAndAcceptTerms];function ue(e){const{type:n,nextPayment:t,current:l,next:r,currentPayment:o,onError:c,onSuccess:i,offer:s}=e,p=n===y.ChangePlanType.Switch,d=r.billing_cycle,u=r.pro_plan;if(!u||!d)return null;const h=window.pro.getProduct(u),m={[I.ReadAndAcceptTerms]:t?$:R.dumbValidator},[g,v,f]=(0,R.useFormValidation)(de,m,W);return a.createElement("div",{className:pe.content},a.createElement(U,{type:n}),!p&&a.createElement(se,{next:r,current:l,type:n,nextPayment:t}),a.createElement(S,{productData:h,billingCycle:d,nextPayment:t,type:n,current:l,next:r,currentPayment:o}),t&&a.createElement(K,{...g[I.ReadAndAcceptTerms], billingCycle:d,productData:h,onChange:function(){const e=I.ReadAndAcceptTerms,n=!g[e].value;f({[e]:m[e](n)}),g[e].onChange(n)}}),a.createElement(le,{type:n,validateForm:v,next:r,onError:c,onSuccess:i,offer:s}))}var he=t(37005),ye=t(25760);var me=t(35855);const ge={[y.ChangePlanType.Downgrade]:"downgrade",[y.ChangePlanType.Switch]:"switch",[y.ChangePlanType.Upgrade]:"upgrade",[y.ChangePlanType.Reactivate]:"reactivate",[y.ChangePlanType.TvcoinsUpgrade]:"upgrade-tvcoins",[y.ChangePlanType.TvcoinsExtend]:"extend-tvcoins"};function ve(e){const{isOpened:n,...t}=e,{current:l,next:c,type:i}=t,u=(0,o.t)("Close",{context:"input"}),[y,m]=(0,a.useState)(null),g=(0,te.useIsMounted)(),v=l&&l.billing_cycle,f=c&&c.billing_cycle,P=(0,a.useCallback)(()=>{h(c.pro_plan,l.pro_plan,"close-"+ge[i],v,f),e.onClose()},[e.onClose]);return(0,a.useEffect)(()=>{h(c.pro_plan,l.pro_plan,"show-"+ge[i],v,f)},[]),(0,he.useFixedBody)(),function(e){const n=(0,a.useRef)(null),t=(0,a.useRef)(null);(0,a.useEffect)(()=>(n.current=ye.createGroup({desc:"Change plan popup",modal:!0}),t.current=n.current.add({desc:"close",hotkey:27,handler:e.onClose}),()=>{var e;null===(e=n.current)||void 0===e||e.destroy()}),[]),(0,a.useEffect)(()=>{var a,l;t.current&&(null===(a=n.current)||void 0===a||a.remove(t.current)),t.current=null===(l=n.current)||void 0===l?void 0:l.add({desc:"close",hotkey:27,handler:e.onClose})},[e.onClose])}({onClose:P}),a.createElement(d.Modal,{className:r(me.dialog,me["change-plan"]),width:768,isOpened:n,onClick:function(){null!==y&&m(null)}},null!==y&&a.createElement(p.Message,{isError:!0,text:y}),a.createElement(p.Body,{className:me.body},a.createElement(ue,{...t,onError:function(e){g.current&&m(e)}}),a.createElement(s.CloseButton,{className:me["close-button"],"aria-label":u,onClick:P})))}let fe=!1;async function Pe(e){const{current:n,next:t}=e;if(!n.pro_plan||!t.pro_plan||fe)return;const r=(0,c.guid)(),o=(0,i.getRootOverlapManager)(),s=o.ensureWindow(r);function p(){e.onSuccess&&e.onSuccess(),d()}function d(){fe=!1,l.unmountComponentAtNode(s),o.removeWindow(r)}window.pro.runOrUpdate((function(){fe=!0,l.render(a.createElement(ve,{...e,onSuccess:p,onClose:d,isOpened:!0}),s)}))}},9182:(e,n,t)=>{"use strict";t.d(n,{Body:()=>p,Header:()=>i,Message:()=>h});var a=t(59496),l=t(97754),r=t(13520),o=t(49370),c=t(9745);function i(e){const n=e.hideIcon?null:a.createElement(c.Icon,{className:r.close,icon:o,onClick:e.onClose});return a.createElement("div",{className:l(r.header,e.className),"data-dragg-area":!0,ref:e.reference},e.children,n)}t(37062);var s=t(2742);function p(e){return a.createElement("div",{className:l(s.body,e.className),ref:e.reference},e.children)}var d=t(58095),u=t(82561);function h(e){let n;e.text?n=a.createElement("span",null,e.text):e.html&&(n=a.createElement("span",{dangerouslySetInnerHTML:{__html:e.html}}));const t=(0,d.useOutsideEvent)({mouseDown:!0,touchStart:!0,handler:e.onClickOutside});if(!n)return null;const r=l(u.message,e.className,{[u.error]:e.isError});return a.createElement("div",{className:r,key:"0" },a.createElement("span",{ref:t},n))}},4585:e=>{e.exports=''},15510:e=>{e.exports=''},33666:e=>{e.exports=''},19514:e=>{ e.exports=''},64464:e=>{e.exports=''},49370:e=>{ e.exports=''}}]);