!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ec389379-d6ac-4cfe-b2cf-40032e9e0d00",e._sentryDebugIdIdentifier="sentry-dbid-ec389379-d6ac-4cfe-b2cf-40032e9e0d00")}catch(e){}}(),(self.webpackChunktwitch_twilight=self.webpackChunktwitch_twilight||[]).push([[24726],{839719:function(e,t,n){"use strict";n.d(t,{V:function(){return s}});var r=n(331635),i=n(474848),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.container=null,t.setContainerRef=function(e){t.container=e},t.handleGlobalMousedown=function(e){var n=e.target;t.isParentOf(n)||t.props.onClickOut(e)},t}return(0,r.__extends)(t,e),t.prototype.componentDidMount=function(){document.addEventListener("mousedown",this.handleGlobalMousedown,!0)},t.prototype.componentWillUnmount=function(){document.removeEventListener("mousedown",this.handleGlobalMousedown,!0)},t.prototype.render=function(){var e=this.props,t=(e.onClickOut,(0,r.__rest)(e,["onClickOut"]));return(0,i.jsx)("div",(0,r.__assign)({},t,{ref:this.setContainerRef,children:this.props.children}))},t.prototype.isParentOf=function(e){for(var t=e;t;){if(t===this.container)return!0;t=t.parentElement}return!1},t}(n(296540).Component)},204597:function(e,t,n){"use strict";n.d(t,{P:function(){return g}});var r,i=n(331635),s=n(474848),o=n(666311),a=n(552400),l=n(959340),c=n(914421),u=n(973421),d=n.n(u),p=n(296540),h=n(148223);!function(e){e.BalloonInsideClickDetector="balloon-inside-click-detector",e.MouseEnterDetector="toggle-balloon-wrapper__mouse-enter-detector"}(r||(r={}));var g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={showBalloon:!!t.props.openByDefault,hasInteracted:!!t.props.openByDefault},t.toggleBalloonId=(0,h.aq)(),t.handleButtonClick=function(e){t.props.preventDefault&&e.preventDefault(),t.props.stopPropagation&&e.stopPropagation(),t.setState((function(e){return{showBalloon:!e.showBalloon,hasInteracted:!0}}),(function(){t.props.onToggle&&t.props.onToggle(!t.state.showBalloon)}))},t.handleGlobalClick=function(e){e.target.matches('[data-toggle-balloon-id="'.concat(t.toggleBalloonId,'"] *'))||t.hideBalloon()},t.handleInsideBalloonClick=function(){t.hideBalloon()},t.handleMouseEnter=function(){t.props.preventMountingContentOnHover||t.state.hasInteracted||t.setState({hasInteracted:!0})},t}return(0,i.__extends)(t,e),t.prototype.componentDidMount=function(){this.props.openByDefault&&document.addEventListener("click",this.handleGlobalClick,!0)},t.prototype.componentDidUpdate=function(e,t){t.showBalloon!==this.state.showBalloon&&(this.state.showBalloon?document.addEventListener("click",this.handleGlobalClick,!0):document.removeEventListener("click",this.handleGlobalClick,!0))},t.prototype.componentWillUnmount=function(){document.removeEventListener("click",this.handleGlobalClick,!0)},t.prototype.render=function(){var e=this,t=p.Children.toArray(this.props.children);if(2!==t.length)throw new Error("ToggleBalloonWrapper should only be given two children: a clickable and a Balloon");var n,u=t[0],h=t[1];if(u.type===o.f){var g=u,m=d()(g.props.dropdown,(function(t){return t.onClick=e.handleButtonClick,t["aria-expanded"]=e.state.showBalloon,t}));n=p.cloneElement(g,{dropdown:m})}else n=!0===u.props.dropdown?p.cloneElement(u,{onClick:this.handleButtonClick,"aria-expanded":this.state.showBalloon}):p.cloneElement(u,{onClick:this.handleButtonClick});var y=null;(this.state.hasInteracted||this.props.alwaysMountBalloonContent)&&(y=p.cloneElement(h,{show:this.state.showBalloon}),this.props.hideBalloonOnInsideClick&&(y=(0,s.jsx)("div",{"data-test-selector":r.BalloonInsideClickDetector,onClick:this.handleInsideBalloonClick,role:"presentation",children:y})));var f=n;return this.props.tooltipProps&&(f=(0,s.jsx)(a.m,(0,i.__assign)({},this.props.tooltipProps,{children:n}))),(0,s.jsxs)(l.P,{"data-toggle-balloon-id":this.toggleBalloonId,display:this.props.display,position:c.yX.Relative,children:[(0,s.jsx)("div",{style:{display:"inherit"},onMouseEnter:this.handleMouseEnter,"data-test-selector":r.MouseEnterDetector,children:f}),y]})},t.prototype.toggleBalloon=function(e){void 0===e&&(e=!this.state.showBalloon),this.setState({showBalloon:e,hasInteracted:!0})},t.prototype.hideBalloon=function(){var e=this;this.setState({showBalloon:!1},(function(){e.props.onToggle&&e.props.onToggle(!0)}))},t}(p.Component)},765700:function(e,t,n){"use strict";n.d(t,{pF:function(){return p},Pm:function(){return d},eb:function(){return h}});var r=n(331635),i=n(474848),s=n(959340),o=n(97774),a=n(636367),l=n(246942),c=n.n(l),u=n(296540),d="data-tray-item",p="tw-tray-item--highlighted",h=function(e){var t,n,l=u.Children.only(e.children),h=((t={})[d]=!0,t.className=c()(((n={})[p]=e.highlighted,n)),t);return(0,i.jsx)(s.P,{borderRadius:o.Z.Medium,children:(0,i.jsx)(a.tD,(0,r.__assign)({},h,{borderRadius:o.Z.Medium,tabIndex:-1,variant:a.hJ.Alpha},e.interactableProps,{children:l}))})};h.displayName="TrayItem"},28366:function(e,t,n){"use strict";n.d(t,{f:function(){return g}});var r=n(331635),i=n(474848),s=n(959340),o=n(914421),a=n(927784),l=n(733927),c=n(97774),u=n(296540),d=n(765700),p=n(192941),h=n(148223);var g=function(e){function t(t){var n=e.call(this,t)||this;return n.inputRef=null,n.inputID=n.props.inputProps&&n.props.inputProps.id||"tw-".concat((0,h.k3)()),n.focusInput=function(){n.inputRef&&n.inputRef.focus()},n.getHighlightedIndex=function(){return n.state.highlightedIndex},n.setHighlightedIndex=function(e){n.changeHighlightIndex(e)},n.setInputRef=function(e){n.inputRef=e},n.setDropDownRef=function(e){n.dropDownRef=e},n.handleFocus=function(e){n.setState({isFocused:!0}),n.props.inputProps&&n.props.inputProps.onFocus&&n.props.inputProps.onFocus(e)},n.handleBlur=function(e){n.setState({isFocused:!1}),n.props.inputProps&&n.props.inputProps.onBlur&&n.props.inputProps.onBlur(e)},n.handleMouseOut=function(){n.changeHighlightIndex(-1)},n.handleMouseOver=function(e){var t,r=e.target.closest("[".concat(d.Pm,"=true]"));if(r){var i=null===(t=n.dropDownRef)||void 0===t?void 0:t.querySelectorAll("[".concat(d.Pm,"=true]")),s=Array.prototype.indexOf.call(i,r);n.state.highlightedIndex!==s&&n.changeHighlightIndex(s)}},n.handleKeyDown=function(e){var t=function(){e.preventDefault(),e.stopPropagation(),e.persist()};"Escape"===e.key?(t(),n.changeHighlightIndex(-1,e)):"ArrowUp"===e.key?(t(),n.changeHighlightIndex(n.state.highlightedIndex-1,e)):"ArrowDown"===e.key&&(t(),n.changeHighlightIndex(n.state.highlightedIndex+1,e)),n.props.inputProps&&n.props.inputProps.onKeyDown&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key&&n.props.inputProps.onKeyDown(e)},n.changeHighlightIndex=function(e,t){var r,i=null===(r=n.dropDownRef)||void 0===r?void 0:r.querySelectorAll("[".concat(d.Pm,"=true]"));i&&e>=i.length?e=-1:i&&e<-1&&(e=i.length-1),n.removeAllHighlights(),-1!==e&&(null==i||i.item(e).classList.add(d.pF),null==i||i.item(e).setAttribute("aria-selected","true")),n.setState({highlightedIndex:e},(function(){t&&n.props.inputProps&&n.props.inputProps.onKeyDown&&n.props.inputProps.onKeyDown(t)}))},n.removeAllHighlights=function(){var e,t=null===(e=n.dropDownRef)||void 0===e?void 0:e.querySelectorAll(".".concat(d.pF,"[").concat(d.Pm,"=true]"));t&&Array.from(t).forEach((function(e,n){t.item(n).classList.remove(d.pF),t.item(n).setAttribute("aria-selected","false")}))},n.state={isFocused:!1,highlightedIndex:-1},n}return(0,r.__extends)(t,e),t.prototype.render=function(){var e,t=(0,i.jsx)(s.P,{visibility:o.bv.Hidden,children:(0,i.jsx)(a.pd,{id:"".concat(this.inputID,"-hidden"),size:this.props.inputProps&&this.props.inputProps.size,type:this.props.inputProps&&this.props.inputProps.type||a.NZ.Text})});return(0,i.jsxs)(s.P,(0,r.__assign)({"aria-haspopup":"grid",position:o.yX.Relative,zIndex:o.Py.Default},(0,p.F)(this.props),{children:[(0,i.jsx)(s.P,{padding:.5,children:(e=this.props,void 0!==e.comboInputButtonProps?(0,i.jsx)(l.t,(0,r.__assign)({},this.props.inputProps,{buttonProps:(0,r.__assign)({},this.props.comboInputButtonProps),"data-a-target":"tray-search-input",id:this.inputID,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown,ref:this.setInputRef,type:this.props.inputProps&&this.props.inputProps.type||a.NZ.Text})):(0,i.jsx)(a.pd,(0,r.__assign)({},this.props.inputProps,{"data-a-target":"tray-input",id:this.inputID,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown,ref:this.setInputRef,type:this.props.inputProps&&this.props.inputProps.type||a.NZ.Text})))}),(0,i.jsx)(s.P,{attachTop:!0,background:o.VS.Base,borderRadius:c.Z.Large,display:this.props.showTray?o.nl.Block:o.nl.Hide,elevation:3,fullWidth:!0,padding:.5,position:o.yX.Absolute,zIndex:o.Py.Below,children:(0,i.jsxs)("div",{onMouseOut:this.handleMouseOut,onMouseOver:this.handleMouseOver,ref:this.setDropDownRef,children:[t,this.props.showTray&&this.props.children&&(0,i.jsx)(s.P,{padding:{top:.5},children:this.props.children})]})})]}))},t}(u.Component)},423720:function(e,t,n){"use strict";n.d(t,{m:function(){return a}});var r=n(474848),i=n(254714),s=n(413811),o=(n(296540),n(883474)),a=function(e){var t=e.fillColor,n=void 0===t?"brand":t,a=e.size,l=e.isLarge?i.E:s.f;return(0,r.jsx)(l,{fillColor:n,title:(0,o.hw)("Official Twitch DJ","DJIcon"),size:a})}},443512:function(e,t,n){"use strict";n.d(t,{V:function(){return i},b:function(){return s}});var r=n(949530),i={"doors-roblox":(0,r.nu)("roblox-doors.jpg"),"petsimulator-roblox":(0,r.nu)("roblox-pet-simulator.jpg"),"bloxfruits-roblox":(0,r.nu)("roblox-blox-fruits.jpg"),"deepwoken-roblox":(0,r.nu)("roblox-deep-woken.jpg"),"adopt-me-roblox":(0,r.nu)("roblox-adopt-me.jpg"),"murder-mystery-2-roblox":(0,r.nu)("roblox-murder-mystery2.jpg"),"dresstoimpress-roblox":(0,r.nu)("roblox-dress-to-impress.jpg"),"forsaken-roblox":(0,r.nu)("roblox-forsaken.jpg"),"dandysworld-roblox":(0,r.nu)("roblox-dandys-world.jpg"),"fisch-roblox":(0,r.nu)("roblox-fisch-v2.jpg"),"growagarden-roblox":(0,r.nu)("roblox-grow-a-garden-v2.jpg"),"rivals-roblox":(0,r.nu)("roblox-rivals-v2.jpg"),"deadrails-roblox":(0,r.nu)("roblox-dead-rails.jpg"),"99nightsintheforest-roblox":(0,r.nu)("roblox-99-nights-in-the-forest-v2.jpg"),"stealabrainrot-roblox":(0,r.nu)("roblox-steal-a-brainrot.jpg"),"plantsvsbrainrots-roblox":(0,r.nu)("roblox-plants-vs-brainrots.jpg"),"hypershot-roblox":(0,r.nu)("roblox-hypershot.jpg"),"creatures-of-sonaria-roblox":(0,r.nu)("roblox-sonaria.jpg"),"bee-swarm-simulator-roblox":(0,r.nu)("roblox-bee-swarm.jpg"),"bubble-gum-simulator-roblox":(0,r.nu)("roblox-bubblegum.jpg"),"pls-donate-roblox":(0,r.nu)("roblox-pls-donate.jpg")},s={doors:(0,r.nu)("roblox-doors.jpg"),petsimulatorx:(0,r.nu)("roblox-pet-simulator.jpg"),bloxfruits:(0,r.nu)("roblox-blox-fruits.jpg"),deepwoken:(0,r.nu)("roblox-deep-woken.jpg"),adoptme:(0,r.nu)("roblox-adopt-me.jpg"),murdermystery2:(0,r.nu)("roblox-murder-mystery2.jpg"),dresstoimpress:(0,r.nu)("roblox-dress-to-impress.jpg"),forsaken:(0,r.nu)("roblox-forsaken.jpg"),dandysworld:(0,r.nu)("roblox-dandys-world.jpg"),fisch:(0,r.nu)("roblox-fisch-v2.jpg"),growagarden:(0,r.nu)("roblox-grow-a-garden-v2.jpg"),rivals:(0,r.nu)("roblox-rivals-v2.jpg"),deadrails:(0,r.nu)("roblox-dead-rails.jpg"),"99nightsintheforest":(0,r.nu)("roblox-99-nights-in-the-forest-v2.jpg"),stealabrainrot:(0,r.nu)("roblox-steal-a-brainrot.jpg"),plantsvsbrainrots:(0,r.nu)("roblox-plants-vs-brainrots.jpg"),hypershot:(0,r.nu)("roblox-hypershot.jpg"),creaturesofsonaria:(0,r.nu)("roblox-sonaria.jpg"),beeswarmsimulator:(0,r.nu)("roblox-bee-swarm.jpg"),bubblegumsimulator:(0,r.nu)("roblox-bubblegum.jpg"),plsdonate:(0,r.nu)("roblox-pls-donate.jpg"),"":(0,r.nu)("roblox-other.png")}},105693:function(e,t,n){"use strict";n.d(t,{HV:function(){return F},Gd:function(){return H}});var r=n(331635),i=n(474848),s=n(848683),o=n(186396),a=n(292644),l=n(927784),c=n(79004),u=n(808681),d=n(86011),p=n(324602),h=n(959340),g=n(736585),m=n(882439),y=n(296540),f=n(415044),v=n(868238),S=n(883474),k=n(839719),I=n(204597),D=n(28366),x=n(73849),b=n(148223),_=n(368770),w=n(830137),C=n(837069),T=n(64770),Q=function(e){function t(t){var n=e.call(this,t)||this;return n.inputTimeout=0,n.state={debouncedSearchQuery:t.searchQuery,requestID:(0,b.aq)()},n}return(0,r.__extends)(t,e),t.prototype.componentDidUpdate=function(){var e=this;this.inputTimeout&&clearTimeout(this.inputTimeout),this.inputTimeout=setTimeout((function(){e.state.debouncedSearchQuery!==e.props.searchQuery&&e.setState({debouncedSearchQuery:e.props.searchQuery,requestID:(0,b.aq)()})}),S.x2.dynamicSettings.get("search_debounce_timeout_ms",50))},t.prototype.componentWillUnmount=function(){this.inputTimeout&&clearTimeout(this.inputTimeout)},t.prototype.render=function(){var e=this.state,t=e.debouncedSearchQuery,n=e.requestID,s=C.e.AllWhiteSpace.test(t);return(0,i.jsx)(T.gr,(0,r.__assign)({},this.props,{isBlankQuery:s,searchQuery:t,requestID:n}))},t}(y.Component),j=n(16427),P=n(437516),N=n(875235),F="search-result-row",R=function(e){function t(t){var n=e.call(this,t)||this;n.selectedAllText=!1,n.previousSearchQueryID=null,n.searchQueryID=(0,b.aq)(),n.searchSessionID=(0,b.aq)(),n.prefilledText="",n.keystroke=0,n.calledSprigOnce=!1,n.renderSearchTray=function(){var e=n.state.tempSearchQuery||n.state.searchQuery,t=n.getTooltipProps().label;return(0,i.jsx)(k.V,{onClickOut:n.closeDropDown,children:(0,i.jsx)("form",{role:"search",onSubmit:n.onSubmit,children:(0,i.jsx)(D.f,{showTray:n.state.showTray,comboInputButtonProps:{disabledInteraction:!e,icon:s.D,onClick:n.doSearch,type:o.sK.Secondary,"aria-label":(0,S.hw)("Search Button","SearchBox")},inputProps:{autoComplete:"twitch-nav-search",onChange:n.onChange,onFocus:n.onFocus,onKeyDown:n.onKeyDown,placeholder:t,size:a.Y.Large,spellCheck:!1,type:l.NZ.Search,"aria-label":(0,S.hw)("Search Input","SearchBox"),value:e,maxLength:65,"aria-haspopup":"grid","aria-owns":n.state.showTray?T.gF:void 0,"aria-controls":n.state.showTray?T.gF:void 0,"aria-activedescendant":n.getActiveIndexID()},ref:n.saveTrayRef,children:(0,i.jsx)(Q,{generateNewSearchQueryID:n.generateNewSearchQueryID,previousSearchQueryID:n.previousSearchQueryID,refDelegate:n.saveSearchTrayRef,refreshSuggestionHistory:n.refreshSuggestionHistory,searchQuery:n.state.searchQuery,searchQueryID:n.searchQueryID,searchSessionID:n.searchSessionID,suggestionHistory:n.state.suggestionHistory,updateSearchQuery:n.updateSearchQuery,prefilledText:n.prefilledText,keystroke:n.keystroke})})})})},n.onSubmit=function(e){e.preventDefault(),n.doSearch()},n.onKeyDown=function(e){var t,r,i,s;switch(e.key){case"Escape":case"Tab":return void(n.state.tempSearchQuery&&n.state.tempSearchQuery!==n.state.searchQuery?n.setState((function(e){return{searchQuery:e.tempSearchQuery}}),n.closeDropDown):n.closeDropDown());case"ArrowUp":case"ArrowDown":return void((n.state.searchQuery.length>0||n.state.suggestionHistory.suggestions.length>0)&&(n.openDropDown(),n.setTempSearchQuery()));default:return n.selectedAllText=n.state.searchQuery.length>0&&0===(null===(r=null===(t=n.trayRef)||void 0===t?void 0:t.inputRef)||void 0===r?void 0:r.selectionStart)&&(null===(s=null===(i=n.trayRef)||void 0===i?void 0:i.inputRef)||void 0===s?void 0:s.selectionEnd)===n.state.searchQuery.length,void(n.state.searchQuery.length>=2&&!n.calledSprigOnce&&((0,N.Rg)("search_suggestion_appear",n.props.firstPageLoaded),n.calledSprigOnce=!0))}},n.onToggleBalloon=function(e){e||n.focusInput()},n.doSearch=function(){if(n.trayRef){var e=n.trayRef.getHighlightedIndex();e>-1&&n.searchTrayRef&&e-1?u=i[c=a].tracking.suggestionID:i.length&&i[i.length-1].title===e&&(u=i[c=i.length-1].tracking.suggestionID);var d=(0,P.X4)({text:e,previousSearchQueryID:n.previousSearchQueryID,searchQueryID:n.searchQueryID,searchSessionID:n.searchSessionID,searchItemTrackingID:u,content:"view_more"}),p=d.state,h=(0,r.__rest)(d,["state"]);n.props.navigate(h,{state:p}),(0,P.K8)({previousSearchQueryID:n.previousSearchQueryID,searchQueryID:n.searchQueryID,searchSessionID:n.searchSessionID,suggestionID:u,suggestionPosition:c,suggestionText:e,explicitAcceptance:!1,implicitAcceptance:o,requestID:l,query:e,queryType:P.fe.UserTyped}),n.generateNewSearchQueryID()}},n.generateNewSearchQueryID=function(){n.previousSearchQueryID=n.searchQueryID,n.searchQueryID=(0,b.aq)()},n.openDropDown=function(){n.setState({showTray:!0})},n.closeDropDown=function(){var e;n.state.showTray&&(null===(e=n.toggleBalloonWrapperRef)||void 0===e||e.toggleBalloon(!1)),n.setState((function(e){return e.showTray?{showTray:!1}:null}))},n.onChange=function(e){var t=e.target.value;(0===t.length||n.selectedAllText)&&(n.searchSessionID=(0,b.aq)()),n.setState({searchQuery:t,tempSearchQuery:""}),n.keystroke+=1},n.onFocus=function(){""===n.state.searchQuery&&(n.searchSessionID=(0,b.aq)()),(0,P.cB)(n.searchSessionID),(n.state.suggestionHistory.suggestions.length>0||n.state.searchQuery)&&n.openDropDown(),n.prefilledText=n.state.searchQuery,n.keystroke=0},n.saveTrayRef=function(e){n.trayRef=e},n.saveSearchTrayRef=function(e){n.searchTrayRef=e},n.saveToggleBalloonWrapper=function(e){n.toggleBalloonWrapperRef=e},n.refreshSuggestionHistory=function(){n.setState({suggestionHistory:(0,j.Z0)()})},n.updateSearchQuery=function(e){n.setState({searchQuery:e,tempSearchQuery:""})},n.isBlankQuery=function(){return C.e.AllWhiteSpace.test(n.state.searchQuery)},n.handleFocusSearch=function(e){"f"===e.key&&e.altKey&&(e.preventDefault(),n.focusInput())},n.getActiveIndexID=function(){if(n.trayRef){var e=n.trayRef.getHighlightedIndex();if(e>-1&&n.state.tempSearchQuery)return"".concat(F,"__").concat(e)}},n.focusInput=function(){n.trayRef&&n.trayRef.focusInput()},n.setTempSearchQuery=function(){if(n.trayRef){var e=n.trayRef.getHighlightedIndex(),t="";if(e>-1)if(n.state.searchQuery.length>0&&n.searchTrayRef){var r=n.searchTrayRef.getSearchItems();r.length&&(t=r[e].title)}else!n.state.searchQuery.length&&n.state.suggestionHistory.suggestions.length>0&&(t=n.state.suggestionHistory.suggestions[e]);n.setState({tempSearchQuery:t})}};var c="";if(0===t.location.pathname.indexOf("/search")){var u=m.parse(n.props.location.search);u.term&&(c=u.term.toString(),(0,j.C8)(c))}return n.state={searchQuery:c,showTray:!1,suggestionHistory:(0,j.Z0)(),tempSearchQuery:""},n}return(0,r.__extends)(t,e),t.prototype.componentDidMount=function(){this.props.subscribe(this.closeDropDown),window.addEventListener("keydown",this.handleFocusSearch)},t.prototype.componentDidUpdate=function(e,t){if(e.location.pathname!==this.props.location.pathname&&"/search"!==this.props.location.pathname&&this.setState({searchQuery:"",tempSearchQuery:""},this.closeDropDown),t.searchQuery!==this.state.searchQuery){var n=this.state.searchQuery.length>0&&!this.isBlankQuery();!n&&this.state.suggestionHistory.suggestions.length>0&&t.suggestionHistory===this.state.suggestionHistory||n&&e.location.state===this.props.location.state&&e.location.search===this.props.location.search||t.searchQuery.length>0&&!n&&this.props.truncated?this.openDropDown():this.closeDropDown(),this.trayRef&&this.trayRef.setHighlightedIndex(-1)}t.suggestionHistory.suggestions.length>0&&0===this.state.suggestionHistory.suggestions.length&&this.closeDropDown()},t.prototype.componentWillUnmount=function(){window.removeEventListener("keydown",this.handleFocusSearch)},t.prototype.render=function(){var e=this.renderSearchTray(),t=this.getTooltipProps();return this.props.truncated?(0,i.jsxs)(I.P,{onToggle:this.onToggleBalloon,tooltipProps:t,ref:this.saveToggleBalloonWrapper,children:[(0,i.jsx)(c.a2,{"aria-label":t.label,icon:s.D,title:t.label}),(0,i.jsx)(u.E,{direction:d.j.BottomRight,size:p.$V.Large,offsetX:"-16.5rem",children:e})]}):(0,i.jsx)(h.P,{className:"search-box","data-a-target":"nav-search-box",children:e})},t.prototype.getTooltipProps=function(){return{align:g.HX.Center,direction:"bottom",label:(0,S.hw)("Search","SearchBox")}},t}(y.Component);var H=(0,v.Zz)((0,f.Ng)((function(e){return{isLoggedIn:(0,_.M3)(e),firstPageLoaded:e.session.firstPageLoaded}})),x.y,(0,w.Rn)((function(e){return{channelLogin:e.channelLogin,setChannelLogin:e.setChannelLogin}})))(R)},64770:function(e,t,n){"use strict";n.d(t,{gF:function(){return Z},B0:function(){return M},gr:function(){return te}});var r=n(331635),i=n(474848),s=n(296540),o=n(415044),a=n(868238),l=n(883474),c=n(739604),u=n(276337),d=n(73849),p=n(148223),h=n(368770),g=n(750735),m=n(443512),y=n(105693),f=n(959340),v=n(947322),S=n(97774),k=n(235233),I=n(973474),D=n(278818),x=n(848683),b=n(914421),_=n(312663),w=n(85208),C=n(471417),T=n(445373),Q=n(663953),j=n(79004),P=n(34212),N=n(246942),F=n.n(N),R=n(765700),H=n(659655),q=n(423720);var B,L=function(){return"variant"===l.Mv.getAssignment("cdml-ung-ossmd","string","control")},A=n(16427),E=n(437516);!function(e){e[e.Category=0]="Category",e[e.Channel=1]="Channel",e[e.History=2]="History",e[e.String=3]="String",e[e.Direct=4]="Direct"}(B||(B={}));var M,O=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=null,t.recalculateTimeout=0,t.getSubtitleText=function(){return t.props.type===B.Channel?t.props.category&&t.props.streamTitle?(0,l.hw)("{category} ยท {title}",{category:t.props.category,title:t.props.streamTitle},"SearchItem"):t.props.category?t.props.category:(0,l.hw)("Channel","SearchItem"):t.props.type===B.Category?(0,l.hw)("Category","SearchItem"):null},t.getAriaLabel=function(){var e=t.props.type;switch(e){case B.Direct:return U(t.props.title);case B.Channel:return t.getChannelLinkLabel();case B.Category:return(0,l.hw)("{title} Category",{title:t.props.title},"SearchItem");case B.History:return(0,l.hw)("{title} Previous Search",{title:t.props.title},"SearchItem");case B.String:return(0,l.hw)("Search for {title}",{title:t.props.title},"SearchItem");default:return(0,H.x)(e)}},t.renderImage=function(){var e=null,n="search-item__icon";return t.props.type===B.Direct?(0,i.jsx)(f.P,{margin:{right:.5}}):(t.props.type===B.Channel?(L()&&!t.props.isLive&&(n="search-item__icon--offline"),e=(0,i.jsx)(v.e,{alt:t.props.imageAlt,borderRadius:S.Z.Rounded,size:30,src:t.props.image,userLogin:t.props.login})):e=t.props.type===B.Category?(0,i.jsx)(k.j$,{ratio:k.gl.BoxArt,children:(0,i.jsx)(I.L,{alt:t.props.imageAlt,src:t.props.image})}):t.props.type===B.History?(0,i.jsx)(D.k,{}):(0,i.jsx)(x.D,{}),(0,i.jsx)(f.P,{className:n,display:"flex",flexShrink:0,justifyContent:"center",margin:{right:.5},children:e}))},t.handleRemoveHistory=function(e){e.preventDefault(),e.stopPropagation(),(0,A.xt)(t.props.title),t.props.refreshSuggestionHistory()},t.handleClick=function(e){(0,A.C8)(t.props.title),t.props.refreshSuggestionHistory(),(0,E.yk)(t.props.tracking),t.props.onClick&&t.props.onClick(e)},t.setRef=function(e){return t.element=e},t.debounceImpressionTracking=function(){clearTimeout(t.recalculateTimeout),t.recalculateTimeout=setTimeout((function(){t.handleImpressionTracking()}),100)},t.handleImpressionTracking=function(){t.element&&function(e,t){var n=t||100,r=e.getBoundingClientRect(),i=window.innerHeight,s=window.innerWidth;if(r.left0&&r.top0){var o=r.height;return Math.min(i-r.top,o,i)/o*100>=n}return!1}(t.element,75)&&((0,E.c6)(t.props.tracking),t.removeImpressionListener())},t.removeImpressionListener=function(){window.removeEventListener("resize",t.debounceImpressionTracking)},t}return(0,r.__extends)(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.debounceImpressionTracking),this.handleImpressionTracking()},t.prototype.componentWillUnmount=function(){this.removeImpressionListener()},t.prototype.render=function(){var e,t,n,r,s,o,a,l=F()("search-item",{"search-item__without-image":this.props.type===B.History||this.props.type===B.String||this.props.type===B.Direct,"search-item__with-image":this.props.type===B.Category||this.props.type===B.Channel,"search-item__history":this.props.type===B.History});this.props.highlightQuery?(t=this.props.title,n=this.props.highlightQuery.begin,r=this.props.highlightQuery.end,s=t.slice(0,n),o=t.slice(n,r),a=t.slice(r,t.length),e=(0,i.jsxs)(i.Fragment,{children:[s.length?(0,i.jsx)(_.N,{as:"span",color:"alt-2",children:s}):null,o,a.length?(0,i.jsx)(_.N,{as:"span",color:"alt-2",children:a}):null]})):e=this.props.type===B.Direct?U(this.props.title):this.props.title;var c=L()?this.getSubtitleText():null;return(0,i.jsx)("div",{ref:this.setRef,role:"cell",children:(0,i.jsx)(R.eb,{interactableProps:{"aria-label":this.getAriaLabel(),linkTo:this.props.linkTo,onClick:this.handleClick},children:(0,i.jsxs)(f.P,{alignItems:b.k2.Center,className:l,"data-a-target":"nav-search-item",display:"flex",padding:{x:1,y:.5},children:[(0,i.jsx)(f.P,{padding:{right:.5},children:this.renderImage()}),(0,i.jsxs)(f.P,{display:"flex",flexShrink:1,overflow:"hidden",flexGrow:1,flexDirection:"column",children:[(0,i.jsxs)(f.P,{alignItems:b.k2.Center,display:b.nl.Flex,ellipsis:!0,children:[(0,i.jsx)(_.N,{ellipsis:!0,fontSize:b.Z4.Size5,bold:!0,children:e}),(0,i.jsx)(f.P,{margin:{left:"0.3rem"},display:"flex",children:this.props.type===B.Channel&&(0,i.jsx)(V,{isVerified:this.props.isVerified,isDJ:this.props.isDJ})})]}),c&&(0,i.jsx)(_.N,{color:"alt-2",ellipsis:!0,fontSize:b.Z4.Size5,children:c})]}),this.props.type===B.Channel&&this.props.isLive&&(0,i.jsx)(G,{viewerCount:this.props.viewerCount}),this.props.type===B.History&&(0,i.jsx)(z,{title:this.props.title,removeHistory:this.handleRemoveHistory})]})})})},t.prototype.getChannelLinkLabel=function(){return this.props.type===B.Channel&&this.props.isLive?this.props.category?(0,l.hw)("{title}, {category}",{title:this.props.title,category:this.props.category},"SearchItem"):(0,l.hw)("{title} Live Channel",{title:this.props.title},"SearchItem"):(0,l.hw)("{title} Channel",{title:this.props.title},"SearchItem")},t}(s.Component),U=function(e){return(0,l.hw)("Go to {title}",{title:e},"SearchItem")},V=function(e){return(0,i.jsxs)(i.Fragment,{children:[e.isVerified&&(0,i.jsx)(f.P,{display:b.nl.Flex,margin:{left:"0.2rem"},children:(0,i.jsx)(w.K,{fillColor:C.jo.Brand,size:18})}),e.isDJ&&(0,i.jsx)(f.P,{display:b.nl.Flex,margin:{left:"0.2rem"},children:(0,i.jsx)(q.m,{size:18})})]})},G=function(e){return L()?(0,i.jsxs)(f.P,{margin:{left:.5},display:"flex",alignItems:"center",children:[(0,i.jsx)(f.P,{margin:{x:.5},children:(0,i.jsx)(T.T,{})}),e.viewerCount&&(0,i.jsx)(_.N,{as:"span","aria-label":(0,l.hw)("{count, plural, one {{count} viewer} other {{count} viewers}}",{count:e.viewerCount},"SearchItem"),children:(0,l.H2)(e.viewerCount)})]}):(0,i.jsx)(f.P,{margin:{left:.5},display:"flex",alignItems:"center",children:(0,i.jsx)(Q.qd,{})})},z=function(e){return(0,i.jsx)(f.P,{children:(0,i.jsx)(j.a2,{"aria-label":(0,l.hw)("Remove {title} from search history",{title:e.title},"SearchItem"),icon:P.O,onClick:e.removeHistory})})},W=n(382125),K=n.n(W);!function(e){e.Category="SearchSuggestionCategory",e.Channel="SearchSuggestionChannel",e.Collection="SearchSuggestionCollection"}(M||(M={}));var Y,Z="search-tray__container";!function(e){e.LoadingState="loading",e.AvailableState="available",e.UnavailableState="unavailable"}(Y||(Y={}));var X=(0,c.U)({name:"SearchSuggestions",category:"discover"}),J=X.Available,$=X.Unavailable,ee=function(e){function t(t){var n=e.call(this,t)||this;return n.lastResponseID="",n.getRequestID=function(){return n.props.requestID},n.getSearchItems=function(){return n.props.searchQuery?n.state.searchItems:n.state.historyItems},n.selectSearchItem=function(e){var t=n.getSearchItems();if(!(e<0||e>=t.length)){t[e].tracking&&(0,E.yk)(t[e].tracking),t[e].type!==B.History&&t[e].type!==B.String||n.trackSearchQuerySubmit(e),(0,A.C8)(t[e].title),n.props.refreshSuggestionHistory();var i=t[e].linkTo,s=i.state,o=(0,r.__rest)(i,["state"]);n.props.navigate(o,{state:s})}},n.setSearchItemsFromData=function(e){var t,r,i,s,o=[],a=n.props.data;if(e!==n.props&&(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.loading)&&(null==a?void 0:a.error))n.setState({searchItems:[n.getUserTypedSearchItem(0),n.getDirectToChannelSearchItem(1)],isClientAvailable:Y.UnavailableState,errorMessage:a.error.message});else{var l=null===(i=null===(r=null==a?void 0:a.searchSuggestions)||void 0===r?void 0:r.tracking)||void 0===i?void 0:i.responseID;if(l&&l!==n.lastResponseID){n.lastResponseID=l;var c=((null===(s=null==a?void 0:a.searchSuggestions)||void 0===s?void 0:s.edges)||[]).filter((function(e){return null!==e.node}));c.length>0&&(o=c.map(n.getSearchItemProps)),1===o.length&&o[0].type===B.String&&o[0].title===n.props.searchQuery||o.push(n.getUserTypedSearchItem(o.length)),o.push(n.getDirectToChannelSearchItem(o.length)),n.setState({searchItems:o,isClientAvailable:Y.AvailableState,errorMessage:null},(function(){n.reportSuggestionsReturned()}))}}},n.renderSearchItem=function(e,t){return(0,i.jsx)("div",{id:"".concat(y.HV,"__").concat(t),role:"row",children:(0,i.jsx)(O,(0,r.__assign)({},e))},"".concat(e.title,"-").concat(e.tracking.suggestionID))},n.getSearchItemProps=function(e,t){var r,i,s,o,a,c,u,d,p,h,g,y,f,v,S,k,I,D,x,b,_,w=e.node,C=w.matchingCharacters?{begin:w.matchingCharacters.start,end:w.matchingCharacters.end}:void 0,T=L();if((null===(r=w.content)||void 0===r?void 0:r.__typename)===M.Channel){var Q=void 0,j="",P="";T&&(j=null!==(c=null===(a=null===(o=null===(s=null===(i=w.content.user)||void 0===i?void 0:i.stream)||void 0===s?void 0:s.broadcaster)||void 0===o?void 0:o.broadcastSettings)||void 0===a?void 0:a.title)&&void 0!==c?c:"",P=null!==(h=null===(p=null===(d=null===(u=w.content.user)||void 0===u?void 0:u.stream)||void 0===d?void 0:d.game)||void 0===p?void 0:p.displayName)&&void 0!==h?h:"",Q=null!==(f=null===(y=null===(g=w.content.user)||void 0===g?void 0:g.stream)||void 0===y?void 0:y.viewersCount)&&void 0!==f?f:void 0),_={highlightQuery:C,category:P,streamTitle:j,viewerCount:Q,isWatchParty:!1,isLive:w.content.isLive,image:w.content.profileImageURL||l.$W.defaultAvatarURL,imageAlt:w.text,isVerified:w.content.isVerified,isDJ:null!==(k=null===(S=null===(v=w.content.user)||void 0===v?void 0:v.roles)||void 0===S?void 0:S.isParticipatingDJ)&&void 0!==k?k:void 0,linkTo:(0,E.X4)({text:w.content.login,content:"suggestion_channel",searchSessionID:n.props.searchSessionID,searchItemTrackingID:w.id,isLive:w.content.isLive}),login:w.content.login,refreshSuggestionHistory:n.props.refreshSuggestionHistory,searchQuery:n.props.searchQuery,title:w.text,tracking:n.getSearchSuggestionParams({contentID:w.content.id,clickedChannelID:w.content.id,index:t,suggestionID:w.id,text:w.text,type:w.content.isLive?E.Yf.Live:E.Yf.Offline}),type:B.Channel}}else _=(null===(I=w.content)||void 0===I?void 0:I.__typename)===M.Category?{highlightQuery:C,image:w.content.boxArtURL,imageAlt:w.text,linkTo:(0,E.X4)({text:null!==(x=null===(D=w.content.game)||void 0===D?void 0:D.slug)&&void 0!==x?x:"",content:"suggestion_game",searchSessionID:n.props.searchSessionID,searchItemTrackingID:w.id}),refreshSuggestionHistory:n.props.refreshSuggestionHistory,searchQuery:n.props.searchQuery,title:w.text,tracking:n.getSearchSuggestionParams({contentID:w.content.id,clickedCategoryID:w.content.id,index:t,suggestionID:w.id,text:w.text,type:E.Yf.Category}),type:B.Category}:(null===(b=w.content)||void 0===b?void 0:b.__typename)===M.Collection?{highlightQuery:C,image:m.V[w.content.slug],imageAlt:w.text,linkTo:(0,E.X4)({text:w.content.slug,content:"suggestion_collection",previousSearchQueryID:n.props.previousSearchQueryID,searchQueryID:n.props.searchQueryID,searchSessionID:n.props.searchSessionID,searchItemTrackingID:w.id}),refreshSuggestionHistory:n.props.refreshSuggestionHistory,searchQuery:n.props.searchQuery,title:w.text,tracking:n.getSearchSuggestionParams({contentID:w.content.id,clickedCategoryID:w.content.id,index:t,suggestionID:w.id,text:w.text,type:E.Yf.Category}),type:B.Category}:{highlightQuery:C,linkTo:(0,E.X4)({text:w.text,content:"view_more",previousSearchQueryID:n.props.previousSearchQueryID,searchQueryID:n.props.searchQueryID,searchSessionID:n.props.searchSessionID,searchItemTrackingID:w.id}),onClick:n.trackSearchQuerySubmit.bind(n,t),refreshSuggestionHistory:n.props.refreshSuggestionHistory,searchQuery:n.props.searchQuery,title:w.text,tracking:n.getSearchSuggestionParams({index:t,suggestionID:w.id,text:w.text,type:E.Yf.Text}),type:B.String};return _},n.getHistorySearchItemProps=function(e,t){var r=(0,p.aq)();return{linkTo:(0,E.X4)({text:e,content:"view_more",previousSearchQueryID:n.props.previousSearchQueryID,searchQueryID:n.props.searchQueryID,searchSessionID:n.props.searchSessionID,searchItemTrackingID:r}),onClick:n.trackSearchQuerySubmit.bind(n,t),refreshSuggestionHistory:n.props.refreshSuggestionHistory,searchQuery:"",title:e,tracking:n.getSearchSuggestionParams({index:t,isFrontEndGenerated:!0,suggestionID:r,text:e,type:E.Yf.History}),type:B.History}},n.getUserTypedSearchItem=function(e){var t=n.props,r=t.refreshSuggestionHistory,i=t.previousSearchQueryID,s=t.searchSessionID,o=t.searchQueryID,a=t.searchQuery,l=(0,p.aq)();return{linkTo:(0,E.X4)({text:a,content:"view_more",previousSearchQueryID:i,searchQueryID:o,searchSessionID:s,searchItemTrackingID:l}),onClick:n.trackSearchQuerySubmit.bind(n,e),refreshSuggestionHistory:r,searchQuery:a,title:a,tracking:n.getSearchSuggestionParams({index:e,isFrontEndGenerated:!0,suggestionID:l,text:a,type:E.Yf.Text}),type:B.String}},n.getDirectToChannelSearchItem=function(e){var t=n.props,r=t.refreshSuggestionHistory,i=t.previousSearchQueryID,s=t.searchSessionID,o=t.searchQueryID,a=t.searchQuery,l=(0,p.aq)();return{linkTo:(0,E.X4)({text:a.trim(),content:"direct_to_channel",previousSearchQueryID:i,searchQueryID:o,searchSessionID:s,searchItemTrackingID:l}),refreshSuggestionHistory:r,searchQuery:a,title:a,tracking:n.getSearchSuggestionParams({index:e,isFrontEndGenerated:!0,suggestionID:l,text:a,type:E.Yf.Direct}),type:B.Direct}},n.updateHistoryItems=function(){n.setState({historyItems:n.props.suggestionHistory.suggestions.map(n.getHistorySearchItemProps),isClientAvailable:Y.AvailableState,errorMessage:null})},n.getSearchSuggestionParams=function(e){var t,r,i,s=n.props.data,o=n.props.requestID,a=n.props.searchQuery;return e.type===E.Yf.History&&(o=null,a=e.text),e.type===E.Yf.Text||e.type===E.Yf.History||e.type===E.Yf.Direct?t=e.text:e.type===E.Yf.Category?r=e.text:e.type===E.Yf.Live&&(i=e.text),{clickedItemID:e.contentID,clickedCategoryID:e.clickedCategoryID,clickedChannelID:e.clickedChannelID,searchSessionID:n.props.searchSessionID,itemPosition:e.index,requestID:o,responseID:e.isFrontEndGenerated?"":n.lastResponseID,modelTrackingID:s&&s.searchSuggestions&&s.searchSuggestions.tracking&&s.searchSuggestions.tracking.modelTrackingID||"",query:a,suggestionID:e.suggestionID,suggestionText:e.text,suggestedText:t,suggestedCategory:r,suggestedChannel:i,suggestionType:e.type,isFrontEndGenerated:e.isFrontEndGenerated}},n.trackSearchQuerySubmit=function(e){var t,r=n.getSearchItems();if(null===(t=r[e])||void 0===t?void 0:t.tracking){var i=!n.props.searchQuery,s=i?E.fe.History:E.fe.Suggestion,o=n.props.searchQuery&&r[e].tracking.isFrontEndGenerated,a=(0,E.f8)(n.props.searchQuery,r),l=a.isImplicitAcceptance,c=a.suggestionIndex;o&&l&&c>-1&&(e=c),(0,E.K8)({previousSearchQueryID:n.props.previousSearchQueryID,searchQueryID:n.props.searchQueryID,searchSessionID:n.props.searchSessionID,suggestionID:r[e].tracking.suggestionID,suggestionPosition:e,suggestionText:r[e].title,explicitAcceptance:!o,implicitAcceptance:!!o&&l,requestID:i?"":n.props.requestID,query:r[e].title,queryType:s}),n.props.updateSearchQuery(r[e].title),n.props.generateNewSearchQueryID()}},n.trackSearchSuggestionRequest=function(){n.props.searchQuery&&(0,E.fd)({keystroke:n.props.keystroke,prefilledText:n.props.prefilledText,requestID:n.props.requestID,searchSessionID:n.props.searchSessionID,query:n.props.searchQuery})},n.reportSuggestionsReturned=function(){n.suggestionsReturned&&n.props.latencyTracking.reportCustomEvent(n.suggestionsReturned)},n.registerSuggestionsReturnedEvent=function(){return n.props.latencyTracking.resetCustomEvents("Search"),n.props.latencyTracking.registerCustomEvent({benchmark:300,group:"Search",key:"search-suggestions-returned",label:"Suggestions Rendered",start:"registration"})},n.state={historyItems:t.suggestionHistory.suggestions.map(n.getHistorySearchItemProps),searchItems:[],isClientAvailable:Y.LoadingState,errorMessage:null},n}return(0,r.__extends)(t,e),t.prototype.componentDidMount=function(){this.props.refDelegate&&this.props.refDelegate(this),this.setSearchItemsFromData(),this.trackSearchSuggestionRequest()},t.prototype.componentDidUpdate=function(e){e.suggestionHistory!==this.props.suggestionHistory&&this.updateHistoryItems(),this.setSearchItemsFromData(e),e.searchQuery!==this.props.searchQuery&&(this.suggestionsReturned=this.registerSuggestionsReturnedEvent(),this.trackSearchSuggestionRequest())},t.prototype.render=function(){var e,t,n=this.props.searchQuery&&!this.props.isBlankQuery?this.state.searchItems:this.state.historyItems;return t=this.state.isClientAvailable===Y.LoadingState?(0,i.jsx)(i.Fragment,{children:n.map(this.renderSearchItem)}):this.state.isClientAvailable===Y.UnavailableState?(0,i.jsx)($,{reason:null!==(e=this.state.errorMessage)&&void 0!==e?e:"data error",children:n.map(this.renderSearchItem)}):(0,i.jsx)(J,{children:n.map(this.renderSearchItem)}),(0,i.jsx)("div",{className:"search-tray","data-a-target":"nav-search-tray",role:"grid",id:Z,children:t})},t}(s.Component);var te=(0,a.Zz)(d.y,(0,o.Ng)((function(e){return{isLoggedIn:(0,h.M3)(e)}})),(0,u._v)(K(),{options:function(e){return{errorPolicy:"no-cache-write",variables:{requestID:e.requestID,queryFragment:e.searchQuery,withOfflineChannelContent:L()}}},skip:function(e){return!e.searchQuery||e.isBlankQuery}}),(0,g.W)("SearchTray",{autoReportInteractive:!0}))(ee)},837069:function(e,t,n){"use strict";n.d(t,{e:function(){return r}});var r={AllWhiteSpace:/^\s+$/}},16427:function(e,t,n){"use strict";n.d(t,{C8:function(){return u},Z0:function(){return c},xt:function(){return d}});var r=n(331635),i=n(883474),s=n(368770),o="searchSuggestionHistory",a=5,l=function(){return{id:"",suggestions:[]}};function c(e){void 0===e&&(e=!0);var t=i.IG.get(o,l());if(e){var n=i.x2.store.getState(),a=(0,s.wz)(n),c=a?a.id:"";if((0,s.H4)(n)&&(!t||t.id!==c))return function(e){var t=(0,r.__assign)((0,r.__assign)({},l()),{id:e||""});return i.IG.set(o,t),t}(c)}return t}function u(e){var t=c(),n=t.suggestions.indexOf(e);return n>-1&&t.suggestions.splice(n,1),t.suggestions.unshift(e),t.suggestions.length>a&&(t.suggestions.length=a),i.IG.set(o,t),t}function d(e){var t=c(),n=t.suggestions.indexOf(e);return n>-1&&t.suggestions.splice(n,1),i.IG.set(o,t),t}},437516:function(e,t,n){"use strict";n.d(t,{FW:function(){return g},K8:function(){return S},X4:function(){return p},Yf:function(){return r},c6:function(){return f},cB:function(){return y},f8:function(){return d},fd:function(){return k},fe:function(){return h},yk:function(){return v},z$:function(){return m}});var r,i=n(331635),s=n(883474),o=n(253283),a=n(148223),l=n(913140),c=n(53961),u="search_bar";function d(e,t){var n=!1,r=-1;return t.forEach((function(t,i){t.title.toLocaleLowerCase()!==e.toLocaleLowerCase()||t.tracking.isFrontEndGenerated||(n=!0,r=i)})),{isImplicitAcceptance:n,suggestionIndex:r}}function p(e){var t,n=e.text,r=e.content,s=e.previousSearchQueryID,a=e.searchQueryID,l=e.searchSessionID,c=e.searchItemTrackingID,u=e.isLive;return t="suggestion_channel"===r||"direct_to_channel"===r?{pathname:"/".concat(encodeURIComponent(n))}:"suggestion_game"===r?{pathname:(0,o._4)({slug:n})}:"suggestion_collection"===r?{pathname:(0,o.yJ)(n)}:(0,o.iS)(n),(0,i.__assign)((0,i.__assign)({},t),{state:g({content:r,previousSearchQueryID:s,searchQueryID:a,searchSessionID:l,searchItemTrackingID:c,isLive:u})})}!function(e){e.Category="category",e.Live="live",e.Offline="offline_channel",e.Text="text",e.History="history",e.Direct="direct_to_channel"}(r||(r={}));var h,g=function(e){var t,n=((t={content:e.content,medium:"search"})[c.oK]=e.searchSessionID,t[c.I6]=e.searchQueryID,t[c.f7]=e.searchItemTrackingID,t.previous_search_query_id=e.previousSearchQueryID,t.freeform_tag_filter=e.freeformTagFilter,t);return"suggestion_channel"===e.content&&(n.channelView=e.isLive?l.n.Watch:l.n.Home),n};function m(){var e=s.E5.getLastPageview();return{location:e&&e.location,content:e&&e.content,content_type:e&&e.content_type}}function y(e){s.E5.track("search_input_focus",(0,i.__assign)({search_session_id:e},m()))}function f(e){s.E5.__track_SSRMigrationFixme("search_suggestion_display",(0,i.__assign)({search_session_id:e.searchSessionID,item_position:e.itemPosition,request_id:e.requestID,response_id:e.responseID,section:u,model_tracking_id:e.modelTrackingID,query:e.query,suggestion_tracking_id:e.suggestionID||(0,a.aq)(),suggestion_text:e.suggestionText,suggestion_type:e.suggestionType,suggested_channel:e.suggestedChannel,suggested_category:e.suggestedCategory,suggested_text:e.suggestedText},m()))}function v(e){s.E5.__track_SSRMigrationFixme("search_suggestion_click",(0,i.__assign)({clicked_item_id:e.clickedItemID,clicked_category_id:e.clickedCategoryID,clicked_channel_id:e.clickedChannelID,search_session_id:e.searchSessionID,item_position:e.itemPosition,request_id:e.requestID,response_id:e.responseID,section:u,model_tracking_id:e.modelTrackingID,query:e.query,suggestion_tracking_id:e.suggestionID||(0,a.aq)(),suggestion_text:e.suggestionText,suggestion_type:e.suggestionType},m()))}function S(e){s.E5.track("search_query_submit",(0,i.__assign)({search_session_id:e.searchSessionID,search_query_id:e.searchQueryID,suggestion_tracking_id:e.suggestionID||(0,a.aq)(),suggestion_position:e.suggestionPosition,suggestion_text:e.suggestionText,explicit_acceptance:e.explicitAcceptance,implicit_acceptance:e.implicitAcceptance,request_id:e.requestID,query:e.query,query_type:e.queryType,previous_search_query_id:e.previousSearchQueryID},m()))}function k(e){s.E5.track("search_suggestion_request",(0,i.__assign)({request_id:e.requestID,search_session_id:e.searchSessionID,query:e.query,section:"search_bar",prefilled_text:e.prefilledText,keystroke:e.keystroke},m()))}!function(e){e.Suggestion="suggestion",e.History="history",e.UserTyped="user_typed",e.ShowAll="show_all"}(h||(h={}))},382125:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchTray_SearchSuggestions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"queryFragment"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"requestID"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"withOfflineChannelContent"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchSuggestions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"queryFragment"},value:{kind:"Variable",name:{kind:"Name",value:"queryFragment"}}},{kind:"Argument",name:{kind:"Name",value:"requestID"},value:{kind:"Variable",name:{kind:"Name",value:"requestID"}}},{kind:"Argument",name:{kind:"Name",value:"withOfflineChannelContent"},value:{kind:"Variable",name:{kind:"Name",value:"withOfflineChannelContent"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchSuggestionNode"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"tracking"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"modelTrackingID"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"responseID"},arguments:[],directives:[]}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"searchSuggestionNode"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SearchSuggestionEdge"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SearchSuggestionChannel"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isLive"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isVerified"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"login"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"profileImageURL"},arguments:[{kind:"Argument",name:{kind:"Name",value:"width"},value:{kind:"IntValue",value:"50"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"roles"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isParticipatingDJ"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"stream"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"viewersCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"game"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displayName"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"broadcaster"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"broadcastSettings"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]}]}}]}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SearchSuggestionCategory"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"boxArtURL"},arguments:[{kind:"Argument",name:{kind:"Name",value:"width"},value:{kind:"IntValue",value:"30"}},{kind:"Argument",name:{kind:"Name",value:"height"},value:{kind:"IntValue",value:"40"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"game"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"slug"},arguments:[],directives:[]}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SearchSuggestionCollection"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"slug"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"matchingCharacters"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"start"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"end"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"text"},arguments:[],directives:[]}]}}]}}]};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var r=e.type;"NamedType"===r.kind&&t.add(r.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var r={};t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),r[e.name.value]=t}})),e.exports=t}}]);