Module 699595

769 characters · in no known chunk
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{W:()=>l});var i=n(64700),r=n(543767),s=n(410516),a=n(650170),o=n(463376);function l(e){let t,{priceOptions:n,trialId:l,metadata:u,discountInvoicePreview:d}=e,{isEligibleForDiscount:c,discountOffer:_}=(0,o.i)(),h=(0,s.YJ)(_),f=!0===n.loaded,E=null!=d,[p,m]=(0,r.YV)({items:null!=h?[{planId:h,quantity:1}]:[],renewal:!1,preventFetch:E||!c||null==h||!f,trialId:l,paymentSourceId:n.paymentSourceId,currency:n.currency,metadata:u}),g=E?d:p,A=i.useMemo(()=>{let e=c?g??null:null;return{discountOffer:_,applicablePlan:h,discountInvoicePreview:e,discountAmountOff:null!=h?(0,s.pg)(e,h):null,discountInvoiceError:m}},[_,h,g,m,c]);return t=(0,a.t4)(e=>{let{setPremiumDiscountInfo:t}=e;return t}),i.useEffect(()=>(t(A),()=>{t(s.TI)}),[A,t]),A}}