"use strict";(self.webpackChunk_multimediallc_cb_ts=self.webpackChunk_multimediallc_cb_ts||[]).push([[149],{3360:(e,t,i)=>{i.d(t,{K:()=>h});var s=i(8861),n=i(5216),a=i(2709),o=i(7407),r=i(4947),l=i(5411);class h extends a.u{constructor(){super(),this.element.style.position="relative",this.element.style.display="none",this.innerDiv=document.createElement("div"),this.innerDiv.className="top_alert",this.element.appendChild(this.innerDiv);const e=document.createElement("span");e.className="top_alert_close",e.innerText="×",e.style.fontSize="2em",e.dataset.testid="mobile-site-notice-close",this.innerDiv.appendChild(e),e.onclick=()=>{(0,s.uC)("mobile_redirect_hide","true",{hours:18}),this.element.style.display="none"};const t=document.createElement("div"),i=document.createElement("span");i.textContent=r.R.improvedMobileSite,t.appendChild(i);const n=document.createElement("div"),a=document.createElement("ul");a.style.listStyleType="disc";const h=document.createElement("li");h.textContent=r.R.myCollectionText;const c=document.createElement("li");c.textContent=r.R.satisfactionVoting;const d=document.createElement("li");d.textContent=r.R.reportAbuse,a.appendChild(h),a.appendChild(c),a.appendChild(d),n.appendChild(a);const p=document.createElement("div"),m=document.createElement("span");m.innerHTML=r.R.visitMobileSiteOrFeedback(),this.mobileLink=m.querySelectorAll("a")[0],this.mobileLink.dataset.testid="mobile-site-notice-link";const g=m.querySelectorAll("a")[1];p.appendChild(m),this.mobileLink.onclick=()=>{(0,o.bT)("MobileAlertLinkClicked")},g.onclick=()=>{(0,o.bT)("MobileAlertSurveyClicked"),l.E.fire({source:"desktop_on_mobile"})},this.innerDiv.appendChild(t),this.innerDiv.appendChild(n),this.innerDiv.appendChild(p)}show(e){let t;t=void 0!==e?`https://m.chaturbate.com/mobile/?b=${e}&source=desktop`:"https://m.chaturbate.com/",this.mobileLink.href=(0,n._Y)(t),this.element.style.display="block"}}},4691:(e,t,i)=>{i.d(t,{p:()=>l});var s=i(6624),n=i(82),a=i(4947),o=i(1372),r=i(9461);class l extends n.b{createElement(e){return(0,o.tT)("p",{className:"filters-info"})}alertLinks(e){return(0,o.tT)("span",{"data-testid":"not-visible-regions-filters-info"},(0,o.tT)("span",null,a.R.notShowingFromRegions," "),e.map(((t,i)=>(0,o.tT)("span",null,(0,o.tT)("a",{className:"advanced_search_region",href:"#"},t),(0,o.tT)("span",null,i===e.length-1?"":i{this.selectedRegions=""!==e?e:s.AllRegionValues.join(","),this.updateAlertMessage()})),this.updateAlertMessage()}updateAlertMessage(){const e=(0,s.getRegionCategoryFilter)(),t=(i=void 0===e?this.selectedRegions:e,s.AllRegionValues.filter((e=>!i.includes(e))).map((e=>{var t;return null!==(t=h.get(e))&&void 0!==t?t:""})));var i;if(this.element.textContent="",t.length>0&&!(0,s.shouldShowHomepageFilters)()){const e=this.alertLinks(t);this.element.appendChild(e)}window.setTimeout((()=>{this.advancedSearchOptions.bindAdvancedSearchRegion()}))}dispose(){this.regionChangeListener.removeListener()}}const h=new Map([[s.Region.NorthAmerica,a.R.northAmericaTitle],[s.Region.SouthAmerica,a.R.southAmericaTitle],[s.Region.Asia,a.R.asiaTitle],[s.Region.EuropeRussia,a.R.europeRussiaTitle],[s.Region.Other,a.R.otherTitle]])},5294:(e,t,i)=>{i.d(t,{M:()=>r});var s=i(6624),n=i(82),a=i(4947),o=i(1372);class r extends n.b{constructor(e){super(e)}createElement(e){return(0,o.tT)("p",{className:"no-rooms-available","data-testid":"no-rooms-available",bind:{text:()=>this.messageString(),display:()=>!0===this.state.filterPanelActive?"none":0===this.state.numRooms?"block":"none"}})}messageString(){const e=this.searchString();return e.length>0?a.R.noSearchResultsMatch(e):a.R.noRoomsAvailableFiltered}searchString(){const e=(0,s.getPageHashtag)(),[t,i]=(0,s.extractKeywords)();return void 0!==e&&i.push(e),[...t,...i.map((e=>`#${e}`))].join(" ")}}},166:(e,t,i)=>{i.d(t,{q:()=>xe});var s=i(6624),n=i(7623),a=i(6784),o=i(2709),r=i(82),l=i(3955),h=i(9060),c=i(7882),d=i(7407),p=i(1372),m=i(2945),g=i(6262),u=i(7321),T=i(369),v=i(1968),f=i(6615),C=i(7063),S=i(5216),R=i(1452),w=i(4947);function y(e,t){return t===c.YT.All||""===e?(0,S._Y)(`/tag/${e}/`):(0,S._Y)(`/tag/${e}/${c.hf.get(t)}/`)}function A(e){const t="/tags/"+(e!==c.YT.All?`${c.hf.get(e)}/`:"");return(0,S._Y)(t)}function L(e){const t=(0,c.tg)(e),i=""===t?"/":`/${t}/`;return(0,S._Y)(i)}class b extends r.b{constructor(e){super(e),this.props=e,u.HA.getInstance().addOnLoadHandler((()=>{this.updateState()}))}createElement(e){return(0,p.tT)("div",{className:"hashtag-ticker-container"})}updateState(){super.updateState();const e=this.state.genders.map((e=>e===c.YT.Trans?c.YT.OldTrans:e)),t=new URLSearchParams(e.map((e=>["genders",e])));(0,S.Aw)(`api/ts/hashtags/top_tags/?${t.toString()}`).then((e=>{const t=new C.N6(e.responseText).getStringList("all_tags");this.updateElement(t)})).catch(R.h5)}updateElement(e){var t;null===(t=this.element.querySelector("#hashtag_ticker"))||void 0===t||t.remove(),e.length>0&&this.element.appendChild((0,p.tT)("div",{id:"hashtag_ticker","data-paction":"HomepageHashtag","data-paction-send-position":"true","data-testid":"hashtag-ticker"},(0,p.tT)("a",{id:"more_hashtags_link",href:A(this.getGender()),"data-testid":"more-hashtags-link"},w.R.moreTags),this.tagsRow(e)))}tagsRow(e){return e.map((e=>this.bindTagsPageAction((0,p.tT)("a",{className:"tag-link",href:y(e,this.getGender()),onClick:this.props.onTagClick},"#",e))))}getGender(){return this.state.genders.length>0?this.state.genders[0]:c.YT.All}bindTagsPageAction(e){return(0,a.wu)("click",e,(()=>{var t;(0,d.bT)("RoomsFilterTagsClicked",{tagName:null!==(t=e.textContent)&&void 0!==t?t:void 0,source:"HashtagTicker"})})),e}}class P extends r.b{constructor(e){super(e),this.props=e}createElement(e){return(0,p.tT)("div",{className:"remove-hashtag-filter"})}updateState(){super.updateState(),""!==this.state.hashtag?(this.element.textContent=w.R.roomFilteredByHashtag(this.state.hashtag),this.element.appendChild((0,p.tT)("a",{href:L(this.state.gender),onClick:this.props.onTagClick},w.R.removeFilter)),this.element.style.display=""):this.element.style.display="none"}}var k=i(1048),F=i(1224);class I extends r.b{createElement(e){return this.props=e,(0,p.tT)("link",{rel:this.props.rel,...void 0!==this.props.title&&""!==this.props.title&&{title:this.props.title},...void 0!==this.props.media&&""!==this.props.media&&{media:this.props.media},...void 0!==this.props.type&&""!==this.props.type&&{type:this.props.type},...void 0!==this.props.hreflang&&""!==this.props.hreflang&&{hrefLang:this.props.hreflang},href:this.props.href,bind:{href:()=>this.state.href}})}updateState(){super.updateState(),void 0!==this.state.title&&""!==this.state.title?this.element.title=this.state.title:this.element.removeAttribute("title")}}class E extends r.b{createElement(e){return(0,p.tT)("meta",{...void 0!==e.name&&""!==e.name&&{name:e.name},...void 0!==e.property&&{property:e.property},content:e.content,bind:{content:()=>this.state.content}})}}class x{constructor(){this.replaceTags(),this.findRssAppendAfterElement()}getMetaTitle(e,t,i){let s="";const n=(0,C.nx)(F.m.siteName);return s=t?w.R.metaTitlePremium(n):""!==i?w.R.metaTitleHashtag(n,(0,C.nx)(i)):e===k.YT.Female?w.R.metaTitleFemale(n):e===k.YT.Male?w.R.metaTitleMale(n):e===k.YT.Couple?w.R.metaTitleCouples(n):e===k.YT.Trans||e===k.YT.OldTrans?w.R.metaTitleTrans(n):w.R.metaTitleDefault(n),s}findRssAppendAfterElement(){var e;const t=document.head.querySelector("[media='only screen and (max-width: 640px)']");this.rssAppendAfterElement=null!==t?t:null!==(e=document.head.querySelector("title"))&&void 0!==e?e:void 0}getMetaContentCardDescription(e,t,i){let s="";return s=t?w.R.metaContentCardDescriptionPremium:""!==i?w.R.metaContentCardDescriptionHashtag((0,C.nx)(i)):e===k.YT.Female?w.R.metaContentCardDescriptionFemale:e===k.YT.Male?w.R.metaContentCardDescriptionMale:e===k.YT.Couple?w.R.metaContentCardDescriptionCouples:e===k.YT.Trans||e===k.YT.OldTrans?w.R.metaContentCardDescriptionTrans:w.R.metaContentCardDescriptionDefault,s}getMetaDescription(e,t){const i=[],s=(0,C.nx)(window.location.hostname);return e===k.YT.Female?i.push(w.R.metaDescriptionFemale(s)):e===k.YT.Male?i.push(w.R.metaDescriptionMale(s)):e===k.YT.Couple?i.push(w.R.metaDescriptionCouples(s)):e===k.YT.Trans||e===k.YT.OldTrans?i.push(w.R.metaDescriptionTrans(s)):i.push(w.R.metaDescriptionDefault),t&&i.push(w.R.metaDescriptionPremium),i.join("\n")}getMetaKeywords(e,t,i){const s=[];return""!==i&&s.push(w.R.metaKeywordsHashtag(i)),e===k.YT.Female?s.push(w.R.metaKeywordsFemale):e===k.YT.Male?s.push(w.R.metaKeywordsMale):e===k.YT.Couple?s.push(w.R.metaKeywordsCouple):e===k.YT.Trans||e===k.YT.OldTrans?s.push(w.R.metaKeywordsTrans):t||s.push(w.R.metaKeywordsDefault),t&&s.push(w.R.metaKeywordsPremium),s.join(" ")}getNewURLWithCurrentPathAndSearch(e){const t=new URL(e);return t.pathname=window.location.pathname,t.search=window.location.search,t.toString()}createRssLinks(e,t){if(this.removeRssLinks(this.rssLinkComponents.map((e=>e.element))),this.rssLinkComponents=[],t||e===k.YT.All){const i={rel:"alternate",type:"application/rss+xml",href:this.getRssLinkHref(e,t),title:this.getRssLinkTitle(e,t)},s=new I(i);this.rssLinkComponents.push(s),void 0!==this.rssAppendAfterElement&&this.rssAppendAfterElement.insertAdjacentElement("afterend",s.element)}if(e!==k.YT.All){const t={rel:"alternate",type:"application/rss+xml",href:this.getRssLinkHref(e,!1),title:this.getRssLinkTitle(e,!1)},i=new I(t);this.rssLinkComponents.push(i),void 0!==this.rssAppendAfterElement&&this.rssAppendAfterElement.insertAdjacentElement("afterend",i.element)}}removeRssLinks(e){for(const t of e)t.remove()}getRssLinkHref(e,t){const i=new URLSearchParams;return e!==k.YT.All&&i.set("gender",e),t&&i.set("premium","1"),`/feed/latest/?${i.toString()}`}getRssLinkTitle(e,t){let i=w.R.featuredText;const s=(0,C.nx)(F.m.siteName);return t?i=w.R.premiumShowsCaps:e===k.YT.Female?i=w.R.femaleText:e===k.YT.Male?i=w.R.maleText:e===k.YT.Couple?i=w.R.coupleText:e===k.YT.Trans&&(i=w.R.transText),w.R.rssLinkTitle(i,s)}replaceTags(){this.canonicalLinkComponent=this.getLinkComponentFromSelector("[rel='canonical']"),this.hreflangComponents=[],this.rssLinkComponents=[];const e=document.head.querySelectorAll("[hreflang]");for(const t of e){const e=this.getLinkComponentFromReplacedLinkTag(t);void 0!==e&&this.hreflangComponents.push(e)}this.metaDescriptionComponent=this.getMetaComponentFromSelector("[name='description']"),this.metaKeywordsComponent=this.getMetaComponentFromSelector("[name='keywords']"),this.mediaLinkComponent=this.getLinkComponentFromSelector("[media='only screen and (max-width: 640px)']");const t=document.head.querySelectorAll("[type='application/rss+xml']");for(const e of t){const t=this.getLinkComponentFromReplacedLinkTag(e);void 0!==t&&this.rssLinkComponents.push(t)}this.metaTitleComponent=this.getMetaComponentFromSelector("[property='og:title']"),this.metaContentCardDescriptionComponent=this.getMetaComponentFromSelector("[property='og:description']"),this.metaURLComponent=this.getMetaComponentFromSelector("[property='og:url']")}getMetaComponentFromSelector(e){var t;const i=document.head.querySelector(e);if(null===i)return;const s={name:i.name,property:null!==(t=i.getAttribute("property"))&&void 0!==t?t:void 0,content:i.content},n=new E(s);return i.replaceWith(n.element),n}getLinkComponentFromSelector(e){const t=document.head.querySelector(e);return this.getLinkComponentFromReplacedLinkTag(t)}getLinkComponentFromReplacedLinkTag(e){if(null===e)return;const t={href:e.href,hreflang:e.hreflang,rel:e.rel,title:e.title,media:e.media,type:e.type},i=new I(t);return e.replaceWith(i.element),i}updateTags(e,t,i){const s=this.getNewURLWithCurrentPathAndSearch(`https://${F.c.CBAlias}/`),n=new URLSearchParams(window.location.search),a=new URL(window.location.href);this.updateLinkComponent(this.canonicalLinkComponent,{href:s});for(const e of this.hreflangComponents)"x-default"!==e.element.hreflang&&(n.set("language",e.element.hreflang),a.search=n.toString()),this.updateLinkComponent(e,{href:a.toString()});this.updateMetaComponent(this.metaDescriptionComponent,{content:this.getMetaDescription(e,t)}),this.updateMetaComponent(this.metaKeywordsComponent,{content:this.getMetaKeywords(e,t,i)}),this.updateLinkComponent(this.mediaLinkComponent,{href:this.getNewURLWithCurrentPathAndSearch(`https://m.${F.c.CBAlias}/`)}),this.createRssLinks(e,t),this.updateMetaComponent(this.metaTitleComponent,{content:this.getMetaTitle(e,t,i)}),this.updateMetaComponent(this.metaContentCardDescriptionComponent,{content:this.getMetaContentCardDescription(e,t,i)}),this.updateMetaComponent(this.metaURLComponent,{content:s})}updateMetaComponent(e,t){void 0!==e&&e.setState(t)}updateLinkComponent(e,t){void 0!==e&&e.setState(t)}}var M=i(3360),N=i(878);class _ extends r.b{createElement(){return(0,p.tT)("div",{onClick:()=>this.handleClick(),bind:{className:()=>"homepageFilterButton "+(this.state.isActive?"active":"")},"data-testid":"filter-button"},(0,p.tT)("div",{bind:{className:()=>"homepageFilterIcon "+(this.state.hasSelectedFilters?"applied":"")}}),(0,p.tT)("div",{colorClass:"text","data-testid":"filter-button-text"},w.R.filters))}initData(e){super.initData(e),f.T.current.listen([],(()=>{this.setState({...this.state,hasSelectedFilters:(0,s.homepageFiltersCurrentlyApplied)()})}),this.element),this.filterPanel=e.filterPanel,this.setState({hasSelectedFilters:(0,s.homepageFiltersCurrentlyApplied)(),isActive:(0,N.fk)()})}initUI(e){super.initUI(e)}setActive(e){this.setState({...this.state,isActive:e}),this.filterPanel.setState({isOpen:this.state.isActive}),(0,N.xX)(e)}handleClick(){this.setActive(!this.state.isActive),(0,d.bT)("HmpgFilterPanelMovement",{open:this.state.isActive})}}class O extends r.b{initUI(e){super.initUI(e),this.addToLabelSection()||window.setTimeout((()=>{this.addToLabelSection()}),250)}createElement(e){return(0,p.tT)("div",{className:"filterLabel","data-testid":"filter-label-remove","data-ishashtag":e.title.startsWith("#")},e.title,(0,p.tT)("div",{onClick:()=>{this.removeFilter(e)},className:"filterLabelRemove"}))}initData(e){super.initData(e),this.props=e}removeFilter(e){this.element.remove(),(0,d.bT)("HmpgFilterLabelClicked",{title:this.props.title}),e.onRemoval()}addToLabelSection(){const e=document.body.querySelector("div[class=filterLabelSection]");if(null!==e){const t=e.firstElementChild;if(t instanceof HTMLDivElement&&"true"===t.dataset.ishashtag){const t=e.children[1];e.insertBefore(this.element,t)}else e.prepend(this.element);return!0}return!1}getTitle(){return this.props.title}}class U extends r.b{createElement(e){return(0,p.tT)("div",{onClick:()=>{this.clearAll(e)},className:"filtersClearButton","data-testid":"filter-clear-button"},(0,p.tT)("div",{colorClass:"text"},w.R.clear))}clearAll(e){e.onClearAll()}initData(e){super.initData(e),this.showOrHide((0,s.homepageFiltersCurrentlyApplied)()),f.T.current.listen([],(()=>{this.showOrHide((0,s.homepageFiltersCurrentlyApplied)())}),this.element)}showOrHide(e){e?this.showElement("inline-block"):this.hideElement()}}class D extends r.b{createElement(e){return this.props=e,(0,p.tT)("div",{className:"filterLabelSection"},(0,p.tT)(U,{classRef:e=>{this.clearButton=e},onClearAll:e.onClearAll}))}initData(e){super.initData(e),this.updateTagFilterLabel(),f.T.current.listen(["tags"],(()=>{this.updateTagFilterLabel()}),this.element)}updateTagFilterLabel(){var e;const t=null===(e=f.T.current.state.tags)||void 0===e?void 0:e[0];void 0!==t?void 0!==this.tagLabel?this.tagLabel.getTitle().slice(1)!==t&&this.replaceTagLabel(t):this.createTagLabel(t):void 0!==this.tagLabel&&(this.tagLabel.element.remove(),delete this.tagLabel)}replaceTagLabel(e){var t;null===(t=this.tagLabel)||void 0===t||t.element.remove(),this.createTagLabel(e)}createTagLabel(e){this.tagLabel=new O({title:`#${e}`,onRemoval:()=>{f.T.current.clearStateKeys(["tags"],!1),this.props.onRemoval()}})}}var H=i(4801),K=i(1816);class Y extends r.b{createElement(e){return(0,p.tT)("div",{className:"filterSection","data-testid":"filter-age-section"},(0,p.tT)("div",{className:"filterSectionHeader","data-testid":"filter-age-header"},w.R.agesCAPS),(0,p.tT)("a",{className:"clear",href:"#","data-testid":"filter-age-clear-button",onClick:()=>{this.resetAgeFilters(),(0,d.bT)("HmpgFilterAgeRangeReset")}},"(",w.R.reset,")"),(0,p.tT)("div",{className:"filterSectionOptions ageInputs"},(0,p.tT)("input",{type:"number",className:"min","data-testid":"filter-age-min-input",ref:e=>{this.minAgeInput=e},value:s.DEFAULT_MIN_AGE,onChange:()=>this.handleMinAgeChange(),onKeyDown:e=>{var t;"Enter"===(null!==(t=e.key)&&void 0!==t?t:"")&&(this.handleMinAgeChange(!1),this.handleSubmitClick(),this.minAgeInput.blur()),this.preventNonNumericChars(e)},onClick:e=>this.handleInputClick(e),onInput:()=>this.setApplyButtonActive()}),(0,p.tT)("p",null,w.R.ageRangeTo()),(0,p.tT)("input",{type:"number",className:"max","data-testid":"filter-age-max-input",ref:e=>{this.maxAgeInput=e},onChange:()=>this.handleMaxAgeChange(),onKeyDown:e=>{var t;"Enter"===(null!==(t=e.key)&&void 0!==t?t:"")&&(this.handleMaxAgeChange(!1),this.handleSubmitClick(),this.maxAgeInput.blur()),this.preventNonNumericChars(e)},onClick:e=>this.handleInputClick(e),onInput:()=>this.setApplyButtonActive()}),(0,p.tT)("a",{bind:{className:()=>"agesSubmit "+(this.state.inputIsActive?"active":"")},href:"#",onClick:()=>this.handleSubmitClick(),"data-testid":"filter-age-submit"},w.R.applyLower)))}initData(e){super.initData(e),this.props=e}initUI(e){super.initUI(e),this.updateStateFromUrl()}updateStateFromUrl(){var e;const t=(null!==(e=new URLSearchParams(window.location.search).get(s.AGE_FILTER_KEY))&&void 0!==e?e:"").match(s.AGE_URL_PARAM_REGEX);if(null!==t){const e=t[0].split("-");this.setAges(parseInt(e[0]),parseInt(e[1]))}else this.setAges(s.DEFAULT_MIN_AGE,s.DEFAULT_MAX_AGE);this.createOrRemoveLabel()}setAges(e,t){this.minAgeInput.value=e.toString(),this.maxAgeInput.value=t===s.DEFAULT_MAX_AGE?"":t.toString(),this.setState({...this.state,minAge:e,maxAge:t}),this.setApplyButtonActive()}getInputMaxAsNumber(){const e=this.maxAgeInput.valueAsNumber;return isNaN(e)?s.DEFAULT_MAX_AGE:e}minIsInvalid(e,t){return isNaN(e)||e=s.DEFAULT_MAX_AGE}maxIsInvalid(e){return es.DEFAULT_MAX_AGE}newInputsValid(e,t){return!this.minIsInvalid(e,t)&&!this.maxIsInvalid(t)}setApplyButtonActive(){var e;const t=this.minAgeInput.valueAsNumber,i=this.getInputMaxAsNumber();let n=!1;const a=(null!==(e=new URLSearchParams(window.location.search).get(s.AGE_FILTER_KEY))&&void 0!==e?e:"").match(s.AGE_URL_PARAM_REGEX);if(null!==a){const e=a[0].split("-");n=t!==parseInt(e[0])||i!==parseInt(e[1])}else n=t!==s.DEFAULT_MIN_AGE||i!==s.DEFAULT_MAX_AGE;this.setState({...this.state,inputIsActive:this.newInputsValid(t,i)&&n})}handleSubmitClick(){this.state.inputIsActive&&((0,d.bT)("HmpgFilterAgeRangeSubmit",{minAge:this.state.minAge,maxAge:this.state.maxAge}),this.createOrRemoveLabel(),this.setApplyButtonActive(),this.updateAgeUrlParam(this.state.minAge,this.state.maxAge),this.props.onUpdate())}resetAgeFilters(){var e;this.setAges(s.DEFAULT_MIN_AGE,s.DEFAULT_MAX_AGE);const t=(null!==(e=new URLSearchParams(window.location.search).get(s.AGE_FILTER_KEY))&&void 0!==e?e:"").match(s.AGE_URL_PARAM_REGEX);if(null!==t){const e=t[0].split("-");parseInt(e[0])===s.DEFAULT_MIN_AGE&&parseInt(e[1])===s.DEFAULT_MAX_AGE||(this.updateAgeUrlParam(this.state.minAge,this.state.maxAge),this.props.onUpdate())}}updateAgeUrlParam(e,t){const i=(0,m.JO)(window.location.search),n=`${e}-${t}`;"18-100"===n?delete i[s.AGE_FILTER_KEY]:i[s.AGE_FILTER_KEY]=n;const a=(0,m.Go)(i),o=new URL(window.location.href);o.search=a,f.T.current.pushUrl(o)}preventNonNumericChars(e){var t;const i=null!==(t=e.key)&&void 0!==t?t:"";1===i.length&&isNaN(Number(i))&&e.preventDefault()}handleMinAgeChange(){let e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e=i=this.minAgeInput.valueAsNumber,t=n=this.state.maxAge,this.minIsInvalid(e,t)&&(e=s.DEFAULT_MIN_AGE),e>t&&(t=s.DEFAULT_MAX_AGE),this.setAges(e,t),a&&(0,d.bT)("HmpgFilterAgeRangeUpdate",{minAge:e,maxAge:t,rawMin:i,rawMax:n,changed:"min"})}handleMaxAgeChange(){let e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t=n=this.getInputMaxAsNumber(),e=i=this.state.minAge,this.maxIsInvalid(t)&&(t=s.DEFAULT_MAX_AGE),t{this.resetAgeFilters()}})}removeLabelButton(){void 0!==this.filterLabel&&(this.filterLabel.element.remove(),delete this.filterLabel)}handleInputClick(e){e.currentTarget.select()}}var G=i(6440);class B extends r.b{createElement(e){return(0,p.tT)("a",{bind:{className:()=>"filterOption "+(this.props.optionIsActive()?"active":""),href:()=>e.getHref()},onClick:e=>{this.handleClick(e)},title:e.name,"data-testid":e.testid},e.name)}initData(e){super.initData(e),this.props=e}initUI(e){super.initUI(e),this.updateState()}handleClick(e){e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),this.props.handleLeftClick())}createOrRemoveLabel(){var e;const t=null!==(e=this.props.labelText)&&void 0!==e?e:"";this.props.optionIsActive()&&!t.startsWith("#")?this.createFilterLabelButton():this.removeLabelButton()}createFilterLabelButton(){var e;void 0===this.filterLabel&&(this.filterLabel=new O({title:null!==(e=this.props.labelText)&&void 0!==e?e:this.props.name,onRemoval:()=>{this.props.handleLeftClick()}}))}removeLabelButton(){void 0!==this.filterLabel&&(this.filterLabel.element.remove(),delete this.filterLabel)}updateState(){super.updateState(),this.createOrRemoveLabel()}getValue(){return this.props.queryParamValue}}class $ extends r.b{createElement(e){this.props=e,this.optionsList=[];const t=this.createOptionsProps();return(0,p.tT)("div",{className:"filterSection","data-testid":`filter-${this.sectionTitle.toLowerCase().replace(/[ \/]/g,"-")}-section`},(0,p.tT)("div",{className:"filterSectionHeader","data-testid":`filter-${this.sectionTitle.toLowerCase().replace(/[ \/]/g,"-")}-header`},this.sectionTitle),(0,p.tT)("div",{className:"filterSectionOptions"},t.map((e=>(0,p.tT)(B,{testid:`filter-${this.sectionTitle.toLowerCase().replace(/[ \/]/g,"-")}-item`,name:e.name,labelText:e.labelText,getHref:e.getHref,queryParamValue:e.queryParamValue,classRef:e=>this.optionsList.push(e),optionIsActive:e.optionIsActive,handleLeftClick:e.handleLeftClick})))))}updateSectionFromUrl(){var e;null===(e=this.optionsList)||void 0===e||e.map((e=>{e.updateState()}))}createOptionsProps(){return this.sectionOptions.map((e=>({...e,getHref:()=>V(this.filterKey,e.queryParamValue,this.isSingleSelect).href,optionIsActive:()=>this.optionIsActive(e.queryParamValue),handleLeftClick:()=>this.handleLeftClick(e.queryParamValue)})))}handleLeftClick(e){const t=V(this.filterKey,e,this.isSingleSelect);f.T.current.pushUrl(t),this.props.onFilterOptionClick(),(0,d.bT)("HmpgFilterOptionClicked",{category:this.filterKey,value:e,active:this.optionIsActive(e)})}}function V(e,t){const i=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=(0,m.JO)(window.location.search),n=s[e];let a=void 0!==n?n.split(","):[];return a.includes(t)?a.splice(a.indexOf(t),1):i?a=[t]:(a.push(t),a.sort()),a.length>0?s[e]=a.join(","):delete s[e],s}(e,t,arguments.length>2&&void 0!==arguments[2]&&arguments[2]),s=(0,m.Go)(i),n=new URL(window.location.href);return n.search=s,n}class z extends ${createElement(e){return this.filterKey=s.PRIVATE_PRICES_FILTER_KEY,this.sectionOptions=(0,G.f)("LwPvtPrc")?K.cO:K.bw,this.sectionTitle=w.R.privateTksPerMinCAPS,this.isSingleSelect=!0,super.createElement(e)}optionIsActive(e){const t=f.T.current.state.privatePrices;return void 0!==t&&t.toString()===e}}class W extends ${createElement(e){return this.filterKey=s.REGION_FILTER_KEY,this.sectionOptions=K.kD,this.sectionTitle=w.R.regionsCAPS,this.isSingleSelect=!1,super.createElement(e)}optionIsActive(e){const t=f.T.current.state.regions;if(void 0===t)return!1;for(const i of t)if(i.toString()===e)return!0;return!1}}class q extends ${createElement(e){return this.filterKey=s.ROOM_SIZE_FILTER_KEY,this.sectionOptions=K.Nj,this.sectionTitle=w.R.roomSizeCAPS,this.isSingleSelect=!0,super.createElement(e)}optionIsActive(e){const t=f.T.current.state.roomSize;return void 0!==t&&t===e}}var X=i(9757),Z=i(1519),j=i(8451),J=i(9447);class Q extends r.b{createElement(){return(0,p.tT)("div",{className:"tagSuggestionsDiv"})}initData(e){this.props=e}clearList(){this.element.textContent="",this.currentTagsList=[],this.currentIndex=-1}addSuggestionItem(e){const t=this.element.children.length,i=(0,p.tT)("div",{className:"suggestion",title:e,"data-testid":"filter-hashtag-suggestion",onMouseDown:()=>{this.props.onTagClick(e)},onMouseEnter:()=>{this.singleHighlight(i,t)},onMouseLeave:()=>{(0,J.SA)(i,"highlight"),this.currentIndex=-1}},this.generateTagText(e));this.element.appendChild(i)}generateTagText(e){if(""===this.keyword)return(0,p.tT)("div",{className:"tagText"},`#${e}`);const t=e.split(this.keyword),i=e.indexOf(this.keyword)+this.keyword.length;return(0,p.tT)("div",{className:"tagText"},(0,p.tT)("span",null,`#${t[0]}`),(0,p.tT)("span",{className:"keyword"},this.keyword),(0,p.tT)("span",null,e.slice(i)))}updateResults(e,t){if(this.clearList(),0===e.length)this.element.appendChild((0,p.tT)("div",{className:"notFoundText","data-testid":"search-not-found"},w.R.notFound));else{this.keyword=t.toLowerCase();const i=""===t?e.slice(-10):e;let s=0;i.reverse().forEach((e=>{s<10&&(this.addSuggestionItem(e),s+=1),this.currentTagsList.push(e)}))}}highlightViaKeyNav(e){if(0===this.element.children.length)return;const t=this.element.children.length-1;let i=-1;if((0,j.LV)(e)?i=this.currentIndex+1<=t?this.currentIndex+1:0:(0,j.IM)(e)&&(i=this.currentIndex-1>=0?this.currentIndex-1:t),i>-1){const e=this.element.children.item(i);null!==e&&this.singleHighlight(e,i)}}singleHighlight(e,t){this.unhighlightList(),(0,J.fZ)(e,"highlight"),this.currentIndex=t}unhighlightList(){if(this.currentIndex>-1){const e=this.element.children.item(this.currentIndex);null!==e&&e.classList.remove("highlight")}this.currentIndex=-1}getHighlightedText(){if(this.currentIndex>-1)return this.currentTagsList[this.currentIndex]}isTagValid(e){return this.currentTagsList.includes(e)}}class ee extends r.b{constructor(){super(...arguments),this.loading=!1}createElement(e){return this.onlineTagsMatchingFilters=[],(0,p.tT)("div",{className:"tagSearchDiv"},(0,p.tT)("input",{className:"tagSearchInput","data-testid":"filter-tag-search-input",placeholder:w.R.tagSearchPlaceholder,ref:e=>{this.searchInput=e},maxLength:50,onFocus:()=>{this.callAutocompleteDebouncer(),(0,d.bT)("TagSearchFocus")},onBlur:()=>{this.suggestionsList.hideElement()},onKeyDown:e=>{this.handleSpecialKey(e),this.cleanNewChar(e)},onInput:()=>{this.cleanSearchInput(),this.callAutocompleteDebouncer()}}),(0,p.tT)("div",{className:"searchButton","data-testid":"filter-tag-search-button",onClick:()=>{this.submitSearch("click")}},(0,p.tT)("div",{className:"searchIcon"})),(0,p.tT)(Q,{classRef:e=>{this.suggestionsList=e},onTagClick:e=>{(0,d.bT)("TagAutocompleteClick",{tagClicked:e,searchText:this.getSearchWord()}),this.applySearchTag(e)}}))}initData(e){this.props=e,this.autocompleteDebouncer=new Z.a((()=>{this.updateAutocomplete()}),{bounceLimitMS:250,debounceType:1})}initUI(){this.loadKeywordResults("",!1)}updateOnlineTags(e){this.onlineTagsMatchingFilters=e}loadKeywordResults(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.getKeywordResults(e).then((i=>{this.suggestionsList.updateResults(i,e),t&&document.activeElement===this.searchInput&&this.suggestionsList.showElement()})).finally((()=>{this.loading=!1}))}getKeywordResults(e){return(0,S.Aw)(this.buildTagSearchApiUrl(e)).then((e=>{var t;let i=(null!==(t=new C.N6(e.responseText).getList("tags"))&&void 0!==t?t:[]).map((e=>e.getString("hashtag"))).filter((e=>""!==e));return(0,h.nc)()&&(i=i.filter((e=>this.onlineTagsMatchingFilters.includes(e)))),i}))}cleanNewChar(e){"#"===e.key&&0===this.searchInput.selectionStart&&-1===this.searchInput.value.indexOf("#")||"-"!==e.key&&(1!==e.key.length||(0,j.$Z)(e)||e.preventDefault())}cleanSearchInput(){const e=this.searchInput.value.replace(/[^a-zA-Z0-9#-]+/g,""),t=e.replace(/#/g,"").substring(0,50),i=`${"#"===e[0]?"#":""}${t}`;i!==this.searchInput.value&&(this.searchInput.value=i)}getSearchWord(){return this.searchInput.value.replace(/#/g,"").toLowerCase()}buildTagSearchApiUrl(e){const t=new URLSearchParams([["field","room_count"],["search",e]]),i=(0,N.KM)();return i!==k.YT.All&&t.append("genders",i),`api/ts/hashtags/search_get_data/?${t.toString()}`}updateAutocomplete(){this.loadKeywordResults(this.getSearchWord())}callAutocompleteDebouncer(){this.loading=!0,this.autocompleteDebouncer.callFunc()}handleSpecialKey(e){if(this.loading||!(0,j.IM)(e)&&!(0,j.LV)(e))(0,j.Ci)(e)&&this.submitSearch("enter");else{e.preventDefault(),this.suggestionsList.highlightViaKeyNav(e);const t=this.suggestionsList.getHighlightedText();void 0!==t&&(this.searchInput.value=t)}}submitSearch(e){const t=this.getSearchWord();""!==t&&this.suggestionsList.isTagValid(t)?this.applySearchTag(t,e):(0,d.bT)("TagSearchAttempt",{searchText:t})}applySearchTag(e,t){void 0!==t&&(0,d.bT)("TagSearchSubmit",{tag:e,submitMethod:t}),""!==e&&(this.props.applyTagFilter(e),this.searchInput.value=""),this.searchInput.blur(),this.suggestionsList.unhighlightList()}}const te=(0,h.nc)()?1e3:100;class ie extends r.b{createElement(){this.state.isLoading=!0,this.pageMinIndices=[0];const e=(0,h.nc)();if(e){const e=X.c.get("TagPagination");this.tagPaginationRoot=(0,p.tT)("div",{className:"tagPaginationRoot"}),this.tagPagination=new e({isDisabled:this.state.isLoading,currentPage:1,maxPage:1,onNextPageClick:e=>{e instanceof MouseEvent&&(e.ctrlKey||e.metaKey||e.shiftKey)||this.state.isLoading||(this.updatePageNum(this.state.tagPageNum!==this.state.maxPageNum?this.state.tagPageNum+1:1),this.renderTagsPage())},onPrevPageClick:e=>{e instanceof MouseEvent&&(e.ctrlKey||e.metaKey||e.shiftKey)||this.state.isLoading||(this.updatePageNum(1!==this.state.tagPageNum?this.state.tagPageNum-1:this.state.maxPageNum),this.renderTagsPage())}},this.tagPaginationRoot)}return this.tagSearch=new ee({applyTagFilter:e=>{(0,s.getPageHashtag)()!==e&&(this.toggleTagInURL(e),this.props.onFilterOptionClick())}}),(0,p.tT)("div",{bind:{className:()=>`${this.state.maxPageNum>1?"multiPage ":""}${e?"paginated":""} tagSection filterSection`},"data-testid":"filter-tag-section"},(0,p.tT)("div",{className:"filterSectionHeader","data-testid":"filter-tag-header"},w.R.tagsCAPS),this.tagSearch.element,(0,p.tT)("div",{ref:e=>{this.optionsContainer=e},bind:{className:()=>"filterSectionOptions tagSectionOptions "+(this.state.isLoading&&this.state.maxPageNum>1?"loading":"")}}),this.tagPaginationRoot)}initUI(){T.oO.addListener((()=>{this.renderTagsPage(!0)}),this)}initData(e){super.initData(e),f.T.current.listen(["regions","ageMin","ageMax","privatePrices","spyShowPrices","roomSize","apps","aspApp","showType"],(()=>{this.updateTopTagsLists(!1).then((()=>this.renderTagsPage()))}),this.element),f.T.current.listen(["genders"],(()=>{this.updateTopTagsLists(!0).then((()=>this.renderTagsPage()))}),this.element),f.T.current.listen(["tags"],(()=>{this.renderTagsPage()}),this.element),this.props=e,this.topTagsList=[],this.onlineTopTagsFiltered=[],this.updateTopTagsLists(!0).then((()=>this.renderTagsPage()))}updateState(){super.updateState(),void 0!==this.tagPagination&&(this.state.maxPageNum<=1&&this.element.contains(this.tagPaginationRoot)?this.element.removeChild(this.tagPaginationRoot):this.state.maxPageNum>1&&this.element.appendChild(this.tagPaginationRoot),this.tagPagination.update({currentPage:this.state.tagPageNum,maxPage:this.state.maxPageNum,isDisabled:this.state.isLoading}))}updatePageNum(e){this.setState({...this.state,tagPageNum:e})}updateMaxPageNum(e){this.setPagingData(e),this.setState({...this.state,maxPageNum:this.state.maxPageNum})}async updateTopTagsLists(e){if(this.setState({...this.state,tagPageNum:1,isLoading:!0}),(0,h.nc)()){const t=this.loadOnlineTopTags();if(e){const e=this.loadTopTagsList();await Promise.all([t,e])}else await t;this.onlineTopTagsFiltered=this.topTagsList.filter((e=>this.onlineTagsMatchingFilters.includes(e)))}else e&&(await this.loadTopTagsList(),this.onlineTopTagsFiltered=this.topTagsList);this.setState({...this.state,isLoading:!1})}renderTagsPage(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.optionsContainer.textContent="",this.updateMaxPageNum(e),this.createTagOptionsForPage(),this.addCurrentTagToOptionsIfNotPresent((0,s.getPageHashtag)()),(0,h.nc)()&&this.updateTagSearch()}createTagOptionsForPage(){this.currentPageTagsList=[];const[e,t]=[this.pageMinIndices[this.state.tagPageNum-1],this.pageMinIndices[this.state.tagPageNum]],i=(0,h.nc)()?this.onlineTopTagsFiltered:this.topTagsList;for(const s of i.slice(e,t))this.createTagFilterOption(s,!1),this.currentPageTagsList.push(s)}updateTagSearch(){const e=this.onlineTopTagsFiltered;this.state.maxPageNum<2?this.tagSearch.hideElement():(this.tagSearch.updateOnlineTags(e),this.tagSearch.showElement("inline-block"))}addCurrentTagToOptionsIfNotPresent(e){if(void 0===e||this.currentPageTagsList.includes(e))return;const t=this.optionsContainer.offsetHeight;this.createTagFilterOption(e,!0),this.currentPageTagsList.push(e),this.adjustOptionsContainerHeight(t)}adjustOptionsContainerHeight(e){for(;this.optionsContainer.offsetHeight>e&&this.currentPageTagsList.length>1;){var t;null===(t=this.optionsContainer.lastElementChild)||void 0===t||t.remove()}}setPagingData(e){const t=new Set;this.pageMinIndices=[0];let i=0,s=0;for(const e of this.onlineTopTagsFiltered){let a=this.createTagFilterOption(e,!1);if(t.add(a.offsetTop),t.size>13){var n;if(s+=1,null===(n=this.optionsContainer.lastElementChild)||void 0===n||n.remove(),!(0,h.nc)())return this.pageMinIndices[s]=i,void(this.optionsContainer.textContent="");this.optionsContainer.textContent="",a=this.createTagFilterOption(e,!1),this.pageMinIndices[s]=i,t.clear(),t.add(a.offsetTop)}i+=1}const a=s+1;e&&void 0!==this.state.maxPageNum&&(this.state.tagPageNum=Math.min(1+Math.round(a*(this.state.tagPageNum-1)/this.state.maxPageNum),a)),this.optionsContainer.textContent="",this.pageMinIndices[a]=i,this.state.maxPageNum=a}async loadTopTagsList(){const e=new URLSearchParams([["count",String(te)]]),t=(0,N.KM)();t!==k.YT.All&&e.append("genders",t);const i=await(0,S.Aw)(`api/ts/hashtags/top_tags/?${e.toString()}`),s=new C.N6(i.responseText).getStringList("all_tags");this.topTagsList=s}getCurrentFilters(){const e=(0,s.getRoomlistCategoryFilters)(),t={...(0,s.getRoomlistDynamicFilters)(),...e};return delete t.hashtags,delete t.offset,delete t.limit,t}async loadOnlineTopTags(){const e=this.getCurrentFilters(),t=new URLSearchParams(window.location.search).get("min_tags_count"),i=null!==t&&parseInt(t)>0?t:"1",s=new URLSearchParams({min_count:i,...e});s.sort();const n=`api/ts/roomlist/all-tags/?${s.toString()}`,a=await(0,S.Aw)(n),o=new C.N6(a.responseText);this.onlineTagsMatchingFilters=o.getStringList("all_tags")}createTagFilterOption(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=new B({testid:"filter-tag-item",name:e,labelText:`#${e}`,queryParamValue:e,getHref:()=>this.getToggledTagUrl(e).href,optionIsActive:()=>this.optionIsActive(e),handleLeftClick:()=>this.handleLeftClick(e)});return t?this.optionsContainer.prepend(i.element):this.optionsContainer.append(i.element),i.element}handleLeftClick(e){this.toggleTagInURL(e),this.props.onFilterOptionClick(),(0,d.bT)("HmpgFilterOptionClicked",{category:"tags",value:e,active:this.optionIsActive(e)})}optionIsActive(e){const t=f.T.current.state.tags;return void 0!==t&&t.includes(e)}toggleTagInURL(e){const t=this.getToggledTagUrl(e);f.T.current.pushUrl(t)}getToggledTagUrl(e){if(void 0===e||e===(0,s.getPageHashtag)()){const e=new URL(`${window.location.origin}/${(0,c.tg)((0,c.Bg)())}`);return e.search=window.location.search,e}{const t=y(e,(0,c.Bg)()),i=new URL(window.location.origin+t);return i.search=window.location.search,i}}}class se extends r.b{createElement(e){return(0,p.tT)("div",{bind:{className:()=>"homepageFilterPanel "+(this.state.isOpen?"active":"")}},(0,p.tT)("div",{className:"closeButton",onClick:()=>this.handleClick()}),(0,p.tT)(W,{classRef:e=>{this.regionSection=e},onFilterOptionClick:e.onFilterOptionClick}),(0,s.isRoomSizeFilteringActive)()&&(0,p.tT)(q,{classRef:e=>{this.roomSizeSection=e},onFilterOptionClick:e.onFilterOptionClick}),(0,s.isLanguageFilterActive)()&&(0,p.tT)(H.T,{component:"LanguageFilterSection",componentProps:{}}),(0,p.tT)(ie,{onFilterOptionClick:e.onFilterOptionClick}),(0,p.tT)(Y,{classRef:e=>{this.ageSection=e},onUpdate:e.onFilterOptionClick}),(0,p.tT)(z,{classRef:e=>{this.priceSection=e},onFilterOptionClick:e.onFilterOptionClick}))}initData(e){super.initData(e),this.setState({isOpen:(0,N.fk)()}),this.props=e}handleClick(){this.props.handleClose(),(0,d.bT)("HmpgFilterPanelMovement",{open:this.state.isOpen})}clearAll(){var e;f.T.current.clearStateKeys(K.Kn,!1),this.ageSection.resetAgeFilters(),this.regionSection.updateSectionFromUrl(),this.priceSection.updateSectionFromUrl(),null===(e=this.roomSizeSection)||void 0===e||e.updateSectionFromUrl(),(0,N.AV)()}updateOptionsAndLabelsFromUrl(){var e;this.ageSection.updateStateFromUrl(),this.regionSection.updateSectionFromUrl(),this.priceSection.updateSectionFromUrl(),null===(e=this.roomSizeSection)||void 0===e||e.updateSectionFromUrl()}}class ne extends r.b{createElement(e){return(0,h.rT)()?(0,p.tT)("div",{bind:{display:()=>f.T.current.state.showType===s.ShowType.FOLLOW||f.T.current.state.showType===s.ShowType.FOLLOW_OFFLINE?"block":"none"},className:"followed_online_offline","data-testid":"followed-online-offline"},(0,p.tT)(ae,{onlineFilter:!0}),(0,p.tT)(ae,{onlineFilter:!1})):(0,p.tT)("div",{className:"followed_online_offline","data-testid":"followed-online-offline"},(0,p.tT)(ae,{onlineFilter:!0,active:e.online,onFilterClick:e.onFilterClick}),(0,p.tT)(ae,{onlineFilter:!1,active:!e.online,onFilterClick:e.onFilterClick}))}initUI(e){super.initUI(e),f.T.current.listen(["showType"],(()=>{this.updateState()}),this.element),this.updateState()}}class ae extends r.b{createElement(e){var t;return(0,p.tT)("div",{className:"title"+(!(0,h.rT)()&&null!==(t=e.active)&&void 0!==t&&t?" bold":""),bind:(0,h.rT)()?{class:()=>"title"+(this.isActive(e)?" bold":"")}:{},"data-testid":e.onlineFilter?"online-filter-title":"offline-filter-title",onClick:t=>{(0,h.rT)()&&(f.T.current.setPartialState({showType:e.onlineFilter?s.ShowType.FOLLOW:s.ShowType.FOLLOW_OFFLINE}),t.preventDefault())}},(0,p.tT)("p",null,(0,p.tT)("a",{href:this.getHref(e.onlineFilter),onClick:e.onFilterClick,"data-testid":e.onlineFilter?"online-filter-link":"offline-filter-link"},e.onlineFilter?w.R.onlineRooms:w.R.offlineRooms)))}getHref(e){const t=e?s.ShowType.FOLLOW:s.ShowType.FOLLOW_OFFLINE;return f.T.current.getURLForPartialState({showType:t})}isActive(e){return e.onlineFilter?f.T.current.state.showType===s.ShowType.FOLLOW:f.T.current.state.showType===s.ShowType.FOLLOW_OFFLINE}}var oe=i(8423),re=i(7995),le=i(9118),he=i(5294),ce=i(4691);class de extends r.b{initData(e){super.initData(e)}createElement(e){return(0,p.tT)("div",{className:"num-of-rooms-msg","data-testid":"num-of-rooms-msg",bind:{display:()=>this.state.isLastPage&&this.state.hasFilter?"flex":"none",text:()=>this.state.matched>0?w.R.numberOfRoomsMatchesYourFilters(this.state.total,this.state.matched):w.R.noRoomsMatchesYourFilters(this.state.total)}})}}var pe=i(6716),me=i(7596),ge=i(5079);class ue{constructor(e){this.apiUrl=e.apiUrl,this.currentPage=e.currentPage,this.pageSize=e.pageSize}setFilters(e){this.filters=e}setPage(e){this.currentPage=e}getPage(){return this.currentPage}getCurrentFilters(e){var t;return e=null!==(t=e)&&void 0!==t?t:this.currentPage,{...this.filters,...(0,s.getPaginationFilters)(e,this.pageSize)}}fetchPage(e,t,i){var n;let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;t=null!==(n=t)&&void 0!==n?n:this.currentPage;const o=new URLSearchParams({...(0,s.getNonReservedQueryParamValues)(),...this.getCurrentFilters(t)});return o.sort(),(null!=i?i:(0,S.Aw)(`${this.apiUrl}?${o.toString()}`).then((e=>e.responseText))).then((t=>this.parseResponse(t,e))).catch((i=>{if(warn("SPA rooms fetch failed",{pageNum:t,attempt:a,reason:i}),a<5)return this.fetchPage(e,t,void 0,a+1);throw i}))}parseResponse(e,t){var i,s,n;const a=new C.N6(e);return{loadedRooms:null!==(i=null===(s=a.getList("rooms"))||void 0===s?void 0:s.map((e=>(0,ge.ak)(e))))&&void 0!==i?i:[],matchedCount:a.getNumber("total_count"),totalCount:null!==(n=a.getNumberOrUndefined("all_rooms_count"))&&void 0!==n?n:0,roomListId:a.getStringOrUndefined("room_list_id"),fetchId:t}}}var Te=i(8374),ve=i(9930);class fe extends Te.y{constructor(e){var t,i;super({roomListSource:"un",animate:e.animate,showLocation:e.showLocation,rooms:()=>this.state.loadedRooms,hashtag:null!==(t=e.hashtag)&&void 0!==t?t:()=>(0,s.getPageHashtag)(),sourceInfo:null!==(i=e.sourceInfo)&&void 0!==i?i:e=>e.roomInfo.sourceInfo}),this.fetchId=0,this.setPage=e=>{this.roomsIterator.setPage(e)},this.listeners.add(pe.VZ.listen((e=>{void 0!==(0,m.JO)(window.location.search).join_overlay&&(0,ve.X9)()||(0,h.Rd)()||window.location.assign(`/${e}/`)}),!1)),this.categoryFilters={},this.filters={},this.props=e;const n=(0,s.getCurrentPage)(this.props.pageParam);this.roomsIterator=new ue({apiUrl:e.apiUrl,currentPage:n,pageSize:e.pageSize}),this.setState({loadedRooms:[],roomListId:void 0})}addPlaceHolderLoadingRooms(){let e=90;this.rooms.length>0&&(e=this.rooms.length),this.removeAllChildren();for(let t=0;t{this.roomsIterator.fetchPage(this.fetchId,void 0,e).then((i=>{let{loadedRooms:n,totalCount:a,matchedCount:o,roomListId:r,fetchId:l}=i;if((0,s.reportPrefetchStats)("fetchResolved",{usedPrefetch:void 0!==e,isMostRecent:l===this.fetchId}),l!==this.fetchId)return;const h=this.roomsIterator.getPage();this.setState({...this.state,loadedRooms:n,roomListId:r}),t({totalCount:a,matchedCount:o,page:h})})).catch((e=>{i(e)})).finally((()=>{this.hideLoading()}))}))}showLoading(){0===this.state.loadedRooms.length?this.addPlaceHolderLoadingRooms():this.element.classList.add("loading")}hideLoading(){this.element.classList.remove("loading")}}class Ce extends ge.kb{createFollowStar(e){return(0,p.tT)(me.d,{slug:e.roomInfo.room,isFollowing:e.roomInfo.isFollowing,classRef:e=>this.followStar=e,allowPropagation:!0})}createElement(e){const t=super.createElement(e),i=e.roomInfo.extendedInfo;if(void 0!==i){var s,n,a,o,r,l;let e;e=Boolean(i.manualPenalty)?(0,p.tT)(p.FK,null,(0,p.tT)("s",null,i.defaultPenalty)," ",(0,p.tT)("b",null,i.manualPenalty)):(0,p.tT)("b",null,i.defaultPenalty);const h=null!==(s=i.coloredRegs)&&void 0!==s?s:0,c=(null!==(n=i.numRegs)&&void 0!==n?n:0)-h;t.appendChild((0,p.tT)("div",{className:"extended-room-info"},(0,p.tT)("span",null,(0,p.tT)("b",null,"Default:")," #",null!==(a=i.scoreRank)&&void 0!==a?a:"X"),(0,p.tT)("br",null),(0,p.tT)("span",null,(0,p.tT)("b",null,"Base:")," #",null!==(o=i.baseRank)&&void 0!==o?o:"X"),(0,p.tT)("br",null),(0,p.tT)("span",null,(0,p.tT)("b",null,"Satisfaction:")," ",null!==(r=i.satPercent)&&void 0!==r?r:"X","%"),(0,p.tT)("br",null),(0,p.tT)("span",null,(0,p.tT)("b",null,"Penalty:")," ",e),(0,p.tT)("br",null),(0,p.tT)("span",null,(0,p.tT)("b",null,"Grey:")," ",c," | Color: ",h),(0,p.tT)("br",null),(0,p.tT)("span",null,(0,p.tT)("b",null,"Tip rate:")," ",(null!==(l=i.tipRate)&&void 0!==l?l:0).toFixed(2),"/hr")))}return t}}class Se extends r.b{constructor(e){super(e)}initUI(e){(0,h.rT)()?f.T.current.listen(["showType"],(()=>{this.updateState()}),this.element):this.updateMessage(e)}getMessageString(e){if((0,h.rT)())return this.getMessageFromUrlState(e);{var t;const n=null!==(t=e.categorySlug)&&void 0!==t?t:"";let a;return["app","current_app_use"].includes(n)&&void 0!==e.appName?a=w.R.usersRunningAppMessage(e.appName):(i=n,a=Object.keys(Re).includes(i)?Re[n]:""),(0,s.shouldShowHomepageFilters)()&&(a=""),a}var i}getMessageFromUrlState(e){if(void 0===f.T.current.state.apps&&void 0===f.T.current.state.aspApp||void 0===e.appName){var t;const n=(0,s.getCategorySlug)();return null!==(t=e.isSecondContainer)&&void 0!==t&&t?w.R.camCategoryHidden:null!==(i=we.get(n))&&void 0!==i?i:"";var i}return w.R.usersRunningAppMessage(e.appName)}getPremiumDescription(e){if((0,h.rT)())return f.T.current.state.showType===s.ShowType.HIDDEN||f.T.current.state.showType===s.ShowType.PRIVATE&&!0===e.isSecondContainer?w.R.categoryDescriptionHidden:w.R.categoryDescriptionPrivate(F.m.siteName);{var t;const i=null!==(t=e.categorySlug)&&void 0!==t?t:"";let s;const n="spy-on-cams"===i;return"hidden-cams"===i?s=w.R.categoryDescriptionHidden:n&&(s=w.R.categoryDescriptionPrivate(F.m.siteName)),s}}updateMessage(e){const t=this.getMessageString(e),i=this.getPremiumDescription(e);this.removeAllDOMChildren(),this.element.appendChild((0,p.tT)("h2",{"data-testid":t.toLowerCase().replace(/[ \/]/g,"-").replace(/[()\/]/g,"").replace(/--/g,"")},t)),void 0!==i&&this.element.appendChild((0,p.tT)("p",{className:"premium-desc"},i))}createElement(e){return(0,p.tT)("div",{className:"roomlist-msg"},(0,h.rT)()&&(0,p.tT)("h2",{"data-testid":"roomlist-message",bind:{text:()=>this.getMessageString(e)}}),(0,h.rT)()&&(0,p.tT)("p",{bind:{display:()=>f.T.current.state.showType===s.ShowType.PRIVATE||f.T.current.state.showType===s.ShowType.HIDDEN?"block":"none",text:()=>this.getPremiumDescription(e)},className:"premium-desc"}))}}const Re={"north-american-cams":w.R.camCategoryNorthAmerica,"south-american-cams":w.R.camCategorySouthAmerica,"asian-cams":w.R.camCategoryAsia,"euro-russian-cams":w.R.camCategoryEuroRussia,"other-region-cams":w.R.camCategoryOtherRegion,"teen-cams":w.R.camCategoryTeen,"18to20-cams":w.R.camCategory18to20,"18to21-cams":w.R.camCategory18to21,"20to30-cams":w.R.camCategory20to30,"30to50-cams":w.R.camCategory30to50,"21to35-cams":w.R.camCategory21to35,"mature-cams":w.R.camCategoryMature,"exhibitionist-cams":w.R.camCategoryExhib,"spy-on-cams":w.R.camCategoryPrivate,"hidden-cams":w.R.camCategoryHidden,"new-cams":w.R.camCategoryNewCams,"gaming-cams":w.R.camCategoryGaming,"6-tokens-per-minute-private-cams":w.R.camCategory6TkPerMin,"12-tokens-per-minute-private-cams":w.R.camCategory12TkPerMin,"18-tokens-per-minute-private-cams":w.R.camCategory18TkPerMin,"30-tokens-per-minute-private-cams":w.R.camCategory30TkPerMin,"60-tokens-per-minute-private-cams":w.R.camCategory60TkPerMin,"6-18-tokens-per-minute-private-cams":w.R.camCategory6to18TkPerMin,"12-18-tokens-per-minute-private-cams":w.R.camCategory12to18TkPerMin,"30-42-tokens-per-minute-private-cams":w.R.camCategory30to42TkPerMin,"60-72-tokens-per-minute-private-cams":w.R.camCategory60to72TkPerMin,"90-tokens-per-minute-private-cams":w.R.camCategory90TkPerMin},we=new Map([["mature-cams",w.R.camCategoryMature],["exhibitionist-cams",w.R.camCategoryExhib],["spy-on-cams",w.R.camCategoryPrivate],["hidden-cams",w.R.camCategoryHidden],["new-cams",w.R.camCategoryNewCams],["gaming-cams",w.R.camCategoryGaming]]);class ye extends r.b{createElement(){const e=(0,p.tT)("p",{className:"roomlist-reload-msg"});return e.innerHTML=w.R.unableToReloadErrorMessage,e.firstElementChild.onclick=()=>{window.location.reload()},e}showElement(){super.showElement("inline-block")}}var Ae=i(9232);class Le extends r.b{constructor(e){super(e)}createElement(e){var t;return this.pageParam=null!==(t=e.pageParam)&&void 0!==t?t:"page",(0,p.tT)("div",{className:"roomlist_container endless_page_styles","data-testid":"room-list-container"},(0,p.tT)(ce.p,{classRef:e=>{this.notVisibleRegions=e},advancedSearchOptions:e.advancedSearchOptions}),(0,p.tT)(Se,{isSecondContainer:this.isSecondaryContainer(),classRef:e=>{this.roomlistMsg=e}}),(0,p.tT)(Ae.C,{classRef:e=>{this.searchMsg=e}}),(0,p.tT)(ye,{classRef:e=>{this.roomReloadErrorNotification=e}}),(0,p.tT)(he.M,{classRef:e=>{this.noRoomsAvailableNotification=e}}),(0,p.tT)(fe,{classRef:e=>{this.roomlist=e},animate:e.animate,showLocation:e.showLocation,apiUrl:s.ROOMLIST_API_URL,pageSize:s.DEFAULT_PAGESIZE,pageParam:this.pageParam}),(0,p.tT)(de,{classRef:e=>{this.numberOfRoomsMessage=e}}),(0,p.tT)("div",{id:"roomlist_pagination","data-testid":"room-list-pagination-component"},(0,p.tT)(le.d,{classRef:e=>{this.pagination=e},itemsPerPage:s.DEFAULT_PAGESIZE,onPageChange:e=>this.onPageChange(e),reloadOnPageChange:!1,addLastPageAction:!0,pageParam:this.pageParam,makeResponsive:!0})))}initData(e){this.listeners=new oe.gt,this.appName=e.appName}initUI(e){this.listeners.add(e.advancedSearchOptions.regionsChanged.listen((()=>this.handleAdvancedSearchOptionChange()))),this.listeners.add(e.advancedSearchOptions.enableRecommendationsChanged.listen((()=>this.handleAdvancedSearchOptionChange()))),this.listeners.add(re.DO.onSubmit.listen((e=>this.handleSearch(e)))),this.roomReloadErrorNotification.hideElement()}dispose(){this.notVisibleRegions.dispose(),this.searchMsg.dispose(),this.roomlist.dispose(),this.listeners.removeAll()}handleRoomRefresh(){this.loadRooms()}handleAdvancedSearchOptionChange(){this.roomlist.updateFilters((0,s.getRoomlistDynamicFilters)()),this.loadRooms()}handleSearch(e){const t=(0,s.getRoomlistDynamicFilters)(e);this.roomlist.updateFilters(t),this.roomlist.setPage(1),this.loadRooms()}updateContainerFromUrl(){var e;this.notVisibleRegions.updateAlertMessage();const t=(0,s.getCategorySlug)();this.roomlistMsg.updateMessage({categorySlug:t,appName:this.appName});const i=null!==(e=new URLSearchParams(window.location.search).get("keywords"))&&void 0!==e?e:"";this.searchMsg.updateMessage(i);const n=(0,s.getCurrentPage)(this.pageParam),a=(0,s.getRoomlistCategoryFilters)(),o=(0,s.getRoomlistDynamicFilters)();this.roomlist.setCategoryFilters(a),this.roomlist.updateFilters(o,n)}updateRooms(e){(0,s.reportPrefetchStats)("usePrefetch",{usedPrefetch:void 0!==e}),void 0!==e?this.loadRooms(e):this.loadRooms()}loadRooms(e){this.roomlist.fetchRooms(e).then((t=>{let{totalCount:i,matchedCount:n,page:a}=t;(0,s.reportPrefetchStats)("loadRoomsResolved",{usedPrefetch:void 0!==e}),this.roomReloadErrorNotification.hideElement(),this.pagination.setState({currentPage:a,totalItems:n}),this.numberOfRoomsMessage.setState({total:null!=i?i:0,matched:null!=n?n:0,isLastPage:this.pagination.isLastPage(),hasFilter:(0,s.homepageFiltersCurrentlyApplied)()}),this.noRoomsAvailableNotification.setState({numRooms:this.roomlist.rooms.length,filterPanelActive:(0,s.homepageFiltersCurrentlyApplied)()}),this.searchMsg.setState({numRooms:this.roomlist.rooms.length,filterPanelActive:(0,s.homepageFiltersCurrentlyApplied)()}),n>0&&0===this.roomlist.rooms.length&&(this.resetPagination(),1!==a&&this.loadRooms())})).catch((e=>{error("Failed to load roomlist page after retrying",e),this.roomReloadErrorNotification.showElement()}))}resetPagination(){f.T.current.replaceUrlParams(new Map([[this.pageParam,""]])),this.roomlist.setPage(1)}onPageChange(e){this.roomlist.setPage(e),this.loadRooms();const t=1===e?"":String(e);f.T.current.pushUrlParams(new Map([[this.pageParam,t]])),window.scrollTo(0,0)}isSecondaryContainer(){return!1}}class be extends Le{initUI(e){super.initUI(e),this.roomlistMsg.updateMessage({categorySlug:"hidden-cams"}),this.roomlist.setCategoryFilters({hidden:!0})}updateContainerFromUrl(){var e;this.notVisibleRegions.updateAlertMessage();const t=null!==(e=new URLSearchParams(window.location.search).get("keywords"))&&void 0!==e?e:"";this.searchMsg.updateMessage(t);const i=(0,s.getCurrentPage)(this.pageParam),n=(0,s.getRoomlistDynamicFilters)();this.roomlist.updateFilters(n,i)}handlePageChange(e){this.element.scrollIntoView()}isSecondaryContainer(){return!0}}var Pe=i(9268);class ke extends Pe.fS{constructor(e){super({onHide:ve.Cb}),this.initialLink=e}initWithoutAnchor(){const e=new Pe.QC(this.initialLink);e.initialHref=this.initialLink.href,this.initAndShow(e),this.registerLaterLink.onclick=e=>{e.preventDefault(),this.initialLink.click()}}}var Fe=i(6037);const Ie=u.yK*u.Qd,Ee="pageb";class xe extends r.b{constructor(){super(...arguments),this.lastUserActivityTimestamp=0}createElement(e){return this.props=e,document.querySelector("#roomlist_root")}initUI(e){super.initUI(e),this._mainContentDiv=new o.u(document.querySelector("#main .content")),this.initTopSectionNav(),this.makeRoomListResponsive(),e.isTestbed||((0,h.Rd)()||(this.roomlistMetaUpdate=new x),this.bindRoomRefreshTimers(),this.bindRoomlistSpaHandlers(),this.cleanUrlParams(),this.removePlaceholders(),this.handleSpaRouting(),(0,h.rT)()&&f.T.current.listen([],(()=>{var e;window.document.title=(0,ve.v_)();const t=null!==(e=(0,s.getPageHashtag)())&&void 0!==e?e:"";this.roomlistMetaUpdate.updateTags((0,c.Bg)(),(0,s.isPremium)(),t),this.element.className=this.getElementClassName(),xe.addMainClassnames()}),this.element))}initTopSectionNav(){if((0,h.Rd)())return void this.initTopSectionNavSpa();this._topSection=new o.u(document.querySelector(".top-section"));const e=!this.props.isTestbed,t={enableGenderedLinkUpdates:e,skipJoinOverlaySetup:!0,...e&&{onTabClick:e=>{(0,h.rT)()?(this.renderMainRoomlist(),this.renderSecondaryRoomlist()):this.spaInterceptOnClick(e)}}};if(this.genderTabs=new Fe.p3(t),this._topSection.addChild(this.genderTabs),this.props.showMobileSiteBannerLink){var i;const e=new M.K;null===(i=this._topSection.element.parentElement)||void 0===i||i.prepend(e.element),e.show()}this.advancedSearchOptions=new g.ZB(!1,!0)}initTopSectionNavSpa(){(0,h.Rd)()&&(this._topSection=new o.u(document.querySelector(".top-section")),this.genderTabs=Fe.p3.getInstance(),this.advancedSearchOptions=new g.ZB(!1,!0))}makeRoomListResponsive(){(0,n.aq)()||(0,n.tJ)()||(document.body.style.minWidth=500-(0,l.XJ)()+"px"),(0,T.Rk)(this._mainContentDiv,500,600,[{name:"margin-left",min:4,max:15},{name:"margin-right",min:4,max:15}])}removePlaceholders(){document.querySelectorAll(".placeholder_roomlist_container").forEach((e=>{e.remove()}))}cleanUrlParams(){var e,t,i,n,a,o;const r=(0,s.getCurrentPage)(),l=1===r?"":String(r),h=(0,s.getCurrentPage)(Ee),c=1!==h&&(0,s.isPremium)()?String(h):"",d=(0,s.getParamsMinMaxAgeFilter)(),p=void 0===d?"":`${d[0]}-${d[1]-1}`,m=null!==(e=(null!==(t=(0,s.getParamsPrivatePriceFilters)())&&void 0!==t?t:[])[0])&&void 0!==e?e:"",g=null!==(i=(0,s.getParamsRegionFilters)())&&void 0!==i?i:"",u=null!==(n=(0,s.getParamsRoomSizeFilter)())&&void 0!==n?n:"",T=null!==(a=null===(o=(0,s.getParamsSpokenLanguagesFilter)())||void 0===o?void 0:o.join(","))&&void 0!==a?a:"";f.T.current.replaceUrlParams(new Map([["page",l],[Ee,c],[s.AGE_FILTER_KEY,p],[s.PRIVATE_PRICES_FILTER_KEY,String(m)],[s.REGION_FILTER_KEY,g],[s.ROOM_SIZE_FILTER_KEY,u],[s.SPOKEN_LANGUAGE_FILTER_KEY,T]]))}bindRoomlistSpaHandlers(){(0,h.Rd)()||(0,a.wu)("click",document,(e=>{this.spaInterceptOnClick(e,!0)})),void 0!==(0,m.JO)(window.location.search).join_overlay&&((0,a.wu)("mousedown",document,(e=>{2===e.button||this.showJoinOverlay(e)})),(0,a.wu)("keydown",document,(e=>{"Enter"===e.key&&this.showJoinOverlay(e)}))),ve.XS.listen((e=>{this.spaInterceptOnClick(e)})),(0,a.wu)("popstate",window,(()=>{(0,N.AV)(),this.handleSpaRouting()})),(0,a.Vo)("pageshow",window,(()=>{(0,s.isFollowedCams)()&&this.handleSpaRouting()}))}showJoinOverlay(e){const t=(0,l.ss)(e.target);if(void 0!==t&&(0,ve.X9)(t)){const i=new ke(t);window.scrollTo(0,0),i.initWithoutAnchor(),e.stopPropagation(),e.preventDefault()}}interceptNavigationApplyCachedFilters(e){const t=(0,s.homepageFiltersCurrentlyApplied)(f.T.current.readStateFromURL(e));(0,s.shouldShowHomepageFilters)(e.pathname)&&!t&&(e=(0,s.getCachedHmpgFiltersUrl)(e)),f.T.current.navigateTo(e)}spaInterceptOnClick(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=(0,l.ss)(e.target);if(void 0===i)return;if(e.ctrlKey||e.metaKey||e.shiftKey)return;if(t&&!i.hasAttribute(ve.jS))return;const s=new URL(i.href);this.interceptNavigationApplyCachedFilters(s),e.preventDefault(),this.handleSpaRouting()}getElementClassName(){const e=(0,s.isPremium)();return(0,s.isCategoryPage)()?"category_page":e?"private_shows":"main_roomlist"}_handleSpaRouting(){(0,h.rT)()||this.handleSharedUIUpdates(),(0,s.isPremium)()?this.handlePrivateCamsPage():(0,s.isFollowedCams)()?this.handleFollowedCamsPage():this.handleMainRoomlistPage(),ve.Xv.fire()}handleSpaRouting(){(0,d.OY)("handleSpaRouting",(()=>{this._handleSpaRouting()}))()}handleSharedUIUpdates(){var e;const t=(0,c.Bg)();if(!(0,h.Rd)()){var i;window.document.title=(0,ve.v_)();const e=null!==(i=(0,s.getPageHashtag)())&&void 0!==i?i:"";this.roomlistMetaUpdate.updateTags(t,(0,s.isPremium)(),e)}this.element.className=this.getElementClassName(),xe.addMainClassnames(),this.genderTabs.renderTabs();const n=null!==(e=new URLSearchParams(window.location.search).get("keywords"))&&void 0!==e?e:"";v.u.searchKeywordValueUpdate.fire(n),ve.wd.fire(t)}static addMainClassnames(){const e=document.querySelector("#main");if(null===e)return;const t=[null!=(0,s.getRegionCategoryFilter)()?"roomlist-category-region":"",(0,s.shouldShowHomepageFilters)()?"roomlist-filter-panel-enabled":""];e.className=t.filter(Boolean).join(" ")}handleMainRoomlistPage(){(0,s.shouldShowHomepageFilters)()?(this.hideHashtagTicker(),this.renderFilterPanel(),(0,N.AV)(!0)):(this.renderHashtagTicker(),this.disposeFilterPanel()),this.disposeFollowedCamsLinks(),this.renderMainRoomlist(),this.disposeSecondaryRoomlist()}handlePrivateCamsPage(){this.hideHashtagTicker(),this.disposeFilterPanel(),this.disposeFollowedCamsLinks(),this.renderMainRoomlist(),this.renderSecondaryRoomlist()}handleFollowedCamsPage(){this.hideHashtagTicker(),this.disposeFilterPanel(),this.renderMainRoomlist(),this.renderFollowedCamsLinks(),this.disposeSecondaryRoomlist()}renderHashtagTicker(){var e,t,i,n;const a=(0,c.Bg)(),o=null!==(e=(0,s.getPageHashtag)())&&void 0!==e?e:"";if(void 0===this.hashtagTicker){const e=e=>{this.spaInterceptOnClick(e)};this.element.prepend((0,p.tT)("div",null,(0,p.tT)(b,{onTagClick:e,classRef:e=>{this.hashtagTicker=e}}),!(0,s.isHomepageFiltersActive)()&&(0,p.tT)(P,{onTagClick:e,classRef:e=>{this.removeHashtagLink=e}})))}null===(t=this.hashtagTicker)||void 0===t||t.setState({genders:a===c.YT.All?[]:[a]}),null===(i=this.removeHashtagLink)||void 0===i||i.setState({gender:a,hashtag:o}),null===(n=this.hashtagTicker)||void 0===n||n.showElement()}hideHashtagTicker(){var e;void 0!==this.hashtagTicker&&(this.hashtagTicker.hideElement(),null===(e=this.removeHashtagLink)||void 0===e||e.hideElement())}renderFilterPanel(){if((0,s.updateHmpgFiltUrlFromCache)(),f.T.current.syncStateWithCurrentUrl(),void 0===this.hmpgFilterButton||void 0===this.filterPanel){const e=this._topSection.element.querySelector(".advanced-search-button-container");this.filterLabelSection=new D({onClearAll:this.clearHomepageFilters.bind(this),onRemoval:this.onFilterOptionClick.bind(this)}),this.element.prepend(this.filterLabelSection.element),this.filterPanel=new se({handleClose:()=>{var e;null===(e=this.hmpgFilterButton)||void 0===e||e.setActive(!1)},onFilterOptionClick:this.onFilterOptionClick.bind(this)}),this.hmpgFilterButton=new _({filterPanel:this.filterPanel}),this._mainContentDiv.element.before(this.filterPanel.element),e.appendChild(this.hmpgFilterButton.element)}this.filterPanel.updateOptionsAndLabelsFromUrl(),this.hmpgFilterButton.setActive((0,N.fk)())}onFilterOptionClick(){var e;null===(e=this.roomlistContainer)||void 0===e||e.resetPagination(),(0,N.AV)(),this.handleSpaRouting()}clearHomepageFilters(){var e;(0,d.bT)("HmpgFiltersClearButtonClicked"),null===(e=this.filterPanel)||void 0===e||e.clearAll(),f.T.current.clearStateKeys(["keywords"],!0),this.handleSpaRouting()}disposeFilterPanel(){var e,t;void 0!==this.filterPanel&&(this.filterPanel.element.remove(),delete this.filterPanel,null===(e=this.hmpgFilterButton)||void 0===e||e.element.remove(),delete this.hmpgFilterButton,null===(t=this.filterLabelSection)||void 0===t||t.element.remove(),delete this.filterLabelSection)}renderFollowedCamsLinks(){var e;this.disposeFollowedCamsLinks(),this.followedOnlineOfflineTab=new ne({online:!(0,s.isOfflineFollowed)(),onFilterClick:e=>this.spaInterceptOnClick(e)}),null===(e=this.roomlistContainer)||void 0===e||e.element.before(this.followedOnlineOfflineTab.element)}disposeFollowedCamsLinks(){void 0!==this.followedOnlineOfflineTab&&(this.followedOnlineOfflineTab.element.remove(),delete this.followedOnlineOfflineTab)}renderMainRoomlist(){var e;if(void 0===this.roomlistContainer){const e={advancedSearchOptions:this.advancedSearchOptions,animate:this.props.animateThumbnails,showLocation:this.props.showLocation,appName:this.props.appName,spaInterruptNavigation:e=>{this.spaInterceptOnClick(e)}};this.roomlistContainer=new Le(e),this.addChild(this.roomlistContainer)}this.roomlistContainer.updateContainerFromUrl();const t=window.prefetchPromise;null===(e=this.roomlistContainer)||void 0===e||e.updateRooms(t),delete window.prefetchPromise}renderSecondaryRoomlist(){if(void 0===this.secondaryContainer){const e={advancedSearchOptions:this.advancedSearchOptions,animate:(0,u.$r)(),roomListSource:this.props.roomListSource,showLocation:this.props.showLocation,pageParam:Ee,hasFilters:()=>!1,spaInterruptNavigation:e=>{this.spaInterceptOnClick(e)}};this.secondaryContainer=new be(e),this.addChild(this.secondaryContainer)}this.secondaryContainer.updateContainerFromUrl(),this.secondaryContainer.updateRooms()}disposeSecondaryRoomlist(){void 0!==this.secondaryContainer&&(this.removeChild(this.secondaryContainer),this.secondaryContainer.dispose(),delete this.secondaryContainer)}bindRoomRefreshTimers(){(0,s.isPremium)()?u.HA.scheduleImageRefresh(15):u.HA.scheduleImageRefresh(this.props.refreshFrequency),(0,a.Xq)(["click","focusin","keydown","pointerdown","pointermove","scroll","visibilitychange"],document,(()=>this.setUserActivityTimestamp())),window.setInterval((()=>this.inactiveRefreshCheck()),Ie)}inactiveRefreshCheck(){var e,t;0!==this.lastUserActivityTimestamp&&(Date.now()-this.lastUserActivityTimestamp>=6e4?window.location.reload():(null===(e=this.roomlistContainer)||void 0===e||e.handleRoomRefresh(),null===(t=this.secondaryContainer)||void 0===t||t.handleRoomRefresh()))}setUserActivityTimestamp(){this.lastUserActivityTimestamp=Date.now()}hideAllContent(){this.disposeFilterPanel(),this._mainContentDiv.hideElement()}showAllContent(){this._mainContentDiv.showElement()}}},6037:(e,t,i)=>{i.d(t,{lc:()=>R,p3:()=>w});var s=i(6624),n=i(7063),a=i(7623),o=i(5216),r=i(2709),l=i(82),h=i(3955),c=i(8423),d=i(9060),p=i(7882),m=i(9268),g=i(4947),u=i(1372),T=i(9461),v=i(4873),f=i(7995),C=i(6615),S=i(9930);const R=new c.c_("GenderDropdownToggle");class w extends l.b{createElement(e){return this.props=e,this.listeners=new c.gt,(0,u.tT)("ul",{className:"sub-nav genderTabs",style:{display:"block",top:"1px",marginTop:"2px"}})}renderTabs(){var e,t,i;this.listeners.removeAll(),null===(e=this.tabsDropdown)||void 0===e||e.dispose();const n=(0,p.Bg)(),a=null!==(t=this.props.enableGenderedLinkUpdates)&&void 0!==t&&t,o=(0,s.shouldShowHomepageFilters)()||(0,s.isHomepageTab)()||(0,s.isCategoryPage)()?g.R.featuredCAPS:g.R.allGendersCAPS;this.removeAllDOMChildren(),this.featuredTab=new y({text:null!==(i=this.props.featuredTabTitle)&&void 0!==i?i:o,isActive:n===p.YT.All,gender:p.YT.All,enableGenderedLinkUpdates:a,onTabClick:this.props.onTabClick}),this.addChild(this.featuredTab),(0,s.isOfflineFollowed)()||[p.YT.Female,p.YT.Male,p.YT.Couple,p.YT.Trans].forEach((e=>{this.element.appendChild((0,u.tT)(y,{isActive:n===e,gender:e,enableGenderedLinkUpdates:a,onTabClick:this.props.onTabClick}))})),this.makeGenderTabsResponsive(),!Boolean(this.props.skipJoinOverlaySetup)&&this.element.isConnected&&(0,m.Nb)(this.element)}initUI(e){super.initUI(e),this.element.style.overflow="hidden",this.element.style.position="relative",this.element.style.display="block",this.element.style.top="1px",this.element.style.marginTop="2px",this.renderTabs(),window.setTimeout((()=>{(0,a.aq)()||(0,a.tJ)()||(document.body.style.minWidth=500-(0,h.XJ)()+"px")})),(0,d.rT)()&&C.T.current.listen(["genders","showType"],(()=>{this.renderTabs()}),this.element)}initData(e){super.initData(e),f.DO.onSubmit.addListener((()=>{this.renderTabs()}),this.element)}makeGenderTabsResponsive(){const e=this.element;if(null!==e&&e instanceof HTMLElement){const t=new r.u(e);Array.from(e.children).forEach((e=>{if(e instanceof HTMLElement){e.style.display="inline-block",e.style.position="relative",e.style.font=getComputedStyle(e).font;const i=new v.g2(e);this.listeners.add(i.onCollapseEvent.listen((e=>{i.element.style.margin=e?"5px 0":"",i.element.style.display=e?"block":"inline-block"}))),e.firstElementChild instanceof HTMLAnchorElement&&(e.firstElementChild.style.cursor=getComputedStyle(e.firstElementChild).cursor,e.firstElementChild.style.textDecoration="none"),t.attachChild(i)}})),this.tabsDropdown=new v.Dw,this.tabsDropdown.element.classList.add("gender-tab"),t.addChild(this.tabsDropdown),this.tabsDropdown.dropDown.toggleEvent.listen((e=>{R.fire(e.isShowing)})),(0,h.ZM)(this.tabsDropdown,{borderWidth:"1px",borderStyle:"solid",borderRadius:"4px 4px 0 0",height:"27px",lineHeight:"27px",marginRight:"2px",width:"41px"}),(0,h.ZM)(this.tabsDropdown.dropDown,{padding:"8px 20px 8px 0",width:"108px"})}}get maxAvailableNonTabSpace(){const e=this.featuredTab.element.offsetWidth+this.tabsDropdown.element.offsetWidth;return this.element.offsetWidth-e}setActiveRoomTab(e){let t;void 0===e?(t=(0,s.shouldShowHomepageFilters)()||(0,s.isHomepageTab)()||(0,s.isCategoryPage)()?g.R.featuredCAPS:g.R.allGendersCAPS,this.featuredTab.element.style.fontSize=""):(t=`${(0,n.VE)(e)}'s Cam`,this.featuredTab.element.style.fontSize="15px"),this.featuredTab.setState({text:t})}static getInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return w.instance||(w.instance=new w(e)),w.instance}}class y extends l.b{createElement(e){var t,i,s,n;const a=null!==(t=null!==(i=null===(s=e.text)||void 0===s?void 0:s.toLowerCase())&&void 0!==i?i:y.GenderSymbolToPluralCapsCategoryMap.get(e.gender))&&void 0!==t?t:"";return(0,u.tT)("li",{className:"gender-tab"},(0,u.tT)("a",{ref:e=>{this.anchorElement=e},className:"gender-tab tabElement tabElementLink"+(e.isActive?" active":""),"data-paction":"TopTab","data-testid":`top-section-tab-${a.toLowerCase()}`.replace(/ /g,"-"),href:A(e.gender),onClick:t=>{t.ctrlKey||t.metaKey||t.shiftKey||(e.enableGenderedLinkUpdates&&(t.preventDefault(),(0,d.rT)()?C.T.current.setPartialState({genders:[e.gender],page:1,pageb:1},!1):S.wd.fire(e.gender)),void 0!==e.onTabClick&&e.onTabClick(t))},bind:{text:()=>this.state.text}},null!==(n=e.text)&&void 0!==n?n:y.GenderSymbolToPluralCapsCategoryMap.get(e.gender)))}updateState(){super.updateState(),void 0!==this.state.isActive&&(this.state.isActive?this.anchorElement.classList.add("active"):this.anchorElement.classList.remove("active"))}}function A(e,t){const i=(0,p.P_)(e),n=function(e){const t=new URLSearchParams(window.location.search);t.delete("g"),t.delete("page");const i=t.get("keywords");return null!==i&&""!==i?t.set("keywords",i):t.delete("keywords"),t.toString()}();let a=`${function(e){return e===p.YT.All?L():(0,s.isHomepageTab)()?`/${(0,p.tg)(e)}/`:`${L()}${p.hf.get(e)}/`}(i)}${n?`?${n}`:""}`;return"chatroom"===T.Bm.current.pageLocation&&(a=a.replace(/^(\/[^\/]+)(\/)/,"$2")),(0,o._Y)(a)}function L(){var e;let t=window.location.pathname;if(t.endsWith("/")||(t+="/"),(0,s.isHomepageTab)(t))return"/";const i=t.split("/"),n=null!==(e=i[i.length-2])&&void 0!==e?e:"";return!(4===i.length&&"tag"===i[1])&&(Boolean(n)&&p.IL.has(n)||(0,p.P_)(n)!==p.YT.All)&&i.splice(-2,1),i.join("/")}y.GenderSymbolToPluralCapsCategoryMap=new Map([[p.YT.All,""],[p.YT.Male,g.R.menCAPS],[p.YT.Female,g.R.womenCAPS],[p.YT.Couple,g.R.couplesCAPS],[p.YT.Trans,g.R.transCAPS],[p.YT.OldTrans,g.R.transCAPS]])},1968:(e,t,i)=>{i.d(t,{n:()=>m,u:()=>g});var s=i(7623),n=i(6784),a=i(8423),o=i(8451),r=i(9060),l=i(7407),h=i(9930),c=i(6037),d=i(6615),p=i(7995);function m(e){var t;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=document.getElementById(e);if(null===s)return;s.style.display="block";const n=new g({searchIcon:s,pushSearches:i});if(null===(t=s.parentElement)||void 0===t||t.insertBefore(n.element,s),!(0,r.rT)()){var a;const e=null!==(a=new URLSearchParams(window.location.search).get("keywords"))&&void 0!==a?a:"";g.searchKeywordValueUpdate.fire(e)}}class g extends p.DO{constructor(){super(...arguments),this.MINIMIZED_CLASS="minimized",this.MAXIMIZED_CLASS="maximized"}initData(e){super.initData(e),this.searchIcon=e.searchIcon;const t=()=>{""!==this.input.value?this.onSubmitSearchInput():"none"===this.input.style.display?(this.showInputBar(),window.setTimeout((()=>{this.input.focus()})),(0,s.J0)()&&this.input.focus(),(0,l.bT)("SearchBarOpen")):(this.hideInputBar(),this.searchIcon.blur(),(0,l.bT)("SearchBarClose"))};this.searchIcon.onclick=t,this.searchIcon.onkeydown=e=>{(0,o.Ci)(e)&&(e.preventDefault(),t())},this.searchIcon.onblur=e=>{p.WM.fire(e)},c.lc.listen((e=>{e&&this.onInputBlur()})),(0,r.rT)()?d.T.current.listen(["keywords"],(e=>{var t;this.input.value=null!==(t=e.keywords)&&void 0!==t?t:"",""!==this.input.value&&this.showInputBar(),this.minimizeInput()}),this.element):g.searchKeywordValueUpdate.listen((e=>{this.input.value=e,""!==e&&this.showInputBar(),this.minimizeInput()})),(0,n.wu)("popstate",window,(()=>{this.input.blur()})),(0,r.rT)()?d.T.current.listen(["genders"],(()=>{this.input.blur()}),this.element):h.wd.listen((()=>{this.input.blur()}))}initUI(e){super.initUI(e),this.element.classList.add("RoomlistSearchInput"),this.input.className="search_input",this.input.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)",this.input.style["-webkit-focus-ring-color"]="rgba(255, 255, 255, 0)",""!==this.input.value&&this.showInputBar(),this.minimizeInput()}onSubmitSearchInput(){this.minimizeInput(),super.onSubmitSearchInput()}onInputBlur(){super.onInputBlur(),this.minimizeInput()}onInputFocus(){super.onInputFocus(),this.maximizeInput()}onInputDeleteClick(e){super.onInputDeleteClick(e),(0,s.J0)()&&this.maximizeInput()}maximizeInput(){this.input.classList.add(this.MAXIMIZED_CLASS),this.input.classList.remove(this.MINIMIZED_CLASS)}minimizeInput(){""===this.input.value?"none"!==this.input.style.display&&this.hideInputBar():(this.input.classList.add(this.MINIMIZED_CLASS),this.input.classList.remove(this.MAXIMIZED_CLASS))}}g.searchKeywordValueUpdate=new a.c_("searchKeywordValueUpdate")},5858:(e,t,i)=>{i.d(t,{iB:()=>o});var s=i(7407);const n=5;let a;function o(e){(function(){const e=window.sessionStorage.getItem("pageaction_sample_id");if(null!==e)return parseInt(e);const t=Math.floor(100*Math.random())+1;return window.sessionStorage.setItem("pageaction_sample_id",t.toString()),t})()<=n&&(void 0!==a&&void 0!==a&&document.removeEventListener("click",a,!0),a=t=>{const i=t.target;"visible_genders"!==i.getAttribute("name")&&function(e,t){if(null!==t&&t.childNodes.length<=3){const i=function(e){const t=e.dataset.paction;if(void 0!==t)return t;for(;e.parentElement;){const t=(e=e.parentElement).dataset.paction;if(void 0!==t)return t}return""}(t);if(null!==i&&""!==i&&void 0!==i){const n=function(e){var t;return function(e){const t=e.dataset.pactionName;if(void 0!==t)return t;for(;e.parentElement;){const t=(e=e.parentElement).dataset.pactionName;if(void 0!==t)return t;if(null!==e.title)return e.title}return""}(e)||e.title||e.innerText||(null!==(t=e.getAttribute("value"))&&void 0!==t?t:"")||""}(t),a=t.parentElement;if(null!==a&&"true"===a.dataset.pactionSendPosition){const o=Array.prototype.indexOf.call(a.children,t),r=a.childElementCount;(0,s.bT)(e,{location:i,name:n,index:o,count:r})}else(0,s.bT)(e,{location:i,name:n})}}}(e,i)},document.addEventListener("click",a,!0))}}}]); //# sourceMappingURL=149-prod-0098e971d6830c2af63d.js.map