define("modules/clean/account_page/tabs/billing",["require","exports","tslib","modules/clean/event_handler","modules/core/browser","modules/clean/payments/billing_info_modal","modules/clean/dbmodal_stack","modules/clean/deprecated/dbmodal_loading","external/react","external/react-redux","modules/clean/react/css","modules/core/i18n","modules/clean/web_timing_logger","modules/clean/account_page/util","modules/clean/teams/admin/lib/billing_history","modules/clean/account_page/widgets/billing/payment_methods_util","modules/clean/account_page/widgets/billing/action_creators","modules/clean/account_page/widgets/plan/action_creators","modules/clean/account_page/widgets/plan/add_ons/action_creators","modules/clean/teams/admin/widgets/billing_history/billing_history_table","modules/clean/account_page/widgets/plan/views/cancel_subs_warning_modal","modules/clean/account_page/widgets/plan/views/change_schedule_modal","modules/clean/account_page/widgets/plan/views/disable_stacked_transitions_modal","modules/clean/react/payments/edit_invoice_address_modal/edit_invoice_address_modal_loader","modules/constants/account_page","modules/clean/react/payments/update_billing_individual/individual_update_billing_modal_loader","modules/clean/account_page/components/key_value_block","modules/clean/account_page/components/loading","modules/constants/account_page","modules/constants/trademark","modules/clean/analytics","modules/clean/payments/validation","modules/clean/payments/skus/subscription_status"],function(e,t,n,a,r,i,o,s,l,c,u,d,p,m,h,_,f,g,y,b,S,v,E,T,P,C,N,I,x,A,w,L,k){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var D=function(e){return{billingInfo:e.billingInfo.billingInfo,loadingState:e.billingInfo.loadingState,dataLoadedForTTI:"ready"===e.billingInfo.loadingState}},O=function(e){return{loadBillingInfo:function(t){return void 0===t&&(t=!1),e(f.loadDataIfNecessary(t))},loadPlanDataIfNecessary:function(t){return void 0===t&&(t=!1),e(g.loadDataIfNecessary(t))},loadEvhInfoIfNecessary:function(t){return void 0===t&&(t=!1),e(y.loadEvhInfoIfNecessary(t))}}},R=(function(e){function t(t){var n=e.call(this,t)||this;return n.handlePaymentUpdate=function(){w.ProEventsLogger.log("de_billing_tab_update_payment_method_click"),P.INDIVIDUAL_UPDATE_BILLING_MODAL_REFACTOR?C.IndividualUpdateBillingModalLoader.showInstance():o.DBModalStack.push(new s({element_id:"update_billing_info",endpoint_url:"/billing_info_modal",html_in_error_msg:!0,parameters:{}}))},n.handlePaymentAdd=function(){w.ProEventsLogger.log("de_billing_tab_add_payment_method_click"),o.DBModalStack.push(new s({element_id:"add_billing_info",endpoint_url:"/add_billing_info_modal",html_in_error_msg:!0}))},n.handlePaymentAddToResubscribe=function(){w.ProEventsLogger.log("de_billing_tab_add_payment_method_resubscribe_click"),o.DBModalStack.push(new s({element_id:"update_billing_info",endpoint_url:"/billing_info_modal",html_in_error_msg:!0,parameters:{resubscribe:!0}}))},n.reloadData=function(){var e=n.props,t=e.loadBillingInfo,a=e.loadPlanDataIfNecessary,r=e.loadEvhInfoIfNecessary;t(!0),r(!0),a(!0)},n.handleBillingChange=function(){w.ProEventsLogger.log("de_billing_tab_change_billing_modal_open");var e=n.props.billingInfo,t=e.payment_info,a=e.scheduled_for_downgrade;if(x.NO_RESET_INTERVAL_FOR_USERS&&x.DE_DISABLE_STACKED_TRANSITIONS&&n.pendingScheduledChange())return void E.DisableStackedTransitionsModal.showInstance();a?S.CancelChangesModalConfirmation.showInstance({transitionPerformed:n.reloadData,subStatus:n.subStatus}):v.ChangeScheduleModalView.showInstance({transitionPerformed:n.reloadData,paymentInfo:t})},n.onEditInvoiceDetailsClick=function(){w.ProEventsLogger.log("de_billing_tab_edit_invoice_modal_open"),T.EditInvoiceAddressModalLoader.showUpdateTaxProfileModal(!1,n.onInvoiceDetailsUpdated)},n.onInvoiceDetailsUpdated=function(){n.props.loadBillingInfo(!0)},n.renderBillingHistory=function(){var e=n.props.billingInfo.transactions,t=[],a=!1;return null!==e&&e.transactions.length>0&&(t=h.getHistoryData(e.transactions),a=t.length>3,t=t.slice(0,3)),l.createElement("div",{className:"account-page-block"},l.createElement("span",{className:"account-page-block__heading"},d._("Billing history")),l.createElement("p",{className:"account-page-block__subtext"},d._("View invoices and receipts for all payments made on your Dropbox account.")),l.createElement("div",{className:"billing-table-container"},l.createElement(b.BillingHistoryTable,{billingHistoryRecords:t,amountLabel:d._("Amount"),displayNoTransactionsOnEmptyRecords:!0,showEditInvoiceModal:!1,noTransactionLabel:d._("No transaction history"),footer:n.buildFooter(a),logAccountBillingTabEvents:!0})))},n.buildFooter=function(e){if(e)return l.createElement("tr",{className:"billing-history-row"},l.createElement("td",{colSpan:4,className:"billing-history-col"},l.createElement("a",{href:"/payments",target:"_blank",rel:"noopener noreferrer",onClick:n.logViewAll},d._("View all billing history"))))},n.logViewAll=function(){w.ProEventsLogger.log("de_billing_tab_view_all_click")},n.renderPaymentMethod=function(){if(n.user.paid){var e=n.props.billingInfo.payment_info,t=e.gateway_id,a=e.expiration_date,r=e.description,i=e.is_external_billing,o=e.end_date,s=e.deactivated,c=e.is_on_trial,u=e.reseller_name,p=e.reseller_link;if(i){var m=d._("Go to %(reseller_name)s to view or make changes to your account details").format({reseller_name:u}),h=l.createElement("a",{href:p,target:"_blank",rel:"noopener noreferrer"},m);return l.createElement(N.KeyValueBlock,{keyText:h})}if(t!==-1){if(!_.shouldHidePaymentMethod(t)&&!n.props.billingInfo.payment_method)return l.createElement(N.KeyValueBlock,{keyText:d._("You can add your payment information now to have your subscription automatically renew when it expires"),linkText:d._("Add"),onLinkClick:n.handlePaymentAddToResubscribe});if(_.isLicenseKey(t))return l.createElement(N.KeyValueBlock,{keyText:d._("You can add your payment information now to have your subscription automatically renew when it expires"),linkText:d._("Add"),onLinkClick:n.handlePaymentAdd});if(_.shouldHidePaymentMethod(t)){var f=_.getPaymentMethodDisabledMessage(t,i,A.TRADEMARK_PLUS,o,s,c);return l.createElement(N.KeyValueBlock,{keyText:f})}var g=r;return null!==a&&(g=d._("%(payment_description)s, exp: %(expiration_date)s").format({payment_description:r,expiration_date:a,comment:'Payment description is a card information, already translated (ex> Visa ending in 2543). Date is in format MM / YYYY ( ex> 08 / 2017 ). An example translated string is "Visa ending in 2543, exp: 08 / 2017 ).'})),l.createElement(N.KeyValueBlock,{keyText:d._("Payment method"),valueText:g,linkText:d._("Update"),onLinkClick:n.handlePaymentUpdate})}}},n.renderBillingPeriod=function(){if(n.user.paid){var e=n.props.billingInfo,t=e.payment_info,a=e.scheduled_for_downgrade;if(!_.shouldHideBillingChange(t.gateway_id,t.is_external_billing)&&t.period){if(!t.schedule_switchable&&!a)return l.createElement(N.KeyValueBlock,{keyText:d._("Sorry, you cannot change your billing schedule at this time.")});var r=d._("Plan billed %(period)s").format({period:t.period});return l.createElement(N.KeyValueBlock,{keyText:d._("Billing period"),valueText:r,linkText:d._("Change"),onLinkClick:n.handleBillingChange})}}},n.renderInvoiceDetails=function(){var e=n.props.billingInfo,t=e.show_edit_invoice_modal,a=e.payment_info,r=e.payment_method,i=e.has_invoice_details;if(n.user.paid&&t&&!_.shouldHideBillingChange(a.gateway_id,a.is_external_billing)&&a.period){var o=d._("Add details to your invoice, such as company name and address."),s=null;void 0!==r&&(s=r.country_code),s&&L.hasVat(s)&&(o=d._("Add details to your invoice, such as company name, address, and VAT ID."));var c=d._("Update");return i||(c=d._("Add invoice details")),l.createElement(N.KeyValueBlock,{keyText:d._("Invoice details"),linkText:c,subtext:o,onLinkClick:n.onEditInvoiceDetailsClick})}},n.user=m.getCurrentUser(),o.DBModalStack.register(i.BILLING_INFO_UPDATED,function(){w.ProEventsLogger.log("de_payment_modal_save_click"),n.props.loadBillingInfo(!0),n.props.loadPlanDataIfNecessary(!0)}),n}return n.__extends(t,e),t.prototype.componentDidMount=function(){var e=this;this.props.loadBillingInfo(),this.checkTTIstate(),w.ProEventsLogger.log("de_billing_tab_view"),this.events.on(window,"hashchange",function(){e.displayResubscribeBillingModal(),e.displayUpdateBillingModal()}),this.displayResubscribeBillingModal(),this.displayUpdateBillingModal()},t.prototype.componentDidUpdate=function(){this.checkTTIstate()},t.prototype.displayUpdateBillingModal=function(){var e=r.get_hash();void 0!==e&&e.search("billing_info")!==-1&&e.search("resubscribe_billing_info")===-1&&(P.INDIVIDUAL_UPDATE_BILLING_MODAL_REFACTOR?C.IndividualUpdateBillingModalLoader.showInstance():o.DBModalStack.push(new s({element_id:"update_billing_info",endpoint_url:"/billing_info_modal",html_in_error_msg:!0,parameters:{}})))},t.prototype.displayResubscribeBillingModal=function(){var e=r.get_hash();void 0!==e&&e.search("resubscribe_billing_info")!==-1&&(P.INDIVIDUAL_UPDATE_BILLING_MODAL_REFACTOR?C.IndividualUpdateBillingModalLoader.showInstance():o.DBModalStack.push(new s({element_id:"update_billing_info",endpoint_url:"/billing_info_modal",html_in_error_msg:!0,parameters:{resubscribe:!0}})))},Object.defineProperty(t.prototype,"subStatus",{get:function(){var e=this.props.billingInfo.serialized_sub_status;if(e)return k.SubscriptionStatus.deserialize(e)},enumerable:!0,configurable:!0}),t.prototype.pendingScheduledChange=function(){return this.isPlanScheduledToChange()||this.isBillingScheduleToChange()||this.isEvhScheduledToChange()},t.prototype.isPlanScheduledToChange=function(){var e=this.subStatus;return!!this.props.billingInfo||!!(e&&e.subState.plan&&e.finalSubState.plan)&&e.subState.plan.productType!==e.finalSubState.plan.productType},t.prototype.isEvhScheduledToChange=function(){var e=this.subStatus;return!(!e||!e.scheduledSubState)&&e.subState.quantityForEvhAddOn()!==e.scheduledSubState.quantityForEvhAddOn()},t.prototype.isBillingScheduleToChange=function(){var e=this.subStatus;return!!(e&&e.subState.billingSchedule&&e.finalSubState.billingSchedule)&&e.subState.billingSchedule.id!==e.finalSubState.billingSchedule.id},t.prototype.checkTTIstate=function(){this.props.dataLoadedForTTI&&(p.mark_time_to_view(),p.mark_time_to_interactive())},t.prototype.isLoading=function(){return"ready"!==this.props.loadingState},t.prototype.render=function(){return this.isLoading()?l.createElement(I.Loading,null):l.createElement("div",{className:"account-page-tab"},this.renderPaymentMethod(),this.renderBillingPeriod(),this.renderInvoiceDetails(),this.renderBillingHistory())},t=n.__decorate([a.eventHandler],t)})(l.Component),M=c.connect(D,O)(R);t.BillingTab=u(M,["/static/css/account/pagelet/billing_tab-vflTHh_M9.css","/static/css/plan_management-vfl6RBJS-.css"])}),define("modules/clean/account_page/tabs/plan",["require","exports","tslib","external/react","modules/clean/account_page/widgets/plan/views/plan_container"],function(e,t,n,a,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){return a.createElement(r.PlanContainer,null)},t})(a.Component);t.PlanTab=i}),define("modules/clean/account_page/widgets/billing/action_creators",["require","exports","tslib","modules/clean/account_page/widgets/billing/api","modules/clean/account_page/util"],function(e,t,n,a,r){"use strict";function i(e){var t=this;return void 0===e&&(e=!1),function(i,o){return n.__awaiter(t,void 0,void 0,function(){var t;return n.__generator(this,function(n){switch(n.label){case 0:return"never_loaded"===o().billingInfo.loadingState||e?(i({type:"billing_info_load"}),[4,a.getBillingInfo(r.getCurrentUser().id)]):[3,2];case 1:return t=n.sent(),i({type:"billing_info_loaded",billingInfo:t}),[2,!0];case 2:return[2,!1]}})})}}Object.defineProperty(t,"__esModule",{value:!0}),t.loadDataIfNecessary=i}),define("modules/clean/account_page/widgets/billing/api",["require","exports","modules/clean/ajax_as_promised"],function(e,t,n){"use strict";function a(e){return n.WebRequest({url:"/account/ajax_billing_tab_model",subject_user:e,dataType:"json"})}Object.defineProperty(t,"__esModule",{value:!0}),t.getBillingInfo=a}),define("modules/clean/account_page/widgets/billing/payment_methods_util",["require","exports","external/react","modules/core/i18n","modules/constants/trademark","modules/clean/payments/skus/constants","modules/clean/account_page/widgets/billing/payment_method_constants"],function(e,t,n,a,r,i,o){"use strict";function s(e){return[o.GOOGLE_PLAY_SUBSCRIPTION,o.IOS_ONE_TIME_PAYMENT,o.IOS_SANDBOX_ONE_TIME_PAYMENT,o.IOS_RECURRING_PAYMENT,o.IOS_SANDBOX_RECURRING_PAYMENT,o.NO_CHARGE_GATEWAY,o.RESELLER_LICENSE_KEY].includes(e)}function l(e){return e===o.RESELLER_LICENSE_KEY}function c(e){return[o.IOS_ONE_TIME_PAYMENT,o.IOS_RECURRING_PAYMENT,o.IOS_SANDBOX_ONE_TIME_PAYMENT,o.IOS_SANDBOX_RECURRING_PAYMENT].includes(e)}function u(e,t){return t||s(e)}function d(e,t){return e===o.NO_CHARGE_GATEWAY&&t===i.ProductPlanType.FREE}function p(){return n.createElement("a",{href:"/help/9224",target:"_blank",rel:"noopener noreferrer"},a._("Learn how to cancel your Apple App Store subscription"))}function m(e,t){var i,o=c(e);i=t.is_trial_overdue?o?a._("Your trial has expired."):a._("Your trial has expired but we were unable to process your credit card for the Dropbox %(plus)s upgrade.").format({plus:r.TRADEMARK_PLUS}):t.on_extension_period?n.createElement("div",null,a._("You started a Dropbox %(plus)s trial through the iOS app.").format({plus:r.TRADEMARK_PLUS}),n.createElement("br",null),a._("For billing details, please check your iTunes receipt."),n.createElement("br",null),a._("Your subscription is on an extension period ending %(end_date)s.").format({end_date:t.extension_end_date})):t.is_close_to_trial_conversion?a._("Your trial will automatically upgrade to a Dropbox %(plus)s account in the next 48 hours.").format({plus:r.TRADEMARK_PLUS}):a._("Your trial will automatically upgrade to a Dropbox %(plus)s account in %(num_days)s days.").format({plus:r.TRADEMARK_PLUS,num_days:t.days_left});var s=n.createElement("noscript",null);return o&&!t.is_trial_overdue&&(s=p()),n.createElement("span",null,i,n.createElement("br",null),s)}function h(e){return e.isExternalBilling?n.createElement("a",{href:e.resellerLink,target:"_blank",rel:"noopener noreferrer"},a._("Go to %(reseller_name)s to view or make changes to your account details.").format({reseller_name:e.resellerName})):e.gatewayId===o.GOOGLE_PLAY_SUBSCRIPTION?a._("You purchased Dropbox %(dropbox_plan)s through Google Play.\n To make changes to your subscription, visit the Google Play App Store.").format({dropbox_plan:e.dropboxPlan}):e.gatewayId===o.IOS_ONE_TIME_PAYMENT?a._("You purchased Dropbox %(dropbox_plan)s through the iOS app.\n Your plan will expire on %(end_date)s.").format({dropbox_plan:e.dropboxPlan,end_date:e.endDate}):[o.IOS_RECURRING_PAYMENT,o.IOS_SANDBOX_RECURRING_PAYMENT].includes(e.gatewayId)?e.deactivated?a._("Your subscription from Apple is no longer active."):e.isOnTrial?n.createElement("div",null,n.createElement("span",null,a._("You started a Dropbox %(dropbox_plan)s trial through the iOS app.").format({dropbox_plan:e.dropboxPlan})),n.createElement("br",null),p()):n.createElement("div",null,n.createElement("span",null,a._("You purchased Dropbox %(dropbox_plan)s through the iOS app.").format({dropbox_plan:e.dropboxPlan})),n.createElement("br",null),p()):a._("Sorry, you cannot change your billing schedule at this time.")}function _(e,t,r,i,s,l){return t?a._("You’re being externally billed."):e===o.GOOGLE_PLAY_SUBSCRIPTION?a._("You purchased Dropbox %(dropbox_plan)s through Google Play.\n To make changes to your subscription, visit the Google Play App Store.").format({dropbox_plan:r}):e===o.IOS_ONE_TIME_PAYMENT?a._("You purchased Dropbox %(dropbox_plan)s through the iOS app.\n Your plan will expire on %(end_date)s.").format({dropbox_plan:r,end_date:i}):[o.IOS_RECURRING_PAYMENT,o.IOS_SANDBOX_RECURRING_PAYMENT].includes(e)?s?a._("Your subscription from Apple is no longer active."):l?n.createElement("div",null,n.createElement("span",null,a._("You started a Dropbox %(dropbox_plan)s trial through the iOS app.").format({dropbox_plan:r})),n.createElement("br",null),p()):n.createElement("div",null,n.createElement("span",null,a._("You purchased Dropbox %(dropbox_plan)s through the iOS app.").format({dropbox_plan:r})),n.createElement("br",null),p()):a._("Sorry, you cannot change your billing schedule at this time.")}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldHidePaymentMethod=s,t.isLicenseKey=l,t.isIOS=c,t.shouldHideBillingChange=u,t.shouldHideBillingSummary=d,t.getAppleLink=p,t.getTrialDescription=m,t.getBillingDisabledMessage=h,t.getPaymentMethodDisabledMessage=_}),define("modules/clean/account_page/widgets/plan/action_creators",["require","exports","tslib","modules/clean/account_page/widgets/plan/api","modules/clean/account_page/util"],function(e,t,n,a,r){"use strict";function i(e){var t=this;return function(i,o){return n.__awaiter(t,void 0,void 0,function(){var t;return n.__generator(this,function(n){switch(n.label){case 0:return"never_loaded"===o().planTab.loadingState||e?(i({type:"plan_tab_load_info"}),[4,a.getPlanInfo(r.getCurrentUser().id)]):[3,2];case 1:return t=n.sent(),i({type:"plan_tab_info_loaded",planInfo:t}),[2,!0];case 2:return[2,!1]}})})}}Object.defineProperty(t,"__esModule",{value:!0}),t.loadDataIfNecessary=i}),define("modules/clean/account_page/widgets/plan/add_ons/action_creators",["require","exports","tslib","modules/clean/account_page/util","modules/clean/account_page/widgets/plan/add_ons/api"],function(e,t,n,a,r){"use strict";function i(e){var t=this;return function(i,o){return n.__awaiter(t,void 0,void 0,function(){var t;return n.__generator(this,function(n){switch(n.label){case 0:return"never_loaded"===o().planTab.evhLoadingState||e?(i({type:"load_evh_info"}),[4,r.getEvhInfo(a.getCurrentUser().id)]):[3,2];case 1:return t=n.sent(),i({type:"evh_info_loaded",evhInfo:t}),[2,!0];case 2:return[2,!1]}})})}}Object.defineProperty(t,"__esModule",{value:!0}),t.loadEvhInfoIfNecessary=i}),define("modules/clean/account_page/widgets/plan/add_ons/api",["require","exports","tslib","modules/clean/ajax_as_promised"],function(e,t,n,a){"use strict";function r(e){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){return[2,a.WebRequest({url:"/account/ajax_get_evh_info",subject_user:e,dataType:"json"})]})})}Object.defineProperty(t,"__esModule",{value:!0}),t.getEvhInfo=r}),define("modules/clean/account_page/widgets/plan/api",["require","exports","tslib","modules/clean/ajax_as_promised"],function(e,t,n,a){"use strict";function r(e){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){return[2,a.WebRequest({url:"/account/ajax_plan_tab_model",subject_user:e,dataType:"json"})]})})}Object.defineProperty(t,"__esModule",{value:!0}),t.getPlanInfo=r}),define("modules/clean/account_page/widgets/plan/constants",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHANGE_IND_PLAN_MODAL_UPDATED="change_inv_plan_modal:updated"}),define("modules/clean/account_page/widgets/plan/referral_history/action_creators",["require","exports","tslib","modules/clean/account_page/util","modules/clean/account_page/widgets/plan/referral_history/api"],function(e,t,n,a,r){"use strict";function i(e,t){var i=this;return function(o,s){return n.__awaiter(i,void 0,void 0,function(){var i;return n.__generator(this,function(n){switch(n.label){case 0:return"never_loaded"===s().planTab.referralLoadingState||e?(o({type:"load_referral_history"}),[4,r.getReferralHistory(a.getCurrentUser().id,t)]):[3,2];case 1:return i=n.sent(),o({type:"referral_history_loaded",history:i}),[2,!0];case 2:return[2,!1]}})})}}Object.defineProperty(t,"__esModule",{value:!0}),t.loadReferralHistoryIfNecessary=i}),define("modules/clean/account_page/widgets/plan/referral_history/api",["require","exports","tslib","modules/clean/ajax_as_promised"],function(e,t,n,a){"use strict";function r(e,t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(n){return[2,a.WebRequest({url:"/account/bonus_page/"+t,subject_user:e,dataType:"json"})]})})}Object.defineProperty(t,"__esModule",{value:!0}),t.getReferralHistory=r}),define("modules/clean/account_page/widgets/plan/types",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});(function(e){e[e.MONTHLY=1]="MONTHLY",e[e.YEARLY=2]="YEARLY",e[e.PLUS=3]="PLUS",e[e.PROFESSIONAL=4]="PROFESSIONAL",e[e.ADD_EVH=5]="ADD_EVH",e[e.REMOVE_EVH=6]="REMOVE_EVH"})(t.PerformPlanTransition||(t.PerformPlanTransition={}))}),define("modules/clean/account_page/widgets/plan/views/add_ons",["require","exports","tslib","modules/core/i18n","modules/clean/react/css","external/react","modules/clean/static_urls","modules/constants/account_page","modules/clean/payments/skus/constants","modules/clean/account_page/widgets/plan/views/cancel_subs_warning_modal","modules/clean/account_page/widgets/plan/views/disable_stacked_transitions_modal","modules/clean/account_page/widgets/plan/views/evh_modal","modules/constants/account_page","modules/clean/analytics"],function(e,t,n,a,r,i,o,s,l,c,u,d,p,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var h=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.openEvhModal=function(e){var a=t.props.scheduledForDowngrade;if(e.stopPropagation(),p.NO_RESET_INTERVAL_FOR_USERS&&p.DE_DISABLE_STACKED_TRANSITIONS&&t.pendingScheduledChange())return void u.DisableStackedTransitionsModal.showInstance();a?c.CancelChangesModalConfirmation.showInstance({transitionPerformed:t.props.transitionPerformed,subStatus:t.props.subStatus}):d.EvhModalView.showInstance(n.__assign({},t.props))},t}return n.__extends(t,e),t.prototype.isLoading=function(){return"ready"!==this.props.evhLoadingState},t.prototype.pendingScheduledChange=function(){return this.isPlanScheduledToChange()||this.isBillingScheduleToChange()||this.isEvhScheduledToChange()},t.prototype.isPlanScheduledToChange=function(){var e=this.props,t=e.subStatus;return!!e.scheduledForDowngrade||!!(t&&t.subState.plan&&t.finalSubState.plan)&&t.subState.plan.productType!==t.finalSubState.plan.productType},t.prototype.isEvhScheduledToChange=function(){var e=this.props.subStatus;return!(!e||!e.scheduledSubState)&&e.subState.quantityForEvhAddOn()!==e.scheduledSubState.quantityForEvhAddOn()},t.prototype.isBillingScheduleToChange=function(){var e=this.props.subStatus;return!!(e&&e.subState.billingSchedule&&e.finalSubState.billingSchedule)&&e.subState.billingSchedule.id!==e.finalSubState.billingSchedule.id},t.prototype.evhLink=function(){var e=this.props.evhInfo,t=e.purchased,n=e.scheduled_to_remove,r=e.is_free_evh;if(!n&&!r){var o=t?a._("Remove EVH"):a._("Add EVH");return t?m.ProEventsLogger.log("de_plan_tab_evh_remove_link_click"):m.ProEventsLogger.log("de_plan_tab_evh_add_link_click"),i.createElement("a",{className:"evh-link",href:"#",onClick:this.openEvhModal},o)}},t.prototype.showExtendedVersionHistory=function(){var e=this.props,t=e.subStatus,n=e.evhInfo;if(t.subState.billingSchedule){var r=a._("One year file version history for %(evh_price)s per %(billing_period)s").format({evh_price:n.evh_price,billing_period:t.subState.billingSchedule.scheduleDescriptionNoun});if(t.subState.addons.peekSkus())switch(t.subState.addons.sku.adminCxId){case l.AdminCxId.UNLIMITED_FREE_VERSION_HISTORY:r=a._("Free unlimited file version history");break;case l.AdminCxId.UNLIMITED_MONTHLY_VERSION_HISTORY:case l.AdminCxId.UNLIMITED_YEARLY_VERSION_HISTORY:case l.AdminCxId.UNLIMITED_PAID_VERSION_HISTORY:r=a._("Unlimited file version history for %(evh_price)s per %(billing_period)s").format({evh_price:n.evh_price,billing_period:t.subState.billingSchedule.scheduleDescriptionNoun});break;case l.AdminCxId.ONE_YEAR_PAID_VERSION_HISTORY:r=a._("One year file version history for %(evh_price)s per %(billing_period)s").format({evh_price:n.evh_price,billing_period:t.subState.billingSchedule.scheduleDescriptionNoun});break;case l.AdminCxId.ONE_YEAR_FREE_VERSION_HISTORY:r=a._("Free one year file version history");break;case l.AdminCxId.FREE_120_DAYS_VERSION_HISTORY:r=a._("Free 120 days file version history");break;default:throw new Error("Unknown extended version history add-on")}return i.createElement("div",{className:"evh-container"},i.createElement("div",{className:"evh-body"},i.createElement("div",{className:"evh-text"},i.createElement("p",{className:"evh-title"},a._("Extended version history")),i.createElement("p",{className:"evh-content"},r)),this.evhLink()))}},t.prototype.render=function(){var e=this.props.evhInfo.is_available;return s.ACCOUNT_TAURUS_PLANS&&!e?i.createElement("noscript",null):this.isLoading()?i.createElement("div",{className:"loading-indicator"},i.createElement("img",{src:o.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:a._("Loading")})):i.createElement("div",{className:"add-ons"},i.createElement("p",{className:"header"},a._("Available add-ons")),i.createElement("p",{className:"context"},a._("Extend the functionality of your Dropbox plan with add-ons")),this.showExtendedVersionHistory())},t})(i.Component);t.AddOns=r(h,["/static/css/account/pagelet/add_ons-vflZFLEQS.css"])}),define("modules/clean/account_page/widgets/plan/views/cancel_changes_modal",["require","exports","tslib","external/react","modules/clean/ajax","modules/clean/account_page/widgets/plan/constants","modules/clean/teams/admin/widgets/billing_notifications/cancel_billing_changes_modal","modules/clean/react/modal","modules/clean/analytics","modules/clean/payments/skus/subscription_service","modules/constants/trademark","modules/core/i18n","modules/clean/dbmodal_stack","modules/clean/account_page/util","modules/core/notify"],function(e,t,n,a,r,i,o,s,l,c,u,d,p,m,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var _=(function(e){function t(t){var n=e.call(this,t)||this;return n.onAccept=function(){var e=n.props.cancellationType;n.cancelScheduledChange(e)},new c.SubscriptionService,n.state={submitting:!1},n}return n.__extends(t,e),t.showInstance=function(e){s.Modal.showInstance(a.createElement(t,n.__assign({},e)))},t.prototype.submittingRequest=function(){this.setState(function(e){return e.submitting=!0,e})},t.prototype.doneSubmittingRequest=function(){this.setState(function(e){return e.submitting=!1,e})},t.prototype.cancelScheduledChange=function(e){var t=this,n=this.props.transitionPerformed;this.submittingRequest(),r.WebRequest({url:"/account/ajax_cancel_scheduled_change",data:{scheduled_change_type:e},subject_user:m.getCurrentUser().id,success:function(a){h.success(d._("You’ve cancelled your change!")),e===o.CancellationType.SCHEDULE&&l.ProEventsLogger.log("de_change_billing_cancel_change"),e===o.CancellationType.EVH_ADDON&&l.ProEventsLogger.log("de_evh_modal_cancel_change"),n&&n(),t.doneSubmittingRequest(),s.Modal.close(),t.props.reOpenModalDialogAfterCancellation&&p.DBModalStack.trigger(i.CHANGE_IND_PLAN_MODAL_UPDATED,null)},error:function(){h.error(d._("Failed to cancel changes.")),t.doneSubmittingRequest(),s.Modal.close(),t.props.reOpenModalDialogAfterCancellation&&p.DBModalStack.trigger(i.CHANGE_IND_PLAN_MODAL_UPDATED,null)}})},t.prototype.render=function(){var e=this.props,t=e.cancellationType,n=e.subStatus;if(!n.subState.plan||!n.subState.billingSchedule)return a.createElement("noscript",null);var r,i=d._("Confirm cancelling change");switch(t){case o.CancellationType.PLAN:r=d._("You’re cancelling your scheduled plan change. Your Dropbox %(plan)s plan will renew on %(date)s and you will be billed %(schedule)s.").format({trademark_plus:u.TRADEMARK_PLUS,plan:n.subState.plan.displayName(),date:n.subState.formattedNextBillingDate,schedule:n.finalSubState.billingSchedule.scheduleDescriptionAdjective});break;case o.CancellationType.SCHEDULE:r=d._("You’re cancelling your scheduled billing change. Your Dropbox %(plan)s plan will renew on %(date)s and you will be billed %(schedule)s.").format({plan:n.finalSubState.plan.displayName(),date:n.subState.formattedNextBillingDate,schedule:n.subState.billingSchedule.scheduleDescriptionAdjective});break;case o.CancellationType.EVH_ADDON:r=d._("You’re cancelling your EVH changes. Your Dropbox %(plan)s plan will renew on %(date)s and you will be billed %(schedule)s.").format({plan:n.finalSubState.plan.displayName(),date:n.subState.formattedNextBillingDate,schedule:n.finalSubState.billingSchedule.scheduleDescriptionAdjective});break;case o.CancellationType.IND_SUBSCRIPTION:i=d._("Confirmation"),r=d._("By confirming, your downgrade to Dropbox Basic scheduled change will be cancelled.");break;case o.CancellationType.ALL:i=d._("Confirmation"),r=d._("By confirming, all existing scheduled changes will be cancelled.");break;default:i=d._("Confirmation"),r=d._("By confirming, the scheduled change will be cancelled.")}return a.createElement(s.Modal,{acceptButtonDisabled:this.state.submitting,acceptButtonText:d._("Confirm"),autoClose:!1,dismissButtonText:d._("Don’t cancel"),onAccept:this.onAccept,title:i,submitting:this.state.submitting},a.createElement("p",null,r))},t})(a.Component);t.CancelChangesModalConfirmationView=_}),define("modules/clean/account_page/widgets/plan/views/cancel_plan",["require","exports","tslib","external/react","modules/core/uri","modules/core/i18n","modules/clean/display_format","modules/clean/account_page/widgets/plan/views/disable_stacked_transitions_modal","modules/constants/account_page","modules/clean/payments/skus/constants","modules/clean/analytics"],function(e,t,n,a,r,i,o,s,l,c,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.cancelPlanClick=function(e){if(u.ProEventsLogger.log("de_cancel_plan_subscription_click"),l.NO_RESET_INTERVAL_FOR_USERS&&l.DE_DISABLE_STACKED_TRANSITIONS&&t.pendingScheduledChange())return e.preventDefault(),void s.DisableStackedTransitionsModal.showInstance()},t}return n.__extends(t,e),Object.defineProperty(t.prototype,"quota",{get:function(){return this.props.usageBreakdown.quota||.01},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cancelURL",{get:function(){return new r({path:"/downgrade",query:{oqa:"acc_cancel"}}).toString()},enumerable:!0,configurable:!0}),t.prototype.pendingScheduledChange=function(){return this.isPlanScheduledToChange()||this.isBillingScheduleToChange()||this.isEvhScheduledToChange()},t.prototype.isPlanScheduledToChange=function(){var e=this.props.subStatus;return!!(e&&e.subState.plan&&e.finalSubState.plan)&&e.subState.plan.productType!==e.finalSubState.plan.productType},t.prototype.isEvhScheduledToChange=function(){var e=this.props.subStatus;return!(!e||!e.scheduledSubState)&&e.subState.quantityForEvhAddOn()!==e.scheduledSubState.quantityForEvhAddOn()},t.prototype.isBillingScheduleToChange=function(){var e=this.props.subStatus;return!!(e&&e.subState.billingSchedule&&e.finalSubState.billingSchedule)&&e.subState.billingSchedule.id!==e.finalSubState.billingSchedule.id},t.prototype.render=function(){var e=this.props,t=e.subStatus,n=e.eligibleFor1tb;return t&&t.subState.plan&&t.subState.plan.productType!==c.ProductPlanType.FREE?a.createElement("div",{className:"cancel-plan"},a.createElement("span",{className:"cancel-plan__header"},i._("Cancel %(plan)s plan").format({plan:t.subState.plan.displayName(n)})),a.createElement("div",null,a.createElement("p",{className:"cancel-plan__desc"
},i._("If you cancel your plan, your account will drop from %(quota)s to 2 GB of space (plus any bonus space earned previously)").format({quota:o.format_bytes(this.quota)})),a.createElement("span",{className:"cancel-plan__downgrade-link"},a.createElement("a",{href:this.cancelURL,onClick:this.cancelPlanClick},i._("Cancel plan"))))):a.createElement("noscript",null)},t})(a.Component);t.CancelPlan=d}),define("modules/clean/account_page/widgets/plan/views/cancel_subs_warning_modal",["require","exports","tslib","modules/clean/ajax","modules/clean/react/css","modules/core/notify","external/react","modules/core/i18n","modules/clean/account_page/util","modules/clean/static_urls","modules/clean/teams/admin/widgets/billing_notifications/cancel_billing_changes_modal","modules/clean/react/modal","external/spectrum/button"],function(e,t,n,a,r,i,o,s,l,c,u,d,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var m=(function(e){function t(t){var n=e.call(this,t)||this;return n.onDismiss=function(e){e.preventDefault(),d.Modal.close()},n.onAccept=function(){n.cancelScheduledChange()},n.state={submitting:!1},n}return n.__extends(t,e),t.showInstance=function(e){d.Modal.showInstance(o.createElement(t.cancelChangesModalConfirmationView,n.__assign({},e)))},t.prototype.submittingRequest=function(){this.setState(function(e){return e.submitting=!0,e})},t.prototype.doneSubmittingRequest=function(){this.setState(function(e){return e.submitting=!1,e})},t.prototype.cancelScheduledChange=function(){var e=this,t=this.props.transitionPerformed;this.submittingRequest(),a.WebRequest({url:"/account/ajax_cancel_scheduled_change",data:{scheduled_change_type:u.CancellationType.IND_SUBSCRIPTION},subject_user:l.getCurrentUser().id,success:function(n){i.success(s._("You’ve cancelled your change!")),t&&t(),e.doneSubmittingRequest(),d.Modal.close()},error:function(){i.error(s._("Failed to cancel changes.")),e.doneSubmittingRequest(),d.Modal.close()}})},t.prototype.render=function(){var e=this.props.subStatus,t=this.state.submitting;if(!e)return o.createElement("noscript",null);var n=o.createElement("div",{className:"loading-indicator"},o.createElement("img",{src:c.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:s._("Loading")})),a=t?n:o.createElement("div",null,o.createElement("div",{className:"cancel-subscription-warning-modal__cancel-btn"},o.createElement(p.Button,{variant:"primary",onClick:this.onAccept,disabled:t},s._("Cancel downgrade"))),o.createElement("div",{className:"cancel-subscription-warning-modal__dismiss-btn"},o.createElement("a",{href:"#",onClick:this.onDismiss},s._("Dismiss"))));return o.createElement(d.Modal,{acceptButtonDisabled:this.state.submitting,autoClose:!1,className:"cancel-subscription-warning-modal",buttonComponent:o.createElement(d.ModalButtons,null),submitting:this.state.submitting},o.createElement("div",null,o.createElement("p",{className:"cancel-subscription-warning-modal__title"},s._("Plan downgrade scheduled")),o.createElement("p",{className:"cancel-subscription-warning-modal__desc"},s._("Your plan is scheduled to be downgraded to Dropbox Basic on %(date)s. If you want to make any changes, first cancel your scheduled downgrade.").format({date:e.subState.formattedNextBillingDate})),a))},t.cancelChangesModalConfirmationView=r(t,["/static/css/account/pagelet/cancel_subs_warning-vfl-s2mqh.css"]),t})(o.Component);t.CancelChangesModalConfirmation=m}),define("modules/clean/account_page/widgets/plan/views/cancellable_notifications_view",["require","exports","tslib","external/react","modules/clean/react/css","modules/core/i18n","modules/clean/account_page/widgets/billing/payment_methods_util","modules/clean/teams/admin/widgets/billing_notifications/cancellable_item","modules/clean/teams/admin/widgets/billing_notifications/cancel_billing_changes_modal","modules/clean/payments/skus/constants","modules/clean/react_format","modules/constants/trademark","modules/clean/account_page/widgets/plan/views/cancel_changes_modal"],function(e,t,n,a,r,i,o,s,l,c,u,d,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var m=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleCancelSubscriptionAction=function(){t.handleCancelActions(l.CancellationType.IND_SUBSCRIPTION)},t.handleCancelPlanAction=function(){t.handleCancelActions(l.CancellationType.PLAN)},t.handleCancelScheduleAction=function(){t.handleCancelActions(l.CancellationType.SCHEDULE)},t.handleCancelEvhAction=function(){t.handleCancelActions(l.CancellationType.EVH_ADDON)},t.handleCancelActions=function(e){var n=t.props,a=n.subStatus,r=n.transitionPerformed,i=n.reOpenModalDialogAfterCancellation;a&&p.CancelChangesModalConfirmationView.showInstance({subStatus:a,transitionPerformed:r,cancellationType:e,reOpenModalDialogAfterCancellation:i})},t}return n.__extends(t,e),t.prototype.renderCancelSubscriptionNotification=function(){var e=this.props,t=e.subStatus,n=e.scheduledForDowngrade;if(t)return n?a.createElement(s.CancellableItemView,{title:i._("Scheduled plan change"),description:i._("Dropbox Basic"),handleAction:this.handleCancelSubscriptionAction,useSingleCancelLink:!1}):void 0},t.prototype.renderDowngradePlanNotification=function(){var e=this.props,t=e.subStatus,n=e.scheduledForDowngrade;if(t&&!n){var r=t.scheduledSubState;if(r){var o=t.subState.plan,l=r.plan;if(o&&l&&(o.productType!==l.productType||o.productType===l.productType&&o.productSpec!==l.productSpec)){var c=i._("Dropbox %(scheduled_plan)s").format({trademark_plus:d.TRADEMARK_PLUS,scheduled_plan:l.displayName()});return a.createElement(s.CancellableItemView,{title:i._("Scheduled plan change"),description:c,handleAction:this.handleCancelPlanAction,useSingleCancelLink:!1,className:"cancel-plan-schedule"})}}}},t.prototype.renderScheduledChange=function(){var e=this.props,t=e.subStatus,n=e.scheduledForDowngrade;if(t&&!n){var r=t.scheduledSubState;if(r&&r.billingSchedule&&t.subState.billingSchedule&&t.subState.billingSchedule.id!==r.billingSchedule.id){var o=r.billingSchedule.scheduleDescriptionAdjective;return a.createElement(s.CancellableItemView,{title:i._("Scheduled billing period"),description:i._("%(billing)s billing").format({billing:o.charAt(0).toUpperCase()+o.slice(1)}),handleAction:this.handleCancelScheduleAction,useSingleCancelLink:!1,className:"cancel-billing-schedule"})}}},t.prototype.renderEvhChange=function(){var e=this.props,t=e.subStatus,n=e.scheduledForDowngrade;if(t&&!n){var r=t.scheduledSubState;if(r)return t.subState.addons.skus.length>0&&1===t.subState.quantityForEvhAddOn()&&0===r.quantityForEvhAddOn()?a.createElement(s.CancellableItemView,{title:i._("Scheduled add-on change"),description:i._("Remove extended version history"),handleAction:this.handleCancelEvhAction,useSingleCancelLink:!1,className:"cancel-evh-schedule"}):void 0}},t.prototype.appendAllCancellationTypes=function(e){e.push(this.renderCancelSubscriptionNotification()),e.push(this.renderDowngradePlanNotification()),e.push(this.renderScheduledChange()),e.push(this.renderEvhChange())},t.prototype.render=function(){var e=this.props,t=e.displaySingleChangeCancellationItem,n=e.scheduledForDowngrade,r=e.subStatus,s=e.paymentInfo,d=e.hasLicenseKey,p=e.displayNewTotal;if(!r)return a.createElement("noscript",null);if(!s||o.shouldHideBillingChange(s.gateway_id,s.is_external_billing))return a.createElement("noscript",null);var m=[];if(!r.finalSubState.plan)return a.createElement("noscript",null);if(t)switch(t){case l.CancellationType.IND_SUBSCRIPTION:m.push(this.renderCancelSubscriptionNotification());break;case l.CancellationType.PLAN:m.push(this.renderDowngradePlanNotification());break;case l.CancellationType.SCHEDULE:m.push(this.renderScheduledChange());break;case l.CancellationType.EVH_ADDON:m.push(this.renderEvhChange());break;case l.CancellationType.ALL:this.appendAllCancellationTypes(m)}if(m=m.filter(function(e){return void 0!==e}),!m.length)return a.createElement("noscript",null);var h="";!n&&p&&(h=i._("Your new %(schedule)s total will be %(total)s.").format({schedule:c.productScheduleToProductScheduleDescription(r.finalSubState.plan.schedule),total:r.nextBillingSummary.total}));var _=a.createElement("div",{className:"cancellable-scheduled-notifications cancellable-scheduled-notifications__header"},u.reactFormat(i._("Changes are scheduled for %(date)s.").format({date:r.subState.formattedNextBillingDate}),{strong:a.DOM.strong()})," ",h);return a.createElement("div",{className:"cancellable-scheduled-notifications personal-cancellable-scheduled-notifications"},_,!d&&a.createElement("div",{className:"cancellable-scheduled-notifications cancellable-scheduled-notifications__items"},m))},t})(a.Component);t.CancellableNotificationsViewControl=m,t.CancellableNotificationsView=r(m,["/static/css/teams/admin/widgets/billing_notifications/cancellable_scheduled_notifications-vfl1eZBGN.css"])}),define("modules/clean/account_page/widgets/plan/views/change_plan_modal",["require","exports","tslib","modules/core/browser","modules/clean/react/image","modules/core/notify","external/react","modules/clean/ajax","modules/clean/react/css","modules/clean/teams/admin/widgets/admin_priced_list/admin_priced_list","modules/clean/teams/admin/widgets/admin_priced_list/admin_priced_list_item","modules/clean/account_page/widgets/plan/constants","modules/constants/individual_invoice_modal","modules/clean/account_page/widgets/plan/views/cancel_changes_modal","modules/clean/payments/validation","modules/clean/account_page/widgets/plan/views/cancellable_notifications_view","modules/clean/teams/admin/widgets/billing_notifications/cancel_billing_changes_modal","modules/clean/payments/cash","modules/clean/dbmodal_stack","modules/clean/account_page/widgets/plan/views/individual_inline_payment_method","modules/clean/react/modal","modules/constants/account_page","modules/clean/analytics","modules/clean/payments/skus/constants","modules/clean/payments/skus/subscription_change_plan","modules/clean/payments/skus/subscription_status","modules/constants/trademark","modules/core/i18n","modules/clean/account_page/util","modules/clean/react_format","modules/clean/static_urls","modules/clean/react/arbor/elements/arbor_inputs"],function(e,t,n,a,r,i,o,s,l,c,u,d,p,m,h,_,f,g,y,b,S,v,E,T,P,C,N,I,x,A,w,L){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var k;(function(e){e[e.MONTHLY=1]="MONTHLY",e[e.YEARLY=2]="YEARLY",e[e.PLUS=3]="PLUS",e[e.PROFESSIONAL=4]="PROFESSIONAL"})(k=t.PerformPlanTransition||(t.PerformPlanTransition={}));var D=(function(e){function t(t){var n=e.call(this,t)||this;return n.onAccept=function(){var e,t,a=n.getSubChangePlan();if(a){a.finalSubState.planSku.productType!==T.ProductPlanType.PLUS&&a.finalSubState.planSku.productType!==T.ProductPlanType.STANDARD||(t=k.PROFESSIONAL,e=k.PLUS),a.finalSubState.planSku.productType===T.ProductPlanType.PROFESSIONAL&&(t=k.PLUS,e=k.PROFESSIONAL),n.setState(function(e){return{showErrors:!0}});var r=n.state,o=r.vat,l=r.paymentMethod;if(l&&l.country_code&&n.vatValidator(l.country_code,o))if(E.ProEventsLogger.log("de_change_plan_modal_confirm_change_click"),e&&t){n.setState(function(e){return{submitting:!0}});var c={transition_change_type:e};o&&(c.vat=o,E.ProEventsLogger.log("vat_provided_on_upgrade")),s.WebRequest({url:"/account/perform_personal_transition",data:c,subject_user:x.getCurrentUser().id,success:function(r){i.success(I._("You’ve changed your plan!")),n.removeShowModalParams(),n.logChangePlan(t,e),n.props.transitionPerformed&&n.props.transitionPerformed(),a.finalSubState.planSku.productType===T.ProductPlanType.PROFESSIONAL?n.setState({displayUpgradedToProfessionalContent:!0,loadingContent:!1,submitting:!1}):S.Modal.close()},error:function(){i.error(I._("There was an error changing the plan!")),n.setState(function(e){return{submitting:!1}})}})}else i.error(I._("There was an error changing the plan!"))}},n.onDismiss=function(){E.ProEventsLogger.log("de_change_plan_modal_cancel_click")},n.onVatChange=function(e,t,a){var r=a;n.setState(function(e){return{vat:r,loadingChangeSummary:!0,showErrors:!1}});var i=n.state.paymentMethod;i&&i.country_code&&n.repriceTransitions(h.validateVat(i.country_code,r)?r:"")},n.handleCancelScheduleAction=function(e){n.handleCancelActions(f.CancellationType.SCHEDULE),e.preventDefault()},n.handleCancelActions=function(e){var t=n.state.subStatus;return t&&m.CancelChangesModalConfirmationView.showInstance({subStatus:t,transitionPerformed:n.props.transitionPerformed,cancellationType:e,reOpenModalDialogAfterCancellation:!0}),!1},n.transitionPerformedClosure=function(e){if(n.props.transitionPerformed)return n.props.transitionPerformed()},n.getStartedClick=function(){a.redirect("/professional_onboarding")},n.state={loadingContent:!0,schedule:T.ScheduleId.MONTHLY,subChangePlans:[],submitting:!1,type:T.ProductPlanType.STANDARD,displayUpgradedToProfessionalContent:!1,showErrors:!1,vat:"",loadingChangeSummary:!1},n}return n.__extends(t,e),t.prototype.getUrlOption=function(e){var t=e,n=a.get_href().match(/option=([a-zA-Z_]*)/);if(n&&n.length>1){var r=n[1];"plus"===r&&(t=e===T.ProductPlanType.PROFESSIONAL?T.ProductPlanType.PLUS:e),"pro"===r&&(t=T.ProductPlanType.PROFESSIONAL)}return t},t.showInstance=function(e){S.Modal.showInstance(o.createElement(t.ChangePlanModal,n.__assign({},e)))},t.prototype.componentDidMount=function(){this.loadPlanTransitions()},t.prototype.onLoadPlanTransitions=function(e){var t=this;this.setState(function(n){var a=C.SubscriptionStatus.deserialize(e.serializedSubStatus),r=e.paymentMethod,i=a.finalSubState;if(!i.billingSchedule||!i.plan)throw"A base plan is required, in order to change it.";var o=a.subState.billingSchedule.id,s=e.serializedSubChangePlans.map(function(e){return P.SubscriptionChangePlan.deserialize(e)}),l=s.map(function(e){return e});return l.push(a),{loadingContent:!1,subStatus:a,paymentMethod:r,schedule:o,subChangePlans:s,allSubStatuses:l,type:t.getUrlOption(a.subState.plan.productType)}})},t.prototype.loadPlanTransitions=function(){var e=this;this.retrieveViewModel(function(t){e.onLoadPlanTransitions(t)},this.onLoadTransitionsError)},t.prototype.onLoadTransitionsError=function(){i.error(I._("Failed to load modal.")),S.Modal.close()},t.prototype.onRepriceTransitions=function(e){this.setState(function(t){var n=C.SubscriptionStatus.deserialize(e.serializedSubStatus),a=e.serializedSubChangePlans.map(function(e){return P.SubscriptionChangePlan.deserialize(e)}),r=a.map(function(e){return e});r.push(n);return{subStatus:n,subChangePlans:a,allSubStatuses:r,loadingChangeSummary:!1}})},t.prototype.onRepriceError=function(){i.error(I._("Request failed")),S.Modal.close()},t.prototype.repriceTransitions=function(e){var t=this;this.retrieveViewModel(function(e){t.onRepriceTransitions(e)},this.onRepriceError,e)},t.prototype.retrieveViewModel=function(e,t,n){var a=this,r=this.state,i=r.withVat,o=r.withoutVat,l=n?{vat:n}:void 0,c=n?i:o;c?e(c):s.WebRequest({url:"/account/ajax_change_plan",data:l,subject_user:x.getCurrentUser().id,success:function(t){var r=JSON.parse(t);a.setState(function(e){return n?{withVat:r}:{withoutVat:r}}),e(r)},error:t})},t.prototype.getSubChangePlan=function(e){return void 0===e&&(e=this.state.type),this.state.subChangePlans.filter(function(t){var n=t.finalSubState;return!(!n.plan||!n.billingSchedule)&&n.plan.productType===e}).pop()},Object.defineProperty(t.prototype,"hasTypeChanged",{get:function(){var e=this.state.subStatus;return e&&e.finalSubState.plan&&e.finalSubState.plan.productType!==this.state.type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasCurrentPlanChanged",{get:function(){return this.hasTypeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subStatusScheduleId",{get:function(){var e=this.state.subStatus;return e&&e.finalSubState.billingSchedule?e.finalSubState.billingSchedule.id:T.ScheduleId.MONTHLY},enumerable:!0,configurable:!0}),t.prototype.logChangePlan=function(e,t){var n=this.state.subStatus;n&&n.subState.billingSchedule&&E.ProEventsLogger.log("de_change_plan_modal_change_plan",{from:e===k.PLUS?N.TRADEMARK_PLUS:"Professional",to:t===k.PROFESSIONAL?"Professional":N.TRADEMARK_PLUS})},t.prototype.removeShowModalParams=function(){var e=a.get_href().match(/modal=([a-zA-Z_]*)/);if(e&&e.length>1){"plan"===e[1]&&window.history.replaceState({},document.title,a.get_href().split("?")[0])}},t.prototype.changeProductPlanAndScheduleType=function(e,t){e===T.ProductPlanType.PROFESSIONAL?E.ProEventsLogger.log("de_change_plan_modal_professional_section_click"):E.ProEventsLogger.log("de_change_plan_modal_plus_section_click"),this.setState(function(n){return{type:e,schedule:t}})},t.prototype.getPlanDescription=function(e){switch(e.productType){case T.ProductPlanType.STANDARD:case T.ProductPlanType.PLUS:return I._("Stress-free sharing, offline folders on mobile, and %(plan_space)s storage.").format({plan_space:e.formattedSpecQuotaGb});case T.ProductPlanType.PROFESSIONAL:return I._("Smart Sync, Showcase, shared link controls, and %(plan_space)s storage.").format({plan_space:e.formattedSpecQuotaGb})}return""},t.prototype.changeProductPlanAndScheduleTypeClosure=function(e,t){var n=this;return function(){n.changeProductPlanAndScheduleType(e,t)}},t.prototype.renderPlanItems=function(){var e=this,t=this.state,n=t.type,a=t.allSubStatuses,r=t.subStatus,i=[T.ProductPlanType.STANDARD,T.ProductPlanType.PLUS,T.ProductPlanType.PROFESSIONAL];if(a&&r)return a.filter(function(t){return!!(t.finalSubState.plan&&r.subState.plan&&r.finalSubState.plan&&r.subState.planSku&&r.finalSubState.planSku&&r.subState.billingSchedule&&t.finalSubState.billingSchedule)&&(!e.isBillingScheduleToChange()||t.subState.billingSchedule.id===r.subState.billingSchedule.id)}).sort(function(e,t){return e.finalSubState.plan&&t.finalSubState.plan?i.indexOf(e.finalSubState.plan.productType)-i.indexOf(t.finalSubState.plan.productType):0}).map(function(t){var a=t.finalSubState.plan,i=t.finalSubState.billingSchedule;if(a&&i&&!(r&&r.subState&&r.subState.plan&&r.subState.plan.isLegacyPlan&&a.isAdvancePlan)&&r.scheduledSubState&&r.scheduledSubState.billingSchedule&&t&&t.subState.billingSchedule&&t.finalSubState.plan&&t.finalSubState.billingSchedule&&r.subState.billingSchedule&&r.subState.plan){var s,l=void 0,c=r.isOnTrial?r.finalSubState.plan:r.subState.plan;c&&a.productType===c.productType&&(s=I._("(current plan)"));var d=o.createElement("span",null,o.createElement("br",null),o.createElement("a",{href:"/plans/individual",target:"_blank",rel:"noreferrer noopener"},I._("See plan details"))),p=I._("Dropbox %(plan_name)s").format({plan_name:a.displayName()});return o.createElement(u.AdminPricedListItem,{key:a.code,isSelected:n===a.productType,title:p,titleWarningText:l,titleSecondaryText:s,description:e.getPlanDescription(a),detailsLink:d,price:a.displayCost,unit:a.billingSchedule.id===T.ScheduleId.MONTHLY?I._("per month"):I._("per year"),onClick:e.changeProductPlanAndScheduleTypeClosure(a.productType,i.id),disableItem:e.isPlanScheduledToChange()})}})},t.prototype.renderBillingSection=function(){return o.createElement("div",null,o.createElement(c.AdminPricedList,null,this.renderPlanItems()),this.renderVat())},t.prototype.renderVat=function(){var e=null;if(!this.vatDisplayEnabled)return e;var t=this.state,n=t.vat,a=t.paymentMethod,r=t.showErrors,i=a&&a.country_code?a.country_code:void 0;if(i){var s=h.getVatPrefix(i),l=I._("Please enter a valid VAT number, e.g. %(examples)s.").format({examples:h.getVatExamples(i).join(", ")});e=o.createElement(L.ArborTextInput,{name:"vat",placeholderText:s,labelText:I._("VAT number (optional)"),isValid:!r||this.vatValidator(i,n),errorText:l,value:n,onChange:this.onVatChange})}return e},t.prototype.vatValidator=function(e,t){return!t||h.validateVat(e,t)},t.prototype.renderPaymentMethod=function(){var e=this.state.paymentMethod;if(this.hasTypeChanged&&e&&!this.isPlanScheduledToChange())return o.createElement("div",{className:"upgrade-payment-method-link"},o.createElement(b.IndividualInlinePaymentMethodView,{paymentMethod:e,showModal:this.showModalClosure(this.props)}))},t.prototype.showModalClosure=function(e){return function(){t.showInstance(e)}},t.prototype.isScheduledToChange=function(){return this.isPlanScheduledToChange()||this.isBillingScheduleToChange()||this.isEvhScheduledToChange()},t.prototype.isEvhScheduledToChange=function(){var e=this.state.subStatus;return!(!e||!e.scheduledSubState)&&e.subState.quantityForEvhAddOn()!==e.scheduledSubState.quantityForEvhAddOn()},t.prototype.isPlanScheduledToChange=function(){var e=this.state.subStatus;return!!(e&&e.subState.plan&&e.finalSubState.plan)&&e.subState.plan.productType!==e.finalSubState.plan.productType},t.prototype.isBillingScheduleToChange=function(){var e=this.state.subStatus;return!!(e&&e.subState.billingSchedule&&e.finalSubState.billingSchedule)&&e.subState.billingSchedule.id!==e.finalSubState.billingSchedule.id},t.prototype.getPlanNameWithEvhText=function(e){var t=this.state.subStatus;return t&&t.scheduledSubState&&t.scheduledSubState.quantityForEvhAddOn()>0?e+" "+I._("+ extended version history"):e},t.prototype.renderScheduleTransitionText=function(){var e=this.state.subStatus,t=this.getSubChangePlan();if(e&&e.subState.plan){var n=o.createElement("a",{href:"#",onClick:this.handleCancelScheduleAction},I._("Cancel change"));if(this.isPlanScheduledToChange())return o.createElement("span",{className:"plan-transition"},I._("You’ve already requested a change to your plan. If you want to choose a different plan, first cancel your pending change.")," ",n);if((!t||e.subState.planSku.productType===t.finalSubState.planSku.productType)&&e.subState.billingSchedule&&e.currentBillingSummary){if(!this.isScheduledToChange()||!v.NO_RESET_INTERVAL_FOR_USERS)return o.createElement("span",{className:"plan-transition"},I._("Your Dropbox %(plan)s plan will renew on %(date)s. Your current %(schedule)s total is %(recurring_total)s.").format({plan:this.getPlanNameWithEvhText(e.subState.plan.displayName()),schedule:e.subState.billingSchedule.scheduleDescriptionAdjective,recurring_total:g.Cash.formatWithTaxLabels(e.currentBillingSummary.total,e.currentBillingSummary),date:e.subState.formattedNextBillingDate}));if(e.scheduledSubState&&e.scheduledSubState.plan)return o.createElement("div",null,o.createElement("span",{className:"change-summary"},I._("Change summary")),o.createElement("p",{className:"plan-transition"},A.reactFormat(I._("Starting on %(date)s, we’ll bill you once a %(schedule_noun)s for your Dropbox %(plan)s. Your new %(schedule)s total will be %(scheduled_total)s.").format({plan:this.getPlanNameWithEvhText(e.scheduledSubState.plan.displayName()),date:e.subState.formattedNextBillingDate,schedule:e.scheduledSubState.billingSchedule.scheduleDescriptionAdjective,schedule_noun:e.scheduledSubState.billingSchedule.scheduleDescriptionNoun,scheduled_total:g.Cash.formatWithTaxLabels(e.nextBillingSummary.total,e.nextBillingSummary)}),{strong:o.createElement("strong",null)})))}if(t&&t.finalSubState.plan){var a=void 0!==t.tvm;return t&&t.tvm&&a?o.createElement("div",null,o.createElement("span",{className:"change-summary"},I._("Change summary")),o.createElement("p",{className:"plan-transition"},A.reactFormat(I._("You’re upgrading to Dropbox %(plan)s plan. We’ll charge you %(prorated_price)s now, which is prorated for the current billing period. Starting on %(date)s, we’ll bill you once a %(schedule_noun)s and your new %(schedule)s total will be %(scheduled_total)s.").format({plan:this.getPlanNameWithEvhText(t.finalSubState.plan.displayName()),prorated_price:g.Cash.formatWithTaxLabels(t.tvm.getTotalPrice(),t.nextBillingSummary),date:t.subState.formattedNextBillingDate,schedule_noun:t.finalSubState.billingSchedule.scheduleDescriptionNoun,schedule:t.finalSubState.billingSchedule.scheduleDescriptionAdjective,scheduled_total:g.Cash.formatWithTaxLabels(t.nextBillingSummary.total,t.nextBillingSummary)}),{strong:o.createElement("strong",null)}))):a?void 0:o.createElement("div",null,o.createElement("span",{className:"change-summary"},I._("Change summary")),o.createElement("p",{className:"plan-transition"},A.reactFormat(I._("Starting on %(date)s, your plan will be downgraded to Dropbox %(plan)s and your new %(schedule)s total will be %(scheduled_total)s.").format({plan:this.getPlanNameWithEvhText(t.finalSubState.plan.displayName()),date:e.subState.formattedNextBillingDate,schedule:t.finalSubState.billingSchedule.scheduleDescriptionAdjective,scheduled_total:g.Cash.formatWithTaxLabels(t.nextBillingSummary.total,t.nextBillingSummary)}),{strong:o.createElement("strong",null)})))}}},t.prototype.renderChangeFooter=function(){var e;return this.state.loadingChangeSummary?o.createElement("div",{className:"loading-indicator"},o.createElement("img",{src:w.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:I._("Loading")})):(this.isPlanScheduledToChange()||(e=this.renderPaymentMethod()),o.createElement("div",{className:"plan-footer u-font-meta"},this.renderScheduleTransitionText(),e))},Object.defineProperty(t.prototype,"acceptButtonDisabled",{get:function(){var e=this.state.paymentMethod,t=this.state,n=t.loadingContent,a=t.loadingChangeSummary,r=t.submitting;return!(!(n||a||r)&&e)||!this.hasUserSelectedDifferentPlan()},enumerable:!0,configurable:!0}),t.prototype.isValidVatCountry=function(){var e=this.state.paymentMethod;return e&&e.country_code&&h.hasVat(e.country_code)},t.prototype.isUserOnPlus=function(){var e=this.state.subStatus;return e&&e.subState&&e.subState.plan&&e.subState.plan.productType===T.ProductPlanType.PLUS},t.prototype.hasUserSelectedDifferentPlan=function(){return!this.isPlanScheduledToChange()&&this.hasTypeChanged},Object.defineProperty(t.prototype,"vatDisplayEnabled",{get:function(){var e=this.state,t=e.loadingContent,n=e.submitting;return p.INDIVIDUAL_INVOICE_MODAL&&!t&&!n&&this.isValidVatCountry()&&this.isUserOnPlus()&&this.hasUserSelectedDifferentPlan()},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e,n=this,a=this.props,i=a.transitionPerformed,s=a.paymentInfo,l=this.state,c=l.subStatus,u=l.displayUpgradedToProfessionalContent,p=l.loadingContent,m=l.submitting,h=I._("Cancel"),g=I._("Confirm change");if(c&&u)g="",h="",e=o.createElement("div",{className:"upgrade-to-professional"},o.createElement(r,{className:"upgrade-to-professional__img",src:w.static_url("/static/images/account_page/successful-upgrade-conf-vfljF71a-.png"),srcHiRes:w.static_url("/static/images/account_page/successful-upgrade-conf@2x-vflKbwL4c.png"),alt:I._("")}),o.createElement("h3",{className:"upgrade-to-professional__title"},I._("Congrats! You’ve upgraded to Dropbox Professional")),o.createElement("p",{className:"upgrade-to-professional__desc"},I._("Get ready to take advantage of advanced features like Smart Sync, Showcase, and more support options.")),o.createElement("button",{className:"button-primary upgrade-to-professional_cta_btn",onClick:this.getStartedClick},I._("Got it")));else if(p)e=o.createElement("div",{className:"loading-indicator"},o.createElement("img",{src:w.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:I._("Loading")}));else{var b=void 0;if(c&&i){y.DBModalStack.clear(),y.DBModalStack.register(d.CHANGE_IND_PLAN_MODAL_UPDATED,function(){t.showInstance({transitionPerformed:n.transitionPerformedClosure})}),b=o.createElement(_.CancellableNotificationsView,{subStatus:c,transitionPerformed:this.transitionPerformedClosure,displaySingleChangeCancellationItem:f.CancellationType.ALL,reOpenModalDialogAfterCancellation:!0,paymentInfo:s,displayNewTotal:!1})}e=o.createElement("div",null,b,this.renderBillingSection(),this.renderChangeFooter())}return o.createElement(S.Modal,{acceptButtonDisabled:this.acceptButtonDisabled,acceptButtonText:g,className:"change-plan-modal",dismissButtonText:h,autoClose:!1,onAccept:this.onAccept,onDismiss:this.onDismiss,submitting:m,title:I._("Change plan")},e)},t.ChangePlanModal=l(t,["/static/css/teams/admin/widgets/change_plan_modal/change_plan_modal-vfl1OvyKe.css"]),t})(o.Component);t.ChangePlanModalView=D}),define("modules/clean/account_page/widgets/plan/views/change_schedule_modal",["require","exports","tslib","modules/core/notify","external/react","modules/clean/ajax","modules/clean/react/css","modules/clean/teams/admin/widgets/admin_priced_list/admin_priced_list","modules/clean/teams/admin/widgets/admin_priced_list/admin_priced_list_item","modules/clean/account_page/widgets/plan/constants","modules/clean/account_page/widgets/plan/views/cancel_changes_modal","modules/clean/account_page/widgets/plan/views/cancellable_notifications_view","modules/clean/teams/admin/widgets/billing_notifications/cancel_billing_changes_modal","modules/clean/payments/cash","modules/clean/dbmodal_stack","modules/clean/account_page/widgets/plan/views/individual_inline_payment_method","modules/clean/react/modal","modules/constants/account_page","modules/clean/account_page/widgets/plan/views/change_plan_modal","modules/clean/analytics","modules/clean/payments/skus/constants","modules/clean/payments/skus/subscription_change_plan","modules/clean/payments/skus/subscription_status","modules/core/i18n","modules/clean/account_page/util","modules/clean/react_format","modules/clean/static_urls"],function(e,t,n,a,r,i,o,s,l,c,u,d,p,m,h,_,f,g,y,b,S,v,E,T,P,C,N){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var I=(function(e){function t(t){var n=e.call(this,t)||this;return n.onAccept=function(){var e,t,r=n.getSubChangePlan();r&&(r.finalSubState.billingSchedule.id===S.ScheduleId.MONTHLY&&(t=y.PerformPlanTransition.YEARLY,e=y.PerformPlanTransition.MONTHLY),r.finalSubState.billingSchedule.id===S.ScheduleId.YEARLY&&(t=y.PerformPlanTransition.MONTHLY,e=y.PerformPlanTransition.YEARLY),e&&t?(n.setState(function(e){return e.submitting=!0,e}),i.WebRequest({url:"/account/perform_personal_transition",data:{transition_change_type:e},subject_user:P.getCurrentUser().id,success:function(e){a.success(T._("You’ve changed your billing schedule!")),n.logChangeSchedule(),n.props.transitionPerformed&&n.props.transitionPerformed(),f.Modal.close()},error:function(){a.error(T._("There was an error changing the billing schedule!")),n.setState(function(e){return e.submitting=!1,e})}})):a.error(T._("There was an error changing the billing schedule!")))},n.handleCancelScheduleAction=function(){return n.handleCancelActions(p.CancellationType.SCHEDULE),!1},n.handleCancelActions=function(e){var t=n.state.subStatus;return t&&u.CancelChangesModalConfirmationView.showInstance({subStatus:t,transitionPerformed:n.props.transitionPerformed,cancellationType:e,reOpenModalDialogAfterCancellation:!0}),!1},n.transitionPerformedClosure=function(e){if(n.props.transitionPerformed)return n.props.transitionPerformed()},n.state={loadingContent:!0,schedule:S.ScheduleId.MONTHLY,subChangePlans:[],submitting:!1,type:S.ProductPlanType.STANDARD,hasLicenseKey:!1},n}return n.__extends(t,e),t.showInstance=function(e){f.Modal.showInstance(r.createElement(t.ChangeScheduleModal,n.__assign({},e)))},t.prototype.componentDidMount=function(){this.loadPlanTransitions()},t.prototype.loadPlanTransitions=function(){var e=this;i.WebRequest({url:"/account/ajax_change_plan_schedule",subject_user:P.getCurrentUser().id,success:function(t){var n=JSON.parse(t);e.setState(function(e){e.loadingContent=!1,e.subStatus=E.SubscriptionStatus.deserialize(n.serializedSubStatus),e.paymentMethod=n.paymentMethod,e.hasLicenseKey=n.hasLicenseKey;var t=e.subStatus.finalSubState;if(!t.billingSchedule||!t.plan)throw"A base plan is required, in order to change it.";return e.hasLicenseKey?e.schedule=e.subStatus.scheduledSubState.billingSchedule.id:e.schedule=e.subStatus.subState.billingSchedule.id,e.subChangePlans=n.serializedSubChangePlans.map(function(e){return v.SubscriptionChangePlan.deserialize(e)}),e.allSubStatuses=e.subChangePlans.map(function(e){return e
}),e.allSubStatuses.push(e.subStatus),e.type=e.subStatus.subState.plan.productType,e})},error:function(){a.error(T._("Failed to load modal.")),f.Modal.close()}})},t.prototype.getSubChangePlan=function(e,t){return void 0===e&&(e=this.state.type),void 0===t&&(t=this.state.schedule),this.state.subChangePlans.filter(function(n){var a=n.finalSubState;return!(!a.plan||!a.billingSchedule)&&(a.plan.productType===e&&a.billingSchedule.id===t)}).pop()},Object.defineProperty(t.prototype,"hasTypeChanged",{get:function(){var e=this.state.subStatus;return e&&e.finalSubState.plan&&e.finalSubState.plan.productType!==this.state.type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasScheduleChanged",{get:function(){var e=this.state.subStatus;return e&&e.finalSubState.billingSchedule&&e.finalSubState.billingSchedule.id!==this.state.schedule},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasCurrentPlanChanged",{get:function(){return this.hasTypeChanged||this.hasScheduleChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subStatusScheduleId",{get:function(){var e=this.state.subStatus;return e&&e.finalSubState.billingSchedule?e.finalSubState.billingSchedule.id:S.ScheduleId.MONTHLY},enumerable:!0,configurable:!0}),t.prototype.logChangeSchedule=function(){var e=this.state.subStatus;e&&e.subState.billingSchedule&&b.ProEventsLogger.log("de_change_billing_change_schedule",{from:e.subState.billingSchedule.id===S.ScheduleId.MONTHLY?"yearly":"monthly",to:e.subState.billingSchedule.id===S.ScheduleId.MONTHLY?"monthly":"yearly"})},t.prototype.changeProductPlanAndScheduleType=function(e,t){this.setState(function(n){return n.type=e,n.schedule=t,n})},t.prototype.changeProductPlanAndScheduleTypeClosure=function(e,t){var n=this;return function(){n.changeProductPlanAndScheduleType(e,t)}},t.prototype.getScheduleDescription=function(e,t,n){var a=this.state.subStatus;if(!(e.finalSubState.billingSchedule&&e.finalSubState.plan&&a&&a.scheduledSubState&&a.scheduledSubState.plan&&a.subState.plan))return"";var r=this.getOriginalStatusForCurrentStatus(a.subState.plan.productType,S.ScheduleId.MONTHLY);if(this.isPlanScheduledToChange()&&this.isBillingScheduleToChange()&&(r=this.getSubStatusFromSubChangePlans(a.subState.plan.productType,S.ScheduleId.MONTHLY)),!r||!r.subState.planSku||!r.finalSubState.planSku)return"";var i;i=this.isPlanScheduledToChange()?r.finalSubState.planSku.displayCost.multiply(12):a.subState.billingSchedule.id===S.ScheduleId.MONTHLY?r.subState.planSku.displayCost.multiply(12):r.finalSubState.planSku.displayCost.multiply(12);var o="";switch(o=this.isPlanScheduledToChange()&&this.isBillingScheduleToChange()?a.subState.plan.displayName():a.scheduledSubState.plan.displayName(),e.finalSubState.billingSchedule.id){case S.ScheduleId.YEARLY:var s=n.amount,l=i.amount,c=T.format_percent(Math.round(100*(1-s/l)));return T._("Dropbox %(plan_name)s is %(price_per_year)s per year. You’ll save %(save_percentage)s over monthly billing.").format({plan_name:o,price_per_year:n,save_percentage:c});case S.ScheduleId.MONTHLY:return T._("Dropbox %(plan_name)s is %(price_per_month)s per month. You’ll spend %(price_per_year)s per year.").format({plan_name:o,price_per_month:t,price_per_year:n})}return""},t.prototype.getBillingItemTitle=function(e){switch(e){case S.ScheduleId.YEARLY:return T._("Billed yearly");case S.ScheduleId.MONTHLY:return T._("Billed monthly")}return""},t.prototype.getOriginalStatusForCurrentStatus=function(e,t){var n=this.state,a=n.allSubStatuses,r=n.subStatus;if(a&&r)return a.filter(function(n){return!!(n.finalSubState.plan&&r.finalSubState.plan&&n.finalSubState.billingSchedule)&&(n.subState.plan.productType===e&&n.finalSubState.billingSchedule.id===t)}).pop()},t.prototype.getSubStatusFromSubChangePlans=function(e,t){var n=this.state,a=n.subChangePlans,r=n.subStatus;if(a&&r)return a.filter(function(n){return!!(n.finalSubState.plan&&r.finalSubState.plan&&n.finalSubState.billingSchedule)&&(n.finalSubState.plan.productType===e&&n.finalSubState.billingSchedule.id===t)}).pop()},t.prototype.renderBillingScheduleItems=function(){var e=this,t=this.state,n=t.allSubStatuses,a=t.subStatus,i=t.schedule,o=t.hasLicenseKey;if(n&&a)return n.filter(function(t){return!!(t.finalSubState.plan&&a.subState.plan&&a.finalSubState.plan)&&(!e.isPlanScheduledToChange()||!e.isBillingScheduleToChange()||t.finalSubState.plan.productType===a.subState.plan.productType)}).sort(function(e,t){return e.finalSubState.billingSchedule&&t.finalSubState.billingSchedule?e.finalSubState.billingSchedule.id-t.finalSubState.billingSchedule.id:0}).map(function(t){var n=t.finalSubState.plan,s=t.finalSubState.billingSchedule;if(n&&s&&a.subState.billingSchedule&&a.subState.plan&&t.finalSubState.billingSchedule){var c=e.getOriginalStatusForCurrentStatus(a.subState.plan.productType,t.finalSubState.billingSchedule.id);if(c&&c.finalSubState.billingSchedule&&t.subState.billingSchedule){var u,d=n.displayCost,p=n.displayCost,m=n.displayCost,h=t.finalSubState.billingSchedule.id,_=a.subState.billingSchedule.id;switch(o&&a.scheduledSubState&&a.scheduledSubState.billingSchedule&&(_=a.scheduledSubState.billingSchedule.id),_){case S.ScheduleId.MONTHLY:u=T._("per month"),h===S.ScheduleId.YEARLY&&(p=d.divide(12),d=p),h===S.ScheduleId.MONTHLY&&(m=p.multiply(12));break;case S.ScheduleId.YEARLY:u=T._("per year"),h===S.ScheduleId.YEARLY&&(p=d.divide(12)),h===S.ScheduleId.MONTHLY&&(m=d.multiply(12),d=m)}var f,g,y=void 0,b=s.id===i;e.isPlanScheduledToChange()&&(g=r.createElement("span",null,r.createElement("br",null),r.createElement("a",{href:"/plans/individual",target:"_blank",rel:"noreferrer noopener"},T._("See other plans"))));return a.subState.billingSchedule.id===s.id&&(f=T._("(current billing period)")),r.createElement(l.AdminPricedListItem,{key:n.code,isSelected:b,title:e.getBillingItemTitle(s.id),titleWarningText:y,titleSecondaryText:f,description:e.getScheduleDescription(c,p,m),price:d,detailsLink:g,unit:u,onClick:e.changeProductPlanAndScheduleTypeClosure(n.productType,s.id),disableItem:e.isBillingScheduleToChange()})}}})},t.prototype.renderBillingSection=function(){return r.createElement("div",null,r.createElement(s.AdminPricedList,null,this.renderBillingScheduleItems()))},t.prototype.renderPaymentMethod=function(){var e=this.state.paymentMethod;if(this.hasScheduleChanged&&e&&!this.isBillingScheduleToChange())return r.createElement("div",{className:"upgrade-payment-method-link"},r.createElement(_.IndividualInlinePaymentMethodView,{paymentMethod:e,showModal:this.showModalClosure(this.props)}))},t.prototype.showModalClosure=function(e){return function(){t.showInstance(e)}},t.prototype.isPlanScheduledToChange=function(){var e=this.state.subStatus;return!!(e&&e.subState.plan&&e.finalSubState.plan)&&e.subState.plan.productType!==e.finalSubState.plan.productType},t.prototype.isScheduledToChange=function(){return this.isPlanScheduledToChange()||this.isBillingScheduleToChange()||this.isEvhScheduledToChange()},t.prototype.isEvhScheduledToChange=function(){var e=this.state.subStatus;return!(!e||!e.scheduledSubState)&&e.subState.quantityForEvhAddOn()!==e.scheduledSubState.quantityForEvhAddOn()},t.prototype.isBillingScheduleToChange=function(){var e=this.state,t=e.subStatus;return!e.hasLicenseKey&&!!(t&&t.subState.billingSchedule&&t.finalSubState.billingSchedule)&&t.subState.billingSchedule.id!==t.finalSubState.billingSchedule.id},t.prototype.getPlanNameWithEvhText=function(e){var t=this.state.subStatus;return t&&t.scheduledSubState&&t.scheduledSubState.quantityForEvhAddOn()>0?e+" "+T._("+ extended version history"):e},t.prototype.renderScheduleTransitionText=function(){var e=this.state.subStatus,t=this.getSubChangePlan();if(e&&e.subState.plan){var n=r.createElement("a",{onClick:this.handleCancelScheduleAction},T._("Cancel change"));if(this.isBillingScheduleToChange())return r.createElement("span",{className:"plan-transition"},T._("You’ve already requested a change to your billing period. If you want to choose a different billing period, first cancel your pending change.")," ",n);if((!t||this.isBillingScheduleToChange())&&e.currentBillingSummary)return g.NO_RESET_INTERVAL_FOR_USERS&&this.isScheduledToChange()&&e.scheduledSubState&&e.scheduledSubState.plan?r.createElement("div",null,r.createElement("span",{className:"change-summary"},T._("Change summary")),r.createElement("p",{className:"plan-transition"},C.reactFormat(T._("Starting on %(date)s, we’ll bill you once a %(schedule_noun)s for your Dropbox %(plan_name)s plan and your new %(schedule)s total will be %(scheduled_total)s.").format({plan_name:this.getPlanNameWithEvhText(e.scheduledSubState.plan.displayName()),date:e.subState.formattedNextBillingDate,schedule:e.scheduledSubState.billingSchedule.scheduleDescriptionAdjective,schedule_noun:e.scheduledSubState.billingSchedule.scheduleDescriptionNoun,scheduled_total:m.Cash.formatWithTaxLabels(e.nextBillingSummary.total,e.nextBillingSummary)}),{strong:r.createElement("strong",null)}))):r.createElement("div",null,r.createElement("p",{className:"plan-transition"},T._("Your Dropbox %(plan)s plan will renew on %(date)s. Your current %(schedule)s total is %(recurring_total)s.").format({plan:this.getPlanNameWithEvhText(e.subState.plan.displayName()),schedule:e.subState.billingSchedule.scheduleDescriptionAdjective,recurring_total:m.Cash.formatWithTaxLabels(e.currentBillingSummary.total,e.currentBillingSummary),date:e.subState.formattedNextBillingDate})));if(e.scheduledSubState&&e.scheduledSubState.plan){if(!t||!t.finalSubState.plan)return r.createElement("div",null,r.createElement("span",{className:"change-summary"},T._("Change summary")),r.createElement("p",{className:"plan-transition"},C.reactFormat(T._("Starting on %(date)s, we’ll bill you once a %(schedule_noun)s for your Dropbox %(plan_name)s plan and your new %(schedule)s total will be %(scheduled_total)s.").format({plan_name:this.getPlanNameWithEvhText(e.scheduledSubState.plan.displayName()),date:e.subState.formattedNextBillingDate,schedule:e.scheduledSubState.billingSchedule.scheduleDescriptionAdjective,schedule_noun:e.scheduledSubState.billingSchedule.scheduleDescriptionNoun,scheduled_total:m.Cash.formatWithTaxLabels(e.nextBillingSummary.total,e.nextBillingSummary)}),{strong:r.createElement("strong",null)})));if(g.NO_RESET_INTERVAL_FOR_USERS)return r.createElement("div",null,r.createElement("span",{className:"change-summary"},T._("Change summary")),r.createElement("p",{className:"plan-transition"},C.reactFormat(T._("Starting on %(date)s, we’ll bill you once a %(schedule_noun)s for your Dropbox %(plan_name)s plan and your new %(schedule)s total will be %(scheduled_total)s.").format({plan_name:this.getPlanNameWithEvhText(e.scheduledSubState.plan.displayName()),date:e.subState.formattedNextBillingDate,schedule:t.finalSubState.billingSchedule.scheduleDescriptionAdjective,schedule_noun:t.finalSubState.billingSchedule.scheduleDescriptionNoun,scheduled_total:m.Cash.formatWithTaxLabels(t.nextBillingSummary.total,t.nextBillingSummary)}),{strong:r.createElement("strong",null)})));var a=void 0!==t.tvm;if(t&&t.tvm&&a){var i="",o="";return this.isPlanScheduledToChange()&&(i=" "+T._("Upgrading will cancel all scheduled changes.")),this.isEvhScheduledForDowngrade()&&(o=" "+T._("Your scheduled add-on change will take place immediately.")),r.createElement("div",null,r.createElement("span",{className:"change-summary"},T._("Change summary")),r.createElement("p",{className:"plan-transition"},C.reactFormat(T._("You’re changing to %(schedule)s billing.%(evh_upgrade_warning)s We’ll charge you %(prorated_price)s now, which is prorated for the current billing period. Your plan will renew on %(date)s. Your new %(schedule)s total will be %(scheduled_total)s.%(upgrade_warning)s").format({prorated_price:m.Cash.formatWithTaxLabels(t.tvm.getTotalPrice(),t.nextBillingSummary),date:t.subState.formattedNextBillingDate,schedule:t.finalSubState.billingSchedule.scheduleDescriptionAdjective,scheduled_total:m.Cash.formatWithTaxLabels(t.nextBillingSummary.total,t.nextBillingSummary),upgrade_warning:i,evh_upgrade_warning:o}),{strong:r.createElement("strong",null)})))}return a?void 0:r.createElement("div",null,r.createElement("span",{className:"change-summary"},T._("Change summary")),r.createElement("p",{className:"plan-transition"},C.reactFormat(T._("You’re changing to %(schedule)s billing. Starting on %(date)s, we’ll bill you once a %(schedule_noun)s. Your new %(schedule)s total will be %(scheduled_total)s.").format({date:e.subState.formattedNextBillingDate,schedule:t.finalSubState.billingSchedule.scheduleDescriptionAdjective,schedule_noun:t.finalSubState.billingSchedule.scheduleDescriptionNoun,scheduled_total:m.Cash.formatWithTaxLabels(t.nextBillingSummary.total,t.nextBillingSummary)}),{strong:r.createElement("strong",null)})))}}},t.prototype.renderFooter=function(){return this.renderScheduleChangeFooter()},t.prototype.renderScheduleChangeFooter=function(){var e;return this.isBillingScheduleToChange()||(e=this.renderPaymentMethod()),r.createElement("div",{className:"plan-footer u-font-meta"},this.renderScheduleTransitionText(),e)},Object.defineProperty(t.prototype,"acceptButtonDisabled",{get:function(){var e=this.state.paymentMethod,t=this.state,n=t.loadingContent,a=t.submitting;return!(!n&&!a&&e)||(!this.hasScheduleChanged||this.isBillingScheduleToChange())},enumerable:!0,configurable:!0}),t.prototype.isEvhScheduledForDowngrade=function(){var e=this.state.subStatus;if(!e)return!1;var t=e.scheduledSubState;return!!t&&(e.subState.addons.skus.length>0&&1===e.subState.quantityForEvhAddOn()&&0===t.quantityForEvhAddOn())},t.prototype.render=function(){var e,n=this,a=this.state.subStatus,i=this.props,o=i.transitionPerformed,s=i.paymentInfo,l=this.state,u=l.loadingContent,m=l.submitting,_=l.hasLicenseKey;if(u)e=r.createElement("div",{className:"loading-indicator"},r.createElement("img",{src:N.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:T._("Loading")}));else{var g=void 0;if(a&&o){h.DBModalStack.clear(),h.DBModalStack.register(c.CHANGE_IND_PLAN_MODAL_UPDATED,function(){t.showInstance({transitionPerformed:n.transitionPerformedClosure})}),g=r.createElement(d.CancellableNotificationsView,{subStatus:a,transitionPerformed:this.transitionPerformedClosure,displaySingleChangeCancellationItem:p.CancellationType.ALL,reOpenModalDialogAfterCancellation:!0,paymentInfo:s,hasLicenseKey:_,displayNewTotal:!1})}e=r.createElement("div",null,g,this.renderBillingSection(),this.renderFooter())}return r.createElement(f.Modal,{acceptButtonDisabled:this.acceptButtonDisabled,acceptButtonText:T._("Confirm change"),className:"change-plan-modal",dismissButtonText:T._("Cancel"),autoClose:!1,onAccept:this.onAccept,submitting:m,title:T._("Change billing period")},e)},t.ChangeScheduleModal=o(t,["/static/css/teams/admin/widgets/change_plan_modal/change_plan_modal-vfl1OvyKe.css"]),t})(r.Component);t.ChangeScheduleModalView=I}),define("modules/clean/account_page/widgets/plan/views/disable_stacked_transitions_modal",["require","exports","tslib","modules/clean/react/css","external/react","modules/core/i18n","modules/clean/react/modal"],function(e,t,n,a,r,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onAccept=function(){o.Modal.close()},t}return n.__extends(t,e),t.showInstance=function(){o.Modal.showInstance(r.createElement(t.DisableStackedTransitionsModalView,null))},t.prototype.render=function(){return r.createElement(o.Modal,{title:i._("Cancel scheduled changes"),autoClose:!1,dismissButtonText:i._(""),onAccept:this.onAccept,className:"evh-removal-warning-modal"},r.createElement("div",null,r.createElement("p",{className:"evh-removal-warning-modal__desc"},i._("You’ll need to cancel your scheduled changes before making further changes.").format({}))))},t.DisableStackedTransitionsModalView=a(t,["/static/css/account/pagelet/evh_removal_warning-vfloW5p1U.css"]),t})(r.Component);t.DisableStackedTransitionsModal=s}),define("modules/clean/account_page/widgets/plan/views/evh_modal",["require","exports","tslib","modules/core/notify","external/react","modules/clean/ajax","modules/clean/react/css","external/classnames","modules/core/i18n","modules/clean/react_format","modules/clean/payments/skus/constants","modules/constants/account_page","modules/clean/account_page/widgets/plan/views/cancellable_notifications_view","modules/clean/teams/admin/widgets/billing_notifications/cancel_billing_changes_modal","modules/clean/account_page/widgets/plan/views/cancel_changes_modal","modules/clean/payments/cash","external/spectrum/checkbox","modules/clean/account_page/widgets/plan/views/individual_inline_payment_method","modules/clean/dbmodal_stack","modules/clean/account_page/widgets/plan/views/evh_removal_warning","modules/clean/react/modal","modules/constants/account_page","modules/clean/account_page/widgets/plan/types","modules/clean/analytics","modules/clean/payments/skus/subscription_service","modules/clean/payments/skus/subscription_change_plan","modules/clean/account_page/util"],function(e,t,n,a,r,i,o,s,l,c,u,d,p,m,h,_,f,g,y,b,S,v,E,T,P,C,N){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var I=(function(e){function t(t){var n=e.call(this,t)||this;return n.onAccept=function(){var e=n.props.evhInfo.purchased,t=e?E.PerformPlanTransition.REMOVE_EVH:E.PerformPlanTransition.ADD_EVH;n.setState(function(e){return e.submitting=!0,e}),i.WebRequest({url:"/account/perform_personal_transition",data:{transition_change_type:t},subject_user:N.getCurrentUser().id,success:function(e){a.success(l._("You’ve changed your plan!")),T.ProEventsLogger.log("de_evh_modal_toggle_evh"),n.props.transitionPerformed&&n.props.transitionPerformed(),S.Modal.close()},error:function(){a.error(l._("There was an error updating your plan!")),n.setState(function(e){return e.submitting=!1,e})}})},n.toggleEvh=function(){var e=n.props.evhInfo,t=n.state.isEvhSelected;e.scheduled_to_remove||(T.ProEventsLogger.log("de_evh_modal_change_evh_election",{from:t?"evh_on":"evh_off",to:t?"evh_off":"evh_on"}),n.setState({isEvhSelected:!t}))},n.cancelEvhChange=function(){return n.handleCancelActions(m.CancellationType.EVH_ADDON),!1},n.handleCancelActions=function(e){var t=n.props.subStatus;return t&&h.CancelChangesModalConfirmationView.showInstance({subStatus:t,transitionPerformed:n.props.transitionPerformed,cancellationType:e,reOpenModalDialogAfterCancellation:!0}),!1},n.transitionPerformedClosure=function(){if(n.props.transitionPerformed)return n.props.transitionPerformed()},n.onAcceptEvhRemovalWarning=function(){b.EvhRemovalWarningModal.showInstance({evhInfo:n.props.evhInfo,transitionPerformed:n.props.transitionPerformed,subStatus:n.props.subStatus})},new P.SubscriptionService,n.state={isEvhSelected:t.evhInfo.purchased,submitting:!1},n}return n.__extends(t,e),t.showInstance=function(e){S.Modal.showInstance(r.createElement(t.EvhModalViewModal,n.__assign({},e)))},t.prototype.isProfessionalPlanScheduled=function(){var e=this.props.subStatus;return!!(e&&e.scheduledSubState&&e.scheduledSubState.plan)&&(e.scheduledSubState.plan.productType===u.ProductPlanType.PROFESSIONAL||e.scheduledSubState.plan.productType===u.ProductPlanType.PROFESSIONAL_TRIAL)},t.prototype.isPlanScheduledToChange=function(){var e=this.props.subStatus;return!!(e&&e.subState.plan&&e.finalSubState.plan)&&e.subState.plan.productType!==e.finalSubState.plan.productType},t.prototype.isScheduledToChange=function(){return this.isPlanScheduledToChange()||this.isBillingScheduleToChange()||this.isEvhScheduledToChange()},t.prototype.isEvhScheduledToChange=function(){var e=this.props.subStatus;return!(!e||!e.scheduledSubState)&&e.subState.quantityForEvhAddOn()!==e.scheduledSubState.quantityForEvhAddOn()},t.prototype.isBillingScheduleToChange=function(){var e=this.props.subStatus;return!!(e&&e.subState.billingSchedule&&e.finalSubState.billingSchedule)&&e.subState.billingSchedule.id!==e.finalSubState.billingSchedule.id},t.prototype.renderFooter=function(){var e=this.props,t=e.evhInfo,n=e.subStatus,a=this.state.isEvhSelected;if(t.scheduled_to_remove)return r.createElement("p",{className:"evh-modal-footer"},l._("You’ve already requested a plan change. If you want to choose a different plan, first cancel your pending change.")," ",r.createElement("a",{onClick:this.cancelEvhChange},l._("Cancel change")));if(t.evh_transition&&n.subState&&n.subState.plan&&n.scheduledSubState&&n.scheduledSubState.plan){var i=C.SubscriptionChangePlan.deserialize(t.evh_transition);if(a){if(t.purchased)return v.NO_RESET_INTERVAL_FOR_USERS&&this.isScheduledToChange()&&n.scheduledSubState&&n.scheduledSubState.plan?r.createElement("p",{className:"evh-modal-footer"},c.reactFormat(l._("Starting on %(date)s, we’ll bill you once a %(schedule_noun)s for your Dropbox %(plan_name)s plan and your new %(schedule)s total will be %(scheduled_total)s.").format({plan_name:n.scheduledSubState.plan.displayName(),date:n.subState.formattedNextBillingDate,schedule:n.scheduledSubState.billingSchedule.scheduleDescriptionAdjective,schedule_noun:n.scheduledSubState.billingSchedule.scheduleDescriptionNoun,scheduled_total:_.Cash.formatWithTaxLabels(n.nextBillingSummary.total,n.nextBillingSummary)}),{strong:r.createElement("strong",null)})):r.createElement("p",{className:"evh-modal-footer"},l._("Your Dropbox %(plan_name)s + extended version history plan will renew on %(date)s. Your current %(billing_schedule)s total is %(total)s.").format({plan_name:n.subState.plan.displayName(),date:n.subState.formattedNextBillingDate,billing_schedule:n.subState.billingSchedule.scheduleDescriptionAdjective,total:n.currentBillingSummary?_.Cash.formatWithTaxLabels(n.currentBillingSummary.total,n.currentBillingSummary):""}));var o="";return i.tvm&&(o=_.Cash.formatWithTaxLabels(i.tvm.getTotalPrice(),i.nextBillingSummary)),r.createElement("div",{className:"evh-modal-footer"},r.createElement("span",{className:"change-summary"},l._("Change summary")),r.createElement("p",null,c.reactFormat(l._("You’re adding extended version history to your Dropbox %(plan_name)s plan. We’ll charge you %(prorated_price)s now, which has been prorated for the current billing period. Your plan will renew on %(date)s. Your new %(billing_schedule)s total will be %(recurring_total)s.").format({plan_name:n.scheduledSubState.plan.displayName(),prorated_price:o,date:n.subState.formattedNextBillingDate,billing_schedule:i.subState.billingSchedule.scheduleDescriptionAdjective,recurring_total:_.Cash.formatWithTaxLabels(i.nextBillingSummary.total,i.nextBillingSummary)}),{strong:r.createElement("strong",null)})))}return t.purchased&&i.scheduledSubState?r.createElement("div",{className:"evh-modal-footer"},r.createElement("span",{className:"change-summary"},l._("Change summary")),r.createElement("p",null,c.reactFormat(l._("Starting on %(date)s, your plan will be downgraded to Dropbox %(plan_name)s without extended version history. You will revert to %(days)s day version history. Your new %(billing_schedule)s total will be %(scheduled_total)s.").format({date:n.subState.formattedNextBillingDate,plan_name:n.scheduledSubState.plan.displayName(),days:this.isProfessionalPlanScheduled()?"120":"30",billing_schedule:i.scheduledSubState.billingSchedule.scheduleDescriptionAdjective,scheduled_total:_.Cash.formatWithTaxLabels(i.nextBillingSummary.total,i.nextBillingSummary)}),{strong:r.createElement("strong",null)}))):r.createElement("p",{className:"evh-modal-footer"},l._("Your Dropbox %(plan_name)s plan will renew on %(date)s.").format({plan_name:n.subState.plan.displayName(),date:n.subState.formattedNextBillingDate})," ",l._("Your current %(billing_schedule)s total is %(total)s.").format({billing_schedule:n.subState.billingSchedule.scheduleDescriptionAdjective,total:n.currentBillingSummary?_.Cash.formatWithTaxLabels(n.currentBillingSummary.total,n.currentBillingSummary):""}))}},t.prototype.showModalClosure=function(e){var t=this;return function(){t.props.transitionPerformed&&t.props.transitionPerformed()}},t.prototype.getModalContent=function(){var e=this.props,t=e.evhInfo,n=e.subStatus,a=e.paymentInfo,i=this.state.isEvhSelected,o=i,c=l._("year");n.subState.billingSchedule&&(c=n.subState.billingSchedule.scheduleDescriptionNoun);var d=s({"evh-modal-toggle-box-price-box__price":!0,"evh-modal-toggle-box-price-box__price--disabled":t.scheduled_to_remove}),h=l._("See all deletion and version history of your files for one year.");return n.subState.addons.peekSkus()&&n.subState.addons.sku.adminCxId===u.AdminCxId.UNLIMITED_PAID_VERSION_HISTORY&&(h=l._("See all deletion and version history of your files for unlimited time.")),r.createElement("div",null,r.createElement(p.CancellableNotificationsView,{subStatus:n,transitionPerformed:this.transitionPerformedClosure,displaySingleChangeCancellationItem:m.CancellationType.ALL,reOpenModalDialogAfterCancellation:!0,paymentInfo:a,displayNewTotal:!1}),r.createElement("div",{className:"evh-modal-toggle-box"},r.createElement("div",{className:"evh-modal-toggle-box__toggle-btn"},r.createElement(f.Checkbox,{checked:o?"checked":"unchecked",onChange:this.toggleEvh,disabled:t.scheduled_to_remove})),r.createElement("div",{className:"evh-modal-toggle-box__desc"},r.createElement("label",{onClick:this.toggleEvh},r.createElement("p",{className:"evh-modal-toggle-box__desc-title"},l._("Extended version history"))),r.createElement("p",{className:"evh-modal-toggle-box__desc-description"},h),r.createElement("a",{className:"evh-modal-toggle-box__desc-link",href:"/help/security/extended-version-history",target:"_blank",rel:"noopener noreferrer"},l._("See EVH details"))),r.createElement("div",{className:"evh-modal-toggle-box-price-box"},r.createElement("p",{className:d},t.evh_price),r.createElement("span",{className:"evh-modal-toggle-box-price-box__price-desc"},l._("per %(schedule_noun)s").format({schedule_noun:c})))),this.renderFooter(),this.renderPaymentMethod())},t.prototype.renderPaymentMethod=function(){var e=this.props.paymentMethod;if(!this.acceptButtonDisabled&&e)return r.createElement("div",{className:"upgrade-payment-method-link"},r.createElement(g.IndividualInlinePaymentMethodView,{paymentMethod:e,showModal:this.showModalClosure(this.props)}))},Object.defineProperty(t.prototype,"acceptButtonDisabled",{get:function(){var e=this.props.evhInfo;return this.state.isEvhSelected===e.purchased||e.scheduled_to_remove},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.subStatus,n=e.transitionPerformed,a=this.state,i=a.submitting,o=a.isEvhSelected;t&&n&&y.DBModalStack.clear();var s=this.onAccept;return d.ACCOUNT_TAURUS_PLANS&&!o&&(s=this.onAcceptEvhRemovalWarning),r.createElement(S.Modal,{autoClose:!1,acceptButtonDisabled:this.acceptButtonDisabled,acceptButtonText:l._("Save change"),dismissButtonText:l._("Cancel"),onAccept:s,submitting:i,className:"evh-modal",title:l._("Edit EVH add-on")},this.getModalContent())},t.EvhModalViewModal=o(t,["/static/css/account/pagelet/evh_modal-vfltl8w3-.css"]),t})(r.Component);t.EvhModalView=I}),define("modules/clean/account_page/widgets/plan/views/evh_removal_warning",["require","exports","tslib","modules/clean/ajax","modules/clean/react/css","modules/core/notify","external/react","modules/core/i18n","modules/clean/account_page/util","modules/clean/account_page/widgets/plan/types","modules/clean/react/modal","modules/clean/analytics","modules/clean/payments/skus/constants"],function(e,t,n,a,r,i,o,s,l,c,u,d,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var m=(function(e){function t(t){var n=e.call(this,t)||this;return n.onAccept=function(){var e=n.props.evhInfo.purchased,t=e?c.PerformPlanTransition.REMOVE_EVH:c.PerformPlanTransition.ADD_EVH;n.setState(function(e){return e.submitting=!0,e}),a.WebRequest({url:"/account/perform_personal_transition",data:{transition_change_type:t},subject_user:l.getCurrentUser().id,success:function(e){i.success(s._("You’ve changed your plan!")),d.ProEventsLogger.log("de_evh_modal_toggle_evh"),n.props.transitionPerformed&&n.props.transitionPerformed(),u.Modal.close()},error:function(){i.error(s._("There was an error updating your plan!")),n.setState(function(e){return e.submitting=!1,e})}})},n.state={submitting:!1},n}return n.__extends(t,e),t.showInstance=function(e){u.Modal.showInstance(o.createElement(t.EvhRemovalWarningModalView,n.__assign({},e)))},t.prototype.render=function(){var e=this.props.subStatus,t=this.state.submitting;if(!e||!e.subState.plan)return o.createElement("noscript",null);var n=e.subState.plan.productType===p.ProductPlanType.PROFESSIONAL?"120":"30";return o.createElement(u.Modal,{title:s._("Removing EVH is permanent"),acceptButtonDisabled:this.state.submitting,autoClose:!1,acceptButtonText:s._("Confirm removal"),dismissButtonText:s._("Cancel change"),onAccept:this.onAccept,className:"evh-removal-warning-modal",submitting:t},o.createElement("div",null,o.createElement("p",{className:"evh-removal-warning-modal__desc"},s._("Are you sure you want to remove extended version history? Once you remove it,\n you won’t be able to add it back again. Your plan will change from one year of\n version history to the Dropbox %(plan)s length of %(days)s days\n of version history.").format({plan:e.subState.plan.displayName(!1,!0),days:n}))))},t.EvhRemovalWarningModalView=r(t,["/static/css/account/pagelet/evh_removal_warning-vfloW5p1U.css"]),t})(o.Component);t.EvhRemovalWarningModal=m}),define("modules/clean/account_page/widgets/plan/views/individual_inline_payment_method",["require","exports","tslib","modules/clean/payments/billing_info_modal","modules/clean/dbmodal_stack","modules/clean/deprecated/dbmodal_loading","external/react","modules/core/i18n","modules/clean/react_format","modules/clean/account_page/widgets/billing/payment_method_constants","modules/constants/account_page","modules/clean/react/payments/update_billing_individual/individual_update_billing_modal_loader","modules/clean/react/modal"],function(e,t,n,a,r,i,o,s,l,c,u,d,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var m=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.updateBillingInfo=function(e){var n=t.props.showModal;e.stopPropagation(),e.preventDefault(),p.Modal.close(),r.DBModalStack.register(a.BILLING_INFO_UPDATED,function(){n&&n()}),u.INDIVIDUAL_UPDATE_BILLING_MODAL_REFACTOR?d.IndividualUpdateBillingModalLoader.showInstance():r.DBModalStack.push(new i({element_id:"update_billing_info",endpoint_url:"/billing_info_modal",html_in_error_msg:!0,parameters:{}}))},t}return n.__extends(t,e),t.prototype.renderCreditCard=function(){var e=this.props.paymentMethod;if(e){var t=e.account_short.slice(-4),n=s._("We’ll charge your card ending in %(last4)s.").format({last4:t});return o.createElement("span",null,n," ",this.renderUpdateLink())}return o.createElement("span",null)},t.prototype.renderDirectDebit=function(){var e=this.props.paymentMethod;if(e){var t=e.account_short.slice(-4),n=s._("We’ll charge your IBAN ending in %(last4)s.").format({last4:t});return o.createElement("span",null,n," ",this.renderUpdateLink())}return o.createElement("span",null)},t.prototype.renderPaypal=function(){return o.createElement("span",null,s._("We’ll charge your PayPal account.")," ",this.renderUpdateLink())},t.prototype.renderUpdateLink=function(){return l.reactFormat(s._("Update billing information"),{a:o.createElement("a",{key:"updateBillingInfo",href:"#",onClick:this.updateBillingInfo})})},t.prototype.render=function(){var e=this.props.paymentMethod
;if(!e)return o.createElement("span",null);switch(e.gateway_id){case c.BRAINTREE:return this.renderCreditCard();case c.ADYEN_SEPA_GATEWAY:return this.renderDirectDebit();case c.PAYPAL:case c.PAYPAL_REFERENCE_TRANSACTION:return this.renderPaypal();default:return o.createElement("span",null)}},t})(o.Component);t.IndividualInlinePaymentMethodView=m}),define("modules/clean/account_page/widgets/plan/views/plan_container",["require","exports","tslib","modules/clean/payments/billing_info_modal","external/react","external/react-redux","modules/clean/react/css","modules/clean/web_timing_logger","modules/clean/account_page/util","modules/clean/account_page/widgets/billing/payment_methods_util","modules/clean/account_page/widgets/plan/views/add_ons","modules/clean/account_page/widgets/plan/views/cancel_plan","modules/clean/teams/admin/widgets/billing_notifications/cancel_billing_changes_modal","modules/clean/dbmodal_stack","modules/clean/account_page/widgets/plan/action_creators","modules/clean/account_page/widgets/billing/action_creators","modules/clean/account_page/widgets/plan/add_ons/action_creators","modules/clean/account_page/widgets/plan/referral_history/action_creators","modules/clean/account_page/widgets/plan/views/plan_status","modules/clean/payments/skus/constants","modules/clean/account_page/widgets/plan/views/quota_usage","modules/clean/account_page/components/loading","modules/clean/account_page/widgets/plan/views/referral_space","modules/clean/account_page/widgets/plan/views/cancellable_notifications_view","modules/clean/analytics","modules/clean/payments/skus/subscription_status"],function(e,t,n,a,r,i,o,s,l,c,u,d,p,m,h,_,f,g,y,b,S,v,E,T,P,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var N=function(e){return{evhInfo:e.planTab.evhInfo,evhLoadingState:e.planTab.evhLoadingState,planInfo:e.planTab.planInfo,loadingState:e.planTab.loadingState,referralHistory:e.planTab.referralHistory,referralLoadingState:e.planTab.referralLoadingState,dataLoadedForTTI:"ready"===e.planTab.evhLoadingState&&"ready"===e.planTab.loadingState&&"ready"===e.planTab.referralLoadingState}},I=function(e){return{loadPlanInfo:function(t){return e(h.loadDataIfNecessary(t))},loadEvhInfo:function(t){return e(f.loadEvhInfoIfNecessary(t))},loadReferralHistory:function(t,n){return void 0===t&&(t=!1),void 0===n&&(n=0),e(g.loadReferralHistoryIfNecessary(t,n))},forceLoadBillingTab:function(t){return e(_.loadDataIfNecessary(t))}}},x=(function(e){function t(t){var n=e.call(this,t)||this;return n.forceReload=function(){var e=n.props,t=e.loadEvhInfo,a=e.loadPlanInfo,r=e.forceLoadBillingTab;t(!0),a(!0),r(!0)},m.DBModalStack.register(a.BILLING_INFO_UPDATED,function(){P.ProEventsLogger.log("de_payment_modal_save_click"),n.props.loadPlanInfo(!0),n.props.forceLoadBillingTab(!0)}),n}return n.__extends(t,e),t.prototype.componentDidMount=function(){this.props.loadPlanInfo(),this.props.loadReferralHistory(),this.props.loadEvhInfo(),this.checkTTIstate(),P.ProEventsLogger.log("de_plan_tab_view")},t.prototype.componentDidUpdate=function(){this.checkTTIstate()},t.prototype.checkTTIstate=function(){this.props.dataLoadedForTTI&&(s.mark_time_to_view(),s.mark_time_to_interactive())},Object.defineProperty(t.prototype,"isPersonalUser",{get:function(){return"personal"===l.getCurrentUser().role},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBusinessUser",{get:function(){return!this.isPersonalUser},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLicensePlan",{get:function(){var e=this.props.planInfo;if(!e)return!1;var t=e.paymentInfo;return t&&c.isLicenseKey(t.gateway_id)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasLicenseKey",{get:function(){var e=this.props.planInfo;return!!e&&e.hasLicenseKey},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLimitedTeam",{get:function(){return this.props.planInfo.isLimitedTeam},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isOverQuota",{get:function(){var e=this.props.planInfo.usageBreakdown;return e.usage>=e.quota},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subStatus",{get:function(){var e=this.props.planInfo.serializedSubStatus;if(e)return C.SubscriptionStatus.deserialize(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isExternallyBilled",{get:function(){return void 0===this.subStatus},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPlusTrialPlan",{get:function(){return!(!this.subStatus||!this.subStatus.subState.plan)&&(this.subStatus.subState.plan.productType===b.ProductPlanType.TRIAL||this.subStatus.subState.plan.productType===b.ProductPlanType.PLUS_TRIAL)},enumerable:!0,configurable:!0}),t.prototype.isLoading=function(){return"ready"!==this.props.loadingState},t.prototype.renderAddOnsIfAvailable=function(){var e=this.props,t=e.evhInfo,n=e.evhLoadingState,a=e.planInfo,i=this.props.planInfo,o=i.paymentMethod,s=i.paymentInfo;if(!this.isLicensePlan&&t.is_available&&this.subStatus&&this.subStatus.subState.plan&&this.subStatus.subState.plan.productType!==b.ProductPlanType.FREE&&(this.isPersonalUser||this.isLimitedTeam))return r.createElement(u.AddOns,{subStatus:this.subStatus,scheduledForDowngrade:a.scheduledForDowngrade,evhInfo:t,evhLoadingState:n,paymentInfo:s,paymentMethod:o,transitionPerformed:this.forceReload})},t.prototype.renderTotalTeamUsageBreakdown=function(){var e=this.props.planInfo.teamUsageBreakdown;if(e)return r.createElement(S.QuotaUsage,{usageBreakdown:e,isPersonalUser:!1,isLimitedTeam:!1,isMSLTeamMember:!1})},t.prototype.render=function(){var e=this.props.evhInfo,t=this.props.planInfo,n=t.usageBreakdown,a=t.referralInfo,i=t.scheduledForDowngrade,o=t.paymentInfo,s=t.isTeamAdmin,l=t.isMSLTeamMember,u=t.hasLicenseKey,m=t.eligibleFor1tb,h=this.subStatus;if(this.isLoading())return r.createElement(v.Loading,null);var _=void 0;this.isExternallyBilled||i||!this.isPersonalUser&&!this.isLimitedTeam||!o||c.shouldHideBillingChange(o.gateway_id,o.is_external_billing)||(_=r.createElement(d.CancelPlan,{usageBreakdown:n,subStatus:h,eligibleFor1tb:m}));var f,g=this.isBusinessUser&&!this.isLimitedTeam?void 0:r.createElement(E.ReferralSpace,{referralInfo:a,referralHistory:this.props.referralHistory,referralLoadingState:this.props.referralLoadingState});return this.isExternallyBilled||this.isLicensePlan||this.isPlusTrialPlan||!this.isPersonalUser&&!this.isLimitedTeam||this.hasLicenseKey||(f=r.createElement(T.CancellableNotificationsView,{paymentInfo:o,subStatus:h,scheduledForDowngrade:i,transitionPerformed:this.forceReload,displaySingleChangeCancellationItem:p.CancellationType.ALL,reOpenModalDialogAfterCancellation:!1,displayNewTotal:!0})),r.createElement("div",{className:"account-plan-tab"},f,r.createElement(y.PlanStatus,{subStatus:h,scheduledForDowngrade:i,evhInfo:e,onUpdate:this.forceReload,isPersonalUser:this.isPersonalUser,isLimitedTeam:this.isLimitedTeam,isExternallyBilled:this.isExternallyBilled,paymentInfo:o,isTeamAdmin:s,hasLicenseKey:u,usageBreakdown:n,eligibleFor1tb:m}),this.renderAddOnsIfAvailable(),r.createElement(S.QuotaUsage,{subStatus:h,usageBreakdown:n,isPersonalUser:this.isPersonalUser,isLimitedTeam:this.isLimitedTeam,isMSLTeamMember:l}),this.renderTotalTeamUsageBreakdown(),g,_)},t})(r.Component);t.PlanContainerComponent=x;var A=i.connect(N,I)(x);t.PlanContainer=o(A,["/static/css/account/pagelet/plan_tab-vflSUAfWE.css"])}),define("modules/clean/account_page/widgets/plan/views/plan_status",["require","exports","tslib","modules/core/browser","modules/clean/deprecated/dbmodal_loading","external/react","modules/clean/viewer","modules/core/uri","modules/core/i18n","modules/constants/account_page","modules/clean/account_page/widgets/billing/payment_methods_util","modules/clean/account_page/widgets/billing/payment_method_constants","modules/clean/static_urls","modules/clean/payments/cash","modules/clean/account_page/widgets/plan/views/change_plan_modal","modules/clean/account_page/widgets/plan/views/change_schedule_modal","modules/clean/account_page/widgets/plan/views/cancel_subs_warning_modal","modules/clean/dbmodal_stack","modules/clean/account_page/widgets/plan/views/disable_stacked_transitions_modal","modules/constants/account_page","modules/clean/payments/skus/constants","modules/clean/analytics","modules/constants/trademark"],function(e,t,n,a,r,i,o,s,l,c,u,d,p,m,h,_,f,g,y,b,S,v,E){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var T=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isOverQuota=function(){return t.usage>t.quota},t.logSeePlanDetails=function(){v.ProEventsLogger.log("de_plan_tab_details_click")},t.onChangeBillingPeriodClick=function(e){if(e.preventDefault(),b.NO_RESET_INTERVAL_FOR_USERS&&b.DE_DISABLE_STACKED_TRANSITIONS&&t.pendingScheduledChange())return void y.DisableStackedTransitionsModal.showInstance();var n=t.props,a=n.scheduledForDowngrade,r=n.paymentInfo;a?f.CancelChangesModalConfirmation.showInstance({transitionPerformed:t.props.onUpdate,subStatus:t.props.subStatus}):(_.ChangeScheduleModalView.showInstance({transitionPerformed:t.props.onUpdate,paymentInfo:r}),v.ProEventsLogger.log("de_plan_tab_change_billing_open_modal"))},t.basicOnClick=function(){v.ProEventsLogger.log("de_plan_tab_upgrade_to_plus_click");var e=t.isOverQuota()?"acc_plan_upgrade_overquota_btn":"acc_plan_upgrade",n=new s({path:"/upgrade",query:{oqa:e}}).toString();a.redirect(n)},t.purchaseNowClick=function(){v.ProEventsLogger.log("de_plan_tab_purchase_now_click"),a.redirect("/pro/convert")},t.cancelTrialClick=function(){v.ProEventsLogger.log("de_plan_tab_cancel_trial_click"),a.redirect("/downgrade")},t.contactSupportClick=function(){v.ProEventsLogger.log("de_plan_tab_contact_support_click"),a.redirect("/support")},t.addPaymentClick=function(){v.ProEventsLogger.log("de_plan_tab_add_payment_method_click"),g.DBModalStack.push(new r({element_id:"add_billing_info",endpoint_url:"/add_billing_info_modal",html_in_error_msg:!0}))},t.openChangePlanModal=function(e){if(e&&e.preventDefault(),b.NO_RESET_INTERVAL_FOR_USERS&&b.DE_DISABLE_STACKED_TRANSITIONS&&t.pendingScheduledChange())return void y.DisableStackedTransitionsModal.showInstance();var n=t.props,a=n.scheduledForDowngrade,r=n.paymentInfo;a?f.CancelChangesModalConfirmation.showInstance({transitionPerformed:t.props.onUpdate,subStatus:t.props.subStatus}):(h.ChangePlanModalView.showInstance({transitionPerformed:t.props.onUpdate,paymentInfo:r}),v.ProEventsLogger.log("de_plan_tab_change_plan_open_modal"))},t.renderContactSupportLink=function(){return i.createElement("div",{className:"plan-status-section__contact_support_link"},i.createElement("a",{href:"#",onClick:t.contactSupportClick},l._("Contact support to change plan")))},t.renderBillingPeriod=function(){var e=t.props,n=e.paymentInfo,a=e.scheduledForDowngrade;if(n){var r=n.gateway_id,o=n.is_external_billing,s=n.end_date,c=n.deactivated,d=n.is_on_trial,p=n.reseller_name,m=n.reseller_link;if(!n.schedule_switchable&&!a||u.shouldHideBillingChange(r,o)){var h=u.getBillingDisabledMessage({gatewayId:r,isExternalBilling:o,resellerName:p,resellerLink:m,dropboxPlan:E.TRADEMARK_PLUS,endDate:s,deactivated:c,isOnTrial:d});return i.createElement("span",{className:"plan-status-section__link"},h)}if(!t.isTrialPlan())return i.createElement("a",{href:"#",className:"plan-status-section__link",onClick:t.onChangeBillingPeriodClick},l._("Change billing period"))}},t.standardPlanClick=function(){a.redirect("/team/admin/billing/manage?show_switch_plan")},t.advancedPlanClick=function(){a.redirect("/team/admin/billing/manage")},t.createTrialCtaButtons=function(e){return void 0===e&&(e=!0),e?i.createElement("div",{className:"plan-status-section__upgrade_btn trial-cta"},i.createElement("button",{className:"button-primary purchase-button",onClick:t.purchaseNowClick},l._("Purchase Now")),i.createElement("button",{className:"button-tertiary cancel-button",onClick:t.cancelTrialClick},l._("Cancel trial"))):i.createElement("div",{className:"plan-status-section__upgrade_btn trial-cta"},i.createElement("button",{className:"button-primary purchase-button",onClick:t.purchaseNowClick},l._("Purchase Now")))},t}return n.__extends(t,e),t.prototype.componentDidMount=function(){var e=a.get_href().match(/modal=([a-zA-Z_]*)/);if(e&&e.length>1){"plan"===e[1]&&this.isChangePlanSupported()&&this.openChangePlanModal()}},t.prototype.isChangePlanSupported=function(){if(!this.isInStandardSchedule())return!1;var e=this.props,t=e.subStatus,n=e.isExternallyBilled,a=e.paymentInfo;return!!(a&&t&&t.subState.plan)&&(!u.shouldHideBillingChange(a.gateway_id,n)&&(this.isPlusPlan()||t.subState.plan.productType===S.ProductPlanType.PROFESSIONAL))},Object.defineProperty(t.prototype,"usage",{get:function(){return this.props.usageBreakdown.usage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"quota",{get:function(){return this.props.usageBreakdown.quota||.01},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"plansURL",{get:function(){return new s({path:"/plans/individual",query:{oqa:"acc_plan_upgrade"}}).toString()},enumerable:!0,configurable:!0}),t.prototype.isPlusPlan=function(){var e=this.props.subStatus;return!(!e||!e.subState.plan)&&(e.subState.plan.productType===S.ProductPlanType.STANDARD||e.subState.plan.productType===S.ProductPlanType.PLUS)},t.prototype.isProfessionalPlan=function(){var e=this.props.subStatus;return!(!e||!e.subState.plan)&&(e.subState.plan.productType===S.ProductPlanType.PROFESSIONAL||e.subState.plan.productType===S.ProductPlanType.PROFESSIONAL_TRIAL)},t.prototype.isFreePlusPlan=function(){var e=this.props.subStatus;return!(!e||!e.subState.plan)&&e.subState.plan.productType===S.ProductPlanType.FREE},t.prototype.isInStandardSchedule=function(){var e=this.props.subStatus;if(e&&e.subState&&e.subState.billingSchedule){var t=e.subState.billingSchedule.id;return t===S.ScheduleId.MONTHLY||t===S.ScheduleId.YEARLY}return!1},t.prototype.pendingScheduledChange=function(){return this.isPlanScheduledToChange()||this.isBillingScheduleToChange()||this.isEvhScheduledToChange()},t.prototype.isTaurusPlan=function(){var e=this.props.subStatus;if(e&&e.subState.plan){var t=e.subState.plan.productType;return t===S.ProductPlanType.PLUS||t===S.ProductPlanType.PLUS_TRIAL||t===S.ProductPlanType.PROFESSIONAL||t===S.ProductPlanType.PROFESSIONAL_TRIAL||t===S.ProductPlanType.PLUS_WITH_SS||t===S.ProductPlanType.PLUS_WITH_SS_TRIAL}return!1},t.prototype.isPlanScheduledToChange=function(){var e=this.props,t=e.subStatus;return!!e.scheduledForDowngrade||!!(t&&t.subState.plan&&t.finalSubState.plan)&&t.subState.plan.productType!==t.finalSubState.plan.productType},t.prototype.isEvhScheduledToChange=function(){var e=this.props.subStatus;return!(!e||!e.scheduledSubState)&&e.subState.quantityForEvhAddOn()!==e.scheduledSubState.quantityForEvhAddOn()},t.prototype.isBillingScheduleToChange=function(){var e=this.props.subStatus;return!!(e&&e.subState.billingSchedule&&e.finalSubState.billingSchedule)&&e.subState.billingSchedule.id!==e.finalSubState.billingSchedule.id},t.prototype.shouldDisplayChangePlan=function(){var e=this.getGatewayId();return e!==d.NOT_APPLICABLE&&!u.shouldHidePaymentMethod(e)},t.prototype.getGatewayId=function(){var e=this.props.paymentInfo;return e?e.gateway_id:d.NOT_APPLICABLE},t.prototype.isTrialPlan=function(){var e=this.props.subStatus;return!(!e||!e.subState.plan)&&(e.subState.plan.productType===S.ProductPlanType.PLUS_TRIAL||e.subState.plan.productType===S.ProductPlanType.PROFESSIONAL_TRIAL)},t.prototype.isPlusTrialPlan=function(){var e=this.props.subStatus;return!(!e||!e.subState.plan)&&(e.subState.plan.productType===S.ProductPlanType.TRIAL||e.subState.plan.productType===S.ProductPlanType.PLUS_TRIAL)},t.prototype.isLicensePlan=function(){var e=this.props.paymentInfo;return!!e&&u.isLicenseKey(e.gateway_id)},t.prototype.renderDropboxLogo=function(){return i.createElement("div",null,i.createElement("img",{src:p.static_url("/static/images/logo_catalog/dropbox-business-icon_m1-vflczuza3.svg"),className:"plan-status-section__icon u-mar-right-s",alt:""}))},t.prototype.renderBusinessPlanSection=function(){var e=this.props,t=e.subStatus,n=e.isTeamAdmin;if(t&&t.subState.plan){var a=t.subState.plan.displayName(!1,!0),r="";o.get_viewer().team_name&&(r=l._("You’re a member of the %(team_name)s Dropbox account.").format({team_name:o.get_viewer().team_name}));var s,c;return n&&(t.subState.plan.productType===S.ProductPlanType.STANDARD||t.subState.plan.productType===S.ProductPlanType.NEW_STANDARD?(s=i.createElement("div",{className:"plan-status-section__upgrade_btn"},i.createElement("button",{className:"button-primary",onClick:this.standardPlanClick},l._("Change plan"))),c=i.createElement("p",null,i.createElement("a",{href:"/team/admin/billing/manage"},l._("Manage your team in the Admin Console")))):t.subState.plan.productType===S.ProductPlanType.ADVANCED&&(s=i.createElement("div",{className:"plan-status-section__upgrade_btn"},i.createElement("button",{className:"button-tertiary",onClick:this.advancedPlanClick},l._("Manage plan"))),c=i.createElement("p",null,i.createElement("a",{href:"/team/admin/billing/manage"},l._("Manage your team in the Admin Console"))))),i.createElement("div",{className:"plan-status-section"},this.renderDropboxLogo(),i.createElement("div",{className:"plan-status-section__description"},i.createElement("h1",{className:"plan-status-section__title"},a),i.createElement("span",null,r),c),s)}},t.prototype.renderBasicPlanSection=function(){var e=this.props,t=e.subStatus,n=e.isLimitedTeam,a=l._("Dropbox Basic");if(t){t.subState.plan&&(a=t.subState.plan.displayName());var r=void 0;n&&(r=i.createElement("p",{className:"plan-status-section__team_desc"},l._("You’re a member of the %(team_name)s Dropbox account.").format({team_name:o.get_viewer().team_name})));var s=this.isOverQuota()?l._("Upgrade now"):l._("Upgrade");return i.createElement("div",{className:"plan-status-section"},this.renderDropboxLogo(),i.createElement("div",{className:"plan-status-section__description"},i.createElement("h1",{className:"plan-status-section__title"},a),r,i.createElement("a",{className:"plan-status-section__link",href:this.plansURL,target:"_blank",rel:"noopener noreferrer"},l._("See other plans"))),i.createElement("div",{className:"plan-status-section__upgrade_btn"},i.createElement("button",{className:"button-primary",onClick:this.basicOnClick},s)))}},t.prototype.renderResellerPlan=function(){var e=l._("Dropbox %(plus)s 1TB").format({plus:E.TRADEMARK_PLUS});return i.createElement("div",{className:"plan-status-section"},this.renderDropboxLogo(),i.createElement("div",{className:"plan-status-section__description"},i.createElement("h1",{className:"plan-status-section__title"},e),i.createElement("p",{className:"plan-status-section__title_description"},this.renderBillingPeriod())))},t.prototype.renderPaidPlanSection=function(){var e=this.props,t=e.subStatus,n=e.evhInfo,a=e.isLimitedTeam,r=e.hasLicenseKey,s=e.paymentInfo,d=e.scheduledForDowngrade;if(t&&t.scheduledSubState&&t.subState.plan){var p,h=t.subState.plan;p=1024===h.specQuotaGb?l._("Dropbox %(plus)s%(evh)s").format({plus:t.subState.plan.displayName(!1),evh:n.purchased?" + "+l._("extended version history"):""}):l._("%(plus)s%(evh)s").format({plus:t.subState.plan.displayName(!0),evh:n.purchased?" + "+l._("extended version history"):""});var _,f=void 0,g=void 0;if(s&&u.shouldHideBillingSummary(s.gateway_id,t.subState.plan.productType)?_="":r&&t.currentBillingSummary&&t.nextBillingSummary&&t.scheduledSubState.billingSchedule?_=l._("You already paid %(paid_amount)s for your license key, valid until %(exp_date)s. You will be billed %(new_total)s per %(new_period)s, starting %(exp_date)s.").format({paid_amount:m.Cash.formatWithTaxLabels(t.currentBillingSummary.total,t.currentBillingSummary),exp_date:t.formattedNextBillingDate,new_total:m.Cash.formatWithTaxLabels(t.nextBillingSummary.total,t.nextBillingSummary),new_period:t.scheduledSubState.billingSchedule.scheduleDescriptionNoun}):t.currentBillingSummary&&t.subState.billingSchedule&&(_=l._("%(total)s per %(period)s.").format({total:m.Cash.formatWithTaxLabels(t.currentBillingSummary.total,t.currentBillingSummary),period:t.subState.billingSchedule.scheduleDescriptionNoun})),s&&!u.shouldHideBillingChange(s.gateway_id,s.is_external_billing)){var y="";if(this.pendingScheduledChange()&&t.scheduledSubState&&t.scheduledSubState.plan&&t.scheduledSubState.billingSchedule){var b=t.scheduledSubState.plan,S=n.purchased&&!n.scheduled_to_remove?" + "+l._("extended version history"):"",v=void 0;v=1024===b.specQuotaGb?l._("Dropbox %(plus)s%(evh)s").format({plus:t.scheduledSubState.plan.displayName(!1),evh:S}):l._("%(plus)s%(evh)s").format({plus:t.scheduledSubState.plan.displayName(!0),evh:S}),y=l._("Starting on %(date)s, we’ll bill you once a %(new_period_noun)s for your %(plan)s plan. Your new %(new_period_adj)s total will be %(new_amount)s.").format({date:t.formattedNextBillingDate,new_period_noun:t.scheduledSubState.billingSchedule.scheduleDescriptionNoun,plan:v,new_period_adj:t.scheduledSubState.billingSchedule.scheduleDescriptionAdjective,new_amount:m.Cash.formatWithTaxLabels(t.nextBillingSummary.total,t.nextBillingSummary)})}else y=l._("Your %(plan)s plan will renew on %(date)s. %(billing_summary)s").format({plan:p,date:t.formattedNextBillingDate,billing_summary:_});f=i.createElement("span",null,y)}d&&(f=i.createElement("span",null,l._("Your %(plan)s will downgrade to Dropbox Basic on %(date)s.").format({plan:p,date:t.formattedNextBillingDate}))),a&&(g=i.createElement("p",{className:"plan-status-section__team_desc"},l._("You’re a member of the %(team_name)s Dropbox account.").format({team_name:o.get_viewer().team_name})));var E;return!s||u.shouldHideBillingChange(s.gateway_id,s.is_external_billing)||this.isInStandardSchedule()||(E=this.renderContactSupportLink()),c.ACCOUNT_TAURUS_PLANS&&this.shouldDisplayChangePlan()&&this.isInStandardSchedule()&&(this.isPlusPlan()&&!this.isTrialPlan()&&(E=i.createElement("div",{className:"plan-status-section__upgrade_btn"},i.createElement("button",{className:"button-primary",onClick:this.openChangePlanModal},l._("Change plan")))),this.isProfessionalPlan()&&!this.isTrialPlan()&&(E=i.createElement("div",{className:"plan-status-section__upgrade_btn"},i.createElement("button",{className:"button-tertiary",onClick:this.openChangePlanModal},l._("Change plan"))))),(this.isFreePlusPlan()||r)&&(E=this.renderContactSupportLink()),i.createElement("div",{className:"plan-status-section"},this.renderDropboxLogo(),i.createElement("div",{className:"plan-status-section__description"},i.createElement("h1",{className:"plan-status-section__title"},p),g,i.createElement("p",{className:"plan-status-section__title_description"},f," ",i.createElement("a",{className:"plan-status-section__link",onClick:this.logSeePlanDetails,href:this.plansURL,target:"_blank",rel:"noopener noreferrer"},this.isTaurusPlan()?l._("See plan details"):l._("See available plans")),i.createElement("br",null),this.renderBillingPeriod())),E)}},t.prototype.renderTrialSection=function(){var e=this.props,t=e.subStatus,n=e.paymentInfo;if(t&&t.subState&&t.subState.plan&&n){var a=n.gateway_id,r=n.trial_info;if(r){var o=i.createElement("noscript",null);u.isIOS(a)||(o=this.createTrialCtaButtons(!r.is_trial_overdue));var s=l._("Dropbox %(plus)s").format({plus:t.subState.plan.displayName(!1,!1,a)});return r.is_trial_overdue&&(s+=" "+l._("(Expired)")),i.createElement("div",{className:"plan-status-section"},this.renderDropboxLogo(),i.createElement("div",{className:"plan-status-section__description"},i.createElement("h1",{className:"plan-status-section__title"},s),i.createElement("p",{className:"plan-status-section__title_description"},u.getTrialDescription(a,r))),o)}}},t.prototype.renderLicensePlanSection=function(){var e=this.props.subStatus;if(!e||!e.subState||!e.subState.plan)return i.createElement("noscript",null);var t=l._("Dropbox %(plus)s").format({plus:e.subState.plan.displayName()}),n=l._("Your Dropbox %(plus)s plan was activated with a license key. The plan is active until %(date)s.").format({plus:E.TRADEMARK_PLUS,date:e.formattedNextBillingDate}),a=l._("You can add your payment information now to have your subscription automatically renew when it expires."),r=i.createElement("a",{href:"#",onClick:this.addPaymentClick},l._("Add payment method."));return i.createElement("div",{className:"plan-status-section"},this.renderDropboxLogo(),i.createElement("div",{className:"plan-status-section__description"},i.createElement("h1",{className:"plan-status-section__title"},t),i.createElement("p",{className:"plan-status-section__title_description"},n,i.createElement("br",null),a,i.createElement("br",null),r,i.createElement("br",null))))},t.prototype.render1TBChangeablePlan=function(){var e=this.props,t=e.subStatus,n=e.paymentInfo,a=e.scheduledForDowngrade;if(!t||!t.subState||!t.subState.plan)return i.createElement("noscript",null);var r=t.subState.plan.displayName(!0),o="";t.subState.billingSchedule&&t.subState.billingSchedule.scheduleDescriptionNoun&&t.currentBillingSummary&&t.currentBillingSummary.total&&(o=l._("%(total)s per %(period)s.").format({total:m.Cash.formatWithTaxLabels(t.currentBillingSummary.total,t.currentBillingSummary),period:t.subState.billingSchedule.scheduleDescriptionNoun}));var s=i.createElement("noscript",null);if(n&&!u.shouldHideBillingChange(n.gateway_id,n.is_external_billing)){var c=l._("Your %(plan)s plan will renew on %(date)s. %(billing_summary)s").format({plan:r,date:t.formattedNextBillingDate,billing_summary:o});s=i.createElement("span",null,c)}a&&(s=i.createElement("span",null,l._("Your %(plan)s will downgrade to Dropbox Basic on %(date)s. %(billing_summary)s").format({plan:r,date:t.formattedNextBillingDate,billing_summary:o})));var d=this.renderContactSupportLink();return i.createElement("div",{className:"plan-status-section"},this.renderDropboxLogo(),i.createElement("div",{className:"plan-status-section__description"},i.createElement("h1",{className:"plan-status-section__title"},r),i.createElement("p",{className:"plan-status-section__title_description"},s,i.createElement("br",null),this.renderBillingPeriod())),d)},t.prototype.renderPlanSection=function(){var e=this.props,t=e.subStatus,n=e.isExternallyBilled,a=e.paymentInfo,r=e.isLimitedTeam;return e.eligibleFor1tb?this.render1TBChangeablePlan():n&&void 0!==a&&null!==a.reseller_name?this.renderResellerPlan():n&&r&&void 0!==a&&a.gateway_id===d.NOT_APPLICABLE?void 0:t&&t.subState.plan&&t.subState.plan.productFamily===S.ProductFamily.PRO?this.isPlusTrialPlan()?this.renderTrialSection():this.isLicensePlan()?this.renderLicensePlanSection():this.renderPaidPlanSection():this.renderBasicPlanSection()},t.prototype.render=function(){var e=this.props,t=e.isPersonalUser,n=e.isLimitedTeam,a=t||n?this.renderPlanSection():this.renderBusinessPlanSection();return i.createElement("div",{className:"plan-status"},a)},t})(i.Component);t.PlanStatus=T}),define("modules/clean/account_page/widgets/plan/views/quota_usage",["require","exports","tslib","external/react","external/classnames","modules/clean/react/css","modules/clean/viewer","modules/core/i18n","modules/clean/display_format","modules/clean/react_format","modules/constants/trademark"],function(e,t,n,a,r,i,o,s,l,c,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),Object.defineProperty(t.prototype,"teamName",{get:function(){return o.get_viewer().team_name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"freeSpace",{get:function(){var e=this.props.usageBreakdown;return e.quota-e.usage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sharedFles",{get:function(){return this.props.usageBreakdown.shared_usage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"regularFles",{get:function(){return this.props.usageBreakdown.unshared_usage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"usage",{get:function(){return this.props.usageBreakdown.usage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"quota",{get:function(){return this.props.usageBreakdown.quota||.01},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isNearQuota",{get:function(){return this.usage>.9*this.quota},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isOverQuota",{get:function(){return this.usage>this.quota},enumerable:!0,configurable:!0}),t.prototype.getQuotaUpsell=function(){var e=this.props,t=e.subStatus,n=e.isPersonalUser,r=e.isLimitedTeam,i=e.isMSLTeamMember;if(t)return n||r?!t.subState.plan&&this.isOverQuota?a.createElement("div",{className:"quota-upsell"},s._("With %(plan)s, get 1 TB (1,000 GB) for all your photos, videos, docs and other files. Keep everyting stored safely and at your fingertips.").format({plan:u.TRADEMARK_PLUS})," ",a.createElement("a",{href:"/upgrade?oqa=acc_plan_upgrade_overquota_link"},s._("Upgrade now"))):void 0:i?this.isOverQuota?a.createElement("div",{className:"quota-upsell"},s._("Your Dropbox account is full. To continue, remove files or ask your admin for\n more space. "),a.createElement("a",{href:"/help/business/space-limit-full"},s._("Learn more about Dropbox space"))):void 0:a.createElement("div",{className:"quota-upsell"},s._("When your team runs out of quota, accounts will stop syncing and you won’t be able to add any new files. Contact your admin to upgrade your team to an Advanced plan."))},t.prototype.render=function(){var e=this.props,t=e.isPersonalUser,n=e.isLimitedTeam,i=e.isMSLTeamMember,o="",u=c.reactFormat(s._("Using %(usage)s of %(quota)s").format({usage:l.format_bytes(this.usage),quota:l.format_bytes(this.quota)}),{strong:a.createElement("strong",{key:"quota-strong"})});o=t||n?this.isOverQuota?s._("Your Personal Dropbox account is full"):s._("Personal Dropbox space"):i?this.isOverQuota?s._("Your Dropbox account space is full"):s._("Your Dropbox account space"):this.isOverQuota?s._("Your %(team_name)s account is full").format({team_name:this.teamName}):s._("%(team_name)s — space").format({team_name:this.teamName});var d=100*this.regularFles/this.quota,p=d>100?"100":d.toFixed(20),m=p+"%",h=100*this.sharedFles/this.quota,_=h>100?"100":h.toFixed(20),f=_+"%",g={width:m},y={width:f},b=r({"account-plan-tab-quota-usage":!0,"is-within-quota":!this.isOverQuota,"is-over-quota":this.isOverQuota}),S=r({"bar-graph-part":!0,"bar-graph-normal":!0,"normal-color":!0,"is-zero":0===this.usage}),v=r({"bar-graph-part":!0,"bar-graph-shared":!0,"bar-shared-color":!0,"is-zero":0===this.sharedFles}),E=r({"bar-graph-legend":!0,"bar-graph-normal":!0,"normal-color":!0}),T=r({"bar-graph-legend":!0,"bar-graph-shared":!0,"shared-color":!0}),P=this.getQuotaUpsell(),C=this.isOverQuota?void 0:a.createElement("div",{className:"bar-graph-legend-group"},a.createElement("div",{className:"bar-graph-legend bar-graph-free"}),a.createElement("span",{className:"bar-graph-key-text"},s._("Unused space")," (",l.format_bytes(this.freeSpace),")"));return a.createElement("div",{className:b},a.createElement("div",{className:"quota-header"},a.createElement("span",{className:"quota-header quota-header__plan"},o),a.createElement("span",{className:"quota-header quota-header__usage"},u)),a.createElement("div",{className:"quota-space-bar"},a.createElement("div",{className:"bar-graph"},a.createElement("div",{className:S,style:g}),a.createElement("div",{className:v,style:y}))),a.createElement("div",{className:"quota-space-legend"},a.createElement("div",{className:"bar-graph-key"},a.createElement("div",{className:"space-key"},a.createElement("div",{className:"bar-graph-legend-group"},a.createElement("div",{className:E}),a.createElement("span",{className:"bar-graph-key-text"
},s._("Regular files")," (",l.format_bytes(this.regularFles),")")),a.createElement("div",{className:"bar-graph-legend-group"},a.createElement("div",{className:T}),a.createElement("span",{className:"bar-graph-key-text"},s._("Shared files")," (",l.format_bytes(this.sharedFles),")")),C))),P)},t})(a.Component);t.QuotaUsage=i(d,["/static/css/account/pagelet/quota_usage-vflLctkHe.css"])}),define("modules/clean/account_page/widgets/plan/views/referral_space",["require","exports","tslib","modules/core/browser","external/react","modules/clean/react/css","modules/core/i18n","modules/clean/account_page/util","modules/clean/account_page/widgets/plan/referral_history/api","modules/clean/static_urls","modules/clean/account_page/components/account_table","modules/clean/account_page/components/button_block","modules/clean/analytics"],function(e,t,n,a,r,i,o,s,l,c,u,d,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var m=(function(e){function t(t){var a=e.call(this,t)||this;return a.buildReferralHistoryIfNecessary=function(){var e=a.state.history;if(null!==e&&null!==e.rows&&0!==e.rows.length)return r.createElement("div",{className:"referral-table-container"},r.createElement(u.Table,{className:"referral-table"},r.createElement(u.TableHead,null,r.createElement(u.HeaderRow,{className:"referral-header-row"},r.createElement(u.HeaderCell,{className:"referral-bonus-type-header"},o._("Bonus type")),r.createElement(u.HeaderCell,{className:"referral-description-header"}),r.createElement(u.HeaderCell,{className:"referral-updated-header"},o._("Updated")),r.createElement(u.HeaderCell,{className:"referral-earned-header"},o._("Space earned")))),r.createElement(u.TableFooter,{className:"referral-footer"},a.buildReferralFooter()),r.createElement(u.TableBody,null,e.rows.map(function(e,t){if(a.state.showMore||!(t>2))return a.buildReferralRow(e)}))))},a.loadMoreReferralHistory=function(e){return n.__awaiter(a,void 0,void 0,function(){var t;return n.__generator(this,function(n){switch(n.label){case 0:return this.setState({isLoading:!0}),p.ProEventsLogger.log("de_earn_space_view_more_click"),e.preventDefault(),this.state.showMore?[4,l.getReferralHistory(s.getCurrentUser().id,this.state.currentPage+1)]:(this.setState({showMore:!0,isLoading:!1}),[2,!1]);case 1:return t=n.sent(),t.rows=this.state.history.rows.concat(t.rows),this.setState({currentPage:this.state.currentPage+1,history:t,isLoading:!1}),[2,!1]}})})},a.buildReferralFooter=function(){var e=a.state.history;if(a.state.isLoading)return r.createElement("tr",{className:"referral-footer-row"},r.createElement("td",{colSpan:4},r.createElement("img",{src:c.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:o._("Loading")})));if(!(!a.state.showMore&&e.rows.length<3||a.state.showMore&&!e.has_more))return r.createElement("tr",{className:"referral-footer-row"},r.createElement("td",{colSpan:4},r.createElement("a",{onClick:a.loadMoreReferralHistory,href:"#",rel:"noopener noreferrer"},o._("View more earned space"))))},a.buildReferralRow=function(e){var t=null,n=null;return t=e.type.url?r.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:e.type.url},e.type.str):r.createElement("span",null,e.type.str),n=e.earned.completed?r.createElement("div",null,r.createElement("span",{className:"earned-space"},e.earned.str),r.createElement("img",{src:c.static_url("/static/images/icon_checkmark-vflExOh3Y.png"),alt:""})):e.earned.url?r.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:e.earned.url},e.earned.str):r.createElement("span",null,e.earned.str),r.createElement(u.BodyRow,{className:"referral-body-row",key:e.details+e.updated},r.createElement(u.BodyCell,{className:"referral-bonus-type"},t),r.createElement(u.BodyCell,{className:"referral-description"},e.details),r.createElement(u.BodyCell,{className:"referral-updated"},e.updated),r.createElement(u.BodyCell,{className:"referral-earned"},n))},a.state={history:a.props.referralHistory,showMore:!1,isLoading:!1,currentPage:0},a}return n.__extends(t,e),t.prototype.buildInvitePhrase=function(e){return o._("You can earn more space by referring your friend to Dropbox! You’ll get a %(referral_amount)s bonus when they install Dropbox on their computer.").format({referral_amount:e})},t.prototype.isLoading=function(){return"ready"!==this.props.referralLoadingState},t.prototype.inviteFriendClick=function(){p.ProEventsLogger.log("de_earn_space_invite_click"),a.redirect("/referrals")},t.prototype.render=function(){if(this.isLoading())return r.createElement("div",{className:"loading-indicator"},r.createElement("img",{src:c.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:o._("Loading")}));var e=this.props.referralInfo;return r.createElement("div",{className:"referral-space"},r.createElement(d.ButtonBlock,{label:o._("Earn more space (%(current_space)s earned)").format({current_space:e.currentSpace}),subtext:this.buildInvitePhrase(e.referralAmount),buttonText:o._("Invite a friend"),kind:"secondary",buttonAction:{kind:"function",handler:this.inviteFriendClick}}),this.buildReferralHistoryIfNecessary())},t})(r.Component);t.ReferralSpace=i(m,["/static/css/account/pagelet/referral_space-vflqD-0ia.css"])}),define("modules/clean/auth/cyfd_init",["require","exports","modules/constants/login_and_register"],function(e,t,n){"use strict";var a=[];a.push(["_setJsPost",!1]),a.push(["_setJavaScriptKey",n.CYBEFEND_KEY]);var r=0;r=Date.now?Date.now():+new Date,a.push(["_setInitTime",r]),a.push(["_setEnReadDocUrl",!1]);var i=window.location.pathname;return["/","/login","/register"].includes(i)||a.push(["_setDisFpCalOnTimeout",1]),a}),function(){var e=function(e,t){return function(){return e.apply(t,arguments)}};define("modules/clean/payments/billing_info_base",["jquery","modules/clean/payments/cash","modules/clean/payments/pro_util","modules/clean/payments/payment_form_events","modules/core/controller_helpers"],function(t,n,a,r,i){var o,s,l,c,u;return s=n.Cash,l=n.CashUtil,u=a.TransitionInfoFetcher,c=a.TaxHelper,o=(function(){function n(t,n,a,r){this.$container=t,this.country_to_currency_map=n,this.transition_view_models=a,this.countryToTaxNameMap=r,this._recompute_costs_from_tvm=e(this._recompute_costs_from_tvm,this),this._recompute_costs=e(this._recompute_costs,this),this._display_tax=e(this._display_tax,this),this.updateForm=e(this.updateForm,this),this.getCurrentTransitionViewModel=e(this.getCurrentTransitionViewModel,this),this._getCurrency=e(this._getCurrency,this),this.listen_tax=e(this.listen_tax,this),this.transition_info_fetcher=new u(this.transition_view_models),this.payment_form=i.get_controller(this.$container.find(".payment-form-component")),this.hasTax=null!=this.countryToTaxNameMap,this.transition_view_models&&(this.transition_view_model=this.transition_view_models[0]),this.listen_tax()}return n.prototype.listen_tax=function(){if(this.hasTax)return this.$container.on(r.LOCATION_CHANGE_EVENT,(function(e){return function(t,n){if(t.stopPropagation(),c.require_recompute(e.get_country_code(),e.get_zip_code()))return e.updateForm()}})(this))},n.prototype.get_zip_code=function(){return this.$container.find('input:visible[name="zip"]').val()},n.prototype.get_country_code=function(){return this.$container.find('[name="country_code"]').val()},n.prototype._getCountryTaxName=function(e){return this.countryToTaxNameMap[e]||this.countryToTaxNameMap.Other},n.prototype._getCurrency=function(){var e,t;return e=this.payment_form.get_country_code(),null!=(t=this.country_to_currency_map)?t[e]:void 0},n.prototype.getCurrentTransitionViewModel=function(){return this.transition_view_model},n.prototype.updateForm=function(){return this._recompute_costs()},n.prototype._display_tax=function(){return c.display_tax(this.get_country_code())?(t(".tax-row").removeClass("hidden_elem"),t(".tax-name-wrapper").text(this._getCountryTaxName(this.get_country_code())),!0):(t(".tax-row").addClass("hidden_elem"),!1)},n.prototype._recompute_costs=function(){var e;return e={zip:this.get_zip_code(),country_code:this.get_country_code()},this.transition_info_fetcher.get(this._recompute_costs_from_tvm,e,!0)},n.prototype._recompute_costs_from_tvm=function(e){var n,a,r,i,o,u,d,p,m,h,_,f,g;if(e)return this.transition_view_model=e,a=this._getCurrency(),this.$container.find(".currency-wrapper").text(a),_=c.compute_tax(e.read_only_invoice,a),p=_[0],n=_[1],f=_[2],r=l.formatCurrency(p.amount,p.currency),this.$container.find(".price-amount-wrapper").text(r),e.rebill&&(m=s.fromObject(e.rebill.total),i=l.formatCurrency(m.amount,m.currency),this.$container.find(".rebill-amount-wrapper").text(i)),e.state.total_recurring_price&&(h=s.fromObject(e.state.total_recurring_price),o=l.formatCurrency(h.amount,h.currency),this.$container.find(".rebill-price-wrapper").text(o)),g=this._getTotalAmount(e),d=l.formatCurrency(g.amount,g.currency),this.$container.find(".total-amount-wrapper").text(d),t(".tax-row").toggleClass("hidden_elem",this._display_tax()),u=l.formatCurrency(f.amount,f.currency),t(".tax-amount-wrapper").text(u),[p,n,f,m,a]},n})(),{BillingInfoModalBase:o}})}.call(this),function(){var e=function(e,t){return function(){return e.apply(t,arguments)}},t=function(e,t){function a(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype,e},n={}.hasOwnProperty,a=[].indexOf||function(e){for(var t=0,n=this.length;t=0)return t[o]=i.val()}),s=e.payment_form.get_selected_payment_method_id(),i=e.payment_link_map[s],"extra_params"in i&&(n=i.extra_params,r.extend(t,n)),i.use_form_post?e._postRequest(new o({path:i.endpoint}),t):new u(e.$container,i.endpoint,{data:t,success:function(e){if(e.data&&e.data.success)return g.log("update_billing_open_save_changes_success"),f.trigger(l.BILLING_INFO_UPDATED),f.pop()}})})}})(this)),this.payment_form.$container.on(c.PAYMENT_METHOD_TYPE_CHANGE_EVENT,this._update_disclaimer),null!=this.transition_view_models&&this.updateForm()}return t(l,s),l.BILLING_INFO_UPDATED="billing_info_modal:updated",l.prototype._postRequest=function(e,t){var a,r,o;t.t=i.read("__Host-js_csrf"),r=document.createElement("form"),r.action=e,r.method="POST",document.body.appendChild(r);for(o in t)n.call(t,o)&&(a=document.createElement("input"),a.type="hidden",a.name=o,a.value=t[o],r.appendChild(a));return r.submit()},l.prototype._update_disclaimer=function(e,t){return t=parseInt(t,10),this.$container.find(".payment-method-disclaimer").each(function(e,n){var a;return a=r(n).data("payment-method-id"),r(n).toggleClass("hidden",a!==t)})},l.prototype._getTotalAmount=function(e){return _.fromObject(e.read_only_invoice.total)},l})(h)})}.call(this),define("modules/clean/payments/cash",["require","exports","modules/core/i18n"],function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=(function(){function e(){}return e.set_locale_number_format=function(t,n,a){void 0===t&&(t=","),void 0===n&&(n="."),void 0===a&&(a="-"),e.groupSymbol=t,e.decimalSymbol=n,e.minusSignSymbol=a},e.set_currency_format_map=function(t){e.currencyFormatMap=t},e.update_currency_format_map=function(t,n){e.currencyFormatMap[t]=n},e.formatAmountThousandsHelper=function(t){var n=Math.abs(parseInt(t,10)).toFixed(0).toString();if(n.length<=3)return n;var a=n.substr(0,n.length-3);return e.formatAmountThousandsHelper(a)+e.groupSymbol+n.substr(n.length-3)},e.roundCurrency=function(t,n,a){return void 0===n&&(n="USD"),void 0===a&&(a=2),a=t%1===0?0:a,e.formatCurrency(t,n,a)},e.formatCurrency=function(t,n,a){void 0===n&&(n="USD"),void 0===a&&(a=2);var r=parseFloat(t);"JPY"===n&&(a=0);var i=e.formatNumber(r,a);return e.currencyFormatMap[n]?e.currencyFormatMap[n].replace("%v",i):i+" "+n},e.splitFormatCurrency=function(t,n,a){void 0===n&&(n="USD"),void 0===a&&(a=2);var r=e.formatCurrency(t,n,a),i=r.indexOf(e.decimalSymbol);return i===-1?[r,""]:[r.slice(0,i+1),r.slice(i+1)]},e.formatNumber=function(t,n){void 0===n&&(n=2);var a=t<0?e.minusSignSymbol:"",r="";return n>0&&(r=e.decimalSymbol+t.toFixed(n).split(".")[1]),a+e.formatAmountThousandsHelper(t)+r},e.removeFormatting=function(t,n){var a=e.currencyFormatMap[n],r=a.replace("%v","");return t.replace(r,"").replace(e.groupSymbol,"")},e.groupSymbol=",",e.decimalSymbol=".",e.minusSignSymbol="-",e.currencyFormatMap={USD:"$%v"},e})();t.CashUtil=a;var r=(function(){function e(e,t){this.cash1=e,this.cash2=t}return e})();t.CashCurrenciesDoNotMatch=r;var i=(function(){function e(){}return e})();t.CashNeedsAmountAndCurrency=i;var o=(function(){function e(e,t){this.currency=t;var n=parseFloat(""+e);if(isNaN(n)||!this.currency)throw new i;var a=Math.pow(10,2);this.amount=Math.round(n*a)/a}return e.fromObject=function(t){return new e(parseFloat(t.amount),t.currency)},e.fromString=function(t,n){return new e(a.removeFormatting(t,n),n)},e.prototype.add=function(t){if(this.currency!==t.currency)throw new r(this,t);return new e(this.amount+t.amount,this.currency)},e.prototype.subtract=function(t){return this.add(new e(-t.amount,t.currency))},e.prototype.multiply=function(t){return new e(this.amount*t,this.currency)},e.prototype.divide=function(t){return new e(this.amount/t,this.currency)},e.prototype.round=function(t){void 0===t&&(t=2);var n=Math.pow(10,t);return new e(Math.round(this.amount*n)/n,this.currency)},e.prototype.toString=function(e){return void 0===e&&(e=2),"JPY"===this.currency&&(e=0),a.roundCurrency(this.amount,this.currency,e)},e.prototype.formatCurrency=function(e){return void 0===e&&(e=2),a.formatCurrency(this.amount,this.currency,e)},e.formatWithTaxLabels=function(e,t){return e&&t?t.doesTaxApply?n._("%(price)s (taxes included)").format({price:e.formatCurrency()}):e.formatCurrency():""},e})();t.Cash=o}),define("modules/clean/payments/cvv_hint",["require","exports","tslib","react","modules/core/i18n","modules/clean/static_urls"],function(e,t,n,a,r,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){return a.createElement("div",{className:"cvv-hint-view"},a.createElement("div",null,a.createElement("p",null,r._("Your card code is a 3 or 4 digit number that is found in these locations:",{comment:"card refers to credit card"})),a.createElement("img",{src:i.static_url("/static/images/cvv2-vflQL_5Od.png"),alt:""}),a.createElement("h5",null,r._("Visa/Mastercard",{comment:"Credit card types"})),a.createElement("p",null,r._("The security code is a 3 digit number on the back of your credit card. It immediately follows your main card number.")),a.createElement("h5",null,r._("American Express",{comment:"Credit card type"})),a.createElement("p",null,r._("The security code is a 4 digit number on the front of your card, just above and to the right of your main card number."))))},t})(a.Component);t.CvvHint=o}),define("modules/clean/payments/cvv_hint_container",["require","exports","tslib","react","modules/clean/payments/cvv_hint","modules/clean/react/css","modules/clean/react/tooltip"],function(e,t,n,a,r,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.setTooltipRef=function(e){t.tooltipRef=e},t.showTooltip=function(){t.tooltipRef._show()},t.hideTooltip=function(){t.tooltipRef._hide()},t}return n.__extends(t,e),t.prototype.render=function(){var e=this.props.targetDimensions;return a.createElement("div",{className:"cvv-hint-container"},a.createElement("div",{style:{left:e.left,top:e.top}},a.createElement(o.Tooltip,{position:o.TooltipPosition.BOTTOM,tooltip_contents:a.createElement(r.CvvHint,null),ref:this.setTooltipRef},a.createElement("div",{style:{width:e.width,height:e.height}}))))},t})(a.Component);t.CvvHintContainerView=s,t.CvvHintContainer=i(s,["/static/css/payments/cvv_hint_container-vflUKKjdo.css"])}),define("modules/clean/payments/payment_form/iframe_rpc",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFrameRpc={DATA:"DATA",FOCUS_OUTSIDE_IFRAME:"FOCUS_OUTSIDE_IFRAME",HIDE_TOOLTIP:"HIDE_TOOLTIP",INIT_BRAINTREE:"INIT_BRAINTREE",READY:"READY",SHOW_CVV_MODAL:"SHOW_CVV_MODAL",SHOW_FORM_ERRORS:"SHOW_FORM_ERRORS",SHOW_TOOLTIP:"SHOW_TOOLTIP",STATUS_UPDATE:"DATA_STATUS_UPDATE",TOKENIZE:"TOKENIZE",TOKENIZED:"TOKENIZED",VALIDATION_FAILED:"VALIDATION_FAILED",VALIDATION_UPDATE:"VALIDATION_UPDATE",WIDTH_UPDATE:"WIDTH_UPDATE"};var n=(function(){function e(e,n){var a=this;this.origin=e,this.handler=n,this.messageHandler=function(e){if(a.origin===e.origin){var n;try{n=JSON.parse(e.data)}catch(e){return}if(n.hasOwnProperty("action")){var r=n.action,i=n.DATA;switch(r){case t.IFrameRpc.READY:a.handler.originReady&&a.handler.originReady(e.source);break;case t.IFrameRpc.TOKENIZE:a.handler.tokenize&&a.handler.tokenize();break;case t.IFrameRpc.HIDE_TOOLTIP:i&&i.tooltipId&&a.handler.hideTooltip&&a.handler.hideTooltip(i.tooltipId);break;case t.IFrameRpc.INIT_BRAINTREE:i&&i.token&&a.handler.init_bt&&a.handler.init_bt(i.token);break;case t.IFrameRpc.TOKENIZED:i&&i.nonce&&a.handler.submitTokenized&&a.handler.submitTokenized(i.nonce,i.bin);break;case t.IFrameRpc.SHOW_CVV_MODAL:a.handler.showCvvModal&&a.handler.showCvvModal();break;case t.IFrameRpc.SHOW_TOOLTIP:i&&i.tooltipId&&i.tooltipTarget&&a.handler.showTooltip&&a.handler.showTooltip(i.tooltipId,i.tooltipTarget);break;case t.IFrameRpc.FOCUS_OUTSIDE_IFRAME:a.handler.focusOutsideIframe&&a.handler.focusOutsideIframe();break;case t.IFrameRpc.STATUS_UPDATE:a.handler.handleDataStatusUpdate&&a.handler.handleDataStatusUpdate(i);break;case t.IFrameRpc.VALIDATION_FAILED:a.handler.handleValidationFailure&&a.handler.handleValidationFailure(i);break;case t.IFrameRpc.VALIDATION_UPDATE:a.handler.handleValidationUpdate&&a.handler.handleValidationUpdate(i);break;case t.IFrameRpc.WIDTH_UPDATE:a.handler.handleWidthUpdate&&a.handler.handleWidthUpdate(i)}}}},window.addEventListener("message",this.messageHandler)}return e.prototype.removeMessageListener=function(){window.removeEventListener("message",this.messageHandler)},e})();t.IFrameRpcListener=n;var a=(function(){function e(e,t){this.origin=e,this.target=t}return e.prototype.sendMessage=function(e,t){var n={action:e};t&&(n.DATA=t),this.target.postMessage(JSON.stringify(n),this.origin)},e})();t.IFrameRpcTransport=a}),define("modules/clean/payments/payment_form/payment_form_spec",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});(function(e){e[e.CreditCard=1]="CreditCard",e[e.PayPal=2]="PayPal",e[e.DirectDeposit=3]="DirectDeposit",e[e.Ideal=5]="Ideal"})(t.PaymentMethod||(t.PaymentMethod={}));var n=(function(){function e(e){this.spec=e}return e.prototype.available_payment_methods_for_country=function(e){return this.spec.available_payment_methods_overrides_by_country[e]?this.spec.available_payment_methods_overrides_by_country[e]:this.spec.default_available_payment_methods},e.prototype.default_payment_method_for_country=function(e){return this.available_payment_methods_for_country(e)[0]},e.prototype.supported_credit_cards_for_country=function(e){return this.spec.supported_credit_cards_overrides_by_country[e]?this.spec.supported_credit_cards_overrides_by_country[e]:this.spec.default_supported_credit_cards},e.prototype.should_show_vat_for_country=function(e){return this.spec.countries_with_vat.indexOf(e)>-1},e.prototype.allow_zip_code_for_country=function(e){return this.spec.countries_without_zip_code.indexOf(e)===-1},e.prototype.filter_payment_methods_by_price_limit=function(e,t){for(var n=[],a=this.spec.price_limit_for_payment_methods,r=0,i=e;r-1&&n.push(o):n.push(o)}return n},e})();t.PaymentFormSpec=n}),function(){define("modules/clean/payments/payment_form_events",[],function(){return(function(){function e(){}return e.LOCATION_CHANGE_EVENT="db:paymentform:countrycodechanged",e.ZIP_CHANGE_EVENT="db:paymentform:zipchanged",e.PAYMENT_METHOD_TYPE_CHANGE_EVENT="db:paymentform:paymentmethodtypechanged",e.VAT_CHANGE_EVENT="db:paymentform:vatchanged",e.UNVALIDATED="db:paymentform:unvalidated",e.VALIDATE_ERROR="db:paymentform:validateerror",e.VALIDATE_SUCCESS="db:paymentform:validatesuccess",e.LOADED_EVENT="db:paymentform:loaded",e.IFRAME_LOADED_EVENT="db:paymentform:iframeloaded",e.IFRAME_FIELDS_STATUS_EVENT="db:paymentform:iframefieldsstatusevent",e.TRANSITION_FETCHED="db:paymentform:transitionfetched",e.EDIT_SIMPLE_COUNTRY_CLICK_EVENT="db:paymentform:editsimplecountry",e})()})}.call(this),function(){var e=function(e,t){return function(){return e.apply(t,arguments)}};define("modules/clean/payments/pro_util",["external/underscore","modules/clean/ajax","modules/clean/payments/cash","modules/clean/payments/validation","modules/core/exception"],function(t,n,a,r,i){var o,s,l;return o=a.Cash,i.assert,s=(function(){function e(){}return e.compute_tax=function(e,t){var n,a,r,i,s,l,c,u,d;for(l=null,a=null,d=new o(0,t),u=e.line_items,r=0,i=u.length;r0)return this._skus[0]},e.prototype.contains=function(e){for(var t=0;t0)setTimeout(function(){n.fetchBraintreeToken(e,t)},2e3);else{var o=JSON.stringify(a.status)+", "+a.statusText+", "+a.readyState,s="ajax /braintree_token failed: "+o;l.reportException({err:new Error(s),severity:l.SEVERITY.CRITICAL,tags:["fetch_braintree_token_failed"]}),t.reject(i)}};return o.BackgroundRequest({url:"/payments/braintree_token",success:a,error:r}),t.promise},t.prototype.pingIframe=function(){var e=this;this.iframeReady||(this.pingTimeoutLogged||(this.firstPing?(new Date).getTime()-this.firstPing>6e4&&(l.reportException({err:new Error("PCI iFrame timeout"),severity:l.SEVERITY.NONCRITICAL,tags:["iframe_ping_timeout"]}),this.pingTimeoutLogged=!0):this.firstPing=(new Date).getTime()),this.iframeMessageTransport.sendMessage(p.IFrameRpc.READY),setTimeout(function(){e.pingIframe()},250))},t.prototype.showCvvModal=function(){},t.prototype.showFormErrors=function(){this.isSeleniumChangesTest()||this.iframeMessageTransport.sendMessage(p.IFrameRpc.SHOW_FORM_ERRORS)},t.prototype.focusOutsideIframe=function(){},t.prototype.handleValidationFailure=function(e){this.tokenizing=!1,this.tokenizeDeferred.resolve(!1)},t.prototype.handleDataStatusUpdate=function(e){},t.prototype.handleValidationUpdate=function(e){this.props.actions.updateNonce(this.props.nonce.rawValue,e),this.props.actions.updateBIN&&this.props.bin&&this.props.actions.updateBIN(this.props.bin.rawValue)},t.prototype.handleWidthUpdate=function(e){this.props.actions.updateIframeWidth&&this.props.actions.updateIframeWidth(!!e.isNarrow)},t})(r.Component);t.CreditCardFrame=h}),define("modules/clean/react/payments/checkout/components/payment_method_form/direct_debit_form",["require","exports","tslib","external/react","modules/clean/react/payments/common/form_value_helpers","modules/clean/react/payments/checkout/components/inputs/labeled_text_input","modules/clean/react/payments/checkout/components/inputs/labeled_checkbox_input","modules/core/i18n","modules/clean/react/sprite_div","modules/clean/react/tooltip"],function(e,t,n,a,r,i,o,s,l,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=c.Tooltip,d=c.TooltipPosition,p=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.onAccountHolderNameChange=function(e){this.props.actions.updateAccountHolderName(e.value)},t.prototype.onIBANChange=function(e){this.props.actions.updateIBAN(e.value)},t.prototype.onMandateSignedChange=function(e){this.props.actions.updateMandateSigned(e.checked)},t.prototype.accountHolderNameErrorString=function(){var e=this.props.formData.accountHolderName;return!r.FormValueHelper.isValid(e)&&e.showError?s._("Please enter the account holder’s name."):""},t.prototype.ibanErrorString=function(){var e=this.props.formData.iban;return!r.FormValueHelper.isValid(e)&&e.showError?s._("Please enter a valid bank account number."):""},t.prototype.mandateSignedErrorString=function(){var e=this.props.formData.mandateSigned;return!r.FormValueHelper.isValid(e)&&e.showError?s._("Please agree to the SEPA mandate terms by clicking on this check box."):""},t.prototype.renderIBANLabel=function(){var e=a.createElement(l,{group:"web",name:"info"}),t=s._("An International Bank Account Number (IBAN) is a unique identification code for a bank account. It’s made up of a two-letter country code and up to 30 alphanumeric characters. Check your bank statements or ask your bank for your IBAN."),n=a.createElement(u,{tooltip_classname:"iban-label-tooltip-bubble",position:d.RIGHT,tooltip_contents:t},e);return a.createElement("span",{className:"grid__item grid--y-middle"},s._("IBAN"),n)},t.prototype.render=function(){var e=this.props.formData,t=s._("I hereby authorize Dropbox International Unlimited Company, and its payment service provider, Adyen Client Management, to collect payments from my account via direct debit. At the same time, I instruct my bank to honor the direct debits drawn on my account. Notice: Within eight weeks, beginning with the debit date, I am entitled to claim a refund of the debited amount. In this case the terms and conditions agreed with my bank shall apply.");return a.createElement("div",{id:"sepa-direct-debit-form",className:"direct-debit-container"},a.createElement("div",{className:"direct-debit-fields"},a.createElement(i.LabeledTextInput,{name:"owner_name",labelText:s._("Account holder name"),value:e.accountHolderName.rawValue,errorText:this.accountHolderNameErrorString(),errorHTML:e.accountHolderName.serverError,onChange:this.onAccountHolderNameChange.bind(this),subgrowthBizUpdateBillingModalMaestro:this.props.subgrowthBizUpdateBillingModalMaestro,individualUpdateBillingModalRefactor:this.props.individualUpdateBillingModalRefactor}),a.createElement(i.LabeledTextInput,{name:"iban",labelText:this.renderIBANLabel(),value:e.iban.rawValue,errorText:this.ibanErrorString(),errorHTML:e.iban.serverError,onChange:this.onIBANChange.bind(this),subgrowthBizUpdateBillingModalMaestro:this.props.subgrowthBizUpdateBillingModalMaestro,individualUpdateBillingModalRefactor:this.props.individualUpdateBillingModalRefactor})),this.props.locationFields,a.createElement(o.LabeledCheckboxInput,{checked:e.mandateSigned.rawValue,className:"billing-mandate-signed",errorHTML:e.mandateSigned.serverError,errorText:this.mandateSignedErrorString(),labelText:t,name:"mandate_signed",onChange:this.onMandateSignedChange.bind(this)}))},t})(a.Component);t.DirectDebitForm=p}),define("modules/clean/react/payments/common/adapters/captcha",["require","exports","external/cyfd","modules/clean/ajax_as_promised","modules/core/i18n","modules/core/notify","modules/core/exception"],function(e,t,n,a,r,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=(function(){function e(){}return e.getSignupSD=function(){var e=document.getElementsByName("signup_sd");if(e.length){var t=e[0];return n.listFunctions._setSDFieldNames(t.id),n.cfsubmit(),t.value}return void o.reportStack("signup_sd element not found buy page",{tags:["cyberfend"]})},e.getRecaptchaChallenge=function(){var e=document.getElementById("recaptcha_challenge_field");return e&&e.value},e.requestCaptcha=function(e){return a.WebRequest({url:"/ajax_needs_business_signup_captcha",data:{email:e}}).then(function(e){try{var t=JSON.parse(e);return{needsCaptcha:t.needs_captcha,recaptchaPublicKey:t.recaptcha_public_key}}catch(e){throw i.error(r._("There was a problem completing this request.")),e}},function(e){var t=e.jqXHR;return Promise.reject(t.statusText)})},e})();t.Captcha=s}),define("modules/clean/react/payments/common/constants",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PricingToggleCookie="pricing-schedule",t.PricingToggleMonthly="monthly",t.PricingToggleAnnual="annual"}),define("modules/clean/react/payments/common/form/actions/actions",["require","exports","jquery","modules/clean/react/payments/common/pricing/actions/actions","modules/clean/deprecated/uirequest","external/underscore","modules/clean/react/payments/common/adapters/captcha","modules/clean/stormcrow/experiment","modules/clean/react/payments/common/form_value_helpers","modules/clean/ajax_as_promised","modules/clean/react/payments/business/state/state","modules/clean/stormcrow/stormcrow_exposure_logger"],function(e,t,n,a,r,i,o,s,l,c,u,d){"use strict";function p(e,t,n,a){return void 0===a&&(a={}),function(r,i){ee(i().formData,t)?n().then(function(n){n&&m(r,e,i().formData,t,a)}):r(S(t,"SubmitForm"))}}function m(e,t,a,o,s){for(var l={},c=0,d=o;c0),{rawValue:e,formattedValue:e,errorState:r?n.InputErrorState.Valid:n.InputErrorState.Invalid,showError:!1,serverError:""}},e.createSchedule=function(e,t){return{rawValue:e,formattedValue:e,errorState:n.InputErrorState.Valid,showError:!1,serverError:""}},e.createNumberOfUsers=function(e,t,a){var r,i,o=t.minNumUsers,s=t.maxNumUsers,l=e,c=parseInt(l,10),u=!isNaN(c);u?(r=cs,c=Math.min(Math.max(c,o),s)):(r=!1,i=!1,c=o);var d=u&&!r&&!i;return{rawValue:l,formattedValue:c,errorState:d?n.InputErrorState.Valid:n.InputErrorState.Invalid,showError:!(d||!a)&&a.showError,isUnderLimit:r,isOverLimit:i,minNumUsers:o,maxNumUsers:s,serverError:""}},e.createEmail=function(e,t,a){var r=e.trim(),i=n.EmailErrorState.Valid,o=!1;if(r){var s=r.split("@");if(2!==s.length)i=n.EmailErrorState.NoAt;else{var l=s[0],c=s[1],u=/^[\x00-\x7f]*$/,d=/^[\w!#$%&'*+\-\/=?^`{|}~.]+$/,p=new RegExp("^([a-z0-9][a-z0-9\\-]*\\.)+([a-z]+|xn--[a-z0-9\\-]+)$","i");d.test(l)?!c||u.test(c)&&!p.test(c)?i=n.EmailErrorState.BadDomain:a&&a.hasOwnProperty(e)&&a[e]&&(i=n.EmailErrorState.Taken,o=!0):i=n.EmailErrorState.BadUsername}}else i=n.EmailErrorState.Empty;return{rawValue:e,formattedValue:r,errorState:i,showError:i!==n.EmailErrorState.Valid&&(i===n.EmailErrorState.Taken||!!t&&(t.showError&&!t.clearShowErrorNextUpdate)),clearShowErrorNextUpdate:o,serverError:""}},e.createTeamPhone=function(e,t,a){var r=n.TeamPhoneErrorState.Valid;if(e){if(t&&"ON"===t.subgrowthBizPhoneValidation){var i=new RegExp([/\d?(\s?|-?|\+?|\.?)((\(\d{1,4}\))|(\d{1,3})|\s?)(\s?|-?|\.?)/,/((\(\d{1,3}\))|(\d{1,3})|\s?)(\s?|-?|\.?)((\(\d{1,3}\))|(\d{1,3})|\s?)/,/(\s?|-?|\.?)\d{3}(-?|\.|\s)\d{3,4}[x\-ext\ ]*\d+/].map(function(e){return e.source}).join(""));i.test(e)||(r=n.TeamPhoneErrorState.UnexpectedCharacters)}}else r=n.TeamPhoneErrorState.Empty;return{rawValue:e,formattedValue:e,errorState:r,showError:!(r===n.TeamPhoneErrorState.Valid||!a)&&a.showError,serverError:""}},e.createPassword=function(e,t){var a=n.PasswordErrorState.Valid;return e&&e.length<6?a=n.PasswordErrorState.TooShort:e||(a=n.PasswordErrorState.Empty),{rawValue:e,formattedValue:e,errorState:a,showError:!(a===n.PasswordErrorState.Valid||!t)&&t.showError,serverError:""}},e.createPaymentMethod=function(e,t,a,r){return a.available_payment_methods_for_country(t).indexOf(e)<0&&(e=a.default_payment_method_for_country(t)),{rawValue:e,formattedValue:e,errorState:n.InputErrorState.Valid,showError:!1,serverError:""}},e.createCountryCode=function(e,t){var a=e?n.InputErrorState.Valid:n.InputErrorState.Invalid;return{rawValue:e,formattedValue:e,errorState:a,showError:!(a===n.InputErrorState.Valid||!t)&&t.showError,serverError:""}},e.createZipCode=function(e,t,a,r){var i=!0;if(a.allow_zip_code_for_country(t))if("US"===t){var o=/(^\d{5}$)|(^\d{5}-\d{4}$)/;o.test(e)||(i=!1)}else e||(i=!1);else e="";var s=i?n.InputErrorState.Valid:n.InputErrorState.Invalid,l=!(i||!r)&&r.showError;return{rawValue:e,formattedValue:i?e:"",errorState:s,showError:l,serverError:""}},e.createVat=function(e,t,r){var i=n.InputErrorState,o=i.Valid,s=i.Invalid,l=e.replace(/\s+/gi,""),c=a.validateVat(t,l)?o:s;return{rawValue:e,formattedValue:l,errorState:c,showError:!(c===o||!r)&&r.showError,serverError:""}},e.createNonce=function(e,t,a){var r=n.InputErrorState,i=r.Valid,o=r.Invalid,s=!!a&&a.isCCNValid,l=!!a&&a.isCCodeValid,c=!!a&&a.isCCExpValid;t&&(s=t.ccn?!t.ccn.error:s,l=t.ccode?!t.ccode.error:l,c=t.ccexp?!t.ccexp.error:c);var u=e||(a?a.rawValue:""),d=s&&l&&c?i:o;return{rawValue:u,formattedValue:u,errorState:d,showError:!(d===i||!a)&&a.showError,serverError:"",isCCNValid:s,isCCodeValid:l,isCCExpValid:c}},e.createBIN=function(e,t){var a=e||(t?t.rawValue:"");return{rawValue:a,formattedValue:a,errorState:n.InputErrorState.Valid,showError:!1,serverError:""}},e.createIBAN=function(e,t){var r=n.InputErrorState,i=r.Valid,o=r.Invalid,s=e.replace(/\s+/gi,""),l=a.validIBANForCountry(s)?i:o;return{rawValue:e,formattedValue:s,errorState:l,showError:!(l===i||!t)&&t.showError,serverError:""}},e.createIdealBankId=function(e,t){var a=e?n.InputErrorState.Valid:n.InputErrorState.Invalid;return{rawValue:e,formattedValue:e,errorState:a,showError:!(a===n.InputErrorState.Valid||!t)&&t.showError,serverError:""}},e.createIdealBankName=function(e,t){return{rawValue:e,formattedValue:e,errorState:e?n.InputErrorState.Valid:n.InputErrorState.Invalid,showError:!1,serverError:""}},e})();t.FormValueFactory=r}),define("modules/clean/react/payments/common/form_value_helpers",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});(function(e){function t(e){return 0===e.errorState}function n(e){return!!e.serverError}e.isValid=t,e.hasServerError=n})(t.FormValueHelper||(t.FormValueHelper={}))}),define("modules/clean/react/payments/common/form_values",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});(function(e){e[e.Valid=0]="Valid",e[e.Invalid=1]="Invalid"})(t.InputErrorState||(t.InputErrorState={}));(function(e){e[e.Valid=0]="Valid",e[e.Empty=1]="Empty",e[e.NoAt=2]="NoAt",e[e.BadUsername=3]="BadUsername",e[e.BadDomain=4]="BadDomain",e[e.Taken=5]="Taken"})(t.EmailErrorState||(t.EmailErrorState={}));(function(e){e[e.Valid=0]="Valid",e[e.Empty=1]="Empty",e[e.TooShort=2]="TooShort"})(t.PasswordErrorState||(t.PasswordErrorState={}));(function(e){e[e.Valid=0]="Valid",e[e.Empty=1]="Empty",e[e.UnexpectedCharacters=2]="UnexpectedCharacters"})(t.TeamPhoneErrorState||(t.TeamPhoneErrorState={}))}),define("modules/clean/react/payments/common/payments/reducers/reducers",["require","exports","external/underscore","modules/clean/react/payments/common/form_value_factory"],function(e,t,n,a){"use strict";function r(e,t){var a=n.extend({},e.formData,t);return n.extend({},e,{formData:a})}function i(e,t){if("UpdatePaymentMethod"!==t.type&&"UpdateCountryCode"!==t.type)return e;var n=e.formData,i=e.pageState,o="UpdatePaymentMethod"===t.type?t.value:n.paymentMethod.rawValue,s=n.countryCode.formattedValue;return r(e,{paymentMethod:a.FormValueFactory.createPaymentMethod(o,s,i.paymentFormSpec,n.paymentMethod)})}function o(e,t){return"UpdateCountryCode"!==t.type?e:r(e,{countryCode:a.FormValueFactory.createCountryCode(t.value,e.formData.countryCode)})}function s(e,t){if("UpdateZipCode"!==t.type&&"UpdateCountryCode"!==t.type)return e;var n="UpdateZipCode"===t.type?t.value:e.formData.zipCode.rawValue,i=e.formData.countryCode.formattedValue;return r(e,{zipCode:a.FormValueFactory.createZipCode(n,i,e.pageState.paymentFormSpec,e.formData.zipCode)})}function l(e,t){if("UpdateVat"!==t.type&&"UpdateCountryCode"!==t.type)return e;var n="UpdateVat"===t.type?t.value.toUpperCase():e.formData.vat.rawValue,i=e.formData.countryCode.formattedValue;return r(e,{vat:a.FormValueFactory.createVat(n,i,e.formData.vat)})}function c(e,t){return"UpdateNonce"!==t.type?e:r(e,{nonce:a.FormValueFactory.createNonce(t.value,t.creditCardIframeFields,e.formData.nonce)})}function u(e,t){return"UpdateAccountHolderName"!==t.type?e:r(e,{accountHolderName:a.FormValueFactory.createInput(t.value,e.formData.accountHolderName)})}function d(e,t){return"UpdateIBAN"!==t.type?e:r(e,{iban:a.FormValueFactory.createIBAN(t.value,e.formData.iban)})}function p(e,t){return"UpdateMandateSigned"!==t.type?e:r(e,{mandateSigned:a.FormValueFactory.createCheckbox(t.value,e.formData.mandateSigned)})}function m(e,t){return"UpdateTermsAndService"!==t.type?e:r(e,{termsAndService:a.FormValueFactory.createCheckbox(t.value,e.formData.termsAndService)})}function h(e,t){if("UpdateIdealBank"!==t.type)return e;var n=t.value,i=n.bankId,o=n.bankName;return r(e,{idealBankId:a.FormValueFactory.createIdealBankId(i,e.formData.idealBankId),idealBankName:a.FormValueFactory.createIdealBankName(o,e.formData.idealBankName)})}Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentMethodReducers=[o,i,s,l,c,u,d,p,h],t.TermsAndServiceReducers=[m],t.updatePaymentMethod=i,t.updateCountryCode=o,t.updateZipCode=s,t.updateVat=l,t.updateNonce=c,t.updateAccountHolderName=u,t.updateIBAN=d,t.updateMandateSigned=p,t.updateTermsAndService=m,t.updateIdealBank=h}),define("modules/clean/react/payments/common/payments/state/store_creator",["require","exports","modules/clean/payments/payment_form/payment_form_spec","modules/clean/react/payments/common/form_value_factory"],function(e,t,n,a){"use strict";function r(e){return{countryCode:a.FormValueFactory.createCountryCode(e.countryCode).formattedValue,countryCodeLoading:void 0,hasCurrencyChanged:!1,hasTaxChangedWithinCountry:!1,loadingPrices:!1,recentLoadEvent:!1,requestToken:-1}}function i(e){return{paymentFormSpec:new n.PaymentFormSpec(e.serializedPaymentFormSpec)}}function o(e,t,n){var r=e.countryCode,i=t.paymentFormSpec.default_payment_method_for_country(r);return{paymentMethod:a.FormValueFactory.createPaymentMethod(i,r,t.paymentFormSpec),countryCode:a.FormValueFactory.createCountryCode(r),zipCode:a.FormValueFactory.createZipCode("",r,t.paymentFormSpec),vat:a.FormValueFactory.createVat("",r),nonce:a.FormValueFactory.createNonce(""),bin:a.FormValueFactory.createBIN(""),accountHolderName:a.FormValueFactory.createInput(""),iban:a.FormValueFactory.createIBAN(""),mandateSigned:a.FormValueFactory.createCheckbox(!1),termsAndService:a.FormValueFactory.createCheckbox(!1),idealBankId:a.FormValueFactory.createIdealBankId(""),idealBankName:a.FormValueFactory.createIdealBankName("")}}Object.defineProperty(t,"__esModule",{value:!0}),t.createPaymentPricingState=r,t.createPaymentPageState=i,t.createPaymentFormData=o}),define("modules/clean/react/payments/common/pricing/actions/actions",["require","exports","external/underscore","modules/clean/payments/skus/subscription_diff","modules/clean/payments/skus/subscription_service"],function(e,t,n,a,r){"use strict";function i(){return{type:"PrepareToUpdateTransitions"}}function o(e){return{type:"UpdateRecentLoadEventStatus",recentLoadEventStatus:e}}function s(){return function(e,t){var n,a=t(),r=a.formData,i=a.pricingState,o=i.discountInfo,s=r.numberOfUsers.formattedValue,c=!0;o&&(n=o.discountRatio,c=o.allowMonthly);var u={countryCode:r.countryCode.formattedValue,zipCode:r.zipCode.formattedValue,vat:r.vat.errorState?"":r.vat.formattedValue};e(l()),m(e,i,s,u,n,c)}}function l(){return{type:"UpdateTransitionsStart"}}function c(e,t){e({type:"UpdateTransitionsSuccess",subChangePlans:t}),d(e,!1)}function u(e){return{type:"UpdateTransitionsError",error:e}}Object.defineProperty(t,"__esModule",{value:!0});var d=n.debounce(function(e,t){e(o(t))},400),p=new r.SubscriptionService,m=n.debounce(function(e,t,n,r,i,o){var s,l={discountPercentage:100*i,discountAllowMonthly:o};if(t.currentPlanSku){var d=new a.SubscriptionDiff;d.setPlan(t.currentPlanSku),d.setTotalLicenses(n),s=[d]}else s=t.subChangePlans.plans.map(function(e){var t=a.SubscriptionDiff.fromSubscriptionStatus(e);return t.setTotalLicenses(n),t});p.priceSet(s,r,l).then(function(t){c(e,t)}).catch(function(t){e(u(t))})},400);t.prepareToUpdatePrice=i,t.updatePrice=s,t.updateTransitionsStart=l,t.updateTransitionsSuccess=c,t.updateTransitionsError=u}),define("modules/clean/react/payments/common/pricing/reducers/reducers",["require","exports","tslib","modules/clean/payments/skus/subscription_change_plan_set"],function(e,t,n,a){"use strict";function r(e,t){if("PrepareToUpdateTransitions"!==t.type)return e;var a=n.__assign({},e.pricingState,{loadingPrices:!0,recentLoadEvent:!0});return n.__assign({},e,{pricingState:a})}function i(e,t){if("UpdateRecentLoadEventStatus"!==t.type)return e;var a=n.__assign({},e.pricingState,{recentLoadEvent:t.recentLoadEventStatus});return n.__assign({},e,{pricingState:a})}function o(e,t){if("UpdateTransitionsStart"!==t.type)return e;var a=n.__assign({},e.pricingState,{countryCodeLoading:e.formData.countryCode.formattedValue,loadingPrices:!0,recentLoadEvent:!0});return n.__assign({},e,{pricingState:a})}function s(e,t){if("UpdateTransitionsSuccess"!==t.type)return e;var r,i=!1,o=!1;if(t.subChangePlans&&(r=t.subChangePlans,e.pricingState.subChangePlans.plans.length>0)){var s=e.pricingState.subChangePlans.plans[0],l=r[0],c=s.tvm,u=l.tvm,d=c&&c.getCurrency(),p=u&&u.getCurrency();i=e.pricingState.hasCurrencyChanged||d!==p;var m=s.nextBillingSummary.taxRate,h=l.nextBillingSummary.taxRate,_=m===h&&(0===m||d===p);o=e.pricingState.hasTaxChangedWithinCountry||!_;e.pricingState.countryCode!==e.pricingState.countryCodeLoading&&(o=!1)}var f=n.__assign({},e.pricingState,{countryCode:e.pricingState.countryCodeLoading,countryCodeLoading:void 0,hasCurrencyChanged:i,hasTaxChangedWithinCountry:o,loadingPrices:!1,recentLoadEvent:!0,subChangePlans:new a.SubscriptionChangePlanSet(t.subChangePlans),baseSubChangePlans:new a.SubscriptionChangePlanSet(t.subChangePlans)});return n.__assign({},e,{pricingState:f})}Object.defineProperty(t,"__esModule",{value:!0}),t.TransitionManagementReducers=[r,i,o,s],t.prepareToUpdateTransitions=r,t.updateRecentLoadEventStatus=i,t.updateTransitionsStart=o,t.updateTransitionsSuccess=s}),define("modules/clean/react/payments/edit_invoice_address_modal/edit_invoice_address_modal_loader",["require","exports","tslib","modules/core/notify","external/react","modules/clean/react/css","modules/clean/react/sprite","modules/core/uri","modules/core/i18n","modules/clean/react/arbor/elements/arbor_inputs","modules/clean/payments/validation","modules/clean/react/modal","modules/clean/static_urls","modules/clean/react/tooltip","modules/clean/analytics","modules/clean/ajax_as_promised"],function(e,t,n,a,r,i,o,s,l,c,u,d,p,m,h,_){"use strict";function f(e){return function(t){return null==t||t.length<=e}}function g(e,t){return r.createElement(m.Tooltip,{position:m.TooltipPosition.RIGHT,tooltip_contents:t},e,r.createElement(o,{group:"web",name:"info",className:"info-sprite",alt:""}))}Object.defineProperty(t,"__esModule",{value:!0});var y=l._("Country and postal code must match your account’s payment information."),b=l._("Your tax rate on this invoice cannot be updated."),S={addressName:l._("Billing name"),address:l._("Billing address"),city:l._("City"),state:l._("State"),zip:g(l._("Postal code"),y),country:g(l._("Country"),y),exclusionId:l._("VAT number (optional)"),exclusionIdWithTooltip:g(l._("VAT number (optional)"),b)},v=(function(e){function i(t){var n=e.call(this,t)||this;return n.disableds={addressName:!1,address:!1,city:!1,state:!1,zip:!0,country:!0,exclusionId:!1,exclusionIdWithTooltip:!1},n.addressNameLength=100,n.addressLength=250,n.cityLength=50,n.stateLength=50,n.vatLength=25,n.undefinedLength=void 0,n.validateHandlers={addressName:f(n.addressNameLength),address:f(n.addressLength),city:f(n.cityLength),state:f(n.stateLength),zip:function(){return!0},country:function(){return!0},exclusionId:function(){return!0},exclusionIdWithTooltip:function(){return!0}},n.maxLengths={addressName:n.addressNameLength,address:n.addressLength,city:n.cityLength,state:n.stateLength,zip:n.undefinedLength,country:n.undefinedLength,exclusionId:n.vatLength,exclusionIdWithTooltip:n.vatLength},n.errorTexts={addressName:l._("Too long"),address:l._("Too long"),city:l._("Too long"),state:l._("Too long"),zip:"",country:"",exclusionId:"",exclusionIdWithTooltip:""},n.onSave=function(){var e=n.state.formState,t=n.props.invoice;if(e)if(n.logActions("edit_billing_address_started"),n.setState({submitting:!0}),n.isInputValid()){var a={address_name:e.addressName,address:e.address,city:e.city,state:e.state,exclusion_id:e.exclusionId};t&&(a.invoice_id=s.parse(t.link).getQuery().id.toString()),n.makeEditBillingAddressRequest(a)}else n.setState({submitting:!1,showErrors:!0})},n.onCancel=function(){n.logActions("edit_billing_address_cancelled"),d.Modal.close()},n.state={submitting:!1,showErrors:!1},t.isTeam?(n.editUrl="/edit_billing_address",n.viewModelUrl="/edit_billing_address_view_model",n.vatClass="grid__item--1-1",n.modalClass="edit-invoice-modal"):(n.editUrl="/edit_billing_address_individual",n.viewModelUrl="/edit_billing_address_individual_view_model",n.vatClass="grid__item--1-2",n.modalClass="edit-invoice-modal professional-modal"),n}return n.__extends(i,e),i.showInstance=function(e,n){var a=r.createElement(t.EditInvoiceAddressModalLoader,{invoice:e,isTeam:n});d.Modal.showInstance(a)},i.showUpdateTaxProfileModal=function(e,n){var a=r.createElement(t.EditInvoiceAddressModalLoader,{isTeam:e,onUpdated:n});d.Modal.showInstance(a)},i.prototype.componentDidMount=function(){var e=void 0;this.props.invoice&&(e=s.parse(this.props.invoice.link).getQuery().id.toString(),this.disableds.exclusionIdWithTooltip=!0),this.makeRequest(e)},i.prototype.makeRequest=function(e){return n.__awaiter(this,void 0,void 0,function(){var t,a,r;return n.__generator(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t={invoice_id:e},[4,_.WebRequest({url:this.viewModelUrl,data:t,dataType:"json"})];case 1:return a=n.sent(),u.hasVat(a.countryCode)&&(this.errorTexts.exclusionId=l._("Please enter a valid VAT number, e.g. %(examples)s.").format({examples:u.getVatExamples(a.countryCode).join(", ")}),this.validateHandlers.exclusionId=function(e){return!e||u.validateVat(a.countryCode,e)}),this.setState({formState:a}),[3,3];case 2:return r=n.sent(),d.Modal.close(),[3,3];case 3:return[2]}})})},i.prototype.render=function(){var e,t=this.state,n=t.formState,a=t.showErrors,i=t.submitting;if(n){var o=null;if(u.hasVat(n.countryCode)){var s=u.getVatPrefix(n.countryCode);o=this.props.invoice?this.renderInput("exclusionIdWithTooltip",this.vatClass):this.renderInput("exclusionId",this.vatClass,s)}e=this.props.isTeam?r.createElement("div",{className:".type--arbor grid__container grid__container--p-large grid--x-bookend"},this.renderInstructions(n.countryCode),this.renderInput("addressName","grid__item--1-1"),this.renderInput("address","grid__item--1-1"),this.renderInput("city","grid__item--1-2"),this.renderInput("state","grid__item--11-24"),this.renderInput("zip","grid__item--7-24"),this.renderInput("country","grid__item--2-3"),o):r.createElement("div",{className:".type--arbor grid__container grid__container--p-large grid--x-bookend"},this.renderInput("addressName","grid__item--1-1"),this.renderInput("address","grid__item--1-2"),this.renderInput("city","grid__item--1-4"),this.renderInput("state","grid__item--1-4"),this.renderInput("zip","grid__item--1-2"),this.renderInput("country","grid__item--1-2"),o,this.renderInstructions(n.countryCode))}else e=r.createElement("div",{className:"loading-spinner"},r.createElement("img",{src:p.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:l._("Loading")}));var c=r.createElement(d.ModalButtons,{className:"oq-modal__buttons"},r.createElement(d.ModalButton,{className:"cancel-button",importance:"tertiary",onClick:this.onCancel},l._("Cancel")),r.createElement(d.ModalButton,{disabled:!n||i||a&&!this.isInputValid(),importance:"primary",onClick:this.onSave},l._("Save changes")));return r.createElement(d.Modal,{className:this.modalClass,autoClose:!1,buttonComponent:c,title:l._("Edit invoice details")},r.createElement("div",{className:"dynamic-content"},e))},i.prototype.logActions=function(e){this.props.isTeam?h.TeamsWebActionsLogger.log(e):h.UserActivityLogger.log("web",e)},i.prototype.makeEditBillingAddressRequest=function(e){return n.__awaiter(this,void 0,void 0,function(){var t,r,i;return n.__generator(this,function(n){switch(n.label){case 0:t=this.props.onUpdated,n.label=1;case 1:return n.trys.push([1,3,4,5]),r=this.editUrl,[4,_.WebRequest({url:r,data:e})];case 2:return n.sent(),this.logActions("edit_billing_address_success"),a.success(l._("Invoice details updated.")),[3,5];case 3:return i=n.sent(),this.logActions("edit_billing_address_edit_failure"),[3,5];case 4:return t&&t(),d.Modal.close(),[7];case 5:return[2]}})})},i.prototype.renderInstructions=function(e){var t,n=this.props.invoice;if(t=this.props.isTeam?n?l._("You are editing details for the %(date)s invoice.").format({date:n.date}):l._("You are editing details for all future invoices. To edit past invoices, click “Edit” on the invoice item instead."):l._("Any changes to billing information will only apply to future invoices."),u.hasVat(e)){var a=l._("Please note that changing your VAT number could impact your applicable tax rate.");n&&(a=l._("To add or change a VAT number or request a tax refund, contact support.")),t=t.concat(" ",a)}return r.createElement("div",{className:"grid__item--1-1 instructions"},t)},i.prototype.renderInput=function(e,t,n){var a=this.state,i=a.formState,o=a.showErrors,s="";return i&&(s=i[e]),r.createElement(c.ArborTextInput,{name:e,containerClassName:t,isValid:o?!!this.validateHandlers[e](s)&&"":"",labelText:S[e],errorText:this.errorTexts[e],value:s,onChange:this.onChangeFactory(e),disabled:this.disableds[e],placeholderText:n,maxLength:this.maxLengths[e]})},i.prototype.onChangeFactory=function(e){var t=this;return function(n,a,r){var i=t.state.formState;i&&t.setState(function(t){return i[e]=r,t})}},i.prototype.isInputValid=function(){var e=this.state.formState;return!!e&&(this.validateHandlers.addressName(e.addressName)&&this.validateHandlers.address(e.address)&&this.validateHandlers.city(e.city)&&this.validateHandlers.state(e.state)&&this.validateHandlers.exclusionId(e.exclusionId))},i})(r.Component);t.EditInvoiceAddressModalLoader=i(v,["/static/css/payments/edit_invoice_address_modal/edit_invoice_address_modal-vflQS8bbl.css"])}),define("modules/clean/react/payments/pro/components/inputs/inputs",["require","exports","tslib","external/react","external/react-dom","external/classnames"],function(e,t,n,a,r,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){var e=i({input__label:!0,"input__label--before":Boolean(!this.props.labelAfterElement),"input__label--errormodal":Boolean(this.props.errorText)},this.props.className),t=this.props.containerClassName,n=a.createElement("label",{className:e,htmlFor:this.props.htmlFor},this.props.labelText),r=null;this.props.labelAfterElement&&(r=n,n=null);var o=null;this.props.secondaryLabel&&(o=a.createElement("label",{className:"input__label input__label--secondary",htmlFor:this.props.htmlFor},this.props.secondaryLabel));var s;this.props.errorText&&(s=this.props.errorText);var l=a.createElement("label",{className:"input__label--error",htmlFor:this.props.htmlFor},s);return a.createElement("div",{className:t},n,this.props.children,r,o,l)},t})(a.Component);t.LabeledInput=o;var s=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onChange=function(e){t.props.onChange&&t.props.onChange(r.findDOMNode(t.input))},t.onBlur=function(e){t.props.onBlur&&t.props.onBlur(r.findDOMNode(t.input))},t}return n.__extends(t,e),t.prototype.componentDidMount=function(){if(this.props.onChange){var e=r.findDOMNode(this.input),t=e.value;t&&t!==this.props.value&&this.props.onChange(e)}},t.prototype.render=function(){var e=this,t=this.props,n=t.name,r=t.autocomplete,s=t.className,l=t.disabled,c=t.labelText,u=t.secondaryLabel,d=t.errorText,p=t.hasError,m=t.value,h=t.maxLength,_=t.containerClassName,f=t.placeholder,g=this.props.type||"text",y=i({input__text:!0,"input__text--error":Boolean(d)||p},this.props.inputClassName);return a.createElement(o,{className:s,containerClassName:_,labelText:c,htmlFor:n,errorText:d,secondaryLabel:u},a.createElement("input",{className:y,type:g,autoComplete:r,placeholder:f,name:n,id:n,ref:function(t){return e.input=t},value:m,disabled:l,onChange:this.onChange,onBlur:this.onBlur,maxLength:h}))},t})(a.Component);t.LabeledTextInput=s;var l=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleCheckboxChange=function(e){t.props.onClick&&("click"!==e.type&&"Enter"!==e.key&&13!==e.charCode||(t.props.onClick(r.findDOMNode(t.input)),e.preventDefault()))},t}return n.__extends(t,e),t.prototype.componentDidMount=function(){if(this.props.onClick){var e=r.findDOMNode(this.input),t=e.checked;t&&t!==this.props.checked&&this.props.onClick(e)}},t.prototype.render=function(){var e=this,t=this.props,n=t.name,r=t.className,s=t.containerClassName,l=t.disabled,c=t.labelText,u=t.labelClassName,d=t.errorText,p=t.checked,m=i({input__checkbox:!0,"input__checkbox--valid":p,"input__checkbox--disabled":Boolean(l)},r);return a.createElement(o,{containerClassName:s,className:u,errorText:d,htmlFor:n,labelAfterElement:!0,labelText:c},a.createElement("div",{"aria-labelledby":n,tabIndex:0,role:"checkbox",className:m,onClick:this.handleCheckboxChange,onKeyUp:this.handleCheckboxChange}),a.createElement("input",{tabIndex:-1,checked:p,disabled:l,id:n,name:n,ref:function(t){return e.input=t},type:"checkbox"}))},t})(a.Component);t.LabeledCheckboxInput=l;var c=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleRadioChange=function(e){if(t.props.disabled)return void e.stopPropagation();t.props.onClick&&("click"!==e.type&&"Enter"!==e.key&&13!==e.charCode||(t.props.onClick(e,t.props.name,t.props.value),e.preventDefault()))},t}return n.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.name,n=e.disabled,r=e.value,s=e.checked,l=e.onChange,c=e.labelText,u=e.containerClassName,d=i({input__radio:!0,"input__radio--valid":Boolean(s),"input__radio--disabled":Boolean(n)},this.props.className),p=i(this.props.labelClassName);return a.createElement(o,{containerClassName:u,className:p,labelText:c,htmlFor:t,labelAfterElement:!0},a.createElement("div",{"aria-label":t,role:"radio",tabIndex:0,className:d,onClick:this.handleRadioChange,onKeyUp:this.handleRadioChange}),a.createElement("input",{tabIndex:-1,ref:"radio",type:"radio",name:t,value:r,checked:s,onChange:l,disabled:n}))},t})(a.Component);t.LabeledRadioInput=c;var u=(function(e){function t(){
var t=null!==e&&e.apply(this,arguments)||this;return t.onChange=function(e){t.props.onChange&&t.props.onChange(r.findDOMNode(t.input))},t}return n.__extends(t,e),t.prototype.componentDidMount=function(){if(this.props.onChange){var e=r.findDOMNode(this.input),t=e.value;t&&t!==this.props.value&&this.props.onChange(e)}},t.prototype.render=function(){var e=this,t=this.props,n=t.name,r=t.className,s=t.containerClassName,l=t.labelClassName,c=t.labelText,u=t.errorText,d=i({input__select:!0},r);return a.createElement(o,{containerClassName:s,className:l,errorText:u,htmlFor:n,labelText:c},a.createElement("select",{className:d,id:n,name:n,onChange:this.onChange,value:this.props.value,ref:function(t){return e.input=t}},this.props.children))},t})(a.Component);t.LabeledSelectInput=u;var d=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){return a.createElement("div",{className:this.props.className},this.props.children,this.props.errors&&this.props.errors.map(function(e){return a.createElement("div",{className:e.className},a.createElement("label",{className:"input__label--error",htmlFor:e.name},e.text))}))},t})(a.Component);t.LabeledInputRow=d}),define("modules/clean/react/payments/pro/components/payments/ideal_form",["require","exports","tslib","external/react","modules/clean/react/payments/common/form_value_helpers","modules/clean/react/payments/pro/components/inputs/inputs","modules/core/i18n"],function(e,t,n,a,r,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onIdealBankChange=function(e){var n=e.value,a=t.props.idealBanks[n];t.props.actions.updateIdealBank({bankId:n,bankName:a})},t}return n.__extends(t,e),t.prototype.idealBankErrorString=function(){var e=this.props.formData.idealBankId;return!r.FormValueHelper.isValid(e)&&e.showError?o._("Please select your bank."):""},t.prototype.render=function(){var e=this.props,t=e.formData,n=e.idealBanks,r=o._("Note: We’ll use your bank information provided by iDEAL for all future billing cycles. If your bank is not listed, then please select a different payment method.");return a.createElement("div",null,a.createElement("div",{className:"ideal-fields"},a.createElement(i.LabeledSelectInput,{name:"ideal_bank",labelText:o._("Bank"),value:t.idealBankId.rawValue,onChange:this.onIdealBankChange,errorText:this.idealBankErrorString()},a.createElement("option",{value:"",key:"default","aria-selected":""===t.idealBankId.rawValue},o._("Select your bank...")),Object.keys(n).map(function(e){return a.createElement("option",{value:e,key:e,"aria-selected":t.idealBankId.rawValue===e},n[e])}))),this.props.locationFields,a.createElement("div",{className:"ideal-note"},r))},t})(a.Component);t.IdealForm=s}),define("modules/clean/react/payments/pro/components/payments/payment_info_section",["require","exports","tslib","external/react","modules/clean/payments/payment_form/payment_form_spec","modules/clean/payments/validation","modules/core/i18n","modules/clean/react/payments/pro/components/inputs/inputs","modules/clean/react/payments/common/form_value_helpers","modules/clean/react/payments/pro/components/payments/ideal_form","modules/clean/react/payments/pro/components/payments/payment_method_selector","modules/clean/react/payments/checkout/components/payment_method_form/credit_card_frame","modules/clean/react/payments/checkout/components/payment_method_form/direct_debit_form"],function(e,t,n,a,r,i,o,s,l,c,u,d,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var m=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.prepareForSubmission=function(){return this.props.formData.paymentMethod.formattedValue===r.PaymentMethod.CreditCard?this.creditCardFrame.tokenize():Promise.resolve(!0)},t.prototype.onCountryCodeChange=function(e){this.props.actions.updateCountryCode(e.value)},t.prototype.onZipCodeChange=function(e){this.props.actions.updateZipCode(e.value)},t.prototype.onVatChange=function(e){this.props.actions.updateVat(e.value)},t.prototype.zipCodeErrorString=function(){var e=this.props.formData.zipCode;return!l.FormValueHelper.isValid(e)&&e.showError?o._("Please enter a valid postal code."):""},t.prototype.vatErrorString=function(){var e=this.props.formData.vat;return!l.FormValueHelper.isValid(e)&&e.showError?o._("Please enter a valid VAT number (ex: %(examples)s).").format({examples:i.getVatExamples(this.props.formData.countryCode.formattedValue).join(", ")}):""},t.prototype.renderLocationFields=function(){var e=this.props,t=e.countryList,n=e.paymentSpec,r=e.formData,l=e.isScheduledDowngradeToBasic,c=o._("Postal Code",{comment:"This is the label for the zip code field, and should be kept short."}),u="US"===r.countryCode.formattedValue?o._("Billing ZIP"):c,d=!n.allow_zip_code_for_country(r.countryCode.formattedValue),p=this.zipCodeErrorString(),m=t.map(function(e){var t=e[0],n=e[1];return a.createElement("option",{key:"location-"+t,value:t},n)}),h=null,_="grid__item";if(this.props.individualUpdateBillingModalRefactor&&(_="grid__item--medium--1-2"),n.should_show_vat_for_country(r.countryCode.formattedValue)){var f=i.getVatPrefix(r.countryCode.formattedValue);h=a.createElement(s.LabeledTextInput,{className:"payment-info__vat",containerClassName:_,name:"vat",labelText:o._("VAT number (optional)"),errorText:this.vatErrorString(),placeholder:f,value:r.vat.rawValue,onChange:this.onVatChange.bind(this)})}var g="grid__item--7-24",y="grid__item--2-3",b="grid__item--7-24",S=null,v=void 0;if(this.props.individualUpdateBillingModalRefactor){g="grid__item--1-2",y="grid__item--1-2",b="grid__item--1-2",v=this.zipCodeErrorString(),p="";var E=o._("Please note that changing your billing location could impact your applicable tax rate.");n.should_show_vat_for_country(r.countryCode.formattedValue)&&(E=o._("Please note that changing your billing location or VAT number could impact your applicable tax rate.")),S=a.createElement("div",{className:l?"disclaimer-message-full-width":"disclaimer-message"},E,l&&a.createElement("span",null," ",o._("Updating your billing information will cancel your scheduled plan downgrade. If you still wish to downgrade, you will need to schedule it again.")))}return a.createElement("div",{className:"grid__item"},a.createElement(s.LabeledInputRow,{className:"payment-info__location grid__item grid--x-bookend",errors:[{name:"zip",text:p,className:b}]},a.createElement(s.LabeledTextInput,{className:"payment-info__zip",containerClassName:g,name:"zip",labelText:u,value:r.zipCode.rawValue,hasError:Boolean(p),disabled:d,onChange:this.onZipCodeChange.bind(this),errorText:v}),a.createElement(s.LabeledSelectInput,{className:"payment-info__country",containerClassName:y,labelText:o._("Country"),name:"country_code",onChange:this.onCountryCodeChange.bind(this),value:r.countryCode.rawValue},m)),h,S)},t.prototype.renderPaymentMethodSelector=function(){var e=this.props,t=e.paymentSpec,n=e.formData,r=e.enableIdealReact,i=e.individualUpdateBillingModalRefactor;return a.createElement(u.PaymentMethodSelector,{paymentSpec:t,paymentMethod:n.paymentMethod.rawValue,updatePaymentMethod:this.props.actions.updatePaymentMethod,countryCode:n.countryCode.rawValue,zipCode:n.zipCode.rawValue,enableIdealReact:r,individualUpdateBillingModalRefactor:i})},t.prototype.render=function(){var e=this,t=this.props,n=t.actions,i=t.formData,o=t.idealBanks,s=t.enableIdealReact,l=this.renderLocationFields(),u=l;return i.paymentMethod.formattedValue===r.PaymentMethod.DirectDeposit?u=a.createElement(p.DirectDebitForm,{locationFields:l,formData:i,actions:n,individualUpdateBillingModalRefactor:this.props.individualUpdateBillingModalRefactor}):s&&i.paymentMethod.formattedValue===r.PaymentMethod.Ideal&&(u=a.createElement(c.IdealForm,{locationFields:l,formData:i,actions:n,idealBanks:o})),a.createElement("div",{className:"grid__item payment-info"},this.renderPaymentMethodSelector(),a.createElement(d.CreditCardFrame,{iframeUrl:this.props.iframeUrl,hidden:i.paymentMethod.formattedValue!==r.PaymentMethod.CreditCard,actions:this.props.actions,ref:function(t){return e.creditCardFrame=t},nonce:i.nonce}),u)},t})(a.Component);t.PaymentInfoSection=m}),define("modules/clean/react/payments/pro/components/payments/payment_method_input",["require","exports","tslib","external/react","modules/core/i18n","external/classnames","modules/clean/payments/payment_form/payment_form_spec","modules/clean/react/payments/pro/components/inputs/inputs"],function(e,t,n,a,r,i,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.onChange=function(e){this.props.onSelected(this.props.paymentMethod)},t.prototype.render=function(){var e=this.props,t=e.icons,n=e.labelText,l=e.paymentMethod,c=[],u=["payment-info__option"];this.props.individualUpdateBillingModalRefactor?this.props.numberOfPaymentMethods&&3===this.props.numberOfPaymentMethods?u.push("grid__item--medium--1-4"):this.props.numberOfPaymentMethods&&4===this.props.numberOfPaymentMethods?u.push("grid__item--medium--5-24"):u.push("grid__item--medium--1-2"):(u.push("grid__item"),u.push("grid__item--medium--shrink"),u.push("grid--y-middle"));var d;if(n&&(d="payment-method-label#debit",c.push(a.createElement("span",{title:"debit",key:d,className:"debit"},this.props.labelText))),t){if(l===o.PaymentMethod.CreditCard){var p=t.join(", ").replace("_","-"),m=r._("Credit card. We accept %(payment_methods)s").format({payment_methods:p});d="payment-method-label#creditcard",c.push(a.createElement("span",{key:d,className:"ax-visually-hidden"},m))}else l===o.PaymentMethod.PayPal?(d="payment-method-label#paypal",c.push(a.createElement("span",{key:d,className:"ax-visually-hidden"},r._("Paypal")))):l===o.PaymentMethod.Ideal&&(d="payment-method-label#ideal",c.push(a.createElement("span",{key:d,className:"ax-visually-hidden"},r._("iDEAL"))));for(var h=0,_=t;h<_.length;h++){var f=_[h];d="payment-method-icon#"+f,c.push(a.createElement("span",{title:f,key:d,className:f}))}}return a.createElement("div",{className:i(u)},a.createElement(s.LabeledRadioInput,{name:"payment_method",className:"payment-info__payment",value:l.toString(),checked:this.props.selected,onClick:this.onChange.bind(this),onChange:function(){}}),a.createElement("label",{htmlFor:"payment_method_"+l,id:"payment_method_"+l,className:"payment-info__method-label",onClick:this.onChange.bind(this)},c))},t})(a.Component);t.PaymentMethodInput=l}),define("modules/clean/react/payments/pro/components/payments/payment_method_selector",["require","exports","tslib","external/react","modules/core/i18n","modules/clean/payments/payment_form/payment_form_spec","modules/clean/react/payments/pro/components/payments/payment_method_input"],function(e,t,n,a,r,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onPaymentMethodSelected=function(e){t.props.updatePaymentMethod(e)},t}return n.__extends(t,e),t.prototype.getLabelForMethodId=function(e){return e===i.PaymentMethod.CreditCard?a.createElement(o.PaymentMethodInput,{key:"payment-method#"+e,paymentMethod:i.PaymentMethod.CreditCard,selected:this.props.paymentMethod===i.PaymentMethod.CreditCard,onSelected:this.onPaymentMethodSelected.bind(this),icons:this.props.paymentSpec.supported_credit_cards_for_country(this.props.countryCode),numberOfPaymentMethods:this.props.paymentSpec.available_payment_methods_for_country(this.props.countryCode).length,individualUpdateBillingModalRefactor:this.props.individualUpdateBillingModalRefactor}):e===i.PaymentMethod.PayPal?a.createElement(o.PaymentMethodInput,{key:"payment-method#"+e,paymentMethod:i.PaymentMethod.PayPal,selected:this.props.paymentMethod===i.PaymentMethod.PayPal,onSelected:this.onPaymentMethodSelected,icons:["paypal"],numberOfPaymentMethods:this.props.paymentSpec.available_payment_methods_for_country(this.props.countryCode).length,individualUpdateBillingModalRefactor:this.props.individualUpdateBillingModalRefactor}):e===i.PaymentMethod.DirectDeposit?a.createElement(o.PaymentMethodInput,{key:"payment-method#"+e,paymentMethod:i.PaymentMethod.DirectDeposit,selected:this.props.paymentMethod===i.PaymentMethod.DirectDeposit,onSelected:this.onPaymentMethodSelected,labelText:r._("Direct Debit"),numberOfPaymentMethods:this.props.paymentSpec.available_payment_methods_for_country(this.props.countryCode).length,individualUpdateBillingModalRefactor:this.props.individualUpdateBillingModalRefactor}):this.props.enableIdealReact&&e===i.PaymentMethod.Ideal?a.createElement(o.PaymentMethodInput,{key:"payment-method#"+e,paymentMethod:i.PaymentMethod.Ideal,selected:this.props.paymentMethod===i.PaymentMethod.Ideal,onSelected:this.onPaymentMethodSelected,icons:["ideal"],numberOfPaymentMethods:this.props.paymentSpec.available_payment_methods_for_country(this.props.countryCode).length,individualUpdateBillingModalRefactor:this.props.individualUpdateBillingModalRefactor}):null},t.prototype.render=function(){var e=this,t=this.props,n=t.countryCode,r=t.paymentSpec,i=r.available_payment_methods_for_country(n),o=i.map(function(t){return e.getLabelForMethodId(t)});return a.createElement("div",{className:"payment-info__selector grid__item grid__container--p-small"},o)},t})(a.Component);t.PaymentMethodSelector=s}),define("modules/clean/react/payments/transition_view_model",["require","exports","modules/clean/payments/cash"],function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a;(function(e){e[e.InitialPlan=1]="InitialPlan",e[e.ExtraLicense=7]="ExtraLicense"})(a=t.LineItemType||(t.LineItemType={}));var r=(function(){function e(e,t){this.transition=e,this.taxName=t}return e.prototype.getExpectedPriceToken=function(){return this.transition.expected_price},e.prototype.getScheduleId=function(){return this.transition.state.schedule.id},e.prototype.hasPackrat=function(){return this.transition.prices.evh&&this.transition.prices.evh.amount>0},e.prototype.getAddonExpectedPrice=function(){return this.transition.prices.evh.amount},e.prototype.getCurrency=function(){return this.transition.state.currency},e.prototype.getActualPrice=function(){return n.Cash.fromObject(this.transition.prices.actual)},e.prototype.getBilledPrice=function(){return n.Cash.fromObject(this.transition.prices.billed)},e.prototype.getPerLicensePrice=function(e){for(var t=0,a=this.transition.state.per_license_prices;t0){var c=n[0];o.subService.performTransition(c).then(function(e){d.success(a._("You’ve cancelled your change!")),l&&l(e),o.doneSubmittingRequest(),r.Modal.close(),o.props.reOpenModalDialogAfterCancellation&&u.DBModalStack.trigger(m.CHANGE_PLAN_DUAL_MODAL_UPDATED,null)})}else d.error(a._("Failed to revert changes."))},error:function(){d.error(a._("Failed to load modal.")),o.doneSubmittingRequest(),r.Modal.close(),o.props.reOpenModalDialogAfterCancellation&&u.DBModalStack.trigger(m.CHANGE_PLAN_DUAL_MODAL_UPDATED,null)}})},t.prototype.render=function(){var e=this.props,t=e.cancellationType,n=e.subStatus;if(!n.subState.plan||!n.subState.billingSchedule)return p.createElement("noscript",null);var i,o=a._("Confirm cancelled change");switch(t){case h.PLAN:i=a._("You’re cancelling your scheduled changes. Your %(trademark_business)s %(plan)s plan will renew on %(date)s and you will be billed %(schedule)s.").format({trademark_business:l.TRADEMARK_BUSINESS,plan:n.subState.plan.displayName(),date:n.subState.formattedNextBillingDate,schedule:n.subState.billingSchedule.scheduleDescriptionAdjective});break;case h.SCHEDULE:i=a._("You’re cancelling your scheduled changes. Your %(trademark_business)s %(plan)s plan will renew on %(date)s and you will be billed %(schedule)s.").format({trademark_business:l.TRADEMARK_BUSINESS,plan:n.subState.plan.displayName(),date:n.subState.formattedNextBillingDate,schedule:n.subState.billingSchedule.scheduleDescriptionAdjective});break;case h.LICENSES:i=a._("You’re cancelling your scheduled changes. Your %(trademark_business)s %(plan)s plan will renew on %(date)s and you will be billed %(schedule)s.").format({trademark_business:l.TRADEMARK_BUSINESS,plan:n.subState.plan.displayName(),date:n.subState.formattedNextBillingDate,schedule:n.subState.billingSchedule.scheduleDescriptionAdjective});break;case h.ALL:o=a._("Confirmation"),i=a._("By confirming, all existing scheduled changes will be cancelled.");break;default:o=a._("Confirmation"),i=a._("By confirming, all existing scheduled changes will be cancelled.")}return p.createElement(r.Modal,{acceptButtonDisabled:this.state.submitting,acceptButtonText:a._("Confirm"),autoClose:!1,dismissButtonText:a._("Don’t cancel"),onAccept:this.onAccept,title:o,submitting:this.state.submitting},p.createElement("p",null,i))},t})(p.Component);t.CancelBillingChangesConfirmationView=_}),define("modules/clean/teams/admin/widgets/billing_notifications/cancellable_item",["require","exports","tslib","external/react","modules/core/i18n","external/classnames"],function(e,t,n,a,r,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.title,n=e.description,o=e.handleAction,s=e.useSingleCancelLink,l=this.props.className?this.props.className:"",c=i((d={"cancellable-item__button":!0,"link-button":!0},d[l]=!0,d)),u=a.createElement("button",{className:c,onClick:o},r._("Cancel change"));return s&&(u=void 0),a.createElement("div",{className:"cancellable-item"},a.createElement("span",{className:"cancellable-item__title"},t,":")," ",a.createElement("span",{className:"cancellable-item__desc"},n),u);var d},t})(a.Component);t.CancellableItemView=o}),define("modules/clean/teams/admin/widgets/change_plan_modal/change_plan_constants",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHANGE_PLAN_DUAL_MODAL_UPDATED="change_plan_dual_modal:updated";(function(e){e[e.PLAN_CHANGE=1]="PLAN_CHANGE",e[e.SCHEDULE_CHANGE=2]="SCHEDULE_CHANGE"})(t.DualPlanModalMode||(t.DualPlanModalMode={}))});
//# sourceMappingURL=pkg-account_subscription.min.js-vflzrdqb-.map