12 |
- (self.webpackChunk_twitter_responsive_web=self.webpackChunk_twitter_responsive_web||[]).push([["loader.AppModules","loader.LoggedOutNotifications"],{86625:(e,t,n)=>{"use strict";n.d(t,{Z:()=>w});n(6886),n(85940);var o=n(2784),s=n(25686),i=n(68811),r=n.n(i),a=n(29496),c=n(73186),l=n(79404),u=n.n(l),p=n(63752),d=n(19313),h=n(54646),m=n(87053),f=n(41268),b=n(60673);const g="LoginForm_Login_Button",S=u().e919c3bc;class _ extends o.Component{constructor(...e){super(...e),this._mobileLoginToken=r().v1().replace(/-/g,""),this._handleSubmit=()=>{const{analytics:e,onSubmit:t}=this.props;if(e.scribe({action:"submit"}),f.Z.flushHTMLCache(),this._setLoginCookie(),t)return t(this._form.elements),!1},this._handleSubmitButtonClick=()=>{!1!==this._handleSubmit()&&this._form.submit()},this._setFormRef=e=>{e&&(this._form=e)},this._setLoginCookie=()=>{const e=new Date(Date.now());e.setTime(e.getTime()+3e5),(0,h.d8)(p.Vu,this._mobileLoginToken,{featureSwitches:this.context.featureSwitches,cookieOptions:{domain:void 0,expires:e}})}}componentDidUpdate(e){this.props.autoSubmit&&!e.autoSubmit&&this._handleSubmitButtonClick()}componentDidMount(){m.Z.inject({scriptId:"jsInstLibrary",src:"https://twitter.com/i/js_inst?c_name=ui_metrics"})}render(){const{children:e,formActionUrl:t,hideSubmitButton:n,horizontalLayout:i,loginReturnPath:r,submitButtonDisabled:c,submitButtonLabel:l,submitButtonSize:u,submitButtonStyle:p,submitButtonType:d}=this.props,[h,m]="string"==typeof r?r.split("?"):[],f=`${encodeURI(h||"/")}${m?`?${m}`:""}`,b=o.createElement(s.Z,{style:i&&y.horizontalFields},o.createElement("input",{name:"redirect_after_login",type:"hidden",value:f}),o.createElement("input",{name:"remember_me",type:"hidden",value:"1"}),o.createElement("input",{name:"authenticity_token",type:"hidden",value:this._mobileLoginToken}),o.createElement("input",{name:"wfa",type:"hidden",value:"1"}),o.createElement("input",{autoComplete:"off",name:"ui_metrics",type:"hidden"}),e,n?null:o.createElement(s.Z,{style:i&&y.loginButtonContainer},o.createElement(a.ZP,{disabled:c,onPress:this._handleSubmitButtonClick,size:u,style:p,testID:g,type:d},l)));return o.createElement(s.Z,{style:y.loginForm},o.createElement("form",{action:t,children:b,method:"post",noValidate:!0,onSubmit:this._handleSubmit,ref:this._setFormRef}))}}_.contextType=d.rC,_.defaultProps={autoSubmit:!1,formActionUrl:"/sessions",hideSubmitButton:!1,submitButtonDisabled:!1,submitButtonLabel:S,submitButtonType:"brandFilled"};const y=c.Z.create((e=>({horizontalFields:{flexDirection:"row",justifyContent:"center",alignItems:"stretch"},loginForm:{width:"100%"},loginButtonContainer:{flexDirection:"column",justifyContent:"center"}}))),w=(0,b.Z)(_,{element:"inline_login_form"})},7604:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});n(6886);var o=n(2784),s=n(7267),i=n(54987),r=n(54882),a=n(47770);function c(e){return!["/i/flow/login"].includes(e)}const l=(0,r.Z)((function(e={hideCookieBannerPicker:!1}){const t=function(){const e=(0,s.TH)(),[t,n]=o.useState((()=>c(e.pathname)));return o.useEffect((()=>{n(c(e.pathname))}),[n,e]),t}();return!e.hideCookieBannerPicker&&t?o.createElement(i.Z,null,o.createElement(a.Z,null)):null}))},47770:(e,t,n)=>{"use strict";n.d(t,{Z:()=>U});var o=n(2784),s=n(1477),i=n(39466),r=n(19313),a=(n(6886),n(25686)),c=n(36934),l=n(54044),u=n(73186),p=n(29496),d=n(79404),h=n.n(d),m=n(73036),f=n(60673),b=n(44337);const g=h().d8817e36,S=h().b9288ee6,_=h().i1390ec2,y={page:"cookie_compliance_banner"};function w(){const e=o.createElement(h().I18NFormatMessage,{$i18n:"ad048ab9"},o.createElement(c.ZP,{color:"buttonWhite",link:"https://help.twitter.com/rules-and-policies/twitter-cookies",withUnderline:!0},h().id7ef731));return o.createElement(v,{body:e,title:_})}function E(e){const t=o.createElement(h().I18NFormatMessage,{$i18n:"bc8736af"},o.createElement(c.ZP,{accessibilityRole:"button",color:"buttonWhite",onClick:e.onExpand,withUnderline:!0},h().gfb2ba01));return o.createElement(v,{body:t,title:_})}function v(e){return o.createElement(a.Z,{style:T.cookieComplianceMessageWrap},o.createElement(c.ZP,{color:"buttonWhite",size:"headline2",weight:"medium"},e.title),o.createElement(c.ZP,{color:"buttonWhite",size:"subtext2",style:T.cookieComplianceExpandedDetails},e.body))}const k=o.forwardRef((function(e,t){const n=(0,f.z)(),{expand:s,isExpanded:i}=function(){const[e,t]=o.useState(!1),n=(0,f.z)();return{isExpanded:e,expand:()=>{n.scribe({...y,action:"click",element:"expand_message"}),t(!0)}}}(),{acceptAllCookies:c,isBannerOpen:d,refuseNonEssentialCookies:h}=function(){const e=(0,f.z)(),{featureSwitches:t}=o.useContext(r.rC),[n,s]=o.useState((()=>b.iB(t)&&!m.ZP.getTwitterAppVersion()));return{isBannerOpen:n,acceptAllCookies(){e.scribe({...y,action:"click",element:"accept_all"}),b.jk(t),s(!1)},refuseNonEssentialCookies(){e.scribe({...y,action:"click",element:"refuse_non_essential"}),b.c$(t),s(!1)}}}();return o.useEffect((()=>{d&&n.scribe({...y,action:"impression"})}),[n,d]),d?o.createElement(l.Z,null,(({windowWidth:e})=>{const n=e<u.Z.theme.breakpoints.xLarge;return o.createElement(a.Z,{ref:t,style:[T.root,n&&T.rootNarrow]},i?o.createElement(w,null):o.createElement(E,{onExpand:s}),o.createElement(a.Z,{style:[T.buttonContainer,n&&T.buttonContainerNarrow]},o.createElement(p.ZP,{dominantColor:"alwaysBaseGray1100",onPress:c,size:"medium",style:[T.ctaButton,n&&T.ctaButtonNarrow],type:u.Z.isDarkMode()?"onMediaDominantColorFilled":"onMediaWhiteFilled"},g),o.createElement(p.ZP,{dominantColor:"alwaysBaseGray1100",onPress:h,size:"medium",style:[T.ctaButton,n&&T.ctaButtonNarrow],type:u.Z.isDarkMode()?"onMediaDominantColorFilled":"onMediaWhiteFilled"},S)))})):null})),T=u.Z.create((e=>({root:{alignItems:"center",boxShadow:e.boxShadows.xSmall,flexDirection:"row",width:"100%",justifyContent:"space-evenly",paddingVertical:e.componentDimensions.gutterVertical,paddingHorizontal:e.componentDimensions.gutterHorizontal,backgroundColor:e.colors.buttonBlack},rootNarrow:{flexDirection:"column",paddingVertical:e.componentDimensions.gutterVertical,paddingTop:e.spaces.space20,backgroundColor:e.colors.buttonBlack},buttonContainer:{flexDirection:"column",marginVertical:e.spaces.space16,marginStart:e.spaces.space20},buttonContainerNarrow:{width:"100%",maxWidth:550,marginStart:0,flexDirection:"column",flexWrap:"wrap"},ctaButton:{height:e.spaces.space40,marginBottom:e.spaces.space8,width:420,flexGrow:0,flexShrink:0},ctaButtonNarrow:{marginStart:0,width:"100%"},cookieComplianceMessageWrap:{flex:1,maxWidth:640},cookieComplianceExpandedDetails:{marginTop:e.spaces.space8,marginBottom:e.spaces.space8},background:{backgroundColor:e.colors.buttonBlack}})));var P=n(7896),C=n(63752),A=n(54646),I=n(92160),Z=n(67935);const O=(0,I.Z)().propsFromState((()=>({currentCountry:Z.GG}))),L=(e,t,n)=>e.indexOf(t.toLowerCase())>-1&&"1"!==n,D=h().ia5e7488;class x extends o.Component{constructor(e,t){super(e,t),this.state={euWarningIsOpen:!1},this._renderMessage=()=>o.createElement(c.ZP,{color:"white",size:"subtext2"},o.createElement(h().I18NFormatMessage,{$i18n:"i3c34583"},o.createElement(c.ZP,{color:"white",link:"https://help.twitter.com/rules-and-policies/twitter-cookies",style:N.link},h().a8a8d769))),this._handleEUBannerClose=()=>{(e=>{(0,A.d8)(C.B0,"1",{featureSwitches:e})})(this.context.featureSwitches),this.setState({euWarningIsOpen:!1})};const{currentCountry:n}=this.props,{featureSwitches:s}=this.context,i=s.getArrayValue("responsive_web_eu_countries",[]),r=(0,A.ej)({featureSwitches:s,cookieName:C.B0});this.state={euWarningIsOpen:!!n&&L(i,n,r)}}render(){return this.state.euWarningIsOpen?o.createElement(l.Z,null,(({windowWidth:e})=>{const t=e<u.Z.theme.breakpoints.medium;return o.createElement(a.Z,{ref:this.props.innerRef,style:[N.root,t&&N.rootNarrow]},this._renderMessage(),o.createElement(p.ZP,{onPress:this._handleEUBannerClose,size:"medium",style:[N.closeButton,t&&N.closeButtonNarrow],type:"onMediaOutlined"},D))})):null}}x.contextType=r.rC;const N=u.Z.create((e=>({root:{alignItems:"center",boxShadow:e.boxShadows.medium,flexDirection:"row",width:"100%",justifyContent:"space-evenly",backgroundColor:e.colors.alwaysBaseGray1100,paddingHorizontal:e.spaces.space20,paddingVertical:e.spaces.space20},rootNarrow:{flexDirection:"column"},container:{alignItems:"center",flexShrink:1},closeButton:{marginStart:e.spaces.space12,marginTop:0,flexGrow:0,flexShrink:0},closeButtonNarrow:{marginStart:0,marginTop:e.spaces.space12,width:"100%"},link:{textDecorationLine:"underline"}}))),R=o.forwardRef(((e,t)=>o.createElement(x,(0,P.Z)({},e,{innerRef:t})))),M=O.forwardRef(R);function B(e,t=100){return function(e,t=100){const n=o.useMemo((()=>(0,i.Z)((t=>{if(!e)return;if(!t)return void e(null);const n=t.getBoundingClientRect();n&&e(n)}),t)),[e,t]);return o.useCallback((t=>{if("function"!=typeof e)return;const o=n.bind(null,t);return o(),window.addEventListener("resize",o),t&&s.Z.observe(t,o),()=>{window.removeEventListener("resize",o),s.Z.unobserveAll(t),n.cancel()}}),[e,n])}(o.useMemo((()=>"function"==typeof e?t=>{e(t?t.height:null)}:void 0),[e]))}function U(e){const{featureSwitches:t}=o.useContext(r.rC),n=B(e.onHeightChange);return t.isTrue("responsive_web_cookie_compliance_banner_enabled")?o.createElement(k,{ref:n}):o.createElement(M,{ref:n})}},44337:(e,t,n)=>{"use strict";n.d(t,{D0:()=>a,c$:()=>l,fD:()=>r,iB:()=>d,jk:()=>c});var o=n(60328),s=n(72599);const i=1e3,r=Object.freeze({AcceptAllCookies:"acceptAllCookies",RefuseNonEssentialCookies:"refuseNonEssentialCookies",Invalid:"invalid",NotSet:"notSet"});function a(e){const t=(0,o.bL)(e);return t?u(t)?p(t)?t[1]?r.AcceptAllCookies:t[2]?r.RefuseNonEssentialCookies:((0,s.ZP)("Invalid consent signal state"),r.Invalid):r.NotSet:r.Invalid:r.NotSet}function c(e){(0,o.kA)({consent_version:2,text_version:i,1:!0},e)}function l(e){(0,o.kA)({consent_version:2,text_version:i,2:!0},e)}function u(e){return!(e[1]&&e[2])}function p(e){return e[1]||e[2]}function d(e){const t=(0,o.bL)(e);return!t||(!u(t)||!p(t)||t.consent_version<2||t.text_version<i)}},20604:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>P,UJ:()=>v});n(6886),n(36728);var o=n(2784),s=n(67502),i=n(25686),r=n(73186),a=n(36934),c=n(79404),l=n.n(c),u=n(66927),p=n(1206),d=n(16742),h=n(19313),m=n(68547),f=n(66961),b=n(76687),g=n(92160),S=n(57659);const _=(0,g.Z)().propsFromState((()=>({loggedInUser:S.ZP.selectLoggedInUser}))).adjustStateProps((({loggedInUser:e})=>({loggedInUserScreenName:e?e.screen_name:void 0}))),y=l().b47e760e,w=l().fd2c7b44,E=new u.Z,v=e=>{if(!s.canUseDOM)return p.Z;return E.subscribe(e).unsubscribe};class k extends o.Component{constructor(...e){super(...e),this._bindKeyboardShortcuts=()=>{const{history:e,loggedInUserScreenName:t}=this.props,n=(t,n={})=>e.push({pathname:t,state:{...n,source:"keyboard_shortcut"}}),o=e=>t=>{t.preventDefault(),E.getListeners().length?E.notify(e):n("/explore",{searchFocused:!0,searchPrefill:e})},s={[f.uq.search]:o(),[f.uq.goToUser]:o("@"),[f.uq.openKeyboardShortcuts]:()=>n("/i/keyboard_shortcuts"),[f.uq.goExplore]:()=>n("/explore"),[f.uq.goSettings]:()=>n("/settings")},i=e=>({[f.uq.goProfile]:()=>n(`/${e}`),[f.uq.goLikes]:()=>n(`/${e}/likes`),[f.uq.goLists]:()=>n(`/${e}/lists`)}),r=this.context.userClaims.isTrueAndEnabled("subscriptions_feature_1007"),a=t&&r?{...i(t),[f.uq.goTopArticles]:()=>n("/i/articles")}:t?i(t):{},c={...s,...a,[f.uq.goHome]:()=>n("/home"),[f.uq.goDisplay]:()=>n("/i/display"),[f.uq.goNotifications]:()=>n("/notifications"),[f.uq.goMentions]:()=>n("/notifications/mentions"),[f.uq.goMessages]:()=>n("/messages"),[f.uq.newMessage]:()=>n("/messages/compose"),[f.uq.newTweet]:()=>n("/compose/tweet"),[f.uq.goMomentMaker]:()=>n("/i/moment_maker"),[f.uq.goBookmarks]:()=>n("/i/bookmarks"),[f.uq.goToDrafts]:()=>n("/compose/tweet/unsent/drafts"),[f.uq.goToScheduled]:()=>n("/compose/tweet/unsent/scheduled")},l=this.props.loggedInUserScreenName?c:s;this._unbindKeyboardShortcuts=(0,m.Z)(l)}}componentDidMount(){this._bindKeyboardShortcuts()}componentWillUnmount(){this._unbindKeyboardShortcuts&&this._unbindKeyboardShortcuts()}render(){return this.props.loggedInUserScreenName?o.createElement(i.Z,{accessibilityLevel:2,accessibilityRole:"heading",style:r.Z.visuallyHidden},o.createElement(a.ZP,null,y),o.createElement(a.ZP,{focusable:!1,link:"/i/keyboard_shortcuts"},w)):null}}k.contextType=h.rC;const T=_(k),P=s.canUseDOM?(0,b.ZP)(T):(0,d.Z)(null)},36242:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AppInstallOnLandingPrompt:()=>yn,AudioModule:()=>wn,BottomCookieBannerPicker:()=>nn,DtabBar:()=>on,GlobalKeyboardShortcuts:()=>sn,LivePipeline:()=>rn,LoggedOutNotifications:()=>kn,ModalSheet:()=>an,Seo:()=>ln,SmartLockPrompt:()=>cn,Toast:()=>un,altSvc:()=>_n,appReloader:()=>pn,badgeTimers:()=>dn,bindKeyboardShortcuts:()=>hn,getScreenReaderShortcutsDataAttribute:()=>Sn,ie11Reflower:()=>mn,initGeoLocation:()=>En,inputDetect:()=>tn,multiAccountListFetcher:()=>fn,redirectEmailUser:()=>bn,scribeExternalReferer:()=>gn,userPresence:()=>vn});var o={};n.r(o),n.d(o,{KEYBOARD:()=>lt,MOUSE:()=>ut,_private:()=>Tt,detectedType:()=>_t,detectedTypes:()=>St,initialize:()=>gt,register:()=>yt,registerEvery:()=>Et,registerSome:()=>wt,reset:()=>kt,unregister:()=>vt});var s=n(86242),i=n(2784),r=n(67502),a=n(72175),c=n(7267),l=n(5714);const u=function(){(0,c.TH)();const e=function(){let e;return r.canUseDOM&&(e=window.location.href),e?(0,l.Z2)(e):null}();return e?i.createElement(a.ql,null,i.createElement("link",{href:e,rel:"canonical"})):null};n(6886);var p=n(73036),d=n(1179),h=n(76687),m=n(19313),f=n(17464),b=n(92160);const g=(e,t)=>t.location.pathname.includes("/intent/"),S=(e,t)=>t.location.pathname.includes("/login"),_=(e,t)=>t.location.pathname.includes("/ocf_arkose_challenge"),y=(0,b.Z)().propsFromState((()=>({isIntentRoute:g,isLoginRoute:S,isArkoseRoute:_}))).adjustStateProps((({isArkoseRoute:e,isIntentRoute:t,isLoginRoute:n})=>({hideAppPrompt:t||n||e})));class w extends i.Component{constructor(...e){super(...e),this._isStandaloneApp=d.Z.isStandaloneApp(),this._isWebView=!!p.ZP.getTwitterAppVersion(),this._isNotesRoute=this.props.location.pathname.startsWith("/i/notes"),this.state={showPrompt:!this.props.hideAppPrompt&&!this.context.loggedInUserId&&!this._isStandaloneApp&&this.context.featureSwitches.isTrue("responsive_web_use_app_prompt_enabled")&&!this.context.featureSwitches.isTrue("responsive_web_open_in_app_prompt_enabled")&&!this._isWebView&&!this._isNotesRoute},this._handleClose=()=>{this.setState({showPrompt:!1})}}render(){const e=this.props.location.pathname.includes("/i/flow/signup")||this.props.location.pathname.includes("i/flow/login");if(this.state.showPrompt){return!(e&&this.context.featureSwitches.isTrue("responsive_web_suppress_app_button_banner_suppressed"))&&i.createElement(f.ZP,{onClose:this._handleClose,onlyShowOnce:!0,useBottomBanner:!0})}return null}}w.contextType=m.rC;const E=(0,h.ZP)(y(w));var v=n(7604),k=(n(14121),n(60523),n(29496)),T=n(41441),P=n(36934),C=n(73186),A=n(54987),I=n(74016),Z=n(24433);const O=(0,b.Z)().propsFromState((()=>({dtabBarInfo:Z.U6}))).adjustStateProps((({dtabBarInfo:e})=>({dtabAll:e&&e.dtabAll,dtabRweb:e&&e.dtabRweb,hide:e&&e.hide,ttsToken:e&&e.ttsToken}))).propsFromActions((()=>({setDtabBarInfo:Z.wn}))),L="dTabClear",D="dTabHide",x="dTabInfo";class N extends i.PureComponent{constructor(e,t){super(e,t),this._renderButtons=()=>i.createElement(i.Fragment,null,i.createElement(k.ZP,{onClick:this._handleInfo,size:"xSmall",style:R.dtabBarButton,testID:x,type:"onMediaWhiteFilled"},"ⓘ Info"),i.createElement(k.ZP,{onClick:this._handleClose,size:"xSmall",style:R.dtabBarButton,testID:D,type:"onMediaWhiteFilled"},"↓ Hide"),i.createElement(k.ZP,{onClick:this._handleClear,size:"xSmall",style:R.dtabBarButton,testID:L,type:"destructiveFilled"},"↺ Clear")),this._handleInfo=()=>{const e=this._getOverrides();window.prompt(e.join("\n"),window.encodeURIComponent(e.join(";")))},this._getOverrides=()=>{const{dtabAll:e,ttsToken:t}=this.props;let n=[];return e&&!t?n=e:t&&(n=[`tts_token=${t}`]),n.filter((e=>!!e))},this._handleClear=()=>{const e=`OK to clear overrides?\n${this._getOverrides().join("\n")}`;if(window.confirm(e)){const e=new URL(I.ZP.get());e.searchParams.set("dtab_local",""),e.searchParams.set("tts_token",""),I.ZP.navigateTo(e.toString())}},this._handleClose=()=>{const{dtabAll:e,dtabRweb:t,setDtabBarInfo:n,ttsToken:o}=this.props;this.setState({show:!1}),n({dtabAll:e,dtabRweb:t,ttsToken:o,hide:!0})},this._shouldShow=()=>{const{dtabAll:e,hide:t,ttsToken:n}=this.props;return!(t||!e&&!n)},this.state={show:this._shouldShow()}}render(){const{dtabAll:e,ttsToken:t}=this.props,n=t||e?i.createElement(A.Z,{style:R.root},i.createElement(T.Z,{isLarge:!0,style:R.container,withGutter:!0},i.createElement(P.ZP,{color:"whiteOnColor",numberOfLines:1,size:"subtext2",style:R.text},"Staging override is active"),this._renderButtons())):null;return this.state.show?n:null}}N.defaultProps={hide:!1};const R=C.Z.create((e=>({root:{backgroundColor:e.colors.primary},container:{alignItems:"center",flexDirection:"row",height:e.spaces.space40,justifyContent:"space-between"},dtabBarButton:{margin:e.spaces.space8},text:{width:"100%"}}))),M=O(N);var B=n(20604),U=n(99241),F=n(88990),z=n(79404),W=n.n(z),j=n(82998),K=n(1206),q=n(60673),H=n(5780);const $=(0,b.Z)().propsFromState((()=>({promptAllowed:H.selectIsEligibleForPushPrompt}))).propsFromActions((()=>({updatePromptStatus:H.updatePromptStatus,pushSubscribeLoggedOut:H.pushSubscribeLoggedOut}))).withAnalytics({component:"lo_notifications",element:"in_app_prompt"}),V=W().j991cb30,G=W().e71e09ec,X=G,Q=G,J=W().hd50e064,Y=e=>{const{promptAllowed:t,pushSubscribeLoggedOut:n,updatePromptStatus:o}=e,[s,r]=i.useState(t),a=(0,q.z)(),c=i.useCallback((e=>{a.scribeAction(e)}),[a]),l=i.useCallback((()=>{c("primary_cta"),o("inAppPrompt","approved"),r(!1),n()}),[n,c,o]),u=i.useCallback((()=>{const{onDismiss:t}=e;o("inAppPrompt","dismissed"),r(!1),c("dismiss"),t()}),[e,c,o]);return i.useEffect((()=>{t&&(c("impression"),r(!0),o("inAppPrompt","seen"))}),[o,t,c]),t||s?i.createElement(F.Z,{actionLabel:Q,graphic:j.Z,headline:X,onAction:l,onClose:u,onTertiaryAction:u,subtext:V,tertiaryActionLabel:J}):null};Y.defaultProps={message:V,onDismiss:K.Z};const ee=$(i.memo(Y));n(21515);var te=n(73206),ne=n(7032),oe=n(23335),se=n(99629);const ie=(0,b.Z)().propsFromState((()=>({browserPromptStatus:H.selectBrowserPromptStatus,arkosePromptStatus:H.selectArkosePromptStatus}))).adjustStateProps((({arkosePromptStatus:e,browserPromptStatus:t})=>({shouldShowPrompt:t===H.PromptStatus.APPROVED&&e===H.PromptStatus.NOT_SEEN}))).propsFromActions((()=>({verifyArkoseTokenAndSavePushToken:H.verifyArkoseTokenAndSavePushToken,addToast:se.fz,updatePromptStatus:H.updatePromptStatus,createLocalApiErrorHandler:(0,oe.createLocalApiErrorHandlerWithContextFactory)("arkose_challenge_logged_out_notifications")}))).withAnalytics({component:"lo_notifications",element:"arkose"}),re=W().g4850f44,ae=e=>{const{addToast:t,analytics:n,createLocalApiErrorHandler:o,shouldShowPrompt:s,updatePromptStatus:r,verifyArkoseTokenAndSavePushToken:a}=e,[c,l]=i.useState(s);i.useEffect((()=>{s&&(l(!0),r("arkosePrompt",H.PromptStatus.SEEN),n.scribeAction("show"))}),[s,r,n]);const u=i.useCallback((e=>{n.scribeAction("complete"),a(e).then((()=>{r("arkosePrompt",H.PromptStatus.APPROVED),t({text:re})})).catch((()=>{o({})})).finally((()=>{l(!1)}))}),[t,o,r,n,a]),p=i.useCallback((()=>{n.scribeAction("fail"),r("arkosePrompt",H.PromptStatus.DISMISSED),l(!1)}),[r,n]);return s||c?i.createElement(te.Z,{enableMaskForDismiss:!1,type:"full",withMask:!0},i.createElement(ne.default,{mobileKey:"arkose_challenge_lo_web_notification_mobile_prod",onChallengeCompleted:u,onChallengeFailed:p,webKey:"arkose_challenge_lo_web_notification_prod"})):null},ce=ie(i.memo(ae));var le=n(38429),ue=n(23803);const pe=["profile","guide","tweet","topic_landing","spheres_list","live_event_timeline","search"],de=e=>{const t=(0,le.wZ)(e);return!!t&&(e=>-1!==pe.indexOf(e))(t)},he=e=>(0,H.selectFetchStatus)(e)===ue.ZP.LOADED,me=e=>{const{isPersistedDataLoaded:t,isSupportedRoute:n}=e,o="/"===(0,c.TH)().pathname,s=!(null==(r=(0,c.TH)().query)||!r.logout);var r;const a=(0,U.D)("responsive_web_logged_out_notifications_enabled");if(!t||!n||s||o)return null;return a.isTrue()&&i.createElement(i.Fragment,null,i.createElement(ee,null),i.createElement(ce,null))},fe=(0,b.Z)().propsFromState((()=>({isSupportedRoute:de,isPersistedDataLoaded:he}))).propsFromActions((()=>({createLocalApiErrorHandler:(0,oe.createLocalApiErrorHandlerWithContextFactory)("LOGGED_OUT_NOTIFICATIONS")})))(i.memo(me));var be=n(76984),ge=n.n(be),Se=n(25686),_e=n(86625),ye=n(63752),we=n(54646),Ee=n(72599),ve=n(31427),ke=n(67935);const Te=(0,b.Z)().propsFromState((()=>({loginReturnPath:ke.V_}))).withAnalytics({component:"smartlock_prompt"});class Pe extends i.Component{constructor(e,t){super(e,t),this.state={autoSubmit:!1,password:"",smartLockDisabled:!1,userName:""},this._smartLockSupported=!!(window.PasswordCredential&&navigator.credentials&&navigator.credentials.get)&&!t.loggedInUserId,this._isSmartLockDisabledFromCookie="1"===e.getCookie({featureSwitches:t.featureSwitches,cookieName:ye.xp})}componentDidMount(){"/login/error"===this.props.location.pathname?(0,ve.Z)(this.context.featureSwitches):this._checkShouldDisplayPrompt()}componentDidUpdate(e){ge()(e.location,this.props.location)||this._checkShouldDisplayPrompt()}render(){const{loginReturnPath:e}=this.props,{autoSubmit:t,password:n,userName:o}=this.state;return this._shouldDisplaySmartLockPrompt()?i.createElement(Se.Z,{style:Ce.hidden},i.createElement(_e.Z,{autoSubmit:t,loginReturnPath:e},i.createElement("input",{name:"session[username_or_email]",type:"hidden",value:o}),i.createElement("input",{name:"session[password]",type:"hidden",value:n}))):null}_scribeAction(e,t){const{analytics:n}=this.props;n.scribe({...t,action:e})}_checkShouldDisplayPrompt(){const{location:{pathname:e}}=this.props,{smartLockDisabled:t}=this.state;if(this._shouldDisplaySmartLockPrompt()){this._scribeAction("impression");const n=(t||this._isSmartLockDisabledFromCookie)&&"/login"===e?"required":"optional";let o=!0;setTimeout((()=>o=!1),250),navigator.credentials.get({mediation:n,password:!0}).then((e=>{if(e){o?this._scribeAction("select",{element:"unmediated"}):this._scribeAction("select",{element:"mediated"});const{id:t,password:n}=e;this.setState({autoSubmit:!0,userName:t,password:n})}else this._smartLockSupported&&this.setState({smartLockDisabled:!0},(()=>(0,ve.Z)(this.context.featureSwitches))),o?this._scribeAction("cancel",{element:"no_credentials"}):this._scribeAction("cancel",{element:"with_credentials"})}),(e=>{e&&"NotSupportedError"!==e.name&&"NotAllowedError"!==e.name&&"InvalidStateError"!==e.name&&(0,Ee.ZP)(e)}))}}_shouldDisplaySmartLockPrompt(e=this.props){const{featureSwitches:t,loggedInUserId:n}=this.context,{location:{pathname:o}}=e,s="/login"===o,i=t.isTrue("stateful_login_smart_lock_enabled");return!n&&this._smartLockSupported&&s&&i}}Pe.contextType=m.rC,Pe.defaultProps={getCookie:we.ej};const Ce=C.Z.create((e=>({hidden:{display:"none"}}))),Ae=(0,h.ZP)(Te(Pe));var Ie=n(54044),Ze=n(41425),Oe=n(7896),Le=n(66999),De=n(18958),xe=n(16587),Ne=n(77934),Re=n(74054);const Me=W().af8fa2ae,Be=i.createElement(De.Z,null);class Ue extends i.Component{constructor(...e){super(...e),this._getMemoizedBehavioralEventContext=(0,xe.Z)((e=>({viewType:e}))),this._getMemoizedToastBehavioralEventContext=(0,xe.Z)((e=>({viewState:e?{type:"toast",entityToken:e}:void 0,viewType:"toast"}))),this._renderAriaOnly=()=>{const{testID:e,text:t}=this.props;return i.createElement(Se.Z,{accessibilityRole:"alert",style:C.Z.visuallyHidden,testID:e},i.createElement(Le.Z,null,t))},this._renderContent=()=>{const{action:e,text:t,withAutoDismiss:n,withClearButton:o}=this.props;return i.createElement(i.Fragment,null,i.createElement(P.ZP,{color:"whiteOnColor",style:Fe.titleText},t),i.createElement(Se.Z,{accessibilityHidden:n,style:Fe.actionButtons},e&&this._renderActionLabel(e),o&&i.createElement(k.ZP,{accessibilityLabel:Me,borderColor:"transparent",color:"white",icon:Be,onPress:this._handleClose,style:Fe.closeButton})))},this._renderContentWithLayer=({windowWidth:e})=>{const{LayerComponent:t,behavioralEventEntityToken:n,testID:o}=this.props,s=this._getMemoizedToastBehavioralEventContext(n);return i.createElement(t,null,i.createElement(T.Z,null,i.createElement(Re.Z,{id:"Toast"},((t,n)=>i.createElement(Ne.Gr,{behavioralEventContext:s},i.createElement(Se.Z,(0,Oe.Z)({ref:t()},n({accessibilityRole:"alert",style:[Fe.root,e>C.Z.theme.breakpoints.medium&&Fe.rootWide],testID:o})),this._renderContent()))))))},this._renderContentWithoutLayer=({windowWidth:e})=>{const{behavioralEventEntityToken:t,testID:n}=this.props,o=this._getMemoizedToastBehavioralEventContext(t);return i.createElement(T.Z,null,i.createElement(Ne.Gr,{behavioralEventContext:o},i.createElement(Se.Z,{accessibilityRole:"alert",style:[Fe.root,e>C.Z.theme.breakpoints.medium&&Fe.rootWide],testID:n},this._renderContent())))},this._createTimer=()=>{const{action:e,autoDismissDelay:t,onClose:n,text:o,withAutoDismiss:s}=this.props;if(s){const s=t||Ue.calculateDismissDelay(o,!!e);this._timerId=setTimeout(n,s)}},this._handleActionPress=e=>{this._stopTimer();const{action:t,onClose:n}=this.props;null!=t&&t.onAction&&t.onAction(e),n(e)},this._handleClose=e=>{this._stopTimer(),this.props.onClose(e)}}componentDidMount(){this._createTimer()}componentWillUnmount(){this._stopTimer()}render(){const{ariaOnly:e,withoutLayer:t}=this.props;return e?this._renderAriaOnly():i.createElement(Ie.Z,null,t?this._renderContentWithoutLayer:this._renderContentWithLayer)}_renderActionLabel(e){const{behavioralEventViewType:t,label:n,link:o}=e,s=t,r=this._getMemoizedBehavioralEventContext(s);return i.createElement(Ne.zt,{behavioralEventContext:r},i.createElement(P.ZP,{children:n,color:"whiteOnColor",link:o,onClick:this._handleActionPress,style:[Fe.actionText,!o&&Fe.actionMargin],weight:"bold",withInteractiveStyling:!0}))}static calculateDismissDelay(e,t){const n=1e3*("string"==typeof e?e.split(" ").length:0)/5+225;return(n<4e3?4e3:n)+(t?2e3:0)}_stopTimer(){clearTimeout(this._timerId)}}Ue.defaultProps={withAutoDismiss:!0,withClearButton:!1,LayerComponent:Ze.Z.ModalToasts};const Fe=C.Z.create((e=>({root:{alignItems:"center",backgroundColor:e.colors.primary,flexDirection:"row",justifyContent:"space-between",padding:e.spaces.space12},rootWide:{alignSelf:"center",borderRadius:e.borderRadii.small,marginBottom:e.spaces.space32},titleText:{flexShrink:1,paddingHorizontal:e.spaces.space12},actionText:{alignSelf:"center",whiteSpace:"nowrap",marginEnd:e.spaces.space12},actionButtons:{flexDirection:"row"},actionMargin:{marginHorizontal:e.spaces.space12},closeButton:{marginStart:e.spaces.space12,paddingHorizontal:e.spaces.space4}}))),ze=Ue;var We=n(96889),je=n(28510),Ke=n(12599);const qe=(0,b.Z)().propsFromState((()=>({toast:se.Sb}))).propsFromActions((()=>({onClose:se.RS}))),He="toast",$e=qe((({onClose:e,toast:t})=>{const n=(0,c.TH)(),o=(0,je.H)(n),s=i.useMemo((()=>({viewType:o})),[o]);return t?i.createElement(Ie.Z,null,(({windowWidth:n})=>{const o=We.Z.shouldRenderAsModal(n)?Ze.Z.ModalToasts:Ze.Z.Toasts;return i.createElement(Ke.Z,{behavioralEventContext:s},i.createElement(ze,{LayerComponent:o,action:t.action,ariaOnly:t.ariaOnly,autoDismissDelay:t.autoDismissDelay,behavioralEventEntityToken:t.behavioralEventEntityToken,key:t.id,onClose:e,testID:He,text:t.text,withAutoDismiss:t.withAutoDismiss,withClearButton:t.withClearButton}))})):null})),Ve=(e,t,n)=>{if(e.isTrue("responsive_web_alt_svc")){const e=n((0,oe.createLocalApiErrorHandlerWithContextFactory)("APP_INITIALIZATION_ALT_SVC")({}));t.AltSvc.fetch().catch(e)}};var Ge=n(40396),Xe=n(75845),Qe=n(26499),Je=n(63140),Ye=n(60420),et=n(26401),tt=n(19661);const nt=(e,t=1e3)=>{window.requestIdleCallback?window.requestIdleCallback((()=>e.fire())):setTimeout((()=>e.fire()),t)},ot=e=>{if(!ke.Qb(e.getState()))return;const t=e.dispatch((0,oe.createLocalApiErrorHandlerWithContextFactory)("BADGE_TIMERS")({showToast:!1,[Je.ZP.AccessDeniedByBouncer]:{customAction:K.Z}})),n=n=>e.dispatch(n).catch(t),o=new tt.Z(3e4).interval((()=>{"background"!==Qe.Z.currentState&&(n((0,Ye.kJ)()),(0,et.Xy)(e.getState()).forEach(n))}));o.start(),nt(o);Qe.Z.addEventListener("change",(e=>{"active"===e&&nt(o)}))};var st=n(27495),it=n.n(st),rt=n(53682),at=(n(36728),n(11916)),ct=n.n(at);const lt="keyboard",ut="mouse";let pt=[];const dt={[lt]:!1,[ut]:!1};class ht{constructor(e){this._handleTimerEnd=()=>{this._count>=3&&this._handleDetected(),this._reset()},this._handleDetected=()=>{this._reset(),this.detach(),this.detected()},this._reset=()=>{clearTimeout(this._timer),this._timer=void 0,this._count=0},this._handleMouseMove=()=>{this._count=this._count+1,this._count>=3?this._handleDetected():this._timer||(this._timer=setTimeout(this._handleTimerEnd,500))},this.attach=()=>{document.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("touchend",this._reset)},this.detach=()=>{document.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("touchend",this._reset)},this.detected=e,this._count=0}}class mt{constructor(e){this._handleKeyDown=e=>{const{altKey:t,ctrlKey:n,metaKey:o,target:s}=e;var i;!(t||n||o)&&((i=s)instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)||(this.detach(),this.detected())},this.attach=()=>{document.addEventListener("keydown",this._handleKeyDown)},this.detach=()=>{document.removeEventListener("keydown",this._handleKeyDown)},this.detected=e}}function ft(e){dt[e]=!0;const t=pt.filter((({matches:e})=>e())),n=pt.filter((({matches:e})=>!e()));pt=n,t.forEach((({callback:e})=>e()))}let bt;const gt=()=>{bt=[new mt((()=>ft(lt))),new ht((()=>ft(ut)))],bt.forEach((e=>e.attach()))},St=()=>Object.keys(dt).filter((e=>dt[e])),_t=e=>dt[e],yt=(e,t)=>{const n=()=>dt[t];n()?ct()(e):pt.push({matches:n,callback:e})},wt=(e,t)=>{const n=()=>t.some((e=>dt[e]));n()?ct()(e):pt.push({matches:n,callback:e})},Et=(e,t)=>{const n=()=>t.every((e=>dt[e]));n()?ct()(e):pt.push({matches:n,callback:e})},vt=e=>{const t=pt.indexOf(e);t>-1&&pt.splice(t,1)},kt=()=>{pt=[],Object.keys(dt).forEach((e=>{dt[e]=!1})),bt.forEach((e=>e.detach()))},Tt={MOUSE_INTERVAL_TIME_IN_MS:500,SUCCESSIVE_MOUSE_EVENTS:3,detected:ft};var Pt=n(91670),Ct=n(35434);const At=e=>{var t,n,o;return null!=(t=navigator)&&t.permissions?null==(n=navigator)||null==(o=n.permissions)?void 0:o.query({name:"geolocation"}).then((function(t){return e.dispatch((0,Pt.ey)(t.state)),t.onchange=function(){e.dispatch((0,Pt.ey)(this.state))},Promise.resolve(t.state)})):Promise.resolve()},It=e=>(0,Z.JJ)(e.getState())?At(e).then((t=>{t===Ct.S.granted&&e.dispatch((0,Pt.iG)())})):Promise.resolve(),Zt={init:e=>{const t=t=>{if("active"===t&&e&&e.body){const t=e.body.style.display;e.body.style.display="none",e.body.clientHeight,e.body.style.display=t}};p.ZP.isDesktopOS()&&p.ZP.isIE()&&Qe.Z.addEventListener("change",t)}};var Ot=n(66961);n(71372);function Lt(e){return Object.keys(Dt(e))}function Dt(e){return e.reduce(((e,t)=>(e[t]=!0,e)),{})}class xt{constructor({callback:e,makeEventSource:t,topics:n}){this.topics=[],this.backoffDuration=0,this._handleMessage=({data:e})=>{try{const t=JSON.parse(e);this.connection&&"/system/config"===t.topic&&(this.connection.hasConfig=!0),this.callback(t)}catch(e){}},this._handleError=()=>{if(!this.connection||this.connection.eventSource.readyState===this.connection.eventSource.OPEN)return;const e=this.connection;e&&e.eventSource.readyState===e.eventSource.CONNECTING&&function(e,t){const n=Dt(e),o=Object.keys(n),s=Lt(t);return o.length===s.length&&s.every((e=>n[e]))}(e.topics,this._getTopicsForAutoSubscribe())||(this._cleanup(),this.connection&&this.connection.hasConfig?this.backoffDuration=1e3:this.backoffDuration=Math.max(1e3,Math.min(2*this.backoffDuration,6e4)),this.backoffTimeoutId=setTimeout(this._connect,this.backoffDuration*(.5+Math.random())))},this._connect=()=>{this._cleanup();const e=this._getTopicsForAutoSubscribe();this.makeEventSource(e).then((t=>{if("object"!=typeof t)throw new Error("EventSource must be defined");t.addEventListener("message",this._handleMessage),t.addEventListener("error",this._handleError),this.connection={eventSource:t,topics:e,hasConfig:!1}})).catch((()=>{this._handleError()}))},this.makeEventSource=t,this.callback=e,this.setTopics(n),this._connect()}setTopics(e){this.topics=e}getAutoSubscribedTopics(){return this.connection?this.connection.topics:[]}_getTopicsForAutoSubscribe(){return this.topics.slice(0,xt.MAX_AUTO_SUBSCRIBE_TOPICS)}_cleanup(){const e=this.connection;e&&(e.eventSource.removeEventListener("message",this._handleMessage),e.eventSource.removeEventListener("error",this._handleError),e.eventSource.close(),this.connection=null),clearTimeout(this.backoffTimeoutId)}teardown(){this._cleanup()}}xt.MAX_AUTO_SUBSCRIBE_TOPICS=20;function Nt(e){return e.json().then((e=>e.errors.some((e=>392===e.code))))}var Rt=n(39466);class Mt{constructor(e){this.sessionId="",this.pendingState={topics:[],forceSubscribeAll:!1},this.appliedState={topics:[]},this.setTopics=(e=[])=>{this.pendingState.topics=Lt(e),this._applyPendingState()},this._subscribeAll=()=>{this.pendingState.forceSubscribeAll=!0,this._applyPendingState()},this._applyPendingState=()=>{const e=this.pendingState.forceSubscribeAll?this.pendingState.topics:this.pendingState.topics.filter((e=>-1===this.appliedState.topics.indexOf(e))),t=this.appliedState.topics.filter((e=>-1===this.pendingState.topics.indexOf(e))),n=!this.sessionId,o=0===e.length&&0===t.length;n||o||(this.appliedState={topics:this.pendingState.topics},this.pendingState={topics:this.appliedState.topics,forceSubscribeAll:!1},this.updateSubscriptions({toSubscribe:e,toUnsubscribe:t,sessionId:this.sessionId}))};const{updateSubscriptions:t,throttlePeriod:n=Mt.UPDATE_SUBSCRIPTIONS_THROTTLE}=e;this.updateSubscriptions=t,this.throttlePeriod=n,null!==n&&n>=0&&(this._applyPendingState=(0,Rt.Z)(this._applyPendingState,n,{leading:!1}))}setConfig(e=null,t=[]){if(clearInterval(this.intervalId),!e||!e.config)return;this.sessionId=e.config.session_id,this.appliedState={topics:t},this._applyPendingState();const n=(e.config.subscription_ttl_millis||Mt.DEFAULT_TTL)-Mt.TIMEOUT_PREEMPT_DURATION;this.intervalId=setInterval(this._subscribeAll,n)}teardown(){clearInterval(this.intervalId),this.updateSubscriptions({toSubscribe:[],toUnsubscribe:this.appliedState.topics,sessionId:this.sessionId})}}function Bt({condition:e,promiseFactory:t,sideEffect:n}){return(...o)=>{const s=t(...o);return s.then(e).then((e=>{e&&n()})).then((()=>s),(()=>s))}}Mt.DEFAULT_TTL=12e4,Mt.TIMEOUT_PREEMPT_DURATION=2e4,Mt.UPDATE_SUBSCRIPTIONS_THROTTLE=1e3;class Ut{constructor({makeEventSource:e,updateSubscriptions:t}){this.isSuspended=!1,this.eventSourceConnector=null,this.subscriptionsByTopic={},this._closeEventSource=()=>{this._clearExpiryTimeout(),this.livePipelineResubscriber.setConfig(null),this.eventSourceConnector&&(this.eventSourceConnector.teardown(),this.eventSourceConnector=null)},this.restartEventSource=()=>{this._closeEventSource(),this._reconcileTopics()},this._handleMessage=({payload:e,topic:t})=>{t===Ut.SYSTEM_CONFIG_TOPIC&&this.eventSourceConnector&&this.livePipelineResubscriber.setConfig(e,this.eventSourceConnector.getAutoSubscribedTopics());const n=Promise.resolve(e);return(this.subscriptionsByTopic[t]||[]).map((e=>n.then(e.callback)))},this.makeEventSource=e,this.livePipelineResubscriber=new Mt({updateSubscriptions:Bt({promiseFactory:t,condition:Nt,sideEffect:this.restartEventSource})})}teardown(){this._clearExpiryTimeout(),this.subscriptionsByTopic={},this.livePipelineResubscriber.teardown(),this.eventSourceConnector&&(this.eventSourceConnector.teardown(),this.eventSourceConnector=null)}suspend(){this.isSuspended=!0,this._reconcileTopics()}resume(){this.isSuspended=!1,this._reconcileTopics()}subscribeTopic(e,t){if(!e)return{teardown:()=>{}};const n={topic:e,callback:t};return this.subscriptionsByTopic[e]=this.subscriptionsByTopic[e]||[],this.subscriptionsByTopic[e].push(n),this._reconcileTopics(),{teardown:()=>{const t=(this.subscriptionsByTopic[e]||[]).filter((e=>e!==n));0===t.length?delete this.subscriptionsByTopic[e]:this.subscriptionsByTopic[e]=t,this._reconcileTopics()}}}_reconcileTopics(){const e=this.isSuspended?[]:Object.keys(this.subscriptionsByTopic),t=e.length>0;t&&this._clearExpiryTimeout(),this.livePipelineResubscriber.setTopics(e),this.eventSourceConnector&&this.eventSourceConnector.setTopics(e),t&&!this.eventSourceConnector?(this._closeEventSource(),this.eventSourceConnector=new xt({makeEventSource:this.makeEventSource,callback:this._handleMessage,topics:e})):t||!this.eventSourceConnector||this.connectionExpiryTimeoutId||(this.connectionExpiryTimeoutId=setTimeout(this._closeEventSource,Ut.UNUSED_CONNECTION_EXPIRY))}_clearExpiryTimeout(){clearTimeout(this.connectionExpiryTimeoutId),this.connectionExpiryTimeoutId=null}}Ut.SYSTEM_CONFIG_TOPIC="/system/config",Ut.UNUSED_CONNECTION_EXPIRY=3e4;var Ft=n(17360),zt=n(63174);let Wt;const jt={isSupported:e=>"EventSource"in window&&e.isTrue("livepipeline_client_enabled"),isSupportedAndReady(e){return this.isSupported(e)&&!!Wt},create(e,t,n){if(!this.isSupported(e))throw new Error("This browser does not support LivePipeline");if(Wt)throw new Error("LivePipeline should only be initialized once");return Wt=new Ut({makeEventSource:e=>{const t=(e=>{const t=e.map(encodeURIComponent).join(","),o=e=>`${e}/live_pipeline/events?topic=${t}`,s=o(Ft.F$),i=n.getReplacementHost(new URL(s));return i?o(`https://${i}`):s})(e);return Promise.resolve(new window.EventSource(t,{withCredentials:!0}))},updateSubscriptions:e=>t.LivePipeline.updateSubscriptions(e).catch((e=>{if(e)if(e instanceof zt.Z&&(0,Je.VZ)(e,Je.ZP.SessionNotFound))Wt&&Wt.restartEventSource();else if(!(e instanceof zt.Z)&&e instanceof Error)return Promise.reject(e);return Promise.resolve()}))}),Qe.Z.addEventListener("change",(e=>this._handleAppStateChange(e))),Wt},get(){if(!Wt)throw new Error("LivePipeline instance has not been initialized");return Wt},destroy(){Wt&&Wt.teardown(),Wt=void 0},_handleAppStateChange(e){"active"===e?this.get().resume():this.get().suspend()}},Kt=e=>{const t=(0,oe.createLocalApiErrorHandlerWithContextFactory)("MULTI_ACCOUNT_LIST_UPDATER"),n=e.dispatch(t({showToast:!1,[Je.ZP.AccessDeniedByBouncer]:{customAction:K.Z}})),o=t=>e.dispatch(t).catch(n);(window.requestIdleCallback||window.requestAnimationFrame)((()=>{o((0,et.s2)()).then((()=>{(0,et.Xy)(e.getState()).forEach(o)}))}))};var qt=n(61497),Ht=(n(85940),n(45907));const $t=["/login/error","/i/sms_login","/i/flow/lite_login","/i/flow/login","/i/flow/signup"],Vt=(e,t)=>{const n=!ke.Qb(t),o=ke.zS(t),s=ke.$q(t),{pathname:i}=Ht.ZP.location;-1===$t.indexOf(i)&&(n&&o?Ht.ZP.replace("/i/sms_login"):n&&s&&Ht.ZP.replace("/i/flow/lite_login"))};var Gt=n(24797),Xt=n(58314),Qt=n(45925),Jt=n(50519);const Yt={page:"external",action:"referred"},en=(e,t,n,o)=>{const s=e=>o.dispatch((0,oe.createLocalApiErrorHandlerWithContextFactory)(e)({})),i=Qt.zI({featureSwitches:t,query:Ht.ZP&&Ht.ZP.location.query});if((0,Gt.Z)(i))return Promise.resolve();if(i.referer&&!I.ZP.isExternalUrl(i.referer)&&!I.ZP.isInternalRedirect(i.referer))return Promise.resolve();i.referer||(i.referer=""),i.referral_details_str||(i.referral_details_str=""),i.referral_type||(i.referral_type=0);const r=(0,Jt.hZ)(t);r&&(i.external_referer_cookie_value=r);const a=Qt.ti(i),c={...Yt,client:(0,Xt.Z)().clientName};r&&a&&(c.action="set_access_referer_cookie");const l=n.createEventObject(c,"client_event",i),u=n.createPayload([l]);let p,d;p=i?e.Ocf.referer({landing_url:i.url,referral_details:i.referral_details_str||void 0,referrer_url:i.referer||void 0}).catch((()=>s("OCF_EXTERNAL_REFERER"))):Promise.resolve(),d=i?e.Attribution.recordUserEvent({event:"open",referring_link_url:i.url}).catch((()=>s("ATTRIBUTION_EXTERNAL_REFERER"))):Promise.resolve();const h=e.Jot.externalReferer(u).then((e=>{e&&(0,Jt.QF)(t,e[0])})).catch((()=>s("SCRIBE_EXTERNAL_REFERER")));return Promise.all([h,p,d])},tn=o,nn=v.Z,on=M,sn=B.ZP,rn=jt,an=s.Z,cn=Ae,ln=u,un=$e,pn=Ge,dn=ot,hn=function(e,t){const n=Object.keys(e);let o,s=!1;const i=()=>{s||(o=it()(t),n.forEach((t=>o.bind(t,(n=>{var o;(0,rt.zu)(window.location.pathname)||(o=e[t],e=>{e.preventDefault(),e.stopPropagation(),o(e)})(n)})))))};return wt(i,[lt,ut]),()=>{s=!0,vt(i),o&&o.unbind(n)}},mn=Zt,fn=Kt,bn=Vt,gn=en,Sn=Ot.wR,_n=Ve,yn=E,wn=Xe.w,En=It,vn=qt.Z,kn=fe},70025:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var o=n(67502),s=n.n(o),i=n(73036);const r={setLocation(e){document.location=e},getAppStoreURLs(e="rwoiah"){const t=a(e),n=[t.android,t.ios,t.windows],o=n.find((e=>e.matches()));return o?[o]:n},getiOSAppStoreLink(e){const t=a(e);return t.ios.matches()?t.ios.url:t.ios.webUrl},getAndroidAppStoreLink(e){const t=a(e);return t.android.matches()?t.android.url:t.android.webUrl},goToAppStore(){const e=this.getAppStoreURLs();e[0]&&r.setLocation(e[0].url)},openApp(e="twitter://timeline"){s().canUseDOM&&r.setLocation(e)}},a=(e="rwoiah")=>({android:{platform:"android",matches:()=>i.ZP.isAndroid(),url:`market://details?id=com.twitter.android&referrer=utm_source%3Drweb%26utm_medium%3D${e}`,webUrl:`https://play.google.com/store/apps/details?id=com.twitter.android&referrer=utm_source%3Drweb%26utm_medium%3D${e}`},ios:{platform:"ios",matches:()=>i.ZP.isIOS(),url:`itmss://itunes.apple.com/us/app/twitter/id333903271?mt=8&uo=${e}`,webUrl:`https://itunes.apple.com/us/app/twitter/id333903271?mt=8&uo=${e}`},windows:{platform:"windows",matches:()=>i.ZP.isWindowsPhone(),url:"ms-windows-store://pdp/?ProductId=9wzdncrfj140",webUrl:"https://www.microsoft.com/p/twitter/9wzdncrfj140"}}),c=r},61497:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});n(71372);var o=n(39466),s=n(35193),i=n(72599),r=n(86928);const a=new class{constructor(){this.usersInApp={},this._throttledInitialFetch=(0,o.Z)((()=>{this.store.dispatch(r.ZP.fetchManyIfNeeded(Object.keys(this.usersInApp)))}),1500)}init(e){this.store=e,this.usersInApp={}}registerUserInApp(e){Object.keys(this.usersInApp).length>50&&(this.usersInApp={},(0,i.ZP)(new Error("Registered users in app has exceeded 50"),{level:"warning"})),this.usersInApp[e]?this.usersInApp[e]=this.usersInApp[e]+1:(this.usersInApp[e]=1,(0,s.Z)(this._throttledInitialFetch(),100))}deregisterUserInApp(e){this.usersInApp[e]&&this.usersInApp[e]>1?this.usersInApp[e]=this.usersInApp[e]-1:delete this.usersInApp[e]}}},91670:(e,t,n)=>{"use strict";n.d(t,{Bz:()=>c,ZW:()=>h,ey:()=>u,iG:()=>d,wM:()=>a});var o=n(26853),s=n(35434);const i="geoLocation",r=Object.freeze({permissionStatus:void 0,position:void 0});const a=e=>e.geoLocation.permissionStatus,c=e=>e.geoLocation.position,l="rweb/geoLocation/SET_PERMISSION_STATUS",u=e=>({payload:e,type:l}),p="rweb/geoLocation/SET_POSITION",d=()=>(e,t)=>m().then((t=>e({payload:t,type:p}))).catch((t=>(e(u(s.S.denied)),Promise.reject(t)))),h=()=>(e,t)=>c(t())?Promise.resolve():e(d()),m=()=>new Promise(((e,t)=>navigator.geolocation.getCurrentPosition((t=>{const n={timestamp:t.timestamp,coords:{latitude:t.coords.latitude,longitude:t.coords.longitude,altitude:t.coords.altitude,accuracy:t.coords.accuracy,altitudeAccuracy:t.coords.altitudeAccuracy,heading:t.coords.heading,speed:t.coords.speed}};return e(n)}),t)));o.Z.register({[i]:function(e=r,t){switch(t.type){case l:return{...e,permissionStatus:t.payload};case p:return{...e,position:t.payload};default:return e}}})},35434:(e,t,n)=>{"use strict";n.d(t,{M:()=>s,S:()=>o});const o=Object.freeze({granted:"granted",denied:"denied",prompt:"prompt"}),s=Object.freeze({PERMISSION_DENIED:1,POSITION_UNAVAILABLE:2,TIMEOUT:3})},5780:(e,t,n)=>{"use strict";n.r(t),n.d(t,{PromptStatus:()=>h,SET_PROMPT_STATUS:()=>p,default:()=>_,fetchLoggedOutNotificationsDataTypes:()=>m,loadLoggedOutNotificationData:()=>A,pushSubscribeLoggedOut:()=>O,resetLoggedOutNotificationState:()=>I,selectArkosePromptStatus:()=>v,selectBrowserPromptStatus:()=>E,selectFetchStatus:()=>T,selectInAppPromptStatus:()=>w,selectIsEligibleForPushPrompt:()=>C,selectLastSeenTimeStamp:()=>k,selectPushNotificationsPromptIsSeen:()=>P,setLastSeenTimeStamp:()=>g,setPromptStatus:()=>b,updatePromptStatus:()=>Z,verifyArkoseTokenAndSavePushToken:()=>L,verifyArkoseTokenAndSavePushTokenActionTypes:()=>f});n(71372);var o=n(66136),s=n(59975),i=n(26853),r=n(53392),a=n(23803),c=n(67935);n(6886),n(14121),n(60523);const l="loggedOutNotifications",u="rweb.loggedOutNotifications",p="rweb/loggedOutNotifications/SET_PROMPT_STATUS",d="rweb/loggedOutNotifications/SET_LAST_SEEN_TIMESTAMP",h=Object.freeze({DISMISSED:"dismissed",APPROVED:"approved",NOT_SEEN:"not_seen",SEEN:"seen"}),m=Object.freeze({REQUEST:"rweb/loggedOutNotifications/FETCH_REQUEST",SUCCESS:"rweb/loggedOutNotifications/FETCH_SUCCESS",FAILURE:"rweb/loggedOutNotifications/FETCH_FAILURE"}),f=Object.freeze({REQUEST:"rweb/loggedOutNotifications/SAVE_PUSH_TOKEN_REQUEST",SUCCESS:"rweb/loggedOutNotifications/SAVE_PUSH_TOKEN_SUCCESS",FAILURE:"rweb/loggedOutNotifications/SAVE_PUSH_TOKEN_FAILURE"}),b=(e,t)=>({type:p,payload:{promptType:e,promptStatus:t}}),g=()=>({type:d}),S={inAppPrompt:h.NOT_SEEN,browserPrompt:h.NOT_SEEN,arkosePrompt:h.NOT_SEEN,fetchStatus:a.ZP.NONE};function _(e=S,t){switch(t.type){case m.REQUEST:return{...e,fetchStatus:a.ZP.LOADING};case m.FAILURE:return{...e,fetchStatus:a.ZP.FAILED};case m.SUCCESS:return{...e,...t.payload,fetchStatus:a.ZP.LOADED};case p:if(t.payload)return{...e,[t.payload.promptType]:t.payload.promptStatus};break;case d:return{...e,lastSeenTimestamp:Date.now()};default:return e}return e}const y=e=>({type:m.SUCCESS,payload:e}),w=e=>e[l].inAppPrompt,E=e=>e[l].browserPrompt,v=e=>e[l].arkosePrompt,k=e=>e[l].lastSeenTimestamp,T=e=>e[l].fetchStatus,P=e=>w(e)!==h.NOT_SEEN,C=e=>!P(e),A=()=>(e,t,{devicePersistence:n,featureSwitches:o})=>T(t())===a.ZP.LOADED?Promise.resolve():(e({type:m.REQUEST}),n.get(u).then((t=>null!=t&&t.lastSeenTimestamp&&function({browserPrompt:e,featureSwitches:t,lastSeenTimestamp:n}){if(e!==h.APPROVED&&"denied"!==s.qO()){const e=t.getNumberValue("responsive_web_logged_out_notifications_fatigue_days_count",7);return Date.now()-n>864e5*e}return!1}({featureSwitches:o,lastSeenTimestamp:t.lastSeenTimestamp,browserPrompt:t.browserPrompt})?e(y(S)):e(y(t)))).catch((()=>e({type:m.FAILURE})))),I=()=>(e,t)=>e(y(S)),Z=(e,t)=>(n,o,{devicePersistence:s})=>{const i={...o()[l],[e]:t};return s.set(u,i).then((()=>{"inAppPrompt"===e&&t===h.SEEN&&n(g()),n(b(e,t))}))},O=()=>(e,t,{api:n,featureSwitches:o,scribe:i})=>{const r="default"===s.qO(),a={page:"app",section:"permissions",component:"lo_notifications"},c=e=>{r&&i.log({...a,action:e})};return c("impression"),s.pI(!0).then((t=>(c("permissions_granted"),e(Z("browserPrompt",h.APPROVED)),Promise.resolve(!0))),(t=>"denied"===s.qO()?(c("permissions_denied"),e(Z("browserPrompt",h.DISMISSED)),Promise.resolve(!1)):(c("permissions_error"),e(Z("browserPrompt",h.SEEN)),Promise.resolve(!1))))},L=e=>(t,n,{api:i})=>{const{accessToken:a,publicKey:l}=function(e){var t;const n=null==(t=new URL(e,"https://twitter.com").searchParams.get("access_token"))?void 0:t.split("|");if(!n)return{};const o=(n.filter((e=>e.match("pk=")))[0]||"").slice("pk=".length),s=n.filter((e=>e.match("r=")))[0]||"";return{accessToken:s?`${n[0]}|${s}`:n[0],publicKey:o}}(e);if(!a||!l)return Promise.reject(new Error("loggedOutNotifications#verifyArkoseTokenAndSavePushToken: unable to decode arkose link"));return s.pI(!1).then((e=>{const u=n(),p=(0,c.VT)(u),d=(0,o.o)(p),{os_version:h=""}=s.lX(),{encryptionKey1:m,encryptionKey2:b,pushFcmToken:g}=function(e){const t={pushFcmToken:e.endpoint,encryptionKey1:"",encryptionKey2:""};return e.keys&&(t.encryptionKey1=e.keys.p256dh,t.encryptionKey2=e.keys.auth),t}(e),S={locale:d,accessToken:a,publicKey:l,language:p,osVersion:h,encryptionKey1:m,encryptionKey2:b,pushFcmToken:g};return r.AB(t,{params:S,request:i.LoggedOutNotifications.enableLoggedOutWebNotifications})({actionTypes:f,context:"SAVE_PUSH_TOKEN",meta:S})}),(e=>Promise.reject(e)))};i.Z.register({[l]:_})},7032:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ArkoseChallengeType:()=>_,default:()=>E});n(6886);var o=n(2784),s=n(67502),i=n(25686),r=n(73186),a=n(8443),c=n(73036),l=n(19313),u=n(90437),p=n(70025),d=n(82385),h=n(60673),m=n(37796),f=n(67935);const b="arkose-subtask",g="arkose",S={loadIframe:(e,t,n,o)=>{e.scribe({action:"load",data:{items:[{guest_id:t,os:c.ZP.osString(),arkose_keys:{mobile:n,web:o}}]},element:g,page:b})},loadIframeFailed:(e,t,n,o)=>{e.scribe({action:"fail",data:{items:[{guest_id:t,os:c.ZP.osString(),arkose_keys:{mobile:n,web:o}}]},element:g,page:b})},completeChallenge:(e,t,n,o,s)=>{e.scribe({action:"complete",data:{items:[{guest_id:t,os:c.ZP.osString(),challenge_type:n,arkose_keys:{mobile:o,web:s}}]},element:g,page:b})},suppressedChallenge:(e,t,n,o)=>{e.scribe({action:"show",data:{items:[{guest_id:t,challenge_type:_.passive,os:c.ZP.osString(),arkose_keys:{mobile:n,web:o}}]},element:g,page:b})},shownChallenge:(e,t,n,o)=>{e.scribe({action:"show",data:{items:[{guest_id:t,challenge_type:_.interactive,os:c.ZP.osString(),arkose_keys:{mobile:n,web:o}}]},element:g,page:b})}},_=Object.freeze({passive:"PASSIVE",interactive:"INTERACTIVE"}),y="twitter://onboarding/web_modal/next_link",w="twitter://onboarding/web_modal/fail_link";function E({location:e,mobileKey:t,onChallengeCompleted:n,onChallengeFailed:b,webKey:g}){var E;const[k,T]=o.useState(!0),[P,C]=o.useState(!1),{featureSwitches:A}=o.useContext(l.rC),I=(0,h.z)(),Z=(0,m.v)(f.OW),O=o.useRef(null),L=o.useRef(null);let D="",x="",N="",R="";const M=Object.freeze({light:"default",dark:"dim",darker:"dark"}),B=c.ZP.isTwitterApp()?window.matchMedia("(prefers-color-scheme: dark)")?"dark":"default":M[r.Z.theme.paletteName],U=o.useMemo((()=>c.ZP.isTwitterApp()||window.innerWidth<558),[window.innerWidth,window.innerHeight]),[F,z]=o.useState(U?500:523),[W,j]=o.useState(U?327:558),[K,q]=o.useState(_.passive),H=o.useMemo((()=>U?Math.min(window.innerWidth/327,window.innerHeight/500):1),[U,window.innerWidth,window.innerHeight]),$=o.useMemo((()=>{var t,n;return c.ZP.isTwitterApp()&&"string"==typeof(null==e||null==(t=e.query)?void 0:t.guestId)?String(null==e||null==(n=e.query)?void 0:n.guestId):c.ZP.isTwitterApp()?"":Z||""}),[null==e||null==(E=e.query)?void 0:E.guestId,Z]);return(()=>{var n,o,s;const i=String(null==e||null==(n=e.query)?void 0:n.publicKey);D=t||String(null==e||null==(o=e.query)?void 0:o.mobileKey),D=D&&"undefined"!==D?D:i,x=g||String(null==e||null==(s=e.query)?void 0:s.webKey),x=x&&"undefined"!==x?x:i,N=A.getStringValue(D),R=A.getStringValue(x)})(),o.useEffect((()=>{O.current=(0,d.Z)({name:"arkose-challenge-load"})}),[]),o.useEffect((()=>{const e=setTimeout((()=>{P||(S.loadIframeFailed(I,$,D,x),!c.ZP.isTwitterApp()&&b?b(w):c.ZP.isTwitterApp()&&p.Z.openApp(w))}),1e4),t=e=>{var t;if("string"==typeof e.data)try{const o=JSON.parse(e.data);switch(o.eventId){case"challenge-suppressed":S.suppressedChallenge(I,$,D,x),q(_.passive);break;case"challenge-shown":S.shownChallenge(I,$,D,x),q(_.interactive),T(!1);break;case"challenge-complete":S.completeChallenge(I,$,K,D,x),null==(t=L.current)||t.end({endMessage:`mobile key:${D}, web key:${x}, challenge type: ${K}`}),L.current=null,!c.ZP.isTwitterApp()&&n?n(`${y}?access_token=${o.payload.sessionToken}`):c.ZP.isTwitterApp()&&p.Z.openApp(`${y}?access_token=${o.payload.sessionToken}`);break;case"challenge-iframeSize":z(o.payload.frameHeight),j(o.payload.frameWidth)}}catch(e){}};var o;return o=t,s.canUseDOM&&window.addEventListener("message",o,!1),N&&R||(0,u.vv)(),()=>{clearTimeout(e),(e=>{s.canUseDOM&&window.removeEventListener("message",e,!1)})(t)}}),[P,n,b,I,$,L,K,t,g,A,N,R,D,x]),o.createElement(i.Z,{style:v.wrapper},k&&o.createElement(a.Z,{style:v.spinner}),N&&R?o.createElement("iframe",{height:F,id:"arkoseFrame",onLoad:()=>{var e;C(!0),null==(e=O.current)||e.end({endMessage:`mobile key:${D}, web key:${x}`}),O.current=null,L.current=(0,d.Z)({name:"arkose-challenge-complete"}),S.loadIframe(I,$,D,x)},src:U?`https://iframe.arkoselabs.com/${N}/index.html?theme=${B}`:`https://iframe.arkoselabs.com/${R}/index.html?theme=${B}`,style:{MozTransform:`scale(${H})`,OTransform:`scale(${H})`,WebkitTransform:`scale(${H})`,borderWidth:0,MozTransformOrigin:"50% 0",OTransformOrigin:"50% 0",WebkitTransformOrigin:"50% 0",alignSelf:"center"},title:"arkoseFrame",width:W}):o.createElement(a.Z,{style:v.spinner}))}const v=r.Z.create((e=>({wrapper:{backgroundColor:e.colors.white},spinner:{alignSelf:"center",height:"100%"}})))},27495:(e,t,n)=>{var o;!function(s,i,r){if(s){for(var a,c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},l={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},u={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},p={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},d=1;d<20;++d)c[111+d]="f"+d;for(d=0;d<=9;++d)c[d+96]=d.toString();_.prototype.bind=function(e,t,n){var o=this;return e=e instanceof Array?e:[e],o._bindMultiple.call(o,e,t,n),o},_.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},_.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},_.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},_.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(S(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},_.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},_.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(c[t]=e[t]);a=null},_.init=function(){var e=_(i);for(var t in e)"_"!==t.charAt(0)&&(_[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},_.init(),s.Mousetrap=_,e.exports&&(e.exports=_),void 0===(o=function(){return _}.call(t,n,t,e))||(e.exports=o)}function h(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function m(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return c[e.which]?c[e.which]:l[e.which]?l[e.which]:String.fromCharCode(e.which).toLowerCase()}function f(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function b(e,t,n){return n||(n=function(){if(!a)for(var e in a={},c)e>95&&e<112||c.hasOwnProperty(e)&&(a[c[e]]=e);return a}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function g(e,t){var n,o,s,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),s=0;s<n.length;++s)o=n[s],p[o]&&(o=p[o]),t&&"keypress"!=t&&u[o]&&(o=u[o],i.push("shift")),f(o)&&i.push(o);return{key:o,modifiers:i,action:t=b(o,i,t)}}function S(e,t){return null!==e&&e!==i&&(e===t||S(e.parentNode,t))}function _(e){var t=this;if(e=e||i,!(t instanceof _))return new _(e);t.target=e,t._callbacks={},t._directMap={};var n,o={},s=!1,r=!1,a=!1;function c(e){e=e||{};var t,n=!1;for(t in o)e[t]?n=!0:o[t]=0;n||(a=!1)}function l(e,n,s,i,r,a){var c,l,u,p,d=[],h=s.type;if(!t._callbacks[e])return[];for("keyup"==h&&f(e)&&(n=[e]),c=0;c<t._callbacks[e].length;++c)if(l=t._callbacks[e][c],(i||!l.seq||o[l.seq]==l.level)&&h==l.action&&("keypress"==h&&!s.metaKey&&!s.ctrlKey||(u=n,p=l.modifiers,u.sort().join(",")===p.sort().join(",")))){var m=!i&&l.combo==r,b=i&&l.seq==i&&l.level==a;(m||b)&&t._callbacks[e].splice(c,1),d.push(l)}return d}function u(e,n,o,s){t.stopCallback(n,n.target||n.srcElement,o,s)||!1===e(n,o)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(n),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(n))}function p(e){"number"!=typeof e.which&&(e.which=e.keyCode);var n=m(e);n&&("keyup"!=e.type||s!==n?t.handleKey(n,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):s=!1)}function d(e,t,i,r){function l(t){return function(){a=t,++o[e],clearTimeout(n),n=setTimeout(c,1e3)}}function p(t){u(i,t,e),"keyup"!==r&&(s=m(t)),setTimeout(c,10)}o[e]=0;for(var d=0;d<t.length;++d){var h=d+1===t.length?p:l(r||g(t[d+1]).action);b(t[d],h,r,e,d)}}function b(e,n,o,s,i){t._directMap[e+":"+o]=n;var r,a=(e=e.replace(/\s+/g," ")).split(" ");a.length>1?d(e,a,n,o):(r=g(e,o),t._callbacks[r.key]=t._callbacks[r.key]||[],l(r.key,r.modifiers,{type:r.action},s,e,i),t._callbacks[r.key][s?"unshift":"push"]({callback:n,modifiers:r.modifiers,action:r.action,seq:s,level:i,combo:e}))}t._handleKey=function(e,t,n){var o,s=l(e,t,n),i={},p=0,d=!1;for(o=0;o<s.length;++o)s[o].seq&&(p=Math.max(p,s[o].level));for(o=0;o<s.length;++o)if(s[o].seq){if(s[o].level!=p)continue;d=!0,i[s[o].seq]=1,u(s[o].callback,n,s[o].combo,s[o].seq)}else d||u(s[o].callback,n,s[o].combo);var h="keypress"==n.type&&r;n.type!=a||f(e)||h||c(i),r=d&&"keydown"==n.type},t._bindMultiple=function(e,t,n){for(var o=0;o<e.length;++o)b(e[o],t,n)},h(e,"keypress",p),h(e,"keydown",p),h(e,"keyup",p)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}}]);
- //# sourceMappingURL=https://ton.local.twitter.com/responsive-web-internal/sourcemaps/client-web/loader.AppModules.1f46129a.js.map
|