OCDevManageApplicationsMonetizationBonusesAnalyticsV3.react",["fbt","ix","GeoBaseText.react","GeoCard.react","GeoDivider.react","GeoDropdownMenu.react","GeoFlexbox.react","GeoMenuItem.react","HorizonWorldsCreatorMonetizationBonusesAnalyticsDatePickerConstsV2","MHCPBonusEstimatesSitevarConfig","OCDevManageApplicationsMonetizationBonusesAnalyticsV3Query.graphql","OCDevManageWorldsMonetizationBonusesAnalyticsBreakdownTableV2.react","OCDevManageWorldsMonetizationBonusesAnalyticsBreakdownTableV3.react","OCDevManageWorldsMonetizationBonusesAnalyticsCardsRowV3.react","OCDevManageWorldsMonetizationBonusesMonthEndEstimatesAnalyticsCardsRowV3.react","fbicon","geoMargin","geoWidth","react","sumOfArray","testID","useOCDevUIQuery"],(function(t,n,r,o,a,i,l,s,u){"use strict";var e,c,d=c||(c=o("react")),m=c,p=m.useMemo,_=m.useState,f=e!==void 0?e:e=n("OCDevManageApplicationsMonetizationBonusesAnalyticsV3Query.graphql");function g(e){var t,n,a=e.organizationId,l=p(function(){function e(e){var t=o("HorizonWorldsCreatorMonetizationBonusesAnalyticsDatePickerConstsV2").monthNames[e.getMonth()],n=e.getFullYear();return t+" "+n}return[e(o("HorizonWorldsCreatorMonetizationBonusesAnalyticsDatePickerConstsV2").todayDate.toUTCDate()),e(o("HorizonWorldsCreatorMonetizationBonusesAnalyticsDatePickerConstsV2").todayDate.subtractMonths(1).toUTCDate()),e(o("HorizonWorldsCreatorMonetizationBonusesAnalyticsDatePickerConstsV2").todayDate.subtractMonths(2).toUTCDate())]},[]),c=_(l[0]),m=c[0],g=c[1],h=o("HorizonWorldsCreatorMonetizationBonusesAnalyticsDatePickerConstsV2").getStartAndEndDate(m),y=o("HorizonWorldsCreatorMonetizationBonusesAnalyticsDatePickerConstsV2").isCurrentMonth(m),C=o("HorizonWorldsCreatorMonetizationBonusesAnalyticsDatePickerConstsV2").isMonthPriorToMarch(m);function b(e){return e}function v(e){return e.split(" ")[0]}function S(e){var t;return{headset_total:(t=r("sumOfArray"))(e.map(function(e){return e.headsetBonus||0})),iwp_total:t(e.map(function(e){return e.iwpBonus||0})),mobile_total:t(e.map(function(e){return e.mobileBonus||0})),retention_total:t(e.map(function(e){return e.retentionBonus||0})),total_all_platforms:t(e.map(function(e){return e.bonusTotal||0}))}}function R(e,t,n){return e||!t?s._(/*BTDS*/"Estimated {Month bonus} bonus earnings",[s._param("Month bonus",v(n))]):s._(/*BTDS*/"{Month bonus} bonus earnings",[s._param("Month bonus",v(n))])}R.displayName=R.name+" [from "+i.id+"]";function L(e,t){return e||!t?null:d.jsx(r("GeoBaseText.react"),{color:"heading",size:"value",children:s._(/*BTDS*/"Bonuses you earned in each monthly program")})}L.displayName=L.name+" [from "+i.id+"]";var E=r("useOCDevUIQuery")(f,{end_date:h.end.toString(),start_date:h.start.toString(),organization_id:a},{fetchPolicy:"store-and-network"}),k=(t=E.node)==null||(t=t.applications)==null?void 0:t.edges,I=(n=k==null?void 0:k.map(function(e){var t,n,r,o,a,i,l,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T,D,x,$,P,N,M,w,A,F,O,B,W,q,U,V,H,G,z,j,K,Q,X,Y,J,Z,ee,te,ne=(t=e==null||(n=e.node)==null?void 0:n.id)!=null?t:"",re=(r=e==null||(o=e.node)==null||(o=o.horizon_bonus_insights)==null?void 0:o.timespent_seconds)!=null?r:0,oe=(a=e==null||(i=e.node)==null||(i=i.horizon_bonus_insights)==null?void 0:i.cross_screens_timespent_seconds)!=null?a:0,ae=Math.floor(re/3600),ie=Math.floor(oe/3600);return{bonusTotal:(l=e==null||(s=e.node)==null||(s=s.horizon_bonus_insights)==null?void 0:s.bonus_total)!=null?l:0,crossScreensTimeSpent:ie,headsetBonus:(u=e==null||(c=e.node)==null||(c=c.horizon_bonus_insights)==null?void 0:c.headset_bonus)!=null?u:0,headsetEligible:(d=e==null||(m=e.node)==null||(m=m.horizon_bonus_insights)==null?void 0:m.headset_eligible)!=null?d:!1,iwpBonus:(p=e==null||(_=e.node)==null||(_=_.horizon_bonus_insights)==null?void 0:_.iwp_bonus)!=null?p:0,iwpEarnings:(f=e==null||(g=e.node)==null||(g=g.horizon_bonus_insights)==null?void 0:g.in_world_purchase_earnings)!=null?f:0,iwpEligible:(h=e==null||(y=e.node)==null||(y=y.horizon_bonus_insights)==null?void 0:y.iwp_eligible)!=null?h:!1,metaCreditsPerPayingUser:(C=e==null||(b=e.node)==null||(b=b.horizon_bonus_insights)==null?void 0:b.average_meta_credits_exchanged)!=null?C:0,mobileBonus:(v=e==null||(S=e.node)==null||(S=S.horizon_bonus_insights)==null?void 0:S.mobile_bonus)!=null?v:0,mobileEligible:(R=e==null||(L=e.node)==null||(L=L.horizon_bonus_insights)==null?void 0:L.mobile_eligible)!=null?R:!1,newToWorldRetentionRate:e==null||(E=e.node)==null||(E=E.horizon_bonus_insights)==null?void 0:E.new_to_world_retention_rate,numRetentionLevel1Days:(k=e==null||(I=e.node)==null||(I=I.horizon_bonus_insights)==null?void 0:I.num_retention_level_1_days)!=null?k:0,numRetentionLevel2Days:(T=e==null||(D=e.node)==null||(D=D.horizon_bonus_insights)==null?void 0:D.num_retention_level_2_days)!=null?T:0,numRetentionLevel3Days:(x=e==null||($=e.node)==null||($=$.horizon_bonus_insights)==null?void 0:$.num_retention_level_3_days)!=null?x:0,numWeeklyNewVisitors:(P=e==null||(N=e.node)==null||(N=N.horizon_bonus_insights)==null?void 0:N.num_weekly_new_visitors)!=null?P:0,numWeeklyUniqueVisitors3D:(M=e==null||(w=e.node)==null||(w=w.horizon_bonus_insights)==null?void 0:w.num_weekly_unique_visitors_3d)!=null?M:0,pctPayingUsers:(A=e==null||(F=e.node)==null||(F=F.horizon_bonus_insights)==null?void 0:F.pct_paying_users)!=null?A:0,retentionBonus:(O=e==null||(B=e.node)==null||(B=B.horizon_bonus_insights)==null?void 0:B.retention_bonus)!=null?O:0,retentionEligible:(W=e==null||(q=e.node)==null||(q=q.horizon_bonus_insights)==null?void 0:q.retention_eligible)!=null?W:!1,retentionRate3D:e==null||(U=e.node)==null||(U=U.horizon_bonus_insights)==null?void 0:U.retention_rate_3d,retentionVersion:e==null||(V=e.node)==null||(V=V.horizon_bonus_insights)==null?void 0:V.retention_version,thumbnailUri:(H=e==null||(G=e.node)==null||(G=G.primary_screenshot)==null?void 0:G.image_uri)!=null?H:"",timeSpent:ae,v3NumRetentionLevel1Days:(z=e==null||(j=e.node)==null||(j=j.horizon_bonus_insights)==null?void 0:j.v3_num_retention_level_1_days)!=null?z:0,v3NumRetentionLevel2Days:(K=e==null||(Q=e.node)==null||(Q=Q.horizon_bonus_insights)==null?void 0:Q.v3_num_retention_level_2_days)!=null?K:0,v3NumRetentionLevel3Days:(X=e==null||(Y=e.node)==null||(Y=Y.horizon_bonus_insights)==null?void 0:Y.v3_num_retention_level_3_days)!=null?X:0,visitorMAU:(J=e==null||(Z=e.node)==null||(Z=Z.horizon_bonus_insights)==null?void 0:Z.monthly_unique_visitors)!=null?J:0,worldID:ne,worldName:(ee=e==null||(te=e.node)==null?void 0:te.name)!=null?ee:"--"}}))!=null?n:[],T=S(I),D=T.headset_total,x=T.iwp_total,$=T.mobile_total,P=T.total_all_platforms,N=r("MHCPBonusEstimatesSitevarConfig").months_with_total_payouts_released,M=!y&&N.includes(m.toLowerCase());return d.jsx(r("GeoFlexbox.react"),babelHelpers.extends({direction:"column",gap:16,xstyle:r("geoWidth").fullWidth},r("testID")("hw-creator-m10n-bonus-analytics-table"),{children:d.jsxs(r("GeoCard.react"),{xstyle:r("geoMargin").bottom16,children:[d.jsxs(r("GeoFlexbox.react"),{direction:"row",justifyContent:"space-between",style:{marginBottom:20,marginLeft:24,marginRight:24,marginTop:20},children:[d.jsxs(r("GeoFlexbox.react"),{direction:"column",justifyContent:"start",style:{flex:1},children:[d.jsx(r("GeoBaseText.react"),{color:"heading",size:"header1",children:R(y,M,m)}),L(y,M)]}),d.jsx(r("GeoFlexbox.react"),{alignContent:"end",justifyContent:"end",children:d.jsx(r("GeoDropdownMenu.react"),{"data-testid":void 0,icon:o("fbicon")._(u("481124"),16),label:m,children:l.map(function(e,t){return d.jsx(r("GeoMenuItem.react"),{"data-testid":void 0,label:e,onClick:function(){return g(e)}},t)})})})]}),d.jsxs(r("GeoFlexbox.react"),{children:[!y&&M&&d.jsx(r("OCDevManageWorldsMonetizationBonusesAnalyticsCardsRowV3.react"),{totalBonus:P,totalHeadsetBonus:D,totalIWPBonus:x,totalMobileBonus:$}),(y||!M)&&d.jsx(r("OCDevManageWorldsMonetizationBonusesMonthEndEstimatesAnalyticsCardsRowV3.react"),{isPreviousMonthWhilePayoutsAreReleased:!y&&!M,monthSelection:m,totalBonus:P,totalHeadsetBonus:D,totalIWPBonus:x,totalMobileBonus:$})]}),d.jsx(r("GeoDivider.react"),{}),d.jsxs(r("GeoFlexbox.react"),{style:{marginLeft:24,marginRight:26,marginTop:6},children:[!C&&d.jsx(r("OCDevManageWorldsMonetizationBonusesAnalyticsBreakdownTableV3.react"),{canSeePreviousMonthTotals:M,dateRangeStart:h.start,isCurrentMonthSelected:y,worldBonusInfoList:I}),C&&d.jsx(r("OCDevManageWorldsMonetizationBonusesAnalyticsBreakdownTableV2.react"),{dateRangeStart:h.start,worldBonusInfoList:I})]})]})}))}g.displayName=g.name+" [from "+i.id+"]",l.default=g}),226);
-----