;/*FB_PKG_DELIM*/ __d("XChatPluginProfilePlusVoiceSwitchPopupController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/plugins/chat/voice_switch/",{})}),null); __d("MPNDesktopWelcomePageBottomButtons.react",["cx","fbt","ChatPluginTestId","EllipsisText.react","LineClamp.react","LiveChatPluginConstants","LiveChatPluginFbts","LiveChatPluginLoggerUtil","MPNConstants","MPNIdentity","MPNLocalState","MPNMessengerIconSVG.react","MPNNavigation","MPNStorage","MPNXDMessageManager","MessagingPluginContext","MessagingPluginThreadActions","PopupWindow","ShimButton.react","XChatPluginIncognitoLoginPopupController","XChatPluginProfilePlusVoiceSwitchPopupController","cr:878","gkx","performanceAbsoluteNow","react"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l=k||d("react");a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;for(var g=arguments.length,h=new Array(g),i=0;i0?(a.setState({menuItems:b}),f({type:"TOGGLE_HAS_PERSISTENT_MENU",hasPersistentMenu:!0})):(a.setState({menuItems:[]}),f({type:"TOGGLE_HAS_PERSISTENT_MENU",hasPersistentMenu:!1}))});break;case d("MPNIdentity").MPNIdentityState.FB:e=c("XMessengerBotsMenuController").getURIBuilder().setString("page_id",b).setBool("should_flatten",!0).getURI();this.$1=new(c("AsyncRequest"))().setURI(e).setHandler(function(b){a.setState({menuItems:b.payload.menu})}).setErrorHandler(function(b){a.setState({menuItems:[]})});this.$1.send();break;default:return}};e.$4=function(){this.setState(this.$3(!0)),this.props.onClick()};e.$3=function(a){var b=this.context.state.pageID,c=d("MPNIdentity").MPNIdentity.currentUserID();d("LiveChatPluginLoggerUtil").logActionUsingFalco(c,b,d("MPNIdentity").MPNIdentity.currentUserState()===d("MPNIdentity").MPNIdentityState.FB?"logged_in_chat_tab":"guest_chat_tab",a?"customer_chat_bot_menu_opened":"customer_chat_bot_menu_closed")};return b}(k.Component);a.contextType=c("MessagingPluginContext");g["default"]=a}),226); __d("MessagingPluginDesktopProfilePicture.react",["cx","ix","Image.react","MPNConstants","MessagingPluginContext","PrivacyTransparentOverlay.react","joinClasses","react"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k=j||d("react");a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var e=b.prototype;e.render=function(){var a=this.context.state,b=a.pageProfilePictureUri,e=a.isPageAway;a=a.awayHoursEnabled;var f=this.props,g=f.className;f=f.availablityIconSize;var h=e?"_a7a1":"_a2gl";f=f===d("MPNConstants").MPNAvailablityIconSize.LARGE?"_a7a2":"_a7a3";h=c("joinClasses")(h,f);f=e?k.jsx(c("Image.react"),{className:h,src:i("213835")}):k.jsx("div",{className:h});return k.jsxs(c("PrivacyTransparentOverlay.react"),{children:[k.jsx(c("Image.react"),{className:(e=g)!=null?e:"_a3jw",src:b}),a?f:null]})};return b}(k.Component);a.contextType=c("MessagingPluginContext");g["default"]=a}),98); __d("MessagingPluginDesktopThreadMenu.react",["cx","fbt","FDSSeparatorMenuItem.react","LiveChatPluginFbts","LiveChatPluginLoggerUtil","MPNDropdownMenu","MPNDropdownMenuItem","MPNIdentity","MessagingPluginContext","MessagingPluginThreadActions","ODS","URI","gkx","react"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l,m=k||(k=d("react")),n=k.useContext;function a(a){var b;a.history;var e=a.isMuted,f=a.onClickMuteOrUnmute;a.onClose;var g=a.onUpgrade,h=n(c("MessagingPluginContext")),k=d("MPNIdentity").MPNIdentity.currentUserID();a=h.state;var p=a.pageID,q=a.isPageBlocked,r=a.locale,s=a.showUpgradeUpsellPrompt,t=a.isPageInEU;a=a.isLightswitchEnabledForGuest;var u=d("MPNIdentity").MPNIdentity.currentUserState()===d("MPNIdentity").MPNIdentityState.GUEST,v=!0;b=(b=h.state.threadExists)!=null?b:!1;!u?v=c("gkx")("25811"):v=a!==!0;v=v&&!t&&b;v||(u&&a===!0&&(l||(l=d("ODS"))).bumpEntityKey(4205,"chat_plugin","chat_plugin.epd.guest_frx_entry_point_blocked_eu_guest"),!u&&!c("gkx")("25811")&&(l||(l=d("ODS"))).bumpEntityKey(4205,"chat_plugin","chat_plugin.epd.guest_frx_entry_point_blocked_eu_fb_user"),t&&(l||(l=d("ODS"))).bumpEntityKey(4205,"chat_plugin","chat_plugin.epd.guest_frx_entry_point_blocked_eu_page"));return m.jsxs(c("MPNDropdownMenu"),{className:"_a2zx",children:[u&&s?m.jsx(c("MPNDropdownMenuItem"),{"data-testid":void 0,iconSrc:"/images/web_messenger/app-messenger_32-4x.png",onClick:function(){return g()},primaryText:i._("Ti\u1ebfp t\u1ee5c trong Messenger")}):null,m.jsx(c("MPNDropdownMenuItem"),{"data-testid":void 0,iconSrc:"/images/web_messenger/cross-circle_32-4x.png",onClick:function(){o(k,p,u,"end_chat_menu_item"),h.dispatchAction({type:"TOGGLE_END_CHAT",showEndChat:!0})},primaryText:i._("K\u1ebft th\u00fac \u0111o\u1ea1n chat")}),!u&&q!=null?m.jsx(c("MPNDropdownMenuItem"),{"data-testid":void 0,iconSrc:"/images/web_messenger/message-cross_32-4x.png",onClick:function(){d("MessagingPluginThreadActions").blockOrUnblockPage(h)},primaryText:q?i._("B\u1eadt tin nh\u1eafn"):i._("T\u1eaft tin nh\u1eafn")}):null,u?null:m.jsx(c("MPNDropdownMenuItem"),{"data-testid":void 0,iconSrc:e?"/images/web_messenger/bell-cross_32-4x.png":"/images/web_messenger/bell_32-4x.png",onClick:f,primaryText:d("LiveChatPluginFbts").getMuteConversationButtonText(e)}),v?m.jsx(c("MPNDropdownMenuItem"),{"data-testid":void 0,iconSrc:"/images/web_messenger/caution-triangle_32-4x.png",onClick:function(){o(k,p,u,"frx_entry_point"),d("MessagingPluginThreadActions").openFRXPrompt(p,r,"report_button")},primaryText:d("LiveChatPluginFbts").getOpenFRXButtonText()}):null,m.jsx(c("FDSSeparatorMenuItem.react"),{}),m.jsx(c("MPNDropdownMenuItem"),{"data-testid":void 0,onClick:function(){o(k,p,u,"visit_facebook_page_menu_item"),(j||(j=c("URI"))).goURIOnNewWindow("https://www.facebook.com/"+p)},primaryText:i._("Truy c\u1eadp Trang Facebook")}),m.jsx(c("MPNDropdownMenuItem"),{"data-testid":void 0,onClick:function(){o(k,p,u,"add_messenger_to_your_website_menu_item"),(j||(j=c("URI"))).goURIOnNewWindow("https://www.facebook.com/business/m/add-messenger-to-your-website")},primaryText:i._("Th\u00eam Messenger v\u00e0o trang web c\u1ee7a b\u1ea1n")})]})}a.displayName=a.name+" [from "+f.id+"]";function o(a,b,c,e){d("LiveChatPluginLoggerUtil").logActionFromNewUI("in_thread_action",a,b,c?"guest_chat_tab":"logged_in_chat_tab",{button_name:e})}g["default"]=a}),226); __d("MPNDesktopDialogHeader.react",["cx","fbt","Arbiter","BasePopoverTrigger.react","FlexLayout.react","LineClamp.react","LiveChatPluginLoggerUtil","MPNConstants","MPNHeaderActionButton.react","MPNIdentity","MPNMinusButtonSVG.react","MPNMoreInfoButtonSVG.react","MPNThreadPageHeaderSubtitle.react","MPNVerifiedBadge.react","MessagingPluginContext","MessagingPluginDesktopProfilePicture.react","MessagingPluginDesktopThreadMenu.react","MessagingPluginThreadActions","QE2Logger","react"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k=j||d("react");a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g0;break;case"fade":b=c>0;g=c;f=d("LiveChatPluginConstants").PLUGIN_FADE_DELAY;break;case"hide":b=!1;break;default:break}if(!b)return;this.$3=window.setTimeout(function(){a.$13(f)},g)};e.$13=function(a){var b=this,c=this.context.state.optimisticStorageState;c.visibility===d("MPNConstants").MPNVisibility.HIDDEN&&(d("MPNNavigation").maximizePlugin(this.context,!1),a!=null&&(this.$4=window.setTimeout(function(){c.visibility!==d("MPNConstants").MPNVisibility.HIDDEN&&d("MPNNavigation").minimizePlugin(b.context)},a)))};e.$8=function(){var a=this;c("MPNXDMessageManager").subscribeEvent("plugin_wrapper","message","updateCustomerChat",function(b){d("MessagingPluginSDKActionUtil").updateGreetingTextAndRefParam(a.context,b)});c("MPNXDMessageManager").subscribeEvent("plugin_wrapper","message","CustomerChat.isDialogHidden",function(b){d("MessagingPluginSDKActionUtil").updateDialogVisibility(a.context,b)})};e.render=function(){switch(this.actionOnInit){case j.CREATE_GUEST_SESSION:this.actionOnInit=j.NONE;this.$6(function(){c("MPNStorage").clearRedirectCommand()});break;case j.START_NEW_THREAD:this.actionOnInit=j.NONE;c("MPNStorage").clearRedirectCommand();d("MessagingPluginThreadActions").openThreadWithCurrentFBUser(this.context,!1);break;case j.GUEST_UPGRADE:this.actionOnInit=j.NONE;c("MPNStorage").clearRedirectCommand();d("MessagingPluginGuestUpgradeActions").clearGuestStorage(this.context);d("MessagingPluginGuestUpgradeActions").setPluginStateToUpgradedThread(this.context);break;case j.GUEST_UPGRADE_SWITCH_ACCOUNT:this.actionOnInit=j.NONE;c("MPNStorage").clearRedirectCommand();d("MPNIdentity").MPNIdentity.subscribeLoggedInUserChanges(function(a,b){a=c("MPNStorage").getFBStorageState();a!=null&&c("MPNStorage").setFBStorageState(babelHelpers["extends"]({},a,{rdr:d("MPNConstants").MPNRedirect.GUEST_UPGRADE}));c("MPNXDMessageManager").reloadPlugin()},250);break;case j.SHOW_LOGIN_PAGE:this.actionOnInit=j.NONE;c("MPNStorage").clearRedirectCommand();c("MPNXDMessageManager").updateShouldShowLoginPage(!1);this.shouldShowLoginPage=!0;c("MPNStorage").setPath(d("MPNLocalState").MPNLocalStatePath.WELCOME_PAGE);this.context.dispatchAction({type:"UPDATE_DIALOG_PATH",path:d("MPNLocalState").MPNLocalStatePath.WELCOME_PAGE});break;case j.SWITCH_ACCOUNT:this.actionOnInit=j.NONE;c("MPNStorage").clearRedirectCommand();d("MPNIdentity").MPNIdentity.subscribeLoggedInUserChanges(function(a,b){if(b!=="0"){a=c("MPNStorage").getFBStorageState();a!=null&&(c("MPNStorage").setFBStorageState(babelHelpers["extends"]({},a,{rdr:d("MPNConstants").MPNRedirect.SHOW_LOGIN_PAGE})),c("MPNXDMessageManager").reloadPlugin())}},d("LiveChatPluginConstants").LOGIN_CHECK_INTERVAL);break;default:break}return this.context.state.optimisticStorageState.visibility===d("MPNConstants").MPNVisibility.NOT_HIDDEN||this.iconIframeLoaded||this.context.state.shouldShowReEngagement&&this.initialPath===d("MessagingPluginPathUtils").MPN_PATH.BUBBLE?i.jsx(c("MPNDesktopRoute.react"),{path:this.initialPath,ActionDelegate:this.ActionDelegate,shouldShowLoginPage:this.shouldShowLoginPage,shouldShowReEngagement:this.context.state.shouldShowReEngagement}):null};return b}(i.Component);a.contextType=c("MessagingPluginContext");g["default"]=a}),98); __d("MessagingPluginDesktopRoot",["cx","CometBlueBridgeKeyCommandListener.react","LiveChatPluginErrorBoundary.react","MPNCacheVersioning","MPNConstants","MPNDesktopWrapper.react","MPNIdentity","MPNLocalState","MPNStorage","MPNXDMessageManager","MessagingPluginPathUtils","MessagingPluginStateProvider","ReactDOM","URI","performanceAbsoluteNow","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k,l=k||d("react");a=function(){function a(a){var b=a.alignment,c=a.pageID,d=a.container,e=a.serverTime,f=a.clientRequestTime,g=a.pagePassesSentryTest,h=a.hasMessagingPermission,i=a.isMuted,j=a.isPageBlocked,k=a.isBusinessActive,l=a.requestID,m=a.refererUri,n=a.originDomain,o=a.soundURLs,p=a.hasGuestMode,q=a.showUpgradeUpsellPrompt,r=a.hasAutomation,s=a.appSwitchUri,t=a.upgradeAppSwitchUri,u=a.storedStates,v=a.isComposerDisabled,w=a.hasPersistentMenu,x=a.pageName,y=a.pageProfilePictureUri,z=a.viewerProfilePicureUri,A=a.pageResponsiveness,B=a.isInstantlyResponsive,C=a.refParam,D=a.pageVerifiedStatus,E=a.greetingDialogDelay,F=a.greetingDialogDisplay,G=a.loggedInGreeting,H=a.loggedOutGreeting,I=a.threadCSSColor,J=a.entryPointIconSVG,aa=a.entryPointIconEnum,ba=a.entryPointLabel,ca=a.locale,da=a.icebreakers,ea=a.icebreakerCtas,fa=a.bottomSpacing,ga=a.sideSpacing,ha=a.isPageInEU,ia=a.threadExists,ja=a.isLoadedByFacade,ka=a.loggedInAccessToken,K=a.isSanitizedEpd3pdRequest,la=a.shouldShowReEngagement,ma=a.shouldBypassPageSentryTest,na=a.shouldUseAccessTokenAuth,L=a.entryPointSize,M=a.windowSize,oa=a.awayHoursEnabled,N=a.awayGreeting,pa=a.isPageAway,O=a.nextAvailableTimestamp,qa=a.optInMessageEnabled,ra=a.optInMessageCadence,sa=a.collapsedOptInMessageTitle,ta=a.expandedOptInMessageTitle,P=a.collapsedOptInMessageText;a=a.expandedOptInMessageText;try{this.$1(b,c,d,e,f,g,h,i,j,k,l,m,n,o,s,t,p,q,r,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,K,la,ma,na,L,M,oa,N,pa,O,qa,ra,sa,ta,P,a)}catch(a){}}var b=a.prototype;b.$1=function(a,b,e,f,g,h,k,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,K,la,ma,na,L,M,oa,N,pa,O,qa,ra,sa,ta,P,ua,va,wa,xa,ya){var za=!1;c("MPNStorage").initialize(r,b,p);d("MPNIdentity").MPNIdentity.hasStorageAccess(function(Q){var R,S;d("MPNIdentity").MPNIdentity.init(Q,L);var T=p,U=y;U&&(d("MPNCacheVersioning").isLatestVersion(U.v)||(c("MPNStorage").clearThirdPartyStorageState(),U=null));R=(R=U)==null?void 0:R.rdet;R=c("MPNStorage").getShouldRenderReEngagementDialog(M,P,R);S=(S=(S=U)==null?void 0:S.isGreetingDismissed)!=null?S:!1;U||(U=c("MPNStorage").getDefaultOptimisticStorageState(!1,J,I,R,M,S),c("MPNStorage").setThirdPartyStorageState(U));var Aa=!1,Ba,Ca,V=U.visibility,W=U.greetingVisibility,X=U.shouldShowLoginPage,Y=U.isReEngagementOptIn;if(Q){var Z,$=c("MPNStorage").getFBStorageState();Z=(Z=$)==null?void 0:Z.rdr;Z==null&&!d("MPNCacheVersioning").isLatestVersion((Z=$)==null?void 0:Z.v)&&(c("MPNStorage").clearFBStorageState(),$=c("MPNStorage").getFBStorageState());c("MPNStorage").isAccessTokenExpired()&&(c("MPNStorage").clearFBStorageState(),U=c("MPNStorage").getDefaultOptimisticStorageState(!1,J,I,R,M,S),c("MPNStorage").setThirdPartyStorageState(U));if($!=null&&$.requestID!=null&&$.requestID!=""){Z=$.requestID;($.rdr===d("MPNConstants").MPNRedirect.NEW_GUEST_SESSION||$.rdr===d("MPNConstants").MPNRedirect.ITP_CONTINUE_SESSION)&&(T=Z,c("MPNStorage").initialize(r,b,Z))}za=c("MPNStorage").setInitialStateIfNecessary(!1,V,J,X,Y,R,W,S);$=c("MPNStorage").getFBStorageState();if($!=null){Aa=$.chatState!=d("MPNLocalState").MPNChatState.CHAT_NOT_STARTED;Ba=$.accessToken;Ca=$.userID;V=$.visibility;U=babelHelpers["extends"]({},U,{path:$.currentPath,chatState:$.chatState,visibility:$.visibility,showUpgradePrompt:(Z=$.showUpgradePrompt)!=null?Z:d("MPNConstants").MPNUpgradePrompt.NOT_SHOWN,greetingVisibility:$.greetingVisibility});c("MPNStorage").setThirdPartyStorageState(U)}}d("MPNIdentity").MPNIdentity.subscribeLoggedInUserChanges(function(a,b){d("MPNIdentity").MPNIdentity.currentUserState()!=d("MPNIdentity").MPNIdentityState.GUEST&&(c("MPNStorage").clearFBStorageState(),c("MPNStorage").clearThirdPartyStorageState()),c("MPNXDMessageManager").reloadPlugin()});X=c("MPNStorage").getFBStorageState();Y=d("MessagingPluginPathUtils").getDesktopDisplayPathFromStoredState(Q,U,L,X,R,J==="show");W=Y===d("MessagingPluginPathUtils").MPN_PATH.REENGAGEMENT_COLLAPSED||Y===d("MessagingPluginPathUtils").MPN_PATH.REENGAGEMENT_EXPANDED;if(Y===d("MessagingPluginPathUtils").MPN_PATH.THREAD&&U.chatState===d("MPNLocalState").MPNChatState.CHAT_NOT_STARTED||W&&!R&&(X==null?void 0:X.rdr)!==d("MPNConstants").MPNRedirect.RE_ENGAGEMENT_LOG_IN){Z=c("MPNStorage").getDefaultPath(!1,V,J,R);Y=d("MessagingPluginPathUtils").MessagingPluginPathUtils.toMobilePath(Z);U=babelHelpers["extends"]({},U,{path:Z});c("MPNStorage").setThirdPartyStorageState(U)}if(M){$=c("MPNStorage").getDefaultVisibility({visibility:U.visibility,greetingVisibility:d("MPNConstants").MPNVisibility.HIDDEN},d("MessagingPluginPathUtils").MessagingPluginPathUtils.toEnumPath(Y),M,J,S,!1);Y===d("MessagingPluginPathUtils").MPN_PATH.BUBBLE?(U=babelHelpers["extends"]({},U,{visibility:$.visibility,greetingVisibility:$.greetingVisibility}),c("MPNStorage").setThirdPartyStorageState(U)):Y===d("MessagingPluginPathUtils").MPN_PATH.REENGAGEMENT_COLLAPSED?(U=babelHelpers["extends"]({},U,{path:d("MessagingPluginPathUtils").MessagingPluginPathUtils.toEnumPath(Y),visibility:d("MPNConstants").MPNVisibility.NOT_HIDDEN,greetingVisibility:$.greetingVisibility}),c("MPNStorage").setThirdPartyStorageState(U)):(U=babelHelpers["extends"]({},U,{greetingVisibility:d("MPNConstants").MPNVisibility.HIDDEN}),c("MPNStorage").setThirdPartyStorageState(U))}Q={alignment:a,pageID:b,pageName:B,pagePassesSentryTest:h,hasMessagingPermission:k,isMuted:m,isPageBlocked:n,pageProfilePictureUri:C,viewerProfilePicureUri:D,threadCSSColor:ca,entryPointIconSVG:da,entryPointIconEnum:ea,entryPointLabel:fa,pageResponsiveness:E,isInstantlyResponsive:F,isComposerDisabled:z,hasActiveAutomation:!1,hasPersistentMenu:A,greetingDialogDelay:I,greetingDialogDisplay:J,loggedInGreeting:aa,loggedOutGreeting:ba,refParam:G,refererUri:q,originDomain:r,appSwitchUri:t,upgradeAppSwitchUri:u,locale:ga,isBusinessActive:o,icebreakers:ha,icebreakerCtas:ia,pageVerifiedStatus:H,initialRequestUri:(i||(i=c("URI"))).getRequestURI(),requestID:T,bottomSpacing:ja,sideSpacing:ka,chatStarted:Aa,accessToken:Ba,guestID:Ca,optimisticStorageState:U,soundURLs:s,isInitialLoad:za,hasGuestMode:v,showUpgradeUpsellPrompt:w,pluginMountTime:(j||(j=c("performanceAbsoluteNow")))(),serverTime:f,clientRequestTime:g,upgradeUpsellPrompt:d("MPNConstants").MPNUpgradePrompt.NOT_SHOWN,messageCount:null,cookieAccessDenied:!1,hasAutomation:x&&!K,isPageInEU:K,threadExists:la,isLoadedByFacade:ma,isLightswitchEnabledForGuest:!1,loggedInAccessToken:na,isSanitizedEpd3pdRequest:L,shouldShowReEngagement:M,shouldBypassPageSentryTest:oa,shouldUseAccessTokenAuth:N,entryPointSize:pa,windowSize:O,awayHoursEnabled:qa,awayGreeting:ra,isPageAway:sa,nextAvailableTimestamp:ta,optInMessageEnabled:P,optInMessageCadence:ua,collapsedOptInMessageTitle:va,expandedOptInMessageTitle:wa,collapsedOptInMessageText:xa,expandedOptInMessageText:ya,shouldRenderReEngagementDialog:R};(W=document.body)==null?void 0:(X=W.classList)==null?void 0:X.add("_a2w-");(V=document.body)==null?void 0:(Z=V.classList)==null?void 0:Z.add("_95ry");S=O==="compact";c("MPNStorage").setWindowSizeMode(S);S&&(($=document.body)==null?void 0:(T=$.classList)==null?void 0:T.add("_a3u7"));d("ReactDOM").render(l.jsx(c("LiveChatPluginErrorBoundary.react"),{pageID:b,shouldUseNewDomain:N,children:l.jsx(c("CometBlueBridgeKeyCommandListener.react"),{children:l.jsx(c("MessagingPluginStateProvider"),{initialState:Q,children:l.jsx(c("MPNDesktopWrapper.react"),{path:Y,redirectCommand:c("MPNStorage").getRedirectCommand()})})})}),e,"MessagingPluginDesktopRoot.js")})};return a}();g["default"]=a}),98);