LWIInstantAdsGoalPickerModal.react",["fbt","Actor","CometRelay","FDSCardedDialogLegacy.react","GeoVStack.react","LWICometSimpleDialogFooter.react","LWIInstantAdsGoalListItem.react","LWIInstantAdsGoalPickerModalQuery.graphql","LWIInstantAdsGoalPickerModalSaveCTAMutation.graphql","LWIInstantAdsGoalPickerModal_boostedComponent.graphql","LWIOmniTextPairing.react","geoMargin","react","requireDeferred","useLWICometCurrentSpec","useLWICometUIStatusContext","useLWILoggerContext"],(function(pe,L,l,s,Me,z,K,v){"use strict";var p,M,S,f,r=f||(f=s("react")),b=f,P=b.useCallback,N=b.useMemo,g=b.useState,X=l("requireDeferred")("LWICometUnifiedLoggingUtil").__setRef("LWIInstantAdsGoalPickerModal.react"),Y={content:{width:"x14rvwrp",$$css:!0}},Z=p!==void 0?p:p=L("LWIInstantAdsGoalPickerModalSaveCTAMutation.graphql"),ee=M!==void 0?M:M=L("LWIInstantAdsGoalPickerModal_boostedComponent.graphql");function W(x){var c,j,q,o=x.props,te=o.boostedComponentRef,h=o.cta,E=o.goal,k=o.legacyAdAccountID,ae=o.objective,m=o.onClose,H=o.onSaveGoal,oe=o.pageID,R=o.selectedCTAs,D=o.sessionID,ne=x.queries,u=s("CometRelay").usePreloadedQuery(S!==void 0?S:S=L("LWIInstantAdsGoalPickerModalQuery.graphql"),ne.LWIInstantAdsGoalPickerModalQuery),le=s("CometRelay").useFragment(ee,te),O=s("CometRelay").useMutation(Z),B=O[0],se=O[1],Q=l("useLWILoggerContext")(),V=l("useLWICometCurrentSpec")(),_=N(function(){var t;return u==null||(t=u.page)==null||(t=t.lwi_instant_ads_page_info)==null||(t=t.session)==null?void 0:t.goals.map(function(e){var i=e.selected_ctas.map(function(A){return e.ctas_values.find(function(a){return a.type===A})}).filter(Boolean);return{businessGoal:e.business_goal,defaultCTA:i==null?void 0:i[0],eligibleCTAsValues:e.ctas_values,goal:e.goal,goal_description_fbt:e.goal_description_fbt,goal_fbt:e.goal_fbt,objective:e.objective,selectedCTAs:i}}).filter(Boolean)},[u==null||(c=u.page)==null||(c=c.lwi_instant_ads_page_info)==null||(c=c.session)==null?void 0:c.goals]),U=g({goal:E,objective:ae}),n=U[0],ie=U[1],$=g(h),d=$[0],re=$[1],F=g((j=h==null?void 0:h.link)!=null?j:""),G=F[0],de=F[1],ce=v._(/*BTDS*/""),ue=v._(/*BTDS*/""),J=g(E==="GET_MULTI_MESSAGES"?(q=s("LWIInstantAdsGoalListItem.react").validMessaginDestinations==null?void 0:s("LWIInstantAdsGoalListItem.react").validMessaginDestinations.filter(function(t){return R==null?void 0:R.find(function(e){return e.app_destination===t})}))!=null?q:[]:[]),T=J[0],_e=J[1],y=P(function(t){X.onReady(function(e){e.logWithLoggerAndOptionalSpecContext(Q,V,{action:"cancel",context:"instant_ads",event:"instant_ads_close_goal_modal",extra_data:{closed_from:t},side:"user_action"})}),m()},[Q,m,V]),Ie=r.jsx("div",{className:"xyamay9 xv54qhq x1l90r2v xf7dkkf",children:r.jsx(l("LWIOmniTextPairing.react"),{body:ue,headline:ce,level:2})}),ve=l("useLWICometUIStatusContext")(),w=ve.presubmitErrorNotice,ge=P(function(){var t=(d==null?void 0:d.type)!=null?[d==null?void 0:d.type]:[];if(!(d==null||t==null)){var e=_==null?void 0:_.find(function(a){return a.goal===n.goal}),i=e==null?void 0:e.eligibleCTAsValues,A=null;(e==null?void 0:e.goal)==="GET_WEBSITE_VISITORS"?A=i==null?void 0:i.map(function(a){var I,C;return a.type==null||a.label==null?null:babelHelpers.extends({},a,{label:(I=a.label)!=null?I:"",link:G,type:(C=a.type)!=null?C:"LEARN_MORE"})}).filter(Boolean):(e==null?void 0:e.goal)==="GET_MULTI_MESSAGES"&&(t=T.map(function(a){var I=i==null?void 0:i.find(function(C){return C.app_destination===a});return I==null?void 0:I.type}).filter(Boolean)),B({onCompleted:function(){y("transition"),n.goal!=null&&n.objective!=null&&H(n.goal,n.objective)},variables:{adAccountID:k,input:{ad_account_id:k,ctas_values:A,goal:n.goal,selected_ctas:t,session_id:D}}})}},[B,G,_,k,T,y,H,d,n.goal,n.objective,D]),Ae=r.jsx(l("LWICometSimpleDialogFooter.react"),{hideDivider:!0,primaryButton:{isDisabled:se||w.CALL_TO_ACTION!=null&&w.CALL_TO_ACTION.length!==0&&n.goal==="GET_WEBSITE_VISITORS",label:v._(/*BTDS*/""),onPress:ge},secondaryButton:{label:v._(/*BTDS*/""),onPress:function(){return y("layerCancelButton")}}}),Ce=r.jsx(l("GeoVStack.react"),{xstyle:[l("geoMargin").bottom8,Y.content],children:_==null?void 0:_.map(function(t){return r.jsx(s("LWIInstantAdsGoalListItem.react").LWIInstantAdsGoalListItem,{boostedComponentRef:le,ctaLink:G,goalData:t,messagingDestinationSelection:T,pageRef:u==null?void 0:u.page,selectedCTA:d,selectedGoalAndObjective:n,setCtaLink:de,setMessagingDestinationSelection:_e,setSelectedCTA:re,setSelectedGoalAndObjective:ie},t.goal)})});return r.jsx(s("Actor").ActorProvider,{initialActorID:oe,children:r.jsxs(l("FDSCardedDialogLegacy.react"),{closeButtonType:"deemphasized",onClose:m,size:"content",withCloseButton:!0,children:[Ie,Ce,Ae]})})}W.displayName=W.name+" [from "+z.id+"]",K.default=W}),226);
-----
LWIInstantAdsGoalPickerModalSaveCTAMutation.graphql",["LWIInstantAdsGoalPickerModalSaveCTAMutation_facebookRelayOperation"],(function(o,t,g,c,r,m){"use strict";var u=(function(){var a={defaultValue:null,kind:"LocalArgument",name:"adAccountID"},n={defaultValue:null,kind:"LocalArgument",name:"input"},e=[{kind:"Variable",name:"input",variableName:"input"}],s={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"link",storageKey:null};return{fragment:{argumentDefinitions:[a,n],kind:"Fragment",metadata:null,name:"LWIInstantAdsGoalPickerModalSaveCTAMutation",selections:[{alias:null,args:e,concreteType:"LWIInstantAdsMutationResponse",kind:"LinkedField",name:"lwi_instant_ads_save_goal_and_cta",plural:!1,selections:[s,{alias:null,args:null,concreteType:"XFBLWIInstantAdsSession",kind:"LinkedField",name:"session",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBLWIInstantAdsIntention",kind:"LinkedField",name:"intention",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"useLWIInstantAdsAdgroups_intention"}],storageKey:null},{args:null,kind:"FragmentSpread",name:"useLWIInstantAdsBudget_session"},{args:null,kind:"FragmentSpread",name:"useLWIInstantAdsGoals_session"}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a],kind:"Operation",name:"LWIInstantAdsGoalPickerModalSaveCTAMutation",selections:[{alias:null,args:e,concreteType:"LWIInstantAdsMutationResponse",kind:"LinkedField",name:"lwi_instant_ads_save_goal_and_cta",plural:!1,selections:[s,{alias:null,args:null,concreteType:"XFBLWIInstantAdsSession",kind:"LinkedField",name:"session",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBLWIInstantAdsIntention",kind:"LinkedField",name:"intention",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBLWIInstantAdsPersonaAdGroupContent",kind:"LinkedField",name:"adgroups",plural:!0,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"headline",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"media",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cta",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cta_fbt",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"image_description",storageKey:null},{alias:null,args:null,concreteType:"XFBLWIInstantAdsPersona",kind:"LinkedField",name:"persona",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hook",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"interests",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"selling_points",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tone",storageKey:null},{alias:null,args:null,concreteType:"XFBLWIInstantAdsPersonaDemographics",kind:"LinkedField",name:"demographics",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"age_max",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"age_min",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"education",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gender",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"location",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"occupation",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},l],storageKey:null},{alias:null,args:[{kind:"Variable",name:"ad_account_id",variableName:"adAccountID"},{kind:"Literal",name:"caller",value:"INSTANT_ADS"}],concreteType:"CurrencyQuantity",kind:"LinkedField",name:"budget",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"offset_amount",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ads_lwi_goal",storageKey:null},{alias:null,args:null,concreteType:"XFBLWIInstantAdsGoalData",kind:"LinkedField",name:"goals",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"goal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"business_goal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"goal_fbt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"goal_description_fbt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"objective",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"selected_ctas",storageKey:null},{alias:null,args:null,concreteType:"XFBLWIInstantAdsCTAValues",kind:"LinkedField",name:"ctas_values",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"app_destination",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"app_link",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"page",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"event_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"whatsapp_number",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null}],storageKey:null}],storageKey:null},l],storageKey:null}],storageKey:null}]},params:{id:t("LWIInstantAdsGoalPickerModalSaveCTAMutation_facebookRelayOperation"),metadata:{},name:"LWIInstantAdsGoalPickerModalSaveCTAMutation",operationKind:"mutation",text:null}}})();r.exports=u}),null);
-----
LWIInstantAdsGoalPickerModalSaveCTAMutation_facebookRelayOperation",[],(function(o,t,n,r,a,i){a.exports="24284947714493710"}),null);
-----
-----
LWIInstantAdsGoalPickerModalSaveCTAMutation.graphql",["LWIInstantAdsGoalPickerModalSaveCTAMutation_facebookRelayOperation"],(function(o,t,g,c,r,m){"use strict";var u=(function(){var a={defaultValue:null,kind:"LocalArgument",name:"adAccountID"},n={defaultValue:null,kind:"LocalArgument",name:"input"},e=[{kind:"Variable",name:"input",variableName:"input"}],s={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"link",storageKey:null};return{fragment:{argumentDefinitions:[a,n],kind:"Fragment",metadata:null,name:"LWIInstantAdsGoalPickerModalSaveCTAMutation",selections:[{alias:null,args:e,concreteType:"LWIInstantAdsMutationResponse",kind:"LinkedField",name:"lwi_instant_ads_save_goal_and_cta",plural:!1,selections:[s,{alias:null,args:null,concreteType:"XFBLWIInstantAdsSession",kind:"LinkedField",name:"session",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBLWIInstantAdsIntention",kind:"LinkedField",name:"intention",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"useLWIInstantAdsAdgroups_intention"}],storageKey:null},{args:null,kind:"FragmentSpread",name:"useLWIInstantAdsBudget_session"},{args:null,kind:"FragmentSpread",name:"useLWIInstantAdsGoals_session"}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a],kind:"Operation",name:"LWIInstantAdsGoalPickerModalSaveCTAMutation",selections:[{alias:null,args:e,concreteType:"LWIInstantAdsMutationResponse",kind:"LinkedField",name:"lwi_instant_ads_save_goal_and_cta",plural:!1,selections:[s,{alias:null,args:null,concreteType:"XFBLWIInstantAdsSession",kind:"LinkedField",name:"session",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBLWIInstantAdsIntention",kind:"LinkedField",name:"intention",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBLWIInstantAdsPersonaAdGroupContent",kind:"LinkedField",name:"adgroups",plural:!0,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"headline",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"media",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cta",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cta_fbt",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"image_description",storageKey:null},{alias:null,args:null,concreteType:"XFBLWIInstantAdsPersona",kind:"LinkedField",name:"persona",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hook",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"interests",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"selling_points",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tone",storageKey:null},{alias:null,args:null,concreteType:"XFBLWIInstantAdsPersonaDemographics",kind:"LinkedField",name:"demographics",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"age_max",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"age_min",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"education",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gender",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"location",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"occupation",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},l],storageKey:null},{alias:null,args:[{kind:"Variable",name:"ad_account_id",variableName:"adAccountID"},{kind:"Literal",name:"caller",value:"INSTANT_ADS"}],concreteType:"CurrencyQuantity",kind:"LinkedField",name:"budget",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"offset_amount",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ads_lwi_goal",storageKey:null},{alias:null,args:null,concreteType:"XFBLWIInstantAdsGoalData",kind:"LinkedField",name:"goals",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"goal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"business_goal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"goal_fbt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"goal_description_fbt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"objective",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"selected_ctas",storageKey:null},{alias:null,args:null,concreteType:"XFBLWIInstantAdsCTAValues",kind:"LinkedField",name:"ctas_values",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"app_destination",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"app_link",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"page",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"event_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"whatsapp_number",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null}],storageKey:null}],storageKey:null},l],storageKey:null}],storageKey:null}]},params:{id:t("LWIInstantAdsGoalPickerModalSaveCTAMutation_facebookRelayOperation"),metadata:{},name:"LWIInstantAdsGoalPickerModalSaveCTAMutation",operationKind:"mutation",text:null}}})();r.exports=u}),null);
-----
LWIInstantAdsGoalPickerModalSaveCTAMutation_facebookRelayOperation",[],(function(o,t,n,r,a,i){a.exports="24284947714493710"}),null);
-----