LiveProducerLP2AdCreditSection.react",["CometColumn.react","CometColumnItem.react","CometImage.react","CometLink.react","CometRelay","CometRow.react","CometRowItem.react","FDSButton.react","FDSSelect.react","FDSText.react","FundraiserProgressBar.react","LiveProducerLP2AdCreditConfirmationPopover.react","LiveProducerLP2AdCreditSectionEnrollInAcquisitionCouponMutation.graphql","LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation.graphql","LiveProducerLP2AdCreditSectionStrings","PECurrency","react","requireDeferred"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c=u||(u=o("react")),d=u.useState,m=r("requireDeferred")("LiveBoostingFalcoEvent").__setRef("LiveProducerLP2AdCreditSection.react"),p=e!==void 0?e:e=n("LiveProducerLP2AdCreditSectionEnrollInAcquisitionCouponMutation.graphql"),_=s!==void 0?s:s=n("LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation.graphql");function f(e){var t=e.adAccountInfoList,n=e.adCouponCurrency,a=e.adCreditAmount,i=e.adCreditMinimumSpend,l=e.adSpendTowardsCoupon,s=e.creditedAccount,u=e.expirationDate,f=e.hasRunFirstLiveVideoAd,g=e.isExistingAdvertiser,h=e.isNewAdvertiser,y=e.pageID,C=e.selectedAdAccount,b=e.setCreditedAccount,v=e.setSelectedAdAccount,S=d(!1),R=S[0],L=S[1],E=h?p:_,k=o("CometRelay").useMutation(E),I=k[0],T=k[1],D=function(t){I({onCompleted:function(t){m.onReady(function(e){return e.log(function(){return{event:"live_producer_landing_page_coupon_enroll_success",page_id:y!=null?y:"",surface:"live_producer",ui_component:"live_producer_landing_page"}})}),b(C),L(!0)},onError:function(t){m.onReady(function(e){return e.log(function(){return{event:"live_producer_landing_page_coupon_enroll_failure",page_id:y!=null?y:"",surface:"live_producer",ui_component:"live_producer_landing_page"}})})},variables:{adAccountID:t,pageID:y}})},x=t.find(function(e){return e.ad_account_id===s}),$=c.jsx("b",{children:x==null?void 0:x.ad_account_name}),P=c.jsx("b",{children:x==null?void 0:x.ad_account_id}),N=l>=i,M=o("PECurrency").formatAmountWithExtendedSymbolAndOffset(n,a),w=o("PECurrency").formatAmountWithExtendedSymbolAndOffset(n,i),A=o("PECurrency").formatAmountWithExtendedSymbolAndOffset(n,l),F=f?o("LiveProducerLP2AdCreditSectionStrings").adCreditAfterEarned($,P):o("LiveProducerLP2AdCreditSectionStrings").adCreditBeforeEarned($,P),O=t.map(function(e){var t={bodyText:o("LiveProducerLP2AdCreditSectionStrings").ELIGIBLE,label:o("LiveProducerLP2AdCreditSectionStrings").adAccountLabel(e.ad_account_name,Number(e.ad_account_id)),value:e.ad_account_id};return babelHelpers.extends({},t,{bodyColor:"positive"})}),B=function(){C!=null&&D(C)},W=c.jsx(r("CometLink.react"),{href:"https://www.facebook.com/legal/couponterms",target:"_blank",children:c.jsx(r("FDSText.react"),{color:"blueLink",type:"body4",children:o("LiveProducerLP2AdCreditSectionStrings").SEE_AD_CREDIT_TERMS})}),q=c.jsxs(c.Fragment,{children:[c.jsx(r("CometColumnItem.react"),{children:c.jsx(r("FDSText.react"),{type:"body4",children:o("LiveProducerLP2AdCreditSectionStrings").SELECT_AD_ACCOUNT_PROMPT})}),c.jsx(r("CometColumnItem.react"),{children:c.jsxs(r("CometRow.react"),{paddingHorizontal:0,paddingVertical:0,spacing:8,children:[c.jsx(r("CometRowItem.react"),{expanding:!0,children:c.jsx(r("FDSSelect.react"),{defaultLabel:o("LiveProducerLP2AdCreditSectionStrings").SELECT_AD_ACCOUNT_DEFAULT_LABEL,dropdownAccessibleLabelProps:{"aria-label":o("LiveProducerLP2AdCreditSectionStrings").SELECT_AD_ACCOUNT_DROPDOWN_ARIA_LABEL},expanded:!0,inputAccessibleLabelProps:{"aria-label":o("LiveProducerLP2AdCreditSectionStrings").AD_ACCOUNT_INPUT_ARIA_LABEL},labelLineLimit:1,onChange:v,options:O,selectedValue:C,size:"small",truncate:!0})}),c.jsx(r("CometRowItem.react"),{children:c.jsx(r("FDSButton.react"),{disabled:C==null,label:o("LiveProducerLP2AdCreditSectionStrings").CONFIRM_BUTTON,onPress:B,size:"medium",type:"primary"})})]})})]}),U=N?o("LiveProducerLP2AdCreditSectionStrings").adCreditEarned(M):o("LiveProducerLP2AdCreditSectionStrings").pageSpentProgress(A,w),V=o("LiveProducerLP2AdCreditSectionStrings").offerExpires(u),H=o("LiveProducerLP2AdCreditSectionStrings").adCreditCredited($,P),G=c.jsx(r("CometColumnItem.react"),{children:c.jsxs(r("CometRow.react"),{paddingHorizontal:0,paddingVertical:0,spacing:12,children:[c.jsx(r("CometRowItem.react"),{children:c.jsx(r("CometImage.react"),{height:40,src:"/images/assets_DO_NOT_HARDCODE/facebook_user_signals/pages-tags-discount_100_light-4x.png",width:40})}),c.jsx(r("CometRowItem.react"),{expanding:!0,children:c.jsxs(r("CometColumn.react"),{paddingHorizontal:0,paddingVertical:4,spacing:0,children:[c.jsx(r("CometColumnItem.react"),{children:c.jsx(r("FDSText.react"),{type:"body4",children:c.jsx("b",{children:U})})}),c.jsx(r("CometColumnItem.react"),{paddingTop:12,children:c.jsx(r("FundraiserProgressBar.react"),{amountRaised:Math.min(i,l),backgroundType:"legacy",goalAmount:i,hasEnded:!1,heightSize:"small"})}),c.jsx(r("CometColumnItem.react"),{paddingTop:4,children:c.jsxs(r("FDSText.react"),{color:"secondary",type:"body4",children:[N?H:V," ",W]})})]})})]})}),z=s==null?q:h?c.jsx(r("CometColumnItem.react"),{children:c.jsx(r("FDSText.react"),{color:"secondary",type:"body4",children:F})}):g&&G,j=s==null||h?c.jsx(r("CometColumnItem.react"),{align:"start",children:W}):null;return c.jsxs(c.Fragment,{children:[R&&x!=null&&c.jsx(o("LiveProducerLP2AdCreditConfirmationPopover.react").LiveProducerLP2AdCreditConfirmationPopover,{accountName:x.ad_account_name,accountNumber:Number(x.ad_account_id),onDismiss:function(){return L(!1)}}),c.jsxs(r("CometColumn.react"),{paddingHorizontal:4,spacing:12,children:[z,j]})]})}f.displayName=f.name+" [from "+i.id+"]",l.default=f}),98);
-----
LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation.graphql",["LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"adAccountID"},{defaultValue:null,kind:"LocalArgument",name:"pageID"}],t=[{alias:null,args:[{kind:"Variable",name:"ad_account_id",variableName:"adAccountID"},{kind:"Variable",name:"page_id",variableName:"pageID"}],concreteType:"XFBLvaRetentionCouponEnrollResponsePayload",kind:"LinkedField",name:"xfb_lva_retention_coupon_enroll",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"enroll_success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation",selections:t,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation",selections:t},params:{id:n("LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation_facebookRelayOperation"),metadata:{},name:"LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null);
-----
LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="24953148271037175"}),null);
-----
-----
LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation.graphql",["LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"adAccountID"},{defaultValue:null,kind:"LocalArgument",name:"pageID"}],t=[{alias:null,args:[{kind:"Variable",name:"ad_account_id",variableName:"adAccountID"},{kind:"Variable",name:"page_id",variableName:"pageID"}],concreteType:"XFBLvaRetentionCouponEnrollResponsePayload",kind:"LinkedField",name:"xfb_lva_retention_coupon_enroll",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"enroll_success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation",selections:t,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation",selections:t},params:{id:n("LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation_facebookRelayOperation"),metadata:{},name:"LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null);
-----
LiveProducerLP2AdCreditSectionEnrollInRetentionCouponMutation_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="24953148271037175"}),null);
-----