try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`6fcd0493-ec93-464a-9ba2-4ff51059cb06`,e._sentryDebugIdIdentifier=`sentry-dbid-6fcd0493-ec93-464a-9ba2-4ff51059cb06`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{H as t,Qh as n,Qm as r,Rc as i,Yh as a,Zm as o,jg as s,zc as c}from"./entry.client-mpghtlrl.js";import{t as l}from"./PendingFriendRequestType-o03at4sn.js";var u=e(s(),1),d=(e,s,d)=>{let{privacy:f,dialog:p,settings:m,toasts:h}=o(),{trackUserAction:g}=r(),{data:_,isError:v,isPending:y}=n(f.queries.privacySettingValue.getActiveUserQuery().getOptions(c.ShareIdentity)),{mutate:b}=a(p.mutations.open.getOptions()),{data:x}=n(m.queries.showIdentitySharingConfirmationDialogSetting.getOptions()),{mutate:S}=a(h.mutations.showStandardToast.getOptions()),{locFailedAcceptFriendRequest:C,locFailedSendFriendRequest:w}=t(),T=p.keys.identitySharingConfirmation.fullPath;return(0,u.useCallback)(()=>{if(v){S({namespace:`Social`,level:`error`,content:s===l.Incoming?C():w()});return}if(y||!d){e(!1);return}_===i.PeopleOnMyList&&x||_===i.FriendCategoryShareIdentity?(g(`OpenModal`,{modalType:p.keys.identitySharingConfirmation.fullPath},`Press`),b({key:T,props:{onApprove:e,friendRequestType:s,targetGamertag:d},options:{navigationType:`stacked`}})):e(!1)},[s,v,y,C,w,e,b,_,x,S,d,g,T])},f=e=>{let{trackUserAction:t}=r();return{trackSuccessfulSendRequest:(0,u.useCallback)(n=>{t(`FriendInteraction`,{type:`SendRequest`,wasSuccessful:!0,wasRealNameShared:n},`Press`,{location:e})},[t]),trackFailedSendRequest:(0,u.useCallback)(n=>{t(`FriendInteraction`,{type:`SendRequest`,wasSuccessful:!1,wasRealNameShared:n},`Press`,{location:e})},[t]),trackSuccessfulAcceptRequest:(0,u.useCallback)(n=>{t(`FriendInteraction`,{type:`AcceptRequest`,wasSuccessful:!0,wasRealNameShared:n},`Press`,{location:e})},[t]),trackFailedAcceptRequest:(0,u.useCallback)(n=>{t(`FriendInteraction`,{type:`AcceptRequest`,wasSuccessful:!1,wasRealNameShared:n},`Press`,{location:e})},[t]),trackSuccessfulBatchAcceptRequests:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`BatchAcceptRequests`,wasSuccessful:!0},`Press`,{location:e})},[t]),trackFailedBatchAcceptRequests:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`BatchAcceptRequests`,wasSuccessful:!1},`Press`,{location:e})},[t]),trackSuccessfulDeclineRequest:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`DeclineRequest`,wasSuccessful:!0},`Press`,{location:e})},[t]),trackFailedDeclineRequest:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`DeclineRequest`,wasSuccessful:!1},`Press`,{location:e})},[t]),trackSuccessfulBatchDeclineRequests:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`BatchDeclineRequests`,wasSuccessful:!0},`Press`,{location:e})},[t]),trackFailedBatchDeclineRequests:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`BatchDeclineRequests`,wasSuccessful:!1},`Press`,{location:e})},[t]),trackSuccessfulCancelRequest:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`CancelRequest`,wasSuccessful:!0},`Press`,{location:e})},[t]),trackFailedCancelRequest:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`CancelRequest`,wasSuccessful:!1},`Press`,{location:e})},[t]),trackSuccessfulBatchCancelRequests:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`BatchCancelRequests`,wasSuccessful:!0},`Press`,{location:e})},[t]),trackFailedBatchCancelRequests:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`BatchCancelRequests`,wasSuccessful:!1},`Press`,{location:e})},[t]),trackSuccessfulRemoveFriend:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`RemoveFriend`,wasSuccessful:!0},`Press`,{location:e})},[t]),trackFailedRemoveFriend:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`RemoveFriend`,wasSuccessful:!1},`Press`,{location:e})},[t]),trackSuccessfulToggleFavorite:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`ToggleFavorite`,wasSuccessful:!0},`Press`,{location:e})},[t]),trackFailedToggleFavorite:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`ToggleFavorite`,wasSuccessful:!1},`Press`,{location:e})},[t]),trackSuccessfulRemoveSuggestion:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`RemoveSuggestion`,wasSuccessful:!0},`Press`,{location:e})},[t]),trackFailedRemoveSuggestion:(0,u.useCallback)(()=>{t(`FriendInteraction`,{type:`RemoveSuggestion`,wasSuccessful:!1},`Press`,{location:e})},[t])}};export{d as n,f as t};