(self.webpackChunk_multimediallc_cb_ts=self.webpackChunk_multimediallc_cb_ts||[]).push([[319],{1048:(e,t)=>{"use strict";var i,s;function n(e){switch(e){case i.All:case i.Male:case i.Female:case i.Couple:case i.Trans:return e;case i.OldTrans:case s.Transfemme:case s.Transmasc:case s.Nonbinary:return i.Trans;default:return i.All}}t.Bg=t.IL=t.hf=t.P_=t.CM=t.YT=void 0,function(e){e.All="",e.Male="m",e.Female="f",e.Couple="c",e.Trans="t",e.OldTrans="s"}(i||(t.YT=i={})),function(e){e.Transfemme="tf",e.Transmasc="tm",e.Nonbinary="tn"}(s||(t.CM=s={})),t.P_=n,t.hf=new Map([[i.All,""],[i.Male,"male"],[i.Female,"female"],[i.Couple,"couple"],[i.Trans,"trans"],[i.OldTrans,"trans"]]),t.IL=new Map,t.hf.forEach(((e,i)=>t.IL.set(e,i))),t.IL.set("trans",i.Trans),t.Bg=function(e){var s,o,r,a;let l=null!==(s=null==e?void 0:e.pathname)&&void 0!==s?s:window.location.pathname;l.endsWith("/")||(l+="/");const h=l.split("/");if(4===h.length&&"tag"===h[1])return i.All;const d=null!==(o=h[h.length-2])&&void 0!==o?o:"",c=d.endsWith("-cams")?d.slice(0,-5):d,u=null!==(r=t.IL.get(c))&&void 0!==r?r:n(c);if(u!==i.All)return u;const p=null!==(a=null==e?void 0:e.searchParams)&&void 0!==a?a:new URLSearchParams(window.location.search);for(const e of["gender","genders","g"]){const t=p.get(e);if(null!==t)return n(t.split(",")[0])}return i.All}},7193:(e,t,i)=>{"use strict";i.d(t,{Yz:()=>h,z3:()=>l,pq:()=>r,R8:()=>a});const s=!1;let n;try{n=!0}catch(e){console.error("@multimediallc/logging failed to initialize, probably due to undefined process.env.NODE_ENV.",e),n=!0}const o=window.newrelic;function r(e,t){s||void 0!==window.console&&(void 0!==console.info||n?console.info(e,u(t)):console.log("INFO ",e,u(t)))}function a(e,t,i=""){if(s)return;let o;void 0!==window.console&&(void 0!==console.warn||n?console.warn(i.concat("WARN "),e,u(t)):console.log(i.concat("WARN "),e,u(t)),d());try{o="object"==typeof e?JSON.stringify(e):String(e)}catch(t){o=`${e}`}c(i.concat("WARN"),new Error(o),t)}function l(e,t,i=""){if(s)return;let o;void 0!==window.console&&(void 0!==console.error||n?console.error(i.concat("ERROR "),e,u(t)):console.log(i.concat("ERROR "),e,u(t)),d());try{o="object"==typeof e?JSON.stringify(e):String(e)}catch(t){o=`${e}`}c(i.concat("ERROR"),new Error(o),t)}function h(e,t){s||n||void 0!==window.console&&(void 0!==console.debug||n?console.debug(e,u(t)):console.log("DEBUG ",e,u(t)))}function d(){s||n||void 0!==window.console&&void 0!==console.trace&&console.trace()}function c(e,t,i={}){try{if(void 0===o)return;const s={};if(s["attributes.level"]=e,"object"==typeof i)for(const e in i)if("xhrErrorAttributes"!==e)s[`attributes.${e}`]=i[e];else{const t=i[e];s["attributes.xhrError"]=!0,s["attributes.xhrState"]=t.readyState,s["attributes.xhrStatus"]=t.status,s["attributes.xhrReason"]=t.reason}else s["attributes.extra"]=i;o.noticeError(t,s)}catch(e){console.error(`New Relic Error in reportError: ${e}`)}}function u(e){return void 0===e?"":e}},6262:(e,t,i)=>{"use strict";i.d(t,{ZB:()=>W,Ge:()=>O,yR:()=>H});var s=i(7623),n=i(6784),o=i(5216),r=i(2709),a=i(5020),l=i(3955),h=i(8423),d=i(8451),c=i(9060),u=i(7407),p=i(1452),m=i(4947),g=i(1372),v=i(6624),f=i(82),y=i(816),b=i(6615),w=i(9930),C=i(9447),S=i(6861);class x extends S.A{styleRow(e){}styleLabelContainer(e){}styleLabel(e){(0,C.fZ)(e,C.aG.defaultColor)}styleFieldContainer(e){(0,C.fZ)(e,C.aG.defaultColor)}styleField(e){}styleHelpText(e){(0,C.fZ)(e,C.aG.defaultColor)}}const T=[{label:m.R.showLocations,value:!0}],A=[{label:m.R.showRecommendedCams,value:!0}],P=[{label:m.R.previewRooms,value:!0}];class k extends f.b{initData(e){super.initData(e),(0,c.rT)()?b.T.current.listen(["showType"],(e=>{this.setHidden(this.showLocationCheckboxes,e.showType===v.ShowType.FOLLOW_OFFLINE)}),this.element):w.Xv.listen((()=>this.setHidden(this.showLocationCheckboxes,(0,v.isOfflineFollowed)())))}createElement(e){return this.showLocationCheckboxes=new y.Ws({choices:T,name:"show_location",defaultValue:e.showLocation,styles:new x}),this.enableRecommendationsCheckbox=new y.Ws({choices:A,name:"enable_recommendations",defaultValue:e.enableRecommendations,disabled:e.enableRecommendationsDisabled,styles:new x}),this.setDisabled(this.enableRecommendationsCheckbox,e.enableRecommendationsDisabled),this.animateThumbnailsCheckboxes=new y.Ws({choices:P,name:"animate_thumbnails",defaultValue:e.animateThumbnails,disabled:e.animateThumbnailsDisabled,styles:new x}),this.setDisabled(this.animateThumbnailsCheckboxes,e.animateThumbnailsDisabled),this.setHidden(this.showLocationCheckboxes,(0,v.isOfflineFollowed)()),(0,g.tT)("div",{id:"advanced_options"},(0,g.tT)("label",null,m.R.settings,":"),(0,g.tT)("form",{id:"filter_options_form",action:"/ax/update_option_filters/",method:"post"},this.showLocationCheckboxes.getField(),(0,c.qn)()?"":this.enableRecommendationsCheckbox.getField()),(0,g.tT)("form",{id:"animate_thumbnails_form",action:"/ax/update_animate_thumbnails_options/",method:"post"},this.animateThumbnailsCheckboxes.getField()))}initUI(e){super.initUI(e),this.setIdAndForAttribute(this.showLocationCheckboxes,"id_show_location"),(0,c.qn)()||this.setIdAndForAttribute(this.enableRecommendationsCheckbox,"id_enable_recommendations"),this.setIdAndForAttribute(this.animateThumbnailsCheckboxes,"id_animate_thumbnails")}setDisabled(e,t){const i=e.getField().querySelector("input");null!==i&&(i.disabled=t)}setHidden(e,t){e.getField().style.display=t?"none":"block",this.setDisabled(e,t)}setIdAndForAttribute(e,t){const i=e.getField().querySelector("input");if(null!==i){i.id=t;const e=i.closest("td label");null!==e&&(e.htmlFor=i.id)}}}const M=[{label:m.R.refresh30Seconds,value:"30"},{label:m.R.refresh45Seconds,value:"45"},{label:m.R.refresh60Seconds,value:"60"},{label:m.R.refresh90Seconds,value:"90"},{label:m.R.refreshDisable,value:"0"}];class R extends f.b{createElement(e){var t;return this.refreshThumbnailsSelect=new y.l6({choices:M,name:"refresh_frequency",defaultValue:(null!==(t=e.initial)&&void 0!==t?t:60).toString()}),(0,g.tT)("div",{className:"refresh"},(0,g.tT)("form",{id:"refresh_cams_form",action:"/ax/update_refresh_frequency/",method:"post"},(0,g.tT)("label",null,m.R.refreshThumbnailsEvery,":"),this.refreshThumbnailsSelect.getField()))}initUI(e){super.initUI(e);const t=this.element.querySelector("select");null!==t&&(t.id="id_refresh_frequency",t.dataset.testid="refresh-frequency-select",(0,l.ZM)(t,{marginTop:"4px"}))}}const I=[{label:m.R.northAmericaTitle,value:"NA"},{label:m.R.southAmericaTitle,value:"SA"},{label:m.R.asiaTitle,value:"AS"},{label:m.R.europeRussiaTitle,value:"ER"},{label:m.R.otherTitle,value:"O"}];class E extends f.b{createElement(e){const t={choices:I,name:"visible_regions",defaultValue:""!==e.initial?e.initial:"NA,SA,AS,ER,O",styles:new x};return this.checkboxes=new y.Ws(t),(0,g.tT)("div",{className:"filter_location checkboxes"},(0,g.tT)("label",null,m.R.visibleRegionsTag,":"),(0,g.tT)("form",{id:"filter_location_form",method:"post",action:"/ax/update_location_filters/"},this.checkboxes.getField()))}initUI(e){super.initUI(e),this.bindElementIdsAndForAttributes()}bindElementIdsAndForAttributes(){let e=0;this.element.querySelectorAll("input[type=checkbox]").forEach((t=>{t.id=`id_visible_regions_${e}`,t.closest("label[class=checkboxFieldLabel]").htmlFor=t.id,e+=1}))}}var L=i(9461),D=i(7321),B=i(735);class U extends B.wx{createElement(e){return(0,g.tT)("div",{className:"mobile suggestionsDiv"})}initData(e){super.initData(e);const t=document.getElementById("mobile_advanced_options_container");t instanceof HTMLDivElement&&(t.dataset.testid="advanced-search-options-component",this.mobileAdvancedOptionsContainer=t)}hideSuggestions(){super.hideSuggestions(),(0,l.ZM)(this.mobileAdvancedOptionsContainer,{overflow:"hidden"})}showSuggestions(){super.showSuggestions(),(0,l.ZM)(this.mobileAdvancedOptionsContainer,{overflow:this.suggestionsList.length?"visible":"hidden"})}}var F=i(7995);class _ extends F.DO{initUI(e){super.initUI(e),this.element.classList.add("MobileSearchInput");const t=(0,g.tT)("button",{className:"submit",onClick:e=>{e.preventDefault(),this.onSubmitSearchInput()}},"search");this.form.appendChild(t),this.handleMobileSortDisplay()}initSuggestions(){return(0,g.tT)(U,{classRef:e=>{this.suggestionsDiv=e},input:this.input,searchInput:this})}onSubmitSearchInput(){super.onSubmitSearchInput(),this.handleMobileSortDisplay()}handleMobileSortDisplay(){const e=document.querySelector("#mobile-sort-container");e&&(""!==this.searchKeywords?e.style.display="none":e.style.display="block")}}var N=i(9603);const O=new h.c_("showSearchingOverlay"),H=new h.c_("updateShowLocation");class W extends r.u{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.isMobile=e,this.skipOverlays=t,this.isAnimThumbUnlocked=!1,this.showAnimateThumbnails=!1,this.regionsChanged=new h.c_("regionsChanged"),this.enableRecommendationsChanged=new h.c_("enableRecommendationsChanged"),this.toggle=()=>{this.toggleShowHide(),(0,u.bT)("AdvancedSearchOptionsClicked")},this.bindAdvancedSearchRegion=()=>{const e=document.querySelectorAll(".advanced_search_region"),t=document.querySelector("#main");null!==t&&e.forEach((e=>{e.onclick=()=>{this.showElement(),(0,s.J8)().scrollTop>t.offsetTop&&t.scrollIntoView()}}))},this.setShowAnimateThumbnails=()=>{this.showAnimateThumbnails=null!==this.animateThumbnailsInput&&this.animateThumbnailsInput.checked};const i=document.querySelector("#advanced_search_options");if(null!==i){this.element=i,this.element.dataset.testid="advanced-search-options-component";const e=this.createAdvancedSearchForms(),t=i.firstElementChild;null!==t&&t.insertAdjacentElement("afterend",e)}this.bindAnimateThumbnailForm(),this.bindFilterLocationForm(),this.bindFilterOptionsForm(),this.bindAdvancedSearchRegion(),this.bindRefreshCamForm(),(0,c.qn)()||this.bindEnableRecommendations(),this.bindShowLocationOptionsForm(),this.bindSearchInput(),this.bindCloseButton(),this.bindOpenCloseButtons(),this.isAnimThumbUnlocked&&(0,D.Cx)(this.showAnimateThumbnails),O.listen((e=>{e?this.showSearchingOverlays():this.hideSearchingOverlays()}))}createAdvancedSearchForms(){const e=!L.Bm.current.loggedInUser||!L.Bm.current.loggedInUser.isSupporter;return(0,g.tT)("div",{className:"advance-search-element"},(0,g.tT)(E,{initial:L.Bm.current.regions}),(0,g.tT)(k,{showLocation:L.Bm.current.showLocation,enableRecommendations:L.Bm.current.showRecommendations,enableRecommendationsDisabled:!L.Bm.current.loggedInUser,animateThumbnails:L.Bm.current.animateThumbnails,animateThumbnailsDisabled:e}),(0,g.tT)(R,{initial:L.Bm.current.refreshFrequency}))}setTooltipDisplayBehavior(e,t){e.onmouseover=()=>{e.style.display="block"};const i=e=>e.matches(":hover");e.onmouseout=()=>{window.setTimeout((()=>{i(e)||i(t)||(e.style.display="none")}),75)},t.onmouseover=()=>{e.style.display="block"},t.onmouseout=()=>{window.setTimeout((()=>{i(e)||i(t)||(e.style.display="none")}),75)}}createShowRecTooltip(e,t){t.style.cursor="default",t.style.opacity="0.5",e.style.cursor="default";const i=(0,N.q)({content:m.R.signUpToUseFeature(),hasHTML:!0,width:"auto",divotPosition:a.Wi.Top,divotLeftOrTop:"40px"});(0,l.ZM)(i,{marginTop:"5px",marginLeft:"42px",borderStyle:"solid"});const s=i.querySelector(".divotTop"),n=i.querySelector(".divotBorder"),o=i.querySelector(".divotBackground");return null!==s&&null!==n&&null!==o&&((0,l.ZM)(s,{top:"-5px"}),(0,l.ZM)(n,{borderWidth:"4px"}),(0,l.ZM)(o,{borderWidth:"5px",top:"1px",left:"-1px"})),this.setTooltipDisplayBehavior(i,t),e.readOnly=!0,e.onclick=()=>{},i}createRoomAnimTooltip(e,t){t.style.cursor="default",t.style.opacity="0.5",e.style.cursor="default";const i=(0,N.q)({content:m.R.supporterToUseFeature(L.Bm.current.PurchaseEventSources.SUPPORTER_SOURCE_PREVIEW_ROOMS_UPSELL),hasHTML:!0,width:"auto",divotPosition:a.Wi.Top,divotLeftOrTop:"40px"}),s=i.querySelector("a");return null!==s&&(s.onclick=()=>{(0,u.bT)("SupporterPageOpened",{source:"AnimateRoomImagesTooltip"})}),(0,l.ZM)(i,{marginTop:"5px",marginLeft:"42px",borderStyle:"solid"}),this.setTooltipDisplayBehavior(i,t),e.readOnly=!0,e.onclick=()=>{},i}bindFilterLocationForm(){const e=document.querySelector("#filter_location_form");null!==e&&(e.onchange=()=>{this.onFilterFormChange(e)},e.querySelectorAll("input[type=checkbox]").forEach((t=>{(0,n.wu)("change",t,(()=>{const i=new FormData(e).getAll("visible_regions").join(",");this.regionsChanged.fire(i),(0,u.bT)("RoomsFilterRegionClicked",{region:t.value,checked:t.checked})}))})))}bindFilterOptionsForm(){const e=document.querySelector("#filter_options_form");null!==e&&(e.onchange=()=>{this.onFilterFormChange(e)})}bindAnimateThumbnailForm(){const e=document.querySelector("#animate_thumbnails_form");if(this.animateThumbnailsInput=document.querySelector("#id_animate_thumbnails"),null!==e&&null!==this.animateThumbnailsInput&&(this.animateThumbnailsInput.disabled||(this.isAnimThumbUnlocked=!0),this.showAnimateThumbnails=this.animateThumbnailsInput.checked,(0,n.wu)("change",this.animateThumbnailsInput,(()=>{this.isAnimThumbUnlocked&&this.onFilterFormChange(e)})),(this.isAnimThumbUnlocked?this.animateThumbnailsInput:e).onclick=e=>{var t;(0,u.bT)("AnimateRoomImagesClicked",{checked:null===(t=this.animateThumbnailsInput)||void 0===t?void 0:t.checked})},!this.isAnimThumbUnlocked)){const t=e.querySelector("label[for='id_animate_thumbnails']");if(null!==t){const i=this.createRoomAnimTooltip(this.animateThumbnailsInput,t);e.appendChild(i)}}}bindOpenCloseButtons(){const e=document.querySelector(".advanced_search_button");null!==e&&(e.dataset.testid="advanced-search-button",e.onclick=this.toggle)}showSearchingOverlays(){clearTimeout(this.optionsUpdateTimeout),document.querySelectorAll(".searching-overlay").forEach((e=>{this.updateOverlayPosition(e),e.style.display="block"}))}hideSearchingOverlays(){const e=document.querySelectorAll(".searching-overlay");e.forEach((e=>{this.updateOverlayPosition(e)})),clearTimeout(this.optionsUpdateTimeout),this.optionsUpdateTimeout=window.setTimeout((()=>{e.forEach((e=>{e.style.display="none"}))}),300)}onFilterFormChange(e){this.setShowAnimateThumbnails(),this.skipOverlays||O.fire(!0),(0,o.KF)(e.action,new FormData(e)).then((()=>{this.isAnimThumbUnlocked&&(0,D.Cx)(this.showAnimateThumbnails),this.bindAdvancedSearchRegion(),D.HA.getInstance().loadRooms((()=>{this.skipOverlays||O.fire(!1)}))})).catch(p.h5)}getTargetedOverlayContainer(e){const t=e.nextElementSibling;if(null!==t){if("discover_root"===t.id)return t;{let e=t.querySelector(".list");return null===e&&(e=t.lastElementChild),null===e?void 0:e}}}updateOverlayPosition(e){const t=this.getTargetedOverlayContainer(e);if(void 0!==t){const i=t,s=i.getBoundingClientRect().width,n=i.getBoundingClientRect().height;e.style.height=`${n}px`,e.style.left=`${i.offsetLeft}px`,e.style.top=`${i.offsetTop}px`,e.style.right=document.documentElement.clientWidth-i.offsetLeft-s+"px",e.style.lineHeight=`${n}px`;const o=e.querySelector(".searching-overlay-spinner");null!==o&&(n<50?(o.classList.add("searching-overlay-spinner-very-small"),o.classList.remove("searching-overlay-spinner-small"),o.classList.remove("searching-overlay-spinner-medium")):n>=50&&n<200?(o.classList.remove("searching-overlay-spinner-very-small"),o.classList.add("searching-overlay-spinner-small"),o.classList.remove("searching-overlay-spinner-medium")):n>=200&&n<550?(o.classList.remove("searching-overlay-spinner-very-small"),o.classList.remove("searching-overlay-spinner-small"),o.classList.add("searching-overlay-spinner-medium")):(o.classList.remove("searching-overlay-spinner-very-small"),o.classList.remove("searching-overlay-spinner-small"),o.classList.remove("searching-overlay-spinner-medium")))}}bindEnableRecommendations(){const e=document.querySelector("#filter_options_form"),t=document.querySelector("#id_enable_recommendations");let i=!1;if(null!==e){null!==t&&((0,n.wu)("change",t,(()=>{(0,u.bT)("EnableRecommendationsOptionClicked",{isEnabled:t.checked}),this.enableRecommendationsChanged.fire()})),t.disabled||(i=!0));const s=e.querySelector("label[for='id_enable_recommendations']");if(!i&&null!==t&&null!==s){const i=this.createShowRecTooltip(t,s);e.appendChild(i)}}}bindRefreshCamForm(){const e=document.querySelector("#refresh_cams_form");null!==e&&(e.onchange=()=>{const t=e.querySelector("#id_refresh_frequency");if(null!==t){const i=parseInt(t.value);this.setShowAnimateThumbnails(),(0,o.KF)(e.action,new FormData(e)).then((()=>{(0,u.bT)("RefreshFrequencyChanged",{seconds:i}),this.isAnimThumbUnlocked&&(0,D.Cx)(this.showAnimateThumbnails),D.HA.scheduleImageRefresh(i)})).catch(p.h5)}})}showElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block";super.showElement(e),this.element.classList.remove("collapsed"),void 0!==this.closeButton&&(this.closeButton.style.display="block")}hideElement(){super.hideElement(),this.element.classList.add("collapsed"),void 0!==this.closeButton&&(this.closeButton.style.display="none")}isShown(){return!this.element.classList.contains("collapsed")}bindSearchInput(){if(this.isMobile){const e=new _({}),t=document.getElementById("SearchInputEntry");null!==t&&t.appendChild(e.element)}const e=document.querySelector(".search_input"),t=document.querySelector("#search_icon"),i=document.querySelector(".suggestionsDiv");if(null!==e&&null!==t&&null!==i){const s=()=>{(0,u.bT)("RoomsFilterSearchClicked",{keyword:e.value})};[t,i].forEach((e=>{(0,n.wu)("click",e,(e=>{s()}),!0)})),[e,t,i].forEach((e=>{(0,n.wu)("keydown",e,(e=>{(0,d.Ci)(e)&&s()}),!0)}))}}bindCloseButton(){if(!this.isMobile){const e={position:"absolute",height:"12px",width:"14px",right:"17px",top:"25px",cursor:"pointer",display:"none"};this.closeButton=(0,g.tT)("img",{style:e,src:`${STATIC_URL}option_close.svg`,onClick:this.toggle}),this.element.appendChild(this.closeButton)}}bindShowLocationOptionsForm(){const e=document.querySelector("#id_show_location");null!==e&&(0,n.wu)("change",e,(()=>{(0,u.bT)("ShowLocationClicked",{checked:e.checked}),H.fire(e.checked)}))}}},7871:(e,t,i)=>{"use strict";i.d(t,{$q:()=>f,Ac:()=>g,L8:()=>p,Zw:()=>v,_e:()=>C,aL:()=>c,c2:()=>b,cR:()=>w,eH:()=>u,fy:()=>y,ld:()=>S,p6:()=>r});var s=i(7063),n=i(5216),o=i(3916);function r(e){return(0,n.Aw)(`api/public/asp/control/app/${e}/`).then((e=>function(e){const t=new s.N6(e);let i;if(void 0!==t.getAny("settingsValues")){const e=t.getMap("settingsValues");i={},e.keys().map((t=>{i[t]=e.getAny(t)}))}return{id:t.getString("id"),name:t.getString("name"),isPublic:t.getBoolean("isPublic",!1,!1),isInstalled:t.getBoolean("isInstalled",!1,!1),isActive:t.getBoolean("isActive",!1,!1),hasUpdate:t.getBoolean("hasUpdate",!1,!1),installed:void 0!==t.getAny("installed")?l(t.getMap("installed")):void 0,latest:l(t.getMap("latest")),settingsValues:i,permissionsValues:void 0!==t.getAny("permissionsValues")?a(t.getMap("permissionsValues")):void 0,reason:t.getStringOrUndefined("reason"),slot:t.getNumberOrUndefined("slot")}}(e.responseText)))}function a(e){return{videoPanel:e.getBoolean("videoPanel"),rewriteMessages:e.getBoolean("rewriteMessages"),tipOptions:e.getBoolean("tipOptions")}}function l(e){return{version:e.getString("version"),id:e.getString("id"),summary:e.getString("summary"),description:e.getString("description"),author:e.getString("author"),settings:h(e.getMap("settings")),permissions:d(e.getMap("permissions"))}}function h(e){const t={};return e.keys().map((i=>{t[i]=function(e){return{type:e.getString("type"),title:e.getStringOrUndefined("title",!1),description:e.getStringOrUndefined("description",!1),minimum:e.getNumberOrUndefined("minimum",!1),maximum:e.getNumberOrUndefined("maximum",!1),minLength:e.getNumberOrUndefined("minLength",!1),maxLength:e.getNumberOrUndefined("maxLength",!1),pattern:e.getStringOrUndefined("pattern",!1),default:e.getAny("default"),required:e.getBoolean("required",!1,!1),order:e.getNumberOrUndefined("order"),enum:e.getStringListOrUndefined("enum")}}(e.getMap(i))})),t}function d(e){function t(e){return{settings:e.getString("settings")}}return{videoPanel:t(e.getMap("videoPanel")),rewriteMessages:t(e.getMap("rewriteMessages")),tipOptions:t(e.getMap("tipOptions"))}}function c(e){return{appList:e.getStringList("order").map((e=>function(e){const t=new s.N6(e);return{id:t.getString("id"),name:t.getString("name"),panelType:t.getString("system")}}(e))),appName:e.getString("app_name",!1),template:e.getString("template",!1),layers:e.getList("layers"),url:e.getStringOrUndefined("url",!1),webcOrigin:e.getStringOrUndefined("webc_origin",!1),webcAuthToken:e.getStringOrUndefined("webc_auth_token"),error:e.getStringOrUndefined("error",!1)}}function u(e){const t=new FormData;for(const[i,s]of Object.entries(e))Array.isArray(s)?s.forEach((e=>{t.append(i,e)})):t.set(i,s);return(0,n.KF)("api/public/asp/control/applist/",t).then((e=>function(e){var t,i;const n=new s.N6(e);return{items:null!==(t=null===(i=n.getList("items"))||void 0===i?void 0:i.map((e=>{return{id:(t=e).getString("id"),name:t.getString("name"),isPublic:t.getBoolean("isPublic",!1,!1),isInstalled:t.getBoolean("isInstalled",!1,!1),isActive:t.getBoolean("isActive",!1,!1),hasUpdate:t.getBoolean("hasUpdate",!1,!1),author:t.getString("author"),summary:t.getString("summary"),latestVersion:t.getStringOrUndefined("latestVersion"),installedVersion:t.getStringOrUndefined("installedVersion"),permissionsValues:void 0!==t.getAny("permissionsValues")?a(t.getMap("permissionsValues")):void 0,reason:t.getStringOrUndefined("reason"),slot:t.getNumberOrUndefined("slot")};var t})))&&void 0!==t?t:[],limit:n.getNumber("limit"),offset:n.getNumber("offset"),total:n.getNumber("total")}}(e.responseText)))}function p(){return u({offset:"0",limit:"10",hasSlot:"1"})}let m;function g(e){return void 0===m&&(t=e,m=(0,n.Aw)(`api/public/asp/broadcast/applist/${t}/`).then((e=>{return t=e.responseText,{items:null!==(i=null===(n=new s.N6(t).getList("items"))||void 0===n?void 0:n.map((e=>{return{id:(t=e).getString("id"),name:t.getString("name"),slot:t.getNumber("slot")};var t})))&&void 0!==i?i:[]};var t,i,n}))),window.setTimeout((()=>{m=void 0}),1e3),m;var t}function v(){return u({isInstalled:"1",permissions:Object.values(o.y.EXCLUSIVE_PERMISSIONS)})}function f(e,t,i,s,o,r,a){(0,n.KF)(`api/public/asp/control/app/install/${e}/`,{settings:JSON.stringify(t),permissions:JSON.stringify(i),slot:s.toString(),replace_slot:o.toString()}).then((e=>{r()})).catch((e=>{a(e)}))}function y(e,t,i,s,o,r,a){(0,n.KF)(`api/public/asp/control/app/update/${e}/`,{settings:JSON.stringify(t),permissions:JSON.stringify(i),original_settings:JSON.stringify(s),original_permissions:JSON.stringify(o)}).then((e=>{r()})).catch((e=>{a(e)}))}function b(e,t,i,s,o,r){(0,n.KF)(`api/public/asp/control/app/upgrade/${e}/${t}/`,{settings:JSON.stringify(i),permissions:JSON.stringify(s)}).then((e=>{o()})).catch((e=>{r(e)}))}async function w(e,t){await(0,n.KF)(`api/public/asp/control/app/stop/${e}/`,{}).then((e=>{t()})).catch((e=>{error("Error stopping app",e)}))}async function C(e,t,i){await(0,n.KF)(`api/public/asp/control/app/uninstall/${e}/`,{delete_slot:t.toString()}).then((e=>{i()})).catch((e=>{error("Error removing app",e)}))}function S(e,t,i,o){let r=`api/public/asp/panel/${e}/`;const a=new URLSearchParams;return void 0!==i&&a.append("app_id",i),void 0!==o&&a.append("system",o),t&&a.append("bcp_fallback","1"),""!==a.toString()&&(r+=`?${a.toString()}`),(0,n.Aw)(r).then((e=>new s.N6(e.responseText)))}},8598:(e,t,i)=>{"use strict";i.d(t,{$:()=>o,t:()=>n});var s=i(5216);async function n(e){const t={room_user:e.roomUser,created_by:e.createdBy,banned_user:e.bannedUser,is_silence:e.isSilence.toString()};return(0,s.KF)("api/ts/chat/ban-id/",t).then((e=>JSON.parse(e.responseText).banid))}function o(e,t,i,n,o){(0,s.KF)("edit_room_ban/",{banid:String(e),action:t,room_username:i}).then((e=>{const t=e.responseText;if(null===t)return void o();let i;try{i=JSON.parse(t)}catch(e){return void o()}void 0===i.error?n():o()})).catch((()=>{o()}))}},3417:(e,t,i)=>{"use strict";i.d(t,{Bq:()=>d,Kw:()=>c,V6:()=>m,pi:()=>g,vu:()=>p,zS:()=>a});var s=i(5216),n=i(7407),o=i(9461),r=i(897);const a=2e3;let l,h=new Set;function d(e){return(0,s.KF)("api/ts/chat/ignored-users/",{username:e}).then((t=>{var i;return u(t.responseText),(0,n.bT)("IgnoreUser",{username:null===(i=o.Bm.current.loggedInUser)||void 0===i?void 0:i.username,to_user:e,list_size:m().size}),!0})).catch((e=>(error("Error posting ignore user",e),!1)))}function c(e){return(0,s.ju)("api/ts/chat/ignored-users/",{username:e}).then((()=>{var t;return h.delete(e),(0,n.bT)("UnignoreUser",{username:null===(t=o.Bm.current.loggedInUser)||void 0===t?void 0:t.username,to_user:e,list_size:m().size}),!0})).catch((e=>(error("Error posting unignore user",e),!1)))}function u(e){try{h=new Set(JSON.parse(e).users)}catch(e){error("Cannot parse ignore list",{reason:e.toString()})}}function p(){if((0,s.Aw)("api/ts/chat/ignored-users/").then((e=>{u(e.responseText)})).catch((e=>{error("Network error retrieving ignore list",e)})),void 0===l){var e;const t=null===(e=o.Bm.current.loggedInUser)||void 0===e?void 0:e.userUid;void 0!==t&&(l=new r.T_(t).onMessage.listen((e=>{var t;e.isIgnored?(t=e.username,h.add(t)):function(e){h.delete(e)}(e.username)})))}}function m(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&p(),h}function g(e){const t=m();return void 0===t?(error("ignoreSet should not be undefined"),!1):t.has(e)}},20:(e,t,i)=>{"use strict";i.d(t,{F_:()=>P,M7:()=>T,O2:()=>S,SU:()=>v,Xw:()=>A,bi:()=>b,cb:()=>x,j:()=>m,j4:()=>f,lX:()=>g,mi:()=>y,ug:()=>M});var s=i(7063),n=i(213),o=i(5216),r=i(6844),a=i(438),l=i(8423),h=i(7407),d=i(7569),c=i(4947),u=i(2945),p=i(9461);const m=50,g=new l.c_("createNewSession");function v(){return p.Bm.current.dmsEnabled}function f(e){return{message:e.getString("m"),numUnread:e.getNumber("num_unread"),time:1e3*e.getNumber("created_at"),fromUsername:e.getString("from_user"),otherUser:(0,a.Rh)(new s.N6(e.getObject("other_user"))),hasMedia:e.getBoolean("has_media")}}function y(e){return{username:e,isBroadcaster:!0,inFanclub:!1,hasTokens:!1,isMod:!1,tippedRecently:!1,tippedALotRecently:!1,tippedTonsRecently:!1,exploringHashTag:"",sourceName:"df"}}function b(e){return{message:"",numUnread:0,fromUsername:e,hasMedia:!1,otherUser:y(e)}}function w(e){const t=e.getList("messages");return void 0===t?{messages:[],numUnread:0}:{messages:t.map((e=>(0,a.Y6)(e))),numUnread:e.getNumber("num_unread")}}const C=new Map;function S(e,t,i){if(void 0===i||(0,r.ok)())return Promise.resolve({messages:[],numUnread:0});const n=`${e}-${t}-${i}`;let a=C.get(n);if(void 0===a){const r=(0,u.Go)({offset:i,room:t});a=(0,o.Aw)(`api/ts/chatmessages/pm_list/${e}/?${r}`).then((e=>w(new s.N6(e.responseText)))),C.set(n,a),window.setTimeout((()=>{C.delete(n)}),100)}return a}function x(e,t){let i=`api/ts/chatmessages/pm_history/${e}/`;return void 0!==t&&(i+=`?${(0,u.Go)({offset:t})}`),(0,o.Aw)(i).then((e=>w(new s.N6(e.responseText))))}function T(e,t,i){return new Promise(((s,n)=>{S(e,t,null!=i?i:"0").then((e=>{if(e.numUnread<=0)return s([]);const t=e.messages.slice(-e.numUnread);return s(t)})).catch((e=>{n(e)}))}))}const A=["roomviewPM","mobilePM","mobile","DM"];async function P(e){if(d.fM.isShortcodeSyntax(e.message)){const t={username:e.username,errorMessage:"DM"===e.source?c.R.shortcodeNotSupportedInDMs:c.R.shortcodeNotSupportedInPMs,showDmLink:!1};return Promise.reject(t)}if(void 0===p.Bm.current.loggedInUser)return error("Sending private message as anon"),Promise.reject(c.R.loggedInForFeature);if(p.Bm.current.isNoninteractiveUser)return(0,n.Q$)(c.R.internalStaffMessage),Promise.reject({username:e.username,errorMessage:c.R.internalStaffMessage,showDmLink:!1});const{username:t,source:i,roomName:r=""}=e,a=p.Aw.getState().privateShowId,l=new FormData,u=function(e){const t={m:e.message};return void 0!==e.media&&(t.media_id=e.media.map((e=>e.mediaId))),JSON.stringify(t)}(e);return l.append("room",r),l.append("to_user",t),l.append("from_user",p.Bm.current.loggedInUser.username),l.append("message",u),""!==a&&l.append("private_show_id",a),(0,o.KF)("api/ts/chatmessages/pm_publish/",l).then((e=>{const n=new s.N6(e.responseText),o={username:t,source:i,is_reply:n.getBoolean("is_reply"),token_color:n.getStringOrUndefined("token_color"),in_fanclub:n.getBoolean("in_fanclub",void 0,!1),success:"Ok"===n.getString("status")};(0,h.bT)("SendPrivateMessage",o);const r=n.getStringOrUndefined("status",!1);if("Ok"!==r){const e={username:t,errorMessage:null!=r?r:c.R.errorSendingMessage,showDmLink:n.getBoolean("show_sitewide_pm_link",!1,!1)};return Promise.reject(e)}return Promise.resolve()})).catch((e=>{if(error("Could not send private message: ",e),e instanceof o.fr){const t=new s.N6(e.xhr.responseText).getStringOrUndefined("error");return void 0!==t?Promise.reject({errorMessage:t,isOfflineUserError:!1}):Promise.reject({errorMessage:c.R.errorSendingMessage,isOfflineUserError:!1})}return Promise.reject(e)}))}const k=new Map;function M(e,t){let i="";void 0!==t&&""!==t&&(i=`?${(0,u.Go)({room:t})}`);const n=`api/ts/chatmessages/user_info/${e}/${i}`;if(k.has(n))return k.get(n);const r=(0,o.Aw)(n).then((i=>{const o={numUnread:(r=new s.N6(i.responseText)).getNumber("num_unread"),canPm:r.getBoolean("can_pm"),canTip:r.getBoolean("can_tip"),user:(0,a.Rh)(new s.N6(r.getObject("user"))),sitewideUser:(0,a.Rh)(new s.N6(r.getObject("sitewide_user")))};var r;const l=void 0===t,h=p.Aw.getState().room;return l&&""!==h&&e===h&&(o.user.isBroadcaster=!0),window.setTimeout((()=>{k.delete(n)}),2500),o})).catch((i=>{throw error("Error getting user info",{user:e,room:t,error:i.toString()}),k.delete(n),i}));return k.set(n,r),r}},6318:(e,t,i)=>{"use strict";i.d(t,{C0:()=>d,IM:()=>f,bs:()=>h,f1:()=>p,nu:()=>v,sc:()=>u,vI:()=>l,wy:()=>y,xV:()=>a});var s=i(5216),n=i(1519),o=i(8423),r=i(9510);const a=new o.c_("pmMediaDrop",{listenersWarningThreshold:()=>o.hI}),l=new o.c_("pmMediaUpload",{listenersWarningThreshold:()=>o.hI}),h=new o.c_("pmMediaDeleted",{listenersWarningThreshold:()=>2+2*o.hI}),d=new o.c_("pmMediaRejected",{listenersWarningThreshold:()=>2+2*o.hI}),c=52428800;function u(e,t){let i;if(e.size>c)i=Promise.reject("file_too_large");else{const t=new FormData;t.append("media",e),i=(0,s.KF)("api/ts/chatmessages/media/upload/",t).then((e=>{const t=JSON.parse(e.responseText).payload;return{mediaId:t.media_id,url:t.media_url,thumbnailUrl:t.media_thumbnail_url,opened:!1,fromUserUID:t.user_uid}}))}return l.fire({toUser:t,promise:i}),i}function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.V5,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,s.Aw)(`api/ts/chatmessages/media/?media_type=I&limit=${e}&offset=${t}`).then((e=>{const t=[],i=JSON.parse(e.responseText).media;for(const e of i)t.push({mediaId:e.media_id,url:e.media_url,thumbnailUrl:e.media_thumbnail_url,opened:!1,fromUserUID:e.user_uid});return t.sort(((e,t)=>Number(t.mediaId)-Number(e.mediaId))),t}))}let m;const g=new n.a((()=>{m=p()}),{bounceLimitMS:10,debounceType:0});function v(){return g.callFunc(),m}function f(e){return(0,s.KF)("api/ts/chatmessages/media/delete/",{media_id:e.toString()}).then((t=>200===t.status?(h.fire(e),Promise.resolve()):Promise.reject())).catch((e=>Promise.reject()))}function y(e,t,i){const n=new FormData;return n.append("from_user_uid",e),n.append("message_id",t),n.append("media_id",i.toString()),(0,s.KF)("api/ts/chatmessages/media/opened/",n).then((e=>204===e.status)).catch((()=>!1))}},8377:(e,t,i)=>{"use strict";i.d(t,{n:()=>o});var s=i(5216),n=i(1650);function o(e){return new Promise(((t,i)=>{(0,s.KF)("api/ts/accounts/editsubgender/",e).then((()=>{t(e.get("subgender")),"function"==typeof window[n.J9]&&window[n.J9]()})).catch((()=>{i()}))}))}},1474:(e,t,i)=>{"use strict";i.d(t,{D:()=>d,ae:()=>g,ew:()=>h,kb:()=>p,xj:()=>c});var s=i(352),n=i(7063),o=i(5216),r=i(8423),a=i(3049),l=i(9461);const h=new r.c_("tipsInPast24HoursUpdate"),d=new r.c_("tokenBalanceUpdate"),c=6;function u(e){const t=[];for(const i of JSON.parse(e)){const e=new n.N6(JSON.stringify(i));t.push({label:e.getAsString("label")}),e.logUnusedDebugging("parseOptions")}return t}function p(e){return new Promise(((t,i)=>{(0,o.Aw)(`tipping/current_tokens/?room=${e}`).then((e=>{const i=function(e){const t=new n.N6(e),i={tokenBalance:t.getNumber("token_balance")},s=t.getStringOrUndefined("tip_options");return void 0!==s&&(i.tipOptions=function(e){let t=new n.N6(e);const i=t.getObjectStringOrUndefined("tip_options");if(void 0===i)return;t=new n.N6(i);const s={label:t.getAsString("label"),options:u(t.getObjectString("options"))};return t.logUnusedDebugging("parseTipOptions"),s}(s)),t.logUnusedDebugging("parseCurrentTokensResponse"),i}(e.responseText);d.fire({tokens:i.tokenBalance}),t(i)})).catch((e=>{i(e.status)}))}))}let m=!1;function g(e){return new Promise(((t,i)=>{var r,h;m||((0,a.kt)()&&(0,s.trackCustomEvent)({name:"SendTip",data:{roomName:e.roomName,tipAmount:e.tipAmount,message:e.message,source:e.source,tipRoomType:e.tipRoomType,tipType:e.tipType,videoMode:e.videoMode}}),m=!0,(0,o.KF)(`tipping/send_tip/${e.roomName}/`,{tip_amount:e.tipAmount,message:e.message,source:e.source,tip_room_type:e.tipRoomType,tip_type:e.tipType,video_mode:e.videoMode,from_username:null!==(r=null===(h=l.Bm.current.loggedInUser)||void 0===h?void 0:h.username)&&void 0!==r?r:""}).then((e=>{m=!1;const i=function(e){const t=new n.N6(e),i={success:t.getBoolean("success")},s=t.getStringOrUndefined("error",!1);return void 0!==s?(i.error=s,i.showPurchaseLink=t.getBoolean("show_purchase_tokens",!1,!1)):(i.tokenBalance=t.getNumber("token_balance"),i.tipsInPast24Hours=t.getNumber("tipped_performer_last_24hrs")),t.logUnusedDebugging("parseSendTipResponse"),i}(e.responseText);void 0!==i.tokenBalance&&d.fire({tokens:i.tokenBalance}),t(i)})).catch((e=>{m=!1,i(e.xhr.status)})))}))}},9945:(e,t,i)=>{"use strict";i.d(t,{ak:()=>E,W2:()=>U,CO:()=>z,SF:()=>V,BT:()=>$});var s=i(7623),n=i(2758),o=i(8377),r=i(394),a=i(6784),l=i(213),h=i(2028),d=i(2922);class c{constructor(e){this.algorithm=2,this.level=0,void 0!==e&&(this.algorithm=e)}avgAlgorithm(e){const t=e.reduce(((e,t)=>e+t*t));this.level=Math.sqrt(t/e.length)}maxAlgorithm(e){let t=Number.MIN_SAFE_INTEGER;e.map((e=>(e>t&&(t=e),e))),0===e.length||t<0?t=0:t>1?t=1:this.level=t}connect(e){this.level=0,(0,s.o)()&&("webkitAudioContext"in window?this.context=new webkitAudioContext:this.context=new AudioContext,this.script=this.context.createScriptProcessor(2048,1,1),this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),this.script.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);1===this.algorithm?this.avgAlgorithm(t):2===this.algorithm?this.maxAlgorithm(t):error("invalid algorithm choice",this.algorithm)})}stop(){return(0,s.o)()?(this.mic.disconnect(),this.script.disconnect(),this.context.close()):Promise.resolve()}}var u=i(8806),p=i(2709),m=i(3955),g=i(1779),v=i(7882),f=i(3124),y=i(7407),b=i(34),w=i(1452),C=i(4947),S=i(3860),x=i(1673),T=i(9447),A=i(5901),P=i(9937),k=i(9461);const M="we-only-need-a-silent-mic",R="382px",I=["public","private","hidden","away","connecting"],E="broadcast_muted",L="selected_mic",D="selected_cam",B="selected_res",U={days:60};function F(e){const t=document.createElement("div");return t.style.paddingLeft="10px",t.style.paddingTop="3px",t.style.fontSize="20px",t.textContent=e,t}function _(e){const t=F(e);return t.style.paddingTop="10px",t.style.fontFamily="UbuntuRegular",t.style.fontSize="15px",t}function N(){const e=document.createElement("select");return(0,T.fZ)(e,"select"),e.style.width="177px",e.style.height="20px",e.style.marginLeft="10px",e.style.marginTop="10px",e.style.fontFamily="UbuntuRegular",e.style.fontSize="12px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.overflow="hidden",e}function O(){const e=document.createElement("video");return e.autoplay=!0,e.muted=!0,e.setAttribute("playsinline",""),e.oncontextmenu=e=>{e.preventDefault()},e}class H{constructor(){this.broadcasting=!1,this.stopPromise=void 0}setup(e,t,i){const n={video:{deviceId:{exact:i.camId},width:{ideal:i.width}},frameRate:{min:24,max:30}};return(0,s.Xb)()?n.aspectRatio=1.777777778:n.video.height={ideal:i.height},i.micId!==M&&(n.audio={deviceId:{exact:i.micId}},n.audio.advanced=[{autoGainControl:!0},{noiseSuppression:!0}],(0,s.H8)()&&(n.audio.advanced.push({googEchoCancellation:!0}),n.audio.advanced.push({googExperimentalEchoCancellation:!0}),n.audio.advanced.push({googHighpassFilter:!0}))),this.handler=new u.Y9(t,e,"desktop"),this.uuid=this.handler.uuid,new Promise(((e,t)=>{void 0!==this.handler&&this.handler.setup(n).then((t=>{this.stream=t,void 0!==this.handler&&this.handler.setMute(i.muted),e()})).catch((e=>{t(e)}))}))}stop(){return void 0===this.stopPromise&&(this.stopPromise=new Promise((e=>{const t=()=>{this.handler=void 0,this.stream=void 0,this.broadcasting=!1,e()};void 0!==this.handler?this.handler.stop().then((e=>{this.uuid===e&&t()})).catch(w.yZ):t()}))),this.stopPromise}start(){if(this.broadcasting=!1,void 0!==this.handler){if((0,f.FW)()&&!(0,f.Y$)(this.handler.streamSettings.facingMode)){let e=C.R.turnDevice180;return(0,f.K$)()&&(e=C.R.turnDeviceLandscape),Promise.reject(new Error(e))}return new Promise(((e,t)=>{if(void 0!==this.handler){let i=!1;const s=t=>{void 0!==t&&t!==this.uuid||!1===i&&(this.broadcasting=!0,i=!0,u.ni.removeListener(n),e())},n=e=>{s(e)};u.ni.listen(n),this.handler.start().then((()=>{s()})).catch((e=>{!0===e.fatal&&(u.ni.removeListener(n),t(e))}))}}))}return Promise.resolve()}streaming(){return void 0!==this.handler}setMute(e){return void 0!==this.handler&&void 0!==this.stream&&(this.handler.setMute(e),!0)}}class W extends p.u{constructor(e,t,i,s){super(),this.videoWidth=268,this.dossier=e,this.user=s,this.config=i,this.constraints=t,this.helpOverlay=this.createHelpOverlay(),this.createPreviewPanel()}start(){const e=()=>{if(void 0!==this.streamer){(0,A.Rz)((()=>this.setStartButtonDisabled(!1)));const e=Math.floor(this.videoWidth/this.videoRatio);this.video.style.height=`${e}px`,this.startMeter()}};this.stop().then((()=>{this.streamer=new H,this.streamer.setup(this.video,this.dossier,this.constraints).then(e).catch((t=>{(0,s.H8)()&&(0,s.hj)()&&"Could not start video source"===t.message?e():(0,l.Q$)(`${C.R.couldNotSetupPreview}:\n${t.message}`)}))})).catch(w.yZ)}stop(){return this.setStartButtonDisabled(!0),this.stopMeter().then((()=>void 0!==this.streamer?this.streamer.stop():Promise.resolve()))}stopMeter(){return new Promise((e=>{void 0!==this.volumeRange&&(this.volumeRange.style.width="0%"),void 0!==this.volumeMeter?this.volumeMeter.stop().then((()=>{clearInterval(this.volumeMeterInterval),this.volumeMeter=void 0,e()})).catch(w.yZ):e()}))}startMeter(){this.stopMeter().then((()=>{(0,s.o)()&&void 0!==this.streamer&&void 0!==this.streamer.stream&&this.streamer.stream.getAudioTracks().length>0&&(this.volumeMeter=new c,this.volumeMeter.connect(this.streamer.stream),this.volumeMeterInterval=window.setInterval((()=>{if(void 0!==this.volumeMeter&&void 0!==this.volumeRange){const e=100*this.volumeMeter.level;this.volumeRange.style.width=`${e}%`}})))})).catch(w.yZ)}updateResolution(e){const t=this.devices.cams.get(this.constraints.camId);if(void 0!==t){const i=t.resolutions.get(e.value);void 0!==i&&(this.constraints.width=i.width,this.constraints.height=i.height,this.videoRatio=i.ratio,void 0!==this.hdLabel&&(i.isHD?this.hdLabel.style.visibility="visible":this.hdLabel.style.visibility="hidden"),this.start())}}updateResolutions(){const e=this.devices.cams.get(this.constraints.camId);if(void 0!==e){for(let e=this.resSelect.options.length-1;e>=0;e-=1)this.resSelect.removeChild(this.resSelect.options[e]);let t=(0,n.y1)(B);void 0===t&&(t=(0,n.fc)(B,U));let i=0,o=-1;const r=(0,s.Pb)();e.resolutions.forEach((e=>{if(!r||960!==e.width){const s=document.createElement("option");s.label=e.label,s.text=e.label,s.value=e.id,this.resSelect.add(s),s.value===t&&(o=i),i+=1}})),-1===o&&(o=Math.floor(this.resSelect.options.length/2));const a=this.resSelect.options[o];a.selected=!0,this.updateResolution(a)}}onCamChange(){const e=this.camSelect.selectedIndex;if(e>=0){const t=this.camSelect.options[e];this.constraints.camId=t.value,(0,n.aR)(D,t.value,U),window.localStorage.removeItem(B),this.updateResolutions()}}onResChange(){const e=this.resSelect.selectedIndex;if(e>=0){const t=this.resSelect.options[e];(0,n.aR)(B,t.value,U),this.updateResolution(t)}}createPreviewPanel(){(0,T.fZ)(this.element,"previewPanel"),this.element.style.height=R,this.element.style.width="488px",this.element.style.paddingLeft="5px",this.element.appendChild(this.createTitle()),this.element.appendChild(this.createMediaSettingsPanel()),this.element.appendChild(this.createVideoPanel())}createTitle(){const e=document.createElement("div");(0,T.fZ)(e,"welcomeTitle"),e.dataset.testid="preview-title",e.style.width="100%",e.style.height="32px";const t=document.createElement("span");return t.style.paddingLeft="10px",t.style.verticalAlign="sub",t.style.lineHeight="32px",t.textContent=`${C.R.welcomeBack}, ${this.dossier.room}`,e.appendChild(t),e}createMediaSettingsPanel(){const e=document.createElement("div");return e.style.width="198px",e.style.cssFloat="left",e.style.height="318px",e.style.padding="10px 0 10px 0",e.appendChild(this.createCamSettingsPanel()),e.appendChild(this.createMicSettingsPanel()),(0,h.Nn)().then((e=>{e?this.getUserMedia():(this.setStartButtonDisabled(!0),this.showHelpOverlay())})).catch((()=>{this.getUserMedia()})),e}getUserMedia(){this.hideHelpOverlay(),(0,h.s9)(!1).then((e=>{if(this.setStartButtonDisabled(!1),this.devices=e,e.mics.size>0&&void 0!==this.micSelect){const t=document.createElement("option");t.label=C.R.noMicrophone,t.text=t.label,t.value=M,this.micSelect.add(t);let i=(0,n.y1)(L);void 0===i&&(i=(0,n.fc)(L,U));let s=1,o=1;t.value===i&&(o=0),e.mics.forEach((e=>{const t=document.createElement("option");t.label=e.label,t.text=e.label,t.value=e.id,void 0!==this.micSelect&&this.micSelect.add(t),t.value===i&&(o=s),s+=1}));const r=this.micSelect.options[o];r.selected=!0,this.constraints.micId=r.value}if(e.cams.size>0){let t=(0,n.y1)(D);void 0===t&&(t=(0,n.fc)(D,U));let i=0,s=0;e.cams.forEach((e=>{const n=document.createElement("option");n.label=e.label,n.text=e.label,n.value=e.id,this.camSelect.add(n),n.value===t&&(s=i),i+=1}));const o=this.camSelect.options[s];o.selected=!0,this.constraints.camId=o.value,this.updateResolutions()}})).catch((e=>{this.setStartButtonDisabled(!0);let t="",i="";null!==e.message&&void 0!==e.message?t="OverconstrainedError"===e.name||"NotFoundError"===e.name||"DevicesNotFoundError"===e.name?C.R.noCameraFound:"PermissionDeniedError"===e.name||"NotAllowedError"===e.name?C.R.camAndMicPermissionDenied:"NotReadableError"===e.name?`${e.message}. ${C.R.noOtherTabsOpen}`:e.message:null!==e.name&&void 0!==e.name&&(t=e.name),""!==t&&(i=". "),this.showHelpOverlay(`${C.R.couldNotGetDevices}${i}${t}`)}))}hideHelpOverlay(){for(const e of[this.camSelect,this.resSelect,this.micSelect])void 0!==e&&(e.disabled=!1);this.helpOverlay.style.display="none"}showHelpOverlay(e){void 0!==e&&(W.permissionsErrorString=e),void 0!==W.permissionsErrorString?(this.permissionsErrorSpan.textContent=W.permissionsErrorString,this.permissionsErrorSpan.style.display="",this.requestDevicesButton.style.display="none"):(this.permissionsErrorSpan.style.display="none",this.requestDevicesButton.style.display="");for(const e of[this.camSelect,this.resSelect,this.micSelect])void 0!==e&&(e.disabled=!0);this.helpOverlay.style.display=""}createHelpOverlay(){const e=document.createElement("div");(0,T.fZ)(e,"helpOverlay"),e.style.fontSize="14px",e.style.fontFamily="UbuntuRegular",e.style.display="none",e.style.width="304px",e.style.fontWeight="bold",e.style.borderRadius="6px",e.style.textAlign="center",e.style.padding="8px",e.style.position="absolute",e.style.top="25%",e.style.left="50%",e.style.transform="translateX(-50%)",e.style.zIndex="1",e.style.borderWidth="2px",e.style.borderStyle="solid";const t=document.createElement("div");t.style.marginBottom="16px",(0,s.gm)()?(t.textContent=C.R.camAndMicPermissionPromptFF,indexedDB.open("test").onerror=()=>{this.showHelpOverlay(C.R.privateBrowsingMessage)}):t.textContent=C.R.camAndMicPermissionPrompt,e.appendChild(t),this.permissionsErrorSpan=document.createElement("div"),(0,T.fZ)(this.permissionsErrorSpan,"error"),this.permissionsErrorSpan.style.display="none",e.appendChild(this.permissionsErrorSpan),this.requestDevicesButton=document.createElement("button"),this.requestDevicesButton.style.width="268px",this.requestDevicesButton.style.padding="7px 6px",this.requestDevicesButton.style.margin="auto",this.requestDevicesButton.style.fontWeight="normal",this.requestDevicesButton.style.fontSize="14px",this.requestDevicesButton.style.fontFamily="UbuntuRegular",this.requestDevicesButton.style.cursor="pointer",this.requestDevicesButton.innerText=C.R.requestDevicePermissions,this.requestDevicesButton.onclick=()=>{"fullscreen"===S.L.getVideoMode()&&(0,s.Pb)()&&!k.Bm.current.isMobile&&(0,g.Eh)(),this.getUserMedia()},e.appendChild(this.requestDevicesButton);const i=document.createElement("div");i.style.marginTop="16px",i.innerHTML=C.R.camAndMicPermissionSupportInfo();const n=i.querySelector("#camAndMicInfoLink");return null!==n&&(n.onclick=()=>(0,y.bT)("DevicePermsInfoLinkClicked")),e.appendChild(i),this.element.appendChild(e),e}createCamSettingsPanel(){const e=document.createElement("div");(0,T.fZ)(e,"settingsPanel"),e.style.width="100%",e.style.height="158px",e.style.marginBottom="5px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.boxSizing="border-box";const t=F(C.R.cameraLabel);t.style.lineHeight="28px",t.style.paddingTop="8px",t.dataset.testid="camera-label",e.appendChild(t);const i=N();i.style.marginTop="8px",i.style.height="32px",i.dataset.testid="camera-selection",e.appendChild(i);const s=_(C.R.resolutionLabel);s.style.marginTop="16px",s.style.fontSize="12px",s.style.paddingTop="0",s.dataset.testid="resolution-label",e.appendChild(s);const n=N();return n.style.marginTop="5px",n.style.height="32px",n.dataset.testid="resolution-selection",e.appendChild(n),i.onchange=()=>{this.onCamChange()},n.onchange=()=>{this.onResChange()},this.camSelect=i,this.resSelect=n,e}createMicSettingsPanel(){const e=document.createElement("div");(0,T.fZ)(e,"settingsPanel"),e.style.width="100%",e.style.height="162px",e.style.paddingTop="8px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.boxSizing="border-box";const t=F(C.R.microphoneLabel);t.style.lineHeight="28px",e.appendChild(t);const i=N();e.appendChild(i),i.style.marginTop="8px",i.style.height="32px",i.dataset.testid="microphone-selection",i.onchange=()=>{const e=i.selectedIndex;if(e>=0){const t=i.options[e];this.constraints.micId=t.value,(0,n.aR)(L,t.value,U),this.start()}};const o=(0,s.o)();if(o){const t=document.createElement("div"),i=_(`${C.R.inputLevelLabel}:`);i.style.paddingTop="16px",i.style.paddingLeft="8px",i.style.display="inline-block",t.appendChild(i);const s=document.createElement("div");(0,T.fZ)(s,"inputLevelBar"),s.style.width="82px",s.style.margin="23px 8px 0 10px",s.style.borderWidth="1px",s.style.borderStyle="solid",s.style.display="inline-block",s.style.height="7px",s.dataset.testid="audio-level-bar";const n=document.createElement("div");n.style.width="78px",n.style.height="7px",n.style.width="0%",n.style.backgroundColor="lightgreen",this.volumeRange=n,s.appendChild(n),t.appendChild(s),e.appendChild(t),this.tuneLabelFontSizeWithinSettingsPanel(i)}const r=document.createElement("div"),a=new P.m(16,!1,(()=>{const e=!this.constraints.muted;h(e)&&(this.constraints.muted=e)}));a.setCheckboxValue("Mute"),a.setCheckboxId("mutebox-input"),a.element.id="mutebox",a.element.style.marginTop="8px",a.element.style.marginLeft="8px",a.element.dataset.testid="mute-box",a.disable();const l=window.setInterval((()=>{h(this.constraints.muted)&&(a.enable(),clearInterval(l))}),200);r.appendChild(a.element);const h=e=>void 0!==this.streamer&&!!this.streamer.setMute(e)&&(e?a.setCheckedDirectly(!0):a.setCheckedDirectly(!1),(0,n.aR)(E,String(e),U),!0),d=document.createElement("label");return d.textContent=C.R.muteLabel,d.htmlFor="mutebox-input",d.style.paddingLeft="5px",d.style.transform="translateY(-4px)",d.style.fontFamily="UbuntuRegular",d.style.fontSize="14px",d.style.display="inline-block",d.style.lineHeight="22px",r.appendChild(d),o||(a.element.style.marginTop="100px",d.style.marginTop="70px"),e.appendChild(r),this.micSelect=i,e}tuneLabelFontSizeWithinSettingsPanel(e){let t=16;const i=85-((0,s.nr)()?8:0);for(;(0,m.jl)(`${C.R.inputLevelLabel}:`,`${t}px UbuntuRegular`)>i&&t>1;)t-=1;e.style.fontSize=`${t}px`}createVideoPanel(){const e=document.createElement("div");e.style.width="289px",e.style.cssFloat="left",e.style.height="318px",e.style.padding="10px 0 10px 0",e.dataset.testid="preview-video-panel";const t=O();t.style.width=`${this.videoWidth}px`,t.style.height="150px",t.style.marginLeft="10px",t.style.marginRight="10px",e.appendChild(t),this.video=t;const i=document.createElement("div");(0,T.fZ)(i,"hdLabel"),i.style.fontSize="24px",i.style.fontFamily="UbuntuBold",i.style.marginLeft="10px",i.style.marginTop="10px",i.textContent="HD",i.style.visibility="hidden",this.hdLabel=i,e.appendChild(i),e.appendChild(this.createStartButton());const s=_(`${C.R.highQualityStream}:`);s.style.fontSize="11px",s.style.paddingLeft="0",s.style.paddingTop="5px",s.style.textAlign="center",e.appendChild(s);const n=document.createElement("div");n.style.textAlign="center";const o=document.createElement("a");return(0,T.fZ)(o,T.aG.hrefColor),o.style.fontSize="12px",o.text=C.R.useOBS,o.style.cursor="pointer",o.dataset.testid="obs-link",n.appendChild(o),e.appendChild(n),o.onclick=()=>{this.config.onOBSClick()},e}createStartButton(){const e=document.createElement("div");e.style.textAlign="center";const t=document.createElement("button");if((0,T.fZ)(t,"startButton"),t.style.marginTop="75px",t.style.width="268px",t.style.height="32px",t.style.fontWeight="normal",t.style.fontSize="14px",t.textContent=C.R.startBroadcasting,t.style.fontFamily="UbuntuBold",t.style.cursor="pointer",e.appendChild(t),t.disabled=!0,t.onclick=()=>{if(this.user)if(this.user.gender===v.YT.OldTrans&&void 0===this.user.subgender){const e=new r.k,t={acceptText:C.R.subgenderSelectionConfirm,separator:!1,allowDecline:!1,orange:!0};(0,l.SI)(e.element,(()=>{(0,o.n)(new FormData(e.element)).then((e=>{this.user&&(this.user.subgender=e),this.startBroadcast()})).catch(w.yZ)}),void 0,void 0,t,!0)}else this.startBroadcast()},this.startButton=t,(0,s.gm)()){const e=_(`${C.R.firefoxWarning}`);(0,m.ZM)(e,{fontSize:"11px",paddingLeft:"5px",textAlign:"center"}),t.before(e),t.style.marginTop="15px"}return e}setStartButtonDisabled(e){this.startButton.disabled=e,this.startButton.style.opacity=e?".5":"1",this.startButton.style.cursor=e?"default":"pointer"}startBroadcast(){(0,d.w)((()=>{(0,A.Yc)().then((e=>{""!==e?((0,l.Q$)(C.R.showMyCamCurrentlySharing(e)),this.setStartButtonDisabled(!0),(0,A.Rz)((()=>{this.setStartButtonDisabled(!1)}))):this.stop().then((()=>{this.config.onStartBroadcast()})).catch(w.yZ)})).catch(w.yZ)}))}}class $ extends W{constructor(e,t,i){super(e,t,i)}stop(){return super.stop()}start(){super.start()}createPreviewPanel(){this.element.style.width="402px",this.element.style.backgroundColor="transparent",this.element.style.position="relative",this.element.appendChild(this.createTitle()),this.element.appendChild(this.createClose()),this.element.appendChild(this.createVideoPanel()),this.element.appendChild(this.createInfoPanel()),this.element.appendChild(this.createMediaSettingsPanel()),this.element.appendChild(this.createStartButton())}createTitle(){const e=document.createElement("div");e.style.width="200px",e.style.height="26px",e.style.display="inline-block";const t=document.createElement("div");return(0,T.fZ)(t,"title"),t.style.fontFamily="UbuntuBold",t.style.fontSize="18px",t.textContent=this.config.title,t.dataset.testid="preview-title",e.appendChild(t),e}createClose(){const e=document.createElement("div");e.style.display="inline-block",e.style.position="relative",e.style.right="-1px",e.style.width=e.style.height="17px",e.style.cssFloat="right",e.style.cursor="pointer",e.dataset.testid="cam-to-cam-preview-close-button",e.onclick=this.config.onClose;const t=document.createElement("img");return t.src=`${STATIC_URL_ROOT}tsdefaultassets/close-gray.svg`,t.style.width=t.style.height="100%",e.appendChild(t),e}createVideoPanel(){this.videoWidth=400;const e=document.createElement("div");e.style.textAlign="center",e.dataset.testid="preview-video-panel";const t=O();return t.style.width=`${this.videoWidth}px`,t.style.height=this.videoWidth/this.videoRatio+"px",e.appendChild(t),this.video=t,e}createInfoPanel(){const e=document.createElement("div");(0,T.fZ)(e,"infoPanel"),e.style.marginTop="6px",e.style.padding="6px 5px 9px 4px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.boxSizing="border-box",e.dataset.testid="cam-to-cam-preview-info-panel";const t=()=>{const e=document.createElement("div");return e.style.fontFamily="UbuntuRegular",e.style.fontStyle="normal",e.style.fontWeight="bold",e.style.fontSize="12px",e.style.lineHeight="14px",e.style.textAlign="center",e},i=this.config.infoText;let s;for(s of i){const i=t();i.textContent=s,e.appendChild(i)}return e}createMediaSettingsPanel(){const e=super.createMediaSettingsPanel();return e.style.width="100%",e.style.height="auto",e.style.padding="9px 0px 0px 0px",e.style.cssFloat="",e}createHelpOverlay(){const e=super.createHelpOverlay();return e.style.top="11%",e}createCamSettingsPanel(){const e=document.createElement("div");(0,T.fZ)(e,"settingsPanel"),e.style.width="100%",e.style.height="68px",e.style.paddingTop="5px",e.style.borderWidth="2px",e.style.borderStyle="solid",e.style.boxSizing="border-box";const t=document.createElement("div");t.style.display="inline-block";const i=this.createMediaSettingLabel(C.R.cameraLabel);i.dataset.testid="camera-label";const s=N();s.style.marginLeft="8px",s.style.marginTop="8px",t.appendChild(i),t.appendChild(s);const n=document.createElement("div");n.style.display="inline-block",n.style.paddingLeft="16px";const o=this.createMediaSettingLabel(C.R.resolutionLabel);o.style.paddingLeft="10px",o.dataset.testid="resolution-label";const r=N();return r.style.marginTop="8px",n.appendChild(o),n.appendChild(r),e.appendChild(t),e.appendChild(n),s.onchange=()=>{this.onCamChange()},r.onchange=()=>{this.onResChange()},this.camSelect=s,s.dataset.testid="camera-selection",this.resSelect=r,r.dataset.testid="resolution-selection",e}createMicSettingsPanel(){this.constraints.micId=M;const e=document.createElement("div");return e.style.display="none",e}createStartButton(){const e=document.createElement("div");e.style.textAlign="center",e.style.paddingTop="10px";const t=document.createElement("button");return(0,T.fZ)(t,"startButton"),t.style.width="305px",t.style.height="27px",t.style.borderWidth="1px",t.style.borderStyle="solid",t.style.borderRadius="4px",t.textContent=this.config.startButtonText,t.style.fontFamily="UbuntuBold",t.style.fontSize="16px",t.style.cursor="pointer",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.style.textOverflow="ellipsis",e.appendChild(t),t.disabled=!0,t.onclick=()=>{t.disabled=!0,this.startBroadcast()},t.dataset.testid="cam-to-cam-preview-start-button",this.startButton=t,e}createMediaSettingLabel(e){const t=document.createElement("div");return t.style.paddingLeft="8px",t.style.paddingTop="3px",t.style.fontSize="16px",t.style.fontFamily="UbuntuBold",t.textContent=e,t}}class V extends p.u{constructor(e,t,i){super(),this.stopping=!1,this.timeStarted=0,this.dossier=e,this.config=i,this.constraints=t,this.createBroadcastPanel();let s=!1,n=!1,o=!1,r=!0;const a=(e,t)=>{void 0!==this.status&&void 0!==this.warning&&(!0!==t||n?!0!==t&&n&&(this.status.style.color="black",this.status.style.fontFamily="UbuntuRegular",this.status.style.width="",this.status.style.paddingLeft="0px",this.status.style.cssFloat="none",this.status.title="",this.warning.style.display="none",n=!1):(n=!0,this.status.style.color="#D80000",this.status.style.fontFamily="UbuntuBold",this.status.style.width="28%",this.status.style.paddingLeft="18%",this.status.style.cssFloat="left",this.status.title=this.warning.title=C.R.poorBroadcast,this.warning.style.display=""),this.status.textContent=e,e.length>27?this.status.style.paddingTop="2px":this.status.style.paddingTop="10px")},l=()=>{let e=performance.now();const t=window.setInterval((()=>{if(!r)return void clearInterval(t);const i=performance.now(),s=Math.floor((i-e)/1e3);s<1||(s>=10&&(e=i),void 0!==this.fps&&(this.fps.textContent=""),void 0!==this.status&&(this.status.textContent=`${C.R.pleaseWaitConnecting} ${10-s+1}...`,this.status.textContent.length>33?this.status.style.paddingTop="2px":"ja"===k.Bm.current.languageCode?this.status.style.fontSize="14px":this.status.style.paddingTop="10px"))}),200)};l(),this.onStreamStatusUpdate=e=>{if(void 0===this.streamer||this.streamer.uuid!==e.uuid)return;const t=e.data;if(void 0!==t.fps&&(s=!this.setFPS(t.fps)),void 0!==t.status){const e=t.status;if("connecting"!==e&&(r=!1),this.isStatusOffline(e))return void a("(Offline)");if("away"!==e||o)if("away"!==e&&o)void 0!==this.away&&(this.away.style.display="none"),this.main.style.display="",o=!1;else{const t=e.charAt(0).toUpperCase()+e.slice(1);"connecting"===e?r||(r=!0,l()):s&&this.timeStarted>0&&performance.now()-this.timeStarted>5e3?a(C.R.lowFPS,!0):a(`(${t} Broadcasting)`)}else this.main.style.display="none",void 0!==this.away&&(this.away.style.display=""),o=!0}},this.onStreamStop=e=>{void 0===this.streamer||this.streamer.uuid!==e||this.stopping||this.stop(!0)},u.Ay.listen(this.onStreamStatusUpdate),u.vN.listen(this.onStreamStop),this.start()}createBroadcastPanel(){const e=this.createMain();e.appendChild(this.createVideo()),e.appendChild(this.createControls());const t=document.createElement("div");t.innerText=C.R.incorrectOrientation,(0,m.ZM)(t,{color:"#ffffff",position:"absolute",fontSize:"1.0em",fontWeight:"bold",top:"8px",left:"8px",zIndex:100,display:"none",backgroundColor:"rgba(255, 255, 255, 0.5)",lineHeight:"150%",padding:"1px"}),t.setAttribute("draggable","false"),(0,a.wu)("orientationchange",window,(()=>{(0,f.FW)()&&!(0,f.Y$)()?(t.style.display="",(0,f.K$)()?t.innerText=C.R.incorrectPortrait:t.innerText=C.R.incorrectLandscape):t.style.display="none"})),e.appendChild(t);const i=this.createAway();i.appendChild(this.createTitle()),i.appendChild(this.createMessage()),i.appendChild(this.createLink()),(0,T.fZ)(this.element,"broadcastPanel"),this.element.appendChild(e),this.element.appendChild(i),this.main=e,this.away=i}isBroadcasting(){return void 0!==this.streamer&&this.streamer.broadcasting}start(){this.stop().then((()=>{let e=0;const t=(i,n)=>{this.streamer=new H,this.streamer.setup(this.video,this.dossier,this.constraints).then((()=>{void 0!==this.streamer&&this.streamer.start().then((()=>{this.onBeforeUnload=e=>(e.preventDefault(),e.returnValue=!1,C.R.wantToLeaveConfirmation),(0,a.wu)("beforeunload",window,this.onBeforeUnload),this.onUnload=()=>{this.stop(!0)},(0,a.wu)((0,s.p0)(),window,this.onUnload),x.Ve.fire(!0),i()})).catch((e=>{n(`${C.R.couldNotStartBroadcast}: ${e.message}`)}))})).catch((o=>{if((0,s.J0)()&&"Invalid constraint"===o.message){if(e+=1,e<=5)return void this.stop().then((()=>{window.setTimeout((()=>{t(i,n)}),500)})).catch(w.yZ);n(C.R.ipadFailedToSetup)}n(`${C.R.couldNotSetupBroadcast}: ${o.message}`)}))};new Promise(t).catch((e=>{(0,l.Q$)(e),this.stop(!0)}))})).catch(w.yZ)}stop(e){this.stopping=!0,void 0!==this.onBeforeUnload&&((0,a.Pf)("beforeunload",window,this.onBeforeUnload),this.onBeforeUnload=void 0),void 0!==this.onUnload&&((0,a.Pf)((0,s.p0)(),window,this.onUnload),this.onUnload=void 0);let t=Promise.resolve();return void 0!==this.streamer&&(t=this.streamer.stop()),new Promise(((i,s)=>{t.then((()=>{this.stopping=!1,!0===e&&(u.Ay.removeListener(this.onStreamStatusUpdate),u.vN.removeListener(this.onStreamStop),this.config.onStopBroadcast(),x.Ve.fire(!1)),i()})).catch(s)}))}setFPS(e){let t=20,i=15;(0,s.Xb)()&&(t=12,i=9);let n,o=!0;return(e=Math.round(e))>=t?n="frameRateGood":e>=i?n="frameRateAvg":(n="frameRateBad",o=!1),void 0!==this.fps&&(this.fps.className="",(0,T.fZ)(this.fps,n),this.fps.textContent=`${e} FPS`),o}createMain(){const e=document.createElement("div");return e.style.height=R,e.style.width="100%",e.style.overflow="unset",e}createAway(){const e=document.createElement("div");return e.style.height=R,e.style.width="100%",e.style.backgroundColor="black",e.style.display="none",e}createVideo(){const e=O();return e.style.width="100%",e.style.height="370px",e.style.backgroundColor="black",this.video=e,e}createControls(){const e=document.createElement("div");(0,T.fZ)(e,"controls"),e.style.width="100%",e.style.height="35px";const t=document.createElement("button");t.style.border="0px";const i=document.createElement("div");(0,T.fZ)(i,"muteImg"),i.textContent="",i.style.height="20px",i.style.width="20px",i.style.border="0px",i.style.paddingTop="9px",(0,s.nr)()&&!(0,s.Xb)()&&(i.style.paddingTop="3px"),i.style.outline="none",t.appendChild(i);const o=document.createElement("div");o.style.cssFloat="left",o.style.textAlign="center",o.style.height="34px",o.style.borderRight="1px solid black",o.style.width="10%",(0,s.OF)()&&(0,s.nr)()&&(o.style.width="12%"),o.appendChild(t),e.appendChild(o);const r=e=>void 0!==this.streamer&&!!this.streamer.setMute(e)&&(e?(0,T.fZ)(i,"muted"):(0,T.SA)(i,"muted"),(0,n.aR)(E,String(e),U),!0);t.onclick=()=>{const e=!this.constraints.muted;r(e)&&(this.constraints.muted=e)},t.disabled=!0;const a=window.setInterval((()=>{r(this.constraints.muted)&&(t.disabled=!1,clearInterval(a))}),200),l=document.createElement("div");(0,T.fZ)(l,"inBrowserStatus"),l.style.cssFloat="left",l.style.textAlign="center",l.style.height="34px",l.style.width="51%",l.dataset.testid="stream-status",(0,s.OF)()&&(l.style.width="44%"),l.style.borderRight="1px solid black",l.style.padding="0px",l.style.fontFamily="UbuntuRegular";const h=F("");h.style.cssFloat="left",h.style.paddingLeft="5px",h.style.paddingTop="10px";const d=_("");d.style.paddingLeft="0px";const c=document.createElement("img");c.src=`${STATIC_URL_ROOT}broadcastassets/warning.png`,c.style.height="16px",c.style.paddingTop="9px",c.style.paddingLeft="5px",c.style.display="none",c.style.cssFloat="left",l.appendChild(h),l.appendChild(d),l.appendChild(c),this.fps=h,this.status=d,this.warning=c,e.appendChild(l);const u=document.createElement("button"),p=document.createElement("input");p.type="image",p.src=`${STATIC_URL_ROOT}broadcastassets/stop.svg`,p.style.verticalAlign="middle",p.style.height="16px",p.style.paddingTop="1px",u.appendChild(p);const m=document.createElement("span");m.style.fontFamily="UbuntuRegular",m.textContent=m.innerText=C.R.stopBroadcasting;const g=m.innerText.length;g>24?(m.style.fontSize="11px",m.style.paddingLeft="1px"):g<24&&g>18?(m.style.fontSize="13px",m.style.paddingLeft="2px"):(m.style.fontSize="18px",m.style.paddingLeft="7px"),m.style.verticalAlign="middle",u.appendChild(m),u.style.paddingTop="5px",u.style.cssFloat="right",u.style.border="0",u.dataset.testid="stop-broadcasting-web-rtc-button";const v=document.createElement("div");return v.style.cssFloat="left",v.style.textAlign="center",v.style.height="34px",v.appendChild(u),e.appendChild(v),u.onclick=()=>{this.stop(!0)},e}createTitle(){const e=document.createElement("div");e.style.textAlign="center",e.style.paddingTop="90px";const t=document.createElement("span");return(0,T.fZ)(t,"awayTitle"),t.textContent=C.R.youAreAway,t.style.fontFamily="UbuntuRegular",t.style.fontSize="40px",e.appendChild(t),e}createMessage(){const e=document.createElement("div");e.style.textAlign="center",e.style.paddingLeft="16%",e.style.paddingRight="16%",e.style.paddingTop="50px";const t=document.createElement("span");return(0,T.fZ)(t,"inBrowserAwayMessage"),t.style.fontFamily="UbuntuRegular",t.style.fontSize="14px",t.textContent=C.R.wentToAway,e.appendChild(t),e}createLink(){const e=document.createElement("div");e.style.textAlign="center",e.style.paddingTop="35px";const t=document.createElement("a");return(0,T.fZ)(t,"awayLink"),t.text=C.R.exitAwayMode,t.style.fontFamily="UbuntuRegular",t.style.fontSize="20px",t.style.cursor="pointer",t.style.textDecoration="underline",e.appendChild(t),t.onclick=()=>{(0,b.vZ)()},e}isStatusOffline(e){return!I.some((t=>t===e))}}class z extends p.u{constructor(e,t,i){super(),this.startCounter=1,this.dossier=e,this.user=i,this.config=t;let s=(0,n.y1)(E);void 0===s&&(s=(0,n.fc)(E,U));const o="true"===s;this.constraints={micId:"",camId:"",width:0,height:0,muted:void 0!==o&&o},(0,T.fZ)(this.element,"Broadcast"),this.element.style.width="498px",this.element.style.height="407px",this.element.style.fontFamily="UbuntuBold",this.element.style.fontSize="18px",this.element.style.position="relative",this.previewPanel=this.createPreview(),this.addChild(this.previewPanel)}isBroadcasting(){return void 0!==this.broadcastPanel&&this.broadcastPanel.isBroadcasting()}createPreview(){return new W(this.dossier,this.constraints,{onOBSClick:this.config.onOBSClick,onStartBroadcast:()=>{void 0!==this.previewPanel&&(this.removeChild(this.previewPanel),this.previewPanel=void 0),(0,y.bT)("WebRTCBroadcastStart",{startCount:this.startCounter}),this.startCounter+=1,this.broadcastPanel=this.createBroadcast(),this.addChild(this.broadcastPanel)}},this.user)}createBroadcast(){return new V(this.dossier,this.constraints,{onStopBroadcast:()=>{void 0!==this.broadcastPanel&&(this.removeChild(this.broadcastPanel),this.broadcastPanel=void 0),this.previewPanel=this.createPreview(),this.addChild(this.previewPanel)}})}}},1673:(e,t,i)=>{"use strict";i.d(t,{I1:()=>r,Ve:()=>o,WK:()=>n});var s=i(8423);const n=new s.c_("anyRTCBroadcastStartStop"),o=new s.c_("webRTCBroadcastStartStop"),r=new s.c_("OBSBroadcastStartStop"),a=e=>{n.fire(e)};o.listen(a),r.listen(a)},9447:(e,t,i)=>{"use strict";i.d(t,{SA:()=>r,aG:()=>n,fZ:()=>o});var s=i(2709);const n={textColor:"textColor",bgColor:"bgColor",brandColor:"brandColor",tabSectionBorder:"tabSectionBorder",tabBorder:"tabBorder",tabActiveBorder:"tabActiveBorder",tabInactiveBgColor:"tabInactiveBgColor",tabInactiveColor:"tabInactiveColor",tabActiveBgColor:"tabActiveBgColor",tabActiveColor:"tabActiveColor",chatAreaTabColor:"chatAreaTabColor",defaultColor:"defaultColor",defaultTooltipColor:"defaultTooltipColor",disabledTooltipColor:"disabledTooltipColor",roomSubjectToolTipColor:"roomSubjectToolTipColor",hrefColor:"hrefColor",tagFontColor:"tagFontColor",tagExhibColor:"tagExhibColor",tagNewColor:"tagNewColor",tagLineColor:"tagLineColor",tagOfflineColor:"tagOfflineColor",tagPrivateGroupColor:"tagPrivateGroupColor",tagGamingColor:"tagGamingColor",camBgColor:"camBgColor",camBorderColor:"camBorderColor",camSubjectColor:"camSubjectColor",camSubjectTagColor:"camSubjectTagColor",camAltTextColor:"camAltTextColor",camHrefColor:"camHrefColor",nextCamBgColor:"nextCamBgColor",navigationAlt2BgImage:"navigationAlt2BgImage",navigationAlt2BgColor:"navigationAlt2BgColor",dismissibleMessageColor:"dismissibleMessageColor",userInfoDropdownBgColor:"userInfoDropdownBgColor",userInfoDropdownHighlightColor:"userInfoDropdownHighlightColor",userInfoDropdownTextColor:"userInfoDropdownTextColor"};function o(e,t){""!==t&&(e instanceof s.u?e.element:e).classList.add(t)}function r(e,t){""!==t&&(e instanceof s.u?e.element:e).classList.remove(t)}},9757:(e,t,i)=>{"use strict";i.d(t,{c:()=>o});class s{update(e){}dispose(){}}class n extends s{constructor(e,t){super();const i=document.createElement("span");i.style.color="red",i.textContent="Error loading component",t.appendChild(i),warn("Created dummy React component")}update(e){warn("Update called on dummy React component")}dispose(){warn("Dispose called on dummy React component")}}class o{static get(e){return void 0===window.ReactComponentRegistry?(error("ReactComponentRegistry is undefined - React code is likely not loaded",{argument:e}),n):void 0===window.ReactComponentRegistry[e]?(error(`ReactComponentRegistry does not contain component ${e} - React code may not be up to date`,{argument:e}),n):window.ReactComponentRegistry[e]}}},4801:(e,t,i)=>{"use strict";i.d(t,{T:()=>o});var s=i(82),n=i(9757);class o extends s.b{constructor(e){super(e),this.element.setAttribute("ts",`${e.component}Wrapper`)}createBaseElement(e,t){return document.createElement("div")}initUI(e){this.reactComponent=new(n.c.get(e.component))(e.componentProps,this.element),void 0!==e.reactRef&&e.reactRef(this.reactComponent)}update(e){null!==this.reactComponent&&this.reactComponent.update(e)}dispose(){null!==this.reactComponent&&this.reactComponent.dispose()}}},718:(e,t,i)=>{"use strict";i.d(t,{BK:()=>u,HQ:()=>c,p1:()=>w});var s=i(7063),n=i(6176),o=i(82),r=i(4947),a=i(1372),l=i(5389),h=i(7871),d=i(9447);function c(e){const t=new s.N6(e),i=t.getStringOrUndefined("detail",!1);if(void 0!==i)return{msg:i,type:"legacy"};const n=t.getMap("detail");return{msg:n.getString("msg"),type:n.getString("type"),app:n.getStringOrUndefined("app",!1)}}function u(e){return`${function(e){return e.id.split("-",1)[0]}(e)}-${t=e.name,t.replace(/[^a-zA-Z0-9]/g,"-")}`;var t}const p=e=>{const t=`/v2apps?slot=${e.slot}`;return(0,a.tT)("a",{style:T,colorClass:d.aG.hrefColor,href:t,onClick:t=>{t.preventDefault(),(0,l.gr)(t.target.href,`appdir-slot-${e.slot}`,"status=0,toolbar=1,menubar=0,directories=0,resizable=1,scrollbars=1,height=768,width=860,top=50,left=50")},"data-test":`choose-app-btn-${e.slot}`},e.text)},m=e=>{const t=`/v2apps?slot=${e.app.slot}&app_path=${u(e.app)}`;return(0,a.tT)("a",{style:{...T,visibility:e.hidden?"hidden":"visible"},colorClass:d.aG.hrefColor,href:t,onClick:t=>{t.preventDefault(),(0,l.gr)(t.target.href,`appdir-slot-${e.app.slot}`,l.fp)},"data-test":`app-${e.text.toLowerCase()}-link-${e.app.slot}`},e.text)},g=e=>{const t={width:"50px",display:"inline-block",textAlign:"left"};return e.app.isInstalled&&!e.app.isActive&&Boolean(e.app.reason)&&"user requested"!==e.app.reason?(0,a.tT)("span",{style:t,colorClass:"deactivate","data-test":`app-status-${e.app.slot}`},r.R.crashed):e.app.isActive?(0,a.tT)("span",{style:t,colorClass:"activeStatus","data-test":`app-status-${e.app.slot}`},r.R.running):(0,a.tT)("span",{style:t,colorClass:"noneSelected","data-test":`app-status-${e.app.slot}`},r.R.stopped)},v=e=>(0,a.tT)("a",{style:{...T,width:"40px",textAlign:"left"},colorClass:"deactivate",href:"#",onClick:t=>{(0,h.cR)(e.app.id,(()=>{n.s.fire()})).catch((e=>{error(e)}))},"data-test":`app-stop-btn-${e.app.slot}`},r.R.stop),f=e=>(0,a.tT)("a",{style:T,colorClass:"deactivate",href:"#",onClick:t=>{(0,h._e)(e.app.id,!0,(()=>{n.s.fire()})).catch((e=>{error(e)}))},"data-test":`app-uninstall-btn-${e.app.slot}`},e.text),y=e=>(0,a.tT)("tr",{colorClass:"row"},(0,a.tT)("td",{style:S},(0,a.tT)("legend",{style:x,colorClass:"label","data-test":`app-label-${e.slot}`},`v2 App #${e.slot}:`)),(0,a.tT)("td",{style:{fontStyle:"italic"},colorClass:"noneSelected","data-test":`app-name-${e.slot}`},r.R.noneSelected),(0,a.tT)("td",{colSpan:4},(0,a.tT)("span",{style:{cssFloat:"right",paddingRight:"8px"}},(0,a.tT)(p,{text:r.R.chooseAnApp,slot:e.slot})))),b=e=>(0,a.tT)("tr",{colorClass:"row"},(0,a.tT)("td",{style:S},(0,a.tT)("legend",{style:x,colorClass:"label","data-test":`app-label-${e.slot}`},"v2 App #",e.slot,":")),(0,a.tT)("td",{style:{fontStyle:e.app.isActive?"normal":"italic",width:"430px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},colorClass:e.app.isActive?"activeStatus":"noneSelected","data-test":`app-name-${e.slot}`},e.app.name),(0,a.tT)("td",null,(0,a.tT)(g,{app:e.app})),(0,a.tT)("td",null,(0,a.tT)(m,{app:e.app,text:e.app.hasUpdate?r.R.upgrade:r.R.settings,hidden:!e.app.isActive})),(0,a.tT)("td",null,!e.app.isActive&&(0,a.tT)(m,{app:e.app,text:r.R.restart,hidden:!1}),e.app.isActive&&(0,a.tT)(v,{app:e.app})),(0,a.tT)("td",{style:{width:0,paddingRight:"8px"}},(0,a.tT)(f,{app:e.app,text:r.R.uninstall})));class w extends o.b{initData(e){this.authUrl=e.authUrl,this.savedApps=e.savedApps,this.populateAppsRows()}initUI(){super.initUI(),this.element=(0,a.tT)("div",{style:{width:"850px",borderStyle:"solid",borderWidth:"1px",borderRadius:"5px 5px 0 0"}},this.createAppsTable(),(0,a.tT)("div",{style:{margin:"10px 8px"}},this.createDevportalMessage())),(0,d.fZ)(this.element,"aspPanel")}createAppsTable(){return(0,a.tT)("table",{style:C},(0,a.tT)("tr",null,(0,a.tT)("th",{colSpan:6,style:{fontSize:"14px",padding:"8px",borderRadius:"5px 5px 0 0"},colorClass:"header","data-test":"v2-apps-header"},"v2 ",r.R.apps,(0,a.tT)("span",{colorClass:"headerBadge",style:{padding:"2px 7px",margin:"0 5px",borderRadius:"2px"}},r.R.newCapitalized))),(0,a.tT)("tr",null,(0,a.tT)("td",{colSpan:6},(0,a.tT)("div",{style:{fontSize:"12px",margin:"8px 8px",padding:"8px 10px",borderRadius:"5px"},colorClass:"notice","data-test":"v2-apps-header-text"},r.R.v2AppsDescription))),this.appRows.slice(0,10).map((e=>e)))}populateAppsRows(){this.appRows=[];for(let e=0;e<10;++e)this.appRows.push((0,a.tT)(y,{slot:e+1}));this.savedApps.forEach((e=>{void 0!==e.slot?this.appRows[e.slot-1]=(0,a.tT)(b,{app:e,slot:e.slot}):error(`${e.name} has no slot`)}))}createDevportalMessage(){const e=r.R.devportalMessage(this.authUrl),t=document.createElement("p");return t.innerHTML=e.replace(/\s{2,}/gm," "),t.style.margin="0",t.style.fontSize="12px",t.setAttribute("data-test","dev-portal-link-text"),t}render(){return this.element}}const C={borderCollapse:"collapse",textAlign:"left",width:"100%"},S={width:"110px"},x={padding:"3px 8px"},T={verticalAlign:"middle",display:"inline-block"}},3916:(e,t,i)=>{"use strict";i.d(t,{y:()=>h});var s,n=i(2709),o=i(4947),r=i(1372),a=i(9447),l=i(9937);class h extends n.u{constructor(e){super("div",e)}initData(e){this.app=e.app,this.onChange=e.onChange,this.submit=e.submit,this.exclusiveApps=e.exclusiveApps,this.cbappAppUsed=e.cbappsAppUsed,this.showPermissions=!1,this.initExclusivePermissions()}initUI(e){this.permissionsForm=this.createPermissionsForm(),this.permissionsForm.style.display="none",this.element=(0,r.tT)("div",null,this.showPermissions&&(0,r.tT)("div",{onClick:()=>{this.togglePermissionsForm()},style:{display:"flex",justifyContent:"space-between",margin:"10px 10px 0"}},(0,r.tT)("h3",{style:{fontSize:"12px",fontFamily:"ubuntumedium",fontWeight:500,minWidth:"200px",color:"#494949"}},o.R.permissions),(0,r.tT)("h3",{ref:e=>{this.permissionsStatus=e},style:{fontSize:"12px"},colorClass:"subText"},this.getStatusText()),(0,r.tT)("div",null),(0,r.tT)("div",null),(0,r.tT)("div",null,(0,r.tT)("div",{style:{margin:"10px 10px 0 0",width:"15px",height:"15px",backgroundSize:"cover"},ref:e=>{this.chevronDown=e},colorClass:"chevronDown"}),(0,r.tT)("div",{style:{margin:"10px 10px 0 0",width:"15px",height:"15px",backgroundSize:"cover",display:"none"},ref:e=>{this.chevronUp=e},colorClass:"chevronUp"}))),(0,r.tT)("div",null,this.permissionsForm)),(0,a.fZ)(this.element,"appForm"),!this.app.isInstalled&&this.showPermissions&&this.togglePermissionsForm()}togglePermissionsForm(){this.showPermissions&&(this.permissionsForm.style.display="none"===this.permissionsForm.style.display?"block":"none",this.chevronDown.style.display="none"===this.chevronDown.style.display?"block":"none",this.chevronUp.style.display="none"===this.chevronUp.style.display?"block":"none")}initialValue(e,t){var i;return!this.app.isInstalled||(!(!this.app.hasUpdate||"ask"===(null===(i=this.app.installed)||void 0===i?void 0:i.permissions[e].settings)||e in h.EXCLUSIVE_PERMISSIONS&&""!==this.exclusivePermissions[e])||t)}createPermissionsForm(){let e={};if(this.app.isInstalled&&void 0!==this.app.permissionsValues)e=this.app.permissionsValues;else for(const t of Object.keys(h.APP_PERMISSIONS))e[t]=!1;return(0,r.tT)("form",{onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),this.submit())}},(0,r.tT)("ul",null,Object.keys(e).map((t=>{if("ask"===this.app.latest.permissions[t].settings){this.showPermissions=!0;const i=this.initialValue(t,e[t]);return this.renderPermission(t,i)}return""}))))}initExclusivePermissions(){const e=Object.keys(h.EXCLUSIVE_PERMISSIONS);this.exclusivePermissions={};for(const t of e)this.exclusivePermissions[t]="";for(const i of this.exclusiveApps)if(this.app.id!==i.id)for(const s of e){var t;Boolean(null===(t=i.permissionsValues)||void 0===t?void 0:t[s])&&(this.exclusivePermissions[s]=i.name)}}getStatusText(){let e=0;[...this.permissionsForm.elements].forEach((t=>{t.checked&&(e+=1)}));const t=e/this.permissionsForm.elements.length;return 1===t?o.R.allPermissionsText:0===t?o.R.noPermissionsText:o.R.somePermissionsText}exclusiveAppTextElement(e){var t;const i=null===(t=this.exclusivePermissions)||void 0===t?void 0:t[e];let s=h.APP_PERMISSIONS[e].exclusiveText;return this.cbappAppUsed&&""!==s?s=o.R.activeAppOverrideText:e in this.exclusivePermissions&&""!==this.exclusivePermissions[e]&&(s=o.R.usedByText(i)),(0,r.tT)("p",{style:{width:"450px",padding:"0 0 0 25px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},s)}checkboxElement(e,t){const i=new l.m(16,t,this.onChange);return i.setName(e),i.element.style.minWidth="16px",i.element}renderPermission(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!(e in h.APP_PERMISSIONS))return;const s=h.APP_PERMISSIONS[e],n=this.checkboxElement(e,t);return(0,r.tT)("li",{style:{display:"flex",justifyContent:"left",cssFloat:"none",alignItems:"center",borderBottom:"1px solid #E5E5E5",padding:"10px",margin:"0"}},(0,r.tT)("div",{style:{minWidth:"220px",margin:"0 8px 0 0"}},(0,r.tT)("p",{style:{fontSize:"12px",margin:0,padding:0,fontFamily:"ubuntumedium",fontWeight:500}},s.label),(0,r.tT)("p",{style:{fontSize:"10px",margin:0,padding:0},colorClass:"subText"},s.description)),n,i?"":this.exclusiveAppTextElement(e))}updateStatusText(){void 0!==this.permissionsStatus&&(this.permissionsStatus.innerText=this.getStatusText(),[...this.permissionsForm.elements].forEach((e=>{if(!e.checked)return;const t=e.nextSibling;""!==t.innerText&&(t.innerText="")})))}formData(){const e=h.ALL_PERMISSIONS,t={};for(const i of Object.values(e))t[i]=!1;const i=new FormData(this.permissionsForm);for(const s of i.keys())s in e&&(t[e[s]]=!0);return t}modalFormData(e){const t=h.ALL_PERMISSIONS,i={};for(const s of e.elements){const e=s;e.name in t&&(i[t[e.name]]=e.checked)}return i}getFormData(e){let t={};return void 0!==e&&(t=this.modalFormData(e)),{...this.formData(),...t}}getSelectedExclusiveConflicts(){const e=new FormData(this.permissionsForm).keys(),t=[];for(const i of e)i in this.exclusivePermissions&&""!==this.exclusivePermissions[i]&&t.push(i);return t}shouldConfirmModal(){return this.getSelectedExclusiveConflicts().length>0}confirmModalForm(){const e=this.getSelectedExclusiveConflicts();return(0,r.tT)("form",null,(0,r.tT)("ul",null,e.map(((t,i)=>{const s=this.renderPermission(t,!0,!0);return void 0!==s&&e.length===i+1&&(s.style.borderBottom="none"),s}))))}render(){return this.element}}(s=h).EXCLUSIVE_PERMISSIONS={videoPanel:"videoPanel",tipOptions:"tipOptions"},s.ALL_PERMISSIONS={...s.EXCLUSIVE_PERMISSIONS,rewriteMessages:"rewriteMessages"},s.APP_PERMISSIONS={videoPanel:{label:o.R.videoPanelLabel,description:o.R.exclusiveAppPermissionText,exclusiveText:o.R.aspPermissionOverrideText},rewriteMessages:{label:o.R.transformMessagesLabel,description:"",exclusiveText:""},tipOptions:{label:o.R.tipOptionsLabel,description:o.R.exclusiveAppPermissionText,exclusiveText:""}}},7596:(e,t,i)=>{"use strict";i.d(t,{d:()=>d});var s=i(82),n=i(7463),o=i(4947),r=i(1372),a=i(9461),l=i(6064);class h extends s.b{constructor(e){super(e),this.props=e,this.isAnonymous=void 0===a.Bm.current.loggedInUser,this.isMobile=a.Bm.current.isMobile}initData(e){super.initData(e),this.setState({isActive:e.isFollowing})}createElement(e){return this.hideTitle=void 0!==e.hideTitle&&e.hideTitle,(0,r.tT)("div",{bind:{className:()=>`follow_star ${this.getIconClass()}`,title:()=>this.getTitle(),style:()=>this.getStyle()},"data-slug":e.slug,onClick:t=>{this.handleClick(),!0!==e.allowPropagation&&t.stopPropagation(),t.preventDefault()},"data-testid":"follow-star"})}getIconClass(){return void 0===this.state.isActive?"icon_update_following":this.state.isActive?"icon_following":"icon_not_following"}getTitle(){return this.hideTitle||void 0===this.state.isActive?"":this.state.isActive?o.R.unfollowText:o.R.followText}getStyle(){return{}}setHover(){this.element.classList.add("no_hover"),window.setTimeout((()=>{this.element.classList.remove("no_hover")}),3e3)}setFollowing(e){this.setState({isActive:e})}handleClick(){if(this.isAnonymous&&!this.isMobile)return void(0,l.DC)({fromFeature:!0});const e=!0===this.state.isActive;this.setState({isActive:void 0}),this.callFollowApi(!e).then((()=>{this.setState({isActive:!e}),this.setHover()})).catch((()=>{this.setState({isActive:e})}))}}class d extends h{callFollowApi(e){var t;const i=e?(0,n.j4)(this.props.slug,this.isAnonymous):(0,n.QH)(this.props.slug,this.isAnonymous);return null!==(t=null==i?void 0:i.then((e=>e?Promise.resolve():Promise.reject())))&&void 0!==t?t:Promise.reject()}}},9463:(e,t,i)=>{"use strict";i.d(t,{Bq:()=>p,Li:()=>d,M2:()=>m,Mr:()=>w,P$:()=>h,V7:()=>v,XP:()=>f,Y3:()=>y,hD:()=>b,mD:()=>l,mE:()=>g});var s=i(7063),n=i(7623),o=i(6784),r=i(5216),a=i(8423);const l=new a.c_("newFollowedOnline"),h=new a.c_("onlineFollowedStorage"),d=new a.c_("onlineFollowedStorage"),c="onlineFollowedTab",u="followedDropdownClicked";function p(e,t,i,s,o){if(!(0,n.Pf)())return;const r={username:e,onlineFollowedList:t,seenRooms:i,unseenRooms:o,flash:s,timestamp:Date.now()};window.localStorage.setItem(c,JSON.stringify(r))}function m(){if(!(0,n.Pf)())return;const e=window.localStorage.getItem(c);if(null===e)return;const t=JSON.parse(e);for(const e of t.unseenRooms)t.seenRooms[e.room]=!0;t.timestamp=Date.now(),t.flash=!1,t.unseenRooms=[],window.localStorage.setItem(c,JSON.stringify(t))}function g(){(0,n.Pf)()&&window.localStorage.setItem(u,JSON.stringify({timestamp:Date.now()}))}function v(){if(!(0,n.Pf)())return;const e=window.localStorage.getItem(c);if(null===e)return;const t=JSON.parse(e);t.timestamp=Date.now(),window.localStorage.setItem(c,JSON.stringify(t))}function f(){if(!(0,n.Pf)())return;const e=window.localStorage.getItem(c);return null!==e?JSON.parse(e):void 0}function y(){(0,n.Pf)()&&(0,o.wu)("storage",window,(e=>{if(e.key===c){const e=f();void 0!==e&&h.fire(e)}if(e.key===u&&null!==e.newValue){const t=f();void 0!==t&&(t.timestamp=JSON.parse(e.newValue).timestamp,t.flash=!1,t.unseenRooms=[],d.fire(t))}}))}function b(e){const t=e.split(/[()/]+/);return 4!==t.length?{online:0,total:0}:{online:parseInt(t[1]),total:parseInt(t[2])}}function w(){return(0,r.Aw)("follow/api/online_followed_rooms/").then((e=>{if(200!==e.status)return Promise.reject();const t=new s.N6(e.responseText);return{onlineFollowed:{online:t.getNumber("online"),total:t.getNumber("total")},roomList:(i=t.getList("online_rooms"),void 0===i?[]:i.map((e=>({room:e.getString("room"),image:e.getString("image")}))))};var i}))}},8863:(e,t,i)=>{"use strict";i.d(t,{F:()=>v,p:()=>g});var s,n=i(7063),o=i(7623),r=i(5216),a=i(2709),l=i(3955),h=i(8423),d=i(4947),c=i(1372),u=i(1224);const p=()=>(0,c.tT)("img",{src:u.m.logoImageName,style:{maxWidth:"198px"}}),m=e=>{var t;const i=e=>(0,c.tT)("div",{style:{display:"inline-block",verticalAlign:"middle",...e.style}},e.children);return(0,c.tT)("div",{className:"game-search-result",style:{marginTop:"12px",position:"relative"}},(0,c.tT)(i,{style:{paddingRight:"1em"}},(0,c.tT)("img",{src:e.image,style:{borderRadius:"5px",objectFit:"cover",overflow:"hidden"},width:"42px",height:"42px"})),(0,c.tT)(i,null,(0,c.tT)("div",{style:{fontSize:"14px",lineHeight:"22px",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",height:"50%"}},(0,c.tT)("a",{href:"#",onClick:t=>{t.preventDefault(),e.onClick()}},e.name)),(0,c.tT)("div",{style:{fontSize:"12px",lineHeight:"20px",height:"50%"}},"Viewers: ",null!==(t=e.viewers)&&void 0!==t?t:0)),(0,c.tT)(i,{style:{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}},(0,c.tT)("div",{style:{fontSize:"12px",lineHeight:"14px",borderRadius:"4px",cursor:"pointer",display:"inline-block",padding:"7px 8px",marginRight:"18px",userSelect:"none"},className:"selectGameButton","data-testid":"select-game-button",onClick:e.onClick},"Select game")))},g=e=>{const t=document.createElement("p");return t.innerHTML=e.replace(/\s{2,}/gm," "),t.style.width="90%",t};class v extends a.u{constructor(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";super(),this.totalGames=i,this.currentPage=s,this.searchQuery=n,this.OBS_TUTORIAL_URL="https://support.chaturbate.com/hc/en-us/articles/360037971952-How-do-I-set-up-OBS-",this.SEARCH_DELAY=500,(0,l.ZM)(this.element,{position:"relative",width:"unset",height:"unset"}),this.element.appendChild(this.render()),this.searchAPIResults=t,this.renderSearchResults(),this.renderPagination(),null===(e=document.getElementById("search_games_input"))||void 0===e||e.focus(),this.searchTimer=void 0}render(){var e;const t=document.body.classList.contains("darkmode");return(0,c.tT)("div",{className:"GameSelection",ref:e=>{this.displayElement=e}},(0,c.tT)("div",{className:"title"},(0,c.tT)("h1",{style:{color:"#494949",marginBottom:"0px",fontSize:"1.3em",fontWeight:"bolder"},"data-testid":"select-game-header-text"},d.R.selectGameHeaderText),(0,c.tT)("p",{style:{fontSize:"14px",lineHeight:"22px",margin:"12px 0 0"},className:"title"},g(d.R.selectGameSectionText(u.m.sanitizedSiteName,u.m.cbGamesUrl)))),(0,c.tT)("div",null,(0,c.tT)("div",{style:{borderRadius:"4px",display:"inline-block",padding:"5px 8px",verticalAlign:"middle",fontSize:"14px"},className:"searchBar"},(0,c.tT)("input",{id:"search_games_input",type:"text",placeholder:"Search Games",style:{width:"210px",border:"0",outline:"none"},onInput:e=>{this.searchQueryChanged(e)},value:null!==(e=this.searchQuery)&&void 0!==e?e:"",maxLength:50}),(0,c.tT)("label",{for:"search_games_input"},(0,c.tT)("img",{src:`${STATIC_URL_ROOT}images/search${t?"_dm":""}.svg`,width:"12",height:"12",style:{verticalAlign:"middle"}})))),(0,c.tT)("div",{ref:e=>{this.searchResults=e}}),(0,c.tT)("ul",{ref:e=>{this.paginationDOM=e}}))}renderSearchResults(){var e;if(void 0===this.searchAPIResults)return;const t=this.searchAPIResults.length>0?(0,c.tT)("div",null,this.searchAPIResults.map((e=>(0,c.tT)(m,{name:e.name,gameUrl:e.gameUrl,viewers:e.viewers,image:e.image,uid:e.uid,onClick:()=>{window.location.href=(0,r._Y)(encodeURI(`/games/confirm_game/${e.uid}/`))}})))):(0,c.tT)("h3",{style:{fontSize:"14px",color:"#0B5D81"}},"No Results"),i=(0,c.tT)("div",null,t);null===(e=this.displayElement)||void 0===e||e.replaceChild(i,this.searchResults),this.searchResults=i}renderPagination(){var e;let t=Math.floor(this.totalGames/20);this.totalGames%20>0&&(t+=1);const i=""===this.searchQuery?"?":`?q=${this.searchQuery}&`,s=[...(n=t,Array.from({length:n},((e,t)=>t)))].map((e=>{e+=1;const t=this.currentPage===e?"active":"ok";return(0,c.tT)("li",{className:t,style:{margin:"0 2px",display:this.totalGames<=20?"none":""}},(0,c.tT)("a",{href:encodeURI(`${i}p=${e}`)},`${e}`))}));var n;const o=(0,c.tT)("ul",{className:"paging",style:{display:"flex",justifyContent:"center"}},(0,c.tT)("li",{style:{display:1===this.currentPage?"none":"inline-block",cursor:"pointer"}},(0,c.tT)("a",{className:"prev",style:{height:"100%"},href:encodeURI(`${i}p=${this.currentPage-1}`)})),s,(0,c.tT)("li",{style:{display:this.totalGames<20||this.currentPage===t?"none":"inline-block",cursor:"pointer"}},(0,c.tT)("a",{href:encodeURI(`${i}p=${this.currentPage+1}`),className:"next",style:{height:"100%"}})));null===(e=this.displayElement)||void 0===e||e.replaceChild(o,this.paginationDOM),this.paginationDOM=o}searchQueryChanged(e){if(e.stopPropagation(),this.searchQuery=e.target.value,0===this.searchQuery.length||this.searchQuery.length>1){this.currentPage=1,this.scheduleSearch();const e=document.getElementsByTagName("title")[0].innerHTML,t=0===this.searchQuery.length?{}:{q:this.searchQuery},i=0===this.searchQuery.length?`${location.pathname}`:`${location.pathname}?q=${this.searchQuery}`;window.history.replaceState(t,e,(0,r._Y)(i))}}scheduleSearch(){void 0!==this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout((()=>{this.doSearch()}),this.SEARCH_DELAY)}async doSearch(){try{var e;let t=`${v.GAME_QUERY_URL}?q=${encodeURI(this.searchQuery)}`;1!==this.currentPage&&(t+=`&p=${this.currentPage}`);const i=await(0,r.Aw)(t),s=new n.N6(i.responseText);this.totalGames=s.getNumber("total");const a=s.getList("games");this.searchAPIResults=void 0!==a?v.parseSearchResults(a):[],this.renderSearchResults(),this.renderPagination(),null===(e=document.getElementById("search_games_input"))||void 0===e||e.focus(),(0,o.J8)().scrollTop=0,this.searchTimer=void 0}catch(e){this.searchTimer=void 0}}async selectGameAndClose(e){await v.selectGame(e)}static async selectGame(e){let t=!1;try{const i=await(0,r.KF)(v.GAME_SELECT_URL,{uid:e}),s=v.parseSelection(i.responseText);v.selectionChange.fire(s),t=!0}catch(e){}return t}static async deselectGame(){await(0,r.KF)(v.GAME_DESELECT_URL,{}),v.selectionChange.fire(void 0)}static async getCurrentGame(e){const t=await(0,r.Aw)(`${v.GAME_CURRENT_URL}${encodeURI(e)}`);return v.parseSelection(t.responseText)}static parseSearchResults(e){return e.map((e=>{const t=e.getNumberOrUndefined("viewers");return{image:e.getString("image_64x64"),name:e.getString("name"),gameUrl:e.getString("game_url"),uid:e.getString("uid"),viewers:void 0===t?0:t}}))}static parseSelection(e){if(void 0===e)return;const t=JSON.parse(e);return null!==t?{description:t.description,gameUrl:t.game_url,image:t.image_64x64,name:t.name,uid:t.uid,viewers:t.viewers}:void 0}static generateHeader(){let e=(0,c.tT)("a",null),t=(0,c.tT)("div",null);return{headerContainer:(0,c.tT)("div",{className:"OBSInfoSection"},(0,c.tT)("div",null,(0,c.tT)(p,null)),(0,c.tT)("div",{className:"title"},(0,c.tT)("a",{href:"#",style:{display:"none"},ref:t=>{e=t}},(0,c.tT)("p",{style:{fontSize:"24px",lineHeight:"32px",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",margin:"16px 0 10px",color:"#0a5a83"}},"Games")),(0,c.tT)("p",{ref:e=>{t=e},style:{fontSize:"24px",lineHeight:"32px",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",margin:"16px 0 10px",display:"block"}},"Games"))),headerWithPageLink:e,header:t}}}(s=v).GAME_QUERY_URL="api/ts/games/search/",s.GAME_SELECT_URL="api/ts/games/select/",s.GAME_INFO_URL="api/ts/games/info/",s.GAME_DESELECT_URL="api/ts/games/deselect/",s.GAME_CURRENT_URL="api/ts/games/current/room/",s.selectionChange=new h.c_("gameSelectionChanged")},9118:(e,t,i)=>{"use strict";function s(e,t){return t<1?[]:[...Array(t).keys()].map((t=>t+e))}i.d(t,{d:()=>v});var n,o=i(1519),r=i(82),a=i(8423),l=i(1372),h=i(6624),d=i(5216),c=i(2945);function u(e,t,i){var s;i=null!==(s=i)&&void 0!==s?s:"page";let n="",o="";if(void 0!==t){const e=t.split("?");2===e.length?(n=e[0],o=e[1]):e.length<=1&&(n=t)}else n=window.location.pathname,o=window.location.search;const r=(0,c.JO)(o);return r[i]=`${e}`,`${n}?${(0,c.Go)(r)}`}class p extends r.b{createElement(e){return(0,l.tT)("li",null,(0,l.tT)("a",{className:`${e.direction} no-link ${(0,h.isHomepageFiltersActive)()?"hmpg-filt":""}`,"data-testid":`${e.direction}-button`,onClick:e.onClick,href:(0,d._Y)(u(e.page,e.baseUrl,e.pageParam)),ref:e=>{this._anchorElement=e}},(0,h.isHomepageFiltersActive)()?"":e.direction))}toggleDisable(e){e?this._anchorElement.classList.add("no-link"):this._anchorElement.classList.remove("no-link")}isDisabled(){return this.element.classList.contains("no-link")}}class m extends r.b{createElement(e){return(0,l.tT)("li",{className:"page_number_container"},(0,l.tT)("a",{onClick:e.onClick,"data-testid":"page-number-button",href:(0,d._Y)(u(e.page,e.baseUrl,e.pageParam))},e.page))}toggleSelected(e){e?this.element.classList.add("active"):this.element.classList.remove("active")}isSelected(){return this.element.classList.contains("active")}}class g extends r.b{createElement(){return(0,l.tT)("span",{className:"endless_separator","data-testid":"endless-separator"},"...")}setShowHide(e){e?this.showElement():this.hideElement()}}class v extends r.b{constructor(e){var t;if(super(e),this.pageParam=null!==(t=e.pageParam)&&void 0!==t?t:"page",this.setState({currentPage:1,totalItems:0}),!0===e.makeResponsive){const e=new o.a((()=>{this.updateState()}),{bounceLimitMS:250,debounceType:2});window.setTimeout((()=>{null!==this.element.parentElement&&void 0!==window.ResizeObserver&&new ResizeObserver((()=>{e.callFunc()})).observe(this.element.parentElement)}))}}get currentPage(){return this.state.currentPage}set currentPage(e){this.setState({...this.state,currentPage:e})}createElement(e){return this.props=e,this.prevNavigationLink=this.createDirectionalButton("prev",this.state.currentPage-1),this.nextNavigationLink=this.createDirectionalButton("next",this.state.currentPage+1),(0,l.tT)("ul",{className:"paging","data-paction":"PageNumber",bind:{display:()=>this.getDisplay()}},this.prevNavigationLink.element,(0,l.tT)(g,{classRef:e=>{this.previousSpacer=e}}),(0,l.tT)(g,{classRef:e=>{this.nextSpacer=e}}),this.nextNavigationLink.element)}static calculateMaxPages(e,t){return Math.max(Math.ceil(e/t),1)}generatePaginationNumberSequence(){this.maxPages=v.calculateMaxPages(this.state.totalItems,this.props.itemsPerPage),(this.state.currentPage>this.maxPages||this.state.currentPage<1)&&(this.state.currentPage=1);const e=this.getMaxPageNumsFitWithinParentWidth(),t=Math.min(v.MAX_PAGE_NUMBERS_PER_SIDE,Math.floor(e/2)),i=new Set([1,...s(this.currentPage-t,t),this.currentPage,...s(this.currentPage+1,t),this.maxPages]),n=Array.from(i).filter((e=>e>=1&&e<=this.maxPages));return{pageNumbers:n,showPreviousEllipses:n.length>2&&n[0]+1!==n[1],showNextEllipses:n.length>2&&n[n.length-2]+1!==n[n.length-1]}}getMaxPageNumsFitWithinParentWidth(){var e,t;const i=(null!==(e=null===(t=this.element.parentElement)||void 0===t?void 0:t.offsetWidth)&&void 0!==e?e:1e3)-280;return Math.max(0,Math.floor(i/40))}createDirectionalButton(e,t){let i=this.nextNavigationLink,s=this.maxPages;"prev"===e&&(i=this.prevNavigationLink,s=1);const n=new p({direction:e,baseUrl:this.props.baseUrl,onClick:e=>{e instanceof MouseEvent&&(e.ctrlKey||e.metaKey||e.shiftKey)||(this.props.reloadOnPageChange||e.preventDefault(),i.isDisabled()||this.onUserInitiatedPageChange(t))},page:t,pageParam:this.props.pageParam});return n.toggleDisable(this.state.currentPage===s),n}createPageNumber(e,t){const i=(t,i)=>{t instanceof MouseEvent&&(t.ctrlKey||t.metaKey||t.shiftKey)||(this.props.reloadOnPageChange||t.preventDefault(),i.isSelected()||this.onUserInitiatedPageChange(e))},s=new m({baseUrl:this.props.baseUrl,onClick:e=>{i(e,s)},page:e,pageParam:this.props.pageParam});return s.toggleSelected(t),s}rearrangePaginationButtons(e){this.removeAllDOMChildren(),this.addChild(this.createDirectionalButton("prev",this.state.currentPage-1));for(let t=0;t1?"flex":"none"}}(n=v).MAX_PAGE_NUMBERS_PER_SIDE=3,n.pageNumberChanged=new a.c_("pageNumberChanged")},478:(e,t,i)=>{"use strict";i.d(t,{Ni:()=>a,Qc:()=>h,aZ:()=>l});var s=i(2709),n=i(4947),o=i(1372);class r extends s.u{constructor(e){super(),this.config=e,this.clickCallback=e=>{e.stopPropagation(),this.config.onClick()}}}class a extends r{constructor(e){super(e),this.config=e,this.openConversationElement=(0,o.tT)("a",{className:"mobileChatLink msg-link underline-link",style:{textDecoration:"none",cursor:"pointer"}},` (${n.R.openConversationLower})`),this.openConversationElement.onclick=this.clickCallback}}class l extends r{constructor(e){super(e);const t=(0,o.tT)("a",{className:"msg-link underline-link",onClick:this.clickCallback,style:{cursor:"pointer"}},n.R.openConversationLower);this.openConversationElement=(0,o.tT)("span",{style:{fontWeight:"bold",textDecoration:""}}," (",t,")")}}class h extends r{constructor(e){super(e),this.openConversationElement=(0,o.tT)("span",{dangerouslySetInnerHTML:{__html:n.R.newPrivateMessageClickPrompt},onClick:this.clickCallback,style:{fontWeight:"bold",textDecoration:""}})}}},3172:(e,t,i)=>{"use strict";i.d(t,{fY:()=>d,Ew:()=>c,wt:()=>u});var s=i(6784),n=i(2690),o=i(1372),r=i(6318),a=i(9461),l=i(4754),h=i(7660);class d extends n.z{get mediaList(){return this.mediasetProps.mediaList}get currentItem(){return this.mediaList[this.currentIndex]}constructor(){super({onShow:()=>{this.element.classList.add("data-hj-suppress"),this.element.style.display="block",this.repositionChildren()},easyExit:!0}),this.currentIndex=0,r.bs.listen((e=>{this.deleteMedia(e)}),!1),r.C0.listen((e=>{this.deleteMedia(e)}),!1)}static loadMedia(e,t){void 0===d.instance&&(d.instance=new d),d.instance.mediasetProps!==e&&d.instance.init(e),d.instance.displayImage(d.instance.mediaList.indexOf(t))}init(e){var t,i,s,n,r;this.mediasetProps=e,this.mediasetProps.outgoing=null!==(t=this.mediasetProps.outgoing)&&void 0!==t&&t;const l=(null!==(i=null===(s=visualViewport)||void 0===s?void 0:s.height)&&void 0!==i?i:window.innerHeight)>(null!==(n=null===(r=visualViewport)||void 0===r?void 0:r.width)&&void 0!==n?n:window.innerWidth),h=`calc(100% - ${l?72:20}px)`;let c=`calc(100% - ${l?20:72}px)`;this.mediaList.length>1&&(c=`calc(100% - ${a.Bm.current.isMobile?92:180}px)`);for(const e of this.mediaList){if(void 0!==e.imageElement)break;e.imageElement=(0,o.tT)("img",{src:e.url,style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxHeight:h,maxWidth:c},onLoad:()=>{var e;null===(e=d.instance)||void 0===e||e.repositionChildren()}})}this.rebuildUI()}rebuildUI(){this.arrowContainers=void 0,this.mediaList.filter((e=>""!==e.thumbnailUrl)).length>1&&(this.arrowContainers=new l.m((()=>{this.previous()}),(()=>{this.next()})),this.arrowContainers.shiftArrows(a.Bm.current.isMobile?8:25)),this.element=(0,o.tT)("div",{tabIndex:-1,style:{position:"fixed",zIndex:1101,outline:"none",width:"80vw",height:"80vh",top:"50%",left:"50%",transform:"translate(-50%, -50%)",boxSizing:"border-box"},colorClass:"ChatMediaCarousel"},function(e){const t=(0,o.tT)("path",{fill:"#E2E2E2",d:"M11.7255 0.392534C11.6095 0.276307 11.4717 0.184097 11.32 0.121183C11.1684 0.0582692 11.0058 0.0258858 10.8415 0.0258858C10.6773 0.0258858 10.5147 0.0582692 10.363 0.121183C10.2113 0.184097 10.0735 0.276307 9.95753 0.392534L6.23553 4.11453C6.18867 4.16125 6.1252 4.18748 6.05903 4.18748C5.99287 4.18748 5.9294 4.16125 5.88253 4.11453L2.15953 0.392534C2.0448 0.270837 1.90682 0.173402 1.75375 0.106C1.60068 0.0385979 1.43564 0.00259895 1.26841 0.000135597C1.10118 -0.00232775 0.935151 0.0287947 0.780163 0.0916592C0.625176 0.154524 0.484381 0.247852 0.366117 0.366117C0.247852 0.484381 0.154524 0.625176 0.0916592 0.780163C0.0287947 0.935151 -0.00232775 1.10118 0.000135597 1.26841C0.00259895 1.43564 0.0385979 1.60068 0.106 1.75375C0.173402 1.90682 0.270837 2.0448 0.392534 2.15953L4.11453 5.88153C4.13782 5.90476 4.15629 5.93234 4.16889 5.96272C4.18149 5.99309 4.18798 6.02565 4.18798 6.05853C4.18798 6.09142 4.18149 6.12398 4.16889 6.15435C4.15629 6.18472 4.13782 6.21231 4.11453 6.23553L0.392534 9.95953C0.158287 10.1941 0.0267145 10.512 0.0267145 10.8435C0.0267145 11.175 0.158287 11.493 0.392534 11.7275C0.629353 11.9575 0.946449 12.0861 1.27653 12.0861C1.60662 12.0861 1.92371 11.9575 2.16053 11.7275L5.88253 8.00553C5.90567 7.98228 5.93317 7.96383 5.96346 7.95124C5.99375 7.93865 6.02623 7.93217 6.05903 7.93217C6.09184 7.93217 6.12431 7.93865 6.1546 7.95124C6.18489 7.96383 6.2124 7.98228 6.23553 8.00553L9.95953 11.7255C10.1967 11.9548 10.5137 12.0829 10.8435 12.0829C11.1734 12.0829 11.4904 11.9548 11.7275 11.7255C11.9618 11.491 12.0934 11.173 12.0934 10.8415C12.0934 10.51 11.9618 10.1921 11.7275 9.95753L8.00553 6.23553C7.98225 6.21231 7.96378 6.18472 7.95118 6.15435C7.93857 6.12398 7.93209 6.09142 7.93209 6.05853C7.93209 6.02565 7.93857 5.99309 7.95118 5.96272C7.96378 5.93234 7.98225 5.90476 8.00553 5.88153L11.7255 2.15953C11.8416 2.04354 11.9337 1.90581 11.9965 1.75422C12.0593 1.60262 12.0917 1.44013 12.0917 1.27603C12.0917 1.11194 12.0593 0.949446 11.9965 0.797851C11.9337 0.646255 11.8416 0.508526 11.7255 0.392534Z"});return(0,o.tT)("div",{className:"closeButton",style:{position:"absolute",width:"15px",padding:"15px",right:"0px",zIndex:1102,cursor:"pointer"},onMouseEnter:()=>{t.style.fill="#B8B8B8"},onMouseLeave:()=>{t.style.fill="#E2E2E2"},onClick:e},(0,o.tT)("svg",{viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t))}((()=>{this.hide()})),void 0!==this.arrowContainers?this.arrowContainers.leftContainer:void 0,void 0!==this.arrowContainers?this.arrowContainers.rightContainer:void 0),(0,s.wu)("keydown",this.element,(e=>{switch(e.key){case"Left":case"ArrowLeft":this.previous();break;case"Right":case"ArrowRight":this.next();break;case"Esc":case"Escape":this.hide()}}))}clearCurrent(){var e;null===(e=this.currentItem)||void 0===e||null===(e=e.imageElement)||void 0===e||null===(e=e.parentElement)||void 0===e||e.removeChild(this.currentItem.imageElement)}displayImage(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.show(),this.clearCurrent(),this.currentIndex=e,void 0!==this.currentItem&&void 0!==this.currentItem.imageElement&&(this.element.appendChild(this.currentItem.imageElement),this.mediasetProps.outgoing||!1!==this.currentItem.opened||(this.currentItem.opened=!0,(0,r.wy)(this.currentItem.fromUserUID,this.mediasetProps.messageId,this.currentItem.mediaId),h._.markOpened(this.mediasetProps.messageId,this.currentItem.mediaId))),this.repositionChildren()}hide(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];super.hide(e),this.clearCurrent()}deleteMedia(e){const t=this.mediaList.findIndex((t=>t.mediaId===e));var i;-1!==t&&(this.currentIndex===t&&this.hide(),this.mediaList.splice(t,1),this.currentIndex>t&&(this.currentIndex-=1),1===this.mediaList.length&&(null===(i=this.arrowContainers)||void 0===i||i.hideArrows()))}next(){let e=(this.currentIndex+1)%this.mediaList.length;for(;""===this.mediaList[e].thumbnailUrl;)e=(e+1)%this.mediaList.length;this.displayImage(e)}previous(){let e=this.currentIndex>0?this.currentIndex-1:this.mediaList.length-1;for(;""===this.mediaList[e].thumbnailUrl;)e=e>0?e-1:this.mediaList.length-1;this.displayImage(e)}repositionChildren(){var e;null===(e=this.arrowContainers)||void 0===e||e.repositionArrows(this.element.offsetHeight)}}const c=64,u={width:`${c}px`,height:`${c}px`,margin:"0px 1px",display:"inline-block",backgroundSize:"cover",backgroundPosition:"center",position:"relative",cursor:"pointer",borderRadius:"4px",overflow:"hidden",zIndex:0}},1728:(e,t,i)=>{"use strict";i.d(t,{U:()=>B,i:()=>D});var s=i(6844),n=i(2939),o=i(2709),r=i(8423),a=i(7407),l=i(1452),h=i(4947),d=i(1372),c=i(4110),u=i(20),p=i(9447),m=i(9461),g=i(1224),v=i(3885),f=i(4364),y=i(7063),b=i(7623),w=i(3955),C=i(3118),S=i(8785),x=i(7176),T=i(8039),A=i(268);const P="calc(100% - 36px)";class k extends o.u{constructor(e){super("div",e)}initData(e){this.isDropdown=e.isDropdown,this.userColorClass=(0,S.Kb)(e.rawData.otherUser),this.otherUsername=e.rawData.otherUser.username,this.fromUser=e.rawData.fromUsername,this.message=e.rawData.message,this.hasMedia=e.rawData.hasMedia,this.numUnread=e.rawData.numUnread,this.time=e.rawData.time,this.isDropdown=e.isDropdown,this.rawData=e.rawData}getRawData(){return this.rawData}initUI(e){const t={display:"inline-block",left:`${k.CHAT_HEADER_LEFT_PX}px`,position:"absolute",verticalAlign:"bottom",whiteSpace:"nowrap"},i={bottom:"8px",paddingLeft:k.CHAT_HEADER_LEFT_PX-8+"px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:P,boxSizing:"border-box"},s=this.getElapsedTimeString(),n=this.getMessagePreview(),o=this.otherUsername!==this.fromUser;o&&(n.style.maxWidth="calc(100% - 14px)");const r=this.numUnread>0&&(""!==this.message||this.hasMedia);this.numUnreadContainer=(0,d.tT)("span",{"data-testid":"unread-message-count"},r?` (${this.numUnread})`:""),this.elapsedTimeContainer=(0,d.tT)("div",{className:"timeString",style:{fontSize:"10px",position:"absolute",right:"8px",textAlign:"right",top:"8px"},"data-testid":"message-timestamp"},s),this.usernameSpan=this.getUsernameSpan({fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontWeight:"bold",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"bottom"}),this.updateUsernameMaxWidth(),this.element=(0,d.tT)("div",{colorClass:["conversationListItem",r?"unreadBg":""],style:{borderBottomWidth:"1px",borderBottomStyle:"solid",cursor:"pointer",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px",height:"40px",lineHeight:"14px",overflowX:"hidden",padding:"8px",position:"relative",textAlign:"left"},"data-testid":"conversation-list-item",onClick:()=>{e.openConversationEvent.fire(this.otherUsername)}},(0,d.tT)(M,{name:this.otherUsername,style:{marginTop:"-16px",position:"absolute",top:"50%"},color:"",size:"32px",userColorClass:this.userColorClass}),(0,d.tT)("div",{style:t,ref:e=>this.chatHeader=e},this.usernameSpan,this.numUnreadContainer,(0,T.It)()&&!this.isDropdown&&(0,d.tT)(A.i,{classRef:e=>this.inRoomIndicator=e,username:this.otherUsername,style:{verticalAlign:"middle",position:"relative",top:"-1px"}})),this.elapsedTimeContainer,(0,d.tT)("div",{colorClass:"messageDiv",style:i,ref:e=>this.messageDiv=e},o&&""!==this.message?(0,x.sx)("replyIconSvg",{display:"inline-block",verticalAlign:"top"}):"",n))}render(){return this.element}hide(){var e;null===(e=this.parent)||void 0===e||e.removeChild(this),this.element.remove(),this.dispose()}dispose(){var e;null===(e=this.inRoomIndicator)||void 0===e||e.dispose()}repositionChildren(){super.repositionChildren(),this.hideElapsedTimeResponsive()}afterDOMConstructed(){super.afterDOMConstructed(),this.hideElapsedTimeResponsive()}updateTimeContainer(){const e=void 0===this.time||this.isEmptyMessage()?"":(0,y.lI)(new Date(this.time));this.elapsedTimeContainer.innerText=e,this.updateUsernameMaxWidth(),this.updateCloseButtonTop()}updateUsernameMaxWidth(){var e,t;if(!this.isDropdown)return;const i=228-(0,w.q_)(null!==(e=this.elapsedTimeContainer.textContent)&&void 0!==e?e:"",this.elapsedTimeContainer)-(0,w.q_)(null!==(t=this.numUnreadContainer.textContent)&&void 0!==t?t:"",this.numUnreadContainer);this.usernameSpan.style.maxWidth=`${i}px`}getUsernameSpan(e){return(0,d.tT)("span",{colorClass:this.userColorClass,style:e,"data-testid":"conversation-list-username"},this.otherUsername)}addCloseBtn(){this.closeButton=(0,x.fh)();const e=this.closeButton;(0,w.ZM)(e,{position:"absolute",right:"8px"}),e.onclick=e=>{e.stopPropagation(),e.preventDefault(),D(this.otherUsername,this.isDropdown)},(0,b.Xb)()?(e.style.display="block",this.messageDiv.style.width=`calc(${P} - 20px)`):(e.style.display="none",(0,w.JR)(this.element).listen((t=>{t?(e.style.display="block",this.elapsedTimeContainer.style.display="none",this.messageDiv.style.width=`calc(${P} - 20px)`):(e.style.display="none",this.elapsedTimeContainer.style.display="block",this.messageDiv.style.width=P)}))),this.updateCloseButtonTop(),this.element.appendChild(e)}updateCloseButtonTop(){void 0!==this.closeButton&&((0,b.Xb)()&&""!==this.elapsedTimeContainer.textContent?this.closeButton.style.top="50%":this.closeButton.style.top="calc(50% - 8px)")}hideElapsedTimeResponsive(){if(this.element.clientWidth>0){const e=this.chatHeader.clientWidth>this.element.clientWidth-k.CHAT_HEADER_LEFT_PX-8-this.elapsedTimeContainer.clientWidth;this.elapsedTimeContainer.style.visibility=e?"hidden":""}}getOtherUsername(){return this.otherUsername}getNumUnread(){return this.numUnread}setNumUnread(e){this.numUnread=e,0===this.numUnread?(this.numUnreadContainer.innerText="",(0,p.SA)(this.element,"unreadBg")):(this.numUnreadContainer.innerText=` (${this.numUnread})`,(0,p.fZ)(this.element,"unreadBg"))}getUserColorClass(){return this.userColorClass}getMessagePreview(){if(""===this.message&&this.hasMedia)return(0,d.tT)("span",null,h.R.imageAttached);const e=new C.j(this.message),t=e.stringParts()[0],i=(0,d.tT)("span",{style:{maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"inline-block"},"data-testid":"message-preview"},t.split("\n")[0]);for(let t=1;t{const t={width:e.size,height:e.size,borderRadius:"50%",background:e.color,textAlign:"center",display:"table-cell",fontFamily:"UbuntuLight, Tahoma, Arial, Helvetica, sans-serif",fontSize:"16px",lineHeight:"14px",margin:"auto",verticalAlign:"middle"};return(0,d.tT)("div",{colorClass:"avatarBubble",style:{position:"relative",...e.style}},(0,d.tT)("div",{colorClass:e.userColorClass,style:t},e.name.charAt(0).toLocaleUpperCase()))};var R=i(3910),I=i(4564),E=i(1885);const L=new Set;function D(e,t){t||E.wl.fire(e),f.cV.hide(e),L.forEach((i=>{i.isDms===t&&i.hideConversation(e)})),t&&R.x7.fire({username:e})}class B extends o.u{get searchPrefix(){return this.searchBar.value.trim()}constructor(e){super("div",e),this.currentIndex=-1,this.currentConversationColorClass="currentConvo",L.add(this),n.X0.listen((e=>{this.room=e.dossier.room,f.cV.clear(),this.addBroadcasterToTopOfDOM()})).addTo(this.listenerGroup),f.yT.conversationDataChanged.listen((e=>{void 0!==e&&(this.room=e.dossier.room),this.updateList()})).addTo(this.listenerGroup),f.yT.conversationRead.listen((e=>{let{username:t,isDm:i}=e;if(i===this.isDms){const e=this.renderedConversations.find((e=>e.getOtherUsername()===t));void 0!==e&&e.setNumUnread(0)}})),f.yT.conversationItemAdded.listen((e=>{if(this.isDms&&""!==e.room||!this.isDms&&""===e.room)return;f.cV.show(e.fromUsername);const t=!this.isDms&&1===this.renderedConversations.length;0===this.renderedConversations.length||t?this.updateList():(this.removeOldConversation(e.otherUser.username),this.addConversationIfPrefixMatch(e,!0))})),c.E3.listen((e=>{f.cV.show(e.username)})),e.openConversationEvent.listen((()=>{e.clearSearchOnSelect&&(this.currentIndex=-1,this.filterConversations("").catch(l.yZ),this.searchBar.clear())})).addTo(this.listenerGroup),this.startTimeContainerUpdates()}startTimeContainerUpdates(){const e=()=>{for(const e of this.renderedConversations)e.updateTimeContainer();window.setTimeout(e,1e4)};window.setTimeout(e,1e4)}conversationIsRendered(e){return this.renderedConversations.findIndex((t=>t.getRawData().otherUser.username===e))>-1}initData(e){this.isDms=!0===e.isDms,this.isFullVideoMode=e.isFullVideoMode,this.inBroadcast=!0===e.inBroadcast,this.listenerGroup=new r.gt,this.renderedConversations=[],(0,s.ok)()||(this.conversationListData=f.yT.getInstance()),this.openConversationEvent=e.openConversationEvent,this.room="",this.emptyListMessage=(0,d.tT)(U,null)}initUI(e){const t={fontSize:"12px",fontFamily:"UbuntuRegular, Tahoma, Arial, Helvetica, sans-serif",height:"100%",lineHeight:"16px",overflowX:"hidden",overflowY:"hidden",position:"relative",textAlign:"left",width:"100%",zIndex:2,...this.isDms&&{flex:1,display:"flex",flexDirection:"column"}},i={maxHeight:"calc(100% - 32px)",overflowY:"auto",width:"100%",...this.isDms&&{flex:1}};this.conversationBodyRoot=(0,d.tT)("div",{style:i,colorClass:"conversationBodyRoot","data-testid":"conversation-body-root"},(0,d.tT)("div",{className:"loadingDiv",style:{position:"absolute",top:"60px",left:"50%",transform:"translateX(-50%)"}},(0,d.tT)(v.N,null))),this.element=(0,d.tT)("div",{style:t,colorClass:"conversationList"},this.conversationBodyRoot),this.renderSearchBar()}render(){return this.element}repositionChildrenRecursive(){super.repositionChildrenRecursive();for(const e of this.renderedConversations)e.repositionChildrenRecursive()}afterDOMConstructedIncludingChildren(){super.afterDOMConstructedIncludingChildren();for(const e of this.renderedConversations)e.afterDOMConstructedIncludingChildren()}renderSearchBar(){this.searchBar=new I.I({isFullVideoMode:this.isFullVideoMode,room:this.room}),this.searchBar.events.navigateSuggestions.listen((e=>{this.navigateSuggestions(e.event)})).addTo(this.listenerGroup),this.searchBar.events.openCurrentSuggestion.listen((()=>{this.openCurrentSuggestion()})).addTo(this.listenerGroup),this.searchBar.events.inputChange.listen((e=>{e.isFullVideo===this.isFullVideoMode&&(this.currentIndex=-1,e.isValid?this.filterConversations(e.prefix):this.clearConversationListDOM())})).addTo(this.listenerGroup);const e=(0,d.tT)("div",null,this.searchBar.element);this.element.insertBefore(e,this.element.firstChild)}async updateList(){if((0,s.ok)())return;this.clearConversationListDOM();const e=await this.addBroadcasterToTopOfDOM();if(void 0!==this.conversationListData){const t=(this.isDms?this.conversationListData.getDms():this.conversationListData.getPms()).filter((e=>this.conversationMatchesPrefix(e)));this.populateConversationsToDOM(t,e)}}dispose(){this.listenerGroup.removeAll(),this.searchBar.dispose()}clearConversationListDOM(){for(;null!==this.conversationBodyRoot.firstChild;)this.conversationBodyRoot.removeChild(this.conversationBodyRoot.firstChild);this.renderedConversations.forEach((e=>e.dispose())),this.renderedConversations=[]}getRoomUserCount(){return this.conversationBodyRoot.childNodes.length}getLastConversation(){var e;return null===(e=this.conversationListData)||void 0===e?void 0:e.getDms()[0]}shouldAddBroadcaster(e){var t;const i=(null===(t=m.Bm.current.loggedInUser)||void 0===t?void 0:t.username)===this.room;if(""===this.room||i)return!1;const n=void 0===e||this.room.startsWith(e);return!this.isDms&&n&&!this.inBroadcast&&((0,s.ok)()||!i)}async addBroadcasterToTopOfDOM(){const e=this.shouldAddBroadcaster();if(e)if((0,s.ok)()){this.clearConversationListDOM();const e=(0,u.bi)(this.room);this.addConversationIfPrefixMatch(e)}else if(void 0!==this.conversationListData){const t=this.conversationListData.getConversation(this.room);if(void 0===t){const t=await(0,u.ug)(this.room,this.room);return void 0===this.conversationListData.getConversation(this.room)&&(this.clearConversationListDOM(),this.addConversationIfPrefixMatch({message:"",numUnread:t.numUnread,fromUsername:t.user.username,otherUser:t.user,hasMedia:!1})),e}this.clearConversationListDOM(),this.addConversationIfPrefixMatch(t)}return e}shouldSkipPopulating(e,t){return f.cV.have(e.otherUser.username)?!f.cV.isShowing(e.otherUser.username):!(!t||this.room!==e.otherUser.username)}maybeAddEmptyListMessage(){this.isDms&&""===this.searchPrefix&&0===this.renderedConversations.length&&this.conversationBodyRoot.appendChild(this.emptyListMessage)}populateConversationsToDOM(e,t){e.forEach((e=>{this.shouldSkipPopulating(e,t)||(this.addConversationListItemToDOM(e),this.isDms||u.lX.fire(e.otherUser.username))})),this.maybeAddEmptyListMessage()}addConversationListItemToDOM(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.conversationIsRendered(e.otherUser.username))return;const i=(0,d.tT)(k,{rawData:e,openConversationEvent:this.openConversationEvent,isDropdown:this.isDms,classRef:i=>{const s=e.otherUser.username===this.room;this.isDms||s||i.addCloseBtn(),t?this.isDms||s?this.renderedConversations.unshift(i):this.renderedConversations.splice(1,0,i):this.renderedConversations.push(i)}});if(t){var s;const t=this.conversationBodyRoot.firstChild,n=(null===(s=m.Bm.current.loggedInUser)||void 0===s?void 0:s.username)===this.room,o=e.otherUser.username===this.room;this.isDms||o||n||null===t?this.conversationBodyRoot.insertBefore(i,t):this.conversationBodyRoot.insertBefore(i,t.nextSibling)}else this.conversationBodyRoot.appendChild(i);e.otherUser.username===this.currentConversation&&(0,p.fZ)(i,this.currentConversationColorClass),this.repositionChildrenRecursive(),(0,a.bT)("PmListItemAdded",{rendered_pm_count:this.renderedConversations.length,other_user:e.otherUser.username})}hideConversation(e){const t=this.renderedConversations.find((t=>t.getOtherUsername()===e)),i=!this.isDms&&(null==t?void 0:t.getOtherUsername())===this.room;void 0===t||i||(this.renderedConversations.splice(this.renderedConversations.indexOf(t),1),t.hide(),(0,a.bT)("PmListItemRemoved",{rendered_pm_count:this.renderedConversations.length,other_user:e})),this.maybeAddEmptyListMessage()}async filterConversations(e){let t=!1;if(void 0!==this.conversationListData){this.clearConversationListDOM();const i=this.isDms?this.conversationListData.getDms():this.conversationListData.getPms();if(this.shouldAddBroadcaster(e)){let e;const i=this.conversationListData.getConversation(this.room);e=void 0!==i?i:(0,u.bi)(this.room),this.addConversationListItemToDOM(e),t=!0}const s=i.filter((t=>this.conversationMatchesPrefix(t,e)));this.populateConversationsToDOM(s,t)}}conversationMatchesPrefix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.searchPrefix;return 0===t.length||e.otherUser.username.startsWith(t)}addConversationIfPrefixMatch(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;this.conversationMatchesPrefix(e,i)&&this.addConversationListItemToDOM(e,t)}removeOldConversation(e){let t;for(let i=this.renderedConversations.length-1;i>=0;i-=1){const s=this.renderedConversations[i];s.getOtherUsername()===e&&(t=s,this.renderedConversations.splice(i,1),s.element.remove())}return t}navigateSuggestions(e){if(this.unHighlightSelectedIndex(this.currentIndex),"ArrowDown"===e.key||40===e.keyCode?this.currentIndex=this.currentIndex+1>=this.renderedConversations.length?-1:this.currentIndex+1:"ArrowUp"!==e.key&&38!==e.keyCode||(this.currentIndex=this.currentIndex-1<-1?this.renderedConversations.length-1:this.currentIndex-1),this.currentIndex>-1){const e=this.renderedConversations[this.currentIndex].getOtherUsername();this.highlightSelectedIndex(this.currentIndex,!0),this.searchBar.events.suggestionActiveEvent.fire({slug:e})}else this.searchBar.events.suggestionActiveEvent.fire({slug:""})}openCurrentSuggestion(){if(this.currentIndex>-1){const e=this.renderedConversations[this.currentIndex],t=""===this.room?"PMWindow":"PMTab",i=e.getUserColorClass();(0,a.bT)("PMSearchResultClicked",{location:t,color:i}),this.searchBar.events.suggestionActiveEvent.fire({slug:""}),this.openConversationEvent.fire(e.getOtherUsername())}}highlightSelectedIndex(e,t){if(e>-1){const i=this.renderedConversations[e];if(t){const e=this.conversationBodyRoot.clientHeight,t=i.element.clientHeight;this.conversationBodyRoot.scrollTop=this.currentIndex*t-e/2}(0,p.SA)(i.element,"unreadBg"),(0,p.fZ)(i.element,"selected")}}unHighlightSelectedIndex(e){if(e>-1){const t=this.renderedConversations[e];(0,p.SA)(t.element,"selected"),t.getNumUnread()>0?(0,p.fZ)(t.element,"unreadBg"):(0,p.SA)(t.element,"unreadBg")}}setCurrentConversation(e){this.currentConversation=e,this.renderedConversations.forEach((t=>{t.getOtherUsername()===e?(0,p.fZ)(t.element,this.currentConversationColorClass):(0,p.SA)(t.element,this.currentConversationColorClass)}))}focusSearchBar(){this.searchBar.focus()}}const U=()=>(0,d.tT)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",textAlign:"center",lineHeight:"20px",padding:"50px",boxSizing:"border-box"}},(0,d.tT)("img",{src:`${STATIC_URL}pms/empty-chat-state.svg`,style:{margin:"13px",width:"30px"},alt:"empty-chat-state"}),(0,d.tT)("span",{style:{fontFamily:"UbuntuBold, Arial, Helvetica, sans-serif",fontSize:"14px"},colorClass:"sendDmPrompt"},h.R.sendDirectMessage),(0,d.tT)("span",{colorClass:"cautionMessage"},h.R.conversationCautionMessage(g.m.siteName)))},4364:(e,t,i)=>{"use strict";i.d(t,{yT:()=>E,cV:()=>I});var s=i(7063),n=i(5216),o=i(6844),r=i(7437),a=i(2939),l=i(8423),h=i(1452),d=i(2945),c=i(4110),u=i(7623),p=i(8861),m=i(6784),g=i(1519);class v{constructor(){this.queuedPmReads=new Set,this.sendDebouncer=new g.a((()=>{this.sendPost()}),{bounceLimitMS:0,debounceType:1}),(0,m.wu)((0,u.p0)(),window,(()=>this.sendBeacon()))}sendRead(e){this.queuedPmReads.add(e),this.sendDebouncer.callFunc()}getFormData(){if(0===this.queuedPmReads.size)return;this.pmReadsBatch=new Set(this.queuedPmReads),this.queuedPmReads.clear();const e=new FormData;return this.pmReadsBatch.forEach((t=>{e.append("from_usernames",t)})),e.append("csrfmiddlewaretoken",(0,p.I7)("csrftoken")),e}requeueData(){var e;null===(e=this.pmReadsBatch)||void 0===e||e.forEach((e=>this.queuedPmReads.add(e)))}sendPost(){const e=this.getFormData();void 0!==e&&(0,n.KF)(v.endpoint,e).catch((e=>{error("post error marking PMs as read",e),this.requeueData()}))}sendBeacon(){const e=this.getFormData();void 0!==e&&(navigator.sendBeacon((0,n._Y)(v.endpoint),e)||(error("beacon error marking PMs as read"),this.requeueData()))}}v.endpoint="api/ts/chatmessages/update_pms_last_seen/";class f extends v{constructor(){super(),a.X0.listen((e=>{this.room=e.chatConnection.room()})),a.Gr.listen((()=>{this.sendPost()}))}getFormData(){const e=super.getFormData();return void 0!==e&&void 0!==this.room?(e.append("room",this.room),e):void 0}}class y extends v{}let b,w;var C,S=i(20),x=i(6318),T=i(9461),A=i(7477),P=i(897),k=i(3910),M=i(7660),R=i(1885);const I=new class{constructor(){this.showList=new Set,this.hideList=new Set}show(e){this.showList.add(e),this.hideList.delete(e)}hide(e){this.hideList.add(e),this.showList.delete(e)}remove(e){this.showList.delete(e),this.hideList.delete(e)}isShowing(e){return this.showList.has(e)}isHiding(e){return this.hideList.has(e)}have(e){return this.showList.has(e)||this.hideList.has(e)}clear(){this.showList.clear(),this.hideList.clear()}};class E{constructor(){this.pms=new Map,this.dms=new Map,this.room="",this.roomListeners=new l.gt,this.listenToMessagePushTopics(),R.BM.listen((e=>{this.markAsRead(e,!1)})),R.wl.listen((e=>{R.Si.fire(e)})),R.Si.listen((e=>{this.markAsRead(e,!1),T.Bm.current.mergePmDm&&this.markAsRead(e,!0)})),R.ot.listen((e=>{this.markAsRead(e.username,!0),T.Bm.current.mergePmDm&&this.markAsRead(e.username,!1)})),R.H4.listen((e=>{this.handleIncomingMessage(e,!0).catch(h.yZ)})),R.J9.listen((e=>{this.handleIncomingMessage(e,!1).catch(h.yZ)})),a.X0.listen((e=>{var t;this.room=e.dossier.room,this.chatConnection=e.chatConnection,this.pms.clear(),this.removeEmptyDms();for(const e of this.dms.values())e.otherUser.isBroadcaster=e.otherUser.username===this.room;void 0!==E.instance&&E.conversationDataChanged.fire(e),(null===(t=T.Bm.current.loggedInUser)||void 0===t?void 0:t.username)!==this.room&&(0,S.ug)(this.room,this.room).then((e=>{this.addConversation({message:"",numUnread:0,time:Date.now(),fromUsername:this.room,otherUser:e.user,hasMedia:!1,room:this.room})})).catch(h.yZ),this.listenToRoomPushTopics(e.dossier.roomUid)})),a.Gr.listen((()=>{this.roomListeners.removeAll()})),c.E3.listen((e=>{e.focus&&(this.pms.has(e.username)?E.conversationDataChanged.fire(void 0):(0,S.ug)(e.username,this.room).then((e=>{this.addConversation({message:"",numUnread:0,time:Date.now(),fromUsername:this.room,otherUser:e.user,hasMedia:!1,room:this.room})})).catch(h.yZ))})),c.xw.listen((e=>{var t;let i=!1;const s=this.pms.get(e.username);if(void 0!==s&&(s.otherUser.isMod=e.isMod,i=!0),(null===(t=T.Bm.current.loggedInUser)||void 0===t?void 0:t.username)===this.room){const t=this.dms.get(e.username);void 0!==t&&(t.otherUser.isMod=e.isMod,i=!0)}i&&E.conversationDataChanged.fire(void 0)})),E.conversationLoaded.listen((e=>{var t,i;const s=this.getConversation(e.otherUser.username,void 0===e.room||""===e.room),n=""===(null!==(t=null==s?void 0:s.message)&&void 0!==t?t:"")&&!(null!==(i=null==s?void 0:s.hasMedia)&&void 0!==i&&i),o=""===e.message&&!e.hasMedia;n&&!o&&this.addConversation(e)})),this.fetchInitialDms().finally((()=>{k.$o.listen((e=>{void 0===this.getConversation(e,!0)&&(0,S.ug)(e).then((t=>{this.addConversation({message:"",numUnread:0,time:Date.now(),fromUsername:e,otherUser:t.user,hasMedia:!1,room:""})})).catch(h.yZ)}))})).catch(h.yZ)}static getInstance(){return void 0===E.instance&&(E.instance=new E),E.instance}fetchInitialDms(){if(!(0,S.SU)()||(0,o.ok)())return Promise.resolve();const e=(0,d.Go)({offset:"0"});return(0,n.Aw)(`api/ts/chatmessages/pm_users/?${e}`).then((e=>{JSON.parse(e.responseText).reverse().forEach((e=>{const t=(0,S.j4)(new s.N6(e));this.addConversation({...t,room:""})})),E.conversationDataChanged.fire(void 0)})).catch((e=>{error("Error fetching dm conversations",e)}))}getDms(){return Array.from(this.dms.values()).reverse()}getPms(){return Array.from(this.pms.values()).reverse()}async handleIncomingMessage(e,t){const i=this.removeConversation(e.otherUsername,t);let s,n;if(void 0===i){const i=await(0,S.ug)(e.otherUsername,t?void 0:this.room);s=i.user,n=t||T.Bm.current.mergePmDm?i.numUnread:1}else s=i.otherUser,n=i.numUnread+1;e.fromUser.username!==e.otherUsername&&(n=0),this.addConversation({message:e.message,time:Date.now(),numUnread:n,fromUsername:e.fromUser.username,otherUser:s,hasMedia:e.mediaList.length>0,room:t?"":this.room,origMessage:e})}addConversation(e){var t;const i=""===e.room,s=i?this.dms:this.pms;s.delete(e.otherUser.username),s.set(e.otherUser.username,e),E.conversationItemAdded.fire(e),e.fromUsername===(null===(t=T.Bm.current.loggedInUser)||void 0===t?void 0:t.username)&&E.conversationRead.fire({username:e.otherUser.username,isDm:i}),this.updateUnreadCount()}getConversation(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this.dms:this.pms).get(e)}removeConversation(e,t){const i=t?this.dms:this.pms,s=i.get(e);return i.delete(e),s}removeEmptyDms(){var e;const t=null===(e=k.qt.getInstance())||void 0===e?void 0:e.shownWindowUsername();this.dms.forEach(((e,i)=>{""!==e.message||e.hasMedia||i===t||this.dms.delete(i)}))}markAsRead(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=(t?this.dms:this.pms).get(e);void 0!==s&&0!==s.numUnread&&(s.numUnread=0,E.conversationRead.fire({username:e,isDm:t}),this.updateUnreadCount(),i||function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(void 0===w&&(w=new y),w.sendRead(e)):(void 0===b&&(b=new f),b.sendRead(e))}(e,t))}updateUnreadCount(){E.unreadConversationsCountUpdate.fire({dmsCount:[...this.dms.values()].filter((e=>e.numUnread>0)).length,pmsCount:[...this.pms.values()].filter((e=>e.numUnread>0)).length})}isPrivateShowMessage(e){var t,i,s;const n=null!==(t=null===(i=this.chatConnection)||void 0===i?void 0:i.getPrivateShowUser())&&void 0!==t?t:"";return!0===(null===(s=this.chatConnection)||void 0===s?void 0:s.inPrivateRoom())&&(e.otherUsername===n||e.otherUsername===this.room)&&""!==e.room}listenToMessagePushTopics(){var e;const t=null===(e=T.Bm.current.loggedInUser)||void 0===e?void 0:e.userUid;void 0!==t&&(new P.y8(t).onMessage.listen((e=>{if(this.isPrivateShowMessage(e)&&void 0!==this.chatConnection){if(e.otherUsername===this.chatConnection.getPrivateShowUser()||e.otherUsername===this.room){const t={...e,isPrivateShowMessage:!0};(0,r.V8)(t,this.room,e.room)}}else(0,r.V8)(e,this.room,e.room)})),new P.gV(t).onMessage.listen((e=>{M._.markOpened(e.messageId,e.mediaId),this.pms.forEach((t=>{var i;t.hasMedia&&(null===(i=t.origMessage)||void 0===i||i.mediaList.forEach((t=>{t.mediaId===e.mediaId&&(t.opened=!0)})))}))})),new P.vs(t).onMessage.listen((e=>{e.isCompliance?x.C0.fire(e.mediaId):x.bs.fire(e.mediaId)})),new P.IX(t).onMessage.listen((e=>{T.Bm.current.mergePmDm?(this.markAsRead(e.otherUsername,!0,!0),this.markAsRead(e.otherUsername,!1,!0)):void 0===e.room||e.room?this.markAsRead(e.otherUsername,!0,!0):e.room===this.room&&this.markAsRead(e.otherUsername,!1,!0)})))}listenToRoomPushTopics(e){new A.H1(e).onMessage.listen((e=>{var t;let i=!1;const s=this.pms.get(e.fromUser.username);if(void 0!==s&&(s.otherUser.inFanclub=!0,i=!0),(null===(t=T.Bm.current.loggedInUser)||void 0===t?void 0:t.username)===this.room){const t=this.dms.get(e.fromUser.username);void 0!==t&&(t.otherUser.inFanclub=!0,i=!0)}i&&E.conversationDataChanged.fire(void 0)})).addTo(this.roomListeners),new A.HW(e).onMessage.listen((e=>{var t;const i=null===(t=T.Bm.current.loggedInUser)||void 0===t?void 0:t.username;i===this.room?k.x7.fire({username:e.username}):i===e.username&&k.x7.fire({username:this.room})})).addTo(this.roomListeners)}}(C=E).conversationDataChanged=new l.c_("conversationDataChanged"),C.conversationItemAdded=new l.c_("conversationItemAdded"),C.unreadConversationsCountUpdate=new l.c_("unreadConversationsCountUpdate"),C.conversationRead=new l.c_("conversationRead"),C.conversationLoaded=new l.c_("conversationLoaded")},637:(e,t,i)=>{"use strict";i.d(t,{D:()=>y,W:()=>b});var s=i(7623),n=i(5216),o=i(2709),r=i(8423),a=i(4947),l=i(1372),h=i(5389),d=i(9461),c=i(1728),u=i(4364),p=i(2120),m=i(3910),g=i(1585),v=i(1885);const f="changePopoutConvo";class y{static show(e){if(y.showingEvent.fire(),void 0!==this.popout&&!this.popout.closed)if((0,s.OF)())this.popout.close();else if(void 0!==this.popout[f])return this.popout.focus(),void window.setTimeout((()=>{document.hasFocus()?y.openNewPopoutWindow(e):void 0!==this.popout&&void 0!==this.popout[f]&&this.popout[f](e)}),0);y.openNewPopoutWindow(e)}static openNewPopoutWindow(e){let t="/dm/";void 0!==e&&(t+=`${e}/`);const i=(screen.width/2-425).toString(),s=`resizable,dependent,scrollbars,height=768,width=850,top=${(screen.height/2-384).toString()},left=${i}`;(0,h.aH)(t,"dmpopout",s).then((e=>{this.popout=e})).catch((()=>{}))}}y.showingEvent=new r.c_("DmPopoutShowingEvent");class b extends o.u{constructor(e){var t;super("div",e),this.bindListeners(),window[f]=e=>{void 0!==e&&this.showConversation(e)},void 0!==e.username&&e.username!==(null===(t=d.Bm.current.loggedInUser)||void 0===t?void 0:t.username)&&m.$o.fire(e.username)}initData(e){super.initData(e),this.dmList=new c.U({isDms:!0,clearSearchOnSelect:!1,isFullVideoMode:!1,openConversationEvent:m.$o}),this.dmWindowsMap=new Map}initUI(e){super.initUI(e),this.element=(0,l.tT)("div",{style:{display:"flex",justifyContent:"space-between",height:"100%"},colorClass:"DmPopout",className:"fill-view-height"},(0,l.tT)("div",{style:{width:"300px",display:"inline-flex",flexDirection:"column",borderRightStyle:"solid",borderRightWidth:"1px",flexShrink:0},colorClass:"dmListContainer","data-testid":"dm-convo-list"},(0,l.tT)("div",{style:{paddingLeft:"8px",height:"34px",display:"flex",flexDirection:"column",justifyContent:"center",borderBottomWidth:"2px",borderBottomStyle:"solid",fontFamily:"UbuntuRegular, Tahoma, Arial, Helvetica, sans-serif",fontSize:"14px"},colorClass:"header"},(0,l.tT)("span",null,a.R.directMessageLabel,(0,l.tT)("span",{style:{marginLeft:"4px"},ref:e=>this.numUnreadDOM=e,"data-testid":"unread-conversation-count"}))),this.dmList.element),(0,l.tT)("div",{style:{width:"calc(100vw - 301px)",display:"inline-block",flexGrow:1},ref:e=>this.dmWindowContainer=e}))}bindListeners(){v.H4.listen((e=>{var t;null===(t=this.dmWindowsMap.get(e.otherUsername))||void 0===t||t.handleNewMessage(e)})),m.$o.listen((e=>{this.showConversation(e)})),m.x7.listen((e=>{var t;let{username:i,deleteWindow:s}=e;(null===(t=this.currentDmWindow)||void 0===t?void 0:t.username)===i&&this.hideCurrentDmWindow(),!0===s&&this.dmWindowsMap.delete(i)})),u.yT.conversationRead.listen((e=>{let{username:t,isDm:i}=e;if(i){const e=this.dmWindowsMap.get(t);null==e||e.markRead()}})),u.yT.unreadConversationsCountUpdate.listen((e=>{let{dmsCount:t}=e;this.updateNumUnread(t)})),(0,g.L)((e=>this.dmWindowsMap.get(e)))}showConversation(e){var t,i;let s=this.dmWindowsMap.get(e);if(void 0===s)s=new p.H2(e),this.dmWindowsMap.set(e,s);else if(s===this.currentDmWindow)return void s.scrollAndFocus();this.hideCurrentDmWindow(),this.dmWindowContainer.appendChild(s.element),s.setIsShowing(!0),s.openOrCollapseWindow(!0,!0),this.dmList.setCurrentConversation(e),this.currentDmWindow=s,document.title=a.R.directMessagesPageTitle(null!==(t=null===(i=d.Bm.current.loggedInUser)||void 0===i?void 0:i.username)&&void 0!==t?t:"",e),window.history.pushState("","",(0,n._Y)(`/dm/${e}`))}hideCurrentDmWindow(){var e;null===(e=this.currentDmWindow)||void 0===e||e.removeFromDOM(),this.currentDmWindow=void 0}updateNumUnread(e){this.numUnreadDOM.textContent=e>0?`(${e})`:""}}},2394:(e,t,i)=>{"use strict";i.d(t,{O:()=>n,Z:()=>s});const s=new(i(8423).c_)("requestDmInputFocus",{listenersWarningThreshold:1,reportIfNoListeners:!1});function n(e){s.listenerCount()>0?s.fire(e):e instanceof HTMLElement&&e.focus()}},2120:(e,t,i)=>{"use strict";i.d(t,{Jn:()=>ye,sG:()=>be,wV:()=>we,H2:()=>Ce,s2:()=>ve});var s=i(7063),n=i(7623),o=i(6784),r=i(213),a=i(5216),l=i(2939),h=i(2709),d=i(5020),c=i(3955),u=i(8423),p=i(9060),m=i(7463),g=i(7407),v=i(1452),f=i(4947),y=i(1372),b=i(3860),w=i(1474),C=i(9461),S=i(1679),x=i(2394);class T extends h.u{constructor(e,t){super(),this.username=e,this.removeUI=t,this.tokenBalance=0,this.tipAmountChange=()=>{(0,S.Pt)(this.tipInputDOM),this.checkValidTip(),this.isHighTipAmountWarningActive&&this.resetTipButtonText()},this.handleTipKeyPress=e=>{"Enter"===e.code&&(this.sendTipFn(),e.preventDefault())},this.sendTipFn=()=>{if(!(0,S.sI)(this.tipInputDOM.value))return void(0,r.Q$)(f.R.tipAmountInvalid);const e=parseInt(this.tipInputDOM.value);if(C.Bm.current.isNoninteractiveUser)(0,r.Q$)(f.R.internalStaffTip);else if(e>this.tokenBalance)(0,S.qr)(f.R.notEnoughTokensMessage,!1,C.Bm.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE);else{if((0,g.bT)("SendTipClicked",{amount:e,location:"DmWindow"}),e>100&&!this.isHighTipAmountWarningActive)return this.setTipButtonText(f.R.tipConfirmationMessage(e)),this.isHighTipAmountWarningActive=!0,void this.sendTipButtonDOM.focus();(0,w.ae)({roomName:this.username,tipAmount:this.tipInputDOM.value,message:this.tipMessageDOM.value,source:"DM",tipRoomType:"sitewidePMs",tipType:"public",videoMode:b.L.getVideoMode()}).then((t=>{t.success?((0,g.bT)("SendTipSuccess",{amount:e,location:"DmWindow"}),this.hideTipping()):void 0!==t.error?!0===t.showPurchaseLink?(0,S.qr)(t.error):(0,r.Q$)(t.error):(error("unknown send tip error"),(0,r.Q$)(f.R.errorSendingTip)),this.tipMessageDOM.value="",void 0!==t.tipsInPast24Hours&&w.ew.fire({tokens:t.tipsInPast24Hours,roomName:this.username})})).catch((e=>{error(`Error sending tip (${e})`),(0,r.Q$)(f.R.errorSendingTip)})).finally((()=>{this.resetTipButtonText()}))}},this.hideTipping=()=>{this.removeUI()},this.listenerGroup=new u.gt,this.isHighTipAmountWarningActive=!1,this.updateCurrentTipBalance(),w.D.listen((e=>{this.updateTokenBalance(e.tokens)}),!1).addTo(this.listenerGroup)}createOverlay(){const e={display:"block",width:"100%",height:`calc(100% - ${be.headerHeight})`,position:"absolute",bottom:0,left:0,cursor:"pointer"};return this.overlay=(0,y.tT)("div",{style:e,colorClass:"dmWindowTipOverlay",onClick:this.hideTipping}),this.overlay}createUI(){return this.tipInputDOM=(0,S.Gz)("tipInput"),(0,c.ZM)(this.tipInputDOM,{width:"69px",height:"24px",borderWidth:"1px",borderStyle:"solid",boxSizing:"border-box",borderRadius:"4px",marginLeft:"5px"}),(0,o.wu)("input",this.tipInputDOM,this.tipAmountChange),(0,o.wu)("keydown",this.tipInputDOM,this.handleTipKeyPress),(0,o.wu)("pointerdown",this.tipInputDOM,x.O),this.element=(0,y.tT)("div",{colorClass:"dmWindowTipCallout",style:{position:"absolute",bottom:"0px",right:"0px",height:"183px",minWidth:"280px",maxWidth:"100%",fontSize:"12px",zIndex:999},"data-testid":"dm-window-tip-callout"},(0,y.tT)("div",{style:{height:"31px",lineHeight:"31px",borderRadius:"4px 4px 0px 0px",padding:"0 6px"},colorClass:"titleBar"},(0,y.tT)("span",{style:{fontSize:"14px",fontWeight:"bold"}},f.R.sendTipText),(0,y.tT)(ye,{style:{right:"5px",top:"-4px",cursor:"pointer"},clickHandler:this.hideTipping})),(0,y.tT)("div",{style:{padding:"6px",boxSizing:"border-box"}},(0,y.tT)("div",null,(0,y.tT)("span",null,f.R.currentBalanceText),(0,y.tT)("span",{style:{margin:"0 5px",display:"inline-block",width:"90px"},"data-testid":"token-balance",colorClass:"tokenBalance",ref:e=>this.currentBalanceDOM=e}),(0,y.tT)("a",{onClick:()=>{(0,S.di)({source:C.Bm.current.PurchaseEventSources.TOKEN_SOURCE_PRIVATE_MESSAGE_WINDOW})},colorClass:"purchaseLink","data-testid":"purchase-tokens",style:{textDecoration:"underline",cursor:"pointer"},ref:e=>this.getMoreLinkDOM=e},f.R.getMoreLabel)),(0,y.tT)("div",null,(0,y.tT)("span",null,f.R.tipAmountText),this.tipInputDOM,(0,y.tT)("span",{style:{marginLeft:"8px",display:"none"},colorClass:"tokenInputError",ref:e=>{this.wrongTipNoticeDOM=e}},f.R.invalidAmount)),(0,y.tT)("div",null,f.R.TipOptionalMessageLabel),(0,y.tT)("textarea",{style:{width:"100%",height:"32px",borderRadius:"4px",resize:"none",borderWidth:"1px",borderStyle:"solid",margin:"5px 0 0 0",boxSizing:"border-box"},"data-testid":"tip-message-textarea",colorClass:"tipMessage",onPointerDown:x.O,ref:e=>this.tipMessageDOM=e}),(0,y.tT)("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end",marginTop:"5px"}},(0,y.tT)("button",{style:{boxSizing:"border-box",maxWidth:"100%",height:"32px",fontSize:"14px",fontWeight:"bold",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},colorClass:"sendTipButton","data-testid":"send-tip-button",onClick:this.sendTipFn,ref:e=>this.sendTipButtonDOM=e},f.R.sendTipToUser(this.username))))),this.element}dispose(){this.listenerGroup.removeAll()}focus(){(0,x.O)(this.tipInputDOM),this.tipInputDOM.setSelectionRange(0,9999)}setFields(e,t){void 0!==e&&(this.tipInputDOM.value=String(e)),void 0!==t&&(this.tipMessageDOM.value=t),this.checkValidTip(),this.updateCurrentTipBalance()}updateCurrentTipBalance(){(0,w.kb)(this.username).then((e=>{this.tokenBalance=e.tokenBalance,this.currentBalanceDOM.innerText=`${e.tokenBalance} ${f.R.tokenOrTokensText(e.tokenBalance,!1)}`})).catch(v.yZ)}updateTokenBalance(e){this.currentBalanceDOM.innerText=`${e} ${f.R.tokenOrTokensText(e,!1)}`}checkValidTip(){(0,S.sI)(this.tipInputDOM.value)?(this.hideInvalidTipNotice(),this.sendTipButtonDOM.style.cursor="pointer",this.sendTipButtonDOM.disabled=!1):(this.showInvalidTipNotice(),this.sendTipButtonDOM.style.cursor="",this.sendTipButtonDOM.disabled=!0)}showInvalidTipNotice(){this.wrongTipNoticeDOM.style.display=""}hideInvalidTipNotice(){this.wrongTipNoticeDOM.style.display="none"}setTipButtonText(e){this.sendTipButtonDOM.textContent=e,this.sendTipButtonDOM.title=e}resetTipButtonText(){this.setTipButtonText(f.R.sendTipToUser(this.username)),this.isHighTipAmountWarningActive=!1}}class A extends T{constructor(e,t){super(e,t)}createOverlay(){return this.overlay=(0,y.tT)("div",{style:{display:"block",width:"100%",position:"absolute",top:0,right:0,bottom:0,left:0},colorClass:"dmWindowTipOverlay",onClick:this.hideTipping}),this.overlay}createUI(){const e=super.createUI();return(0,c.ZM)(e,{bottom:"",height:"",top:"50%",left:"50%",transform:"translate(-50%, -50%"}),(0,c.ZM)(this.tipInputDOM,{fontSize:"16px",fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif"}),(0,c.ZM)(this.tipMessageDOM,{fontSize:"16px",fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif"}),(0,c.ZM)(this.wrongTipNoticeDOM,{marginLeft:""}),(0,c.ZM)(this.getMoreLinkDOM,{display:"block",textAlign:"right"}),e}showInvalidTipNotice(){this.wrongTipNoticeDOM.style.display="block"}}var P,k=i(7569),M=i(4110),R=i(20),I=i(9447),E=i(3910);class L extends h.u{constructor(e){super("div",e),this.props=e,this.isInputExpanded=!1,this.disableSend=!0,this.disableTip=!0}initData(e){this.listenerGroup=new u.gt,M.n2.listen((e=>{this.emojiButton})).addTo(this.listenerGroup)}initUI(e){const t={position:"absolute",bottom:"0",width:"calc(100% - 4px)",height:this.trueHeight(!1),margin:"0px 2px 3px",boxSizing:"border-box",borderWidth:"1px",borderStyle:"solid",borderRadius:"2px"};this.element=(0,y.tT)("div",{style:t,colorClass:"dmWindowInput"},(0,y.tT)("textarea",{style:{position:"absolute",width:"100%",resize:"none",boxSizing:"border-box",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:"Tahoma, Helvetica, Arial, sans-serif",fontSize:"12px",padding:"8px 0 0 8px"},className:"noScrollbar",placeholder:f.R.sendAMessageDesktop,maxLength:ve,ref:e=>this.inputBar=e,onKeyDown:e=>this.keyDownHandler(e),onInput:()=>this.expandOrCollapseInputBar(),onFocus:e.onFocus,onPointerDown:e=>this.focus(e),"data-testid":"dm-input"}),(0,y.tT)("div",{style:{position:"absolute",bottom:"4px",right:"0px",padding:"2px 6px 0px",margin:"4px 0px"},ref:e=>this.buttonsContainer=e},(0,y.tT)("span",{style:{height:"23px",width:"47px",borderRadius:"4px",fontSize:"12px",lineHeight:"14px",cursor:"pointer",padding:"4px"},colorClass:["sendButton","disabled"],onClick:()=>this.submit(),ref:e=>this.sendDmButton=e,"data-testid":"dm-send-button"},f.R.sendCAPS),(0,y.tT)("span",{style:{height:"23px",width:"47px",borderRadius:"4px",fontSize:"12px",lineHeight:"14px",padding:"4px",cursor:"pointer",marginLeft:"4px",display:"none"},colorClass:["tipButton"],onClick:()=>this.props.showTipping(),ref:e=>this.sendTipButton=e,"data-testid":"dm-tip-button"},f.R.tipCAPS)))}enableSend(){this.disableSend=!1,(0,I.SA)(this.sendDmButton,"disabled")}enableTip(){this.disableTip=!1,this.sendTipButton.style.display=""}focus(e){(0,x.O)(null!=e?e:this.inputBar)}blur(){this.inputBar.blur()}isFocused(){return document.activeElement===this.inputBar}dispose(){this.listenerGroup.removeAll()}submit(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.disableSend)return;if(C.Bm.current.isNoninteractiveUser)return void(0,r.Q$)(f.R.internalStaffMessage);const t=this.inputBar.value.trim();if(this.inputBar.value="",this.expandOrCollapseInputBar(),e&&this.focus(),""===t)return;const i=(0,k.PR)(t,"DM");if(i.messageType===k.gW.TipRequest){const e=i;this.handleTipRequestMessage(e)}else(0,R.F_)({message:t,username:this.props.toUsername,source:"DM"}).catch((e=>{this.props.sendDmFailedCallback(e)}))}handleTipRequestMessage(e){this.disableTip||this.props.showTipping(e.messageData.amount,e.messageData.message)}keyDownHandler(e){switch(e.keyCode){case 76:(e.ctrlKey||e.metaKey)&&(e.preventDefault(),e.stopPropagation(),E.x7.fire({username:this.props.toUsername}));break;case 13:e.shiftKey||(e.preventDefault(),this.submit())}}expandOrCollapseInputBar(){const e=this.buttonsContainer.getBoundingClientRect().x-this.element.getBoundingClientRect().x;(0,c.q_)(this.inputBar.value,this.inputBar)>=e-20||this.inputBar.value.includes("\n")?(()=>{this.isInputExpanded||(this.props.onInputExpand(),this.element.style.height=this.trueHeight(!0),this.isInputExpanded=!0)})():(()=>{this.isInputExpanded&&(this.props.onInputCollapse(),this.element.style.height=this.trueHeight(!1),this.isInputExpanded=!1)})()}render(){return this.element}trueHeight(e){return`calc(${e?L.expandedHeight:L.height} - 3px)`}}(P=L).height="38px",P.expandedHeight="76px";class D extends L{constructor(e){super(e)}initUI(e){this.element=(0,y.tT)("div",{style:{bottom:"1px",width:"100%",height:"33px",borderWidth:"1px",borderStyle:"solid",borderRadius:"2px",boxSizing:"border-box",display:"flex"},colorClass:"dmWindowInput"},(0,y.tT)("textarea",{style:{width:"274px",resize:"none",boxSizing:"border-box",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:"Tahoma, Helvetica, Arial, sans-serif",fontSize:"16px",padding:"6px 0 0 6px"},className:"noScrollbar",placeholder:f.R.sendAMessageDesktop,maxLength:ve,ref:e=>this.inputBar=e,onKeyDown:e=>this.keyDownHandler(e),onInput:()=>this.expandOrCollapseInputBar(),"data-testid":"dm-input"}),(0,y.tT)("div",{style:{padding:"0 3px 3px 3px",display:"flex",alignItems:"flex-end"},ref:e=>this.buttonsContainer=e},(0,y.tT)("span",{style:{borderRadius:"4px",fontSize:"12px",lineHeight:"14px",cursor:"pointer",padding:"4px"},colorClass:["sendButton","disabled"],onClick:()=>this.submit(!1),ref:e=>this.sendDmButton=e,"data-testid":"dm-send-button"},f.R.sendCAPS),(0,y.tT)("span",{style:{borderRadius:"4px",fontSize:"12px",lineHeight:"14px",padding:"4px",cursor:"pointer",marginLeft:"4px",display:"none"},colorClass:["tipButton"],onClick:()=>this.props.showTipping(),ref:e=>this.sendTipButton=e,"data-testid":"dm-tip-button"},f.R.tipCAPS)))}handleTipRequestMessage(e){this.disableTip||this.props.showTipping(e.messageData.amount,e.messageData.message,(0,n.OF)())}}var B=i(4580),U=i(7789),F=i(8936),_=i(8785),N=i(1448),O=i(3417),H=i(897),W=i(1224),$=i(442),V=i(3885),z=i(7596),G=i(4364);class q{constructor(){this.historyDms=new Set,this.newDms=new Set}filterDuplicates(e,t){const i=t?this.historyDms:this.newDms,s=t?this.newDms:this.historyDms;if(void 0===i||void 0===s)return e;if(0===s.size)return e.forEach((e=>i.add(e.messageID))),e;{const t=e.filter((e=>!s.has(e.messageID)));return t.length>0&&(this.historyDms=void 0,this.newDms=void 0),t}}isMessageDuplicate(e,t){return 0===this.filterDuplicates([e],t).length}}var j=i(2359);function Z(e,t,i,s,n){const o={padding:"5px 8px",display:"inline-block",textAlign:"left",maxWidth:"77%",borderRadius:"10px",overflowWrap:"break-word"},r={...o,marginRight:"8px"},a={...o,borderWidth:"1px",borderStyle:"solid",position:"relative"},l={textAlign:t?"right":"left",paddingTop:"2px"},h=t?r:a,d=t?"sent-message":"received-message";return(0,y.tT)("div",{colorClass:i,style:l},(0,y.tT)("div",{colorClass:s,style:h,title:null!=n?n:"","data-testid":d},e))}class K extends h.u{constructor(e){super("div",e),this.timestampThresholdSeconds=3600,this.updateForPrevTimestamp(e.prevTimestamp)}initData(e){super.initData(e),this.dm=e.dm,this.timestamp=e.dm.createdAt}initUI(e){super.initUI(e);const t=e.isMine?"me":"other",i=void 0!==this.dm.createdAt?this.tooltipTimestampString(this.dm.createdAt):"",s=(0,N.bB)(this.dm),n=(0,j.e4)(this.dm.message);n.style.display="block",this.element=(0,y.tT)("div",{style:{marginTop:"1px"}},this.createTimestamp(),""!==this.dm.message&&Z(n,e.isMine,"dmWindowMessage",t,i),s&&Z(s,e.isMine,"dmWindowMessage",t))}showTimestamp(){this.timestampDiv.style.display="block"}updateForPrevTimestamp(e){this.timestampDiv.style.display=this.shouldShowTimestamp(e)?"block":"none"}createTimestamp(){let e="";return void 0!==this.dm.createdAt&&(e=this.timestampString(this.dm.createdAt)),this.timestampDiv=(0,y.tT)("div",{style:{textAlign:"center",display:"none",padding:"8px 0 2px"},colorClass:"timestamp"},e),this.timestampDiv}timestampString(e){return e.toLocaleDateString()===(new Date).toLocaleDateString()?f.R.todayAtTime(e.toLocaleTimeString([],{hour:"numeric",minute:"numeric"})):e.toLocaleDateString()===new Date(Date.now()-864e5).toLocaleDateString()?f.R.yesterdayAtTime(e.toLocaleTimeString([],{hour:"numeric",minute:"numeric"})):e.getFullYear()===(new Date).getFullYear()?e.toLocaleString([],{month:"short",day:"numeric",weekday:"short",hour:"numeric",minute:"numeric"}):e.toLocaleString([],{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"})}tooltipTimestampString(e){return e.toLocaleString([],{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}shouldShowTimestamp(e){return void 0!==this.timestamp&&void 0!==e&&(0,s.gn)(this.timestamp,e)>this.timestampThresholdSeconds}}var J=i(637),Y=i(6844),Q=i(8160),X=i(2396),ee=i(3587),te=i(5173),ie=i(9757);class se extends te.Q{constructor(e){super(),this.props=e,this.tearDown=()=>{var e;this.props.tearDownFunc(),null===(e=this.reactUserNote)||void 0===e||e.dispose()},this.popoutConversation=()=>{this.props.popoutFunc(),this.tearDown()},this.ignoreUser=()=>{this.props.ignoreFunc(),this.tearDown()},this.unignoreUser=()=>{this.props.unignoreFunc(),this.tearDown()},this.reportUser=()=>{void 0!==this.lastReceivedMessage?((0,g.bT)("reportPMUser",{location:"PMWindow"}),this.chatReport=new Q.V(this.props.userInfo.username,this.lastReceivedMessage,this.ignoreUser),this.element.removeChild(this.menuContents),this.element.appendChild(this.chatReport.element),this.chatReport.focusForm(),this.chatReport.closeChatReportRequest.listen((()=>{this.tearDown()}))):error("PMUserContextMenu - reporting with no received message")},this.element=this.createMenuContents(),this.overlayClick.listen((()=>{this.element.style.display="none",this.tearDown()}))}createMenuContents(){var e,t;const i={display:"inline-block",cssFloat:"right",verticalAlign:"top",width:"36px",marginRight:"8px"};(0,X.b)(this.props.userInfo.username).then((e=>{this.menuRightSpan.replaceWith((0,y.tT)("span",{style:i},(0,y.tT)(re,{menuData:e}),(0,y.tT)(ae,{gender:e.gender}))),e.online&&(this.element.insertBefore((0,y.tT)(ne,{imgURL:e.imageUrl}),this.menuContents),this.props.dontRepositionForThumbnail||(this.element.style.top="-75px"))})).catch((e=>{error("Could not process user menu request",{username:this.props.userInfo.username,reason:e.toString()})})),this.ucmDescription=(0,y.tT)(le,{user:this.props.userInfo});const s=this.createUcmLinks(),n=document.createElement("div"),o=ie.c.get("UserNote");this.reactUserNote=new o({username:this.props.userInfo.username,handleInputFocus:x.O,badgeManager:ee.T.getOrCreateInstance(),isNotLoggedIn:Y.rC,removeMenu:this.tearDown},n);const r=null!==(e=null===(t=this.props.usernameLabel)||void 0===t?void 0:t.element)&&void 0!==e?e:(0,y.tT)(oe,{userInfo:this.props.userInfo});return(0,y.tT)("div",{style:{borderWidth:"1px",borderStyle:"solid",borderRadius:"4px",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",cursor:"initial",display:"none",position:"absolute",left:"0px",top:"0",minWidth:"188px",maxWidth:"220px",zIndex:1001},colorClass:"pmUcmContainer",onClick:e=>e.stopPropagation(),"data-testid":"dm-ucm-container"},(0,y.tT)("div",{ref:e=>this.menuContents=e},(0,y.tT)("div",{style:{padding:"9px 0 4px 9px",position:"relative",overflow:"hidden",boxSizing:"border-box"},colorClass:"pmUcmHeader"},r,(0,y.tT)("span",{style:i,ref:e=>this.menuRightSpan=e},(0,y.tT)("span",{colorClass:"placeholder",style:{width:"14px",height:"14px",cssFloat:"left"}}),(0,y.tT)("span",{colorClass:"placeholder",style:{width:"14px",height:"14px",cssFloat:"right"}}))),this.ucmDescription,s,n))}createUcmLinks(){return(0,y.tT)("ul",{style:{borderTopWidth:"1px",borderTopStyle:"solid",listStyle:"none",padding:"5px 0",margin:0},colorClass:"pmUcmLinks"},this.props.includePopoutLink&&(0,y.tT)(he,{iconColorClass:"pmUcmPopoutIcon",innerText:f.R.popoutInNewWindow,clickHandler:this.popoutConversation,newIconStyle:{width:"12px",height:"12px",marginBottom:"1px"},dataid:"dm-popout"}),(0,y.tT)(he,{iconColorClass:"pmUcmIgnoreIcon",innerText:(0,O.pi)(this.props.userInfo.username)?f.R.unignoreThisUserText:f.R.ignoreThisUserText,clickHandler:(0,O.pi)(this.props.userInfo.username)?this.unignoreUser:this.ignoreUser,dataid:"ignore-toggle"}),(0,y.tT)(he,{ref:e=>this.reportLinkItem=e,iconColorClass:"pmUcmReportIcon",innerText:f.R.reportThisUserText,clickHandler:this.reportUser,newLinkItemStyle:void 0!==this.lastReceivedMessage?{}:{display:"none"},dataid:"report-room"}))}setLastReceivedMessage(e){void 0!==e&&(this.lastReceivedMessage=e,this.reportLinkItem.style.display="flex")}render(){return this.element}}const ne=e=>(0,y.tT)("div",{style:{width:"100%",height:"75px",overflow:"hidden",borderRadius:"4px 4px 0px 0px"}},(0,y.tT)("img",{style:{position:"relative",width:"188px",top:"-50%",left:"50%",transform:"translateX(-50%)"},src:e.imgURL,"data-testid":"thumbnail"})),oe=e=>{const t=(0,y.tT)("a",{href:`/${e.userInfo.username}/`,target:"_blank",rel:"noopener noreferrer","data-testid":"username",style:{fontWeight:"bold",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",width:"120px",display:"inline-block",cursor:"pointer"},onClick:t=>{(0,g.bT)("ViewProfile",{username:e.userInfo.username}),t.stopPropagation()}},e.userInfo.username);return t.onmouseenter=()=>{t.style.textDecoration="underline"},t.onmouseleave=()=>{t.style.textDecoration="none"},t},re=e=>{var t;const i={display:"inline-block",width:"15px",minHeight:"14px",fontSize:"12px",fontWeight:"bold",marginRight:"6px",verticalAlign:"top",...e.newAgeStyle};let s="";return!0===(null===(t=e.menuData)||void 0===t?void 0:t.canAccess)&&!isNaN(e.menuData.displayAge)&&e.menuData.displayAge>=18&&(s=e.menuData.displayAge),i.background="",(0,y.tT)("span",{style:i,colorClass:"ageIcon","data-testid":"age"},s)},ae=e=>{const t={display:"inline-block",width:"15px",height:"14px",verticalAlign:"top",...e.newGenderSpanStyle},i={display:"inline-block",width:"14px",height:"14px",...e.newGenderIconStyle};let s=(0,y.tT)("img",null);return void 0!==e.gender&&""!==e.gender&&(s=(0,y.tT)("img",{style:i,src:(0,_.e0)(e.gender),title:f.R.genderSymbolToIconTitle(e.gender),"data-testid":"gender-icon"})),(0,y.tT)("span",{style:t},s)},le=e=>{const t=(0,_.DG)(e.user),i=(0,_.Kb)(e.user),s=(0,_.LD)(e.user);if(void 0!==t){const e={padding:"9px 10px",borderTopWidth:"1px",borderTopStyle:"solid",fontSize:"12px"},n={height:"12px",width:"100%",fontWeight:"bold"},o={height:"10px",fontSize:"10px",marginTop:"4px",WebkitTextSizeAdjust:"none"};let r="";return void 0!==s&&(r=(0,y.tT)("div",{style:o},s)),(0,y.tT)("div",{style:e,colorClass:"pmUcmDescription"},(0,y.tT)("div",{style:n,colorClass:i,"data-testid":"user-label"},t),r)}},he=e=>{const t={display:"flex",padding:"3px 8px 3px 12px",whiteSpace:"nowrap",fontWeight:"normal",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px",WebkitTextSizeAdjust:"none",cursor:"pointer",boxSizing:"border-box",...e.newLinkItemStyle},i={flexShrink:0,padding:"0px 4px 0px 0px",width:"14px",height:"14px",display:"inline-block",marginRight:"4px",marginTop:"2px",...e.newIconStyle};return(0,y.tT)("li",{style:t,onClick:e.clickHandler,colorClass:"pmUcmLinkItem",title:e.innerText},(0,y.tT)("span",{style:i,colorClass:e.iconColorClass}),(0,y.tT)("span",{style:{fontWeight:"normal",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px",overflow:"hidden",textOverflow:"ellipsis",WebkitTextSizeAdjust:"none"},"data-testid":e.dataid},e.innerText))};var de=i(9603);class ce extends h.u{constructor(e){super("div",e)}initUI(e){const t=void 0!==e.divotPosition?e.divotPosition:d.Wi.Bottom;this.element=(0,de.q)({content:e.message,hasHTML:!1,width:"auto",divotPosition:t,divotLeftOrTop:"auto"}),(0,c.ZM)(this.element,{fontFamily:"Tahoma, Arial, Helvetica, sans-serif",lineHeight:"27px",bottom:void 0===e.toolTipBottom?"40px":e.toolTipBottom,right:void 0===e.toolTipRight?"0px":e.toolTipRight,padding:"0px 8px",whiteSpace:"nowrap"});const i=this.element.querySelector(".divot");null!==i&&(0,c.ZM)(i,{right:void 0===e.caretRight?"21px":e.caretRight,bottom:void 0===e.caretBottom?"auto":e.caretBottom})}changeMessage(e){this.element.firstChild&&(this.element.firstChild.textContent=e)}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}render(){return this.element}}var ue,pe=i(1885);class me extends h.u{constructor(e){var t;super("div",e),this.props=e,this.colorClass=null!==(t=e.colorClass)&&void 0!==t?t:"defaultUser",this.applyColor(this.colorClass)}initUI(e){this.element=(0,y.tT)("div",{style:{position:"relative",display:"inline-block",margin:"10px 0 0 8px",width:"calc(100% - 48px)",fontSize:"12px",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontWeight:"bold",lineHeight:"14px"}},(0,y.tT)("a",{style:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"inline-block",cursor:"pointer"},onClick:t=>{t.stopPropagation(),e.clickUsernameFn()},target:"_blank",ref:e=>this.usernameLink=e,"data-testid":"username"},e.username),(0,y.tT)(ge,{classRef:e=>this.numUnreadDisplay=e}))}applyColor(e){(0,I.SA)(this.usernameLink,this.colorClass),this.colorClass=e,(0,I.fZ)(this.usernameLink,e),"inFanclub"===e?void 0===this.icon&&(this.icon=document.createElement("img"),this.icon.src=`${STATIC_URL}badge_star.svg`,this.icon.height=16,this.element.insertBefore(this.icon,this.usernameLink),this.usernameLink.style.position="relative",this.usernameLink.style.marginLeft="5px",this.usernameLink.style.marginBottom="2px",this.usernameLink.style.maxWidth="calc(100% - 24px)"):void 0!==this.icon&&(this.element.removeChild(this.icon),this.icon=void 0,this.usernameLink.style.position="",this.usernameLink.style.marginLeft="",this.usernameLink.style.marginBottom="",this.usernameLink.style.maxWidth="100%")}updateNumUnread(e){this.numUnreadDisplay.updateNum(e)}toggleUnreadDot(e){this.numUnreadDisplay.toggleDot(e)}activateUsernameLink(){this.usernameLink.href=(0,a._Y)(`/${this.props.username}`)}clone(){const e=new me({...this.props,colorClass:this.colorClass});return e.updateNumUnread(this.numUnreadDisplay.getNum()),e.toggleUnreadDot(this.numUnreadDisplay.usingDot()),e}render(){return this.element}}class ge extends h.u{constructor(){super("div")}initUI(){this.element=(0,y.tT)("div",{style:{display:"none"}},(0,y.tT)("div",{className:"numDisplay",style:{position:"relative",display:"none",left:"4px",bottom:"2px",minWidth:"16px",height:"15px",paddingTop:"1px",backgroundColor:"#F47321",color:"#FFFFFF",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",textAlign:"center",borderRadius:"4px",fontWeight:"normal"},ref:e=>this.numDisplay=e}),(0,y.tT)("img",{src:`${STATIC_URL}orange_dot.svg`,style:{position:"relative",top:"-8px",marginLeft:"4px",display:"none"},ref:e=>this.dot=e}))}updateNum(e){this.numUnread=e,e>0?(this.element.style.display="inline-block",this.numDisplay.textContent=e>9?"9+":`${e}`,this.numDisplay.style.width=`${(0,c.q_)(this.numDisplay.textContent,this.numDisplay)+4}px`):this.element.style.display="none"}getNum(){return this.numUnread}toggleDot(e){e?(this.numDisplay.style.display="none",this.dot.style.display=""):(this.numDisplay.style.display="",this.dot.style.display="none")}usingDot(){return""===this.dot.style.display}render(){return this.element}}const ve=4096,fe=e=>(0,y.tT)("div",{style:{position:"absolute",height:"25px",width:"25px",borderRadius:"5px",top:"5px",...e.style},onMouseEnter:()=>e.parentDiv&&(0,I.fZ)(e.parentDiv,"noHighlight"),onMouseLeave:()=>e.parentDiv&&(0,I.SA)(e.parentDiv,"noHighlight"),colorClass:"button",onClick:e.clickHandler,"data-testid":e.testID},e.children),ye=e=>(0,y.tT)(fe,{parentDiv:e.parentDiv,style:e.style,clickHandler:t=>{t.stopPropagation(),e.clickHandler()},testID:"close"},(0,y.tT)("img",{src:`${STATIC_URL}close-gray.svg`,height:"13px",width:"13px",style:{position:"relative",height:"13px",width:"13px",left:"6px",top:"7px"}}));class be extends h.u{constructor(e){var t;super(),this.fetchFailed=!1,this.isShowing=!0,this.fetched=!1,this.isAllHistoryLoaded=!1,this.dmDuplicateChecker=new q,this.removeMenu=()=>{void 0!==this.menu&&(this.element.removeChild(this.menu.overlay),this.element.removeChild(this.menu.element),this.unHighlightHeader(),this.menu=void 0)},this.popoutConvo=()=>{J.D.show(this.username),this.openOrCollapseWindow(!1)},this.ignoreUser=()=>{const e=()=>this.appendRoomNotice(this.createLogMessage(f.R.errorIgnoringUser(this.username)));(0,O.Bq)(this.username).then((t=>!t&&e())).catch(e)},this.unignoreUser=()=>{const e=()=>this.appendRoomNotice(this.createLogMessage(f.R.errorUnignoringUser(this.username)));(0,O.Kw)(this.username).then((t=>!t&&e())).catch(e)},this.username=e.username,this.myUsername=e.myUsername,this.raiseWindowZIndexToTop=e.raiseWindowZIndexToTop,this.listenerGroup=new u.gt,this.initTippingUI(),this.constructElement(),this.openOrCollapseWindow(e.open,e.markAsRead,!0);const i=null===(t=C.Bm.current.loggedInUser)||void 0===t?void 0:t.userUid;if(void 0!==i){const e=new H.y8(i);e.isSubscribed()?this.enableSend():e.onSubscribeChange.listen((e=>{e.subscribed&&this.enableSend()})).addTo(this.listenerGroup)}(0,R.ug)(this.username).then((t=>{let{sitewideUser:i,canPm:s,canTip:n}=t;this.userInfo=i,this.colorClass=(0,_.Kb)(i),this.canSendDm=s,n&&this.enableTip(),this.usernameLabel.applyColor(this.colorClass),this.fetchConversation(e.markAsRead),l.X0.listen((e=>{this.userInfo.isBroadcaster=this.username===e.dossier.room,this.colorClass=(0,_.Kb)(this.userInfo),this.usernameLabel.applyColor(this.colorClass)}))})).catch((e=>{const t=new s.N6(e.xhr.responseText).getStringOrUndefined("error");void 0!==t?(0,r.Q$)(t):(0,r.Q$)(f.R.errorLoadingDms(this.username)),E.x7.fire({username:this.username,deleteWindow:!0})}))}constructElement(){this.createHeaderBar(),this.createChatDiv(),this.createFollowStar();const e={cssFloat:"right",position:"relative",marginRight:"7px",borderRadius:"4px 4px 0px 0px",width:"280px",height:be.expandedHeight};this.element=(0,y.tT)("div",{colorClass:"dmWindow",style:e},this.headerBar,this.chatDiv)}createHeaderBar(){const e={position:"relative",height:be.headerHeight,borderRadius:"4px 4px 0px 0px",borderBottomWidth:"2px",borderBottomStyle:"solid",cursor:"pointer"};this.headerBar=(0,y.tT)("div",{style:e,colorClass:"dmWindowHeader",onMouseEnter:()=>{this.highlightHeader()},onMouseLeave:()=>{this.unHighlightHeader()},onClick:()=>this.openOrCollapseWindow(!this.isOpen)}),this.usernameLabel=new me({username:this.username,colorClass:this.colorClass,clickUsernameFn:()=>this.showUCM()}),this.headerBar.appendChild(this.usernameLabel.element);const t=(0,y.tT)(ye,{parentDiv:this.headerBar,style:{right:"5px"},"data-testid":"dm-close-button",clickHandler:()=>E.x7.fire({username:this.username})});this.closeToolTip=new ce({message:f.R.dmCloseTabShortcut}),(0,o.wu)("mouseenter",t,(()=>{var e;null===(e=this.closeToolTip)||void 0===e||e.show()})),(0,o.wu)("mouseleave",t,(()=>{var e;null===(e=this.closeToolTip)||void 0===e||e.hide()})),t.appendChild(this.closeToolTip.element),this.headerBar.appendChild(t)}initTippingUI(){this.tippingUI=new T(this.username,(()=>this.hideTipping())),this.tippingWindow=this.tippingUI.createUI(),this.tippingOverlay=this.tippingUI.createOverlay()}enableSend(){this.input.enableSend()}enableTip(){this.input.enableTip()}changeWindowZIndex(e){this.element.style.zIndex=`${e}`}onIgnoreUnignore(e){e?this.appendRoomNotice(this.createLogMessage(f.R.ignoringUser(this.username))):this.appendRoomNotice(this.createLogMessage(f.R.noLongerIgnoring(this.username)))}showUCM(){if(this.isOpen){if(void 0===this.menu){const e=this.usernameLabel.clone();e.activateUsernameLink(),e.element.style.margin="0",this.menu=new se({currentUsername:this.myUsername,userInfo:this.userInfo,usernameLabel:e,tearDownFunc:this.removeMenu,popoutFunc:this.popoutConvo,ignoreFunc:this.ignoreUser,unignoreFunc:this.unignoreUser,includePopoutLink:!(this instanceof Ce),dontRepositionForThumbnail:this instanceof Ce}),this.element.appendChild(this.menu.overlay),this.element.appendChild(this.menu.element)}this.menu.setLastReceivedMessage(this.lastReceivedMessage),this.raiseWindowZIndexToTop(this.username),"none"===this.menu.element.style.display&&(this.menu.element.style.display="block",this.menu.showOverlay(),(0,g.bT)("DmMenuClicked",{location:"DmWindow"}))}else this.openOrCollapseWindow(!0)}showTipping(e,t,i){this.tippingUI.setFields(e,t),this.element.appendChild(this.tippingOverlay),this.element.appendChild(this.tippingWindow),!0===i?window.setTimeout((()=>{this.tippingUI.focus()}),990):this.tippingUI.focus(),(0,g.bT)("SendTipViewed",{location:"DmWindow",tipType:"public",localStorage:(0,n.Pf)()})}hideTipping(){var e,t;null===(e=this.tippingOverlay.parentElement)||void 0===e||e.removeChild(this.tippingOverlay),null===(t=this.tippingWindow.parentElement)||void 0===t||t.removeChild(this.tippingWindow)}onTip(e){const t=e.fromUser.username===this.myUsername;let i;i=t?f.R.sentTipDmNotice(e.amount):e.message.length>0?f.R.receivedTipDmNoticeWithMessage(this.username,e.amount,e.message):f.R.receivedTipDmNotice(this.username,e.amount);const s=this.createLogMessage(i,t?2:1,"tipNotice");(0,c.ZM)(s,{fontWeight:"bold"}),this.appendRoomNotice(s)}getNumUnread(){var e;return null!==(e=this.numUnread)&&void 0!==e?e:0}createChatDiv(){const e={height:`calc(100% - ${be.headerHeight})`,position:"relative",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px"},t={position:"relative",height:`calc(100% - ${L.height})`,paddingBottom:"8px",boxSizing:"border-box",overflowY:"auto"};let i,s;(0,p.QC)()&&(this.newMessageNotice=(0,N.rc)(),b.L.changeVideoMode.listen((()=>{this.newMessageNotice.remove(),this.scrollToBottom()}))),this.chatDiv=(0,y.tT)("div",{style:e,ref:e=>{this.chatDiv=e}},(0,y.tT)("div",{style:t,onScroll:()=>{this.handleChatDivScroll()},onMouseDown:e=>{i=e.pageX,s=e.pageY},onMouseUp:e=>{const t=e.pageX-i,n=e.pageY-s;Math.sqrt(t*t+n*n)<2&&this.input.focus()},ref:e=>this.messageDiv=e},(0,y.tT)("div",{style:{width:"100%",boxSizing:"border-box",padding:"0px 4px"},ref:e=>this.messageList=e},this.createLogMessage(f.R.privateConversationWithText(this.username)),this.createLogMessage(f.R.conversationCautionMessage(W.m.siteName)),(0,y.tT)("div",{ref:e=>this.messageHistoryDiv=e},(0,y.tT)("div",{style:{marginTop:"44px"},ref:e=>this.loadingDiv=e},(0,y.tT)(V.N,{extraStyle:{margin:"auto"}}))))),(0,y.tT)(L,{classRef:e=>this.input=e,toUsername:this.username,onInputExpand:()=>this.onInputExpand(),onInputCollapse:()=>this.onInputCollapse(),showTipping:(e,t)=>this.showTipping(e,t),sendDmFailedCallback:e=>{this.appendRoomNotice(this.createLogMessage(e.errorMessage))},onFocus:()=>this.onInputFocus()}),(0,p.QC)()&&(0,y.tT)($.w,{scrollToBottom:()=>this.scrollToBottom(),bottomStyle:`calc(${L.height} + 4px)`,classRef:e=>this.scrollDownButton=e}))}handleChatDivScroll(){var e,t,i;0!==this.messageDiv.scrollTop||this.isAllHistoryLoaded||this.fetchConversation(!0,this.earliestMessageId),this.isScrolledUp(0)||this.fireDmsRead(),this.isScrolledUp(20)?null===(e=this.scrollDownButton)||void 0===e||e.showElement():(null===(t=this.scrollDownButton)||void 0===t||t.hideElement(),null===(i=this.scrollDownButton)||void 0===i||i.clearUnread())}createFollowStar(){(0,m.wF)(this.username).then((e=>{this.followProhibited=!e,(0,a.Aw)(`follow/is_following/${this.username}/`).then((t=>{const i=JSON.parse(t.responseText).following;(e||i)&&this.constructFollowStarUI(i)})).catch(v.yZ)})).catch(v.yZ)}constructFollowStarUI(e){this.followButton=(0,y.tT)(fe,{parentDiv:this.headerBar,testID:"dm-follow-button",style:{right:"30px"},clickHandler:()=>{}}),this.followStar=new z.d({slug:this.username,isFollowing:e,hideTitle:!0}),(0,c.ZM)(this.followStar,{height:"20px",width:"20px",backgroundSize:"20px 20px",backgroundPosition:"center",padding:"2px 3px",margin:"0px"}),this.constructFollowToolTip(e),(0,o.wu)("mouseenter",this.followButton,(()=>{var e;this.followStar.isShown()&&(null===(e=this.followToolTip)||void 0===e||e.show())})),(0,o.wu)("mouseleave",this.followButton,(()=>{var e;null===(e=this.followToolTip)||void 0===e||e.hide()})),this.followButton.appendChild(this.followStar.element),void 0!==this.followToolTip&&this.followButton.appendChild(this.followToolTip.element),this.headerBar.appendChild(this.followButton)}constructFollowToolTip(e){this.followToolTip=new ce({message:e?f.R.unfollowText:f.R.followText})}followUnfollow(e){var t;this.followStar.setFollowing(e),null===(t=this.followToolTip)||void 0===t||t.changeMessage(e?f.R.unfollowText:f.R.followText),this.followProhibited&&!e&&(this.followButton.style.display="none")}getUserInfo(){return this.userInfo}setUserInfo(e){this.userInfo={...this.userInfo,...e},this.usernameLabel.applyColor((0,_.Kb)(this.userInfo))}openWindow(e){var t;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.chatDiv.style.display="block",(0,I.SA)(this.element,"collapsed"),this.element.style.bottom=be.expandedHeight,this.element.style.height=be.expandedHeight,null===(t=this.closeToolTip)||void 0===t||t.changeMessage(f.R.dmCloseTabShortcut),this.usernameLabel.toggleUnreadDot(!0),e&&(i||this.scrollAndFocus(),this.fireDmsRead()),void 0!==this.followButton&&(this.followButton.style.display="block")}collapseWindow(){var e;this.chatDiv.style.display="none",(0,I.fZ)(this.element,"collapsed"),this.element.style.bottom="36px",this.element.style.height="36px",null===(e=this.closeToolTip)||void 0===e||e.changeMessage(f.R.dmCloseTab),this.usernameLabel.toggleUnreadDot(!1),this.getNumUnread()>0&&this.usernameLabel.updateNumUnread(this.getNumUnread()),void 0!==this.followButton&&(this.followButton.style.display="none"),this.hideTipping()}openOrCollapseWindow(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.isOpen=e,e?this.openWindow(t,i):this.collapseWindow();const s={username:this.username,isOpen:e};E.oB.fire(s),E.c9.fire(void 0)}setIsShowing(e){this.isShowing=e,e&&this.fetchFailed&&this.fetchConversation(!0)}removeFromDOM(){var e;null===(e=this.closeToolTip)||void 0===e||e.hide(),this.hideTipping(),this.element.remove(),this.setIsShowing(!1)}isWindowOpen(){return this.isOpen}isInputFocused(){return this.input.isFocused()}blurInput(){this.input.blur()}isScrolledUp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40;return this.messageList.offsetHeight-(this.messageDiv.scrollTop+this.messageDiv.offsetHeight)>e}scrollToBottom(){this.messageDiv.scrollTop=this.messageList.offsetHeight}handleImageLoadScrolling(e){this.isScrolledUp()||e.querySelectorAll("img").forEach((e=>{const t=e.src;e.src="",e.onload=()=>this.scrollToBottom(),e.src=t}))}scrollAndFocus(){this.scrollToBottom(),document.activeElement!==this.input.element&&this.input.focus()}onInputFocus(){this.isScrolledUp()||this.fireDmsRead()}onInputExpand(){const e=this.isScrolledUp();this.messageDiv.style.height=`calc(100% - ${L.expandedHeight})`,e||this.scrollToBottom()}onInputCollapse(){this.messageDiv.style.height=`calc(100% - ${L.height})`}fetchConversation(e,t){(0,R.cb)(this.username,t).then((i=>{const s=i.messages;if(s.length0)if(this.earliestMessageId=s[0].messageID,void 0===this.lastReceivedMessage&&(this.lastReceivedMessage=[...s].reverse().find((e=>e.fromUser.username===this.username))),void 0===this.latestTimestamp&&(this.latestTimestamp=s[s.length-1].createdAt),void 0===t){const e=this.dmDuplicateChecker.filterDuplicates(s,!0);this.addPreviousBatch(e),this.maybeAddCanDmNotice(),this.scrollToBottom(),this.handleImageLoadScrolling(this.messageHistoryDiv)}else this.addPreviousBatch(s);else void 0===t&&this.maybeAddCanDmNotice();this.maybeUpdateConversationListItem(s)})).catch((()=>{this.appendRoomNotice(this.createLogMessage(f.R.errorLoadingConversationHistory)),this.loadingDiv.remove(),this.fetchFailed=!0}))}maybeUpdateConversationListItem(e){var t,i;if(0===e.length)return;const s=e[e.length-1];G.yT.conversationLoaded.fire({message:s.message,numUnread:null!==(t=this.numUnread)&&void 0!==t?t:0,time:null===(i=this.latestTimestamp)||void 0===i?void 0:i.getTime(),fromUsername:s.fromUser.username,otherUser:this.userInfo,hasMedia:s.mediaList.length>0,room:""})}addPreviousBatch(e){if(0===e.length)return;const t=(0,y.tT)("div",null);let i,s;void 0!==this.oldestMessage&&this.oldestMessage.updateForPrevTimestamp(e[e.length-1].createdAt),e.forEach(((e,n)=>{const o=e.fromUser.username===this.myUsername;i=new K({dm:e,isMine:o,prevTimestamp:s}),t.appendChild(i.element),s=e.createdAt,0===n&&(i.showTimestamp(),this.oldestMessage=i)})),this.messageHistoryDiv.insertBefore(t,this.messageHistoryDiv.firstChild),this.messageDiv.scrollTop=t.offsetHeight}createLogMessage(e){let t=arguments.length>2?arguments[2]:void 0;switch(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0){case 0:const i={maxWidth:"271px",textAlign:"center",fontSize:"11px",lineHeight:"12px",padding:"4px",margin:"auto"};return(0,y.tT)("div",{style:i,colorClass:"logMessage"},e);case 2:return Z(e,!0,"logMessage",t);case 1:return Z(e,!1,"logMessage",t)}}appendRoomNotice(e){this.appendMessageListChild(e),this.scrollToBottom()}addMessageToEnd(e){const t=e.fromUser.username===this.myUsername;t||(this.lastReceivedMessage=e);const i=new K({dm:e,isMine:t,prevTimestamp:this.latestTimestamp});this.handleImageLoadScrolling(i.element),this.appendMessageListChild(i.element),this.latestTimestamp=e.createdAt,void 0===this.oldestMessage&&(i.showTimestamp(),this.oldestMessage=i)}maybeAppendNewMessageNotice(){var e;(0,p.QC)()&&this.isScrolledUp()&&1===(null===(e=this.scrollDownButton)||void 0===e?void 0:e.getUnreadCount())&&((0,c.Mo)(this.newMessageNotice,this.messageList)||this.messageList.appendChild(this.newMessageNotice))}appendMessageListChild(e){var t;this.isScrolledUp(20)&&(null===(t=this.scrollDownButton)||void 0===t||t.incUnread()),this.maybeAppendNewMessageNotice(),this.messageList.appendChild(e)}maybeAddCanDmNotice(){if(!this.canSendDm){var e;const t=!0===(null===(e=C.Bm.current.loggedInUser)||void 0===e?void 0:e.isAgeVerified)?f.R.dmSupporterNoticeAgeVerified:f.R.dmSupporterNotice;this.appendRoomNotice(this.createLogMessage(t))}}handleNewMessage(e){if(this.dmDuplicateChecker.isMessageDuplicate(e,!1))return;const t=e.fromUser.username===this.myUsername,i=t?0:this.getNumUnread()+1,s=this.isScrolledUp();this.addMessageToEnd(e),!t&&s||this.scrollToBottom(),t||this.setNumUnread(i),this.isOpen&&this.isShowing&&!s&&this.fireDmsRead()}setNumUnread(e){0!==e?(this.numUnread=e,this.usernameLabel.updateNumUnread(e)):this.fireDmsRead()}fireDmsRead(){0!==this.getNumUnread()&&document.hasFocus()&&(this.markRead(),pe.ot.fire({username:this.username}))}markRead(){0!==this.getNumUnread()&&(this.numUnread=0,this.usernameLabel.updateNumUnread(0))}highlightHeader(){(0,I.fZ)(this.headerBar,"highlight")}unHighlightHeader(){(0,I.SA)(this.headerBar,"highlight")}highlightHeaderForShow(){(0,I.fZ)(this.headerBar,"loadedHighlight"),window.clearTimeout(this.loadedHighlightTimeout),this.loadedHighlightTimeout=window.setTimeout((()=>(0,I.SA)(this.headerBar,"loadedHighlight")),4e3)}}(ue=be).headerHeight="34px",ue.expandedHeight="260px";class we extends be{constructor(e){super(e),"ResizeObserver"in window&&new ResizeObserver((()=>this.onResize())).observe(this.messageDiv)}constructElement(){this.createHeaderBar(),this.createChatDiv(),this.createFollowStar(),this.element=(0,y.tT)("div",{colorClass:"dmWindow",style:{boxShadow:"none",display:"flex",flexDirection:"column",flex:1,height:"1px"}},this.headerBar,this.chatDiv,(0,y.tT)(D,{classRef:e=>this.input=e,toUsername:this.username,onInputExpand:()=>{},onInputCollapse:()=>{},showTipping:(e,t,i)=>this.showTipping(e,t,i),sendDmFailedCallback:e=>{this.appendRoomNotice(this.createLogMessage(e.errorMessage))},onFocus:()=>this.onInputFocus()}))}createHeaderBar(){this.headerBar=(0,y.tT)("div",{style:{position:"relative",height:"34px",borderRadius:"4px 4px 0px 0px",borderBottomWidth:"1px",borderBottomStyle:"solid"},colorClass:"dmWindowHeader"}),this.usernameLabel=new me({username:this.username,colorClass:this.colorClass,clickUsernameFn:()=>this.showUserPanel()}),this.headerBar.appendChild(this.usernameLabel.element)}createChatDiv(){this.chatDiv=(0,y.tT)("div",{style:{fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:"12px",flex:1,height:"1px",display:"flex"},ref:e=>{this.chatDiv=e}},(0,y.tT)("div",{style:{width:"100%",height:"100%",overflowY:"auto"},onScroll:()=>{this.handleChatDivScroll()},ref:e=>this.messageDiv=e},(0,y.tT)("div",{style:{width:"100%",boxSizing:"border-box",padding:"4px 4px 8px 4px"},ref:e=>this.messageList=e},this.createLogMessage(f.R.privateConversationWithText(this.username)),this.createLogMessage(f.R.conversationCautionMessage(W.m.siteName)),(0,y.tT)("div",{ref:e=>this.messageHistoryDiv=e},(0,y.tT)("div",{style:{marginTop:"44px"},ref:e=>this.loadingDiv=e},(0,y.tT)(V.N,{extraStyle:{margin:"auto"}})))),(0,p.QC)()&&(0,y.tT)($.w,{scrollToBottom:()=>this.scrollToBottom(),bottomStyle:`calc(${L.height} + 4px)`,classRef:e=>this.scrollDownButton=e})))}initTippingUI(){this.tippingUI=new A(this.username,(()=>this.hideTipping())),this.tippingWindow=this.tippingUI.createUI(),this.tippingOverlay=this.tippingUI.createOverlay()}constructFollowStarUI(e){this.followStar=new z.d({slug:this.username,isFollowing:e}),(0,c.ZM)(this.followStar,{height:"20px",width:"20px",backgroundSize:"20px 20px",backgroundPosition:"center",padding:"2px 3px",margin:"0px"}),this.followButton=(0,y.tT)(fe,{style:{right:"8px"},clickHandler:()=>{}}),this.followButton.appendChild(this.followStar.element),this.headerBar.appendChild(this.followButton)}openOrCollapseWindow(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e?this.showElement():this.hideElement(),super.openOrCollapseWindow(e,t)}openWindow(e){this.chatDiv.style.display="flex",(0,I.SA)(this.element,"collapsed"),this.scrollToBottom(),e&&this.fireDmsRead(),void 0!==this.followButton&&(this.followButton.style.display="block")}resizeTipCallout(){const e=(0,F.mJ)();e<250?(0,c.ZM)(this.tippingUI,{height:`${e}px`,overflow:"scroll",transform:"translate(-50%)",top:"",bottom:"0",overscrollBehavior:"contain"}):(0,c.ZM)(this.tippingUI,{height:"",overflow:"",transform:"translate(-50%, -50%)",top:"50%",bottom:"",overscrollBehavior:""})}showUCM(){}showUserPanel(){void 0===this.userPanel&&(this.userPanel=new U.T,(0,c.ZM)(this.userPanel.element,{top:`${this.headerBar.offsetHeight}px`,backgroundColor:"#FFF",fontSize:"12px"}),B.bW.listen((()=>{this.removeUserPanelDOM()})).addTo(this.listenerGroup),this.userPanel.overlayClick.listen((()=>{this.removeUserPanelDOM()})).addTo(this.listenerGroup)),this.userPanel.updateContents(this.username,this.lastReceivedMessage),this.headerBar.appendChild(this.userPanel.overlay),this.headerBar.appendChild(this.userPanel.element),this.userPanel.showOverlay()}removeUserPanelDOM(){var e;null===(e=this.userPanel)||void 0===e||e.hideOverlay(),void 0!==this.userPanel&&null!==this.userPanel.element.parentElement&&this.userPanel.element.parentElement.removeChild(this.userPanel.element)}showElement(){super.showElement("flex")}highlightHeaderForLoad(){}onResize(){this.isScrolledUp(600)||this.scrollToBottom()}}class Ce extends be{constructor(e){var t,i;super({username:e,myUsername:null!==(t=null===(i=C.Bm.current.loggedInUser)||void 0===i?void 0:i.username)&&void 0!==t?t:"",open:!0,markAsRead:!0,raiseWindowZIndexToTop:()=>{}}),"ResizeObserver"in window&&new ResizeObserver((()=>this.onResize())).observe(this.messageDiv)}constructElement(){this.createHeaderBar(),this.createFollowStar(),this.createChatDiv(),this.element=(0,y.tT)("div",{colorClass:"dmWindow",style:{position:"relative",height:"100%"},"data-testid":"dm-window"},this.headerBar,this.chatDiv)}createHeaderBar(){this.headerBar=(0,y.tT)("div",{style:{position:"relative",height:"34px",borderRadius:"4px 4px 0px 0px",borderBottomWidth:"2px",borderBottomStyle:"solid"},colorClass:"dmWindowHeader"}),this.usernameLabel=new me({username:this.username,colorClass:this.colorClass,clickUsernameFn:()=>this.showUCM()}),this.headerBar.appendChild(this.usernameLabel.element)}constructFollowStarUI(e){super.constructFollowStarUI(e),this.followButton.style.right="8px"}constructFollowToolTip(e){this.followToolTip=new ce({message:e?f.R.unfollowText:f.R.followText,toolTipBottom:"auto",toolTipRight:"40px",divotPosition:d.Wi.Right,caretRight:"0px",caretBottom:"24px"})}openWindow(e){super.openWindow(e),this.element.style.bottom="",this.element.style.height="100%"}highlightHeaderForLoad(){}onResize(){this.isScrolledUp(600)||this.scrollToBottom()}}},1585:(e,t,i)=>{"use strict";i.d(t,{L:()=>a,N:()=>r});var s=i(7463),n=i(9461),o=i(897);function r(e){const t=(e||document).querySelectorAll(".dmWindow");return Array.from(t).reduce(((e,t)=>Math.max(e,t.offsetHeight)),0)}function a(e){var t;const i=null===(t=n.Bm.current.loggedInUser)||void 0===t?void 0:t.userUid;void 0!==i&&(new o.aT(i).onMessage.listen((t=>{var i;const s=null===(i=n.Bm.current.loggedInUser)||void 0===i?void 0:i.username,o=t.fromUser.username!==s?t.fromUser.username:t.toUsername,r=e(null!=o?o:"");null==r||r.onTip(t)})),new o.T_(i).onMessage.listen((t=>{const i=e(t.username);null==i||i.onIgnoreUnignore(t.isIgnored)})),s.im.listen((t=>{const i=e(t.roomName);null==i||i.followUnfollow(t.following)})),new o.vc(i).onMessage.listen((t=>{const i=e(t.fromUser.username);null==i||i.setUserInfo({inFanclub:!0})})))}},3910:(e,t,i)=>{"use strict";i.d(t,{$o:()=>w,Z4:()=>P,c9:()=>x,oB:()=>S,qt:()=>A,x7:()=>C});var s=i(7623),n=i(6784),o=i(2709),r=i(8423),a=i(8936),l=i(3124),h=i(9439),d=i(1372),c=i(4110),u=i(3417),p=i(9461),m=i(9466),g=i(4364),v=i(2394),f=i(2120),y=i(1585),b=i(1885);const w=new r.c_("createDmWindowRequest"),C=new r.c_("removeDMWindowRequest"),S=new r.c_("updateWindowIsOpenEvent"),x=new r.c_("dmsHeightChanged"),T="pmChatWindow";class A extends o.u{constructor(e){super(),this.allDmWindowsMap=new Map,this.focusingTablet=!1,this.tabletFocusState=2,this.raiseWindowZIndexToTop=e=>{this.allDmWindowsMap.forEach(((t,i)=>{i===e?t.changeWindowZIndex(2):t.changeWindowZIndex(1)}))},this.myUsername=e,this.bindListeners(),(0,n.wu)("mousedown",this.element,(()=>(0,h.jb)(!1))),(0,n.wu)("mouseup",window,(()=>(0,h.jb)(!0)))}static getOrCreateInstance(e){return void 0===A.instance&&(A.instance=new A(e)),A.instance}static getInstance(){return A.instance}initData(){this.manuallyHandlingTabletKeyboard=(0,s.Xb)()&&!!window.visualViewport&&void 0===navigator.virtualKeyboard}initUI(){if(super.initUI(),this.shownDmContainer=(0,d.tT)("div",{style:{display:"inline-block",cssFloat:"right"}}),this.element=(0,d.tT)("div",{id:"DmWindowBar",style:{position:"fixed",bottom:"0px",right:"10px",minWidth:"350px",width:"100vw",height:"0px",backgroundColor:"rgba(255, 255, 255, 0.5)",zIndex:1005}},this.shownDmContainer),v.Z.listen((e=>this.handleInputFocus(e))),this.manuallyHandlingTabletKeyboard)(0,n.wu)("focus",this.element,(()=>this.onTabletFocus()),!0),(0,n.wu)("blur",this.element,(()=>this.onTabletBlur()),!0),(0,m.QR)(document,(()=>{this.focusingTablet||this.blur()})),(0,n.wu)("touchstart",document,(e=>{e.target instanceof Element&&!this.element.contains(e.target)&&this.blur()}));else if(void 0!==navigator.virtualKeyboard){const e=navigator.virtualKeyboard;(0,n.wu)("focus",document,(t=>{e.overlaysContent=t.target instanceof Element&&this.element.contains(t.target)}),!0),(0,n.wu)("blur",this.element,(()=>{this.element.style.bottom="0px"}),!0),e.addEventListener("geometrychange",(e=>{this.element.contains(document.activeElement)&&(this.element.style.bottom=`${e.target.boundingRect.height}px`)}))}if((0,s.Xb)()){var e;let t;(0,n.wu)("focusin",document,(e=>{e.target instanceof HTMLElement&&(["input","textarea"].includes(e.target.tagName.toLowerCase())||"true"===e.target.contentEditable)&&!this.element.contains(e.target)&&(this.element.style.visibility="hidden")})),(0,n.wu)("focusout",document,(()=>{this.element.style.visibility=""})),null===(e=window.visualViewport)||void 0===e||e.addEventListener("resize",(()=>{const e=window.visualViewport?Math.round(10*window.visualViewport.scale):void 0;void 0!==t&&e!==t&&this.blur(),t=e}))}}handleInputFocus(e){if(!this.manuallyHandlingTabletKeyboard)return void(e instanceof HTMLElement&&e.focus());let t;if(e instanceof HTMLElement)t=e;else{if(!(e.target instanceof HTMLElement))return;if(document.activeElement===e.target&&(0,s.OF)()&&this.isPositionedForKeyboard())return;e.preventDefault(),t=e.target}this.handleTabletInputFocus(t)}handleTabletInputFocus(e){e.blur();const t=window.scrollX,i=window.scrollY;this.maxZoomedTabletTop=document.body.offsetHeight,this.focusingTablet=!0;const s=()=>{window.scrollTo(t,i),(0,a.z1)()&&this.setTabletStyleForZoomFocus()};(0,n.wu)("scroll",document,s),window.setTimeout((()=>{(0,n.Pf)("scroll",document,s),this.focusingTablet=!1}),1e3),this.setTabletStyleForFocus(0),e.focus()}onTabletFocus(){window.setTimeout((()=>{this.setTabletStyleForFocus(1)}),(0,s.OF)()?75:350)}onTabletBlur(){window.setTimeout((()=>{this.setTabletStyleForFocus(0),window.setTimeout((()=>{this.element.contains(document.activeElement)?(0,s.OF)()&&this.setTabletStyleForFocus(1):this.setTabletStyleForFocus(2)}),0)}),0)}setTabletStyleForFocus(e){if(e===this.tabletFocusState)return;if(this.tabletFocusState=e,(0,a.z1)())return void this.setTabletStyleForZoomFocus();if((0,s.Pb)())return;const t=!this.isPositionedForKeyboard();switch(this.element.style.top="unset",this.element.style.bottom="unset",this.element.style.visibility="",e){case 0:t?(0,s.OF)()?(this.element.style.visibility="none",this.element.style.bottom="60vh"):this.element.style.bottom=(0,l.K$)()?"35vh":"60vh":this.element.style.top="calc(var(--vh, 1vh) * 100 - 2px)";break;case 1:this.element.style.top="calc(var(--vh, 1vh) * 100)";break;case 2:this.element.style.bottom="0px";break;default:error("DmWindowManager - invalid focusState"),this.element.style.bottom="0px"}}setTabletStyleForZoomFocus(){if(!(0,s.OF)())return this.element.style.position="fixed",void(this.element.style.bottom="0px");switch(this.element.style.top="unset",this.element.style.bottom="unset",this.tabletFocusState){case 0:case 1:if(window.visualViewport){this.element.style.position="absolute";const e=Math.min(window.scrollY+window.visualViewport.height,this.maxZoomedTabletTop);this.element.style.top=`${e}px`}break;case 2:this.element.style.position="fixed",this.element.style.bottom="0px";break;default:error("DmWindowManager - invalid zoom focusState"),this.element.style.position="fixed",this.element.style.bottom="0px"}}isPositionedForKeyboard(){return this.element.getBoundingClientRect().bottom<=window.innerHeight-5}blur(){document.activeElement instanceof HTMLElement&&this.element.contains(document.activeElement)&&document.activeElement.blur()}bindListeners(){C.listen((e=>{var t;let{username:i,deleteWindow:s}=e;(null===(t=this.shownWindow)||void 0===t?void 0:t.username)===i&&this.removeShownWindow(),!0===s&&this.allDmWindowsMap.delete(i)})),S.listen((()=>{this.updateLocalStorage()})),b.H4.listen((e=>{const t=this.allDmWindowsMap.get(e.otherUsername);null==t||t.handleNewMessage(e)})),g.yT.conversationRead.listen((e=>{let{username:t,isDm:i}=e;if(i){const e=this.allDmWindowsMap.get(t);null==e||e.markRead()}})),p.Bm.current.isBroadcast&&c.xw.listen((e=>{const t=this.allDmWindowsMap.get(e.username);null==t||t.setUserInfo({isMod:e.isMod})})),(0,y.L)((e=>this.allDmWindowsMap.get(e)))}shownWindowUsername(){var e;return null===(e=this.shownWindow)||void 0===e?void 0:e.username}showUserConversation(e,t,i){if(this.transferToShown(e,i))return;const s=new f.sG({username:e,myUsername:this.myUsername,open:t,markAsRead:i,raiseWindowZIndexToTop:this.raiseWindowZIndexToTop});this.allDmWindowsMap.set(e,s),this.shownDmContainer.appendChild(s.element),this.showWindow(s,t,i)}removeShownWindow(){void 0!==this.shownWindow&&(this.shownWindow.removeFromDOM(),this.shownWindow=void 0,this.updateLocalStorage(),x.fire(void 0))}transferToShown(e,t){const i=this.allDmWindowsMap.get(e);return void 0!==i&&(this.shownDmContainer.appendChild(i.element),this.showWindow(i,!0,t),!0)}showWindow(e,t,i){this.removeShownWindow(),this.shownDmContainer.appendChild(e.element),e.setIsShowing(!0),e.openOrCollapseWindow(t,i,!i),i&&e.highlightHeaderForShow(),this.shownWindow=e,this.updateLocalStorage(),x.fire(void 0)}updateLocalStorage(){if(!(0,s.Pf)())return;let e;void 0!==this.shownWindow&&(e={username:this.shownWindow.username,isOpen:this.shownWindow.isWindowOpen()});const t=window.localStorage.getItem(T),i=null!==t?JSON.parse(t):{};i[this.myUsername]=JSON.stringify(e),window.localStorage.setItem(T,JSON.stringify(i))}}function P(e){let t;(0,u.vu)();const i=(i,s,n)=>{e!==i&&(void 0===t&&(t=A.getOrCreateInstance(e),document.body.appendChild(t.element)),t.showUserConversation(i,s,n))};(()=>{if(!(0,s.Pf)())return;const t=window.localStorage.getItem(T);if(null!==t){const s=JSON.parse(t)[e];if(void 0===s)return;const n=JSON.parse(s);i(n.username,n.isOpen,!1),x.fire(void 0)}})(),w.listen((e=>{i(e,!0,!0)}))}},268:(e,t,i)=>{"use strict";i.d(t,{i:()=>m});var s,n=i(6784),o=i(2709),r=i(5020),a=i(3955),l=i(8423),h=i(4947),d=i(1372),c=i(9447),u=i(8039),p=i(9603);class m extends o.u{constructor(e){super("span",e),this.listeners=new l.gt,this.hideTooltip=()=>{var e;null===(e=this.shownTooltip)||void 0===e||null===(e=e.parentElement)||void 0===e||e.removeChild(this.shownTooltip),this.shownTooltip=void 0};const t={display:"inline-block",width:"16px",height:"16px",marginLeft:"4px",...e.style};this.element=(0,d.tT)("span",{colorClass:"InRoomIndicator",style:t}),this.createTooltips(),this.setupTooltipListeners(),u.tb.listen((()=>{this.userInRoomState=u.SJ.getInstance().userInRoomState(e.username),this.updateUI()})).addTo(this.listeners),this.userInRoomState=u.SJ.getInstance().userInRoomState(e.username),this.updateUI()}dispose(){this.listeners.removeAll()}setupTooltipListeners(){m.documentClick.listen(this.hideTooltip).addTo(this.listeners),m.documentScroll.listen(this.hideTooltip).addTo(this.listeners),(0,a.JR)(this.element).listen((e=>{e?this.showTooltip():this.hideTooltip()})),(0,n.wu)("touchend",this.element,(e=>{void 0===this.shownTooltip?this.showTooltip():this.hideTooltip(),e.preventDefault()}))}createTooltips(){const e={hasHTML:!1,divotPosition:r.Wi.Bottom,divotLeftOrTop:"5px"};this.inRoomTooltip=(0,p.q)({content:h.R.userInRoom,...e}),this.notInPrivateTooltip=(0,p.q)({content:h.R.userNotInPrivate,...e}),this.notInRoomTooltip=(0,p.q)({content:h.R.userNotInRoom,...e});const t=[this.inRoomTooltip,this.notInPrivateTooltip,this.notInRoomTooltip];for(const e of t)e.style.position="fixed",e.style.display=""}showTooltip(){var e;let t;switch(this.hideTooltip(),this.userInRoomState){case 0:t=this.inRoomTooltip;break;case 1:t=this.notInPrivateTooltip;break;case 2:t=this.notInRoomTooltip}document.body.appendChild(t);const i=this.element.getBoundingClientRect(),s=(0,a.Mx)(),n=-s.left+i.left-7,o=-s.top+i.top-t.offsetHeight-6;t.style.top=`${o}px`,t.style.left=`${n}px`,t.style.width=`${(0,a.q_)(null!==(e=t.textContent)&&void 0!==e?e:"",t)+1}px`,this.shownTooltip=t}updateUI(){switch((0,c.SA)(this.element,"inRoom"),(0,c.SA)(this.element,"notInPrivate"),(0,c.SA)(this.element,"notInRoom"),this.userInRoomState){case 0:(0,c.fZ)(this.element,"inRoom");break;case 1:(0,c.fZ)(this.element,"notInPrivate");break;case 2:(0,c.fZ)(this.element,"notInRoom")}}render(){return this.element}}(s=m).documentClick=new l.c_("InRoomIndicator.documentClick",{listenersWarningThreshold:()=>50+3*l.hI}),s.documentScroll=new l.c_("InRoomIndicator.documentScroll",{listenersWarningThreshold:()=>50+3*l.hI})},9510:(e,t,i)=>{"use strict";i.d(t,{$w:()=>P,Xt:()=>k,c6:()=>D,V5:()=>w,xf:()=>S,$x:()=>x,TL:()=>C});var s=i(6784),n=i(213),o=i(5216),r=i(6844),a=i(2709),l=i(3955),h=i(8423),d=i(9447),c=i(2690);class u extends c.z{constructor(){super(),(0,d.fZ)(this.element,"mediaPreviewModal"),(0,l.ZM)(this.element,{position:"fixed",width:"auto",height:"auto",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"6px",padding:"10px",fontSize:"12px",fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif",zIndex:1005,textAlign:"center",boxShadow:"0 0 18px rgba(0, 0, 0, 0.4)"}),(0,l.ZM)(this.overlay,{backgroundColor:"#000000",opacity:"0.4",zIndex:1005}),this.element.dataset.testid="emoticon-modal";const e=document.createElement("div");(0,d.fZ)(e,"closeButton"),(0,l.ZM)(e,{display:"inline-block",position:"absolute",width:"10px",height:"10px",top:"9px",right:"9px",cursor:"pointer",opacity:"1"}),e.onclick=()=>{this.hide()},e.onmouseenter=()=>{e.style.opacity="1"},e.onmouseleave=()=>{e.style.opacity="0.5"},e.dataset.testid="close-button",this.element.appendChild(e),this.previewImage=document.createElement("img"),(0,l.ZM)(this.previewImage,{verticalAlign:"middle",padding:"10px",maxHeight:"60vh",maxWidth:"80vw"}),(0,s.wu)("load",this.previewImage,(()=>{this.previewImage.style.visibility="visible",this.repositionChildren()})),this.previewImage.dataset.testid="preview-image",this.element.appendChild(this.previewImage),this.overlayClick.listen((()=>{this.hide()}))}initAndShow(e){this.previewImage.style.visibility="hidden",this.previewImage.src=e,super.show(),this.removeDocumentFocus(),this.repositionChildren()}hide(){super.hide()}show(){super.show(),this.element.style.visibility="",this.repositionChildren()}removeDocumentFocus(){null!==document.activeElement&&document.activeElement.blur()}}var p=i(4947),m=i(1372),g=i(3860),v=i(6318),f=i(3885),y=i(3172);const b={...y.wt,cursor:"default"},w=20,C=new h.c_("showMobileMediaDock"),S=new h.c_("mobileMediaUploadProgress"),x=()=>64;class T extends a.u{constructor(e){super(),this.parentContents=e,this.scrollSize=A.itemWidth,this.mediaPreviewModal=new u,this.listeners=new h.gt;const t={height:"100%",position:"absolute",zIndex:1e3,opacity:.8,borderRadius:0,border:"none",fill:"currentColor",cursor:"pointer"},i={minHeight:"77px",width:"auto",minWidth:"100%",cssFloat:"left",boxSizing:"border-box",padding:`${T.padding}px`,whiteSpace:"nowrap",position:"relative"};this.dock=new a.u,(0,l.ZM)(this.dock,i),this.element=(0,m.tT)("div",{className:"pmMediaDockContainer",style:{flexShrink:0,position:"relative",display:"none",overflowX:"hidden",whiteSpace:"nowrap",bottom:0}},(0,m.tT)("button",{ref:e=>this.scrollLeftBtn=e,onClick:()=>{this.scrollLeft()},style:{...t,left:0},colorClass:"scrollButton"},(0,m.tT)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg"},(0,m.tT)("path",{d:"M9.19276e-07 5.98581C-0.000425611 5.65497 0.147594 5.33999 0.406233 5.12135L6.21431 0.216066C6.6146 -0.106384 7.20982 -0.0630863 7.55493 0.313586C7.90004 0.690259 7.8688 1.26253 7.48456 1.6025L2.40562 5.89181C2.37742 5.91555 2.36125 5.9498 2.36125 5.98581C2.36125 6.02182 2.37742 6.05607 2.40562 6.07981L7.48456 10.3691C7.75191 10.5845 7.87679 10.922 7.81086 11.251C7.74493 11.58 7.49854 11.8489 7.16704 11.9537C6.83554 12.0584 6.47093 11.9826 6.21431 11.7556L0.408316 6.85177C0.149051 6.63276 0.000328855 6.31734 9.19276e-07 5.98581Z",fill:"#222222"}))),(0,m.tT)("button",{ref:e=>this.scrollRightBtn=e,onClick:()=>{this.scrollRight()},style:{...t,right:0},colorClass:"scrollButton"},(0,m.tT)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg"},(0,m.tT)("path",{d:"M8 5.98581C8.00043 5.65497 7.85241 5.33999 7.59377 5.12135L1.78569 0.216066C1.3854 -0.106384 0.790178 -0.0630863 0.44507 0.313586C0.0999627 0.690259 0.131205 1.26253 0.515437 1.6025L5.59438 5.89181C5.62258 5.91555 5.63875 5.9498 5.63875 5.98581C5.63875 6.02182 5.62258 6.05607 5.59438 6.07981L0.515437 10.3691C0.248085 10.5845 0.123215 10.922 0.189144 11.251C0.255072 11.58 0.501458 11.8489 0.832959 11.9537C1.16446 12.0584 1.52907 11.9826 1.78569 11.7556L7.59168 6.85177C7.85095 6.63276 7.99967 6.31734 8 5.98581Z",fill:"#222222"}))),(0,m.tT)("div",{ref:e=>this.scrollContainer=e,onScroll:()=>{this.setScrollButtonVisibility()},style:{overflow:"scroll",width:"100%",position:"relative"},className:"noScrollbar"},this.dock.element)),this.setScrollButtonVisibility(),v.bs.listen((e=>{var t;null===(t=this.getImageById(e))||void 0===t||t.removeElement()})).addTo(this.listeners),v.C0.listen((e=>{var t;null===(t=this.getImageById(e))||void 0===t||t.markRejected()})).addTo(this.listeners)}repositionChildren(){this.setScrollButtonVisibility()}scrollLeft(){this.scrollContainer.scrollLeft-=this.scrollSize,this.setScrollButtonVisibility()}scrollRight(){this.scrollContainer.scrollLeft+=this.scrollSize,this.setScrollButtonVisibility()}setScrollButtonVisibility(){const e=this.scrollContainer;this.scrollLeftBtn.style.display=e.scrollLeft>0?"block":"none",this.scrollRightBtn.style.display=e.scrollLeft+2{this.setScrollButtonVisibility()}),0)}show(){this.isShown()||(this.showElement(),this.scrollRightBtn.click(),this.scrollLeftBtn.click(),this.parentContents.repositionChildrenRecursive())}hide(){this.hideElement(),this.onHide(),this.hideMediaPreview(),this.parentContents.repositionChildrenRecursive()}setPreviewModal(e){this.mediaPreviewModal.initAndShow(e)}hideMediaPreview(){this.mediaPreviewModal.hide()}removeItem(e){this.dock.removeChild(e)}items(){return this.dock.children()}getImageById(e){return this.items().find((t=>{var i;return(null===(i=t.media)||void 0===i?void 0:i.mediaId)===e}))}clear(){for(;this.items().length>0;)this.items().forEach((e=>{e.remove()}))}isEmpty(){return 0===this.items().length}async mediaList(){return Promise.all(this.items().map((e=>e.mediaPromise)))}onHide(){}}T.padding=5;class A extends a.u{constructor(e,t){super(),this.mediaPromise=e,this.parentDock=t,this.element=(0,m.tT)("div",{style:{...b,backgroundImage:""},colorClass:"mediaDockItem"},(0,m.tT)("img",{src:`${STATIC_URL_ROOT}tsdefaultassets/mediaDock/closeButton.svg`,onClick:e=>{e.stopPropagation(),this.remove()},ref:e=>this.removeBtn=e,style:{position:"absolute",top:0,right:0,zIndex:1,cursor:"pointer"}}),(0,m.tT)("div",{style:{...b,position:"absolute"},ref:e=>this.imageContainer=e},(0,m.tT)(f._,{myRef:e=>{this.loadingSpinner=e}}))),e.then((e=>{this.onload(e)})),this.loadingSpinner.dataset.testid="chat-image-loading-spinner"}onload(e){this.media=e;const t=new Image;t.onload=()=>{const e=new Image;e.src=t.src,e.style.width="100%",e.style.height="auto",this.imageContainer.appendChild(e),this.loadingSpinner.style.display="none"},t.src=e.thumbnailUrl}removeElement(){this.parentDock.removeItem(this)}}A.itemWidth=y.Ew+2;class P extends T{constructor(e,t,i){super(e),this.toUser=t,this.videoModes=i,this.fileInput=(0,m.tT)("input",{type:"file",accept:".jpg,.jpeg,.png,.gif,.heic,.heif,.webp",multiple:!0}),this.loadingSpinner=new M,this.initSibling();const s=(0,m.tT)("div",{style:{...b,cursor:"pointer",backgroundImage:"none",backgroundColor:"#2C2C2C"}},(0,m.tT)("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1.5)"}},(0,m.tT)("img",{src:`${STATIC_URL_ROOT}tsdefaultassets/mediaDock/uploadBackground.svg`}),(0,m.tT)("img",{src:`${STATIC_URL_ROOT}tsdefaultassets/mediaDock/uploadSymbol.svg`,style:{position:"absolute",bottom:0,right:0,transform:"translate(50%, 25%) scale(0.66)"}})));s.dataset.testid="upload-image-button",s.onclick=()=>{this.showSelectDialog()},this.dock.element.appendChild(s),this.dock.element.dataset.testid="image-dock",this.fileInput.onchange=()=>{this.onFileInputChange()},(0,r.ok)()||this.getLatest(),g.L.changeVideoMode.listen((e=>{this.videoModes.includes(e.currentMode)&&!(0,r.ok)()&&this.getLatest()})).addTo(this.listeners),v.xV.listen((e=>{const t=g.L.getVideoMode();this.videoModes.includes(t)&&this.toUser===e.toUser&&(this.handleFileUpload(...e.files),this.show())})).addTo(this.listeners),v.vI.listen((e=>{this.videoModes.includes(g.L.getVideoMode())&&this.addItem(new I(e.promise,this,this.toUser===e.toUser))}),!1).addTo(this.listeners)}initSibling(){this.sibling=new E(this.parentContents),this.sibling.sibling=this}dispose(){this.listeners.removeAll(),this.sibling.dispose()}async onFileInputChange(){null!==this.fileInput.files&&(this.handleFileUpload(...this.fileInput.files),this.fileInput.value="")}async handleFileUpload(){for(var e=arguments.length,t=new Array(e),i=0;i1&&void 0!==arguments[1]&&arguments[1])&&this.items().length>0?this.dock.addChildBeforeIndex(e,0):this.dock.addChild(e),e.mediaPromise.then((t=>{const i=this.sibling.getImageById(t.mediaId);void 0!==i&&e.setSibling(i)}));this.items().length>w;)this.dock.removeChild(this.dock.lastChild());this.setScrollButtonVisibility()}getImageById(e){return this.items().find((t=>{var i;return(null===(i=t.media)||void 0===i?void 0:i.mediaId)===e}))}getLatest(){this.dock.removeAllChildren(),this.dock.addChild(this.loadingSpinner),this.setScrollButtonVisibility(),(0,v.nu)().then((e=>{this.dock.removeAllChildren(),this.loadingSpinner.element.style.display="none";for(const t of e)this.addItem(new I(Promise.resolve(t),this),!0);this.setScrollButtonVisibility()})).catch((()=>{this.loadingSpinner.element.style.display="none",this.setScrollButtonVisibility()}))}items(){return super.items()}show(){super.show(),this.sibling.showIfNonempty()}hide(){super.hide(),this.sibling.hide()}}class k extends T{constructor(e){super(e),this.parentContents=e,this.scrollSize=R.itemWidth,this.loadingSpinner=new M,this.fileInput=(0,m.tT)("input",{type:"file",accept:".jpg,.jpeg,.png,.gif,.heic,.heif,.webp",multiple:!0}),this.room="",this.element.style.boxSizing="border-box",this.element.style.borderTopLeftRadius="4px",this.element.style.borderTopRightRadius="4px",this.element.style.borderBottom="none",this.element.dataset.testid="mobile-image-dock",(0,d.fZ)(this.element,"SelectedMediaDock"),this.dock.element.style.borderTopColor="#EFEFEF",this.dock.element.style.borderTopWidth="1px",this.dock.element.style.borderTopStyle="solid",this.dock.removeAllChildren(),this.hideLoadingSpinner(),this.fileInput.onchange=()=>{this.onFileInputChange()},this.element.ontouchmove=e=>{e.stopPropagation()}}repositionChildren(){this.setScrollButtonVisibility()}show(){this.isShown()||(window.setTimeout((()=>{this.setScrollButtonVisibility()}),0),this.showElement(),this.parentContents.repositionChildrenRecursive())}hide(){super.hide(),C.fire(!1)}showLoadingSpinner(){this.dock.removeAllChildren(),this.dock.addChild(this.loadingSpinner),this.loadingSpinner.showElement()}hideLoadingSpinner(){var e;null===(e=this.loadingSpinner.parent)||void 0===e||e.removeChild(this.loadingSpinner),this.loadingSpinner.hideElement()}setRoom(e){this.room=e}getRoom(){return this.room}onFileInputChange(){null!==this.fileInput.files&&(this.processFiles(...this.fileInput.files),this.fileInput.value="")}processFiles(){for(var e=arguments.length,t=new Array(e),i=0;i=10){(0,n.Q$)(p.R.errorUploadMediaLimit(10));break}this.addMediaItem(new R(e,this))}Promise.all(this.mobileItems().map((e=>e.uploadPromise))).then((e=>{e.some((e=>!1===e))&&(0,n.Q$)(p.R.errorUploadingMedia)}))}showSelectDialog(){this.fileInput.click()}addItem(e){}addMediaItem(e){for(this.mobileItems().length>0?this.dock.addChildBeforeIndex(e,0):(this.show(),this.dock.addChild(e),C.fire(!0));this.mobileItems().length>10;)this.dock.removeChild(this.dock.lastChild());S.fire()}removeItem(e){this.dock.removeChild(e),this.isEmpty()&&this.hide(),S.fire()}mobileItems(){return this.dock.children().filter((e=>e!==this.loadingSpinner))}clear(){for(;this.mobileItems().length>0;)this.mobileItems().forEach((e=>{e.removeElement()}))}isEmpty(){return 0===this.mobileItems().length}mobileMediaList(){return this.mobileItems().map((e=>e.media))}isUploading(){return this.mobileItems().some((e=>void 0===e.media))}onHide(){this.clear()}dispose(){this.listeners.removeAll()}}class M extends a.u{constructor(){super(),this.element=(0,m.tT)("div",{style:{...b,backgroundImage:""}},(0,m.tT)("div",{style:{...b,position:"absolute"}},(0,m.tT)(f._,null)))}}class R extends a.u{constructor(e,t){super(),this.parentDock=t,this.file=e,this.element=(0,m.tT)("div",{style:{...b,backgroundImage:""},colorClass:"mediaDockItem"},(0,m.tT)("img",{src:`${STATIC_URL_ROOT}tsdefaultassets/mediaDock/closeButton.svg`,onClick:e=>{e.stopPropagation(),this.remove()},style:{position:"absolute",top:0,right:0,zIndex:1,cursor:"pointer",width:"15px",height:"15px"}}),(0,m.tT)("div",{style:{...b,position:"absolute"},ref:e=>this.imageContainer=e},(0,m.tT)(f._,{myRef:e=>{this.loadingSpinner=e},extraStyle:{background:"rgba(0,0,0,0.1)"}}))),(0,l.ZM)(this.imageContainer,{display:"flex",justifyContent:"center",alignItems:"center"});const i=this.createThumbnail();this.imageContainer.appendChild(i),this.uploadPromise=this.uploadMediaFile(e,i)}createThumbnail(){const e=new Image;return e.style.width="auto",e.style.width="-moz-available",e.style.width="-webkit-fill-available",e.style.width="fill-available",e.style.height="auto",e.style.height="-moz-available",e.style.height="-webkit-fill-available",e.style.height="fill-available",e.onclick=()=>{void 0!==this.media&&this.parentDock.setPreviewModal(this.media.url)},e}uploadMediaFile(e,t){return(0,v.sc)(e,this.parentDock.getRoom()).then((e=>(t.src=e.thumbnailUrl,this.media=e,this.hideLoadingSpinner(),!0))).catch((e=>{if(this.parentDock.removeItem(this),e instanceof o.fr){if(400===e.xhr.status){const t=JSON.parse(e.xhr.responseText).errors;if(void 0!==t&&"invalid_media"===t.media)return void(0,n.Q$)(p.R.invalidFileErrorUploadingMedia)}return!1}"file_too_large"===e&&(0,n.Q$)(p.R.fileSizeErrorUploadingMedia)})).finally((()=>{S.fire()}))}remove(){if(void 0===this.media||this.isSpinnerVisible())return;this.showLoadingSpinner();const e=this.imageContainer.querySelector("img");this.imageContainer.removeChild(e),(0,v.IM)(this.media.mediaId).then((()=>{})).catch((()=>{this.hideLoadingSpinner(),this.imageContainer.appendChild(e),(0,n.Q$)(p.R.errorDeletingMedia)}))}removeElement(){this.parentDock.removeItem(this)}showLoadingSpinner(){this.loadingSpinner.style.display="block"}hideLoadingSpinner(){this.loadingSpinner.style.display="none"}isSpinnerVisible(){return"none"!==this.loadingSpinner.style.display}}R.itemWidth=y.Ew+2;class I extends A{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(e,t),this.autoselect=i,this.selected=!1,this.rejected=!1,e.catch((e=>{if(this.removeElement(),e instanceof o.fr){if(400===e.xhr.status){const t=JSON.parse(e.xhr.responseText).errors;if(void 0!==t&&"invalid_media"===t.media)return void(0,n.Q$)(p.R.invalidFileErrorUploadingMedia)}(0,n.Q$)(p.R.errorUploadingMedia)}else"file_too_large"===e&&(0,n.Q$)(p.R.fileSizeErrorUploadingMedia)})),this.selectedIcon=(0,m.tT)("img",{ref:e=>this.selectedIcon=e,src:`${STATIC_URL_ROOT}tsdefaultassets/mediaDock/selected.svg`,style:{position:"absolute",bottom:0,right:0,zIndex:1,display:"none"}}),this.element.appendChild(this.selectedIcon),this.removeBtn.style.display="none"}onload(e){super.onload(e),this.removeBtn.style.display="block",this.autoselect&&window.setTimeout((()=>{this.select()}),0),this.element.onclick=()=>{this.toggleSelect()}}toggleSelect(){this.selected?this.deselect():this.select()}select(){this.selected||(this.selected=!0,this.removeBtn.style.display="none",this.selectedIcon.style.display="block",this.createSibling(),this.parentDock.sibling.addItem(this.sibling),this.parentDock.sibling.show(),this.parentDock.sibling.setScrollButtonVisibility())}createSibling(){void 0===this.sibling&&(this.sibling=new L(this.mediaPromise,this.parentDock.sibling),this.sibling.sibling=this)}setSibling(e){void 0===this.sibling?(this.selected=!0,this.removeBtn.style.display="none",this.selectedIcon.style.display="block",this.sibling=e,this.sibling.sibling=this):error("LibraryMediaDockItem sibling exists")}deselect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t;this.selected=!1,this.removeBtn.style.display="block",this.selectedIcon.style.display="none",e||null===(t=this.sibling)||void 0===t||t.remove(!0)}remove(){this.rejected?this.removeElement():(0,n.mf)(p.R.confirmPhotoDelete,(()=>{if(void 0===this.media)return void error("Attempting to delete media before it is loaded");this.loadingSpinner.style.display="block";const e=this.imageContainer.querySelector("img");this.imageContainer.removeChild(e),(0,v.IM)(this.media.mediaId).then((()=>{})).catch((()=>{this.loadingSpinner.style.display="none",this.imageContainer.appendChild(e),(0,n.Q$)(p.R.errorDeletingMedia)}))}))}markRejected(){this.element.removeChild(this.imageContainer),this.element.onclick=null;const e=(0,m.tT)("div",{style:{whiteSpace:"break-spaces",fontSize:"11px",width:"100%",height:"100%",padding:"2px"},colorClass:"rejected"},p.R.removedForViolation);this.element.appendChild(e),this.rejected=!0}removeElement(){var e;super.removeElement(),(0,v.f1)(1,w-1).then((e=>{var t;if(e.length>0){const t=Promise.resolve(e[0]),i=new I(t,this.parentDock);this.parentDock.addItem(i,!0)}null===(t=this.parentDock)||void 0===t||t.setScrollButtonVisibility()})),this.loadingSpinner.style.display="none",null===(e=this.parentDock)||void 0===e||e.setScrollButtonVisibility()}}class E extends T{constructor(e){super(e),this.element.style.boxSizing="border-box",this.element.style.borderTopLeftRadius="4px",this.element.style.borderTopRightRadius="4px",this.element.style.borderBottom="none",this.element.dataset.testid="staged-image-dock",(0,d.fZ)(this.element,"SelectedMediaDock")}addItem(e){this.dock.addChild(e)}getImageById(e){return super.getImageById(e)}showIfNonempty(){this.isEmpty()||this.show()}hideIfEmpty(){this.isEmpty()&&this.hide()}onHide(){this.clear()}dispose(){this.listeners.removeAll()}}class L extends A{constructor(e,t){super(e,t),this.element.onclick=()=>{void 0!==this.media&&this.parentDock.setPreviewModal(this.media.url)}}remove(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t;this.removeElement(),this.parentDock.setScrollButtonVisibility(),this.parentDock.hideIfEmpty(),e||null===(t=this.sibling)||void 0===t||t.deselect(!0)}markRejected(){this.remove()}}function D(e,t){const i=(0,m.tT)("div",{style:{position:"absolute",top:"0",left:"0",boxSizing:"border-box",height:"100%",width:"100%",background:"rgba(0,0,0,0.5)",padding:"10px",display:"none",zIndex:1e3}},(0,m.tT)("div",{style:{border:"3px dashed white",padding:"10px",height:"calc(100% - 26px)"}}));e.appendChild(i),(0,s.Xq)(["dragenter","dragover","dragleave","drop"],e,(e=>{e.preventDefault(),e.stopPropagation()})),(0,s.Xq)(["dragenter","dragover"],e,(e=>{e.dataTransfer&&e.dataTransfer.types.includes("Files")&&(i.style.display="block")})),(0,s.Xq)(["dragleave","drop"],i,(e=>{i.style.display="none"})),(0,s.wu)("drop",i,(e=>{if(!(0,r.rC)()){var i,s;const n=Array.from(null!==(i=null===(s=e.dataTransfer)||void 0===s?void 0:s.files)&&void 0!==i?i:[]);v.xV.fire({toUser:t,files:n})}}))}},7660:(e,t,i)=>{"use strict";i.d(t,{_:()=>u});var s,n=i(7623),o=i(213),r=i(3955),a=i(4947),l=i(1372),h=i(6318),d=i(3885),c=i(3172);class u{constructor(e){var t;this.mediasetProps=e,this.element=(0,l.tT)("div",null),this.unopened=new Map,this.thumbnails=new Map,m||(h.C0.listen((e=>{u.deleteMediasetsMedia(e)})),m=!0),u.messageLedger.has(e.messageId)||u.messageLedger.set(e.messageId,[]),null===(t=u.messageLedger.get(e.messageId))||void 0===t||t.push(this),this.mediasetProps.mediaList.forEach((e=>{var t;const i=this.createThumbnail(e);this.element.appendChild(i),this.thumbnails.set(e.mediaId,i),u.mediaLedger.has(e.mediaId)||u.mediaLedger.set(e.mediaId,[]),null===(t=u.mediaLedger.get(e.mediaId))||void 0===t||t.push(this)}))}createThumbnail(e){if(""===e.url){const e=(0,l.tT)("div",{style:c.wt});return p(e),e}let t,i,s=!1;return t=(0,l.tT)("div",{style:c.wt},(0,l.tT)(d._,{extraStyle:{background:"rgba(0,0,0,0.6)"}}),(0,l.tT)("img",{src:e.thumbnailUrl,ref:e=>i=e,style:{position:"absolute",maxHeight:"100%"},onLoad:()=>{if(s=!0,!0!==e.opened)if(this.mediasetProps.outgoing){const i=function(){const e=document.createElement("span");return e.innerText=a.R.unopenedCAPS,(0,r.ZM)(e,{color:"#FFFFFF",backgroundColor:"#2067AB",fontFamily:"'UbuntuBold', Arial, Helvetica, sans-serif",fontSize:"8px",position:"absolute",bottom:"2px",right:"2px",padding:"0px 1px",zIndex:1}),e}();this.unopened.set(e.mediaId,i),t.appendChild(i)}else{const s=function(e){const t=document.createElement("canvas"),i=t.getContext("2d"),s=e.width,n=e.height;t.width=s,t.height=n;return i.drawImage(e,0,0,8,8),i.imageSmoothingEnabled=!1,i.drawImage(t,0,0,8,8,0,0,t.width,t.height),t}(i);s.style.zIndex="1000",s.style.position="absolute",this.unopened.set(e.mediaId,s),t.insertBefore(s,t.firstChild)}},onError:async e=>{(0,n.lT)()&&(await new Promise((e=>window.setTimeout(e,300))),s)||p(t)}})),t.onclick=()=>{const t={...this.mediasetProps,mediaList:[...this.mediasetProps.mediaList]};c.fY.loadMedia(t,e)},t}static markOpened(e,t){var i;const s=null!==(i=u.messageLedger.get(e))&&void 0!==i?i:[];for(const e of s)if(void 0!==e){var n;const i=e.unopened.get(t);null==i||null===(n=i.parentElement)||void 0===n||n.removeChild(i),e.unopened.delete(t)}}deleteMedia(e){this.mediasetProps.mediaList=this.mediasetProps.mediaList.filter((t=>t.mediaId!==e));const t=this.thumbnails.get(e);void 0!==t&&p(t)}static deleteMediasetsMedia(e){for(const i of null!==(t=u.mediaLedger.get(e))&&void 0!==t?t:[]){var t;i.deleteMedia(e)}}}function p(e){const t=(0,l.tT)("img",{src:`${STATIC_URL_ROOT}images/no_thumbnail_1.jpg`,style:{position:"absolute",maxHeight:"100%",left:"-9px"}});for(;null!==e.firstChild;)e.removeChild(e.firstChild);e.appendChild(t),e.onclick=()=>{(0,o.Q$)(a.R.errorLoadingMedia)}}(s=u).messageLedger=new Map,s.mediaLedger=new Map;let m=!1},5728:(e,t,i)=>{"use strict";i.d(t,{b3:()=>p,od:()=>c,sV:()=>u,yA:()=>d});var s=i(2709),n=i(8423),o=i(4947),r=i(1372),a=i(9461),l=i(8039),h=i(268);const d=new n.c_("goPMList"),c=new n.c_("ignoreUser");class u extends s.u{constructor(e,t){super();const i={margin:"0 8px",display:t===a.Aw.getState().room?"none":"",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"};this.element=(0,r.tT)("div",{colorClass:"PMControlBar",style:{width:"100%",height:"31px",lineHeight:"32px",borderBottomWidth:"1px",borderBottomStyle:"solid",fontSize:"12px",justifyContent:"flex-start"},id:"pm-control-bar"},(0,r.tT)("span",{colorClass:"backButton",style:{marginLeft:"10px",cursor:"pointer"},onClick:()=>{d.fire(e)},"data-testid":"back-to-conversation-list-button"},o.R.back),(0,r.tT)("span",{style:i,title:o.R.ctrlLToClose},o.R.ctrlLToClose),(0,l.It)()&&(0,r.tT)(h.i,{classRef:e=>this.inRoomIndicator=e,username:t,style:{marginTop:"8px"}})),this.element.classList.add("pm-control-bar")}dispose(){var e;null===(e=this.inRoomIndicator)||void 0===e||e.dispose()}}class p{constructor(){this.showing=!1,this.getElement=()=>this.element,this.isShowing=()=>this.showing,this.hideLoading=()=>{this.element.style.display="none",this.showing=!1},this.showLoading=()=>{this.element.style.display="block",this.showing=!0},this.element=(0,r.tT)("div",{style:{display:"none",textAlign:"center"}},o.R.loadingMoreMessages)}}},4564:(e,t,i)=>{"use strict";i.d(t,{I:()=>c});var s=i(7623),n=i(1519),o=i(2709),r=i(8423),a=i(7407),l=i(4947),h=i(1372),d=i(9461);class c extends o.u{constructor(e){super("div",e),this.listenerGroup=new r.gt,this.events={navigateSuggestions:new r.c_("navigateSuggestions"),openCurrentSuggestion:new r.c_("openCurrentSuggestion"),inputChange:new r.c_("inputChange"),suggestionActiveEvent:new r.c_("suggestionActiveEvent")},this.value="",this.events.suggestionActiveEvent.listen((e=>{const t=e.slug;this.input.value=""===t?this.value:t})).addTo(this.listenerGroup),this.debouncer=new n.a((()=>{const t=this.value.match(/^[\w-]*$/);this.events.inputChange.fire({isFullVideo:e.isFullVideoMode,isValid:null!==t,prefix:this.value})}),{bounceLimitMS:100,debounceType:1})}initUI(e){const t={background:"none",height:"24px",borderWidth:"1px",borderStyle:"solid",boxSizing:"border-box",borderRadius:"3px",margin:"0",padding:"5px 22px 5px 8px",width:"100%",outline:"none",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",fontSize:d.Bm.current.isMobile?"16px":"12px"},i={height:"1em",margin:"auto",position:"absolute",right:"10px",top:d.Bm.current.isMobile?"7px":"10px"};this.element=(0,h.tT)("div",{colorClass:"SearchBar",style:{position:"relative",width:"100%",padding:"4px",boxSizing:"border-box",borderBottomWidth:"1px",borderBottomStyle:"solid"}},(0,h.tT)("input",{colorClass:"searchUserInput",className:"search_autocomplete","data-testid":"username-search",type:"text",placeholder:l.R.searchUsers,style:t,onFocus:()=>{const t=""===e.room?"PMWindow":"PMTab";(0,a.bT)("PMSearchStarted",{location:t})},onKeyDown:e=>{!function(e){return"ArrowDown"===e.key||"ArrowUp"===e.key||40===e.keyCode||38===e.keyCode}(e)?"Enter"!==e.key&&13!==e.keyCode||(e.preventDefault(),(0,s.Xb)()&&this.input.blur(),this.events.openCurrentSuggestion.fire(void 0)):(e.preventDefault(),this.events.navigateSuggestions.fire({event:e}))},onInput:()=>{const e=this.input.value.toLowerCase();this.value=e,this.input.value=e,this.debouncer.callFunc()},ref:e=>this.input=e}),(0,h.tT)("img",{src:`${STATIC_URL}pms/icon-search.svg`,alt:"Search",style:i}))}getInput(){return this.input}focus(){this.input.focus()}render(){return this.element}clear(){this.input.value=""}dispose(){this.listenerGroup.removeAll()}}},1885:(e,t,i)=>{"use strict";i.d(t,{BM:()=>r,H4:()=>o,J9:()=>n,Si:()=>l,ot:()=>h,wl:()=>a});var s=i(8423);const n=new s.c_("privateMessage"),o=new s.c_("directMessage"),r=new s.c_("showPmSession"),a=new s.c_("closePmSession"),l=new s.c_("allPmsRead"),h=new s.c_("allDmsRead")},753:(e,t,i)=>{"use strict";i.d(t,{X:()=>l});var s=i(6784),n=i(6144),o=i(1372),r=i(816),a=i(9937);class l extends r.D0{constructor(e){super(e)}initializeData(e){super.initializeData(e),this.choices=void 0===e.choices?[]:e.choices,this.currentValues=void 0===e.defaultValue?[]:e.defaultValue}getValue(){return this.currentValues.join(",")}createField(){return this.activeChoicesContainer=(0,o.tT)("div",{className:"activeChoicesContainer","data-testid":"multiSelectActiveChoices",tabIndex:0},(0,o.tT)("div",{className:"dropdownMenuIcon"})," ",this.currentValues.map((e=>this.createActiveChoice(e)))),this.activeChoicesContainer}initCheckboxesDropdown(){this.checkboxesDropdown=new h(this.activeChoicesContainer,{choices:this.choices,defaultValue:this.currentValues,fieldName:this.name,disabled:this.disabled,handleCheckboxChange:(e,t)=>{this.handleCheckboxChange(e,t)}})}handleCheckboxChange(e,t){e.target.checked?(this.currentValues.push(t),this.activeChoicesContainer.appendChild(this.createActiveChoice(t))):(this.currentValues=this.currentValues.filter((e=>e!==t)),this.removeActiveChoice(t))}createActiveChoice(e){var t;return(0,o.tT)("div",{className:"activeChoiceElement","data-testid":"multiSelectActiveChoice","data-value":e},null===(t=this.choices.find((t=>String(t.value)===e)))||void 0===t?void 0:t.label)}removeActiveChoice(e){const t=this.activeChoicesContainer.querySelector(`[data-value="${e}"]`);t&&this.activeChoicesContainer.removeChild(t)}assembleField(){this.widget=this.createField(),this.initCheckboxesDropdown(),this.widgetContainer.appendChild(this.widget),this.widgetContainer.appendChild(this.checkboxesDropdown.element)}afterAssembleField(){super.afterAssembleField(),this.getHelpTextElement().classList.add("helpText"),this.getWidgetContainer().classList.add("multiSelectDropdown"),(0,s.wu)("keydown",this.widgetContainer,(e=>{"Escape"===e.code&&this.checkboxesDropdown.hideElement(e)}))}}class h extends n.v{constructor(e,t){super(e,!0,t)}initData(e){this.checkboxes=[],this.choices=e.choices,this.defaultValue=e.defaultValue,this.fieldName=e.fieldName,this.disabled=e.disabled}initUI(e){super.initUI(e),this.element=(0,o.tT)("div",{className:"checkboxesDropdown","data-testid":"multiSelectCheckboxesDropdown",style:{display:"none"}},this.choices.map((t=>(0,o.tT)("label",{className:"checkboxFieldLabel"},this.createCheckbox(t.value,e.handleCheckboxChange),String(t.label)))))}createCheckbox(e,t){const i=-1!==this.defaultValue.indexOf(String(e)),s=new a.m(16,i);return s.setName(this.fieldName),s.setCheckboxValue(String(e)),this.disabled&&s.disable(),this.checkboxes.push(s),void 0!==t&&s.element.addEventListener("change",(i=>{t(i,String(e))})),s.element}showElement(e,t){const i=this.toggleElement;return null!==i&&(null==i||i.classList.add("dropdown-shown")),super.showElement("flex")}hideElement(e){const t=this.toggleElement;return null!==t&&(null==t||t.classList.remove("dropdown-shown")),super.hideElement()}}},7209:(e,t,i)=>{"use strict";i.d(t,{w:()=>T,J:()=>C});var s=i(7063),n=i(213),o=i(6844),r=i(2939),a=i(82),l=i(8423),h=i(7407),d=i(1452),c=i(4947),u=i(9461),p=i(6064),m=i(7537),g=i(1372);class v extends m.o{constructor(e){super(e),this.defineTabbableElements([this.okButton])}createElement(){return(0,g.tT)("div",{className:"promoteDisabledModal"},(0,g.tT)("div",{className:"title"},c.R.promotionUnavailableTitle),(0,g.tT)("div",{className:"description"},c.R.promotionUnavailableDescription),(0,g.tT)("div",{className:"buttonDiv"},(0,g.tT)("div",{className:"okButton","data-testid":"promotion-disabled-accept",onClick:()=>{this.hide()},ref:e=>{this.okButton=e}},c.R.confirmOK)))}}var f=i(8861),y=i(1474),b=i(2650);class w extends m.o{constructor(e){super(e),this.props=e,this.defineTabbableElements([this.notNotButton,this.acceptButton])}createElement(e){return(0,g.tT)("div",{className:"promoteRoomConfirmation"},(0,g.tT)("div",{className:"title"},c.R.promotionConfirmTitle),(0,g.tT)("div",{className:"description"},c.R.promotionConfirmDescription),(0,g.tT)("div",{className:"price",ref:e=>{this.priceText=e}},`${c.R.userPromotionCurrentPriceLabel}:`),(0,g.tT)("div",{className:"buttonDiv"},(0,g.tT)("div",{className:"notNowButton","data-testid":"promote-confirm-notnow",onClick:()=>{this.hide()},ref:e=>{this.notNotButton=e}},c.R.notNowText),(0,g.tT)("div",{className:"promoteButton","data-testid":"promote-confirm-accept",onClick:()=>{this.promoteRoom(),this.hide()},ref:e=>{this.acceptButton=e}},c.R.promotionConfirmPromoteText)))}setPrice(e){this.setState({price:e}),this.priceText.textContent=c.R.promotionConfirmPriceText(this.state.price)}promoteRoom(){const e=new FormData;e.append("csrfmiddlewaretoken",(0,f.I7)("csrftoken")),e.append("token_price",`${this.state.price}`),e.append("slug",this.props.slug),new URLSearchParams(window.location.search).forEach(((t,i)=>{e.append(t,i)})),b._.submitPromotion(e).then((e=>{const t=new s.N6(e.responseText);y.D.fire({tokens:t.getNumber("token_balance")}),(0,h.bT)("ViewerPromoteConfirmSuccess")})).catch((e=>{const t=new s.N6(e.xhr.responseText),i=t.getStringOrUndefined("detail"),o=t.getStringOrUndefined("code");void 0!==i&&("pending"===o?this.props.showDisabledFunc():(0,n.Q$)(i)),(0,d.h5)(e),(0,h.bT)("ViewerPromoteConfirmFail",{status:null!=o?o:`${e.xhr.statusText} (${e.xhr.status})`,detail:null!=i?i:`${e.xhr.responseText} (${e.toString()})`})}))}}const C=new l.c_("userPromotionPush"),S=["too_soon","unauthorized"],x=new Set(["unknown","notconnected"]);class T extends a.b{constructor(e){super(e),this.listenerGroup=new l.gt,(0,o.ok)()||(r.X0.listen((e=>{let t=!1;const i=e=>{const i=this.state.roomStatus;this.setState({...this.state,roomStatus:e}),["privatenotwatching","away","privatewatching","hidden","passwordprotected"].includes(i)&&this.state.eligibility===b.S.ACCOUNT_INELIGIBLE?t&&this.refreshData():this.updateActiveState()};var s;this.slug=e.dossier.room,i(e.dossier.roomStatus),void 0===this.statusChangeListener&&(this.statusChangeListener=e.chatConnection.event.statusChange.listen((e=>{i(e.currentStatus)})),null===(s=this.statusChangeListener)||void 0===s||s.addTo(this.listenerGroup)),this.refreshData().then((()=>{t=!0})).catch((e=>{(0,d.h5)(e)}))})).addTo(this.listenerGroup),C.listen((()=>{this.promotionStartUpdate()})).addTo(this.listenerGroup))}initData(e){super.initData(e),this.setState({eligibility:b.S.ACCOUNT_INELIGIBLE,price:0,isActive:!1,roomStatus:"unknown"})}refreshData(){const e=new URLSearchParams(window.location.search);return e.set("slug",this.slug),b._.promotionPrice(e.toString()).then((e=>{const t=new s.N6(e.responseText),i=t.getString("eligibility"),n=t.getNumber("token_price");this.setState({...this.state,eligibility:i,price:n}),this.updateActiveState()})).catch((e=>{(0,d.h5)(e)}))}updateActiveState(){var e;const t="public"===this.state.roomStatus&&this.state.eligibility===b.S.ELIGIBLE;var i;t||!0!==(null===(e=this.confirmModal)||void 0===e?void 0:e.isShown())||null===(i=this.confirmModal)||void 0===i||i.hide(),this.setState({...this.state,isActive:t})}clickHandler(){(0,h.bT)("ViewerPromoteLinkClick",{activeState:`${this.state.isActive}`}),(0,o.ok)()?(0,p.DC)({fromFeature:!0}):"public"===this.state.roomStatus?u.Bm.current.isNoninteractiveUser?(0,n.Q$)(c.R.internalStaffPromotion):this.refreshData().then((()=>{this.state.isActive?this.showConfirmationModal():this.state.eligibility===b.S.PURCHASER_INELIGIBLE?(0,n.Q$)(c.R.promotionIneligibleUserMessage):this.showDisabledModal()})).catch((e=>{const t=new s.N6(e.xhr.responseText),i=t.getStringOrUndefined("code"),o=t.getStringOrUndefined("detail");S.includes(null!=i?i:"")&&void 0!==o?(0,n.Q$)(o):(0,n.Q$)(c.R.feedbackUnknownError),(0,h.bT)("ViewerPromoteRefreshError",{status:null!=i?i:e.xhr.statusText,detail:null!=o?o:e.xhr.responseText})})):(0,n.Q$)(x.has(this.state.roomStatus)?c.R.promotionUnavailableTitle:c.R.promotionUnavailableOffline)}showDisabledModal(){void 0===this.unavailableModal&&(this.unavailableModal=new v({})),this.unavailableModal.show()}showConfirmationModal(){void 0===this.confirmModal&&(this.confirmModal=new w({slug:this.slug,showDisabledFunc:()=>{this.showDisabledModal()}})),this.confirmModal.setPrice(this.state.price),this.confirmModal.show(),(0,h.bT)("ViewerPromoteConfirmShow")}promotionStartUpdate(){this.setState({...this.state,eligibility:b.S.ACTIVE}),this.updateActiveState(),window.setTimeout((()=>{this.setState({...this.state,eligibility:b.S.ELIGIBLE}),this.updateActiveState()}),33e4)}dispose(){this.listenerGroup.removeAll()}getRoomStatusState(){return this.state.roomStatus}}},2650:(e,t,i)=>{"use strict";i.d(t,{S:()=>s,_:()=>o});var s,n=i(5216);class o{static promotionPrice(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,n.Aw)(`promotion/api/promote_price/?${e}`,{timeout:2e4})}static promotionState(){return(0,n.Aw)("promotion/api/promotion_info/")}static submitPromotion(e){return(0,n.KF)("promotion/api/purchase_promotion/",e)}static promotionReport(){return(0,n.Aw)("promotion/api/promotion_report/")}}!function(e){e.ELIGIBLE="ELIGIBLE",e.ACCOUNT_INELIGIBLE="ACCOUNT_INELIGIBLE",e.PURCHASER_INELIGIBLE="PURCHASER_INELIGIBLE",e.ROOM_STATUS_OFFLINE="ROOM_STATUS_OFFLINE",e.PENDING_START="PENDING_START",e.PENDING_FINISH="PENDING_FINISH",e.ACTIVE="ACTIVE"}(s||(s={}))},4184:(e,t,i)=>{"use strict";i.d(t,{BL:()=>r,pR:()=>a});var s=i(1329);const n="",o="xx";function r(e){let t=function(e){var t,i;const o=s.find((t=>t.code===e));return{flagCode:null!==(t=null==o?void 0:o.code)&&void 0!==t?t:n,flagName:null!==(i=null==o?void 0:o.name)&&void 0!==i?i:n}}(e);return t.flagCode===o&&(t={flagCode:n,flagName:n}),t}function a(e){return["ru",o,n].includes(e)}},1816:(e,t,i)=>{"use strict";i.d(t,{I0:()=>o,Kn:()=>r,Nj:()=>d,bw:()=>l,cO:()=>h,kD:()=>a});var s=i(6624),n=i(4947);const o="hpfltopen",r=["regions","tags","ageMin","ageMax","privatePrices","roomSize"],a=(s.AGE_FILTER_KEY,s.REGION_FILTER_KEY,s.ROOM_SIZE_FILTER_KEY,s.TAG_FILTER_KEY,s.PRIVATE_PRICES_FILTER_KEY,[{name:n.R.northAmericaTitle,queryParamValue:s.Region.NorthAmerica},{name:n.R.southAmericaTitle,queryParamValue:s.Region.SouthAmerica},{name:n.R.asiaTitle,queryParamValue:s.Region.Asia},{name:n.R.europeRussiaTitle,queryParamValue:s.Region.EuropeRussia},{name:n.R.otherTitle,queryParamValue:s.Region.Other}]),l=[{name:n.R.hmpgFilterOpt6To18TksAbbrev,queryParamValue:s.PrivatePrices.Range6to18},{name:n.R.hmpgFilterOpt30TksAbbrev,queryParamValue:s.PrivatePrices.Range30to42},{name:n.R.hmpgFilterOpt60TksAbbrev,queryParamValue:s.PrivatePrices.Range60to72},{name:n.R.hmpgFilterOpt90TksAbbrev,queryParamValue:s.PrivatePrices.Range90Plus}],h=[{name:n.R.hmpgFilterOpt6TksAbbrev,queryParamValue:s.PrivatePrices.Value6},{name:n.R.hmpgFilterOpt12To18TksAbbrev,queryParamValue:s.PrivatePrices.Range12to18},{name:n.R.hmpgFilterOpt30TksAbbrev,queryParamValue:s.PrivatePrices.Range30to42},{name:n.R.hmpgFilterOpt60TksAbbrev,queryParamValue:s.PrivatePrices.Range60to72},{name:n.R.hmpgFilterOpt90TksAbbrev,queryParamValue:s.PrivatePrices.Range90Plus}],d=[{name:n.R.intimateRoomSizeCategory,labelText:n.R.intimateRoomsLabel,queryParamValue:s.RoomSize.SMALL},{name:n.R.midSizeRoomSizeCategory,labelText:n.R.midSizeRoomsLabel,queryParamValue:s.RoomSize.MEDIUM},{name:n.R.hiTrafficRoomSizeCategory,labelText:n.R.hiTrafficRoomsLabel,queryParamValue:s.RoomSize.LARGE}]},878:(e,t,i)=>{"use strict";i.d(t,{AV:()=>u,KM:()=>c,fk:()=>d,xX:()=>h});var s=i(6624),n=i(1048),o=i(2758),r=i(2945),a=i(6615),l=i(1816);function h(e){(0,o.aR)(l.I0,String(e),s.N_DAYS_HOMEPAGE_FILTERS_CACHE_EXP)}function d(){return"false"!==(0,o.y1)(l.I0)}function c(){const e=(0,n.Bg)();return e===n.YT.Trans?n.YT.OldTrans:e}function u(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=function(){const e=new URL(a.T.current.convertStateToUrl((0,s.getFilterPanelPartialState)())),t=(0,r.JO)(e.search),i=(0,s.getPageHashtag)();return void 0!==i&&(t[s.TAG_FILTER_KEY]=i),0===Object.keys(t).length?"":`?${(0,r.Go)(t)}`}();void 0!==window.sessionStorage&&window.sessionStorage.setItem(s.FILTER_PANEL_SELECTED_PARAMS_CACHE_KEY,t),e||(0,o.aR)(s.FILTER_PANEL_SELECTED_PARAMS_CACHE_KEY,t,s.N_DAYS_HOMEPAGE_FILTERS_CACHE_EXP)}},836:(e,t,i)=>{"use strict";i.d(t,{$F:()=>a,Iq:()=>h,SU:()=>o,p5:()=>r});var s=i(4947);function n(e){return"unknown"!==l(e)}function o(e){return"rec_config"===l(e)}function r(e){return void 0!==e&&n(e)}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unknown";if(void 0!==e){const t=l(e);if(n(t))return"rec_config"===t?e.toLowerCase():t.toLowerCase()}return t}function l(e){if(e.startsWith("rec_config"))return"rec_config";switch(e){case"Recommended":return"Recommended";case"Recommended_popular":return"Recommended_popular";default:return"unknown"}}function h(e){switch(e){case"recommended":return s.R.recommendedCAPS;case"recommended_popular":return s.R.recommendedPopularCAPS;default:return e}}},5079:(e,t,i)=>{"use strict";i.d(t,{OM:()=>I,kb:()=>k,Eh:()=>E,ak:()=>A});var s,n=i(6784),o=i(4941),r=i(82),a=i(8451),l=i(8269),h=i(9268),d=i(4947),c=i(1372),u=i(9447),p=i(9461),m=i(7321),g=i(7596),v=i(4184),f=i(836),y=i(4801),b=i(6624),w=i(6615),C=i(878),S=i(9930);class x extends r.b{initUI(){for(const e of this.element.querySelectorAll("a"))(0,u.fZ)(e,u.aG.camSubjectTagColor),(0,n.wu)("click",e,(e=>{S.XS.fire(e),(0,b.isHomepageFiltersActive)()&&(0,C.AV)()})),(0,b.shouldShowHomepageFilters)()&&(e.href=w.T.current.getURLFromPartialURL(e.href));(0,b.shouldShowHomepageFilters)()||(0,m.T1)(this.element)}createElement(e){const t=(0,c.tT)("ul",{className:`subject ${u.aG.camSubjectColor}`},(0,c.tT)("li",{dangerouslySetInnerHTML:{__html:e.subject}}));return t.title=t.textContent,t}}class T extends r.b{createElement(e){const t=e.roomInfo.viewers,i=t>-1?d.R.numViewerOrViewers(t):"",s=""!==i&&""!==e.roomInfo.timeOnline;return(0,c.tT)("div",{className:"details"},(0,c.tT)("div",{className:"cardTitle title"},(0,a.HK)((0,c.tT)("a",{href:`/${e.roomInfo.room}/`,"data-room":e.roomInfo.room,"data-room-nav":"true","data-testid":"room-card-username"},e.roomInfo.room)),(0,c.tT)("div",{className:"age_gender_container"},(0,c.tT)("span",{className:"age","data-testid":"room-card-age"},e.roomInfo.displayAge),(0,c.tT)("span",{className:`${u.aG.camAltTextColor} ${T.getGenderClassName(e.roomInfo.gender)}`,title:d.R.genderSymbolToIconTitle(e.roomInfo.gender),"data-testid":"room-card-gender"}),e.roomInfo.countryCode&&(0,c.tT)("span",{className:"thumbnail_flag","data-testid":"room-card-thumbnail-flag"},(0,c.tT)(y.T,{component:"FlagIcon",componentProps:{countryCode:e.roomInfo.countryCode,countryName:e.roomInfo.countryName,"data-testid":"room-card-country"}})))),(0,c.tT)(x,{subject:e.roomInfo.subject}),(0,c.tT)("ul",{className:`sub-info ${u.aG.camAltTextColor}`},void 0!==e.roomInfo.location?(0,c.tT)("li",{className:"location",style:T.subInfoItemStyle,"data-testid":"room-card-location"},e.roomInfo.location):"",(0,c.tT)("li",{className:"cams "+(s?"":"no-viewers"),style:T.subInfoItemStyle},(0,c.tT)("span",{className:"time"+(-1===e.roomInfo.viewers?" time-since":"")},e.roomInfo.timeOnline),(0,c.tT)("span",{className:"comma"},s?", ":""),(0,c.tT)("span",{className:"viewers"},i))))}static getGenderClassName(e){return e.includes("t")?"genders":`gender${e}`}}function A(e){var t;const i=(e,t)=>{const i=e.getNumber(t,!1);return isNaN(i)?-1:i},s=e.getString("label",!1),n=e.getNumberOrUndefined("start_timestamp",!1),r=null===(t=e.getStringOrUndefined("country"))||void 0===t?void 0:t.toLowerCase(),{flagCode:a,flagName:l}=(0,v.BL)(r);return{room:e.getString("room",!1)||e.getString("username",!1),label:s,img:e.getString("img"),gender:e.getString("gender"),subject:e.getString("subject",!1)||e.getString("room_subject",!1),timeOnline:(0,o.tR)("offline"===s,0===n?void 0:n),viewers:Math.max(i(e,"viewers"),i(e,"num_users")),location:e.getStringOrUndefined("location"),displayAge:e.getStringWithNumbers("display_age",!1)||e.getStringWithNumbers("age",!1),isFollowing:e.getBoolean("is_following",!1,!1),isNew:e.getBoolean("is_new",!1,!1),isGaming:e.getBoolean("is_gaming",!1,!1),sourceName:(0,m.Ys)(e.getStringOrUndefined("source_name")),sourcePosition:e.getNumberOrUndefined("source_position"),sourceInfo:e.getStringOrUndefined("source_info"),startTimestamp:n,countryCode:a,countryName:l,extendedInfo:P(e)}}function P(e){var t;const i=new URL(window.location.href).searchParams;if(null!==(t=p.Bm.current)&&void 0!==t&&t.isInternal&&"1"===i.get("show_rankings"))return{score:e.getNumberOrUndefined("score"),scoreRank:e.getNumberOrUndefined("score_rank"),baseScore:e.getNumberOrUndefined("base_score"),baseRank:e.getNumberOrUndefined("base_rank"),satScore:e.getNumberOrUndefined("sat_score"),satPercent:e.getNumberOrUndefined("sat_percent"),defaultPenalty:e.getNumberOrUndefined("default_penalty"),manualPenalty:e.getNumberOrUndefined("manual_penalty"),numRegs:e.getNumberOrUndefined("num_regs"),coloredRegs:e.getNumberOrUndefined("colored_regs"),tipRate:e.getNumberOrUndefined("tip_rate")}}T.subInfoItemStyle={whiteSpace:"nowrap"};class k extends r.b{initUI(e){this.props=e,this.setImageStreamer(),(0,n.Xq)(["click","mousedown","touchstart"],this.element,(e=>{this.fireBeforeRoomClick(e)}))}fireBeforeRoomClick(e){e.target instanceof HTMLElement&&null!==e.target.getAttribute("data-room-nav")&&this.props.roomList.roomBeforeClickEvent.fire({index:this.props.roomIndex,roomInfo:this.props.roomInfo,event:e})}fireRoomClick(e){e.target instanceof HTMLElement&&null!==e.target.getAttribute("data-room-nav")&&this.props.roomList.roomClickEvent.fire({index:this.props.roomIndex,roomInfo:this.props.roomInfo,event:e})}onRoomClick(e){this.element.querySelector(`a[${l.rS}]`)?h.zG.listen((()=>this.fireRoomClick(e))):this.fireRoomClick(e)}blurThumbnail(e){e.roomInfo.img=e.roomInfo.img.replace("/riw/","/ribw/")}createElement(e){const t=(0,f.$F)(e.roomInfo.sourceInfo,e.roomInfo.label);return(0,S.PS)()&&this.blurThumbnail(e),(0,c.tT)("li",{className:`roomCard ${u.aG.camBgColor}`,"data-testid":"room-card",style:k.roomStyle,onClick:e=>this.onRoomClick(e)},(0,a.HK)((0,c.tT)("a",{href:`/${e.roomInfo.room}/`,"data-room-nav":"true","data-room":e.roomInfo.room},(0,c.tT)("img",{width:180,height:101,src:e.roomInfo.img,loading:"lazy","data-testid":"room-card-image",alt:e.roomInfo.room,"data-room-nav":"true",ref:e=>{this.img=e},className:"room_thumbnail"}))),(0,c.tT)(M,{roomLabel:t}),(0,c.tT)(T,{roomInfo:e.roomInfo}),this.createFollowStar(e))}createFollowStar(e){return(0,c.tT)(g.d,{slug:e.roomInfo.room,isFollowing:e.roomInfo.isFollowing,classRef:e=>this.followStar=e})}setImageStreamer(){(0,n.wu)("mouseenter",this.element,(()=>{(0,m.$r)()&&(this.img.removeAttribute("loading"),(0,m.DL)(this.props.roomInfo.room,this.img))})),(0,n.wu)("mouseleave",this.element,(()=>{(0,m.$r)()&&(0,m.Hy)(this.props.roomInfo.room)}))}afterRemovedFromParent(){(0,m.$r)()&&void 0!==this.props&&(0,m.Hy)(this.props.roomInfo.room),super.afterRemovedFromParent()}getRoomName(){return this.props.roomInfo.room}updateFollowStar(e){var t;null===(t=this.followStar)||void 0===t||t.setFollowing(e)}}(s=k).labelTextMap={promoted:d.R.promotedCAPS,recommended:d.R.recommendedCAPS,recommended_popular:d.R.recommendedPopularCAPS,offline:d.R.offlineCAPS,exhib:d.R.exhibitionistCAPS,new:d.R.newCAPS,private:d.R.inPrivateCAPS,gaming:d.R.gamingCAPS},s.labelClassMap={promoted:"thumbnail_label thumbnail_label_c_promoted",offline:"thumbnail_label thumbnail_label_offline",exhib:"thumbnail_label thumbnail_label_exhibitionist",new:"thumbnail_label thumbnail_label_c_new",private:"thumbnail_label_featured thumbnail_label_c_private_show",gaming:"thumbnail_label thumbnail_label_c_gaming",recommended:"thumbnail_label thumbnail_label_c thumbnail_label_recommender",recommended_popular:"thumbnail_label thumbnail_label_c thumbnail_label_recommender"},s.roomStyle={margin:"0 7px 7px 0"};const M=e=>{var t,i;const s=(0,f.SU)(e.roomLabel)?e.roomLabel:null!==(t=k.labelTextMap[e.roomLabel])&&void 0!==t?t:"",n=(0,f.SU)(e.roomLabel)?k.labelClassMap.recommended:null!==(i=k.labelClassMap[e.roomLabel])&&void 0!==i?i:"thumbnail_label";return(0,c.tT)("div",{className:n,"data-testid":"thumbnail-label"},s)};class R extends k{initUI(e){}createElement(e){return(0,c.tT)("li",{className:`roomCard placeholder ${u.aG.camBgColor}`,style:k.roomStyle,"data-testid":"room-card-placeholder"},(0,c.tT)("a",null,(0,c.tT)("div",{className:"room_thumbnail"})),(0,c.tT)("div",{className:"details"},(0,c.tT)("div",{className:"title"}," "),(0,c.tT)("div",{className:"subject"}," "),(0,c.tT)("div",{className:"sub-info"}," ")))}}const I={roomList:{},roomIndex:0,roomInfo:{},animate:!1},E=()=>new R(I)},8374:(e,t,i)=>{"use strict";i.d(t,{L:()=>f,y:()=>v});var s=i(6624),n=i(7063),o=i(6784),r=i(5216),a=i(82),l=i(8423),h=i(6716),d=i(4580),c=i(1452),u=i(1372),p=i(6262),m=i(9461),g=i(7321);class v extends a.b{constructor(e){super(e),this.rooms=[],this.pageShowCallback=()=>{this.updateFollowStars()},this.bindCachedFollowStarFix()}createElement(){return(0,u.tT)("ul",{className:"list"})}initData(e){this.listeners=new l.gt}initUI(e){super.initUI(e),this.roomListProps=e,this.roomClickEvent=new l.c_("roomClick"),this.listeners.add(this.roomClickEvent.listen((e=>{const t=e.event;t.ctrlKey||t.metaKey||t.shiftKey||(m.Bm.current.isMobile?d.VZ.fire(e.roomInfo.room):(e.event.preventDefault(),h.VZ.fire(e.roomInfo.room)))}))),this.roomBeforeClickEvent=new l.c_("roomBeforeClick"),this.listeners.add(this.roomBeforeClickEvent.listen((t=>{this.saveRoomListSourceCookie(t,e)}))),this.updateShowLocation(e.showLocation),this.listeners.add(p.yR.listen((e=>this.updateShowLocation(e))))}bindCachedFollowStarFix(){(0,o.Vo)("pageshow",window,this.pageShowCallback)}unbindCachedFollowStarFix(){(0,o.Pf)("pageshow",window,this.pageShowCallback)}saveRoomListSourceCookie(e,t){const i="un"===e.roomInfo.sourceName?t.roomListSource:e.roomInfo.sourceName;(0,g.sl)(e.roomInfo.room,i,e.index,this.getOptionalSourceInfo(e,t))}getOptionalSourceInfo(e,t){return{sourceIndex:void 0===t.sourceIndex?e.roomInfo.sourcePosition:t.sourceIndex(e),hashtag:void 0===t.hashtag?void 0:t.hashtag(e),sourceInfo:void 0===t.sourceInfo?void 0:t.sourceInfo(e)}}updateState(){super.updateState(),this.resetRooms()}resetRooms(){this.removeAllChildren(),this.rooms=[];const e=this.roomListProps.rooms();let t=!1;e.forEach(((e,i)=>{this.appendRoomCard(i+1,e),t=t||void 0!==e.location})),f(this.element,t&&this.showLocation)}appendRoomCard(e,t){const i=this.createRoomCard({roomList:this,roomIndex:e,roomInfo:t,animate:(0,g.$r)()});this.rooms.push(i),this.addChild(i)}updateShowLocation(e){this.showLocation=e,f(this.element,e)}updateFollowStars(){if(void 0===m.Bm.current.loggedInUser||(0,s.isFollowedCams)()||0===this.rooms.length)return;const e=this.rooms.map((e=>e.getRoomName())),t=`api/ts/follow/followed_usernames/?usernames=${encodeURIComponent(e.join(","))}`;(0,r.Aw)(t).then((e=>{const t=new n.N6(e.responseText).getStringList("followed_usernames"),i=new Set(t);this.rooms.forEach((e=>{e.updateFollowStar(i.has(e.getRoomName()))}))})).catch(c.h5)}dispose(){this.listeners.removeAll(),this.unbindCachedFollowStarFix()}}function f(e,t){t?e.classList.add("show-location"):e.classList.remove("show-location")}},9232:(e,t,i)=>{"use strict";i.d(t,{C:()=>u,y:()=>c});var s=i(6624),n=i(82),o=i(8423),r=i(9060),a=i(4947),l=i(1372),h=i(7995),d=i(6615);const c=new o.c_("updateNoResultsMessage");class u extends n.b{createElement(){return(0,l.tT)("div",{className:"searching-keyword",bind:{display:()=>!0!==this.state.filterPanelActive&&0===this.state.numRooms?"none":"block"}})}initData(e){this.listeners=new o.gt}initUI(){this.updateMessage(),this.listeners.add(h.DO.onSubmit.listen((e=>{this.updateMessage(e)}))),this.listeners.add(c.listen((e=>{0!==e.length&&this.updateNoSearchResultsMessage(e)}))),(0,r.rT)()&&d.T.current.listen(["keywords"],(e=>{this.updateMessage(e.keywords)}),this.element)}updateMessage(e){const t=(0,s.getPageHashtag)(),[i,n]=(0,s.extractKeywords)(e);if(0===i.length&&0===n.length)this.removeAllDOMChildren();else{const e=n.map((e=>`#${e}`));!(0,s.isHomepageFiltersActive)()&&Boolean(t)&&e.push(`#${t}`);const o=[...i,...e].join(" ");this.removeAllDOMChildren(),this.element.appendChild((0,l.tT)("p",null,a.R.searchResultsFor(o)))}}updateNoSearchResultsMessage(e){const t=document.querySelector(".endless_page_template .no-rooms-available");null!==t&&(t.textContent=this.constructNoResultsMessage(e))}constructNoResultsMessage(e){const t=(0,s.getPageHashtag)(),[i,n]=(0,s.extractKeywords)(e),o=n.map((e=>`#${e}`));Boolean(t)&&o.push(`#${t}`);const r=[...i,...o].join(" ");return a.R.noSearchResultsMatch(r)}dispose(){this.listeners.removeAll()}}},9930:(e,t,i)=>{"use strict";i.d(t,{Cb:()=>b,PS:()=>C,X9:()=>w,XS:()=>g,Xv:()=>v,jS:()=>f,v_:()=>p,wd:()=>m});var s=i(6624),n=i(7063),o=i(8861),r=i(8423),a=i(6440),l=i(7882),h=i(4947),d=i(5389),c=i(9461),u=i(1224);function p(){const e=[],t=(0,s.getPageHashtag)(),i=(0,l.Bg)(),o=(0,n.nx)(u.m.siteName);return void 0!==t&&e.push(h.R.roomlistPageTitleHashtag((0,n.nx)(t),o)),(0,s.isPremium)()&&e.push(h.R.roomlistPageTitlePremium(o)),i===l.YT.Female?e.push(h.R.roomlistPageTitleFemale(o)):i===l.YT.Male?e.push(h.R.roomlistPageTitleMale(o)):i===l.YT.Couple?e.push(h.R.roomlistPageTitleCouple(o)):i===l.YT.Trans||i===l.YT.OldTrans?e.push(h.R.roomlistPageTitleTrans(o)):void 0!==t||(0,s.isPremium)()||e.push(h.R.roomlistPageTitleDefault(o)),e.join(" ")}const m=new r.c_("genderFilterUpdateFromNav"),g=new r.c_("spaNavigation"),v=new r.c_("newSpaLoad"),f="data-roomlist-spa-nav",y="jnoldsms";function b(){(0,o.$G)(y,"1")}function w(e){return!(void 0!==e&&(e.classList.contains("nooverlay")||e.classList.contains("purchase_tokens")||"#"===e.getAttribute("href"))||void 0!==c.Bm.current.loggedInUser||"1"===(0,o.oD)(y))}function C(){if(!(0,a.f)("BlurThumbnails"))return!1;if(document.getElementsByClassName("entrance-terms--shown").length>0){const e=document.getElementById("entrance_terms_overlay");return null!==e?S(e)&&(0,d.T8)():(0,d.T8)(),!0}if(c.Bm.current.isAgeGated){const e=document.getElementById("age_gate_overlay");return null!==e?S(e)&&(0,d.T8)():(0,d.T8)(),!0}return!1}function S(e){return"none"===e.style.display||"hidden"===e.style.visibility||""!==e.style.opacity||""!==e.style.zIndex}},4054:(e,t,i)=>{"use strict";i.d(t,{p:()=>W,r:()=>G});var s=i(7063),n=i(7623),o=i(6784),r=i(213),a=i(5216),l=i(1134),h=i(1131),d=i(9332),c=i(8160),u=i(2709),p=i(7668),m=i(8423),g=i(1284),v=i(7407),f=i(338),y=i(580),b=i(1452),w=i(5424),C=i(2609),S=i(3957),x=i(74),T=i(4947),A=i(5389),P=i(1673),k=i(9447),M=i(9461),R=i(897);let I=[];function E(e){if(I.some((t=>t.getUserUid()===e)))return;const t=new R.eR(e);t.enterPresence(),I.push(t)}function L(e){void 0!==e?I=I.filter((t=>t.getUserUid()!==e||(t.leavePresence(),!1))):(I.forEach((e=>{e.leavePresence()})),I=[])}var D=i(369),B=i(3910),U=i(1585),F=i(5901);const _=9/16,N="smcPlayerSettings",O=new m.c_("stopCamRequest"),H=new m.c_("shutdownCamRequest");class W extends u.u{constructor(e){var t;super(),this.roomChatConn=e,this.camUserInfos=new Map,this.cams=new Map,this.dummyRoomStatusNotifier=new C.k(!1),this.noticeRateLimits=new Map,this.height=0,this.bottom=16,this.cachedBottom=this.bottom,this.right=16,this.width=208,this.numCams=0,this.listenedForPublicStatus=!1,this.viewCamFailedListeners=new Map,(0,k.fZ)(this.element,"SmcBroadcaster"),this.getSettingsLocalstorage(),this.element.style.display="none",this.element.style.width=`${this.width}px`,this.element.style.height="",this.element.style.position="fixed",this.element.style.right=`${this.right}px`,this.element.style.overflow="visible",this.element.style.zIndex=`${F.MS}`,this.recalcPosition(),(0,o.wu)("scroll",window,(()=>{this.recalcPosition()})),D.oO.listen((()=>{this.recalcPosition()})),this.playerContainer=document.createElement("div"),this.playerContainer.style.display="table-cell",this.playerContainer.style.verticalAlign="bottom",this.playerContainer.style.width="100%",this.element.appendChild(this.playerContainer),this.addDrag(),this.addResize();const i=null===(t=M.Bm.current.loggedInUser)||void 0===t?void 0:t.userUid;void 0!==i&&new R.cc(i).onMessage.listen((e=>{e.started?R.KD.fire(e):R.Oh.fire(e)}));const n=new Set;R.KD.listen((e=>{if(2!==this.getCamState(e.username)||n.has(e.username))return;n.add(e.username);let t=!1,i=!1,s=10;const o=R.Oh.listen((t=>{t.username===e.username&&(i=!0,o.removeListener())}),!1),r=window.setInterval((()=>{if(t||i||s<=0)return clearInterval(r),n.delete(e.username),o.removeListener(),void(t&&!i&&(this.camUserInfos.set(e.username,e),this.setCamState(e.username,1)));s-=1,(0,F.yC)(e.username).then((e=>{t=e})).catch(b.yZ)}),1e3);(0,F.yC)(e.username).then((e=>{t=e})).catch(b.yZ)})),R.Oh.listen((e=>{const t=e.username,i=this.cams.get(t);this.camUserInfos.set(e.username,e),void 0!==(null==i?void 0:i.player)&&this.stopViewingCam(t),this.setCamState(t,2)})),this.roomChatConn.event.statusChange.listen((e=>{"privatewatching"===e.currentStatus&&this.endAllCamsExcept(this.roomChatConn.getPrivateShowUser())})),window.setInterval((()=>{this.monitorInactive()}),3e4),P.WK.listen((t=>{if(t){if(!this.listenedForPublicStatus){const t=i=>{if("public"===i.currentStatus){e.event.statusChange.removeListener(t),this.listenedForPublicStatus=!0;const i=[],n=R.Oh.listen((e=>{i.push(e.username)}));(0,a.Aw)("api/ts/chat/share-my-cam/").then((e=>{const t=new s.N6(e.responseText).getList("shared_rooms");if(void 0!==t)for(const e of t)-1===i.indexOf(e.getString("username"))&&R.KD.fire((0,F.p8)(e));n.removeListener()})).catch(b.yZ)}};e.event.statusChange.listen(t)}}else this.stopAllCams(),this.listenedForPublicStatus=!1})),O.listen((e=>{this.stopViewingCam(e.username)})),H.listen((e=>{const t=this.cams.get(e);void 0!==(null==t?void 0:t.player)&&this.stopViewingCam(e),this.setCamState(e,2)})),(0,o.wu)("beforeunload",window,(()=>{this.stopAllCams()})),this.noticeRateLimitSetting=M.Aw.getState().userChatSettings.c2cNotificationLimit,x.EZ.listen((e=>{this.noticeRateLimitSetting=e.c2cNotificationLimit;for(const e of this.noticeRateLimits.keys())this.unsetNoticeRateLimit(e)})),B.c9.listen((()=>{this.recalcPosition()})),l.T.registerGenerator("smcBadge",(e=>this.createChatBadge(e)))}static getOrCreateInstance(e){return void 0===W.singletonInstance&&(W.singletonInstance=new W(e)),W.singletonInstance}static getInstance(){return W.singletonInstance}addDrag(){(0,p.S)(this.playerContainer,((e,t,i)=>{const s=this.getCorrectedRight(this.right),n=this.getCorrectedBottom(this.bottom);let o=s,r=n;const a=t,l=i;let h=!1;return{enabled:!0,move:(e,t)=>{const i=e-a,d=t-l;!h&&(Math.abs(i)>5||Math.abs(d)>5)&&(h=!0,this.forEachPlayer(((e,t)=>{t.setDragging(!0)}))),r=this.getCorrectedBottom(n-d),o=this.getCorrectedRight(s-i),this.element.style.bottom=`${r}px`,this.element.style.right=`${o}px`,this.forEachPlayer(((e,t)=>{t.positionChanged()}))},end:()=>{this.right=o,this.bottom=r,this.cachedBottom=r,this.saveSettingsLocalstorage(),h=!1,window.setTimeout((()=>{this.forEachPlayer(((e,t)=>{t.setDragging(!1)}))}),100)}}}))}addResize(){!function(e,t){const i=t=>{const i=document.createElement("div");return i.style.position="absolute",i.style.cursor=t,i.style.backgroundColor="rgba(0, 0, 0, 0.01)",e.appendChild(i),i},s=i("nwse-resize");s.style.height="10px",s.style.width="10px",s.style.top="-5px",s.style.left="-5px";const n=i("nesw-resize");n.style.height="10px",n.style.width="10px",n.style.top="-5px",n.style.right="-5px";const o=i("nwse-resize");o.style.height="10px",o.style.width="10px",o.style.bottom="-5px",o.style.right="-5px";const r=i("nesw-resize");r.style.height="10px",r.style.width="10px",r.style.bottom="-5px",r.style.left="-5px";const a=i("ew-resize");a.style.height="calc(100% - 10px)",a.style.width="10px",a.style.top="5px",a.style.left="-5px";const l=i("ew-resize");l.style.height="calc(100% - 10px)",l.style.width="10px",l.style.top="5px",l.style.right="-5px";const h=i("ns-resize");h.style.height="10px",h.style.width="calc(100% - 10px)",h.style.left="5px",h.style.bottom="-5px";const d=i("ns-resize");d.style.height="5px",d.style.width="calc(100% - 10px)",d.style.left="5px",d.style.top="-5px",(0,p.S)(o,t(2)),(0,p.S)(r,t(3)),(0,p.S)(n,t(1)),(0,p.S)(s,t(0)),(0,p.S)(a,t(4)),(0,p.S)(l,t(5)),(0,p.S)(h,t(6)),(0,p.S)(d,t(7))}(this.element,(e=>(t,i,s)=>{t.stopPropagation();const n={initialBottom:this.bottom,initialRight:this.right,initialWidth:this.width,initialX:i,initialY:s,minWidth:200,ratio:_};let o=this.right,r=this.bottom,a=this.width;return{enabled:!0,move:(t,i)=>{const s=function(e,t,i,s){const n=function(e,t,i,s){switch(s){case 0:return e.ratio*(e.initialX-t+(e.initialY-i));case 1:return e.ratio*(e.initialY-i-(e.initialX-t));case 2:return e.ratio*(-(e.initialX-t)-(e.initialY-i));case 3:return e.ratio*(e.initialX-t-(e.initialY-i));case 4:return e.initialX-t;case 5:return-(e.initialX-t);case 6:return-(e.initialY-i)/e.ratio;case 7:return(e.initialY-i)/e.ratio}}(e,t,i,s),o=Math.min(Math.max(e.minWidth,e.initialWidth+n),.66*window.innerWidth),r=e.initialWidth-o;let a=e.initialBottom,l=e.initialRight;switch(s){case 1:l=e.initialRight+r;break;case 2:l=e.initialRight+r,a=e.initialBottom+r*e.ratio;break;case 3:a=e.initialBottom+r*e.ratio;break;case 4:a=e.initialBottom+r*e.ratio/2;break;case 5:l=e.initialRight+r,a=e.initialBottom+r*e.ratio/2;break;case 6:l=e.initialRight+r/2,a=e.initialBottom+r*e.ratio;break;case 7:l=e.initialRight+r/2}return{bottom:a,right:l,width:o}}(n,t,i,e);[o,r,a]=[s.right,s.bottom,s.width],o=this.getCorrectedRight(o,a),this.element.style.right=`${o}px`,this.element.style.width=`${a}px`,this.forEachPlayer(((e,t)=>{t.updateHeight()}));const l=this.element.offsetHeight;r=this.getCorrectedBottom(r,l),this.element.style.bottom=`${r}px`,this.forEachPlayer(((e,t)=>{t.positionChanged()}))},end:()=>{this.bottom=r,this.cachedBottom=r,this.right=o,this.width=a,this.height=this.element.getBoundingClientRect().height,this.saveSettingsLocalstorage()}}}))}getCorrectedBottom(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.height;return Math.max(0,Math.min(window.innerHeight-t,e))}getCorrectedRight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.width;return Math.max(0,Math.min(window.innerWidth-t,e))}recalcPosition(){const e=(0,U.N)();this.bottom=e>0?Math.max(this.cachedBottom,e+4):this.cachedBottom,this.element.style.bottom=`${this.getCorrectedBottom(this.bottom)}px`,this.element.style.right=`${this.getCorrectedRight(this.right)}px`}getSettingsLocalstorage(){if(!(0,n.Pf)())return;const e=window.localStorage.getItem(N);if(null!==e){const t=JSON.parse(e);this.bottom=t.bottom,this.cachedBottom=t.bottom,this.right=t.right,this.width=t.width}}saveSettingsLocalstorage(){if(!(0,n.Pf)())return;const e={bottom:this.bottom,right:this.right,width:this.width};window.localStorage.setItem(N,JSON.stringify(e))}startViewingCam(e){return this.unsetNoticeRateLimit(e),this.numCams>=5?((0,r.Q$)(T.R.showMyCamTooManyCams),(0,v.bT)("SharedCamViewStartFailed",{cam_user:e}),void(0,v.bT)("SharedCamViewStartTooManyCams",{cam_user:e})):2===this.getCamState(e)?(error("smcBroadcaster - no such cam"),void(0,v.bT)("SharedCamViewStartFailed",{cam_user:e})):void(0,F.yC)(e).then((t=>{t?(0,w.Bc)(e).then((t=>{const i=this.cams.get(e);if(void 0!==i&&void 0!==i.player)return;this.element.style.display="table";const s=new $(t,this.roomChatConn,this.dummyRoomStatusNotifier);this.playerContainer.appendChild(s.element),s.updateHeight(),s.startViewing(),this.numCams+=1,this.height=this.element.getBoundingClientRect().height,this.recalcPosition(),(0,v.bT)("SharedCamViewStarted",{cam_user:e,num_cams_open:this.numCams}),this.setCamState(e,1,s);const n=window.setTimeout((()=>{const t=this.cams.get(e);void 0!==(null==t?void 0:t.player)&&this.stopViewingCam(e),o.removeListener(),(0,v.bT)("SharedCamViewStartFailed",{cam_user:e})}),1e3*(y.Mc-1)),o=s.playerComponent.playbackStart.once((()=>{const i=this.cams.get(e);if(void 0!==i&&s===i.player){var o;this.setCamState(e,0,s),E(t.roomUid),null===(o=this.viewCamFailedListeners.get(e))||void 0===o||o.removeListener();const i=new R.eR(t.roomUid).onAuthFail.listen((()=>{0===this.getCamState(e)&&(this.stopViewingCam(e),(0,r.Q$)(T.R.showMyCamCouldNotView))}));this.viewCamFailedListeners.set(e,i),clearTimeout(n)}})),a=s.playerComponent.videoOfflineChange.listen((t=>{t&&(this.stopViewingCam(e),a.removeListener())}))})).catch(b.yZ):(this.setCamState(e,2),(0,r.Q$)(T.R.showMyCamCamOffline),(0,v.bT)("SharedCamViewStartFailed",{cam_user:e}))})).catch(b.yZ)}stopViewingCam(e){var t;null===(t=this.viewCamFailedListeners.get(e))||void 0===t||t.removeListener();const i=this.getCamState(e),s=this.cams.get(e);if((0,S.Nt)(!1,S.aw.SMC),void 0!==s&&void 0!==s.player){s.player.stopViewing(),this.setCamState(e,1);const t=s.player;void 0!==s.player.reportMenu?s.player.reportMenu.closeChatReportRequest.once((()=>{this.cleanUpCam(e,t)})):this.cleanUpCam(e,t)}else warn("stopViewingCam no player for cam",{camUser:e,state:i})}cleanUpCam(e,t){t.element.style.height="0",t.element.style.width="0",this.numCams-=1,this.height=this.element.getBoundingClientRect().height,this.recalcPosition(),0===this.numCams&&(this.element.style.display="none"),(0,v.bT)("SharedCamPlayerRemoved",{cam_user:e,num_cams_open:this.numCams})}forEachPlayer(e){for(const t of this.cams.keys()){const i=this.cams.get(t);void 0!==i&&void 0!==i.player&&e(t,i.player)}}stopAllCams(){this.forEachPlayer(((e,t)=>{this.stopViewingCam(e)}))}endAllCamsExcept(e){for(const t of this.cams.keys()){if(t===e)continue;const i=this.cams.get(t);void 0!==i&&void 0!==i.player&&this.stopViewingCam(t),this.setCamState(t,2)}}monitorInactive(){for(const e of this.cams.keys())2!==this.getCamState(e)&&(0,F.yC)(e).then((t=>{if(!t){const t=this.cams.get(e);void 0!==(null==t?void 0:t.player)&&this.stopViewingCam(e),this.setCamState(e,2)}})).catch(b.yZ)}getCamState(e){const t=this.cams.get(e);return void 0!==t?t.state:2}setCamState(e,t,i){const s=this.camUserInfos.get(e),n=this.getCamState(e);switch(t){case 2:this.cams.delete(e),this.camUserInfos.delete(e),2!==n&&(0,v.bT)("SharedCamViewerBroadcastStopped",{cam_user:e,num_cams_total:this.cams.size});break;case 1:this.cams.set(e,{state:1,player:i}),2===n&&(0,v.bT)("SharedCamViewerBroadcastStarted",{cam_user:e,num_cams_total:this.cams.size});break;case 0:void 0!==i?this.cams.set(e,{state:0,player:i}):error("smcBroadcaster - no player provided for active cam")}this.updateChatBadges(e),void 0!==s&&this.sendChatNoticeForStateChange(s,n,t)}sendChatNoticeForStateChange(e,t,i){if(t===i)return;let s;if(2===t&&2!==i&&(s=this.getCamStartNotice(e.username)),void 0!==s){const t=(0,g.W2)(this.roomChatConn.room(),e);this.roomChatConn.event.roomNotice.fire({messages:[[(0,d.H5)("User "===t?T.R.showMyCamSharingPrefix:t),(0,d.JH)(e),(0,d.H5)(s)]],showInPrivateMessage:!1})}}getCamStartNotice(e){const t=this.noticeRateLimits.get(e);if(!0!==(null==t?void 0:t.preventStartNotice))return this.setNoticeRateLimit(e),T.R.showMyCamStartedSharing}setNoticeRateLimit(e){let t,i;switch(this.noticeRateLimitSetting){case 0:t=!1;break;case 300:t=!0,i=window.setTimeout((()=>this.unsetNoticeRateLimit(e)),3e5);break;case-1:t=!0;break;default:error("smcBroadcaster - invalid rate limit setting",this.noticeRateLimitSetting),t=!1}this.noticeRateLimits.set(e,{preventStartNotice:t,timeout:i})}unsetNoticeRateLimit(e){const t=this.noticeRateLimits.get(e);void 0!==t?(window.clearTimeout(t.timeout),this.noticeRateLimits.set(e,{preventStartNotice:!1})):error("smcBroadcaster - no notice rate limit to unset")}getContextMenuLinkInfo(e){const t=this.getCamState(e);if(2===t)return{linkText:"",icon:"",action:()=>{}};const i=this.cams.get(e);let s,n,o;return n=1===t?`${STATIC_URL_ROOT}broadcastassets/inactive-cam.svg`:`${STATIC_URL_ROOT}broadcastassets/active-cam.svg`,void 0!==i&&void 0!==i.player?(s=T.R.showMyCamStopView,o=()=>{(0,v.bT)("SharedCamViewStopClicked",{cam_user:e}),this.stopViewingCam(e)}):(s=T.R.showMyCamView,o=()=>{(0,v.bT)("SharedCamViewStartClicked",{cam_user:e}),this.startViewingCam(e)}),{linkText:s,icon:n,action:o}}createChatBadge(e){const t=this.getCamState(e),i=document.createElement("img");return i.style.marginRight=".2em",i.style.height="1.2em",i.style.position="relative",i.title=T.R.sharingCam,2===t?i.style.display="none":i.src=1===t?`${STATIC_URL_ROOT}broadcastassets/inactive-cam.svg`:`${STATIC_URL_ROOT}broadcastassets/active-cam.svg`,i}updateChatBadges(e){const t=this.getCamState(e),i=l.T.getBadgeElements("smcBadge",e);let s="";1===t?s=`${STATIC_URL_ROOT}broadcastassets/inactive-cam.svg`:0===t&&(s=`${STATIC_URL_ROOT}broadcastassets/active-cam.svg`);for(let e=i.length-1;e>=0;e-=1){const t=i[e];t.src=s,t.style.display=""!==s?"":"none"}}}class $ extends f.N{constructor(e,t,i){super(!0,i),this.camDossier=e,this.roomChatConn=t,this.dragging=!1,this.hideAllTooltips=new m.c_("hideAllTooltips"),this.blockMouseEvent=e=>{e.stopPropagation()},this.element.dataset.testid="cam-to-cam-broadcast-panel",this.playerComponent.element.dataset.testid="cam-to-cam-video",this.watermark.style.visibility="hidden",this.element.style.position="relative",this.element.style.width="100%",this.element.style.minWidth="200px",this.element.style.backgroundColor="#000",this.element.style.border="1px solid #FFF",this.element.style.marginTop="-1px",this.element.style.overflow="visible",(0,o.wu)("mouseenter",this.element,(e=>{this.controls.style.display="block"})),(0,o.wu)("mouseleave",this.element,(e=>{this.controlsFrozen||(this.controls.style.display="none")}));let s=0;(0,o.wu)("touchstart",this.element,(e=>{"none"===this.controls.style.display?(this.controls.style.display="block",s=1):s+=1})),(0,o.wu)("touchend",this.element,(e=>{window.setTimeout((()=>{(s>1||this.dragging)&&!this.controlsFrozen&&(this.controls.style.display="none")}),0)})),(0,o.wu)("touchstart",document,(e=>{this.element.contains(e.target)||this.controlsFrozen||(this.controls.style.display="none")})),this.username=e.room,this.element.appendChild(this.createUsernameBar()),this.element.appendChild(this.createControls()),this.element.appendChild(this.createReportDiv())}startViewing(){this.chatConn=new h.Z(this.camDossier),this.playerComponent.handleRoomLoaded({dossier:this.camDossier,chatConnection:this.chatConn})}stopViewing(){var e;this.playerComponent.stop(),void 0===this.popoutWindow||this.popoutWindow.closed||this.popoutWindow.close(),this.chatConn.leaveRoom(),L(this.camDossier.roomUid),void 0!==this.reportMenu?(null!==(null===(e=this.usernameBar)||void 0===e?void 0:e.firstChild)&&(this.usernameBar.firstChild.textContent+=` ${T.R.showMyCamConnectionClosed}`),this.reportMenu.closeChatReportRequest.once((()=>{this.attemptRemoveFromDom()}))):this.attemptRemoveFromDom()}setDragging(e){this.dragging=e}reportCam(){const e=new V(this,this.username,this.roomChatConn);e.closeChatReportRequest.listen((e=>{void 0!==this.reportMenu&&(this.reportDiv.removeChild(this.reportMenu.element),this.reportMenu.tearDown(),this.reportMenu=void 0),e?((0,v.bT)("SharedCamReportSent",{cam_user:this.username}),this.attemptRemoveFromDom()):(this.reportDiv.style.display="none",this.controls.style.display="none",this.hideAllTooltips.fire(!0),this.freezeControls(!1))})),this.freezeControls(!0),this.reportDiv.appendChild(e.element),this.reportMenu=e,this.reportDiv.style.display="block",this.reportMenu.focusForm()}freezeControls(e){this.controlsFrozen=e,e?((0,o.wu)("mouseenter",this.element,this.blockMouseEvent,!0),(0,o.wu)("mouseleave",this.element,this.blockMouseEvent,!0)):((0,o.Pf)("mouseenter",this.element,this.blockMouseEvent,!0),(0,o.Pf)("mouseleave",this.element,this.blockMouseEvent,!0))}popoutCam(){if(void 0!==this.popoutWindow&&!this.popoutWindow.closed)return void this.popoutWindow.focus();const e=(screen.width/2-425).toString(),t=`resizable,dependent,scrollbars,height=768,width=850,top=${(screen.height/2-384).toString()},left=${e}`;(0,A.aH)(`/popout/${this.username}`,"_blank",t).then((e=>{this.popoutWindow=e})).catch(b.yZ)}attemptRemoveFromDom(){null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element)}createUsernameBar(){const e=document.createElement("div");e.style.position="absolute",e.style.bottom="0px",e.style.width="100%",e.style.height="auto",e.style.minHeight="20px",e.style.maxHeight="40px",e.style.color="#FFF",e.style.backgroundColor="rgba(0, 0, 0, 0.4)",e.style.zIndex=`${F.MS}`;const t=document.createElement("span");return t.style.zIndex=`${F.MS}`,t.textContent=this.username,t.style.fontFamily="UbuntuRegular",t.style.fontSize="12px",t.style.color="#EEE",t.style.position="relative",t.style.left="5px",t.style.bottom="-3px",e.appendChild(t),this.usernameBar=e,e}createControls(){const e=(0,F.ru)(),t=(0,F.uN)({iconAsset:"broadcastassets/close.svg",tooltipText:T.R.showMyCamCloseCam,iconSize:23,centerTop:"50%",onClick:()=>{this.controlsFrozen||this.dragging||((0,v.bT)("SharedCamViewStopClicked",{cam_user:this.username}),O.fire(this))},hideAllTooltips:this.hideAllTooltips});t.style.left="50%",t.style.transform="translateX(-50%) translateX(-50px)",e.appendChild(t);const i=(0,F.uN)({iconAsset:"tsdefaultassets/smc_popout.svg",tooltipText:T.R.showMyCamPopoutCam,iconSize:23,centerTop:"50%",onClick:()=>{this.controlsFrozen||this.dragging||this.popoutCam()},hideAllTooltips:this.hideAllTooltips});i.style.left="50%",i.style.transform="translateX(-50%)",e.appendChild(i);const s=(0,F.uN)({iconAsset:"broadcastassets/report.svg",tooltipText:T.R.showMyCamReportCam,iconSize:23,centerTop:"50%",onClick:()=>{this.controlsFrozen||this.dragging||this.reportCam()},hideAllTooltips:this.hideAllTooltips});return s.style.left="50%",s.style.transform="translateX(-50%) translateX(50px)",e.appendChild(s),this.controls=e,e}createReportDiv(){const e=document.createElement("div");return(0,k.fZ)(e,"reportDiv"),e.style.width="207px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.position="absolute",e.style.transform="translate(-100%, -100%) translateX(-5px)",e.style.borderRadius="4px",e.style.display="none",e.style.zIndex="999",e.style.fontWeight="normal",e.style.fontSize="12px",e.onmouseenter=()=>{e.style.cursor="default"},this.reportDiv=e,e}updateHeight(){this.element.style.height=this.element.offsetWidth*_+"px"}positionChanged(){this.element.getBoundingClientRect().left-this.reportDiv.offsetWidth<0?this.reportDiv.style.transform=`translateY(-100%) translateX(${this.element.offsetWidth+5}px)`:this.reportDiv.style.transform="translate(-100%, -100%) translateX(-5px)"}}class V extends c.n{constructor(e,t,i){super(t,void 0,i),this.cam=e,this.username=t,this.chatConnection=i,(0,o.wu)("touchstart",this.element,(e=>{e.stopPropagation()})),(0,o.wu)("mousedown",this.element,(e=>{e.stopPropagation()}))}categories(){return{public:T.R.showMyCamReportPublic,rude:T.R.showMyCamReportRude,intoxicated:T.R.showMyCamReportIntoxicated,sleeping:T.R.showMyCamReportSleeping,spam:T.R.showMyCamReportSpamming,underage:T.R.showMyCamReportUnderage,other:T.R.reportMessageOther}}reportEndpoint(){return`abuse/report/${this.username}/`}additionalFinishReportLinks(){const e=this.chatConnection.room(),t=document.createElement("button"),i=document.createElement("button");return(0,k.fZ)(t,k.aG.hrefColor),(0,k.fZ)(i,k.aG.hrefColor),t.textContent=T.R.silenceDurationMessage,i.textContent=T.R.kickBan,i.dataset.testid="kick-ban",t.onclick=i=>{i.preventDefault(),(0,a.KF)(`roomsilence/${this.username}/${e}/`,{}).catch((t=>{error("smcBroadcaster Unable to silence user",{room:e,username:this.username,reason:t.toString()}),(0,r.Q$)(`Error silencing user ${this.username}`)})),t.style.color="",t.style.cursor="",t.onclick=()=>{}},i.onclick=s=>{s.preventDefault(),(0,a.KF)(`roomban/${this.username}/${this.chatConnection.room()}/`,{}).catch((t=>{error("smcBroadcaster Unable to ban user",{room:e,username:this.username,reason:t.toString()}),(0,r.Q$)(T.R.banUserError(this.username))})),t.style.color="",t.style.cursor="",t.onclick=()=>{},i.style.color="",i.style.cursor="",i.onclick=()=>{}},[t,i]}onChatReportClosed(e){super.onChatReportClosed(e),e&&O.fire(this.cam)}}let z=!1;function G(e,t){var i;z||(z=!0,""!==e.roomUid&&new R.eR(e.roomUid).onAuthFail.listen((()=>{t.stop(),(0,r.Q$)(T.R.showMyCamCouldNotView),L(e.roomUid)})),!0===(null===(i=M.Bm.current)||void 0===i||null===(i=i.loggedInUser)||void 0===i?void 0:i.isBroadcasting)&&(L(),(0,a.Aw)("api/ts/chat/share-my-cam/").then((t=>{const i=new s.N6(t.responseText).getList("shared_rooms");if(void 0!==i)for(const t of i)t.getString("username")===e.room&&E(e.roomUid)})).catch(b.yZ)))}},5901:(e,t,i)=>{"use strict";i.d(t,{MS:()=>o,Rz:()=>d,Yc:()=>h,p8:()=>c,ru:()=>r,uN:()=>a,yC:()=>l});var s=i(6784),n=i(5216);const o=1003;function r(){const e=document.createElement("div");return e.style.position="absolute",e.style.width="100%",e.style.height="100%",e.style.top="0px",e.style.left="0px",e.style.display="none",e.style.zIndex=`${o+1}`,e.style.backgroundColor="rgba(0, 0, 0, .3)",e.style.boxShadow="0px 0px 4px rgba(0, 0, 0, 0.5)",e}function a(e){const t=Math.floor(e.iconSize/2),i=document.createElement("div");i.style.display="inline-block",i.style.position="absolute",i.style.width=i.style.height=`${e.iconSize}px`,i.style.top=`calc(${e.centerTop} - ${t}px)`;const n=document.createElement("img");n.src=`${STATIC_URL_ROOT}${e.iconAsset}`,n.style.position="relative",n.style.height="100%",n.style.width="100%",n.style.zIndex="1",i.appendChild(n);const o=document.createElement("div");o.style.position="absolute",o.style.display="none",o.style.width="39px",o.style.height="39px",o.style.top=`${-19+t}px`,o.style.left=`${-19+t}px`,o.style.borderRadius="4px",o.style.zIndex="0",o.style.backgroundColor="rgba(255, 255, 255, .25)";const r=document.createElement("div");r.textContent=e.tooltipText,r.style.position="relative",r.style.display="inline-block",r.style.top="42px",r.style.left="50%",r.style.transform="translateX(-50%)",r.style.padding="0px 7px",r.style.whiteSpace="nowrap",r.style.fontFamily="UbuntuRegular",r.style.fontSize="12px",r.style.color="#FFF",r.style.backgroundColor="rgba(0, 0, 0, .9)",r.style.border="1px solid #8A8A8A",o.appendChild(r),i.appendChild(o),void 0!==e.hideAllTooltips&&e.hideAllTooltips.listen((()=>{o.style.display="none"})),void 0!==e.onClick&&(n.style.cursor="pointer",(0,s.wu)("click",n,e.onClick)),(0,s.wu)("mouseenter",n,(()=>{o.style.display="block"})),(0,s.wu)("mouseleave",n,(()=>{o.style.display="none"}));let a=!1;const l=e=>{e.target!==n&&(o.style.display="none",a=!1,(0,s.Pf)("touchstart",document,l,!0))};return(0,s.wu)("touchstart",n,(t=>{a?void 0!==e.onClick&&(0,s.ck)("touchend",n,e.onClick):(o.style.display="block",a=!0,(0,s.wu)("touchstart",document,l,!0),t.preventDefault(),t.stopPropagation())})),i}function l(e){return(0,n.Aw)(`api/online/${e}/`).then((e=>JSON.parse(e.responseText).online))}function h(){return(0,n.Aw)("api/ts/chat/share-my-cam/").then((e=>{const t=JSON.parse(e.responseText).cam_room;return t.length>0?t[0]:""}))}function d(e){const t=()=>{h().then((i=>{""===i?e():window.setTimeout(t,5e3)})).catch((()=>{}))};t()}function c(e){return{username:e.getString("username"),isBroadcaster:!1,inFanclub:e.getBoolean("in_fanclub"),hasTokens:e.getBoolean("has_tokens"),isMod:e.getBoolean("is_mod"),tippedRecently:e.getBoolean("tipped_recently"),tippedALotRecently:e.getBoolean("tipped_alot_recently"),tippedTonsRecently:e.getBoolean("tipped_tons_recently"),exploringHashTag:"",sourceName:"df"}}},3956:(e,t,i)=>{"use strict";i.d(t,{fL:()=>N,Md:()=>W,n8:()=>$});var s=i(7063),n=i(7623),o=i(6784),r=i(213),a=i(5216),l=i(6844);var h=i(8806),d=i(7809),c=i(9332),u=i(2939),p=i(5020),m=i(7668),g=i(8423),v=i(9060),f=i(1779),y=i(2690),b=i(7407),w=i(1452),C=i(8331),S=i(4947),x=i(5389),T=i(20),A=i(9945),P=i(9447),k=i(9461),M=i(897),R=i(369),I=i(3910),E=i(1585),L=i(5901);const D=5e3,B="smcBroadcastSettings";let U,F,_;function N(){return U}(0,o.wu)("pageshow",window,(e=>{e.persisted&&void 0!==F&&F.stopCam()}));const O=new g.c_("showMyCamDidNotStart");function H(e,t,i){if(!(0,n.YU)()||!h.Y9.canUseWebRTC())return!1;let o;return u.X0.listen((n=>{if(void 0!==F&&n.chatConnection.room()!==F.roomChatConn.room()&&(F.cleanup(),F=void 0),n.chatConnection.viewerIsAnonymous())t.fire((()=>{(0,l.rC)()}));else{void 0===F&&(F=new z(n.chatConnection,e));const l=()=>{i.fire("starting"),t.fire((()=>{})),void 0!==o&&o.removeListener(),o=O.listen((()=>{i.fire("stopped"),t.fire(l)}),!1),(0,a.Aw)(`api/ts/chat/can-share-cam/${n.dossier.room}/`).then((e=>{const t=new s.N6(e.responseText);t.getBoolean("can_share")&&0===t.getStringList("shared_cam").length?void 0!==F&&F.startCam():(t.getBoolean("show_upsell")?(0,r.mf)(S.R.showMyCamMayNotShareUpsell,(()=>{const e=`/tipping/purchase_tokens/?source=${k.Bm.current.PurchaseEventSources.TOKEN_SOURCE_SHOW_MY_CAM}`;(0,b.bT)("SharedCamPurchaseTokensClicked"),(0,x.gr)(e,"_blank","height=615, width=850, scrollbars=1")})):t.getBoolean("is_private")?(0,r.Q$)(S.R.showMyCamMayNotShareIsPrivate):t.getStringList("shared_cam").length>0?((0,r.Q$)(S.R.showMyCamAlreadyBroadcasting),(0,b.bT)("SharedCamAlreadySharing")):(0,r.Q$)(t.getString("message")),O.fire(void 0))})).catch(w.yZ)};F.setOnStart((()=>{i.fire("started"),t.fire((()=>{(0,b.bT)("SharedCamBroadcastStopClicked"),void 0!==F&&F.stopCam(!0)}))})),F.setOnStop((()=>{i.fire("inactiveStopped"),t.fire((()=>{(0,v.c5)()||(0,r.Q$)(S.R.showMyCamCooldownAlert(D/1e3))})),window.setTimeout((()=>{i.fire("stopped"),t.fire((()=>{l()}))}),D)})),t.fire((()=>{l()}))}})),!0}function W(e,t){const i=new g.c_("requestChangeClickListener"),s=new g.c_("showMyCamStateChanged");return i.listen((t=>{k.Bm.current.isNoninteractiveUser?e.onclick=()=>{(0,r.Q$)(S.R.internalStaffC2C)}:e.onclick=t})),s.listen((t=>{switch(t){case"starting":case"inactiveStopped":e.textContent=S.R.showMyCamShow,e.style.opacity="0.5",e.style.cursor="default";break;case"started":e.textContent=S.R.showMyCamStop,e.style.opacity="1",e.style.cursor="pointer";break;case"stopped":e.textContent=S.R.showMyCamShow,e.style.opacity="1",e.style.cursor="pointer"}})),H(t,i,s)}function $(e,t){(0,v.c5)()||error("ff-ReplaceFullscreenWithIFS is not active");const i=new g.c_("requestChangeClickListener"),s=new g.c_("showMyCamStateChanged");return i.listen((t=>{k.Bm.current.isNoninteractiveUser?e.element.onclick=()=>{e.isDisabled()||(0,r.Q$)(S.R.internalStaffC2C)}:e.element.onclick=()=>{e.isDisabled()||t()}})),s.listen((t=>{switch(t){case"starting":V(e,S.R.showMyCamShow),e.disable();break;case"started":V(e,S.R.showMyCamStop),e.enable();break;case"inactiveStopped":V(e,S.R.showMyCamShow),(0,v.ng)()&&"offline"===_||(e.setTooltipTextOverride(S.R.showMyCamCooldownAlert(D/1e3)),e.disable());break;case"stopped":V(e,S.R.showMyCamShow),(0,v.ng)()&&"offline"===_||e.enable()}})),H(t,i,s)}function V(e,t){e.updateTextLabel(t),e.clearTooltipTextOverride(),(0,v.ng)()&&C.h4?e.setTooltipTextFromLabel():e.clearTooltipText()}class z{constructor(e,t){var i;this.onStartBroadcast=[],this.onStopBroadcast=[],this.listenerGroup=new g.gt,this.startBroadcast=()=>{if(void 0!==this.previewModal&&this.previewModal.hide(),(0,b.bT)("SharedCamBroadcastStartClicked"),this.roomOffline||this.chatOffline)return(0,r.Q$)(S.R.showMyCamMustBeConnected),void O.fire(void 0);const e=this.onStopBroadcast;this.onStopBroadcast=[],this.stopCam().then((()=>{this.onStopBroadcast=e;let t=!1;const i=window.setTimeout((()=>{void 0!==this.broadcastModal&&this.broadcastModal.stopBroadcast(),(0,b.bT)("SharedCamBroadcastStartTimedOut"),(0,r.Q$)(S.R.showMyCamBroadcastTimeoutError),error("smcViewer - timeout starting cam"),t=!0}),2e4);(0,a.KF)("api/ts/chat/share-my-cam/",{username:this.roomChatConn.room()}).then((()=>{if(!t){this.broadcastModal=new q(this.camDossier,this.constraints,this.broadcastStop,this.roomChatConn,i),this.broadcastModal.showBroadcast(),this.fullscreenChangeListener=f._c.listen(this.broadcastModal.showBroadcast);for(const e of this.onStartBroadcast)e()}})).catch((()=>{t||((0,r.Q$)(S.R.showMyCamBroadcastError),O.fire(void 0))}))})).catch(w.yZ)},this.broadcastStop=()=>{var e;void 0!==this.broadcastModal&&(null===(e=this.fullscreenChangeListener)||void 0===e||e.removeListener(),this.fullscreenChangeListener=void 0,this.broadcastModal.currentlyViewed&&this.roomChatConn.event.roomNotice.fire({messages:[[(0,c.JH)((0,T.mi)(this.roomChatConn.room())),(0,c.H5)(S.R.showMyCamStoppedViewing)]],showInPrivateMessage:!0})),this.broadcastModal=void 0;for(const e of this.onStopBroadcast)e()},this.roomChatConn=e,this.constraints={micId:"",camId:"",width:0,height:0,muted:!0},this.roomOffline=!0,t.listen((e=>{this.roomOffline=e,e&&this.stopCam()}),!1).addTo(this.listenerGroup),this.chatOffline=!0,e.event.statusChange.listen((e=>{switch(this.chatOffline="notconnected"===e.currentStatus,_=e.currentStatus,e.currentStatus){case"privatenotwatching":case"privatespying":case"passwordprotected":case"notconnected":case"offline":this.stopCam()}})).addTo(this.listenerGroup);const s=null===(i=k.Bm.current.loggedInUser)||void 0===i?void 0:i.userUid;void 0!==s&&new M.Vg(s).onMessage.listen((e=>{e.started?M.Vu.fire(e):M.DL.fire(e)})).addTo(this.listenerGroup)}startCam(){if((0,b.bT)("SharedCamStartClicked"),this.roomOffline||this.chatOffline)return(0,r.Q$)(S.R.showMyCamMustBeConnected),void O.fire(void 0);(0,L.yC)(this.roomChatConn.username()).then((e=>{if(e)(0,r.Q$)(S.R.showMyCamAlreadyBroadcasting),O.fire(void 0);else if(d.i.areTermsAccepted())this.showBroadcastPreview();else{const e=()=>{this.showBroadcastPreview()},t=()=>{O.fire(void 0)};new d.i(!1,e,t).show()}})).catch(w.yZ)}stopCam(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.broadcastModal?this.broadcastModal.stopBroadcast(e):Promise.resolve()}cleanup(){this.stopCam(),this.listenerGroup.removeAll()}showBroadcastPreview(){if(this.roomOffline||this.chatOffline)return(0,r.Q$)(S.R.showMyCamMustBeConnected),void O.fire(void 0);new Promise(((e,t)=>{(0,a.Aw)("api/broadcastvideocontext/").then((t=>{var i;e((i=t.responseText,new Promise(((e,t)=>{const n=new s.N6(i);n.getNumber("status",!1)>=400?t(`Bad response from server: ${i}`):e({room:n.getString("room"),originHost:n.getString("originHost"),originPassword:n.getString("originPassword"),originWSEndpoint:n.getString("originWSEndpoint")})}))))})).catch(t)})).then((e=>{this.camDossier=e,void 0!==this.previewModal&&this.previewModal.hide(),this.previewModal=new G(this.camDossier,this.constraints,this.startBroadcast,this.roomChatConn.room()),this.previewModal.show()})).catch(w.yZ)}setOnStart(e){this.onStartBroadcast.push(e)}setOnStop(e){this.onStopBroadcast.push(e)}isBroadcasting(){return void 0!==this.broadcastModal}}class G extends y.z{constructor(e,t,i,s){super(),this.paused=!1,this.preventChatFocus=!0,this.overlay.style.backgroundColor="rgba(0, 0, 0, 0.4)",this.element.id="smc-preview-modal",this.element.style.boxShadow="0px 0px 10px rgba(0, 0, 0, 0.3)",this.element.style.position="fixed",this.element.style.overflow="hidden",this.element.style.height="auto",this.element.style.width="422px",this.element.style.top="50%",this.element.style.left="50%",this.element.style.transform="translate(-50%, -56%)",this.element.style.borderRadius="6px",this.previewPanel=new A.BT(e,t,{onOBSClick:()=>{},onStartBroadcast:i,title:S.R.showMyCamPreviewTitle,infoText:[S.R.showMyCamPreviewInfo1(s),S.R.showMyCamPreviewInfo2],startButtonText:S.R.showMyCamStart(s),onClose:()=>{O.fire(void 0),this.hide()}}),this.element.style.padding="8px 10px",this.element.style.boxSizing="border-box",this.overlayClick.listen((()=>{O.fire(void 0),this.hide()})),this.addChild(this.previewPanel)}show(){this.paused&&this.previewPanel.start(),super.show(),(0,b.bT)("SharedCamPreviewDisplayed")}hide(){super.hide(),this.previewPanel.stop(),this.paused=!0}}class q extends A.SF{constructor(e,t,i,s,n){super(e,t,{onStopBroadcast:()=>{(0,a.ju)("api/ts/chat/share-my-cam/?",{username:this.roomUsername}),this.removeFromDom(),this.listenerGroup.removeAll(),U=void 0,i()}}),this.roomChatConn=s,this.currentlyViewed=!1,this.listenerGroup=new g.gt,this.bottom=16,this.cachedBottom=this.bottom,this.right=16,this.fullscreenBottom=32,this.fullscreenRight=0,this.currentWatchers=new Map,this.showBroadcast=()=>{const e=(0,f.Gy)();(0,f.aS)()&&void 0!==e?(e.appendChild(this.element),this.main.style.bottom=`${this.fullscreenBottom}px`,this.main.style.right=`${this.fullscreenRight}px`):(document.body.appendChild(this.element),this.main.style.bottom=`${this.bottom}px`,this.main.style.right=`${this.right}px`)},this.roomUsername=s.room(),this.getSettingsLocalstorage(),this.createBroadcastDisplay(),R.oO.listen((()=>{this.recalcPosition()}));let o=!0;h.Ay.listen((e=>{const t=e.data.status;"connecting"!==t&&o&&"hidden"===t?(clearTimeout(n),o=!1,this.onConnected()):!o&&this.isStatusOffline(t)&&(this.stopBroadcast(),(0,r.Q$)(S.R.showMyCamBroadcastError),error("smcViewer - cam went offline"))}),!1).addTo(this.listenerGroup),I.c9.listen((()=>{this.recalcPosition()})).addTo(this.listenerGroup)}onConnected(){(0,b.bT)("SharedCamBroadcastStarted"),U=this.roomUsername,M.Vu.listen((e=>{this.updateCamStatus(!0,e)}),!1).addTo(this.listenerGroup),M.DL.listen((e=>{this.updateCamStatus(!1,e)}),!1).addTo(this.listenerGroup)}stopBroadcast(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,o.wu)("mouseenter",this.element,(e=>{e.stopPropagation()}),!0),(0,o.wu)("mouseleave",this.element,(e=>{e.stopPropagation()}),!0),e&&(0,b.bT)("SharedCamBroadcastStopClicked",{is_broadcaster_viewing:this.currentlyViewed}),this.stop(!0)}removeFromDom(){null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element)}updateCamStatus(e,t){let i;this.currentlyViewed=e,e?this.currentWatchers.has(t.username)||(this.statusIcon.src=`${STATIC_URL_ROOT}broadcastassets/active-cam-overlaying-video.svg`,this.statusTooltipText.textContent=`${this.roomUsername} ${S.R.showMyCamIsViewing}`,this.currentWatchers.set(t.username,t),i=S.R.showMyCamStartedViewing):this.currentWatchers.has(t.username)&&(this.statusIcon.src=`${STATIC_URL_ROOT}broadcastassets/inactive-cam-overlaying-video.svg`,this.statusTooltipText.textContent=`${this.roomUsername} ${S.R.showMyCamNotViewing}`,this.currentWatchers.delete(t.username),i=S.R.showMyCamStoppedViewing),void 0!==i&&this.roomChatConn.event.roomNotice.fire({messages:[[(0,c.JH)((0,T.mi)(t.username)),(0,c.H5)(i)]],showInPrivateMessage:!0})}createBroadcastPanel(){}createBroadcastDisplay(){this.element.style.height="auto",this.element.style.width="auto",this.main=this.createMain(),this.main.appendChild(this.createCamStatus()),this.main.appendChild(this.createVideo()),this.main.appendChild(this.createControls()),this.element.appendChild(this.main),this.setupUIEventListeners()}createMain(){const e=document.createElement("div");return e.style.height="117px",e.style.width=117*this.constraints.width/this.constraints.height+"px",e.style.backgroundColor="#000",e.style.position="fixed",e.style.zIndex=`${L.MS}`,e.style.border="1px solid #FFF",e.dataset.testid="cam-to-cam-broadcast-panel",e}createCamStatus(){const e=document.createElement("div");e.style.position="absolute",e.style.right="5px",e.style.top="5px",e.style.width=e.style.height="15px",e.style.zIndex=`${L.MS+2}`;const t=document.createElement("img");t.src=`${STATIC_URL_ROOT}broadcastassets/inactive-cam-overlaying-video.svg`;const i=document.createElement("div");(0,P.fZ)(i,"smc-status-tooltip"),i.style.position="absolute",i.style.width="175px",i.style.padding="9px",i.style.borderRadius="4px",i.style.fontSize="14px",i.style.display="none",i.style.zIndex="5",i.style.bottom="25px",i.style.left="-168px",i.dataset.testid="cam-to-cam-status-tooltip";const s=document.createElement("span");s.textContent=`${this.roomUsername} ${S.R.showMyCamNotViewing}`,i.appendChild(s);const n=(0,p.Uv)("","","168px",2);return(0,P.fZ)(n,"divotBottom"),i.appendChild(n),e.appendChild(t),e.appendChild(i),this.statusIcon=t,this.statusTooltip=i,this.statusTooltipText=s,e}createVideo(){const e=super.createVideo();return e.style.height="100%",e.dataset.testid="cam-to-cam-video",e}createControls(){const e=(0,L.ru)(),t=document.createElement("div");t.style.width="100%",t.style.height="26px",t.style.backgroundColor="rgba(0, 0, 0, 0.4)",t.style.cursor="move",this.addDrag(t);const i=document.createElement("div");i.style.paddingLeft="10px",i.style.position="relative",i.style.top="50%",i.style.transform="translateY(-50%)",i.style.color="#FFF",i.style.cursor="default",i.textContent=S.R.showMyCamMyCam,i.style.cursor="move",this.addDrag(i),t.appendChild(i),e.appendChild(t);const s=(0,L.uN)({iconAsset:"broadcastassets/volume-mute-grey.svg",tooltipText:S.R.showMyCamMuted,iconSize:31,centerTop:"60%"});s.style.left="50%",s.style.transform="translateX(calc(-50% - 30px))",e.appendChild(s);const n=(0,L.uN)({iconAsset:"broadcastassets/close.svg",tooltipText:S.R.showMyCamCloseCam,iconSize:23,centerTop:"60%",onClick:()=>{this.stopBroadcast(!0)}});return n.style.left="50%",n.style.transform="translateX(calc(-50% + 30px))",e.appendChild(n),this.controls=e,e}setupUIEventListeners(){const e=()=>{this.controls.style.display="block",this.currentlyViewed?this.statusIcon.src=`${STATIC_URL_ROOT}broadcastassets/active-cam.svg`:this.statusIcon.src=`${STATIC_URL_ROOT}broadcastassets/inactive-cam.svg`},t=()=>{this.controls.style.display="none",this.currentlyViewed?this.statusIcon.src=`${STATIC_URL_ROOT}broadcastassets/active-cam-overlaying-video.svg`:this.statusIcon.src=`${STATIC_URL_ROOT}broadcastassets/inactive-cam-overlaying-video.svg`};(0,o.wu)("mouseenter",this.main,e),(0,o.wu)("mouseleave",this.main,t);let i=0;(0,o.wu)("touchstart",this.main,(t=>{"none"===this.controls.style.display?(e(),i=1):i+=1})),(0,o.wu)("touchend",this.main,(e=>{i>1&&t()})),(0,o.wu)("touchstart",document,(e=>{this.element.contains(e.target)||t()})),(0,o.wu)("mouseenter",this.statusIcon,(e=>{this.statusTooltip.style.display="block"})),(0,o.wu)("mouseleave",this.statusIcon,(e=>{this.statusTooltip.style.display="none"})),(0,o.wu)("touchstart",this.statusIcon,(e=>{this.statusTooltip.style.display="block"})),(0,o.wu)("touchstart",document,(e=>{this.statusTooltip.style.display="none"}),!0)}addDrag(e){(0,m.S)(e,((e,t,i)=>{const s=this.getCorrectedRight((0,f.aS)()?this.fullscreenRight:this.right),n=this.getCorrectedBottom((0,f.aS)()?this.fullscreenBottom:this.bottom);let o=s,r=n;const a=t,l=i;return{enabled:!0,move:(e,t)=>{const i=e-a,h=t-l;r=this.getCorrectedBottom(n-h),o=this.getCorrectedRight(s-i),this.main.style.bottom=`${r}px`,this.main.style.right=`${o}px`},end:()=>{(0,f.aS)()?(this.fullscreenRight=o,this.fullscreenBottom=r):(this.right=o,this.bottom=r,this.cachedBottom=r),this.saveSettingsLocalstorage()}}}))}getCorrectedBottom(e){return Math.max(0,Math.min(window.innerHeight-this.main.offsetHeight,e))}getCorrectedRight(e){return Math.max(0,Math.min(window.innerWidth-this.main.offsetWidth,e))}recalcPosition(){if((0,f.aS)())this.main.style.bottom=`${this.getCorrectedBottom(this.fullscreenBottom)}px`,this.main.style.right=`${this.getCorrectedRight(this.fullscreenRight)}px`;else{const e=(0,E.N)(),t=4;this.bottom=e>0?Math.max(this.cachedBottom,e+t):this.cachedBottom,this.main.style.bottom=`${this.getCorrectedBottom(this.bottom)}px`,this.main.style.right=`${this.getCorrectedRight(this.right)}px`}}getSettingsLocalstorage(){if(!(0,n.Pf)())return;const e=window.localStorage.getItem(B);if(null!==e){const t=JSON.parse(e);this.bottom=t.bottom,this.cachedBottom=t.bottom,this.right=t.right,this.fullscreenBottom=t.fullscreenBottom,this.fullscreenRight=t.fullscreenRight}}saveSettingsLocalstorage(){if(!(0,n.Pf)())return;const e={bottom:this.bottom,right:this.right,fullscreenBottom:this.fullscreenBottom,fullscreenRight:this.fullscreenRight};window.localStorage.setItem(B,JSON.stringify(e))}}},9937:(e,t,i)=>{"use strict";i.d(t,{l:()=>l,m:()=>r});var s=i(2709),n=i(9447);class o extends s.u{constructor(e,t,i){super(),this.checkbox=document.createElement("input"),this.onChange=()=>{},this.disabled=!1,this.checkbox.type="checkbox",this.element.style.overflow="visible",this.element.style.position="relative",(0,n.fZ)(this.element,"checkboxComponent"),this.subclassInit(i),void 0!==e&&this.setChecked(e),void 0!==t&&this.setOnChange(t),this.element.appendChild(this.checkbox),this.updateStyles(),this.element.onclick=e=>{this.disabled||e.target===this.checkbox||(this.toggle(),this.checkbox.focus(),e.preventDefault())},this.checkbox.onchange=()=>{this.updateStyles(),this.onChange()}}toggle(){this.checkbox.click()}focus(){this.checkbox.focus()}blur(){this.checkbox.blur()}isActiveElement(){return document.activeElement===this.checkbox}isChecked(){return this.checkbox.checked}setChecked(e){this.checkbox.checked=e,this.updateStyles(),this.onChange()}setCheckedDirectly(e){this.checkbox.checked=e,this.updateStyles()}setOnChange(e){this.onChange=e}disable(){this.disabled=!0,this.checkbox.tabIndex=-1,this.updateStyles()}enable(){this.disabled=!1,this.checkbox.removeAttribute("tabindex"),this.updateStyles()}setCheckboxValue(e){this.checkbox.value=e}getCheckboxValue(){return this.checkbox.value}setCheckboxId(e){this.checkbox.id=e}getCheckboxId(){return this.checkbox.id}}class r extends o{constructor(e,t,i){super(t,i),this.element.style.height=`${e}px`,this.element.style.width=`${e}px`}subclassInit(){(0,n.fZ)(this.element,"transparentCheckbox")}updateStyles(){this.checkbox.checked?(0,n.fZ)(this.element,"checked"):(0,n.SA)(this.element,"checked"),this.disabled?((0,n.fZ)(this.element,"disabled"),this.element.style.cursor="default"):((0,n.SA)(this.element,"disabled"),this.element.style.cursor="pointer")}setName(e){this.checkbox.name=e}getName(){return this.checkbox.name}setTitle(e){this.checkbox.title=e}}const a="rgb(246, 115, 0)";class l extends o{constructor(e,t,i){super(e,t,i)}subclassInit(e){var t,i;const s=null!==(t=null==e?void 0:e.width)&&void 0!==t?t:50,o=null!==(i=null==e?void 0:e.height)&&void 0!==i?i:30,r=`${s}px`,a=`${o}px`,l=2*o/3+"px";this.toggledOnLeftStyle=s-o+"px",this.element.style.width=r,this.element.style.height=a,this.element.style.borderRadius=l,this.element.style.lineHeight=a,(0,n.fZ)(this.element,"toggle"),this.button=document.createElement("div"),this.button.style.height=a,this.button.style.width=a,(0,n.fZ)(this.button,"toggleButton"),this.element.appendChild(this.button)}updateStyles(){this.checkbox.checked?(this.element.style.backgroundColor=`${a}`,this.element.style.boxShadow=`${a} 0 0 0 16px inset`,this.element.style.border=`1px solid ${a}`,this.button.style.left=this.toggledOnLeftStyle):(this.element.style.backgroundColor="rgb(233, 233, 233)",this.element.style.boxShadow="rgb(233, 233, 233) 0 0 0 16px inset",this.element.style.border="1px solid rgb(223, 223, 223)",this.button.style.left="0")}}},9419:(e,t,i)=>{"use strict";i.d(t,{k:()=>a});var s=i(2939),n=i(8423),o=i(8039),r=i(6428);class a{constructor(){this.invalidMentions=new Set,this.sorted=!1,this.chatListeners=new n.gt,this.userList=[],s.X0.listen((e=>{this.clearUserListPromise(),this.isAnonymous=e.chatConnection.viewerIsAnonymous(),e.chatConnection.event.statusChange.listen((e=>{this.statusChangeShouldRefresh(e.currentStatus,e.previousStatus)})).addTo(this.chatListeners),this.isAnonymous||e.chatConnection.event.roomNotice.listen((e=>{for(const t of e.messages)for(const e of t)0===e.partType&&void 0!==e.user&&this.addRecentUser(e.user)})).addTo(this.chatListeners)})),s.Gr.listen((()=>{this.chatListeners.removeAll()}))}static getInstance(){return void 0===a.instance&&(a.instance=new a),a.instance}mentionUserList(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return void 0!==this.userListPromise||(this.userListPromise=this.refreshUserList(e),this.scheduleUserListPromiseReset()),this.userListPromise}clearList(){this.userList=[]}clearUserListPromise(){this.userListPromise=void 0}scheduleUserListPromiseReset(){window.setTimeout((()=>{this.clearUserListPromise()}),6e4)}getSortedList(){return this.sorted||(this.userList.sort(((e,t)=>e.user.username.toLowerCase()t.user.username.toLowerCase()?1:0)),this.sorted=!0),this.userList}users(){return this.userList.map((e=>e.user))}get count(){return this.userList.length}refreshUserList(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return o.SJ.getInstance().fetchRoomUsers().then((t=>{const i=document.createElement("div");e?this.removeNonRecentUsers():this.userList=[];for(const e of t.roomUsers)this.userInList(e.username)||this.userList.push({user:e,slug:e.username,element:i,recent:!1}),this.invalidMentions.has(e.username)&&(r.$u.fire(void 0),this.invalidMentions.delete(e.username));return this.userList})).catch((e=>(error("Error loading username autocomplete",e),this.userList)))}addRecentUser(e){const t=document.createElement("div");this.sorted=!1;const i=this.getUser(e.username);void 0===i?this.userList.push({user:e,slug:e.username,element:t,recent:!0}):(i.user=e,i.recent=!0),this.invalidMentions.has(e.username)&&(r.$u.fire(void 0),this.invalidMentions.delete(e.username))}addInvalidUsers(e){for(const t of e)this.invalidMentions.add(t)}shouldNotRefresh(e){return["offline","notconnected","hidden","passwordprotected"].indexOf(e)>-1}statusChangeShouldRefresh(e,t){if(this.isAnonymous||this.shouldNotRefresh(e))return;const i="privatespying"!==t&&"privatewatching"!==t,s="privatespying"!==e&&"privatewatching"!==e;!i&&s?(this.clearUserListPromise(),this.mentionUserList()):i&&!s?(this.clearUserListPromise(),this.mentionUserList(!1)):this.mentionUserList()}removeNonRecentUsers(){this.userList=this.userList.filter((e=>e.recent))}getUser(e){return this.userList.find((t=>t.user.username===e))}userInList(e){return void 0!==this.getUser(e)}}},6428:(e,t,i)=>{"use strict";i.d(t,{$u:()=>c,jE:()=>p,ti:()=>u});var s=i(6657),n=i(6066),o=i(2939),r=i(8423),a=i(9586),l=i(8785),h=i(9447),d=i(9419);const c=new r.c_("updateUserMention",{reportIfNoListeners:!1});class u extends s.c{constructor(e){super(e),this.config=e,this.userList=d.k.getInstance(),o.X0.listen((()=>{this.hide(),this.clearListDOM(),this.userList.clearList()})).addTo(this.listenerGroup)}initData(){super.initData(),this.disableCache=!0,this.maxOptionLength=30}initUI(e){super.initUI(e),this.element.dataset.testid="user-mention-modal"}promptRegex(){return"@"}searchSlugRegex(){return"[\\w-]*"}userMatchesPrefix(e){return e.username.toLowerCase().startsWith(this.searchSlug.toLowerCase())}async getData(){if(!this.isGetDataCancelled())return await this.userList.mentionUserList(),this.setItems(this.userList.getSortedList().filter((e=>this.userMatchesPrefix(e.user)))),Promise.resolve()}appendItem(e,t){const i=super.appendItem(e,t);return(0,h.fZ)(i,(0,l.Kb)(e.user)),i.dataset.testid="user-mention-modal-item",i.style.fontWeight="bold",i}pickItem(e,t){super.pickItem(e,t),t||(this.finalizeSelection(),this.hide())}getDataEndpoint(){return""}parseResponse(e){return[]}getDataDebounceMS(){return 0}}class p extends u{constructor(e){super(e),(0,a.H)(this.list,!0),new n.v({autocompleteConfig:this.config,element:this.element,list:this.list,overlayClick:this.overlayClick,listenerGroup:this.listenerGroup,isVisible:()=>this.visible,hide:()=>this.hide(),pickItem:(e,t)=>this.pickItem(e,t),hideOnSpace:!0})}initUI(e){super.initUI(e),this.element.style.border="",this.element.style.fontSize="14px",this.element.style.lineHeight="26px",this.element.style.boxShadow="0px 0px 8px rgba(0, 0, 0, 0.32)",this.element.style.marginLeft="7px",this.element.style.boxSizing="content-box",this.element.style.position="fixed",this.element.style.bottom=e.inputDivHeight-3+"px"}repositionChildren(){}}},7964:(e,t,i)=>{"use strict";i.d(t,{oG:()=>b,tI:()=>y});var s=i(6784),n=i(6844),o=i(1413),r=i(8423),a=i(5431),l=i(9586),h=i(5173),d=i(9439),c=i(74),u=i(4947),p=i(9447),m=i(9461);const g=new Set;function v(e){g.forEach((t=>{e!==t.roomName&&t.dispose()}))}function f(e){return(Array.from(e,(e=>e.charCodeAt(0))).reduce(((e,t)=>(e<<5)-e+t|0),0)>>>0).toString(16)}function y(){return Array.from(g).some((e=>e.isShown()))}function b(e,t){var i;if(null===(i=e.rulesModal)||void 0===i||i.dispose(),!(0,n.ok)()&&t.chatRules.trim().length>0&&!function(e,t){var i;const s=null===(i=m.Bm.current.loggedInUser)||void 0===i?void 0:i.username;if(s===e)return!0;const n=f(t.trim()),o=`rules_accepted_${s}_${e}`;return localStorage.getItem(o)===n}(t.room,t.chatRules)){if(e instanceof a.i){const i=new w({inputContainer:e.centerControlsDiv,customInputField:e.chatInput,roomName:t.room,chatRules:t.chatRules,container:e.getMobileRoot(),chatSettings:t.userChatSettings},!0);return i.element.style.position="fixed",i.element.style.zIndex="999999",i}{const i=new w({inputContainer:e.inputDiv,customInputField:e.customInputField,roomName:t.room,chatRules:t.chatRules,container:e,chatSettings:t.userChatSettings});return i.element.style.zIndex="1001",i}}}o.V.listen((e=>{v(e.room)}));class w extends h.Q{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(e),this.visibilityChanged=new r.c_("visibilityChanged",{reportIfNoListeners:!1}),this.showFunction=e=>{this.show()},this.listenerAdded=!1,this.listenerGroup=new r.gt,this.isVisible=!1,this.captureKeys=e=>{(0,d.Vx)()||("Tab"===e.key?(document.activeElement===this.acceptBtn?this.closeBtn.focus():this.acceptBtn.focus(),e.stopPropagation(),e.preventDefault()):"Escape"===e.key?(this.hide(),e.stopPropagation(),e.preventDefault()):"Enter"!==e.key&&(e.stopPropagation(),e.preventDefault()))},this.isMobile=m.Bm.current.isMobile,this.overlayClick.listen((()=>{this.hide()})),g.add(this),t?(this.element.style.width="70%",this.element.style.left="15%"):(this.element.style.width="95%",this.element.style.left="2.5%"),this.bindListeners(),this.updateScrollIndicator()}applyChatSettingsFontStyles(e){this.element.style.fontFamily=e.fontFamily,this.element.style.fontSize=e.fontSize}initData(e){this.chatRules=e.chatRules.trim()}initUI(e){super.initUI(),this.element.style.bottom="10px",this.element.style.borderWidth="1px",this.element.style.borderStyle="solid",this.element.style.borderRadius="4px",this.element.style.margin="0 auto",this.element.style.padding="10px",this.element.style.boxSizing="border-box",this.element.style.maxHeight="95%",this.applyChatSettingsFontStyles(e.chatSettings),(0,p.fZ)(this.element,"rulesModal"),this.inputContainer=e.inputContainer,this.customInput=e.customInputField,this.roomName=e.roomName,this.container=e.container,this.element.style.position="absolute",this.element.style.textAlign="center",this.element.style.height="auto",this.element.style.display="none";const t=document.createElement("div");t.style.fontWeight="bold",t.style.textAlign="left",t.style.paddingBottom="5px",t.style.paddingRight="10px",t.style.whiteSpace="nowrap",t.style.textOverflow="ellipsis",t.style.overflow="hidden";const i=`${this.roomName[0].toUpperCase()}${this.roomName.substring(1)}`;t.innerText=`${i}'s Rules:`,this.element.appendChild(t),this.textPar=this.createTextContent(this.chatRules),this.scrollIndicator=this.createScrollIndicator();const s=document.createElement("div");s.style.position="relative",s.appendChild(this.textPar),s.appendChild(this.scrollIndicator),s.dataset.testid="chat-rules",this.element.appendChild(s),this.acceptBtn=this.createAcceptButton(),this.closeBtn=this.createCloseButton(),this.element.appendChild(this.acceptBtn),this.element.appendChild(this.closeBtn),this.repositionChildren()}createTextContent(e){const t=document.createElement("div");return t.style.whiteSpace="pre-line",t.style.textAlign="left",t.style.lineHeight="1.4",t.style.height="auto",t.style.paddingBottom="15px",t.style.boxSizing="border-box",t.style.width="100%",t.style.overflowY="scroll",t.style.overflowWrap="break-word",t.style.wordBreak="break-word",t.style.wordWrap="break-word",t.style.cssText+="; -ms-overflow-style: -ms-autohiding-scrollbar",t.style.marginBottom="3px",t.style.paddingRight="15px",t.onscroll=()=>{this.updateScrollIndicator()},t.appendChild(document.createTextNode(e)),(0,l.H)(t),t}isTextScrolledToBottom(){return this.textPar.scrollHeight-this.textPar.scrollTop-this.textPar.clientHeight<=1}updateScrollIndicator(){this.isTextScrolledToBottom()?this.scrollIndicator.style.display="none":this.scrollIndicator.style.display="block"}createScrollIndicator(){const e=document.createElement("div");return(0,p.fZ)(e,"scrollIndicator"),e.style.height="50px",e.style.position="absolute",e.style.bottom="0",e.style.fontWeight="bold",e.style.textAlign="center",e.style.boxSizing="border-box",e.style.width="100%",e}repositionChildren(){const e=this.container.element.getBoundingClientRect().height;this.textPar.style.maxHeight=`calc(${e}px - 120px)`,this.updateScrollIndicator()}show(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isVisible||(this.isVisible=!0,this.element.style.display="block",this.customInput.disable(),this.inputContainer.style.pointerEvents="none",this.showOverlay(),this.repositionChildren(),this.isMobile||(0,s.wu)("keydown",document,this.captureKeys,!0),e||this.visibilityChanged.fire(this.isVisible))}hide(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isVisible&&(this.isVisible=!1,this.element.style.display="none",this.customInput.enable(),this.inputContainer.style.pointerEvents="",this.hideOverlay(),this.container.repositionChildrenRecursive(),this.isMobile||(0,s.Pf)("keydown",document,this.captureKeys,!0),e||this.visibilityChanged.fire(this.isVisible))}accept(){var e;const t=`rules_accepted_${null===(e=m.Bm.current.loggedInUser)||void 0===e?void 0:e.username}_${this.roomName}`,i=f(this.chatRules);localStorage.setItem(t,i),v(),this.customInput.focus()}bindListeners(){c.EZ.listen((e=>{this.applyChatSettingsFontStyles(e)})).addTo(this.listenerGroup),this.listenerAdded||((0,s.wu)("focus",this.customInput.element,this.showFunction),this.listenerAdded=!0)}removeInputListener(){this.listenerAdded&&((0,s.Pf)("focus",this.customInput.element,this.showFunction),this.listenerAdded=!1)}dispose(){this.hide(),this.removeInputListener(),this.listenerGroup.removeAll(),void 0!==this.parent&&(delete this.parent.rulesModal,this.parent.removeChild(this)),g.delete(this)}createAcceptButton(){const e=document.createElement("button");return e.innerText=u.R.acceptRules,e.style.fontFamily="'UbuntuRegular',sans-serif",e.style.display="inline-block",e.style.boxSizing="content-box",e.style.width="calc(100% - 16px)",e.style.padding="8px",e.style.borderRadius="4px",e.style.cursor="pointer",e.style.fontWeight="500",e.style.lineHeight="16px",e.style.whiteSpace="nowrap",e.style.overflow="hidden",e.style.textOverflow="ellipsis",e.style.fontSize="120%",e.style.zIndex="2",(0,s.wu)("click",e,(()=>{this.accept()})),(0,p.fZ)(e,"acceptRulesButton"),e}createCloseButton(){const e=document.createElement("button"),t=document.createElement("img");return t.src=`${STATIC_URL}close_icon.svg`,t.style.backgroundColor="inherit",e.appendChild(t),e.style.boxSizing="border-box",e.style.padding="5px 5px 4px 5px",e.style.position="absolute",e.style.top="2px",e.style.right="2px",e.style.cursor="pointer",(0,s.wu)("click",e,(()=>{this.hide()})),(0,p.fZ)(e,"closeRulesButton"),e}}},5411:(e,t,i)=>{"use strict";i.d(t,{E:()=>s});const s=new(i(8423).c_)("openFeedbackForm")},1280:(e,t,i)=>{"use strict";i.d(t,{f:()=>F,I:()=>B});var s=i(8861),n=i(6784),o=i(5216),r=i(2709),a=i(3955),l=i(2690),h=i(1452),d=i(3957),c=i(4947),u=i(9447),p=i(9461),m=i(1224),g=i(6064),v=i(7623),f=i(8423),y=i(1675);class b{constructor(e,t,i){let s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.element=document.createElement("div"),this.label=document.createElement("label"),this.label.htmlFor=t,this.label.innerText=i,"textarea"===e?this.input=document.createElement("textarea"):(this.input=document.createElement("input"),this.input.type=e),this.input.name=t,s&&(this.input.required=s),this.error=document.createElement("p"),this.error.style.display="none",this.element.appendChild(this.label),this.element.appendChild(this.input),this.element.appendChild(this.error)}setError(e){this.error.textContent=e,this.error.style.display=""}clearError(){this.error.textContent="",this.error.style.display="none"}}var w=i(664);const C=new f.c_("canvasOpen"),S=new f.c_("canvasClose"),x=e=>{const t=document.createElement("div");return t.style.display="block",void 0!==e&&e.appendChild(t),t};class T extends r.u{initData(){this.element=x(),this.control=document.createElement("button"),this.control.type="button",this.control.tabIndex=0,this.element.appendChild(this.control)}initUI(){this.element.style.position="absolute",this.element.style.top="0",this.element.style.right="0",this.element.style.margin="12px 12px 0 0",(0,u.fZ)(this.control,"closeControl"),this.control.style.padding="4px",this.control.style.cursor="pointer",this.control.style.width="12px",this.control.style.height="12px",this.control.style.border="none",this.control.style.boxSizing="content-box"}}class A extends r.u{initData(){this.element=x(),(0,u.fZ)(this.element,"header"),this.header=document.createElement("h2"),this.header.textContent=c.R.sendFeedbackTextLc,this.element.appendChild(this.header)}initUI(){(0,a.ZM)(this.header,{fontSize:"14px",lineHeight:"18px",fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif",margin:"0 0 8px"})}}class P extends r.u{initData(){this.element=x(),(0,u.fZ)(this.element,"submitRow"),this.submit=document.createElement("button"),this.submit.type="submit",this.submit.textContent=c.R.feedbackSubmit,this.submit.disabled=!0,this.element.appendChild(this.submit)}initUI(){this.element.style.textAlign="right",(0,a.ZM)(this.submit,{fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif",marginTop:"16px",borderStyle:"solid",borderWidth:"1px",borderRadius:"4px",boxSizing:"border-box",opacity:"0.5",padding:"7px"})}disable(){this.submit.disabled=!0,this.submit.style.opacity="0.5",this.submit.style.cursor="default"}enable(){this.submit.disabled=!1,this.submit.style.opacity="1",this.submit.style.cursor="pointer"}}class k extends r.u{constructor(){super(),this.inputChange=new f.c_("inputChange"),this.defaultPrompt=c.R.feedbackSentimentLabel(m.m.siteName),this.element=x(),this.formInput=new b("hidden","sentiment",this.defaultPrompt,!1),this.element.appendChild(this.formInput.element);const e=x();(0,a.ZM)(e,{height:"auto",width:"224px",margin:"12px auto 16px",position:"relative"}),e.appendChild(this.createSentimentSelection(d.PL.InTrouble)),e.appendChild(this.createSentimentSelection(d.PL.Unhappy)),e.appendChild(this.createSentimentSelection(d.PL.Indifferent)),e.appendChild(this.createSentimentSelection(d.PL.Smirk)),e.appendChild(this.createSentimentSelection(d.PL.InLove,!0)),this.element.appendChild(e)}createSentimentSelection(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("button");return i.type="button",(0,u.fZ)(i,"sentimentOption"),i.appendChild((0,w.S)(e)),(0,a.ZM)(i,{height:"24px",width:"24px",padding:"4px",boxSizing:"content-box",backgroundPosition:"center center",backgroundRepeat:"no-repeat",display:"inline-block",backgroundColor:"transparent",border:"none",cursor:"pointer",marginRight:t?"0":"16px",verticalAlign:"middle"}),this.inputChange.listen((t=>{t===e?(0,u.fZ)(i,"selected"):(0,u.SA)(i,"selected")})),i.onclick=()=>{this.setValue(e)},i}setValue(e){this.formInput.input.value=e,this.inputChange.fire(e)}getValue(){return this.formInput.input.value}setPrompt(e){this.formInput.label.textContent=""===e?this.defaultPrompt:e}clearSelection(){this.setValue("")}}class M extends r.u{constructor(e){super(),this.props=e,this.commentItems=[],this.element=x();for(const t of e.prompts){const i=new b("textarea","comments",t,e.required);(0,u.fZ)(i.input,"feedbackComment"),(0,a.ZM)(i.input,{width:"306px",resize:"none",minHeight:`${e.textBoxHeight}px`,boxSizing:"border-box",marginBottom:"8px"}),i.input.maxLength=5e3,(0,u.fZ)(i.error,"error"),i.error.style.marginBottom="12px",(0,n.wu)("keyup",i.input,e.onChange),(0,n.wu)("touchend",i.input,e.onChange),(0,n.wu)("paste",i.input,e.onChange),(0,n.wu)("cut",i.input,e.onChange),this.element.appendChild(i.element),this.commentItems.push(i)}for(let e=0;ee+1e>0?this.commentItems[e-1].input:void 0)))}prompts(){return this.props.prompts}values(){return this.commentItems.map((e=>e.input.value))}clear(){for(const e of this.commentItems)e.input.value=""}focus(){this.commentItems[0].input.focus()}blur(){this.commentItems.forEach((e=>e.input.blur()))}firstInput(){return this.commentItems[0].input}lastInput(){return this.commentItems[this.commentItems.length-1].input}setError(e,t){(t<0||t>=this.commentItems.length)&&error("Feedback comments error index out of range"),e.length>0&&this.commentItems[t].setError(e)}clearErrors(){this.commentItems.forEach((e=>e.clearError()))}anyCommentsNonempty(){return this.commentItems.some((e=>""!==e.input.value.trim()))}}class R extends r.u{constructor(e,t){super("div",{control:e}),this.canvas=t}initData(e){this.element=document.createElement("div"),(0,u.fZ)(this.element,"screenshot"),this.editToggle=document.createElement("button"),this.editToggle.type="button",(0,u.fZ)(this.editToggle,"editToggle"),this.editImage=new Image,this.editImage.src=`${STATIC_URL_ROOT}images/feedback/select.svg`,this.editToggle.appendChild(this.editImage),this.editText=document.createElement("div"),this.editText.textContent=c.R.feedbackCanvasToggle,this.editToggle.appendChild(this.editText),(0,n.wu)("click",this.editToggle,(()=>{this.canvas.show()})),(0,n.wu)("mouseenter",this.editToggle,(()=>{this.editImage.src=`${STATIC_URL_ROOT}images/feedback/select_active.svg`})),(0,n.wu)("mouseleave",this.editToggle,(()=>{this.editImage.src=`${STATIC_URL_ROOT}images/feedback/select.svg`})),this.element.appendChild(this.editToggle),this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.onclick=()=>{e.control.removeScreenshot()},this.element.appendChild(this.closeButton)}initUI(){this.element.style.width="100%",this.element.style.minHeight="140px",this.element.style.maxHeight="340px",this.element.style.position="relative",this.element.style.backgroundSize="contain",this.element.style.backgroundRepeat="no-repeat",this.element.style.backgroundPosition="center",this.element.style.justifyContent="center",this.element.style.alignItems="center",this.element.style.display="none",this.editToggle.style.width="75%",this.editToggle.style.height="100px",this.editToggle.style.boxShadow="0px 4px 16px rgba(0, 0, 0, 0.3)",this.editToggle.style.borderRadius="4px",this.editToggle.style.textAlign="center",this.editToggle.style.cursor="pointer",this.editToggle.style.fontFamily="UbuntuMedium, Helvetica, Arial, sans-serif",this.editText.style.width="100%",(0,a.ZM)(this.closeButton,{position:"absolute",right:"10px",top:"10px",height:"24px",width:"24px",padding:"4px",background:`transparent url(${STATIC_URL}feedback/remove-screenshot.svg) no-repeat center center`,border:"none",cursor:"pointer"})}}class I extends r.u{constructor(e,t){super("div",{canvas:t}),this.modal=e,this.canvas=t,this.isCapturing=!1}initData(e){this.element=x(),this.button=document.createElement("button"),this.button.type="button",this.button.textContent=c.R.feedbackAddScreenshot,(0,n.wu)("click",this.button,(e=>{e.preventDefault(),this.addScreenshot()})),this.element.appendChild(this.button),this.screenshot=new R(this,e.canvas),this.addChild(this.screenshot,this.element),this.info=document.createElement("div"),this.info.style.display="none",this.element.appendChild(this.info),this.error=document.createElement("span"),this.element.appendChild(this.error)}initUI(){this.element.style.width="306px",this.element.style.textAlign="center",this.element.style.marginBottom="8px",(0,u.fZ)(this.element,"screenShotControl"),(0,u.fZ)(this.button,"sscButton"),(0,a.ZM)(this.button,{fontFamily:"UbuntuRegular, Arial, Helvetica, sans-serif",border:"none",boxSizing:"border-box",display:"block",cursor:"pointer",textDecoration:"underline",padding:"0",marginBottom:"16px"}),(0,u.fZ)(this.error,"error"),(0,u.fZ)(this.info,"info"),this.info.style.margin="8px 0 10px"}addScreenshot(){if(!this.canvas.canScreenshot())return;if(this.removeScreenshot(),this.canvas.createScreenshot(),this.error.textContent="",void 0===this.canvas.screenshot)return;const e=this.canvas.screenshot.getContext("2d");if(null===e)return;this.isCapturing=!0,this.modal.hide();let t=!1;const i=document.createElement("video");i.style.display="none",this.canvas.element.appendChild(i),this.canvas.getDisplayMedia().then((s=>{i.srcObject=s,this.videoStream=s,i.play(),(0,n.wu)("canplay",i,(()=>{t||(t=!0,window.setTimeout((()=>{const t=window.innerWidth,s=window.innerHeight,n=i.videoWidth/i.videoHeight;let o,r;s*n{e.stop()})),this.canvas.element.removeChild(i),this.modal.show(),window.setTimeout((()=>{this.isCapturing=!1}),1e3)}),250))}),!1)})).catch((e=>{this.modal.show(),"NotAllowedError"===e.name?this.error.textContent=c.R.feedbackPermissionDenied:this.error.textContent=c.R.feedbackUnknownCaptureError,this.canvas.element.removeChild(i),this.removeScreenshot()}))}removeScreenshot(){this.canvas.canScreenshot()&&(this.screenshot.element.style.backgroundImage="",this.screenshot.element.style.display="none",this.button.textContent=c.R.feedbackAddScreenshot,this.info.style.display="none",this.button.style.display="block",this.canvas.deleteScreenshot(),this.canvas.hide())}}class E extends r.u{constructor(e){super("div",{canvas:e}),this.canvas=e,(0,u.fZ)(this.element,"drawControls")}setScreenshot(e){this.screenshot=e}initData(e){this.element=x(),this.element.tabIndex=-1,this.drag=document.createElement("div"),this.drag.style.background=`url(${STATIC_URL_ROOT}images/feedback/drag.svg) no-repeat center`,this.element.appendChild(this.drag),this.highlight=document.createElement("button"),this.highlight.type="button",(0,u.fZ)(this.highlight,"highlight"),this.highlightImage=new Image,this.highlightImage.src=`${STATIC_URL_ROOT}images/feedback/highlight_issue.svg`,this.highlight.appendChild(this.highlightImage),this.highlightText=document.createElement("span"),this.highlightText.textContent=c.R.feedbackHighlightControl,this.highlight.appendChild(this.highlightText),(0,n.wu)("click",this.highlight,(()=>{this.canvas.highlightBrush()})),this.element.appendChild(this.highlight),this.hide=document.createElement("button"),this.hide.type="button",this.hideImage=document.createElement("div"),this.hide.appendChild(this.hideImage),this.hideText=document.createElement("span"),this.hideText.textContent=c.R.feedbackHideControl,this.hide.appendChild(this.hideText),(0,u.fZ)(this.hide,"highlight"),(0,n.wu)("click",this.hide,(()=>{this.canvas.hideBrush()})),this.element.appendChild(this.hide),this.hr=document.createElement("hr"),this.element.appendChild(this.hr),this.done=document.createElement("a"),(0,u.fZ)(this.done,"done"),this.done.style.textDecoration="none",(0,n.wu)("click",this.done,(e=>{e.preventDefault(),this.updateScreenshotBackground(),this.canvas.hide()})),this.element.appendChild(this.done),(0,y.eB)(this.element,{},[this.drag]),(0,n.wu)("keydown",e.canvas.element,(e=>{e.stopPropagation(),27===e.keyCode&&"block"===this.element.style.display&&(e.stopImmediatePropagation(),this.updateScreenshotBackground(),this.canvas.hide())}))}updateScreenshotBackground(){void 0!==this.canvas.screenshot&&void 0!==this.screenshot&&(this.screenshot.element.style.backgroundImage=`url("${this.canvas.screenshot.toDataURL("image/png")}")`)}initUI(){(0,a.ZM)(this.element,{borderRadius:"4px",padding:"10px 15px 5px 15px",position:"fixed",zIndex:2010,textAlign:"right",width:"115px",height:"101px",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",userSelect:"none",boxShadow:"10px 10px 25px -5px rgba(0,0,0,0.75)"}),(0,a.ZM)(this.drag,{width:"20px",height:"10px",position:"absolute",right:"0",top:"5px"}),(0,u.fZ)(this.highlight,"highlight"),(0,a.ZM)(this.highlight,{border:"0",display:"inline-block",padding:"5px",position:"relative",margin:"7px 0 0 0",left:"-15px",width:"145px",textAlign:"left",cursor:"pointer",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif"}),(0,a.ZM)(this.highlightImage,{width:"23px",verticalAlign:"middle",marginRight:"10px"}),this.highlightText.style.verticalAlign="middle",(0,u.fZ)(this.hide,"highlight"),(0,a.ZM)(this.hide,{border:"0",display:"inline-block",padding:"5px",position:"relative",margin:"0",left:"-15px",width:"145px",textAlign:"left",cursor:"pointer",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif"}),(0,u.fZ)(this.hideImage,"hideImage"),(0,a.ZM)(this.hideImage,{width:"20px",verticalAlign:"middle",marginRight:"10px",height:"20px",display:"inline-block"}),this.hideText.style.verticalAlign="middle",(0,a.ZM)(this.done,{padding:"4px",cursor:"pointer",textAlign:"right"}),this.done.textContent=c.R.doneText}}class L extends r.u{constructor(){super(),this.fillRect=!1,this.mediaStreams=navigator.mediaDevices,void 0!==this.mediaStreams&&void 0!==this.mediaStreams.getDisplayMedia||(this.mediaStreams=void 0),void 0===document.createElement("canvas").toBlob&&(this.mediaStreams=void 0),this.controls=new E(this),this.addChild(this.controls,this.element)}initData(){this.element=x(),this.infoTooltip=x(this.element),this.infoTooltip.innerHTML=`${c.R.feedbackHighlightInfo} (${c.R.dismissLower})`,(0,n.wu)("click",this.infoTooltip,(()=>{var e;null===(e=this.draw)||void 0===e||e.focus()})),this.infoTooltip.style.userSelect="none"}initUI(){(0,u.fZ)(this.element,"canvas"),(0,a.ZM)(this.element,{display:"none",position:"absolute",height:"100%",width:"100%"}),(0,u.fZ)(this.infoTooltip,"infoToolTip"),(0,a.ZM)(this.infoTooltip,{position:"fixed",borderWidth:"1px",borderStyle:"solid",boxSizing:"border-box",zIndex:2020,top:"100px",left:"0",right:"0",margin:"0 auto",padding:"12px",fontWeight:"bold",width:"500px",textAlign:"center",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",fontSize:"1.3em"})}canScreenshot(){return void 0!==this.mediaStreams&&!(0,v.Xb)()}getDisplayMedia(){if(!this.canScreenshot())throw new ReferenceError("Display media not supported by browser");return this.mediaStreams.getDisplayMedia({video:{displaySurface:"browser",cursor:!1},audio:!1})}createScreenshot(){this.deleteScreenshot(),this.screenshot=document.createElement("canvas"),(0,a.ZM)(this.screenshot,{zIndex:2e3,top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:"0px auto",position:"fixed"}),this.hide(),this.element.appendChild(this.screenshot)}deleteScreenshot(){this.deleteDraw(),void 0!==this.screenshot&&(this.element.removeChild(this.screenshot),this.screenshot=void 0)}setScreenshotDims(e,t){void 0!==this.screenshot&&(this.screenshot.width=e,this.screenshot.height=t,this.screenshot.style.width=`${e}px`,this.screenshot.style.height=`${t}px`)}createDraw(){void 0!==this.screenshot&&(void 0!==this.draw&&(this.element.removeChild(this.draw),this.draw=void 0),this.draw=this.screenshot.cloneNode(),this.draw.style.zIndex="2001",this.draw.tabIndex=0,this.element.appendChild(this.draw),this.refreshDraw())}deleteDraw(){void 0!==this.draw&&(this.element.removeChild(this.draw),this.draw=void 0)}hide(){this.element.style.display="none",this.clearBrush(),this.deleteDraw(),document.body.style.overflow="",S.fire(void 0)}show(){this.element.style.display="block",this.controls.element.style.left="75px",this.controls.element.style.bottom="30px",this.infoTooltip.style.display="block",document.body.style.overflow="hidden",this.createDraw(),this.highlightBrush(),void 0!==this.draw&&this.draw.focus(),C.fire(void 0)}copyCanvas(e,t){if(void 0===e||void 0===t)return;const i=t.getContext("2d");if(null===i)return;const s=i.globalAlpha;i.globalAlpha=1,i.clearRect(0,0,t.width,t.height),i.drawImage(e,0,0),i.globalAlpha=s}refreshDraw(){if(void 0===this.draw)return;const e=this.draw.getContext("2d");if(null===e)return;this.copyCanvas(this.screenshot,this.draw);const t=e.globalAlpha,i=e.strokeStyle;e.globalAlpha=.1,e.strokeStyle="rgb(0, 0, 0)",e.fillRect(0,0,this.draw.width,this.draw.height),e.globalAlpha=t,e.strokeStyle=i}clearBrush(){this.controls.hide.style.backgroundColor="transparent",this.controls.hide.classList.toggle("active",!1),this.controls.highlight.style.backgroundColor="transparent",this.controls.highlight.classList.toggle("active",!1),void 0!==this.draw&&(void 0!==this.brushMouseListeners&&((0,n.Pf)("mousedown",this.draw,this.brushMouseListeners.down),(0,n.Pf)("mouseup",window,this.brushMouseListeners.up),(0,n.Pf)("mousemove",window,this.brushMouseListeners.move),this.brushMouseListeners=void 0),this.draw.style.cursor="default")}hideBrush(){if(this.clearBrush(),this.createDraw(),void 0===this.draw)return;const e=this.draw.getContext("2d");null!==e&&((0,u.fZ)(this.controls.hide,"active"),e.globalAlpha=1,e.strokeStyle="rgb(0, 0, 0)",e.lineWidth=5,this.fillRect=!0,this.canvasBrush())}highlightBrush(){if(this.clearBrush(),this.createDraw(),void 0===this.draw)return;const e=this.draw.getContext("2d");null!==e&&((0,u.fZ)(this.controls.highlight,"active"),e.globalAlpha=.8,e.strokeStyle="rgb(249, 185, 144)",e.lineWidth=5,this.fillRect=!1,this.canvasBrush())}canvasBrush(){if(void 0===this.draw)return;this.draw.style.cursor="crosshair";const e=this.draw.getContext("2d");if(null===e)return;let t=0,i=0,s=0,o=0,r=0,a=0,l=!1;const h=()=>{t=0,i=0,r=0,a=0,l=!1};this.brushMouseListeners={down:s=>{l&&(this.drawBoxOnScreenshot(t,i,r,a,e),h());const n=this.draw.getBoundingClientRect();t=s.clientX-n.left,i=s.clientY-n.top,l=!0,e.canvas.style.cursor="crosshair"},up:s=>{l&&(this.drawBoxOnScreenshot(t,i,r,a,e),h())},move:n=>{if(l){const l=this.draw.getBoundingClientRect();s=n.clientX-l.left,o=n.clientY-l.top,this.refreshDraw(),r=s-t,a=o-i,this.drawBox(t,i,r,a,e)}}},(0,n.wu)("mousedown",this.draw,this.brushMouseListeners.down),(0,n.wu)("mouseup",window,this.brushMouseListeners.up),(0,n.wu)("mousemove",window,this.brushMouseListeners.move)}drawBox(e,t,i,s,n){n.beginPath(),n.rect(e,t,i,s),this.fillRect?n.fill():n.stroke()}drawBoxOnScreenshot(e,t,i,s,n){if(void 0===this.screenshot)return;this.screenshot.style.cursor="crosshair";const o=this.screenshot.getContext("2d");null!==o&&(o.globalAlpha=n.globalAlpha,o.strokeStyle=n.strokeStyle,o.lineWidth=n.lineWidth,this.drawBox(e,t,i,s,o))}}class D extends r.u{constructor(e){super("div",e),this.errors=[],this.canvas.canScreenshot()&&(this.updateInfoText(),this.errors.push(this.screenshot.error)),this.errors.push(this.globalError),(0,n.wu)("submit",this.form,(e=>{e.preventDefault(),this.submit()}))}initUI(e){this.element=x(),this.form=document.createElement("form"),this.form.action=(0,o._Y)("/feedback/submit/"),this.form.method="POST",this.element.appendChild(this.form),this.globalError=document.createElement("p"),this.globalError.style.color="red",this.globalError.style.marginBottom="8px",this.form.appendChild(this.globalError),this.sentiment=this.createSentimentSelection(),this.form.appendChild(this.sentiment.element),this.comments=this.createComments(),this.form.appendChild(this.comments.element),this.canvas=e.canvas,this.canvas.canScreenshot()&&(this.screenshot=new I(e.modal,this.canvas),this.addChild(this.screenshot,this.form)),this.notice=document.createElement("p"),(0,u.fZ)(this.notice,"privacyNotice"),this.notice.style.fontSize="10.5px",this.notice.style.lineHeight="14px",this.notice.textContent=c.R.feedbackNotice.replace("%SITE_NAME%",m.m.siteName),this.form.appendChild(this.notice),this.csrf=document.createElement("input"),this.csrf.type="hidden",this.csrf.name="csrfmiddlewaretoken",this.csrf.value=(0,s.I7)("csrftoken"),this.form.appendChild(this.csrf),this.url=document.createElement("input"),this.url.type="hidden",this.url.name="url",this.url.value=document.location.href.substr(0,255),this.form.appendChild(this.url),this.source=document.createElement("input"),this.source.type="hidden",this.source.name="source",this.source.value="",this.form.appendChild(this.source),this.submitRow=new P,this.addChild(this.submitRow,this.form)}createSentimentSelection(){return new k}createComments(){return new M({prompts:[c.R.feedbackCommentsLabel],onChange:()=>{window.setTimeout((()=>{this.comments.anyCommentsNonempty()?this.submitRow.enable():this.submitRow.disable()}),200)},required:!0,textBoxHeight:72})}canAddScreenshot(){return this.canvas.canScreenshot()&&"none"!==this.screenshot.button.style.display}updateInfoText(){this.canAddScreenshot()&&(this.screenshot.info.textContent="footer"===this.source.value?c.R.feedbackAddScreenshotInfoScrollUp:c.R.feedbackAddScreenshotInfoScrollDown)}updateCSRF(){this.csrf.value=(0,s.I7)("csrftoken")}updateURL(){this.url.value=document.location.href.substr(0,255)}updateSource(e){this.source.value=e,this.updateInfoText()}updateSentiment(e){this.sentiment.setValue(e)}clearErrors(){this.errors.forEach((e=>{e.textContent=""})),this.comments.clearErrors()}resetForm(){this.forceForm(),this.clearErrors(),this.comments.clear(),this.sentiment.clearSelection(),this.submitRow.disable(),this.form.reset(),this.canvas.canScreenshot()&&this.screenshot.removeScreenshot()}forceForm(){this.removeAllDOMChildren(),this.element.appendChild(this.form),this.comments.focus()}submit(){this.clearErrors();const e=new FormData;e.append("sentiment",this.sentiment.formInput.input.value),this.comments.prompts().forEach((t=>{e.append("prompts",t)})),this.comments.values().forEach((t=>{e.append("responses",t)})),e.append("url",document.location.href.substr(0,255)),e.append("source",this.source.value),e.append("csrfmiddlewaretoken",(0,s.I7)("csrftoken")),void 0!==this.canvas.screenshot?this.canvas.screenshot.toBlob((t=>{null!==t&&e.append("screenshot",t,"screenshot.png"),this.postFeedback(e)})):this.postFeedback(e)}postFeedback(e){this.submitRow.disable(),(0,o.KF)(this.form.action,e).then((e=>{const t=e.getResponseHeader("content-type");if(null!==t&&t.includes("text/html"))this.globalError.textContent=c.R.feedbackBannedUser,this.submitRow.enable();else{this.resetForm(),this.element.removeChild(this.form);const e=document.createElement("p");e.textContent=c.R.feedbackSubmitted,this.element.appendChild(e)}})).catch((e=>{if(429===e.xhr.status)this.globalError.textContent=c.R.feedbackRateLimitError;else try{const t=JSON.parse(e.xhr.response).responses;void 0!==t&&t.forEach(((e,t)=>this.comments.setError(e,t)))}catch{this.globalError.textContent=c.R.feedbackUnknownError}this.submitRow.enable()}))}}class B extends l.z{static show(e){void 0===B.instance&&(B.instance=new B),B.instance.showFromSource(e)}constructor(){super({onShow:()=>{this.onShow()},onHide:()=>{this.onHide()},easyExit:!0}),this.isVisible=!1,this.overlayClickStayOpen=!0,this.preventChatFocus=!0,this.element.classList.add("block_CB1_chat_focus"),this.element.dataset.testid="user-feedback-modal",(0,u.fZ)(this.overlay,"overlayOpacity"),(0,u.fZ)(this.element,"userFeedbackForm"),(0,u.fZ)(this.element,u.aG.defaultColor),C.listen((()=>{this.element.style.display="none"})),S.listen((()=>{this.element.style.display="block"})),g.Fd.listen((()=>{this.hide()})),this.overlayClick.listen((()=>{this.hide()}))}initData(){this.canvas=new L,this.canvas.canScreenshot()&&document.body.appendChild(this.canvas.element),this.inner=x(this.element),this.close=new T,(0,n.wu)("click",this.close.control,(()=>{this.hide()})),this.addChild(this.close,this.inner),this.header=new A,this.addChild(this.header,this.inner),this.form=this.createFormContent(),this.canvas.canScreenshot()&&this.canvas.controls.setScreenshot(this.form.screenshot.screenshot),this.addChild(this.form,this.inner);const e=()=>this.form.submitRow.submit.disabled?this.close.control:this.form.submitRow.submit;this.element.querySelectorAll(".sentimentOption").forEach((e=>{(0,n.wu)("keydown",e,(0,a.eh)(this.form.comments.firstInput(),this.close.control))})),(0,n.wu)("keydown",this.form.comments.element,(0,a.eh)((()=>this.form.canAddScreenshot()?this.form.screenshot.button:e()),this.close.control)),this.form.canAddScreenshot()&&(0,n.wu)("keydown",this.form.screenshot.button,(0,a.eh)(e,this.form.comments.lastInput())),(0,n.wu)("keydown",this.form.submitRow.submit,(0,a.eh)(this.close.control,(()=>this.form.canAddScreenshot()?this.form.screenshot.button:this.form.comments.lastInput()))),(0,n.wu)("keydown",this.close.control,(0,a.eh)(this.form.comments.firstInput(),(()=>this.form.submitRow.submit.disabled?this.form.canAddScreenshot()?this.form.screenshot.button:this.form.comments.lastInput():this.form.submitRow.submit)))}initUI(){(0,a.ZM)(this.element,{position:"fixed",top:"150px",fontSize:"12px",left:"50%",marginLeft:"-157px",width:"310px",height:"auto",border:"4px",borderRadius:"4px",padding:"15px",fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif"}),this.canvas.canScreenshot()&&(0,n.wu)("resize",window,(()=>{this.form.screenshot.isCapturing||void 0===this.canvas.screenshot||(this.form.screenshot.removeScreenshot(),this.form.screenshot.error.textContent=c.R.feedbackResize)}))}createFormContent(){return new D({modal:this,canvas:this.canvas})}showFromSource(e){this.form.updateSource(e.source),void 0!==e.sentiment&&this.form.updateSentiment(e.sentiment),this.show()}onShow(){this.form.updateCSRF(),this.form.updateURL(),this.element.style.display="",this.repositionChildren(),this.isVisible=!0,(0,n.wu)("keydown",this.element,_),(0,n.wu)("keydown",document.body,N),this.form.forceForm()}onHide(){const e=this.isVisible;this.element.style.display="none",this.isVisible=!1,e&&((0,n.Pf)("keydown",this.element,_),(0,n.Pf)("keydown",document.body,N));try{window.dispatchEvent(new Event("resize"))}catch{if(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0){const e=document.createEvent("UIEvents");e.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(e)}else error("Could not fire resize event")}this.canvas.hide()}}class U extends D{constructor(e){super(e),this.sentiment.inputChange.listen((()=>{this.submitRow.enable()}))}createSentimentSelection(){const e=new k;return e.setPrompt(c.R.feedbackBroadcasterLabel(m.m.siteName)),e}createComments(){return new M({prompts:[c.R.haveYouNoticedAnyBugs],onChange:()=>{window.setTimeout((()=>{""===this.sentiment.getValue()&&(this.comments.anyCommentsNonempty()?this.submitRow.enable():this.submitRow.disable())}),200)},required:!1,textBoxHeight:52})}forceForm(){super.forceForm(),this.comments.blur()}submit(){var e,t;super.submit();const i=new FormData;i.append("rating",this.sentiment.formInput.input.value),i.append("url",document.location.href.substr(0,255)),i.append("room_user",null!==(e=null===(t=p.Bm.current.loggedInUser)||void 0===t?void 0:t.username)&&void 0!==e?e:""),(0,o.KF)(d.eN,i).catch(h.yZ)}}class F extends B{static show(){void 0===F.instance&&(F.instance=new F),F.instance.show()}constructor(){super(),this.form.updateSource("broadcaster_sentiment_survey")}createFormContent(){return new U({modal:this,canvas:this.canvas})}}const _=e=>{27!==e.keyCode&&e.stopImmediatePropagation()},N=e=>{32===e.keyCode&&e.target===document.body&&e.preventDefault()}},7872:(e,t,i)=>{"use strict";i.d(t,{cl:()=>d,gY:()=>h,zD:()=>c});var s=i(7623),n=i(2758),o=i(6784),r=i(5216);const a=10,l=60;function h(e){const t=e.querySelectorAll("a.dismiss_notice_tfa_and_email"),i=e.querySelectorAll("a.dismiss_notice"),s=e.querySelectorAll("a.dismiss_notice_no_persist"),h=e.querySelectorAll("a.dismiss_notice_ajax"),d=e.getAttribute("data-cache-key"),u=t.length>0?a:l;if(null!==d){let t=(0,n.y1)(d);void 0===t&&(t=(0,n.fc)(d,{days:u})),"1"!==t&&(e.style.display="")}t.forEach((e=>{(0,o.wu)("click",e,(()=>{c(e,a)}))})),i.forEach((e=>{(0,o.wu)("click",e,(()=>{c(e,l)}))})),s.forEach((e=>{(0,o.wu)("click",e,(()=>{c(e)}))})),h.forEach((e=>{(0,o.wu)("click",e,(()=>{!function(e){const t=e.closest("div.dismissible_notice");if(null!==t){const i=e.getAttribute("data-dismiss-url");null!==i&&(0,r.KF)(i,{}),t.style.display="none"}}(e)}))}))}function d(){const e=document.querySelectorAll("div.dismissible_notice");for(const t of e)"ie-support-notice"===t.id&&(0,s.hl)()||h(t)}function c(e,t){const i=e.closest("div.dismissible_notice");if(null!==i){const e=i,s=e.getAttribute("data-cache-key");null!==s&&void 0!==t&&(0,n.aR)(s,"1",{days:t}),e.style.display="none"}}},9461:(e,t,i)=>{"use strict";i.d(t,{Bm:()=>l,Aw:()=>h,Db:()=>d});var s,n=i(8423),o=i(2042);class r{constructor(){this.isSet=!1}get current(){return this.value}set current(e){this.isSet||(this.value=e,this.isSet=!0)}}class a{constructor(e){this.state=e}getState(){return{...this.state}}setState(e){if(!this.hasChanges(e))return;const t=this.state;this.state={...this.state,...e},this.onUpdate.fire(t)}hasChanges(e){for(const t in e)if(!(0,o.k)(e[t],this.state[t]))return!0;return!1}}!function(e){e.RoomlistPage="roomlistPage",e.RoomPage="chatroom"}(s||(s={}));const l=new class extends r{},h=new class extends a{constructor(){super(...arguments),this.onUpdate=new n.c_("RoomDossierContextUpdate",{maxHistorySize:1})}}({room:"",chatUserName:"",viewerPassword:"",roomPassword:"",chatRules:"",roomUid:"",viewerUid:"",host:"",roomTitle:"",appsRunning:[{app_name:"",app_location:""}],roomStatus:"public",userName:"",edgeAuth:"",viewerGender:"m",hlsSource:"",allowAnonymousTipping:!1,privateMinMinutes:0,allowShowRecordings:!1,numViewers:0,isWidescreen:!1,roomGender:"f",allowPrivateShow:!1,privatePrice:6,spyPrice:0,privateShowId:"",hasLowSatisfactionScore:!1,isAgeVerified:!0,hiddenMessage:"",following:!0,followNotificationFrequency:"smart",isModerator:!1,broadcasterIsOnNewChat:!1,tokenBalance:0,isSupporter:!1,needsSupporterToPm:!0,serverName:"",numFollowed:0,numFollowedOnline:0,hasStudio:!1,isMobile:!1,ignoredEmoticons:[],hideSatisfactionScore:!1,satisfactionScore:{upVotes:0,downVotes:0,percent:100},tipsInPast24Hours:0,lastVoteInPast24Hours:0,lastVoteInPast90DaysDown:!1,tfaEnabled:!1,dismissibleMessages:[],showMobileSiteBannerLink:!1,exploringHashTag:"",sourceName:"un",isInFanClub:!1,hasFanClub:!1,paidTokensFanClub:!1,userChatSettings:{fontSize:"",fontColor:"",fontFamily:"",showEmoticons:!0,emoticonAutocompleteDelay:5,sortUsersKey:"a",modExpiration:0,roomEntryFor:1,roomLeaveFor:1,c2cNotificationLimit:0,silenceBroadcasters:"false",ignoredUsers:"",allowedChat:"",tipVolume:0,highestTokenColor:"",collapseNotices:!0},browserId:"",aspAuthUrl:"",quality:{quality:"good",rate:0,stopped:!0},edgeRegion:"",userlistColor:"g",activePassword:!1}),d=new class extends a{constructor(){super(...arguments),this.onUpdate=new n.c_("SPAPageContextUpdate",{maxHistorySize:1})}}({pageLocation:s.RoomlistPage,showLocation:!1})},7254:(e,t,i)=>{"use strict";i.d(t,{AJ:()=>s,CM:()=>o});var s,n=i(4947);!function(e){e.Fanclub="fanclub",e.Follow="follow",e.Signup="signup",e.Supporter="supporter",e.Tip="tip",e.Help="help"}(s||(s={})),s.Fanclub,s.Follow,s.Signup,s.Supporter,s.Help,s.Tip;const o=(e,t)=>{let i=`${n.R.shortcodeHelp}\n\n ${n.R.shortcode}: [cb:help]\n ${n.R.shortcodeHelpHelp}\n\n ${n.R.shortcode}: [cb:signup]\n ${n.R.shortcodeHelpSignup()}\n\n ${n.R.shortcode}: [cb:supporter]\n ${n.R.shortcodeHelpSupporter()}\n\n ${n.R.shortcode}: [cb:fanclub]\n ${n.R.shortcodeHelpFanclub(e)}\n\n ${n.R.shortcode}: [cb:follow]\n ${n.R.shortcodeHelpFollow(e)}`;return t&&(i+=`\n\n ${n.R.shortcode}: [cb:tip amount=50 message="${n.R.shortcodeHelpTipExample}"]\n ${n.R.shortcodeHelpTip()}`),i}},4754:(e,t,i)=>{"use strict";i.d(t,{m:()=>n});var s=i(2709);class n extends s.u{constructor(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(),this.userCanAccess=i,this.leftContainer=document.createElement("div"),this.rightContainer=document.createElement("div"),this.leftContainer.style.display=this.rightContainer.style.display="inline-block",this.leftContainer.style.height=this.rightContainer.style.height="calc(100% - 20px)",this.leftContainer.style.width=this.rightContainer.style.width="50%",this.leftContainer.style.top=this.rightContainer.style.top="0px",this.leftContainer.style.position=this.rightContainer.style.position="absolute",this.leftContainer.style.left=this.rightContainer.style.right="0px",this.userCanAccess&&(this.leftContainer.style.cursor=this.rightContainer.style.cursor="pointer"),this.leftArrow=document.createElement("div"),this.rightArrow=document.createElement("div"),this.leftArrow.style.position=this.rightArrow.style.position="absolute",this.leftArrow.style.top=this.rightArrow.style.top=(this.leftContainer.offsetHeight-50)/2+"px",this.leftArrow.style.height=this.rightArrow.style.height="50px",this.leftArrow.style.width=this.rightArrow.style.width="30px",this.leftArrow.style.userSelect=this.rightArrow.style.userSelect="none",this.leftArrow.style.webkitUserSelect=this.rightArrow.style.webkitUserSelect="none",this.leftArrow.style.left=this.rightArrow.style.right="0";const s=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg"),i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d","M5.7 0L0 5.55 18.6 24 0 42.45 5.7 48 30 24 5.7 0z"),i.setAttribute("fill","#E2E2E2"),"left"===e&&i.setAttribute("transform","translate(30, 0) scale(-1,1)"),t.appendChild(i),t.setAttribute("viewBox","0 0 30 50"),t},n=s("left");n.dataset.testid="left-arrow";const o=s("right");o.dataset.testid="right-arrow",this.leftArrow.appendChild(n),this.rightArrow.appendChild(o),this.leftContainer.appendChild(this.leftArrow),this.rightContainer.appendChild(this.rightArrow);const r=this.leftArrow.firstChild.firstChild,a=this.rightArrow.firstChild.firstChild,l=e=>{this.userCanAccess&&("left"===e?r.style.fill="#B8B8B8":a.style.fill="#B8B8B8")},h=e=>{"left"===e?r.style.fill="#E2E2E2":a.style.fill="#E2E2E2"};this.leftContainer.onmouseenter=()=>{l("left")},this.leftContainer.onmouseleave=()=>{h("left")},this.rightContainer.onmouseenter=()=>{l("right")},this.rightContainer.onmouseleave=()=>{h("right")},this.leftContainer.onclick=e,this.rightContainer.onclick=t}repositionArrows(e){this.leftArrow.style.top=this.rightArrow.style.top=(e-50)/2+"px"}shiftArrows(e){this.leftArrow.style.left=this.rightArrow.style.right=`${e}px`}showArrows(){this.leftContainer.style.visibility=this.rightContainer.style.visibility="normal",this.userCanAccess&&(this.leftContainer.style.cursor=this.rightContainer.style.cursor="pointer")}hideArrows(){this.leftContainer.style.visibility=this.rightContainer.style.visibility="hidden"}}},2042:(e,t,i)=>{"use strict";function s(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(isNaN(e)&&isNaN(t)&&"number"==typeof e&&"number"==typeof t)return!0;if(e===t)return!0;if(e instanceof Function)return e===t;if("function"==typeof e&&"function"==typeof t||e instanceof Date&&t instanceof Date||e instanceof RegExp&&t instanceof RegExp||e instanceof String&&t instanceof String||e instanceof Number&&t instanceof Number)return e.toString()===t.toString();if(!(e instanceof Object&&t instanceof Object))return!1;if(e.isPrototypeOf(t)||t.isPrototypeOf(e))return!1;if(e.constructor!==t.constructor)return!1;if(e.prototype!==t.prototype)return!1;for(const s in t)if(!(i.indexOf(s)>=0)){if(t.hasOwnProperty(s)!==e.hasOwnProperty(s))return!1;if(typeof t[s]!=typeof e[s])return!1}for(const n in e)if(!(i.indexOf(n)>=0)){if(t.hasOwnProperty(n)!==e.hasOwnProperty(n))return!1;if(typeof t[n]!=typeof e[n])return!1;switch(typeof e[n]){case"object":case"function":if(!s(e[n],t[n],i))return!1;break;default:if(e[n]!==t[n])return!1}}return!0}i.d(t,{k:()=>s})},5914:(e,t,i)=>{"use strict";i.d(t,{U:()=>H});var s=i(7063),n=i(1519),o=i(8423),r=i(7407),a=i(1452),l=i(9461),h=i(7623),d=i(6784),c=i(4516);function u(e){switch(e){case"initialized":return"initialized";case"connecting":return"connecting";case"connected":return"connected";case"closing":return"closing";case"closed":return"closed";case"disconnected":case"unavailable":return"disconnected";case"failed":return"failed";case"suspended":return"suspended";default:return"unknown"}}function p(e){switch(e){case"initialized":return"initialized";case"attaching":return"subscribing";case"attached":return"subscribed";case"detaching":return"unsubscribing";case"detached":return"unsubscribed";case"failed":return"failed";case"suspended":return"suspended";default:return"unknown"}}function m(e,t){if(void 0===t)return;const i=t;Object.keys(t).forEach((t=>{const s=i[t];e.set(t,s)}))}class g{constructor(e){e.ignore("client_id"),this.topicKeyToChannelName=new Map,this.channelNameToTopicKeys=new Map,this.channelNameToTopicsMap=new Map,this.failures=new Map,e.keys().includes("settings")||warn("PushServiceContext: settings not found in context",{contextKeys:e.keys().join(","),context:e.stringMessage});const t=e.getParsedSubMap("settings");this.settings=this.parseSettings(t),m(this.settings.flags,t.getObjectOrUndefined("flags")),this.populateTopics(e.getObjectOrUndefined("channels")),m(this.failures,e.getObjectOrUndefined("failures"))}populateTopics(e){if(void 0===e)return;const t=Object.keys(e);for(const i of t){const t=i.split("#")[0],s=i.split("#")[1],n=e[i];this.topicKeyToChannelName.set(s,n);const o=this.channelNameToTopicKeys.get(n);void 0===o?this.channelNameToTopicKeys.set(n,[s]):(o.push(s),this.channelNameToTopicKeys.set(n,o));let r=this.channelNameToTopicsMap.get(n);if(void 0===r)r=new Map;else if(r.has(t))return void warn("A topic with different topic keys is being registered on the same channel. This should never happen!",{channelName:n,topicId:t},"PUSH_");r.set(t,s),this.channelNameToTopicsMap.set(n,r)}}getChannelName(e){return this.topicKeyToChannelName.get(e)}getTopicKeys(e){return this.channelNameToTopicKeys.get(e)}deleteChannel(e){this.channelNameToTopicKeys.delete(e)}deleteTopic(e){this.topicKeyToChannelName.delete(e)}getChannelTopicMap(e){return this.channelNameToTopicsMap.get(e)}getFailedTopics(){return Array.from(this.failures.keys(),(e=>e.split("#")[1]))}}class v{constructor(e){this.callbacks=e,this.activeSubscriptions=new Set,this.topicsToSubscribe=new Set,this.topicPromises=new Map,this.creationTime=(new Date).getTime(),this.seenMessages=new Map,this.seenMessagesLimit=5e3,this.messagesInChat=new Map,this.failedTopics=new Map,this.criticalFailLimit=3,this.subscribedTopicKeysByChannel=new Map}addPageAction(e,t){(0,r.PF)()&&(t.action=e,t.created=this.creationTime,t.client=this.clientName,(0,r.bT)("PushServiceClient",t))}connect(){return this.isConnected()?Promise.resolve():this.hasBusyConnection()&&void 0===this.connectPromise?Promise.reject("Connection is currently busy!"):(void 0===this.connectPromise&&(this.connectPromise=new Promise(((e,t)=>{const i=s=>{"connected"===s.current?this.isConnected()&&(this.connectPromise=void 0,this.connectionChange.removeListener(i),e()):"connecting"===s.previous&&(this.connectPromise=void 0,this.connectionChange.removeListener(i),t(s.reason))};this.connectionChange.listen(i),this._connect()}))),this.connectPromise)}isConnected(){return"connected"===this.getConnectionState()}hasBusyConnection(){return new Set(["connecting","closing"]).has(this.getConnectionState())}ensureConnected(){return this.isConnected()?Promise.resolve():this.connect()}ensureConnectedAndAuthed(e){return this.ensureConnected().then((()=>this.auth.canAccessTopic(e)?Promise.resolve():Promise.reject(`Auth context has no access: ${this.auth.serialize()}`)))}getAuthPromise(e){const t=[],i=[];return e.forEach((e=>{-1===this.auth.getTopicKeys().indexOf(e)&&t.push(e),this.isSubscribedTo(e)&&!c.J.hasPresence(e)||i.push(e)})),t.length<1?Promise.resolve():this.auth.updateAuthToken()}isSubscribedTo(e){return this.auth.canAccessTopic(e)&&this.activeSubscriptions.has(e)}subscribe(e){return this.topicsToSubscribe.add(e),this.updateChannelSubscription(e).then((()=>(this.topicPromises.delete(e),Promise.resolve()))).catch((t=>(this.handleTopicFailure(e),this.topicPromises.delete(e),["closed","closing","disconnected"].includes(this.getConnectionState())?Promise.resolve():Promise.reject(t))))}unsubscribe(e){return this.topicsToSubscribe.delete(e),this.updateChannelSubscription(e).then((()=>{this.topicPromises.delete(e)})).catch((t=>(this.handleUnsubscribed(e),this.topicPromises.delete(e),Promise.reject(t))))}updateChannelSubscription(e){const t=this.topicPromises.get(e);if(void 0!==t)return t.then((()=>this.updateChannelSubscription(e)));const i=this.getChannelName(e);if(void 0===i)return Promise.reject({code:"topic_error",message:"Unknown topic key"});const s=this.getChannelState(i),n=this.topicsToSubscribe.has(e),o=this.subscribedTopicKeysByChannel.get(i);return n?"subscribed"===s||"subscribing"===s?Promise.resolve():this.checkSubscribe(i,o,e):"unsubscribed"===s||"unsubscribing"===s?Promise.resolve():this.checkUnsubscribe(i,o,e)}checkForReauth(e){if("reauth"===e.getStringOrUndefined("_control")){const t=e.getStringList("_channel_names"),i=[],s=c.J.getPresenceKeys();t.forEach((e=>{const t=this.getTopicKeys(e);void 0!==t?t.forEach((e=>{i.push(this.unsubscribe(e))})):i.push(Promise.resolve())})),i.push(...s.map((e=>this.unsubscribe(e)))),Promise.all(i).then((()=>{t.forEach((e=>{var t;const i=this.getTopicKeys(e);null===(t=this.context)||void 0===t||t.deleteChannel(e),void 0!==i&&i.forEach((e=>{var t;null===(t=this.context)||void 0===t||t.deleteTopic(e)}))})),H.updateAuthorization()})).catch((e=>{e.topics=t,error("Error during re-auth detach",e,"PUSH_")}))}}handleSubscribed(e){this.failedTopics.delete(e),this.activeSubscriptions.add(e),this.callbacks.onSubscribe(this.clientName,e,!0)}handleUnsubscribed(e){this.failedTopics.delete(e),this.activeSubscriptions.delete(e),this.callbacks.onSubscribe(this.clientName,e,!1)}handleTopicFailure(e){const t=this.failedTopics.get(e);this.failedTopics.set(e,void 0===t?1:t+1)}shouldRetrySubscribe(){const e=this.auth.getTopicKeys();for(const[t,i]of this.failedTopics.entries())if(e.includes(t)&&i{const t=this.failedTopics.get(e);return void 0!==t&&t>this.criticalFailLimit}))}getConnectionType(){return""}getConnectionId(){return""}getClientId(){return""}getConnectionHost(){return""}getConnectionServer(){return""}getConnectionSerial(){return""}getChannelName(e){var t;return null===(t=this.context)||void 0===t?void 0:t.getChannelName(e)}getTopicKeys(e){var t;return null===(t=this.context)||void 0===t?void 0:t.getTopicKeys(e)}getChannelTopicMap(e){var t;return null===(t=this.context)||void 0===t?void 0:t.getChannelTopicMap(e)}addExternalMessage(e,t){const i=`${this.getChannelName(e)}:${t}`;return void 0!==this.messagesInChat.get(i)||(this.messagesInChat.set(i,[]),void 0!==this.seenMessages.get(i))}handleMessageDuplicate(e,t,i){const s=`${e}:${i}`,n=this.seenMessages.get(s);if(void 0===n){if(this.seenMessages.size>this.seenMessagesLimit){const e=Array.from(this.seenMessages.entries());this.seenMessages=new Map(e.splice(Math.floor(-.5*e.length)))}return this.seenMessages.set(s,[this.getDuplicateMessageMeta(t)]),!1}return n.push(this.getDuplicateMessageMeta(t)),0!==n.length&&this.reportDuplicateMessage(e,t,i,n),!0}reportDuplicateMessage(e,t,i,s){const n=this.duplicateMessageAttributes(e,t,i,s);debug("[PushService] Duplicate Message: ",n),(0,r.PF)()&&(0,r.bT)("PushDuplicateMessage",n)}duplicateMessageAttributes(e,t,i,s){var n;const o=s[0],r=null!==(n=t.getParsedSubMap("providerData").getStringOrUndefined("id"))&&void 0!==n?n:"invalid_provider_id",a=this.hashMessage(t.stringMessage),l=t.getStringOrUndefined("_topic");let h={};return 0===Math.floor(400*Math.random())&&(h=t),{tid:i,first_seen_time:o.timestamp,time_since_first_seen:(new Date).getTime()-o.timestamp,num_duplicates:s.length,client:this.clientName,connection_host:this.getConnectionHost(),connection_type:this.getConnectionType(),connection_state:this.getConnectionState(),num_reconnects:this.getReconnectCount(),same_content:a===o.hash,same_pid:r===o.providerId,same_server:o.server===this.hashMessage(this.getConnectionServer()),same_host:o.host===this.hashMessage(this.getConnectionHost()),orig_connection_serial:o.connectionSerial,channel_name:e,pid:r,topic:l,messageData:JSON.stringify(h)}}hashMessage(e){return""===e?"":Array.from(e,(e=>e.charCodeAt(0))).reduce(((e,t)=>e+t)).toString()+e.length.toString()}getDuplicateMessageMeta(e){var t;return{timestamp:(new Date).getTime(),hash:this.hashMessage(e.stringMessage),providerId:null!==(t=e.getParsedSubMap("providerData").getStringOrUndefined("id"))&&void 0!==t?t:"invalid_provider_id",server:this.hashMessage(this.getConnectionServer()),host:this.hashMessage(this.getConnectionHost()),connectionSerial:this.getConnectionSerial()}}checkSubscribe(e,t,i){if(void 0===t)this.subscribedTopicKeysByChannel.set(e,[i]);else if(!t.includes(i))return t.push(i),this.subscribedTopicKeysByChannel.set(e,t),Promise.resolve();return this._subscribe(i).then((()=>{const t=this.getTopicKeys(e);void 0!==t&&t.forEach((e=>{this.handleSubscribed(e)}))}))}checkUnsubscribe(e,t,i){if(void 0!==t&&t.includes(i)){const s=t.indexOf(i);if(t.splice(s,1),this.subscribedTopicKeysByChannel.set(e,t),0!==t.length)return Promise.resolve();this.subscribedTopicKeysByChannel.delete(e)}return this._unsubscribe(i).then((()=>{const t=this.getTopicKeys(e);void 0!==t&&t.forEach((e=>{this.handleUnsubscribed(e)}))}))}}const f="a";class y extends v{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(e),this.clientName=f,this.shouldRewind=new Set,this.settings=t,this.connectionChange=new o.c_("AblyClientConnection"),this.shouldAutoDisconnect=!i;try{this.realtime=new Ably.Realtime.Promise(this.getClientOptions())}catch(e){throw A("connect",e.toString())}this.auth=new T(this.realtime);const s=["disconnected","failed","suspended"];this.realtime.connection.on((e=>{if(e.previous!==e.current){var t;const i=u(e.previous),n=u(e.current),o=P("connect",e.reason);(s.includes(n)&&204!==(null===(t=e.reason)||void 0===t?void 0:t.statusCode)||"connected"===n)&&this.connectionChange.fire({previous:i,current:n,reason:o,client:"a"})}})),this.shouldAutoDisconnect||(0,d.wu)((0,h.p0)(),window,(()=>{this.close()}))}getClientOptions(){const e={autoConnect:!1,closeOnUnload:this.shouldAutoDisconnect,log:{level:1},authCallback:(e,t)=>{this.auth.fetchTokenRequest().then((e=>{e.isValid()?(this.context=e,t(void 0,e.getTokenRequest())):t("Invalid token request")})).catch((e=>{t(e.message)}))},restHost:this.settings.restHost,realtimeHost:this.settings.realtimeHost,transportParams:{remainPresentFor:"0"}};return this.settings.fallbackHosts.length>0&&(e.fallbackHosts=this.settings.fallbackHosts),e}_connect(){this.realtime.connect()}close(){this.realtime.close()}getConnectionState(){return u(this.realtime.connection.state)}getChannelState(e){return p(this.realtime.channels.get(e).state)}getConnectionType(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t||null===(t=t.activeProtocol)||void 0===t||null===(t=t.transport)||void 0===t?void 0:t.shortName)&&void 0!==e?e:""}getConnectionId(){return this.realtime.connection.id}getClientId(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t||null===(t=t.connectionDetails)||void 0===t?void 0:t.clientId)&&void 0!==e?e:""}getConnectionHost(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t?void 0:t.host)&&void 0!==e?e:""}getConnectionServer(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t||null===(t=t.connectionDetails)||void 0===t?void 0:t.serverId)&&void 0!==e?e:""}getConnectionSerial(){var e,t;return null!==(e=null===(t=this.realtime.connection)||void 0===t||null===(t=t.connectionManager)||void 0===t?void 0:t.connectionSerial)&&void 0!==e?e:""}getReconnectCount(){return-1}duplicateMessageAttributes(e,t,i,s){var n,o,r,a,l,h;const d=super.duplicateMessageAttributes(e,t,i,s);return d.connection_id=this.getConnectionId(),d.recovery_key=this.realtime.connection.recoveryKey,d.client_id=this.getClientId(),d.server_id=this.getConnectionServer(),d.connection_serial=this.getConnectionSerial(),d.connection_key=null!==(n=null===(o=this.realtime.connection)||void 0===o||null===(o=o.connectionManager)||void 0===o||null===(o=o.connectionDetails)||void 0===o?void 0:o.connectionKey)&&void 0!==n?n:"",d.msg_serial=null!==(r=null===(a=this.realtime.connection)||void 0===a||null===(a=a.connectionManager)||void 0===a?void 0:a.msgSerial)&&void 0!==r?r:"",d.recovery_key=null!==(l=null===(h=this.realtime.connection)||void 0===h?void 0:h.recoveryKey)&&void 0!==l?l:"",d}_subscribe(e){const t=this.getChannelName(e);if(void 0===t)return Promise.reject(A("topic_error","Invalid topic key reached subscribe"));const i=this.realtime.channels.get(t),n=new Promise(((n,o)=>{this.ensureConnectedAndAuthed(e).then((()=>{const t=this.shouldRewind.delete(e);return i.setOptions({cipher:void 0,params:t?{rewind:"30s"}:{},modes:["SUBSCRIBE","PRESENCE"]})})).then((()=>i.attach())).then((()=>(i.unsubscribe(),i.subscribe((e=>{e.data.providerData={id:e.id,ts:e.timestamp};const i=new s.N6(e.data);this.checkForReauth(i);const n=this.getChannelTopicMap(t);let o;if(void 0!==n&&(o=n.get(i.getString("_topic"))),void 0!==o){if(this.handleMessageDuplicate(t,i,i.getString("tid")))return;this.callbacks.onMessage(this.clientName,o,i)}else"o"!==i.getStringOrUndefined("_sm")&&warn("Received message for unknown topic",{topic:i.getString("_topic"),client:this.clientName})}))))).then((()=>{n()})).catch((e=>{"suspended"===i.state&&i.detach().then().catch((()=>{})),o(A("subscribe",e))}))}));return this.topicPromises.set(e,n),n}_unsubscribe(e){const t=this.getChannelName(e);if(void 0===t)return Promise.reject(A("topic_error","Invalid topic key reached unsubscribe"));const i=this.realtime.channels.get(t),s=p(i.state);if(i.unsubscribe(),["unsubscribed","initialized","failed"].includes(s))return Promise.resolve();const n=new Promise(((e,t)=>{i.detach().then((()=>{e()})).catch((e=>{t(A("unsubscribe",e))}))}));return this.topicPromises.set(e,n),n}enterPresence(e,t){let i=this.topicPromises.get(e);if(void 0!==i)return Promise.reject(A("topic_error","Called subscribe while channel is busy"));const s=this.getChannelName(e);if(void 0===s)return Promise.reject(A("topic_error","Unknown topic key"));const n=this.realtime.channels.get(s);return i=new Promise(((i,o)=>{this.ensureConnectedAndAuthed(e).then((()=>n.setOptions({cipher:void 0,params:{},modes:["SUBSCRIBE","PRESENCE"]}))).then((()=>n.attach())).then((()=>{const e=this.auth.getCapabilities()[s];return Array.isArray(e)&&e.includes("presence")?void 0!==t&&t.changed?n.presence.update(t.data):Promise.resolve():Promise.reject(A("presence","Token does not have capability for presence"))})).then((()=>{this.handleSubscribed(e),i()})).catch((t=>{this.topicPromises.delete(e),this.handleTopicFailure(e),o(A("presence",t))}))})),i}leavePresence(e){const t=this.getChannelName(e);return void 0===t?Promise.reject(A("topic_error","Unknown topic key")):this.realtime.channels.get(t).presence.leave().then((()=>{this.handleUnsubscribed(e)})).catch((t=>(this.handleUnsubscribed(e),Promise.reject(A("presence",t)))))}getSubscriptionState(e){const t=this.getChannelName(e);return void 0===t?"unknown":p(this.realtime.channels.get(t).state)}isSubscribedTo(e){return"subscribed"===this.getSubscriptionState(e)}}class b extends g{constructor(e){super(e),this.tokenRequest=e.getObject("token_request"),this.jwtToken=e.getString("token"),""!==this.jwtToken&&void 0!==this.tokenRequest.keyName||warn("invalid AblyContext",{contextKeys:e.keys().join(","),context:e.stringMessage}),e.ignore("token_request"),e.logUnusedDebugging("AblyContext")}parseSettings(e){return b.parseSettings(e)}static parseSettings(e){const t={backend:f,restHost:e.getStringOrUndefined("rest_host"),realtimeHost:e.getStringOrUndefined("realtime_host"),fallbackHosts:e.getStringList("fallback_hosts"),flags:new Map,verifyEnabled:!1};return m(t.flags,e.getObjectOrUndefined("flags")),t}isValid(){return void 0!==this.tokenRequest}getTokenRequest(){if(void 0===this.jwtToken)throw new Error("Access to AblyContext.tokenRequest on an invalid context!");return this.jwtToken}serialize(){return JSON.stringify(this.tokenRequest)}}var w=i(5216);const C="push_service/auth/";function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=H.getClientName()===e;l.Bm.current.isNoninteractiveUser&&(i=!1);const n=H.getTopicKeysToAuth();n.length>100&&(warn("PushService is attempting to request too many topics",{},"PUSH_"),n.length=100);const o={};n.forEach((e=>{const t=H.getTopicAuthData(e);void 0===t||t.subscribeOnlyOnPrimaryBackend&&!i||(o[t.key]=t.payload)}));const r={presence_id:`${i?"+":"-"}${H.presenceId}`,topics:JSON.stringify(o),backend:e,...t};return(0,w.KF)(C,r).then((e=>{try{const t=new s.N6(e.responseText);return Promise.resolve(t)}catch(e){return Promise.reject(e)}}))}class x{constructor(e){this.tokenDetails=e,this.capability=this.parseCapability(e.getString("x-ably-capability"))}getChannelNames(){return Object.keys(this.capability)}parseCapability(e){const t={},i=JSON.parse(e),s=Object.keys(i);for(const n of s){const s=i[n];s instanceof Array?t[n]=s:error(`Invalid capability type for topic: ${n}`,{capability:e},"PUSH_")}return t}}class T{constructor(e,t){this.consecutiveAuthFails=0,this.realtime=e,this.ablyContext=t}serialize(){var e;return!0!==(null===(e=this.ablyContext)||void 0===e?void 0:e.isValid())?"":this.ablyContext.serialize()}getCapabilities(){const e=this.authToken;return void 0===e?{}:e.capability}fetchTokenRequest(){return new Promise(((e,t)=>{S(f).then((t=>{this.consecutiveAuthFails=0,this.reportFailedTopics(t),this.ablyContext=new b(t),e(this.ablyContext)})).catch((e=>{this.consecutiveAuthFails+=1,t(e)}))}))}reportFailedTopics(e){const t=e.getObjectOrUndefined("failures");"object"==typeof t&&0!==Object.keys(t).length&&(0,r.bT)("PushServiceClient",{action:"token_request_failed_topics",topics:JSON.stringify(t),client:f})}canAccessTopic(e){var t;const i=null===(t=this.ablyContext)||void 0===t?void 0:t.getChannelName(e);return void 0!==i&&void 0!==this.authToken&&this.authToken.getChannelNames().includes(i)}getTopicKeys(){if(void 0===this.authToken)return[];const e=this.authToken.getChannelNames(),t=[];return e.forEach((e=>{var i;const s=null===(i=this.ablyContext)||void 0===i?void 0:i.getTopicKeys(e);void 0!==s&&t.push(...s)})),t}updateAuthToken(){return new Promise(((e,t)=>{this.realtime.auth.authorize().then((t=>{const i=JSON.parse(atob(t.token.split(".")[1]));this.authToken=new x(new s.N6(i)),e()})).catch((e=>{const i=A("auth",e);t(i)}))}))}}function A(e,t){let i;return i=void 0===t?{code:e,message:"Unknown",providerCode:""}:"string"==typeof t?{code:e,message:t,providerCode:""}:"statusCode"in t?P(e,t):t,i}function P(e,t){const i={code:e,message:"Unknown failure",providerCode:""};return void 0!==t&&(i.message=t.message,i.providerCode=t.code.toString(),void 0!==t.cause&&"code"in t.cause&&(i.cause=t.cause.code)),i}class k extends g{constructor(e){super(e),this.tokenRequest=e.getObject("token_request"),e.logUnusedDebugging("DevContext")}static parseSettings(e){const t={backend:R,flags:new Map,url:e.getStringOrUndefined("url"),verifyEnabled:!1};return m(t.flags,e.getObjectOrUndefined("flags")),t}parseSettings(e){return k.parseSettings(e)}isValid(){return void 0!==this.tokenRequest}getTokenRequest(){if(void 0===this.tokenRequest)throw new Error("Access to tokenRequest on an invalid context!");return this.tokenRequest}serialize(){return JSON.stringify(this.tokenRequest)}}class M{constructor(e,t){this.client=e,this.consecutiveAuthFails=0,this.context=t}serialize(){var e;return!0!==(null===(e=this.context)||void 0===e?void 0:e.isValid())?"":this.context.serialize()}fetchAccessToken(){return this.getRequestToken().then((e=>this.getAccessToken(e)))}getRequestToken(){return new Promise(((e,t)=>{S(R).then((i=>{this.consecutiveAuthFails=0;const s=i.getObjectOrUndefined("failures");if("object"==typeof s&&0!==Object.keys(s).length&&(0,r.bT)("PushServiceClient",{action:"token_request_failed_topics",topics:JSON.stringify(s),client:R}),this.context=new k(i),this.context.isValid()){this.client.context=this.context;const t=this.context.getTokenRequest();e(t)}else t("Invalid token request")})).catch((e=>{this.consecutiveAuthFails+=1,this.consecutiveAuthFails>=3&&debug("Should be closing connection and reverting to ably/wowza"),t(e)}))}))}getAccessToken(e){return new Promise(((t,i)=>{if(void 0===this.context)return void i("no context");const n=new XMLHttpRequest,o=void 0===this.context.settings.url?"":`http://${this.context.settings.url}`;n.open("POST",`${o}/auth/access_token`,!0),n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.onload=()=>{if((0,w.W9)(n.status)){const e=new s.N6(n.responseText);t(e.getString("access_token"))}else i(new w.fr(n))},n.send(JSON.stringify({request_token:e}))}))}canAccessTopic(e){var t;return void 0!==(null===(t=this.context)||void 0===t?void 0:t.getChannelName(e))}getTopicKeys(){return[]}getFailedTopics(){return[]}updateAuthToken(){return this.client.updateAuth()}reportFailedTopics(e){debug("Failed topics on dev service",e.stringMessage)}}const R="hermod";class I extends v{constructor(e){super(e),this.clientName=R,this.connectionState="unknown",this.connectionChange=new o.c_("HermodClientConnection"),this.auth=new M(this)}close(){var e,t;null===(e=this.websocket)||void 0===e||e.send("send closing message"),null===(t=this.websocket)||void 0===t||t.close()}_connect(){this.auth.fetchAccessToken().then((e=>{var t,i;const n=void 0===(null===(t=this.auth.context)||void 0===t?void 0:t.settings.url)?`${window.location.hostname}:${window.location.port}/hermod`:`${null===(i=this.auth.context)||void 0===i?void 0:i.settings.url}`;this.websocket=new WebSocket(`ws://${n}`),this.websocket.onmessage=e=>{const t=new s.N6(e.data),i=t.getNumber("action"),n=t.getString("channel",!1);switch(i){case 4:this.connectionChange.fire({previous:this.connectionState,current:"connected"}),this.connectionState="connected";break;case 6:this.connectionChange.fire({previous:this.connectionState,current:"disconnected"}),this.connectionState="disconnected";break;case 9:warn("Error on websocket",t,"PUSH_");break;case 11:case 13:break;case 15:const e=t.getList("messages");null==e||e.forEach(((e,i)=>{const o=`${t.getString("id")}:${i}`,r=new s.N6({...e.getParsed(),channel:n,providerData:{id:o,ts:t.getNumber("timestamp")}}),a=this.getChannelTopicMap(n);let l;if(void 0!==a&&(l=a.get(r.getString("_topic"))),void 0!==l){if(this.handleMessageDuplicate(n,r,r.getString("tid")))return;this.callbacks.onMessage(this.clientName,l,r)}else"o"!==r.getStringOrUndefined("_sm")&&warn("Received message for unknown topic",{topic:r.getString("_topic"),client:this.clientName})}))}},this.websocket.onopen=()=>{var t;null===(t=this.websocket)||void 0===t||t.send(JSON.stringify({action:3,message:{accessToken:e}}))}})).catch((e=>{error(e)})),this.connectionState="connecting"}updateAuth(){return this.isConnected()?this.auth.fetchAccessToken().then((e=>void 0===this.websocket?Promise.reject("Invalid websocket during update"):(this.websocket.send(JSON.stringify({action:17,message:{accessToken:e}})),Promise.resolve()))).catch((e=>{error(e)})):this.connect()}getConnectionState(){return this.connectionState}getChannelState(e){return"unknown"}getReconnectCount(){return-1}_subscribe(e){const t=this.getChannelName(e);return void 0===t?Promise.reject("invalid channel name reached subscribe"):this.ensureConnectedAndAuthed(e).then((()=>void 0===this.websocket?Promise.reject("websocket undefined"):(this.websocket.send(JSON.stringify({action:10,channelName:t})),Promise.resolve())))}_unsubscribe(e){const t=this.getChannelName(e);return void 0===t?Promise.reject("invalid channel name reached unsubscribe"):this.ensureConnectedAndAuthed(e).then((()=>void 0===this.websocket?Promise.reject("websocket undefined"):(this.websocket.send(JSON.stringify({action:12,channelName:t})),Promise.resolve())))}enterPresence(e,t){const i=this.getChannelName(e);return void 0===i?Promise.reject("invalid channel name"):this.ensureConnectedAndAuthed(e).then((()=>this.subscribe(e))).then((()=>{var e;return void 0===this.websocket?Promise.reject("websocket undefined"):(this.websocket.send(JSON.stringify({action:14,channelName:i,message:null!==(e=null==t?void 0:t.data)&&void 0!==e?e:{}})),Promise.resolve())}))}leavePresence(e){return this.unsubscribe(e)}}const E="p";function L(e,t){return{providerCode:"",code:e,message:null!=t?t:""}}class D extends v{constructor(e,t){super(e),this.clientName=E,this.connectionChange=new o.c_("PusherClientConnection"),this.settings=t,this.auth=new B(this)}close(){void 0!==this.client&&this.client.disconnect(),this.auth.reset(),this.client=void 0}_connect(){const e={cluster:this.settings.cluster,channelAuthorization:{endpoint:C,transport:"ajax",customHandler:(e,t)=>{const i=this.auth.getAuthToken(e.channelName);void 0!==i?t(null,{auth:i,channel_data:this.auth.channelDataString}):t(new Error("Pusher js no auth token"),null)}}};void 0!==this.settings.host&&""!==this.settings.host&&(e.wsHost=`ws.${this.settings.host}`,e.httpHost=`sockjs.${this.settings.host}`),this.client=new Pusher(this.settings.key,e),this.client.connection.bind("state_change",(e=>{"connected"===e.current&&void 0!==this.client&&(void 0!==this.socketId&&this.socketId!==this.client.connection.socket_id&&(this.auth.reset(),this.activeSubscriptions.clear()),this.socketId=this.client.connection.socket_id);const t={current:u(e.current),previous:u(e.previous),client:"p"};this.connectionChange.fire(t)})),Pusher.log=e=>debug(e),this.connect().catch((()=>{}))}getConnectionState(){return void 0===this.client?"disconnected":u(this.client.connection.state)}getChannelState(e){return void 0===this.client?"unknown":void 0===(t=this.client.channel(e))?"uninitialized":t.subscriptionPending?"subscribing":t.subscribed?"subscribed":t.subscriptionCancelled?"failed":"initialized";var t}getReconnectCount(){return-1}_subscribe(e){const t=this.getChannelName(e);if(void 0===t)return Promise.reject(L("topic_error","Invalid topic key reached subscribe"));if(void 0===this.client)return Promise.reject(L("connect","Client not initialized at subscribe"));const i=this.client.subscribe(t),n=new Promise(((n,o)=>{this.ensureConnectedAndAuthed(e).then((()=>{i.unbind_all(),i.bind("notify",(e=>{e.providerData={id:"pusher:id:1",ts:(new Date).getTime()};const i=new s.N6(e);this.checkForReauth(i);const n=this.getChannelTopicMap(t);let o;if(void 0!==n&&(o=n.get(i.getString("_topic"))),void 0!==o){if(this.handleMessageDuplicate(t,i,i.getString("tid")))return;this.callbacks.onMessage(this.clientName,o,i)}else"o"!==i.getStringOrUndefined("_sm")&&warn("Received message for unknown topic",{topic:i.getString("_topic"),client:this.clientName})})),n()})).catch((e=>{i.unbind_all(),i.unsubscribe(),o(L("subscribe",e))}))}));return this.topicPromises.set(e,n),n}_unsubscribe(e){const t=this.getChannelName(e);if(void 0===t)return Promise.reject(L("topic_error","Invalid topic key reached unsubscribe"));if(void 0===this.client)return Promise.reject(L("connect","Client not initialized at unsubscribe"));const i=this.client.channel(t);if(void 0===i)return Promise.resolve();const s=new Promise(((e,s)=>{i.unbind_all(),i.unsubscribe(),this.auth.removeTopicAuth(t),e()}));return this.topicPromises.set(e,s),s}enterPresence(e,t){return this.subscribe(e).then((()=>{const i=this.getChannelName(e);if(void 0===i)return Promise.reject(L("topic_error","Invalid topic key reached enterPresence"));if(void 0===this.client)return Promise.reject(L("connect","Client not initialized at enterPresence"));const s=this.client.channel(i);return void 0===s?Promise.reject(L("topic_error","Invalid channel state after subscribe in enterPresence")):(s.members.me.info=t,Promise.resolve())}))}leavePresence(e){return this.unsubscribe(e)}getConnectionType(){return""}getConnectionId(){let e="";return void 0!==this.client&&(e=this.client.connection.socket_id),e}getClientId(){let e="";return void 0!==this.client&&(e=this.client.sessionID.toString()),e}getConnectionHost(){return this.settings.key}getConnectionServer(){return this.settings.cluster}}class B{constructor(e){this.realtime=e,this.tokens=new Map,this.consecutiveAuthFails=0}serialize(){return JSON.stringify(this.tokens)}getTopicKeys(){const e=Array.from(this.tokens.keys()),t=[];return e.forEach((e=>{var i;const s=null===(i=this.realtime.context)||void 0===i?void 0:i.getTopicKeys(e);void 0!==s&&t.push(...s)})),t}reset(){this.tokens.clear(),this.consecutiveAuthFails=0}removeTopicAuth(e){this.tokens.delete(e)}getAuthToken(e){return this.tokens.get(e)}canAccessTopic(e){var t;return void 0!==(null===(t=this.realtime.context)||void 0===t?void 0:t.getChannelName(e))}updateAuthToken(){return this.realtime.ensureConnected().then((()=>{const e=this.realtime.getConnectionId();return S(E,{socket_id:e}).then((t=>{this.consecutiveAuthFails=0,this.reportFailedTopics(t);const i=t.getParsedSubMap("tokens"),s=t.getObject("tokens");return 0===Object.keys(s).length&&warn("Pusher auth has no tokens",{req_socket_id:e,socket_id:this.realtime.getConnectionId(),authCtx:t.stringMessage}),this.channelDataString=t.getStringOrUndefined("channel_data",!0),Array.from(Object.keys(s)).forEach((e=>{this.tokens.set(e,i.getString(e))})),this.realtime.context=new U(t),Promise.resolve()})).catch((e=>(this.consecutiveAuthFails+=1,this.consecutiveAuthFails>=3&&this.realtime.close(),Promise.reject(e))))}))}reportFailedTopics(e){const t=e.getObjectOrUndefined("failures");"object"==typeof t&&0!==Object.keys(t).length&&(0,r.bT)("PushServiceClient",{action:"token_request_failed_topics",topics:JSON.stringify(t),client:E})}}class U extends g{constructor(e){super(e),e.logUnusedDebugging("PusherContext")}parseSettings(e){return U.parseSettings(e)}static parseSettings(e){const t={backend:E,flags:new Map,key:e.getString("key"),cluster:e.getString("cluster"),host:e.getStringOrUndefined("host"),verifyEnabled:!1};return m(t.flags,e.getObjectOrUndefined("flags")),t}isValid(){return!0}}class F{constructor(e){this.activeClients=e,this.startTime=(new Date).getTime(),this.messages=new Map,this.timeouts=new Set,this.totalFailures=0,this.connectedClients=[],this.connectionHistory={},this.messageCount={},this.expireTime=9e4,this.lateTime=3e3,this.invalidateClient("w")}verify(e,t,i){if(this.setLastMessage(e,(new Date).getTime()),this.activeClients.includes(e)||this.activeClients.push(e),this.connectedClients.includes(e)||this.connectedClients.push(e),this.activeClients.length<2)return;const s={clientName:e,topicKey:t,tid:i.getString("tid"),messageHash:this.hashMessage(i),initialClients:this.connectedClients};this.doVerify(s)}invalidateClient(e){this.activeClients=this.activeClients.filter((t=>t!==e))}buildMeta(e){return{messageHash:e.messageHash,timestamp:(new Date).getTime(),clients:[e.clientName],initialClients:e.initialClients}}doVerify(e){const t=this.messages.get(e.tid);if(void 0!==t)return this.handleItemMatch(t,e);const i=this.buildMeta(e);this.messages.set(e.tid,i),this.trackTimeout((()=>{this.handleItemNeverArrived(e.tid,i,e.topicKey),this.messages.delete(e.tid)}))}recordFailure(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;this.totalFailures+=1;const s={...t,...this.connectionHistory,...this.messageCount,topic:i.split(":")[0],topicKey:i,userid:i.split(":")[1],reason:e,start_time:this.startTime,total_failures:this.totalFailures,room_count:this.roomCount};debug("Push Service clients verifier failure",s),(0,r.PF)()&&(0,r.bT)("PushClientVerifier",s)}handleItemMatch(e,t){if(e.clients.includes(t.clientName))return;e.clients.push(t.clientName);const i=(new Date).getTime()-e.timestamp;i>this.lateTime&&this.handleItemLate(e,t,i),e.messageHash!==t.messageHash&&this.handleItemDiffers(e,t),0===this.activeClients.filter((t=>!e.clients.includes(t))).length&&debug("Push service clients verifier success",e)}handleItemNeverArrived(e,t,i){const s=this.activeClients.filter((e=>!t.clients.includes(e)));s.length>0&&this.recordFailure("never_arrived",{tid:e,first_ts:t.timestamp,first_client:t.clients[0],failedClients:s,initialClients:t.initialClients,connectedClients:this.connectedClients,isConnected:!!this.connectedClients.includes(s[0])},i)}handleItemDiffers(e,t){this.recordFailure("differs",{tid:t.tid,first_ts:e.timestamp,first_client:e.clients[0],failed_client:t.clientName,first_hash:e.messageHash,differ_hash:t.messageHash},t.topicKey)}handleItemLate(e,t,i){this.recordFailure("late",{late:i,tid:t.tid,first_ts:e.timestamp,first_client:e.clients[0],failed_client:t.clientName},t.topicKey)}trackTimeout(e){const t=window.setTimeout((()=>{e(),this.timeouts.delete(t)}),this.expireTime);this.timeouts.add(t)}hashMessage(e){const t=JSON.parse(e.stringMessage);return delete t.providerData,delete t.id,delete t.pub_ts,delete t.ts,delete t.method,delete t.channel,JSON.stringify(t)}recordDisconnect(e){this.connectedClients=this.connectedClients.filter((t=>t!==e))}setLastMessage(e,t){var i;this.connectionHistory[`${e}_time`]=t,this.messageCount[`${e}_messages`]=(null!==(i=this.messageCount[`${e}_messages`])&&void 0!==i?i:0)+1}setRoomCount(e){this.roomCount=e}validateClient(e){this.activeClients.includes(e)||this.activeClients.push(e)}}var _;const N="w";class O{constructor(e){this.clients=new Map,this.resetting=!1,this.counter=0,this.contexts=this.parseContext(e);const t=()=>{this.contexts.forEach((e=>{const i=this.clients.get(e.backend);if(void 0!==i&&i.close(),e.backend===N)return;e.backend===H.clientToVerify&&(e.verifyEnabled=!0);const s=this.initializeClient(e);void 0!==s?(this.clients.set(e.backend,s),s.connectionChange.listen((e=>{this.verifier.recordDisconnect(s.clientName),e.primary=this.isPrimaryClient(s),debug("PushClient connection change",{client:s.clientName,event:e}),["failed","closed","disconnected"].includes(e.current)&&!this.resetting&&e.primary&&(this.invalidateClient(s.clientName),this.counter+=1,this.resetting=!0,window.setTimeout((()=>{t(),H.updateAuthorization(),this.resetting=!1,this.informReconnect(s.clientName,this.getPrimaryClient(),this.counter)}),3e3)),H.connectionChange.fire(e),"connected"===e.current&&(this.lastConnection=Date.now(),H.updateAuthorization(),this.verifier.validateClient(s.clientName))}))):warn("client not initialized",{client:e.backend},"PUSH_")}))};t(),this.verifier=new F(this.contexts.map((e=>e.backend)))}getFlag(e){var t;const i=this.contexts.find((e=>e.backend!==N));return void 0===i&&warn("getting flag without any valid context",{},"PUSH_"),null!==(t=null==i?void 0:i.flags.get(e))&&void 0!==t&&t}setVerified(e){void 0!==e&&this.contexts.forEach((t=>{t.backend===e&&t.flags.set("verify_enabled",!0)}))}isWowzaPrimary(){return this.contexts.length<1||this.contexts[0].backend===N}isPrimaryClient(e){const t=this.contexts.find((e=>e.backend!==N&&!0===e.flags.get("is_live")));return(null==t?void 0:t.backend)===e.clientName}getPrimaryClient(){const e=this.contexts.find((e=>e.backend!==N)),t={contexts:Array.from(this.contexts.keys()),clients_keys:Array.from(this.clients.keys()),clients:Array.from(this.clients.values()).map((e=>e.clientName))};if(void 0!==e)return this.clients.get(e.backend);warn("no valid push service context",t,"PUSH_")}getActiveClients(){return Array.from(this.clients.values()).filter((e=>{const t=this.contexts.find((t=>t.backend===e.clientName));return this.isPrimaryClient(e)||!0===(null==t?void 0:t.verifyEnabled)||!0===(null==t?void 0:t.flags.get("is_live"))}))}updateOrder(e){e.length!==this.contexts.length&&warn("invalid chat backends",{backends:e},"PUSH_"),debug("Changing push service backends",e),this.contexts=this.contexts.filter((t=>e.includes(t.backend))).sort(((t,i)=>e.indexOf(t.backend)-e.indexOf(i.backend)))}initializeClient(e){const t=e=>{var t;return(null===(t=this.contexts.find((e=>e.backend!==N)))||void 0===t?void 0:t.backend)===e},i={onMessage:(e,i,s)=>{this.verifier.verify(e,i,s),t(e)&&c.J.fireMessage(i,s)},onSubscribe:(e,i,s)=>{t(e)&&c.J.fireSubscribeChange(i,{subscribed:s,isCriticalFail:!1})}};try{switch(e.backend){case f:return new y(i,e,H.isBroadcaster);case E:return new D(i,e);case R:return new I(i)}}catch(t){H.getClientName()===e.backend&&H.primaryClientFailure.fire("client failure"),error("An exception was thrown during client construction",t,"PUSH_")}}parseContext(e){const t={backend:N,flags:new Map,verifyEnabled:!1},i=[];for(const s of e)switch(s.getStringOrUndefined("backend")){case f:i.push(b.parseSettings(s));break;case R:i.push(k.parseSettings(s));break;case E:i.push(U.parseSettings(s));break;case N:i.push(t);break;default:warn("unrecognized backend during parseContext",{failed_context:s},"PUSH_")}return 1===i.length&&!0!==i[0].flags.get("is_live")&&(warn("first context is not is_live",{context:i[0]},"PUSH_"),i[0].flags.set("is_live",!0)),i}invalidateClient(e){for(const[e,t]of this.clients)t.close();this.orderLast(e);let t=0;for(;!0!==this.contexts[0].flags.get("is_live")&&t<3;)this.orderLast(this.contexts[0].backend),t+=1}orderLast(e){this.updateOrder(this.contexts.map((e=>e.backend)).filter((t=>t!==e)).concat([e]))}setVerifierRoomCount(e){this.verifier.setRoomCount(e)}informReconnect(e,t,i){window.setTimeout((()=>{const s={failedClient:e,lastConnection:this.lastConnection,newClient:null==t?void 0:t.clientName,success:null==t?void 0:t.isConnected(),connectionAttempt:i};(0,r.bT)("PushServiceReconnect",s)}),3e3)}}class H{static initialize(e){var t;const i=new s.N6(e);H.servicesContext=i.getList("push_services"),H.presenceId=null!==(t=i.getStringOrUndefined("presence_id"))&&void 0!==t?t:H.presenceId,H.clientToVerify=i.getStringOrUndefined("push_service_verify"),void 0!==H.servicesContext?(H.isBroadcaster=void 0!==i.getAny("broadcastDossier"),H.clientManager=new O(H.servicesContext),H.clientManager.setVerified(H.clientToVerify)):error("PushService parseContext failed",{context_keys:i.keys()},"PUSH_")}static isConnected(){const e=H.getClient();return void 0!==e&&e.isConnected()}static isEnabledForVerify(){return H.isEnabledForUI()||void 0!==l.Bm.current.loggedInUser}static isEnabledForUI(){return void 0!==H.clientManager&&!H.clientManager.isWowzaPrimary()}static isEnabledForUserList(){return H.isConnected()}static changeChatHandler(e){void 0!==H.clientManager?H.clientManager.updateOrder(e):error("attempting to change backends on not ready push service",{backends:e},"PUSH_")}static updateAuthorization(){H.updateAuthThrottler.callFunc()}static _updateAuthorizationAndSubscriptions(){var e,t;const i=null!==(e=null===(t=H.clientManager)||void 0===t?void 0:t.getActiveClients())&&void 0!==e?e:[];if(i.length<1)return void c.J.getTopicKeys().forEach((e=>{c.J.fireSubscribeChange(e,{subscribed:!1,isCriticalFail:!0})}));H.authId+=1;const s=H.authId;window.clearTimeout(H.pushReconnectTimeout);const n=H.getTopicKeysToAuth(),o=(new Date).getTime();i.forEach((e=>{const t=H.isPrimaryClient(e);e.getAuthPromise(n).then((()=>{if(H.pushReconnectTimer=5e3,sc.J.fireAuthFail(e))));let n=!1;const a=e.connectionChange.listen((e=>{"closed"!==e.current&&"disconnected"!==e.current||(n=!0)}),!1),l=(new Date).getTime();H.subscribeToEligibleTopics(e).then((i=>{const h=(new Date).getTime();if(a.removeListener(),s"fulfilled"===e.status)).length,u=e.auth.getTopicKeys().filter((t=>!e.isSubscribedTo(t)));if((0,r.bT)("PushServiceTopicSetup",{client:e.clientName,all_topics_success:0===u.length,topics_requested_count:i.length,successful_topic_count:d,failed_topic_list:u.toSorted().toString(),is_push_connected:H.isConnected(),elapsed_time:h-l,elapsed_time_auth:h-o}),e.shouldRetrySubscribe()&&!n&&(H.pushReconnectTimeout=window.setTimeout((()=>{H.updateAuthorization()}),1e4)),t){const t=e.getCriticallyFailedTopics();u.forEach((e=>{c.J.fireSubscribeChange(e,{subscribed:!1,isCriticalFail:n||t.includes(e),retryCallback:n?void 0:()=>{H.updateAuthorization()}})}))}})).catch((()=>{}))})).catch((i=>{var o,r;s{H.updateAuthorization()}),H.pushReconnectTimer),H.pushReconnectTimer*=2,n.filter((e=>!H.isListeningFor(e))).forEach((e=>{c.J.fireAuthFail(e)})),i.message.includes("access denied")||e.addPageAction("auth_failure",{client_id:e.getClientId(),user_uid:null!==(o=null===(r=l.Bm.current.loggedInUser)||void 0===r?void 0:r.userUid)&&void 0!==o?o:"anon",message:i.message,provider_status:i.providerCode,cause:i.cause,code:i.code}))}))}))}static getTopicKeysToAuth(){return c.J.getTopicKeys().concat(c.J.getPendingTopics())}static getTopicAuthData(e){const t=c.J.getTopicAuthData(e);return void 0===t&&warn("undefined topic data",{topic:e},"PUSH_"),t}static getClient(){var e;const t=null===(e=H.clientManager)||void 0===e?void 0:e.getPrimaryClient();return void 0===t&&error("No valid push service client",{},"PUSH_"),t}static listenFor(e,t){return e.isSubscribedTo(t)?Promise.resolve():e.subscribe(t).catch((i=>{e.addPageAction("subscribe_failure",{is_primary:H.isPrimaryClient(e),topic:t,auth:e.auth.serialize(),code:i.code,message:i.message,providerCode:i.providerCode})}))}static stopListeningFor(e){var t,i;const s=null!==(t=null===(i=H.clientManager)||void 0===i?void 0:i.getActiveClients())&&void 0!==t?t:[];if(s.length<1)return Promise.reject("PushService client is not initialized");const n=s.map((t=>{const i=H.isPrimaryClient(t),s=t.unsubscribe(e).catch((s=>{t.addPageAction("unsubscribe_failure",{is_primary:i,topic:e,auth:t.auth.serialize(),code:s.code,message:s.message,providerCode:s.providerCode})}));return i?s:void 0})).find((e=>void 0!==e));return null!=n?n:Promise.reject("Primary client lost during unsubscribe")}static isListeningFor(e){const t=H.getClient();return void 0!==t&&t.isSubscribedTo(e)}static subscribeToEligibleTopics(e){const t=c.J.getTopicKeys().filter((t=>(c.J.hasPresence(t)||!e.isSubscribedTo(t))&&e.auth.canAccessTopic(t))).map((t=>{const i=c.J.getPresence(t);return void 0!==i?e.enterPresence(t,i):H.listenFor(e,t)}));return Promise.all((0,a.rO)(t))}static close(){var e,t;(null!==(e=null===(t=H.clientManager)||void 0===t?void 0:t.getActiveClients())&&void 0!==e?e:[]).forEach((e=>e.close())),void 0!==H.servicesContext&&(H.clientManager=new O(H.servicesContext))}static addExternalMessage(e,t){var i,s;const n=null!==(i=null===(s=H.clientManager)||void 0===s?void 0:s.getActiveClients())&&void 0!==i?i:[];let o=!1;for(const i of n)i.addExternalMessage(e,t)&&H.isPrimaryClient(i)&&(o=!0);return o}static getConnectionType(){const e=H.getClient();return void 0===e?"not_connected":e.getConnectionType()}static getConnectionId(){const e=H.getClient();return void 0===e?"":e.getConnectionId()}static isPrimaryClient(e){return void 0!==H.clientManager&&H.clientManager.isPrimaryClient(e)}static setVerifierRoomCount(e){var t;null===(t=H.clientManager)||void 0===t||t.setVerifierRoomCount(e)}static getClientName(){var e,t;return null!==(e=null===(t=H.getClient())||void 0===t?void 0:t.clientName)&&void 0!==e?e:""}}(_=H).pushReconnectTimer=5e3,_.isBroadcaster=!1,_.connectionChange=new o.c_("PushServiceClientConnection"),_.primaryClientFailure=new o.c_("PushServicePrimaryClientFailure"),_.updateAuthThrottler=new n.a((()=>{_._updateAuthorizationAndSubscriptions()}),{bounceLimitMS:800,debounceType:1}),_.presenceId=Math.random().toString(36).substring(2),_.authId=0},2823:(e,t,i)=>{"use strict";i.d(t,{K:()=>a,v:()=>r});var s=i(8423),n=i(5914),o=i(4516);function r(e){e.providerData={id:"",ts:0},e.pub_ts=0,e.method="UI"}class a{constructor(e){this.subscribeOnlyOnPrimaryBackend=!1,this.maxListeners=50,this.routerOptions={listenersWarningThreshold:5,onListenerAdded:()=>{this.onListenerAdded()},onListenerRemoved:()=>{this.onListenerRemoved()}},this.initData(e),this.authData=e,this.onMessage=new s.c_(this.getKey(),this.routerOptions),this.onAuthFail=new s.c_("TopicAuthFail",this.routerOptions),this.onSubscribeChange=new s.c_("TopicSubscribeChange",this.routerOptions)}getAuthKey(){return`${this.getId()}#${this.getKey()}`}parseData(e){return{tid:e.getString("tid"),providerId:e.getParsedSubMap("providerData").getString("id"),publishMethod:e.getString("method")}}isSubscribed(){return n.U.isListeningFor(this.getKey())}enterPresence(e){o.J.enterPresence(this,e)}leavePresence(){o.J.leavePresence(this)}getAuthData(){return this.authData}onListenerAdded(){1===this.onMessage.listenerCount()+this.onSubscribeChange.listenerCount()+this.onAuthFail.listenerCount()&&o.J.registerTopic(this)}onListenerRemoved(){0===this.onMessage.listenerCount()+this.onSubscribeChange.listenerCount()+this.onAuthFail.listenerCount()&&o.J.removeTopic(this)}uidCheck(e){if(7!==e.length&&14!==e.length)throw new Error("Invalid uid passed into topic")}}},8650:(e,t,i)=>{"use strict";i.d(t,{JS:()=>h,TP:()=>d,UT:()=>o,ZT:()=>l,bu:()=>a,qN:()=>r});var s=i(438),n=i(7477);class o extends n.PT{getId(){return"RoomModeratorNoticeTopic"}parseData(e){return{...super.parseData(e),...(0,s.rI)(e),toGroup:"red",toUser:void 0,ts:Math.floor(1e3*e.getNumber("ts"))}}}class r extends n.PT{getId(){return"RoomFanClubTopic"}parseData(e){return{...super.parseData(e),...(0,s.rI)(e),toGroup:"green",toUser:void 0,ts:Math.floor(1e3*e.getNumber("ts"))}}}class a extends n.PT{getId(){return"RoomLightPurpleTopic"}parseData(e){return{...super.parseData(e),...(0,s.rI)(e),toGroup:"lightpurple",toUser:void 0,ts:Math.floor(1e3*e.getNumber("ts"))}}}class l extends n.PT{getId(){return"RoomDarkPurpleTopic"}parseData(e){return{...super.parseData(e),...(0,s.rI)(e),toGroup:"darkpurple",toUser:void 0,ts:Math.floor(1e3*e.getNumber("ts"))}}}class h extends n.PT{getId(){return"RoomDarkBlueTopic"}parseData(e){return{...super.parseData(e),...(0,s.rI)(e),toGroup:"darkblue",toUser:void 0,ts:Math.floor(1e3*e.getNumber("ts"))}}}class d extends n.PT{getId(){return"RoomLightBlueTopic"}parseData(e){return{...super.parseData(e),...(0,s.rI)(e),toGroup:"lightblue",toUser:void 0,ts:Math.floor(1e3*e.getNumber("ts"))}}}},8300:(e,t,i)=>{"use strict";i.d(t,{QD:()=>r,ZW:()=>h,fn:()=>a,hw:()=>l});var s=i(438),n=i(2823);class o extends n.K{constructor(e,t){if(super({broadcaster_uid:e,show_id:t}),0===e.length)throw new Error("room uid cannot be empty");if(0===t.length)throw new Error("show ID cannot be empty")}getKey(){return`${this.getId()}:${this.roomUid}:${this.showId}`}initData(e){this.roomUid=e.broadcaster_uid,this.showId=e.show_id}}class r extends o{constructor(){super(...arguments),this.maxListeners=1}getId(){return"PrivateRoomUserPresenceTopic"}}class a extends o{getId(){return"PrivateRoomMessageTopic"}parseData(e){return{...super.parseData(e),...(0,s.YE)(e),ts:Math.floor(1e3*e.getNumber("ts"))}}}class l extends o{getId(){return"PrivateRoomTipAlertTopic"}parseData(e){return{...super.parseData(e),fromUser:(0,s.Rh)(e),message:e.getString("message",!1),amount:e.getNumber("amount"),isAnonymousTip:e.getBoolean("is_anonymous_tip"),toUsername:e.getString("to_username"),ts:Math.floor(1e3*e.getNumber("ts")),roomType:"private"}}}class h extends o{getId(){return"PrivateRoomEnterLeaveTopic"}parseData(e){return{...super.parseData(e),user:(0,s.by)(e.getParsedSubMap("user")),action:e.getString("action"),viewers:e.getNumber("count"),connections:e.getNumber("num_connections")}}}},7477:(e,t,i)=>{"use strict";i.d(t,{BP:()=>N,C9:()=>R,EJ:()=>T,Fh:()=>m,H1:()=>k,HW:()=>w,IJ:()=>b,Io:()=>M,KU:()=>P,Mt:()=>y,PT:()=>l,Q4:()=>L,Tp:()=>x,Uv:()=>u,WQ:()=>A,bq:()=>v,dq:()=>_,eB:()=>I,fH:()=>E,iS:()=>F,iX:()=>p,n1:()=>D,pr:()=>U,rr:()=>f,sL:()=>S,t1:()=>d,uB:()=>g,ug:()=>C,vE:()=>c,yv:()=>B});var s=i(7063),n=i(438),o=i(8255),r=i(8863),a=i(2823);class l extends a.K{constructor(e){super({broadcaster_uid:e}),this.uidCheck(this.roomUid)}initData(e){this.roomUid=e.broadcaster_uid}getKey(){return`${this.getId()}:${this.roomUid}`}}class h extends a.K{constructor(e,t){super({broadcaster_uid:e,user_uid:t}),this.uidCheck(this.roomUid),this.uidCheck(this.userUid)}getKey(){return`${this.getId()}:${this.roomUid}:${this.userUid}`}initData(e){this.roomUid=e.broadcaster_uid,this.userUid=e.user_uid}}class d extends l{constructor(){super(...arguments),this.maxListeners=1}getId(){return"PrivilegedSessionTopic"}}class c extends h{constructor(){super(...arguments),this.maxListeners=1}getId(){return"RoomUserPresenceTopic"}}class u extends l{constructor(){super(...arguments),this.subscribeOnlyOnPrimaryBackend=!0}getId(){return"RoomAnonPresenceTopic"}}class p extends l{constructor(){super(...arguments),this.maxListeners=1}getId(){return"RoomPasswordProtectedTopic"}}class m extends l{getId(){return"RoomTitleChangeTopic"}parseData(e){return{...super.parseData(e),title:e.getString("title")}}}class g extends l{getId(){return"RoomTipAlertTopic"}parseData(e){return{...super.parseData(e),fromUser:(0,n.Rh)(e),message:e.getString("message"),amount:e.getNumber("amount"),isAnonymousTip:e.getBoolean("is_anonymous_tip"),toUsername:e.getString("to_username"),ts:Math.floor(1e3*e.getNumber("ts")),roomType:"public"}}}class v extends l{getId(){return"RoomStatusTopic"}parseData(e){return{...super.parseData(e),status:(0,o.PZ)(e.getString("status")),message:e.getString("message"),password:e.getString("hash")}}}class f extends h{getId(){return"RoomUserHiddenCamStatusTopic"}parseData(e){return{...super.parseData(e),status:e.getString("status")}}}class y extends l{getId(){return"RoomMessageTopic"}parseData(e){return{...super.parseData(e),...(0,n.YE)(e),ts:Math.floor(1e3*e.getNumber("ts"))}}}class b extends l{getId(){return"RoomSilenceTopic"}parseData(e){return{...super.parseData(e),username:e.getString("username"),fromUser:e.getString("from_username")}}}class w extends l{getId(){return"RoomKickTopic"}parseData(e){return{...super.parseData(e),username:e.getString("username"),fromUser:"Unknown"}}}class C extends l{getId(){return"RoomModeratorPromotedTopic"}parseData(e){return{...super.parseData(e),username:e.getString("username"),fromUser:e.getString("from_username")}}}class S extends l{getId(){return"RoomModeratorRevokedTopic"}parseData(e){return{...super.parseData(e),username:e.getString("username"),fromUser:e.getString("from_username")}}}class x extends l{getId(){return"RoomNoticeTopic"}parseData(e){return{...super.parseData(e),...(0,n.rI)(e),ts:Math.floor(1e3*e.getNumber("ts")),toGroup:void 0,toUser:void 0}}}class T extends h{getId(){return"RoomUserNoticeTopic"}parseData(e){return{...super.parseData(e),...(0,n.rI)(e),ts:Math.floor(1e3*e.getNumber("ts")),toGroup:void 0,toUser:this.userUid}}}class A extends l{getId(){return"RoomAppLogTopic"}parseData(e){return{...super.parseData(e),...(0,n.tV)(e)}}}class P extends l{getId(){return"RoomPurchaseTopic"}parseData(e){return{...super.parseData(e),fromUser:(0,n.by)(e.getParsedSubMap("user")),message:e.getString("message"),ts:Math.floor(1e3*e.getNumber("ts"))}}}class k extends l{getId(){return"RoomFanClubJoinedTopic"}parseData(e){return{...super.parseData(e),fromUser:(0,n.by)(e.getParsedSubMap("user")),message:e.getString("message"),ts:Math.floor(1e3*e.getNumber("ts"))}}}class M extends l{getId(){return"RoomSettingsTopic"}parseData(e){return{...super.parseData(e),allowPrivateShow:e.getBoolean("allow_private_shows"),privatePrice:e.getNumber("private_show_tokens_per_minute"),spyPrice:e.getNumber("spy_on_private_show_tokens_per_minute"),privateMinMinutes:e.getNumber("private_min_minutes"),allowShowRecordings:e.getBoolean("allow_show_recordings"),hasFanClub:e.getBoolean("has_fan_club"),activePassword:e.getBoolean("active_password")}}}class R extends l{getId(){return"RoomEnterLeaveTopic"}parseData(e){return{...super.parseData(e),user:(0,n.by)(e.getParsedSubMap("user")),action:e.getString("action"),viewers:e.getNumber("count"),connections:e.getNumber("num_connections")}}}class I extends l{getId(){return"RoomPrivilegedEnterTopic"}parseData(e){var t;const i={...e.getObject("user"),source_name:e.getStringOrUndefined("source"),exploringHashTag:null!==(t=e.getStringOrUndefined("exploring_hash"))&&void 0!==t?t:""};return{...super.parseData(e),action:"enter",user:(0,n.by)(new s.N6(i)),connections:e.getNumber("num_connections"),viewers:e.getNumber("count")}}}class E extends l{getId(){return"RoomPrivilegedLeaveTopic"}parseData(e){return{...super.parseData(e),action:"leave",user:(0,n.by)(e.getParsedSubMap("user")),viewers:e.getNumber("count"),connections:e.getNumber("num_connections")}}}class L extends l{getId(){return"RoomUpdateTopic"}parseData(e){const t={...super.parseData(e),target:e.getString("target"),appId:e.getStringOrUndefined("app_id",!1),appSystem:e.getStringOrUndefined("app_system",!1)},i=e.getString("target_user");return""!==i&&(t.targetUser=i),t}}class D extends h{getId(){return"RoomUserPrivateStatusTopic"}parseData(e){return{...super.parseData(e),status:e.getString("status"),privateShowId:e.getStringWithNumbers("show_id")}}}class B extends l{getId(){return"QualityUpdateTopic"}parseData(e){return{...super.parseData(e),quality:e.getString("quality"),rate:e.getNumber("rate"),stopped:e.getBoolean("stopped")}}}class U extends l{getId(){return"LatencyUpdateTopic"}parseData(e){return{...super.parseData(e),localTimeTranscoderInput:e.getNumberOrUndefined("local_time_transcoder_input"),streamTimeTranscoderInput:e.getNumberOrUndefined("stream_time_transcoder_input"),localTimeSegmentStart:e.getNumberOrUndefined("local_time_segment_start"),streamTimeSegmentStart:e.getNumberOrUndefined("stream_time_segment_start")}}}class F extends l{getId(){return"RoomShortcodeTopic"}parseData(e){var t;const i=null!==(t=e.getList("shortcodes"))&&void 0!==t?t:[];return{...super.parseData(e),...(0,n.YE)(e),ts:Math.floor(1e3*e.getNumber("ts")),shortcodes:(0,n.U3)(i)}}}class _ extends l{getId(){return"GameUpdateTopic"}parseData(e){return{...super.parseData(e),game:r.F.parseSelection(e.getObjectStringOrUndefined("game"))}}}class N extends l{getId(){return"ViewerPromotionTopic"}parseData(e){return{...super.parseData(e),purchaser:(0,n.Rh)(e.getParsedSubMap("purchaser")),durationMins:e.getNumber("duration_mins")}}}},4516:(e,t,i)=>{"use strict";i.d(t,{J:()=>o});var s,n=i(5914);class o{static fireMessage(e,t){const i=o.topics.get(e);if(void 0===i){if(o.missingTopics.has(e))return;o.missingTopics.add(e);const t={topicKey:e,client:n.U.getClientName()};void 0!==e&&e.includes(":")&&(t.topic=e.split(":")[0],t.userId=e.split(":")[1],t.subscribedTopics=o.getTopicKeys().toSorted().toString());const i=o.unsubscribedTracker.get(e);return void 0!==i&&(t.timeSinceListen=(new Date).getTime()-i.getTime()),void warn("calling fireMessage with no topics in TopicManager",t,"PUSH_")}i.forEach((e=>{e.onMessage.fire(e.parseData(t))})),t.logUnusedDebugging(e)}static fireMessageDirect(e,t){const i=o.topics.get(e.getKey());void 0!==i?i.forEach((e=>{e.onMessage.fire(t)})):warn("calling fireMessageDirect with no topics in TopicManager",{topicKey:e.getKey(),client:n.U.getClientName()},"PUSH_")}static fireSubscribeChange(e,t){var i;null===(i=o.topics.get(e))||void 0===i||i.forEach((e=>{e.onSubscribeChange.fire(t)}))}static fireAuthFail(e){var t;null===(t=o.topics.get(e))||void 0===t||t.forEach((e=>{e.onAuthFail.fire(void 0)}))}static registerTopic(e){let t=o.topics.get(e.getKey());void 0===t?t=[e]:(t.length>e.maxListeners&&warn("Too many instances of topic created",{topic:e.getKey(),num_listeners:t.length},"PUSH_"),t.push(e)),o.topics.set(e.getKey(),t),n.U.updateAuthorization()}static removeTopic(e){const t=o.topics.get(e.getKey());if(void 0!==t){const i=t.indexOf(e);if(t.splice(i,1),t.length<1){if(o.topics.delete(e.getKey()),o.pending.set(e.getKey(),e),o.unsubscribedTracker.size>o.unsubscribedLimit){const e=Array.from(o.unsubscribedTracker.entries());o.unsubscribedTracker=new Map(e.splice(0,o.unsubscribedLimit/2))}o.unsubscribedTracker.set(e.getKey(),new Date),n.U.stopListeningFor(e.getKey()).then((()=>{o.pending.delete(e.getKey())})).catch((()=>{}))}else o.topics.set(e.getKey(),t)}}static getTopicKeys(){const e=Array.from(o.presence.keys()),t=e=>e.onMessage.listenerCount()>0||e.onSubscribeChange.listenerCount()>0;return o.topics.forEach(((i,s)=>{i.some(t)&&e.push(s)})),e}static getPresenceKeys(){return Array.from(o.presence.keys())}static getPendingTopics(){return Array.from(o.pending.keys())}static hasPresence(e){return o.presence.has(e)}static getPresence(e){return o.presence.get(e)}static getTopic(e){const t=o.presence.get(e);if(void 0!==t)return t.topic;const i=o.pending.get(e);if(void 0!==i)return i;const s=o.topics.get(e);return void 0!==s&&0!==s.length?s[0]:void 0}static getTopicAuthData(e){const t=o.getTopic(e);if(void 0!==t)return{key:t.getAuthKey(),payload:t.getAuthData(),subscribeOnlyOnPrimaryBackend:t.subscribeOnlyOnPrimaryBackend}}static enterPresence(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.presence.set(e.getKey(),{changed:!0,data:t,topic:e}),n.U.updateAuthorization()}static leavePresence(e){const t=e.getKey();o.presence.has(t)&&(o.presence.delete(t),o.pending.set(t,e),n.U.stopListeningFor(e.getKey()).then((()=>{o.pending.delete(t)})).catch((()=>{})))}}(s=o).topics=new Map,s.presence=new Map,s.pending=new Map,s.missingTopics=new Set,s.unsubscribedTracker=new Map,s.unsubscribedLimit=100},897:(e,t,i)=>{"use strict";i.d(t,{DL:()=>S,HD:()=>h,HJ:()=>v,IX:()=>L,Jf:()=>I,KD:()=>b,LS:()=>P,O$:()=>c,O_:()=>k,Oh:()=>w,T_:()=>E,Tg:()=>u,Vg:()=>T,Vu:()=>C,aT:()=>m,bb:()=>g,cc:()=>x,cu:()=>f,eR:()=>A,gV:()=>M,mt:()=>y,nH:()=>p,vc:()=>D,vs:()=>R,y8:()=>d});var s=i(438),n=i(8423),o=i(5901),r=i(2823);class a extends r.K{constructor(e){super({user_uid:e}),this.uidCheck(this.userUid)}getKey(){return`${this.getId()}:${this.userUid}`}initData(e){this.userUid=e.user_uid}}class l extends a{parseData(e){return{...super.parseData(e),timestamp:e.getNumber("read_ts")}}}class h extends l{getId(){return"UserNewsSeenTopic"}}class d extends a{getId(){return"UserMessageTopic"}parseData(e){return{...super.parseData(e),room:e.getString("room"),createdAt:new Date(Math.floor(1e3*e.getNumber("ts"))),fromUser:(0,s.Rh)(e.getParsedSubMap("from_user")),message:e.getString("message"),textColor:e.getStringOrUndefined("font_color",!1),messageID:e.getString("id",!1),otherUsername:e.getString("other_user"),font:e.getString("font_family"),backgroundColor:e.getStringOrUndefined("background"),mediaList:(0,s.ew)(e.getObjectOrUndefined("media")),isPrivate:!0}}}class c extends a{getId(){return"UserUpdateTopic"}parseData(e){return{...super.parseData(e),target:e.getString("target")}}}class u extends a{getId(){return"UserColorUpdateTopic"}parseData(e){return{...super.parseData(e),hasTokens:e.getBoolean("has_tokens"),tippedRecently:e.getBoolean("tipped_recently"),tippedAlotRecently:e.getBoolean("tipped_alot_recently"),tippedTonsRecently:e.getBoolean("tipped_tons_recently")}}}class p extends a{getId(){return"UserTokenUpdateTopic"}parseData(e){return{...super.parseData(e),tokens:e.getNumber("tokens")}}}class m extends a{getId(){return"UserTipAlertTopic"}parseData(e){return{...super.parseData(e),fromUser:(0,s.Rh)(e),message:e.getString("message"),amount:e.getNumber("amount"),isAnonymousTip:e.getBoolean("is_anonymous_tip"),toUsername:e.getString("to_username"),ts:Math.floor(1e3*e.getNumber("ts")),roomType:e.getString("room_type")}}}class g extends a{getId(){return"UserOneClickTopic"}parseData(e){return{...super.parseData(e),is_one_click_eligible:e.getBoolean("is_one_click_eligible")}}}class v extends a{getId(){return"OfflineTipNotificationTopic"}parseData(e){return{...super.parseData(e),...(0,s.Lf)(e)}}}class f extends a{getId(){return"UpdateOfflineTipNotificationTopic"}parseData(e){return{...super.parseData(e),...(0,s.Lf)(e),fromUsername:e.getString("from_username")}}}class y extends a{getId(){return"RoomBroadcasterPrivateStatusTopic"}parseData(e){return{...super.parseData(e),status:e.getString("status"),privateShowId:e.getStringWithNumbers("show_id"),requester:e.getString("requester",!1),earlyCancelTokens:e.getNumber("early_cancel_tokens"),reason:e.getString("reason",!1)}}getAuthData(){return{broadcaster_uid:this.userUid}}}const b=new n.c_("showMyCamStarted"),w=new n.c_("showMyCamStopped"),C=new n.c_("showMyCamViewStarted"),S=new n.c_("showMyCamViewStopped");class x extends a{getId(){return"UserSMCBroadcastNotifyTopic"}parseData(e){return{...super.parseData(e),...(0,o.p8)(e),started:e.getBoolean("started")}}}class T extends a{getId(){return"UserSMCWatchingTopic"}parseData(e){return{...super.parseData(e),...(0,o.p8)(e),started:e.getBoolean("started")}}}class A extends a{getId(){return"SMCPresenceTopic"}parseData(e){return super.parseData(e)}getUserUid(){return this.userUid}}class P extends a{getId(){return"UserAlertTopic"}parseData(e){return{...super.parseData(e),message:e.getString("message")}}}class k extends a{getId(){return"BroadcasterWarningTopic"}parseData(e){return{...super.parseData(e),text:e.getString("text"),warningId:e.getNumber("warning_id"),response:e.getBoolean("response")}}}class M extends a{getId(){return"UserChatMediaOpenedTopic"}parseData(e){return{...super.parseData(e),mediaId:e.getNumber("media_id"),messageId:e.getString("message_id")}}}class R extends a{getId(){return"UserChatMediaRemovedTopic"}parseData(e){return{...super.parseData(e),mediaId:e.getNumber("media_id"),isCompliance:e.getBoolean("is_compliance")}}}class I extends a{getId(){return"UserFollowerTopic"}parseData(e){return{...super.parseData(e),followerUsername:e.getString("follower_username"),followedUsername:e.getString("followed_username"),isFollowing:e.getBoolean("is_following")}}}class E extends a{getId(){return"UserIgnoreTopic"}parseData(e){return{...super.parseData(e),username:e.getString("username"),isIgnored:e.getBoolean("is_ignored")}}}class L extends a{getId(){return"UserPmReadTopic"}parseData(e){return{...super.parseData(e),otherUsername:e.getString("other_username"),room:e.getStringOrUndefined("room")}}}class D extends a{getId(){return"UserJoinedFanClubTopic"}parseData(e){return{...super.parseData(e),fromUser:(0,s.by)(e.getParsedSubMap("user")),message:e.getString("message"),ts:Math.floor(1e3*e.getNumber("ts"))}}}},7321:(e,t,i)=>{"use strict";i.d(t,{$r:()=>M,Cx:()=>k,DL:()=>R,HA:()=>w,Hy:()=>I,Qd:()=>g,T1:()=>E,Ys:()=>f,s:()=>b,sl:()=>y,tF:()=>S,yK:()=>v});var s=i(8861),n=i(5216),o=i(3062),r=i(7882),a=i(7407),l=i(1452),h=i(5088),d=i(9930),c=i(9461),u=i(1224);const p=30,m="tbu_",g=1e3,v=900;function f(e){switch(e){case"df":case"rc":case"ft":case"fn":case"fo":case"ff":case"ml":case"mr":case"tp":case"pr":case"bs":case"nc":case"sc":case"dc":case"tr":case"sm":case"ps":case"cc":case"ac":return e;default:return"un"}}function y(e,t,i,n){const o=JSON.stringify({source:t,index:i,source_index:null==n?void 0:n.sourceIndex,hashtag:null==n?void 0:n.hashtag,source_info:null==n?void 0:n.sourceInfo,row_num:null==n?void 0:n.rowNum,col_num:null==n?void 0:n.colNum,room_list_id:null==n?void 0:n.roomListId},((e,t)=>""===t?void 0:null!=t?t:void 0));!function(e){const t=document.cookie;if(t.length+e.length<4096)return;const i=Object.fromEntries(t.split(";").slice(0,50).map((e=>{const[t,i]=e.trim().split("=");return[`cookielen-${t}`,i.length]})));(0,a.bT)("BroadcasterSourceOversizedCookie",{cookie_length:t.length,data_length:e.length,...i})}(o),(0,s.uC)(`${function(e){return`${m}${e}`}(e)}`,o,{seconds:p})}function b(e){return c.Bm.current.isTestbed||c.Bm.current.noImage?`${STATIC_URL_ROOT}images/no_thumbnail_1_wide.jpg`:`${u.m.jpegRoomImgUrl}riw/${e}.jpg?${Math.floor((new Date).getTime()/3e4)}`}class w{constructor(){this.onLoadhandlers=[],this.streamers=new Map}getContainers(){const e=[],t=document.querySelectorAll(".endless_page_template, .MoreRooms, .followedDropdown");for(const i of t)e.push(i);return e}addOnLoadHandler(e){this.onLoadhandlers.push(e)}onSuccess(){for(const e of this.onLoadhandlers)e()}static getInstance(){return void 0===w.instance&&(w.instance=new w),w.instance}getUrl(e){let t="";const i=e.getAttribute("data-href");if("skip"===i)return;t="string"!=typeof i||0===i.length?window.location.href.replace(""===location.hash?"#":location.hash,""):"/"===i[0]?i.substr(1):i;let s="?";-1!==t.indexOf("?")&&(s="&");const n=document.getElementById("filter_search_form");return t+s+(null!==n?(0,o.R)(n,!1).serialize():"")}static scheduleRefresh(e){w.clearRefresh(),e>0&&(w.refreshTimer=window.setTimeout((()=>{w.getInstance().loadRooms(),w.scheduleRefresh(e)}),e*g))}static scheduleImageRefresh(e){w.clearImageRefresh();let t=e;(0,d.PS)()&&(t=1),e>0&&(w.refreshImageTimer=window.setTimeout((()=>{w.getInstance().loadImages(),w.scheduleImageRefresh(e)}),t*g))}static clearRefresh(){clearTimeout(w.refreshTimer)}static clearImageRefresh(){clearTimeout(w.refreshImageTimer)}loadRooms(e){for(const e of this.streamers.values())e.stopStreaming();this.streamers.clear();const t=this.getContainers(),i=[];for(const e of t){const t=this.getUrl(e);void 0!==t&&i.push((0,n.Aw)(t).then((t=>{e.innerHTML=t.responseText})))}Promise.all(i).then((()=>{this.onSuccess(),void 0!==e&&e()})).catch(l.yZ)}loadImages(){if(!(0,d.PS)())for(const e of this.getContainers())e.querySelectorAll("img.room_thumbnail").forEach((e=>{if(null!==e.parentElement){const t=e.parentElement.dataset.room;if(void 0!==t){const i=new Image(e.width,e.height);i.onload=()=>{e.src=i.src},i.src=b(t)}}}))}getImageStreamer(e){return this.streamers.get(e)}removeImageStreamer(e){this.streamers.delete(e)}getOrCreateImageStreamer(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=arguments.length>3?arguments[3]:void 0,n=this.getImageStreamer(e);return void 0===n&&(n=new h.QR(e,t,{startStreaming:i,useWideImages:void 0===s?!c.Bm.current.isMobile:s,streamingFadeoutTimeoutMs:0}),this.streamers.set(e,n)),n}safariReloadAllImages(){for(const e of this.streamers.values())e.safariReloadImage()}static exportToJS(){return{addOnLoadHandler:C,loadRooms:S,scheduleRefresh:x,chatRoomListOnClick:A,startStreaming:R,stopStreaming:I,clearRefresh:T,setRoomAnimation:k}}}function C(e){w.getInstance().addOnLoadHandler(e)}function S(e){w.getInstance().loadRooms(e)}function x(e){w.scheduleRefresh(e)}function T(){w.clearRefresh()}function A(e,t,i,s,n,o){y(e,f(t),i,{sourceIndex:s,hashtag:n,roomListId:o})}let P=!1;function k(e){P=e}function M(){return P}function R(e,t,i,s){(void 0===s?M():s)&&null!==t&&w.getInstance().getOrCreateImageStreamer(e,t,!0,i).startStreaming()}function I(e,t){if(void 0===t?M():t){const t=w.getInstance().getImageStreamer(e);void 0!==t&&(t.stopStreaming(),w.getInstance().removeImageStreamer(e))}}function E(e){const t=(0,r.Bg)();if(t!==r.YT.All){const i=c.Bm.current.isMobile?".subject > a":".subject > li > a";e.querySelectorAll(i).forEach((e=>{e.href=(0,n._Y)(e.href.concat(`${r.hf.get(t)}/`))}))}}},8039:(e,t,i)=>{"use strict";i.d(t,{SJ:()=>P,It:()=>S,tb:()=>x});var s=i(9461),n=i(6440);const o=new Map([["o",1],["m",2],["f",3],["l",4],["p",5],["tr",6],["t",7],["g",8]]);function r(e,t,i,s){const n={username:e,isBroadcaster:!1,inFanclub:!1,isFollowing:"t"===s,hasTokens:!1,isMod:!1,tippedRecently:!1,tippedALotRecently:!1,tippedTonsRecently:!1,exploringHashTag:"",gender:i,sourceName:"un"};return"o"===t?n.isBroadcaster=!0:"m"===t?n.isMod=!0:"f"===t?n.inFanclub=!0:"l"===t?n.tippedTonsRecently=!0:"p"===t?n.tippedALotRecently=!0:"tr"===t?n.tippedRecently=!0:"t"===t?n.hasTokens=!0:"g"!==t&&error("Unexpected IUserInfo colorGroup",{colorGroup:t}),n}function a(e){return e.isBroadcaster?"o":e.isMod?"m":e.inFanclub?"f":e.tippedTonsRecently?"l":e.tippedALotRecently?"p":e.tippedRecently?"tr":e.hasTokens?"t":"g"}var l=i(2939),h=i(8423),d=i(7407),c=i(1452),u=i(74),p=i(5216),m=i(2945);const g=new Map;var v=i(8650),f=i(8300),y=i(7477);const b=(e,t)=>e+Math.floor(Math.random()*t),w=30*b(1,10)*1e3,C=w+60*b(2,10)*1e3,S=()=>s.Bm.current.realtimeUserlistEnabled,x=new h.c_("roomUsersUpdate",{maxHistorySize:1,listenersWarningThreshold:()=>50+3*h.hI}),T=["o","m","f","l","p","tr","t","g"],A=(e,t)=>{const i=T.indexOf(a(e)),s=T.indexOf(a(t));return i!==s?i{this.chatConnection=e.chatConnection,this.room=e.dossier.room,this.roomUid=e.dossier.roomUid,this.sortUsersBy=e.dossier.userChatSettings.sortUsersKey,this.roomLoadTime=performance.now(),this.refetchCounter=0,this.initializePublicUserList(),this.chatConnection.event.statusChange.listen((e=>{"privatewatching"===e.currentStatus?this.initializePrivateUserList():"privatewatching"===e.previousStatus&&(this.cleanUpPrivateUserList(),x.fire(this.getRoomUsersInfo()))}))})),u.EZ.listen((e=>{e.sortUsersKey!==this.sortUsersBy&&(this.sortUsersBy=e.sortUsersKey,this.refetch(!0).catch(c.yZ))})),l.Gr.listen((()=>{this.cleanupPublicUserList(),this.cleanUpPrivateUserList(),x.fire(this.getRoomUsersInfo())}))}static getInstance(){return void 0===P.instance&&(P.instance=new P),P.instance}getRoomUsersInfo(){var e,t,i;const s=arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.publicUserList:this.activeUserList;return{totalCount:null!==(e=null==s?void 0:s.getTotalUsers())&&void 0!==e?e:0,anonCount:null!==(t=null==s?void 0:s.getAnonUsers())&&void 0!==t?t:0,roomUsers:null!==(i=null==s?void 0:s.getUsers())&&void 0!==i?i:[]}}userInRoomState(e){var t,i;return!0===(null===(t=this.activeUserList)||void 0===t?void 0:t.hasUser(e))?0:!0===(null===(i=this.publicUserList)||void 0===i?void 0:i.hasUser(e))?1:2}async refetch(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!s.Bm.current.isBroadcast)return;if(!e&&(void 0!==this.refetchedRecentlyTimeout||this.refetchDisabled))return;window.clearTimeout(this.refetchedRecentlyTimeout),this.refetchedRecentlyTimeout=window.setTimeout((()=>{this.refetchedRecentlyTimeout=void 0}),2e3);const i=await this.fetchRoomUsers(!0),n=new k(i,this.sortUsersBy);n.includeCurrentUser(),this.recentPublicEnterLeaves.forEach((e=>{let{user:t,action:i}=e;"enter"===i?n.addUser(t):n.deleteUser(t)}));const o=void 0!==this.publicUserList&&!n.equals(this.publicUserList);if(t||s.Bm.current.isBroadcast&&o){var r;let e;void 0!==this.latestRefetchTime&&(e=performance.now()-this.latestRefetchTime,e=(e-w)/6e4),(0,d.bT)("RoomUserListsMismatched",{current_size:null===(r=this.publicUserList)||void 0===r?void 0:r.getUsers().length,new_size:n.getUsers().length,time_elapsed_m:(performance.now()-this.roomLoadTime)/6e4,time_since_last_refetch_m:e,refetch_count:this.refetchCounter,lag_window_m:w/6e4})}this.latestRefetchTime=performance.now(),this.refetchCounter+=1,this.publicUserList=n,x.fire(this.getRoomUsersInfo())}toggleRefetch(e){this.refetchDisabled=!e}fetchRoomUsers(){var e,t;let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(void 0===this.room)return error("roomUsers: calling fetchRoomUsers when not in a room"),Promise.reject("not in a room");const a=!i&&null!==(e=null===(t=this.chatConnection)||void 0===t?void 0:t.inPrivateRoom())&&void 0!==e&&e;return function(e,t,i){const a={roomname:e,private:i,sort_by:t,exclude_staff:!0};s.Bm.current.isNoninteractiveUser||(a.exclude_staff=!1);const l=(0,m.Go)(a),h=g.get(l);if(void 0!==h)return h;const d=new Promise(((e,t)=>{(0,p.Aw)(`api/getchatuserlist/?${l}`).then((t=>{e(function(e){let t=e.split(",");const i=~~t[0];t=t.slice(1);const a=[];let l=!!s.Bm.current.isBroadcast;const h=s.Aw.getState(),d=h.userlistColor,c=h.following?"t":"f",u=(0,n.f)("PushEnblRecEnter")&&!s.Bm.current.isNoninteractiveUser;for(const e of t){const[t,i,n,h]=e.split("|"),f=i;if(u&&!l&&void 0!==s.Bm.current.loggedInUser){var p,m;const e=s.Bm.current.loggedInUser.username===t?0:s.Bm.current.loggedInUser.username>t?1:-1;if(0===e)l=!0;else if(f===d){if(e<0){var g;const e=r(s.Bm.current.loggedInUser.username,d,null!==(g=s.Bm.current.loggedInUser.gender)&&void 0!==g?g:"",c);a.push(e),l=!0}}else if((null!==(p=o.get(f))&&void 0!==p?p:0)>(null!==(m=o.get(d))&&void 0!==m?m:0)){var v;const e=r(s.Bm.current.loggedInUser.username,d,null!==(v=s.Bm.current.loggedInUser.gender)&&void 0!==v?v:"",c);a.push(e),l=!0}}const y=r(t,f,n,h);a.push(y)}if((0,n.f)("PushEnblRecEnter")&&!l&&void 0!==s.Bm.current.loggedInUser&&!s.Bm.current.isNoninteractiveUser){var f;const e=r(s.Bm.current.loggedInUser.username,d,null!==(f=s.Bm.current.loggedInUser.gender)&&void 0!==f?f:"",c);a.push(e),l=!0}return{totalCount:i+a.length,anonCount:i,roomUsers:a}}(t.responseText)),window.setTimeout((()=>g.delete(l)),3e3)})).catch((e=>{t(e),g.delete(l)}))}));return g.set(l,d),d}(this.room,this.sortUsersBy,a)}initializePublicUserList(){this.listenForPublicEnterLeaves(),window.setTimeout((()=>{this.refetch().catch(c.yZ)}),3e3),window.setTimeout((()=>{this.refetch().catch(c.yZ)}),w),this.refetchInterval=window.setInterval((()=>{this.refetch().catch(c.yZ)}),C)}cleanupPublicUserList(){this.publicListeners.removeAll(),this.recentPublicEnterLeaves.clear(),window.clearTimeout(this.refetchedRecentlyTimeout),window.clearInterval(this.refetchInterval),this.refetchedRecentlyTimeout=void 0,this.publicUserList=void 0}listenForPublicEnterLeaves(){void 0!==this.roomUid?(s.Bm.current.isBroadcast||s.Aw.getState().isModerator)&&(new y.eB(this.roomUid).onMessage.listen((e=>{this.onPublicEnterLeave(e.user,e.action)})).addTo(this.publicListeners),new y.fH(this.roomUid).onMessage.listen((e=>{0===e.connections&&this.onPublicEnterLeave(e.user,e.action)})).addTo(this.publicListeners),new v.UT(this.roomUid).onMessage.listen((()=>{})).addTo(this.publicListeners)):error("roomUsers: listening for public enter/leaves without room uid")}onPublicEnterLeave(e,t){var i,s;"enter"===t?null===(i=this.publicUserList)||void 0===i||i.addUser(e):null===(s=this.publicUserList)||void 0===s||s.deleteUser(e),this.recordRecentPublicEnterLeave(e,t),x.fire(this.getRoomUsersInfo())}recordRecentPublicEnterLeave(e,t){const i=this.recentPublicEnterLeaves.get(e.username);void 0!==i&&window.clearTimeout(i.timeout);const s=window.setTimeout((()=>{this.recentPublicEnterLeaves.delete(e.username)}),w);this.recentPublicEnterLeaves.set(e.username,{user:e,action:t,timeout:s})}initializePrivateUserList(){if(this.privateUserList=new k(void 0,this.sortUsersBy),this.privateUserList.includeCurrentUser(),s.Bm.current.isBroadcast){var e;const i=null===(e=this.chatConnection)||void 0===e?void 0:e.getPrivateShowUser();if(void 0===i)error("roomUsers: no private show user when initializing private user list");else{var t;const e=null===(t=this.publicUserList)||void 0===t?void 0:t.getLatestUserInfo(i);void 0!==e&&this.privateUserList.addUser(e)}}x.fire(this.getRoomUsersInfo()),this.listenForPrivateEnterLeaves()}cleanUpPrivateUserList(){this.privateListeners.removeAll(),this.privateUserList=void 0}listenForPrivateEnterLeaves(){const e=e=>{void 0!==this.roomUid?new f.ZW(this.roomUid,e).onMessage.listen((e=>{"leave"===e.action&&0!==e.connections||this.onPrivateEnterLeave(e.user,e.action)})).addTo(this.privateListeners):error("roomUsers: listening for private enter/leaves without room uid")},t=s.Aw.getState();if(""!==t.privateShowId)e(t.privateShowId);else{let t=-1;const i=s.Aw.onUpdate.listen((n=>{const o=s.Aw.getState().privateShowId;""!==o&&(e(o),i.removeListener(),clearTimeout(t))}),!1);t=window.setTimeout((()=>{error("roomUsers: no private show ID after 10 seconds"),i.removeListener()}),1e4)}}onPrivateEnterLeave(e,t){var i,s;"enter"===t?null===(i=this.privateUserList)||void 0===i||i.addUser(e):null===(s=this.privateUserList)||void 0===s||s.deleteUser(e),x.fire(this.getRoomUsersInfo())}}class k{constructor(e,t){var i,s;this.currentUsersSet=new Set,this.historicalUsers=new Map,this.currentUsers=null!==(i=null==e?void 0:e.roomUsers)&&void 0!==i?i:[],this.anonUsers=null!==(s=null==e?void 0:e.anonCount)&&void 0!==s?s:0,this.sortUsersBy=t,this.currentUsers.forEach((e=>{this.currentUsersSet.add(e.username),this.historicalUsers.set(e.username,e)}))}getUsers(){return this.currentUsers}getTotalUsers(){return this.currentUsers.length+this.anonUsers}getAnonUsers(){return this.anonUsers}getLatestUserInfo(e){return this.historicalUsers.get(e)}hasUser(e){return this.currentUsersSet.has(e)}addUser(e){this.hasUser(e.username)||("a"===this.sortUsersBy?this.addUserAlphaSorted(e):this.addUserTokenSorted(e))}deleteUser(e){if(!this.hasUser(e.username))return;const t=this.currentUsers.findIndex((t=>t.username===e.username));this.currentUsers.splice(t,1),this.currentUsersSet.delete(e.username)}includeCurrentUser(){const e=function(){var e;if(void 0!==s.Bm.current.loggedInUser&&s.Bm.current.isBroadcast)return r(s.Bm.current.loggedInUser.username,"o",null!==(e=s.Bm.current.loggedInUser.gender)&&void 0!==e?e:"","f")}();void 0!==e&&this.addUser(e)}equals(e){return e.getUsers().length===this.currentUsers.length&&this.currentUsers.every((t=>e.hasUser(t.username)))}addUserAlphaSorted(e){const t=function(e,t,i){let s=0,n=e.length;for(;s=0?s=o+1:n=o}return s}(this.currentUsers,e,A);this.currentUsers.splice(t,0,e),this.currentUsersSet.add(e.username),this.historicalUsers.set(e.username,e)}addUserTokenSorted(e){this.currentUsers.push(e),this.currentUsersSet.add(e.username),this.historicalUsers.set(e.username,e)}}},1224:(e,t,i)=>{"use strict";i.d(t,{c:()=>r,m:()=>a});var s=i(5216),n=i(4947),o=i(2416);const r={CBAlias:"chaturbate.com",DBWLDomain:"",tagLine:n.R.tagLine,tagLineColor:"#0b5d81",siteName:"Chaturbate",sanitizedSiteName:"Chaturbate",jpegStreamUrl:"https://jpeg.live.mmcdn.com/",jpegRoomImgUrl:"https://thumb.live.mmcdn.com/",cbGamesUrl:"https://games.multimediallc.com/",bgColor:"#ffffff",navigationBgColor:"#0c6a93",navigationFontColor:"#ffffff",navigationAltBgColor:"#f47321",navigationAlt2BgColor:"#ffffff",navigationAlt2BgImage:`url(${STATIC_URL_ROOT}tsdefaultassets/gender_tab_bg.gif) repeat-x`,h1Color:"#004B5E",textColor:"#494949",defaultColor:"#494949",defaultTooltipColor:"#222222",userInfoAreaTextColor:"#222222",hrefColor:"#0A5B83",tabBorderColor:"#8bb3da",tabActiveColor:"#ffffff",tabInactiveColor:"#dde9f5",tabActiveFontColor:"#dc5500",tabInactiveFontColor:"#5e81a4",tagExhibColor:"#6D85B5",tagFontColor:"#FFF",tagOfflineColor:"#4F4F4F",tagPrivateColor:"#B60A42",contentBgColor:"#FFFFFF",camBgColor:"#F0F1F1",camBorderColor:"#ACACAC",camSubjectColor:"#000",camSubjectTagColor:"#0A5A83",camAltTextColor:"#575757",camHrefColor:"#0A5A83",tokenHrefColor:"#e45900",footerHrefColor:"#676767",footerTextColor:"#494949",copyrightTextColor:"#494949",logoImageName:(0,o.f)(),signupBgColor:"#f47321",logoWidth:void 0,footerHtml:"",headerGif:`#ffffff url(${STATIC_URL_ROOT}tsdefaultassets/header_bg.gif) repeat-x`,footerGif:`#ffffff url(${STATIC_URL_ROOT}tsdefaultassets/footer_bg.gif) repeat-x`,userInfoBgColor:"#e9e9e9",usernameColor:"#ffffff",nextCamBgColor:"#FCEADB",footerColNameColor:"#494949",footerRowColor:"#0A5A83",footerSiteNavColor:"#dc5500",chatAreaTabColor:"#4C4C4C",defaultCampaignSlug:"",isWhiteLabel:!1,shouldHideWaterMark:!1,shouldChangeFooterBorder:!1,shouldChangeFooterTextColor:!1,shouldAddWhiteLabelPoweredBy:!1,shouldShowHeaderAd:!0,showEarnFreeTokens:!0,shouldShowAltLanguages:!0,shouldShowFooterAddress:!0,roomSubjectToolTipColor:"#494949",loginOverlayColor:"#000000",dismissibleMessageColor:"#494949",userInfoDropdownBgColor:"#3C87BA",userInfoDropdownHighlightColor:"#F47321",userInfoDropdownTextColor:"#ffffff",userUpdatesFeedbackLink:"https://www.surveymonkey.com/r/DXYF5T8",hideEntranceTerms:!0===window.hide_entrance_terms,carouselActiveCircleColor:"#F47321",carouselArrowBgColor:"#FFFFFF",carouselArrowColor:"#000000",carouselBgColor:"#F8F9fA",carouselBorderColor:"#ACACAC",carouselCircleColor:"#6E6F70",carouselHrefColor:"#0A5B83",carouselTitleColor:"#494949"};let a=r;void 0!==window.siteSettings?a=function(e){const t=e.navigation_font_color,i=e.text_color,s=e.tab_inactive_color,n=e.tab_inactive_font_color,o=e.content_bgcolor,a=e.footer_href_color,l=e.footer_text_color,h=e.tab_inactive_color,d=e.tab_active_color,c=e.tab_active_font_color,u=e.cam_href_color,p=e.site_name,m=document.createElement("span");m.innerText=p;const g=m.innerHTML;return{CBAlias:e.chaturbate_alias,DBWLDomain:e.dbwl_domain,tagLine:e.tagline,tagLineColor:e.tagline_color,siteName:p,sanitizedSiteName:g,jpegStreamUrl:e.jpeg_stream_url,jpegRoomImgUrl:e.jpeg_room_img_url,cbGamesUrl:e.cb_games_url,bgColor:e.bgcolor,navigationBgColor:e.navigation_bgcolor,navigationFontColor:t,navigationAltBgColor:e.navigation_alt_bgcolor,navigationAlt2BgColor:e.navigation_alt_2_bgcolor,navigationAlt2BgImage:"",h1Color:e.h1_color,textColor:i,defaultColor:r.defaultColor,defaultTooltipColor:r.defaultTooltipColor,userInfoAreaTextColor:i,hrefColor:e.href_color,tabBorderColor:e.tab_border_color,tabActiveColor:e.tab_active_color,tabInactiveColor:s,tabActiveFontColor:e.tab_active_font_color,tabInactiveFontColor:n,tagExhibColor:e.tag_exhibitionist_color,tagFontColor:e.tag_font_color,tagOfflineColor:e.tag_offline_color,tagPrivateColor:e.tag_private_group_color,contentBgColor:o,camBgColor:e.cam_background_color,camBorderColor:e.cam_border_color,camSubjectColor:e.cam_text_color,camSubjectTagColor:"#0C6A93",camAltTextColor:e.cam_text_alt_color,camHrefColor:u,tokenHrefColor:u,footerHrefColor:a,footerTextColor:l,copyrightTextColor:l,logoImageName:e.logo_image_name,signupBgColor:e.signup_bg_color,logoWidth:e._logo_width,footerHtml:e.footer_html,headerGif:"",footerGif:"",userInfoBgColor:o,usernameColor:t,nextCamBgColor:s,footerColNameColor:n,footerRowColor:a,footerSiteNavColor:a,chatAreaTabColor:"#0C6A93",defaultCampaignSlug:e.default_campaign_slug,isWhiteLabel:!0,shouldHideWaterMark:!0,shouldChangeFooterBorder:!0,shouldChangeFooterTextColor:!0,shouldAddWhiteLabelPoweredBy:!0,shouldShowHeaderAd:!1,showEarnFreeTokens:!1,shouldShowAltLanguages:!1,shouldShowFooterAddress:!1,roomSubjectToolTipColor:"#222222",loginOverlayColor:i,dismissibleMessageColor:i,recordHitURL:e.whitelabel_hit_count_referring_url,userInfoDropdownBgColor:h,userInfoDropdownHighlightColor:d,userInfoDropdownTextColor:c,userUpdatesFeedbackLink:r.userUpdatesFeedbackLink,hideEntranceTerms:r.hideEntranceTerms,carouselActiveCircleColor:e.carousel_active_circle_color,carouselArrowBgColor:e.carousel_arrow_bg_color,carouselArrowColor:e.carousel_arrow_color,carouselBgColor:e.carousel_bg_color,carouselBorderColor:e.carousel_border_color,carouselCircleColor:e.carousel_circle_color,carouselHrefColor:e.carousel_href_color,carouselTitleColor:e.carousel_title_color}}(window.siteSettings):void 0!==window.siteUrls&&(a.jpegStreamUrl=window.siteUrls.jpeg_stream_url,a.jpegRoomImgUrl=window.siteUrls.jpeg_room_img_url,a.cbGamesUrl=window.siteUrls.cb_games_url),void 0!==a.recordHitURL&&(0,s.KF)("whitelabels/record_hit/",{referer:a.recordHitURL}).catch((e=>{error("Error recording whitelabel hit",e)}))},9505:(e,t,i)=>{"use strict";i.d(t,{J:()=>a,z:()=>s});var s,n=i(2709),o=i(3955),r=i(1372);!function(e){e[e.Text=0]="Text",e[e.Icon=1]="Icon"}(s||(s={}));class a extends n.u{constructor(e){super("div",e)}initData(e){this.columnGap=null==e?void 0:e.columnGap}initUI(e){const t={display:"flex",alignItems:"center",minWidth:"0px",...null==e?void 0:e.containerStyle};this.element=(0,r.tT)("div",{style:t})}addButton(e,t){void 0!==this.lastChildEl&&void 0!==this.columnGap&&(0,o.ZM)(this.lastChildEl,{marginRight:this.columnGap}),e instanceof n.u?this.addChild(e):this.element.appendChild(e);const i=e instanceof n.u?e.element:e;t===s.Text&&(0,o.ZM)(i,{minWidth:"0px"}),this.lastChildEl=i}}},8746:(e,t,i)=>{"use strict";i.d(t,{O:()=>p,Z:()=>u});var s=i(7063),n=i(213),o=i(5216),r=i(2709),a=i(4947),l=i(9447),h=i(753),d=i(816),c=i(6861);class u{static parseData(e){const t=new s.N6(e),i=t.getObject("initial"),n=t.getMap("schema"),o=n.getList("fieldsets");let r;r=void 0===o?[]:o.map((e=>({fields:e.getStringList("fields"),label:e.getString("label")})));const a=JSON.parse(e).schema.fields,l={};for(const e of Object.keys(a)){const t=new s.N6(JSON.stringify(a[e])),n=null===i[e]?void 0:i[e];l[e]=u.parseField(e,t,n),t.logUnusedDebugging("parse DjangoForm field")}return{extra:t.getObject("extra"),initial:i,schema:{prefix:n.getStringOrUndefined("prefix"),fields:l,fieldsets:r,label_suffix:n.getStringOrUndefined("label_suffix"),field_order:n.getStringList("field_order")}}}static parseField(e,t,i){return{defaultValue:i,name:e,minLength:t.getNumberOrUndefined("min_length"),maxLength:t.getNumberOrUndefined("max_length"),emptyValue:t.getStringOrUndefined("empty_value"),choices:u.parseSelectOptions(t.getList("choices")),required:t.getBoolean("required"),disabled:t.getBoolean("disabled"),helpText:t.getString("help_text"),labelText:t.getString("label"),fieldType:t.getString("type"),siteKey:t.getStringOrUndefined("site_key")}}static parseSelectOptions(e){if(void 0===e)return[];const t=[];for(const i of e)t.push({label:i.getStringWithNumbers("label"),value:i.getStringWithNumbersOrBoolean("value")});return t}}class p extends r.u{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super("form"),this.data=e,this.fields={},this.fieldsets={},this.loading=!1,this.initializeOptions(i),this.element.style.position="static",this.isAutoSaveForm=s;const n=document.createElement("table");this.element.appendChild(n),this.tbody=document.createElement("tbody"),n.appendChild(this.tbody),this.submitButton=this.createSubmitButton(),this.element.appendChild(this.submitButton),this.endpoint=t,this.generateFields(),this.isAutoSaveForm?this.handleAutoSaveAndUnsavedLabels():this.element.onsubmit=e=>{e.preventDefault(),this.onSubmit()}}handleAutoSaveAndUnsavedLabels(){}triggerExternalSubmit(){this.isAutoSaveForm&&this.hasChanged&&this.onSubmit()}onSubmit(){if(this.loading)return;this.loading=!0;const e=new FormData(this.element);let t=!1;this.hasChanged=!1,(0,o.KF)(this.endpoint,e).then((()=>{this.loading=!1,this.options.onSubmitSuccess(e),this.isAutoSaveForm&&this.clearUnsavedLabels()})).catch((e=>{this.loading=!1;try{const i=JSON.parse(e.xhr.responseText);if(void 0!==i.throttle_error)return t=!0,void(0,n.Q$)(i.throttle_error);const s=i.errors;if(null===s||"object"!=typeof s)return;this.handleErrors(s)}catch(e){}finally{t||this.options.onSubmitError(e)}})).finally((()=>{this.hideErrorMessages()}))}initializeOptions(e){const t={field:new c.Dr,checkbox:new c.oM,input:new c.V8,select:new c.x9,textarea:new c.np,multipleCheckboxes:new c.A,multipleSelect:new c.xx,noReCaptcha:new c.n$};this.options={onSubmitSuccess:void 0===e.onSubmitSuccess?()=>{}:e.onSubmitSuccess,onSubmitError:void 0===e.onSubmitError?()=>{}:e.onSubmitError,styles:void 0===e.styles?t:{...t,...e.styles}}}generateFields(){if(this.data.schema.field_order.length>0)for(const e of this.data.schema.field_order){const t=this.data.schema.fields[e];this.addField(this.createField(t))}else if(void 0!==this.data.schema.fieldsets)for(const e of this.data.schema.fieldsets){this.addFieldset(e.label);for(const t of e.fields){const i=this.data.schema.fields[t];this.addFieldToFieldset(this.createField(i),e.label)}}else for(const e of Object.keys(this.data.schema.fields)){const t=this.data.schema.fields[e];this.addField(this.createField(t))}}createField(e){var t;switch(e.fieldType){case"CharField":return void 0===e.maxLength?new d.fs({...e,styles:this.options.styles.textarea}):new d.pd({...e,styles:this.options.styles.input});case"EmailField":return new d.pd({...e,styles:this.options.styles.input});case"BooleanField":return new d.Oc({...e,styles:this.options.styles.checkbox});case"ChoiceField":case"TypedChoiceField":return new d.l6({...e,styles:this.options.styles.select});case"TypedMultipleChoiceField":return new h.X({...e});case"MultiSelectFormField":return new d.Ws({...e,styles:this.options.styles.multipleSelect});case"DateField":return new d.BS({...e,day:this.data.initial[`${e.name}__day`],month:this.data.initial[`${e.name}__month`],year:this.data.initial[`${e.name}__year`],styles:this.options.styles.select});case"NoReCaptchaField":const i=null!==(t=e.siteKey)&&void 0!==t?t:"";return""===i&&error("siteKey must be provided for NoReCaptchaField"),new d.r9({...e,siteKey:i,styles:this.options.styles.noReCaptcha});default:return error(`DjangoForm received an unknown field type: ${e.fieldType}`),new d.pd({name:""})}}addField(e){void 0===this.fields[e.getName()]?(this.fields[e.getName()]=e,this.tbody.appendChild(e.getField())):error(`Field ${e.getName()} already exists`)}clearUnsavedLabels(){for(const e of Object.keys(this.fields)){const t=this.fields[e];void 0!==t&&(t.setUnsaved(!1),t.clearError())}}addFieldToFieldset(e,t){const i=this.getFieldset(t);void 0!==i?void 0===this.fields[e.getName()]?(this.fields[e.getName()]=e,i.appendChild(e.getField())):error(`Field ${e.getName()} already exists`):error(`Fieldset ${t} does not exist`)}removeField(e){const t=this.fields[e];void 0!==t&&(t.getField().remove(),delete this.fields[e])}createFieldset(e){const t=document.createElement("fieldset"),i=document.createElement("table"),s=document.createElement("tbody");return t.appendChild(this.createLegend(e)),t.appendChild(i),i.appendChild(s),this.fieldsets[e]=s,t}createLegend(e){const t=document.createElement("legend");return(0,l.fZ)(t,"label"),t.innerText=e,t.style.fontSize="1.266em",t.style.fontFamily="'UbuntuMedium', Arial, Helvetica, sans-serif",t.style.fontWeight="normal",t.style.padding="10px 0px 10px 0px",t}handleErrors(e){for(const i of Object.keys(this.fields)){var t;if(null===(t=this.fields[i])||void 0===t||t.onFormError(),!(i in e)){const e=this.fields[i];void 0!==e&&e.clearError()}}for(const t in e){const i=e[t][0];if("string"!=typeof i)break;const s=this.getField(t);void 0===s?error(`Form error on unknown field ${t}`):s.setError(i)}}hideErrorMessages(){for(const e of Object.keys(this.fields)){const t=this.fields[e];void 0===t||t.hasError()||t.clearError()}}createSubmitButton(){const e=document.createElement("input");return e.type="submit",e.value=a.R.submitCAPS,e.className="button",e.style.display="block",e.style.cursor="pointer",e.style.padding="0px 30px 2px 15px",e.style.margin="15px 0px 0px 137px",e.style.width="auto",e.style.height="28px",e.style.borderRadius="4px",e.style.font="1.16em/1.0em 'UbuntuMedium', Arial, Helvetica, sans-serif",this.isAutoSaveForm&&(e.style.display="none",e.disabled=!0),e}focusFirstField(){const e=Object.keys(this.fields)[0];if(void 0!==e){const t=this.fields[e];void 0!==t&&t.getWidget().focus()}}focusField(e){const t=this.getField(e);void 0!==t&&t.getWidget().focus()}getFields(){return this.fields}getField(e){return this.fields[e]}getFieldset(e){return this.fieldsets[e]}getSubmitButton(){return this.submitButton}prependFieldset(e){this.tbody.insertBefore(this.createFieldset(e),this.tbody.firstChild)}addFieldset(e){this.tbody.appendChild(this.createFieldset(e))}setSubmitText(e){this.submitButton.value=e}}},4873:(e,t,i)=>{"use strict";i.d(t,{Dw:()=>d,Dy:()=>c,g2:()=>p});var s=i(2709),n=i(3955),o=i(8423),r=i(9447),a=i(369),l=i(520),h=i(1848);class d extends s.u{constructor(e,t){super(e),this.defaultDisplay="inline-block",this.collapseEvent=new o.c_("collapse",{reportIfNoListeners:!1}),this.overflownSibling=[],this.shownSibling=[],this.spacer=new h.m,this.collapsedTabs=[],this.listeners=new o.gt,void 0!==e&&"string"!=typeof e||this.styleElement(),this.dropDown=this.createDropDown(!0===t),(0,n.ZM)(this,{userSelect:"none"}),this.hideElement(),(0,n.ZM)(this.spacer,{cssFloat:"right",height:"100%",visibility:"hidden"}),this.listeners.add(this.dropDown.toggleEvent.listen((e=>{this.onToggle(e)}))),this.listeners.add(a.oO.listen((e=>{this.dropDown.isShown()&&this.dropDown.hideElement(),this.collapseIfNeeded(!e)}))),window.setTimeout((()=>{this.attachSpacer(),this.collapseIfNeeded()}))}collapseIfNeeded(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.dropDown.isShown();t&&this.restoreTabsFromDropDown(),this.separateOverflownSiblings(),this.showOrHideBasedOnOverflownSiblings(),e&&this.isShown()&&this.fixLeftPosition(),t&&(0===this.overflownSibling.length?this.dropDown.hideElement():(this.addTabsToDropDown(),this.dropDown.reposition()))}showOrHideBasedOnOverflownSiblings(){0===this.overflownSibling.length?this.isShown()&&(this.hideElement(),this.spacer.element.style.paddingLeft="0px",this.collapseEvent.fire(!1)):1===this.overflownSibling.length&&this.isShown()&&this.lastOverflownElementHasEnoughSpace()?this.tryToHideThisAndShowLastOverflown():this.isShown()||(this.showElement(this.defaultDisplay),this.reposition(),this.collapseEvent.fire(!0),this.separateOverflownSiblings())}tryToHideThisAndShowLastOverflown(){this.hideElement();const e=this.spacer.element.style.paddingLeft;this.spacer.element.style.paddingLeft="0px",this.separateOverflownSiblings(),this.overflownSibling.length>0?(this.showElement(this.defaultDisplay),this.spacer.element.style.paddingLeft=e):this.collapseEvent.fire(!1)}lastOverflownElementHasEnoughSpace(){const e=this.overflownSibling[0],t=getComputedStyle(e.element);return e.element.offsetWidth+(0,n.Lx)(t.marginLeft)+(0,n.Lx)(t.marginRight)+5<=this.element.offsetWidth+this.spacer.element.offsetLeft-this.element.offsetLeft}setSpacerWidth(e){this.spacer.element.style.width=`${e}px`}isTargetOverflownAnchor(e){return this.overflownSibling.some((t=>t.element.children[0]===e))}lastShownSibling(){return this.shownSibling[this.shownSibling.length-1]}firstTab(){if(void 0!==this.parent)for(const e of this.parent.children())if(u(e.element))return e}repositionChildren(){super.repositionChildren(),this.collapseIfNeeded()}onToggle(e){e.isShowing?(this.separateOverflownSiblings(),this.addTabsToDropDown()):this.restoreTabsFromDropDown()}addTabsToDropDown(){this.overflownSibling.forEach((e=>{this.collapsedTabs.unshift([e,e.nextSibling()]),this.dropDown.addChild(e),e.collapse(!0)}))}restoreTabsFromDropDown(){const e=this.parent;this.collapsedTabs.forEach((t=>{const i=t[0];e.addChildBefore(i,t[1]),i.collapse(!1)})),this.collapsedTabs=[]}collapsibleSiblings(){return void 0===this.parent?[]:this.parent.children().filter((e=>e instanceof p&&e.isShown()))}createDropDown(e){return new l.s(this.element,e)}separateOverflownSiblings(){if(null===this.element.parentElement||null===this.element.parentElement.offsetParent)return;const e=this.collapsibleSiblings();this.overflownSibling=[],this.shownSibling=[],e.forEach((e=>{c(e)?this.overflownSibling.push(e):this.shownSibling.push(e)}))}reposition(){null!==this.element.parentElement&&((0,n.ZM)(this.element,{position:"absolute",boxSizing:"border-box",textAlign:"center"}),this.spacer.element.style.paddingLeft=`${this.element.offsetWidth}px`,""===this.element.style.width&&(this.element.style.width=`${this.element.offsetWidth+1}px`))}attachSpacer(){if(void 0!==this.parent||null!==this.element.parentElement){const e=void 0===this.parent?this.element.parentElement:this.parent.element,t=this.firstTab();void 0!==t&&e.insertBefore(this.spacer.element,t.element.nextSibling)}}styleElement(){return this.element.appendChild(document.createTextNode(d.DOTDOTDOT_TEXT)),(0,r.fZ)(this.element,r.aG.chatAreaTabColor),(0,n.ZM)(this.element,{cursor:"pointer",width:"",height:"",padding:"0 10px",textAlign:"center"}),this.element}fixLeftPosition(){if(void 0!==this.parent){let e=0;for(const t of this.parent.children())!u(t.element)||t===this||t instanceof p&&-1===this.shownSibling.indexOf(t)||(e=Math.max(t.element.offsetLeft+t.element.offsetWidth+(0,n.Lx)(getComputedStyle(t.element).marginRight),e));this.element.offsetLeft!==e&&(this.element.style.left=`${e}px`,window.setTimeout((()=>{this.element.style.left=""})))}}dispose(){this.dropDown.dispose(),this.listeners.removeAll()}}function c(e){if(null===e.element.parentElement)return!1;if(e.element.parentElement.offsetHeight<=e.element.offsetHeight)return.5*e.element.offsetHeight+e.element.offsetTop>=e.element.parentElement.offsetHeight;const t=e.element.parentElement.scrollHeight>e.element.parentElement.offsetHeight,i=e.element.parentElement.offsetHeight<=.5*e.element.offsetHeight+e.element.offsetTop;return t&&i}function u(e){return"none"!==e.style.display&&"right"!==e.style.cssFloat&&"absolute"!==e.style.position&&"fixed"!==e.style.position}d.DOTDOTDOT_TEXT=". . .";class p extends s.u{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div"),this.onCollapseEvent=new o.c_("collapse",{reportIfNoListeners:!1}),this.collapsed=!1,window.setTimeout((()=>{this.onCollapseEvent.fire(this.collapsed)}))}collapse(e){this.collapsed=e,e?this.element.classList.add("collapsed"):this.element.classList.remove("collapsed"),this.onCollapseEvent.fire(e)}}},6861:(e,t,i)=>{"use strict";i.d(t,{A:()=>c,Dr:()=>n,Gw:()=>h,V8:()=>a,n$:()=>u,np:()=>l,oM:()=>d,x9:()=>o,xx:()=>r});var s=i(9447);class n{styleRow(e){e.style.padding="3px 0"}styleLabelContainer(e){e.style.minWidth="130px",e.style.width="auto",e.style.paddingTop="10px",e.style.paddingBottom="1px",e.style.verticalAlign="top",e.style.textAlign="right"}styleLabel(e){(0,s.fZ)(e,s.aG.defaultColor),e.style.textAlign="right",e.style.fontWeight="bold",e.style.font="1em/1.3em 'UbuntuMedium', Arial, Helvetica, sans-serif",e.style.padding="0",e.style.margin="0 4px 0 0"}styleFieldContainer(e){(0,s.fZ)(e,s.aG.defaultColor)}styleField(e){(0,s.fZ)(e,"field"),e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.padding="2px 4px",e.style.lineHeight="18px",e.style.marginTop="4px",e.style.width="225px"}styleHelpText(e){(0,s.fZ)(e,s.aG.defaultColor),e.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",e.style.fontSize="11px",e.style.width="350px"}}class o extends n{styleField(e){super.styleField(e),e.style.width="auto",e.style.marginTop="7px"}}class r extends o{styleField(e){super.styleField(e),e.style.height="",e.size=10}}class a extends n{}class l extends n{styleField(e){(0,s.fZ)(e,"fieldTextArea"),e.style.width="350px",e.style.lineHeight="18px",e.style.marginTop="4px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.padding="2px 4px",e.style.overflow="hidden",e.style.height="150px"}}class h extends l{styleLabel(e){(0,s.fZ)(e,s.aG.defaultColor),e.style.width="100%",e.style.textAlign="left",e.style.fontWeight="bold",e.style.font="1em/1.3em 'UbuntuMedium', Arial, Helvetica, sans-serif",e.style.margin="0px 4px 6px"}styleLabelContainer(e){e.style.minWidth="130px",e.style.width="auto",e.style.paddingLeft="10px",e.style.paddingBottom="1px",e.style.verticalAlign="top",e.style.textAlign="right"}}class d extends n{styleFieldContainer(e){super.styleFieldContainer(e),e.style.paddingTop="7px"}}class c extends n{styleFieldContainer(e){super.styleFieldContainer(e),e.style.paddingTop="7px"}styleField(e){super.styleField(e),e.style.width="auto",e.style.marginTop="7px"}}class u extends n{styleField(e){super.styleField(e),e.style.position="",e.style.padding="",e.style.overflow="",e.style.background="",e.style.border=""}}},816:(e,t,i)=>{"use strict";i.d(t,{Oc:()=>w,ib:()=>S,BS:()=>x,D0:()=>m,pd:()=>g,Ws:()=>C,LP:()=>y,r9:()=>T,l6:()=>f,Ru:()=>b,fs:()=>v});var s=i(6784),n=i(8423),o=i(2709),r=i(6716);let a;const l=new n.c_("recaptchaLoaded",{maxHistorySize:1});window.recaptchaLoadCallback=()=>{a=window.grecaptcha,l.fire(void 0)};class h extends o.u{constructor(){super(),this.element.style.height="",this.element.style.width=""}render(e){l.once((()=>{void 0===e.theme&&(e.theme=document.body.classList.contains("darkmode")?"dark":"light"),void 0===this.listener&&(this.listener=r.gh.listen((e=>{void 0!==this.widgetData&&(this.widgetData.parameters.theme="darkmode"===e?"dark":"light",this.reset())})));const t=a.render(this.element,e);this.widgetData={widgetID:t,parameters:e}}))}reset(){void 0!==this.widgetData&&(a.reset(this.widgetData.widgetID),this.updateTheme())}getResponse(){return void 0!==this.widgetData?a.getResponse(this.widgetData.widgetID):""}updateTheme(){if(void 0!==this.widgetData){const e=this.element.getElementsByTagName("iframe")[0];"dark"===this.widgetData.parameters.theme?e.src=e.src.replace("theme=light","theme=dark"):e.src=e.src.replace("theme=dark","theme=light")}}}var d=i(4947),c=i(9447),u=i(9937),p=i(6861);class m{constructor(e){this.required=!1,this.unsaved=!1,this.disabled=!1,this.errorMessage="",this.initializeData(e),this.errorContainer=document.createElement("div"),(0,c.fZ)(this.errorContainer,"fieldError"),this.errorContainer.style.display="none",this.createLabel(),this.createLabelContainer(),this.createWidgetContainer(),this.labelContainer.appendChild(this.label),this.createRow(),this._assembleField()}initializeData(e){this.name=e.name,this.defaultValue=void 0===e.defaultValue?"":String(e.defaultValue),this.labelText=void 0===e.labelText?"":e.labelText,this.helpText=void 0===e.helpText?"":e.helpText,this.required=void 0!==e.required&&e.required,this.disabled=void 0!==e.disabled&&e.disabled,this.onChange=void 0===e.onChange?()=>{}:e.onChange,this.fieldChanged=new n.c_(`${this.name}Changed`),this.fieldTouched=new n.c_(`${this.name}Touched`),this.styles=void 0===e.styles?new p.Dr:e.styles}getField(){return this.field}getWidget(){return this.widget}getWidgetContainer(){return this.widgetContainer}getName(){return this.name}getLabelContainer(){return this.labelContainer}onFormError(){}hasError(){return""===this.errorContainer.style.display}setError(e){this.errorContainer.style.display="",this.errorContainer.innerText=e,(0,c.fZ)(this.label,"fieldError")}clearError(){this.errorContainer.style.display="none",this.errorContainer.innerText="",(0,c.SA)(this.label,"fieldError"),this.styles.styleLabel(this.label)}setDisabled(e){this.disabled=e,"disabled"in this.widget&&(this.widget.disabled=e)}setOnChange(e){this.onChange=e}_assembleField(){this.assembleField(),this.afterAssembleField()}afterAssembleField(){this.widgetContainer.appendChild(this.createHelpText()),this.widgetContainer.appendChild(this.errorContainer)}createLabel(){this.label=document.createElement("label"),this.styles.styleLabel(this.label),this.label.innerText=this.formatLabelText()}createLabelContainer(){this.labelContainer=document.createElement("th"),this.styles.styleLabelContainer(this.labelContainer),""===this.labelText&&(this.labelContainer.style.display="none")}updateLabelText(e){this.labelText=e,this.label.innerText=this.formatLabelText(),""===this.labelText?this.labelContainer.style.display="none":this.labelContainer.style.display=""}formatLabelText(){return`${this.labelText}${this.unsaved?` ${d.R.unsavedText}`:""}: ${this.required?"*":""}`}setUnsaved(e){this.unsaved=e,this.label.innerText=this.formatLabelText(),void 0!==this.unsavedHelpTextSpan&&(this.unsavedHelpTextSpan.style.display=e?"":"none")}createWidgetContainer(){this.widgetContainer=document.createElement("td"),this.styles.styleFieldContainer(this.widgetContainer)}createHelpText(){return this.helpText instanceof HTMLElement?(this.styles.styleHelpText(this.helpText),this.helpTextElement=this.helpText):(this.helpTextElement=document.createElement("div"),""===this.helpText?this.helpTextElement.style.display="none":(this.styles.styleHelpText(this.helpTextElement),this.helpTextElement.innerHTML=this.helpText)),this.helpTextElement}createUnsavedHeptextSpan(){return this.unsavedHelpTextSpan=document.createElement("span"),this.unsavedHelpTextSpan.innerText=` ${d.R.unsavedText}`,this.unsavedHelpTextSpan.style.display="none",this.unsavedHelpTextSpan.style.whiteSpace="pre",this.unsavedHelpTextSpan}getHelpTextElement(){return this.helpTextElement}createRow(){this.field=document.createElement("tr"),this.styles.styleRow(this.field),this.field.appendChild(this.labelContainer),this.field.appendChild(this.widgetContainer)}}class g extends m{constructor(e){super(e)}getValue(){return this.widget.value}createField(){const e=document.createElement("input");return e.name=this.name,e.value=this.defaultValue,this.styles.styleField(e),e.style.width="225px",e.required=this.required,e.disabled=this.disabled,void 0!==this.minLength&&(e.minLength=this.minLength),void 0!==this.maxLength&&(e.maxLength=this.maxLength),(0,s.wu)("input",e,(()=>{this.fieldChanged.fire()})),e}assembleField(){this.widget=this.createField(),this.widgetContainer.appendChild(this.widget)}initializeData(e){super.initializeData(e),this.minLength=e.minLength,this.maxLength=e.maxLength,this.styles=void 0===e.styles?new p.V8:e.styles}}class v extends m{constructor(e){super(e)}getValue(){return this.widget.value}createField(){const e=document.createElement("textarea");e.name=this.name,e.id=`id_${this.name}`,e.value=this.defaultValue,e.required=this.required,e.disabled=this.disabled,void 0!==this.minLength&&(e.minLength=this.minLength),void 0!==this.maxLength&&(e.maxLength=this.maxLength),this.styles.styleField(e);const t=()=>{const t=e.offsetHeight-e.clientHeight;e.style.height="auto",e.style.height=`${e.scrollHeight+t+15}px`};return window.setTimeout((()=>{t()}),0),(0,s.wu)("input",e,(()=>{t(),this.fieldChanged.fire()})),e}assembleField(){this.widget=this.createField(),this.widgetContainer.appendChild(this.widget)}initializeData(e){super.initializeData(e),this.minLength=e.minLength,this.maxLength=e.maxLength,this.styles=void 0===e.styles?new p.np:e.styles}}class f extends m{constructor(e){super(e)}getValue(){return this.widget.value}createField(){const e=document.createElement("select");e.name=this.name,e.multiple=this.multiple,e.required=this.required,e.disabled=this.disabled,this.styles.styleField(e);const t=this.defaultValue.split(",");for(const i of this.choices){const s=document.createElement("option");s.innerText=String(i.label),s.value=String(i.value),s.selected=t.includes(s.value),e.appendChild(s)}return(0,s.wu)("change",e,(()=>{this.onChange(this),this.fieldChanged.fire()})),(0,s.wu)("blur",e,(()=>{this.fieldTouched.fire()})),e}assembleField(){this.widget=this.createField(),this.widgetContainer.appendChild(this.widget)}initializeData(e){super.initializeData(e),this.multiple=void 0!==e.multiple&&e.multiple,this.choices=void 0===e.choices?[]:e.choices,this.styles=void 0===e.styles?new p.x9:e.styles,"true"===this.defaultValue?this.defaultValue="True":"false"===this.defaultValue&&(this.defaultValue="False")}}class y extends f{constructor(e){super(e)}getValue(){const e=[];for(const t of this.selectedOptions.options)e.push(t.value);return e}createField(){const e=document.createElement("select");this.selectedOptions=document.createElement("select");const t=document.createElement("div");t.style.clear="both",t.style.display="none",this.widgetContainer.appendChild(t);const i=e=>{const i=document.createElement("input");i.type="checkbox",i.style.display="none",i.name=this.name,i.value=e,i.checked=!0,i.id=`listselect_${this.name}_${e}`,t.appendChild(i)},n=e=>{const i=document.getElementById(`listselect_${this.name}_${e}`);null!==i&&t.removeChild(i)};this.styles.styleField(e),this.styles.styleField(this.selectedOptions);const o=this.defaultValue.split(",");for(const t of this.choices){const s=document.createElement("option");s.innerText=String(t.label),s.value=String(t.value),o.includes(s.value)?(this.selectedOptions.appendChild(s),i(s.value)):e.appendChild(s)}e.multiple=!0,e.disabled=this.disabled,this.selectedOptions.multiple=!0,this.selectedOptions.disabled=this.disabled;const r=(e,t,s)=>{const o=e.selectedOptions.length,r=[...e.selectedOptions];for(let e=0;e{r(e,this.selectedOptions,!0),this.fieldChanged.fire(),this.onChange(this)})),(0,s.wu)("change",this.selectedOptions,(()=>{r(this.selectedOptions,e,!1),this.fieldChanged.fire(),this.onChange(this)})),e}initializeData(e){super.initializeData(e),this.selectedHeader=void 0===e.selectedHeader?"":e.selectedHeader,this.unselectedHeader=void 0===e.unselectedHeader?"":e.unselectedHeader,this.styles=void 0===e.styles?new p.xx:e.styles}createHeader(e){const t=document.createElement("strong");return(0,c.fZ)(t,"label"),t.style.fontWeight="bold",t.innerText=e,t}createSelectContainer(){const e=document.createElement("div");return e.style.marginRight="5px",e.style.cssFloat="left",e.style.width="200px",e}assembleField(){const e=this.createSelectContainer(),t=this.createSelectContainer(),i=this.createHeader(this.unselectedHeader),s=this.createHeader(this.selectedHeader);this.widget=this.createField(),e.appendChild(i),e.appendChild(this.widget),t.appendChild(s),t.appendChild(this.selectedOptions),this.widgetContainer.appendChild(e),this.widgetContainer.appendChild(t)}}class b extends m{createField(){return this.transparentCheckbox=new u.m(16,"True"===this.defaultValue,(()=>{this.transparentCheckbox.setCheckboxValue(this.getChecked()?"True":"False"),this.onChange(this)})),this.transparentCheckbox.setName(this.name),this.styles.styleField(this.transparentCheckbox.element),this.setDisabled(this.disabled),(0,s.wu)("change",this.transparentCheckbox.element,(()=>{this.fieldChanged.fire()})),this.transparentCheckbox.element}assembleField(){this.widget=this.createField(),this.widgetContainer.appendChild(this.widget)}getValue(){return this.transparentCheckbox.getCheckboxValue()}initializeData(e){super.initializeData(e),this.styles=void 0===e.styles?new p.oM:e.styles,"true"===this.defaultValue?this.defaultValue="True":"false"===this.defaultValue&&(this.defaultValue="False")}setChecked(e){this.transparentCheckbox.setCheckedDirectly(e)}getChecked(){return this.transparentCheckbox.isChecked()}setDisabled(e){e?this.transparentCheckbox.disable():this.transparentCheckbox.enable()}}class w extends g{createField(){const e=document.createElement("input");return e.name=this.name,e.value=this.defaultValue,e.checked="True"===this.defaultValue,e.required=this.required,e.disabled=this.disabled,e.type="checkbox",this.styles.styleField(e),(0,s.wu)("change",e,(()=>{this.widget.value=e.checked?"True":"False",this.fieldChanged.fire(),this.onChange(this)})),e}getValue(){return this.widget.value}initializeData(e){super.initializeData(e),this.styles=void 0===e.styles?new p.oM:e.styles,"true"===this.defaultValue?this.defaultValue="True":"false"===this.defaultValue&&(this.defaultValue="False")}setChecked(e){this.widget.checked=e}getChecked(){return this.widget.checked}}class C extends g{constructor(e){super(e)}getValue(){const e=[];for(const t of this.checkboxes)t.isChecked()&&e.push(t.getCheckboxValue());return e}initializeData(e){super.initializeData(e),this.choices=void 0===e.choices?[]:e.choices,this.styles=void 0===e.styles?new p.A:e.styles}createCheckboxesField(){const e=document.createElement("div");this.checkboxes=[];for(const t of this.choices){const i=-1!==this.defaultValue.indexOf(String(t.value)),n=new u.m(16,i);n.setName(this.name),n.setCheckboxValue(String(t.value)),this.styles.styleField(n.element),this.disabled&&n.disable(),(0,s.wu)("change",n.element,(()=>{this.fieldChanged.fire()})),this.checkboxes.push(n);const o=document.createElement("label");o.className="checkboxFieldLabel";const r=document.createTextNode(String(t.label));o.appendChild(n.element),o.appendChild(r),e.appendChild(o)}return e}assembleField(){const e=this.createCheckboxesField();this.widgetContainer.appendChild(e)}}class S extends m{constructor(e){super(e)}initializeData(e){super.initializeData(e),this.customElement=e.customElement}getValue(){return""}createField(){return document.createElement("div")}assembleField(){this.widgetContainer.appendChild(this.customElement)}}class x extends f{constructor(e){super({...e,choices:[]})}initializeData(e){super.initializeData({...e,choices:[]}),this.defaultDay=void 0===e.day?"0":e.day.toString(10),this.defaultMonth=void 0===e.month?"0":e.month.toString(10),this.defaultYear=void 0===e.year?"0":e.year.toString(10)}getValue(){return[this.monthField.value,this.dayField.value,this.yearField.value]}createDateField(e,t,i){const s=document.createElement("select");s.name=`${this.name}_${i}`,this.styles.styleField(s);for(const t of e){const e=document.createElement("option");e.innerText=`${t.label}`,e.value=`${t.value}`,s.appendChild(e)}return s.value=t,s.required=this.required,s}getDayOptions(){const e=[];e.push({label:"---",value:"0"});for(let t=1;t<=31;t+=1){const i=t.toString(10);e.push({label:i,value:i})}return e}getMonthOptions(){const e=[],t=[d.R.january,d.R.february,d.R.march,d.R.april,d.R.may,d.R.june,d.R.july,d.R.august,d.R.september,d.R.october,d.R.november,d.R.december];e.push({label:"---",value:"0"});for(let i=0;i1900;i-=1){const t=i.toString(10);e.push({label:t,value:t})}return e}assembleField(){this.dayField=this.createDateField(this.getDayOptions(),this.defaultDay,"day"),this.monthField=this.createDateField(this.getMonthOptions(),this.defaultMonth,"month"),this.yearField=this.createDateField(this.getYearOptions(),this.defaultYear,"year"),this.widgetContainer.appendChild(this.monthField),this.widgetContainer.appendChild(this.dayField),this.widgetContainer.appendChild(this.yearField)}}class T extends m{constructor(e){super(e)}initializeData(e){super.initializeData(e),this.styles=void 0===e.styles?new p.n$:e.styles,this.sitekey=e.siteKey}getValue(){return this.recaptcha.getResponse()}createField(){return this.recaptcha=new h,this.styles.styleField(this.recaptcha.element),this.recaptcha.element}assembleField(){this.widget=this.createField(),this.recaptcha.render({sitekey:this.sitekey}),this.widgetContainer.appendChild(this.widget)}onFormError(){super.onFormError(),this.recaptcha.reset()}}},6064:(e,t,i)=>{"use strict";i.d(t,{DC:()=>D,Fd:()=>S,QZ:()=>U,SJ:()=>B});var s=i(352),n=i(7623),o=i(8861),r=i(6784),a=i(5216),l=i(2939),h=i(8423),d=i(1779),c=i(9586),u=i(3124),p=i(2690),m=i(7407),g=i(3049),v=i(3004),f=i(4947),y=i(1372),b=i(5389),w=i(9461),C=i(1224);const S=new h.c_("loginOverlayShown"),x=`${v.k6}?src=login_gate`,T=e=>{"Escape"!==e.key&&e.stopImmediatePropagation()};let A="",P="";l.X0.listen((e=>{A=e.chatConnection.room(),P=e.dossier.roomUid}));let k,M,R=0;function I(e){const t=(0,v.G6)(`/auth-sso/login/${e.provider}/?popup=1`,(0,v.TI)({ignoreExistingRoom:!0}));return(0,y.tT)("a",{className:"auth_option",href:"#",onClick:i=>{i.preventDefault(),R+=1,R>1||((0,m.bT)("SsoSignupClick",{provider:e.provider,source:"loginOverlay"}),(0,b.gr)(t,"_blank",b.NL)),window.setTimeout((()=>{R=0}),1e3)}},(0,y.tT)("div",null,(0,y.tT)("img",{src:`${STATIC_URL_ROOT}images/sso-${e.provider}.svg`,alt:e.provider}),(0,y.tT)("p",null,f.R.signInWithSocialAuth(e.name))))}class E extends p.z{constructor(){super({onShow:()=>{this.repositionChildren(),this.isVisible=!0,this.usernameInput.focus(),(0,r.wu)("keydown",this.element,T),this.fullscreenChangeListener=d._c.listen((()=>this.hideBodyElement())),this.hideBodyElement()},onHide:()=>{const e=this.isVisible;var t;this.element.style.display="none",this.isVisible=!1,e&&((0,r.Pf)("keydown",this.element,T),null===(t=this.fullscreenChangeListener)||void 0===t||t.removeListener(),this.fullscreenChangeListener=void 0),this.unhideBodyElement(),this.clearAutofillPollInterval()},easyExit:!0}),this.isVisible=!1,this.autofillPollInterval=0,this.tabListenerFactory=(e,t)=>i=>{"Tab"===i.key&&(i.preventDefault(),i.shiftKey?t.focus():e.focus())},this.detectInputFilled=()=>{""!==this.passwordInput.value.trim()&&""!==this.usernameInput.value.trim()?(this.loginButton.removeAttribute("disabled"),this.rememberMeCheckBox.onkeydown=this.tabListenerFactory(this.loginButton,this.forgotPasswordLink),this.loginButton.onkeydown=this.tabListenerFactory(this.signupLink,this.rememberMeCheckBox),this.signupLink.onkeydown=this.tabListenerFactory(this.closeButton,this.loginButton),this.clearAutofillPollInterval()):(this.loginButton.disabled=!0,this.rememberMeCheckBox.onkeydown=this.tabListenerFactory(this.signupLink,this.forgotPasswordLink),this.signupLink.onkeydown=this.tabListenerFactory(this.closeButton,this.rememberMeCheckBox),this.createAutofillPollInterval())},this.clearAutofillPollInterval=()=>{this.autofillPollInterval&&(window.clearInterval(this.autofillPollInterval),this.autofillPollInterval=0)},this.createAutofillPollInterval=()=>{this.autofillPollInterval||(this.autofillPollInterval=window.setInterval((()=>{this.detectInputFilled()}),200))};const e=e=>{const t=document.createElement("div");return t.style.display="block",t.style.margin="10px 0 0 0",e.appendChild(t),t};this.element.style.display="none",this.element.style.position="fixed",this.element.style.fontSize="12px",this.element.style.width="364px",this.element.style.height="auto",this.element.style.color="currentSiteSettings.defaultColor",this.element.style.margin="auto",this.element.style.boxShadow="0px 0px 10px rgba(0, 0, 0, 0.4)",this.element.style.background="white",this.element.style.border="3px solid #0E6C92",this.element.style.borderRadius="10px",this.element.style.visibility="visible",this.element.id="LoginOverlay",this.element.dataset.testid="login-form",this.overlay.classList.add("blurred-login-overlay"),this.overlay.style.visibility="visible",this.overlay.style.background="",this.overlay.style["-webkit-overflow-scrolling"]="touch",this.loginContainer=document.createElement("form"),this.loginContainer.target="_top",this.loginContainer.style.padding="5px 30px 10px 30px",this.loginContainer.action=(0,a._Y)((0,v.G6)(v.ii,(0,v.TI)({ignoreExistingRoom:!0}))),this.loginContainer.method="POST",this.loginContainer.onclick=e=>{e.stopPropagation()},this.element.appendChild(this.loginContainer);const t=e(this.loginContainer),i=e(this.loginContainer),n=e(this.loginContainer),h=e(this.loginContainer),c=e(this.loginContainer),u=e(this.loginContainer),p=e(this.loginContainer),m=e(this.loginContainer),b=e(this.loginContainer);c.style.display="flex",c.style.alignItems="center",this.closeButton=document.createElement("input"),this.closeButton.type="button",this.closeButton.onclick=e=>{e.preventDefault(),this.hide()},this.closeButton.value="",this.closeButton.style.background=`transparent url(${STATIC_URL}close_icon2.svg) no-repeat center center`,this.closeButton.style.backgroundSize="10px",this.closeButton.style.padding="10px 20px 8px 12px",this.closeButton.style.border="none",this.closeButton.style.cursor="pointer",this.closeButton.dataset.testid="login-modal-close-button",t.appendChild(this.closeButton),t.style.position="absolute",t.style.top="0px",t.style.right="0px",t.style.margin="0px",this.header=document.createElement("h1"),this.header.style.font="18px ubuntumedium,Arial,Helvetica,sans-serif",this.header.style.color="#f47422",i.appendChild(this.header),i.style.textAlign="center",this.usernameInput=this.createFormInput(n,`${f.R.usernameText}:`,"text","username"),this.usernameInput.required=!0,this.usernameInput.dataset.testid="username-input",this.forgotPasswordLink=document.createElement("a"),this.forgotPasswordLink.target="_top",this.forgotPasswordLink.href=(0,a._Y)("/auth/password_reset/"),this.forgotPasswordLink.tabIndex=0,this.forgotPasswordLink.textContent=f.R.forgotPassword,this.forgotPasswordLink.style.cssFloat="right",this.forgotPasswordLink.dataset.testid="forgot-password-link",h.appendChild(this.forgotPasswordLink),this.passwordInput=this.createFormInput(h,`${f.R.passwordText}:`,"password","password"),this.passwordInput.required=!0,this.passwordInput.dataset.testid="password-input",this.rememberMeCheckBox=this.createFormInput(c,`${f.R.keepLoggedInText}:`,"checkbox","rememberme"),this.rememberMeCheckBox.style.marginLeft="10px",this.rememberMeCheckBox.dataset.testid="remember-me-check-box",this.loginButton=document.createElement("input"),this.loginButton.dataset.testid="login-button",this.loginButton.id="id_login_btn",this.loginButton.type="submit",this.loginButton.disabled=!0,this.loginButton.value=f.R.loginVerbText,C.m.isWhiteLabel&&(this.loginButton.style.backgroundColor=C.m.signupBgColor),(0,g.kt)()&&(this.loginButton.onclick=()=>{this.loginButton.disabled||(0,s.trackCustomEvent)({name:"LoginRequest",data:{roomName:A,broadcasterID:P}})}),u.appendChild(this.loginButton);const S=w.Bm.current.socialAuths;if(void 0!==S&&S.length>0){const e=(0,y.tT)("div",{className:"or_separator"},(0,y.tT)("p",null," ",f.R.orSimple," "));p.appendChild(e);for(const e of S)p.appendChild(I(e));p.style.marginBottom="16px"}const k=document.createElement("p");k.textContent=`${f.R.dontHaveAccountYet} `,k.style.display="inline",this.signupLink=document.createElement("a"),this.signupLink.target="_top",this.signupLink.classList.add("signupLogin"),this.signupLink.href=x,this.signupLink.tabIndex=0,this.signupLink.textContent=f.R.signUpText,m.appendChild(k),m.appendChild(this.signupLink),m.style.textAlign="center",this.nextField=document.createElement("input"),this.csrfField=document.createElement("input"),this.nextField.type=this.csrfField.type="hidden",this.nextField.name="next",this.nextField.value=(()=>{const e=(0,v.TI)({ignoreExistingRoom:!0});return-1!==(0,v.bP)().indexOf("/al/")||void 0===e.nextParam?"/":e.nextParam})(),this.csrfField.name="csrfmiddlewaretoken",this.csrfField.value=(0,o.I7)("csrftoken"),b.appendChild(this.nextField),b.appendChild(this.csrfField),b.style.display="none",this.closeButton.onkeydown=this.tabListenerFactory(this.usernameInput,this.signupLink),this.usernameInput.onkeydown=this.tabListenerFactory(this.passwordInput,this.closeButton),this.passwordInput.onkeydown=this.tabListenerFactory(this.forgotPasswordLink,this.usernameInput),this.forgotPasswordLink.onkeydown=this.tabListenerFactory(this.rememberMeCheckBox,this.passwordInput),this.rememberMeCheckBox.onkeydown=this.tabListenerFactory(this.loginButton,this.forgotPasswordLink),this.loginButton.onkeydown=this.tabListenerFactory(this.signupLink,this.rememberMeCheckBox),this.signupLink.onkeydown=this.tabListenerFactory(this.closeButton,this.loginButton),this.usernameInput.oninput=this.detectInputFilled,this.passwordInput.oninput=this.detectInputFilled,l.X0.listen((()=>{this.nextField.value=(0,v.bP)()}))}initAndShow(e){if((0,b.GZ)()&&""!==A)(0,b.gr)(`/auth/login/?next=/${A}/`);else{if(S.fire(void 0),this.header.innerText=void 0!==e.fromFeature&&e.fromFeature?f.R.loginToUseFeature:f.R.loginToContinue,this.header.dataset.testid="login-modal-header-text",this.csrfField.value=(0,o.I7)("csrftoken"),this.element.style.display="block",super.show(),void 0!==e.seeBackground&&e.seeBackground&&(this.unhideBodyElement(),this.overlay.style.backgroundColor="rgba(0, 0, 0, 0.5)"),this.signupLink.href=(0,a._Y)(!1===e.returnToPage?x:(0,v.G6)(x,(0,v.TI)({}))),!0===e.refreshOpener){const e=(0,v.TI)({ignoreExistingRoom:!0});void 0!==e.nextParam&&(e.nextParam.endsWith("/")?e.nextParam+="?refresh_opener=1":e.nextParam+="/refresh_opener=1",this.nextField.value=e.nextParam),this.loginContainer.action=(0,a._Y)((0,v.G6)(`${v.ii}`,e)),this.signupLink.href=`${this.signupLink.href}?refresh_opener=1`}this.createAutofillPollInterval(),this.usernameInput.focus()}}createFormInput(e,t,i,s){const n=document.createElement("label"),o=document.createElement("input");return n.innerText=t,n.htmlFor=s,o.type=i,o.id=s,o.name=s,o.style.height="checkbox"===i?"18px":"26px",o.style.width="checkbox"===i?"18px":"100%",o.style.font="100% Arial,Helvetica,sans-serif",o.style.color="#000",o.style.boxSizing="border-box",o.style.border="1px solid #d5d5d5",o.style.padding="2px 4px",o.style.margin="1px 0",o.style.lineHeight="18px",o.style.borderRadius="4px",(0,r.wu)("keydown",o,(e=>{"Enter"===e.key&&(e.preventDefault(),this.loginButton.click())})),e.appendChild(n),e.appendChild(o),o}unhideBodyElement(){void 0!==this.bodyElement&&(this.bodyElement.style.visibility="",this.bodyElement.style.backgroundColor="",this.bodyElement.style.overflow="",this.bodyElement.style.position="",this.bodyElement.classList.remove("blurred-login-overlay-shown","embed-blurred-login-overlay"))}hideBodyElement(){this.unhideBodyElement(),null!==this.element.parentElement&&(this.bodyElement=this.element.parentElement,this.bodyElement.style.overflow="hidden",this.bodyElement.classList.add("blurred-login-overlay-shown"),(0,n.Pb)()&&(this.bodyElement.style.position="fixed",this.bodyElement.classList.add("embed-blurred-login-overlay")))}repositionChildren(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth),t=Math.max(document.documentElement.clientHeight,window.innerHeight);this.element.style.left=(e-this.loginContainer.offsetWidth)/2+"px",this.element.style.top=(t-this.loginContainer.offsetHeight)/2+"px"}}class L extends E{constructor(){super(),this.element.style.width="calc(96% - 6px)",this.element.style.maxWidth="364px",this.element.style.margin="",this.element.style.fontSize="12px",this.element.style.position="fixed",this.element.style.overflow="scroll",(0,c.H)(this.element)}createFormInput(e,t,i,s){const n=super.createFormInput(e,t,i,s);return n.style.fontFamily="'UbuntuRegular', Arial, Helvetica, sans-serif",n.style.fontSize="16px",n}repositionChildren(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth),t=Math.max(document.documentElement.clientHeight,window.innerHeight),i=(e-this.loginContainer.offsetWidth)/2;let s=Math.max(50,(t-this.loginContainer.offsetHeight)/2);(0,n.m0)()&&(s=Math.max(50,(t-this.loginContainer.offsetHeight)/5));const o=(0,u.K$)(),r=!o&&t<576;this.element.style.left=`${i}px`,this.element.style.top=r?"0px":`${s}px`,this.element.style.bottom=r?"0px":"",(document.activeElement===this.usernameInput||document.activeElement===this.passwordInput)&&!o&&window.setTimeout((()=>{var e;null===(e=document.activeElement)||void 0===e||e.scrollIntoView()}),510)}}function D(e){!function(e){void 0===e.fromFeature&&(e.fromFeature=e.fromFeature),void 0===e.seeBackground&&(e.seeBackground=e.seeBackground),void 0===e.returnToPage&&(e.returnToPage=e.returnToPage),void 0===e.refreshOpener&&(e.refreshOpener=e.refreshOpener)}(e),w.Bm.current.isMobile?(void 0===M&&(M=new L,(0,m.bT)("LoginOverlayOpened")),M.initAndShow(e)):(void 0===k&&(k=new E,(0,m.bT)("LoginOverlayOpened")),k.initAndShow(e))}function B(){void 0!==k&&k.hide()}function U(){return void 0!==k&&k.isVisible}},2416:(e,t,i)=>{"use strict";i.d(t,{f:()=>n});var s=i(9461);function n(){var e,t;return null!==(e=null===(t=s.Bm.current)||void 0===t?void 0:t.current_logo)&&void 0!==e?e:`${STATIC_URL_ROOT}images/logo.svg`}},634:(e,t,i)=>{"use strict";i.d(t,{HY:()=>m,tj:()=>u,x4:()=>v,xT:()=>p,zG:()=>c});var s=i(6784),n=i(213),o=i(8423),r=i(7407),a=i(5173),l=i(4947),h=i(9447),d=i(9461);function c(){const e=document.createElement("div");return(0,h.fZ)(e,"title"),e.innerText=l.R.followerBrowserNotifications,e.style.fontFamily="UbuntuBold, Helvetica, Arial, sans-serif",e}function u(){const e=document.createElement("div");return e.innerText=l.R.allowBrowserNotificationsMessage,e.style.margin="5px 0 10px",e.style.fontSize="11px",e}function p(e){const t=document.createElement("div");return(0,h.fZ)(t,"confirmButton"),t.innerText=l.R.yesText,t.style.display="inline-block",t.style.padding="5px 30px",t.style.marginLeft="10px",t.style.borderRadius="3px",t.style.cursor="pointer",(0,s.wu)("click",t,e),t}function m(e){const t=document.createElement("div");return(0,h.fZ)(t,"denyButton"),t.innerText=l.R.notNowText,t.style.display="inline-block",t.style.padding="5px 18px",t.style.cursor="pointer",(0,s.wu)("click",t,e),t}const g={numTimeoutsKey:"numPushNotificationTimeouts",timeoutDateKey:"pushNotificationTimeout"};class v extends a.Q{constructor(){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:g),this.closed=new o.c_("closed"),e){this.skipOverlay=!0;const e=e=>{e.target!==this.element&&this.element.contains(e.target)||this.close()};return(0,s.wu)("click",document,e),void this.closed.once((()=>{try{(0,s.Pf)("click",document,e)}catch(e){debug("NotificationsModal listener was already removed")}}))}this.overlayClick.listen((()=>{this.close()}))}initData(e){super.initData(),this.numTimeoutsLocalStorageKey=e.numTimeoutsKey,this.timeoutDateLocalStorageKey=e.timeoutDateKey;const t=window.localStorage.getItem(this.numTimeoutsLocalStorageKey),i=window.localStorage.getItem(this.timeoutDateLocalStorageKey);null!==t&&null!==i?(this.timeoutDate=new Date(i),this.numTimeouts=parseInt(t)+1):(this.timeoutDate=new Date,this.numTimeouts=1)}afterDOMConstructedIncludingChildren(){super.afterDOMConstructedIncludingChildren(),this.skipOverlay||this.showOverlay()}canRequestPermission(){return new Date>=this.timeoutDate}close(){this.element.style.display="none",this.skipOverlay||this.hideOverlay(),this.closed.fire(void 0)}subscribeToBrowserPush(e,t){const i=window.subscribeUserToPush;void 0!==d.Bm.current.loggedInUser&&i(d.Bm.current.loggedInUser.signedUsername).then((()=>{e(),(0,r.bT)("PushNotificationSettingsUpdated",{new_status:!0,old_status:!1,location:"notif-modal"})})).catch(t)}onConfirmClick(){this.subscribeToBrowserPush((()=>{}),(e=>{void 0===e||400===e.status?(0,n.Q$)(l.R.followSubscribeFailedMessage):(window.localStorage.removeItem(this.numTimeoutsLocalStorageKey),window.localStorage.removeItem(this.timeoutDateLocalStorageKey))}))}onDenyClick(){const e=new Date,t=Math.min(Math.pow(2,this.numTimeouts),168);this.timeoutDate.setTime(e.getTime()+60*t*60*1e3),window.localStorage.setItem(this.numTimeoutsLocalStorageKey,this.numTimeouts.toString()),window.localStorage.setItem(this.timeoutDateLocalStorageKey,this.timeoutDate.toString())}}},369:(e,t,i)=>{"use strict";i.d(t,{BL:()=>m,Rk:()=>p,oO:()=>d,x0:()=>c});var s=i(7623),n=i(6784),o=i(1519),r=i(2709),a=i(3955),l=i(8423),h=i(8936);const d=new class extends l.c_{listen(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.listen(e,t);return u.callFunc(),i}addListener(e,t){super.addListener(e,t),u.callFunc()}}("resizeDebounceEvent");let c=!1;const u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80;const i=new o.a((()=>{e(!0)}),{bounceLimitMS:t,debounceType:2}),s=new o.a((()=>{e(!1)}),{bounceLimitMS:200,debounceType:1});return(0,n.wu)("resize",window,(()=>{i.callFunc(),s.callFunc()})),(0,n.wu)("orientationchange",window,(()=>{e(!1),window.setTimeout((()=>{e(!1)}),80)})),s}((e=>{c=e,d.fire(e)}));function p(e,t,i,s,n){const o=()=>{const o=e instanceof r.u?e.element:e;s.forEach((e=>{const s=(e=>{const s=e.min instanceof Function?e.min():e.min;return s+((e.max instanceof Function?e.max():e.max)-s)*(Math.max(Math.min(document.body.clientWidth,i),t)-t)/(i-t)})(e);o.style[e.name]=`${s}px`,void 0!==n&&n(s)})),e instanceof r.u&&e.repositionChildrenRecursive()};return d.addListener(o,e),window.setTimeout((()=>{o()})),o}function m(e){const t=new l.c_(`width-less-than${e}`);let i=!1;return d.listen((()=>{(0,h.DK)(){t!==e.offsetWidth&&(d.fire(!0),t=e.offsetWidth)}),150)}},442:(e,t,i)=>{"use strict";i.d(t,{w:()=>l});var s=i(2709),n=i(3955),o=i(4947),r=i(1372);function a(){return(0,r.tT)("svg",{width:".75em",height:"1.1em",viewBox:"0 0 9 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.tT)("path",{d:"M4.50848 7.97048V1.5",stroke:"white","stroke-width":"1.4","stroke-linecap":"round"}),(0,r.tT)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1.24099 4.92406C0.957097 4.66164 0.496814 4.66164 0.21292 4.92406C-0.0709734 5.18648 -0.0709734 5.61194 0.21292 5.87436L3.90125 9.28368C4.18515 9.5461 4.64543 9.5461 4.92932 9.28368L8.67227 5.82387C8.95617 5.56145 8.95617 5.13599 8.67227 4.87357C8.38838 4.61115 7.9281 4.61115 7.6442 4.87357L4.41529 7.85823L1.24099 4.92406ZM0.655497 11.2058C0.298143 11.2058 0.00844965 11.4955 0.00844965 11.8528C0.00844965 12.2102 0.298143 12.4999 0.655498 12.4999H8.3614C8.71876 12.4999 9.00845 12.2102 9.00845 11.8528C9.00845 11.4955 8.71876 11.2058 8.3614 11.2058H0.655497Z",fill:"white"}))}class l extends s.u{constructor(e){super("div",e),this.props=e,this.unreadCount=0,this.hideElement()}initUI(e){const t={bottom:e.bottomStyle,left:"50%",transform:`translateX(-50%) translateX(-${.5*(0,n.XJ)()}px)`,maxWidth:`calc(100% - ${(0,n.XJ)()+8}px)`};this.element=(0,r.tT)("div",{className:"scrollDownButton",onClick:()=>this.onClick(),style:t,title:o.R.scrollToBottom},(0,r.tT)(a,null),(0,r.tT)("span",{ref:e=>this.textSpan=e,"data-testid":"scroll-down-text"},o.R.scrollToBottom))}getUnreadCount(){return this.unreadCount}incUnread(){this.unreadCount+=1,this.unreadCount>10?this.textSpan.textContent=o.R.tenPlusNewMessages:this.textSpan.textContent=o.R.nNewMessages(this.unreadCount),this.flashBackground()}clearUnread(){this.unreadCount=0,this.textSpan.textContent=o.R.scrollToBottom}flashBackground(){this.element.classList.remove("flash"),(0,n.aN)(),this.element.classList.add("flash")}onClick(){this.props.scrollToBottom(),this.hideElement()}showElement(){this.element.classList.remove("flash"),super.showElement()}render(){return this.element}}},9466:(e,t,i)=>{"use strict";i.d(t,{QR:()=>h,cL:()=>l,kG:()=>a,r0:()=>r});var s=i(6784),n=i(1519),o=i(8423);function r(e,t){const i=new n.v(t);return(0,s.wu)("scroll",e,(()=>{i.callFunc()})),i}class a extends o.c_{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super("scrollEndDebounceEvent",arguments.length>2?arguments[2]:void 0),this.listenerObj=e,this.scrollOrientation=t,this.lastScroll=this.getCurrentScroll()}get element(){return this.listenerObj instanceof Document?this.listenerObj.documentElement:this.listenerObj}getCurrentScroll(){return 0===this.scrollOrientation?this.element.scrollTop:this.element.scrollLeft}listen(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.listen(e,t);return this.registerDebouncer(),i}addListener(e,t){super.addListener(e,t),this.registerDebouncer()}registerDebouncer(){r(this.listenerObj,(e=>{const t=this.getCurrentScroll();this.fire({isStart:e,scrollDirection:t>this.lastScroll?1:0}),this.lastScroll=t}))}}function l(e,t,i){const s=e.scrollLeft;let n;const o=i,r=i=>{n=void 0===n?i:n;const a=i-n;e.scrollLeft=s2&&void 0!==arguments[2]?arguments[2]:100;const o=new n.a(t,{bounceLimitMS:i,debounceType:2});return(0,s.wu)("scroll",e,(()=>{o.callFunc()})),o}},735:(e,t,i)=>{"use strict";i.d(t,{wx:()=>H,R5:()=>O});var s=i(7063),n=i(7623),o=i(5216),r=i(6844),a=i(82),l=i(8451),h=i(7882),d=i(7407),c=i(1372),u=i(9447),p=i(6615),m=i(8423),g=i(9461),v=i(1421),f=i(7995);const y=new m.c_("SuggestionClicked"),b={fontSize:"9px",position:"relative",width:"105px"},w={display:"inline-block",position:"relative",top:"6px",height:"18px",padding:"5px 10px",width:"18px"},C={display:"inline-block",margin:"0px",position:"relative"},S={borderBottomStyle:"solid",borderBottomWidth:"1px",cursor:"pointer",height:"42px",position:"relative"},x={textDecoration:"none"},T={display:"inline-block",position:"absolute",top:"6px",height:"35px",width:(0,n.Xb)()?"calc(100% - 38px)":"180px"},A={font:"12px UbuntuBold, Arial, Helvetica, sans-serif",marginRight:"0px"},P={font:"12px UbuntuRegular, Arial, Helvetica, sans-serif",marginRight:"0px"};class k extends a.b{getIconClassName(){return""}getStatusText(){return""}getRowClassName(){return""}createLabelElements(e){let t=e.input;t=e.labelText.startsWith("#")?t.replace(/%23/g,"#"):t.replace(/#/g,"");const i=e.labelText.toLowerCase().indexOf(t.toLowerCase()),s=i>=0?e.labelText.slice(i,i+t.length):e.labelText,n=i>0?e.labelText.slice(0,i):"",o=i+t.length=0?e.labelText.slice(i+t.length):"";return[(0,c.tT)("span",{style:A},n),(0,c.tT)("span",{style:P},s),(0,c.tT)("span",{style:A},o),(0,c.tT)("div",{className:"statusText",style:b},this.getStatusText())]}createElement(e){return(0,c.tT)("a",{style:x,href:e.href,tabIndex:-1,onKeyDown:t=>{(0,l.Ci)(t)&&this.onClickHandler(e)},onContextMenu:e=>!(0,n.Xb)()&&!g.Bm.current.isMobile||(e.preventDefault(),!1),onBlur:e=>{f.WM.fire(e)},onClick:t=>{""===e.href&&t.preventDefault(),this.onClickHandler(e,t)}},(0,c.tT)("div",{className:this.getRowClassName(),style:S},(0,c.tT)("div",{className:this.getIconClassName(),style:w}),(0,c.tT)("div",{style:T},(0,c.tT)("p",{className:this.getRowClassName(),style:C},this.createLabelElements(e)))))}onClickHandler(e,t){(0,v.ig)(e.labelText,"online");const i={resultType:"broadcaster",resultString:e.labelText};(0,d.bT)("SearchBarResultsClick",i)}}var M=i(6624),R=i(878),I=i(9930);class E extends k{getIconClassName(){return"icon-hashtag"}getStatusText(){return""}getRowClassName(){return"hashtag_suggestion"}onClickHandler(e,t){const i=`#${e.labelText}`;(0,v.ig)(i,"hashtags");const s={resultType:"hashtag",resultString:i};(0,d.bT)("SearchBarResultsClick",s),void 0!==t&&(I.XS.fire(t),(0,M.isHomepageFiltersActive)()&&(0,R.AV)())}}var L=i(4947);const D=new m.c_("historyDeleteClicked"),B={width:"23px",height:"23px",display:"block",position:"absolute",top:"20%",left:"unset",right:"2px",backgroundPosition:"50% top",backgroundSize:"14px 14px"};class U extends k{getIconClassName(){return"icon-history"}getStatusText(){return L.R.previouslySearched}getRowClassName(){return"history_suggestion"}onClickHandler(e,t){const i={resultType:"history",resultString:e.labelText};(0,d.bT)("SearchBarResultsClick",i),e.href.includes("/tag/")?((0,v.ig)(e.labelText,"hashtags"),void 0!==t&&(I.XS.fire(t),(0,M.isHomepageFiltersActive)()&&(0,R.AV)())):""!==e.href?(0,v.ig)(e.labelText,"online"):y.fire(e.labelText)}createElement(e){const t=super.createElement(e),i=(0,n.Xb)()?B:{},s=(0,c.tT)("div",{style:i,className:"historyDelete",onClick:e=>{e.preventDefault(),e.stopPropagation()},onMouseDown:t=>{t.ctrlKey||t.metaKey||2===t.button||((0,v.og)(e.labelText),D.fire(e.labelText),t.preventDefault(),t.stopPropagation())}}),o=t.firstElementChild;if(null!==o){const e=o.lastElementChild;null!==e&&e.appendChild(s)}return t}}class F extends k{getIconClassName(){return"icon-offline"}getStatusText(){return L.R.recentlyOnline}getRowClassName(){return"broadcaster_suggestion"}}class _ extends k{getIconClassName(){return"icon-online"}getStatusText(){return L.R.broadcastingNow}getRowClassName(){return"broadcaster_suggestion"}}const N=["hashtags","online","offline"],O="Tab";class H extends a.b{constructor(){super(...arguments),this.currentIndex=-1,this.highestIndex=-1,this.keyNavigated=!1,this.pauseSuggestions=!1,this.timeoutId=0}createElement(e){return(0,c.tT)("div",{className:"suggestionsDiv"})}initData(e){this.input=e.input,this.searchInput=e.searchInput,this.suggestionsList=[],this.gender=(0,h.Bg)(),f.DO.onSubmit.listen((()=>{this.lastSearch=void 0})),y.listen((e=>{null!==e&&(this.input.value=e,this.searchInput.onSubmitSearchInput())})),D.listen((e=>{const t=this.suggestionsList.findIndex((t=>t.label===e));this.suggestionsList[t].element.remove(),this.suggestionsList.splice(t,1),this.highestIndex=this.suggestionsList.length-1,this.showSuggestions(),this.input.focus(),this.input.select()}))}styleActiveSuggestion(e){(0,u.fZ)(e,"active")}styleInactiveSuggestion(e){(0,u.SA)(e,"active")}removeExistingSuggestions(){for(this.suggestionsList=[],this.highestIndex=-1;null!==this.element.lastChild;)this.element.removeChild(this.element.lastChild);this.hideElement()}createUrlForHashtagSuggestion(e){const t={...p.T.current.state},i={genders:t.genders,regions:t.regions,ageMin:t.ageMin,ageMax:t.ageMax,privatePrices:t.privatePrices,roomSize:t.roomSize,tags:[e]};return p.T.current.convertStateToUrl(i)}createSuggestion(e,t,i,s,n){let o,r=`/${e}/`;switch(this.gender=(0,h.Bg)(),i){case"online":o=new _({labelText:e,input:t,count:s,href:r}).element;break;case"offline":o=new F({labelText:e,input:t,count:s,href:r}).element;break;case"hashtags":r=this.createUrlForHashtagSuggestion(e),o=new E({labelText:e,input:t,count:s,href:r}).element,o.dataset.testid="search-hashtag-suggestion";break;default:"hashtags"===n?r=this.createUrlForHashtagSuggestion(e.replace("#","")):"history"===n&&(r=""),o=new U({labelText:e,input:t,count:s,href:r}).element}this.element.appendChild(o);const a=o.firstElementChild;a.onmouseenter=()=>{this.styleInactiveLastSug(),this.styleActiveSuggestion(a);const e=o.getAttribute("index");null!==e&&(this.currentIndex=parseInt(e,10)),this.keyNavigated=!1},a.onmouseleave=()=>{this.styleInactiveLastSug(),this.styleInactiveSuggestion(a),this.currentIndex=-1,this.keyNavigated=!1},this.suggestionsList.push({label:e,element:a})}navigateSuggestions(e){if(this.suggestionsList.length>0){this.saveFirstText(),this.keyNavigated=!0;const t=this.currentIndex;t>-1&&this.styleInactiveSuggestion(this.suggestionsList[t].element),this.tabThroughSuggestions(e),(0,l.LV)(e)?this.currentIndex=this.currentIndex+1<=this.highestIndex?this.currentIndex+1:0:(0,l.IM)(e)&&(this.currentIndex=this.currentIndex-1>=0?this.currentIndex-1:this.highestIndex,e.preventDefault());const i=this.suggestionsList[this.currentIndex];void 0!==i&&(this.replaceInputValue(i),this.styleActiveSuggestion(i.element)),this.styleAllInactiveSuggestions()}}replaceInputValue(e){var t;const i=null!==(t=e.element.getAttribute("class"))&&void 0!==t?t:"";void 0!==i&&(this.input.value=i.includes("hashtag_suggestion")?`#${e.label}`:e.label)}tabThroughSuggestions(e){if(e.key===O)if(this.currentIndex>-1&&this.currentIndex<=this.highestIndex){if(e.shiftKey){if(0===this.currentIndex)return this.resetSuggestionsNavigation(),void(this.input.value=this.firstText);this.currentIndex=this.currentIndex-1}else{if(this.currentIndex===this.highestIndex)return this.resetSuggestionsNavigation(),void(this.input.value=this.firstText);this.currentIndex=this.currentIndex+1}e.preventDefault()}else-1!==this.currentIndex||e.shiftKey||(this.currentIndex=0,e.preventDefault())}saveFirstText(){this.keyNavigated||(this.firstText=this.input.value)}getSuggestionsAfterTime(e){if(this.pauseSuggestions)""===this.input.value&&this.removeExistingSuggestions();else{0!==this.timeoutId&&window.clearTimeout(this.timeoutId);const t=this.input.value.trim().replace(/^#/,"%23"),i=t.split(" "),s=e=>e.some((e=>e.length>30))||e.length>6||t.length>60,n=(0,h.Bg)();t===this.lastSearch&&this.gender===n||s(i)?(s(i)&&this.showHistorySuggestions(t),e?this.showSuggestions():this.hideSuggestions()):this.timeoutId=window.setTimeout((()=>{this.suggestionPromise=this.getSuggestions(e)}),250)}}styleAllInactiveSuggestions(){for(const e of this.suggestionsList)e!==this.suggestionsList[this.currentIndex]&&this.styleInactiveSuggestion(e.element)}async getSuggestions(e){const t=this.input.value,i=t.trim().replace(/^#/,"%23");return this.timeoutId=0,""===t?(this.lastSearch=void 0,this.showHistorySuggestions(t),void this.showSuggestions()):await(0,o.Aw)(`ax/search/?keywords=${i}`).then((n=>{if(this.input.value!==t)return;this.lastSearch=i,this.showHistorySuggestions(i);let o=this.suggestionsList.length;const r=new s.N6(n.responseText);N.forEach((e=>{const i=r.getStringList(e);void 0!==i&&i.forEach((i=>{o>=10||(this.createSuggestion(i,t,e,o),this.highestIndex=o,o+=1)}))})),this.preventShow?this.preventShow=!1:e?this.showSuggestions():this.hideSuggestions()})).catch((e=>{this.pauseSuggestions=!0,window.setTimeout((()=>{this.pauseSuggestions=!1}),6e4),(0,d.bT)("TooManySearchAutocompleteError"),warn("Too many autocomplete queries, wait before resuming",e)}))}showHistorySuggestions(e){this.removeExistingSuggestions(),this.createHistorySuggestions(e),this.highestIndex=this.suggestionsList.length-1}createHistorySuggestions(e){if(!(0,n.Pf)())return;(0,v.Y4)();let t=0;if(!(0,r.ok)()){const i=window.localStorage.getItem((0,v.Dc)());null!==i&&JSON.parse(i).forEach((i=>{void 0!==i.content&&i.content.includes(e.replace(/%23/g,"#").toLowerCase())&&(t+=1,this.createSuggestion(i.content,e,"history",t,i.type))}))}}hideSuggestions(){this.styleInactiveLastSug(),this.hideElement(),this.resetSuggestionsNavigation(),window.setTimeout((()=>{document.activeElement instanceof HTMLElement&&this.element.contains(document.activeElement)&&document.activeElement.blur()}))}getCurrentNavigatedSuggestion(){return this.suggestionsList[this.currentIndex]}isSuggestionsNavigated(){return this.keyNavigated&&this.currentIndex>-1&&this.suggestionsList.length>this.currentIndex}resetSuggestionsNavigation(){this.currentIndex=-1,this.keyNavigated=!1}styleInactiveLastSug(){this.currentIndex>-1&&this.suggestionsList.length>this.currentIndex&&this.styleInactiveSuggestion(this.suggestionsList[this.currentIndex].element)}preventShowOnGetSuggestions(e){this.preventShow=e}showSuggestions(){this.suggestionsList.length&&document.activeElement===this.input?this.showElement():this.hideElement()}}},1421:(e,t,i)=>{"use strict";i.d(t,{Dc:()=>a,Y4:()=>d,ig:()=>l,og:()=>h});var s=i(7623),n=i(9461);const o="searchHistory",r=5;function a(){return void 0!==n.Bm.current.loggedInUser?`${o}:${n.Bm.current.loggedInUser.username}`:""}function l(e,t){if((0,s.Pf)()&&void 0!==n.Bm.current.loggedInUser&&""!==e){const i=e.toLowerCase().trim(),s=window.localStorage.getItem(a()),n={content:i,type:t};let o=JSON.stringify([n]);if(null!==s){const e=JSON.parse(s);let t=0;for(const s of e){if(s.content===i){e.splice(t,1);break}t+=1}e.unshift(n),e.length>r&&e.pop(),o=JSON.stringify(e)}window.localStorage.setItem(a(),o)}}function h(e){if(!(0,s.Pf)())return;const t=window.localStorage.getItem(a());if(null!==t){const i=null!==t?JSON.parse(t):[];i.splice(i.findIndex((t=>t.content===e)),1);const s=JSON.stringify(i);window.localStorage.setItem(a(),s)}}function d(){const e=window.localStorage.getItem(a());if(null!==e)try{const t=JSON.parse(e);for(const e of t)if(void 0===e.content||void 0===e.type)return void window.localStorage.removeItem(a())}catch{return warn("Failed to parse and iterate search history, clearing",{searchHistory:e}),void window.localStorage.removeItem(a())}}},7995:(e,t,i)=>{"use strict";i.d(t,{DO:()=>C,WM:()=>w});var s=i(6624),n=i(7623),o=i(5216),r=i(82),a=i(3955),l=i(8423),h=i(8451),d=i(9060),c=i(4947),u=i(1372),p=i(2945),m=i(9232),g=i(9461),v=i(7321),f=i(6615),y=i(735),b=i(1421);const w=new l.c_("SearchBlur");class C extends r.b{constructor(){super(...arguments),this.searchKeywords=""}createElement(e){return(0,u.tT)("div",{className:"SearchInput",id:"SearchInput"},(0,u.tT)("form",{id:"filter_search_form",method:"GET",action:(0,o._Y)("/"),ref:e=>{this.form=e}},(0,u.tT)("input",{type:"text",style:{display:"none"}}),(0,u.tT)("input",{type:"password",style:{display:"none"}}),(0,u.tT)("input",{id:"keywords",name:"keywords",className:"search_input",maxLength:150,placeholder:c.R.searchBarPlaceholder,type:"text",autocomplete:"off",ref:e=>{this.input=e},onFocus:e=>{this.isFocusInsideSearch(e)&&this.onInputFocus()},onBlur:e=>{w.fire(e)},onInput:()=>{this.onInput()},onKeyDown:e=>{this.inputKeyDown(e)}}),(0,u.tT)("div",{className:"inputDelete",ref:e=>{this.delete=e},onMouseDown:e=>{e.ctrlKey||e.metaKey||2===e.button||this.onInputDeleteClick(e)}}),this.initSuggestions()))}initUI(e){super.initUI(e),this.styleInputDelete()}initSuggestions(){return(0,u.tT)(y.wx,{classRef:e=>{this.suggestionsDiv=e},input:this.input,searchInput:this})}initData(e){var t,i;super.initData(e),this.pushSearches=null!==(t=e.pushSearches)&&void 0!==t&&t,this.searchKeywords=S(null!==(i=new URLSearchParams(window.location.search).get("keywords"))&&void 0!==i?i:""),(0,p.KZ)(new Map([["keywords",this.searchKeywords]])),m.y.fire(this.searchKeywords),this.input.value=this.searchKeywords,w.listen((e=>{this.isFocusInsideSearch(e)||window.setTimeout((()=>{this.onInputBlur()}),250)})),""!==this.input.value&&(this.suggestionsDiv.getSuggestionsAfterTime(!1),(0,b.ig)(this.input.value,"history"))}inputKeyDown(e){(0,h.Ci)(e)?(e.preventDefault(),this.suggestionsDiv.styleInactiveLastSug(),this.suggestionsDiv.isSuggestionsNavigated()?this.suggestionsDiv.getCurrentNavigatedSuggestion().element.click():this.onSubmitSearchInput()):"ArrowDown"===e.key||"ArrowUp"===e.key||e.key===y.R5?this.suggestionsDiv.navigateSuggestions(e):e.shiftKey||e.key===y.R5||(this.suggestionsDiv.styleInactiveLastSug(),this.suggestionsDiv.resetSuggestionsNavigation()),this.styleInputDelete()}onInputFocus(){this.styleInputDelete(),this.suggestionsDiv.getSuggestionsAfterTime(!0)}onInputBlur(){this.suggestionsDiv.hideSuggestions()}styleInputDelete(){""!==this.input.value?(0,a.ZM)(this.delete,{visibility:"visible",display:"block"}):(0,a.ZM)(this.delete,{visibility:"hidden",display:"none"})}onInputDeleteClick(e){this.input.value="",this.styleInputDelete(),(0,n.J0)()&&this.onInputFocus(),this.input.focus(),this.suggestionsDiv.getSuggestionsAfterTime(!0),e.preventDefault(),e.stopImmediatePropagation()}showInputBar(){(0,a.ZM)(this.input,{display:"block"}),(0,a.ZM)(this.delete,{visibility:"visible"})}hideInputBar(){(0,a.ZM)(this.input,{display:"none"}),(0,a.ZM)(this.delete,{visibility:"hidden"}),this.suggestionsDiv.hideSuggestions()}showHideInputBar(){""!==this.input.value?this.showInputBar():this.hideInputBar()}onInput(){this.suggestionsDiv.getSuggestionsAfterTime(!0),this.styleInputDelete()}onSubmitSearchInput(){const e=new URLSearchParams(window.location.search);if(0!==this.input.value.trim().length||e.has("keywords")){if(this.searchKeywords=S(this.input.value),!window.location.pathname.includes("/tags/")){const e=new Map([["keywords",this.searchKeywords],["page",""]]);this.pushSearches?(0,p.W2)(e):(0,p.KZ)(e)}this.input.blur(),this.styleInputDelete(),this.suggestionsDiv.hideSuggestions(),(0,b.ig)(this.searchKeywords,"history"),this.completeSearch()}}completeSearch(){C.onSubmit.fire(this.searchKeywords),window.scrollTo(0,0),this.suggestionsDiv.preventShowOnGetSuggestions(!0),window.setTimeout((()=>{this.suggestionsDiv.preventShowOnGetSuggestions(!1)}),400),v.HA.getInstance().loadRooms((()=>{this.input.value=this.searchKeywords,g.Bm.current.isMobile?this.styleInputDelete():this.showHideInputBar(),m.y.fire(this.searchKeywords)})),(0,d.rT)()&&f.T.current.setPartialState({keywords:this.searchKeywords.slice(0,s.KEYWORDS_LENGTH_LIMIT),page:1,pageb:1})}isFocusInsideSearch(e){return this.element.contains(document.activeElement)||this.input===document.activeElement||e.relatedTarget instanceof Node&&this.element.contains(e.relatedTarget)}}function S(e){const t=[],i=new RegExp(/[a-zA-Z0-9_#\-\s]+/g),s=e.match(i);let n=!1;if(null!==s){const e=s.join("").split(" ").filter((e=>e.length>0));for(const i of e){const e=i.startsWith("#")?"#":"",s=i.replace(/#/g,""),o=s.length>0?`${e}${s}`:"";t.push(o),s.length>=2&&(n=!0)}}return n?t.join(" ").trim():""}C.onSubmit=new l.c_("onSubmit")},3885:(e,t,i)=>{"use strict";i.d(t,{N:()=>n,_:()=>o});var s=i(1372);function n(e){const t={width:"30px",height:"31px",background:`url("${STATIC_URL_ROOT}images/loading_spinner.svg")`,backgroundSize:"cover",animationName:"spin",animationDuration:"2s",animationTimingFunction:"linear",animationIterationCount:"infinite",...e.extraStyle};return(0,s.tT)("div",{style:t})}function o(e){const t={display:!0===e.startHidden?"none":"block",width:"100%",height:"100%",position:"absolute",...e.extraStyle};return(0,s.tT)("div",{style:t,ref:e.myRef},(0,s.tT)(n,{extraStyle:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:"-15px 0 0 -15px"}}))}},394:(e,t,i)=>{"use strict";i.d(t,{k:()=>h});var s=i(2709),n=i(7882),o=i(4947),r=i(1372);const a={marginLeft:"8px",verticalAlign:"middle",fontSize:"14px"},l={marginLeft:"10px",fontSize:"14px"};class h extends s.u{constructor(){super(),this.element=(0,r.tT)("form",{className:"subgenderModal",style:{position:"relative"}},(0,r.tT)("p",{style:l},o.R.subgenderSelectionHeader),(0,r.tT)("p",{style:l},o.R.subgenderSelectionPrompt),(0,r.tT)("div",{style:{margin:"5px"}},(0,r.tT)("input",{type:"radio",name:"subgender",id:"subgender1",value:n.CM.Transfemme,checked:!0}),(0,r.tT)("label",{style:a,htmlFor:"subgender1"},o.R.subgenderFemme)),(0,r.tT)("div",{style:{margin:"5px"}},(0,r.tT)("input",{type:"radio",name:"subgender",id:"subgender2",value:n.CM.Transmasc}),(0,r.tT)("label",{style:a,htmlFor:"subgender2"},o.R.subgenderMasc)),(0,r.tT)("div",{style:{margin:"5px"}},(0,r.tT)("input",{type:"radio",name:"subgender",id:"subgender3",value:n.CM.Nonbinary}),(0,r.tT)("label",{style:a,htmlFor:"subgender3"},o.R.subgenderNonbinary)))}}},664:(e,t,i)=>{"use strict";i.d(t,{S:()=>o});var s=i(3957),n=i(1372);function o(e){switch(e){case s.PL.InTrouble:return(0,n.tT)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.tT)("g",{opacity:"0.4","clip-path":"url(#clip0)"},(0,n.tT)("path",{d:"M22.948 10.5C22.8167 10.5054 22.6878 10.5366 22.5686 10.5919C22.4494 10.6471 22.3423 10.7253 22.2533 10.822C22.1643 10.9187 22.0953 11.0319 22.0501 11.1553C22.0049 11.2787 21.9845 11.4097 21.99 11.541C21.996 11.692 22 11.841 22 11.999C21.9983 14.1333 21.3133 16.2109 20.0452 17.9277C18.7772 19.6444 16.9927 20.91 14.9533 21.5391C12.9138 22.1682 10.7265 22.1278 8.71174 21.4237C6.69694 20.7196 4.96052 19.3889 3.7568 17.6265C2.55309 15.864 1.94533 13.7625 2.02255 11.6296C2.09976 9.4967 2.85789 7.44458 4.1859 5.77379C5.5139 4.103 7.342 2.90132 9.40244 2.34478C11.4629 1.78823 13.6474 1.90606 15.636 2.68099C15.8831 2.77753 16.1583 2.77197 16.4013 2.66555C16.5216 2.61285 16.6303 2.53697 16.7213 2.44225C16.8123 2.34753 16.8837 2.23582 16.9315 2.11349C16.9793 1.99116 17.0025 1.86062 16.9999 1.72931C16.9972 1.59801 16.9688 1.46851 16.9161 1.34821C16.8634 1.22791 16.7875 1.11917 16.6928 1.02819C16.598 0.937219 16.4863 0.865792 16.364 0.817991C13.9758 -0.114361 11.3518 -0.257336 8.87638 0.410013C6.40101 1.07736 4.20443 2.51995 2.60851 4.52641C1.01259 6.53286 0.101223 8.9977 0.00794807 11.5598C-0.0853267 14.1218 0.644395 16.6464 2.09019 18.7636C3.53599 20.8808 5.62185 22.4793 8.04214 23.3249C10.4624 24.1704 13.0899 24.2187 15.5396 23.4624C17.9893 22.7062 20.1324 21.1853 21.6549 19.1226C23.1774 17.0599 23.9992 14.5637 24 12C24 11.818 24 11.639 23.988 11.459C23.9711 11.1961 23.8536 10.9499 23.66 10.7713C23.4663 10.5928 23.2114 10.4956 22.948 10.5Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M20.5 9.49994C21.4283 9.49994 22.3185 9.13119 22.9749 8.47482C23.6313 7.81844 24 6.9282 24 5.99994C24 4.42994 21.951 1.34094 21.323 0.431943C21.2261 0.305815 21.1014 0.203655 20.9587 0.133354C20.816 0.0630519 20.6591 0.0264893 20.5 0.0264893C20.3409 0.0264893 20.184 0.0630519 20.0413 0.133354C19.8986 0.203655 19.7739 0.305815 19.677 0.431943C19.049 1.34094 17 4.42994 17 5.99994C17 6.9282 17.3687 7.81844 18.0251 8.47482C18.6815 9.13119 19.5717 9.49994 20.5 9.49994ZM20.285 3.19094C20.3071 3.15364 20.3386 3.12273 20.3763 3.10127C20.414 3.0798 20.4566 3.06852 20.5 3.06852C20.5434 3.06852 20.586 3.0798 20.6237 3.10127C20.6614 3.12273 20.6929 3.15364 20.715 3.19094C21.3011 4.04677 21.7357 4.99692 22 5.99994C22 6.39777 21.842 6.7793 21.5607 7.0606C21.2794 7.34191 20.8978 7.49994 20.5 7.49994C20.1022 7.49994 19.7206 7.34191 19.4393 7.0606C19.158 6.7793 19 6.39777 19 5.99994C19.2643 4.99692 19.6989 4.04677 20.285 3.19094Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M7.50827 18.37C7.73904 18.5003 8.01212 18.5338 8.2675 18.4629C8.52289 18.392 8.73969 18.2226 8.87027 17.992C9.16681 17.4109 9.61344 16.9197 10.1638 16.5695C10.7142 16.2192 11.3483 16.0226 12.0003 16C12.6523 16.0226 13.2863 16.2192 13.8367 16.5695C14.3871 16.9197 14.8337 17.4109 15.1303 17.992C15.2653 18.2138 15.4813 18.3743 15.7325 18.4397C15.9838 18.5051 16.2507 18.4702 16.4767 18.3424C16.7027 18.2146 16.8701 18.0039 16.9436 17.7549C17.017 17.5058 16.9907 17.238 16.8703 17.008C16.4021 16.1166 15.7032 15.3672 14.8466 14.8381C13.9899 14.309 13.007 14.0195 12.0003 14C10.9936 14.0195 10.0106 14.309 9.15396 14.8381C8.29732 15.3672 7.59843 16.1166 7.13027 17.008C6.99993 17.2388 6.96652 17.5118 7.0374 17.7672C7.10828 18.0226 7.27764 18.2394 7.50827 18.37Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M8.5 11.5C9.60457 11.5 10.5 10.6046 10.5 9.5C10.5 8.39543 9.60457 7.5 8.5 7.5C7.39543 7.5 6.5 8.39543 6.5 9.5C6.5 10.6046 7.39543 11.5 8.5 11.5Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M15.5 11.5C16.6046 11.5 17.5 10.6046 17.5 9.5C17.5 8.39543 16.6046 7.5 15.5 7.5C14.3954 7.5 13.5 8.39543 13.5 9.5C13.5 10.6046 14.3954 11.5 15.5 11.5Z",fill:"#49494F"})),(0,n.tT)("defs",null,(0,n.tT)("clipPath",{id:"clip0"},(0,n.tT)("rect",{width:"24",height:"24",fill:"white"}))));case s.PL.Unhappy:return(0,n.tT)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.tT)("g",{opacity:"0.4","clip-path":"url(#clip0)"},(0,n.tT)("path",{d:"M12 0C9.62663 0 7.30655 0.703788 5.33316 2.02236C3.35977 3.34094 1.8217 5.21509 0.913451 7.4078C0.00519943 9.60051 -0.232441 12.0133 0.230582 14.3411C0.693605 16.6689 1.83649 18.8071 3.51472 20.4853C5.19295 22.1635 7.33115 23.3064 9.65892 23.7694C11.9867 24.2324 14.3995 23.9948 16.5922 23.0866C18.7849 22.1783 20.6591 20.6402 21.9776 18.6668C23.2962 16.6935 24 14.3734 24 12C23.9966 8.81846 22.7312 5.76821 20.4815 3.51852C18.2318 1.26883 15.1815 0.00344108 12 0V0ZM12 22C10.0222 22 8.08879 21.4135 6.4443 20.3147C4.79981 19.2159 3.51809 17.6541 2.76121 15.8268C2.00433 13.9996 1.8063 11.9889 2.19215 10.0491C2.578 8.10929 3.53041 6.32746 4.92894 4.92893C6.32746 3.53041 8.10929 2.578 10.0491 2.19215C11.9889 1.8063 13.9996 2.00433 15.8268 2.7612C17.6541 3.51808 19.2159 4.79981 20.3147 6.4443C21.4135 8.08879 22 10.0222 22 12C21.9971 14.6513 20.9426 17.1931 19.0679 19.0679C17.1931 20.9426 14.6513 21.9971 12 22Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M8 11C9.10457 11 10 10.1046 10 9C10 7.89543 9.10457 7 8 7C6.89543 7 6 7.89543 6 9C6 10.1046 6.89543 11 8 11Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M16 11C17.1046 11 18 10.1046 18 9C18 7.89543 17.1046 7 16 7C14.8954 7 14 7.89543 14 9C14 10.1046 14.8954 11 16 11Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M17.2149 14.186C15.7885 13.873 14.3036 13.9565 12.9212 14.4273C11.5389 14.8982 10.3118 15.7384 9.37291 16.857C9.27893 16.9558 9.20617 17.0728 9.1591 17.2009C9.11203 17.3289 9.09164 17.4651 9.09919 17.6013C9.10674 17.7375 9.14206 17.8707 9.20299 17.9927C9.26392 18.1147 9.34917 18.223 9.45349 18.3109C9.55781 18.3987 9.679 18.4643 9.80961 18.5036C9.94022 18.5429 10.0775 18.555 10.213 18.5393C10.3484 18.5236 10.4793 18.4803 10.5974 18.4122C10.7155 18.344 10.8185 18.2524 10.8999 18.143C11.6044 17.3047 12.5248 16.6752 13.5614 16.3227C14.5981 15.9701 15.7115 15.908 16.7809 16.143C16.9099 16.1734 17.0437 16.1779 17.1745 16.1561C17.3053 16.1344 17.4305 16.0868 17.5427 16.0163C17.6549 15.9457 17.752 15.8536 17.8283 15.7451C17.9046 15.6367 17.9586 15.5142 17.9871 15.3847C18.0156 15.2552 18.0181 15.1214 17.9944 14.9909C17.9707 14.8605 17.9213 14.7361 17.8491 14.6249C17.7768 14.5137 17.6832 14.418 17.5737 14.3433C17.4641 14.2687 17.3408 14.2165 17.2109 14.19L17.2149 14.186Z",fill:"#49494F"})),(0,n.tT)("defs",null,(0,n.tT)("clipPath",{id:"clip0"},(0,n.tT)("rect",{width:"24",height:"24",fill:"white"}))));case s.PL.Indifferent:return(0,n.tT)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.tT)("g",{opacity:"0.4","clip-path":"url(#clip0)"},(0,n.tT)("path",{d:"M17 15H7C6.73478 15 6.48043 15.1054 6.29289 15.2929C6.10536 15.4804 6 15.7348 6 16C6 16.2652 6.10536 16.5196 6.29289 16.7071C6.48043 16.8946 6.73478 17 7 17H17C17.2652 17 17.5196 16.8946 17.7071 16.7071C17.8946 16.5196 18 16.2652 18 16C18 15.7348 17.8946 15.4804 17.7071 15.2929C17.5196 15.1054 17.2652 15 17 15Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M12 0C9.62663 0 7.30655 0.703788 5.33316 2.02236C3.35977 3.34094 1.8217 5.21509 0.913451 7.4078C0.00519943 9.60051 -0.232441 12.0133 0.230582 14.3411C0.693605 16.6689 1.83649 18.8071 3.51472 20.4853C5.19295 22.1635 7.33115 23.3064 9.65892 23.7694C11.9867 24.2324 14.3995 23.9948 16.5922 23.0866C18.7849 22.1783 20.6591 20.6402 21.9776 18.6668C23.2962 16.6935 24 14.3734 24 12C23.9966 8.81846 22.7312 5.76821 20.4815 3.51852C18.2318 1.26883 15.1815 0.00344108 12 0V0ZM12 22C10.0222 22 8.08879 21.4135 6.4443 20.3147C4.79981 19.2159 3.51809 17.6541 2.76121 15.8268C2.00433 13.9996 1.8063 11.9889 2.19215 10.0491C2.578 8.10929 3.53041 6.32746 4.92894 4.92893C6.32746 3.53041 8.10929 2.578 10.0491 2.19215C11.9889 1.8063 13.9996 2.00433 15.8268 2.7612C17.6541 3.51808 19.2159 4.79981 20.3147 6.4443C21.4135 8.08879 22 10.0222 22 12C21.9971 14.6513 20.9426 17.1931 19.0679 19.0679C17.1931 20.9426 14.6513 21.9971 12 22Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M8 11C9.10457 11 10 10.1046 10 9C10 7.89543 9.10457 7 8 7C6.89543 7 6 7.89543 6 9C6 10.1046 6.89543 11 8 11Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M16 11C17.1046 11 18 10.1046 18 9C18 7.89543 17.1046 7 16 7C14.8954 7 14 7.89543 14 9C14 10.1046 14.8954 11 16 11Z",fill:"#49494F"})),(0,n.tT)("defs",null,(0,n.tT)("clipPath",{id:"clip0"},(0,n.tT)("rect",{width:"24",height:"24",fill:"white"}))));case s.PL.Smirk:return(0,n.tT)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.tT)("g",{opacity:"0.4","clip-path":"url(#clip0)"},(0,n.tT)("path",{d:"M17.8871 13.077C17.7659 13.0264 17.6359 13.0002 17.5046 12.9999C17.3732 12.9996 17.2431 13.0251 17.1216 13.0751C17.0002 13.125 16.8897 13.1984 16.7967 13.291C16.7036 13.3837 16.6296 13.4938 16.5791 13.615C16.0168 14.9609 14.9436 16.0289 13.595 16.5845C12.2463 17.1402 10.7323 17.1382 9.38508 16.579C9.14028 16.4769 8.86495 16.4762 8.61965 16.5771C8.37436 16.678 8.17918 16.8722 8.07708 17.117C7.97497 17.3618 7.97429 17.6371 8.07518 17.8824C8.17608 18.1277 8.37028 18.3229 8.61508 18.425C10.4519 19.1885 12.5166 19.1918 14.3558 18.4344C16.1951 17.6769 17.6586 16.2205 18.4251 14.385C18.4756 14.2638 18.5018 14.1338 18.5022 14.0025C18.5025 13.8711 18.477 13.741 18.427 13.6195C18.377 13.4981 18.3036 13.3876 18.211 13.2946C18.1184 13.2015 18.0083 13.1275 17.8871 13.077Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M12 0C9.62663 0 7.30655 0.703788 5.33316 2.02236C3.35977 3.34094 1.8217 5.21509 0.913451 7.4078C0.00519943 9.60051 -0.232441 12.0133 0.230582 14.3411C0.693605 16.6689 1.83649 18.8071 3.51472 20.4853C5.19295 22.1635 7.33115 23.3064 9.65892 23.7694C11.9867 24.2324 14.3995 23.9948 16.5922 23.0866C18.7849 22.1783 20.6591 20.6402 21.9776 18.6668C23.2962 16.6935 24 14.3734 24 12C23.9966 8.81846 22.7312 5.76821 20.4815 3.51852C18.2318 1.26883 15.1815 0.00344108 12 0V0ZM12 22C10.0222 22 8.08879 21.4135 6.4443 20.3147C4.79981 19.2159 3.51809 17.6541 2.76121 15.8268C2.00433 13.9996 1.8063 11.9889 2.19215 10.0491C2.578 8.10929 3.53041 6.32746 4.92894 4.92893C6.32746 3.53041 8.10929 2.578 10.0491 2.19215C11.9889 1.8063 13.9996 2.00433 15.8268 2.7612C17.6541 3.51808 19.2159 4.79981 20.3147 6.4443C21.4135 8.08879 22 10.0222 22 12C21.9971 14.6513 20.9426 17.1931 19.0679 19.0679C17.1931 20.9426 14.6513 21.9971 12 22Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M8 11C9.10457 11 10 10.1046 10 9C10 7.89543 9.10457 7 8 7C6.89543 7 6 7.89543 6 9C6 10.1046 6.89543 11 8 11Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M16 11C17.1046 11 18 10.1046 18 9C18 7.89543 17.1046 7 16 7C14.8954 7 14 7.89543 14 9C14 10.1046 14.8954 11 16 11Z",fill:"#49494F"})),(0,n.tT)("defs",null,(0,n.tT)("clipPath",{id:"clip0"},(0,n.tT)("rect",{width:"24",height:"24",fill:"white"}))));case s.PL.InLove:return(0,n.tT)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.tT)("g",{opacity:"0.4","clip-path":"url(#clip0)"},(0,n.tT)("path",{d:"M15.7724 14.452C15.3637 15.0802 14.8047 15.5963 14.146 15.9536C13.4873 16.3109 12.7498 16.498 12.0004 16.498C11.251 16.498 10.5135 16.3109 9.85479 15.9536C9.19608 15.5963 8.63703 15.0802 8.22838 14.452C8.08331 14.2298 7.85588 14.0743 7.59615 14.0197C7.33641 13.9651 7.06563 14.0159 6.84338 14.161C6.62113 14.3061 6.46561 14.5335 6.41104 14.7933C6.35646 15.053 6.40731 15.3238 6.55238 15.546C7.14252 16.454 7.95016 17.2001 8.90194 17.7167C9.85372 18.2332 10.9195 18.5038 12.0024 18.5038C13.0853 18.5038 14.151 18.2332 15.1028 17.7167C16.0546 17.2001 16.8622 16.454 17.4524 15.546C17.5975 15.3238 17.6483 15.053 17.5937 14.7933C17.5391 14.5335 17.3836 14.3061 17.1614 14.161C16.9391 14.0159 16.6683 13.9651 16.4086 14.0197C16.1489 14.0743 15.9215 14.2298 15.7764 14.452H15.7724Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M5.13896 11.345C5.18563 11.3937 5.24168 11.4325 5.30372 11.459C5.36576 11.4854 5.43251 11.4991 5.49996 11.4991C5.56742 11.4991 5.63417 11.4854 5.69621 11.459C5.75825 11.4325 5.81429 11.3937 5.86096 11.345L9.26296 7.80002C9.63565 7.42708 9.88166 6.94641 9.96618 6.42599C10.0507 5.90557 9.96947 5.37174 9.73396 4.90002C9.55667 4.54205 9.29672 4.23141 8.97559 3.9938C8.65447 3.75619 8.28141 3.59842 7.88724 3.53354C7.49307 3.46866 7.08912 3.49853 6.70878 3.62068C6.32844 3.74283 5.98264 3.95376 5.69996 4.23602L5.67396 4.26302C5.6268 4.30956 5.56322 4.33565 5.49696 4.33565C5.43071 4.33565 5.36712 4.30956 5.31996 4.26302L5.29996 4.23602C4.82894 3.76248 4.18909 3.49544 3.52118 3.49366C2.85327 3.49188 2.21201 3.7555 1.73846 4.22652C1.26492 4.69755 0.997884 5.33739 0.996103 6.0053C0.994321 6.67322 1.25794 7.31448 1.72896 7.78802L5.13896 11.345Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M14.2663 4.89103C14.0292 5.36181 13.9463 5.89529 14.0294 6.41581C14.1125 6.93634 14.3574 7.41749 14.7293 7.79103L18.1393 11.348C18.186 11.3967 18.242 11.4355 18.3041 11.462C18.3661 11.4884 18.4329 11.5021 18.5003 11.5021C18.5678 11.5021 18.6345 11.4884 18.6966 11.462C18.7586 11.4355 18.8147 11.3967 18.8613 11.348L22.2613 7.79903C22.634 7.42609 22.88 6.94542 22.9645 6.425C23.0491 5.90458 22.9678 5.37075 22.7323 4.89903C22.5548 4.5415 22.2949 4.23129 21.9739 3.99403C21.6529 3.75677 21.2801 3.59926 20.8862 3.53449C20.4923 3.46972 20.0887 3.49956 19.7086 3.62154C19.3285 3.74352 18.9829 3.95415 18.7003 4.23603L18.6743 4.26303C18.6272 4.30957 18.5636 4.33566 18.4973 4.33566C18.4311 4.33566 18.3675 4.30957 18.3203 4.26303L18.3003 4.23603C18.0183 3.95407 17.6732 3.74317 17.2936 3.62071C16.9141 3.49826 16.5108 3.46776 16.1172 3.53173C15.7235 3.5957 15.3507 3.7523 15.0294 3.98864C14.7081 4.22497 14.4476 4.53426 14.2693 4.89103H14.2663Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M23 11C22.7348 11 22.4804 11.1054 22.2929 11.2929C22.1054 11.4804 22 11.7348 22 12C22 14.6522 20.9464 17.1957 19.0711 19.0711C17.1957 20.9464 14.6522 22 12 22C9.34784 22 6.8043 20.9464 4.92893 19.0711C3.05357 17.1957 2 14.6522 2 12C2 11.7348 1.89464 11.4804 1.70711 11.2929C1.51957 11.1054 1.26522 11 1 11C0.734784 11 0.48043 11.1054 0.292893 11.2929C0.105357 11.4804 0 11.7348 0 12C0 15.1826 1.26428 18.2348 3.51472 20.4853C5.76516 22.7357 8.8174 24 12 24C15.1826 24 18.2348 22.7357 20.4853 20.4853C22.7357 18.2348 24 15.1826 24 12C24 11.7348 23.8946 11.4804 23.7071 11.2929C23.5196 11.1054 23.2652 11 23 11Z",fill:"#49494F"}),(0,n.tT)("path",{d:"M9.72711 2.25897C11.2228 1.91397 12.7774 1.91397 14.2731 2.25897C14.348 2.27557 14.4244 2.28396 14.5011 2.28397C14.7458 2.28281 14.9816 2.19197 15.1638 2.02865C15.346 1.86534 15.462 1.64088 15.4899 1.39778C15.5177 1.15468 15.4554 0.909807 15.3149 0.70952C15.1743 0.509232 14.9652 0.367434 14.7271 0.31097C12.9326 -0.102029 11.0677 -0.102029 9.27311 0.31097C9.01478 0.371174 8.79096 0.53153 8.65087 0.756761C8.51078 0.981992 8.4659 1.25365 8.52611 1.51197C8.58631 1.77029 8.74667 1.99412 8.9719 2.1342C9.19713 2.27429 9.46879 2.31917 9.72711 2.25897V2.25897Z",fill:"#49494F"})),(0,n.tT)("defs",null,(0,n.tT)("clipPath",{id:"clip0"},(0,n.tT)("rect",{width:"24",height:"24",fill:"white"}))))}}},7013:(e,t,i)=>{"use strict";i.d(t,{H:()=>n});var s=i(1372);function n(){return(0,s.tT)("div",{style:{height:"1.2em",width:"1.2em",display:"inline-block",position:"relative"},colorClass:"followerStarSvg"},(0,s.tT)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"8 7 48 46"},(0,s.tT)("g",{transform:"translate(0,-952.36218)"},(0,s.tT)("path",{d:"M32,959.4l8,14.3l16,3.2L44.9,989l1.9,16.3L32,998.4l-14.8,6.9l1.9-16.3L8,976.9l16-3.2L32,959.4z"}))))}},2331:(e,t,i)=>{"use strict";i.d(t,{YI:()=>c,ZZ:()=>d,Zz:()=>h});var s=i(6784),n=i(2709),o=i(3955),r=i(9447),a=i(4873),l=i(1848);class h extends n.u{constructor(){super(),this.tabHandleStyle={position:"relative",padding:"5px",margin:"2px 0 0 2px",borderRadius:"4px 4px 0 0",minWidth:"16px",width:"auto",height:"100%",fontSize:"10px",cursor:"pointer",cssFloat:"left",textSizeAdjust:"none",WebkitTextSizeAdjust:"none",userSelect:"none"},this.tabHandleActiveStyle={cursor:"default"},(0,r.fZ)(this.element,"BaseTabsContainer"),this.tabHandlesRow=new l.m,this.tabHandlesRow.element.id="tab-row",this.tabHandlesRow.element.style.overflow="hidden",this.tabHandlesRow.element.style.width="100%",this.tabHandlesRow.element.style.borderRadius="2px 2px 0 0",super.addChild(this.tabHandlesRow),this.window=document.createElement("div"),this.window.style.width="100%",this.window.style.position="absolute",(0,r.fZ)(this.window,"window"),this.element.appendChild(this.window)}addFooter(e){this.element.appendChild(e)}getTabRow(){return this.tabHandlesRow}repositionChildren(){const e=this.element.clientHeight-this.tabHandlesRow.element.offsetHeight;this.window.style.height=`${e}px`}addChild(e){throw new Error("addChild not implemented")}addTab(e){return e.element.style.width="100%",e.element.style.height="100%",e.element.style.display="none",super.addChild(e,this.window),this.attachTabToDOM(e),e}attachTabToDOM(e){const t=e.constructTabHandle();return this.tabHandlesRow.addChild(t),e.adjustTab(),(0,r.fZ)(t,"tab"),(0,r.fZ)(t,r.aG.chatAreaTabColor),t}children(){return super.children().filter((e=>e instanceof d))}changeToTab(e){e!==this.currentTab&&(this.currentTab=e,e.setAsCurrentTab()),this.showCurrentTab()}changeToFirstTab(){this.changeToTab(this.children()[0])}getCurrentTab(){return this.currentTab}showCurrentTab(){const e=this.children();for(let t=e.length-1;t>=0;t-=1){const i=e[t];i!==this.currentTab?i.hideElement():this.currentTab.active||i.showElement()}this.repositionChildrenRecursive(),this.afterDOMConstructedIncludingChildren()}refreshTabs(){let e=!1;for(const t of this.children())e=t.adjustTab()||e;e&&this.tabHandlesRow.repositionChildrenRecursive()}getHandleStyle(e){return e.active?(0,r.fZ)(e.handle,"active"):((0,r.SA)(e.handle,"active"),e instanceof c&&(e.collapsed?(0,r.fZ)(e.handle,"collapsed"):(0,r.SA)(e.handle,"collapsed"))),{...this.tabHandleStyle,...e instanceof c&&e.collapsed?e.handleCollapseStyle:{},...e.active?this.tabHandleActiveStyle:{}}}}class d extends n.u{constructor(){super(),this.active=!1,this.isHandleHovered=!1,this.element.style.position="relative"}tabHandleClicked(e){this.changeToThisTab()}shouldHideTabHandle(){return!this.handle.isShown()}getTabHandleContent(){return[document.createTextNode(" ")]}getTabId(){return""}setAsCurrentTab(){}adjustTab(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.handle.element.textContent;if(!e){let e=document.createElement("span");null!==this.handle.element.firstChild&&(e=this.handle.element.firstChild,e.innerHTML="");for(const t of this.getTabHandleContent())e.appendChild(t);this.handle.element.appendChild(e)}this.adjustHandleStyle();const i="none"===this.handle.element.style.display;return this.shouldHideTabHandle()?this.handle.element.style.display="none":this.handle.element.style.display="inline-block",t!==this.handle.element.textContent||i!==("none"===this.handle.element.style.display)}constructTabHandle(){for(this.handle=this.constructTabHandleComponent(),(0,s.Xq)(["click","touchstart"],this.handle.element,(e=>{this.tabHandleClicked(e),this instanceof c&&this.collapsed&&(this.isHandleHovered=!1)}));null!==this.handle.element.firstChild;)this.handle.element.removeChild(this.handle.element.firstChild);const e=document.createElement("span");for(const t of this.getTabHandleContent())e.appendChild(t);return this.handle.element.appendChild(e),this.handle.element.id=this.getTabId(),this.handle.element.dataset.testid=this.getTabId(),this.adjustHandleStyle(),(0,o.JR)(this.handle).listen((e=>{this.isHandleHovered=e,this.adjustHandleStyle()})),this.handle}constructTabHandleComponent(){return new n.u(document.createElement("div"))}changeToThisTab(){void 0!==this.parent?this.parent.changeToTab(this):error("no parent")}isCurrentTab(){return void 0===this.parent?(error("no parent"),!1):this.parent.getCurrentTab()===this}refreshTabs(){void 0!==this.parent?this.parent.refreshTabs():error("no parent")}getHandleStyle(){return void 0!==this.parent?this.parent.getHandleStyle(this):{}}adjustHandleStyle(){(0,o.ZM)(this.handle,this.getHandleStyle())}hideElement(){super.hideElement(),this.active=!1,this.adjustHandleStyle()}showElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block";super.showElement(e),this.active=!0,this.adjustHandleStyle()}}class c extends d{constructor(){super(...arguments),this.handleCollapseStyle={display:"block",cssFloat:"none",padding:"9px 12px",margin:0,borderRadius:"",border:"none",boxSizing:"border-box",width:"100%",height:"auto"}}constructTabHandleComponent(){const e=new a.g2(document.createElement("div"));return e.onCollapseEvent.listen((e=>{this.collapsed=e,void 0!==this.onCollapse&&this.onCollapse(e),this.adjustTab()})),e}}},1679:(e,t,i)=>{"use strict";i.d(t,{p5:()=>E,HH:()=>V,Pt:()=>B,Gz:()=>F,sI:()=>U,di:()=>H,qr:()=>W,bv:()=>D,lc:()=>L,yL:()=>O,hw:()=>$});var s=i(7623),n=i(9461),o=i(6784),r=i(213),a=i(5216),l=i(2939),h=i(2032),d=i(2709),c=i(5020),u=i(8423),p=i(7407),m=i(5173),g=i(4947),v=i(5389),f=i(9447),y=i(3955),b=i(3124),w=i(2690),C=i(1474),S=i(9757);const x="TokenSourcePurchaseMedia";class T extends w.z{constructor(e,t){super(),(0,y.ZM)(this.element,{width:"100%",position:"fixed",minHeight:"250px",maxHeight:"100%",height:"unset",overflowY:"auto",transition:"bottom 500ms",zIndex:1006,bottom:"-400px",borderRadius:"8px 8px 0px 0px",backgroundColor:"#F8F9FA",touchAction:"none"}),(0,y.ZM)(this.overlay,{zIndex:1005,background:"rgba(0, 0, 0, 0.5)",touchAction:"none"}),this.content=document.createElement("div"),this.content.classList.add("oneclickflowMobile"),this.element.appendChild(this.content);const i=document.createElement("div");i.onclick=()=>this.hide();const s=e===x?{height:"14.6px",width:"14.6px",right:"25px",top:"20px"}:{height:"12.73px",width:"12.73px",right:"15px",top:"10px"};(0,y.ZM)(i,{display:"inline-block",cursor:"pointer",position:"absolute",...s});const n=t=>{const i=document.createElement("div");i.classList.add("oneclickflow__closeButtonSlash");const s=e===x?{width:"4.5px",height:"22px",left:"10px"}:{width:"3px",height:"15px",left:"5px"};return(0,y.ZM)(i,{position:"absolute",transform:t,...s}),i};i.appendChild(n("rotate(-135deg)")),i.appendChild(n("rotate(-45deg)")),this.element.appendChild(i),this.show(e,t)}show(e,t){this.orientationChangeListener=b.DQ.once((()=>{this.hide()}),!1);const i=S.c.get("OneClickFlow");this.oneClickFlowInstance=new i({source:null!=e?e:"",roomType:null!=t?t:"public",closeModal:()=>this.hide()},this.content),super.show(),void 0===e||e!==x||(0,b.K$)()?window.setTimeout((()=>{this.element.style.bottom="0"}),1):window.setTimeout((()=>{this.element.style.bottom="-60px"}),1)}hide(){var e;this.element.style.bottom="-400px",null===(e=this.orientationChangeListener)||void 0===e||e.removeListener(),window.setTimeout((()=>{var e;super.hide(),null===(e=this.oneClickFlowInstance)||void 0===e||e.dispose()}),1)}}class A extends w.z{constructor(e,t,i){var s,o;super(),this.isOpen=!1,this.tokenBalance=null!==(s=null===n.Bm||void 0===n.Bm||null===(o=n.Bm.current)||void 0===o||null===(o=o.loggedInUser)||void 0===o?void 0:o.tokenBalance)&&void 0!==s?s:0,this.outSideHandlerClick=e=>{e.target===this.element&&this.element.contains(e.target)||this.hide()},this.createCloseButton=()=>{const e=document.createElement("div");e.onclick=()=>this.hide(),(0,y.ZM)(e,{display:"inline-block",cursor:"pointer",position:"absolute",height:"12.73px",width:"12.73px",right:"15px",top:"10px"});const t=e=>{const t=document.createElement("div");return t.classList.add("oneclickflow__closeButtonSlash"),(0,y.ZM)(t,{position:"absolute",transform:e,width:"3px",height:"15px",left:"5px"}),t};return e.appendChild(t("rotate(-135deg)")),e.appendChild(t("rotate(-45deg)")),e},this.overrideBasedOnSource=e=>{var t,i;const s={TokenSourceUserInfoPanel:{top:"100px",right:"1%"}},n=null!=e&&s.hasOwnProperty(e)&&s[e],o=null!==(t=null===(i=document)||void 0===i||null===(i=i.body)||void 0===i||null===(i=i.getBoundingClientRect())||void 0===i?void 0:i.top)&&void 0!==t?t:0;!1!==n?(0,y.ZM)(this.element,{transform:"none",top:"unset",right:"unset",left:"unset",...n}):(0,y.ZM)(this.element,{left:"unset",top:`calc(50% - ${o}px)`,right:"50%",transform:"translate(50%, -50%)"})},this.applyDarkModeStyles=()=>{const e=document.body.classList.contains("darkmode");(0,y.ZM)(this.element,{backgroundColor:e?"#202c39":"#F8F9FA",boxShadow:e?"0 0 12px rgba(0,0,0,0.8)":"0px 3px 10px 0px rgba(0, 0, 0, 0.10)",border:"1px solid "+(e?"#17202a":"#ACACAC")})},(0,y.ZM)(this.element,{width:"313px",position:"absolute",minHeight:"218px",height:"unset",overflowY:"auto",zIndex:1006,borderRadius:"8px"}),this.content=document.createElement("div"),this.content.classList.add("oneclickflowDesktop"),this.element.appendChild(this.content);const r=this.createCloseButton();this.element.appendChild(r),this.show(e,t,i),C.D.listen((e=>{var t,i;this.tokenBalance=null!==(t=null==e?void 0:e.tokens)&&void 0!==t?t:0,void 0!==this.oneClickFlowInstance&&(null===(i=this.oneClickFlowInstance)||void 0===i||i.update({tokenBalance:this.tokenBalance}))}))}overrideBasedOnTarget(e){const t=window.innerWidth-(e.x+e.width)<323,i=window.innerHeight-(e.y+e.height)+window.scrollY<230;(0,y.ZM)(this.element,{right:"unset",transform:"unset",top:i?`${window.innerHeight-220-10+window.scrollY}px`:`${e.y}px`,left:t?window.innerWidth-313-10+"px":`${e.right}px`})}applyPositionOverrides(e,t){const i=void 0!==e?(0,y.$R)(e):void 0;i?this.overrideBasedOnTarget(i):this.overrideBasedOnSource(t)}show(e,t,i){if(this.isOpen)return void this.hide();this.isOpen=!0,this.applyDarkModeStyles(),this.applyPositionOverrides(i,e);const s=S.c.get("OneClickFlow");this.oneClickFlowInstance=new s({source:null!=e?e:"",roomType:null!=t?t:"public",closeModal:()=>this.hide(),desktop:!0,tokenBalance:this.tokenBalance},this.content),super.show(),(0,y.ZM)(this.overlay,{display:"none"}),window.setTimeout((()=>(0,o.wu)("click",document,this.outSideHandlerClick)),10)}hide(){var e;super.hide(),null===(e=this.oneClickFlowInstance)||void 0===e||e.dispose(),this.oneClickFlowInstance=void 0,(0,o.Pf)("click",document,this.outSideHandlerClick),this.isOpen=!1}}var P=i(897),k=i(9603);const M=16;class R extends d.u{constructor(e){super(),this.data=e,this.disabled=!1,this.onClick=e=>{this.disabled?void 0!==this.disabledMouseClick&&this.disabledMouseClick(e):this.enabledMouseClick(e)},this.onTouch=e=>{this.disabled&&(e.preventDefault(),void 0!==this.data.disabledModalText?(0,r.mf)(this.data.disabledModalText,(()=>{void 0!==this.disabledMouseClick&&this.disabledMouseClick(e)})):void 0!==this.disabledMouseClick&&this.disabledMouseClick(e))},this.showTooltip=()=>{void 0!==this.disabledTooltip&&(this.disabledTooltip.style.display="block")},this.hideTooltip=()=>{void 0!==this.disabledTooltip&&(this.disabledTooltip.style.display="none")},this.element.removeAttribute("id"),(0,f.fZ)(this.element,"menuItem"),this.element.style.padding="9px 0",this.element.style.cursor="pointer",this.element.style.boxSizing="border-box",this.element.style.position="relative",this.element.style.overflow="visible",this.element.style.borderWidth="1px",this.element.style.borderStyle="solid",void 0!==e.disabledTooltip&&(this.disabledTooltip=e.disabledTooltip,this.disabledTooltip.style.top="57px",this.element.appendChild(e.disabledTooltip)),this.dt=document.createElement("dt"),this.dt.style.margin="0",this.dt.style.padding="0 8px 5px 28px",this.dt.style.backgroundSize="14px 14px",this.dt.innerText=e.label,e.label===g.R.anonTippingText&&(this.dt.dataset.testid="anon-tip-option"),this.element.appendChild(this.dt);const t=e.description;void 0!==t&&t.length>0&&(this.dd=document.createElement("dd"),this.dd.style.margin="0",this.dd.style.padding="0 8px 0 28px",this.dd.innerText=t,this.element.appendChild(this.dd));const i=R.createItemId("ButtonMenuItem");this.input=document.createElement("input"),this.input.id=i,this.input.name=i,this.input.type="radio",this.input.style.cursor="pointer",this.input.style.position="absolute",this.input.style.opacity="0",this.input.style.width="0",this.input.style.height="0",this.element.appendChild(this.input),void 0!==e.disabledMouseClick&&(this.disabledMouseClick=e.disabledMouseClick),(0,o.wu)("mouseenter",this.element,(()=>{this.disabled&&void 0!==this.disabledTooltip&&this.showTooltip()})),(0,o.wu)("mouseleave",this.element,(()=>{this.disabled&&void 0!==this.disabledTooltip&&this.hideTooltip()})),this.enabledMouseClick=e.enabledMouseClick,(0,o.wu)("click",this.element,this.onClick),(0,o.wu)("touchstart",this.element,this.onTouch),(0,o.wu)("focus",this.input,(()=>{this.element.style.outline="2px solid Highlight"})),(0,o.wu)("blur",this.input,(()=>{this.element.style.removeProperty("outline")}))}select(){(0,f.fZ)(this.dt,"selected")}deselect(){(0,f.SA)(this.dt,"selected")}getValue(){return this.data.value}getButtonLabel(){const e=this.data.buttonLabel;return void 0===e?this.data.label:e}disable(){this.disabled||(this.disabled=!0,(0,f.fZ)(this.element,"disabled"))}enable(){this.disabled&&(this.disabled=!1,(0,f.SA)(this.element,"disabled"))}static createItemId(e){return R.lastId+=1,e+R.lastId.toString()}}R.lastId=0;class I extends m.Q{constructor(e,t){super(),this.width=280,this.visible=!1,this.visibilityChange=new u.c_("visibilityChange"),this.selectionChange=new u.c_("selectionChange");const i=[],s=e.length;0===s&&error("ButtonMenu requires at least one option!"),(0,f.fZ)(this.element,"menu"),this.element.style.padding="0",this.element.style.display="none",this.element.style.width=`${this.width}px`,this.element.style.textAlign="left",this.element.style.fontSize="14px",this.element.style.lineHeight="14px",this.element.style.borderRadius="4px",this.overlay.style.zIndex="1002",this.element.style.zIndex="1003",this.element.style.overflow="visible",this.element.style.removeProperty("height");let n=-1;const r=s-1;for(let a=0;a{e.stopPropagation(),this.onItemClick(l)};const l=this.createMenuItem(s),h=e=>(e.preventDefault(),e.stopPropagation(),l.onClick(e),!1);(0,o.wu)("keyup",l.input,(e=>32!==e.keyCode||h(e))),(0,o.wu)("keydown",l.input,(e=>13!==e.keyCode||h(e))),0===a&&(l.element.style.borderTopWidth="1px",l.element.style.borderTopLeftRadius="2px",l.element.style.borderTopRightRadius="2px"),a===r&&(l.element.style.borderBottomLeftRadius="2px",l.element.style.borderBottomRightRadius="2px"),this.addChild(l),i.push(l.input)}const a=this.children();n=-1===n?0:n,this.selectedItem=a[n],this.focusElements=i,this.selectionChange.listen((e=>{this.onSelectionChange(e)})),this.overlayClick.listen((()=>{this.hide()}))}getValue(){return this.selectedItem.getValue()}getButtonLabel(){return this.selectedItem.getButtonLabel()}isVisible(){return this.visible}show(e){this.isVisible()||(this.visibilityChange.fire(!0),this.element.style.display="inline-block",this.element.style.top=`${e.top}px`,this.element.style.left=`${e.left}px`,this.showOverlay(),this.visible=!0,this.repositionChildrenRecursive())}hide(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isVisible()&&(e||this.visibilityChange.fire(!1),this.visible=!1,this.element.style.display="none",this.hideOverlay())}toggle(e){this.isVisible()?this.hide():this.show(e)}disableItem(e){const t=this.children();e{if(this.isAnonymousEnabled()){const t=e.current.getValue();this.changeTipType(t),this.submitButton.focus()}})),(0,o.wu)("mouseenter",this.submitButton,(e=>{this.submitButton.style.textDecoration="underline"})),(0,o.wu)("mouseleave",this.submitButton,(e=>{this.submitButton.style.textDecoration="none"})),(0,o.wu)("click",this.dropDownButton,(e=>(e.preventDefault(),e.stopPropagation(),this.dropDownMenu.toggle(this.getMenuOffsets()),!1))),this.dropDownMenu.visibilityChange.listen((e=>{e||this.submitButton.focus()})),this.focusElements=[this.submitButton,this.dropDownButton],l.X0.listen((e=>{e.dossier.allowAnonymousTipping?this.enableAnonymousTips():this.disableAnonymousTips()}))}getOffsetWidth(){return this.element.offsetWidth}hideMenu(){this.dropDownMenu.hide(!0)}promptUser(e){this.submitButton.innerHTML=`${e} ▸`,this.submitButton.title=e,this.disableMenu()}cancelPrompt(){this.resetText(),this.enableMenu()}resetText(){this.submitButton.innerText=this.dropDownMenu.getButtonLabel(),this.submitButton.title=this.dropDownMenu.getButtonLabel()}isAnonymousEnabled(){return this.anonymousEnabled}isEnabled(){return this.enabled}disable(){this.isEnabled()&&(this.enabled=!1,this.dropDownMenu.hide(),this.submitButton.disabled=!0,(0,f.fZ)(this.submitButton,"disabled"),this.dropDownButton.disabled=!0,(0,f.fZ)(this.dropDownButton,"disabled"))}enable(){this.isEnabled()||(this.enabled=!0,this.submitButton.disabled=!1,(0,f.SA)(this.submitButton,"disabled"),this.dropDownButton.disabled=!1,(0,f.SA)(this.dropDownButton,"disabled"))}getTipType(){return this.tipType}hasFocus(){return this.getCurrentFocusData().index>-1}focusPrev(){const e=this.getCurrentFocusData(),t=e.elements.length;if(e.index-=1,-2===e.index)e.index=t-1;else if(-1===e.index)return!1;return this.focusElement(e),!0}focusPrevMenuItem(){if(!this.menuEnabled||!this.dropDownMenu.isVisible())return!1;const e=this.getCurrentFocusData(),t=e.elements.length;return e.index-=1,e.index<=t-this.dropDownMenu.focusElements.length-1&&(e.index=t-1),this.focusElement(e),!0}focusNext(){const e=this.getCurrentFocusData(),t=e.elements.length;return e.index+=1,!(e.index>=t||(this.focusElement(e),0))}focusNextMenuItem(){if(!this.menuEnabled||!this.dropDownMenu.isVisible())return!1;const e=this.getCurrentFocusData(),t=e.elements.length;return e.index+=1,(e.index>=t||e.index<=t-this.dropDownMenu.focusElements.length-1)&&(e.index=t-this.dropDownMenu.focusElements.length),this.focusElement(e),!0}focusElement(e){const t=e.index;e.elements[t].focus()}getCurrentFocusData(){let e=this.focusElements;return this.menuEnabled&&this.dropDownMenu.isVisible()&&(e=this.focusElements.concat(this.dropDownMenu.focusElements)),{elements:e,index:e.indexOf(document.activeElement)}}getMenuOffsets(){const e=this.element,t=(0,h.w_)(this.submitButton),i=e.offsetLeft+e.offsetWidth+1-this.dropDownMenu.width;return{top:t.height+2*t.top,left:i}}enableAnonymousTips(){const e=this.dropDownMenu.getValue();this.anonymousEnabled=!0,this.dropDownMenu.enableItem(1),this.changeTipType(e)}disableAnonymousTips(){this.anonymousEnabled=!1,this.dropDownMenu.disableItem(1),this.changeTipType("public")}enableMenu(){this.menuEnabled||(this.menuEnabled=!0,this.submitButton.style.borderRadius="4px 0 0 4px",this.dropDownButton.style.display="inline-block",this.focusElements=[this.submitButton,this.dropDownButton],this.repositionChildrenRecursive())}disableMenu(){this.menuEnabled&&(this.hasFocus()&&this.submitButton.focus(),this.menuEnabled=!1,this.dropDownMenu.hide(),this.submitButton.style.borderRadius="4px",this.dropDownButton.style.display="none",this.focusElements=[this.submitButton])}changeTipType(e){this.tipType=e,this.tipTypeChange.fire(e),this.resetText()}styleButtonMenuItem(e){e.dt.style.fontFamily="'UbuntuMedium', Helvetica, Arial, sans-serif",void 0!==e.dd&&(e.dd.style.fontFamily="'UbuntuRegular', Helvetica, Arial, sans-serif")}createCommonButton(){const e=document.createElement("button");return(0,f.fZ)(e,"buttons"),e.style.position="relative",e.style.display="inline-block",e.style.cursor="pointer",e.style.fontSize="14px",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.height="auto",e.style.verticalAlign="top",e.style.margin="0",(0,o.wu)("focus",e,(()=>{e.style.zIndex="100"})),(0,o.wu)("blur",e,(()=>{e.style.zIndex="auto"})),e}createSubmitButton(){const e=this.createCommonButton();return e.type="submit",e.title=g.R.sendTipButtonText,e.style.padding="6px 18px",e.style.borderRadius="4px 0 0 4px",e.style.borderRight="0 none transparent",e.style.overflow="hidden",e.style.textOverflow="ellipsis",e}createDropDownMenu(){const e=this.createCommonButton();return e.style.padding="6px 0",e.style.borderRadius="0 4px 4px 0",e.style.width="24px",e}}function L(e,t){window.setTimeout((()=>{if(t.isAnonymousEnabled()){const i=t.getTipType();(0,p.bT)("SendTipViewed",{source:e,tipType:i,localStorage:(0,s.Pf)()})}}),0)}E.menuItemsData=[{label:g.R.publicTippingText,value:"public",description:g.R.publicTippingDesc,buttonLabel:g.R.sendTipButtonText,enabledMouseClick:()=>{}},{label:g.R.anonTippingText,value:"anonymous",description:g.R.anonTippingDesc,buttonLabel:g.R.anonButtonText,enabledMouseClick:()=>{},disabledMouseClick:e=>{(0,p.bT)("SupporterPageOpened",{source:"anon_tip"}),null!==window.top&&(window.top.location.href=(0,a._Y)(`/supporter/upgrade/?source=${n.Bm.current.PurchaseEventSources.SUPPORTER_SOURCE_ANON_TIP_UPSELL}`))},disabledTooltip:(0,k.q)({content:g.R.mustBeSupporterFeature,hasHTML:!1,width:240,divotPosition:c.Wi.Top,divotLeftOrTop:"40px"}),disabledModalText:`${g.R.mustBeSupporterFeature} ${g.R.anonTipDisabledModalCont}`}];const D="/tipping/purchase_tokens/";function B(e){const t=e.value.replace(/[^\d]+/g,"").substring(0,M);e.value!==t&&(e.value="",e.value=t)}function U(e){return null===e.match(/[^\d]/)&&parseInt(e)>0}function F(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"tipAmountInput";const t=document.createElement("input");return(0,f.fZ)(t,e),t.dataset.testid="tip-amount-input",t.type="tel",t.autocomplete="off",t.value="25",(0,o.wu)("beforeinput",t,(e=>{null!==e.data&&(!isNaN(parseInt(e.data))&&t.value.lengthB(t))),t}let _,N=!1;const O=()=>{var e,t,i;if(null===n.Bm||void 0===n.Bm||null===(e=n.Bm.current)||void 0===e||!e.loggedInUser||null===(t=n.Bm.current)||void 0===t||null===(t=t.loggedInUser)||void 0===t||!t.userUid)return;N=n.Bm.current.loggedInUser.canWegOneClick;const s=null===(i=n.Bm.current)||void 0===i||null===(i=i.loggedInUser)||void 0===i?void 0:i.userUid;new P.bb(s).onMessage.listen((e=>{N=e.is_one_click_eligible}))};function H(){var e;let{popupOnly:t=!1,source:i,roomType:s,target:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(e){let t,{source:i}=e;const s=void 0===n.Bm.current.loggedInUser;return""===window.location.search?(t=D,null!=i&&""!==i?(t+=`?source=${i}`,s&&(t+="&refresh_opener=1")):s&&(t+="?refresh_opener=1")):(t=`${D}${window.location.search}`,null!=i&&""!==i&&(t+=`&source=${i}`),s&&(t+="&refresh_opener=1")),t}({source:i});null!==(e=N)&&void 0!==e&&e?n.Bm.current.isMobile?_?_.show(null!=i?i:"",s):_=new T(null!=i?i:"",s):_?_.show(null!=i?i:"",s,o):_=new A(null!=i?i:"",s,o):(0,v.gr)(r,"_blank","height=615, width=850, scrollbars=1")}function W(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;(0,r.mf)(e,(()=>{H({popupOnly:t,source:i,roomType:s})}),void 0,{acceptText:g.R.purchaseTokensText})}function $(e){const t=document.querySelectorAll(".tokencount[updatable-count]");for(const i of t)i.textContent=`${e}`}function V(e){e.onclick=t=>{if(e.classList.contains("welcome-page-purchase-tokens")&&(0,p.bT)("WelcomePagePurchaseTokensClicked"),!t.ctrlKey&&!t.metaKey){const i=function(e){const t=e.dataset.purchaseEventSource;if(null!=t&&""!==t)return Object.values(n.Bm.current.PurchaseEventSources).includes(t)?Object.values(n.Bm.current.PurchaseEventSources).find((e=>e===t)):void 0}(e);t.preventDefault(),H({popupOnly:t.target.className.includes("popup_only"),source:i})}},""===e.href&&(e.href=(0,a._Y)(D))}},9603:(e,t,i)=>{"use strict";i.d(t,{q:()=>o});var s=i(5020),n=i(9447);function o(e){const t=document.createElement("div");(0,n.fZ)(t,"tooltip"),e.hasHTML?t.innerHTML=e.content:t.textContent=e.content,void 0!==e.width&&(t.style.width="number"==typeof e.width?`${e.width}px`:e.width),t.style.borderWidth="1px",t.style.position="absolute",t.style.borderStyle="solid",t.style.borderRadius="4px",t.style.fontSize="14px",t.style.padding="8px",t.style.display="none",t.style.zIndex="5";const i=(0,s.Hq)(e.divotPosition,e.divotLeftOrTop,e.borderWidth);return void 0!==i&&t.appendChild(i),t}},520:(e,t,i)=>{"use strict";i.d(t,{s:()=>n});var s=i(6909);class n extends s.B{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];super({},e,t),this.toggleElement=e,this.alignRight=t}}},6909:(e,t,i)=>{"use strict";i.d(t,{B:()=>l,g:()=>h});var s=i(7063),n=i(2709),o=i(3955),r=i(2997),a=i(369);class l extends r.ij{constructor(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(e,t,!1),this.toggleElement=t,this.alignRight=i,this.topMargin=4,this.toggleStylesToKeep=["color","background-color","text-decoration"],this.initAddChildren(),this.resizeDebounceListener=a.oO.listen((()=>{this.isShown()&&this.reposition()})),document.body.appendChild(this.element),this.hideElement()}initAddChildren(){this.connectedOverlay=new h,this.addChild(this.connectedOverlay)}showElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block",t=arguments.length>1?arguments[1]:void 0;return!!super.showElement(e,t)&&(this.toggleElement.classList.add("active"),this.reposition(),!0)}hideElement(e){return!!super.hideElement(e)&&(this.toggleElement.classList.remove("active"),!0)}reposition(){const e=(0,o.$R)(this.toggleElement),t=this.alignRight||e.left+this.element.offsetWidth>document.documentElement.clientWidth&&e.right-this.element.offsetWidth>0;this.setDropDownStyleFromToggle(t);const i=(0,o.Lx)(getComputedStyle(this.element).borderBottomWidth)-(0,o.Lx)(getComputedStyle(this.toggleElement).borderLeftWidth);this.setDropDownPosition(e,i,t),this.connectedOverlay.positionAndStyle(this.toggleElement,this,i,t),this.element.style.zIndex=getComputedStyle(this.connectedOverlay.element).zIndex}dispose(){super.dispose(),this.element.remove(),this.resizeDebounceListener.removeListener()}setBorderRadius(e,t){""!==t&&(this.element.style.borderRadius=`${e?`${t} 0`:`0 ${t}`} ${t} ${t}`)}setDropDownStyleFromToggle(e){this.element.style.position="absolute",this.element.style.backgroundColor=(0,o.gK)(this.toggleElement),"0px"!==this.getToggleStyle(e?"borderRightWidth":"borderLeftWidth")&&(this.element.style.borderWidth=this.getToggleStyle(e?"borderRightWidth":"borderLeftWidth"),this.element.style.borderStyle=this.getToggleStyle(e?"borderRightStyle":"borderLeftStyle"),this.element.style.borderColor=this.getToggleStyle(e?"borderRightColor":"borderLeftColor"));const t=this.getToggleStyle(e?"borderTopRightRadius":"borderTopLeftRadius");this.setBorderRadius(e,t)}setDropDownPosition(e,t,i){if(this.element.style.top=`${e.bottom+this.topMargin}px`,i){this.element.style.left="";const i=document.documentElement.clientWidth-e.right-t;this.element.style.right=`${i}px`,this.element.style.right=i-c(this.toggleElement,this.element)-t+"px"}else{this.element.style.right="";const i=e.left-t;this.element.style.left=`${i}px`,this.element.style.left=i+d(this.toggleElement,this.element)-t+"px"}}getToggleStyle(e){const t=getComputedStyle(this.toggleElement);return(0,s.zm)(this.toggleElement.style[e],t[e])}}class h extends n.u{constructor(){super(),(0,o.ZM)(this.element,{position:"absolute",zIndex:4})}positionAndStyle(e,t,i,n){const r=getComputedStyle(t.element);this.element.style.borderLeftWidth=r.borderLeftWidth,this.element.style.borderLeftStyle=r.borderLeftStyle,this.element.style.borderLeftColor=r.borderLeftColor,this.element.style.borderRightWidth=r.borderLeftWidth,this.element.style.borderRightStyle=r.borderLeftStyle,this.element.style.borderRightColor=r.borderLeftColor;const a=(0,o.Lx)(getComputedStyle(e).width)+2*i;this.element.style.width=`${a}px`;const l=t.element.offsetTop-(0,o.$R)(e).bottom+1;this.element.style.height=`${l+2}px`,this.element.style.top=`-${l+2}px`,this.element.style.backgroundColor=r.backgroundColor;const h=(0,s.zm)(r.borderWidth,r.borderLeftWidth);this.element.style.right=n?`-${h}`:"",this.element.style.left=n?"":`-${h}`,this.element.style.zIndex=(0,s.zm)(r.zIndex,this.element.style.zIndex),this.element.style.width=n?`${a-d(e,this.element)+i}px`:`${a+c(e,this.element)+i}px`}}function d(e,t){return e.getBoundingClientRect().left-t.getBoundingClientRect().left}function c(e,t){return e.getBoundingClientRect().right-t.getBoundingClientRect().right}},1848:(e,t,i)=>{"use strict";i.d(t,{m:()=>n});var s=i(2709);class n extends s.u{constructor(e){super("div"),this.element.style.height="",this.element.style.width="",this.element.style.position="relative",void 0!==e&&(e instanceof s.u?this.addChild(e):this.element.appendChild(e))}}},4035:(e,t,i)=>{"use strict";i.d(t,{I:()=>n,w:()=>o});var s=i(1519);const n=new(i(8423).c_)("cssVhVarUpdate",{reportIfNoListeners:!1});function o(){var e;r();const t=new s.a(r,{bounceLimitMS:100,debounceType:1});null===(e=window.visualViewport)||void 0===e||e.addEventListener("resize",(()=>t.callFunc())),window.setInterval((()=>t.callFunc()),500)}function r(){var e,t;const i=document.documentElement.style.getPropertyValue("--vh"),s=.01*(null!==(e=null===(t=window.visualViewport)||void 0===t?void 0:t.height)&&void 0!==e?e:window.innerHeight)+"px";s!==i&&(document.documentElement.style.setProperty("--vh",s),n.fire())}},6615:(e,t,i)=>{"use strict";i.d(t,{T:()=>h});var s,n=i(6624),o=i(7063),r=i(5216),a=i(7882),l=i(2945);class h extends n.UrlStateBase{static get current(){return h.instance}constructor(){super(),this.listeners=new Map,this.recentlyAddedListeners=new Map,addEventListener("popstate",(()=>{this.onHistoryChange(new URL(window.location.href))})),this.onHistoryChange(new URL(window.location.href)),this.startGarbageCollectionOnDetachedElements()}moveRecentListenersToMainListeners(){for(const[t,i]of this.recentlyAddedListeners){var e;this.listeners.has(t)||this.listeners.set(t,[]),null===(e=this.listeners.get(t))||void 0===e||e.push(...i),this.recentlyAddedListeners.set(t,[])}}startGarbageCollectionOnDetachedElements(){window.setInterval((()=>{for(const[e,t]of this.listeners)this.cleanupDetachedListeners(e);this.moveRecentListenersToMainListeners()}),1e4)}syncStateWithCurrentUrl(){const e=new URL(window.location.href);h.current.onHistoryChange(e)}replaceUrl(e){const t=new URL(e.toString(),window.location.href);window.history.replaceState(void 0,"",t.toString()),h.current.onHistoryChange(t)}pushUrl(e,t){const i=new URL(e.toString(),window.location.href);i.toString()!==window.location.href&&window.history.pushState(t,"",i.toString()),h.current.onHistoryChange(i)}replaceUrlParams(e){const t=(0,l.U1)(e);if(t!==document.location.search){const e=(0,r._Y)((0,o.zm)(t,window.location.pathname));window.history.replaceState("","",e),h.current.onHistoryChange(new URL(window.location.href))}}pushUrlParams(e,t){const i=(0,l.U1)(e);if(i!==window.location.search){const e=(0,r._Y)((0,o.zm)(i,window.location.pathname));window.history.pushState(t,"",e),h.current.onHistoryChange(new URL(window.location.href))}}navigateTo(e){h.current.pushUrl(e),window.scrollTo(0,0)}convertStateToUrl(e){const t={...e};return`${window.location.origin}/${this.applyUrlPathFromState(t)}${this.getUrlParamsFromState(t)}`}applyUrlPathFromState(e){var t,i,s,o,r,a;const l=null!==(t=null!==(i=null!==(s=this.getAppPath(e))&&void 0!==s?s:this.getShowTypePath(e))&&void 0!==i?i:this.getTagPath(e))&&void 0!==t?t:(0,n.isHomepageFiltersActive)()?"":null!==(o=null!==(r=null!==(a=this.getRegionPath(e))&&void 0!==a?a:this.getAgePath(e))&&void 0!==r?r:this.getPrivatePricePath(e))&&void 0!==o?o:"";return this.appendGenderPath(l,e)}appendGenderPath(e,t){if(void 0!==t.genders&&1===t.genders.length&&t.showType!==n.ShowType.FOLLOW_OFFLINE){const i=(0,a.tg)(t.genders[0]),s=a.hf.get(t.genders[0]);if(""===i)return e;""===e?e=`${i}/`:void 0!==s&&(e+=`${s}/`)}return e}getUrlParamsFromState(e){const t=new URLSearchParams;if(void 0!==e.regions&&e.regions.length>0&&t.set("regions",[...e.regions].sort().join(",")),void 0!==e.ageMin||void 0!==e.ageMax){var i,s;let o=`${null!==(i=e.ageMin)&&void 0!==i?i:n.DEFAULT_MIN_AGE}-${null!==(s=e.ageMax)&&void 0!==s?s:n.DEFAULT_MAX_AGE}`;o!==`${n.DEFAULT_MIN_AGE}-${n.DEFAULT_MAX_AGE}`&&void 0!==e.ageMax&&(o=`${e.ageMin}-${e.ageMax-1}`,t.set("ages",o))}void 0!==e.privatePrices&&e.privatePrices.length>0&&t.set("private_prices",e.privatePrices.join(",")),void 0!==e.roomSize&&t.set("room_size",e.roomSize),void 0!==e.spokenLanguages&&t.set("spoken_languages",e.spokenLanguages.join(",")),void 0!==e.genders&&e.genders.length>1&&t.set("gender",e.genders.join(",")),void 0!==e.keywords&&t.set("keywords",e.keywords),void 0!==e.page&&e.page>1&&t.set("page",String(e.page)),void 0!==e.pageb&&e.pageb>1&&t.set("pageb",String(e.pageb)),t.sort();const o=t.toString();return o.length>0?`?${o}`:""}getURLForPartialState(e){const t={...this.state,...e};return this.convertStateToUrl(t)}getURLFromPartialURL(e){const t=new URL(e),i=this.readStateFromURL(t);return this.convertStateToUrl({...this.state,...i})}setPartialState(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i={...this.state,...e};this.setState(i,t)}clearStateKeys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i={...this.state};e.forEach((e=>{delete i[e]})),this.setState(i,t)}onHistoryChange(e){const t={...this.state};this.state=this.readStateFromURL(e),this.fireChangeListeners({...this.state},t)}setState(e,t){const i=this.convertStateToUrl(e);!0===t?h.current.replaceUrl(i):h.current.pushUrl(i),JSON.stringify(this.state)!==JSON.stringify(e)&&warn("URLState set result in mismatch between state and url.",{"curr state":this.state,"new state":e,url:i})}listen(e,t,i){this.listenHelper(e,t,i)}listenGlobal(e,t){this.listenHelper(e,t,document.body)}listenHelper(e,t,i){const s=0===e.length?[""]:e;for(const e of s){var n;this.recentlyAddedListeners.has(e)||this.recentlyAddedListeners.set(e,[]),null===(n=this.recentlyAddedListeners.get(e))||void 0===n||n.push([t,i])}}fireListenersByMap(e,t,i,s){var n;const o=e.map((e=>{var t;return null!==(t=s.get(e))&&void 0!==t?t:[]})).flat(),r=null!==(n=s.get(""))&&void 0!==n?n:[];o.push(...r);const a=new Map(o);for(const[e,s]of a.entries())s.isConnected&&e.call(s,t,i)}fireChangeListeners(e,t){const i=new Set([...Object.keys(e),...Object.keys(t)]),s=Array.from(i.keys()).filter((i=>JSON.stringify(e[i])!==JSON.stringify(t[i])));this.fireListenersByMap(s,e,t,this.listeners),this.fireListenersByMap(s,e,t,this.recentlyAddedListeners)}cleanupDetachedListeners(e){var t,i,s;const n=null!==(t=this.listeners.get(e))&&void 0!==t?t:[];let o=n.length-1;for(;o>=0;)n[o][1].isConnected||n.splice(o,1),o-=1;(null!==(i=null===(s=this.listeners.get(e))||void 0===s?void 0:s.length)&&void 0!==i?i:0)>300&&warn(`URLState has too many listeners for key ${e}`)}getAppPath(e){if(void 0!==e.apps){const t=`current_app_use/${e.apps[0]}/`;return e.apps=e.apps.slice(1),t}if(void 0!==e.aspApp){const t=`app/${e.aspApp}/`;return e.aspApp=void 0,t}}getShowTypePath(e){if(void 0!==e.showType){const t=`${n.CamTypeKeyToCategory.get(e.showType)}/`;return e.showType=void 0,t}}getTagPath(e){if(void 0!==e.tags&&e.tags.length>0){const t=`tag/${e.tags[0]}/`;return e.tags=e.tags.slice(1),t}}getRegionPath(e){if(void 0!==e.regions&&1===e.regions.length){const t=`${n.RegionKeyToCategory.get(e.regions[0])}/`;return e.regions=e.regions.slice(1),t}}getAgePath(e){if(void 0!==e.ageMin&&void 0!==e.ageMax)for(const[t,i]of n.AgeCategoryToFilterRange.entries())if(i[0]===e.ageMin&&i[1]===e.ageMax)return e.ageMin=void 0,e.ageMax=void 0,`${t}/`}getPrivatePricePath(e){if(void 0!==e.privatePrices&&e.privatePrices.length>0)for(const[t,i]of n.PrivatePriceCategoryToFilterValues.entries())if(i===e.privatePrices[0])return e.privatePrices=e.privatePrices.slice(1),`${t}/`}}(s=h).instance=new s},3955:(e,t,i)=>{"use strict";i.d(t,{$R:()=>d,EF:()=>r,JR:()=>p,Lx:()=>c,Mo:()=>A,Mx:()=>C,Q:()=>u,XJ:()=>g,YG:()=>S,ZM:()=>a,_W:()=>l,aN:()=>x,eh:()=>b,gK:()=>h,jl:()=>y,q_:()=>f,ss:()=>T}),i(7063);var s=i(6784),n=i(2709),o=i(8423);function r(e,t){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect();return!(i.rights.right||i.bottoms.bottom)}function a(e,t){let i;i=e instanceof n.u?e.element:e;let s=t;t instanceof Function&&(s=t(e));for(const e of Object.keys(s))i.style[e]=t[e]}function l(e){(0,s.wu)("mouseenter",e,(()=>{e.style.textDecoration="underline"})),(0,s.wu)("mouseleave",e,(()=>{e.style.textDecoration=""}))}function h(e){const t="rgba(0, 0, 0, 0)";if(null===e)return t;const i=getComputedStyle(e).backgroundColor;return""===i||i===t||"transparent"===i?h(e.parentElement):i}function d(e){function t(e,t,i){return 0===e?0===t?void 0===i?0:i:t:e}const i=e.getBoundingClientRect(),s=document.body,n=document.documentElement,o=t(window.pageYOffset,n.scrollTop,s.scrollTop),r=t(window.pageXOffset,n.scrollLeft,s.scrollLeft),a=t(n.clientTop,s.clientTop),l=t(n.clientLeft,s.clientLeft),h=i.top+o-a,d=i.left+r-l;return new DOMRect(d,h,i.width,i.height)}function c(e){if(null===e)return 0;try{const t=parseFloat(e.substring(0,e.indexOf("px")));return isNaN(t)?0:t}catch(e){return 0}}function u(e){const t=getComputedStyle(e),i=c(t.paddingLeft)+c(t.paddingRight),s=c(t.borderLeftWidth)+c(t.borderRightWidth);return e.getBoundingClientRect().width-i-s}function p(e,t){const i=new o.c_("hover"),r=e instanceof n.u?e.element:e;return!0===(null==t?void 0:t.handleTouch)&&!0===(null==t?void 0:t.ignoreTouch)&&error("handleTouch and ignoreTouch cannot both be true"),(0,s.wu)("pointerenter",r,(e=>{!0===(null==t?void 0:t.ignoreTouch)?"mouse"===e.pointerType&&i.fire(!0):i.fire(!0)})),(0,s.wu)("pointerleave",r,(()=>{i.fire(!1)})),!0===(null==t?void 0:t.handleTouch)&&((0,s.wu)("click",r,(()=>{i.fire(!0)})),(0,s.wu)("touchstart",document,(()=>{i.fire(!1)})),(0,s.wu)("touchmove",document,(()=>{i.fire(!1)})),(0,s.wu)("touchend",document,(()=>{i.fire(!1)}))),i}let m;function g(){if(void 0!==m)return m;const e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);const t=e.offsetWidth;e.style.overflow="scroll";const i=document.createElement("div");i.style.width="100%",e.appendChild(i);const s=i.offsetWidth;return document.body.removeChild(e),m=t-s,m}const v=document.createElement("canvas");function f(e,t){const i=v.getContext("2d");return null!==i?(i.font=getComputedStyle(t).font,i.measureText(e).width):0}function y(e,t){const i=v.getContext("2d");return null!==i?(i.font=t,i.measureText(e).width):0}function b(e,t){return i=>{if("Tab"===i.key){let s;i.preventDefault(),s=i.shiftKey?t instanceof HTMLElement?t:t():e instanceof HTMLElement?e:e(),void 0!==s&&(s.focus(),i.stopPropagation())}}}let w;function C(){void 0===w&&(w=document.createElement("div"),a(w,{position:"fixed",top:"0px",left:"0px"}),document.body.appendChild(w));const e=w.getBoundingClientRect();return{top:e.top,left:e.left}}function S(e){const t=e.getBoundingClientRect();return"none"!==e.style.display&&Math.round(t.top)>=0&&Math.round(t.left)>=0&&Math.round(t.bottom)<=(window.innerHeight||document.documentElement.clientHeight)&&Math.round(t.right)<=(window.innerWidth||document.documentElement.clientWidth)}function x(){document.body.offsetWidth}function T(e){let t=e;for(;null!==t&&"a"!==t.tagName.toLowerCase();)t=t.parentElement;if(null===t)return;const i=t,s=i.getAttribute("href");return"#"!==s&&""!==s&&null!==s?i:void 0}function A(e,t){if(!t.contains(e))return!1;const i=t.scrollTop,s=i+t.offsetHeight,n=e.offsetTop;return n+e.offsetHeight<=s&&n>=i}},6784:(e,t,i)=>{"use strict";i.d(t,{Pf:()=>d,Vo:()=>u,Xq:()=>h,ck:()=>c,wu:()=>l});var s=i(7623);const n=42,o={},r={};function a(e){return Number.isNaN(Number(e))?0:Number(e)}function l(e,t,i){let l,h=arguments.length>3&&void 0!==arguments[3]&&arguments[3],d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t===window)l=o[e]=a(o[e])+1;else if(t===document)l=r[e]=a(r[e])+1;else if(t instanceof HTMLElement){const i=`data-listener-count-${e}`;l=a(t.getAttribute(i))+1,t.setAttribute(i,`${l}`)}else l=1,debug(`EventListener attached to non-HTMLElement object (possibly frame document): ${t}`);if(l>n){let i;i=t===document?"document":t===window?"window":`${t.outerHTML.split(">")[0]}>`,warn("Too many event listeners on element",{event:e,element:i,listeners:l,maxListeners:n})}if(void 0!==window.addEventListener){const n=(0,s.sb)()?{capture:h,passive:d}:h;t.addEventListener(e,i,n)}else void 0!==window.attachEvent?t.attachEvent(`on${e}`,i):error(`Could not resolve addEventListenerPoly( ${e} ) to ${t}`)}function h(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];for(const o of e)l(o,t,i,s,n)}function d(e,t,i){let n,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],h=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t===window)n=o[e]=a(o[e])-1;else if(t===document)n=r[e]=a(r[e])-1;else if(t instanceof HTMLElement){const i=`data-listener-count-${e}`;n=a(t.getAttribute(i))-1,t.setAttribute(i,`${n}`)}else n=1,debug(`EventListener removed from non-HTMLElement object (possibly frame document): ${t}`);if(n<0&&warn(`event listener "${e}" removed without being added`,{listeners:n}),void 0!==window.removeEventListener){const n=(0,s.sb)()?{capture:l,passive:h}:l;t.removeEventListener(e,i,n)}else void 0!==window.detachEvent?t.detachEvent(`on${e}`,i):error(`Could not resolve removeEventListenerPoly( ${e} ) from ${t}`)}function c(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const o=r=>{i(r),d(e,t,o,s,n)};l(e,t,o,s,n)}function u(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];c(e,t,(()=>{l(e,t,i,s,n)}),s,n)}},213:(e,t,i)=>{"use strict";i.d(t,{J:()=>m,Q$:()=>u,SI:()=>v,mf:()=>p});var s=i(9447),n=i(6784),o=i(3955),r=i(1779),a=i(1191),l=i(2690);const h={backgroundColor:"#F47321",color:"#FFFFFF",border:"1px solid #CD5D26"};class d{constructor(){this.message=document.createElement("div"),this.container=document.createElement("div"),this.dialog=document.createElement("div"),this.title=document.createElement("div"),this.decline=document.createElement("button"),this.accept=document.createElement("button"),this.teardown=()=>{},this.queue=[],this.rotateDismissTeardownHandler=()=>{(0,n.Pf)("orientationchange",window,this.rotateDismissTeardownHandler),this.teardown()},(0,s.fZ)(this.container,"modalAlert"),this.container.style.display="none",this.container.style.position="fixed",this.container.style.overflow="auto",this.container.style.top="0",this.container.style.left="0",this.container.style.width="100%",this.container.style.height="100%",this.container.style.zIndex="2000",(0,s.fZ)(this.dialog,"dialog"),this.dialog.style.width="440px",this.dialog.style.minWidth="240px",this.dialog.style.position="relative",this.dialog.style.display="inline-block",this.dialog.style.borderRadius="10px",this.dialog.style.textAlign="left",this.dialog.style.overflow="hidden",this.dialog.style.zIndex="2001",this.dialog.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",this.title.style.display="block",this.title.style.fontSize="20px",this.title.style.paddingTop="20px",this.title.style.paddingLeft="20px",this.title.style.paddingRight="20px",this.title.style.paddingBottom="1px",this.title.style.fontWeight="bold",this.title.style.overflow="hidden",this.title.style.textOverflow="ellipsis",this.dialog.appendChild(this.title),this.message.style.display="inline-block",this.message.style.wordWrap="break-word",this.message.style.padding="20px",this.message.style.textAlign="left",this.dialog.appendChild(this.message);const e=document.createElement("div");(0,s.fZ)(e,"dialogForm"),(0,o.ZM)(e,{display:"flex",alignItems:"center",justifyContent:"end",borderTopWidth:"1px",borderTopStyle:"solid",textAlign:"center",height:"40px",gap:"10px"}),(0,s.fZ)(this.accept,"accept"),this.accept.style.minWidth="70px",this.accept.style.padding="3px",this.accept.style.marginRight="15px",this.accept.style.boxSizing="border-box",this.accept.innerText="OK",this.accept.style.cursor="pointer",this.accept.style.borderWidth="1px",this.accept.style.borderStyle="solid",this.accept.tabIndex=1,this.accept.onclick=e=>{e.stopPropagation(),void 0!==this.yesCallback&&this.yesCallback(),c.teardown()},(0,s.fZ)(this.decline,"decline"),this.decline.style.minWidth="70px",this.decline.style.padding="3px",this.decline.innerText="Cancel",this.decline.style.cursor="pointer",this.decline.tabIndex=2,this.decline.onclick=e=>{e.stopPropagation(),void 0!==this.noCallback?this.noCallback():void 0!==this.yesCallback&&this.yesCallback(),c.teardown()},e.appendChild(this.decline),e.appendChild(this.accept),this.dialog.appendChild(e),this.container.appendChild(this.dialog)}resize(){this.dialog.style.width=`${Math.min(440,document.documentElement.clientWidth-40)}px`,this.dialog.style.left=`${Math.max(0,(this.container.offsetWidth-this.dialog.offsetWidth)/2)}px`,this.dialog.style.top=`${Math.max(0,(this.container.offsetHeight-80-this.dialog.offsetHeight)/2)}px`}display(e,t,i,s){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(this.active)return void this.queue.push({msg:e,yesCallback:t,noCallback:i,config:s});this.message.innerText=e,this.handleConfig(s),this.container.style.display="block",this.yesCallback=t,void 0===i?c.decline.style.display="none":(this.noCallback=i,c.decline.style.display="");const h=new a.t,d=e=>{e.stopPropagation(),e.preventDefault(),h.execute(e)};h.addHandler({keyCode:13,requiresCtrlOrMeta:!1,handle:e=>{if(void 0!==i&&document.activeElement===c.decline)return i(),void this.teardown();t(),this.teardown()}}),o||h.addHandler({keyCode:27,requiresCtrlOrMeta:!1,handle:e=>{void 0!==i?i():t(),this.teardown()}}),void 0!==i&&h.addHandler({code:"Tab",requiresCtrlOrMeta:!1,handle:e=>{document.activeElement===c.accept?c.decline.focus():c.accept.focus()}}),this.active=!0;const u=()=>{this.resize()};(0,n.wu)("keydown",document,d,!0),(0,n.wu)("resize",window,u),(0,n.wu)("orientationchange",window,u),this.teardown=()=>{l.$.fire(!1);try{(0,n.Pf)("keydown",document,d,!0)}catch(e){debug("ModalAlert keydown listener was already removed")}try{(0,n.Pf)("resize",window,u)}catch(e){debug("ModalAlert resize listener was already removed")}this.container.style.display="none",this.active=!1,this.container.parentElement===document.body&&document.body.removeChild(this.container),this.yesCallback=void 0,this.noCallback=void 0;const e=this.queue.shift();void 0!==e&&this.display(e.msg,e.yesCallback,e.noCallback,e.config)};const p=(0,r.Gy)();void 0!==p&&Boolean(p)?p.appendChild(this.container):document.body.appendChild(this.container),this.resize(),l.$.fire(!0)}handleConfig(e){void 0!==(null==e?void 0:e.title)?(this.title.style.display="block",this.title.innerText=e.title,!0===e.titleSmall&&(this.title.style.fontSize="16px")):this.title.style.display="none",!1===(null==e?void 0:e.allowDecline)&&(0,o.ZM)(this.decline,{display:"none"}),void 0!==(null==e?void 0:e.acceptText)?this.accept.innerText=e.acceptText:this.accept.innerText="OK",void 0!==(null==e?void 0:e.declineText)?this.decline.innerText=e.declineText:this.decline.innerText="Cancel"}}const c=new d;function u(e,t,i){void 0===t&&(t=()=>{}),c.display(e,t,void 0,i)}function p(e,t,i,s){var n,o;let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];t=null!==(n=t)&&void 0!==n?n:()=>{},i=null!==(o=i)&&void 0!==o?o:()=>{},c.display(e,t,i,s,r)}function m(e,t,i){c.display(e,(()=>{void 0!==t&&t(),(0,n.Pf)("orientationchange",window,c.rotateDismissTeardownHandler)}),void 0,i),(0,n.wu)("orientationchange",window,c.rotateDismissTeardownHandler)}const g=new class extends d{constructor(){super()}displayForm(e,t,i,s,n){var r;let a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];this.cancelActiveForm(),s=null!==(r=s)&&void 0!==r?r:"",super.display(s,t,i,n,a);const l=document.createElement("div");(0,o.ZM)(l,{minHeight:void 0!==n&&!0===n.separator?"15px":"0px"}),this.message.appendChild(l),this.form=e,this.message.appendChild(this.form),void 0===(null==n?void 0:n.acceptText)&&(this.accept.innerText="Apply"),!0===(null==n?void 0:n.orange)&&(0,o.ZM)(this.accept,h),this.accept.onclick=e=>{e.stopPropagation(),void 0!==this.yesCallback&&this.yesCallback(this.form),g.teardown()},this.decline.onclick=e=>{e.stopPropagation(),void 0!==this.noCallback&&this.noCallback(),g.teardown()}}cancelActiveForm(){this.active&&(void 0!==this.noCallback&&this.noCallback(),g.teardown())}};function v(e,t,i,s,n){var o;let r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];i=null!==(o=i)&&void 0!==o?o:()=>{},g.displayForm(e,t,i,s,n,r)}},5216:(e,t,i)=>{"use strict";i.d(t,{$e:()=>p,Aw:()=>d,KF:()=>u,W9:()=>a,_Y:()=>o,fr:()=>r,ju:()=>m,vU:()=>c});var s=i(8861),n=i(9461);function o(e){if([".","?","#"].some((t=>e.startsWith(t))))return e;let t="";return null===e.match(/^[a-zA-Z]+:\/\//)&&(t=e.startsWith("/")?"":"/"),`${t}${e}`}class r extends Error{constructor(e){super(function(e){switch(e.readyState){case 0:return"request not sent";case 4:switch(e.status){case 0:return"network error";case 400:return"bad request";case 401:return"unauthorized";case 403:return"access denied";case 404:return"not found";case 429:return"request throttled";case 500:return"server error";default:return`unknown status ${e.status}`}default:return`unknown ready state ${e.readyState}`}}(e)),this.xhr=e,this.toString=()=>`XhrError: ${this.message}`,this.xhrErrorAttributes={status:e.status,reason:e.statusText,readyState:e.readyState}}}function a(e){return e>=200&&e<=299||1223===e}function l(e,t,i,s){var n,o;e.withCredentials=null===(n=null==s?void 0:s.withCredentials)||void 0===n||n,e.timeout=null!==(o=null==s?void 0:s.timeout)&&void 0!==o?o:6e4,e.onerror=()=>{i(new r(e))},e.onload=()=>{a(e.status)?t(e):i(new r(e))},!0!==(null==s?void 0:s.noRequestedWith)&&e.setRequestHeader("X-Requested-With","XMLHttpRequest")}function h(e,t){const i=Object.keys(t).map((e=>((e,t)=>`${e}=${encodeURIComponent(t)}`)(e,t[e]))).join("&");return o(""===i?e:`${e}?${i}`)}function d(e,t){return c(e,t)[1]}function c(e,t){return function(e,t,i){const s=new XMLHttpRequest;return[s,new Promise(((t,n)=>{s.open("GET",o(e)),l(s,t,n,i),s.send()}))]}(e,0,t)}function u(e,t,i){const s=function(e){if(e instanceof FormData)return e;const t=new FormData;for(const i of Object.keys(e))t.append(i,e[i]);return t}(t),n=g(s);return void 0===n?error("CSRF token is undefined"):s.set("csrfmiddlewaretoken",n),new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("POST",o(e),!0),l(r,t,n,i),r.send(s)}))}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const s=g();return new Promise(((n,o)=>{const a=new XMLHttpRequest;if(a.open("PUT",h(e,t),!0),l(a,n,o,i),void 0===s)return error("CSRF token is undefined"),void o(new r(a));a.setRequestHeader("X-CSRFToken",s),a.send()}))}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const s=g();return new Promise(((n,o)=>{const a=new XMLHttpRequest;if(a.open("DELETE",h(e,t),!0),l(a,n,o,i),void 0===s)return error("CSRF token is undefined"),void o(new r(a));a.setRequestHeader("X-CSRFToken",s),a.send()}))}function g(e){const t=(0,s.oD)("csrftoken");if(void 0!==t)return t;if(void 0!==n.Bm.current.csrftoken)return n.Bm.current.csrftoken;let i;return void 0!==e&&e.has("csrfmiddlewaretoken")&&(i=e.get("csrfmiddlewaretoken")),i}},7322:(e,t,i)=>{"use strict";i.d(t,{Y6:()=>E,yc:()=>R,zZ:()=>P,un:()=>A,bt:()=>M});var s=i(7063),n=i(7623),o=i(7871),r=i(9461),a=i(6784),l=i(5216),h=i(2939),d=i(2709),c=i(3955),u=i(8423),p=i(6440);function m(e){const t={name:e.getString("name",!1),template:e.getString("template",!1)},i=e.getAny("layers");if(void 0!==i){const e=i;if(e instanceof Array&&0!==e.length){const i=[];for(const t of e)i.push(g(JSON.stringify(t)));t.layers=i}}const n=e.getObjectString("table",!1);if(0!==n.length){const e=function(e){const t=new s.N6(e),i={backgroundColor:t.getStringWithNumbers("background-color",!1),color:t.getStringWithNumbers("color",!1),textAlign:t.getStringWithNumbers("text-align",!1),fontStyle:t.getStringWithNumbers("font-style",!1),fontWeight:t.getStringWithNumbers("font-weight",!1)},n=t.getObjectString("row_1",!1);""!==n&&(i.rowOne=v(n));const o=t.getObjectString("row_2",!1);""!==o&&(i.rowTwo=v(o));const r=t.getObjectString("row_3",!1);return""!==r&&(i.rowThree=v(r)),i}(n);t.table=e}return function(e){const t=document.createElement("div");if(t.style.position="absolute",t.style.height=`${P}px`,t.style.width=`${A}px`,t.style.backgroundColor="transparent",t.style.overflow="hidden",t.style.font="1em 'UbuntuRegular', Arial, Helvetica, sans-serif",void 0!==e.layers)for(const i of e.layers)"text"===i.layerType?t.appendChild(y(i)):"image"===i.layerType&&(t.appendChild(b(i)),t.style.color="#000000");if(void 0!==e.table){const i=function(e){const t=document.createElement("div");t.style.height=`${P}px`,t.style.width=`${A}px`,t.style.backgroundColor=e.backgroundColor,t.style.color=e.color,t.style.fontStyle=e.fontStyle,t.style.fontWeight=e.fontWeight,t.style.textAlign=e.textAlign;for(const i of[e.rowOne,e.rowTwo,e.rowThree]){let e;e=void 0!==i?w(i):w(),t.appendChild(e)}return t}(e.table);t.appendChild(i)}return t}(t)}function g(e){const t=new s.N6(e);return{color:t.getStringWithNumbers("color",!1),filename:t.getStringWithNumbers("filename",!1),fontFamily:t.getStringWithNumbers("font-family",!1),fontSize:t.getStringWithNumbers("font-size",!1),fontStyle:t.getStringWithNumbers("font-style",!1),fontWeight:t.getStringWithNumbers("font-weight",!1),height:t.getStringWithNumbers("height",!1),imageUrl:t.getStringWithNumbers("image_url",!1),layerType:t.getStringWithNumbers("type",!1),left:t.getStringWithNumbers("left",!1),maxWidth:t.getStringWithNumbers("max-width",!1),opacity:t.getStringWithNumbers("opacity",!1),text:t.getStringWithNumbers("text",!1),textAlign:t.getStringWithNumbers("text-align",!1),top:t.getStringWithNumbers("top",!1),width:t.getStringWithNumbers("width",!1)}}function v(e){const t=new s.N6(e),i={backgroundColor:t.getStringWithNumbers("background-color",!1),color:t.getStringWithNumbers("color",!1),textAlign:t.getStringWithNumbers("text-align",!1),fontStyle:t.getStringWithNumbers("font-style",!1),fontWeight:t.getStringWithNumbers("font-weight",!1)},n=t.getObjectString("col_1",!1);""!==n&&(i.header=f(n));const o=t.getObjectString("col_2",!1);return""!==o&&(i.data=f(o)),i}function f(e){const t=new s.N6(e);return{backgroundColor:t.getStringWithNumbers("background-color",!1),color:t.getStringWithNumbers("color",!1),left:t.getStringWithNumbers("left",!1),textAlign:t.getStringWithNumbers("text-align",!1),fontStyle:t.getStringWithNumbers("font-style",!1),fontWeight:t.getStringWithNumbers("font-weight",!1),value:t.getStringWithNumbers("value",!1),width:t.getStringWithNumbers("width",!1)}}function y(e){const t=document.createElement("span");return t.style.position="absolute",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.style.textOverflow="ellipsis",t.style.lineHeight="normal",t.style.color=e.color,t.style.fontFamily=e.fontFamily,t.style.fontSize=e.fontSize,t.style.fontStyle=e.fontStyle,t.style.fontWeight=e.fontWeight,t.style.left=e.left,t.style.maxWidth=e.maxWidth,t.innerText=e.text,t.style.textAlign=e.textAlign,t.style.top=e.top,t.style.width=e.width,t}function b(e){const t=document.createElement("img");return t.style.position="absolute",t.alt="",t.style.height=e.height,t.src=e.imageUrl,t.style.left=e.left,t.style.top=e.top,t.style.width=e.width,t.style.opacity=e.opacity,t}function w(e){const t=document.createElement("div");if(t.style.height=P/3+"px",t.style.lineHeight=P/3+"px",t.style.width=`${A}px`,void 0!==e){if(t.style.backgroundColor=e.backgroundColor,t.style.color=e.color,t.style.fontStyle=e.fontStyle,t.style.fontWeight=e.fontWeight,t.style.textAlign=e.textAlign,void 0!==e.header){const i=C(e.header);t.appendChild(i)}if(void 0!==e.data){const i=C(e.data);t.appendChild(i)}}return t}function C(e){const t=document.createElement("div");return t.style.position="absolute",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.style.textOverflow="ellipsis",t.style.position="absolute",t.style.backgroundColor=e.backgroundColor,t.style.color=e.color,t.style.fontStyle=e.fontStyle,t.style.fontWeight=e.fontWeight,t.style.textAlign=e.textAlign,t.innerText=e.value,t.style.width=e.width,t.style.left=e.left,t}var S=i(9741),x=i(4947),T=i(3860);const A=270,P=69,k=new u.c_("panelUpdated"),M=(0,p.f)("MultiAppPanel");class R extends d.u{constructor(){super(),this.panelUpdated=k,this.hasContent=!0,this.bcpFallback=!1,this.element.style.width="320px",this.element.style.height=`${P}px`,this.element.style.position="relative",this.element.style.overflow="",h.X0.listen((e=>{this.roomUid=e.dossier.roomUid,this.getInitialPanel(!0),this.chatConnection=e.chatConnection,e.chatConnection.event.refreshPanel.listen((e=>{void 0===e||void 0===e.appId||void 0===e.appSystem?this.getInitialPanel(!1):this.refreshPanel(e.appId,e.appSystem)}))})),T.L.changeVideoMode.listen((e=>{e.currentMode!==e.previousMode&&"split"===e.currentMode&&this.getInitialPanel(!1)})),this.appPanelWrapper=document.createElement("div"),this.appPanelWrapper.style.height=`${P}px`,this.appPanelWrapper.style.overflow="hidden",this.appPanelWrapper.style.boxSizing="border-box",this.appPanel=new I,this.appPanelWrapper.appendChild(this.appPanel.element),this.element.appendChild(this.appPanelWrapper),(0,a.wu)("message",window,(e=>{switch(e.data){case"webc-bcp-fallback":if(e.origin!==this.appPanel.getWebcOrigin())return;this.bcpFallback=!0,this.chatConnection.event.refreshPanel.fire(void 0);break;case"request-auth-token":if(e.origin!==this.appPanel.getWebcOrigin())return;this.appPanel.sendAuthToken()}})),this.setupListeners()}getAppIndex(e){if(void 0===e)return-1;for(let t=0;t{this.reset(t,e)})).catch((()=>{}))}reset(e,t){this.clear(),this.hasContent=!0;const i=(0,o.aL)(e);if(this.panelList=i.appList,this.panelList.length>0){var s;let n=this.getAppIndex(null===(s=this.currentApp)||void 0===s?void 0:s.id);-1===n&&(n=0),this.currentApp=this.panelList[n],void 0===i.error?this.appPanel=new I(e,t):(this.hasContent=!1,this.appPanel=new I)}else this.currentApp=void 0,this.hasContent=!1,this.appPanel=new I;this.appPanelWrapper.appendChild(this.appPanel.element),this.panelUpdated.fire(void 0)}extendPanel(){this.appPanel.element.style.position="absolute",this.appPanel.element.style.zIndex="1000",this.appPanel.element.style.height="337px"}shrinkPanel(){this.appPanel.element.style.position="static",this.appPanel.element.style.zIndex="auto",this.appPanel.element.style.height=`${P}px`}setupListeners(){(0,c.JR)(this.appPanelWrapper,{handleTouch:!0}).listen((e=>{e&&void 0!==this.currentApp?this.extendPanel():this.shrinkPanel()})),(0,n.OF)()&&window.setInterval((()=>{this.element.contains(document.activeElement)&&void 0!==this.currentApp?this.extendPanel():this.shrinkPanel()}),300)}previous(){var e;const t=this.getAppIndex(null===(e=this.currentApp)||void 0===e?void 0:e.id);t<1||(this.currentApp=this.panelList[t-1],this.refreshPanel(this.currentApp.id,this.currentApp.panelType))}next(){var e;const t=this.getAppIndex(null===(e=this.currentApp)||void 0===e?void 0:e.id);t!==this.panelList.length-1&&(this.currentApp=this.panelList[t+1],this.refreshPanel(this.currentApp.id,this.currentApp.panelType))}refreshPanel(e,t){(0,o.ld)(this.roomUid,this.bcpFallback,e,t).then((t=>{var i;const s=(0,o.aL)(t);this.panelList=s.appList,void 0===s.error||(null===(i=this.currentApp)||void 0===i?void 0:i.id)!==e?this.reset(t,!1):this.getInitialPanel(!1)})).catch((()=>{}))}removeDOMChildren(e){for(;null!==e.firstChild;)e.removeChild(e.firstChild)}clearAppPanel(){this.removeDOMChildren(this.appPanelWrapper)}clear(){this.clearAppPanel()}}class I extends d.u{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];super(),this.previewTime=5e3,this.element.style.position="relative",this.element.style.display="inline-block",this.element.style.width=`${A}px`,this.element.style.overflow="hidden",this.element.style.textShadow="none",this.element.style.fontSize="11px",this.element.style.lineHeight="1.7em",this.update(e,t)}update(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.cleanupPanel(),void 0===e)return this.panel=(0,S.o)(),void this.element.appendChild(this.panel);const i=(0,o.aL)(e);var s;void 0!==i.url?(this.element.style.width="320px",this.webcOrigin=null===(s=i.webcOrigin)||void 0===s?void 0:s.toLowerCase(),this.webcAuthToken=i.webcAuthToken,this.prepareIframePanel(i.url,t)):this.panel=this.createHTMLPanel(i.template,e),this.element.appendChild(this.panel)}getWebcOrigin(){return this.webcOrigin}sendAuthToken(){var e;void 0!==this.webcOrigin&&(null===(e=this.panel.contentWindow)||void 0===e||e.postMessage({type:"auth-token",value:this.webcAuthToken},this.webcOrigin))}prepareIframePanel(e,t){r.Bm.current.isBroadcast&&t?(this.preview=document.createElement("div"),this.preview.style.width="320px",this.preview.style.height="69px",this.preview.style.textAlign="center",this.preview.style.lineHeight="5em",this.preview.style.fontSize="14px",this.preview.style.fontWeight="bold",this.preview.style.boxShadow="inset 0 0 100px 10px rgba(0, 0, 0, 0.32)",this.preview.innerText=x.R.loadingPreview,this.element.appendChild(this.preview),this.panel=this.createIframePanel(""),this.panel.style.display="none",this.previewTimer=window.setTimeout((()=>{this.element.removeChild(this.preview),this.panel.src=e,this.panel.style.display="block"}),this.previewTime)):this.panel=this.createIframePanel(e)}createHTMLPanel(e,t){switch(e){case"image_template":return m(t);case"3_rows_11_21_31":case"3_rows_11_22_32":case"3_rows_12_21_31":case"3_rows_12_22_31":case"3_rows_of_labels":return(0,S.o)(t);default:return warn(`template of type (${e}): is not supported`),(0,S.o)()}}createIframePanel(e){const t=document.createElement("iframe");return t.id="appPanelFrame",t.src=e,t.style.border="none",t.style.padding="0",t.style.background="#FFFFFF",t.style.width="100%",t.style.height="100%",(0,c.JR)(t).listen((e=>{this.element.style.filter=e?"drop-shadow(0px 0px 16px rgba(0, 0, 0, 0.3))":""})),(0,n.OF)()&&window.setInterval((()=>{this.element.contains(document.activeElement)?this.element.style.filter="drop-shadow(0px 0px 16px rgba(0, 0, 0, 0.3))":this.element.style.filter=""}),300),t}cleanupPanel(){clearTimeout(this.previewTimer),this.removeAllDOMChildren()}}class E extends d.u{constructor(){super(),this.panelUpdated=new u.c_("panelUpdated"),this.hasContent=!1,this.element.style.display="inline-block",this.element.style.paddingLeft="5px",this.element.style.paddingTop="3px",this.element.style.paddingRight="5px",this.element.style.paddingBottom="3px",this.element.style.position="",this.element.style.width=`${A}px`,this.element.style.height=`${P}px`,this.element.style.textShadow="none",this.element.style.fontSize="11px",this.element.style.lineHeight="1.7em",this.element.style.overflow="hidden",h.X0.listen((e=>{this.updateAppPanel(e.chatConnection.room()),e.chatConnection.event.refreshPanel.listen((()=>{this.updateAppPanel(e.chatConnection.room())})),e.chatConnection.event.clearApp.listen((()=>{this.updateAppPanel(e.chatConnection.room())}))})),this.appPanelTable=(0,S.o)(),this.element.appendChild(this.appPanelTable)}updateAppPanel(e){(0,l.Aw)(`api/panel_context/${e}/`).then((e=>{this.cleanupPanel();const t=new s.N6(e.responseText);if("no-content"===t.getString("code",!1))return this.hasContent=!1,this.appPanelTable=(0,S.o)(),this.element.appendChild(this.appPanelTable),void this.panelUpdated.fire(void 0);this.hasContent=!0;const i=t.getString("template",!1);switch(i){case"image_template":this.appPanelTable=m(t);break;case"3_rows_11_21_31":case"3_rows_11_22_32":case"3_rows_12_21_31":case"3_rows_12_22_31":case"3_rows_of_labels":this.appPanelTable=(0,S.o)(t);break;default:this.hasContent=!1,this.appPanelTable=(0,S.o)(),warn(`template of type (${i}): is not supported`)}t.logUnusedDebugging("updateAppPanel"),this.element.appendChild(this.appPanelTable),this.panelUpdated.fire(void 0)})).catch((e=>{e.message.toLowerCase().includes("network error")||error("Error fetching app panel",e)}))}cleanupPanel(){this.element.children.length>0&&this.element.removeChild(this.appPanelTable)}}},3971:(e,t,i)=>{"use strict";i.d(t,{$:()=>o,_:()=>r});var s=i(7322),n=i(2939);const o=2e3;class r{constructor(e){this.config=e,this.appPanel=new s.Y6,this.appPanel.element.style.width=`${s.un}px`,this.appPanel.element.style.position="relative",this.hasContent=!1,this.canUpdatePanel=!1,n.X0.listen((e=>{this.hasContent=!1,this.canUpdatePanel=!1,this.appPanelLastId=void 0,window.setTimeout((()=>{this.canUpdatePanel=!0,this.hasContent&&this.updatePanel()}),o)})),this.appPanel.panelUpdated.listen((()=>{this.hasContent=!0,this.canUpdatePanel&&this.updatePanel()}))}updatePanel(){if(!this.appPanel.hasContent)return;if(void 0===this.appPanelLastId)return this.config.appendMessageDiv(this.appPanel.element),void(this.appPanelLastId=this.config.getLastMessageId());const e=this.appPanel.element.offsetTop-this.config.getMessagesScrollTop();(e<0||e>this.config.getMessagesOffsetHeight()-30)&&this.config.messagesSinceId(this.appPanelLastId)>20&&(this.config.removeMessageDiv(this.appPanel.element),this.config.appendMessageDiv(this.appPanel.element),this.appPanelLastId=this.config.getLastMessageId())}}},768:(e,t,i)=>{"use strict";i.d(t,{T:()=>r});var s=i(7623),n=i(6784),o=i(5389);class r{constructor(){this.soundMap=new Map,this.supported=!0,this.supported=(0,s.xe)()&&((0,s.o)()||(0,s.Hg)()),this.init(),(0,n.wu)("beforeunload",window,(e=>{this.close()})),o.g$.listen((e=>{if(e&&(0,s.OF)()){const e=(0,s.yb)();void 0!==e&&e<13?this.init():void 0!==this.context&&this.context.resume()}}))}init(){if(this.supported)if((0,s.o)()){info("Using audio context"),this.close(),this.ensureContextCreated(!1);const e=()=>{this.playEmptySound(),(0,n.Pf)("click",document,e),(0,n.Pf)("touchstart",document,e),(0,n.Pf)("touchend",document,e)};(0,n.wu)("click",document,e),(0,n.wu)("touchstart",document,e),(0,n.wu)("touchend",document,e)}else info("Using audio elements");else warn("Sounds are not supported.")}close(){void 0!==this.context&&("close"in this.context&&this.context.close(),this.context=void 0)}loadSound(e,t){if(this.soundMap.set(e,{ready:!1}),void 0!==this.context){const i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=()=>{i.status<200||i.status>=300?error("Error requesting sound",{soundName:e,status:i.status,statusText:i.statusText}):void 0!==this.context?this.context.decodeAudioData(i.response.slice(0),(t=>{debug(`Loaded sound ${e}`),this.soundMap.set(e,{ready:!0,buffer:t})}),(t=>{error("Error decoding sound",{soundName:e,message:t})})):this.supported&&error("audioHolder loadSound missing context")},i.onerror=()=>{error("Error requesting sound",{soundName:e,status:i.status,statusText:i.statusText})},i.send()}else(0,s.Hg)()&&this.soundMap.set(e,{ready:!0,audioElement:new Audio(t)})}loadTipSounds(){this.loadSound("HugeTip",`${STATIC_URL}sounds/classic/huge.mp3`),this.loadSound("LargeTip",`${STATIC_URL}sounds/classic/large.mp3`),this.loadSound("MediumTip",`${STATIC_URL}sounds/classic/medium.mp3`),this.loadSound("SmallTip",`${STATIC_URL}sounds/classic/small.mp3`),this.loadSound("TinyTip",`${STATIC_URL}sounds/classic/tiny.mp3`)}loadPrivateShowSounds(){this.loadSound("PrivateShow",`${STATIC_URL}sounds/show.mp3`)}playSound(e,t){if(!this.canPlaySound(e,t))return;const i=this.soundMap.get(e);if(void 0!==i)if(i.ready)if(void 0!==i.buffer){if(this.ensureContextCreated(),void 0===this.context)return void(this.supported&&error("audioHolder playSound missing context"));const s=this.context.createBufferSource();s.buffer=i.buffer;const n=this.context.createGain();s.connect(n),n.connect(this.context.destination),n.gain.value=t/3.5/100,debug(`play sound ${e} volume ${t/3.5} (video at ${t}) gain ${n.gain.value}`),s.start(0)}else if(void 0!==i.audioElement){i.audioElement.volume=t/100;const s=i.audioElement.play();void 0!==s&&s.catch((t=>{error(`Error playing sound ${e} (${t})`)}))}else error(`Missing sound buffer or element for ${e}`);else warn(`sound ${e} not ready yet (and may never will be ready)`)}ensureContextCreated(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.supported&&void 0===this.context&&(e&&warn("audioHolder context unexpectedly missing"),"webkitAudioContext"in window?this.context=new webkitAudioContext:this.context=new AudioContext)}canPlaySound(e,t){return this.supported?0===t?(debug(`Not playing sound ${e} at volume 0`),!1):t>100||t<0||isNaN(t)?(error(`setSoundVolume: invalid volume ${t}`),!1):!!this.soundMap.has(e)||(error(`Unknown sound: ${e}`),!1):(debug(`Not playing sound ${e} because sound is not supported`),!1)}playEmptySound(){if(void 0===this.context)return;const e=this.context.createBufferSource();e.buffer=this.context.createBuffer(1,1,22050),e.connect(this.context.destination),e.start(0)}}},6844:(e,t,i)=>{"use strict";i.d(t,{n:()=>h,ok:()=>r,rC:()=>l});var s=i(9461),n=i(6064),o=i(213);function r(){var e;return void 0===(null===(e=s.Bm.current)||void 0===e?void 0:e.loggedInUser)}let a;function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Login required",t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;return!!r()&&(void 0!==a&&t?a():(0,o.mf)(e,(()=>{(0,n.DC)({fromFeature:s})}),i),!0)}function h(e){a=e}},6657:(e,t,i)=>{"use strict";i.d(t,{c:()=>g});var s=i(9447),n=i(9461),o=i(6784),r=i(5216),a=i(2939),l=i(1519),h=i(3955),d=i(8423),c=i(4693),u=i(5173),p=i(74);const m=["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Enter","Escape","Space","Tab"];class g extends u.Q{constructor(e){super(e),this.config=e,this.items=[],this.selectedIndex=-1,this.cacheTTL=-1,this.overlayClick.listen((()=>{this.isValidSelectionIndex()&&this.finalizeSelection(),this.hide()})),this.initEventListeners()}initEventListeners(){(0,o.wu)("input",this.config.inputElement.element,(()=>{this.handleInputChange()})),(0,o.wu)("keydown",this.config.inputElement.element,(e=>{this.handleKeydown(e)}))}handleKeydown(e){this.visible&&(this.handleArrowUpDown(e),["Tab","ArrowRight","Space","Enter"].includes(e.code)&&(e.preventDefault(),e.stopPropagation(),this.hide(),n.Bm.current.isMobile&&"Enter"===e.code||this.finalizeSelection()),"Escape"!==e.code&&"ArrowLeft"!==e.code||(e.preventDefault(),this.hide(),this.deleteHighlightedSuffix()))}handleArrowUpDown(e){"ArrowUp"===e.code&&(e.preventDefault(),this.scrollList(!0)),"ArrowDown"===e.code&&(e.preventDefault(),this.scrollList(!1))}initData(){super.initData(),this.list=document.createElement("div"),this.visible=!1,this.disableCache=!1,this.isPrefixSearch=!0,this.listenerGroup=new d.gt,this.regex=this.buildRegex(),this.getDataDebouncer=new l.a((()=>this.getData()),{bounceLimitMS:this.getDataDebounceMS(),debounceType:1}),this.initDelay()}initUI(e){super.initUI(),(0,s.fZ)(this.element,"autocompleteModal"),this.element.style.visibility="hidden",this.element.style.width="auto",this.element.style.maxWidth="260px",this.element.style.height="auto",this.element.style.borderWidth="1px",this.element.style.borderStyle="solid",this.element.style.borderBottom="none",this.element.style.fontFamily="Helvetica, Arial, sans-serif",this.element.style.cursor="pointer",this.list.style.width="auto",this.list.style.maxHeight="180px",this.list.style.overflowY="scroll",this.element.appendChild(this.list)}buildRegex(){return new RegExp(`(?(?:^|.*\\s+)${this.promptRegex()})(?${this.searchSlugRegex()})$`,"i")}dispose(){this.listenerGroup.removeAll()}initDelay(){this.delay=n.Aw.getState().userChatSettings.emoticonAutocompleteDelay,a.X0.listen((e=>{this.delay=e.dossier.userChatSettings.emoticonAutocompleteDelay})).addTo(this.listenerGroup),p.EZ.listen((e=>{this.delay=e.emoticonAutocompleteDelay})).addTo(this.listenerGroup)}repositionChildren(){const e=this.config.inputElement.caretXPos(!0)+this.config.leftOffset,t=this.config.inputElement.element.clientWidth-this.config.rightOffset;this.element.style.left=`${Math.max(4,Math.min(e,t))}px`}setItems(e){this.items=e,this.displayedResultsSearchSlug=this.searchSlug,this.updateListDOM()}getData(){const e=this.searchSlug;this.isGetDataCancelled()||(0,r.Aw)(this.getDataEndpoint(),this.xhrConfig).then((t=>{if(this.searchSlug!==e)return;const i=this.parseResponse(t.responseText);this.setItems(i),this.disableCache||this.cache.set(this.searchSlug,i)})).catch((e=>{error("Error autocomplete modal",e)}))}updateItems(){if(this.disableCache)this.getDataDebouncer.callFunc();else{const e=this.getCache().get(this.normalizedSearchSlug());void 0!==e?this.setItems(e):this.getDataDebouncer.callFunc()}}handleInputChange(){if(this.delay>=0&&this.config.inputElement.getAvailableLength()>this.maxOptionLength){const e=this.inputMatch();if(void 0!==e){if(this.searchSlug=e,void 0!==this.maxSearchSlugLength&&this.searchSlug.length>this.maxSearchSlugLength)return void warn(`Autocomplete search slug >${this.maxSearchSlugLength} chars. Not updating.`);this.clearSelectionStyle(),this.selectedIndex=-1,this.updateItems()}else this.hide()}}getCache(){return void 0===this.cache&&(this.cache=new c.Be(this.filterAfterSize,this.cacheTTL)),this.cache}normalizedSearchSlug(){return this.searchSlug}inputMatch(){const e=this.config.inputElement.getCurrentNodePreCaretText().match(this.regex);if(null!=e&&void 0!==e.groups)return e.groups.slug}isSpecialFunctionKey(e){return m.includes(e.code)}updateListDOM(){this.clearListDOM(),0===this.items.length?this.element.style.display="none":this.element.style.display="block";for(let e=0;e=this.items.length&&(t=0),this.pickItem(t,!0)}highlightSelectedIndex(e){this.isValidSelectionIndex()&&this.items.length>0&&(this.clearSelectionStyle(),(0,s.fZ)(this.items[this.selectedIndex].element,"selectedEmoticon"),this.items[this.selectedIndex].element.dataset.testid="selected-emoticon",e&&this.scrollToIndex(this.selectedIndex))}replacePreCaratInputText(e,t){const i=t?e.length-(this.isPrefixSearch?this.searchSlug.length:0):0,s=Math.max(i,0);try{this.config.inputElement.replaceCurrentNodePreCaretText(this.regex,`$${e}`,s)}catch{this.hide()}}scrollToIndex(e){const t=this.list.clientHeight,i=this.list.firstChild.getBoundingClientRect().height;this.list.scrollTop=e*i-t/2}deleteHighlightedSuffix(){this.config.inputElement.deleteSelection()}finalizeSelection(){this.config.inputElement.setCaretToEndOfSelection(),this.config.inputElement.insertText(" ")}show(){this.delay>=0&&window.setTimeout((()=>{void 0!==this.inputMatch()&&(this.element.style.visibility="visible",0===(0,h.Lx)(this.element.style.width)&&(this.element.style.width="auto",this.element.style.width="-moz-available",this.element.style.width="-webkit-fill-available",this.element.style.width="fill-available"),this.element.style.height="auto",this.showOverlay(),this.repositionChildrenRecursive(),this.visible=!0)}),this.delay)}hide(){this.hideOverlay(),this.element.style.visibility="hidden",this.element.style.width="0",this.element.style.height="0",this.visible=!1,this.clearListDOM()}clearSelectionStyle(){for(const e of this.items)(0,s.SA)(e.element,"selectedEmoticon"),e.element.dataset.testid="autocomplete-item"}appendItem(e,t){const i=document.createElement("div");i.style.padding="2px 8px",this.shouldIgnoreItem(e)&&(i.style.display="none"),i.onclick=e=>{this.pickItem(t,!1),e.preventDefault()},i.dataset.testid="autocomplete-item";const s=document.createElement("div");return s.dataset.testid="emoticon-title",s.classList.add("tag-text"),s.textContent=e.slug,s.title=e.slug,s.style.overflow="hidden",s.style.textOverflow="ellipsis",i.appendChild(s),this.list.appendChild(i),e.element=i,i}pickItem(e,t){void 0!==this.displayedResultsSearchSlug?(this.searchSlug!==this.displayedResultsSearchSlug&&(this.searchSlug=this.displayedResultsSearchSlug),this.selectedIndex=e,this.isValidSelectionIndex()&&this.items.length>0&&(this.highlightSelectedIndex(t),this.replacePreCaratInputText(this.items[this.selectedIndex].slug,!0))):error("displayedResultsSearchSlug unset while picking results")}shouldIgnoreItem(e){return!1}isVisible(){return this.visible}isValidSelectionIndex(){return this.selectedIndex>=0&&this.selectedIndex{"use strict";i.d(t,{v:()=>r});var s=i(7623),n=i(6784),o=i(8466);class r{constructor(e){this.config=e,this.scrolling=!1;const t=e.autocompleteConfig;(0,n.wu)("touchstart",e.element,(()=>{this.scrolling=!1,t.inputElement.setCaretToEndOfSelection()})),e.overlayClick.listen((()=>{t.inputElement.setCaretToEndOfSelection()})),e.listenerGroup.add(o.R.listen((()=>{e.hide()}))),e.list.onscroll=()=>{this.scrolling=!0},!(0,s.OF)()&&e.hideOnSpace&&(0,n.wu)("beforeinput",t.inputElement.element,(t=>{" "===t.data&&e.hide()}))}customizeItem(e,t){e.ontouchend=e=>{this.scrolling||(this.config.pickItem(t,!1),e.preventDefault())}}onShow(){this.config.element.style.width=`${this.config.autocompleteConfig.inputElement.element.offsetWidth}px`}}},5581:(e,t,i)=>{"use strict";i.d(t,{EY:()=>a,Fk:()=>l,WO:()=>d,_W:()=>c,zB:()=>h});var s=i(7063),n=i(9461),o=i(5216),r=i(7407);const a=150;function l(e,t){var i;const o=new s.N6(e),a={infoSection:{username:t,fanClubCost:o.getNumber("fan_club_cost",!1),isInFanClub:o.getBoolean("fan_club_is_member"),hasFanClub:o.getBoolean("performer_has_fanclub"),fanClubJoinUrl:`${o.getString("fan_club_join_url")}?source=${null===(i=n.Bm.current)||void 0===i?void 0:i.PurchaseEventSources.SUPPORTER_SOURCE_JOIN_FAN_CLUB_BUTTON}`,location:o.getString("location"),interestedIn:o.getObjectString("interested_in"),realName:o.getString("real_name"),sex:(0,s.nx)(o.getString("sex")),subgender:(0,s.nx)(o.getString("subgender")),followersCount:o.getNumber("follower_count"),displayAge:o.getNumber("display_age",!1),bodyDecorations:o.getString("body_decorations"),displayBirthday:o.getString("display_birthday",!1),lastBroadcast:o.getStringOrUndefined("time_since_last_broadcast"),smokeDrink:o.getString("smoke_drink"),bodyType:o.getString("body_type"),languages:o.getString("languages"),roomStatus:o.getString("room_status"),needsSupporterToPm:o.getBoolean("needs_supporter_to_pm")},aboutMe:o.getString("about_me"),wishList:o.getString("wish_list"),photoSets:(e=>{const t=[];for(const i of JSON.parse(e)){const e=new s.N6(JSON.stringify(i));t.push({id:e.getNumber("id"),name:e.getString("name"),coverUrl:e.getString("cover_url"),tokens:e.getNumber("tokens"),isVideo:e.getBoolean("is_video"),videoHasSound:e.getBoolean("video_has_sound"),userCanAccess:e.getBoolean("user_can_access"),fanClubOnly:e.getBoolean("fan_club_only"),labelText:e.getString("label_text"),labelColor:e.getString("label_color"),pendingApproval:e.getBoolean("pending_approval",!1,!1),userHasPurchased:e.getBoolean("user_has_purchased")}),e.logUnusedDebugging("parseBioApiResponse.photoset")}return t})(o.getObjectString("photo_sets")),socialMedias:(e=>{const t=[];for(const i of JSON.parse(e)){const e=new s.N6(JSON.stringify(i));t.push({id:e.getNumber("id"),titleName:e.getString("title_name"),imageUrl:e.getString("image_url"),link:e.getString("link"),popup:e.getBoolean("popup_link"),tokens:e.getNumber("tokens"),purchased:e.getBoolean("purchased"),labelText:e.getString("label_text"),labelColor:e.getString("label_color")}),e.logUnusedDebugging("parseBioApiResponse.socials")}return t})(o.getObjectString("social_medias")),gameSelection:(e=>{if(void 0!==e)return{description:e.description,gameUrl:e.game_url,image:e.image_64x64,name:e.name,uid:e.uid,viewers:e.viewers}})(o.getObjectOrUndefined("game_selection"))};return o.logUnusedDebugging("parseBioApiResponse.bioParsed"),(0,r.bT)("BioLoaded"),a}function h(e){return new Promise(((t,i)=>{(0,o.Aw)(`api/biocontext/${e}/`).then((i=>{t(l(i.responseText,e))})).catch((e=>{i(e)}))}))}function d(e,t){(0,r.bT)("PhotoSetClicked",{source:t,photoset_id:e.id,cost:e.tokens,is_video:e.isVideo})}function c(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n=e.getElementsByTagName("*");t.style.position="relative";for(const e of n){if(!(e instanceof HTMLElement))continue;e.style.position.includes("fixed")&&(e.style.position="absolute");const t=parseInt(e.style.zIndex);if(!isNaN(t)&&t>=100&&(e.style.zIndex="99"),i&&u(e),s&&"img"===e.tagName.toLowerCase()){const t=e.cloneNode();t.style.visibility="hidden",document.body.appendChild(t),t.onload=()=>{e.style.height=.5*t.offsetHeight+"px",e.style.width=.5*t.offsetWidth+"px",document.body.removeChild(t)},t.onerror=()=>{document.body.removeChild(t)}}}}function u(e){null!==e.style.top&&parseInt(e.style.top,10)<0&&(e.style.top="0"),null!==e.style.marginTop&&parseInt(e.style.marginTop,10)<0&&(e.style.marginTop="0"),null!==e.style.left&&parseInt(e.style.left,10)<0&&(e.style.left="0"),null!==e.style.marginLeft&&parseInt(e.style.marginLeft,10)<0&&(e.style.marginLeft="0")}},1918:(e,t,i)=>{"use strict";i.d(t,{x:()=>b});var s=i(7063),n=i(7623),o=i(9447),r=i(369),a=i(9603),l=i(5216),h=i(5581),d=i(4354),c=i(2939),u=i(5020),p=i(3955),m=i(9268),g=i(74),v=i(4947),f=i(1372),y=i(5389);class b extends d.y{constructor(){super(),this.customSections=[],(0,o.fZ)(this.element,"BioContents"),this.element.dataset.testid="room-bio-tab-contents",this.element.style.width="100%",this.element.style.margin="0 0 14px",this.loadingMsg.style.padding="14px 14px 0",this.errorMsg.style.padding="14px 14px 0",c.BR.listen((e=>{this.loadRoom(e.dossier.room)})),c.X0.listen((e=>{this.loadRoom(e.dossier.room)})),window.refreshSocials=()=>{this.load()}}loadRoom(e){this.room=e,this.setResourceUrl(`api/biocontext/${this.room}/`),this.load()}show(){this.element.style.display="",this.element.style.height="",this.element.style.minHeight="325px",void 0!==this.adjustMargin&&this.adjustMargin(),void 0!==this.adjustWidth&&this.adjustWidth(),this.showingError&&this.load()}hide(){this.element.style.height="0",this.element.style.minHeight="0",this.element.style.margin="0"}parseData(e){return(0,h.Fk)(e,this.room)}createContent(e){this.createBioContents(e)}clearContent(){super.clearContent(),this.clearResizeListeners()}clearResizeListeners(){void 0!==this.adjustWidth&&r.oO.removeListener(this.adjustWidth),void 0!==this.adjustMargin&&r.oO.removeListener(this.adjustMargin)}createResizeListeners(){this.clearResizeListeners(),this.adjustWidth=(0,r.Rk)(this.labelRef,500,600,[{name:"width",min:117,max:150},{name:"min-width",min:117,max:150}]),this.adjustMargin=(0,r.Rk)(this.tableRef,500,530,[{name:"margin-right",min:0,max:14},{name:"padding-right",min:0,max:14}])}repositionChildren(){for(const e of this.customSections)(0,h._W)(e,this.bioRootWrapper)}createPhotoVideos(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=e.photoSets.filter((e=>e.isVideo)),s=e.photoSets.filter((e=>!e.isVideo));if(i.length>0||t){const t=this.generatePhotoVideoSection(i,e.infoSection.username,"video");this.bioRootElement.appendChild(t)}if(s.length>0||t){const t=this.generatePhotoVideoSection(s,e.infoSection.username);this.bioRootElement.appendChild(t)}}createBioContents(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.bioRootWrapper=(0,f.tT)("div",{style:{paddingLeft:"14px",overflow:"hidden"}}),this.bioRootElement=(0,f.tT)("table",{style:{tableLayout:"fixed",width:"100%"},ref:e=>{this.tableRef=e}},(0,f.tT)("tr",{style:{height:"1px"}},(0,f.tT)("th",{style:{width:"150px",minWidth:"150px"},ref:e=>{this.labelRef=e}}),(0,f.tT)("th",null)),(0,f.tT)("tr",{style:{verticalAlign:"top"}},(0,f.tT)("th",{colSpan:2},(0,f.tT)("h1",{colorClass:[o.aG.defaultColor,"bioHeader"],style:{fontSize:`${w}.4px`,fontFamily:"UbuntuMedium, Arial, Helvetica, sans-serif",fontWeight:"normal",margin:"10px 0 20px",lineHeight:"20px",textAlign:"left"},ref:e=>{this.header=e},"data-testid":"bio-header"})))),this.bioRootWrapper.appendChild(this.bioRootElement),this.element.appendChild(this.bioRootWrapper),this.createResizeListeners();const i=e.infoSection;if(this.room===i.username){if(this.header.innerText=v.R.bioAndFreeWebCamText((0,s.nx)(this.room)),this.createSections(i),this.shouldShowSocialMediaSection(e.socialMedias.length)){const t=this.generateSocialMediaSection(e.socialMedias,e.infoSection.username);this.bioRootElement.appendChild(t)}if(this.shouldShowPicsSection(e.photoSets.length)&&this.createPhotoVideos(e,t),e.aboutMe.length>=1){const t=this.generateSectionWithUserHTML(e.aboutMe,v.R.aboutMeText);(0,m.Nb)(t),this.bioRootElement.appendChild(t),this.afterCustomSectionCreated(t)}if(e.wishList.length>=1){const t=this.generateSectionWithUserHTML(e.wishList,v.R.wishListText);(0,m.Nb)(t),this.bioRootElement.appendChild(t),this.afterCustomSectionCreated(t)}this.repositionChildren()}}createSections(e){if(""!==e.realName&&this.bioRootElement.appendChild(this.createSection(v.R.realNameText,e.realName,!1)),this.bioRootElement.appendChild(this.createFollowersSection(e.followersCount)),""!==e.displayBirthday&&this.bioRootElement.appendChild(this.createSection(v.R.birthdateText,e.displayBirthday,!1)),isNaN(e.displayAge)||this.bioRootElement.appendChild(this.createSection(v.R.ageText,e.displayAge.toString(),!1)),"A Couple"===e.sex?this.bioRootElement.appendChild(this.createSection(v.R.sexTextCouple,e.sex,!1)):"Trans"===e.sex&&e.subgender?this.bioRootElement.appendChild(this.createSection(v.R.sexText,`${e.sex} (${e.subgender})`,!1)):this.bioRootElement.appendChild(this.createSection(v.R.sexText,e.sex,!1)),""!==e.interestedIn){let t=e.interestedIn;if(t=t.slice(1,t.length-1),""!==t){for(;t.includes('"');)t=t.replace('"',"");t=t.split(",").join(", "),this.bioRootElement.appendChild(this.createSection(v.R.interstedInText,t,!1))}}""!==e.location&&this.bioRootElement.appendChild(this.createSection(v.R.locationText,e.location,!1)),void 0!==e.lastBroadcast&&""!==e.lastBroadcast&&this.bioRootElement.appendChild(this.createSection(v.R.lastBroadcastText,e.lastBroadcast,!1)),""!==e.languages&&this.bioRootElement.appendChild(this.createSection(v.R.languagesText,e.languages,!1)),""!==e.bodyType&&this.bioRootElement.appendChild(this.createSection(v.R.bodyTypeText,e.bodyType,!1)),""!==e.smokeDrink&&this.bioRootElement.appendChild(this.createSection(v.R.smokeOrDrinkText,e.smokeDrink,!1)),""!==e.bodyDecorations&&this.bioRootElement.appendChild(this.createSection(v.R.bodyDecorationsText,e.bodyDecorations,!1))}createFollowersSection(e){return this.createSection(v.R.followersText,isNaN(e)?"0":e.toString(),!1)}shouldShowSocialMediaSection(e){return e>=1}shouldShowPicsSection(e){return e>=1}generateSocialMediaSection(e,t){const i=e=>{const t=(new m.QC).anchor;t.dataset.testid="social-media-item";const i=e.link;t.href=(0,l._Y)(i),t.style.position="relative",t.style.display="inline-block",t.style.marginBottom="17px",t.style.marginRight="5px",t.style.cursor="pointer",t.className="userUpload socialMediaUpload",t.title=e.titleName,(0,p._W)(t),e.popup?t.onclick=()=>((0,y.gr)(i,void 0,`resizable,dependent,scrollbars,height=700,width=700,top=${screen.height/2-600},left=${screen.width/2-800}`),!1):t.target="_blank";const s=document.createElement("img");if(s.dataset.testid="social-media-preview",(0,o.fZ)(s,"previewBorder"),s.src=e.imageUrl,s.width=C,s.height=S,s.style.borderWidth="1px",s.style.borderStyle="solid",s.style.display="block",s.style.borderRadius="3%",s.style.display="block",t.appendChild(s),""!==e.labelText){const i=document.createElement("span");i.dataset.testid="social-media-tokens-badge",(0,o.fZ)(i,"tokenText"),i.innerText=e.labelText,i.style.backgroundColor=e.labelColor,i.style.position="absolute",i.style.bottom="16px",i.style.right="0",i.style.margin="8px",i.style.fontSize="9px",i.style.borderRadius="2px",i.style.padding="1px 3px",i.style.lineHeight="12px",t.appendChild(i)}const n=document.createElement("div");return n.dataset.testid="social-media-title",(0,o.fZ)(n,"link"),n.innerText=e.titleName,n.style.fontSize=`${w}px`,n.style.left="0px",n.style.maxWidth="145px",n.style.whiteSpace="nowrap",n.style.textOverflow="ellipsis",n.style.overflow="hidden",n.style.lineHeight="16px",n.style.textDecoration="none",t.appendChild(n),t},s=[];let n=0;for(const t of e){if(8===n)break;s.push(i(t)),n+=1}const r=e.length>8;s.push(this.generateSocialMediaLinks(t,r));const a=this.createSection(v.R.socialMediaText,s);return(0,o.fZ)(a,"smContainer"),a}generateSocialMediaLinks(e,t){const i=document.createElement("div");if(i.style.marginBottom="20px",t){const t=(new m.QC).anchor,s=`/socials/social_media/list_popup/${e}/`;(0,o.fZ)(t,"link"),t.href=(0,l._Y)(s),t.innerText=v.R.showMoreText,t.style.fontSize="14px",t.style.cursor="pointer",(0,p._W)(t),t.onclick=e=>{(0,y.gr)(s,void 0,`resizable,dependent,scrollbars,height=600,width=800,top=${screen.height/2},left=${screen.width/2}`),e.preventDefault()},i.appendChild(t)}return i}generatePhotoVideoSection(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"photo";const s=e=>{const i=(new m.QC).anchor;i.dataset.testid="photo-video-item",i.href=(0,l._Y)(`/photo_videos/photoset/detail/${t}/${e.id}`),i.target="_blank",i.style.position="relative",i.style.display="inline-block",i.style.marginBottom="17px",i.style.marginRight="5px",i.style.cursor="pointer",(0,p._W)(i),i.className="userUpload",(0,n.lT)()||(i.title=e.name),i.onclick=t=>{(0,h.WO)(e,"BioTab"),this.handlePictureClick(t,e.id,i.href)};const s=document.createElement("img");if(s.dataset.testid="photo-video-preview",(0,o.fZ)(s,"previewBorder"),s.src=e.coverUrl,s.width=C,s.height=S,s.style.borderWidth="1px",s.style.borderStyle="solid",s.style.display="block",s.style.borderRadius="3%",s.style.display="block",i.appendChild(s),e.userCanAccess){if(e.userCanAccess&&e.userHasPurchased){const e=document.createElement("span");e.dataset.testid="purchased-badge",(0,o.fZ)(e,"purchasedBadge"),e.style.backgroundColor="#6d85b5",e.style.color="#fff",e.style.position="absolute",e.style.top="80px",e.style.right="8px",e.style.padding="1px 3px",e.style.lineHeight="12px",e.style.borderRadius="2px",e.style.fontSize="9px",e.textContent=v.R.purchasedCAPS,i.appendChild(e)}}else{const t=document.createElement("div");t.style.width=`${C+1}px`,t.style.height=`${S+1}px`,t.style.borderRadius="3%",t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.backgroundColor="rgba(0, 0, 0, .55)",i.appendChild(t);const s=document.createElement("img");s.dataset.testid="lock-icon";const n=18;if(s.src=`${STATIC_URL}lock.svg`,s.width=n,s.height=n,s.style.marginLeft=-n/2+"px",s.style.marginTop=-n/2+"px",s.style.position="absolute",s.style.left="50%",s.style.top="40%",s.style.padding="4px",s.style.border="none",i.appendChild(s),""!==e.labelText){const t=document.createElement("span");t.dataset.testid="token-badge",(0,o.fZ)(t,"tokenText"),t.innerText=e.labelText,t.style.backgroundColor=e.labelColor,t.style.position="absolute",t.style.bottom="16px",t.style.right="0",t.style.margin="8px",t.style.fontSize="9px",t.style.padding="1px 3px",t.style.lineHeight="12px",t.style.borderRadius="2px",i.appendChild(t)}}if(e.isVideo){const e=document.createElement("img");e.src=`${STATIC_URL}video.svg`,e.height=18,e.style.position="absolute",e.style.top="8px",e.style.right="8px",i.appendChild(e)}if(e.isVideo&&!e.videoHasSound&&!e.pendingApproval){const e=document.createElement("img");e.src=`${STATIC_URL}no-audio.svg`,e.height=18,e.style.position="absolute",e.style.top="8px",e.style.right="32px";const t=(0,a.q)({content:`${v.R.audioRemovedText}`,hasHTML:!1,width:175,divotPosition:u.Wi.Bottom,divotLeftOrTop:"90px"});t.style.textAlign="center";const s=document.createElement("span");t.appendChild(s),i.appendChild(t),e.onmouseenter=()=>{t.style.display="block",t.style.left="12px",t.style.top="-50px"},e.onmouseleave=()=>{t.style.display="none"},i.appendChild(e)}const r=document.createElement("div");return r.dataset.testid="title",(0,o.fZ)(r,"link"),r.innerText=e.name,r.style.fontSize=`${w}px`,r.style.left="0px",r.style.maxWidth="145px",r.style.whiteSpace="nowrap",r.style.textOverflow="ellipsis",r.style.overflow="hidden",r.style.lineHeight="16px",r.style.textDecoration="none",i.appendChild(r),i},r=[];let d=0;for(const t of e){if(8===d)break;r.push(s(t)),d+=1}const c=e.length>8;let g;c&&(g=e[0].id);const f=this.generatePicsLinks(t,c,i,g);f.style.marginBottom="20px",r.push(f);const y=this.createSection("video"===i?v.R.vidsText:v.R.picsText,r);return(0,o.fZ)(y,"psContainer"),y}handlePictureClick(e,t,i){g.mf.fire(t),e.preventDefault()}generatePicsLinks(e,t){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;const s=document.createElement("div");if(t){const t=(new m.QC).anchor;t.href=(0,l._Y)(`/photo_videos/photoset/list_popup/${e}/`),(0,o.fZ)(t,"link"),t.innerText=v.R.showMoreText,t.style.fontSize="14px",t.style.cursor="pointer",(0,p._W)(t),t.onclick=e=>{g.mf.fire(i),e.preventDefault()},s.appendChild(t)}return s}createSection(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=e.toLowerCase().replace(/[ \/]/g,"-").replace(/[()\/]/g,"").replace(/--/g,"");return(0,f.tT)("tr",{style:{fontSize:`${w}px`,fontWeight:"normal",lineHeight:"15px",verticalAlign:"top",textAlign:"left"}},(0,f.tT)("td",{colorClass:"label",style:{paddingBottom:"9px",fontFamily:"UbuntuMedium, Arial, Helvetica, sans-serif",height:"16px"}},(0,f.tT)("span",{"data-testid":`bio-tab-${s}-label`},e,":")),(0,f.tT)("td",{className:"contentText bioContentText",style:{fontSize:`${w}px`,lineHeight:"16px",fontFamily:"UbuntuRegular, Arial, Helvetica, sans-serif"},ref:e=>{if("string"==typeof t)if(i){const i=(0,f.tT)("div",null);if(e.appendChild(i),i.innerHTML=t,0!==i.children.length){const e=i.children[0];e.style.display="unset",e.dataset.testid=`bio-tab-${s}-value`}}else e.innerText=t;else t.forEach((t=>{e.appendChild(t)}));i||(e.dataset.testid=`bio-tab-${s}-value`)}}))}generateSectionWithUserHTML(e,t){return this.createSection((0,s.nx)(t),e,!0)}afterCustomSectionCreated(e){this.customSections.push(e),(0,h._W)(e,this.bioRootWrapper)}}const w=14,C=150,S=100},7809:(e,t,i)=>{"use strict";i.d(t,{i:()=>d});var s=i(2758),n=i(9447),o=i(3955),r=i(2690),a=i(4947),l=i(1372);const h="broadcast_terms";class d extends r.z{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};super({easyExit:!1}),(0,o.ZM)(this.element,{position:"fixed",overflow:"hidden",height:"auto",maxWidth:"1000px",minWidth:"450px",width:"90%",top:"50%",transform:"translateY(-50%)",left:"0px",right:"0px",margin:"auto",padding:"20px",borderWidth:"2px",borderStyle:"solid",borderRadius:"20px",zIndex:1e4}),(0,n.fZ)(this.element,"broadcastTermsModal"),this.overlay.style.background="",e?((0,n.fZ)(this.overlay,"blackOverlay"),this.overlayClickStayOpen=!0):((0,n.fZ)(this.overlay,"transparentOverlay"),this.overlayClick.listen(i)),this.element.appendChild(this.createHeader()),this.element.appendChild(this.createBody()),this.element.appendChild(this.createAcceptButton(t))}static areTermsAccepted(){return"1"===(0,s.y1)(h)}createHeader(){return(0,l.tT)("div",{colorClass:"header"},(0,l.tT)("h3",{style:{textAlign:"center"}},a.R.broadcastTermsHeader))}createBody(){return this.body=(0,l.tT)("div",{style:{height:"200px",overflow:"auto",padding:"0 15px 0 10px",borderWidth:"1px",borderStyle:"solid",margin:"0 auto",textAlign:"left"},colorClass:"body"},(0,l.tT)("p",null,a.R.broadcastTerms1),(0,l.tT)("ol",null,(0,l.tT)("li",null,a.R.broadcastTerms2),(0,l.tT)("li",null,a.R.broadcastTerms3),(0,l.tT)("li",null,a.R.broadcastTerms4),(0,l.tT)("li",null,a.R.broadcastTerms5),(0,l.tT)("li",{dangerouslySetInnerHTML:{__html:a.R.broadcastTerms6}}),(0,l.tT)("li",null,a.R.broadcastTerms7),(0,l.tT)("li",null,a.R.broadcastTerms8),(0,l.tT)("li",null,a.R.broadcastTerms9)),(0,l.tT)("p",{dangerouslySetInnerHTML:{__html:a.R.broadcastTerms10}})),this.body}createAcceptButton(e){return(0,l.tT)("div",{style:{textAlign:"center",color:"#222"}},(0,l.tT)("a",{style:{width:"200px",height:"30px",lineHeight:"30px",fontWeight:"bold",margin:"10px 5px 0px 5px",borderWidth:"1px",borderStyle:"solid",display:"inline-block",textAlign:"center",cursor:"pointer"},"data-testid":"agree-broadcast-terms-button",colorClass:"acceptLink",ref:e=>{this.acceptLink=e},onClick:t=>{t.stopPropagation(),this.hide(),(0,s.aR)(h,"1",{days:7}),e()}},a.R.termsAgree))}}},78:(e,t,i)=>{"use strict";i.d(t,{p:()=>R,_:()=>I});var s=i(7623),n=i(1673),o=i(9447),r=i(213),a=i(5216),l=i(2709),h=i(8423),d=i(34),c=i(1452),u=i(2146),p=i(4947),m=i(2945);function g(e){let t=0;for(const i of e)t+=i;return t/e.length}function v(e){return Math.sqrt(function(e){const t=g(e),i=[];for(const s of e)i.push(Math.abs(s-t));return Math.sqrt(g(i))}(e))}var f,y,b=i(4941);!function(e){e[e.obsSD=0]="obsSD",e[e.obsHD=1]="obsHD",e[e.obsHDPlus=2]="obsHDPlus",e[e.obs4k=3]="obs4k"}(f||(f={})),function(e){e[e.none=0]="none",e[e.bad=1]="bad",e[e.warning=2]="warning",e[e.good=3]="good"}(y||(y={}));const w={9:"H.263",7:"H.264",12:"H.265",8:"VPX"},C={11:"Speex",12:"Opus",2:"MP3",10:"AAC",1:"AC3",9:"Vorbis"},S={480:800,576:1200,720:3e3,1080:5e3,1440:8e3,2160:12e3},x={480:900,576:3e3,720:5e3,1080:7500,1440:11e3,2160:18e3},T=(e,t)=>null==e?t:e,A=window.SmoothieChart,P=window.TimeSeries;class k{constructor(){this.started=!1,this.closed=!1,this.fpsData=[],this.MAX_FPS_LENGTH=40,this.bitrateData=[],this.MAX_BITRATE_LENGTH=100,this.lastUpdate=0,this.lastWidth=0,this.lastHeight=0,this.streamTime=0,this.infoInterval=0,this.streamDataUpdate=new h.c_("streamDataUpdate",{listenersWarningThreshold:1}),this.pollingStatusUpdate=new h.c_("pollingStatusUpdate",{listenersWarningThreshold:1}),this.startPollingEvent=new h.c_("streamWatcherStartPolling",{listenersWarningThreshold:1}),this.closeEvent=new h.c_("streamWatcherClose",{listenersWarningThreshold:1})}processData(e){const t=T(e.fps,0),i=T(e.bitrate,0),s=T(e.region,""),n=T(e.host,""),o=T(e.streamType,"obs");this.streamTime=T(e.secondsOnline,0),this.lastWidth=T(e.videoWidth,0),this.lastHeight=T(e.videoHeight,0),this.lastHeight>0&&(this.lastRatio=this.lastWidth/this.lastHeight);const r=T(e.videoCodecString,T(w[T(e.videoCodec,"")],"Unknown")),a=T(e.audioCodecString,T(w[T(e.audioCodec,"")],"Unknown"));this.transcodeCount=T(e.transcodeCount,void 0),this.fpsData.push(t),this.bitrateData.push(i),this.fpsData.length>this.MAX_FPS_LENGTH&&this.fpsData.shift(),this.bitrateData.length>this.MAX_BITRATE_LENGTH&&this.bitrateData.shift(),this.fpsSeries.append((new Date).getTime(),t),this.bitrateSeries.append((new Date).getTime(),i),this.streamDataUpdate.fire({host:n,region:s,streamType:o,fps:Math.round(t),bitrate:Math.round(i),streamTime:(0,b.I4)(this.streamTime),videoWidth:this.lastWidth,videoHeight:this.lastHeight,videoCodec:r,audioCodec:a}),this.lastUpdate=(new Date).getTime()}statusMessage(){const e=[],t=[],i=[],s=e=>{const t=document.createElement("span");return t.innerText=e,t};let n,o,r=0,a=!1,l=y.none,h=y.none;if(this.lastHeight>0){for(const e in S)S.hasOwnProperty(e)&&this.lastHeight>=Number(e)&&(n=S[e],o=x[e]);this.lastHeight<480&&this.streamTime<120&&this.streamTime>2?t.push(s(p.R.lowStreamResolution)):this.lastHeight<720&&this.streamTime>2&&i.push((e=>{const t=document.createElement("span");return t.innerHTML=e,t})(p.R.streamNotHD)),void 0!==this.lastRatio&&this.lastRatio<1.7&&this.streamTime<120&&this.streamTime>2&&(t.push(s(p.R.streamNotWidescreen)),r+=1)}void 0!==this.transcodeCount&&this.streamTime>10&&this.transcodeCount<3&&e.push(s(p.R.errorHandlingStream));let d=0,c=30,u=30;this.fpsData.length>0&&(d=v(this.fpsData.slice(-100)),c=g(this.fpsData.slice(-10)),u=g(this.fpsData.slice(-5)));let m=n;if(u>45&&c>45&&(a=!0,m=o),void 0!==m&&this.streamTime>5){const n=v(this.bitrateData.slice(-100)),o=g(this.bitrateData.slice(-10)),h=g(this.bitrateData.slice(-5));o>.01&&o<.95*m&&h<.95*m?o<.7*m&&h<.7*m?a?e.push(s(p.R.bitrateMuchLowerThanHigh(m))):e.push(s(p.R.bitrateMuchLower(m))):a?t.push(s(p.R.bitrateLowerThanHigh(m))):t.push(s(p.R.bitrateLower(m))):n>o/8&&this.streamTime>50&&this.bitrateData.length>20?(r+=1,t.push(s(p.R.unstableBitrate))):o>1.5*m&&i.push(s(p.R.veryGoodBitrate)),l=h<.7*m?y.bad:h<.95*m?y.warning:y.none}else l=y.none;u>.01&&c<21&&u<21&&this.streamTime>5?c<15&&u<15?e.push(s(p.R.frameRateMuchLower)):t.push(s(p.R.frameRateLower)):u>45&&c>45?this.streamTime<120&&this.streamTime>2&&i.push(s(p.R.frameRateHigh)):u>62&&c>62?e.push(s(p.R.frameRateTooHigh)):d>6&&this.streamTime>30&&this.fpsData.length>20?(r+=1,t.push(s(p.R.fpsVeryUnstable))):d>3&&this.streamTime>30&&this.fpsData.length>20&&(r+=1,t.push(s(p.R.fpsUnstable))),this.streamTime>5&&this.fpsData.length>20&&(h=u<15?y.bad:u>63||u>33&&u<45||u<21?y.warning:y.none),this.lastUpdate>0&&(new Date).getTime()-this.lastUpdate>1e4&&t.push(s(p.R.noQualityInformation));let b,w=y.none,C="",T=[];e.length>0?(C=p.R.alert,T=e.slice(0,2),w=y.bad):t.length>0?(C=p.R.warning,T=t.slice(0,2),w=y.warning):i.length>0||this.streamTime>10?(C=p.R.yourStreamIsGood,T=i.length>0?i.slice(0,2):[s(p.R.noIssues)],w=y.good):w=y.none;let A="",P="";const k=t.length-r;this.lastHeight>=2160&&k<1&&0===e.length?(b=f.obs4k,A="4K",P="4K"):this.lastHeight>=1080&&k<1&&0===e.length?(b=f.obsHDPlus,A="HD+",P="Full High Definition"):this.lastHeight>=720&&k<1&&0===e.length?(b=f.obsHD,A="HD",P="High Definition"):(b=f.obsSD,A="SD",P="Standard Definition"),this.pollingStatusUpdate.fire({feedbackHeader:C,feedbackMessages:T,feedbackType:w,resolutionTitle:P,resolutionType:b,resolutionText:A,bitrateFeedback:l,fpsFeedback:h})}startPolling(){if(this.startPollingEvent.fire(void 0),this.started)return;this.started=!0;const e={millisPerPixel:90,maxValueScale:1.3,grid:{fillStyle:"rgba(209, 209, 209, 0.69)",strokeStyle:"rgba(141, 142, 126, 0.82)",sharpLines:!0,borderVisible:!0,millisPerLine:6e3,verticalSections:2},labels:{fillStyle:"rgba(35, 34, 34, 0.79)",fontSize:10,precision:0},minValue:0,responsive:!0};this.fpsChart=new A(e),this.fpsSeries=new P,this.fpsChart.addTimeSeries(this.fpsSeries,{lineWidth:1.2,strokeStyle:"#033E58"}),this.fpsChart.streamTo(document.getElementById("fps_chart"),2e3),this.bitrateChart=new A(e),this.bitrateSeries=new P,this.bitrateChart.addTimeSeries(this.bitrateSeries,{lineWidth:1.2,strokeStyle:"#033E58"}),this.bitrateChart.streamTo(document.getElementById("bitrate_chart"),2e3),this.infoInterval=window.setInterval((()=>{this.statusMessage()}),1500)}isStarted(){return this.started}start(){this.started||(this.closed=!1,this.startPolling())}close(){!this.closed&&this.started&&(this.closed=!0,this.started=!1,this.closeEvent.fire(void 0),this.fpsChart.stop(),this.bitrateChart.stop(),clearInterval(this.infoInterval))}reset(){this.isStarted()&&this.close(),this.started=!1,this.closed=!1,this.fpsData=[],this.bitrateData=[],this.lastUpdate=0,this.transcodeCount=0,this.lastWidth=0,this.lastHeight=0,this.lastRatio=void 0,this.streamTime=0,this.infoInterval=0,this.start()}}class M{constructor(e){this.originWSEndpoint=e,this.streamWatcher=new k,this.closed=!1,this.lastInfo=(new Date).getTime(),this.streamName="",this.roomStatusUpdate=new h.c_("originWatcherRoomStatusUpdate"),this.alternativeStreamEvent=new h.c_("originWatcherAlternativeStream")}close(){this.closed||(this.closed=!0,void 0!==this.websocket&&this.websocket.readyState<2&&this.websocket.close(),this.streamWatcher.close())}start(){if(void 0!==this.origin&&void 0!==this.auth&&void 0!==this.username){if(void 0!==this.websocket){if(this.websocket.readyState<2)return;try{this.websocket.close()}catch{}}this.closed=!1,this.websocket=new WebSocket(`wss://${this.origin}${this.originWSEndpoint}`),this.websocket.onopen=e=>{void 0!==this.websocket&&this.websocket.send(JSON.stringify({method:"connect",username:this.username,password:this.auth}))},this.websocket.onmessage=e=>{const t=e.data;let i;try{i=JSON.parse(t)}catch(e){}if(void 0!==i)switch(i.method){case"auth_valid":break;case"stream_info":case"origin_info":this.lastInfo=(new Date).getTime(),this.handleInfo(i);break;default:console.warn("Unhandled",i)}},this.websocket.onerror=e=>{},this.websocket.onclose=e=>{this.closed||window.setTimeout((()=>{this.start()}),100)}}}isConnected(){return!this.closed&&void 0!==this.websocket&&(new Date).getTime()-this.lastInfo<5e3}handleInfo(e){let t=T(e.status,"offline");const i=T(e.roomPassword,"");"public"===t&&i.length>0&&(t="password protected");const s=T(e.streamType,"obs"),n=Boolean((0,m.JO)(window.location.search).graph);if(this.roomStatusUpdate.fire(t),"obs"!==s&&!n){let e="Unknown";"webrtc"===s&&(e="WebRTC"),this.alternativeStreamEvent.fire(e)}void 0===e.streamName||"obs"!==s&&!n?(this.streamWatcher.close(),void 0!==e.remoteHost&&void 0!==e.remoteStatus&&e.remoteHost!==this.origin&&""!==e.remoteStatus&&"offline"!==e.remoteStatus&&this.update(e.remoteHost,e.username,e.originPassword)):e.streamName!==this.streamName?(this.streamWatcher.reset(),this.streamName=e.streamName):this.streamWatcher.processData(e)}getStreamWatcher(){return this.streamWatcher}update(e,t,i){this.origin=e,this.username=t,this.auth=i,this.close(),window.setTimeout((()=>{this.start()}),10)}getOrigin(){return this.origin}}class R extends l.u{constructor(e,t){super(),this.originWSEndpoint=e,this.roomNameStaffView=t,this.roomStatus="offline",this.obsInfo=this.createLink("Show RTMP/OBS broadcast information"),this.backToWebRTC=this.createLink("Use In-Browser Broadcaster"),this.originWatcher=new M(this.originWSEndpoint),this.obsRoomStatusBlock=document.createElement("div"),this.obsRoomStatusContainer=document.createElement("div"),this.obsRoomStatus=document.createElement("span"),this.obsExitAway=document.createElement("div"),this.obsStreamStatsBlock=document.createElement("div"),this.obsStreamStatsOther=document.createElement("div"),this.obsAlternativeStreamType=document.createElement("p"),this.obsStreamRegion=document.createElement("div"),this.obsStreamGraphFPS=document.createElement("div"),this.obsStreamGraphBitrate=document.createElement("div"),this.obsStreamGraphFPSDisp=document.createElement("span"),this.obsStreamGraphBitrateDisp=document.createElement("span"),this.obsDetailsBoxTimeDisp=document.createElement("span"),this.obsDetailsBoxResDisp=document.createElement("span"),this.obsDetailsBoxCodecVideo=document.createElement("span"),this.obsDetailsBoxCodecAudio=document.createElement("span"),this.statsLoadingMessage=document.createElement("div"),this.resolutionFloatBox=document.createElement("div"),this.resolutionFloatBoxText=document.createElement("div"),this.obsStreamFeedbackBox=document.createElement("div"),this.obsFeedbackBoxHeader=document.createElement("h4"),this.obsFeedbackBoxMessages=document.createElement("div"),this.obsStreamRejected=document.createElement("div"),this.obsStreamRejectedReason=document.createElement("p"),this.obsControl=document.createElement("div"),this.obsStarted=new h.c_("obsStarted"),this.element.id="OBSOverlay";const i=void 0!==t;this.createOBSVideo(),i||(this.hide(),this.createOtherStreamOptions()),this.originWatcher.alternativeStreamEvent.listen((e=>{this.obsStreamStatsOther.style.display="",this.updateAlternativeStreamType(e),this.obsStreamStatsBlock.style.display="none",this.statsLoadingMessage.style.display="none"})),this.originWatcher.getStreamWatcher().closeEvent.listen((()=>{this.obsStreamStatsBlock.style.display="none",this.statsLoadingMessage.style.display="none",this.styleGraph(this.obsStreamGraphFPS,y.none),this.styleGraph(this.obsStreamGraphBitrate,y.none),this.styleFeedbackBox(y.none),this.obsStreamGraphFPSDisp.innerText="",this.obsStreamGraphBitrateDisp.innerText="",this.resolutionFloatBox.title="",this.obsDetailsBoxCodecVideo.innerText="",this.obsDetailsBoxCodecAudio.innerText="",this.obsDetailsBoxTimeDisp.innerText="",this.obsDetailsBoxResDisp.innerText=""})),this.originWatcher.getStreamWatcher().startPollingEvent.listen((()=>{this.statsLoadingMessage.style.display="none",this.styleFeedbackBox(y.none),this.obsStreamStatsBlock.style.display=""})),this.originWatcher.getStreamWatcher().pollingStatusUpdate.listen((e=>{this.resolutionFloatBox.title=p.R.obsStreamClass(e.resolutionTitle),this.resolutionFloatBoxText.innerText=e.resolutionText,this.styleResolutionFloatBox(e.resolutionType),this.styleFeedbackBox(e.feedbackType),this.styleGraph(this.obsStreamGraphFPS,e.fpsFeedback),this.styleGraph(this.obsStreamGraphBitrate,e.bitrateFeedback),this.obsFeedbackBoxHeader.innerText=e.feedbackHeader,this.obsFeedbackBoxMessages.replaceChildren();let t=!0;for(const i of e.feedbackMessages)t||this.obsFeedbackBoxMessages.appendChild(document.createElement("br")),t=!1,this.obsFeedbackBoxMessages.appendChild(i)})),this.originWatcher.getStreamWatcher().streamDataUpdate.listen((e=>{this.obsStreamStatsBlock.style.display="",this.obsStreamRegion.innerText=p.R.obsConnectionDescription(e.host,e.region,e.streamType),this.obsStreamGraphFPSDisp.innerText=p.R.obsFPS(Math.round(e.fps)),this.obsStreamGraphBitrateDisp.innerText=p.R.obsBitrate(Math.round(e.bitrate)),this.obsDetailsBoxTimeDisp.innerText=`${e.streamTime}`,this.obsDetailsBoxResDisp.innerText=`${e.videoWidth}x${e.videoHeight}`,this.obsDetailsBoxCodecVideo.innerText=`${e.videoCodec}`,this.obsDetailsBoxCodecAudio.innerText=`${e.audioCodec}`})),this.originWatcher.roomStatusUpdate.listen((e=>{this.updateRoomStatus(e)}))}monitorRoomStatus(){void 0!==this.monitorTimeout&&clearTimeout(this.monitorTimeout);const e=`api/get_my_broadcast_status/${void 0!==this.roomNameStaffView?`${this.roomNameStaffView}/`:""}${"offline"===this.roomStatus?"?auth=1":""}`;(0,a.KF)(e,{}).then((e=>{const t=JSON.parse(e.responseText);this.originWatcher.isConnected()||this.updateRoomStatus(t.status);const i=t.errors;if(null!=i&&"offline"===t.status){this.obsStreamRejected.style.display="";let e="Your stream was recently rejected for the following reasons:
";void 0!==i.reasons&&i.reasons.forEach((t=>{switch(t){case"ratio":e=`${e}Having an incorrect ratio, please either broadcast at 4:3 or 16:9.
`;break;case"height":e=`${e}Having an invalid height of ${T(i.height,"Unknown")} pixels, the stream height must be between 240 and 2160 pixels.
`;break;case"codec_video":e=`${e}Having an invalid video codec of ${T(w[T(i.video_codec,"")],"Unknown")}, the stream must use the H.264 video codec baseline, main or high 4:2:0.
`;break;case"codec_audio":e=`${e}Having an invalid video codec of ${T(C[T(i.audio_codec,"")],"Unknown")} the stream must use the AAC audio codec.
`;break;case"high_res_fps":e=`${e}Having a high frame rate and resolution. Resolutions above 1080p are limited to 30fps.
`;break;case"video_fps":e=`${e}Having an invalid video fps of ${Math.round(T(i.video_fps,0))} the stream must be at least 24 fps.
`;break;default:e=`${e}An unknown reason.
`}})),this.obsStreamRejectedReason.innerHTML=e}const s=t.origin,n=t.username,o=t.originPassword,r=t.status;void 0!==s&&void 0!==n&&void 0!==o&&void 0!==r&&(!this.originWatcher.isConnected()||this.originWatcher.getOrigin()!==s&&"offline"!==r)&&this.originWatcher.update(s,n,o)})).catch(c.yZ),this.monitorTimeout=window.setTimeout((()=>{this.monitorRoomStatus()}),1e4)}createOBSVideo(){const e=document.createElement("div"),t=document.createElement("span"),i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div"),a=this.createDetailsBox(),l=this.createDetailsBox(),h=this.createDetailsBox(),c=document.createElement("div");e.appendChild(i),i.appendChild(this.obsRoomStatusBlock),this.obsRoomStatusContainer.appendChild(t),this.obsRoomStatusContainer.appendChild(this.obsRoomStatus),this.obsRoomStatusBlock.appendChild(this.obsRoomStatusContainer),this.obsRoomStatusBlock.appendChild(this.obsExitAway),i.appendChild(s),s.appendChild(this.obsStreamRejected),s.appendChild(this.statsLoadingMessage),s.appendChild(this.obsStreamStatsBlock),this.obsStreamStatsBlock.appendChild(n),n.appendChild(this.obsStreamFeedbackBox),this.obsStreamStatsBlock.appendChild(r),r.appendChild(a),this.resolutionFloatBox.appendChild(this.resolutionFloatBoxText),r.appendChild(l),r.appendChild(h),this.obsStreamStatsBlock.appendChild(c),c.appendChild(this.obsStreamGraphFPS),c.appendChild(this.obsStreamGraphBitrate),this.obsStreamStatsBlock.appendChild(this.obsStreamRegion),s.appendChild(this.obsStreamStatsOther),this.element.appendChild(e),r.style.lineHeight="18px",(0,o.fZ)(t,"roomStatusLabel"),t.innerText=p.R.yourStreamIsCurrently,this.obsRoomStatusContainer.style.textAlign="center",this.obsRoomStatusContainer.style.display="none",this.obsRoomStatusContainer.style.fontSize="1.1em",this.obsRoomStatusContainer.style.paddingTop="20px",(0,o.fZ)(this.obsRoomStatus,"roomStatus"),this.obsRoomStatus.style.fontWeight="bolder",i.style.font="1.2em/1.4em 'UbuntuRegular', Arial, Helvetica, sans-serif",i.style.height="460px",this.obsStreamStatsBlock.style.display="none",this.obsRoomStatusBlock.style.height="145px",this.obsRoomStatusBlock.style.lineHeight="1em",this.obsRoomStatusBlock.style.textAlign="center",(0,o.fZ)(this.obsStreamRegion,"streamRegion"),this.obsStreamRegion.style.textAlign="left",this.obsStreamRegion.style.fontSize="9px",this.obsStreamRegion.style.paddingLeft="5px",s.style.fontWeight="normal",r.style.width="100%",r.style.padding="8px",r.style.height="55px",r.style.boxSizing="border-box",r.style.textAlign="center",c.style.width="100%",c.style.height="110px",c.style.padding="3px",c.style.boxSizing="border-box",c.style.marginTop="5px",this.obsStreamGraphFPS.style.cssFloat="left",this.obsStreamGraphFPS.style.width="240px",this.obsStreamGraphFPS.style.textAlign="center",(0,u.Ve)(this.obsStreamGraphFPS,"background 500ms ease-in-out"),this.obsStreamGraphBitrate.style.cssFloat="right",this.obsStreamGraphBitrate.style.width="240px",this.obsStreamGraphBitrate.style.textAlign="center",(0,u.Ve)(this.obsStreamGraphBitrate,"background 500ms ease-in-out"),this.obsExitAway.style.fontSize="0.9em",this.obsExitAway.style.lineHeight="1.4em",this.obsExitAway.style.maxWidth="90%",this.obsExitAway.style.margin="10px auto 0",this.obsExitAway.style.display="none",n.style.width="100%",n.style.padding="5px",n.style.boxSizing="border-box",this.obsStreamFeedbackBox.style.width="85%",this.obsStreamFeedbackBox.style.padding="5px",this.obsStreamFeedbackBox.style.textAlign="center",this.obsStreamFeedbackBox.style.fontSize="12px",this.obsStreamFeedbackBox.style.margin="4px auto 0",(0,o.fZ)(this.obsStreamRejected,"streamRejected"),this.obsStreamRejected.style.display="none",this.obsStreamRejected.style.width="85%",this.obsStreamRejected.style.padding="5px",this.obsStreamRejected.style.textAlign="center",this.obsStreamRejected.style.color="#ffffff",this.obsStreamRejected.style.fontSize="14px",this.obsStreamRejected.style.margin="15px auto 0",this.obsStreamRejected.style.borderWidth="1px",this.obsStreamRejected.style.borderStyle="solid",this.resolutionFloatBox.style.display="none",this.resolutionFloatBox.style.fontSize="16px",this.resolutionFloatBox.style.width="33px",this.resolutionFloatBox.style.height="23px",this.resolutionFloatBox.style.borderRadius="3px",this.resolutionFloatBox.style.position="absolute",this.resolutionFloatBox.style.right="2px",this.resolutionFloatBox.style.top="10px",this.resolutionFloatBox.style.fontWeight="bold",this.resolutionFloatBox.style.textAlign="center",this.resolutionFloatBoxText.style.padding="10% 0";const m=document.createElement("p");(0,o.fZ)(m,"obsAwayMessage"),m.innerText=p.R.obsAwayMessage,m.style.margin="3px";const g=this.createLink("Exit Away Mode");(0,o.fZ)(g,"exitAwayLink"),g.style.fontSize="1.6em",g.onclick=e=>{e.preventDefault(),(0,d.vZ)()},this.obsExitAway.appendChild(m),this.obsExitAway.appendChild(g);const v=document.createElement("h4");v.innerText=p.R.streamRejected,this.obsStreamRejected.appendChild(v),this.obsStreamRejected.appendChild(this.obsStreamRejectedReason);const f=document.createElement("p");(0,o.fZ)(f,"waitingMessage"),f.innerText=p.R.waitingforStreamStats,f.style.textAlign="center";const y=document.createElement("img");y.src=`${STATIC_URL}ellipsis.svg`,y.style.height="110px",y.style.width="auto",y.style.opacity="0.5",y.style.margin="0 auto",y.style.display="block",this.statsLoadingMessage.appendChild(f),this.statsLoadingMessage.appendChild(y),this.obsFeedbackBoxHeader.innerText=p.R.streamStatusUnknown,this.obsFeedbackBoxHeader.style.color="inherit",this.obsFeedbackBoxHeader.style.fontWeight="bold",this.obsFeedbackBoxHeader.style.fontSize="15px",this.obsFeedbackBoxHeader.style.margin="3px",this.obsStreamFeedbackBox.appendChild(this.obsFeedbackBoxHeader),this.obsStreamFeedbackBox.appendChild(this.obsFeedbackBoxMessages),this.obsStreamFeedbackBox.style.display="none",(0,o.fZ)(a,"resolutionText");const b=document.createElement("span");b.innerText=p.R.resolutionLabel,a.appendChild(b),a.appendChild(document.createElement("br")),this.obsDetailsBoxResDisp=document.createElement("span"),this.obsDetailsBoxResDisp.style.fontSize="0.8em",a.appendChild(this.obsDetailsBoxResDisp),a.appendChild(this.resolutionFloatBox);const w=document.createElement("span");w.innerText=p.R.streamTime,l.appendChild(w),l.appendChild(document.createElement("br")),this.obsDetailsBoxTimeDisp=document.createElement("span"),this.obsDetailsBoxTimeDisp.style.fontSize="0.8em",l.appendChild(this.obsDetailsBoxTimeDisp),(0,o.fZ)(h,"codecText");const C=document.createElement("span");C.innerText=p.R.codec,h.appendChild(C),h.appendChild(document.createElement("br")),this.obsDetailsBoxCodecVideo=document.createElement("span"),this.obsDetailsBoxCodecVideo.style.fontSize="10px",this.obsDetailsBoxCodecVideo.style.lineHeight="1",this.obsDetailsBoxCodecVideo.style.display="block",this.obsDetailsBoxCodecVideo.style.marginTop="2px",this.obsDetailsBoxCodecAudio=document.createElement("span"),this.obsDetailsBoxCodecAudio.style.fontSize="10px",this.obsDetailsBoxCodecAudio.style.lineHeight="1",this.obsDetailsBoxCodecAudio.style.display="block",this.obsDetailsBoxCodecAudio.style.marginTop="2px",h.appendChild(this.obsDetailsBoxCodecVideo),h.appendChild(this.obsDetailsBoxCodecAudio);const S=document.createElement("span");S.innerText=p.R.frameRate,this.obsStreamGraphFPSDisp.style.fontWeight="bold";const x=document.createElement("canvas");x.style.width="235px",x.style.height="80px",x.id="fps_chart",this.obsStreamGraphFPS.appendChild(S),this.obsStreamGraphFPS.appendChild(this.obsStreamGraphFPSDisp),this.obsStreamGraphFPS.appendChild(x);const T=document.createElement("span");T.innerText=p.R.bitrate,this.obsStreamGraphBitrateDisp.style.fontWeight="bold";const A=document.createElement("canvas");A.style.width="235px",A.style.height="80px",A.id="bitrate_chart",this.obsStreamGraphBitrate.appendChild(T),this.obsStreamGraphBitrate.appendChild(this.obsStreamGraphBitrateDisp),this.obsStreamGraphBitrate.appendChild(A),this.obsStreamStatsOther.appendChild(this.obsAlternativeStreamType),this.obsStreamStatsOther.style.display="none",this.obsAlternativeStreamType.style.textAlign="center",this.obsAlternativeStreamType.style.height="260px",this.obsAlternativeStreamType.style.marginTop="40px",this.updateAlternativeStreamType("Unknown")}updateAlternativeStreamType(e){this.obsAlternativeStreamType.innerText=p.R.obsAlternativeStreamType(e)}createDetailsBox(){const e=document.createElement("div");return e.style.width="33%",e.style.cssFloat="left",e.style.height="30px",e.style.lineHeight="18px",e.style.position="relative",e}styleResolutionFloatBox(e){switch(this.resolutionFloatBox.style.display="",e){case f.obsSD:this.resolutionFloatBox.style.backgroundColor="#e67e22",this.resolutionFloatBox.style.color="#fff";break;case f.obsHD:this.resolutionFloatBox.style.backgroundColor="#27ae60",this.resolutionFloatBox.style.color="#fff";break;case f.obsHDPlus:this.resolutionFloatBox.style.backgroundColor="#16a085",this.resolutionFloatBox.style.color="#fff";break;case f.obs4k:this.resolutionFloatBox.style.backgroundColor="#2980b9",this.resolutionFloatBox.style.color="#f1c40f"}}styleFeedbackBox(e){switch(this.obsStreamFeedbackBox.className="",this.obsStreamFeedbackBox.style.display="",this.obsStreamFeedbackBox.style.borderWidth="1px",this.obsStreamFeedbackBox.style.borderStyle="solid",e){case y.none:this.obsStreamFeedbackBox.style.display="none";break;case y.good:(0,o.fZ)(this.obsStreamFeedbackBox,"goodFeedback");break;case y.warning:(0,o.fZ)(this.obsStreamFeedbackBox,"warningFeedback");break;case y.bad:(0,o.fZ)(this.obsStreamFeedbackBox,"badFeedback")}}styleGraph(e,t){switch(t){case y.none:e.style.backgroundColor="";break;case y.good:e.style.backgroundColor="rgba(46, 204, 113, 0.49)";break;case y.warning:e.style.backgroundColor="rgba(230, 126, 34, 0.61)";break;case y.bad:e.style.backgroundColor="rgba(231, 76, 60, 0.58)"}}updateRoomStatus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";-1!==["offline","public","private","group","away","hidden","password protected"].indexOf(e)?("offline"!==e?(this.obsControl.style.marginTop="0",this.obsStreamRejected.style.display="none",this.backToWebRTC.style.display="none","offline"===this.roomStatus&&(n.I1.fire(!0),this.obsStarted.fire(void 0))):(this.obsControl.style.marginTop="-12px",(0,s.YU)()&&!(0,s.BS)()&&(this.backToWebRTC.style.display=""),"offline"!==this.roomStatus&&(n.I1.fire(!1),clearTimeout(this.monitorTimeout),this.monitorTimeout=window.setTimeout((()=>{this.monitorRoomStatus()}),2e3))),this.roomStatus=e,this.obsRoomStatus.innerText=e,this.styleOBSRoomStatus(e)):this.roomStatus="unknown",this.obsExitAway.style.display="away"===e?"":"none"}styleOBSRoomStatus(e){switch(this.obsRoomStatusContainer.style.display="",this.obsStreamStatsOther.style.display="none",this.obsRoomStatusBlock.className="",e){case"offline":(0,o.fZ)(this.obsRoomStatusBlock,"offlineBlock");break;case"public":(0,o.fZ)(this.obsRoomStatusBlock,"publicBlock");break;case"private":(0,o.fZ)(this.obsRoomStatusBlock,"privateBlock");break;case"group":(0,o.fZ)(this.obsRoomStatusBlock,"groupBlock");break;case"away":(0,o.fZ)(this.obsRoomStatusBlock,"awayBlock");break;case"hidden":(0,o.fZ)(this.obsRoomStatusBlock,"hiddenBlock");break;case"password protected":(0,o.fZ)(this.obsRoomStatusBlock,"passwordProtectedBlock")}}createOtherStreamOptions(){this.element.appendChild(this.obsControl),this.obsControl.appendChild(this.backToWebRTC),this.obsControl.appendChild(this.obsInfo),this.obsControl.style.paddingTop="7px",this.obsControl.style.width="100%",this.obsControl.style.height="8%",this.obsControl.style.marginTop="-12px",this.obsControl.style.textAlign="center",this.backToWebRTC.style.paddingLeft="5px",this.obsInfo.style.display="block",this.backToWebRTC.onclick=()=>{this.webBroadcaster()}}webBroadcaster(){"private"===this.roomStatus||"group"===this.roomStatus?(0,r.mf)(`Warning! This will end your ${this.roomStatus} show. Are you sure?`,(()=>{""===window.location.search?window.location.reload():window.location.search=""})):""===window.location.search?window.location.reload():window.location.search=""}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}createLink(e){const t=document.createElement("a");return(0,o.fZ)(t,o.aG.hrefColor),t.innerText=e,t.style.padding="0 10px",t.style.fontWeight="bold",t.style.font="1.1em/1.2em 'UbuntuRegular', Arial, Helvetica, sans-serif",t.style.cursor="pointer",t}getOBSInfoLink(){return this.obsInfo}isOffline(){return"offline"===this.roomStatus}}const I=new h.c_("showOBSOverlay")},6176:(e,t,i)=>{"use strict";i.d(t,{q:()=>v,s:()=>g});var s=i(7063),n=i(7871),o=i(9447),r=i(718),a=i(213),l=i(5216),h=i(2939),d=i(8423),c=i(1452),u=i(4947),p=i(5389),m=i(4354);const g=new d.c_("reloadAppTab",{maxHistorySize:1});class v extends m.y{constructor(e){super(),this.roomDossier=e,(0,o.fZ)(this.element,"appsTab"),h.BR.listen((()=>{this.showing&&this.load()})),h.X0.listen((e=>{e.chatConnection.event.appTabRefresh.listen((()=>{this.showing&&this.load()}))})),g.listen((()=>{this.showing&&this.load()}))}createContent(e){}createCbappsTable(e){const t=document.createElement("table");(0,o.fZ)(t,"table"),t.dataset.testid="cb-panel",t.style.width="850px",t.style.borderWidth="1px",t.style.borderStyle="solid",t.style.borderRadius="5px 5px 0 0",t.style.borderSpacing="0",t.appendChild(this.createCbappsTableHeader()),t.appendChild(this.createCbappsTableFooter());const i=document.createElement("tbody");t.appendChild(i);const s=[`${u.R.activeApp}:`,`${u.R.bot1}:`,`${u.R.bot2}:`,`${u.R.bot3}:`,`${u.R.bot4}:`,`${u.R.bot5}:`];for(let t=0;t{e.preventDefault(),(0,p.gr)(f.href,"_blank",p.fp)},f.innerText=h?u.R.chooseAnApp:u.R.chooseABot):((0,o.fZ)(f,"deactivate"),f.name=`/app/stop/${t}`,f.innerText=u.R.deactivateText,f.href="#",f.onclick=e=>{e.preventDefault(),(0,l.KF)(`app/stop/${t}/`,{}).then((()=>{this.load()})).catch((()=>{(0,a.Q$)("Error deactivating app")}))}),void 0!==r){const e=document.createElement("span"),i=document.createElement("a");(0,o.fZ)(e,"orText"),e.innerText=` ${u.R.orSimple} `,(0,o.fZ)(i,o.aG.hrefColor),i.innerText=`${u.R.restart} "${r.app_name}"`,i.href=(0,l._Y)(`/app/startup/${r.app_slug}/?version=${r.app_version}&slot=${t}`),i.onclick=e=>{e.preventDefault(),(0,p.gr)(i.href,"_blank",p.fp)},v.appendChild(e),v.appendChild(i)}c.style.width="150px",v.style.textAlign="right",i.appendChild(d),c.appendChild(m),d.appendChild(c),d.appendChild(g),d.appendChild(v)}return t}createCbappsTableHeader(){const e=document.createElement("thead"),t=document.createElement("tr"),i=document.createElement("th");return i.dataset.testid="cbapps-header",i.colSpan=3,i.innerText=`v1 ${u.R.appsAndBots}`,i.style.textAlign="left",i.style.fontSize="13px",i.style.borderRadius="5px 5px 0 0",i.style.padding="7px 10px",i.style.fontWeight="normal",(0,o.fZ)(i,"header"),t.appendChild(i),e.appendChild(t),e}createCbappsTableFooter(){const e=document.createElement("tfoot"),t=document.createElement("tr"),i=document.createElement("td");return i.dataset.testid="cbapps-footer",i.innerHTML=u.R.v1AppsAndBotsFooterText(),i.colSpan=3,i.style.padding="7px 10px",i.style.fontSize="12px",t.appendChild(i),e.appendChild(t),e}loadContent(e,t){const i=document.createElement("div"),s=document.createElement("p");s.style.color="red",s.style.fontSize="18px",this.element.appendChild(i);const n=document.createElement("p");if(n.style.width="580px",n.style.fontSize="13px",n.style["-webkit-font-smoothing"]="antialiased",n.innerHTML=u.R.appsTabDescription,n.dataset.test="apps-description",i.appendChild(n),void 0!==t){const e={authUrl:this.roomDossier.aspAuthUrl,savedApps:[]};e.savedApps=t.items,i.appendChild(new r.p1(e).render())}else s.textContent=u.R.appsLoadingErrorV2,i.appendChild(s);i.appendChild(document.createElement("br")),void 0!==e?i.appendChild(this.createCbappsTable(e)):(s.textContent=u.R.appsLoadingError,i.appendChild(s))}fetchCbappsData(){const e="api/ts/chat/app-and-bots/";return this.fetchData(e).then((t=>new Promise(((i,s)=>{try{i(this.parseData(t.responseText))}catch(t){error("Error parsing response from resource",{path:e,reason:t.toString()}),s(t)}}))))}load(){this.showingError=!1,Promise.all((0,c.rO)([this.fetchCbappsData(),(0,n.L8)()])).then((e=>{this.clearContent(),e.every((e=>"rejected"===e.status))?this.showErrorMessage():this.loadContent(...e.map((e=>e.value)))})).catch((()=>{}))}parseData(e){const t=new s.N6(e),i={slot0:t.getStringOrUndefined("slot0"),slot1:t.getStringOrUndefined("slot1"),slot2:t.getStringOrUndefined("slot2"),slot3:t.getStringOrUndefined("slot3"),slot4:t.getStringOrUndefined("slot4"),slot5:t.getStringOrUndefined("slot5"),previous_app_0:this.parsePreviousApp(t.getObjectStringOrUndefined("previous_app_0")),previous_app_1:this.parsePreviousApp(t.getObjectStringOrUndefined("previous_app_1")),previous_app_2:this.parsePreviousApp(t.getObjectStringOrUndefined("previous_app_2")),previous_app_3:this.parsePreviousApp(t.getObjectStringOrUndefined("previous_app_3")),previous_app_4:this.parsePreviousApp(t.getObjectStringOrUndefined("previous_app_4")),previous_app_5:this.parsePreviousApp(t.getObjectStringOrUndefined("previous_app_5"))};return t.logUnusedDebugging("AppsAndBotsTab"),i}parsePreviousApp(e){if(void 0===e)return;const t=new s.N6(e);return{app_slug:t.getString("app_slug"),app_version:t.getString("app_version"),app_name:t.getString("app_name")}}}},4354:(e,t,i)=>{"use strict";i.d(t,{y:()=>a});var s=i(5216),n=i(2709),o=i(4947),r=i(2945);class a extends n.u{constructor(){super(),this.loadingMsg=document.createElement("div"),this.errorMsg=document.createElement("div"),this.showing=!1,this.showingError=!1,this.params={},this.pathname="",this.element.style.position="static",this.element.style.minHeight="325px",this.element.style.margin="14px",this.element.style.boxSizing="border-box",this.element.style.width="",this.element.style.height="",this.element.style.paddingLeft="8px",this.loadingMsg.innerText=`${o.R.loadingText}…`,this.loadingMsg.style.fontSize="1.2em",this.errorMsg.innerText="An error occurred trying to load this tab",this.errorMsg.style.fontSize="1.2em"}setResourceUrl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.pathname=e,this.params=t}clearContent(){this.removeAllDOMChildren()}load(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;if(this.showingError=!1,""===this.pathname)return this.clearContent(),void this.createContent({});e&&(this.clearContent(),this.element.appendChild(this.loadingMsg));const i=(0,r.Go)(this.params);this.fetchData(`${this.pathname}?${i}`).then((i=>{let s;try{s=this.parseData(i.responseText)}catch(e){return this.showErrorMessage(),void error("Error parsing response from resource",{path:this.pathname,reason:e.toString()})}e&&this.loadingMsg.parentElement===this.element&&this.element.removeChild(this.loadingMsg),this.clearContent(),this.createContent(s),void 0!==t&&t()})).catch((e=>{error("Fetch data error",{pathname:this.pathname,reason:e.toString()}),this.showErrorMessage()}))}fetchData(e){return(0,s.Aw)(e)}showErrorMessage(){this.clearContent(),this.showingError=!0,this.element.appendChild(this.errorMsg)}showLoadingMessage(){this.clearContent(),this.element.appendChild(this.loadingMsg)}show(e,t){this.showing=!0,this.element.style.display="",this.load(!0,t)}hide(){this.showing=!1,this.element.style.display="none"}}},1650:(e,t,i)=>{"use strict";i.d(t,{zc:()=>T,li:()=>A,J9:()=>x});var s=i(9447),n=i(7872),o=i(8746),r=i(5216),a=i(5581),l=i(1918),h=i(3955),d=i(9268),c=i(4947),u=i(2945),p=i(5389),m=i(9523),g=i(816),v=i(6861),f=i(6440),y=i(7882);class b extends o.O{constructor(e,t,i,s,n){super(e,t,{...i,styles:{field:new w,input:new w,select:new C,multipleSelect:new S}}),this.roomName=s,this.canUpload=n,this.element.style.marginLeft="50px";const o=this.getField("gender"),r=this.getField("subgender"),a=e=>{if(void 0!==r){const t=r.getWidget();e.value===y.YT.OldTrans||e.value===y.YT.Trans?t.style.display="inline":(t.style.display="none",t.value="")}};if(this.placeSubgenderField(),void 0!==o){const e=o.getWidget();a(e),o.setOnChange((()=>{e.value===y.YT.Couple?o.updateLabelText(c.R.sexTextCouple):o.updateLabelText(c.R.sexText),a(e)}))}this.addField(new g.ib({name:"pics_and_videos",labelText:c.R.picsAndVideosText,customElement:this.createPicsAndVideos()})),this.setSubmitText(c.R.updateBio),this.setTestIds()}setTestIds(){const e={real_name:"bio-tab-real-name",gender:"bio-tab-gender",subgender:"bio-tab-subgender",location:"bio-tab-location",spoken_languages:"bio-tab-spoken-languages",body_type:"bio-tab-body-type",smoke_drink:"bio-tab-smoke-drink",body_decorations:"bio-tab-body-decorations",about_me:"bio-tab-about-me",wish_list:"bio-tab-wish-list"},t=this.getField("interested_in").getField().getElementsByClassName("checkboxFieldLabel");for(const t in e){const i=this.getField(t);void 0!==i&&(i.getWidget().dataset.testid=e[t])}for(const e of t){var i,s;e.children[0].dataset.testid=`bio-tab-interested-in-${null===(i=e.lastChild)||void 0===i||null===(i=i.nodeValue)||void 0===i?void 0:i.toLowerCase()}-container`,e.children[0].children[0].dataset.testid=`bio-tab-interested-in-${null===(s=e.lastChild)||void 0===s||null===(s=s.nodeValue)||void 0===s?void 0:s.toLowerCase()}`}if((0,f.f)("SpknLng")){const e=this.getField("spoken_languages_strict").getWidgetContainer().getElementsByClassName("checkboxFieldLabel");for(const t of e){const e=t.children[0],i=e.children[0];e.dataset.testid=`bio-tab-spoken-languages-${i.value}-container`,i.dataset.testid=`bio-tab-spoken-languages-${i.value}`}}}placeSubgenderField(){const e=this.getField("gender"),t=this.getField("subgender");if(void 0!==e&&void 0!==t){const i=e.getField().querySelector("td"),s=t.getField().querySelector("td");null!==i&&null!==s&&s.childNodes.forEach((e=>i.appendChild(e)))}}createPicsAndVideos(){const e=document.createElement("div");e.style.paddingTop="9px";const t=document.createElement("a"),i=document.createElement("a"),s=document.createElement("a");if(t.innerText=c.R.uploadNewPics,t.href=(0,r._Y)("/photo_videos/photoset/create/"),t.onclick=e=>{e.preventDefault(),(0,p.gr)(t.href,"_blank",p.rR)},t.dataset.testid="upload-new-pics",i.innerText=c.R.uploadNewVideos,i.href=(0,r._Y)("/photo_videos/photoset/create/video/"),i.target="_blank",i.onclick=e=>{e.preventDefault(),(0,p.gr)(i.href,"_blank",p.rR)},i.dataset.testid="upload-new-videos",s.innerText=c.R.managePhotoSet,s.href=(0,r._Y)(`/photo_videos/photoset/list_popup/${this.roomName}/`),s.onclick=e=>{e.preventDefault(),(0,p.gr)(s.href,"_blank",p.rR)},s.dataset.testid="manage-photo-sets",this.canUpload)e.appendChild(t),e.appendChild(this.createSeparator()),e.appendChild(i);else{const t=document.createElement("span");t.style.fontSize="14px",t.style.color="black",t.innerHTML=c.R.mustBeAgeVerifiedToUploadContent(),e.appendChild(t)}return e.appendChild(this.createSeparator()),e.appendChild(s),e}createSeparator(){const e=document.createElement("span");return(0,s.fZ)(e,"separator"),e.style.fontSize="12px",e.innerText=" | ",e}}class w extends v.Dr{styleField(e){super.styleField(e),(0,s.SA)(e,"field"),(0,s.fZ)(e,"fieldInput")}}class C extends w{styleField(e){super.styleField(e),e.style.width=""}}class S extends w{styleField(e){(0,s.fZ)(e,"fieldInput")}}const x="RefreshBroadcastBioTabSocialMedia";var T;!function(e){e[e.VIEW_BIO=0]="VIEW_BIO",e[e.EDIT_BIO=1]="EDIT_BIO"}(T||(T={}));class A extends l.x{constructor(e,t,i){super(),this.isAgeVerified=t,this.canUpload=i,this.state=T.VIEW_BIO,this.editQueryChecked=!1,window[x]=()=>{this.load(!1)},window.RefreshBroadcastBioTabPicsAndVideo=()=>{this.load(!1)},this.element.id="tabs_content_container"}load(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;super.load(e,(()=>{void 0!==t&&t(),this.editQueryChecked||(this.editQueryChecked=!0,"bio"===(0,u.JO)(window.location.search).edit&&this.setState(T.EDIT_BIO))}))}show(){this.element.style.display="",this.element.style.margin="0 0 14px",this.showingError&&this.load(),this.repositionChildren()}hide(){this.element.style.display="none"}parseData(e){return this.state===T.VIEW_BIO?(0,a.Fk)(e,this.room):o.Z.parseData(e)}createContent(e){this.state===T.VIEW_BIO?this.createBioContents(e):this.state===T.EDIT_BIO&&this.createEditBio(e)}createEditBio(e){this.createPreHeaderContent();const t=new b(e,"api/ts/accounts/editbio/",{onSubmitSuccess:e=>{if(m.ek.fire({gender:String(e.get("gender")),subgender:String(e.get("subgender"))}),null!==e.get("spoken_languages_strict")){const e=document.querySelector("a#edit-spoken-language + .dismiss_notice");null!==e&&(0,n.zD)(e)}this.setState(T.VIEW_BIO)}},this.room,this.canUpload);this.editBroadcastForm=t,this.element.appendChild(t.element),t.focusFirstField()}createSeparator(){const e=document.createElement("span");return(0,s.fZ)(e,"separator"),e.style.fontSize="14px",e.innerText=" | ",e}generateSocialMediaSection(e,t){const i=super.generateSocialMediaSection(e,t);return this.isAgeVerified||i.querySelectorAll(".socialMediaUpload").forEach((e=>{e.style.opacity="0.6"})),i}generateSocialMediaLinks(e,t){const i=super.generateSocialMediaLinks(e,t);if(t&&i.appendChild(this.createSeparator()),this.isAgeVerified){const e=document.createElement("a");(0,s.fZ)(e,s.aG.hrefColor),e.href=(0,r._Y)("/socials/social_media/create/"),e.onclick=t=>{t.preventDefault(),(0,p.gr)(e.href,"_blank",p.rR)},e.innerText=c.R.addNewSocialMedia,e.style.fontSize="14px",e.dataset.testid="add-more",i.appendChild(e)}else{const e=document.createElement("span");e.style.fontSize="14px",e.innerHTML=c.R.mustBeAgeVerifiedToAddSocialMedia(),i.appendChild(e)}return i}generatePicsLinks(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"photo";const n=document.createElement("div");if(t){const t=(new d.QC).anchor,i=`/photo_videos/photoset/list_popup/${e}/`;(0,s.fZ)(t,s.aG.hrefColor),t.href=(0,r._Y)(i),t.innerText=c.R.showMoreText,t.style.fontSize="14px",t.style.cursor="pointer",(0,h._W)(t),t.onclick=e=>{e.preventDefault(),(0,p.gr)(t.href,"_blank",p.rR)},n.appendChild(t),n.appendChild(this.createSeparator())}const o=(e,t)=>{const n=document.createElement("a");return(0,s.fZ)(n,s.aG.hrefColor),n.href=(0,r._Y)(t),n.onclick=e=>{e.preventDefault(),(0,p.gr)(n.href,"_blank",p.rR)},n.innerText=e,n.style.fontSize="14px",n.dataset.testid=`upload-new-${i}`,n};if(this.canUpload)"photo"===i?n.appendChild(o(c.R.uploadNewPics,"/photo_videos/photoset/create/")):n.appendChild(o(c.R.uploadNewVideos,"/photo_videos/photoset/create/video/"));else{const e=document.createElement("span");e.style.fontSize="14px",e.innerHTML=c.R.mustBeAgeVerifiedToUploadContent(),n.appendChild(e)}return n}handlePictureClick(e,t,i){e.preventDefault(),(0,p.gr)(i,"_blank",p.rR)}createFollowersSection(e){const t=`${isNaN(e)?"0":e.toString()}`;return this.createSection(c.R.followersText,t,!0)}shouldShowSocialMediaSection(e){return!0}shouldShowPicsSection(e){return!0}createBioContents(e){this.createPreHeaderContent(),super.createBioContents(e,this.canUpload)}createPreHeaderContent(){if(this.state===T.VIEW_BIO){const e=document.createElement("a");this.element.appendChild(e),e.style.cursor="pointer",e.style.display="inline-block",e.style.margin="14px 14px 0",e.innerText=c.R.editYourBio,e.className="editbio",e.onclick=e=>{this.setState(T.EDIT_BIO)}}else if(this.state===T.EDIT_BIO){const e=document.createElement("a");this.element.appendChild(e),e.style.cursor="pointer",e.style.display="inline-block",e.style.margin="14px 14px 0",e.innerText=c.R.cancelText,e.onclick=e=>{this.setState(T.VIEW_BIO)}}}setState(e,t){if(e===this.state)return null==t?void 0:t.call(void 0);e===T.VIEW_BIO?(this.state=T.VIEW_BIO,this.setResourceUrl(`api/biocontext/${this.room}/`),this.load(!1,t)):e===T.EDIT_BIO&&(this.state=T.EDIT_BIO,this.setResourceUrl("api/ts/accounts/editbio/"),this.load(!1,t))}fetchData(e){return this.state===T.VIEW_BIO||this.state===T.EDIT_BIO?(0,r.Aw)(e):super.fetchData(e)}}},2028:(e,t,i)=>{"use strict";i.d(t,{Nn:()=>c,W_:()=>a,s9:()=>d});var s=i(7623),n=i(7407),o=i(4947);const r=[[640,360],[960,540],[1280,720]];function a(e,t){return void 0===t&&(t=200),e.forEach((e=>{e.stop()})),new Promise((e=>{window.setTimeout((()=>{e()}),t)}))}function l(e){return"Invalid constraint"===e.message||"OverconstrainedError"===e.name||"NotReadableError"===e.name}function h(e,t,i){if((0,s.OF)()&&(0,s.nr)()&&960===t&&540===i)return;const n=t/i;return{id:`${t}x${i}`,camId:e,label:`${t} x ${i}`,width:t,height:i,ratio:n,isWidescreen:n>1.4,isHD:i>=720}}function d(e,t){return new Promise(((i,s)=>{let d="DevicePermsOnLoadGranted",c="DevicePermsOnLoadDenied",u="PermanentDevicePermsOnLoadDenied";const p=Date.now();window.setTimeout((()=>{d="DevicePermsRequestGranted",c="DevicePermsRequestDenied",u="PermanentDevicePermsRequestDenied"}),1e3),navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then((c=>{a(c.getTracks(),t).then((()=>{navigator.mediaDevices.enumerateDevices().then((t=>{const c=Promise.all(t.map((t=>{if("videoinput"===t.kind){if(void 0!==e&&e)return(i=t.deviceId,new Promise(((e,t)=>{(function(e){return new Promise(((t,i)=>{navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:{exact:e}}}).then((e=>{let i;e.getTracks().forEach((e=>{void 0===i&&void 0!==e.getCapabilities&&(i=e.getCapabilities())})),a(e.getTracks()).then((()=>{t(i)})).catch((()=>{}))})).catch((e=>{l(e)?t(void 0):i(e)}))}))})(i).then((t=>{let s,n,o=!1;void 0!==t&&void 0!==t.width&&void 0!==t.height&&(s=[t.width.max,t.height.max],void 0!==t.resizeMode&&(o=t.resizeMode.some((e=>"crop-and-scale"===e)))),n=o&&void 0!==s?r.map((e=>new Promise((t=>{const i=e[0],n=e[1];void 0!==s&&i<=s[0]&&n<=s[1]?t([i,n]):t(void 0)})))):r.map((e=>{const t=e[0],s=e[1],n={audio:!1,video:{deviceId:{exact:i},width:{exact:t},height:{exact:s}}};return new Promise(((e,i)=>{navigator.mediaDevices.getUserMedia(n).then((i=>{a(i.getTracks()).then((()=>{e([t,s])})).catch((()=>{}))})).catch((t=>{l(t)?e(void 0):i(t)}))}))}));const d=n.reduce(((e,t)=>e.then((e=>t.then((t=>(void 0!==t&&e.push(t),Promise.resolve(e)))).catch((()=>[]))))),Promise.resolve([]));Promise.resolve(d).then((t=>{void 0!==s&&r.some((e=>void 0!==s&&e[0]===s[0]&&e[1]===s[1]))&&t[t.length-1][0]!==s[0]&&t[t.length-1][1]!==s[1]&&t.push(s);const n=new Map;t.forEach((e=>{const t=h(i,e[0],e[1]);void 0!==t&&n.set(t.id,t)})),e(n)})).catch((()=>{}))})).catch((e=>{t(e)}))}))).then((e=>Promise.resolve({device:t,resolutions:e}))).catch((e=>Promise.reject(e)));const s=new Map;return r.forEach((e=>{const i=h(t.deviceId,e[0],e[1]);void 0!==i&&s.set(i.id,i)})),Promise.resolve({device:t,resolutions:s})}var i;return Promise.resolve({device:t})}))),m={mics:new Map,cams:new Map};c.then((e=>{let t=!0;if(e.forEach((e=>{const i=e.device;""!==i.label&&(t=!1),"audioinput"===i.kind?m.mics.set(i.deviceId,{id:i.deviceId,label:i.label}):"videoinput"===i.kind&&void 0!==e.resolutions&&e.resolutions.size>0&&m.cams.set(i.deviceId,{id:i.deviceId,label:i.label,resolutions:e.resolutions})})),t){const e=o.R.permanentPermsMessage;return(0,n.bT)(u,{time_elapsed_ms:Date.now()-p}),void s(new Error(e))}(0,n.bT)(d,{time_elapsed_ms:Date.now()-p}),i(m)})).catch((e=>{s(e)}))})).catch((()=>{}))})).catch((()=>{}))})).catch((e=>{(0,n.bT)(c,{time_elapsed_ms:Date.now()-p}),s(e)}))}))}function c(){return navigator.mediaDevices.enumerateDevices().then((e=>{let t=!1,i=!1;return e.forEach((function(e){""!==e.label&&("audioinput"===e.kind&&(t=!0),"videoinput"===e.kind&&(i=!0))})),t&&i}))}},2922:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});var s=i(5216);const n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};(0,s.Aw)("api/ts/accounts/broadcaster_suspension/").then((t=>{JSON.parse(t.responseText).is_suspended?window.location.reload():e()})).catch((e=>{error(e.message)}))}},4941:(e,t,i)=>{"use strict";i.d(t,{I4:()=>n,jM:()=>d,tR:()=>c});var s=i(4947);function n(e){const t=e=>e>1?"s":"",i=Math.floor(e/3600),s=Math.floor((e%=3600)/60),n=e%60;return i>0?s>0?`${i} hour${t(i)}, ${s} minute${t(s)}`:`${i} hour${t(i)}`:s>0?n>0?`${s} minute${t(s)}, ${n} second${t(n)}`:`${s} minute${t(s)}`:n>0?`${n} second${t(n)}`:"less than a second"}const o=[{name:"year",seconds:31536e3,translation:s.R.years,ago:s.R.yearsAgo,fromNow:s.R.yearsFromNow},{name:"month",seconds:2592e3,translation:s.R.months,ago:s.R.monthsAgo,fromNow:s.R.monthsFromNow},{name:"week",seconds:604800,translation:s.R.weeks,ago:s.R.weeksAgo,fromNow:s.R.weeksFromNow},{name:"day",seconds:86400,translation:s.R.days,ago:s.R.daysAgo,fromNow:s.R.daysFromNow},{name:"hour",seconds:3600,translation:s.R.hours,ago:s.R.hoursAgo,fromNow:s.R.hoursFromNow},{name:"minute",seconds:60,translation:s.R.minutes,ago:s.R.minutesAgo,fromNow:s.R.minutesFromNow},{name:"second",seconds:1,translation:s.R.seconds,ago:s.R.secondsAgo,fromNow:s.R.secondsFromNow}],r=o.findIndex((e=>"hour"===e.name)),a=o.findIndex((e=>"minute"===e.name)),l=function(e){return 1===e?"":arguments.length>1&&void 0!==arguments[1]?arguments[1]:"s"},h=e=>e?"from now":"ago";function d(e,t){const i=t.getTime()-e.getTime();if(0===i)return s.R.now;const n=Math.floor(Math.abs(i)/1e3),r=i>0;if(n<60)return`${n} second${l(n)} ${h(r)}`;let a,d=0,c=0,u="";for(a=0;a86400&&a+1=i.seconds)return i.ago(Math.floor(t/i.seconds))}return s.R.now}(i):function(e){const t=((new Date).getTime()-e.getTime())/1e3,i=e=>{let i=t/o[e].seconds;var s;i=e===r?(s=i,Math.floor(10*s)/10):Math.floor(i);const n=e===r||e===a;return o[e].translation(i,n)};for(let e=0;e<=a;e+=1)if(t>=o[e].seconds)return i(e);return i(a)}(i)}},9523:(e,t,i)=>{"use strict";i.d(t,{Go:()=>r,eN:()=>n,ek:()=>a,pf:()=>l,ww:()=>o});var s=i(8423);const n=new s.c_("privateSettingsClicked"),o=new s.c_("spokenLanguageEditLinkClicked"),r=new s.c_("broadcastSettingsSaved"),a=new s.c_("genderSettingsSaved"),l=new s.c_("optInFlagDisplaySettingsSaved")},8806:(e,t,i)=>{"use strict";i.d(t,{Y9:()=>E,ni:()=>D,Ay:()=>L,vN:()=>B});var s=i(7623),n=i(3956),o=i(5216),r=i(2028),a=i(7407);const l=[];for(let e=0;e<256;++e)l[e]=(e+256).toString(16).substr(1);var h=i(213),d=i(8423),c=i(6440),u=i(9135),p=i(4947),m=i(78),g=i(2239),v=i(2945);const f={v:[{name:"version",reg:/^(\d*)$/,fmt:"%s"}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,fmt:"%s %s %d %s IP%d %s",names:["username","sessionId","sessionVersion","netType","ipVer","address"]}],s:[{name:"name",reg:/(.*)/,fmt:"%s"}],i:[{name:"description",reg:/(.*)/,fmt:"%s"}],u:[{name:"uri",reg:/(.*)/,fmt:"%s"}],e:[{name:"email",reg:/(.*)/,fmt:"%s"}],p:[{name:"phone",reg:/(.*)/,fmt:"%s"}],z:[{name:"timezones",reg:/(.*)/,fmt:"%s"}],r:[{name:"repeats",reg:/(.*)/,fmt:"%s"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,fmt:"%d %d",names:["start","stop"]}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,fmt:"IN IP%d %s",names:["version","ip"]}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,fmt:"%s:%s",names:["type","limit"]}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,fmt:"%s %d %s %s",names:["type","port","protocol","payloads"]}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],fmt:e=>void 0!==e.encoding?"rtpmap:%d %s/%s/%s":void 0!==e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],fmt:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,fmt:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],fmt:e=>void 0!==e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],fmt:"rtcp-fb:%d trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],fmt:e=>void 0!==e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],fmt:e=>"extmap:%d"+(void 0!==e.direction?"/%s":"%v")+(void 0!==e["encrypt-uri"]?" %s":"%v")+" %s"+(void 0!==e.config?" %s":"")},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/,fmt:"%s"},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],fmt:e=>void 0!==e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"},{name:"setup",reg:/^setup:(\w*)/,fmt:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,fmt:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,fmt:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,fmt:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*)/,fmt:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*)/,fmt:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/,fmt:"%s"},{name:"icelite",reg:/^(ice-lite)/,fmt:"%s"},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,fmt:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,fmt:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],fmt:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],fmt:e=>{let t="candidate:%s %d %s %d %s %d typ %s";return t+=void 0!==e.raddr?" raddr %s rport %d":"%v%v",t+=void 0!==e.tcptype?" tcptype %s":"%v",void 0!==e.generation&&(t+=" generation %d"),t+=void 0!==e["network-id"]?" network-id %d":"%v",t+=void 0!==e["network-cost"]?" network-cost %d":"%v",t}},{name:"endOfCandidates",reg:/^(end-of-candidates)/,fmt:"%s"},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,fmt:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,fmt:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],fmt:e=>{let t="ssrc:%d";return void 0!==e.attribute&&(t+=" %s",void 0!==e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],fmt:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],fmt:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],fmt:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/,fmt:"%s"},{name:"rtcpRsize",reg:/^(rtcp-rsize)/,fmt:"%s"},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],fmt:e=>void 0!==e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,fmt:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],fmt:e=>void 0!==e.params?"rid:%s %s %s":"rid:%s %s"},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],fmt:e=>"imageattr:%s %s %s"+(e.dir2?" %s %s":"")},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~,]+))?$"),names:["dir1","list1","dir2","list2"],fmt:e=>"simulcast:%s %s"+(e.dir2?" %s %s":"")},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],fmt:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,fmt:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],fmt:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/,fmt:"%s"},{name:"label",reg:/^label:(.+)/,fmt:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,fmt:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,fmt:"max-message-size:%s"},{name:"keywords",reg:/^keywds:(.+)$/,fmt:"keywds:%s"},{name:"content",reg:/^content:(.+)/,fmt:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,fmt:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,fmt:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,fmt:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],fmt:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"],reg:/(.*)/,fmt:"%s"}]},y=/(\r\n|\r|\n)/,b=/%[sdv%]/g,w=RegExp.prototype.test.bind(/^([a-z])=(.*)/),C=function(e){let t=1;const i=arguments,s=i.length;return e.replace(b,(e=>{if(t>=s)return e;const n=i[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(n);case"%d":return String(Number(n));case"%v":return""}return""}))},S=function(e,t,i){let s=t.fmt;if("function"==typeof t.fmt){let e=i;void 0===t.push&&void 0!==t.name&&(e=i[t.name]),s=t.fmt(e)}const n=[`${e}=${s}`];if(void 0!==t.names)for(let e=0;e!!e.reg.test(n)&&(function(e,t,i){void 0!==e.push&&void 0===t[e.push]?t[e.push]=[]:void 0!==e.name&&void 0!==e.names&&void 0===t[e.name]&&(t[e.name]={});let s={};void 0===e.push&&(s=void 0!==e.name&&void 0!==e.names?t[e.name]:t),function(e,t,i,s){if(null!==e)if(void 0!==s&&void 0===i)t[s]=x(e[1]);else if(void 0!==i)for(let s=0;s0&&void 0!==s&&(t=s.split(",")),this.forceVideoCodecs(e,t),this.videoCodecsOverriden=!0}}write(){return(0,c.f)("SDPLib")?(0,g.M9)(this.sdp):function(e,t){void 0===t&&(t={outerOrder:T,innerOrder:A}),void 0===e.version&&(e.version=0),void 0===e.name&&(e.name=" "),e.media.forEach((e=>{void 0===e.payloads&&(e.payloads="")}));const i=[];return t.outerOrder.forEach((t=>{f[t].forEach((function(s){void 0!==s.name&&s.name in e&&void 0!==e[s.name]?i.push(S(t,s,e)):void 0!==s.push&&s.push in e&&void 0!==e[s.push]&&e[s.push].forEach((e=>{i.push(S(t,s,e))}))}))})),e.media.forEach((e=>{i.push(S("m",f.m[0],e)),void 0!==t&&t.innerOrder.forEach((t=>{f[t].forEach((s=>{void 0!==s.name&&s.name in e&&void 0!==e[s.name]?i.push(S(t,s,e)):void 0!==s.push&&s.push in e&&void 0!==e[s.push]&&e[s.push].forEach((e=>{i.push(S(t,s,e))}))}))}))})),i.join("\r\n")+"\r\n"}(this.sdp)}forceVideoBitrate(e){if(!this.videoBitrateOverriden){const t=this.videoBitrate(e);return this.sdp.media.forEach((e=>{"video"===e.type&&this.addBitrates(t,e,P)})),t}}forceVideoCodecs(e,t){this.videoCodecsOverriden||this.sdp.media.forEach((i=>{"video"===i.type&&this.filterCodecs(e,i,P,t)}))}videoBitrate(e){let t=1500;return void 0!==e&&(e<=360?t=800:e>540&&(t=3e3)),t}addBitrates(e,t,i){const s=this.findCodecs(i,t),n=[];return s.forEach((t=>{n.push({payload:t,config:`x-google-min-bitrate=${e}`}),n.push({payload:t,config:`x-google-max-bitrate=${e}`})})),t.fmtp=t.fmtp.concat(n),e}filterCodecs(e,t,i,s){const n=this.findCodecs(i,t),o=this.findCodecs(e,t,s);t.rtp.filter((e=>n.some((t=>t===e.payload))&&!o.some((t=>t===e.payload)))).map((e=>e.payload)).forEach((e=>{this.removeCodec(e,t)}))}findCodecs(e,t,i){let s,n=t.rtp.filter((t=>{const i=e.some((e=>e.toUpperCase()===t.codec.toUpperCase()));return i&&"VP8"===t.codec.toUpperCase()&&(s=t.payload),i})).map((e=>e.payload));if(void 0!==i){const e=["profile-level-id=","profile-id="],o=t.fmtp.filter((t=>{if(n.some((e=>e===t.payload))){let s=!1;return t.config.split(";").forEach((t=>{e.forEach((e=>{if(t.startsWith(e)){const n=t.split(e)[1].toUpperCase();i.some((e=>e.toUpperCase()===n))&&(s=!0)}}))})),s}return!1})).map((e=>e.payload));void 0!==s&&n.some((e=>e===s))&&o.unshift(s),n=o}return n}removeCodec(e,t){const i="apt=";let s=t.payloads.split(" ");s=s.filter((t=>parseInt(t)!==e)),t.payloads=s.join(" "),t.rtp=t.rtp.filter((t=>t.payload!==e));const n=t.rtcpFb;void 0!==n&&(t.rtcpFb=n.filter((t=>t.payload!==e))),t.fmtp=t.fmtp.filter((t=>t.payload!==e)),t.fmtp.filter((t=>{const s=t.config;if(s.startsWith(i)){const t=s.split(i)[1];if(parseInt(t)===e)return!0}return!1})).map((e=>e.payload)).forEach((e=>{this.removeCodec(e,t)}))}}var M=i(2922);function R(e){let t;return t=void 0,void 0===e||"number"==typeof e?t=e:void 0!==e.exact?t=e.exact:void 0!==e.ideal&&(t=e.ideal),t}class I extends Error{constructor(e){super(e),this.fatal=!0}}class E{constructor(e,t,i){this.lastMessage=0,this.lastStreamInfoMessage=0,this.bitrateNRSent=!1,this.streamInfo={applicationName:"live-origin",streamName:"stream",sessionId:"[empty]"},this.dossier=e,this.video=t,this.source=i,this.uuid=function(){const e=new Uint8Array(16);return window.crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){let t=0;const i=l;return[i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]]].join("")}(e)}(),this.lastStreamInfoMessage=Date.now(),this.started=!1,this.browserAndPlatformInfo=(0,s.Ni)()}setup(e){return this.constraints=e,new Promise(((t,i)=>{if("object"!=typeof navigator||"object"!=typeof navigator.mediaDevices||"function"!=typeof navigator.mediaDevices.getUserMedia)return void i(new Error("Your browser doesn't support broadcasting. Recent versions of Safari, Firefox, or Chrome are recommended."));let s="DevicePermsOnLoadDenied";window.setTimeout((()=>{s="DevicePermsRequestDenied"}),500),navigator.mediaDevices.getUserMedia(e).then((s=>{this.stream=s;const n=s.getVideoTracks();0!==n.length&&void 0!==n[0]?(this.streamSettings=n[0].getSettings(),void 0!==this.streamSettings.width&&void 0!==this.streamSettings.height&&function(e,t,i){if(void 0===i.video)return;const s=function(e){let t,i;t=void 0,i=void 0;const s=e.video;return void 0!==s&&(t=R(s.width),i=R(s.height)),{width:t,height:i}}(i);if(void 0!==s.width&&s.width!==e||void 0!==s.height&&s.height!==t){const n={WebRTCHandlerError:"Stream resolution different from constraint resolution"};if(void 0!==s.width){let t=i.video.width;"object"==typeof t&&(t=JSON.stringify(t)),n.WebRTCHandlerConstraintWidth=t,n.WebRTCHandlerStreamWidth=e}if(void 0!==s.height){let e=i.video.height;"object"==typeof e&&(e=JSON.stringify(e)),n.WebRTCHandlerConstraintHeight=e,n.WebRTCHandlerStreamHeight=t}(0,a.bT)("WebRTCHandlerSetup",n)}}(this.streamSettings.width,this.streamSettings.height,e),debug(`Got stream with constraints: ${JSON.stringify(e)}`),debug(`Using video device: ${n[0].label}`),this.video.srcObject=s,t(s)):i(new Error("We can't find any cameras, please ensure you have given permission to use your camera."))})).catch((e=>{let t=e.message;"ConstraintNotSatisfiedError"===e.name?t=p.R.resolutionNotSupported:"OverconstrainedError"===e.name?t=p.R.minResolutionNotSupported:"PermissionDeniedError"===e.name||"NotAllowedError"===e.name?t=p.R.needCamAndMicPermission:""!==t&&null!==t||(t=p.R.unknownDeviceError),(0,a.bT)(s);const n=new Error(t);n.name=e.name,i(n)}))}))}start(){return new Promise(((e,t)=>{this.started=!0;let i=!1;if(void 0===this.stream)return this.close(),void t(new I("Unable to get video from camera. Try refreshing the page and make sure you allow video/audio if any prompts come up."));try{if(void 0===this.updateStatusInterval&&(this.closed=!1,this.updateStatusInterval=window.setInterval((()=>{this.updateStatus()}),1e3)),this.createPeerConnection(),void 0===this.peerConnection)return void t(new Error("Unable to connect to peer"));this.peerConnection.oniceconnectionstatechange=n=>{void 0!==this.peerConnection?(debug(`oniceconnectionstatechange (${this.peerConnection.iceConnectionState})`,n),i||("connected"!==this.peerConnection.iceConnectionState&&"completed"!==this.peerConnection.iceConnectionState||(i=!0,(0,a.bT)("WebRTCHandlerConnected",{WebRTCHandlerSource:this.source}),window.setTimeout((()=>{let e={};e={room:this.dossier.room,stream_type:"webrtc",origin_host:this.dossier.originHost,origin_region:this.streamData.region,webrtc_browser_info:JSON.stringify((0,s.Ni)())},(0,o.KF)("api/ts/chat/webrtc-start/",e)}),1e3),D.fire(this.uuid),e()),"failed"===this.peerConnection.iceConnectionState&&(i=!0,t(new Error("WebRTC failed"))))):debug("oniceconnectionstatechange for closed peer",n)},this.connectOrigin(this.dossier,t)}catch(e){t(e)}}))}stop(e){const t=!0===e;return new Promise((e=>{const i=()=>{t||(this.started=!1,B.fire(this.uuid)),e(this.uuid)};if(t||this.close(),void 0!==this.websocket){if(this.websocket.readyState!==WebSocket.CLOSING&&this.websocket.readyState!==WebSocket.CLOSED)try{this.websocket.close()}catch(e){error("could not close websocket connection",{reason:e.toString()})}this.websocket=void 0}if(void 0!==this.peerConnection){try{this.peerConnection.close()}catch(e){error("could not close peer connection",{reason:e.toString()})}this.peerConnection=void 0}this.lastMessage=Date.now(),t||void 0===this.stream?i():(0,r.W_)(this.stream.getTracks()).then((()=>{this.stream=void 0,i()})).catch((()=>{}))}))}setMute(e){void 0!==this.stream?this.stream.getAudioTracks().length>0&&(this.stream.getAudioTracks()[0].enabled=!e):error("no stream")}reset(){return new Promise(((e,t)=>{const i=this.started;this.stop().then((()=>{void 0!==this.constraints?this.setup(this.constraints).then((s=>{i?this.start().then((()=>{e()})).catch((e=>{t(e)})):e()})).catch((e=>{t(e)})):e()})).catch((e=>{t(e)}))}))}close(){this.closed=!0,void 0!==this.updateStatusInterval&&(clearInterval(this.updateStatusInterval),this.updateStatusInterval=void 0)}updateStatus(){if(!0===this.closed)return void this.stop();const e=Date.now();if(this.lastStreamInfoMessage{const e=`api/switch_origin/?current_origin=${this.dossier.originHost}`;(0,o.Aw)(e).then((e=>{this.dossier.originHost=e.responseText,this.start().catch((e=>{error("Could not restart stream",{reason:e.message})}))})).catch((e=>{error("Could not get new origin",{reason:e.message})}))})).catch((()=>{}))}let t=this.streamData;void 0===this.websocket&&(t={status:"connecting"}),void 0!==t&&L.fire({uuid:this.uuid,data:t})}shouldUpdateOrigin(){return void 0===(0,n.fL)()}createPeerConnection(){void 0!==this.stream?(void 0!==this.peerConnection&&(error("peerConnection already open"),this.peerConnection.close(),this.peerConnection=void 0),this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onicecandidate=e=>{debug("onicecandidate",e)},this.stream.getAudioTracks().length>0&&this.peerConnection.addTrack(this.stream.getAudioTracks()[0],this.stream),this.peerConnection.addTrack(this.stream.getVideoTracks()[0],this.stream),this.peerConnection.createOffer().then((e=>{this.updateSDP(e.sdp)})).catch((()=>{}))):error("no stream")}connectOrigin(e,t){void 0!==this.websocket&&(error("WebSocket already open"),this.websocket.close(),this.websocket=void 0);const i=new WebSocket(`wss://${e.originHost}${e.originWSEndpoint}`);i.binaryType="arraybuffer",i.onopen=()=>{this.websocket=i,i.send(JSON.stringify({method:"connect",username:e.room,password:e.originPassword}))},i.onerror=e=>{error("webrtc websocket error",{error:e}),t(new Error(`WebSocket error: ${JSON.stringify(e)}`))},i.onclose=()=>{this.websocket=void 0},i.onmessage=e=>{let i;try{i=JSON.parse(e.data)}catch(e){return}switch(i.method){case"auth_valid":this.createOffer(t);break;case"stream_info":this.streamData=i,this.lastStreamInfoMessage=Date.now();break;case"already_publishing":this.lastMessage=Date.now(),(0,h.Q$)("You have started publishing from a new location, shutting down stream",(()=>{u.H.fire(""),m._.fire("")})),this.stop();break;case"shutdown":this.lastMessage{u.H.fire(""),(0,M.w)((()=>{}))})),this.stop();break;case"origin_info":break;default:"sendOffer"===i.command?this.processSdp(i,t):warn("Unhandled",i)}}}correctedWidthAndHeight(){const{width:e,height:t}=this.streamSettings,i=Number(e)=16?{width:t,height:e}:{width:e,height:t}}createOffer(e){void 0!==this.websocket?void 0!==this.stream?(this.websocket.send(JSON.stringify({method:"publish",frameRate:this.streamSettings.frameRate,source:this.source,browserAndPlatform:JSON.stringify(this.browserAndPlatformInfo),...this.correctedWidthAndHeight()})),void 0!==this.peerConnection?this.peerConnection.createOffer().then((t=>{void 0!==this.peerConnection?(debug(`Got description ${t}`),t.sdp=this.updateSDP(t.sdp),debug(`gotDescription: ${JSON.stringify({sdp:t})} ${this.peerConnection}`),this.peerConnection.setLocalDescription(t).then((()=>{void 0!==this.websocket?this.websocket.send(JSON.stringify({direction:"publish",command:"sendOffer",streamInfo:this.streamInfo,sdp:t})):e(new Error("ws undefined"))})).catch((t=>{e(t)}))):error("peerConnection not open")})).catch((t=>{e(t)})):error("peerConnection not open")):e(new Error("stream undefined")):e(new Error("ws undefined"))}processSdp(e,t){if(void 0===this.peerConnection)return void error("peerConnection not open");const i=e.sdp;null!=i&&(debug("sdp: ",i),this.peerConnection.setRemoteDescription(i).catch((e=>{t(e)})));const s=e.iceCandidates;if(void 0!==s)for(const e of s)debug("iceCandidates: ",e),this.peerConnection.addIceCandidate(new RTCIceCandidate(e)).catch((e=>{t(e)}))}updateSDP(e){if(void 0===e)return error("sdpStr undefined"),"";debug("Original SDP",e);const t=new k(e);(0,s.OF)()?t.forceVideoCodecs(["H264"],["42e01f"]):t.forceVideoCodecs(["H264","VP8"],["42e01f"]);const i=t.forceVideoBitrate(this.streamSettings.height);return void 0!==i&&(this.bitrateNRSent||((0,a.bT)("WebRTCHandlerSDPUpdate",{WebRTCHandlerVideoBitrate:i,usingLibrary:(0,c.f)("SDPLib")}),this.bitrateNRSent=!0)),e=t.write(),debug("Updated SDP",e),e}static isWebRTCNotYetSupported(){return(0,s.H9)()}static isWebRTCNeverSupported(){return(0,s._6)()}static canUseWebRTC(){return!E.isWebRTCNotYetSupported()&&!E.isWebRTCNeverSupported()}}const L=new d.c_("streamStatusUpdate"),D=new d.c_("streamStart"),B=new d.c_("streamStop")},1134:(e,t,i)=>{"use strict";i.d(t,{T:()=>o});var s=i(3955);const n=["smcBadge","followerBadge","notesBadge"];class o{static registerGenerator(e,t){o.badgeGenerators.has(e)?error("Generator already registered for badge",e):o.badgeGenerators.set(e,t)}static createBadges(e){const t=document.createElement("span");return(0,s.ZM)(t,{display:"inline-block",verticalAlign:"middle",marginTop:"-.5em",marginBottom:"-.5em",marginRight:"1px",overflow:"visible"}),n.forEach((i=>{const s=o.badgeGenerators.get(i);if(void 0!==s){const n=s(e);n.classList.add(`${i}_${e}`),n.dataset.testid=`${i}`,t.appendChild(n)}})),t}static getBadgeElements(e,t){return Array.from(document.body.querySelectorAll(`.${e}_${t}`))}}o.badgeGenerators=new Map},9453:(e,t,i)=>{"use strict";i.d(t,{TL:()=>h,Ye:()=>l});var s=i(9461),n=i(1519),o=i(7407);let r=!0;const a=new n.a((()=>{void 0===s.Bm.current.loggedInUser&&(0,o.bT)("AnonChatInputFocused")}),{bounceLimitMS:1500,debounceType:0}),l=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!0===r&&(a.callFunc(),!0!==e&&(r=!1))},h=()=>{r=!0}},8160:(e,t,i)=>{"use strict";i.d(t,{n:()=>m,V:()=>g});var s=i(7063),n=i(3417),o=i(9447),r=i(2394),a=i(6784),l=i(213),h=i(5216),d=i(6844),c=i(2709),u=i(8423),p=i(4947);class m extends c.u{constructor(e,t,i){super(),this.username=e,this.message=t,this.chatConnection=i,this.formFocusableElements=[],this.endScreenFocusableElements=[],this.isOnEndScreen=!1,this.closeChatReportRequest=new u.c_("closeChatReportRequest"),this.reportSent=new u.c_("reportSent"),this.ignoreReportedUser=new u.c_("ignoreReportedUser"),this.trapFocus=e=>{e.stopPropagation(),27!==e.keyCode?9===e.keyCode&&(e.preventDefault(),this.isOnEndScreen?this.focusNextElement(this.endScreenFocusableElements,e.shiftKey):this.focusNextElement(this.formFocusableElements,e.shiftKey)):this.onChatReportClosed(!1)},(0,o.fZ)(this.element,"chatReport"),this.element.style.position="static",this.element.style.fontFamily="UbuntuBold, Arial, Helvetica, sans-serif",this.element.style.fontSize="11px",this.form=document.createElement("form"),this.element.dataset.testid="report-modal";const s=document.createElement("div"),n=document.createElement("div");this.commentInput=document.createElement("textarea"),this.form.appendChild(s),this.form.style.width="100%",(0,o.fZ)(s,"headerDiv"),s.style.margin="6px",s.style.fontSize="13px",s.style.overflow="hidden",s.style.textOverflow="ellipsis",s.innerText=`${p.R.report} ${this.username}`;const r=this.categories();for(const e in r){const t=document.createElement("label"),i=document.createElement("input"),s=document.createElement("span");t.style.display="flex",t.style.margin="6px 8px",t.style.alignItems="center",i.type="radio",i.style.margin="0 4px 0 2px",i.name="chatReport",i.value=e,s.innerText=r[e],s.style.flex="1",t.appendChild(i),t.appendChild(s),this.form.appendChild(t),t.onclick=()=>{this.activeRadioInput=i},this.formFocusableElements.push(i)}n.style.margin="6px 8px",this.commentInput.draggable=!1,this.commentInput.style.resize="none",this.commentInput.style.boxSizing="border-box",this.commentInput.style.height="40px",this.commentInput.style.width="100%",this.commentInput.style.borderWidth="1px",this.commentInput.style.borderStyle="solid",this.commentInput.maxLength=255,this.commentInput.oninput=()=>{this.commentInput.value=this.commentInput.value.slice(0,255)},n.appendChild(this.commentInput),this.form.appendChild(n),this.formFocusableElements.push(this.commentInput),this.buttonContainer=document.createElement("div"),this.buttonContainer.style.margin="0 0 8px",this.buttonContainer.style.cssFloat="right",this.buttonContainer.style.fontFamily="UbuntuMedium, Arial, Helvetica, sans-serif";const h=document.createElement("button");(0,o.fZ)(h,"submitButton"),h.type="submit",h.innerText=p.R.reportCAPS,h.style.fontSize="11px",h.style.padding="4px 6px 4px 6px",h.style.marginRight="8px",h.style.borderRadius="4px",h.style.boxSizing="border-box",h.style.cursor="pointer",h.style.display="inline-block",h.dataset.testid="submit-report-button";const d=document.createElement("span");(0,o.fZ)(d,"cancelSpan"),d.innerText=p.R.cancelCAPS,d.style.fontSize="11px",d.style.padding="4px 6px 4px 6px",d.style.marginRight="8px",d.style.borderRadius="4px",d.style.boxSizing="border-box",d.style.cursor="pointer",d.style.display="inline-block",d.dataset.testid="cancel-report-button",this.buttonContainer.appendChild(d),this.buttonContainer.appendChild(h),this.form.appendChild(this.buttonContainer),this.formFocusableElements.push(d),this.formFocusableElements.push(h),this.createFinishReportScreen(),(0,a.wu)("submit",this.form,(e=>{e.preventDefault(),this.commentInput.blur(),void 0!==this.activeRadioInput?"other"!==this.activeRadioInput.value||""!==this.commentInput.value.trim()?(this.sendReport().then((e=>{e.success?this.setEndScreenText(p.R.userHasBeenReported(this.username)):this.setEndScreenText(p.R.unableToReport)})).catch((e=>{403===e.xhr.status?this.setEndScreenText(p.R.tooManyReports):this.setEndScreenText(p.R.unableToReport)})),this.onSendReport(),this.showEndReportScreen()):(0,l.Q$)(p.R.reportAbuseDescriptionRequired,(()=>this.focusCommentBox())):(0,l.Q$)(p.R.selectReason,(()=>this.focusForm()))})),(0,a.wu)("click",d,(e=>{e.preventDefault(),this.onChatReportClosed(!1)})),this.element.appendChild(this.form),this.element.appendChild(this.finishReportScreenDiv),(0,a.wu)("keydown",this.element,this.trapFocus)}categories(){return void 0===this.message?(error("ChatReport error: expected categories override"),{}):!0===this.message.isPrivate&&this.message.mediaList.length>0?{inappropriate:p.R.reportMessageInappropriate,rude:p.R.reportMessageRudeToBcaster,spam:p.R.reportMessageSpam,photo:p.R.reportMessageOffensiveMedia,other:p.R.reportMessageOther}:{inappropriate:p.R.reportMessageInappropriate,rude:p.R.reportMessageRudeToBcaster,spam:p.R.reportMessageSpam,other:p.R.reportMessageOther}}additionalFinishReportLinks(){return[]}showEndReportScreen(){const e=this.element.offsetWidth,t=this.element.offsetHeight;this.form.style.display="none",this.finishReportScreenDiv.style.display="block",this.finishReportScreenDiv.style.width=`${e}px`,this.finishReportScreenDiv.style.height=`${t}px`;const i=this.finishReportContainer.offsetHeight;this.finishReportContainer.style.padding=t/2-i/2+"px 0 0",this.isOnEndScreen=!0}static parseAbuseReportResult(e){const t=new s.N6(e);return{success:"success"===t.getStringOrUndefined("result"),html:t.getStringOrUndefined("html")}}reportEndpoint(){return void 0===this.message?(error("ChatReport error: expected reportEndpoint override"),""):`chatmessages/report/${this.message.messageID}/`}sendReport(){return new Promise(((e,t)=>{const i=void 0===this.activeRadioInput?"":this.activeRadioInput.value,s=this.commentInput.value;(0,h.KF)(this.reportEndpoint(),{spammer:this.username,category:i,additional_comments:s}).then((t=>{e(m.parseAbuseReportResult(t.responseText))})).catch((e=>{t(e)}))}))}resetForm(){this.form.reset()}createFinishReportScreen(){this.finishReportScreenDiv=document.createElement("div"),this.finishReportContainer=document.createElement("div"),this.userReportedMessage=document.createElement("div"),this.ignoreUserLink=document.createElement("button");const e=this.additionalFinishReportLinks(),t=document.createElement("button");this.endScreenFocusableElements.push(this.ignoreUserLink);for(const t of e)this.endScreenFocusableElements.push(t);this.endScreenFocusableElements.push(t),this.userReportedMessage.innerText=p.R.sending,this.userReportedMessage.style.margin="0 0 8px 0",this.userReportedMessage.style.textAlign="center",(0,o.fZ)(this.ignoreUserLink,"ignoreUserLink"),(0,o.fZ)(t,"closeReportLink"),this.ignoreUserLink.style.textAlign="center",this.ignoreUserLink.style.fontSize="13px",this.ignoreUserLink.style.display="block",this.ignoreUserLink.style.margin="0 auto 8px",this.ignoreUserLink.style.background="none",this.ignoreUserLink.style.border="none",this.ignoreUserLink.style.cursor="pointer",this.ignoreUserLink.dataset.testid="ignore-user-link",this.updateIgnoreText((0,n.pi)(this.username));for(const t of e)t.style.textAlign="center",t.style.fontSize="13px",t.style.display="block",t.style.margin="0 auto 8px",t.style.background="none",t.style.border="none",t.style.cursor="pointer";t.innerText=p.R.close,t.style.textAlign="center",t.style.fontSize="13px",t.style.display="block",t.style.margin="0 auto 8px",t.style.background="none",t.style.border="none",t.style.cursor="pointer",t.dataset.testid="close-report-link",this.underlineOnHover(t),this.finishReportScreenDiv.style.display="none",this.finishReportContainer.style.fontSize="13px",this.finishReportContainer.style.fontFamily="Arial, Helvetica, sans-serif",this.finishReportContainer.appendChild(this.userReportedMessage),this.shouldShowIgnore()&&this.finishReportContainer.appendChild(this.ignoreUserLink);for(const t of e)this.finishReportContainer.appendChild(t);this.finishReportContainer.appendChild(t),this.finishReportScreenDiv.appendChild(this.finishReportContainer),(0,a.wu)("click",t,(e=>{e.preventDefault(),this.onChatReportClosed(!0)}))}setEndScreenText(e){this.userReportedMessage.innerText=e}disableIgnoreTextInteraction(){this.ignoreUserLink.disabled=!0,this.ignoreUserLink.style.cursor="default",this.ignoreUserLink.style.textDecoration="none",this.ignoreUserLink.onmouseenter=()=>{},this.ignoreUserLink.onmouseleave=()=>{},this.ignoreUserLink.onclick=()=>{},(0,o.fZ)(this.ignoreUserLink,"disabled");const e=this.endScreenFocusableElements.indexOf(this.ignoreUserLink);-1!==e&&this.endScreenFocusableElements.splice(e,1),this.ignoreUserLink.blur()}focusNextElement(e,t){if(!(document.activeElement instanceof HTMLElement))return void this.focusForm();const i=e.indexOf(document.activeElement);if(-1===i)return void this.focusForm();let s;t?(s=i-1,s<0&&(s+=e.length)):s=(i+1)%e.length,e[s].focus()}updateIgnoreText(e){e?(this.ignoreUserLink.innerText=p.R.userIsIgnored(this.username),this.disableIgnoreTextInteraction()):(this.ignoreUserLink.innerText=p.R.ignoreUser(this.username),(0,o.SA)(this.ignoreUserLink,"disabled"),this.underlineOnHover(this.ignoreUserLink),this.ignoreUserLink.disabled=!1,this.ignoreUserLink.onclick=()=>{(0,d.rC)()?this.ignoreUserLink.innerText=p.R.loginForIgnore:(this.onIgnoreUser(),this.ignoreUserLink.innerText=p.R.userIsIgnored(this.username),this.ignoreReportedUser.fire(void 0)),this.disableIgnoreTextInteraction()})}focusCommentBox(){this.commentInput.focus()}focusForm(){this.isOnEndScreen?this.endScreenFocusableElements[0].focus():this.formFocusableElements[0].focus()}tearDown(){}underlineOnHover(e){e.onmouseenter=()=>{e.style.textDecoration="underline"},e.onmouseleave=()=>{e.style.textDecoration="none"}}shouldShowIgnore(){return void 0!==this.chatConnection&&this.chatConnection.username()!==this.chatConnection.room()}onIgnoreUser(){void 0!==this.chatConnection&&this.chatConnection.ignore(this.username)}onSendReport(){this.reportSent.fire(void 0)}onChatReportClosed(e){this.closeChatReportRequest.fire(e)}}class g extends m{constructor(e,t,i){super(e,t),this.ignoreFunc=i,this.element.style.minWidth="188px",this.element.style.maxWidth="268px",(0,a.wu)("pointerdown",this.commentInput,(e=>(0,r.O)(e)))}categories(){return{inappropriate:p.R.inappropriateMessage,rude:p.R.rudeMessage,spam:p.R.spamMessage,other:p.R.reportMessageOther}}shouldShowIgnore(){return!0}onIgnoreUser(){this.ignoreFunc()}}},1413:(e,t,i)=>{"use strict";i.d(t,{J:()=>_,V:()=>F});var s=i(7063),n=i(9461),o=i(1224),r=i(6064),a=i(369),l=i(213),h=i(5216),d=i(768),c=i(6844),u=i(1131),p=i(2939),m=i(2709),g=i(8423),v=i(1779),f=i(6716),y=i(7407),b=i(5424),w=i(3456),C=i(7623),S=i(1474),x=i(9447),T=i(1679),A=i(6784),P=i(5020),k=i(3955),M=i(8936),R=i(5173),I=i(4947),E=i(3860),L=i(9311);class D extends R.Q{constructor(e,t,i){super(),this.tipSource=e,this.topSectionWrapper=t,this.sendTipButtonSpan=i,this.roomType="public",this.tokenBalance=0,this.isTokenAmountAlreadyTooHigh=!1,this.isHighTipAmountWarningActive=!1,this.divotOffsetLeft=96,this.tipSent=new g.c_("tipSent"),this.closed=new g.c_("tipClosed"),this.isVisible=!1,this.element.id="SplitModeTipCallout",this.element.dataset.testid="send-tip-callout",(0,x.fZ)(this.element,x.aG.defaultColor),this.element.style.display="none",this.element.style.position="absolute",this.element.style.width="390px",this.element.style.height="auto",this.element.style.top="0",this.element.style.borderWidth="2px",this.element.style.borderStyle="solid",this.element.style.borderRadius="4px",this.element.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",this.element.style.fontSize="12px",this.element.style.overflow="visible";const s=()=>{this.sendTipButton.hasFocus()&&!this.sendTipButton.focusPrev()?this.tipMessageTextarea.focus():document.activeElement===this.tipMessageTextarea?void 0!==this.tipOptionsSelect?this.tipOptionsSelect.focus():this.tipAmountInput.focus():document.activeElement===this.tipOptionsSelect?this.tipAmountInput.focus():this.sendTipButton.hasFocus()||this.sendTipButton.focusPrev()},o=()=>{this.sendTipButton.hasFocus()&&!this.sendTipButton.focusNext()?this.tipAmountInput.focus():document.activeElement===this.tipAmountInput?void 0!==this.tipOptionsSelect?this.tipOptionsSelect.focus():this.tipMessageTextarea.focus():document.activeElement===this.tipOptionsSelect?this.tipMessageTextarea.focus():this.sendTipButton.hasFocus()||this.sendTipButton.focusNext()},r=e=>{this.sendTipButton.hasFocus()&&(e?this.sendTipButton.focusNextMenuItem():this.sendTipButton.focusPrevMenuItem())};(0,A.wu)("keydown",this.element,(e=>{"Escape"===e.code?this.hide():"Tab"===e.code?(e.shiftKey?s():o(),e.preventDefault()):"ArrowDown"===e.code?(e.preventDefault(),r(!0)):"ArrowUp"===e.code&&(e.preventDefault(),r(!1))})),this.bottomDivot=(0,P.Uv)("","","74px"),(0,x.fZ)(this.bottomDivot,"bottomDivot"),this.element.appendChild(this.bottomDivot),this.topDivot=(0,P.Wj)("","","74px"),(0,x.fZ)(this.topDivot,"topDivot"),this.element.appendChild(this.topDivot),this.leftDivot=(0,P.Wr)("","","30px"),(0,x.fZ)(this.leftDivot,"leftDivot"),this.element.appendChild(this.leftDivot),this.overlay.style.bottom="";const a=document.createElement("div");(0,x.fZ)(a,"titleBar"),a.innerText=I.R.sendTipText,a.style.fontSize="15px",a.style.fontFamily="UbuntuBold, Helvetica, Arial, sans-serif",a.style.padding="6px",this.element.appendChild(a);const d=document.createElement("div");d.style.display="inline-block",d.style.width="100%";const c=document.createElement("span");c.innerText=I.R.currentBalanceText,c.style.fontWeight="bold",c.style.display="inline-block",c.style.padding="6px",d.appendChild(c),this.tokenBalanceSpan=document.createElement("span"),this.tokenBalanceSpan.dataset.testid="token-balance",(0,x.fZ)(this.tokenBalanceSpan,"tokenBalance"),this.tokenBalanceSpan.style.display="inline-block",this.tokenBalanceSpan.style.fontWeight="bold",this.tokenBalanceSpan.style.padding="6px 6px 6px 0",d.appendChild(this.tokenBalanceSpan);const u=document.createElement("a");(0,x.fZ)(u,"purchaseTokens"),u.innerText=I.R.purchaseTokensText,u.href=(0,h._Y)(`${T.bv}?source=${n.Bm.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT}`),u.style.display="inline-block",u.style.fontSize="11px",u.style.marginLeft="12px",u.style.cssFloat="right",u.style.padding="6px",u.dataset.testid="purchase-tokens",u.onclick=()=>((0,T.di)({popupOnly:"embed"===this.tipSource,source:n.Bm.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT,target:u}),!1),d.appendChild(u),this.element.appendChild(d),this.lowScoreWarning=document.createElement("div"),(0,x.fZ)(this.lowScoreWarning,"warning"),this.lowScoreWarning.style.display="none",this.lowScoreWarning.style.fontWeight="bold",this.lowScoreWarning.style.padding="6px",this.lowScoreWarning.style.textAlign="center",this.lowScoreWarning.style.position="absolute",this.lowScoreWarning.style.left="50%";const m=document.createElement("div");m.innerText=I.R.satisfactionWarningText,this.lowScoreWarning.appendChild(m);const v=document.createElement("div");v.innerText=I.R.tipWarningText,this.lowScoreWarning.appendChild(v),this.element.appendChild(this.lowScoreWarning),this.sendTipForm=document.createElement("form");const f=document.createElement("label"),b=document.createElement("span");b.innerText=I.R.tipAmountText,b.style.display="inline-block",b.style.padding="6px",f.appendChild(b),this.tipAmountInput=(0,T.Gz)(),this.tipAmountInput.style.width="5em",this.tipAmountInput.style.display="inline-block",this.tipAmountInput.style.padding="4px",this.tipAmountInput.style.borderWidth="1px",this.tipAmountInput.style.borderStyle="solid",this.tipAmountInput.style.borderRadius="4px",this.tipAmountInput.onclick=()=>{this.focusTipAmount()},(0,A.wu)("input",this.tipAmountInput,(()=>{this.tipAmountChange()})),f.appendChild(this.tipAmountInput),this.sendTipForm.appendChild(f),this.tipMessageLabel=document.createElement("div"),this.tipMessageLabel.innerText=I.R.defaultTipMessageLabel,this.tipMessageLabel.style.padding="6px 6px 0 6px",this.sendTipForm.appendChild(this.tipMessageLabel),this.tipMessageDiv=document.createElement("div"),this.tipMessageTextarea=document.createElement("textarea"),this.tipMessageTextarea.dataset.testid="tip-message-textarea",(0,x.fZ)(this.tipMessageTextarea,"tipMessageInput"),this.tipMessageTextarea.maxLength=255,this.tipMessageTextarea.style.width="100%",this.tipMessageTextarea.style.height="40px",this.tipMessageTextarea.style.resize="none",this.tipMessageTextarea.style.margin=`${S.xj}px`,this.tipMessageTextarea.style.padding="4px",this.tipMessageTextarea.style.borderWidth="1px",this.tipMessageTextarea.style.borderStyle="solid",this.tipMessageTextarea.style.borderRadius="4px",this.tipMessageTextarea.style.boxSizing="border-box",this.tipMessageDiv.appendChild(this.tipMessageTextarea),this.sendTipForm.appendChild(this.tipMessageDiv),this.tipMessageLabel.onclick=()=>{this.tipMessageTextarea.select()},this.invalidTipAmountDiv=document.createElement("div"),(0,x.fZ)(this.invalidTipAmountDiv,"warning"),this.invalidTipAmountDiv.innerText=I.R.tipAmountInvalid,this.invalidTipAmountDiv.style.display="none",this.invalidTipAmountDiv.style.paddingLeft="5px",this.invalidTipAmountDiv.dataset.testid="invalid-tip",f.appendChild(this.invalidTipAmountDiv);const w=document.createElement("div");w.style.textAlign="right",w.style.position="relative",w.style.display="flex",w.style.flexWrap="wrap-reverse",this.ctrlSNotice=document.createElement("div"),this.ctrlSNotice.innerText=I.R.toggleWindowMessage,this.ctrlSNotice.style.position="relative",this.ctrlSNotice.style.display="none",this.ctrlSNotice.style.fontSize="10px",this.ctrlSNotice.style.lineHeight="1.3em",this.ctrlSNotice.style.padding="10px",this.ctrlSNotice.style.textAlign="left",this.ctrlSNotice.style.top="6px",this.ctrlSNotice.style.left="0px",w.appendChild(this.ctrlSNotice),this.sendTipButton=new L.i,this.addChild(this.sendTipButton,w),this.sendTipForm.appendChild(w),this.element.appendChild(this.sendTipForm),p.X0.listen((e=>{this.hasLowSatisfactionScore=e.dossier.hasLowSatisfactionScore,this.isAgeVerified=e.dossier.isAgeVerified,this.roomName=e.chatConnection.room(),e.chatConnection.event.statusChange.listen((e=>{"privatewatching"===e.currentStatus?this.roomType="private":this.roomType="public"}))})),S.D.listen((e=>{this.updateTokenBalance(e.tokens)})),this.repositionChildren(),(0,A.wu)("submit",this.sendTipForm,(e=>{if(e.preventDefault(),!(0,T.sI)(this.tipAmountInput.value))return void(0,l.Q$)(I.R.tipAmountInvalid);if(!this.isVisible||!this.sendTipButton.isEnabled())return;const t=parseInt(this.tipAmountInput.value);if(t>this.tokenBalance)return void(0,T.qr)(I.R.notEnoughTokensMessage,!1,n.Bm.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE,this.roomType);if((0,y.bT)("SendTipClicked",{amount:t,location:"PMTab"}),t>100&&!this.isHighTipAmountWarningActive)return this.sendTipButton.promptUser(I.R.tipConfirmationMessage(t)),this.isHighTipAmountWarningActive=!0,void this.repositionChildren();this.tipAmountInput.blur();let i=this.tipMessageTextarea.value;void 0!==this.tipOptionsSelect&&(i=""===this.tipMessageTextarea.value?this.tipOptionsSelect.value:`${this.tipOptionsSelect.value} | ${this.tipMessageTextarea.value}`),(0,S.ae)({roomName:this.roomName,tipAmount:this.tipAmountInput.value,message:i,source:this.tipSource,tipRoomType:this.roomType,tipType:this.sendTipButton.getTipType(),videoMode:E.L.getVideoMode()}).then((e=>{e.success?(0,y.bT)("SendTipSuccess",{amount:t,location:"PMTab"}):void 0!==e.error?!0===e.showPurchaseLink?(0,T.qr)(`${e.error}`,!1,n.Bm.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE,this.roomType):(0,l.Q$)(e.error):error("unknown send tip error"),this.removeHighTipAmountWarning(),this.tipMessageTextarea.value="",void 0!==e.tipsInPast24Hours&&S.ew.fire({tokens:e.tipsInPast24Hours,roomName:this.roomName}),this.tipSent.fire({amount:t,success:e.success})})).catch((e=>{error(`Error sending tip. status: ${e}`),(0,l.Q$)(I.R.errorSendingTip),this.tipSent.fire({amount:t,success:!1})})),this.hide()})),this.overlayClick.listen((()=>{this.hide()})),this.closed.listen((()=>{this.sendTipButton.hideMenu()}))}showElement(){super.showElement(),this.isVisible=!0}repositionChildren(){this.tipMessageDiv.style.width=`${Math.max(0,this.element.clientWidth-2*S.xj)}px`;const e=(0,k.$R)(this.sendTipButtonSpan);if(this.bottomDivot.style.display="none",this.topDivot.style.display="none",this.leftDivot.style.display="none","fixed"===this.topSectionWrapper.style.position)this.leftDivot.style.display="block",this.element.style.top=e.top-30+"px",this.element.style.left=`${e.right+12}px`;else{const t=e.left-70;let i=Math.max(0,t+this.element.offsetWidth-(0,M.DK)()+4);t-i<0&&(i+=t-i),this.element.style.left=t-i+"px",(0,C.Xb)()||this.element.offsetHeight+e.bottom+20>(0,M.mJ)()+document.documentElement.scrollTop?(this.bottomDivot.style.display="block",this.bottomDivot.style.left=`${this.divotOffsetLeft+i}px`,this.element.style.top=e.top-this.element.offsetHeight-11+"px"):(this.topDivot.style.display="block",this.topDivot.style.left=`${this.divotOffsetLeft+i}px`,this.element.style.top=`${e.bottom+14}px`)}this.overlay.style.height=`${document.documentElement.offsetHeight}px`}tipAmountChange(){(0,T.Pt)(this.tipAmountInput),(0,T.sI)(this.tipAmountInput.value)?(this.sendTipButton.enable(),this.invalidTipAmountDiv.style.display="none",this.tokenBalance>0&&parseInt(this.tipAmountInput.value)>this.tokenBalance?this.isTokenAmountAlreadyTooHigh||((0,y.bT)("TokenAmountTooHigh"),this.isTokenAmountAlreadyTooHigh=!0):this.isTokenAmountAlreadyTooHigh=!1):(this.sendTipButton.disable(),this.invalidTipAmountDiv.style.display="inline-block"),this.isHighTipAmountWarningActive&&this.removeHighTipAmountWarning()}removeHighTipAmountWarning(){this.sendTipButton.cancelPrompt(),this.isHighTipAmountWarningActive=!1}tippingAllowed(){return this.isAgeVerified?!((0,c.rC)('You must be logged in to tip. Click "OK" to login.')||n.Bm.current.isNoninteractiveUser&&((0,l.Q$)(I.R.internalStaffTip),1)):((0,l.Q$)("This broadcaster doesn't accept tips."),!1)}show(e){this.tippingAllowed()&&(void 0!==e.amount&&(this.tipAmountInput.value=e.amount.toString(),this.tipAmountChange()),void 0!==e.message?this.tipMessageTextarea.value=e.message:this.tipMessageTextarea.value="",this.hasLowSatisfactionScore?this.lowScoreWarning.style.display="block":this.lowScoreWarning.style.display="none",void 0!==e.usedCtrlS&&e.usedCtrlS?this.ctrlSNotice.style.display="none":this.ctrlSNotice.style.display="block",(0,T.lc)(this.tipSource,this.sendTipButton),this.showElement(),this.showOverlay(),this.repositionChildren(),this.focusTipAmount(),this.tokenBalanceSpan.innerText=`${I.R.loadingTextLower}...`,(0,S.kb)(this.roomName).then((e=>{if(this.tipAmountInput.max=e.tokenBalance.toString(),void 0!==e.tipOptions){this.tipMessageLabel.innerText=e.tipOptions.label,void 0!==this.tipOptionsSelect&&this.tipMessageDiv.removeChild(this.tipOptionsSelect),this.tipOptionsSelect=document.createElement("select"),(0,x.fZ)(this.tipOptionsSelect,"tipOptionsSelect"),this.tipOptionsSelect.style.width="100%",this.tipOptionsSelect.style.fontSize=".8125em",this.tipOptionsSelect.style.margin=`${S.xj}px`,this.tipOptionsSelect.style.borderWidth="1px",this.tipOptionsSelect.style.borderStyle="solid",this.tipOptionsSelect.style.boxSizing="border-box",this.tipMessageDiv.insertBefore(this.tipOptionsSelect,this.tipMessageTextarea);let t=document.createElement("option");t.innerText=`-- ${I.R.selectOneLabel} --`,t.value="",this.tipOptionsSelect.appendChild(t);for(const i of e.tipOptions.options)t=document.createElement("option"),t.innerText=i.label,t.value=i.label,this.tipOptionsSelect.appendChild(t)}else void 0!==this.tipOptionsSelect&&(this.tipMessageLabel.innerText=I.R.defaultTipMessageLabel,this.tipMessageTextarea.value="",this.tipMessageDiv.removeChild(this.tipOptionsSelect),this.tipOptionsSelect=void 0)})).catch((e=>{error(`Error getting token balance. status: ${e}`),this.tokenBalanceSpan.innerText=I.R.unknownText})))}hide(){this.element.style.display="none",this.tipAmountInput.blur(),this.hideOverlay(),this.isVisible=!1,this.closed.fire(void 0)}setTipButtonSpan(e){this.sendTipButtonSpan=e}focusTipAmount(){document.activeElement!==this.tipAmountInput&&(this.tipAmountInput.focus(),this.tipAmountInput.setSelectionRange(0,9999))}updateTokenBalance(e){this.tokenBalance=e,this.tokenBalanceSpan.innerText=`${e} ${I.R.tokenOrTokensText(e,!1)}`}}var B=i(74),U=i(5389);const F=new g.c_("dossierLoaded",{listenersWarningThreshold:()=>10+g.hI});class _ extends m.u{constructor(e,t){super(),this.audioHolder=new d.T,this.lastLoadRoomId=0,this.listenerGroup=new g.gt,this.loadedRoom={room:"",roomTitle:""}}handleHistory(e){}handleRoomStatusOffline(e){}handleSetWidescreen(e){}handlePlaySound(e){}handleRoomInitiallyOffline(){}handleRoomInitiallyOnline(){}handleRoomStatusPasswordProtected(e){this.player.playerComponent.stop()}handleUpdateChatSettings(e,t){e.updateEnterLeaveSettings(t.roomEntryFor,t.roomLeaveFor)}handleRoomAccessDenied(e,t){(0,l.Q$)(`Access Denied for room: ${e}\n\n${t.getString("detail")}`)}handleRoomUnauthorized(e){null!==window.top&&(window.top.location.href=(0,h._Y)(`/auth/login/?next=${window.location.pathname}${window.location.search}`))}handleRoomPasswordRequired(e){}handleRoomLoaded(e){}handleRoomStatusChangeNotification(e){}handleResize(){}setupAudio(){B.EZ.listen((e=>{this.tipVolume=e.tipVolume}))}setupTipCallout(e,t,i){this.tipCallout=this.addChild(new D(e,t,i)),B.i5.listen((e=>{this.tipCallout.isVisible?this.tipCallout.hide():this.tipCallout.show(e)})),this.tipCallout.tipSent.listen((()=>{this.tipCallout.hide()}))}setupLoginOverlay(){B.pL.listen((e=>{(0,r.DC)({fromFeature:e})})),(0,c.n)((()=>{B.pL.fire(!0)}))}setupResizeHandlers(){a.oO.listen((()=>{this.repositionChildrenRecursive(),this.handleResize()})),window.onorientationchange=()=>{(0,v.Eh)(),this.repositionChildrenRecursive()}}setupLoadRoom(e){this.loadRoom(e,!0),f.VZ.listen((e=>{(0,U.Iw)()>172800?window.location.pathname=`/${e}/`:this.loadRoom(e,!0)})),p.X0.listen((e=>{this.handleRoomLoaded(e)}))}createChatConnection(e){this.chatConnection=new u.Z(e,!0)}setDocumentTitle(e,t){document.title=I.R.mobileDocumentTitle(e,o.m.siteName,t)}loadRoom(e,t){if(this.isRoomLoaded(e))return;this.loadedRoom={room:e,roomTitle:""},this.lastLoadRoomId+=1;const i=this.lastLoadRoomId;this.getRoomDossierPromise(e).then((e=>{i===this.lastLoadRoomId&&this.onRoomDossierLoad(e,t)})).catch((t=>{this.onRoomDossierError(t,e)}))}getRoomDossierPromise(e){return(0,b.Bc)(e)}onRoomDossierLoad(e,t){void 0!==this.cleanupLastRoomCallback&&this.cleanupLastRoomCallback(),(0,y.RN)(e.room),this.setDocumentTitle(e.room,e.roomTitle),this.loadedRoom.roomTitle=e.roomTitle,n.Aw.setState(e),F.fire(e),this.createChatConnection(e),this.chatConnection.event.titleChange.listen((t=>{this.setDocumentTitle(e.room,t)})),this.tipVolume=e.userChatSettings.tipVolume,this.audioHolder.loadTipSounds(),this.chatConnection.event.playSound.listen((e=>{this.handlePlaySound(e)})),this.handleSetWidescreen(e.isWidescreen);const i={dossier:e,chatConnection:this.chatConnection};let s,o;this.player.playerComponent.handleRoomLoaded(i),this.cleanupLastRoomCallback=()=>{clearInterval(s),window.clearTimeout(o),this.chatConnection.disconnect(),this.player.playerComponent.stop(),this.listenerGroup.removeAll(),p.Gr.fire(void 0)},t&&this.handleHistory(e),this.isRoomInitiallyOffline(i.dossier)?this.handleRoomInitiallyOffline():this.handleRoomInitiallyOnline(),p.X0.fire(i),this.listenerGroup.add(this.chatConnection.event.statusChange.listen((e=>{const t=["privatewatching","privatespying"],i=t.includes(e.currentStatus),n=t.includes(e.previousStatus);switch(("notconnected"===e.previousStatus||i||n)&&(clearInterval(s),s=window.setInterval((()=>{this.chatConnection.updateRoomCount(i)}),1e3*(i?5:90)),o=window.setTimeout((()=>{this.chatConnection.updateRoomCount(i||n)}),2e3)),e.currentStatus){case"passwordprotected":this.handleRoomStatusPasswordProtected(this.chatConnection);break;case"offline":this.handleRoomStatusOffline(this.chatConnection)}this.handleRoomStatusChangeNotification(e)}))),this.listenerGroup.add(B.EZ.listen((e=>{this.handleUpdateChatSettings(this.chatConnection,e)}))),this.repositionChildrenRecursive()}isRoomInitiallyOffline(e){return"offline"===e.roomStatus}onRoomDossierError(e,t){if(e instanceof h.fr&&""!==e.xhr.responseText){if("application/json"!==e.xhr.getResponseHeader("Content-Type"))return void error("Error reading room dossier error",{room:t,error:e.xhr.responseText});const i=new s.N6(e.xhr.responseText);switch(i.getStringOrUndefined("code",!1)){case"access-denied":this.handleRoomAccessDenied(t,i);break;case"unauthorized":this.handleRoomUnauthorized(t);break;case"password-required":this.handleRoomPasswordRequired(t);break;default:error("Error parsing room dossier error",{room:t,error:e.xhr.responseText})}}else error("Error occurred while processing room dossier",{room:t,error:e})}isRoomLoaded(e){const t=e===this.loadedRoom.room,i=!this.chatConnection||this.chatConnection.room()===e;return t&&i}setupPrivateShowRequestOverlay(){this.privateShowRequestModal=this.addChild(new w.nE),B.Ne.listen((e=>{"split"===E.L.getVideoMode()&&(void 0===e?this.privateShowRequestModal.showPending(this.chatConnection):this.privateShowRequestModal.show(e))})).addTo(this.listenerGroup),B.ef.listen((()=>{this.privateShowRequestModal.hide()})).addTo(this.listenerGroup)}}},1516:(e,t,i)=>{"use strict";i.d(t,{m:()=>D,s:()=>L});var s=i(7623),n=i(8861),o=i(9447),r=i(9937),a=i(1224),l=i(9603),h=i(6784),d=i(213),c=i(5216),u=i(6844),p=i(7347),m=i(2939),g=i(2709),v=i(5020),f=i(3955),y=i(8423),b=i(9586),w=i(7407),C=i(5424),S=i(3320),x=i(4660),T=i(3417),A=i(2690),P=i(4947);class k extends A.z{constructor(){super(),m.X0.listen((e=>this.chatConnection=e.chatConnection)),this.element.id="RemoveIgnoredUsersModal",this.element.style.position="fixed",this.element.style.width="450px",this.element.style.height="",this.element.style.borderRadius="6px",this.element.style.padding="10px",this.element.style.fontSize="12px",this.element.style.left="50%",this.element.style.top="50%",this.element.style.transform="translate(-50%, -50%)",(0,o.fZ)(this.overlay,"overlay"),this.overlay.style.background="",this.overlay.style.opacity="0.4";const e=this.createCloseButton(`${STATIC_URL}close.svg`);(0,o.fZ)(e,"lightCloseButton"),e.style.opacity="0.5",this.element.appendChild(e);const t=this.createCloseButton(`${STATIC_URL}close-gray.svg`);(0,o.fZ)(t,"darkCloseButton"),this.element.appendChild(t);const i=document.createElement("div");(0,o.fZ)(i,"header"),i.innerText=P.R.removeIgnoredUsers,i.style.fontSize="15px",i.style.fontFamily="UbuntuMedium, Helvetica, Arial, sans-serif",i.style.textAlign="center",this.element.appendChild(i),this.helpText=document.createElement("div"),(0,o.fZ)(this.helpText,o.aG.textColor),this.helpText.innerText="",this.helpText.style.margin="10px 0",this.helpText.style.textAlign="center",this.element.appendChild(this.helpText),this.element.appendChild(this.createIgnoreWrapper()),this.element.appendChild(this.createUnignoreWrapper());const s=document.createElement("div");s.style.textAlign="right";const n=document.createElement("span");(0,o.fZ)(n,"saveButton"),n.innerText=P.R.saveCAPS,n.style.display="inline-block",(0,o.fZ)(n,"gradient"),n.style.fontFamily="UbuntuMedium, Helvetica, Arial, sans-serif",n.style.fontSize="14px",n.style.padding="5px 15px 5px 15px",n.style.marginTop="10px",n.style.borderRadius="4px",n.style.cursor="pointer",n.onclick=()=>{this.saveButtonHandler()},s.appendChild(n),this.element.appendChild(s),this.overlayClick.listen((()=>{this.hide()}))}createSelectLabel(e){const t=document.createElement("div");return(0,o.fZ)(t,"bluetxt"),t.textContent=e,t.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",t.style.fontWeight="bold",t}createMultipleSelect(){const e=document.createElement("select");return(0,o.fZ)(e,"select"),e.multiple=!0,e}createCloseButton(e){const t=document.createElement("img");return t.src=e,t.style.position="absolute",t.style.width="14px",t.style.height="14px",t.style.top="10px",t.style.right="10px",t.style.cursor="pointer",t.onclick=()=>{this.hide()},t.onmouseenter=()=>{t.style.opacity="1"},t.onmouseleave=()=>{t.style.opacity="0.5"},t}}class M extends k{constructor(){super(),this.helpText.innerText=P.R.clickToUnignoreText}initData(){this.marginBetweenIgnoreUnignorePx=10}initAndShow(){for(;null!==this.ignoredUsersSelect.firstChild;)this.ignoredUsersSelect.removeChild(this.ignoredUsersSelect.firstChild);for(;null!==this.unignoredUsersSelect.firstChild;)this.unignoredUsersSelect.removeChild(this.unignoredUsersSelect.firstChild);const e=(0,T.V6)(!0);for(const t of e){const e=document.createElement("option");e.innerText=t,e.value=t,this.ignoredUsersSelect.appendChild(e)}super.show()}createIgnoreWrapper(){const e=document.createElement("div");e.style.display="inline-block",e.style.marginRight=`${this.marginBetweenIgnoreUnignorePx}px`,e.style.width=`calc(50% - ${this.marginBetweenIgnoreUnignorePx/2}px)`;const t=this.createSelectLabel(P.R.ignoredUsers);return e.appendChild(t),this.ignoredUsersSelect=this.createMultipleSelect(),this.ignoredUsersSelect.style.borderWidth="1px",this.ignoredUsersSelect.style.borderStyle="solid",this.ignoredUsersSelect.style.borderRadius="4px",this.ignoredUsersSelect.style.marginTop="4px",this.ignoredUsersSelect.style.width="100%",this.ignoredUsersSelect.style.height="200px",this.ignoredUsersSelect.style.padding="2px",this.ignoredUsersSelect.style.overflow="auto",this.ignoredUsersSelect.onchange=()=>{const e=this.ignoredUsersSelect.selectedOptions.length,t=[...this.ignoredUsersSelect.selectedOptions];for(let i=0;i{const e=this.unignoredUsersSelect.selectedOptions.length,t=[...this.unignoredUsersSelect.selectedOptions];for(let i=0;ithis.saveSettings())),this.showEmoticonsCheckbox.element.dataset.testid="show-emoticons-checkbox",this.highestTokenColorSelect=document.createElement("select"),this.highestTokenColorSelect.dataset.testid="highest-token-color-select",this.notifyEntryForSelect=document.createElement("select"),this.notifyEntryForSelect.dataset.testid="notify-entry-for-select",this.notifyLeaveForSelect=document.createElement("select"),this.notifyLeaveForSelect.dataset.testid="notify-leave-for-select",this.tipVolumeValueLabel=document.createElement("label"),this.tipVolumeValueLabel.dataset.testid="tip-volume-value-label",this.tipVolumeSlider=new S.A({handleDiameter:16,handleColor:"rgb(246, 115, 0)",emptyBarColor:"#cccccc",filledBarColor:"rgb(246, 115, 0)"}),this.tipVolumeSlider.element.dataset.testid="tip-volume-slider",this.collapseNoticesCheckbox=new r.l(!1,(()=>this.saveSettings())),this.collapseNoticesCheckbox.element.dataset.testid="collapse-notices-checkbox",this.manageIgnoredUsersLink=document.createElement("label"),this.manageIgnoredUsersLink.dataset.testid="manage-ignored-users-link"}initUI(){this.element.style.width="100%",this.element.style.overflow="auto",this.element.style.boxSizing="border-box",this.element.style.padding="11px",this.element.style.fontSize="12px",this.element.style.position="static",this.form.style.marginBottom="40px",this.form.style.maxWidth="400px",this.element.appendChild(this.form);const e=document.createElement("div");e.dataset.testid="font-settings";const t=document.createElement("div");t.dataset.testid="emoticons-settings",this.form.appendChild(e),this.form.appendChild(t),this.form.appendChild(this.usersSettings),this.form.appendChild(this.notificationsSettings),this.form.appendChild(this.otherSettings),this.getStyles().styleContainer(e),this.getStyles().styleContainer(t),this.getStyles().styleContainer(this.usersSettings),this.getStyles().styleContainer(this.notificationsSettings),this.getStyles().styleContainer(this.otherSettings);const i=this.createHeader(P.R.fontSettings);i.style.marginTop="0",e.appendChild(i),e.appendChild(this.createColorPicker()),e.appendChild(this.createFontFamilyPicker()),e.appendChild(this.createFontSizePicker()),t.appendChild(this.createHeader(P.R.emoticonsSettings)),t.appendChild(this.createShowEmoticonsPicker()),t.appendChild(this.createEmoticonAutocompleteDelayPicker()),this.usersSettings.appendChild(this.createHeader(P.R.usersSettings)),this.createUserSettings(),this.createNotificationSettings(),this.otherSettings.appendChild(this.createHeader(P.R.otherSettings)),this.createOtherSettings(),(0,b.H)(this.element,!0),I.EZ.listen((e=>{this.updateChatSettings(e)})),m.X0.listen((e=>{this.handleRoomLoaded(e)})),E.xw.listen((e=>{this.isModerator=e.isMod,this.updateNotificationsSettingsVisibility()}))}hideModals(){void 0!==this.colorPickerModal&&this.colorPickerModal.hide(),void 0!==this.removeIgnoredUserUI&&this.removeIgnoredUserUI.hide()}updateChatColor(e){this.chatColorInput.value=e,this.chatColorSwatch.style.color=e,this.chatColorSwatch.style.backgroundColor=e}openColorSwatch(e){if(!this.isBroadcaster()){if((0,u.rC)(P.R.mustBeLoggedInForChatColor))return void e.preventDefault();if(!this.isSupporter)return(0,d.Q$)(P.R.mustBeSupporterForChatColor),void e.preventDefault()}void 0===this.colorPickerModal&&(this.colorPickerModal=this.addChild(this.createColorPickerModal())),this.colorPickerModal.show(this.chatColorInput.value)}onColorPicked(e){this.updateChatColor(e),this.saveSettings()}onColorHovered(e){this.updateChatColor(e)}createColorPickerModal(){return new x.J(this.chatColorSwatch,(e=>this.onColorPicked(e)),(e=>this.onColorHovered(e)))}createLabelWithTooltip(e,t){const i=document.createElement("span");(0,o.fZ)(i,"tooltip-info-icon");const s=(0,l.q)({content:t,hasHTML:!1,divotPosition:v.Wi.Bottom});s.style.position="fixed",s.style.display="block";const n=document.createElement("div");return n.style.display="inline-block",n.appendChild(e),n.appendChild(i),(0,f.JR)(i,{handleTouch:!0}).listen((e=>{var t;e?n.appendChild(s):null===(t=s.parentElement)||void 0===t||t.removeChild(s);const o=i.getBoundingClientRect(),r=(0,f.Mx)();s.style.top=-r.top+o.top-s.offsetHeight-o.height/5-5+"px",s.style.left=`${-r.left+o.left+(o.width-22)}px`})),n}createRow(e,t,i,s,n){const o=document.createElement("div");if(this.getStyles().styleRowWrapper(o),void 0!==n?o.appendChild(this.createLabelWithTooltip(e,n)):o.appendChild(e),o.appendChild(i),void 0!==s&&i instanceof HTMLSelectElement)for(const e of s){const t=document.createElement("option");t.innerText=e.label.toString(),t.value=e.value.toString(),i.appendChild(t)}return this.getStyles().styleLabel(e,t),this.getStyles().styleInput(i),o.onclick=e=>{(0,u.rC)(P.R.mustBeLoggedInForChatSettings)?e.preventDefault():e.target!==i&&i.focus()},i.onmousedown=e=>{(0,u.rC)(P.R.mustBeLoggedInForChatSettings)&&e.preventDefault()},i instanceof HTMLSelectElement&&this.updateSelectWidth(i),(0,h.wu)("change",i,(e=>{i instanceof HTMLSelectElement&&this.updateSelectWidth(i),this.saveSettings()})),o}createColorPicker(){const e=document.createElement("label"),t=this.createRow(e,P.R.chatColor,this.chatColorSwatch);return t.dataset.testid="chat-settings-color-picker",t.appendChild(this.chatColorInput),this.styleWrapperCustom(t),this.styleLabelCustom(e),this.styleColorSwatch(this.chatColorSwatch),this.chatColorSwatch.onmousedown=e=>this.openColorSwatch(e),t.onclick=e=>this.openColorSwatch(e),this.chatColorInput.type="hidden",t}createFontFamilyPicker(){const e=document.createElement("label"),t=this.createRow(e,P.R.font,this.fontFamilySelect,this.getFontOptions());t.dataset.testid="chat-settings-font-family-picker";const i=e=>{if(!this.isBroadcaster()){if((0,u.rC)(P.R.mustBeLoggedInForFontFamily))return void e.preventDefault();if(!this.isSupporter)return e.preventDefault(),this.fontFamilySelect.blur(),void(0,d.Q$)(P.R.mustBeSupporterForFontFamily)}};return this.fontFamilySelect.onmousedown=e=>i(e),(0,h.wu)("click",t,(e=>{i(e)})),t}createFontSizePicker(){const e=[];for(let t=9;t<=20;t+=1)e.push({label:`${t}pt`,value:`${t}pt`});const t=document.createElement("label");return this.createRow(t,P.R.fontSize,this.fontSizeSelect,e)}createShowEmoticonsPicker(){const e=document.createElement("label"),t=this.createRow(e,P.R.showEmoticons,this.showEmoticonsCheckbox.element);return this.styleWrapperCustom(t),this.styleLabelCustom(e),this.styleCheckbox(this.showEmoticonsCheckbox.element),(0,h.wu)("click",t,(e=>{e.preventDefault(),e.stopPropagation(),this.showEmoticonsCheckbox.focus(),this.showEmoticonsCheckbox.setChecked(!this.showEmoticonsCheckbox.isChecked())}),!0),t}createEmoticonAutocompleteDelayPicker(){const e=document.createElement("label");return this.createRow(e,P.R.emoticonAutoCompleteDelay,this.emoticonAutocompleteDelaySelect,this.getEmoticonAutocompleteDelayOptions())}createHighestTokenColorPicker(){const e=document.createElement("label");return this.createRow(e,P.R.highestTokenColor,this.highestTokenColorSelect,this.getHighestTokenColorOptions(),P.R.highestTokenColorTooltip)}createNotifyEntryPicker(){const e=document.createElement("label");return this.createRow(e,P.R.notifyEntryFor,this.notifyEntryForSelect,this.getNotifyEntryLeaveOptions())}createNotifyLeavePicker(){const e=document.createElement("label");return this.createRow(e,P.R.notifyLeaveFor,this.notifyLeaveForSelect,this.getNotifyEntryLeaveOptions())}createTipVolumePicker(){let e="";L.listen((t=>{e=t}));const t=this.createRow(this.tipVolumeValueLabel,P.R.tipVolume,this.tipVolumeSlider.element);return this.styleSlider(this.tipVolumeSlider),this.handleSliderMove(this.tipVolumeSlider.getValue()),this.tipVolumeSlider.valueChangeStart.listen((e=>{this.handleSliderMove(e)})),this.tipVolumeSlider.valueChanged.listen((e=>this.handleSliderMove(e))),this.tipVolumeSlider.valueChangeEnd.listen((t=>{this.handleSliderMove(t),(0,w.bT)("TipVolumeChanged",{tipvol:t,chatmode:e}),this.saveSettingsOrCookie()})),t.onclick=()=>{},this.tipVolumeSlider.element.onmousedown=()=>{},t}handleSliderMove(e){this.tipVolumeValueLabel.innerText=`${P.R.tipVolume} (${Math.round(e)}%)`}createCollapseNoticesPicker(){const e=document.createElement("label"),t=this.createRow(e,P.R.collapseNotices,this.collapseNoticesCheckbox.element);return this.styleWrapperCustom(t),this.styleLabelCustom(e),this.styleCheckbox(this.collapseNoticesCheckbox.element),(0,h.wu)("click",t,(e=>{e.preventDefault(),e.stopPropagation(),this.collapseNoticesCheckbox.focus(),this.collapseNoticesCheckbox.setChecked(!this.collapseNoticesCheckbox.isChecked())}),!0),this.collapseNoticesCheckbox.setOnChange((()=>{(0,w.bT)("CollapseNoticesToggled",{state:this.collapseNoticesCheckbox.isChecked()?"on":"off"}),this.saveSettings()})),t}createManageIgnoredUsersPicker(){const e=this.createSettingsLink(this.manageIgnoredUsersLink,P.R.viewEditIgnoredUsers);return e.appendChild(this.manageIgnoredUsersLink),this.manageIgnoredUsersLink.onclick=()=>{(0,u.rC)(P.R.mustBeLoggedInForIgnoredUsers)||(void 0===this.removeIgnoredUserUI&&this.createManageIgnoredUsersUI(),void 0!==this.removeIgnoredUserUI&&this.removeIgnoredUserUI.initAndShow())},e}createSettingsLink(e,t){const i=document.createElement("div");return this.getStyles().styleRowWrapper(i),(0,o.fZ)(e,"link"),e.innerText=t,e.style.marginTop="16px",e.style.cursor="pointer",e.onmouseenter=()=>{e.style.textDecoration="underline"},e.onmouseleave=()=>{e.style.textDecoration="none"},i}createManageIgnoredUsersUI(){void 0===this.removeIgnoredUserUI&&(this.removeIgnoredUserUI=(0,s.Xb)()?new R:new M)}createHeader(e){const t=document.createElement("div");return this.getStyles().styleHeader(t,e),t}saveSettingsOrCookie(){const e=Math.round(this.tipVolumeSlider.getValue());this.isAnon?((0,n.uC)("tipvol",`${e}`,{days:60}),this.userChatSettings.tipVolume=e,I.EZ.fire(this.userChatSettings)):this.saveSettings()}saveSettings(){(0,u.rC)(P.R.mustBeLoggedInForChatSettings)?I.EZ.fire(this.userChatSettings):(this.chatColorInput.value!==this.userChatSettings.fontColor&&(this.isBroadcaster()||this.isSupporter)&&(0,c.KF)(this.getSaveColorEndpoint(),{color:this.chatColorInput.value}).catch((e=>{this.chatColorInput.value=this.userChatSettings.fontColor,error("Error saving user chat color",e)})),(0,c.KF)(this.getSaveEndpoint(),this.getFormData()).then((e=>{this.chatSettingsSavedRequest.fire(void 0),this.setUserChatSettings(),I.EZ.fire(this.userChatSettings)})).catch((e=>{error("Error saving user chat settings",e)})))}setUserChatSettings(){this.hasModeratorPrivileges()&&(this.userChatSettings.roomEntryFor=(0,C.OC)(this.notifyEntryForSelect.value),this.userChatSettings.roomLeaveFor=(0,C.OC)(this.notifyLeaveForSelect.value)),this.userChatSettings.fontColor=this.chatColorInput.value,this.userChatSettings.fontFamily=decodeURIComponent(this.fontFamilySelect.value),this.userChatSettings.fontSize=this.fontSizeSelect.value,this.userChatSettings.showEmoticons=this.showEmoticonsCheckbox.isChecked(),this.userChatSettings.emoticonAutocompleteDelay=parseInt(this.emoticonAutocompleteDelaySelect.value),this.userChatSettings.highestTokenColor=this.highestTokenColorSelect.value,this.userChatSettings.tipVolume=Math.round(this.tipVolumeSlider.getValue()),this.userChatSettings.collapseNotices=this.collapseNoticesCheckbox.isChecked()}getFormData(){const e={color:this.chatColorInput.value,font_family:decodeURIComponent(this.fontFamilySelect.value),font_size:this.fontSizeSelect.value,show_emoticons:`${this.showEmoticonsCheckbox.isChecked()}`,emoticon_autocomplete_delay:this.emoticonAutocompleteDelaySelect.value,highest_token_color:this.highestTokenColorSelect.value,tip_volume:`${Math.round(this.tipVolumeSlider.getValue())}`,collapse_notices:`${this.collapseNoticesCheckbox.isChecked()}`};return this.hasModeratorPrivileges()&&(e.enter_notify=this.notifyEntryForSelect.value,e.leave_notify=this.notifyLeaveForSelect.value),e}getSaveColorEndpoint(){return"choose_viewer_chat_color/"}getSaveEndpoint(){return`api/viewerchatsettings/${this.roomName}/`}hasModeratorPrivileges(){return this.isModerator}updateSelectWidth(e){}styleWrapperCustom(e){}styleLabelCustom(e){}styleColorSwatch(e){(0,o.fZ)(this.chatColorSwatch,"colorSwatch"),this.chatColorSwatch.style.width="20px",this.chatColorSwatch.style.height="20px",this.chatColorSwatch.style.border=`1px solid ${a.m.defaultColor}`,this.chatColorSwatch.style.cursor="pointer",this.chatColorSwatch.style.verticalAlign="middle"}styleCheckbox(e){e.style.display="block",e.style.marginBottom="10px"}styleSlider(e){this.tipVolumeSlider.element.style.display="inline-block",this.tipVolumeSlider.element.style.border="none",this.tipVolumeSlider.element.style.verticalAlign="top",this.tipVolumeSlider.element.style.height="16px",this.tipVolumeSlider.element.style.width="100%"}repositionChildren(){this.tipVolumeSlider.handleResize()}getTipVolumeSlider(){return this.tipVolumeSlider}getStyles(){return void 0===this.chatSettingsStyles&&(this.chatSettingsStyles=new p.U),this.chatSettingsStyles}createUserSettings(){this.usersSettings.appendChild(this.createHighestTokenColorPicker())}createNotificationSettings(){this.notificationsSettings.appendChild(this.createHeader(P.R.notificationsSettings)),this.notificationsSettings.appendChild(this.createNotifyEntryPicker()),this.notificationsSettings.appendChild(this.createNotifyLeavePicker())}createOtherSettings(){this.otherSettings.appendChild(this.createTipVolumePicker()),this.otherSettings.appendChild(this.createCollapseNoticesPicker()),this.otherSettings.appendChild(this.createManageIgnoredUsersPicker())}updateChatSettings(e){this.userChatSettings=e,this.updateChatColor(this.userChatSettings.fontColor),this.fontFamilySelect.value=this.userChatSettings.fontFamily,this.fontSizeSelect.value=this.userChatSettings.fontSize,this.showEmoticonsCheckbox.setCheckedDirectly(this.userChatSettings.showEmoticons),this.emoticonAutocompleteDelaySelect.value=this.userChatSettings.emoticonAutocompleteDelay.toString(),this.highestTokenColorSelect.value=this.userChatSettings.highestTokenColor,this.updateSelectWidth(this.fontFamilySelect),this.updateSelectWidth(this.fontSizeSelect),this.updateSelectWidth(this.emoticonAutocompleteDelaySelect),this.updateSelectWidth(this.highestTokenColorSelect),this.tipVolumeSlider.setValue(this.userChatSettings.tipVolume),this.handleSliderMove(this.userChatSettings.tipVolume),(0,w.U4)(this.userChatSettings.tipVolume),this.collapseNoticesCheckbox.setCheckedDirectly(this.userChatSettings.collapseNotices)}isBroadcaster(){return!1}handleRoomLoaded(e){this.updateChatSettings(e.dossier.userChatSettings),this.roomName=e.dossier.room,this.isModerator=e.dossier.isModerator,this.isSupporter=e.dossier.isSupporter,this.isAnon=e.chatConnection.viewerIsAnonymous(),this.updateNotificationsSettingsVisibility()}updateNotificationsSettingsVisibility(){this.hasModeratorPrivileges()?(this.notificationsSettings.style.display="block",this.notifyEntryForSelect.value=B(this.userChatSettings.roomEntryFor),this.notifyLeaveForSelect.value=B(this.userChatSettings.roomLeaveFor)):this.notificationsSettings.style.display="none"}getFontOptions(){return[{label:"Default",value:"default"},{label:"Arial",value:"Arial, Helvetica"},{label:"Bookman Old Style",value:"Bookman Old Style"},{label:"Comic Sans",value:'"Comic Sans MS", cursive'},{label:"Courier",value:'"Courier New"'},{label:"Lucida",value:"Lucida"},{label:"Palantino",value:"Palantino"},{label:"Tahoma",value:"Tahoma, Geneva"},{label:"Times New Roman",value:'"Times New Roman"'}]}getEmoticonAutocompleteDelayOptions(){return[{label:"Turn Off Autocomplete",value:"-1"},{label:"No Delay - 0s",value:"0"},{label:"Short - 0.5s",value:"500"},{label:"Medium - 1s",value:"1000"},{label:"Long - 1.5s",value:"1500"}]}getHighestTokenColorOptions(){return[{label:"Dark Purple (Tipped 1000 recently)",value:"darkpurple"},{label:"Light Purple (Tipped 250 recently)",value:"lightpurple"},{label:"Dark Blue (Tipped 50 recently)",value:"darkblue"},{label:"Light Blue (Owns or purchased tokens)",value:"lightblue"}]}getNotifyEntryLeaveOptions(){return[{label:"All Registered Users",value:"orga"},{label:"Mods, Fans, and Users With Tokens",value:"orgb"},{label:"Mods and Fans",value:"org"},{label:"No Users",value:"none"}]}}function B(e){switch(e){case C.XL.AllUsers:return"orga";case C.XL.ModsFansAndTokens:return"orgb";case C.XL.ModsAndFans:return"org";case C.XL.None:return"none";default:return error(`Invalid enter/leave setting: ${e}`),"orgb"}}},7347:(e,t,i)=>{"use strict";i.d(t,{U:()=>n});var s=i(9447);class n{styleContainer(e){}styleHeader(e,t){e.innerText=t,e.style.fontWeight="bold",e.style.fontSize="12px",e.style.margin="14px 0 8px",e.style.backgroundColor=""}styleRowWrapper(e){e.style.margin="4px 0 7px 4px"}styleLabel(e,t){e.innerText=t,e.style.fontSize="12px",e.style.display="inline-block",e.style.marginBottom="5px"}styleInput(e){(0,s.fZ)(e,"chat-settings-input"),e.style.display="block",e.style.fontSize="12px",e.style.marginTop="0",e.style.borderWidth="1px",e.style.borderStyle="solid",e instanceof HTMLSelectElement&&((0,s.fZ)(e,"chat-settings-select"),e.style.height="24px",e.style.width="100%")}}},3333:(e,t,i)=>{"use strict";i.d(t,{NX:()=>l,eF:()=>a,uJ:()=>r});var s=i(6784),n=i(8423),o=i(7407);const r="dismissibleSettingsLink",a=new n.c_("goToSettingsTab");function l(e){(0,s.wu)("click",e,(e=>{e.preventDefault(),(0,o.bT)("DismissibleSettingsLinkClicked"),a.fire()}))}},3502:(e,t,i)=>{"use strict";i.d(t,{d:()=>a});var s=i(8598),n=i(213),o=i(4947),r=i(1372);function a(e,t,i,a,l){const h=(0,r.tT)("div",{className:`undo-ban-options-${t.silenced}`,style:{boxSizing:"border-box",padding:"2px 5px 3px 25px",fontWeight:"bold"}}),d=(0,r.tT)("a",{href:"#",className:"msg-link",onClick:function(e){null==e||e.preventDefault(),u(),(0,s.$)(i,t.isBan?"remove_ban":"remove_silence",a.dossier.room,(()=>{l(t.isBan?o.R.banRemovedMessage:o.R.silenceRemovedMessage)}),(()=>{l(t.isBan?o.R.banRemoveErrorMessage:o.R.silenceRemoveErrorMessage)}))}},o.R.inlineUndoText),c=(0,r.tT)("a",{href:"#",style:{color:"inherit"},onClick:u},"(",o.R.dismissLower,")");function u(i){var s;null==i||i.preventDefault(),null===(s=h.parentElement)||void 0===s||s.removeChild(h);const n=e.element.getElementsByClassName(`undo-ban-options-${t.silenced}`);Array.from(n).forEach((e=>{var t;null===(t=e.parentElement)||void 0===t||t.removeChild(e)}))}if(h.appendChild(d),d.dataset.testid="undo-button",c.dataset.testid="dismiss-button",!t.isBan&&a.dossier.userName===a.dossier.room){function p(e){null==e||e.preventDefault(),(0,n.mf)(o.R.banUserConfirm(t.silenced),(()=>{u(),(0,s.$)(i,"convert_to_ban",a.dossier.room,(()=>{}),(()=>{l(o.R.banConvertErrorMessage)}))}))}const m=(0,r.tT)("a",{href:"#",style:{color:"red"},onClick:p},o.R.inlineBanText);m.dataset.testid="ban-button",h.appendChild(document.createTextNode(" ".repeat(5))),h.appendChild(m)}return h.appendChild(document.createTextNode(" ".repeat(5))),h.appendChild(c),u(),h}},8122:(e,t,i)=>{"use strict";function s(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");const i=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),i&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function n(e){return Math.min(1,Math.max(0,e))}function o(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function r(e){return e<=1?100*e+"%":e}function a(e){return 1===e.length?`0${e}`:String(e)}function l(e,t,i){e=s(e,255),t=s(t,255),i=s(i,255);const n=Math.max(e,t,i),o=Math.min(e,t,i);let r=0,a=0;const l=(n+o)/2;if(n===o)a=0,r=0;else{const s=n-o;switch(a=l>.5?s/(2-n-o):s/(n+o),n){case e:r=(t-i)/s+(t1&&(i-=1),i<1/6?e+6*i*(t-e):i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function d(e,t,i){e=s(e,255),t=s(t,255),i=s(i,255);const n=Math.max(e,t,i),o=Math.min(e,t,i);let r=0;const a=n,l=n-o,h=0===n?0:l/n;if(n===o)r=0;else{switch(n){case e:r=(t-i)/l+(tN,hd:()=>H,at:()=>U});const m={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};const g="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",v=`[\\s|\\(]+(${g})[,|\\s]+(${g})[,|\\s]+(${g})\\s*\\)?`,f=`[\\s|\\(]+(${g})[,|\\s]+(${g})[,|\\s]+(${g})[,|\\s]+(${g})\\s*\\)?`,y={CSS_UNIT:new RegExp(g),rgb:new RegExp(`rgb${v}`),rgba:new RegExp(`rgba${f}`),hsl:new RegExp(`hsl${v}`),hsla:new RegExp(`hsla${f}`),hsv:new RegExp(`hsv${v}`),hsva:new RegExp(`hsva${f}`),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function b(e){return Boolean(y.CSS_UNIT.exec(String(e)))}function w(e){return!isNaN(Number(e))}class C{static setColorSpace(e){C.globalSpace=e}get colorSpace(){return 1===C.globalSpace?this.HSL:0===C.globalSpace?this.CIELAB:this.YPbPr}get lightness(){return this.colorSpace.lightness}matchHue(e){const t=C.get(e).toHsl().h,i=this.toHsl();return i.h=t,C.get(i)}constructor(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.lighten=e=>this.colorSpace.lighten(e),this.darken=e=>this.colorSpace.darken(e),this.setLightness=e=>this.colorSpace.setLightness(e),this.matchLightness=e=>this.colorSpace.matchLightness(e),t instanceof C)return t.clone();"number"==typeof t&&(t=function(e){return{r:e>>16,g:(65280&e)>>8,b:255&e}}(t)),this.originalInput=t;const n=function(e){var t;let i={r:0,g:0,b:0},n=1,a=null,l=null,d=null,c=!1,g=!1;var v,f,C,S,x,T;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;let t=!1;if(m[e])e=m[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};let i=y.rgb.exec(e);return null!==i?{r:i[1],g:i[2],b:i[3]}:(i=y.rgba.exec(e),null!==i?{r:i[1],g:i[2],b:i[3],a:i[4]}:(i=y.hsl.exec(e),null!==i?{h:i[1],s:i[2],l:i[3]}:(i=y.hsla.exec(e),null!==i?{h:i[1],s:i[2],l:i[3],a:i[4]}:(i=y.hsv.exec(e),null!==i?{h:i[1],s:i[2],v:i[3]}:(i=y.hsva.exec(e),null!==i?{h:i[1],s:i[2],v:i[3],a:i[4]}:(i=y.hex8.exec(e),null!==i?{r:p(i[1]),g:p(i[2]),b:p(i[3]),a:u(i[4]),format:t?"name":"hex8"}:(i=y.hex6.exec(e),null!==i?{r:p(i[1]),g:p(i[2]),b:p(i[3]),format:t?"name":"hex"}:(i=y.hex4.exec(e),null!==i?{r:p(i[1]+i[1]),g:p(i[2]+i[2]),b:p(i[3]+i[3]),a:u(i[4]+i[4]),format:t?"name":"hex8"}:(i=y.hex3.exec(e),null!==i&&{r:p(i[1]+i[1]),g:p(i[2]+i[2]),b:p(i[3]+i[3]),format:t?"name":"hex"})))))))))}(e)),"object"==typeof e&&(b(e.r)&&b(e.g)&&b(e.b)?(S=e.r,x=e.g,T=e.b,i={r:255*s(S,255),g:255*s(x,255),b:255*s(T,255)},c=!0,g="%"===String(e.r).substr(-1)?"prgb":"rgb"):w(e.y)&&w(e.pb)&&w(e.pr)?(v=e.y,f=e.pb,C=e.pr,i={r:Math.round(v+1.402*C),g:Math.round(v-.344*f-.714*C),b:Math.round(v+1.772*f)},c=!0,g="ypbpr"):b(e.h)&&b(e.s)&&b(e.v)?(a=r(e.s),l=r(e.v),i=function(e,t,i){e=6*s(e,360),t=s(t,100),i=s(i,100);const n=Math.floor(e),o=e-n,r=i*(1-t),a=i*(1-o*t),l=i*(1-(1-o)*t),h=n%6;return{r:255*[i,a,r,r,l,i][h],g:255*[l,i,i,a,r,r][h],b:255*[r,r,l,i,i,a][h]}}(e.h,a,l),c=!0,g="hsv"):b(e.h)&&b(e.s)&&b(e.l)?(a=r(e.s),d=r(e.l),i=function(e,t,i){let n,o,r;if(e=s(e,360),t=s(t,100),i=s(i,100),0===t)o=i,r=i,n=i;else{const s=i<.5?i*(1+t):i+t-i*t,a=2*i-s;n=h(a,s,e+1/3),o=h(a,s,e),r=h(a,s,e-1/3)}return{r:255*n,g:255*o,b:255*r}}(e.h,a,d),c=!0,g="hsl"):w(e.l)&&w(e.a)&&w(e.b)&&(i=function(e,t,i){let s,n,o,r=(e+16)/116,a=t/500+r,l=r-i/200;return a=.95047*(a*a*a>.008856?a*a*a:(a-16/116)/7.787),r=1*(r*r*r>.008856?r*r*r:(r-16/116)/7.787),l=1.08883*(l*l*l>.008856?l*l*l:(l-16/116)/7.787),s=3.2406*a+-1.5372*r+-.4986*l,n=-.9689*a+1.8758*r+.0415*l,o=.0557*a+-.204*r+1.057*l,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:12.92*s,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:12.92*o,{r:255*Math.max(0,Math.min(1,s)),g:255*Math.max(0,Math.min(1,n)),b:255*Math.max(0,Math.min(1,o))}}(e.l,e.a,e.b),c=!0,g="lab"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=o(n),{ok:c,format:null!==(t=e.format)&&void 0!==t?t:g,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:n}}(t);this.originalInput=t,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(e=i.format)&&void 0!==e?e:n.format,this.gradientType=i.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok,this.initHSL(),this.initCIELAB(),this.initYPbPr()}initHSL(){const e=this;this.HSL={lighten:t=>{const i=e.toHsl();return i.l+=t/100,i.l=n(i.l),C.get(i)},darken:t=>e.HSL.lighten(-t),setLightness:t=>{const i=e.toHsl();return i.l=t,C.get(i)},matchLightness:t=>{const i=C.get(t).HSL.lightness,s=e.toHsl();return s.l=i,C.get(s)},get lightness(){return e.toHsl().l}}}initCIELAB(){const e=this;this.CIELAB={lighten:t=>{const i=e.toCieLab();return i.l+=t/100,i.l=n(i.l),C.get(i)},darken:t=>e.CIELAB.lighten(-t),setLightness:t=>{const i=e.toCieLab();return i.l=t,C.get(i)},matchLightness:t=>{const i=C.get(t).CIELAB.lightness,s=e.toCieLab();return s.l=i,C.get(s)},get lightness(){return e.toCieLab().l}}}initYPbPr(){const e=this;this.YPbPr={lighten:t=>{const i=e.toYPbPr();return i.y+=t/100*255,i.y=n(i.y),C.get(i)},darken:t=>e.YPbPr.lighten(-t),setLightness:t=>{const i=e.toYPbPr();return i.y=t,C.get(i)},matchLightness:t=>{const i=C.get(t).YPbPr.lightness,s=e.toYPbPr();return s.y=i,C.get(s)},get lightness(){return e.toYPbPr().y}}}static get(){return new C(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3}getLuminance(){const e=this.toRgb(),t=e.r/255,i=e.g/255,s=e.b/255;return.2126*S(t)+.7152*S(i)+.0722*S(s)}getAlpha(){return this.a}setAlpha(e){return this.a=o(e),this.roundA=Math.round(100*this.a)/100,this}toHsv(){const e=d(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}}toCieLab(){const e=function(e,t,i){let s,n,o;return t/=255,i/=255,s=(.4124*(e=(e/=255)>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92))/.95047,n=(.2126*e+.7152*t+.0722*i)/1,o=(.0193*e+.1192*t+.9505*i)/1.08883,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,{l:116*n-16,a:500*(s-n),b:200*(n-o)}}(this.r,this.g,this.b);return{l:e.l,a:e.a,b:e.b}}toHsvString(){const e=d(this.r,this.g,this.b),t=Math.round(360*e.h),i=Math.round(100*e.s),s=Math.round(100*e.v);return 1===this.a?`hsv(${t}, ${i}%, ${s}%)`:`hsva(${t}, ${i}%, ${s}%, ${this.roundA})`}toHsl(){const e=l(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}}toHslString(){const e=l(this.r,this.g,this.b),t=Math.round(360*e.h),i=Math.round(100*e.s),s=Math.round(100*e.l);return 1===this.a?`hsl(${t}, ${i}%, ${s}%)`:`hsla(${t}, ${i}%, ${s}%, ${this.roundA})`}toHex(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return c(this.r,this.g,this.b,e)}toHexString(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return`#${this.toHex(e)}`}toHex8(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(e,t,i,s,n){const o=[a(Math.round(e).toString(16)),a(Math.round(t).toString(16)),a(Math.round(i).toString(16)),a((r=s,Math.round(255*parseFloat(r)).toString(16)))];var r;return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this.r,this.g,this.b,this.a,e)}toHex8String(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return`#${this.toHex8(e)}`}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toYPbPr(){return{y:.299*(e=this.r)+.587*(t=this.g)+.114*(i=this.b),pb:-.169*e-.331*t+.5*i,pr:.5*e-.419*t-.081*i};var e,t,i}toRgbString(){const e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return 1===this.a?`rgb(${e}, ${t}, ${i})`:`rgba(${e}, ${t}, ${i}, ${this.roundA})`}toPercentageRgb(){const e=e=>`${Math.round(100*s(e,255))}%`;return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}toPercentageRgbString(){const e=e=>Math.round(100*s(e,255));return 1===this.a?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`}toName(){if(0===this.a)return"transparent";if(this.a<1)return!1;const e=`#${c(this.r,this.g,this.b,!1)}`;for(const[t,i]of Object.entries(m))if(e===i)return t;return!1}toString(e){var t,i;const s=Boolean(e);e=null!==(t=e)&&void 0!==t?t:this.format;let n=!1;const o=this.a<1&&this.a>=0;return s||!o||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),null!==(i=n)&&void 0!==i?i:this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return C.get(this.toString())}brighten(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(-e/100*255))),t.g=Math.max(0,Math.min(255,t.g-Math.round(-e/100*255))),t.b=Math.max(0,Math.min(255,t.b-Math.round(-e/100*255))),C.get(t)}tint(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix("#FFFFFF",e)}shade(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix("#000000",e)}desaturate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const t=this.toHsl();return t.s-=e/100,t.s=n(t.s),C.get(t)}saturate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const t=this.toHsl();return t.s+=e/100,t.s=n(t.s),C.get(t)}greyscale(){return this.desaturate(100)}spin(e){const t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,C.get(t)}mix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;const i=this.toRgb(),s=C.get(e).toRgb(),n=t/100,o={r:(s.r-i.r)*n+i.r,g:(s.g-i.g)*n+i.g,b:(s.b-i.b)*n+i.b,a:(s.a-i.a)*n+i.a};return C.get(o)}analogous(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;const i=this.toHsl(),s=360/t,n=[this];for(i.h=(i.h-(s*e>>1)+720)%360;--e;)i.h=(i.h+s)%360,n.push(C.get(i));return n}complement(){const e=this.toHsl();return e.h=(e.h+180)%360,C.get(e)}monochromatic(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6;const t=this.toHsv(),{h:i}=t,{s}=t;let{v:n}=t;const o=[],r=1/e;for(;e-- >0;)o.push(C.get({h:i,s,v:n})),n=(n+r)%1;return o}splitcomplement(){const e=this.toHsl(),{h:t}=e;return[this,C.get({h:(t+72)%360,s:e.s,l:e.l}),C.get({h:(t+216)%360,s:e.s,l:e.l})]}onBackground(e){const t=this.toRgb(),i=C.get(e).toRgb();return C.get({r:i.r+(t.r-i.r)*t.a,g:i.g+(t.g-i.g)*t.a,b:i.b+(t.b-i.b)*t.a})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(e){const t=this.toHsl(),{h:i}=t,s=[this],n=360/e;for(let o=1;o0&&void 0!==arguments[0]&&arguments[0];return this.a<1||e?[this.r,this.g,this.b,this.a]:[this.r,this.g,this.b]}get isBlack(){return this.equals("#000000")}static get black(){return C.get("#000000")}get isWhite(){return this.equals("#FFFFFF")}static get white(){return C.get("#FFFFFF")}get isTransparent(){return 0===this.getAlpha()}static get transparent(){return C.get("transparent")}isLessLuminousThan(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=this.getLuminance()-x(e);return t?i<=0:i<0}isMoreLuminousThan(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=this.getLuminance()-x(e);return t?i>=0:i>0}get rgbRange(){const e=this.toRgbArray();return Math.max(...e)-Math.min(...e)}}function S(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function x(e){return"number"==typeof e?e:C.get(e).getLuminance()}C.globalSpace=1;var T=i(6716);const A=/\s*,\s*/,P=/(?:[+-]?\d*\.?\d+)(?:%|[a-z]+)?/,k=D(["(?:",/#(?:[a-f0-9]{6}|[a-f0-9]{3})/,"|","(?:rgb|hsl)",/\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)/,"|","(?:rgba|hsla)",/\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*,\s*\d*\.?\d+\)/,"|",/[_a-z-][_a-z0-9-]*/,")"],""),M=D([k,"(?:\\s+",P,"(?:\\s+",P,")?)?"],""),R=D(["(?:",M,A,")*",M],""),I=["(?:(",D(["(?:(",/(?:[+-]?\d*\.?\d+)(?:deg|grad|rad|turn)/,")|",/to\s+((?:(?:left|right|top|bottom)(?:\s+(?:top|bottom|left|right))?))/,")"],""),")",A,")?(",R,")"],E=["\\s*(",k,")","(?:\\s+","(",P,"))?","(?:",A,"\\s*)?"];class L{constructor(e,t,i){this.stops=[],this.line=i[1];const s=t.exec(e);if(null===s)return;this.angle=s[1];const n=D(E,"gi");let o=n.exec(s[4]);for(;null!==o;){var r;this.stops.push({color:C.get(o[1]),position:null!==(r=o[2])&&void 0!==r?r:""}),o=n.exec(s[4])}}static parse(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(0===e.trim().length||!e.trim().toLowerCase().startsWith("linear-gradient"))return;const t=D(I,"gi"),i=t.exec(e);return null!==i?new L(e,t,i):void 0}isBlack(){return this.stops.every((e=>e.color.equals("black")))}isWhite(){return this.stops.every((e=>e.color.equals("white")))}toString(){const e=[];void 0!==this.angle&&e.push(this.angle);for(const t of this.stops)e.push(`${t.color.toRgbString()} ${t.position}`.trim());return`linear-gradient(${e.join(", ")})`}darkest(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";const t=C.get(e);let i=C.get("white"),s=i.getLuminance();for(const e of this.stops){const n=e.color.onBackground(t),o=n.getLuminance();o0&&void 0!==arguments[0]?arguments[0]:"white";const t=C.get(e);let i=C.get("white"),s=i.getLuminance();for(const e of this.stops){const n=e.color.onBackground(t),o=n.getLuminance();o>s&&(s=o,i=n)}return i}}function D(e,t){return new RegExp(e.reduce(((e,t)=>e+("string"==typeof t?t:t.source)),""),t)}T.gh.listen((e=>{const t=document.querySelectorAll(".dm-adjust"),i="darkmode"===e;for(const e of t)U(e,i)}));const B="#202C39";function U(e,t){if("photo"===e.getAttribute("type"))return;const i=e.firstElementChild;if(null!==i){var s,n,o;const e=i.classList.contains("roomNotice");if(e&&!(null!==(s=i.textContent)&&void 0!==s?s:"").startsWith("Notice:"))return;const r=t?null!==(n=i.getAttribute("dm-adjust-bg"))&&void 0!==n?n:B:null!==(o=i.getAttribute("dm-init-bg"))&&void 0!==o?o:"white";r.startsWith("linear-gradent")?i.style.backgroundImage=r:i.style.background=r;const a=t?i.getAttribute("dm-adjust-fg"):i.getAttribute("dm-init-fg"),l=e?i:i.querySelector("span.msg-text");null!==a&&null!==l&&(l.style.color=a)}}C.setColorSpace(2);const F=C.darkModeBg.lightness,_=C.darkModeFg.lightness;class N{constructor(e){this.background=e.bg,this.foreground=e.fg,this.calc()}calc(){var e;const t=L.parse(this.background),i=C.get(null!==(e=this.foreground)&&void 0!==e?e:C.darkModeFg).setAlpha(1);if(this.fgDark=i.setLightness(_).setAlpha(1).toRgbString(),void 0!==t)t.stops.forEach((e=>{e.color=e.color.onBackground(C.darkModeBg).setLightness(F)})),this.bgDark=t.toString();else{const e=C.get(this.background);if(!e.isValid||e.isWhite||e.isTransparent||e.isBlack)return void(this.bgDark=B);this.bgDark=e.setLightness(F).toRgbString()}}static parseNotice(e){return new N({fg:e.foreground,bg:e.background})}static parseMessage(e){return new N({fg:e.textColor,bg:e.backgroundColor})}}function O(e){e.style.textShadow="1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000"}function H(e,t,i){var s,n;t=(null!==(s=t)&&void 0!==s?s:"").trim(),i=(null!==(n=i)&&void 0!==n?n:"").trim();const o=e.firstElementChild;let r=o,a=e;if(o.classList.contains("roomNotice")){if(a=o,!function(e){return!!e.innerText&&e.innerText.startsWith("Notice:")}(r))return}else r=e.querySelector(".msg-text");const l=C.get(t);if(l.rgbRange<10?r.style.color="#D3D3D3":r.style.color=l.setLightness(_).setAlpha(1).toRgbString(),i.length>0){const e=L.parse(i);if(void 0!==e)e.stops.forEach((e=>{const t=e.color.getAlpha();e.color.rgbRange<10?e.color=C.transparent:e.color=e.color.setLightness(F).setAlpha(t)})),a.style.background=e.toString();else{let e=C.get(i);if(e.rgbRange<10)a.style.removeProperty("background"),O(r);else{const t=e.getAlpha();e=e.setLightness(F).setAlpha(t),a.style.background=e.toRgbString(),t<1&&O(r)}}}else O(r)}},1131:(e,t,i)=>{"use strict";i.d(t,{Z:()=>Z});var s=i(7063),n=i(2758),o=i(3417),r=i(1474),a=i(3956),l=i(9461),h=i(7254),d=i(5914),c=i(897),u=i(213),p=i(5216),m=i(6844),g=i(2939),v=i(1519),f=i(8423),y=i(6440),b=i(1284),w=i(7407),C=i(1282),S=i(34),x=i(1452),T=i(5424),A=i(4947),P=i(2945),k=i(4110),M=i(8863),R=i(7209),I=i(2042),E=i(2823);class L extends E.K{constructor(){super({})}getKey(){return`${this.getId()}`}initData(e){}}class D extends L{getId(){return"GlobalPushServiceBackendChangeTopic"}parseData(e){var t,i;return{...super.parseData(e),backends:null!==(t=null===(i=e.getList("backends"))||void 0===i?void 0:i.map((e=>e.getString("backend"))))&&void 0!==t?t:[]}}}var B=i(8650),U=i(8300),F=i(7477),_=i(819),N=i(1021),O=i(7437),H=i(9332);class W{constructor(e){this.chatConn=e,this.topics=new Map,this.historyLimit=10,this.finished=!1,this.initial=!0,this.listeners=new f.gt,this.historyCallback=[],this.handledMessages=[]}setupHistory(){if(!d.U.isEnabledForVerify())return;this.tipHistory(),this.purchaseHistory(),this.messageHistory(),this.shortcodeHistory();const e=d.U.primaryClientFailure.listen((e=>{this.informHistoryFailure(e)}),!1);this.listeners.add(e),this.fetchHistoryIfReady()}dispose(){this.listeners.removeAll()}push(e){this.historyCallback.length>this.historyLimit&&this.historyCallback.pop(),this.historyCallback.push(e)}fireBuffer(){this.historyCallback.forEach((e=>{d.U.isEnabledForUI()&&e()})),this.historyCallback=[]}fetchHistory(){const e={};return Array.from(this.topics.entries()).forEach((t=>{let[i,s]=t;e[i]=s.authData})),(0,p.KF)("push_service/room_history/",{topics:JSON.stringify(e)}).then((e=>{const t=JSON.parse(e.responseText);let i=0;t.forEach((e=>{for(const[t,n]of Object.entries(e)){const e=this.topics.get(t);if(void 0===e||i>=this.historyLimit)return;(0,E.v)(n);const o=new s.N6(n),r=this.addHistoryMessage(e.topicKey,o.getString("tid"));if(d.U.addExternalMessage(e.topicKey,o.getString("tid"))||r)return;i+=1,e.callback(o)}}))})).catch(x.yZ)}tipHistory(){const{roomUid:e,viewerUid:t,privateShowId:i}=l.Aw.getState(),s=e=>t=>{const i=e.parseData(t);i.toUsername===this.chatConn.room()&&(0,O.YY)(this.chatConn,i,!0)},n=[];t===e?n.push(new c.aT(t)):n.push(new F.uB(e)),""!==i&&n.push(new U.hw(e,i)),n.forEach((e=>{this.topics.set(e.getAuthKey(),{callback:s(e),authData:e.getAuthData(),topicKey:e.getKey()});const t=e.onSubscribeChange.listen((t=>{t.subscribed?this.fetchHistoryIfReady():this.informHistoryFailure(`${e.getId()} topic failed`)}));this.listeners.add(t)}))}purchaseHistory(){const e=l.Aw.getState().roomUid;[new F.KU(e),new F.H1(e)].forEach((e=>{this.topics.set(e.getAuthKey(),{callback:t=>{const i=e.parseData(t);(0,O.J1)(this.chatConn,i)},authData:e.getAuthData(),topicKey:e.getKey()});const t=e.onSubscribeChange.listen((t=>{t.subscribed?this.fetchHistoryIfReady():this.informHistoryFailure(`${e.getId()} topic failed`)}));this.listeners.add(t)}))}messageHistory(){const{roomUid:e,privateShowId:t}=l.Aw.getState();if(""===e)return;const i=""!==t?new U.fn(e,t):new F.Mt(e);this.topics.set(i.getAuthKey(),{callback:e=>{const t=i.parseData(e);(0,O.Ds)(this.chatConn,t)},authData:i.getAuthData(),topicKey:i.getKey()}),i.onSubscribeChange.listen((e=>{e.subscribed?this.fetchHistoryIfReady():this.informHistoryFailure(`${i.getId()} topic failed`)})).addTo(this.listeners)}shortcodeHistory(){const{roomUid:e}=l.Aw.getState(),t=[];""!==e&&t.push(new F.iS(e)),t.forEach((e=>{this.topics.set(e.getAuthKey(),{callback:t=>{const i=e.parseData(t);this.chatConn.event.roomShortcode.fire(i)},authData:e.getAuthData(),topicKey:e.getKey()});const t=e.onSubscribeChange.listen((t=>{t.subscribed?this.fetchHistoryIfReady():this.informHistoryFailure(`${e.getId()} topic failed`)}));this.listeners.add(t)}))}fetchHistoryIfReady(){if(!this.finished&&d.U.isEnabledForUI()){for(const e of this.topics.values())if(!d.U.isListeningFor(e.topicKey))return;this.finished=!0,this.fetchHistory().then((()=>{(0,O.rM)(this.chatConn,l.Aw.getState().roomTitle),this.initial&&(this.chatConn.changeStatus(this.chatConn.statusAfterConnected),this.initial=!1)})).catch((()=>{}))}}addHistoryMessage(e,t){const i=`${e}:${t}`;return!!this.handledMessages.includes(i)||(this.handledMessages.push(i),!1)}reset(){this.finished=!1}informHistoryFailure(e){if(!this.finished){const t=[];for(const e of this.topics.values())d.U.isListeningFor(e.topicKey)||t.push(e.topicKey);t.length>0&&(this.finished=!0,(0,w.bT)("PushServiceHistoryFailure",{reason:e,unconnectedTopics:t.toString(),unconnectedTopicsCount:t.length}),this.fetchHistory().then((()=>{})).catch((()=>{})))}}}class ${constructor(e,t){var i,s;this.dossier=e,this.chatConn=t,this.listeners={global:new f.gt,room:new f.gt,user:new f.gt,color:new f.gt,fanclub:new f.gt,privileged:new f.gt,private:new f.gt,enterLeave:new f.gt,roomUser:new f.gt},this.isInHiddenShow=!1,this.history=new W(this.chatConn),this.connectionFailedCount=0,this.lastOnlineStatus="notconnected",this.hiddenMessage="",this.receivedMessageBuffer=[],this.messageTimeouts=new Map;let n=!0;const o=(new Date).getTime();let r=0;d.U.connectionChange.listen((e=>{if(["connecting","closing","initialized"].includes(e.current))return;"connected"===e.current&&(r+=1);const t={state:e.current,previousState:e.previous,push_connection_type:d.U.getConnectionType(),wowza_state:this.chatConn.wowzaHandler.readyState(),connection_id:d.U.presenceId,first_connection:n,time_since_start:(new Date).getTime()-o,client:e.client,connectionCount:r,connectionFailedCount:this.connectionFailedCount,reason:JSON.stringify(e.reason)};if((0,w.bT)("PushServiceConnection",t),n=!1,!0===e.primary&&d.U.isEnabledForUI())switch(e.current){case"closed":case"failed":this.chatConn.event.roomNotice.fire({messages:[[(0,H.H5)("Chat disconnected")]],showInPrivateMessage:!0});break;case"suspended":case"disconnected":this.connectionFailedCount+=1,this.chatConn.event.roomNotice.fire({messages:[[(0,H.H5)("Trying to reconnect")]],showInPrivateMessage:!0});break;default:this.connectionFailedCount=0}}),!1).addTo(this.listeners.global);const a=null!==(i=this.dossier.viewerUid)&&void 0!==i?i:"",h=null!==(s=this.dossier.roomUid)&&void 0!==s?s:"";this.isBroadcaster=""!==h&&a===h;const{privateShowId:c,isModerator:u,isInFanClub:p,userColors:m}=l.Aw.getState();this.setupBackendSwapListener(),this.joinRoomPresence(h,a),this.setupVideoQualityTopic(h),this.setupVideoLatencyTopic(h),this.setupUserListeners(a),this.setupRoomListeners(h),this.setupRoomEnterLeaveListener(h,u||this.isBroadcaster),this.setupRoomUserListeners(h,a),this.setupPrivilegedListeners(h,u||this.isBroadcaster),this.setupFanClubListeners(h,p),this.setupColorGroupListeners(h,m),this.setupGameListener(h),""!==c&&this.setupPrivateRoomListeners(h,c),window.setTimeout((()=>{this.history.setupHistory()}),500),l.Aw.onUpdate.listen((e=>{const t=l.Aw.getState();t.privateShowId!==e.privateShowId&&this.setupPrivateRoomListeners(h,t.privateShowId),t.isModerator!==e.isModerator&&(this.setupPrivilegedListeners(h,t.isModerator||this.isBroadcaster),this.setupRoomEnterLeaveListener(h,t.isModerator||this.isBroadcaster)),t.isInFanClub!==e.isInFanClub&&this.setupFanClubListeners(h,t.isInFanClub),this.setupColorGroupListeners(h,t.userColors,e.userColors)}),!1).addTo(this.listeners.global)}sendMessage(e,t){const{roomUid:i,privateShowId:n,userName:o}=l.Aw.getState();if(e!==this.chatConn.room()||""===i)return Promise.reject({error:"room error",sendMessageRoom:e,handlerRoom:this.chatConn.room(),roomUid:i});if(l.Bm.current.isNoninteractiveUser)return Promise.reject({error:"internal staff",sendMessageRoom:e,handlerRoom:this.chatConn.room(),roomUid:i});const r={room:e,message:JSON.stringify({m:t})};return this.chatConn.inPrivateRoom()&&""!==n&&(r.private_show_id=n),""!==o&&(r.username=o),d.U.isEnabledForUI()&&this.chatConn.wowzaHandler.ensureConnected(),(0,p.KF)("push_service/publish_chat_message_live/",r).then((e=>{var n;let o=null!==(n=e.getResponseHeader("x-banned"))&&void 0!==n?n:e.getResponseHeader("x-denied");const a=new s.N6(e.responseText);if(null!==o)o=decodeURIComponent(o),this.shouldHandleMessage()&&this.chatConn.event.roomNotice.fire({messages:[[(0,H.H5)(o)]],showInPrivateMessage:!0});else{const t=a.getObject("message");(0,E.v)(t);const n=void 0===r.private_show_id?new F.Mt(i):new U.fn(i,r.private_show_id),o=n.parseData(new s.N6(t));if(o.isSpam="True"===e.getResponseHeader("x-spam"),d.U.isEnabledForUI()&&void 0!==o.tid&&!d.U.addExternalMessage(n.getKey(),o.tid))this.history.addHistoryMessage(n.getKey(),o.tid),(0,O.Ds)(this.chatConn,o),this.messageTimeouts.set(o.tid,window.setTimeout((()=>{var e;this.checkReceivedBuffer(null!==(e=o.tid)&&void 0!==e?e:"")||(0,w.bT)("PushServiceMessageTimeout",{topic_key:n.getKey(),topic_id:n.getId(),tid:o.tid,isSpam:o.isSpam,message:o.message})}),1e4));else if(d.U.isEnabledForUI()){var l;this.checkReceivedBuffer(null!==(l=o.tid)&&void 0!==l?l:"")}}return{m:t,f:"",c:"",tid:a.getString("tid"),sig:a.getString("sig")}}))}checkReceivedBuffer(e){const t=this.receivedMessageBuffer.indexOf(null!=e?e:"");return-1!==t&&(this.receivedMessageBuffer.splice(t,1),!0)}setupUserListeners(e){this.chatConn.viewerIsAnonymous()||""===e||(new c.Tg(e).onMessage.listen((e=>{l.Aw.setState({userColors:e})})).addTo(this.listeners.user),new c.LS(e).onMessage.listen((e=>{this.shouldHandleMessage()&&(0,O.DK)(e.message)})).addTo(this.listeners.user),this.isBroadcaster&&this.setupBroadcasterPrivateListener(e))}setupVideoQualityTopic(e){""!==e&&new F.yv(e).onMessage.listen((e=>{const t=l.Aw.getState(),{tid:i,...s}=e;var n,o;(0,I.k)(t.quality,s)||(l.Aw.setState({...t,quality:s}),null!==(n=null===(o=l.Aw.getState().quality)||void 0===o?void 0:o.stopped)&&void 0!==n&&n&&(0,N.YW)({eventName:"streamEnd"}))})).addTo(this.listeners.room)}setupVideoLatencyTopic(e){""!==e&&new F.pr(e).onMessage.listen((e=>{var t,i,s,n,o,r,a,h;const d=l.Aw.getState(),{tid:c,...u}=e;u.localTimeTranscoderInput=null!==(t=u.localTimeTranscoderInput)&&void 0!==t?t:null===(i=d.latency)||void 0===i?void 0:i.localTimeTranscoderInput,u.streamTimeTranscoderInput=null!==(s=u.streamTimeTranscoderInput)&&void 0!==s?s:null===(n=d.latency)||void 0===n?void 0:n.streamTimeTranscoderInput,u.localTimeSegmentStart=null!==(o=u.localTimeSegmentStart)&&void 0!==o?o:null===(r=d.latency)||void 0===r?void 0:r.localTimeSegmentStart,u.streamTimeSegmentStart=null!==(a=u.streamTimeSegmentStart)&&void 0!==a?a:null===(h=d.latency)||void 0===h?void 0:h.streamTimeSegmentStart,(0,I.k)(d.latency,u)||l.Aw.setState({...d,latency:u})})).addTo(this.listeners.room)}setupRoomListeners(e){""!==e&&d.U.isEnabledForVerify()&&(this.setupRoomPublicListeners(e),new F.iX(e).onMessage.listen((()=>{})).addTo(this.listeners.room),new F.ug(e).onMessage.listen((e=>{this.chatConn.username()===e.username&&l.Aw.setState({isModerator:!0}),this.shouldHandleMessage()&&(0,O.gh)(this.chatConn,e)})).addTo(this.listeners.room),new F.sL(this.dossier.roomUid).onMessage.listen((e=>{this.chatConn.username()===e.username&&l.Aw.setState({isModerator:!1}),this.shouldHandleMessage()&&(0,O.rN)(this.chatConn,e)})).addTo(this.listeners.room),new F.bq(e).onMessage.listen((e=>{const t=l.Aw.getState().roomStatus;let i=e.status;if(void 0!==e.password&&""!==e.password&&!this.isBroadcaster&&l.Aw.getState().roomPassword!==e.password)return this.cleanup(),void(this.shouldHandleMessage()&&(window.location.reload(),(0,O.GR)(this.chatConn)));if("offline"!==t&&(this.lastOnlineStatus=t),"hidden"===e.status){if(this.isBroadcaster)return void("away"===t&&((0,O.K_)(this.chatConn),l.Aw.setState({roomStatus:"public"})));this.isInHiddenShow||(this.hiddenShowStarted=new Date),this.shouldHandleMessage()&&(""!==e.message&&(this.hiddenMessage=e.message),"hiddenwatching"===this.lastOnlineStatus?((0,O.KM)(this.chatConn,this.lastOnlineStatus,this.hiddenMessage),i=this.lastOnlineStatus):(0,O.KM)(this.chatConn,e.status,this.hiddenMessage))}else if("privatenotwatching"===e.status){if(this.isBroadcaster&&"offline"!==t||["privaterequesting","privatewatching","privatenotwatching"].includes(t))return;this.shouldHandleMessage()&&("offline"===t?this.isBroadcaster?this.chatConn.changeStatus("privatewatching"):"privatespying"===this.lastOnlineStatus?(this.chatConn.changeStatus(this.lastOnlineStatus),i=this.lastOnlineStatus):(""!==l.Aw.getState().privateShowId?this.chatConn.changeStatus("privaterequesting"):this.chatConn.changeStatus("public"),(0,O.Md)(this.chatConn)):(0,O.Md)(this.chatConn))}else if("away"===e.status&&this.shouldHandleMessage())"privatewatching"===t?(l.Aw.setState({privateShowId:"",roomStatus:"away"}),(0,O.VW)(this.chatConn)):"privatenotwatching"===t||"privatespying"===t?(0,O.VW)(this.chatConn):this.chatConn.changeStatus(e.status);else if("public"===e.status&&this.shouldHandleMessage())"away"===t?(0,O.K_)(this.chatConn):"hidden"===t||"hiddenwatching"===t?(0,O.KM)(this.chatConn,e.status,e.message):this.chatConn.changeStatus(e.status);else{if("passwordprotected"===e.status)return;"offline"===e.status&&this.shouldHandleMessage()?("privaterequesting"===t&&((0,O.VW)(this.chatConn),this.chatConn.leavePrivateOrSpyShow().catch(x.yZ)),this.chatConn.changeStatus(e.status)):this.shouldHandleMessage()&&this.chatConn.changeStatus(e.status)}l.Aw.setState({roomStatus:i})})).addTo(this.listeners.room),new F.Fh(e).onMessage.listen((e=>{this.shouldHandleMessage()&&(0,O.rM)(this.chatConn,e.title)})).addTo(this.listeners.room),new F.IJ(e).onMessage.listen((e=>{this.shouldHandleMessage()&&(0,O.II)(this.chatConn,e)})).addTo(this.listeners.room),new F.HW(e).onMessage.listen((e=>{this.shouldHandleMessage()&&(e.fromUser=this.chatConn.room(),this.chatConn.username()===e.username?(0,O.hp)(this.chatConn,A.R.kickedFromRoomMessage,l.Aw.getState().exploringHashTag):(0,O.vL)(this.chatConn,e))})).addTo(this.listeners.room),new F.Q4(e).onMessage.listen((e=>{if(this.shouldHandleMessage()&&"refresh_panel"===e.target){const t=()=>{this.chatConn.event.refreshPanel.fire({appId:e.appId,appSystem:e.appSystem})};l.Bm.current.throttleTopicPublish?window.setTimeout((()=>{t()}),1e3):t()}})).addTo(this.listeners.room),new F.Io(e).onMessage.listen((e=>{l.Aw.setState({allowPrivateShow:e.allowPrivateShow,privatePrice:e.privatePrice,spyPrice:e.spyPrice,privateMinMinutes:e.privateMinMinutes,allowShowRecordings:e.allowShowRecordings,hasFanClub:e.hasFanClub,activePassword:e.activePassword}),!this.chatConn.inPrivateRoom()||this.isBroadcaster?this.shouldHandleMessage()&&(0,O.$G)(this.chatConn,e):this.chatConn.event.settingsUpdate.fire(e)})).addTo(this.listeners.room),new F.BP(e).onMessage.listen((e=>{this.chatConn.event.roomNotice.fire({messages:[[(0,H.JH)(e.purchaser),(0,H.H5)(` promoted the room for ${e.durationMins} minutes`)]],colorClass:"userPromotion",foreground:"#272F35",background:"#ECF3FD",weight:"bold",showInPrivateMessage:!1}),R.J.fire(void 0)})).addTo(this.listeners.room))}setupRoomPublicListeners(e){new F.Mt(e).onMessage.listen((e=>{if(e.fromUser.username===this.chatConn.username()&&void 0!==e.tid){if(this.messageTimeouts.has(e.tid))return window.clearTimeout(this.messageTimeouts.get(e.tid)),void this.messageTimeouts.delete(e.tid);this.receivedMessageBuffer.push(e.tid)}if(this.chatConn.inPrivateRoom())return e.ts=void 0,void this.history.push((()=>(0,O.Ds)(this.chatConn,e)));const t=`RoomMessageTopic:${l.Aw.getState().roomUid}`;void 0!==e.tid&&this.history.addHistoryMessage(t,e.tid),this.shouldHandleMessage()&&(0,O.Ds)(this.chatConn,e)})).addTo(this.listeners.room),new F.H1(e).onMessage.listen((e=>{const t=l.Aw.getState();if(e.fromUser.username===t.userName&&l.Aw.setState({isInFanClub:!0}),this.chatConn.inPrivateRoom())return e.ts=void 0,void this.history.push((()=>(0,O.J1)(this.chatConn,e)));this.shouldHandleMessage()&&(0,O.J1)(this.chatConn,e)})).addTo(this.listeners.room),new F.KU(e).onMessage.listen((e=>{if(this.chatConn.inPrivateRoom())return e.ts=void 0,void this.history.push((()=>(0,O.J1)(this.chatConn,e)));this.shouldHandleMessage()&&(0,O.J1)(this.chatConn,e)})).addTo(this.listeners.room),new F.Tp(e).onMessage.listen((e=>{this.chatConn.inPrivateRoom()?e.ts=void 0:this.shouldHandleMessage()&&this.chatConn.event.roomNotice.fire(e)})).addTo(this.listeners.room),new F.uB(e).onMessage.listen((e=>{if(!this.isBroadcaster){if(this.chatConn.inPrivateRoom())return e.ts=void 0,void this.history.push((()=>(0,O.YY)(this.chatConn,e,!0)));this.shouldHandleMessage()&&(0,O.YY)(this.chatConn,e)}})).addTo(this.listeners.room),new F.iS(e).onMessage.listen((e=>{if(this.chatConn.inPrivateRoom())return e.ts=void 0,void this.history.push((()=>this.chatConn.event.roomShortcode.fire(e)));this.chatConn.event.roomShortcode.fire(e)})).addTo(this.listeners.room)}setupBroadcasterPrivateListener(e){""!==e&&this.isBroadcaster&&new c.mt(e).onMessage.listen((e=>{this.privateStatusHandler(e)})).addTo(this.listeners.user)}privateStatusHandler(e){let t;switch(e.status){case"started":if("privatenotwatching".includes(this.chatConn.status))break;["privatewatching","privaterequesting"].includes(this.chatConn.status)?l.Aw.setState({privateShowId:e.privateShowId,roomStatus:"privatewatching"}):l.Aw.setState({roomStatus:"privatenotwatching"}),this.isBroadcaster&&(0,w.bT)("BroadcasterPrivateStarted"),t=O.Md;break;case"declined":l.Aw.setState({roomStatus:"public"}),t=O.VW;break;case"stopped":if(this.isBroadcaster&&["away","privatewatching"].includes(this.chatConn.status)){let t=A.R.privateShowFinishedMessage;var i;void 0!==e.earlyCancelTokens&&e.earlyCancelTokens>0&&(t+=A.R.privateShowEarlyCancelMessage(null!==(i=e.requester)&&void 0!==i?i:this.chatConn.getPrivateShowUser(),e.earlyCancelTokens)),this.chatConn.event.roomNotice.fire({messages:[[(0,H.H5)(t)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0,toUser:e.requester}),(0,w.bT)("BroadcasterPrivateEnded",{reason:e.reason})}l.Aw.setState({roomStatus:"away",privateShowId:""}),t=O.VW;break;case"error":l.Aw.setState({roomStatus:"public",privateShowId:""}),t=O.VW;break;case"spy_leave":l.Aw.setState({roomStatus:"public",privateShowId:""}),t=e=>{e.changeStatus("privatenotwatching")};break;default:this.isBroadcaster||warn("Invalid private show status on viewer",e,"PUSH_")}this.shouldHandleMessage()&&void 0!==t&&t(this.chatConn)}setupRoomUserListeners(e,t){this.chatConn.viewerIsAnonymous()||""===e||""===t||(new F.EJ(e,t).onMessage.listen((e=>{this.chatConn.inPrivateRoom()||this.shouldHandleMessage()&&this.chatConn.event.roomNotice.fire(e)})).addTo(this.listeners.roomUser),new F.n1(e,t).onMessage.listen((e=>{this.isBroadcaster||this.privateStatusHandler(e)})).addTo(this.listeners.roomUser),new F.rr(e,t).onMessage.listen((e=>{if("approved"===e.status){this.isInHiddenShow=!0;const e=void 0===this.hiddenShowStarted||(new Date).getTime()-this.hiddenShowStarted.getTime()<2e3;this.shouldHandleMessage()&&(0,O.Ge)(this.chatConn,e),window.setTimeout((()=>{l.Aw.setState({roomStatus:"hiddenwatching"})}),e?2e3:0)}else"denied"===e.status&&(this.isInHiddenShow=!1,l.Aw.setState({roomStatus:"hidden"}),this.shouldHandleMessage()&&this.chatConn.changeStatus("hidden"))})).addTo(this.listeners.roomUser))}setupPrivateRoomListeners(e,t){var i;if(""!==e){var s,n,o;if(""===t)return this.listeners.private.removeAll(),null===(s=this.privatePresence)||void 0===s||s.leavePresence(),this.joinRoomPresence(e,null!==(n=this.dossier.viewerUid)&&void 0!==n?n:""),this.setupRoomUserListeners(e,null!==(o=this.dossier.viewerUid)&&void 0!==o?o:""),void this.history.fireBuffer();this.listeners.roomUser.removeAll(),null===(i=this.roomPresence)||void 0===i||i.leavePresence(),this.privatePresence=new U.QD(e,t),this.privatePresence.enterPresence(),new U.fn(e,t).onMessage.listen((e=>{if(e.fromUser.username===this.chatConn.username()&&void 0!==e.tid){if(this.messageTimeouts.has(e.tid))return window.clearTimeout(this.messageTimeouts.get(e.tid)),void this.messageTimeouts.delete(e.tid);this.receivedMessageBuffer.push(e.tid)}this.shouldHandleMessage()&&(0,O.Ds)(this.chatConn,{...e,isPrivateShowMessage:!0})})).addTo(this.listeners.private),new U.ZW(e,t).onMessage.listen((e=>{this.shouldHandleMessage()&&(0,O.PJ)(this.chatConn,e),d.U.isEnabledForUserList()&&this.chatConn.event.roomCountUpdate.fire(e.viewers),d.U.setVerifierRoomCount(e.viewers)})).addTo(this.listeners.private),new U.hw(e,t).onMessage.listen((e=>{!this.isBroadcaster&&this.shouldHandleMessage()&&(0,O.YY)(this.chatConn,e)})).addTo(this.listeners.private)}}setupPrivilegedListeners(e,t){""!==e&&(t?(new F.t1(e).onMessage.listen((()=>{})).addTo(this.listeners.privileged),new F.eB(e).onMessage.listen((e=>{this.chatConn.inPrivateRoom()||(this.shouldHandleMessage()&&(0,O.PJ)(this.chatConn,e),d.U.isEnabledForUserList()&&this.chatConn.event.roomCountUpdate.fire(e.viewers),d.U.setVerifierRoomCount(e.viewers))})).addTo(this.listeners.privileged),new F.fH(e).onMessage.listen((e=>{this.chatConn.inPrivateRoom()||(this.shouldHandleMessage()&&(0,O.PJ)(this.chatConn,e),d.U.isEnabledForUserList()&&this.chatConn.event.roomCountUpdate.fire(e.viewers),d.U.setVerifierRoomCount(e.viewers))})).addTo(this.listeners.privileged),new B.UT(e).onMessage.listen((e=>{!this.isBroadcaster&&this.shouldHandleMessage()&&this.chatConn.event.roomNotice.fire(e)})).addTo(this.listeners.privileged),this.isBroadcaster&&(new F.WQ(e).onMessage.listen((e=>{this.shouldHandleMessage()&&(0,O.lg)(this.chatConn,e)})).addTo(this.listeners.privileged),new c.O$(e).onMessage.listen((e=>{this.shouldHandleMessage()&&"app_tab_refresh"===e.target&&this.chatConn.event.appTabRefresh.fire(void 0)})).addTo(this.listeners.privileged),new c.aT(e).onMessage.listen((e=>{if(e.toUsername===this.chatConn.username())return this.chatConn.inPrivateRoom()&&"public"===e.roomType?(e.ts=void 0,void this.history.push((()=>(0,O.YY)(this.chatConn,e,!0)))):void(this.shouldHandleMessage()&&(0,O.YY)(this.chatConn,e))})).addTo(this.listeners.privileged),new c.mt(e).onMessage.listen((e=>{if("requested"===e.status&&(l.Aw.setState({roomStatus:"privaterequesting"}),this.shouldHandleMessage())){var t;const i={userRequesting:null!==(t=e.requester)&&void 0!==t?t:this.chatConn.getPrivateShowUser(),tokensPerMinute:l.Aw.getState().privatePrice};(0,O._y)(this.chatConn,i)}})),new c.O_(e).onMessage.listen((e=>{(0,y.f)("BroadcasterWarningModal")&&(0,_.nQ)(e)})).addTo(this.listeners.privileged))):this.listeners.privileged.removeAll())}setupFanClubListeners(e,t){""!==e&&(t?new B.qN(e).onMessage.listen((e=>{this.shouldHandleMessage()&&this.chatConn.event.roomNotice.fire(e)})).addTo(this.listeners.fanclub):this.listeners.fanclub.removeAll())}setupColorGroupListeners(e,t,i){if(""===e||void 0===t)return;const s=e=>{this.chatConn.inPrivateRoom()||this.shouldHandleMessage()&&this.chatConn.event.roomNotice.fire(e)};!t.hasTokens||void 0!==i&&i.hasTokens||new B.TP(e).onMessage.listen(s).addTo(this.listeners.color),!t.tippedRecently||void 0!==i&&i.tippedRecently||new B.JS(e).onMessage.listen(s).addTo(this.listeners.color),!t.tippedAlotRecently||void 0!==i&&i.tippedAlotRecently||new B.bu(e).onMessage.listen(s).addTo(this.listeners.color),!t.tippedTonsRecently||void 0!==i&&i.tippedTonsRecently||new B.ZT(e).onMessage.listen(s).addTo(this.listeners.color)}setupGameListener(e){""!==e&&new F.dq(e).onMessage.listen((e=>{M.F.selectionChange.fire(e.game)})).addTo(this.listeners.room)}setupRoomEnterLeaveListener(e,t){this.listeners.enterLeave.removeAll(),new F.C9(e).onMessage.listen((e=>{if(!t){if(this.chatConn.inPrivateRoom())return;this.shouldHandleMessage()&&(0,O.PJ)(this.chatConn,e),d.U.isEnabledForUserList()&&this.chatConn.event.roomCountUpdate.fire(e.viewers),d.U.setVerifierRoomCount(e.viewers)}})).addTo(this.listeners.enterLeave)}joinRoomPresence(e,t){""!==e&&(this.chatConn.viewerIsAnonymous()?new F.Uv(e).onSubscribeChange.listen((()=>{})).addTo(this.listeners.room):""!==t&&(void 0===this.roomPresence&&(this.roomPresence=new F.vE(e,t)),this.roomPresence.enterPresence()))}shouldHandleMessage(){return d.U.isEnabledForUI()}setupBackendSwapListener(){(new D).onMessage.listen((e=>{d.U.changeChatHandler(e.backends),this.chatConn.wowzaHandler.ensureConnected()})).addTo(this.listeners.global)}cleanup(){var e,t;null===(e=this.roomPresence)||void 0===e||e.leavePresence(),null===(t=this.privatePresence)||void 0===t||t.leavePresence(),Object.values(this.listeners).forEach((e=>e.removeAll())),this.history.dispose(),this.messageTimeouts.forEach((e=>window.clearTimeout(e))),this.messageTimeouts.clear(),this.receivedMessageBuffer=[]}}var V,z=i(7623),G=i(6784);class q{constructor(){this.failures=0}millisecondsForRetry(){return this.failures+=1,Math.min(1e4,1e3*this.failures)}reset(){this.failures=0}}i(438);class j{constructor(e,t){this.roomDossier=e,this.chatConn=t,this._websocket=void 0,this.reconnectLimiter=new q,this.remakeWebsocket(),(0,z.OF)()&&(this.handlePagehide=()=>{this.disconnect()},(0,G.wu)("pagehide",window,this.handlePagehide))}remakeWebsocket(){}readyState(){if(void 0===this._websocket)return"websocket undefined";switch(this._websocket.readyState){case WebSocket.CLOSED:return"closed";case WebSocket.OPEN:return"open";case WebSocket.CLOSING:return"closing";case WebSocket.CONNECTING:return"connecting";default:return"unknown"}}ensureConnected(){var e;void 0!==this._websocket&&this.websocket().readyState===WebSocket.CONNECTING||this.isWebsocketReady()||(debug("restoring websocket"),null===(e=this._websocket)||void 0===e||e.close(),this.remakeWebsocket())}websocket(){return this._websocket}isWebsocketReady(){return void 0!==this._websocket&&this._websocket.readyState===WebSocket.OPEN}setConnectedAndAuthed(){this.reconnectLimiter.reset(),function(e){if(-1!==["onAuthResponse","onPrivateMsg"].indexOf(e.method))return!0;if("onNotify"===e.method&&"push_backends"===new s.N6(e.args[0]).getString("type"))return!0;return!d.U.isEnabledForUI()}({method:"onTitleChange",callback:0,args:[]})&&(0,O.rM)(this.chatConn,this.roomDossier.roomTitle)}disconnect(){void 0!==this._websocket&&(this._websocket.onclose=()=>{},this._websocket.onerror=()=>{},this._websocket.close(),this._websocket=void 0),void 0!==this.handlePagehide&&(0,G.Pf)("pagehide",window,this.handlePagehide)}sendRawMessage(e){debug(["sending ",e]),this.websocket().send(e)}sendMessage(e){}retryMessage(e,t,i){this.isWebsocketReady()?this.sendRawMessage(JSON.stringify({method:e,data:t})):i<5?window.setTimeout((()=>{this.retryMessage(e,t,i+1)}),1e3):(0,w.bT)("WowzaMsgRetryFailed",{method:e,push_active:d.U.isEnabledForUI()})}}class Z{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.d=e,this.previousStatus="offline",this.status="offline",this.isModerator=!1,this.appDebuggingEnabled=!1,this.privateMinEnd=0,this.privateShowRequestingUser="",this.isBroadcasting=!1,this.isNewConnection=!1,this.exploringHashTag="",this.sourceName="un",this.roomCountPresenceThrottle=new v.a((()=>{this.roomCountPresence().catch(x.yZ)}),{debounceType:2,bounceLimitMS:9e4}),this.event={messageSent:new f.c_("messageSent"),roomMessage:new f.c_("roomMessage"),roomNotice:new f.c_("roomNotice"),roomShortcode:new f.c_("roomShortcode"),statusChange:new f.c_("statusChange",{listenersWarningThreshold:15}),hiddenMessageChange:new f.c_("hiddenMessageChange"),refreshPanel:new f.c_("refreshPanel"),titleChange:new f.c_("titleChange"),clearApp:new f.c_("clearApp"),removeMessages:new f.c_("removeMessages"),settingsUpdate:new f.c_("settingsUpdate"),roomCountUpdate:new f.c_("roomCountUpdate"),modStatusChange:new f.c_("modStatusChange"),tokenBalanceUpdate:r.D,privateShowRequest:new f.c_("privateShowRequest"),playSound:new f.c_("playSound"),appTabRefresh:new f.c_("appTabRefresh"),appDebugLog:new f.c_("appDebugLog"),tipAlert:new f.c_("tipAlert"),leftRoom:new f.c_("leftRoom"),connectionLost:new f.c_("connectionLost"),onBanSilence:new f.c_("onBanSilence")},this.isNewConnection=!1,this.isBroadcasting=this.username()===this.room(),this.viewerIsAnonymous()||(0,o.vu)(),this.isModerator=e.isModerator,this.roomEntryFor=e.userChatSettings.roomEntryFor,this.roomLeaveFor=e.userChatSettings.roomLeaveFor,this.isBroadcasting?this.statusAfterConnected="public":this.statusAfterConnected=e.roomStatus,this.privatePrice=e.privatePrice,this.spyPrice=e.spyPrice,this.exploringHashTag=this.d.exploringHashTag,this.sourceName=this.d.sourceName,this.wowzaHandler=new j(this.d,this),t&&(this.pushServiceHandler=new $(this.d,this)),this.loadLastPrivateInfo(),this.changeStatus("notconnected"),this.listenForIgnores()}appsRunning(){return this.d.appsRunning}disconnect(){var e;this.wowzaHandler.disconnect(),null===(e=this.pushServiceHandler)||void 0===e||e.cleanup()}changeStatus(e){e!==this.status&&(debug(`Status changing from ${this.status} to ${e}`),this.previousStatus=this.status,this.status=e,this.isBroadcasting&&"notconnected"===this.previousStatus&&"public"===this.status&&(0,S.BO)(),this.event.statusChange.fire({previousStatus:this.previousStatus,currentStatus:this.status}))}updateEnterLeaveSettings(e,t){this.roomEntryFor=e,this.roomLeaveFor=t}viewerIsAnonymous(){return"AnonymousUser"===this.username()}isAppDebuggingEnabled(){return this.appDebuggingEnabled}toggleAppDebugging(){this.appDebuggingEnabled=!this.appDebuggingEnabled,k.q_.fire(this.appDebuggingEnabled)}viewerInPrivateChat(){switch(this.status){case"privatewatching":return!0;case"privaterequesting":case"privatenotwatching":case"passwordprotected":case"public":case"away":case"hidden":case"hiddenwatching":case"offline":case"privatespying":case"notconnected":return!1;default:return warn(`unexpected status: ${this.status}`),!1}}sendShortcode(e){if(e.shortcodes.map((e=>e.code.toLowerCase())).includes(h.AJ.Help))return void this.event.roomNotice.fire({messages:[[(0,H.H5)((0,h.CM)(this.room(),this.isBroadcasting))]],showInPrivateMessage:!0});if(l.Bm.current.isNoninteractiveUser)return void(0,u.Q$)(A.R.internalStaffMessage);const t=e.shortcodes.map((e=>{const t={code:e.code};return void 0!==e.msg&&(t.msg=e.msg),void 0!==e.amt&&(t.amt=e.amt),t})),i={room:this.room(),shortcodes:JSON.stringify(t),message:JSON.stringify({m:e.message})};(0,p.KF)("push_service/publish_chat_message_live/",i).then((e=>{var t;let i=null!==(t=e.getResponseHeader("x-banned"))&&void 0!==t?t:e.getResponseHeader("x-denied");null!==i&&(i=decodeURIComponent(i),d.U.isEnabledForUI()&&this.event.roomNotice.fire({messages:[[(0,H.H5)(i)]],showInPrivateMessage:!0}))})).catch((e=>{this.event.roomNotice.fire({messages:[[(0,H.H5)(A.R.shortcodeGeneralError)]],showInPrivateMessage:!0})}))}sendRoomMessage(e){if(l.Bm.current.isNoninteractiveUser)return void(0,u.Q$)(A.R.internalStaffMessage);this.event.messageSent.fire(void 0),(0,w.bT)("SendRoomMessage");const t=e=>{this.wowzaHandler.sendMessage(this.viewerInPrivateChat()?"messagePrivateRoom":"messageRoom",{room:this.d.room,msg:JSON.stringify({m:e,f:"",c:"",tid:""})})};if(void 0===this.pushServiceHandler)return warn("push service send handler not active",{},"PUSH_"),void t(e);const i=this.viewerInPrivateChat();this.pushServiceHandler.sendMessage(this.d.room,e).then((e=>{this.wowzaHandler.sendMessage(i?"messagePrivateRoom":"messageRoom",{room:this.d.room,msg:JSON.stringify(e)})})).catch((i=>{error("Publishing live message",i,"PUSH_"),t(e)}))}updateRoomCount(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];d.U.isEnabledForUserList()||this.wowzaHandler.sendMessage("updateRoomCount",{room_uid:this.d.roomUid,model_name:this.room(),private_room:this.inPrivateRoom()}),e?this.roomCountPresence():this.roomCountPresenceThrottle.callFunc()}roomCountPresence(){if(l.Bm.current.isNoninteractiveUser)return Promise.resolve();const e=l.Aw.getState().privateShowId,t={presence_id:d.U.presenceId};""!==e&&this.inPrivateRoom()&&(t.private_show_id=e);const i=`push_service/room_user_count/${this.room()}/?${(0,P.Go)(t)}`;return(0,p.Aw)(i).then((e=>{if(d.U.isEnabledForUserList()){const t=new s.N6(e.responseText).getNumber("count");this.event.roomCountUpdate.fire(t),d.U.setVerifierRoomCount(t)}})).catch(x.yZ)}kickUser(e){this.wowzaHandler.sendMessage("kickUser",{user:e,room:this.room()})}requestPrivateShow(e,t,i){return new Promise(((n,o)=>{"public"===this.status?(this.wowzaHandler.ensureConnected(),(0,p.KF)(`tipping/private_show_request/${this.room()}/`,{chat_username:this.username(),price:`${e}`,private_show_minimum_minutes:`${t}`,recordings_allowed:`${i}`}).then((e=>{const t=new s.N6(e.responseText),i=t.getBoolean("success");let r=t.getString("message",!1);if(!i)return""===r&&(error("unknown cannot start private show reason"),r="Cannot start private show."),void o(r);t.logUnusedDebugging("privateShowRequest"),this.changeStatus("privaterequesting"),l.Aw.setState({roomStatus:"privaterequesting"}),this.event.roomNotice.fire({messages:[[(0,H.H5)(A.R.privateShowRequestMessage)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0}),n()})).catch((e=>{o(e)}))):o(`unexpected status: ${this.status}`)}))}requestSpyShow(){return new Promise(((e,t)=>{"privatenotwatching"===this.status?(this.wowzaHandler.ensureConnected(),(0,p.KF)(`tipping/spy_on_private_show_request/${this.room()}/`,{chat_username:this.username()}).then((i=>{const n=new s.N6(i.responseText),o=n.getBoolean("success");let r=n.getString("message",!1);if(n.logUnusedDebugging("parseRequestResult"),!o)return""===r&&(r="Error joining spy show"),void t(r);this.changeStatus("privatespying"),l.Aw.setState({roomStatus:"privatespying"}),this.event.roomNotice.fire({messages:[[(0,H.H5)("You are spying on the private show")]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0}),e()})).catch((e=>{t(e)}))):t(`unexpected status: ${this.status}`)}))}setPrivateShowInfo(e,t){this.privatePrice=e,this.privateMinEnd=Date.now()+60*t*1e3,(0,C.C6)(this.room(),e,this.privateMinEnd)}leavePrivateOrSpyShow(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(((t,i)=>{const n=`tipping/private_show_cancel/${this.room()}/`;let o={};(0,y.f)("PushEnblErlyCncl")&&e&&(o={understands_minimum_charge:!0});const r=this.status;(0,p.KF)(n,o).then((e=>{const n=new s.N6(e.responseText),o=n.getBoolean("success"),a=n.getNumber("remaining_seconds"),h=n.getStringWithNumbers("private_show_minimum_minutes"),d=n.getBoolean("can_access"),c=Math.ceil(this.privatePrice*((this.privateMinEnd-Date.now())/6e4));switch(n.logUnusedDebugging("parseCancelResult"),r){case"privatewatching":if(!o){if(0===a)i({allowCancel:!1,message:A.R.privateShowRequestCancelErrorMessage});else{const e=Math.floor(a/60),t=a%60;(0,y.f)("PushEnblErlyCncl")?i({allowCancel:!0,message:"privateCancelEarly",earlyDetails:{minimumMinutes:h,tokensPerMinute:this.privatePrice,secondsRemaining:a,tokensRemaining:c}}):i({allowCancel:!1,message:A.R.cannotCancelPrivate(h,e,t)})}return}break;case"privatespying":if(!o)return void i({allowCancel:!1,message:A.R.unableToCancelSpyShow});this.changeStatus("privatenotwatching"),l.Aw.setState({roomStatus:"privatenotwatching"});break;case"privaterequesting":if(!o)return void i({allowCancel:!1,message:A.R.unableToCancelPrivateRequest});break;default:if(warn(`unable to leave private show from status: ${r}`),!o)return void i({allowCancel:!1,message:A.R.unableToLeavePrivateShow(r)})}o&&!d&&window.location.reload(),t()})).catch(i)}))}joinRoom(){this.wowzaHandler.sendMessage("joinRoom",{room:this.room(),exploringHashTag:this.exploringHashTag,source_name:this.sourceName}),this.exploringHashTag="",this.sourceName="df"}leaveRoom(){this.wowzaHandler.sendMessage("leaveRoom",{room:this.room()})}joinPrivateRoom(){window.setTimeout((()=>{this.wowzaHandler.sendMessage("joinPrivateRoom",{room:this.room()})}),500)}leavePrivateRoom(){this.wowzaHandler.sendMessage("leavePrivateRoom",{room:this.room()})}inPrivateRoom(){return"privatewatching"===this.status}inPrivateOrSpy(){return["privatewatching","privatespying"].includes(this.status)}setPrivateShowRequestingUser(e){this.privateShowRequestingUser=e}getPrivateShowUser(){return this.inPrivateRoom()?this.privateShowRequestingUser:""}room(){return this.d.room}age(){return this.d.age}username(){return this.d.userName}ignore(e){if((0,m.ok)())return this.event.roomNotice.fire({messages:[[(0,H.H5)(A.R.loginToUseFeature)]],showInPrivateMessage:!0}),new Promise((()=>!1));if(this.d.room===this.username())return error("Error: cannot ignore users in this room"),new Promise((()=>!1));const t=`${this.username()}-hitMaxIgnore`,i=(0,o.V6)().size>=o.zS;return new Promise((s=>{const r=()=>{i&&(0,n.aR)(t,"1",{days:30});const r=(0,o.V6)();(0,o.Bq)(e).then((t=>{if(t){const e=(0,o.V6)();for(const t of r)e.has(t)||this.event.roomNotice.fire({messages:[[(0,H.H5)(A.R.removedOldestIgnore(t))]],showInPrivateMessage:!0})}else this.event.roomNotice.fire({messages:[[(0,H.H5)(A.R.errorIgnoringUser(e))]],showInPrivateMessage:!0});s(t)})).catch(x.yZ)};void 0===(0,n.y1)(t)&&i?(0,u.mf)(A.R.reachedMaxIgnore,r):r()}))}unignore(e){return(0,o.Kw)(e).then((t=>(t||this.event.roomNotice.fire({messages:[[(0,H.H5)(A.R.errorUnignoringUser(e))]],showInPrivateMessage:!0}),t)))}isIgnored(e){return(0,o.pi)(e)}listenForIgnores(){var e;const t=null===(e=l.Bm.current.loggedInUser)||void 0===e?void 0:e.userUid;if(void 0!==t){const e=new c.T_(t).onMessage.listen((e=>{if(e.isIgnored){const t=A.R.ignoringUser(e.username);this.event.roomNotice.fire({messages:[[(0,H.H5)(t)]],showInPrivateMessage:!0})}else{const t=A.R.noLongerIgnoring(e.username);this.event.roomNotice.fire({messages:[[(0,H.H5)(t)]],showInPrivateMessage:!0})}}));g.Gr.once((()=>e.removeListener()),!1)}}static updateUserInfoFromHashtag(e){switch(e.exploringHashTag){case"promotion":e.exploringHashTag="",e.sourceName="pr";break;case"onlineannouncement":e.exploringHashTag="",e.sourceName="fn"}}roomEntry(e){if(Z.updateUserInfoFromHashtag(e),this.shouldShowJoinLeaveMessage(this.roomEntryFor,e)){const t=this.isBroadcasting?e.exploringHashTag:"",i=[(0,H.H5)((0,b.W2)(this.room(),e)),(0,H.JH)(e),(0,H.H5)(` ${A.R.roomJoinedMessage}`)];""!==t?(i.push((0,H.H5)(" (from ")),i.push((0,H.yP)(t,[t])),i.push((0,H.H5)(")"))):this.isBroadcasting&&"pr"===e.sourceName?i.push((0,H.H5)(" via promotion")):this.isBroadcasting&&"fn"===e.sourceName&&i.push((0,H.H5)(" via online announcement")),i.push((0,H.H5)(".")),this.event.roomNotice.fire({messages:[i],showInPrivateMessage:e.username===this.username(),dataNick:e.username})}}roomLeave(e){if(this.shouldShowJoinLeaveMessage(this.roomLeaveFor,e)){let t=` ${A.R.roomLeftMessage}`;e.isBroadcaster&&!Z.noFollowMessageInStatus.has(this.status)&&(t+=` ${A.R.roomFollowToGetNotified}`),this.event.roomNotice.fire({messages:[[(0,H.H5)((0,b.W2)(this.room(),e)),(0,H.JH)(e),(0,H.H5)(t)]],showInPrivateMessage:e.username===this.username(),dataNick:e.username})}}shouldShowJoinLeaveMessage(e,t){if(t.username===this.username())return!1;if(t.username===(0,a.fL)())return!0;if(this.inPrivateRoom())return!1;if((0,o.pi)(t.username))return!1;switch(e){case T.XL.None:return!1;case T.XL.ModsAndFans:if(t.username===this.room()||t.isMod||t.inFanclub)return!0;break;case T.XL.ModsFansAndTokens:if(t.username===this.room()||t.isMod||t.inFanclub||t.hasTokens&&(this.isBroadcasting||this.isModerator))return!0;break;case T.XL.AllUsers:if(t.username===this.room()||t.isMod||t.inFanclub||this.isBroadcasting||this.isModerator)return!0;break;default:return error("Invalid EnterLeaveSetting"),!1}return!1}loadLastPrivateInfo(){const e=(0,C.nQ)(this.room());if(""!==e){const t=new s.N6(e);this.privatePrice=t.getNumber("price"),this.privateMinEnd=t.getNumber("end")}}}(V=Z).privateViewStatuses=["privatewatching","privatenotwatching","privatespying"],V.noFollowMessageInStatus=new Set(V.privateViewStatuses)},438:(e,t,i)=>{"use strict";i.d(t,{CA:()=>h,IT:()=>m,Lf:()=>f,N4:()=>p,Rh:()=>a,U3:()=>y,Y6:()=>c,YE:()=>d,by:()=>l,ew:()=>u,rI:()=>g,tV:()=>v}),i(7063);var s=i(9461),n=i(7321),o=i(6440),r=i(9332);function a(e){return{...l(e),gender:e.getStringOrUndefined("gender",!1)}}function l(e){const t=e.getStrings(["from_username","user","username"]);1!==t.size&&error('getStrings(["from_username", "user", "username"]): length is not 1',{data:t,message:e.stringMessage});const i=t.values().next().value;return{username:i,isBroadcaster:i===s.Aw.getState().room,inFanclub:e.getBoolean("in_fanclub"),isFollowing:e.getBooleanOrUndefined("is_following"),hasTokens:e.getBoolean("has_tokens"),isMod:e.getBoolean("is_mod"),tippedRecently:e.getBoolean("tipped_recently"),tippedALotRecently:e.getBoolean("tipped_alot_recently"),tippedTonsRecently:e.getBoolean("tipped_tons_recently"),exploringHashTag:e.getString("exploringHashTag",!1),sourceName:(0,n.Ys)(e.getString("source_name",!1)),gender:e.getStringOrUndefined("gender")}}function h(e,t){!0!==t.getAny("X-Successful")&&error("X-Successful not true?");const i={fromUser:a(t),message:t.getString("m"),font:t.getStringOrUndefined("f",!1),textColor:t.getStringOrUndefined("c",!1),messageID:t.getString("i",!1),backgroundColor:t.getStringOrUndefined("background",!1),tid:t.getString("tid",!1)};return i.fromUser.username!==e&&error("Parsing username match failed"),i}function d(e){return{fromUser:a(e.getParsedSubMap("from_user")),message:e.getString("message"),font:e.getStringOrUndefined("font_family",!1),textColor:e.getStringOrUndefined("font_color",!1),messageID:e.getString("id",!1),backgroundColor:e.getStringOrUndefined("background",!1),tid:e.getString("tid",!1)}}function c(e){return{fromUser:a(e.getParsedSubMap("from_user")),message:e.getString("m"),textColor:e.getStringOrUndefined("c",!1),messageID:e.getString("i",!1),otherUsername:e.getString("other_user"),font:e.getString("f"),mediaList:u(e.getObjectOrUndefined("media")),tid:e.getString("tid",!1),createdAt:new Date(1e3*e.getNumber("created_at")),isPrivate:!0}}function u(e){const t=[];if(void 0===e)return t;for(const i of e)t.push({mediaId:i.media_id,thumbnailUrl:i.media_thumbnail_url,url:i.media_url,opened:i.opened,fromUserUID:i.user_uid});return t}function p(e){return{fromUser:a(e),message:e.getString("message"),amount:e.getNumber("amount"),isAnonymousTip:e.getBoolean("is_anonymous_tip"),toUsername:e.getStringOrUndefined("to_username"),tid:e.getString("tid")}}function m(e){const t={allowPrivateShow:e.getBoolean("allow_privates"),privatePrice:e.getNumber("private_price"),spyPrice:e.getNumber("spy_price"),privateMinMinutes:e.getNumber("private_min_minutes"),allowShowRecordings:e.getBoolean("allow_show_recordings"),activePassword:e.getBoolean("active_password"),tid:e.getString("tid")};return e.logUnusedDebugging("parseSettingsUpdate"),t}function g(e){var t;const i=e.getAny("messages"),s=[];if("string"==typeof i)s.push([(0,r.H5)(`Notice: ${i}`)]);else if(i instanceof Array)for(const e of i)s.push([(0,r.H5)(`Notice: ${e}`)]);else error("handleAppNotice error: Invalid message type",{data:i});const{foreground:n,background:a}=function(){const t=document.body.classList.contains("darkmode"),i=(0,o.f)("SendNoticeDarkModeOpts")&&t;let s=e.getStringOrUndefined("foreground"),n=e.getStringOrUndefined("background");if(i){const t=e.getStringOrUndefined("darkmode_foreground"),i=e.getStringOrUndefined("darkmode_background");void 0!==t&&""!==t&&(s=t),void 0!==i&&""!==i&&(n=i)}return{foreground:s,background:n}}(),l=e.getStringOrUndefined("weight"),h=null!==(t=e.getList("shortcodes"))&&void 0!==t?t:[];return{foreground:n,background:a,weight:""===l?void 0:l,messages:s,showInPrivateMessage:e.getBoolean("showInPrivateMessage",!1,!1),shortcodes:y(h),isAppNotice:!0,tid:e.getString("tid")}}function v(e){const t=e.getString("type");let i,s;if("log"===t)s=e.getString("message");else if("apperrorlog"===t){const t=e.getAny("message");if(i=[],i.push([(0,r.H5)("App Error: ")]),"string"==typeof t)i.push([(0,r.H5)(t)]);else if(t instanceof Array)for(const e of t)i.push([(0,r.H5)(e)]);else error("parseAppLog error: Invalid message type",{data:t})}else error(`parseAppLog error: Unknown app log type: ${t}`);return{type:t,errorMessages:i,debugMessage:s,tid:e.getString("tid")}}function f(e){return{text:e.getString("text"),notificationType:e.getString("notification_type"),url:e.getString("url"),timestamp:e.getNumber("timestamp"),timeSince:e.getString("time_since"),seen:e.getBoolean("seen",!1,!1)}}function y(e){const t=[];for(const o of e){var i,s,n;t.push({code:o.getString("code"),msg:null!==(i=o.getStringOrUndefined("msg"))&&void 0!==i?i:"",amt:null!==(s=o.getNumberOrUndefined("amt"))&&void 0!==s?s:0,signupLink:null!==(n=o.getStringOrUndefined("signup_link"))&&void 0!==n?n:""})}return t}},7437:(e,t,i)=>{"use strict";i.d(t,{lg:()=>L,K_:()=>I,Ge:()=>F,KM:()=>U,vL:()=>P,GR:()=>T,hp:()=>x,V8:()=>b,Md:()=>M,VW:()=>R,_y:()=>k,gh:()=>C,J1:()=>D,rN:()=>S,PJ:()=>w,Ds:()=>y,$G:()=>B,II:()=>A,YY:()=>E,rM:()=>f,DK:()=>N});var s=i(3417);class n{static get(e){return void 0===window.ReactAPIRegistry?(error("ReactAPIRegistry is undefined - React code is likely not loaded",{argument:e}),function(){return Promise.reject()}):void 0===window.ReactAPIRegistry[e]?(error(`ReactAPIRegistry does not contain API function ${e} - React code may not be up to date`,{argument:e}),function(){return Promise.reject()}):window.ReactAPIRegistry[e]}}var o=i(1885),r=i(9461),a=i(213),l=i(819);class h{constructor(e){this.stringParts=[],this.hashtagParts=[];const t=e.match(/#[a-zA-Z0-9\-_]{2,50}/g);if(null!==t)for(const e of t)this.hashtagParts.push(e.substr(1));this.stringParts=e.split(/#[a-zA-Z0-9\-_]{2,50}/g)}}var d=i(1452),c=i(3456),u=i(74),p=i(4947),m=i(4110),g=i(9332);function v(e){return""===e.fromUser.username?(0,g.H5)(p.R.aUser):(0,g.JH)(e.fromUser)}function f(e,t,i){if(""===t)return;const s=[],o=p.R.subjectChangeMessage(t),a=new h(o),l=i=>{for(let e=0;e{l([])})):l(i)}function y(e,t){(0,s.pi)(t.fromUser.username)||e.event.roomMessage.fire(t)}function b(e,t,i){if((0,s.pi)(e.fromUser.username))return;const n=void 0===i?t:i;r.Bm.current.mergePmDm?(o.J9.fire(e),o.H4.fire({...e,room:n})):""!==t&&n===t?o.J9.fire(e):""===n&&o.H4.fire({...e,room:n})}function w(e,t){"enter"!==t.action||void 0!==t.connections&&1!==t.connections?"leave"!==t.action||void 0!==t.connections&&0!==t.connections||e.roomLeave(t.user):e.roomEntry(t.user)}function C(e,t){t.username===e.username()&&(e.event.modStatusChange.fire(!0),e.isModerator=!0);const i=(0,g.H5)(p.R.moderatorPromoteMessage(t.fromUser,t.username));e.event.roomNotice.fire({messages:[[i]],showInPrivateMessage:[t.fromUser,t.username].includes(e.username())}),m.xw.fire({isMod:!0,username:t.username})}function S(e,t){t.username===e.username()&&(e.event.modStatusChange.fire(!1),e.isModerator=!1);const i=(0,g.H5)(p.R.moderatorRevokeMessage(t.fromUser,t.username));e.event.roomNotice.fire({messages:[[i]],showInPrivateMessage:[t.fromUser,t.username].includes(e.username())}),m.xw.fire({isMod:!1,username:t.username})}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.R.kickedFromRoomMessage,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.event.roomNotice.fire({messages:[[(0,g.H5)(t)]],showInPrivateMessage:!0}),e.changeStatus("notconnected"),(0,l.qK)(e,i)}function T(e){e.changeStatus("passwordprotected"),e.event.roomNotice.fire({messages:[[(0,g.H5)(p.R.chatDisconnectedMessage)]],showInPrivateMessage:!0})}function A(e,t){e.event.removeMessages.fire({username:t.username}),(e.username()===t.fromUser||e.username()===t.username||e.username()===e.room()||e.isModerator)&&e.event.roomNotice.fire({messages:[[(0,g.H5)(p.R.silenceMessage(t.username,t.fromUser))]],showInPrivateMessage:[t.fromUser,t.username].includes(e.username())}),e.event.onBanSilence.fire({silenced:t.username,silencer:t.fromUser,isBan:!1})}function P(e,t){e.event.removeMessages.fire({username:t.username}),"privatenotwatching"===e.status||"privatespying"===e.status||e.username()!==t.fromUser&&!e.isModerator||e.event.roomNotice.fire({messages:[[(0,g.H5)(p.R.userKickedAndMessagesRemovedMessage(t.username))]],showInPrivateMessage:t.username===e.username()}),e.event.onBanSilence.fire({silenced:t.username,silencer:t.fromUser,isBan:!0})}function k(e,t){if(e.setPrivateShowRequestingUser(t.userRequesting),e.event.privateShowRequest.fire(t),e.isBroadcasting){switch(e.status){case"public":case"away":break;default:warn(`unexpected status: ${e.status}`)}e.changeStatus("privaterequesting"),e.isBroadcasting&&e.event.playSound.fire("PrivateShow")}}function M(e){switch(e.status){case"public":e.changeStatus("privatenotwatching");break;case"privaterequesting":e.leaveRoom(),e.joinPrivateRoom(),e.setPrivateShowInfo(r.Aw.getState().privatePrice,r.Aw.getState().privateMinMinutes),e.changeStatus("privatewatching");break;default:warn(`private show approve unexpected status: ${e.status}`)}const t=(0,g.H5)(p.R.privateShowStartedMessage);"privatewatching"===e.status?(e.event.roomNotice.fire({messages:[[t]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0,toUser:e.privateShowRequestingUser}),e.isBroadcasting&&!r.Bm.current.isMobile&&e.event.roomNotice.fire({messages:[[(0,g.H5)(p.R.privateShowC2cTip)]],showInPrivateMessage:!0,toUser:e.privateShowRequestingUser})):e.event.roomNotice.fire({messages:[[t,(0,g.H5)(" ("),{partType:3},(0,g.H5)(")")]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0,toUser:e.privateShowRequestingUser}),u.ef.fire(void 0)}function R(e){const t=()=>{e.changeStatus("away"),e.isBroadcasting||e.event.roomNotice.fire({messages:[[(0,g.H5)(p.R.privateShowFinishedMessage)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0})};switch(e.status){case"privaterequesting":e.changeStatus("public"),e.event.roomNotice.fire({messages:[[(0,g.H5)(p.R.privateShowDeclinedMessage)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0});break;case"away":case"hidden":case"public":case"offline":case"hiddenwatching":break;case"privatewatching":e.leavePrivateRoom(),e.joinRoom(),t();break;case"privatespying":case"privatenotwatching":t();break;default:warn(`privateShowCancel wrong room status: ${e.status}`)}u.ef.fire(void 0)}function I(e){switch(e.status){case"away":case"public":case"privaterequesting":e.event.roomNotice.fire({messages:[[(0,g.H5)(p.R.returnFromAwayModeMessage)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0}),e.changeStatus("public");break;default:error(`unexpected state: ${e.status}`)}}function E(e,t){var i;arguments.length>2&&void 0!==arguments[2]&&arguments[2]||e.event.playSound.fire((i=t.amount)>=1e3?"HugeTip":i>=500?"LargeTip":i>=100?"MediumTip":i>=15?"SmallTip":"TinyTip"),e.event.tipAlert.fire(t);const s=[v(t),(0,g.H5)(` tipped ${t.amount} ${t.amount>1?"tokens":"token"}`)];t.isAnonymousTip&&s.push((0,g.H5)(" anonymously")),e.isBroadcasting&&""!==t.message&&s.push((0,g.H5)(` -- ${t.message}`)),e.event.roomNotice.fire({messages:[s],background:"#ff3",foreground:"#000",weight:"bold",showInPrivateMessage:t.fromUser.username===e.username()||e.isBroadcasting,dataNick:t.fromUser.username,ts:t.ts})}function L(e,t){if("log"===t.type&&void 0!==t.debugMessage)e.event.appDebugLog.fire(t.debugMessage);else if("apperrorlog"===t.type&&void 0!==t.errorMessages){const i={messages:t.errorMessages,showInPrivateMessage:!1};e.event.roomNotice.fire(i)}else error("handleAppDebugError invalid type",t)}function D(e,t){const i=[];"RECORDING_SAVED"===t.message&&(t.message=p.R.privateShowRecordingSavedMessage);for(const e of t.message.split(new RegExp(`\\b${t.fromUser.username}\\b`,"gi")))""===e||i.push((0,g.H5)(e)),i.push((0,g.JH)(t.fromUser));i.pop(),e.event.roomNotice.fire({messages:[i],background:"#33ff33",foreground:"#000",weight:"bold",showInPrivateMessage:t.fromUser.username===e.username(),ts:t.ts})}function B(e,t){if(e.event.settingsUpdate.fire(t),t.allowPrivateShow){if(e.privatePrice!==t.privatePrice){e.privatePrice=t.privatePrice;const i=(0,g.H5)(p.R.privateShowPriceChangeMessage(e.room(),t.privatePrice));e.event.roomNotice.fire({messages:[[i]],showInPrivateMessage:!0}),(0,c.Sz)()&&u.Sj.fire(void 0)}if(e.spyPrice!==t.spyPrice&&0!==t.spyPrice){e.spyPrice=t.spyPrice;const i=(0,g.H5)(p.R.spyShowPriceChangeMessage(e.room(),t.spyPrice));e.event.roomNotice.fire({messages:[[i]],showInPrivateMessage:!0})}}}function U(e,t,i){if(!e.isBroadcasting){switch(e.event.hiddenMessageChange.fire(i),e.status){case"privaterequesting":e.leavePrivateOrSpyShow().catch(d.yZ);break;case"public":case"hidden":case"hiddenwatching":case"offline":break;case"away":e.event.roomNotice.fire({messages:[[(0,g.H5)(p.R.returnFromAwayModeMessage)]],foreground:"#222",background:"#ff8b45",weight:"bold",showInPrivateMessage:!0});break;default:error(`handleHiddenShowStatusChange unexpected status: ${e.status}`)}"public"===t?window.setTimeout((()=>{e.changeStatus("public")}),3e3):e.changeStatus(t)}}function F(e,t){t?window.setTimeout((()=>{e.changeStatus("hiddenwatching")}),2e3):e.changeStatus("hiddenwatching")}let _=!1;function N(e){_||(_=!0,(0,a.Q$)(e,(()=>{_=!1})))}},9332:(e,t,i)=>{"use strict";function s(e){return{partType:1,message:e}}function n(e){return{partType:0,user:e}}function o(e,t){return-1!==t.indexOf(e.toLowerCase())?{partType:2,message:e}:s(`#${e}`)}i.d(t,{H5:()=>s,JH:()=>n,yP:()=>o})},2382:(e,t,i)=>{"use strict";i.d(t,{Ob:()=>l,ko:()=>r,lK:()=>n,oH:()=>a,qv:()=>o});const s={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",orange:"#ffa500",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"};function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{red:200,green:200,blue:200},i=e.toLowerCase();if(i=function(e){if(/^[a-z]+$/.test(e)){const t=s[e];if(void 0!==t)return t}return e}(i),o(i))return function(e){4===e.length&&(e=`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);const t=Number(`0x${e.substring(1)}`);return{red:t>>16&255,green:t>>8&255,blue:255&t}}(i);if(0===i.indexOf("rgb")){let i=e.match(/\d+(\.\d+)?%?/g);if(null===i||i.length<3||i.length>4)return t;i=[i[0],i[1],i[2]];const s=[];for(let e=0;e<3;e+=1)-1!==i[e].indexOf("%")?s[e]=Math.round(2.55*parseFloat(i[e])):s[e]=Number(i[e]),s[e]<0?s[e]=0:s[e]>255&&(s[e]=255);return{red:s[0],green:s[1],blue:s[2]}}return debug(`Cannot parse color: "${e}"`),t}function o(e){return/^#([a-fA-F0-9]{3}){1,2}$/.test(e)}function r(e,t,i){const s=i*t,n=s*(1-Math.abs(e/60%2-1)),o=i-s,r=Math.round(255*(s+o)),a=Math.round(255*(n+o)),l=Math.round(255*o);return e<=60?{red:r,green:a,blue:l}:e<=120?{red:a,green:r,blue:l}:e<=180?{red:l,green:r,blue:a}:e<240?{red:l,green:a,blue:r}:e<=300?{red:a,green:l,blue:r}:{red:r,green:l,blue:a}}function a(e){const t=n(e),i=t.red/255,s=t.green/255,o=t.blue/255,r=Math.max(i,s,o),a=r-Math.min(i,s,o);let l,h;return l=0===a?0:r===i?(s-o)/a*60:r===s?60*((o-i)/a+2):60*((i-s)/a+4),l<0&&(l+=360),h=0===r?0:a/r,{hue:Math.round(l),saturation:Number(h.toFixed(3)),value:Number(r.toFixed(3))}}function l(e){return(e.red>255||e.green>255||e.blue>255||e.red<0||e.green<0||e.blue<0)&&error(`Invalid rgb color value: r: ${e.red}, g: ${e.green}, b: ${e.blue}`),`000000${(e.red<<16|e.green<<8|e.blue).toString(16)}`.slice(-6)}},2939:(e,t,i)=>{"use strict";i.d(t,{BR:()=>l,Gr:()=>o,Ps:()=>a,X0:()=>n,Zm:()=>r,t7:()=>h});var s=i(8423);const n=new s.c_("roomLoaded",{listenersWarningThreshold:()=>100+3*s.hI,maxHistorySize:1}),o=new s.c_("roomCleanup",{listenersWarningThreshold:25}),r=new s.c_("userViewedPm"),a=new s.c_("tipSent"),l=new s.c_("context"),h=new s.c_("context")},7197:(e,t,i)=>{"use strict";i.d(t,{e:()=>p});var s=i(3910),n=i(9461),o=i(4140),r=i(1284),a=i(4580),l=i(9815),h=i(1448),d=i(4947),c=i(1372),u=i(4110);class p extends l.q{constructor(e){super(),this.chatConn=e}initListeners(){super.initListeners(),s.oB.listen((e=>{e.isOpen&&this.dontNotify.add(e.username)})).addTo(this.listenerGroup)}shouldNotify(e){const t=this.chatConn.inPrivateRoom()&&(e===this.chatConn.getPrivateShowUser()||e===this.chatConn.room());return super.shouldNotify(e)&&!t}createChatLinkMessage(e){const t={marginLeft:".5em"},i=this.createDmChatLink(e),s=this.createPmChatLink(e),a=n.Bm.current.isMobile&&e!==this.chatConn.room(),l=(0,c.tT)("span",null,(0,c.tT)("span",{style:t},"(",i,")"),!a&&(0,c.tT)("span",{style:t},"(",s,")"));return(0,o.yX)(l,(0,r.Uq)("#aaaaaa")),(0,h.r_)(d.R.newConversationMessageNotice(e),l)}createDmChatLink(e){return this.createChatLink(d.R.newConversationDmClick,(()=>{s.$o.fire(e),n.Bm.current.isMobile&&a.bW.fire(!0)}))}createPmChatLink(e){if(n.Bm.current.isMobile){const e=()=>{a.qb.fire("private")};return this.createChatLink(d.R.newConversationPmClickMobile,e)}{const t=t=>{t.target instanceof HTMLAnchorElement&&u.E3.fire({username:e,focus:!0,showSupporterAlert:!1})};return(0,c.tT)("span",{onClick:t,dangerouslySetInnerHTML:{__html:d.R.newConversationPmClickHTML}})}}createChatLink(e,t){return(0,c.tT)("a",{style:{cursor:"pointer"},colorClass:["msg-link","underline-link"],onClick:t},e)}}},2032:(e,t,i)=>{"use strict";function s(e,t){t.style.left=`${e.left}px`,t.style.top=`${e.top}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`}function n(e){return{left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function o(e,t,i){const s={...e};return s.top=e.top+t,s.height=e.height-t,s.top<0?(s.height+=s.top,s.top=0):s.heights?n.height=s-n.top:n.heights?n.width=s-n.left:n.widthr,U5:()=>a,ly:()=>s,qX:()=>o,w_:()=>n,xn:()=>l})},6669:(e,t,i)=>{"use strict";i.d(t,{Z2:()=>m,op:()=>v,wi:()=>g});var s=i(7623),n=i(9447),o=i(6784),r=i(1519),a=i(2709),l=i(3955),h=i(9605),d=i(8423),c=i(5412),u=i(7407),p=i(2146);const m=new d.c_("focusingInputFromKeypress",{listenersWarningThreshold:()=>10+d.hI});class g extends a.u{constructor(e,t){super(),this.submitInput=e,this.maxLength=t,this.savedCaret={nodeIdx:-1,nodeOffset:-1},this.recordUndoTimeout=-1,this.undoStack=[{inputContent:"",inputNodes:[],savedCaret:this.savedCaret}],this.undoPointer=0,this.ctrlMetaKeydownsIE=new Set,this.disableRequestUndo=!1,this.restoringBrowserUndo=!1,this.elementIsFocused=!1,this.listeners=new d.gt,this.maxLength=t,this.element.classList.add("customInput"),this.element.classList.add("noScrollbar"),this.element.style.position="relative",this.element.style.outline="none",this.element.style.border="none",this.element.style.boxSizing="border-box",this.element.style.fontSize="12px",this.element.style.whiteSpace="nowrap",this.element.style.overflowY="hidden",this.element.style.overflowX="scroll",this.element.contentEditable="true",(0,p.PF)(this.element,"text");const i=new r.a((()=>{this.doUndo(!0)}),{bounceLimitMS:10,debounceType:0}),n=new r.a((()=>{this.doRedo(!0)}),{bounceLimitMS:10,debounceType:0}),a=new r.a((()=>{this.onPossibleEmoji()}),{bounceLimitMS:10,debounceType:1});let l=!1,h=!1;(0,o.wu)("input",this.element,(e=>{var t;const o="\n"===(null===(t=e.data)||void 0===t?void 0:t.charAt(e.data.length-1));if(!h&&o)return e.preventDefault(),void this.submit();l||this.restoringBrowserUndo||(l=!0,"historyUndo"===e.inputType?i.callFunc():"historyRedo"===e.inputType?n.callFunc():((0,s.AD)()||a.callFunc(),this.requestRecordUndo(!0)),this.updatePlaceholderVisibility(),this.saveCaretPos(),l=!1)})),(0,s.lT)()&&window.setInterval((()=>{document.activeElement===this.element&&this.onPossibleEmoji()}),200),(0,o.wu)("paste",this.element,(e=>{if(e.preventDefault(),null!==e.clipboardData){let t;t=null!==window.clipboardData&&void 0!==window.clipboardData?window.clipboardData.getData("Text"):e.clipboardData.getData("text/plain"),this.insertText(t)}})),(0,o.wu)("click",this.element,(e=>{if(null!==e.target&&e.target!==this.element){const t=window.getSelection();if(null!==t){const i=document.createRange(),s=e.target;e.offsetX{h="Unidentified"!==e.key,"Enter"===e.key?(e.preventDefault(),this.submit()):this.willKeyEventViolateMaxLength(e)?e.preventDefault():(e.ctrlKey||e.metaKey)&&(-1!==["u","b","i"].indexOf(e.key)?e.preventDefault():"z"!==e.key||e.shiftKey?("z"===e.key&&e.shiftKey||"y"===e.key)&&(this.doRedo(),e.preventDefault()):(this.doUndo(),e.preventDefault()),this.ctrlMetaKeydownsIE.add(e.key)),this.updatePlaceholderVisibility()})),(0,o.wu)("keyup",this.element,(e=>{(0,s.lT)()&&(0,c.x)(e.which)&&(!this.ctrlMetaKeydownsIE.has(e.key)||e.repeat)?this.onInputChanged():-1===["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].indexOf(e.key)&&-1===["MetaLeft","MetaRight"].indexOf(e.code)||this.saveCaretPos(),this.ctrlMetaKeydownsIE.delete(e.key)})),(0,o.wu)("focus",this.element,(()=>{var e;this.elementIsFocused=!0,void 0!==this.placeholder&&(null===(e=this.placeholder.parentElement)||void 0===e||e.removeChild(this.placeholder))})),(0,o.wu)("blur",this.element,(()=>{this.elementIsFocused=!1,void 0!==this.placeholder&&""===this.getText()&&this.element.appendChild(this.placeholder),this.updatePlaceholderVisibility(),this.ctrlMetaKeydownsIE.clear()})),m.listen((e=>{this.willKeyEventViolateMaxLength(e)&&e.preventDefault()})).addTo(this.listeners)}setText(e){this.disableRequestUndo=!0,this.clearText(),this.insertText(e),this.element.scrollLeft=this.element.scrollWidth,this.disableRequestUndo=!1}insertText(e){if(""===e)return;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&this.setCaretToEnd(),this.focus(!0),this.forceRequestedRecordUndo(),this.areAnyContentsSelected()){const e=window.getSelection();null!==e&&e.rangeCount>0&&e.getRangeAt(0).deleteContents()}if(e=(e=e.replace(/\r?\n|\r/g," ")).replace(/ /g," "),""===(e=g.truncateString(e,this.getAvailableLength())))return;const t=this.createDivForText(e),i=window.getSelection();if(null!==i&&i.rangeCount>0){const e=i.getRangeAt(0),s=[...t.childNodes].reverse(),n=s[0];for(const t of s)e.insertNode(t);e.setStartAfter(n),e.collapse(!0),i.removeAllRanges(),i.addRange(e)}this.onInputChanged(),this.updatePlaceholderVisibility(),this.scrollToSavedCaret()}createDivForText(e){const t=document.createElement("div");if(t.textContent=e,!(0,s.AD)()){const e={unselectable:"on"};twemoji.parse(t,{attributes:t=>e})}return t}appendText(e){this.insertText(e,!0)}clearText(){if(""===this.getText())return;this.forceRequestedRecordUndo();const e=window.getSelection();if(null!==e){const t=document.createRange();t.selectNodeContents(this.element),e.removeAllRanges(),e.addRange(t),t.deleteContents(),t.collapse(!0)}this.onInputChanged()}getText(){let e="",t=!1;for(const i of this.element.childNodes)if(i instanceof HTMLImageElement)e+=i.alt,t=!0;else{if(i===this.placeholder)continue;null!==i.textContent&&(!t||":"!==i.textContent[0]&&"@"!==i.textContent[0]||(e+=" "),e+=i.textContent,t=!1)}return e.replace(/\s/g," ")}getAvailableLength(){return this.maxLength-this.getText().length}setCaretToEnd(){const e=window.getSelection();if(null!==e){const t=document.createRange();t.selectNodeContents(this.element),t.collapse(!1),e.removeAllRanges(),e.addRange(t),this.saveCaretPos()}}setCaretToEndOfSelection(){const e=window.getSelection();if(null!==e&&e.rangeCount>0){const t=e.getRangeAt(e.rangeCount-1);t.collapse(!1),e.removeAllRanges(),e.addRange(t)}else this.focus(!0)}setCurrentNodeText(e){document.activeElement!==this.element&&this.restoreCaretPos();const t=this.getNodeAtCaret(),i=window.getSelection();if(null!==i){t.textContent=e;const s=document.createRange();s.selectNodeContents(t),s.collapse(!1),i.removeAllRanges(),i.addRange(s)}}getCurrentNodeText(){const e=this.getNodeAtCaret();return null!==e.textContent?e.textContent.replace(/\s/g," "):""}selectCurrentNodeTail(e){const t=this.getNodeAtCaret(),i=window.getSelection();if(null!==i&&i.rangeCount>0){const s=document.createRange();s.selectNodeContents(t),s.setStart(t,e),this.scrollToSavedCaret(),i.removeAllRanges(),i.addRange(s)}}deleteSelection(){const e=window.getSelection();if(null!==e&&e.rangeCount>0){const t=e.getRangeAt(0);t.startContainer!==this.element&&this.element.contains(t.startContainer)&&(this.requestRecordUndo(!1),t.deleteContents(),this.onInputChanged())}}focus(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];document.activeElement!==this.element&&document.body.contains(this.element)&&(t&&!(0,l.YG)(this.element)&&(this.element.scrollIntoView(!1),window.scrollBy(0,12)),this.element.focus(),e?this.restoreCaretPos():this.setCaretToEnd(),this.scrollToSavedCaret())}blur(){this.element.blur()}disable(){this.blur(),this.element.contentEditable="false"}enable(){this.element.contentEditable="true"}setPlaceholder(e,t){void 0===this.placeholder?(this.placeholder=document.createElement("span"),this.placeholder.textContent=e,this.placeholder.style.pointerEvents="none",this.placeholder.contentEditable="false",void 0!==t&&(0,n.fZ)(this.placeholder,t),this.element.appendChild(this.placeholder)):this.placeholder.textContent=e}submit(){if(this.submitInput()){if(!(0,s.AD)()){const e=this.element.innerHTML,t=/]+alt="?([^"\s]+)"?\s*/g;let i=t.exec(e);for(;null!==i;)(0,u.bT)("emojiSent",{value:i[1]}),i=t.exec(e)}this.clearText(),this.blur()}}onPossibleEmoji(){const e=window.getSelection();if(null!==e&&e.rangeCount>0){const t=this.getNodeAtCaret();if(null!==t.textContent&&twemoji.test(t.textContent)){const i=t.textContent,s=document.createRange();s.selectNodeContents(t),e.removeAllRanges(),e.addRange(s),s.deleteContents(),this.insertText(i);const n=this.getNodeAtCaret();""!==n.textContent&&(s.setStartBefore(n),s.collapse(!0),e.removeAllRanges(),e.addRange(s),this.saveCaretPos())}}}areAnyContentsSelected(){const e=window.getSelection();if(null!==e&&e.rangeCount>0&&document.activeElement===this.element){const t=e.getRangeAt(0);if(t.startContainer!==t.endContainer||t.startOffset!==t.endOffset)return!0}return!1}willKeyEventViolateMaxLength(e){return!(this.getAvailableLength()>0)&&(!e.ctrlKey&&!e.metaKey&&(0,c.x)(e.which)&&-1===["Backspace","Delete"].indexOf(e.key)&&!this.areAnyContentsSelected())}onInputChanged(){this.saveCaretPos(),this.requestRecordUndo(!0)}requestRecordUndo(e){window.clearTimeout(this.recordUndoTimeout),this.recordUndoTimeout=-1,this.disableRequestUndo||(e?this.recordUndoTimeout=window.setTimeout((()=>{this.recordUndo(),this.recordUndoTimeout=-1}),300):this.recordUndo())}forceRequestedRecordUndo(){-1!==this.recordUndoTimeout&&(window.clearTimeout(this.recordUndoTimeout),this.recordUndoTimeout=-1,this.recordUndo())}recordUndo(){this.saveCaretPos();const e=this.getText();this.undoStack.splice(this.undoPointer+1,this.undoStack.length),this.undoStack[this.undoStack.length-1].inputContent===e&&this.undoStack.pop();const t=[...this.element.childNodes].map((e=>e.cloneNode(!0)));this.undoStack.push({inputContent:e,inputNodes:t,savedCaret:this.savedCaret}),this.undoStack.length>20&&this.undoStack.shift(),this.undoPointer=this.undoStack.length-1,this.keepBrowserUndoAvailable(!1)}doUndo(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,u.bT)(e?"BrowserTriggeredUndo":"HotkeyTriggeredUndo"),this.undoPointer!==this.undoStack.length-1||e||this.requestRecordUndo(!1),this.undoPointer>0&&(this.undoPointer-=1,this.applyUndoData(this.undoStack[this.undoPointer]),this.keepBrowserUndoAvailable(!0))}doRedo(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,u.bT)(e?"BrowserTriggeredRedo":"HotkeyTriggeredRedo"),this.undoPointer{this.element.appendChild(e.cloneNode())})),this.savedCaret=e.savedCaret,this.restoreCaretPos(),this.scrollToSavedCaret()}keepBrowserUndoAvailable(e){if(!this.elementIsFocused||document.queryCommandSupported("insertText"))return;this.restoringBrowserUndo=!0;const t=()=>{document.execCommand("insertText",!1,"~"),document.execCommand("delete",!1)},i=window.getSelection();if(null!==i&&i.rangeCount>0){const e=i.getRangeAt(0);i.removeAllRanges(),t(),i.addRange(e)}else t();this.restoringBrowserUndo=!1}getNodeAtCaret(){return this.saveCaretPos(),0===this.element.childNodes.length?this.element:-1===this.savedCaret.nodeIdx?this.element.childNodes[0]:this.element.childNodes[this.savedCaret.nodeIdx]}caretLeftOffset(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getCaretRange(e).getBoundingClientRect().left}caretXPos(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.caretLeftOffset(e)-this.element.getBoundingClientRect().left}caretAtEndOfInput(){const e=this.getCurrentNodeText().length;return!(e>0&&this.savedCaret.nodeOffset!==e)&&![...this.element.childNodes].slice(this.savedCaret.nodeIdx+1).some((e=>{var t,i;return"IMG"===e.nodeName||(null!==(t=null===(i=e.textContent)||void 0===i?void 0:i.length)&&void 0!==t?t:0)>0}))}getCaretWordStartRange(e){var t,i;const s=e.startContainer;if(0===(null!==(t=null==s||null===(i=s.textContent)||void 0===i?void 0:i.length)&&void 0!==t?t:0))return e;if(null!==window.getSelection()){for(;e.startOffset>0;){const t=e.toString();if(/^\s/.test(t)){e.setStart(s,e.startOffset+1);break}e.setStart(s,e.startOffset-1)}return e}return document.createRange()}getCaretRange(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=document.createRange();if(0===this.element.childNodes.length)return t.setStart(this.element,0),t;const i=this.element.childNodes[this.savedCaret.nodeIdx];return-1===this.savedCaret.nodeIdx?t.setStartBefore(this.element.childNodes[0]):""===i.textContent?t.setStartAfter(i):t.setStart(i,this.savedCaret.nodeOffset),e?this.getCaretWordStartRange(t):t}saveCaretPos(){const e=window.getSelection();if(null!==e&&e.rangeCount>0&&document.activeElement===this.element){const t=e.getRangeAt(0).cloneRange();let i;if(t.collapse(!1),i=t.startContainer===this.element?t.startOffset-1:Array.from(this.element.childNodes).indexOf(t.startContainer),-1===i)this.savedCaret={nodeIdx:-1,nodeOffset:-1};else if(""===this.element.childNodes[i].textContent)this.savedCaret={nodeIdx:i,nodeOffset:-1};else{const e=this.element.childNodes[i].textContent,s=t.startContainer===this.element?e.length:t.startOffset;this.savedCaret={nodeIdx:i,nodeOffset:s}}}}restoreCaretPos(){if(0===this.element.childNodes.length||this.savedCaret.nodeIdx>=this.element.childNodes.length)return;const e=window.getSelection();if(null!==e){const t=this.getCaretRange();t.collapse(!0),e.removeAllRanges(),e.addRange(t)}}scrollToSavedCaret(){let e=0;if(-1!==this.savedCaret.nodeIdx){const t=this.element.childNodes[this.savedCaret.nodeIdx],i=document.createRange();i.setStart(this.element,0),i.setEndAfter(t),e=i.getBoundingClientRect().width}e+=3,this.element.scrollLeft=Math.max(this.element.scrollLeft,e-this.element.offsetWidth)}static truncateString(e,t){if(e.length<=t)return e;let i=-1,s=0;for(const n of e){if(s+n.length>t)break;twemoji.test(n)&&(i=s),s+=n.length}if(-1!==i){const s=(0,h.yd)(e.substr(i,e.length));if(void 0!==s&&i+s.emojiChars.length>t)return e.substr(0,i)}return e.substr(0,s)}updatePlaceholderVisibility(){""!==this.getText()?this.element.classList.remove("inputFieldChatPlaceholder"):this.element.classList.add("inputFieldChatPlaceholder")}dispose(){this.listeners.removeAll()}getCurrentNodePreCaretText(){return this.getCurrentNodeText().substring(0,this.savedCaret.nodeOffset)}getCurrentNodePostCaretText(){return this.getCurrentNodeText().substring(this.savedCaret.nodeOffset)}replaceCurrentNodePreCaretText(e,t,i){const s=this.getCurrentNodePreCaretText().replace(e,t);i<0&&(error("CustomInput replaceCurrentNodePreCaretText with highlightLength < 0"),i=0),this.setCurrentNodeText(s+this.getCurrentNodePostCaretText()),this.setCurrentNodeSelection(s.length-i,s.length)}setCurrentNodeSelection(e,t){const i=this.getNodeAtCaret(),s=window.getSelection();if(null!==s&&s.rangeCount>0){const o=document.createRange();o.selectNodeContents(i);try{o.setStart(i,e),o.setEnd(i,t),s.removeAllRanges(),s.addRange(o),this.saveCaretPos(),this.scrollToSavedCaret()}catch(s){var n;throw error("setCurrentNodeSelectionError",{error:s,nodeContent:i.textContent,inputContent:this.getText(),nodeLen:null===(n=i.textContent)||void 0===n?void 0:n.length,start:e,end:t}),s}}}}class v extends a.u{constructor(e){super(),this.inputElement=e,this.element=e}caretLeftOffset(){var e,t;let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=this.inputElement.value.substring(0,null!==(e=null===(t=this.getCurrentSelection())||void 0===t?void 0:t.start)&&void 0!==e?e:0);if(i){for(;s.length>0&&!/^\s/.test(s);)s=s.slice(0,-1);s=this.inputElement.value.substring(0,s.length+1)}return(0,l.q_)(s,this.inputElement)}caretXPos(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.caretLeftOffset(e)+this.element.getBoundingClientRect().left}getAvailableLength(){return this.inputElement.maxLength-this.inputElement.value.length}appendText(e){this.inputElement.value=`${this.inputElement.value}${e}`}setCaretToEnd(){this.setCaretPosition(this.inputElement.value.length)}setCaretToEndOfSelection(){const e=this.getCurrentSelection();void 0!==e&&this.setCaretPosition(e.end)}getCaretPosition(){var e;return null===(e=this.getCurrentSelection())||void 0===e?void 0:e.end}setCaretPosition(e){this.selectRange(e,e)}getCurrentSelection(){return void 0!==this.pendingSelection?this.pendingSelection:null===this.inputElement.selectionStart||null===this.inputElement.selectionEnd?void 0:{start:this.inputElement.selectionStart,end:this.inputElement.selectionEnd}}getCurrentNodePreCaretText(){var e;return this.inputElement.value.substring(0,null!==(e=this.getCaretPosition())&&void 0!==e?e:0).replace(/\s/g," ")}scrollToEndOfSelection(){var e,t;const i=this.inputElement.value.substring(0,null!==(e=null===(t=this.getCurrentSelection())||void 0===t?void 0:t.end)&&void 0!==e?e:0),s=(0,l.q_)(i,this.inputElement);this.element.scrollLeft=Math.max(this.element.scrollLeft,s-(0,l.Q)(this.element)+4)}getCurrentNodeText(){return this.inputElement.value.replace(/\s/g," ")}getCurrentNodePostCaretText(){var e;return this.inputElement.value.substring(null!==(e=this.getCaretPosition())&&void 0!==e?e:this.inputElement.value.length).replace(/\s/g," ")}replaceCurrentNodePreCaretText(e,t,i){const s=this.getCurrentNodePreCaretText().replace(e,t);i<0&&(error("InputAsCustomInput replaceCurrentNodePreCaretText with highlightLength < 0"),i=0),this.inputElement.value=s+this.getCurrentNodePostCaretText(),this.selectRange(s.length-i,s.length)}insertText(e){this.replaceCurrentNodePreCaretText(/$/,e,0)}selectRange(e,t){this.inputElement.focus(),this.pendingSelection={start:e,end:t},window.setTimeout((()=>{this.inputElement.setSelectionRange(e,t),this.scrollToEndOfSelection(),this.pendingSelection=void 0}),0)}deleteSelection(){const e=this.getCurrentSelection();if(void 0!==e){const t=this.inputElement.value.substring(0,e.start),i=this.inputElement.value.substring(e.end);this.inputElement.value=t+i,this.setCaretPosition(t.length)}}focus(){this.inputElement.focus()}blur(){this.inputElement.blur()}}},1519:(e,t,i)=>{"use strict";i.d(t,{a:()=>s,v:()=>n});class s{constructor(e,t){this.func=e,this.config=t,this.recentlyLetPassthrough=!1,this.callImmediate=!1}callFunc(){if(1===this.config.debounceType)return clearTimeout(this.debounceTimeout),void(this.debounceTimeout=window.setTimeout(this.func,this.config.bounceLimitMS));const e=()=>{this.callImmediate&&2===this.config.debounceType?(this.callImmediate=!1,this.func(),window.setTimeout(e,this.config.bounceLimitMS)):this.recentlyLetPassthrough=!1};this.recentlyLetPassthrough?this.callImmediate=!0:(this.recentlyLetPassthrough=!0,this.func(),window.setTimeout(e,this.config.bounceLimitMS))}}class n extends s{constructor(e){super((()=>{this.isStart=!0,e(!1)}),{bounceLimitMS:300,debounceType:1}),this.fn=e,this.isStart=!0}callFunc(){this.isStart&&(this.isStart=!1,this.fn(!0)),super.callFunc()}}},9259:(e,t,i)=>{"use strict";i.r(t),i.d(t,{debug:()=>a,error:()=>n,info:()=>r,warn:()=>o});var s=i(7193);const n=s.z3,o=s.R8,r=s.pq,a=s.Yz;window.onerror=(e,t,i,s,o)=>{let r;try{r=JSON.stringify(o)}catch(e){r=`${o}`}const a=[`"Message: " ${e}`,`"URL: " ${t}`,`"Line: " ${i}`,`"Column: " ${s}`,`"Error object: " ${r}`].join("\n");return n(a,{},"UNCAUGHT_"),!1}},106:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});var s=i(2509);class n{constructor(){this.drawPile=new s.C,this.discardPile=new s.C}addToTop(e){this.currentElem!==e&&(this.discardPile.remove(e),this.drawPile.addToTop(e))}nextElem(){const e=this.drawPile.popFromTop();return void 0!==this.currentElem&&this.discardPile.addToTop(this.currentElem),this.currentElem=e,e}prevElem(){const e=this.discardPile.popFromTop();return void 0!==this.currentElem&&this.drawPile.addToTop(this.currentElem),this.currentElem=e,e}refillFromDiscard(){for(;;){const e=this.discardPile.popFromBottom();if(void 0===e)break;this.drawPile.addToBottom(e)}void 0!==this.currentElem&&(this.drawPile.addToBottom(this.currentElem),this.currentElem=void 0)}emptyDrawIntoDiscard(){for(;;){const e=this.drawPile.popFromBottom();if(void 0===e)break;this.discardPile.addToBottom(e)}void 0!==this.currentElem&&(this.discardPile.addToBottom(this.currentElem),this.currentElem=void 0)}remove(e){this.discardPile.remove(e),this.drawPile.remove(e),this.currentElem===e&&(this.currentElem=void 0)}makeCurrent(e){this.currentElem!==e&&(this.addToTop(e),this.nextElem())}}},2709:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});var s=i(8423);class n{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1?arguments[1]:void 0;this._children=[],this.hasInitUI=!1,this.didRepositionEvent=new s.c_("didReposition",{reportIfNoListeners:!1}),this.element="string"==typeof e?this.createBaseElement(e,t):e,this.initData(t),this.initUI(t),this.element.setAttribute("ts",`${this.constructor.name}`)}createBaseElement(e,t){const i=document.createElement(e);return i.style.height="100%",i.style.width="100%",i.style.position="absolute",i.style.overflow="hidden",i.style["-webkit-tap-highlight-color"]="transparent",i}initData(e){}initUI(e){}lazyInitUI(){this.hasInitUI=!0}repositionChildren(){}repositionChildrenRecursive(){this.repositionChildren();for(const e of this.children())e.repositionChildrenRecursive();this.didRepositionEvent.fire(void 0)}afterDOMConstructed(){}afterDOMConstructedIncludingChildren(){this.afterDOMConstructed();for(const e of this.children())e.afterDOMConstructedIncludingChildren()}addChild(e,t){return this.attachChild(e),void 0===t&&(t=this.element),e.hasInitUI||e.lazyInitUI(),t.appendChild(e.element),e}prependChild(e,t){return this.attachChild(e,0),void 0===t&&(t=this.element),t.insertBefore(e.element,this.element.firstChild),e}addChildBeforeIndex(e,t,i){if(t>this._children.length||t<0)return error("tried to add item before an index that does not exist"),e;if(void 0===i&&(i=this.element),e.hasInitUI||e.lazyInitUI(),t===this._children.length)this.attachChild(e),i.appendChild(e.element);else{const s=this._children[t].element;this.attachChild(e,t),i.insertBefore(e.element,s)}return e}attachChild(e,t){void 0!==e.parent&&e.parent!==this&&e.parent.removeChild(e),void 0===t?this._children.push(e):this._children.splice(t,0,e),e.parent=this}addChildBefore(e,t){void 0!==e.parent&&e.parent!==this&&e.parent.removeChild(e);const i=void 0===t?-1:this._children.indexOf(t);return i<0?this.element.appendChild(e.element):this.element.insertBefore(e.element,this._children[i].element),this._children.splice(i,0,e),e.parent=this,e}removeChild(e){const t=this._children.indexOf(e);if(-1!==t){this._children.splice(t,1),e.parent===this&&(e.parent=void 0),this.cleanupChildDOM(e);for(const t of e.children())t.afterRemovedFromParent();e.afterRemovedFromParent()}else error("tried removing component that doesn't exist")}cleanupChildDOM(e){const t=e.element.parentNode;null!==t?t.removeChild(e.element):error("couldn't find parent element to use for node removal")}removeAllChildren(){for(const e of this.children())e.parent===this&&(e.parent=void 0),this.cleanupChildDOM(e),e.afterRemovedFromParent();this._children=[]}removeAllDOMChildren(){for(;null!==this.element.firstChild;)this.element.removeChild(this.element.firstChild)}children(){return this._children}siblings(){return void 0===this.parent?[]:this.parent._children.filter((e=>e!==this))}afterRemovedFromParent(){}showElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block";this.element.style.display=void 0===this.originalDisplayStyle?e:this.originalDisplayStyle}hideElement(){"none"!==this.element.style.display&&(""!==this.element.style.display&&(this.originalDisplayStyle=this.element.style.display),this.element.style.display="none")}isShown(){return"none"!==this.element.style.display}toggleShowHide(){this.isShown()?this.hideElement():this.showElement()}previousSibling(){if(void 0!==this.parent)return this.findPreviousSibling(this.parent.children())}nextSibling(){if(void 0!==this.parent)return this.findPreviousSibling(this.parent.children().slice().reverse())}lastChild(){return this.children().length>0?this.children()[this.children().length-1]:void 0}findPreviousSibling(e){let t;for(const i of e){if(i===this)break;t=i}return t}}},82:(e,t,i)=>{"use strict";i.d(t,{b:()=>o});var s=i(1372),n=i(2709);class o extends n.u{constructor(e){super(void 0,e)}initData(e){super.initData(e)}createBaseElement(e,t){return this.state=this.initState(t),this.createElement(t)}createElement(e){return super.createBaseElement("div",e)}render(){return this.element}setState(e){for(const t in e)e.hasOwnProperty(t)&&(this.state[t]=e[t]);this.updateState()}updateState(){(0,s.zN)(this.element).forEach((e=>{e instanceof Function?e():e!==this&&e.updateState()}))}initState(e){return{}}}},5020:(e,t,i)=>{"use strict";i.d(t,{Hq:()=>h,Uv:()=>r,Wi:()=>s,Wj:()=>o,Wr:()=>a});var s,n=i(9447);function o(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3;const o=document.createElement("div");o.style.position="absolute",o.style.height="0",o.style.width="0",o.style.top="-8px",void 0!==i&&(o.style.left=i);const r=document.createElement("div");(0,n.fZ)(r,"divotBorder"),r.style.borderLeft="8px solid transparent",r.style.borderRight="8px solid transparent",r.style.borderBottomWidth="8px",r.style.borderBottomStyle="solid",""!==e&&(r.style.borderBottomColor=`${e}`),o.appendChild(r);const a=8-s,l=document.createElement("div");return(0,n.fZ)(l,"divotBackground"),l.style.position="absolute",l.style.top=`${s}px`,l.style.left=`${s}px`,l.style.borderLeft=`${a}px solid transparent`,l.style.borderRight=`${a}px solid transparent`,l.style.borderBottomWidth=`${a}px`,l.style.borderBottomStyle="solid",""!==t&&(l.style.borderBottomColor=`${t}`),r.appendChild(l),o}function r(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3;const o=document.createElement("div");o.style.position="absolute",o.style.height="0",o.style.width="0",o.style.bottom="0",void 0!==i&&(o.style.left=i);const r=document.createElement("div");(0,n.fZ)(r,"divotBorder"),r.style.borderLeft="8px solid transparent",r.style.borderRight="8px solid transparent",r.style.borderTopWidth="8px",r.style.borderTopStyle="solid",""!==e&&(r.style.borderTopColor=`${e}`),o.appendChild(r);const a=8-s,l=document.createElement("div");return(0,n.fZ)(l,"divotBackground"),l.style.position="absolute",l.style.top="0",l.style.left=`${s}px`,l.style.borderLeft=`${a}px solid transparent`,l.style.borderRight=`${a}px solid transparent`,l.style.borderTopWidth=`${a}px`,l.style.borderTopStyle="solid",""!==t&&(l.style.borderTopColor=`${t}`),r.appendChild(l),o}function a(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3;const o=document.createElement("div");o.style.position="absolute",o.style.height="0",o.style.width="0",o.style.left="-8px",void 0!==i&&(o.style.top=i);const r=document.createElement("div");(0,n.fZ)(r,"divotBorder"),r.style.borderTop="8px solid transparent",r.style.borderBottom="8px solid transparent",r.style.borderRightWidth="8px",r.style.borderRightStyle="solid",""!==e&&(r.style.borderRightColor=`${e}`),o.appendChild(r);const a=8-s,l=document.createElement("div");return(0,n.fZ)(l,"divotBackground"),l.style.position="absolute",l.style.top=`${s}px`,l.style.left=`${s}px`,l.style.borderTop=`${a}px solid transparent`,l.style.borderBottom=`${a}px solid transparent`,l.style.borderRightWidth=`${a}px`,l.style.borderRightStyle="solid",""!==t&&(l.style.borderRightColor=`${t}`),r.appendChild(l),o}function l(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3;const o=document.createElement("div");o.style.position="absolute",o.style.height="0",o.style.width="0",o.style.right="0",void 0!==i&&(o.style.top=i);const r=document.createElement("div");(0,n.fZ)(r,"divotBorder"),r.style.borderTop="8px solid transparent",r.style.borderBottom="8px solid transparent",r.style.borderLeftWidth="8px",r.style.borderLeftStyle="solid",""!==e&&(r.style.borderLeftColor=`${e}`),o.appendChild(r);const a=8-s,l=document.createElement("div");return(0,n.fZ)(l,"divotBackground"),l.style.position="absolute",l.style.top=`${s}px`,l.style.right=`-${a}px`,l.style.borderTop=`${a}px solid transparent`,l.style.borderBottom=`${a}px solid transparent`,l.style.borderLeftWidth=`${a}px`,l.style.borderLeftStyle="solid",""!==t&&(l.style.borderLeftColor=`${t}`),r.appendChild(l),o}function h(e,t){let i,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,d="";switch(e){case s.Top:i=o,d="divotTop";break;case s.Bottom:i=r,d="divotBottom";break;case s.Left:i=a,d="divotLeft";break;case s.Right:i=l,d="divotRight";break;default:i=void 0}if(void 0!==i){const e=i("","",t,h);return(0,n.fZ)(e,d),(0,n.fZ)(e,"divot"),e}}!function(e){e[e.Top=0]="Top",e[e.Bottom=1]="Bottom",e[e.Left=2]="Left",e[e.Right=3]="Right"}(s||(s={}))},1243:(e,t,i)=>{"use strict";i.d(t,{k:()=>r});var s=i(3910),n=i(2939),o=i(9815);class r extends o.q{constructor(){super()}initListeners(){s.oB.listen((e=>{e.isOpen&&this.dontNotify.add(e.username)})),n.Gr.listen((()=>{this.dontNotify.clear()}))}}},7668:(e,t,i)=>{"use strict";i.d(t,{P:()=>o,S:()=>r});var s=i(7623),n=i(6784);const o={enabled:!1,move:(e,t)=>{},end:()=>{}};function r(e,t){a(e,t,(e=>{const t=e;return{valid:!0,x:t.clientX,y:t.clientY}}),"mousedown","mousemove","mouseup"),a(e,t,(e=>{const t=e;if(1===t.touches.length){const e=t.touches.item(0);if(null!==e)return{valid:!0,x:e.clientX,y:e.clientY}}return{valid:!1,x:0,y:0}}),"touchstart","touchmove","touchend")}function a(e,t,i,o,r,a){(0,n.wu)(o,e,(e=>{const o=i(e);if(!o.valid)return;const l=t(e,o.x,o.y);if(!l.enabled)return;l.move(o.x,o.y),e.preventDefault();const h=e=>{const t=i(e);t.valid&&l.move(t.x,t.y)},d=e=>{e.preventDefault(),void 0!==e.buttons&&(e=>(0,s.Cc)()?0===e.buttons:1===e.buttons)(e)||void 0!==e.touches&&1===e.touches.length?h(e):c(e,!1)};(0,n.wu)(r,document,d,!0);const c=function(e){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&h(e),(0,n.Pf)(r,document,d,!0),(0,n.Pf)(a,document,c,!0),l.end()};(0,n.wu)(a,document,c,!0)}))}},6144:(e,t,i)=>{"use strict";i.d(t,{G:()=>o,v:()=>n});var s=i(2997);class n extends s.ij{constructor(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(null!=t?t:{},e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),this.toggleElement=e}}class o extends n{constructor(e){super(e)}initUI(){super.initUI(),this.element.style.display="block"}showElement(){const e=this.element.parentElement;return null!==e&&(e.classList.toggle("pushmenu-animate",!0),this.toggleEvent.fire(new s.XY(!0)),!0)}hideElement(){const e=this.element.parentElement;return null!==e&&(e.classList.toggle("pushmenu-animate",!1),this.toggleEvent.fire(new s.XY(!1)),!0)}isShown(){const e=this.element.parentElement;return null!==e&&e.classList.contains("pushmenu-animate")}}},2997:(e,t,i)=>{"use strict";i.d(t,{Ke:()=>l,XY:()=>c,ij:()=>a});var s=i(7623),n=i(6784),o=i(82),r=i(8423);class a extends o.b{constructor(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(e),this.toggleElement=t,this.toggleEvent=new r.c_("dropDownToggled",{reportIfNoListeners:!1}),void 0!==t&&((0,n.wu)("click",t,(e=>{e.metaKey||e.ctrlKey||this.toggleOverlay(e)}),!1),(0,n.wu)("keydown",t,(e=>{32!==e.keyCode&&"Space"!==e.code||(e.preventDefault(),this.toggleOverlay(e))})),t.classList.add("dropdown-anchor")),this.autoHide(i)}initUI(e){super.initUI(e),this.element.style.overflow="visible",this.element.style.position="absolute",this.element.style.top="0",this.element.style.left="0",this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.width="",this.element.style.height="",this.element.style.display="none",this.element.style.zIndex="4",this.element.classList.add("dropdown")}showElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block",t=arguments.length>1?arguments[1]:void 0;return!this.isShown()&&(this.element.style.display=e,this.toggleEvent.fire(new c(!0,t)),this.isShown())}hideElement(e){return!(void 0!==e&&e.composedPath().some((e=>e instanceof Element&&this.element.contains(e)&&e.matches(".dropdown-anchor")))||!this.isShown()||(this.element.style.display="none",this.toggleEvent.fire(new c(!1,e)),this.isShown()))}toggleOverlay(e){return this.isShown()?!this.hideElement(e):this.showElement(void 0,e)}autoHide(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.documentClickListener=l.listen((t=>{!(this.isShown()&&t.target instanceof Element)||e&&this.element.contains(t.target)||void 0!==this.toggleElement&&this.toggleElement.contains(t.target)||this.hideElement(t)}))}dispose(){this.documentClickListener.removeListener()}}const l=new r.c_("documentClick");let h,d=!1;(0,n.wu)("touchmove",document,(()=>{d=!0})),(0,n.wu)("touchstart",document,(()=>{d=!1})),(0,n.wu)("click",document,(e=>{l.fire(e),void 0!==h&&(clearTimeout(h),h=void 0)})),((0,s.J0)()||(0,s.aq)())&&(0,n.wu)("touchend",document,(e=>{d||(h=window.setTimeout((()=>{h=void 0,l.fire(e)}),200))}),!1);class c{constructor(e,t){this.isShowing=e,this.event=t}}},9605:(e,t,i)=>{"use strict";i.d(t,{FH:()=>m,GH:()=>d,IC:()=>u,I_:()=>g,jS:()=>p,mj:()=>v,yd:()=>c});var s=i(7063),n=i(5216);let o,r=[];const a=18,l="emojiRecents",h="|";function d(e){const t=e.match(/[^\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g);return null!==t?t:[]}function c(e){if(!twemoji.test(e))return;let t=-1,i="",s="",n=0;for(const o of d(e))-1===t&&twemoji.test(o)?(t=n,i=o,s=o):-1!==t&&(s=`${s}${o}`,twemoji.test(o)&&u(twemoji.parse(s))&&(i=s)),n+=o.length;return-1!==t?{emojiStart:t,emojiChars:i}:void 0}function u(e){const t=e.match(/JSON.stringify({value:e.value,name:e.name}))).join(h);return window.localStorage.setItem(l,t),r}function m(){const e=new Promise((e=>{const t=window.localStorage.getItem(l);e(null!==t?t.split(h).map((e=>{const t=JSON.parse(e);return{value:t.value,name:t.name}})):[])})),t=(0,n.Aw)("api/ts/emoticons/search_emojis/");o=Promise.all([e,t]).then((e=>{let[t,i]=e;return r=t,[r,new s.N6(i.responseText)]}))}function g(e){return void 0===o&&m(),void 0!==o?o.then((t=>{let[i,s]=t;if("recent"===e)return i;if("smileys-people"===e){const e=s.getAny("smileys-emotion"),t=s.getAny("people-body");return f(e.concat(t))}return f(s.getAny(e))})):Promise.reject()}function v(e){return(0,n.Aw)(`api/ts/emoticons/search_emojis/?keywords=${encodeURIComponent(e)}`).then((e=>{const t=new s.N6(e.responseText);return["smileys-emotion","people-body","animals-nature","food-drink","activities","travel-places","objects","symbols","flags"].map((e=>t.getAny(e))).filter((e=>void 0!==e)).map((e=>f(e))).reduce(((e,t)=>e.concat(t)))})).catch((()=>[]))}function f(e){return e.map((e=>({value:e.character,name:e.name})))}},481:(e,t,i)=>{"use strict";i.d(t,{Q:()=>f,s:()=>v});var s=i(7063),n=i(9447),o=i(6657),r=i(6066),a=i(2939),l=i(1244),h=i(8423),d=i(9060),c=i(8466),u=i(9586),p=i(3860);let m;const g=new h.c_("hideEmoticons",{listenersWarningThreshold:()=>10+h.hI});p.L.changeVideoMode.listen((()=>{g.fire(void 0)}));class v extends o.c{constructor(){super(...arguments),this.maxOptionLength=36}initData(){super.initData(),this.previewWrapper=document.createElement("div"),this.previewImage=document.createElement("img"),this.viewReportLink=document.createElement("div"),this.xhrConfig={withCredentials:!1,noRequestedWith:!0}}initUI(){(0,n.fZ)(this.previewWrapper,"previewWrapper"),this.previewWrapper.style.display="none",this.previewWrapper.style.width="260px",this.previewWrapper.style.height="110px",this.previewWrapper.style.lineHeight="110px",this.previewWrapper.style.borderBottomWidth="1px",this.previewWrapper.style.borderBottomStyle="solid",this.previewWrapper.style.textAlign="center",this.previewWrapper.onclick=()=>{void 0!==this.selectedIndex&&this.showPreview(this.items[this.selectedIndex])},this.previewWrapper.dataset.testid="emoticon-preview",this.element.appendChild(this.previewWrapper),super.initUI(),this.previewImage.src=`${STATIC_URL}loading.png`,this.previewImage.style.maxWidth="240px",this.previewImage.style.maxHeight="80px",this.previewImage.style.verticalAlign="middle",this.previewImage.style.padding="10px 10px 16px 10px",this.previewWrapper.appendChild(this.previewImage),(0,n.fZ)(this.viewReportLink,n.aG.hrefColor),this.viewReportLink.innerText="VIEW / REPORT EMOTICON",this.viewReportLink.style.fontSize="10px",this.viewReportLink.style.position="relative",this.viewReportLink.style.bottom="8px",this.viewReportLink.style.lineHeight="0",this.viewReportLink.onmouseenter=()=>{this.viewReportLink.style.textDecoration="underline"},this.viewReportLink.onmouseleave=()=>{this.viewReportLink.style.textDecoration="none"},this.viewReportLink.dataset.testid="view-report-link",this.previewWrapper.appendChild(this.viewReportLink),a.X0.listen((e=>{m=e.dossier.ignoredEmoticons})).addTo(this.listenerGroup),g.listen((()=>{void 0!==this.overlay&&this.hide()})).addTo(this.listenerGroup)}promptRegex(){return":"}searchSlugRegex(){return"[\\w-]+"}getDataEndpoint(){return(0,d.Jv)()?`/api/ts/emoticons/autocomplete/?slug=${this.searchSlug}`:`https://emote.highwebmedia.com/autocomplete?slug=${this.searchSlug}&_=${Date.now()}`}clearListDOM(){super.clearListDOM(),this.previewWrapper.style.display="none"}highlightSelectedIndex(e){super.highlightSelectedIndex(e),void 0!==this.selectedIndex&&(this.previewImage.src=`${STATIC_URL}loading.png`,this.previewImage.src=this.items[this.selectedIndex].url,this.previewWrapper.style.display="block")}parseResponse(e){const t=new s.N6(e),i=(t.getString("slug"),t.getObject("emoticons"));let n=[];for(const e of i)n.push({slug:e.slug,url:e.url,element:y,score:e.score});return n=n.map((e=>{const t=void 0===e.score?0:e.score;return e.slug===this.searchSlug?e.score=t+1e5:0===e.slug.indexOf(this.searchSlug)&&(e.score=t+9e3),e})),n=n.sort(((e,t)=>(void 0===e.score?0:e.score)-(void 0===t.score?0:t.score))),t.logUnusedDebugging("parseEmoticonAutocompleteResponse"),n}shouldIgnoreItem(e){return m.indexOf(e.slug)>=0}showPreview(e){l.pp.fire(e)}}class f extends v{constructor(e){super({inputElement:e,leftOffset:0,rightOffset:0}),this.mobileMixin=new r.v({autocompleteConfig:this.config,element:this.element,list:this.list,overlayClick:this.overlayClick,listenerGroup:this.listenerGroup,isVisible:()=>this.visible,hide:()=>this.hide(),pickItem:(e,t)=>this.pickItem(e,t),hideOnSpace:!0}),c.R.listen((()=>{l.JA.fire(void 0)})).addTo(this.listenerGroup)}initUI(){super.initUI(),this.element.style.border="",this.element.style.fontSize="14px",this.element.style.lineHeight="26px",this.element.style.boxShadow="0px 0px 8px rgba(0, 0, 0, 0.32)",this.element.style.marginLeft="7px",this.element.style.boxSizing="content-box",this.previewWrapper.style.width="",this.list.style.width="",(0,u.H)(this.list,!0)}repositionChildren(){}showPreview(e){super.showPreview(e),this.config.inputElement.blur(),l.jC.once((()=>{this.isVisible()&&(this.config.inputElement.focus(),this.previewImage.src=this.previewImage.src)}),!1)}appendItem(e,t){const i=super.appendItem(e,t);return this.mobileMixin.customizeItem(i,t),i}isSpecialFunctionKey(e){const t=this.config.inputElement.getCurrentNodePreCaretText().match(/\s$/);return super.isSpecialFunctionKey(e)||this.visible&&null!==t}show(){this.mobileMixin.onShow(),super.show()}}const y=document.createElement("div")},1244:(e,t,i)=>{"use strict";i.d(t,{Gj:()=>m,JA:()=>c,Yn:()=>p,jC:()=>u,pp:()=>d});var s=i(9447),n=i(6784),o=i(5216),r=i(2939),a=i(8423),l=i(2690);let h=[];r.X0.listen((e=>{h=e.dossier.ignoredEmoticons}));const d=new a.c_("openEmoticonPreview"),c=new a.c_("closeEmoticonPreview"),u=new a.c_("emoticonPreviewClosed");class p extends l.z{constructor(){super(),(0,s.fZ)(this.element,"emoticonPreviewModal"),this.element.style.position="fixed",this.element.style.width="auto",this.element.style.height="auto",this.element.style.left="50%",this.element.style.top="50%",this.element.style.transform="translate(-50%, -50%)",this.element.style.borderRadius="6px",this.element.style.padding="10px",this.element.style.fontSize="12px",this.element.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",this.element.style.zIndex="1005",this.element.style.textAlign="center",this.element.style.boxShadow="0 0 18px rgba(0, 0, 0, 0.4)",this.overlay.style.backgroundColor="#000000",this.overlay.style.opacity="0.4",this.overlay.style.zIndex="1005",this.element.dataset.testid="emoticon-modal";const e=document.createElement("div");(0,s.fZ)(e,"closeButton"),e.style.display="inline-block",e.style.position="absolute",e.style.width="10px",e.style.height="10px",e.style.top="9px",e.style.right="9px",e.style.cursor="pointer",e.style.opacity="1",e.onclick=()=>{this.hide()},e.onmouseenter=()=>{e.style.opacity="1"},e.onmouseleave=()=>{e.style.opacity="0.5"},e.dataset.testid="close-button",this.element.appendChild(e),this.previewImage=document.createElement("img"),this.previewImage.style.verticalAlign="middle",this.previewImage.style.padding="10px",this.previewImage.style.maxHeight="75vh",this.previewImage.style.maxWidth="75vw",(0,n.wu)("load",this.previewImage,(()=>{this.previewImage.style.visibility="visible",this.repositionChildren()})),this.previewImage.dataset.testid="preview-image",this.element.appendChild(this.previewImage),this.reportLink=document.createElement("div"),(0,s.fZ)(this.reportLink,s.aG.hrefColor),this.reportLink.innerText="REPORT EMOTICON",this.reportLink.style.cursor="pointer",this.reportLink.onclick=()=>{this.reportLink.style.display="none",this.reportWrapper.style.display="block",this.repositionChildren()},this.reportLink.onmouseenter=()=>{this.reportLink.style.textDecoration="underline"},this.reportLink.onmouseleave=()=>{this.reportLink.style.textDecoration="none"},this.reportLink.dataset.testid="report-link",this.element.appendChild(this.reportLink),this.reportWrapper=document.createElement("div"),this.reportWrapper.style.display="none",this.element.appendChild(this.reportWrapper);const t=document.createElement("span");t.innerText="Choose a category:",t.style.marginRight="6px",t.dataset.testid="category-label",this.reportWrapper.appendChild(t);const i=document.createElement("select");(0,s.fZ)(i,"categorySelect"),i.style.borderRadius="4px",i.style.marginBottom="2px";for(const e of g){const t=document.createElement("option");t.innerText=e.label,t.value=e.value,t.dataset.testid=e.value.replace("_","-"),i.appendChild(t)}i.dataset.testid="category-select",this.reportWrapper.appendChild(i);const r=document.createElement("span");r.style.display="inline-block";const a=document.createElement("span");(0,s.fZ)(a,"cancelButton"),a.innerText="CANCEL",a.style.fontFamily="UbuntuMedium, Helvetica, Arial, sans-serif",a.style.fontSize="12px",a.style.padding="2px 6px",a.style.borderRadius="4px",a.style.boxSizing="border-box",a.style.cursor="pointer",a.style.display="inline-block",a.style.marginLeft="6px",a.onclick=()=>{this.reportLink.style.display="block",this.reportWrapper.style.display="none",this.repositionChildren()},a.dataset.testid="cancel-button",r.appendChild(a);const l=document.createElement("span");(0,s.fZ)(l,"reportButton"),l.innerText="REPORT",l.style.fontFamily="UbuntuMedium, Helvetica, Arial, sans-serif",l.style.fontSize="12px",l.style.padding="2px 6px",l.style.borderRadius="4px",l.style.boxSizing="border-box",l.style.cursor="pointer",l.style.display="inline-block",l.style.marginLeft="6px",l.onclick=()=>{const e=`emoticon_report_abuse/${this.emoticon.slug}/`;(0,o.KF)(e,{category:i.value}).then((e=>{h.push(this.emoticon.slug),this.reportWrapper.style.display="none",this.undoWrapper.style.display="block",this.repositionChildren()})).catch((e=>{error("Error reporting emoticon",e)}))},l.dataset.testid="report-button",r.appendChild(l),this.reportWrapper.appendChild(r),this.undoWrapper=document.createElement("div"),this.undoWrapper.style.display="none",this.element.appendChild(this.undoWrapper);const d=document.createElement("span");d.innerText="EMOTICON REPORTED - ",d.dataset.testid="emoticon-reported-label",this.undoWrapper.appendChild(d);const u=document.createElement("span");(0,s.fZ)(u,s.aG.hrefColor),u.innerText="UNDO",u.style.cursor="pointer",u.onclick=()=>{const e=`emoticon_report_abuse/${this.emoticon.slug}/`;(0,o.KF)(e,{category:i.value}).then((e=>{const t=h.indexOf(this.emoticon.slug,0);t>=0&&h.splice(t,1),this.undoWrapper.style.display="none",this.reportLink.style.display="block",this.repositionChildren()})).catch((e=>{error("Error reporting emoticon",e)}))},u.onmouseenter=()=>{u.style.textDecoration="underline"},u.onmouseleave=()=>{u.style.textDecoration="none"},u.dataset.testid="undo-link",this.undoWrapper.appendChild(u),this.overlayClick.listen((()=>{this.hide()})),c.listen((()=>{this.hide()}))}initAndShow(e){this.emoticon=e,this.previewImage.style.visibility="hidden",this.previewImage.src=this.emoticon.url,this.reportLink.style.display="none",this.reportWrapper.style.display="none",this.undoWrapper.style.display="none",h.indexOf(e.slug)>=0?this.undoWrapper.style.display="block":this.reportLink.style.display="block",super.show(),this.removeDocumentFocus(),this.repositionChildren()}hide(){super.hide(),u.fire(void 0)}show(){super.show(),this.element.style.visibility="",this.repositionChildren()}removeDocumentFocus(){null!==document.activeElement&&document.activeElement.blur()}}class m extends p{constructor(){super(),this.previewImage.style.maxWidth="calc(100vw - 64px)",this.reportWrapper.style.width="300px",this.reportWrapper.style.margin="auto"}}const g=[{label:"Just ignore this emoticon",value:"ignore"},{label:"Offensive",value:"offensive"},{label:"Disgusting",value:"disgusting"},{label:"Fake Tip",value:"fake_tip"},{label:"Advertising",value:"advertising"}]},8423:(e,t,i)=>{"use strict";i.d(t,{Rj:()=>a,c_:()=>h,gt:()=>d,hI:()=>o,jU:()=>r});var s=i(2709);class n{constructor(){this.reportIfNoListeners=!0,this.maxHistorySize=10,this.listenersWarningThreshold=50}}let o=0;function r(){o+=1}function a(){o-=1}class l{constructor(e,t){this.router=e,this.listener=t}removeListener(){this.router.removeListener(this.listener)}addTo(e){e.add(this)}}class h{constructor(e,t){this.eventName=e,this.listeners=[],this.history=[],this.counter=0,this.listenersMap=new Map,this.options=Object.assign(new n,t),this.idFieldName=`_eventRouter${this.eventName}Id`}listen(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.listeners.push(e),t)for(const t of this.history)e(t);else i&&this.history.length>0&&e(this.history[this.history.length-1]);return this.warnTooManyListeners(),void 0!==this.options.onListenerAdded&&this.options.onListenerAdded(this.listeners.length),new l(this,e)}warnTooManyListeners(){const e=this.getListenersWarningThreshold();-1!==e&&this.size()>e&&warn("EventRouter has too many listeners",{event:this.eventName,listeners:this.size(),"max-listeners":e})}addListener(e,t){if(!t.hasOwnProperty(this.idFieldName)){this.counter+=1;const e=this.counter;Object.defineProperty(t,this.idFieldName,{get:()=>e})}const i=t[this.idFieldName];this.listenersMap.set(i,[t,e]),window.setTimeout((()=>{if(!h.isElementConnected(t)){const e=(t instanceof s.u?t.element:t).outerHTML;warn(`addListener for EventRouter "${this.eventName}" is called on a listeningSource which is not attached to the DOM.\n This can result in the listener not being registered. Make sure the element is attached in the same thread as calling addListener.`,{listeningSource:e})}})),void 0!==this.listenersCleanUpTimeout&&window.clearTimeout(this.listenersCleanUpTimeout),this.listenersCleanUpTimeout=window.setTimeout((()=>{this.cleanUpRemovedElements(),this.warnTooManyListeners()}),100)}cleanUpRemovedElements(){const e=Math.max(1,Math.floor(this.getListenersWarningThreshold()/2));if(this.listenersMap.size>e)for(const e of this.listenersMap.values())h.isElementConnected(e[0])||this.listenersMap.delete(e[0][this.idFieldName])}static isElementConnected(e){return e instanceof HTMLElement&&e.isConnected||e instanceof s.u&&e.element.isConnected}once(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t=>{e(t),this.removeListener(i)};return this.listen(i,!1,t)}fire(e){this.history.push(e)>this.options.maxHistorySize&&this.history.shift(),0===this.listeners.length&&0===this.listenersMap.size&&this.options.reportIfNoListeners&&debug(`No listeners for event: ${this.eventName}`);for(const t of[...this.listeners])this.callListener(t,e);for(const t of this.listenersMap.values()){const i=t[0],s=t[1];h.isElementConnected(i)?this.callListener(s,e):window.setTimeout((()=>{h.isElementConnected(i)?this.callListener(s,e):this.listenersMap.delete(i[this.idFieldName])}))}}callListener(e,t){try{e(t)}catch(t){error("Event listener error",{reason:t.toString(),event_name:this.eventName,event_listeners:this.size(),listener:e,error_stack:t.stack})}}size(){return this.listeners.length+this.listenersMap.size}removeListener(e){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1),void 0!==this.options.onListenerRemoved&&this.options.onListenerRemoved(this.listeners.length)}listenerCount(){return this.listeners.length}getListenersWarningThreshold(){return"number"==typeof this.options.listenersWarningThreshold?this.options.listenersWarningThreshold:this.options.listenersWarningThreshold()}}class d{constructor(){this.boundListeners=[]}add(e){this.boundListeners.push(e)}removeAll(){for(const e of this.boundListeners)e.removeListener();this.boundListeners=[]}}},8451:(e,t,i)=>{"use strict";i.d(t,{$Z:()=>l,Ci:()=>r,HK:()=>d,IM:()=>n,LV:()=>o,T6:()=>a});var s=i(6784);function n(e){return"ArrowUp"===e.key||38===e.keyCode}function o(e){return"ArrowDown"===e.key||40===e.keyCode}function r(e){return"Enter"===e.key||13===e.keyCode}function a(e){return void 0===e.which||"number"==typeof e.which&&e.which>0&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function l(e){var t;return 1===(null===(t=e.key.match(/^[a-zA-Z0-9]$/))||void 0===t?void 0:t.length)}function h(e){null==e||e.preventDefault(),null==e||e.stopImmediatePropagation()}function d(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,n=!1;const o=()=>{n||((0,s.Pf)("click",e,h,!0),(0,s.Pf)("pageshow",window,o),d(e,t,i),n=!0)};return(0,s.ck)("click",e,(n=>{t&&(n.ctrlKey||n.metaKey||n.shiftKey)?d(e,t,i):((0,s.wu)("click",e,h,!0),i>0&&window.setTimeout(o,i),(0,s.wu)("pageshow",window,o))})),e}},3737:(e,t,i)=>{"use strict";i.d(t,{a:()=>o,y:()=>a});var s=i(7407);const n={};class o{constructor(e){this.active=!1,this.eligible=!1,this.name=e;const t=window.experiments;if(void 0!==t){const i=new RegExp(`\\b${e}\\b`),s=t.active;this.active=void 0!==s&&i.test(s);const n=t.eligible;this.eligible=void 0!==n&&i.test(n)}}record(){if(!this.eligible||n[this.name])return;const e={experimentName:this.name,experimentGroup:this.active?"active":"inactive",experimentTreatment:this.active?this.name:"control"};(0,s.bT)("ExperimentEntered",e,!0),n[this.name]=!0}}const r={};class a{constructor(e,t){this.namespace=t,this.active=!1,this.eligible=!1;const i=window.experiments;if(void 0!==i){const t=i.active,s=i.eligible;if(void 0!==s){for(const t of e)if(new RegExp(`\\b${t}\\b`).test(s)){this.eligible=!0;break}if(this.eligible&&void 0!==t)for(const i of e)if(new RegExp(`\\b${i}\\b`).test(t)){this.active=!0,this.activeSide=i;break}}}}isControlGroup(){return this.eligible&&!this.active}record(){if(!this.eligible||r[this.namespace])return;const e={experimentName:this.namespace,experimentGroup:this.active?"active":"inactive",experimentTreatment:this.active?this.activeSide:"control"};(0,s.bT)("ExperimentEntered",e,!0),r[this.namespace]=!0}}},6440:(e,t,i)=>{"use strict";function s(e){return new RegExp(`\\b${e}\\b`).test(window.active_feature_flags)}i.d(t,{f:()=>s})},9060:(e,t,i)=>{"use strict";i.d(t,{BP:()=>p,Jv:()=>d,P7:()=>u,QC:()=>g,Rd:()=>a,c5:()=>o,nc:()=>l,ng:()=>r,qn:()=>c,rT:()=>m,vn:()=>h,yb:()=>n});var s=i(6440);const n=()=>(0,s.f)("MobileMediaUpload"),o=()=>(0,s.f)("ReplaceFullscreenWithIFS"),r=()=>(0,s.f)("CmpctVdCtrlIcns"),a=()=>(0,s.f)("RmRmlstSpa"),l=()=>(0,s.f)("HmpgTagsPag"),h=()=>(0,s.f)("BTagUpdate"),d=()=>(0,s.f)("PGEmoticonsAC"),c=()=>(0,s.f)("RemoveRecommendedCams"),u=()=>(0,s.f)("MobileUnmuteClickability"),p=()=>(0,s.f)("PSRequestPMTabRedirect"),m=()=>(0,s.f)("FltInPath"),g=()=>(0,s.f)("ScrollDownNotice")},2396:(e,t,i)=>{"use strict";i.d(t,{b:()=>r});var s=i(7063),n=i(5216);let o;function r(e){const t=void 0===o||""===o?e:o;return new Promise(((i,o)=>{(0,n.Aw)(`api/ts/accounts/usermenu/${e}/${t}/`).then((e=>{i(function(e){const t=new s.N6(e),i=t.getBoolean("online"),n=t.getString("username"),o=t.getNumber("display_age",!1),r=t.getString("gender"),a=t.getString("image_url"),l=t.getBoolean("can_silence"),h=t.getNumberOrUndefined("silence_id"),d=t.getBoolean("can_access"),c=t.getBoolean("needs_supporter_to_pm");return t.logUnusedDebugging("fetchUserMenuData.parseMenuDataRes"),{username:n,displayAge:o,gender:r,imageUrl:a,online:i,canSilence:l,canAccess:d,needsSupporterToPm:c,silenceId:h}}(e.responseText))})).catch((e=>{o(e)}))}))}i(2939).X0.listen((e=>{o=e.chatConnection.room()}))},4693:(e,t,i)=>{"use strict";i.d(t,{Be:()=>s,wT:()=>o,zt:()=>n});class s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;this.filterAfterSize=e,this.cacheTTL=t,this.cache=new Map}getShortenedPrefix(e){return void 0===this.filterAfterSize||e.length>this.filterAfterSize?e.substring(0,this.filterAfterSize):e}get(e){const t=this.getShortenedPrefix(e),i=this.cache.get(t);return t===e?i:null==i?void 0:i.filter((t=>t.slug.startsWith(e)))}set(e,t){(void 0===this.filterAfterSize||e.length<=this.filterAfterSize)&&(this.cache.set(e,t),-1!==this.cacheTTL&&window.setTimeout((()=>this.cache.delete(e)),this.cacheTTL))}}class n extends s{get(e){const t=this.getShortenedPrefix(e),i=this.cache.get(t);return t===e?i:null==i?void 0:i.filter((t=>t.slug.toLowerCase().startsWith(e)))}}class o extends s{get(e){const t=this.getShortenedPrefix(e),i=this.cache.get(t);return t===e?i:null==i?void 0:i.filter((t=>t.slug.includes(e)))}}},7463:(e,t,i)=>{"use strict";i.d(t,{O3:()=>g,PT:()=>d,QH:()=>f,Tf:()=>c,iD:()=>u,im:()=>h,j4:()=>v,wF:()=>y});var s=i(7063),n=i(5216),o=i(6844),r=i(8423),a=i(5424),l=i(4947);const h=new r.c_("followingEvent"),d=["follow_new","follow_text","follow_photo"];function c(e,t,i){return(0,n.KF)(`api/ts/follow/notifications/${e}`,{notification_frequency:t}).then((()=>(i.fire({roomName:e,following:!0,followNotificationFrequency:t}),!0))).catch((t=>(error("Unable to update follow notification settings",{room:e,reason:t.toString()}),!1)))}function u(){return(0,n.Aw)("api/ts/follow/email_notifications/").then((e=>{const t=new s.N6(e.responseText);return{activated:t.getBoolean("activated"),email:void 0!==t.getStringOrUndefined("email")?t.getStringOrUndefined("email"):"",validated:t.getBoolean("validated")}})).catch((e=>(error("Error checking if follow email notifications are turned on",e),!1)))}const p="email_field";function m(e,t,i){const o=void 0!==i?i.email:void 0,r=void 0!==i?i.validated:void 0;return new Promise(((i,a)=>{const h={activate:`${e}`};void 0!==t&&""!==t&&(h[p]=t),(0,n.KF)("api/ts/follow/email_notifications/",h).then((()=>{i(`${!(void 0!==t&&""!==t&&o===t&&void 0!==r&&r)&&void 0!==t}`)})).catch((e=>{a(function(e){const t=new s.N6(e.xhr.responseText).getString("error");if(t.indexOf(p)>-1){const e=new s.N6(t).getList(p);if(void 0!==e&&e.length>0)return e[0].getString("message")}return l.R.emailSubmitErrorMessage}(e))}))}))}function g(e,t){return void 0!==t&&""!==t?u().then((i=>t===i.email&&e===i.activated?new Promise(((e,s)=>{i.validated||(0,n.KF)("emailvalidation/resend/",{}).then((()=>{e("true")})).catch((()=>{s(`Error resending verification email to ${t}`)})),e("false")})):m(e,t,i))).catch((()=>m(e,t))):m(e)}function v(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"FollowStar";if(void 0!==t&&!t||!(0,o.rC)(l.R.loginToFollow,void 0,void 0,!0))return(0,n.KF)(`follow/follow/${e}/`,{location:i}).then((t=>{const i=new s.N6(t.responseText);return h.fire({roomName:e,following:!0,followNotificationFrequency:(0,a.QZ)(i.getString("notification_frequency")),onlineCount:i.getNumberOrUndefined("online_count"),totalCount:i.getNumberOrUndefined("total_count")}),!0})).catch((t=>(error("Unable to follow",{roomName:e,reason:t.toString()}),!1)))}function f(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"FollowStar";if(void 0!==t&&!t||!(0,o.rC)(l.R.loginToFollow,void 0,void 0,!0))return(0,n.KF)(`follow/unfollow/${e}/`,{location:i}).then((t=>{const i=new s.N6(t.responseText);return h.fire({roomName:e,following:!1,followNotificationFrequency:"none",onlineCount:i.getNumberOrUndefined("online_count"),totalCount:i.getNumberOrUndefined("total_count")}),!0})).catch((t=>(error("Unable to unfollow",{roomName:e,reason:t.toString()}),!1)))}function y(e){return(0,n.Aw)(`follow/follow_allowed/${e}/`).then((e=>new s.N6(e.responseText).getBoolean("can_follow"))).catch((e=>(error("Error checking if user following is allowed",e),!1)))}},2119:(e,t,i)=>{"use strict";i.d(t,{M:()=>m});var s=i(9461),n=i(7477),o=i(897),r=i(8039),a=i(7013),l=i(9603),h=i(1134),d=i(2939),c=i(5020),u=i(3955),p=i(4947);class m{constructor(){if(this.followers=new Set,s.Bm.current.isBroadcast){var e,t;const i=null!==(e=null===(t=s.Bm.current.loggedInUser)||void 0===t?void 0:t.userUid)&&void 0!==e?e:"";new o.Jf(i).onMessage.listen((e=>{var t;e.followerUsername!==(null===(t=s.Bm.current.loggedInUser)||void 0===t?void 0:t.username)&&(e.isFollowing?this.addFollower(e.followerUsername):this.removeFollower(e.followerUsername))})),d.X0.listen((e=>{window.setTimeout((()=>{r.SJ.getInstance().fetchRoomUsers().then((e=>{e.roomUsers.forEach((e=>{!0===e.isFollowing&&this.addFollower(e.username)}))})).catch(void 0)}),5e3),e.chatConnection.event.roomMessage.listen((e=>{!0===e.fromUser.isFollowing&&this.addFollower(e.fromUser.username)})),e.chatConnection.event.tipAlert.listen((e=>{!0===e.fromUser.isFollowing&&this.addFollower(e.fromUser.username)})),new n.eB(e.dossier.roomUid).onMessage.listen((e=>{!0===e.user.isFollowing&&this.addFollower(e.user.username)}))})),h.T.registerGenerator("followerBadge",(e=>this.createChatBadge(e)))}}static getOrCreateInstance(){return void 0===m.singletonInstance&&(m.singletonInstance=new m),m.singletonInstance}hasFollower(e){return this.followers.has(e)}addFollower(e){this.followers.has(e)||(this.followers.add(e),this.updateChatBadges(e))}removeFollower(e){this.followers.delete(e),this.updateChatBadges(e)}shouldShowBadge(e){return this.followers.has(e)&&e!==s.Aw.getState().room}createChatBadge(e){const t=document.createElement("span");(0,u.ZM)(t,{position:"relative",display:this.shouldShowBadge(e)?"":"none",marginRight:".1em"});const i=(0,a.H)(),s=(0,l.q)({content:p.R.followsYou,hasHTML:!1,divotPosition:c.Wi.Bottom,divotLeftOrTop:"8px"});return s.style.padding="6px",s.style.fontFamily="UbuntuLight, Helvetica, Arial, sans-serif",s.style.lineHeight="normal",s.style.position="fixed",s.style.display="block",(0,u.JR)(i).listen((e=>{var t;e?document.body.appendChild(s):null===(t=s.parentElement)||void 0===t||t.removeChild(s);const n=i.getBoundingClientRect(),o=(0,u.Mx)();s.style.top=-o.top+n.top-s.offsetHeight-n.height/5-5+"px",s.style.left=-o.left+n.left+n.width/2-18+"px"})),t.appendChild(i),t}updateChatBadges(e){const t=this.shouldShowBadge(e);h.T.getBadgeElements("followerBadge",e).forEach((e=>{e.style.display=t?"":"none"}))}}},5090:(e,t,i)=>{"use strict";i.d(t,{y:()=>d});var s=i(9463),n=i(9461),o=i(7321),r=i(6064),a=i(7463),l=i(213),h=i(4947);class d{constructor(e,t,i){this.isAnonymous=e,this.roomListContainerID=t,this.isMobile=i,this.initEvents()}initEvents(){this.bindFollowingIcons(),o.HA.getInstance().addOnLoadHandler((()=>{this.bindFollowingIcons()})),s.P$.listen((e=>{if(void 0===n.Bm.current.loggedInUser||window.location.pathname.startsWith("/followed-cams/"))return;const t=new Set(e.onlineFollowedList.roomList.map((e=>e.room)));this.updateAllFollowIcons(t)}))}bindFollowingIcons(){const e=document.querySelectorAll(`#${this.roomListContainerID}`);for(const t of e){const e=t.querySelectorAll("div.follow_star");for(const t of e)t.onclick=()=>{this.setFollowUnfollowStar(t)}}}onFollowClickSuccess(e){e.classList.remove("icon_update_following"),e.classList.add("icon_following","no_hover"),window.setTimeout((function(){e.classList.remove("no_hover")}),3e3),e.title=h.R.unfollowText}updateAllFollowIcons(e){const t=document.querySelectorAll(`#${this.roomListContainerID}`);for(const s of t){const t=s.querySelectorAll("div.follow_star:not([ts])");for(const s of t){var i;const t=null!==(i=s.dataset.slug)&&void 0!==i?i:"";this.updateFollowIcon(s,e.has(t))}}}updateFollowIcon(e,t){e.classList.remove("icon_update_following","icon_following","icon_not_following","no_hover"),t?(e.classList.add("icon_following"),e.title=h.R.unfollowText):(e.classList.add("icon_not_following"),e.title=h.R.followText)}defineFollowClick(e){e.classList.remove("icon_not_following"),e.classList.add("icon_update_following");const t=e.getAttribute("data-slug");if(null!==t){const i=(0,a.j4)(t,this.isAnonymous);void 0!==i&&i.then((t=>{t?this.onFollowClickSuccess(e):this.defineUnFollowClick(e)})).catch((()=>{}))}}onUnFollowRoomDefined(e){e.classList.remove("icon_update_following"),e.classList.add("icon_not_following","no_hover"),window.setTimeout((function(){e.classList.remove("no_hover")}),3e3),e.title=h.R.followText}onUnFollowRoomUnDefined(e){e.classList.remove("icon_update_following"),e.classList.add("icon_following")}defineUnFollowClick(e){e.classList.remove("icon_following"),e.classList.add("icon_update_following");const t=e.getAttribute("data-slug");null!==t&&(void 0!==(0,a.QH)(t,this.isAnonymous)?this.onUnFollowRoomDefined(e):this.onUnFollowRoomUnDefined(e))}setFollowUnfollowStar(e){e.classList.contains("icon_following")?this.defineUnFollowClick(e):e.classList.contains("icon_not_following")&&(this.isAnonymous?this.isMobile?(0,l.mf)("To follow this broadcaster, please create an account or login now.",(()=>{(0,r.DC)({fromFeature:!0})})):(0,r.DC)({fromFeature:!0}):this.defineFollowClick(e))}}},3062:(e,t,i)=>{"use strict";i.d(t,{a:()=>h,R:()=>c});var s=i(6784),n=i(5216),o=i(1519);function r(e){e.row.style.display="none"}function a(e,t,i,s){if(void 0!==e)if(t)!function(e,t,i){(0,n.Aw)(t.concat(`?username=${encodeURIComponent(i)}`)).then((t=>{const i=JSON.parse(t.responseText);!0===i.success?function(e,t){e.availableButton.innerText=t.usernames[0],e.availableButton.style.display="inline-block",function(e){e.available.appendChild(e.availableButton),e.available.style.display="block"}(e),e.row.style.display="table-row"}(e,i):r(e)})).catch((()=>{}))}(e,i,s);else{if(function(e){return"none"===e.row.style.display}(e))return;r(e)}}var l=i(7407);class h{constructor(e){this.form=e,this.checkpoints=[],this.submitting=!1,c(e,!1).hasValidationErrors()||this.saveCheckpoint(),(0,s.wu)("submit",e,(()=>{this.submitting=!0}))}saveCheckpoint(){this.checkpoints.push(this.serializeForm())}isDirty(){return 0===this.checkpoints.length||this.serializeForm()!==this.checkpoints[this.checkpoints.length-1]}isSubmit(){return this.submitting}warnOnClosingDirty(e){(0,s.wu)("beforeunload",window,(t=>{if(this.isDirty()&&!this.isSubmit())return t.preventDefault(),t.returnValue=!1,e}))}serializeForm(){return c(this.form,!1).serialize()}}function d(e){const t={name:"",errorName:"",elementType:"",isMultiSelect:!1,isCheckbox:!1,isHidden:!1,isDisabled:!1,grace:!0,isDateWidget:!1,isRecaptcha:!1,dateWidgetLabel:"",isRecaptchaSet:!1,htmlElement:e,init:function(){t.elementType=String(e.tagName.toLowerCase());const i=t.getName();t.name=null!==i?i:"",t.errorName=t.name,"captcha"===e.getAttribute("data-type")?(t.isRecaptcha=!0,function(e,t){const i=String(t.getAttribute("data-callback"));"null"!==i&&(window[i]=function(){e.isRecaptchaSet=!0,e.clearError()})}(t,e)):function(e){const t=String(e.getAttribute("id")).split("_"),i=t[t.length-1],s=["day","month","year"];let n=!1;if(s.indexOf(i)>-1){t.pop();const e=t.join("_");n=!0;for(const t of s){const i=`${e}_${t}`;null===document.querySelector(`#${i}`)&&(n=!1)}}return n}(e)&&(t.isDateWidget=!0,t.errorName=function(e){const t=String(e.getAttribute("id")).split("_");return t.shift(),t.pop(),t.join("_")}(e));const s=String(e.getAttribute("type"));"checkbox"===s?t.isCheckbox=!0:"hidden"===s?t.isHidden=!0:"select"===t.elementType&&"select-multiple"===e.type&&(t.isMultiSelect=!0),t.isDisabled=null!==e.getAttribute("disabled"),t.hasError()&&(t.grace=!1)},getName:function(){return"captcha"===e.getAttribute("data-type")?function(e){const t=String(e.getAttribute("id")).split("_");return t.shift(),t.join("_")}(e):e.getAttribute("name")},showSpinner:function(){if(t.isHidden||t.isRecaptcha)return;const e=document.querySelector(`#${t.errorName}_spinner`);null!==e&&e.classList.remove("formvalidate_hidden")},hideSpinner:function(){const e=document.querySelector(`#${t.errorName}_spinner`);null!==e&&e.classList.add("formvalidate_hidden")},getId:function(){return String(e.getAttribute("id"))},getSubmitValue:function(){const i=e;return t.isCheckbox?i.checked?null!==i.getAttribute("value")?i.getAttribute("value"):"on":"":i.value},change:function(){t.grace=!1},hasError:function(){if(t.isHidden)return!1;const e=document.querySelector(`.${t.errorName}_error`);return null!==e&&"none"!==e.style.display},showError:function(e,i){if(!t.isHidden&&(i&&(t.grace=!1),!t.grace)){document.querySelector(`.${t.errorName}_error .error_msg`).appendChild(document.createTextNode(e));const i=document.querySelector(`.${t.errorName}_error`);"tr"===String(i.tagName.toLowerCase())?i.style.display="table-row":i.style.display="block"}},clearError:function(){if(t.isHidden)return;const e=document.querySelector(`.${t.errorName}_error .error_msg`);for(;null!==e.firstChild;)e.removeChild(e.firstChild);document.querySelector(`.${t.errorName}_error`).style.display="none";const i=document.querySelector(`.${t.errorName}_label`);null!==i&&i.classList.remove("formvalidate_error")}};return t.init(),t}function c(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i="1"===e.getAttribute("data-formvalidate-disable-on-submit")?[...e.querySelectorAll("button:not([type=button]),input[type=submit]")]:[],r={fields:[],formElement:e,usernameAssist:{fields:void 0},isValid:!0,isSubmitting:!1,isValidating:!1,validateUrl:"",usernameAssistUrl:"",fieldsIndex:{},lastAllData:{},queueValidation:!1,isPreSubmitValidationComplete:!1,preSubmitValidationHandlers:[],template:"",errored_inputs:[],init:function(){var n;if(r.validateUrl=String(e.getAttribute("data-formvalidate")).substring(1),r.usernameAssistUrl=String(e.getAttribute("data-usernameAssist")).substring(1),r.template=null!==(n=e.getAttribute("data-template"))&&void 0!==n?n:"",t){(0,s.wu)("submit",e,(e=>{r.isSubmitting?e.preventDefault():(r.isSubmitting=!0,r.isValid&&!r.isValidating?r.preSubmitValidation(e):(r.isPreSubmitValidationComplete=!1,i.map((e=>e.disabled=!0)),r.validate(!0).then((()=>{r.isValid?r.preSubmitValidation(e):(r.isSubmitting=!1,i.map((e=>e.disabled=!1)))})).catch((()=>{r.isSubmitting=!1,i.map((e=>e.disabled=!1))})),e.preventDefault()))}));const t=Boolean(e.getAttribute("data-formvalidate-eagerness"))?Number(e.getAttribute("data-formvalidate-eagerness")):2;let n;"1"===e.getAttribute("data-formvalidate-debounce")&&(n=new o.a((()=>{r.validate()}),{bounceLimitMS:1e3,debounceType:2}));for(const i of e.querySelectorAll("input[type=text], input[type=checkbox], input[type=password], input[type=email], select")){const e=Boolean(i.getAttribute("data-formvalidate-eagerness"))?Number(i.getAttribute("data-formvalidate-eagerness")):t;e>=1&&(0,s.wu)("change",i,(e=>{const t=e.target;r.fields[r.fieldsIndex[String(t.getAttribute("id"))]].change(),r.validate()})),e>=2&&(0,s.wu)("input",i,(e=>{const t=e.target;r.fields[r.fieldsIndex[String(t.getAttribute("id"))]].change(),void 0!==n?n.callFunc():r.validate()}))}(()=>{if(r.template.indexOf("register")>-1)for(const t of e.querySelectorAll("input[type=submit], button[type=submit]"))(0,s.wu)("click",t,(e=>{!r.isValid&&r.errored_inputs.length>0&&r.template.indexOf("register")>-1&&(0,l.bT)("SignupFailed",{template:r.template,inputs:r.errored_inputs.toString()})}))})()}let a=0;for(const t of e.querySelectorAll("input[type=text], input[type=checkbox], input[type=hidden], input[type=password], input[type=email], select, .g-recaptcha")){const e=d(t);r.fields.push(e),r.fieldsIndex[e.getId()]=a,a+=1,r.lastAllData[e.name]=e.getSubmitValue()}!function(e){if(void 0===e.usernameAssistUrl)return;const t=e.fields.find((e=>"username"===e.name)),i=document.getElementById("username_assist_row"),s=document.getElementById("username_assist_available");var n;t&&i&&s&&(e.usernameAssist.fields={usernameField:t,row:i,available:s,availableButton:document.createElement("button")},(n=e.usernameAssist.fields.availableButton).style.display="none",n.style.cursor="pointer",n.style.background="transparent",n.style.border="none",n.style.padding="2px",n.style.color="#0a5a83",e.usernameAssist.fields.availableButton.type="button",e.usernameAssist.fields.availableButton.addEventListener("click",(t=>{var i;t.preventDefault(),void 0!==e.usernameAssist.fields&&(i=e.usernameAssist.fields.availableButton,void 0!==e.usernameAssist.fields&&(e.usernameAssist.fields.usernameField.htmlElement.value=i.innerText,e.validate(!1)))})))}(r)},serialize:function(){return r.fields.map((e=>{if(""!==e.name&&!e.isDisabled){if(e.isMultiSelect)return Array.from(e.htmlElement.options).filter((e=>e.selected)).map((t=>`${encodeURIComponent(e.name)}=${encodeURIComponent(t.value)}`)).join("&");if(!e.isCheckbox&&"radio"!==e.elementType||e.htmlElement.checked){const t=e.getSubmitValue();return`${encodeURIComponent(e.name)}=${encodeURIComponent(t)}`}}})).filter((e=>void 0!==e)).join("&").replace(/%20/g,"+")},validate:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(r.isValidating&&!e)return r.queueValidation=!0,Promise.resolve();r.isValidating=!0;const t={},i={};let s=!1,o=!1;for(const n of r.fields)i[n.name]=n.getSubmitValue(),n.isCheckbox&&""===n.getSubmitValue()||(t[n.name]=n.getSubmitValue()),(i[n.name]!==r.lastAllData[n.name]||e)&&("username"===n.name&&(o=!0),n.showSpinner(),s=!0);return s?(r.lastAllData=Object.assign({},i),(0,n.KF)(r.validateUrl,t).then((t=>{const s=JSON.parse(t.responseText);r.isValid=s.valid,r.errored_inputs=[];for(const t of r.fields)t.isRecaptcha&&!t.isRecaptchaSet?(t.clearError(),t.showError("Captcha has to be completed",e)):void 0!==s.errors[t.errorName]?(t.clearError(),t.showError(s.errors[t.errorName],e),r.errored_inputs.includes(t.errorName)||r.errored_inputs.push(t.errorName),"username"===t.name&&(""===i[t.name].trim()?a(r.usernameAssist.fields,!1,r.usernameAssistUrl,i[t.name]):o&&!1===t.grace&&a(r.usernameAssist.fields,!0,r.usernameAssistUrl,i[t.name]))):(t.clearError(),"username"===t.name&&a(r.usernameAssist.fields,!1,r.usernameAssistUrl,i[t.name])),t.hideSpinner();if(r.clearGlobalErrors(),void 0!==s.errors.__all__){for(const e of s.errors.__all__)r.addGlobalError(e);r.showGlobalErrors()}r.isValidating=!1,r.queueValidation&&(r.queueValidation=!1,r.validate())})).catch((e=>{if(info(`error: ${e}`),r.isValidating=!1,!r.queueValidation)throw e;r.queueValidation=!1,r.validate()}))):(r.isValidating=!1,r.queueValidation&&(r.queueValidation=!1,r.validate()),Promise.resolve())},preSubmitValidation:t=>(i.map((e=>e.disabled=!0)),r.isPreSubmitValidationComplete||0===r.preSubmitValidationHandlers.length?(window.setTimeout((()=>{i.map((e=>e.disabled=!1))}),700),Promise.resolve()):(t.preventDefault(),Promise.all(r.preSubmitValidationHandlers.map((e=>e()))).then((t=>{r.isSubmitting=!1,window.setTimeout((()=>{i.map((e=>e.disabled=!1))}),10),t.reduce(((e,t)=>e&&t),!0)&&(r.isPreSubmitValidationComplete=!0,(()=>{const t=document.createElement("button");t.style.display="none",e.appendChild(t),window.setTimeout((()=>{t.click(),e.removeChild(t)}),0)})())})).catch((t=>{throw error(`Can't complete preSubmitValidation in form ${e.action}`,t),r.isSubmitting=!1,i.map((e=>e.disabled=!1)),t})))),addGlobalError:function(e){const t=document.querySelector("#error_notice > .errorlist"),i=document.createElement("li");i.appendChild(document.createTextNode(e)),t.appendChild(i)},clearGlobalErrors:function(){const e=document.querySelector("#error_notice");if(null!==e){e.classList.add("formvalidate_hidden");const t=document.querySelector("#error_notice > .errorlist");if(null!==t)for(;null!==t.firstChild;)t.removeChild(t.firstChild)}},showGlobalErrors:function(){const e=document.querySelector("#error_notice");null!==e&&e.classList.remove("formvalidate_hidden")},hasValidationErrors:function(){let t=!1;for(const e of r.fields)t=t||e.hasError();const i=0!==Array.from(e.getElementsByClassName("errorlist")).filter((e=>""!==e.innerHTML.trim())).length;return t||i},addPreSubmitValidator(e){r.preSubmitValidationHandlers.push(e);let t=!1;return()=>{t||(r.preSubmitValidationHandlers.splice(r.preSubmitValidationHandlers.indexOf(e),1),t=!0)}}};return r.init(),r}},7269:(e,t,i)=>{"use strict";i.d(t,{n:()=>p});var s=i(3062),n=i(5216),o=i(7407),r=i(2945);const a=void 0!==window.performance&&void 0!==performance.now;class l extends Error{constructor(){super(...arguments),this.isValidationError=!0}}class h extends Error{constructor(){super(...arguments),this.isFormInvalidError=!0}}const d=(e,t)=>{const{formElement:i}=t,s=t.addPreSubmitValidator((()=>{if("function"!=typeof window.injectReCaptchaV3Token)return error("window.injectReCaptchaV3Token is not a function: ",typeof window.injectReCaptchaV3Token),Promise.resolve(!0);const n=a?performance.now():0;return window.injectReCaptchaV3Token(e).then((e=>{if(t.isValid)return u(e,i);throw new h})).then((e=>{if(""===e){const e=document.createElement("input");e.type="hidden",e.name="sign_recaptcha_failed",e.value="1",i.appendChild(e)}else{const t=document.createElement("input");t.type="hidden",t.name="signed_recaptcha",t.value=e,i.appendChild(t)}return(0,o.bT)("ReCAPTCHA3_frontend",{result:"success",timing_milliseconds:a?performance.now()-n:void 0}),!0})).catch((t=>!t.isFormInvalidError&&((0,o.bT)("ReCAPTCHA3_frontend",{result:JSON.stringify(t),timing_milliseconds:a?performance.now()-n:void 0}),c(e,i).then((e=>!e||(s(),!1))))))}))},c=(e,t)=>"function"!=typeof window.bindNoReCaptchaField?(error("window.bindNoReCaptchaField is not a function: ",typeof window.bindNoReCaptchaField),Promise.resolve(!1)):null===e.parentNode?(error("replaceWithNoReCaptcha: captcha element hasn't a parent"),Promise.resolve(!1)):(0,n.Aw)("accounts/ajax_norecaptcha_html/").then((i=>{const s=document.createElement("div");if(null===e.parentNode||"function"!=typeof window.bindNoReCaptchaField)return!1;e.parentNode.insertBefore(s,e),s.outerHTML=i.responseText;const o=t.querySelector(".g-recaptcha");if(null===o)return error("replaceWithNoReCaptcha: html doesn't contain norecaptcha"),!1;window.bindNoReCaptchaField(o);const a=document.createElement("a");a.href=(0,n._Y)(t.action);const l=(0,r.JO)(a.search);l["force-nocaptcha"]="1";const h="/"===a.pathname[0]?"":"/";return t.action=(0,n._Y)(`${h}${a.pathname}?${(0,r.Go)(l)}`),!0})),u=(e,t)=>{const i=t.querySelector("[data-formvalidate-sign-url]");if(null===i)return Promise.resolve("");const s=i.getAttribute("data-formvalidate-sign-url"),o=t.querySelector("[name=csrfmiddlewaretoken]");return"string"!=typeof s||null===o?Promise.resolve(""):(0,n.KF)(s,{recaptcha3:e,field_to_sign:i.value,csrfmiddlewaretoken:o.value}).then((e=>{const t=JSON.parse(e.responseText);if(!0!==t.valid)throw new l(t.errors);return t.signed_value})).catch((e=>{if(e.isValidationError)throw e;return error("Can't sign recaptcha: ",e),""}))};function p(){for(const e of document.querySelectorAll("form[data-formvalidate]")){const t=(0,s.R)(e),i=e.querySelector("[name='prove_you_are_human']");null!==i&&d(i,t)}}},1779:(e,t,i)=>{"use strict";i.d(t,{CK:()=>d,Eh:()=>u,Gy:()=>m,T1:()=>p,_c:()=>y,aS:()=>f,bR:()=>v,et:()=>b,lh:()=>c});var s=i(6784),n=i(8423);const o={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5},r=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror"],a=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror"],l=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError"];let h;"fullscreenEnabled"in document?h=Object.keys(o):r[0]in document?h=r:a[0]in document?h=a:l[0]in document&&(h=l);const d=500;function c(e){void 0!==h?e[h[o.requestFullscreen]]():"webkitEnterFullScreen"in e&&e.webkitEnterFullScreen()}function u(){void 0!==h&&document[h[o.exitFullscreen]].bind(document)()}function p(){return void 0!==h&&Boolean(document[h[o.fullscreenEnabled]])}function m(){if(void 0!==h)return document[h[o.fullscreenElement]]}function g(){return void 0===h?"":h[o.fullscreenchange]}function v(){return void 0===h?"":`${h[o.fullscreenerror]}`.toLowerCase()}function f(){return Boolean(m())}const y=new n.c_("fullscreenChange",{listenersWarningThreshold:()=>50+n.hI,maxHistorySize:0});function b(){""!==g()&&(0,s.wu)(g(),document,(()=>y.fire()))}},1675:(e,t,i)=>{"use strict";i.d(t,{Qx:()=>P,eB:()=>k,$m:()=>A});var s=i(9447),n=i(6784),o=i(2709),r=i(2032),a=i(1519),l=i(7668);class h extends o.u{constructor(e){super(),this.element.style.height="0",this.element.style.width="0",this.element.style.overflow="visible",this.element.style.position="fixed",this.element.style.top="0",this.element.style.left="0",this.componentToOverlay=e.componentToOverlay,this.listener=()=>{this.repositionChildrenRecursive()},this.componentToOverlay.didRepositionEvent.listen(this.listener),this.addChild(new c(this,e)),this.addChild(new u(this,e)),this.addChild(new p(this,e)),this.addChild(new m(this,e)),this.addChild(new g(this,e)),this.addChild(new v(this,e)),this.addChild(new f(this,e)),this.addChild(new y(this,e))}repositionChildren(){}prepareToRemove(){this.componentToOverlay.didRepositionEvent.removeListener(this.listener)}}class d extends o.u{constructor(e,t,i){super(),this.holder=e,this.options=t,this.cursor=i,this.thickness=8,this.element.style.height=`${this.thickness}px`,this.element.style.width=`${this.thickness}px`,this.element.style.cursor=this.cursor,(0,l.S)(this.element,((e,i,s)=>{e.stopPropagation(),void 0!==t.onStart&&t.onStart();const n=i,o=s,l=Object.freeze((0,r.w_)(t.componentToOverlay.element)),h=new a.a((()=>{t.componentToOverlay.repositionChildrenRecursive()}),{bounceLimitMS:10});return{enabled:!0,move:(e,i)=>{(0,r.ly)(this.moveEdges(l,{x:e-n,y:i-o}),t.componentToOverlay.element),h.callFunc()},end:()=>{void 0!==t.onStop&&t.onStop()}}}))}}class c extends d{constructor(e,t){super(e,t,"ns-resize")}repositionChildren(){const e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top=e.top-this.thickness/2+"px",this.element.style.left=`${e.left}px`,this.element.style.width=e.right-e.left+"px"}moveEdges(e,t){return(0,r.qX)(e,t.y,this.options.minHeight)}}class u extends d{constructor(e,t){super(e,t,"ns-resize")}repositionChildren(){const e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top=e.top+e.height-this.thickness/2+"px",this.element.style.left=`${e.left}px`,this.element.style.width=`${e.width}px`}moveEdges(e,t){return(0,r.GD)(e,t.y,this.options.minHeight,this.options.maxHeight())}}class p extends d{constructor(e,t){super(e,t,"ew-resize")}repositionChildren(){const e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top=`${e.top}px`,this.element.style.left=e.left-this.thickness/2+"px",this.element.style.height=e.bottom-e.top+"px"}moveEdges(e,t){return(0,r.U5)(e,t.x,this.options.minWidth)}}class m extends d{constructor(e,t){super(e,t,"ew-resize")}repositionChildren(){const e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top=`${e.top}px`,this.element.style.left=e.right-this.thickness/2+"px",this.element.style.height=e.bottom-e.top+"px"}moveEdges(e,t){return(0,r.xn)(e,t.x,this.options.minWidth,this.options.maxWidth())}}class g extends d{constructor(e,t){super(e,t,"nwse-resize")}repositionChildren(){const e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top=e.top-this.thickness+this.thickness/2+"px",this.element.style.left=e.left-this.thickness+this.thickness/2+"px"}moveEdges(e,t){const i=(0,r.qX)(e,t.y,this.options.minHeight),s=(0,r.U5)(e,t.x,this.options.minWidth);return{top:i.top,height:i.height,left:s.left,width:s.width}}}class v extends d{constructor(e,t){super(e,t,"nesw-resize")}repositionChildren(){const e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top=e.top-this.thickness+this.thickness/2+"px",this.element.style.left=e.right-this.thickness/2+"px"}moveEdges(e,t){const i=(0,r.qX)(e,t.y,this.options.minHeight),s=(0,r.xn)(e,t.x,this.options.minWidth,this.options.maxWidth());return{top:i.top,height:i.height,left:s.left,width:s.width}}}class f extends d{constructor(e,t){super(e,t,"nesw-resize")}repositionChildren(){const e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top=e.bottom-this.thickness/2+"px",this.element.style.left=e.left-this.thickness+this.thickness/2+"px"}moveEdges(e,t){const i=(0,r.GD)(e,t.y,this.options.minHeight,this.options.maxHeight()),s=(0,r.U5)(e,t.x,this.options.minWidth);return{top:i.top,height:i.height,left:s.left,width:s.width}}}class y extends d{constructor(e,t){super(e,t,"nwse-resize")}repositionChildren(){const e=this.options.componentToOverlay.element.getBoundingClientRect();this.element.style.top=e.bottom-this.thickness/2+"px",this.element.style.left=e.right-this.thickness/2+"px"}moveEdges(e,t){const i=(0,r.GD)(e,t.y,this.options.minHeight,this.options.maxHeight()),s=(0,r.xn)(e,t.x,this.options.minWidth,this.options.maxWidth());return{top:i.top,height:i.height,left:s.left,width:s.width}}}var b=i(8423),w=i(7407),C=i(7623),S=i(3955),x=i(8936);class T{constructor(e,t,i){this.draggableCanvasWindow=e,this.config=i,this.bounds={leftBound:NaN,topBound:NaN,bottomBound:NaN,rightBound:NaN,width:NaN,height:NaN},this.localStorageKey=`window__${t}`,this.bounds=this.getBoundsFromStorage(),isNaN(this.bounds.width)&&(this.bounds.width=this.config.defaultWidth),isNaN(this.bounds.height)&&(this.bounds.height=this.config.defaultHeight),this.setDefaultHorizontalBounds(),this.setDefaultVerticalBounds()}setDefaultVerticalBounds(){isNaN(this.bounds.topBound)&&isNaN(this.bounds.bottomBound)&&(this.config.defaultAnchors.indexOf(3)>=0?this.bounds.bottomBound=(0,S.XJ)():this.config.defaultAnchors.indexOf(4)>=0?this.bounds.topBound=Math.max(0,window.innerHeight/2-this.config.defaultHeight/2):this.bounds.topBound=0)}setDefaultHorizontalBounds(){isNaN(this.bounds.leftBound)&&isNaN(this.bounds.rightBound)&&(this.config.defaultAnchors.indexOf(1)>=0?this.bounds.rightBound=(0,S.XJ)():this.config.defaultAnchors.indexOf(4)>=0?this.bounds.leftBound=Math.max(0,(0,x.DK)()/2-this.config.defaultWidth/2):this.bounds.leftBound=0)}getBoundsFromStorage(){let e={leftBound:NaN,topBound:NaN,bottomBound:NaN,rightBound:NaN,width:NaN,height:NaN};if((0,C.Pf)()){const t=window.localStorage.getItem(this.localStorageKey);if(null!==t){e=JSON.parse(t);for(const t in e)null===e[t]&&(e[t]=NaN);isNaN(e.width)&&(e.width=this.config.defaultWidth),isNaN(e.height)&&(e.height=this.config.defaultHeight)}}return e}save(){this.detect(),(0,C.Pf)()&&window.localStorage.setItem(this.localStorageKey,JSON.stringify(this.bounds))}detect(){const e=this.draggableCanvasWindow.element.parentElement;if(null===e)return void error("no parent element");const t=this.draggableCanvasWindow.element.offsetLeft,i=this.draggableCanvasWindow.element.offsetTop,s=e.clientHeight-(this.draggableCanvasWindow.element.offsetHeight+i),n=e.clientWidth-(this.draggableCanvasWindow.element.offsetWidth+t);this.bounds.height=this.draggableCanvasWindow.element.offsetHeight,this.bounds.width=this.draggableCanvasWindow.element.offsetWidth,t<=n?(this.bounds.leftBound=t,this.bounds.rightBound=NaN):(this.bounds.leftBound=NaN,this.bounds.rightBound=n),i<=s?(this.bounds.topBound=i,this.bounds.bottomBound=NaN):(this.bounds.topBound=NaN,this.bounds.bottomBound=s)}apply(){const e=this.draggableCanvasWindow.element.parentElement;if(null===e)return void error("no parent element");if(0===e.clientHeight)return;void 0!==this.config.autoSize&&this.config.autoSize?(this.draggableCanvasWindow.innerDiv.style.position="relative",this.draggableCanvasWindow.element.style.width="auto",this.draggableCanvasWindow.element.style.height="auto",this.bounds.height=this.draggableCanvasWindow.element.offsetHeight,this.bounds.width=this.draggableCanvasWindow.element.offsetWidth):this.config.resizeable?((()=>{this.bounds.width=Math.min(this.bounds.width,e.clientWidth),this.bounds.height=Math.min(this.bounds.height,e.clientHeight),this.bounds.width=Math.max(this.bounds.width,this.config.minWidth),this.bounds.height=Math.max(this.bounds.height,this.config.minHeight)})(),this.draggableCanvasWindow.element.style.width=`${this.bounds.width}px`,this.draggableCanvasWindow.element.style.height=`${this.bounds.height}px`):(this.bounds.width=this.config.defaultWidth,this.bounds.height=this.config.defaultHeight+this.draggableCanvasWindow.getTitleBarHeight(),this.draggableCanvasWindow.element.style.width=`${this.bounds.width}px`,this.draggableCanvasWindow.element.style.height=`${this.bounds.height}px`),this.sanityCheckBounds()?info(`unexpected bounds: top:${this.bounds.topBound} bottom:${this.bounds.bottomBound} left:${this.bounds.leftBound} right: ${this.bounds.rightBound}`):(this.setVerticalPosition(e.clientHeight),this.setHorizontalPosition(e.clientWidth))}sanityCheckBounds(){const e=!isNaN(this.bounds.topBound)&&!isNaN(this.bounds.bottomBound)||isNaN(this.bounds.topBound)&&isNaN(this.bounds.bottomBound),t=!isNaN(this.bounds.leftBound)&&!isNaN(this.bounds.rightBound)||isNaN(this.bounds.leftBound)&&isNaN(this.bounds.rightBound);return e||t}setVerticalPosition(e){isNaN(this.bounds.topBound)?isNaN(this.bounds.bottomBound)||((this.bounds.bottomBound+this.bounds.height>e||this.bounds.bottomBound<0)&&(info("set bottomBound to container height - bounds height to make fit"),this.bounds.bottomBound=Math.max(0,e-this.bounds.height)),this.draggableCanvasWindow.element.style.top=e-this.bounds.height-this.bounds.bottomBound+"px"):((this.bounds.topBound+this.bounds.height>e||this.bounds.topBound<0)&&(info("set topBound to container height - bounds height to make fit"),this.bounds.topBound=Math.max(0,e-this.bounds.height)),this.draggableCanvasWindow.element.style.top=`${this.bounds.topBound}px`)}setHorizontalPosition(e){isNaN(this.bounds.leftBound)?isNaN(this.bounds.rightBound)||((this.bounds.rightBound+this.bounds.width>e||this.bounds.rightBound<0)&&(info("set rightBound to 0 to make fit"),this.bounds.rightBound=0),this.draggableCanvasWindow.element.style.left=e-this.bounds.width-this.bounds.rightBound+"px"):((this.bounds.leftBound+this.bounds.width>e||this.bounds.leftBound<0)&&(info("set leftBound to 0 to make fit"),this.bounds.leftBound=0),this.draggableCanvasWindow.element.style.left=`${this.bounds.leftBound}px`)}}const A=2;class P extends o.u{constructor(e,t,i){super(),this.draggableCanvas=e,this.content=t,this.config=i,this.isDraggingOrResizing=!1,this.draggingOrResizingChanged=new b.c_("draggingOrResizingChanged"),this.isOpen=!1,(0,s.fZ)(this.element,"draggableCanvasWindow"),this.element.style.overflow="visible",this.innerDiv=document.createElement("div"),(0,s.fZ)(this.innerDiv,"innerDiv"),this.innerDiv.style.height="100%",this.innerDiv.style.width="100%",this.innerDiv.style.position="absolute",this.innerDiv.style.overflow="visible",this.innerDiv.style.boxSizing="border-box",this.innerDiv.style.borderWidth=`${A}px`,this.innerDiv.style.borderStyle="solid",this.innerDiv.style.borderRadius="4px",this.closable=void 0!==i.title;const o=this.closeButton=document.createElement("div");(0,s.fZ)(this.closeButton,"closeButton"),this.closeButton.id=`${this.config.windowKey}-close-btn`.toLowerCase(),this.closeButton.dataset.paction="TheaterChat",this.closeButton.dataset.pactionName="ChatTab_Close",this.closeButton.style.position="absolute",this.closeButton.style.right="4px",this.closeButton.style.height="10px",this.closeButton.style.width="10px",this.closeButton.style.cursor="pointer",this.closeButton.style.borderWidth="1px",this.closeButton.style.borderStyle="solid",this.closeButton.style.borderRadius="2px",(0,n.wu)("mouseenter",this.closeButton,(()=>{o.style.backgroundImage=`url(${STATIC_URL}grey-close.svg)`,o.style.backgroundSize="10px"})),(0,n.wu)("mouseleave",this.closeButton,(()=>{o.style.backgroundImage=""})),void 0!==i.title?(this.titleBarDiv=document.createElement("div"),(0,s.fZ)(this.titleBarDiv,"titleBar"),this.titleBarDiv.style.position="relative",this.titleBarDiv.style.fontSize="13px",this.titleBarDiv.style.fontWeight="bold",this.titleBarDiv.style.padding="3px 3px 3px 5px",this.titleBarDiv.style.borderRadius="4px 4px 0 0",this.titleBarDiv.style.minHeight="10px",this.titleBarDivInner=document.createElement("div"),this.titleBarDivInner.style.height="100%",this.titleBarDivInner.style.whiteSpace="nowrap",this.titleBarDivInner.style.overflow="hidden",this.titleBarDivInner.style.textOverflow="ellipsis",this.titleBarDiv.appendChild(this.titleBarDivInner),this.titleSpan=document.createElement("span"),this.titleSpan.innerText=i.title,this.titleBarDivInner.appendChild(this.titleSpan),this.onClose=i.onClose,this.titleBarDiv.appendChild(this.closeButton),this.innerDiv.appendChild(this.titleBarDiv),(0,n.wu)("click",this.closeButton,(e=>{e.stopPropagation(),this.draggableCanvas.removeChild(this)}))):(this.closeButton.style.top="8px",this.closeButton.style.zIndex="1",this.element.appendChild(this.closeButton),(0,n.wu)("click",this.closeButton,(e=>{e.stopPropagation(),this.element.style.display="none",this.isOpen=!1}))),this.addChild(this.content,this.innerDiv),this.positioner=new T(this,this.config.windowKey,this.config),this.stopDraggingOrResizing=()=>{this.positioner.save(),this.repositionChildrenRecursive()},void 0===i.handles&&(i.handles=void 0!==this.titleBarDivInner?[this.titleBarDivInner]:[this.element]),k(this.element,{dragStart:()=>{this.focusThisWindow(),this.setDraggingOrResizing(!0)},dragStop:()=>{this.setDraggingOrResizing(!1),this.stopDraggingOrResizing(),(0,w.bT)("MoveDraggableWindow",{window:this.getWindowKey(),left:this.element.offsetLeft,top:this.element.offsetTop,windowWidth:window.innerWidth,windowHeight:window.innerHeight})},canStart:()=>!this.isDraggingOrResizing},i.handles),!0===i.resizeable&&this.makeResizeable(),this.element.appendChild(this.innerDiv)}focusThisWindow(){this.draggableCanvas.setFocusedWindow(this)}setTitle(e){void 0!==this.titleSpan&&(this.titleSpan.innerText=e)}makeResizeable(){void 0===this.resizeHandles&&(this.resizeHandles=this.addChild(new h({minWidth:this.config.minWidth,minHeight:this.config.minHeight,maxWidth:()=>this.draggableCanvas.element.clientWidth,maxHeight:()=>this.draggableCanvas.element.clientHeight,componentToOverlay:this,onStart:()=>{this.focusThisWindow(),this.setDraggingOrResizing(!0)},onStop:()=>{this.setDraggingOrResizing(!1),this.stopDraggingOrResizing(),(0,w.bT)("ResizeDraggableWindow",{window:this.getWindowKey(),width:this.element.clientWidth,height:this.element.clientHeight,windowWidth:window.innerWidth,windowHeight:window.innerHeight})}})),this.resizeHandles.repositionChildrenRecursive())}resize(e,t){this.config.defaultHeight=e,this.config.defaultWidth=t,this.repositionChildren()}setDraggingOrResizing(e){this.isDraggingOrResizing=e,this.draggingOrResizingChanged.fire(e)}removeResizeable(){void 0!==this.resizeHandles&&(this.resizeHandles.prepareToRemove(),this.removeChild(this.resizeHandles),this.resizeHandles=void 0)}repositionChildren(){void 0!==this.config.autoSize&&this.config.autoSize?this.content.element.style.height="auto":this.content.element.style.height=this.element.clientHeight-this.getTitleBarHeight()-2*A+"px",void 0!==this.titleBarDiv&&(void 0===this.closeButton?error("expected close button to be defined"):void 0===this.titleBarDivInner?error("expected title bar div inner to be defined"):(this.titleBarDivInner.style.maxWidth=this.titleBarDiv.clientWidth-this.closeButton.offsetWidth-5-8+"px",this.closeButton.style.top=(this.titleBarDiv.offsetHeight-this.closeButton.offsetHeight)/2+"px"))}getWindowKey(){return this.config.windowKey}getTitleBarHeight(){return void 0===this.titleBarDiv?0:this.titleBarDiv.offsetHeight}gainedFocus(){this.innerDiv.style.opacity="1",void 0!==this.config.onGainedFocus&&this.config.onGainedFocus()}lostFocus(){this.innerDiv.style.opacity=void 0!==this.config.blurOpacity?this.config.blurOpacity:"1",void 0!==this.config.onLostFocus&&this.config.onLostFocus()}blur(){this.draggableCanvas.focusedWindow===this&&this.draggableCanvas.setFocusedWindow(void 0)}handleKeyEvent(e){return void 0!==this.config.onKey&&this.config.onKey(e)}}function k(e,t,i){for(const s of i)s.style.cursor="move",(0,l.S)(s,((i,s,n)=>{if(void 0!==t.canStart&&!1===t.canStart())return l.P;const o=e.offsetLeft,r=e.offsetTop,a=e.offsetHeight,h=e.offsetWidth;if(null===e.parentElement)return error("draggable without parent element"),l.P;const d=e.parentElement.clientHeight,c=e.parentElement.clientWidth,u=s,p=n;let m=u,g=p;return void 0!==t.dragStart&&t.dragStart(),{enabled:!0,move:(t,i)=>{m=t,g=i,(()=>{let t=r+(g-p),i=o+(m-u);t<0?t=0:t+a>d&&(t=d-a),i<0?i=0:i+h>c&&(i=c-h),e.style.top=`${t}px`,e.style.left=`${i}px`})()},end:()=>{void 0!==t.dragStop&&t.dragStop()}}}))}},3654:(e,t,i)=>{"use strict";i.d(t,{CM:()=>D,Qp:()=>k,U$:()=>M,YC:()=>B,j7:()=>P,j8:()=>R,mh:()=>U,r_:()=>_,xm:()=>C});var s=i(7623),n=i(9447),o=i(9419),r=i(9461),a=i(5216),l=i(8122),h=i(2382),d=i(2939),c=i(6094),u=i(1284),p=i(7407),m=i(34),g=i(2359),v=i(7569),f=i(4947),y=i(9681),b=i(4140),w=i(6716);const C=2;let S,x;function T(e){const t=(0,h.lK)(e),i=new c.P(t.red,t.green,t.blue),s=i.brightness();return i.raiseToMin(255-s/3),`rgb(${i.red}, ${i.green}, ${i.blue})`}function A(e,t){return new y.L(e,t)}function P(e){const t=U(e.fromUser.username);t.style.fontSize="";const i=document.createElement("div");i.style.borderRadius="4px",i.style.padding=`0 ${C}px`,t.appendChild(i);const n=A(e.fromUser,e);n.element.style.paddingRight="4px",i.appendChild(n.element);const o=(0,g.e4)(e.message);return o.style.color=void 0!==e.textColor?e.textColor:"#FFFFFF",void 0!==e.font&&(n.element.style.fontFamily=e.font,o.style.fontFamily=e.font),o.classList.add("msg-text"),o.dataset.testid="chat-message-text",n.element.dataset.paction="TheaterChat",n.element.dataset.pactionName="Username",n.element.dataset.testid="chat-message-username",i.appendChild(o),(0,s.lT)()?window.setTimeout((()=>{twemoji.parse(i,{className:"emojiChat"})}),0):(0,s.AD)()||twemoji.parse(i,{className:"emojiChat"}),(0,l.hd)(i,e.textColor,e.backgroundColor),k(t),(0,u.V_)(e,t),t}function k(e){const t=e.querySelectorAll(".username-mention"),i=[],s=o.k.getInstance(),n=s.users();for(const e of t){const t=e.innerText.replace("@","").toLowerCase(),s=n.find((e=>e.username===t));if(void 0!==s){var a,l;const t=A(s).createMentionLabel((null===(a=r.Bm.current.loggedInUser)||void 0===a?void 0:a.username)===s.username);null===(l=e.parentElement)||void 0===l||l.replaceChild(t,e)}else i.push(t)}s.addInvalidUsers(i)}function M(e,t,i){for(const s of t){const t=document.createElement("div");for(const e of s)switch(e.partType){case 1:t.appendChild(F(e,i));break;case 0:t.appendChild(A(e.user,void 0).element);break;case 2:t.appendChild(L(e.message));break;case 3:t.appendChild(E(f.R.spyPrivateShowLower,(()=>{"privatespying"!==x.status&&(0,m.lh)(x)})));break;default:error(`Unknown roomNotice type: ${e.partType}`,e)}e.appendChild(t)}return e}function R(e){const t=U(e.fromUser.username);t.style.fontSize="";const i=document.createElement("div");i.style.borderRadius="4px",i.style.padding=`0 ${C}px`,t.appendChild(i);const s=A(e.fromUser,e);s.element.style.paddingRight="4px",i.appendChild(s.element);const n=document.createElement("div");n.classList.add("msg-text"),n.style.display="inline-block";const o=(0,g.BP)(e,I,w.f6);void 0!==e.font&&(s.element.style.fontFamily=e.font,o.style.fontFamily=e.font),n.appendChild(o);const r=document.createElement("div");return r.style.display="inline-block",r.appendChild(n),i.appendChild(r),(0,l.hd)(i,e.textColor,e.backgroundColor),k(t),(0,u.V_)(e,t),t}function I(e,t,i){const s=E(e,i);return void 0!==t&&""!==t&&(s.href=(0,a._Y)(t),s.target="_blank"),s}function E(e,t){const i=document.createElement("a");return(0,n.fZ)(i,"msg-link"),i.style.textDecoration="underline",i.innerText=e,i.onclick=t,i.style.cursor="pointer",i}function L(e){var t;const i=document.createElement("a");return i.href=(0,a._Y)(`/tag/${e}/${null!==(t=S)&&void 0!==t?t:""}`),(0,n.fZ)(i,"msg-link"),i.style.textDecoration="none",i.innerText=`#${e}`,i}function D(e){const t=U();return t.innerText=e,(0,b.yX)(t,T("#aaaaaa")),t}function B(e,t){function i(e){const t=document.createElement("span");return t.innerText=e,t}const s=U();(0,b.yX)(s,T("#aaaaaa"));const n=t?f.R.pmSupporterNoticeAgeVerified:f.R.pmSupporterNotice;s.appendChild(i(n)),s.appendChild(document.createElement("br")),s.appendChild(i(`${f.R.pmSupporterSignUp} `));const o=E(f.R.pmSupporterMembership,(()=>{}));return o.href=(0,a._Y)(`/supporter/upgrade/?source=${r.Bm.current.PurchaseEventSources.SUPPORTER_SOURCE_PM_UPSELL}`),o.target="_blank",o.dataset.testid="supporter-upsell-link",o.onclick=()=>{(0,p.bT)("SupporterPageOpened",{source:"chat"})},s.appendChild(o),s.appendChild(i(` ${f.R.pmSupporterSendPm(e)}.`)),s}function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=document.createElement("div");return t.dataset.testid="chat-message",t.style.fontFamily="Tahoma,Arial,Helvetica,sans-serif",t.style.boxSizing="border-box",t.style.paddingTop="3px",t.style.paddingBottom="3px",t.style.paddingLeft="5px",t.style.paddingRight="5px",t.style.overflowWrap="break-word",t.style.wordWrap="break-word",e.length>0&&t.setAttribute("data-nick",e),t}function F(e,t){let i=document.createElement("span");return void 0!==e.message&&t&&v.fM.isShortcodeSyntax(e.message)?i=(0,g.P7)(e,t,I,w.f6):!1!==e.parseEmoticon?i=(0,g.e4)(e.message):i.innerText=e.message,i.style.color=void 0!==e.foreground?e.foreground:"",i.style.background=void 0!==e.background?e.background:"",i.style.fontWeight=void 0!==e.weight?e.weight:"",i}function _(e,t){const i=U(e);return i.innerText=e,i.appendChild(t),(0,b.yX)(i,T("#aaaaaa")),i.classList.add("roomNotice"),i}d.X0.listen((e=>{S=e.dossier.roomGender,x=e.chatConnection}))},4140:(e,t,i)=>{"use strict";function s(e,t){e.setAttribute("data-pureChatColor",t),e.style.setProperty("--pureChatColor",t),e.classList.add("pureChatColor")}function n(e){const t=e=>{const t=e.getAttribute("data-pureChatColor");null!==t&&(e.style.color=t)};if(e.classList.contains("pureChatColor"))t(e);else for(const i of e.getElementsByClassName("pureChatColor"))i instanceof HTMLElement&&t(i)}i.d(t,{VN:()=>h,c6:()=>n,sW:()=>l,yX:()=>s});const o=20,r=new Map,a="pureHidden";function l(e){window.clearTimeout(r.get(e)),r.set(e,window.setTimeout((()=>{e.classList.add(a),r.delete(e)}),1e3*o))}function h(e){e.forEach((e=>{e.classList.remove(a),l(e)}))}},6716:(e,t,i)=>{"use strict";i.d(t,{F_:()=>h,Iw:()=>n,VZ:()=>a,eY:()=>l,f6:()=>r,gh:()=>c,p3:()=>o,sb:()=>u,y6:()=>d});var s=i(8423);const n=new s.c_("bioClicked"),o=new s.c_("userListRequest"),r=new s.c_("openTipCalloutRequest"),a=new s.c_("loadRoomRequest"),l=new s.c_("reportAbuseRequest"),h=new s.c_("privateWindowRequest"),d=new s.c_("chatWindowRequest"),c=new s.c_("colorModeChangeRequest"),u=new s.c_("roomChangeColorModeUpdateRequest")},7882:(e,t,i)=>{"use strict";i.d(t,{Bg:()=>s.Bg,CM:()=>s.CM,IL:()=>s.IL,P_:()=>s.P_,YT:()=>s.YT,hf:()=>s.hf,jM:()=>n,tg:()=>o});var s=i(1048);function n(e){const t=s.IL.get(e);return void 0!==t?t:"followed"===e?"o":(error(`Unknown user category ${e}`),"")}function o(e){switch(e){case s.YT.Female:return"female-cams";case s.YT.Male:return"male-cams";case s.YT.Couple:return"couple-cams";case s.YT.Trans:case s.YT.OldTrans:return"trans-cams";default:return""}}},5412:(e,t,i)=>{"use strict";i.d(t,{x:()=>n});const s={enter:13,esc:27,modifierKeys:{ctrl:17,shift:16,alt:18,leftMeta:91,rightMeta:93,caps:20,tab:9},arrowKeys:{left:37,up:38,right:39,down:40}};function n(e){if(void 0===e||e===s.enter||e===s.esc)return!1;for(const t in s.arrowKeys)if(e===s.arrowKeys[t])return!1;for(const t in s.modifierKeys)if(e===s.modifierKeys[t])return!1;return!0}},1191:(e,t,i)=>{"use strict";i.d(t,{t:()=>s});class s{constructor(){this.handlers=[]}addHandler(e){this.handlers.push(e)}execute(e){for(const t of this.handlers)if(!t.requiresCtrlOrMeta||e.ctrlKey||e.metaKey){if(void 0!==t.code&&e.code===t.code)return t.handle(e),!0;if(void 0!==t.key&&e.key===t.key)return t.handle(e),!0;if(e.which===t.keyCode&&(!t.requiresCtrlOrMeta||e.ctrlKey||e.metaKey))return t.handle(e),!0}return!1}}},9741:(e,t,i)=>{"use strict";i.d(t,{a:()=>a,o:()=>r});var s=i(9447),n=i(7322);function o(e,t){const i=document.createElement("div");i.innerText=t,i.style.overflow="hidden",i.style.maxHeight="21px",e.appendChild(i)}function r(e){return void 0===e?a():a({name:e.getString("name",!1),template:e.getString("template",!1),firstRowLabel:e.getStringWithNumbers("row1_label",!1),secondRowLabel:e.getStringWithNumbers("row2_label",!1),thirdRowLabel:e.getStringWithNumbers("row3_label",!1),firstRowValue:e.getStringWithNumbers("row1_value",!1),secondRowValue:e.getStringWithNumbers("row2_value",!1),thirdRowValue:e.getStringWithNumbers("row3_value",!1)})}function a(e){const t=document.createElement("tr"),i=document.createElement("tr"),r=document.createElement("tr");if(void 0!==e){const n=e.template,a=[],l=[];if(""!==e.firstRowLabel){const i=document.createElement("th");i.style.padding="2px",o(i,e.firstRowLabel),a.push(i),t.appendChild(i);const s=document.createElement("td");o(s,e.firstRowValue),t.appendChild(s),l.push(s),s.style.width="50%",s.style.paddingLeft="10px"}else{const i=document.createElement("td");o(i,e.firstRowValue),i.colSpan=2,l.push(i),t.appendChild(i),i.style.textAlign="center"}if(""!==e.secondRowLabel){const t=document.createElement("th");t.style.padding="2px",t.style.fontWeight="bold",o(t,e.secondRowLabel),a.push(t),i.appendChild(t);const s=document.createElement("td");o(s,e.secondRowValue),l.push(s),i.appendChild(s),s.style.width="50%",s.style.paddingLeft="10px"}else{const t=document.createElement("td");o(t,e.secondRowValue),t.colSpan=2,l.push(t),i.appendChild(t),t.style.textAlign="center"}if(""!==e.thirdRowLabel){const t=document.createElement("th");t.style.padding="2px",o(t,e.thirdRowLabel),a.push(t),r.appendChild(t);const i=document.createElement("td");o(i,e.thirdRowValue),l.push(i),r.appendChild(i),i.style.width="50%",i.style.paddingLeft="10px"}else{const t=document.createElement("td");o(t,e.thirdRowValue),t.colSpan=2,l.push(t),r.appendChild(t),t.style.textAlign="center"}for(const e of a)e.style.overflow="hidden",e.style.display="block",e.style.cssFloat="right";"3_rows_of_labels"===n?((0,s.fZ)(a[0],"threeRowsOfLabels"),a[0].style.display="block",a[0].style.margin="0px auto",a[0].style.height="16px",a[0].style.fontWeight="bold"):"3_rows_11_21_31"!==n&&"3_rows_11_22_32"!==n||((0,s.fZ)(l[0],"threeRows-11-21-31"),l[0].style.fontWeight="bold")}else{const e=document.createElement("td");t.appendChild(e.cloneNode()),i.appendChild(e.cloneNode()),r.appendChild(e.cloneNode())}(0,s.fZ)(t,"rowOne"),t.style.height="33.3333%",(0,s.fZ)(i,"rowTwo"),i.style.height="33.3333%",(0,s.fZ)(r,"rowThree"),r.style.height="33.3333%";const a=document.createElement("table");return a.id="AppPanelTable",a.style.fontSize="11px",a.style.lineHeight="1.7em",a.style.width=`${n.un}px`,a.style.height=`${n.zZ}px`,a.style.borderCollapse="collapse",a.style.margin="0 auto",a.style.tableLayout="fixed",a.appendChild(t),a.appendChild(i),a.appendChild(r),a}},819:(e,t,i)=>{"use strict";i.d(t,{ir:()=>f,nQ:()=>v,p$:()=>u,qK:()=>p});var s=i(7063),n=i(8861),o=i(213),r=i(5216),a=i(6440),l=i(4947);let h;const d=["total_viewers","image_url","password_warning"];let c=[];function u(e,t){clearTimeout(h),e.viewerIsAnonymous()&&function(e){const t=e.age();if(void 0!==t){const e=[];y.forEach(((i,s)=>{i[0]<=t&&i[1]>t&&e.push(s)}));let s={};try{var i;s=JSON.parse(null!==(i=(0,n.oD)("ag"))&&void 0!==i?i:"{}")}catch(e){}e.forEach((e=>{var t;s[e]=(null!==(t=s[e])&&void 0!==t?t:0)+1})),(0,n.uC)("ag",JSON.stringify(s),{days:30})}}(e);const i=m(e,t);h=window.setTimeout((()=>{g(i),u(e,t)}),55e3)}function p(e,t){g(m(e,t))}function m(e,t){let i=`contest/log/${e.room()}/`;if(""!==t){const e=new s.N6(t).getString("hashtag");i=`${i}?hashtag=${encodeURIComponent(e)}`}return i}function g(e){(0,r.Aw)(e).then((e=>{const t=new s.N6(e.responseText),i=t.getBoolean("can_access"),n=t.getBoolean("is_banned"),o=t.getList("warnings");for(const e of d)t.ignore(e);i||window.location.reload(),n&&(window.location.href=(0,r._Y)("/")),(0,a.f)("BroadcasterWarningModal")&&void 0!==o&&o.forEach((e=>{v({text:e.getString("text"),warningId:e.getNumber("id"),response:e.getBoolean("allow_response")})})),!(0,a.f)("BroadcasterWarningModal")&&t.getBoolean("has_warnings")&&(window.location.href=(0,r._Y)(`/accounts/site_message/?next=${window.location.href}`)),t.logUnusedDebugging("logPresence")})).catch((e=>{error("log_presence failed",e)}))}function v(e){e.response?window.location.href=(0,r._Y)(`/accounts/site_message/?next=${window.location.href}`):!1===c.includes(e.warningId)&&((0,o.mf)(e.text,(()=>{window.open((0,r._Y)(`/accounts/site_message/?next=${window.location.href}&question=true`),"_blank")}),(()=>{(0,r.KF)("/accounts/site_message/",{}).catch((e=>{error(`post error accessing site messages: ${e}`)})),c=c.filter((t=>t!==e.warningId))}),{acceptText:l.R.broadcasterWarningQuestion,declineText:l.R.broadcasterWarningAknowledge,title:l.R.broadcasterWarningMessage,titleSmall:!0},!0),c.push(e.warningId))}function f(){clearTimeout(h)}const y=new Map([["teen-cams",[18,20]],["18to21-cams",[18,22]],["20to30-cams",[20,31]],["30to50-cams",[30,51]],["mature-cams",[50,20]]])},6094:(e,t,i)=>{"use strict";i.d(t,{P:()=>s});class s{constructor(e,t,i){this.red=e,this.green=t,this.blue=i,this.redWeight=10,this.greenWeight=10,this.blueWeight=10}raiseToMin(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=.05;for(e=Math.min(255,e);e>this.brightness()&&(!t||255!==this.red&&255!==this.green&&255!==this.blue);)this.red=Math.min(this.red+Math.max(1,i*this.red),255),this.green=Math.min(this.green+Math.max(1,i*this.green),255),this.blue=Math.min(this.blue+Math.max(1,i*this.blue),255);this.red=Math.round(this.red),this.green=Math.round(this.green),this.blue=Math.round(this.blue)}totalWeights(){return this.redWeight+this.greenWeight+this.blueWeight}redMultiplier(){return this.redWeight/this.totalWeights()}greenMultiplier(){return this.greenWeight/this.totalWeights()}blueMultiplier(){return this.blueWeight/this.totalWeights()}brightness(){return Math.round(this.redMultiplier()*this.red+this.greenMultiplier()*this.green+this.blueMultiplier()*this.blue)}}},1284:(e,t,i)=>{"use strict";i.d(t,{LQ:()=>f,NZ:()=>b,Sy:()=>u,Uq:()=>g,V_:()=>y,W2:()=>m,mh:()=>p});var s=i(7871),n=i(9447),o=i(718),r=i(5216),a=i(2382),l=i(4140),h=i(6094),d=i(2091),c=i(4947);function u(){const e=document.createElement("div");return e.style.width="100%",e.style.display="inline-block",e.style.padding="0px",e.style.position="relative",e.style.boxSizing="border-box",e.style.borderRadius="4px",e.style.marginRight="4px",e}function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=document.createElement("div");return t.dataset.testid="chat-message",t.style.fontFamily="Tahoma,Arial,Helvetica,sans-serif",t.style.boxSizing="border-box",t.style.width="100%",t.style.paddingTop="3px",t.style.paddingBottom="3px",t.style.paddingLeft="5px",t.style.paddingRight="5px",t.style.overflowX="hidden",e.length>0&&t.setAttribute("data-nick",e),t}function m(e,t){return t.username===e?`${c.R.broadcaster} `:t.isMod?`${c.R.moderator} `:t.inFanclub?`${c.R.fanclubMember} `:`${c.R.user} `}function g(e){const t=(0,a.lK)(e),i=new h.P(t.red,t.green,t.blue),s=i.brightness();return i.raiseToMin(255-s/3),`rgb(${i.red}, ${i.green}, ${i.blue})`}function v(){const e=document.createElement("span");return e.innerText=", ",e}async function f(e,t,i,a){let h=p();(0,l.yX)(h,g("#aaaaaa"));const d=document.createElement("span");d.innerText=c.R.appsRunningMessage(e),h.appendChild(d);for(let e=0;e{t.style.textDecoration="underline"},t.onmouseleave=()=>{t.style.textDecoration="none"}),h.appendChild(t),e{(0,s.Ac)(e).then((e=>{const s=document.createElement("span");if(0===e.items.length)return void i(s);const a=document.createElement("span");s.appendChild(a);let l=0;for(const i of e.items){let a;l+=1,"mobile"===t?(a=document.createElement("div"),a.style.display="inline",a.style.position="relative",a.innerText=i.name):(a=document.createElement("a"),a.href=(0,r._Y)(`/v2apps?slot=${i.slot}&app_path=${(0,o.BK)(i)}`),a.target="_blank",a.innerText=i.name,(0,n.fZ)(a,"msg-link"),a.onmouseenter=()=>{a.style.textDecoration="underline"},a.onmouseleave=()=>{a.style.textDecoration="none"}),s.appendChild(a),l{a(e)}))}))}(t,a),""===u.innerText&&0===i.length)return Promise.resolve(document.createElement("div"));if(""===u.innerText)return Promise.resolve(h);i.length>0&&h.appendChild(v()),h.appendChild(u)}catch(e){0===i.length&&(h=document.createElement("div"))}return Promise.resolve(h)}function y(e,t){const i=e;void 0!==e.ts?t.dataset.ts=e.ts.toString():void 0!==i.createdAt&&(t.dataset.ts=i.createdAt.getTime().toString())}function b(e,t){const i=e.dataset.ts;if(void 0===i||""===i)return void t.appendChild(e);const s=t.children;let n=t.children.length;const o=s.length=o;e-=1){const t=s[e].getAttribute("data-ts");if(null!==t&&""!==t){if(Number.parseInt(t)<=Number.parseInt(i))break;n=e}}n>=t.children.length?t.appendChild(e):t.insertBefore(e,s[n])}},9135:(e,t,i)=>{"use strict";i.d(t,{H:()=>u,t:()=>c});var s=i(7623),n=i(6784),o=i(2709),r=i(8423),a=i(3124),l=i(4947),h=i(2945);const d=window.Accelerometer;class c extends o.u{constructor(){super(),this.element.style.textAlign="center",this.element.style.paddingTop="40px",this.element.style.backgroundColor="rgba(255, 255, 255, 0.5)",this.element.style.width="100%",this.element.style.height="100%";const e=this.element.appendChild(document.createElement("img"));if(e.src=`${STATIC_URL_MOBILE}rotate.svg`,e.style.width="500px",e.style.objectFit="contain",e.style.maxWidth="40%",e.style.maxHeight="40%",e.style.padding="15px",e.style.animationName="spin-default",e.style.animationDuration="2s",e.style.animationIterationCount="infinite",document.head.appendChild(document.createElement("style")).innerText="@keyframes spin-default { 0% { transform: rotate(0deg); } 100% { transform: rotate(180deg); } }",this.text=this.element.appendChild(document.createElement("div")),this.text.style.fontWeight="bold",this.text.style.fontSize="1.5em",this.text.style.padding="15px",(0,n.wu)("fullscreenchange",document,(e=>{this.onFullScreen()})),(0,s.OF)()||void 0===window.Accelerometer)this.update(),a.DQ.listen((()=>{this.update()}));else{this.image=e;const t=screen.orientation.type,i=new d({frequency:2});(0,n.wu)("reading",i,(()=>{this.updateAndroid(i.x,i.y,i.z,t)})),i.start()}u.listen((()=>{if((0,a.FW)()&&null===document.fullscreenElement)try{void 0!==document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen()}catch(e){warn(e)}}))}onFullScreen(){if(debug("On Full Screen"),(0,a.FW)()&&void 0!==screen.orientation){debug("Trying to lock landscape");try{screen.orientation.lock("landscape")}catch(e){warn(e)}}this.update()}update(){(0,a.FW)()&&(0,a.Y$)()||"true"===(0,h.JO)(window.location.search).ignorerotation||!(0,a.FW)()?this.element.style.display="none":(this.element.style.display="",(0,a.K$)()?this.text.innerText=l.R.incorrectPortrait:this.text.innerText=l.R.incorrectLandscape)}updateAndroid(e,t,i,s){null===document.fullscreenElement?(this.image.style.display="none",this.element.style.display="",this.text.innerText=l.R.missingFullscreen+l.R.androidBroadcast):("portrait-primary"===s||"portrait-secondary"===s)&&e<4.5&&(t>2||t<-2)||Math.abs(t)>6.5&&i<8.5?(this.image.style.display="",this.element.style.display="",this.text.innerText=l.R.incorrectPortrait):this.element.style.display="none"}}const u=new r.c_("tryFullScreen")},8227:(e,t,i)=>{"use strict";i.d(t,{b0:()=>M,bR:()=>k,hP:()=>R,iI:()=>I,uj:()=>P});var s=i(9447),n=i(9461),o=i(5216),r=i(6844),a=i(2939),l=i(2709),h=i(3955),d=i(8423),c=i(6440),u=i(7407),p=i(34),m=i(1452),g=i(5424),v=i(4947),f=i(1372),y=i(4580);const b={borderWidth:"1px",borderStyle:"solid",borderRadius:"4px",display:"flex",justifyContent:"center",alignItems:"center",marginBottom:"10px",padding:"0 12px",textAlign:"center",minHeight:"48px",boxSizing:"border-box",font:"inherit",width:"inherit"},w=e=>{var t;return(0,f.tT)("button",{style:{...b,...e.style},colorClass:void 0!==e.colorClass?["buttonBase",e.colorClass]:"buttonBase",onClick:e.onClick},null!==(t=e.body)&&void 0!==t?t:"")},C=e=>{var t;const i=(0,f.tT)("a",{style:{...b,...e.style},colorClass:void 0!==e.colorClass?["buttonBase",e.colorClass]:"buttonBase",onClick:e.onClick},null!==(t=e.body)&&void 0!==t?t:"");return void 0!==e.href&&(i.href=(0,o._Y)(e.href)),void 0!==e.target&&(i.target=e.target),i};class S extends l.u{constructor(e,t){super(e,t)}setButtonText(e){this.element.innerText=e}setButtonBody(e){this.removeAllDOMChildren(),this.element.appendChild((0,f.tT)(f.FK,null,e))}setOnClick(e){this.element.onclick=e}showElement(){super.showElement("flex")}}class x extends S{constructor(e){super("button",e)}initUI(e){this.element=(0,f.tT)(w,{style:null==e?void 0:e.style,colorClass:null==e?void 0:e.colorClass,body:null==e?void 0:e.body,onClick:null==e?void 0:e.onClick})}enable(){this.element.disabled=!1}disable(){this.element.disabled=!0}}class T extends S{constructor(e){super("a",e)}initUI(e){this.element=(0,f.tT)(C,{style:null==e?void 0:e.style,colorClass:null==e?void 0:e.colorClass,body:null==e?void 0:e.body,onClick:null==e?void 0:e.onClick,href:null==e?void 0:e.href,target:null==e?void 0:e.target})}}const A=new class{constructor(){this.privateShowButtons=[],this.fanclubButtons=[],this.supporterButtons=[];const e=new d.gt;a.X0.listen((t=>{t.chatConnection.event.statusChange.listen((()=>{this.updateContext(t)})).addTo(e),t.chatConnection.event.settingsUpdate.listen((()=>{this.updateContext(t)})).addTo(e)})),a.Gr.listen((()=>{e.removeAll()}))}addButton(e){e instanceof k?this.privateShowButtons.push(e):e instanceof P?this.fanclubButtons.push(e):e instanceof R&&this.supporterButtons.push(e),void 0!==this.context&&this.updateContext(this.context)}updateContext(e){this.context=e,this.fanclubButtons.forEach((t=>{t.updateState(e)})),this.supporterButtons.forEach((t=>{t.updateState(e)})),this.updatePrivateButtonsState()}updatePrivateButtonsState(){if(this.privateShowButtons.forEach((e=>{e.hideElement()})),void 0===this.context||!this.canShowPrivateButton())return;const e=()=>{this.privateShowButtons.forEach((e=>{void 0!==this.context&&e.updateState(this.context.chatConnection)}))},t={previousStatus:this.context.chatConnection.previousStatus,currentStatus:this.context.chatConnection.status};(0,g.fs)(this.context,t)?e():(0,g._b)(this.context,t).then(e).catch(m.yZ)}canShowPrivateButton(){if(void 0===this.context)return!1;const{allowPrivateShow:e,isAgeVerified:t}=n.Aw.getState(),i=["privatewatching","privatespying"].includes(this.context.chatConnection.status);return(e||i)&&t}};class P extends T{constructor(){super(),A.addButton(this)}initData(){this.hasFanclub=!1}initUI(){super.initUI(),(0,s.fZ)(this.element,"fanclubButton"),(0,h.ZM)(this.element,{flex:1}),this.hideElement()}updateState(e){if(n.Bm.current.isNoninteractiveUser)return;const{hasFanClub:t,isInFanClub:i}=n.Aw.getState();var s;this.hasFanclub=t,this.hasFanclub&&(this.element.href=(0,o._Y)(`/fanclub/join/${e.chatConnection.room()}/?source=${null===(s=n.Bm.current)||void 0===s?void 0:s.PurchaseEventSources.SUPPORTER_SOURCE_JOIN_FAN_CLUB_BUTTON}`)),this.hasFanclub?this.showElement():this.hideElement(),i?this.setButtonText(v.R.fanClubMember):this.setButtonText(v.R.joinFanClub)}getHasFanclub(){return this.hasFanclub}}class k extends x{constructor(e){super(e),A.addButton(this)}initData(e){this.useConciseText=!0===(null==e?void 0:e.useConciseText)}initUI(e){super.initUI(e),this.hideElement(),(0,s.fZ)(this.element,"privateShowButton")}updateState(e){this.showElement();const t=e.status;switch(t){case"privaterequesting":this.setCancelText(),this.setOnClick((()=>{this.leavePrivateOrSpy(e,t)}));break;case"privatenotwatching":if(n.Aw.getState().spyPrice<=0){this.hideElement();break}this.setSpyRequestText(),this.setOnClick((()=>{(0,u.bT)("SpyClicked"),this.requestSpy(e,t)}));break;case"privatewatching":case"privatespying":this.setLeaveText(),this.setOnClick((i=>{i.preventDefault(),this.leavePrivateOrSpy(e,t)}));break;case"offline":case"away":case"hidden":case"notconnected":case"hiddenwatching":this.hideElement();break;case"public":this.setPrivateRequestText(),this.setOnClick((()=>{(0,u.bT)("PrivateClicked"),this.requestPrivate(e)}));break;default:warn(`Unexpected status for updatePrivateState: ${t}`)}}requestPrivate(e){(0,p.UK)(e,!0,{onResolve:()=>{y.qb.fire("private")}})}requestSpy(e,t){(0,p.lh)(e,!0,{onResolve:()=>{y.qb.fire("chat")}})}leavePrivateOrSpy(e,t){(0,u.bT)("LeavePrivateOrSpyShow");const i=!(0,c.f)("PushEnblErlyCncl")||e.privateMinEnd{this.updateState(e)}))}setCancelText(){this.setButtonText(this.useConciseText?v.R.cancelRequest:v.R.privateShowCancelRequestLabel)}setSpyRequestText(){this.setButtonText(this.useConciseText?v.R.spyOnPrivate:v.R.privateShowSpyLabel)}setLeaveText(){this.setButtonText(this.useConciseText?v.R.leavePrivate:v.R.privateShowLeaveLabel)}setPrivateRequestText(){this.setButtonText(this.useConciseText?v.R.requestPrivate:v.R.privateShowRequestLabel)}}class M extends k{constructor(e){super({...e,style:{width:"120px",minWidth:"120px",height:"40px",marginBottom:"",minHeight:""}})}initData(e){super.initData(e)}updateState(e){this.enable(),super.updateState(e)}requestPrivate(e){(0,p.UK)(e,!1)}requestSpy(e){this.disable(),this.setConnectingText(),(0,p.lh)(e,!1,{onError:()=>{this.updateState(e)},onFinally:()=>{this.enable()}})}leavePrivateOrSpy(e){this.disable(),this.setEndingText();let t=e.inPrivateOrSpy();(0,c.f)("PushEnblErlyCncl")&&e.privateMinEnd>Date.now()&&(t=!1),(0,p.yx)(e,t,{onError:()=>{this.updateState(e)},onFinally:()=>{this.enable()}},(()=>{this.updateState(e)}))}setCancelText(){this.setButtonText(v.R.cancelText)}setSpyRequestText(){this.setButtonText(v.R.spyNow)}setLeaveText(){this.setButtonText(v.R.leave)}setPrivateRequestText(){this.setButtonText(v.R.request)}setConnectingText(){this.setButtonText(`${v.R.connecting}...`)}setEndingText(){this.setButtonText(`${v.R.ending}...`)}}class R extends T{constructor(){super(),A.addButton(this)}initUI(){this.element=(0,f.tT)(C,{style:{flex:1},colorClass:"upgradeButton",href:`/supporter/upgrade/?source=${n.Bm.current.PurchaseEventSources.SUPPORTER_SOURCE_MOBILE_TOKENS_TAB}`,target:"_blank",body:v.R.upgradeToSupporterLabel})}updateState(e){e.dossier.isSupporter?this.hideElement():this.showElement()}}class I extends x{constructor(e){super(e)}initUI(e){super.initUI();const t=(0,f.tT)("span",{style:{display:"flex",alignItems:"center"},"data-testid":"send-tip-button"},!0!==e.hideIcon&&(0,f.tT)("span",{style:{display:"inline-block",width:"20px",height:"20px",marginRight:"8px"},colorClass:"tipIcon"}),e.tipButtonText);this.element=(0,f.tT)(w,{style:{...e.style,marginBottom:0},colorClass:"sendTipButton",body:t,onClick:()=>{(0,u.bT)("TipWindowOpened"),(0,r.rC)(v.R.loginToTip)||y.f6.fire({})}})}}},3272:(e,t,i)=>{"use strict";i.d(t,{$h:()=>$,CC:()=>V,Z_:()=>z});var s=i(7623),n=i(9447),o=i(9510),r=i(9757),a=i(6428),l=i(7964),h=i(9461),d=i(442),c=i(6784),u=i(213),p=i(6844),m=i(1413),g=i(2939),v=i(6669),f=i(1519),y=i(2709),b=i(3955),w=i(481),C=i(8423),S=i(9060),x=i(1779),T=i(1284),A=i(7407),P=i(2146),k=i(7258),M=i(7569),R=i(2091),I=i(1448),E=i(74),L=i(4947),D=i(3860),B=i(8227),U=i(4926),F=i(7925),_=i(9818),N=i(9586),O=i(4580),H=i(8936),W=i(3124);const $=()=>64,V=1;class z extends y.u{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.outgoingHandlers=e,this.isPmChatContents=t,this.addMessageHTMLEvent=new C.c_("addMessageHtml",{reportIfNoListeners:!1}),this.addNoticeEvent=new C.c_("addNoticeEvent",{reportIfNoListeners:!1}),this.addPhotoMessageEvent=new C.c_("addPhotoMessageEvent",{reportIfNoListeners:!1}),this.removeMessagesForUserEvent=new C.c_("removeMessageHtml",{reportIfNoListeners:!1}),this.scrolledToBottom=new C.c_("scrolledToBottom"),this.messageList=function(){const e=document.createElement("div");return(0,n.fZ)(e,"msgList"),(0,P.PF)(e,"text"),e.dataset.testid="message-list",e.style.width="100%",e.style.cursor="text",e.style.paddingBottom="4px",e}(),this.noticeList=function(){const e=document.createElement("div");return(0,n.fZ)(e,"noticeList"),(0,P.PF)(e,"text"),e.style.width="100%",e.style.cursor="text",e.style.paddingBottom="4px",e}(),this.messageListWrapper=function(){const e=document.createElement("div");return e.dataset.testid="message-list-wrapper",e.style.width="100%",e.className="mobile-msg-list-wrapper",e.style.boxSizing="border-box",e.style.overflowX="hidden",(0,N.H)(e,!0),e}(),this.isWatchingPrivate=!1,this.inputFieldHasFocus=!1,this.messageCounter=0,this.listenerGroup=new C.gt,this.autocompleteModalCollection=[],this.toBottom=()=>{this.scrollToBottom()},(0,n.fZ)(this.element,"ChatContents"),(0,b.ZM)(this.element,{position:"unset",wordWrap:"break-word"}),this.messageListWrapper.appendChild(this.noticeList),this.messageListWrapper.appendChild(this.messageList),this.element.appendChild(this.messageListWrapper),(0,S.QC)()&&(this.newMessageNotice=(0,I.rc)(),D.L.changeVideoMode.listen((()=>{this.newMessageNotice.remove(),this.scrollToBottom()})),this.scrollDownButton=new d.w({scrollToBottom:()=>this.scrollToBottom(),bottomStyle:`${$()+4}px`}),this.addChild(this.scrollDownButton)),this.initInputUI(),this.initPrivateOverlay(),this.initEmoticonModal(),this.initUserMentionModal(),this.initShortcodeModal(),this.initCssClasses(),(0,c.wu)("submit",this.inputForm,(e=>{e.preventDefault(),this.customInputField.submit()})),(0,c.wu)("focus",this.customInputField.element,(e=>{this.inputFieldHasFocus=!0,O.Gt.fire(void 0),(0,_.Jo)()&&(this.inputDiv.style.bottom="50px",void 0!==this.userMentionAutocompleteModal&&(this.userMentionAutocompleteModal.element.style.bottom=$()+50-3+"px"))})),(0,c.wu)("blur",this.customInputField.element,(e=>{(0,s.H8)()&&(0,s.OF)()&&this.customInputField.element.blur(),this.autocompleteModalCollection.some((e=>e.isVisible()))&&e.cancelable?e.preventDefault():(this.inputFieldHasFocus=!1,O.P4.fire(void 0),(0,_.Jo)()&&(this.inputDiv.style.bottom="0",void 0!==this.userMentionAutocompleteModal&&(this.userMentionAutocompleteModal.element.style.bottom=$()-3+"px")))}));let i=!1,r=!1;const h=new f.a((()=>{i=!1}),{bounceLimitMS:50,debounceType:1});(0,c.wu)("scroll",this.messageListWrapper,(e=>{var t,s,n;i||(i=!0,r=this.isScrolledUp()),h.callFunc(),this.isScrolledUp()?null===(t=this.scrollDownButton)||void 0===t||t.showElement():(null===(s=this.scrollDownButton)||void 0===s||s.hideElement(),null===(n=this.scrollDownButton)||void 0===n||n.clearUnread()),!this.isScrolledUp()&&r&&(this.scrolledToBottom.fire(),r=!1)})),(0,c.wu)("keyup",this.element,(e=>{"Enter"===e.key&&this.customInputField.blur()})),m.V.listen((e=>{this.rulesModal=(0,l.oG)(this,e),void 0!==this.rulesModal&&this.addChild(this.rulesModal)})).addTo(this.listenerGroup),g.X0.once((e=>{this.currentRoomContext=e,this.messageListWrapper.style.fontSize=e.dossier.userChatSettings.fontSize,this.setLineHeight(),this.listenerGroup.add(a.$u.listen((()=>{(0,U.St)(this.messageList)})))}));const u=e=>{this.messageListWrapper.style.fontSize=e.fontSize,this.setLineHeight()};E.EZ.listen(u).addTo(this.listenerGroup),g.Gr.listen((()=>{E.EZ.removeListener(u),this.autocompleteModalCollection.forEach((e=>e.dispose()))})).addTo(this.listenerGroup),O.nD.listen((e=>{this.inputDiv.style.position=e?"absolute":"fixed",this.inputDiv.style.bottom="0"})).addTo(this.listenerGroup),o.xf.listen((()=>{this.updateInputButtonHighlight()})),o.TL.listen((e=>{this.sendButton.update({highlight:this.hasNonEmptyMessageDraft()})})).addTo(this.listenerGroup),F.GF.listen((e=>{let{isInputFocused:t,playerTop:i}=e;this.repositionChatOnInputFocus(t,i)})).addTo(this.listenerGroup)}hasNonEmptyMessageDraft(){return this.customInputField.getText().trim().length>0||this.hasMediaFiles()}initInputUI(){this.inputForm=function(){const e=document.createElement("form");return(0,b.ZM)(e,{height:"100%",display:"flex",alignItems:"center",boxSizing:"border-box",flex:1,overflow:"hidden",position:"relative"}),e}(),this.inputDiv=function(){const e=document.createElement("div");return(0,n.fZ)(e,"inputDiv"),(0,b.ZM)(e,{height:`${$()}px`,boxSizing:"border-box",position:"absolute",bottom:"0",cursor:"text",borderTopWidth:`${V}px`,borderTopStyle:"solid",zIndex:1,display:"flex",alignItems:"center",padding:"8px"}),e}();const e=this.isPmChatContents?R.mU:R.hk;this.customInputField=function(e,t){const i=new v.wi(e,t);return i.element.dataset.testid="chat-input",(0,b.ZM)(i,{boxSizing:"border-box",lineHeight:"24px",minHeight:"24px",fontSize:"16px",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",WebkitUserSelect:"text",height:""}),i}((()=>this.sendMessageFromInput()),e),this.inputPlaceholder=function(){const e=document.createElement("span");return(0,n.fZ)(e,"placeholder"),e.innerText=L.R.sendAMessage,(0,b.ZM)(e,{position:"absolute",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),e}(),this.sendButtonRoot=document.createElement("span");const t=r.c.get("SendButton");this.sendButton=new t({onClick:()=>{this.isUploadInProgress()||((0,A.bT)("MobileSendButtonClicked",{input:this.customInputField.getText()}),this.customInputField.submit(),this.customInputField.blur())},isPm:this.isPmChatContents,variant:"MobileSplitMode",hidden:!0,highlight:!1},this.sendButtonRoot),x._c.listen((()=>{this.inputForm.style.display="none",window.setTimeout((()=>this.showInputForm()),0)})).addTo(this.listenerGroup),this.constructInputUI()}createMediaDockButton(){const e=document.createElement("span");e.style.cursor="pointer",e.style.display="inline-block",e.style.height="26px",e.style.padding="0 10px 0 5px",e.dataset.paction="MobileChat",e.dataset.pactionName="UploadPhoto",e.dataset.testid="send-image-button";const t=document.createElement("img");return t.src=`${STATIC_URL_ROOT}tsdefaultassets/mediaDock/uploadBackground-lighter.svg`,t.style.width="100%",t.style.height="100%",e.appendChild(t),(0,s.OF)()?(e.onpointerdown=e=>{var t;e.preventDefault(),e.stopPropagation(),(null===(t=document)||void 0===t?void 0:t.activeElement)instanceof HTMLElement&&document.activeElement.blur()},e.onpointerup=()=>{this.onMediaDockButtonClick()}):e.onclick=()=>{this.onMediaDockButtonClick()},e}constructInputUI(){(0,n.fZ)(this.inputForm,"inputForm"),(0,b.ZM)(this.inputForm,{display:"flex",borderWidth:"1px",borderStyle:"solid",borderRadius:"4px",paddingLeft:"8px"}),this.inputControlsWrapper=function(){const e=document.createElement("div");return e.dataset.testid="buy-box",(0,b.ZM)(e,{display:"flex",alignItems:"center",marginLeft:"6px"}),e}(),(0,b.ZM)(this.inputControlsWrapper,{margin:0,height:"100%"}),this.actionButtonsContainer=document.createElement("div"),this.actionButtonsContainer.dataset.testid="action-buttons-container",(0,b.ZM)(this.actionButtonsContainer,{height:"100%"}),this.inputControlsWrapper.appendChild(this.actionButtonsContainer);const e=new B.iI({style:{padding:"0px 16px",fontSize:"14px",minHeight:"",height:"100%",marginRight:0,marginLeft:"8px"},tipButtonText:L.R.sendTipButtonText});this.actionButtonsContainer.appendChild(e.element),this.inputForm.appendChild(this.inputPlaceholder),this.inputForm.appendChild(this.customInputField.element),this.inputForm.appendChild(this.sendButtonRoot),this.isPmChatContents&&(0,S.yb)()&&(this.mediaDockButton=this.createMediaDockButton(),this.inputDiv.appendChild(this.mediaDockButton)),this.inputDiv.appendChild(this.inputForm),this.inputDiv.appendChild(this.inputControlsWrapper),this.element.appendChild(this.inputDiv),this.bindInputObserver(),this.sendButton.update({hidden:!1}),this.initToggleActionButtons()}onMediaDockButtonClick(){if((0,A.bT)("PMPhotoButtonClicked"),!(0,p.rC)()){var e;if(void 0!==this.rulesModal)return void this.rulesModal.show();null===(e=this.mobileMediaDock)||void 0===e||e.showSelectDialog(),this.scrollToBottom()}}initMediaDock(e){this.mobileMediaDock=e,this.addMediaDockToDOM()}addMediaDockToDOM(){void 0!==this.mobileMediaDock&&this.element.insertBefore(this.mobileMediaDock.element,this.inputDiv)}initShortcodeModal(){this.isPmChatContents||(this.shortcodeAutocompleteModal=new k.J(this.customInputField,this.isPmChatContents),this.inputDiv.appendChild(this.shortcodeAutocompleteModal.element),this.shortcodeAutocompleteModal.afterDOMConstructedIncludingChildren(),this.autocompleteModalCollection.push(this.shortcodeAutocompleteModal))}initEmoticonModal(){this.emoticonAutocompleteModal=new w.Q(this.customInputField),this.inputDiv.appendChild(this.emoticonAutocompleteModal.element),this.emoticonAutocompleteModal.afterDOMConstructedIncludingChildren(),this.autocompleteModalCollection.push(this.emoticonAutocompleteModal)}initUserMentionModal(){this.isPmChatContents||(this.userMentionAutocompleteModal=this.addChild(new a.jE({inputElement:this.customInputField,leftOffset:10,rightOffset:167,inputDivHeight:$()})))}initCssClasses(){this.isPmChatContents?(this.element.classList.add("MobileChatDivPm"),this.element.dataset.testid="pm-chat-base",this.customInputField.element.classList.add("mobileInputFieldPm"),this.emoticonAutocompleteModal.element.classList.add("mobileEmoticonAutocompleteModalPm")):(this.element.classList.add("MobileChatDivChat"),this.element.dataset.testid="chat-base",this.customInputField.element.classList.add("mobileInputFieldChat"),this.emoticonAutocompleteModal.element.classList.add("mobileEmoticonAutocompleteModalChat")),this.emoticonAutocompleteModal.element.dataset.testid="emoticon-autocomplete-modal"}toggleActionButtons(){this.inputFieldHasFocus?void 0!==this.actionButtonsContainer&&(this.actionButtonsContainer.style.display="none"):void 0!==this.actionButtonsContainer&&(this.actionButtonsContainer.style.display="flex")}initToggleActionButtons(){O.Gt.listen((()=>{this.toggleActionButtons()})).addTo(this.listenerGroup),O.P4.listen((()=>{window.setTimeout((()=>{this.toggleActionButtons()}),200)})).addTo(this.listenerGroup)}bindInputObserver(){new MutationObserver((e=>{e.forEach((()=>{this.updateInputButtonHighlight(),this.customInputField.getText().length>0?this.inputPlaceholder.style.display="none":this.inputPlaceholder.style.display="block"}))})).observe(this.customInputField.element,{characterData:!0,subtree:!0,childList:!0})}updateInputButtonHighlight(){const e=this.customInputField.getText();e.length>0?this.inputPlaceholder.style.display="none":this.inputPlaceholder.style.display="block";const t=(e.trim().length>0||this.hasMediaFiles())&&!this.isUploadInProgress();this.sendButton.update({highlight:t})}isUploadInProgress(){var e,t;return null!==(e=null===(t=this.mobileMediaDock)||void 0===t?void 0:t.isUploading())&&void 0!==e&&e}showInputForm(){this.inputForm.style.display="flex"}setLineHeight(){const e=Number(this.messageListWrapper.style.fontSize.slice(0,-2));this.messageListWrapper.style.lineHeight=`${e+7}pt`}shouldSendMessageFromInput(){return!((0,p.rC)('You must be logged in to send a message. Click "OK" to login.')||this.isWatchingPrivate&&!this.isPmChatContents&&((0,u.Q$)(`${L.R.privateShowChatActive} ${L.R.goToPrivateTabToChat}`),1))}sendMessageFromInput(){return!!this.shouldSendMessageFromInput()&&(this.scrollToBottom(),this.hasNonEmptyMessageDraft()&&this.processMessage(this.customInputField.getText()),!0)}initPrivateOverlay(){this.isPmChatContents||(this.privateOverlay=document.createElement("div"),(0,n.fZ)(this.privateOverlay,"privateOverlay"),(0,b.ZM)(this.privateOverlay,{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:2,display:"none",justifyContent:"center",alignItems:"center",textAlign:"center",padding:"15px",boxSizing:"border-box"}),this.element.appendChild(this.privateOverlay))}showPrivateOverlay(e,t){this.isPmChatContents||void 0===this.privateOverlay||(this.isWatchingPrivate=!0,this.privateOverlay.innerText=`${L.R.privateShowChatActive} ${""!==e?L.R.tapToChatWithUser(e):L.R.tapToChatWithBroadcaster}`,this.privateOverlay.onclick=t,this.privateOverlay.style.display="flex")}hidePrivateOverlay(){this.isPmChatContents||void 0===this.privateOverlay||(this.isWatchingPrivate=!1,this.privateOverlay.style.display="none")}shortcodeErrorMsg(e,t){return this.isPmChatContents?L.R.shortcodeNotSupportedInPMs:""!==h.Aw.getState().privateShowId?L.R.shortcodeNotSupportedInPrivates:0===e.shortcodes.length?M.fM.errorBehindShortcode(t):void 0}processMessage(e){const t=(0,M.PR)(e);switch(t.messageType){case M.gW.Shortcode:const i=t,s=this.shortcodeErrorMsg(i,e);void 0!==s?this.appendMessageDiv((0,U.CM)(s)):this.outgoingHandlers.onShortcode&&this.outgoingHandlers.onShortcode(i);break;case M.gW.ToggleDebugMode:this.outgoingHandlers.onToggleDebugMode();break;case M.gW.TipRequest:this.customInputField.clearText();const n=t;this.outgoingHandlers.onTipRequest(n.messageData);break;default:this.outgoingHandlers.onChatMessage(e)}}repositionChatOnInputFocus(e,t){const i=visualViewport;if(null===i)return;const s=this.messageListWrapper.scrollTop;if(e){if(void 0===t)return void error("playerTop cannot be undefined when input is focused.");const e=this.messageListWrapper.offsetHeight;this.messageListWrapper.style.position="fixed",this.messageListWrapper.style.top="",this.messageListWrapper.style.bottom=`${t}px`,this.messageListWrapper.style.height=i.height-t+"px",this.messageListWrapper.scrollTop=s+(e-this.messageListWrapper.offsetHeight)}else this.messageListWrapper.style.position="",this.messageListWrapper.style.top="",this.messageListWrapper.style.bottom=""}repositionChildren(){this.inputFieldHasFocus&&!(0,W.K$)()&&this.customInputField.blur(),this.inputDiv.style.width=`${(0,H.DK)()}px`,this.emoticonAutocompleteModal.element.style.bottom=this.inputDiv.offsetHeight-8+"px",void 0!==this.shortcodeAutocompleteModal&&(this.shortcodeAutocompleteModal.element.style.bottom=this.inputDiv.offsetHeight-8+"px"),this.isScrolledUp()||this.scrollToBottom()}isScrolledUp(){return this.messageListWrapper.scrollTop<=this.messageListWrapper.scrollHeight-(this.messageListWrapper.offsetHeight+20)}scrollToBottom(){this.isScrolledUp()&&this.scrolledToBottom.fire(),this.messageListWrapper.scrollTop=this.messageListWrapper.scrollHeight-this.messageListWrapper.offsetHeight-1}getScrollTop(){return this.messageListWrapper.scrollTop}setScrollTop(e){this.messageListWrapper.scrollTo({top:e})}cloneClickListeners(e,t){for(let i=0;i{this.addMessageHTMLEvent.fire({makeByCloning:()=>{const t=e.cloneNode(!0);return this.cloneClickListeners(e,t),t}})}))}appendNoticeMessage(e){this.appendMessage(e.element,(()=>{this.addNoticeEvent.fire(e.roomNoticeData)}))}appendPhotoMessage(e,t){this.appendMessage(e,(()=>{this.addPhotoMessageEvent.fire(t)}))}appendMessage(e,t){const i=this.isScrolledUp();var s;i?null===(s=this.scrollDownButton)||void 0===s||s.incUnread():e.querySelectorAll("img").forEach((e=>{const t=e.src;e.src="",e.onload=this.toBottom,e.src=t})),e.style.fontSize="",e.style.lineHeight="",this.maybeAppendNewMessageNotice(),(0,T.NZ)(e,this.messageList);let n=this.messageList.childElementCount-1e3;for(;n>0;n-=1){const e=this.messageList.firstElementChild;null!==e&&this.messageList.removeChild(e)}return i||this.scrollToBottom(),t(),this.messageCounter+=1,e}maybeAppendNewMessageNotice(){var e;(0,S.QC)()&&this.isScrolledUp()&&1===(null===(e=this.scrollDownButton)||void 0===e?void 0:e.getUnreadCount())&&((0,b.Mo)(this.newMessageNotice,this.messageListWrapper)||(0,T.NZ)(this.newMessageNotice,this.messageList))}removeMessageDiv(e){this.messageList.removeChild(e)}getLastMessageId(){return this.messageCounter}getEarliestMessageId(){return this.earliestMessageId}setEarliestMessageId(e){this.earliestMessageId=e}messagesSinceId(e){return this.messageCounter-e}hasMediaFiles(){return void 0!==this.mobileMediaDock&&!this.mobileMediaDock.isEmpty()}handleRemoveMessages(e){const t=[];for(const i of this.messageList.childNodes){const s=i;s.getAttribute("data-nick")===e&&t.push(s)}for(const e of t)this.messageList.removeChild(e);this.removeMessagesForUserEvent.fire(e)}clear(){for(this.messageCounter=0;null!==this.messageList.firstChild;)this.messageList.removeChild(this.messageList.firstChild)}dispose(){var e,t,i,s;this.emoticonAutocompleteModal.dispose(),this.listenerGroup.removeAll(),this.customInputField.dispose(),null===(e=this.rulesModal)||void 0===e||e.dispose(),null===(t=this.userMentionAutocompleteModal)||void 0===t||t.dispose(),null===(i=this.mobileMediaDock)||void 0===i||i.dispose(),null===(s=this.shortcodeAutocompleteModal)||void 0===s||s.dispose()}}},9739:(e,t,i)=>{"use strict";i.d(t,{W:()=>f});var s=i(7623),n=i(9461),o=i(213),r=i(2709),a=i(8423),l=i(7463),h=i(90),d=i(4947),c=i(1372),u=i(9447),p=i(1224),m=i(634),g=i(6784);class v extends m.x4{lazyInitUI(){(0,u.fZ)(this.element,"notificationsModal"),this.element.style.width="",this.element.style.height="",this.overlay.style.opacity="0.5",this.overlay.style.background="#000000";const e=function(){const e=document.createElement("div");return e.style.position="relative",e.style.height="",e.style.width="264px",e.style.backgroundColor="#e0e0e0",e.style.padding="6px 12px",e.style.borderRadius="3px",e.style.marginLeft="0px",e.style.marginTop="11px",e.style.fontSize="12.012px",e.style.color=p.m.defaultColor,e.style.overflow="",e.style.lineHeight="16.8px",e}(),t=(0,m.zG)(),i=(0,m.tj)(),s=(0,m.xT)((()=>{this.onConfirmClick(),this.close()})),n=(0,m.HY)((()=>{this.onDenyClick(),this.close()}));e.appendChild(t),e.appendChild(i),e.appendChild(s),e.appendChild(n),this.element.appendChild(e);const o=()=>{this.resize()};(0,g.wu)("resize",window,o),this.closed.once((()=>{try{(0,g.Pf)("resize",window,o)}catch(e){debug("NotificationsModal resize listener was already removed")}})),super.lazyInitUI()}afterDOMConstructedIncludingChildren(){super.afterDOMConstructedIncludingChildren(),this.resize()}resize(){this.element.style.left=`${Math.max(0,(window.innerWidth-this.element.offsetWidth)/2)}px`,this.element.style.top=`${Math.max(0,(window.innerHeight-this.element.offsetHeight)/2)}px`}}class f extends r.u{constructor(){super()}initData(){this.followStateChanged=new a.c_("followStateChanged"),this.isFollowingUpdate=new h.P(!1,((e,t)=>this.setIsFollowing(e,t)),(()=>{const e=this.isFollowing?d.R.errorUnfollowingUser(this.roomName):d.R.errorFollowingUser(this.roomName);(0,o.Q$)(e)}))}initUI(){this.followButton=(0,c.tT)(y,{onClick:()=>{this.handleFollowAndUnfollow()}}),this.unfollowButton=(0,c.tT)(b,{onClick:()=>{this.onUnfollowClick()}}),this.element=(0,c.tT)("div",{colorClass:"FollowButton",style:{cssFloat:"left"}},this.followButton,this.unfollowButton),l.im.listen((e=>{e.roomName===this.roomName&&this.updateContext(this.roomName,e.following)}))}onUnfollowClick(){(0,o.mf)(d.R.unfollowInfo,(()=>{this.handleFollowAndUnfollow()}),void 0,{title:`${d.R.unfollowText} ${this.roomName}?`,acceptText:`${d.R.yes}, ${d.R.unfollowLower}`,declineText:`${d.R.no}, ${d.R.cancelLower}`})}updateFollowButtonDisplay(e){this.followButton.style.display=this.isFollowing?"none":"flex",this.unfollowButton.style.display=this.isFollowing?"flex":"none",this.followStateChanged.fire({isFollowing:this.isFollowing,isPending:e})}updateContext(e,t){this.roomName=e,this.isFollowing=t,this.updateFollowButtonDisplay()}showBrowserNotification(){if(void 0!==n.Bm.current.loggedInUser){const e=window.isBrowserNotificationSupported,t=window.isSubscribedToBrowserNotifications;if(void 0!==e&&!0===e()&&void 0!==t&&(0,s.Pf)()){const e=new v;e.canRequestPermission()&&t(!1,(()=>{this.addChild(e,document.body),e.closed.once((()=>{this.removeChild(e)}))}))}}}handleFollowAndUnfollow(){const e=void 0===n.Bm.current.loggedInUser;this.isFollowing||this.showBrowserNotification();const t=(this.isFollowing?l.QH:l.j4)(this.roomName,e,"FollowButton");void 0!==t&&this.isFollowingUpdate.dispatch(!this.isFollowing,t)}setIsFollowing(e,t){this.isFollowing=e,this.updateFollowButtonDisplay(t)}}const y=e=>(0,c.tT)("div",{colorClass:"follow",style:{display:"none",borderWidth:"1px",borderStyle:"solid",boxSizing:"border-box",borderRadius:"4px",marginRight:"4px",padding:"0 8px",justifyContent:"center",alignItems:"center"},onClick:e.onClick},(0,c.tT)("span",{className:"icon_not_following no_hover",style:{position:"relative",padding:"2px 3px 1px 0px",marginLeft:"-6px",height:"29px",width:"29px",backgroundSize:"28px 28px",display:"inline-block",verticalAlign:"middle"}}),(0,c.tT)("span",{style:{display:"inline-block",verticalAlign:"middle"}},d.R.followText)),b=e=>(0,c.tT)("div",{colorClass:"unfollow",style:{display:"none",borderWidth:"1px",borderStyle:"solid",boxSizing:"border-box",borderRadius:"4px",marginRight:"4px",justifyContent:"center",alignItems:"center"},onClick:e.onClick},(0,c.tT)("span",{className:"icon_following no_hover",style:{position:"relative",padding:"2px 4px 1px 4px",height:"29px",width:"29px",backgroundSize:"28px 28px"}}))},5256:(e,t,i)=>{"use strict";i.d(t,{f:()=>s,z:()=>n});class s{constructor(e){this.individualConstraints={top:0,bottom:0,left:0,right:0,transitionTime:0},this.boundingConstraints={top:0,bottom:0,left:0,right:0,transitionTime:0},this.onUpdate=()=>{},this.onAttach=()=>{},this.ID=e}top(){return this.boundingConstraints.top}bottom(){return this.boundingConstraints.bottom}left(){return this.boundingConstraints.left}right(){return this.boundingConstraints.right}transitionTime(){return this.boundingConstraints.transitionTime}setConstraints(e){void 0===this.handler?this.onAttach=()=>{this.updateConstraints(e)}:this.updateConstraints(e),this.individualConstraints=e}updateConstraints(e){void 0!==this.handler&&this.handler.updateConstraints({ID:this.ID,...e})}setOnUpdate(e){this.onUpdate=e}getIndividualConstraints(){return this.individualConstraints}attach(e){this.handler=e,this.onAttach()}detach(){this.handler=void 0}update(e){this.boundingConstraints=e,this.onUpdate()}}class n{constructor(){this.constraintsMap=new Map,this.listeners=[]}addListener(e){this.listeners.push(e),e.attach(this),this.updateConstraints({ID:e.ID,...e.getIndividualConstraints()})}removeListener(e){const t=this.listeners.indexOf(e);t>=0&&(this.listeners.splice(t,1),this.constraintsMap.delete(e.ID),e.detach(),this.notifyListeners())}updateConstraints(e){this.constraintsMap.set(e.ID,e),this.notifyListeners()}calculateTotalConstraints(){const e={top:0,bottom:0,left:0,right:0,transitionTime:0};for(const t of this.constraintsMap.values())for(const i of Object.keys(e))e[i]+=t[i];return e}notifyListeners(){const e=this.calculateTotalConstraints();for(const t of this.listeners){const i=this.constraintsMap.get(t.ID);if(void 0===i){error("A LayoutConstraintHandler's listener does not exist in its constraints map");continue}const s={...e};for(const e of Object.keys(s))s[e]-=i[e];t.update(s)}}}},76:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(9757),n=i(1519),o=i(2709),r=i(3955),a=i(2146),l=i(4947),h=i(8936);class d extends o.u{constructor(e,t,i,o){if(super(),this.width=(0,h.$B)().width,this.transitionMS=300,this.visibilityDebouncer=new n.a((()=>{this.element.style.visibility="hidden"}),{bounceLimitMS:this.transitionMS,debounceType:1}),(0,r.ZM)(this.element,{backgroundColor:"#ffffff",top:"0",bottom:"0",zIndex:1,visibility:"visible",position:"relative"}),!0===i){(0,r.ZM)(this.element,{position:"absolute",visibility:"hidden",right:"-100%",width:"100%"});const e=document.createElement("div");new(s.c.get("MenuLabel"))({onClick:()=>{this.hide()},text:void 0!==o?o:l.R.backToRoomMenu,showChevron:!0,isBackLabel:!0},e),this.element.appendChild(e)}(0,a.Ve)(this.element,`right ${this.transitionMS}ms ease-in-out`),void 0!==t&&this.addChild(t)}show(){this.element.style.visibility="visible",this.element.style.right="0"}hide(){this.element.style.right="-100%","hidden"!==this.element.style.visibility&&this.visibilityDebouncer.callFunc()}}},4926:(e,t,i)=>{"use strict";i.d(t,{CM:()=>I,Fr:()=>b,St:()=>T,U$:()=>x,YC:()=>E,j7:()=>S,j8:()=>P,r_:()=>L});var s=i(7623),n=i(9447),o=i(9419),r=i(9461),a=i(5216),l=i(2939),h=i(4140),d=i(1284),c=i(7407),u=i(34),p=i(2359),m=i(8785),g=i(7569),v=i(4947),f=i(4580),y=i(2944);const b=2;let w,C;function S(e){const t=(0,d.mh)(e.fromUser.username),i=(0,d.Sy)();i.style.padding=`0px ${b}px`,void 0!==e.backgroundColor&&(i.style.background=e.backgroundColor),t.appendChild(i);const n=(0,y.t)(e.fromUser,e);n.dataset.testid="chat-message-username",n.style.paddingRight="4px",(0,h.yX)(n,(0,m.W1)(e.fromUser)),i.appendChild(n);const o=(0,p.e4)(e.message);o.dataset.testid="chat-message-text";const r=void 0!==e.textColor?e.textColor:"#000000";return o.style.color=r,void 0!==e.font&&(n.style.fontFamily=e.font,o.style.fontFamily=e.font),(0,h.yX)(o,(0,d.Uq)(r)),T(o),i.appendChild(o),(0,s.AD)()||twemoji.parse(t,{className:"emojiChat"}),(0,d.V_)(e,t),t}function x(e,t,i){for(const s of t){const t=document.createElement("div");for(const e of s)switch(e.partType){case 1:t.appendChild(A(e,i));break;case 0:t.appendChild((0,y.t)(e.user));break;case 2:t.appendChild(R(e.message));break;case 3:t.appendChild(M(v.R.spyPrivateShowLower,(()=>{"privatespying"!==C.status&&(0,u.lh)(C,void 0,{onResolve:()=>{f.qb.fire("private")}})})));break;default:error(`Unknown roomNotice type: ${e.partType}`,e)}e.appendChild(t)}return e}function T(e){const t=e.querySelectorAll(".username-mention"),i=[],s=o.k.getInstance(),a=s.users();for(const e of t){const t=e.innerText.replace("@","").toLowerCase(),s=a.find((e=>e.username===t));if(void 0!==s){var l,h;const t=(0,y.t)(s,void 0,!1,!0);(null===(l=r.Bm.current.loggedInUser)||void 0===l?void 0:l.username)===s.username&&(t.style.padding="2px 4px",t.style.borderRadius="4px",(0,n.fZ)(t,"mentionHl")),null===(h=e.parentElement)||void 0===h||h.replaceChild(t,e),t.insertAdjacentText("afterend"," ")}else i.push(t)}s.addInvalidUsers(i)}function A(e,t){if(void 0!==e.message&&t&&g.fM.isShortcodeSyntax(e.message))return(0,p.P7)(e,t,k,f.f6);if(!1!==e.parseEmoticon)return(0,p.e4)(e.message);const i=document.createElement("span");return i.innerText=e.message,i}function P(e){const t=(0,d.mh)(e.fromUser.username),i=(0,d.Sy)();i.style.padding=`0px ${b}px`,void 0!==e.backgroundColor&&(i.style.background=e.backgroundColor),t.appendChild(i);const s=(0,y.t)(e.fromUser,e);s.style.paddingRight="4px",(0,h.yX)(s,(0,m.W1)(e.fromUser)),i.appendChild(s);const n=(0,p.BP)(e,k,f.f6);return void 0!==e.font&&(s.style.fontFamily=e.font,n.style.fontFamily=e.font),n.style.textShadow="rgb(51, 51, 51) 0.2px 0.2px 0px",i.appendChild(n),T(n),(0,d.V_)(e,t),t}function k(e,t,i){const s=M(e,i);return s.dataset.messagetype="shortcode",void 0!==t&&""!==t&&(s.href=(0,a._Y)(t),s.target="_blank"),s}function M(e,t){const i=document.createElement("a");return i.style.color="#0a5a83",i.style.textDecoration="underline",i.innerText=e,i.onclick=t,i}function R(e){var t;const i=document.createElement("a");return i.href=(0,a._Y)(`/tag/${e}/${null!==(t=w)&&void 0!==t?t:""}`),(0,n.fZ)(i,"msg-link"),i.style.textDecoration="none",i.innerText=`#${e}`,i}function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=(0,d.mh)();return t&&(i.dataset.testid=t),i.innerText=e,i.style.color="#000000",(0,h.yX)(i,(0,d.Uq)("#aaaaaa")),i}function E(e,t){function i(e){const t=document.createElement("span");return t.innerText=e,t}const s=(0,d.mh)();(0,h.yX)(s,(0,d.Uq)("#aaaaaa"));const o=t?v.R.pmSupporterNoticeAgeVerified:v.R.pmSupporterNotice;s.appendChild(i(o)),s.appendChild(document.createElement("br")),s.appendChild(i(`${v.R.pmSupporterSignUp} `));const l=M(v.R.pmSupporterMembership,(()=>{}));return l.style.color="",(0,n.fZ)(l,"msg-link"),l.href=(0,a._Y)(`/supporter/upgrade/?source=${r.Bm.current.PurchaseEventSources.SUPPORTER_SOURCE_PM_UPSELL}`),l.target="_blank",l.onclick=()=>{(0,c.bT)("SupporterPageOpened",{source:"chat"})},s.appendChild(l),s.appendChild(i(` ${v.R.pmSupporterSendPm(e)}.`)),s}function L(e,t){const i=(0,d.mh)(e);return i.innerText=e,i.appendChild(t),i.style.color="#000000",(0,h.yX)(i,(0,d.Uq)("#aaaaaa")),i}l.X0.listen((e=>{w=e.dossier.roomGender,C=e.chatConnection}))},7925:(e,t,i)=>{"use strict";i.d(t,{BG:()=>d,Dd:()=>r,GF:()=>u,Ko:()=>o,Wr:()=>l,Ys:()=>a,lG:()=>n,q9:()=>h,r_:()=>c});var s=i(8423);const n=new s.c_("MobileVideoControls:tap"),o=new s.c_("MobilePureChat:tap"),r=new s.c_("MobilePureChat:drag"),a=new s.c_("MobilePureChat:dragEnd"),l=new s.c_("MobileFullscreenSendChat"),h=new s.c_("MobilePlayer:Resize"),d=new s.c_("MobilePlayer:changeSize"),c=new s.c_("mobilePMChatLinkFullscreenToggle"),u=new s.c_("repositionChatContentsOnInputFocus")},6471:(e,t,i)=>{"use strict";i.d(t,{E:()=>w});var s=i(7063),n=i(20),o=i(4364),r=i(9461),a=i(1224),l=i(6784),h=i(6844),d=i(2939),c=i(2709),u=i(3955),p=i(7407),m=i(3118),g=i(8785),v=i(4947),f=i(1372),y=i(4110),b=i(9586);class w extends c.u{constructor(e){super("div",e)}initData(e){this.openConversationEvent=e.openConversationEvent,this.room="",this.startedTimeUpdates=!1,this.onItemRemoved=e.onItemRemoved,this.isDropdown=e.isDropdown,this.searchBar=e.searchBar,(0,h.ok)()||(this.conversationListData=o.yT.getInstance())}initUI(e){(0,u.ZM)(this.element,{position:"relative",overflowX:"hidden",overflowY:"scroll"}),this.isDropdown?(this.emptyListMessage=(0,f.tT)(T,null),this.element.appendChild(this.emptyListMessage)):y.E3.listen((e=>{var t;const i=null===(t=this.conversationListData)||void 0===t?void 0:t.getConversation(e.username);void 0!==i&&this.updateList(i)})),d.X0.once((()=>{(0,b.H)(this.element)})),d.X0.listen((e=>{var t;this.room=e.chatConnection.room(),this.isDropdown?this.updateUserColors():(this.clearItems(),(null===(t=r.Bm.current.loggedInUser)||void 0===t?void 0:t.username)!==this.room&&this.addBroadcasterToTop())})),o.yT.conversationDataChanged.listen((()=>{(0,h.ok)()||void 0!==this.conversationListData||(this.conversationListData=o.yT.getInstance())})),o.yT.conversationItemAdded.listen((e=>{this.isDropdown&&""!==e.room||!this.isDropdown&&""===e.room||this.updateList(e)})),o.yT.conversationRead.listen((e=>{let{username:t,isDm:i}=e;i===this.isDropdown&&this.markItemRead(t)})),this.startTimeContainerUpdates(),void 0!==this.searchBar&&this.initSearchBarListeners(this.searchBar)}initSearchBarListeners(e){(0,l.wu)("touchstart",window,(t=>{const i=e.getInput();document.activeElement===i&&t.target!==i&&i.blur()})),this.openConversationEvent.listen((()=>{this.filterConversations("")})),e.events.inputChange.listen((e=>{e.isValid?this.filterConversations(e.prefix):this.clearItems()}))}filterConversations(e){if(void 0!==this.conversationListData){this.clearItems();const t=t=>0===e.length||t.otherUser.username.startsWith(e);(this.isDropdown?this.conversationListData.getDms():this.conversationListData.getPms()).filter(t).reverse().forEach((e=>{this.updateList(e)}))}}updateList(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];void 0!==this.emptyListMessage&&this.element.contains(this.emptyListMessage)&&this.element.removeChild(this.emptyListMessage);let i=this.findItem(e.otherUser.username);void 0!==i?(i.updateItem(e),o.cV.isHiding(e.otherUser.username)&&this.addChild(i)):(i=new C({conversationListItem:e,onClick:()=>{this.openConversationEvent.fire(e.otherUser.username)},onCloseButtonClick:()=>{this.removeItem(e.otherUser.username)},isDropdown:this.isDropdown}),this.addChild(i),(0,p.bT)("PmListItemAdded",{rendered_pm_count:this.getAllItems().length,other_user:e.otherUser.username})),o.cV.remove(e.otherUser.username),t&&this.moveToTop(i)}updateUserColors(){var e;this.isDropdown&&(null===(e=this.conversationListData)||void 0===e||e.getDms().forEach((e=>{const t=this.findItem(e.otherUser.username);void 0!==t&&t.updateColors(e.otherUser)})))}moveToTop(e){this.isDropdown?null!==this.element.firstChild?this.element.insertBefore(e.element,this.element.firstChild):this.element.appendChild(e.element):null!==this.element.firstChild&&null!==this.element.firstChild.nextSibling?this.element.insertBefore(e.element,this.element.firstChild.nextSibling):this.element.appendChild(e.element)}findItem(e){return this.getAllItems().find((t=>t.getItemInfo().otherUser.username===e))}markItemRead(e){const t=this.findItem(e);void 0!==t&&t.setReadStyle()}addBroadcasterToTop(){var e,t;const i=null!==(e=null===(t=this.conversationListData)||void 0===t?void 0:t.getConversation(this.room))&&void 0!==e?e:(0,n.bi)(this.room);let s=this.findItem(this.room);void 0===s&&(s=new C({conversationListItem:i,onClick:()=>{this.openConversationEvent.fire(this.room)},onCloseButtonClick:()=>{this.removeItem(i.otherUser.username)},isDropdown:this.isDropdown})),this.getAllItems().length>0?this.addChildBefore(s,this.getAllItems()[0]):this.addChild(s)}getAllItems(){return super.children()}getNumUnread(){return this.getAllItems().filter((e=>e.getItemInfo().numUnread>0)).length}removeItem(e){const t=this.findItem(e);void 0!==t&&this.element.contains(t.element)&&(this.removeChild(t),o.cV.hide(e),this.onItemRemoved(t.getItemInfo().otherUser.username),(0,p.bT)("PmListItemRemoved",{rendered_pm_count:this.getAllItems().length,other_user:e}))}clearItems(){this.removeAllChildren()}startTimeContainerUpdates(){this.startedTimeUpdates||(this.startedTimeUpdates=!0,window.setInterval((()=>{for(const e of this.getAllItems())e.setTimestamp()}),1e4))}}class C extends c.u{constructor(e){super("div",e)}initData(e){this.conversationListItem=e.conversationListItem}initUI(e){this.replyIcon=(0,f.tT)(S,null),this.closeButton=(0,f.tT)("img",{src:`${STATIC_URL_MOBILE}close.svg`,style:{width:"18px",height:"18px",display:"inline-block"},onClick:e.onCloseButtonClick}),this.avatarBubble=(0,f.tT)(x,{name:e.conversationListItem.otherUser.username,userColorClass:(0,g.Kb)(e.conversationListItem.otherUser)}),this.element=(0,f.tT)("div",{style:{width:"100%",height:"90px",boxSizing:"border-box",borderBottom:"1px solid #EFEFEF",padding:"20px",fontSize:"12px",display:"flex",alignItems:"center",fontFamily:"Tahoma, Arial, Helvetica, sans-serif"},ref:e=>this.containerElement=e,"data-testid":"conversation-list-item"},(0,f.tT)("div",{style:{display:"flex",flex:1,alignItems:"center"},onClick:e.onClick},this.avatarBubble,(0,f.tT)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%",height:"100%"}},(0,f.tT)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},(0,f.tT)("span",{style:{display:"block",fontWeight:"bold",marginBottom:"5px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,width:0,marginRight:"10px"},colorClass:(0,g.Kb)(e.conversationListItem.otherUser),ref:e=>{this.usernameLabel=e},"data-testid":"conversation-list-username"},e.conversationListItem.otherUser.username),(0,f.tT)("span",{style:{color:"#6C6C78"},ref:e=>{this.timestampElement=e},"data-testid":"message-timestamp"})),(0,f.tT)("span",{style:{display:"flex"}},this.replyIcon,(0,f.tT)("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:"1",width:"0px"},ref:e=>{this.msgElement=e},"data-testid":"message-preview"})))),!e.isDropdown&&(0,f.tT)("div",{style:{width:"18px",height:"18px",marginLeft:"20px"}},!e.conversationListItem.otherUser.isBroadcaster&&this.closeButton)),this.updateItem(e.conversationListItem)}updateItem(e){this.conversationListItem=e,this.setReplyIcon(),this.setMessage(),this.setTimestamp(),this.conversationListItem.numUnread>0?this.setUnreadStyle():this.setReadStyle()}updateColors(e){const t=(0,g.Kb)(e);this.usernameLabel.className=t,this.avatarBubble.firstChild instanceof HTMLElement&&(this.avatarBubble.firstChild.className=t)}getItemInfo(){return this.conversationListItem}setReplyIcon(){const e=this.isReply()&&!this.isEmptyMessage();this.replyIcon.style.display=e?"block":"none"}setMessage(){null!==this.msgElement.firstChild&&this.msgElement.removeChild(this.msgElement.firstChild),""!==this.conversationListItem.message?this.msgElement.appendChild(this.renderConversationEmoticons(this.conversationListItem.message)):this.conversationListItem.hasMedia&&this.msgElement.appendChild((0,f.tT)("span",null,v.R.imageAttached))}setTimestamp(){if(!this.isEmptyMessage()){const e=this.conversationListItem.time,t=void 0===e?"":(0,s.lI)(new Date(e));this.timestampElement.innerText=`${t}`}}renderConversationEmoticons(e){const t=new m.j(e),i=(0,f.tT)("span",null),s=t.stringParts()[0];i.innerText=s.split("\n")[0];for(let e=1;e(0,f.tT)("img",{src:`${STATIC_URL_MOBILE}reply-icon.svg`}),x=e=>(0,f.tT)("div",{colorClass:"avatarBubble",style:{position:"relative",...e.style}},(0,f.tT)("div",{colorClass:e.userColorClass,style:{width:"45px",height:"45px",borderRadius:"50%",textAlign:"center",color:"#FFF",display:"flex",justifyContent:"center",alignItems:"center",fontFamily:"UbuntuLight, Tahoma, Arial, Helvetica, sans-serif",fontSize:"20px",margin:"auto 10px auto auto",verticalAlign:"middle"}},e.name.charAt(0).toLocaleUpperCase())),T=()=>(0,f.tT)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",textAlign:"center",lineHeight:"20px",padding:"50px",boxSizing:"border-box",fontSize:"12px",fontFamily:"UbuntuRegular, Helvetica, Arial, sans-serif"}},(0,f.tT)("img",{src:`${STATIC_URL_MOBILE}empty-chat-state.svg`,style:{margin:"13px",width:"30px"},alt:"empty-chat-state"}),(0,f.tT)("span",{style:{fontFamily:"UbuntuBold, Arial, Helvetica, sans-serif",fontSize:"14px"}},v.R.sendDirectMessage),(0,f.tT)("span",null,v.R.conversationCautionMessage(a.m.siteName)))},8466:(e,t,i)=>{"use strict";i.d(t,{R:()=>P,X:()=>k});var s=i(9447),n=i(442),o=i(6784),r=i(2939),a=i(1519),l=i(2709),h=i(3955),d=i(8423),c=i(9060),u=i(1779),p=i(4140),m=i(1284),g=i(9898),v=i(2434),f=i(2146),y=i(1448),b=i(74),w=i(3860),C=i(5256),S=i(7925),x=i(9586),T=i(8936),A=i(3124);const P=new d.c_("mobilePureChatChange");class k extends l.u{constructor(e){super(),this.chatComponentToMirror=e,this.pendingTimeouts=[],this.isVisible=!1,this.desiredPortraitHeight=this.deviceLength()/4,this.desiredLandscapeWidth=this.deviceLength()/4,this.portraitHeight=this.deviceLength()/4,this.landscapeWidth=this.deviceLength()/4,this.areEphemeralsVisible=!1,this.backgroundDelay=0,this.heightDuration=0,this.widthDuration=0,this.layoutConstraints=new C.f(this.constructor.name),this.inputFocusOffset=0,(0,s.fZ)(this.element,"hasDarkBackground"),this.element.style.position="absolute",this.element.style.height="",this.element.style.fontSize="10px",this.element.style.textShadow="1px 0 1px #000, -1px 0 1px #000, 0 -1px 1px #000, 0 1px 1px #000",this.element.style.bottom="56px",this.element.style.overflow="visible",this.element.style.overflowWrap="break-word";const t=document.createElement("div");t.style.position="relative",t.style.overflow="hidden",t.style.height="100%",this.element.appendChild(t),this.innerDiv=document.createElement("div"),(0,x.H)(this.innerDiv,!0),this.innerDiv.style.position="",this.innerDiv.style.bottom="0",this.innerDiv.style["-webkit-text-size-adjust"]="none",this.innerDiv.style.overflowX="hidden",this.innerDiv.style.height="100%",t.appendChild(this.innerDiv),this.createResizeDragDiv(),this.element.appendChild(this.resizeDragDiv),(0,c.QC)()&&(this.newMessageNotice=(0,y.rc)(),w.L.changeVideoMode.listen((()=>{this.newMessageNotice.remove(),this.scrollToBottom()})),this.scrollDownButton=new n.w({scrollToBottom:()=>this.scrollToBottom(),bottomStyle:"4px"}),t.appendChild(this.scrollDownButton.element)),this.listenerGroup=new d.gt,this.initNoticeDeclutterer(),(0,o.wu)("scroll",this.innerDiv,(e=>{var t,i,s;this.isScrolledUp()?null===(t=this.scrollDownButton)||void 0===t||t.showElement():(null===(i=this.scrollDownButton)||void 0===i||i.hideElement(),null===(s=this.scrollDownButton)||void 0===s||s.clearUnread())})),e.addMessageHTMLEvent.listen((e=>{this.addMessage(e.makeByCloning())})).addTo(this.listenerGroup),e.addNoticeEvent.listen((e=>{this.addNotice(e)})).addTo(this.listenerGroup),e.addPhotoMessageEvent.listen((e=>{this.addRoomPhotoMessage(e)})).addTo(this.listenerGroup),e.removeMessagesForUserEvent.listen((e=>{this.handleRemoveMessages(e)})).addTo(this.listenerGroup),r.Gr.listen((()=>{this.clear(),this.roomNoticeDeclutterer.onRoomCleanup()})).addTo(this.listenerGroup),r.X0.listen((e=>{this.element.style.fontSize=e.dossier.userChatSettings.fontSize,this.setLineHeight()})).addTo(this.listenerGroup),b.EZ.listen((e=>{this.element.style.fontSize=e.fontSize,this.setLineHeight()})).addTo(this.listenerGroup);const i=new a.a((()=>{this.showMessages()}),{bounceLimitMS:7500,debounceType:2});let l,h,u;this.element.ontouchstart=e=>{i.callFunc()},this.innerDiv.ontouchstart=()=>{i.callFunc()},this.innerDiv.ontouchmove=()=>{i.callFunc()},this.innerDiv.onclick=e=>{this.toggleEphemeralsVisibility(),"shortcode"!==e.target.dataset.messagetype&&S.Ko.fire(this.areEphemeralsVisible)},this.resizeDragDiv.ontouchstart=e=>{1!==e.touches.length&&e.preventDefault(),u=this.areEphemeralsVisible,l=e.touches[0].clientX,h=e.touches[0].clientY,(0,A.K$)()?(this.heightDuration=0,this.updateTransitions()):(this.widthDuration=0,this.updateTransitions())},this.resizeDragDiv.ontouchmove=e=>{if(e.preventDefault(),e.touches.length<1||e.touches.length>2)return;const t=e.touches[0].clientX,s=e.touches[0].clientY;(0,A.K$)()?this.setPortraitHeight(this.portraitHeight+(h-s)):this.setLandscapeWidth(this.landscapeWidth+(l-t)),l=t,h=s,i.callFunc(),this.showEphemerals(),S.Dd.fire(void 0)},this.resizeDragDiv.ontouchend=e=>{e.touches.length>0||(u||this.hideEphemerals(160),S.Ys.fire(void 0))},this.resizeDragDiv.onclick=()=>{this.toggleEphemeralsVisibility(),S.Ko.fire(this.areEphemeralsVisible)},S.lG.listen((()=>{this.areEphemeralsVisible&&this.toggleEphemeralsVisibility()})).addTo(this.listenerGroup),S.Wr.listen((()=>{this.isChatHidden()&&this.unhideChat(),this.scrollToBottom()})).addTo(this.listenerGroup),this.layoutConstraints.setOnUpdate((()=>{this.repositionChildren()})),A.DQ.listen((()=>{this.backgroundDelay=0,this.heightDuration=0,this.widthDuration=0,this.updateTransitions()})).addTo(this.listenerGroup),this.element.style.display="none",this.repositionChildren()}initNoticeDeclutterer(){this.roomNoticeDeclutterer=new v.z({appendNotice:e=>this.addMessage(e.element),appendSentinelDiv:e=>this.element.appendChild(e)})}dispose(){this.listenerGroup.removeAll(),this.roomNoticeDeclutterer.dispose()}clear(){for(const e of this.pendingTimeouts)clearTimeout(e);for(this.pendingTimeouts=[];null!==this.innerDiv.firstChild;)this.innerDiv.removeChild(this.innerDiv.firstChild)}setLineHeight(){this.innerDiv.style.lineHeight=`${Number(this.element.style.fontSize.slice(0,-2))+7}pt`}addTimeout(e,t){const i=window.setTimeout((()=>{const t=this.pendingTimeouts.indexOf(i);t>=0&&this.pendingTimeouts.splice(t,1),e()}),t);this.pendingTimeouts.push(i)}showBackground(){this.backgroundDelay=0,this.updateTransitions(),this.element.style.background="rgba(255, 255, 255, 0.25)"}hideBackground(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.backgroundDelay=e,this.updateTransitions(),this.element.style.background="transparent"}addMessage(e){(0,p.c6)(e);const t=e.querySelector("a");null!==t&&t.classList.contains("mobileChatLink")&&(0,o.wu)("click",t,(()=>{S.r_.fire(void 0)})),e.style.fontSize="",e.style.lineHeight="",e.style.display="inline-block",e.style.verticalAlign="bottom",e.style.overflowWrap="break-word";const i=!this.isScrolledUp();var s;i||null===(s=this.scrollDownButton)||void 0===s||s.incUnread(),this.maybeAppendNewMessageNotice(),(0,m.NZ)(e,this.innerDiv),this.addTimeout((()=>{this.hideMessage(e)}),15e3),i&&this.scrollToBottom()}maybeAppendNewMessageNotice(){var e;(0,c.QC)()&&this.isScrolledUp()&&1===(null===(e=this.scrollDownButton)||void 0===e?void 0:e.getUnreadCount())&&((0,h.Mo)(this.newMessageNotice,this.innerDiv)||((0,m.NZ)(this.newMessageNotice,this.innerDiv),this.addTimeout((()=>{this.hideMessage(this.newMessageNotice)}),15e3)))}addRoomPhotoMessage(e){const t=(0,y.bB)(e);void 0!==t&&this.addMessage(t)}addNotice(e){const t=new g._y({roomNoticeData:e,isChatScrolledToBottom:()=>!this.isScrolledUp(),scrollChatToBottom:()=>this.scrollToBottom(),getChatScrollTop:()=>this.getScrollTop(),setChatScrollTop:e=>this.setScrollTop(e)});this.roomNoticeDeclutterer.addRoomNotice(t)}isScrolledUp(){return this.innerDiv.scrollTop<=this.innerDiv.scrollHeight-(this.innerDiv.offsetHeight+20)}scrollToBottom(){this.innerDiv.scrollTop=this.innerDiv.scrollHeight-this.innerDiv.offsetHeight-1}getScrollTop(){return this.innerDiv.scrollTop}setScrollTop(e){this.innerDiv.scrollTo({top:e})}showMessages(){for(const e of this.pendingTimeouts)clearTimeout(e);for(const e of this.innerDiv.children){const t=e;(0,f.Ve)(t,"opacity 400ms"),t.style.opacity="1",this.addTimeout((()=>{this.hideMessage(t)}),15e3)}}hideMessage(e){this.isScrolledUp()?this.addTimeout((()=>{this.hideMessage(e)}),15e3):((0,f.Ve)(e,"opacity 1000ms"),e.style.opacity="0")}setVisible(e){if(this.isVisible===e)return;this.isVisible=e,this.heightDuration=0,this.widthDuration=0,this.updateTransitions(),window.setTimeout((()=>{this.scrollToBottom()}),Math.max(this.heightDuration,this.widthDuration)+100);const t={top:0,bottom:0,left:0,right:0,transitionTime:0};this.isVisible&&(this.showEphemerals(),this.showMessages(),t.bottom=this.calculateTotalChatHeight(),t.right=this.calculateTotalChatWidth()),this.layoutConstraints.setConstraints(t),P.fire(e)}calculateTotalChatHeight(){return Math.round(this.portraitHeight+56+30+4)}calculateTotalChatWidth(){return Math.round(this.landscapeWidth+20)}deviceLength(){return(0,A.K$)()?(0,T.mJ)():(0,T.DK)()}setPortraitHeight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.desiredPortraitHeight=e;const i=!this.isScrolledUp(),s=this.portraitHeight,n=this.deviceLength()-56-30-4-Math.max(30,this.layoutConstraints.top());e=Math.min(e,n),e=Math.max(e,0),e=Math.round(e),this.portraitHeight=e,(0,u.aS)()?this.element.style.height=`min(calc(var(--vh, 1vh) * 100 - 136px), ${this.portraitHeight}px)`:this.element.style.height=`${this.portraitHeight}px`,0===e?this.hideCloseChatDiv():this.showCloseChatDiv(),e!==s&&(i||0===s?this.scrollToBottom():this.innerDiv.scrollTop+=s-e,this.layoutConstraints.setConstraints({top:0,bottom:this.isVisible?this.calculateTotalChatHeight():0,left:0,right:this.isVisible?this.calculateTotalChatWidth():0,transitionTime:t}))}setLandscapeWidth(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.desiredLandscapeWidth=e;const i=!this.isScrolledUp(),s=this.landscapeWidth,n=this.deviceLength()-30-20-Math.max(50,this.layoutConstraints.left());e=Math.min(e,n),e=Math.max(e,0),e=Math.round(e),this.landscapeWidth=e,this.element.style.width=`${this.landscapeWidth}px`,0===e?this.hideCloseChatDiv():window.innerHeight<150?(this.hideCloseChatDiv(),window.innerHeight<75&&this.hideEphemerals()):this.showCloseChatDiv(),e!==s&&((i||0===s)&&this.scrollToBottom(),this.layoutConstraints.setConstraints({top:0,bottom:this.isVisible?this.calculateTotalChatHeight():0,left:0,right:this.isVisible?this.calculateTotalChatWidth():0,transitionTime:t}))}hideCloseChatDiv(){this.closeChatContainer.style.display="none",(0,A.K$)()?(this.resizeIndicatorDiv.style.height="21px",this.resizeIndicatorDiv.style.width=(0,T.DK)()-2+"px"):(this.resizeIndicatorDiv.style.height="100%",this.resizeIndicatorDiv.style.width="21px")}showCloseChatDiv(){if((0,A.K$)())this.resizeIndicatorDiv.style.height="21px",this.resizeIndicatorDiv.style.width=(0,T.DK)()-21-4+"px";else{const e=this.resizeDragDiv.getBoundingClientRect();this.resizeIndicatorDiv.style.height=e.height-21-2+"px",this.resizeIndicatorDiv.style.width="21px"}this.closeChatContainer.style.display="inline-block"}createResizeDragDiv(){if(this.resizeDragDiv=document.createElement("div"),this.controlsContainerDiv=document.createElement("div"),this.resizeIndicatorDiv=document.createElement("div"),this.resizeIndicatorImg=document.createElement("img"),this.closeChatContainer=document.createElement("div"),this.closeChatDiv=document.createElement("div"),this.closeChatImg=document.createElement("img"),this.resizeDragDiv.appendChild(this.controlsContainerDiv),this.controlsContainerDiv.appendChild(this.resizeIndicatorDiv),this.controlsContainerDiv.appendChild(this.closeChatContainer),this.closeChatContainer.appendChild(this.closeChatDiv),this.resizeIndicatorDiv.appendChild(this.resizeIndicatorImg),this.closeChatDiv.appendChild(this.closeChatImg),this.resizeDragDiv.style.position="absolute",this.resizeDragDiv.style.bottom="0",this.controlsContainerDiv.style.verticalAlign="middle",this.controlsContainerDiv.style.width="100%",this.controlsContainerDiv.style.position="absolute",this.resizeIndicatorDiv.style.display="inline-block",this.resizeIndicatorDiv.style.position="absolute",this.resizeIndicatorDiv.style.left="0",this.resizeIndicatorDiv.style.padding="4px",this.resizeIndicatorDiv.style.borderRadius="4px",this.resizeIndicatorDiv.style.opacity="1",this.resizeIndicatorDiv.style.boxSizing="border-box",this.resizeIndicatorDiv.style.background="rgba(0, 0, 0, 0.3)",this.resizeIndicatorDiv.classList.add("resizeIndicatorDiv"),this.closeChatContainer.style.padding="30px",this.closeChatContainer.style.display="inline-block",this.closeChatContainer.style.position="absolute",this.closeChatContainer.style.margin="0",this.closeChatContainer.style.boxSizing="border-box",this.closeChatContainer.style.fontSize="9pt",this.closeChatContainer.style.lineHeight="14px",this.closeChatContainer.style.top="-19.5px",this.closeChatContainer.style.right="-18.5px",this.closeChatDiv.style.display="inline-block",this.closeChatDiv.style.position="absolute",this.closeChatDiv.style.margin="0",this.closeChatDiv.style.height="21px",this.closeChatDiv.style.width="21px",this.closeChatDiv.style.padding="4px",this.closeChatDiv.style.borderRadius="4px",this.closeChatDiv.style.boxSizing="border-box",this.closeChatDiv.style.textAlign="center",this.closeChatDiv.style.top="19.5px",this.closeChatDiv.style.left="19.5px",this.closeChatDiv.style.background="rgba(0, 0, 0, 0.3)",this.resizeIndicatorImg.src=`${STATIC_URL_MOBILE}3-bar.svg`,this.resizeIndicatorImg.style.position="absolute",this.resizeIndicatorImg.style.height="13px",this.resizeIndicatorImg.style.width="7px",this.closeChatImg.src=`${STATIC_URL_MOBILE}close-button.svg`,this.closeChatImg.style.height="9px",this.closeChatImg.style.width="9px",this.closeChatImg.style.padding="0",this.closeChatImg.style.margin="0",this.closeChatImg.classList.add("closeChatFullscreen"),(0,A.K$)())this.resizeIndicatorDiv.style.width=(0,T.DK)()-21-4+"px",this.resizeIndicatorDiv.style.height="21px",this.stylePortrait();else{this.resizeIndicatorDiv.style.width="21px";const e=this.resizeDragDiv.getBoundingClientRect();this.resizeIndicatorDiv.style.height=e.height-21+"px",this.styleLandscape()}this.closeChatContainer.onclick=e=>{if(this.areEphemeralsVisible){if(e.stopPropagation(),(0,A.K$)()){let e=Math.max(180,1.15*this.portraitHeight);e=Math.min(380,e),this.heightDuration=e,this.updateTransitions(),this.setPortraitHeight(0,e)}else{let e=Math.max(200,1.5*this.landscapeWidth);e=Math.min(450,e),this.widthDuration=e,this.updateTransitions(),this.setLandscapeWidth(0,e)}this.showEphemerals(),S.Dd.fire(void 0)}},this.resizeIndicatorDiv.onclick=e=>{this.areEphemeralsVisible&&this.isChatHidden()&&(e.stopPropagation(),this.unhideChat())}}unhideChat(){const e=180;(0,A.K$)()?(this.heightDuration=e,this.updateTransitions(),this.setPortraitHeight(150,e)):(this.widthDuration=e,this.updateTransitions(),this.setLandscapeWidth(150,e))}isChatHidden(){return(0,A.K$)()&&this.portraitHeight<5||!(0,A.K$)()&&this.landscapeWidth<5}stylePortrait(){this.element.style.width="100%",this.element.style.top="",this.element.style.bottom=`${56+this.layoutConstraints.bottom()+this.inputFocusOffset}px`,this.element.style.right="",this.resizeDragDiv.style.height="50px",this.resizeDragDiv.style.width="100%",this.resizeDragDiv.style.left="0",this.resizeDragDiv.style.top="-30px",this.controlsContainerDiv.style.height="21px",this.controlsContainerDiv.style.width="100%",this.controlsContainerDiv.style.top="4px",this.controlsContainerDiv.style.left="0",this.resizeIndicatorDiv.style.marginLeft="1px",this.resizeIndicatorImg.style.left=((0,T.DK)()-7-2)/2+"px",this.resizeIndicatorImg.style.bottom="4px",this.resizeIndicatorImg.style.transform="rotate(90deg)",this.closeChatDiv.style.right="0",this.closeChatDiv.style.marginRight="1px",this.closeChatContainer.style.right="-18.5px"}styleLandscape(){let e;this.element.style.height="",this.element.style.top="30px",this.element.style.bottom=`${56+this.layoutConstraints.bottom()}px`,this.element.style.right="10px",this.resizeDragDiv.style.width="50px",this.resizeDragDiv.style.height="",this.resizeDragDiv.style.left="-30px",this.resizeDragDiv.style.top="0",this.controlsContainerDiv.style.height="100%",this.controlsContainerDiv.style.width="21px",this.controlsContainerDiv.style.top="0",this.controlsContainerDiv.style.left="4px",e=window.innerHeight>200?this.element.getBoundingClientRect().height:this.resizeIndicatorDiv.getBoundingClientRect().height,this.resizeIndicatorDiv.style.bottom="0",this.resizeIndicatorDiv.style.marginLeft="0",this.resizeIndicatorImg.style.left="7px",this.resizeIndicatorImg.style.bottom=(e-13)/2+"px",this.resizeIndicatorImg.style.transform="rotate(0deg)",this.closeChatDiv.style.right="",this.closeChatDiv.style.marginRight="0",this.closeChatContainer.style.right="-19.5px"}handleRemoveMessages(e){const t=[];for(const i of this.innerDiv.childNodes){const s=i;s.getAttribute("data-nick")===e&&t.push(s)}for(const e of t)this.innerDiv.removeChild(e)}toggleEphemeralsVisibility(){this.areEphemeralsVisible?this.hideEphemerals():this.showEphemerals()}showEphemerals(){(0,f.Ve)(this.resizeDragDiv,"opacity 175ms"),this.resizeDragDiv.style.opacity="0.9",this.areEphemeralsVisible=!0,this.showBackground(),clearTimeout(this.opacityTimer),this.opacityTimer=window.setTimeout((()=>{this.hideEphemerals()}),3500)}hideEphemerals(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,f.Ve)(this.resizeDragDiv,`opacity 175ms ${e}ms`),this.areEphemeralsVisible=!1,this.resizeDragDiv.style.opacity="0",this.hideBackground(e),clearTimeout(this.opacityTimer)}updateTransitions(){const e=`background-color 175ms ${this.backgroundDelay}ms`,t=`height ${this.heightDuration}ms`,i=`width ${this.widthDuration}ms`;(0,f.Ve)(this.element,[e,t,i].join(","))}isMirroringComponent(e){return this.chatComponentToMirror===e}repositionChildren(){this.element.style.display=this.isVisible?"block":"none",(0,A.K$)()?(this.setPortraitHeight(this.desiredPortraitHeight),this.stylePortrait()):(this.setLandscapeWidth(this.desiredLandscapeWidth),this.styleLandscape())}}},9818:(e,t,i)=>{"use strict";i.d(t,{Hy:()=>Ri,Ic:()=>ki,Jo:()=>Pi});var s=i(7063),n=i(7623),o=i(1474),r=i(4054),a=i(9461),l=i(1224),h=i(6784),d=i(213),c=i(5216),u=i(768),p=i(6844),m=i(1131),g=i(1413),v=i(1516),f=i(2939),y=i(1519),b=i(2709),w=i(8423),C=i(7407),S=i(580),x=i(5424),T=i(2146),A=i(74),P=i(4947),k=i(2945),M=i(5389),R=i(3272),I=i(1372),E=i(7463),L=i(9739);class D extends L.W{constructor(){super()}initUI(){this.followButton=(0,I.tT)(B,{onClick:()=>{this.handleFollowAndUnfollow()}}),this.unfollowButton=(0,I.tT)(U,{onClick:()=>{this.onUnfollowClick()}}),this.element=(0,I.tT)("div",{style:{display:"flex",alignItems:"center"}},this.followButton,this.unfollowButton),this.updateFollowButtonDisplay(),E.im.listen((e=>{e.roomName===this.roomName&&this.updateContext(this.roomName,e.following)}))}}const B=e=>(0,I.tT)("div",{style:{display:"none",backgroundColor:"#E0E0E0",color:"#ffffff",boxSizing:"border-box",borderRadius:"4px",padding:0,height:"32px",justifyContent:"center",alignItems:"center"},onClick:e.onClick},(0,I.tT)("span",{className:"icon_not_following no_hover",style:{position:"static",padding:"0 3px 0",height:"29px",width:"29px",backgroundSize:"28px 28px",display:"inline-block"}}),(0,I.tT)("span",{style:{display:"inline-block",fontSize:"14px",color:"#222222",paddingRight:"8px"}},P.R.followText)),U=e=>(0,I.tT)("div",{style:{display:"none",backgroundColor:"#17202A",color:"#ffffff",boxSizing:"border-box",borderRadius:"4px",justifyContent:"center",alignItems:"center"},onClick:e.onClick},(0,I.tT)("span",{className:"icon_following_new no_hover",style:{position:"relative",height:"20px",width:"20px",backgroundSize:"20px 20px"}}));var F=i(2835);class _ extends b.u{constructor(){super()}initUI(){const e={whiteSpace:"nowrap",textOverflow:"ellipsis",textAlign:"right",overflow:"hidden",width:"100%"},t={fontFamily:"'UbuntuBold', Arial, Helvetica, sans-serif",color:"#FFF",fontWeight:700,fontSize:"14px",display:"block",...e},i={fontSize:"12px",color:"#A7A7A7",display:"inline-block",...e};this.followButton=new D,this.element=(0,I.tT)("div",{style:{margin:"0 10px",display:"flex",boxSizing:"border-box",minWidth:"inherit"}},(0,I.tT)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",marginRight:"8px",flex:1,minWidth:"inherit",textAlign:"right"}},(0,I.tT)("span",{style:t,ref:e=>this.roomNameElement=e}),(0,I.tT)("span",{style:i},(0,I.tT)("span",{ref:e=>this.roomStatusElement=e}),(0,I.tT)("span",{ref:e=>this.numViewersElement=e}))),this.followButton.element),F.K.listen((e=>{this.updateViewerCount(e)}))}updateContext(e,t,i){this.roomName=e,this.roomStatus=i,this.followButton.updateContext(this.roomName,t),this.updateText()}updateViewerCount(e){this.numViewers=e,this.updateText()}updateRoomNameText(){this.roomNameElement.innerText=this.roomName}updateRoomStatusText(){const e="offline"===this.roomStatus||"notconnected"===this.roomStatus||"unknown"===this.roomStatus,t=`${P.R.live} • `;this.roomStatusElement.innerText=`${e?P.R.offline:t}`,this.numViewersElement.innerText=e?"":`${P.R.numViewerOrViewers(this.numViewers)}`}updateText(){this.updateRoomNameText(),this.updateRoomStatusText()}}var N=i(7925),O=i(9447),H=i(3333),W=i(3955),$=i(7176),V=i(2196);class z extends V.N{constructor(){super(),(0,O.fZ)(this.element,"MobileDismissibleMessages"),(0,W.ZM)(this.element,{height:"",position:"fixed",top:"40px"})}render(e){const t=(0,I.tT)(q,{onCloseButtonClick:()=>this.dismissMessage(t,e),message:e});this.element.appendChild(t)}dismissMessage(e,t){super.dismissMessage(e,t)}}const G=e=>{const t=(0,$.fh)("12px");return(0,O.fZ)(t,"closeButton"),(0,W.ZM)(t,{marginRight:"15px"}),t.dataset.testid="dismissible-message-dismiss",t.onclick=e.onClick,t},q=e=>(0,I.tT)("div",{colorClass:"messageContainer",style:{alignItems:"center",padding:"8px 15px",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",fontSize:"14px",lineHeight:"16px"}},(0,I.tT)(G,{onClick:e.onCloseButtonClick}),(0,I.tT)(j,{message:e.message})),j=e=>{const t=(0,I.tT)("div",{colorClass:"message","data-testid":"dismissible-message-text",style:{flex:1,maxHeight:"15vh",overflowY:"scroll"},dangerouslySetInnerHTML:{__html:e.message.messageHtml}});for(const e of t.getElementsByTagName("a"))(0,O.fZ)(e,"link"),"javascript:;"!==e.href&&(e.target="_blank",e.rel="noopener noreferrer"),e.classList.contains(H.uJ)&&(0,H.NX)(e);for(const e of t.getElementsByTagName("img"))e.style.maxWidth="100%";return t};var Z=i(1779),K=i(338),J=i(3131),Y=i(9321),Q=i(1282),X=i(3933),ee=i(2609),te=i(5256),ie=i(8936),se=i(3124);class ne extends ee.k{constructor(e){super(),this.mobileDismissibleMessages=e,this.layoutConstraints=new te.f(this.constructor.name),this.isInputFocused=!1,(0,W.ZM)(this.element,{WebkitTextSizeAdjust:"none",height:"inherit",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"}),N.q9.listen((e=>{this.playerHeight=e,(0,T.Ve)(this.element,"none")})),this.layoutConstraints.setConstraints({top:this.element.offsetHeight+8,bottom:0,left:200,right:0,transitionTime:0}),this.layoutConstraints.setOnUpdate((()=>{const e=this.layoutConstraints.transitionTime();(0,T.Ve)(this.element,`top ${e}ms, width ${e}ms`),this.repositionChildren()})),this.siteHeaderMenu=document.querySelector("#static-header")}repositionChildren(){var e,t;if(super.repositionChildren(),this.element.style.height=`${this.playerHeight}px`,void 0===this.parent)return;const i=this.parent.element.getBoundingClientRect();i.width<=(0,ie.DK)()?this.positionFixed&&(this.element.style.left=`${i.left+window.pageXOffset}px`):this.element.style.left="0";const s=(null!==(e=null===(t=this.siteHeaderMenu)||void 0===t?void 0:t.offsetHeight)&&void 0!==e?e:0)+this.mobileDismissibleMessages.element.offsetHeight;if((0,se.K$)())this.isInputFocused?(this.element.style.bottom=`${(0,R.$h)()}px`,this.element.style.top=""):(this.element.style.bottom="",this.element.style.top=`${s}px`);else{const e=i.width-this.layoutConstraints.right();this.element.style.width=`${e}px`;const t=.5*i.height-.5*this.element.offsetHeight;this.element.style.top=`${t+s}px`}this.resizeRoomStatusText(i.width);let n=Math.min(50,(i.width-(0,ie.DK)()+100)/2);n=Math.max(0,n),this.element.style.padding=`0 ${n}px`}toggleInputFocusPosition(e){this.isInputFocused=e,this.repositionChildren()}showElement(){super.showElement("flex")}resizeRoomStatusText(e){const t=()=>{this.header.style.fontSize="20px",this.header.style.marginBottom="20px",this.body.style.fontSize="12px"};if((0,se.K$)()&&e<(0,ie.DK)()){const i=e/(0,ie.DK)()*100;i<=47?(this.header.style.fontSize="15px",this.header.style.marginBottom="0px",this.body.style.fontSize="8px"):i<=50?(this.header.style.fontSize="15px",this.header.style.marginBottom="0px",this.body.style.fontSize="10px"):i<=75?(this.header.style.fontSize="15px",this.header.style.marginBottom="12px",this.body.style.fontSize="10px"):t()}else t()}handleStatusChange(e,t){super.handleStatusChange(e,t);const i={top:0,bottom:0,left:0,right:0,transitionTime:0};"none"!==this.element.style.display&&(i.top=this.element.offsetHeight+8,i.left=200),this.layoutConstraints.setConstraints(i)}hideConnectingStatus(){super.hideConnectingStatus(),"none"===this.element.style.display&&this.layoutConstraints.setConstraints({top:0,bottom:0,left:0,right:0,transitionTime:0})}}var oe=i(5431);class re extends X.y{createPlayerOption(){const e=super.createPlayerOption();return e.techOrder=["chromecast","html5"],e.chromecast={requestTitleFn:e=>document.title,requestSubtitleFn:e=>""},e.plugins={chromecast:{receiverAppID:"96BDEA07"}},e}constructor(e){super(e)}}var ae=i(5271),le=i(3939);class he extends K.N{constructor(e,t,i){super(e,new ne(i),{noHook:!0}),this.mobileDismissibleMessages=i,this.toggleFullscreen=new w.c_("MobilePlayer:toggleFullscreen"),this.sendMessageInputFieldHasFocus=!1,this.minPortraitLeft=0,this.isVideoHidden=!1,this.isFullscreen=!1,this.usingAirPlay=!1,this.usingChromecast=!1,this.element.style.position="absolute",this.element.style.top="0",this.element.style.width="auto",this.element.style.height="auto",this.element.style.overflow="hidden",this.element.style.setProperty("scrollBehavior","auto"),(0,n.OF)()&&(this.element.style.touchAction="none"),this.playerComponent.element.style.overflowX="hidden",this.headerMenu=document.querySelector("#static-header"),this.roomStatusNotifier.header.style.fontSize="20px",this.roomStatusNotifier.body.style.fontSize="12px",this.videoControls=new oe.i(this,t,i),this.bindControlsEvents(),this.afterPlayerCreated(),this.addChild(this.videoControls),this.element.removeChild(this.watermark),this.addChild(this.roomStatusNotifier),this.toggleFullscreen.listen((e=>{this.repositionChildrenRecursive()})),void 0!==navigator.mediaSession&&(navigator.mediaSession.setActionHandler("play",null),navigator.mediaSession.setActionHandler("pause",null),navigator.mediaSession.setActionHandler("previoustrack",null),navigator.mediaSession.setActionHandler("nexttrack",null)),this.setupAirPlayControls(),this.setupChromecast(),debug("Player type: "+typeof this.playerComponent)}stylePortraitFullscreen(){let e,t;this.roomStatusNotifier.setShowMoreRoomsLink(!0),void 0===this.playerScaled?(t=(0,ie.mJ)(),e=t/(this.isWidescreen?Q.qL:Q.Bu)):(t=this.playerScaled.height,e=this.playerScaled.width),this.playerComponent.element.style.height=`${t}px`,this.playerComponent.element.style.width=`${e}px`,this.applyPlayerHeight(t),this.element.style.width=`${(0,ie.DK)()}px`,this.toggleMenuBar(!0)}styleLandscape(){if(this.roomStatusNotifier.setShowMoreRoomsLink(!1),this.applyPlayerHeight((0,ie.mJ)()),this.element.style.height="100%",this.element.style.width="100%",this.playerComponent.element.style.width="100%",(0,n.OF)())this.playerComponent.element.style.height="100%";else{const e=document.activeElement.tagName.toLowerCase();"input"!==e&&"textarea"!==e&&(this.playerComponent.element.style.height=`${this.element.getBoundingClientRect().height}px`)}this.toggleMenuBar(!0)}stylePortraitNonFullscreen(){this.roomStatusNotifier.setShowMoreRoomsLink(!0);const[e,t]=this.getNoneFullscreenSize();this.playerComponent.element.style.height="100%",this.playerComponent.element.style.position="static",this.applyPlayerHeight(t),e>(0,ie.DK)()||this.usingAirPlay||this.usingChromecast?(this.element.style.width="100%",this.element.style.left="0"):(this.element.style.width=`${e}px`,this.element.style.left=.5*(0,ie.DK)()-.5*e+"px"),this.usingAirPlay||this.usingChromecast?(this.element.style.height="100px",this.playerComponent.element.style.height="100px",this.playerComponent.element.style.width="100%"):this.playerComponent.element.style.width=`${e}px`,this.toggleMenuBar(!1)}repositionChildren(){(0,se.K$)()&&this.isFullscreen?this.stylePortraitFullscreen():(0,se.K$)()&&!this.isFullscreen?(void 0!==this.desiredPortraitHeight&&this.setPortraitHeight(this.desiredPortraitHeight),this.stylePortraitNonFullscreen()):this.styleLandscape(),(0,se.K$)()&&!this.isFullscreen||(this.isVideoHidden&&this.centerPlayer(),this.element.style.left="0")}applyPlayerHeight(e){this.element.style.height=`${e}px`,N.q9.fire(e)}centerPlayer(){let e;e=this.isFullscreen||void 0===this.portraitHeight?void 0===this.fullscreenHeight?(0,ie.mJ)():this.fullscreenHeight:this.portraitHeight;const t=e/(this.isWidescreen?Q.qL:Q.Bu);this.element.scrollLeft=t/2-(0,ie.DK)()/2}getNoneFullscreenSize(){const e=(0,ie.DK)(),t=(0,ie.mJ)();let i,s;if(this.sendMessageInputFieldHasFocus&&(0,ie.d9)()>0)[i,s]=this.getDimensionsWithinBounds(e,t-(0,R.$h)());else if((0,se.K$)())if(void 0!==this.portraitHeight)s=Math.min(t-this.minPortraitLeft,this.portraitHeight),i=s/(this.isWidescreen?Q.qL:Q.Bu);else{const n=120;i=Math.min(e,(t-n)/(this.isWidescreen?Q.qL:Q.Bu)),s=i*(this.isWidescreen?Q.qL:Q.Bu)}else[i,s]=this.getDimensionsWithinBounds(e,t);return[Math.round(i),Math.round(s)]}getDimensionsWithinBounds(e,t){let i=t/(this.isWidescreen?Q.qL:Q.Bu),s=t;return i>e&&(i=e,s=i*(this.isWidescreen?Q.qL:Q.Bu)),[i,s]}setupAirPlayControls(){void 0!==window.WebKitPlaybackTargetAvailabilityEvent?(this.videoControls.showAirPlay(),(0,h.wu)("click",this.videoControls.airPlayImg,(()=>{const e=this.playerComponent.getVideoElement();void 0===e?this.videoControls.getPlayerIsHlsPlaceholder()||this.videoControls.forceHLS():e.webkitShowPlaybackTargetPicker()})),(0,h.wu)("webkitplaybacktargetavailabilitychanged",this.playerComponent.element,(e=>{if(this.videoControls.forceHLS(),void 0!==e.availability)switch(e.availability){case"available":this.videoControls.showAirPlay();break;case"not-available":this.videoControls.hideAirPlay()}}))):this.videoControls.hideAirPlay()}setupChromecastControls(){if(this.playerComponent instanceof X.y){const e=this.playerComponent.getVideoJs();if(void 0!==e&&void 0!==e.chromecastSessionManager){const t=e.chromecastSessionManager.getCastContext();(0,h.wu)("click",this.videoControls.chromecastImg,(()=>{void 0===this.playerComponent.getVideoElement()?this.videoControls.forceHLS():e.chromecastSessionManager.openCastMenu()})),t.addEventListener("caststatechanged",(e=>{if(void 0!==e.castState)switch(e.castState){case"NOT_CONNECTED":this.videoControls.showChromecast();break;case"NO_DEVICES_AVAILABLE":this.videoControls.hideChromecast()}})),"CONNECTED"===t.getCastState()||"CONNECTING"===t.getCastState()?(this.videoControls.showChromecast(),t.getCurrentSession().endSession(!0)):"NOT_CONNECTED"===t.getCastState()?this.videoControls.showChromecast():"NO_DEVICES_AVAILABLE"===t.getCastState()&&this.videoControls.hideChromecast()}else this.videoControls.hideChromecast()}}setupChromecast(){let e=0;const t=window.setInterval((()=>{if(e>=10&&clearInterval(t),this.playerComponent instanceof X.y){const e=this.playerComponent.getVideoJs();if(void 0!==e&&void 0!==e.chromecastSessionManager){this.setupChromecastControls();const e=this.playerComponent.getVideoElement();void 0!==e&&this.bindChromecastEventsToVideo(e),clearInterval(t)}}e+=1}),1e3)}createVideoJsPlayer(){return new re(this.roomStatusNotifier)}afterPlayerCreated(){super.afterPlayerCreated();const e=this.playerComponent.getVideoElement();void 0!==e&&this.bindAirPlayEventsToVideo(e),this.videoControls.notifyPlayerIsJPEG(this.playerComponent instanceof Y.O)}setUsingAirPlay(e){this.usingAirPlay=e,this.videoControls.notifyUsingAirPlayChange(e)}bindAirPlayEventsToVideo(e){void 0!==window.WebKitPlaybackTargetAvailabilityEvent&&(0,h.wu)("webkitcurrentplaybacktargetiswirelesschanged",e,(()=>{e.webkitCurrentPlaybackTargetIsWireless?((0,C.bT)("Video_CastStart",{CastType:"airplay"}),this.setUsingAirPlay(!0)):((0,C.bT)("Video_CastStop",{CastType:"airplay"}),this.setUsingAirPlay(!1)),J.T.fire(this.usingAirPlay),this.videoControls.updateCastingStyling(this.usingAirPlay?"AirPlay":""),this.repositionChildrenRecursive(),this.centerPlayer()}))}setUsingChromecast(e){this.usingChromecast=e,this.videoControls.notifyUsingChromecastChange(e)}bindChromecastEventsToVideo(e){if(this.playerComponent instanceof X.y){const e=this.playerComponent.getVideoJs();void 0!==e&&void 0!==e.chromecastSessionManager&&e.chromecastSessionManager.getCastContext().addEventListener("sessionstatechanged",(e=>{if(void 0!==e.sessionState)switch(e.sessionState){case"SESSION_STARTED":case"SESSION_RESUMED":(0,C.bT)("Video_CastStart",{CastType:"chromecast"}),this.setUsingChromecast(!0);break;case"SESSION_ENDED":(0,C.bT)("Video_CastStop",{CastType:"chromecast"}),this.setUsingChromecast(!1)}this.videoControls.updateCastingStyling(this.usingChromecast?"Chromecast":""),this.repositionChildrenRecursive(),this.centerPlayer()}))}}bindControlsEvents(){this.videoControls.setPlayerVisibilityEvent.listen((e=>{this.setHidden(e)})),this.videoControls.centerPlayerEvent.listen((()=>{this.centerPlayer()})),this.videoControls.requestFullscreenEvent.listen((()=>{(0,Z.lh)(this.element)})),this.videoControls.setPlayerComponentVolumeMutedEvents.listen((e=>{this.playerComponent.setVolumeMuted(e.volume,e.isMuted)})),this.videoControls.forceHlsPlayerEvent.listen((e=>{let{roomContext:t,unmute:i}=e;this.forceHlsPlayer(t,null==i||i)})),this.videoControls.touchControls.scalePlayerEvent.listen((e=>{let{factor:t,pointX:i}=e;this.canUpdateMobilePlayer()&&(0,se.K$)()&&this.isFullscreen&&this.scalePlayer(t,i)})),this.videoControls.touchControls.changeVideoHeightEvent.listen((e=>{if(this.canUpdateMobilePlayer()&&(0,se.K$)())if(this.isFullscreen){const t=1+e.distance.y/(0,ie.mJ)()*le.L,i=(0,ie.DK)()/2;this.scalePlayer(t,i)}else this.setDesiredPortraitHeight(e.distance.y)})),this.videoControls.touchControls.scrollPlayerEvent.listen((e=>{this.canUpdateMobilePlayer()&&!this.isVideoHidden&&(void 0!==this.element.scrollBy?this.element.scrollBy(e,0):this.element.scrollLeft+=e)})),this.videoControls.touchControls.swipePlayerEvent.listen((e=>{const t=e.totalDistance>0;switch(e.state){case ae.d.Cancelled:debug("Swipe Reset");break;case 2:debug("Handle Completed Swipe",{direction:t?"Left":"Right",totalDistance:e.totalDistance});break;default:t?this.handleLeftSwipe(e):this.handleRightSwipe(e)}})),this.videoControls.playerComponentReadjustForceHlsOverlayOrderEvent.listen((e=>{this.playerComponent.element.insertBefore(e,this.playerComponent.element.firstChild),this.playerComponent.element.insertBefore(e,this.playerComponent.element.firstChild)})),this.videoControls.showJpegPlayerComponentImage.listen((()=>{this.playerComponent instanceof Y.O&&this.playerComponent.showPlayerImage()})),this.videoControls.toggleFullscreen.listen((e=>{this.isFullscreen=e,this.toggleFullscreen.fire(e)})),this.videoControls.requestHlsPlayerPlayIfPaused.listen((()=>{this.playerComponent instanceof S.vS&&this.playerComponent.videoElement.paused&&this.playerComponent.play()}))}bindVideoEvents(){var e,t;super.bindVideoEvents(),this.playerComponent.requestControlVisibility.listen((e=>{e?this.videoControls.show():this.videoControls.hide()})),null===(e=this.playerComponent.setControlVolume)||void 0===e||e.listen((e=>{let{volume:t,save:i}=e;i?this.videoControls.updateAndSaveVolume(t):this.videoControls.updateVolume(t)})),null===(t=this.playerComponent.setControlIsMuted)||void 0===t||t.listen((e=>{let{isMuted:t,save:i}=e;i?this.videoControls.updateAndSaveIsMuted(t):this.videoControls.updateIsMuted(t)}))}toggleMenuBar(e){this.headerMenu.style.display=e?"none":""}setIsWidescreen(e){this.isWidescreen=e}setPortraitHeight(e){let t=this.portraitHeight,i=Math.min((0,ie.mJ)()-this.getOtherComponentsCombinedHeights(),Math.max(100,e));i=Math.round(i),this.portraitHeight=i,t=void 0!==t?t:this.portraitHeight,t!==i&&(this.repositionChildrenRecursive(),this.element.scrollLeft+=i-t)}getOtherComponentsCombinedHeights(){var e,t,i,s;const n=null!==(e=null===(t=document.getElementById("static-header"))||void 0===t?void 0:t.offsetHeight)&&void 0!==e?e:40,o=null!==(i=null===(s=document.getElementById("tab-room-header"))||void 0===s?void 0:s.offsetHeight)&&void 0!==i?i:42,r=this.mobileDismissibleMessages.element.offsetHeight;return n+o+(0,R.$h)()+r}setDesiredPortraitHeight(e){const t=this.element.offsetHeight+e;this.desiredPortraitHeight!==t&&(this.desiredPortraitHeight=t,this.repositionChildren())}scalePlayer(e,t){const i=this.playerComponent.element.offsetWidth;let s=e*i;const n=(0,ie.mJ)()/(this.isWidescreen?Q.qL:Q.Bu),o=(0,ie.DK)();s=Math.max(s,o),s=Math.min(s,n),s=Math.round(s);const r=this.element.scrollLeft,a=Math.round(s*(this.isWidescreen?Q.qL:Q.Bu));this.element.style.width=`${s}px`,this.fullscreenHeight=a,this.applyPlayerHeight(a),this.playerComponent.element.style.width=`${s}px`,this.playerScaled={width:s,height:a},this.repositionChildrenRecursive();const l=s/i-1,h=(t+this.element.scrollLeft)*l;this.element.scrollLeft=r+h}limitPortraitHeight(e){this.minPortraitLeft=e,this.repositionChildrenRecursive()}setMessageInputFieldHasFocus(e){this.sendMessageInputFieldHasFocus=e,e&&this.videoControls.hideControls()}setHidden(e){this.isVideoHidden=e,this.repositionChildren()}canUpdateMobilePlayer(){return!this.usingAirPlay&&!this.usingChromecast&&!this.videoControls.isAnyInputFocused()}handleLeftSwipe(e){debug("Handle Left Swipe In Progress")}handleRightSwipe(e){debug("Handle Right Swipe In Progress")}}var de=i(8466),ce=i(5169),ue=i(4580);class pe extends b.u{constructor(e){super("ul",e)}initData(e){this.activeTab="chat"}initUI(e){const t={fontSize:"10px",fontFamily:"UbuntuBold, Arial, Helvetica, sans-serif"};this.numChatUnreadContainer=(0,I.tT)("span",{colorClass:"numUnread",style:t}),this.numPmsUnreadContainer=(0,I.tT)("span",{colorClass:"numUnread",style:t}),this.chatUnreadBubble=(0,I.tT)(ge,{unreadContainer:this.numChatUnreadContainer}),this.pmUnreadBubble=(0,I.tT)(ge,{unreadContainer:this.numPmsUnreadContainer}),this.headerTabs=e.tabList.getList().map((e=>({tabName:e.getTabName(),element:(0,I.tT)(me,{tab:e,onClick:()=>{ue.qb.fire(e.getTabName())},chatUnreadBubble:this.chatUnreadBubble,pmUnreadBubble:this.pmUnreadBubble})}))),this.element=(0,I.tT)("ul",{id:"tab-room-header",style:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box",width:"100%",height:"43px",margin:0,padding:0,overflowX:"scroll",overflowY:"hidden",whiteSpace:"nowrap",display:"flex"},colorClass:"Header",className:"noScrollbar"},this.headerTabs.map((e=>e.element))),e.tabList.getChatTab().getChatWindow().numUnreadChanged.listen((e=>{this.setChatUnreadBubble(e)})),e.tabList.getPrivateTab().numUnreadChanged.listen((e=>{this.setPmsUnreadBubble(e)})),this.setActiveTabStyles(this.activeTab),ue.qb.listen((e=>{const t=this.headerTabs.find((t=>t.tabName===e));if(void 0===t)return void this.setActiveTab(ce.S.currentTab);const i=t.element.offsetLeft0?(this.chatUnreadBubble.style.display="flex",e>=99?(this.numChatUnreadContainer.style.fontSize="9px",this.numChatUnreadContainer.innerText="99+"):(this.numChatUnreadContainer.style.fontSize="10px",this.numChatUnreadContainer.innerText=`${e}`)):this.chatUnreadBubble.style.display="none"}setPmsUnreadBubble(e){e>0?(this.pmUnreadBubble.style.display="flex",e>=99?(this.numPmsUnreadContainer.style.fontSize="9px",this.numPmsUnreadContainer.innerText="99+"):(this.numPmsUnreadContainer.style.fontSize="10px",this.numPmsUnreadContainer.innerText=`${e}`)):this.pmUnreadBubble.style.display="none"}setActiveTab(e){this.setInactiveTabStyles(this.activeTab),this.activeTab=e,this.setActiveTabStyles(this.activeTab)}setActiveTabStyles(e){const t=this.headerTabs.find((t=>t.tabName===e));void 0!==t&&((0,O.SA)(t.element,"inactiveTab"),(0,O.fZ)(t.element,"activeTab"),(0,W.ZM)(t.element,{borderBottomStyle:"solid",borderBottomWidth:"3px"}))}setInactiveTabStyles(e){const t=this.headerTabs.find((t=>t.tabName===e));if(void 0===t)return;const i="roomMenu"===e;(0,O.SA)(t.element,"activeTab"),(0,O.fZ)(t.element,"inactiveTab"),i&&(0,O.fZ)(t.element,"roomMenu"),(0,W.ZM)(t.element,{borderBottom:"none"})}}const me=e=>{const t="chat"===e.tab.getTabName(),i="tokens"===e.tab.getTabName(),s="roomMenu"===e.tab.getTabName(),n="private"===e.tab.getTabName(),o={listStyleType:"none",display:"inline-block",height:"100%",lineHeight:"42px",fontFamily:"'UbuntuBold', Arial, Helvetica, sans-serif",fontSize:"14px",boxSizing:"border-box",textAlign:"center",position:"relative",flex:1,letterSpacing:s?"1px":""},r={position:"relative",display:"flex",alignItems:"center",justifyContent:"center"};let a;if(t)a=(0,I.tT)("span",{style:r,"data-testid":"chat-tab-default"},e.tab.getTabLabel(),e.chatUnreadBubble);else if(i)a=(0,I.tT)("span",{"data-testid":"tokens-tab"},(0,I.tT)("span",{style:{display:"inline-block",width:"16px",height:"16px",marginRight:"4px",position:"relative",top:"4px"},colorClass:"tipIcon"}),e.tab.getTabLabel());else if(s)a=(0,I.tT)("span",{style:{transform:"rotate(90deg)",display:"inline-block"},"data-testid":"additional-menu-options"},e.tab.getTabLabel());else if(n)a=(0,I.tT)("span",{style:r,"data-testid":"pm-tab-default"},e.tab.getTabLabel(),e.pmUnreadBubble);else{let t="";switch(e.tab.getTabName()){case"moreRooms":t="more-rooms-tab";break;case"bio":t="bio-tab";break;default:t=""}a=(0,I.tT)("span",{"data-testid":t},e.tab.getTabLabel())}return(0,I.tT)("li",{style:o,colorClass:["inactiveTab","smallPadding",s?"roomMenu":""],onClick:e.onClick},a)},ge=e=>(0,I.tT)("span",{style:{width:"8px",height:"8px",borderRadius:"50%",display:"none",justifyContent:"center",alignItems:"center",padding:"6px",marginLeft:"4px"},colorClass:"bubble"},e.unreadContainer);class ve extends b.u{constructor(e){super("div",e)}initData(e){this.tabName=e.tabName,this.tabLabel=e.tabLabel,this.pageActionName=e.pageActionName}initUI(e){this.element=(0,I.tT)("div",{style:{width:"100%",height:"100%",flex:"none",backgroundColor:"#FFF",boxSizing:"border-box"}})}getTabName(){return this.tabName}getTabLabel(){return this.tabLabel}getPageActionName(){return this.pageActionName}}var fe=i(3910),ye=i(5581),be=i(9586);class we extends b.u{constructor(){super(),this.offline=!1,f.X0.listen((e=>{this.username=e.dossier.room,"bio"===ce.S.currentTab&&this.load(),this.offline="offline"===e.dossier.roomStatus})),ue.qb.listen((e=>{"bio"===e&&this.load()})),f.Gr.listen((()=>{this.removeAllDOMChildren(),this.loadingState=0}))}initUI(){(0,W.ZM)(this.element,{padding:"19px",boxSizing:"border-box"}),(0,be.H)(this.element)}load(){if(this.isLoadingOrLoaded())return;this.removeAllDOMChildren();const e=(0,I.tT)(Ce,null);this.element.appendChild(e),this.loadingState=1,(0,ye.zB)(this.username).then((e=>{this.element.appendChild((0,I.tT)(Te,{content:e,offline:this.offline})),this.loadingState=2})).catch((e=>{error("Bio Content error",e),this.element.appendChild((0,I.tT)(Se,null)),this.loadingState=0})).finally((()=>{this.element.removeChild(e)}))}isLoadingOrLoaded(){return 1===this.loadingState||2===this.loadingState}}const Ce=()=>(0,I.tT)("div",null,`${P.R.loadingText}...`),Se=()=>(0,I.tT)("div",null,P.R.bioUnavailableText),xe=e=>{const t={fontFamily:"'UbuntuBold', Arial, Helvetica, sans-serif",display:"inline-block",color:"#49494F",fontWeight:"bold",...e.style};return(0,I.tT)("span",{style:t},e.text)},Te=e=>{var t;const{gameSelection:i,infoSection:s,socialMedias:n,photoSets:o,aboutMe:r,wishList:l}=e.content,h=s.username,d=e.offline&&h!==(null===(t=a.Bm.current.loggedInUser)||void 0===t?void 0:t.username);return(0,I.tT)("div",{style:{fontSize:"14px"},"data-testid":"mobile-bio-tab-contents"},(0,I.tT)("h2",{style:{fontFamily:"'UbuntuBold', Arial, Helvetica, sans-serif",margin:0,color:"#222",fontSize:"16px",marginBottom:"12px"}},P.R.bioAndFreeWebCamText(h)),d&&(0,I.tT)(Ae,{username:h}),null!=i&&(0,I.tT)(Pe,{gameSelection:i,username:h}),(0,I.tT)(ke,{info:s}),n.length>0&&(0,I.tT)(Re,{socialMedias:n,username:h}),o.length>0&&(0,I.tT)(Ee,{photosets:o,username:h}),""!==r&&(0,I.tT)(De,{htmlString:r,sectionTitle:P.R.aboutMeText}),""!==l&&(0,I.tT)(De,{htmlString:l,sectionTitle:P.R.wishListText}))},Ae=e=>{const t={width:"100%",fontFamily:"UbuntuMedium, Arial, Helvetica, sans-serif",fontSize:"16px",padding:"12px",color:"#FFF",border:"1px solid #CD5D26",backgroundColor:l.m.isWhiteLabel?l.m.signupBgColor:"#F47321",textAlign:"center",borderRadius:"4px",boxSizing:"border-box",margin:"0px 0 16px 0",display:"inline-block"};return(0,I.tT)("button",{style:t,onClick:()=>{(0,p.rC)(P.R.loggedInToDm)||(ue.bW.fire(!0),fe.$o.fire(e.username))},"data-testid":"send-dm"},P.R.dmMenuTitle)},Pe=e=>{var t;return(0,I.tT)("div",{style:{border:"1px solid #eee",borderRadius:"3px",boxShadow:"0 3px 6px 0 rgba(90, 90, 90, 0.2), 0 6px 20px 0 rgba(90, 90, 90, 0.19)",margin:"4px 0 12px 0",padding:"4px",position:"relative"}},(0,I.tT)("div",{style:{display:"inline-block",paddingRight:"4px"}},(0,I.tT)("img",{style:{width:"42px",height:"42px",borderRadius:"5px",objectFit:"cover",overflow:"hidden"},src:e.gameSelection.image})),(0,I.tT)("div",{style:{borderLeft:"2px solid #eee",bottom:0,display:"inline-block",height:"100%",overflow:"ellipsis",paddingLeft:"4px",position:"absolute",top:0}},(0,I.tT)("div",{style:{display:"inline-block",marginTop:"-0.5em",position:"relative",top:"50%",transform:"translateY(-50%)",verticalAlign:"middle"}},`${null!==(t=e.username)&&void 0!==t?t:"User"} is playing `,(0,I.tT)("a",{href:e.gameSelection.gameUrl,target:"_blank",rel:"noopener"},e.gameSelection.name))))},ke=e=>{const{realName:t,followersCount:i,displayBirthday:s,displayAge:n,bodyType:o,bodyDecorations:r,sex:l,subgender:h,interestedIn:d,location:c,lastBroadcast:u,languages:p,smokeDrink:m,hasFanClub:g,isInFanClub:v,fanClubJoinUrl:f}=e.info,y=""!==d?JSON.parse(d).join(", "):"",b={width:"100%",fontFamily:"UbuntuMedium, Arial, Helvetica, sans-serif",fontSize:"16px",padding:"12px",color:"#FFF",border:"1px solid #006800",backgroundColor:"#009900",textAlign:"center",borderRadius:"4px",boxSizing:"border-box",margin:"12px 0 16px 0",display:"inline-block"},w=a.Bm.current.isNoninteractiveUser;return(0,I.tT)("ul",{style:{listStyleType:"none",padding:0,margin:0}},(0,I.tT)(Me,{title:P.R.realNameText,info:t}),!isNaN(i)&&(0,I.tT)(Me,{title:P.R.followersText,info:i}),(0,I.tT)((()=>""===l?l:"A Couple"===l?(0,I.tT)(Me,{title:P.R.sexTextCouple,info:l}):"Trans"===l&&""!==h?(0,I.tT)(Me,{title:P.R.sexText,info:`${l} (${h})`}):(0,I.tT)(Me,{title:P.R.sexText,info:l})),null),(0,I.tT)(Me,{title:P.R.birthdayText,info:s}),!isNaN(n)&&(0,I.tT)(Me,{title:P.R.ageText,info:n}),(0,I.tT)(Me,{title:P.R.bodyTypeText,info:o}),(0,I.tT)(Me,{title:P.R.bodyDecorationsText,info:r}),(0,I.tT)(Me,{title:P.R.interstedInText,info:y}),(0,I.tT)(Me,{title:P.R.locationText,info:c}),(0,I.tT)(Me,{title:P.R.lastBroadcastText,info:u}),(0,I.tT)(Me,{title:P.R.languagesText,info:p}),(0,I.tT)(Me,{title:P.R.smokeDrinkText,info:m}),!w&&g&&!v&&(0,I.tT)("a",{style:b,href:f,rel:"noopener"},P.R.joinFanClub),g&&v&&(0,I.tT)("a",{style:b,href:f,rel:"noopener"},P.R.inFanClub))},Me=e=>""===e.info||void 0===e.info?"":(0,I.tT)("li",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px"}},(0,I.tT)(xe,{text:`${e.title}:`,style:{width:"50%"}}),(0,I.tT)("span",{style:{textAlign:"right",width:"50%",overflowWrap:"break-word",wordWrap:"break-word",hyphens:"auto"}},e.info)),Re=e=>(0,I.tT)("div",{style:{position:"relative",paddingTop:"5px",paddingBottom:"25px"}},(0,I.tT)(xe,{text:`${P.R.socialMediaText}:`}),(0,I.tT)("div",{style:{textAlign:"center"}},e.socialMedias.slice(0,8).map((t=>(0,I.tT)(Ie,{socialMedia:t,username:e.username}))),e.socialMedias.length>8&&(0,I.tT)("a",{style:{display:"block",paddingTop:"10px",color:"#156b95",textDecoration:"none"},href:`/socials/social_media/list_popup/${e.username}/`,target:`${e.username} social media`},P.R.showMoreText))),Ie=e=>{const t={textDecoration:"none",marginLeft:"5px",marginRight:"5px",marginTop:"10px",position:"relative",display:"inline-block",height:"100px",border:"1px solid #ACACAC",borderRadius:"3%",maxWidth:"150px",width:(0,ie.DK)()/2-40+"px"},i={backgroundColor:e.socialMedia.labelColor,color:"#ffffff",position:"absolute",top:"80px",right:"8px",fontSize:"9px",borderRadius:"2px",padding:"1px 3px",lineHeight:"12px"},s=(0,I.tT)("div",{style:{color:"#156b95",maxWidth:"145px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},"data-testid":"social-media-title"},e.socialMedia.titleName);let n="";return""!==e.socialMedia.labelText&&(n=(0,I.tT)("span",{style:i,"data-testid":"social-media-tokens-badge"},e.socialMedia.labelText)),(0,I.tT)("a",{style:t,href:(0,c._Y)(e.socialMedia.link),target:"_self",className:"userUpload","data-testid":"social-media-item",title:e.socialMedia.titleName,onMouseEnter:()=>s.style.textDecoration="underline",onMouseLeave:()=>s.style.textDecoration="none"},(0,I.tT)("img",{style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"3%"},src:e.socialMedia.imageUrl,"data-testid":"social-media-preview"}),n,s)},Ee=e=>(0,I.tT)("div",{style:{position:"relative",paddingTop:"5px",paddingBottom:"25px"}},(0,I.tT)(xe,{text:`${P.R.photosAndVideosText}:`,style:{padding:"5px 10px 5px 0"}}),(0,I.tT)("div",{style:{textAlign:"center"}},e.photosets.slice(0,8).map((t=>(0,I.tT)(Le,{photoset:t,username:e.username}))),e.photosets.length>8&&(0,I.tT)("a",{style:{display:"block",paddingTop:"10px",color:"#156b95",textDecoration:"none"},href:`/photo_videos/photoset/list_popup/${e.username}/`,target:`${e.username}_photosets`},P.R.showMoreText))),Le=e=>{const t=(0,ie.DK)()/2-40,i={textDecoration:"none",margin:"10px 5px 10px 5px",position:"relative",display:"inline-block",height:"100px",maxWidth:"150px",width:`${t}px`},s={width:`${t}px`,maxWidth:"150px",height:"100px",padding:"1px",borderRadius:"3%",position:"absolute",left:"0px",top:"0px",backgroundColor:"rgba(0, 0, 0, .55)"},n={backgroundColor:e.photoset.labelColor,color:"#fff",position:"absolute",bottom:"0",right:"0",margin:"8px",fontSize:"9px",padding:"1px 3px",lineHeight:"12px",borderRadius:"2px"},o=(0,I.tT)("div",{style:{color:"#156b95",maxWidth:"145px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},"data-testid":"title"},e.photoset.name),r=(0,I.tT)(I.FK,null,(0,I.tT)("div",{style:s}),(0,I.tT)("img",{"data-testid":"lock-icon",style:{marginLeft:"-9px",marginTop:"-9px",position:"absolute",left:"50%",top:"40%",padding:"4px",border:"none"},src:`${STATIC_URL}lock.svg`}),""!==e.photoset.labelText&&(0,I.tT)("span",{style:n,colorClass:"tokenText"},e.photoset.labelText)),a=(0,I.tT)("span",{style:{backgroundColor:"#6d85b5",color:"#fff",position:"absolute",top:"80px",right:"8px",padding:"1px 3px",lineHeight:"12px",borderRadius:"2px",fontSize:"9px"},colorClass:"purchasedBadge","data-testid":"token-badge"},P.R.purchasedCAPS),l=(0,I.tT)("img",{style:{height:"18px",position:"absolute",top:"8px",right:"32px"},src:`${STATIC_URL}no-audio.svg`}),h=(0,I.tT)("img",{style:{height:"18px",position:"absolute",top:"8px",right:"8px"},src:`${STATIC_URL}video.svg`});return(0,I.tT)("a",{style:i,href:(0,c._Y)(`/photo_videos/photoset/detail/${e.username}/${e.photoset.id}`),target:"_blank",className:"userUpload",title:e.photoset.name,"data-testid":"photo-video-preview",onMouseEnter:()=>o.style.textDecoration="underline",onMouseLeave:()=>o.style.textDecoration="none",onClick:t=>{(0,ye.WO)(e.photoset,"BioTab")}},(0,I.tT)("img",{style:{width:"100%",height:"100%",objectFit:"cover",borderWidth:"1px",borderStyle:"solid",borderRadius:"3%",borderColor:"#ACACAC",display:"block"},src:e.photoset.coverUrl,"data-testid":"photo-video-preview-image"}),!e.photoset.userCanAccess&&r,e.photoset.userCanAccess&&e.photoset.userHasPurchased&&a,e.photoset.isVideo&&!e.photoset.videoHasSound&&!e.photoset.pendingApproval&&l,e.photoset.isVideo&&h,o)},De=e=>{const t=(0,I.tT)("div",null);return t.innerHTML=e.htmlString,(0,ye._W)(t,t,!0,!0),(0,I.tT)("div",null,(0,I.tT)(xe,{text:`${e.sectionTitle}:`}),(0,I.tT)("div",{style:{width:"100%",overflow:"scroll"},onTouchStart:e=>{const t=t=>{const i=t;i.scrollWidth>i.clientWidth&&e.stopPropagation()};null!==e.target&&t(e.target),null!==e.currentTarget&&t(e.currentTarget)}},(0,I.tT)("div",{style:{maxWidth:"800px",display:"inline-block"}},t)))};class Be extends ve{constructor(){super({tabName:"bio",tabLabel:P.R.bioText,pageActionName:"BioOpened"})}initUI(){super.initUI(),this.bioContent=new we,this.addChild(this.bioContent)}}var Ue=i(8598),Fe=i(20),_e=i(478),Ne=i(1885),Oe=i(9419),He=i(3971),We=i(3502),$e=i(7197),Ve=i(1243),ze=i(1284),Ge=i(1452),qe=i(9898),je=i(2434),Ze=i(8785),Ke=i(4110),Je=i(4926),Ye=i(4364),Qe=i(9510),Xe=i(5728),et=i(106),tt=i(1448);const it=new w.c_("otherUserInitiatedPm");class st extends b.u{constructor(e){super("div",e),this.mediaDockHeight=0,this.sendPrivateMessageFailCallback=e=>{const t=this.orderedPMSessionKeys.currentElem,i=this.pmSessions.get(t);(0,Fe.SU)()&&e.showDmLink?i.chatContents.appendMessageDiv((0,tt.dD)(e.errorMessage,e.username)):i.chatContents.appendMessageDiv((0,Je.CM)(e.errorMessage))}}initData(e){this.newPMSessionEvent=new w.c_("newPMSession"),this.closePMSessionEvent=new w.c_("closePMSession"),this.numUnreadChanged=new w.c_("numUnreadChanged"),this.pmSessions=new Map,this.orderedPMSessionKeys=new et.J,this.numUnread=0,this.leavePmWindow=e.leavePmWindow}initUI(e){(0,W.ZM)(this.element,{position:"unset",display:"flex",flexDirection:"column"}),this.backButtonContainer=this.createBackButton({onBackClick:this.leavePmWindow,onSendDmClick:()=>{var e;if((0,p.rC)(P.R.loggedInToDm))return;const t=null===(e=this.currentlyDisplayedPmSession())||void 0===e?void 0:e.user;void 0!==t&&(ue.bW.fire(!0),fe.$o.fire(t))}}),this.element.appendChild(this.backButtonContainer),f.X0.listen((e=>{this.chatConnection=e.chatConnection,e.dossier.userName!==e.dossier.room&&Ke.E3.fire({username:e.dossier.room,focus:!1,showSupporterAlert:e.dossier.needsSupporterToPm}),e.chatConnection.event.roomNotice.listen((e=>{e.showInPrivateMessage&&this.possiblyAppendMessageDiv(new qe._y({roomNoticeData:e,neverCollapse:!0}).element)})),e.chatConnection.event.removeMessages.listen((e=>{this.closePMSession(e.username,!0)})),this.adjustBackButtonSize(e.dossier.userChatSettings.fontSize)})),Qe.TL.listen((e=>{this.mediaDockHeight=e?(0,Qe.$x)()+10:0,this.repositionChildren();const t=this.currentlyDisplayedPmSession();void 0!==t&&t.chatContents.scrollToBottom()})),A.EZ.listen((e=>{this.adjustBackButtonSize(e.fontSize)})),Ke.E3.listen((e=>{this.hideCurrentPMSession(),void 0===this.pmSessions.get(e.username)&&this.initializePmSession(e.username,!1,e.showSupporterAlert),e.focus&&(ue.qb.fire("private"),this.definePMLinkOnClick(e.username))})),Ne.J9.listen((e=>{this.newPrivateMessage(e);const t=this.currentlyDisplayedPmSession();void 0!==t&&(this.addPageActions(t,e),e.otherUsername===t.user&&!t.chatContents.isScrolledUp()&&t.isActive()&&Ne.Si.fire(t.user))})),Ye.yT.conversationRead.listen((e=>{let{username:t,isDm:i}=e;if(!i){const e=this.pmSessions.get(t);void 0!==e&&this.markSessionRead(e)}})),f.Gr.listen((()=>{this.clear(),this.resetNumUnread()}))}addPageActions(e,t){var i;let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=(null===(i=a.Bm.current.loggedInUser)||void 0===i?void 0:i.username)===t.fromUser.username,o=e.user===t.fromUser.username;e.isActive()&&!s&&!n&&o&&(0,C.bT)("PMReceivedOpen",{message_id:t.messageID})}loadHistoryMessages(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.isAllHistoryLoaded||e.isLoadingHistory)return;const i=e.chatContents.messageList.clientHeight,s=t?"0":e.chatContents.getEarliestMessageId();this.setIsLoadingHistory(e,!0),(0,Fe.O2)(e.user,this.chatConnection.room(),s).then((t=>{const s=t.messages;s.length{this.newPrivateMessage(e,!0)})),s.length>0&&e.chatContents.setEarliestMessageId(s[0].messageID);const n=e.chatContents.messageList.clientHeight;e.chatContents.messageListWrapper.scrollTop=n-i,this.setIsLoadingHistory(e,!1)})).catch((t=>{error(t),this.setIsLoadingHistory(e,!1)}))}setIsLoadingHistory(e,t){e.isLoadingHistory=t,t?e.loadHistoryMessagesDOM.showLoading():e.loadHistoryMessagesDOM.hideLoading()}repositionChildren(){super.repositionChildren();const e=this.currentlyDisplayedPmSession();if(void 0===e)return;const t=this.element.offsetHeight-(0,R.$h)()-this.backButtonContainer.offsetHeight-this.mediaDockHeight;e.chatContents.messageListWrapper.style.height=`${t}px`}initializePmSession(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=this.pmSessions.get(e);if(void 0===n){(0,w.jU)();const s=new R.Z_({onTipRequest:e=>{ue.f6.fire(e)},onToggleDebugMode:()=>{this.chatConnection.toggleAppDebugging()},onChatMessage:t=>{this.orderedPMSessionKeys.addToTop(e),(0,Fe.F_)({message:t,username:e,source:"mobilePM",roomName:this.chatConnection.room(),media:this.mobileMediaDock.mobileMediaList()}).catch((e=>{this.sendPrivateMessageFailCallback(e)})),this.mobileMediaDock.isEmpty()||(this.mobileMediaDock.clear(),this.mediaDockHeight=0,this.repositionChildren()),Ne.Si.fire(e)}},!0);if(n={chatContents:s,numUnread:0,user:e,loadHistoryMessagesDOM:new Xe.b3,isInitialHistoryLoaded:!1,isNewSessionNotified:!1,isAllHistoryLoaded:!1,isLoadingHistory:!1,isActive:()=>"none"!==s.element.style.display},s.scrolledToBottom.listen((()=>{this.currentlyDisplayedPmSession()===n&&Ne.Si.fire(e)})),this.mobileMediaDock=new Qe.Xt(s),s.initMediaDock(this.mobileMediaDock),this.mobileMediaDock.setRoom(this.chatConnection.room()),this.newPMSessionEvent.fire(n),this.pmSessions.set(e,n),n.chatContents.appendNoticeDiv((0,Je.CM)(P.R.privateConversationWithText(e))),n.chatContents.appendNoticeDiv((0,Je.CM)(P.R.conversationCautionMessage(l.m.siteName))),!t&&i){var o,r;const t=null!==(o=null===(r=a.Bm.current.loggedInUser)||void 0===r?void 0:r.isAgeVerified)&&void 0!==o&&o;n.chatContents.appendMessageDiv((0,Je.YC)(e,t))}else n.chatContents.appendNoticeDiv(n.loadHistoryMessagesDOM.getElement());n.chatContents.element.style.display="none",this.addChild(n.chatContents)}return s||!t||n.isNewSessionNotified||(n.isNewSessionNotified=!0,it.fire({username:e,PMChatLink:new _e.Ni({onClick:()=>{Ke.E3.fire({username:e,focus:!0,showSupporterAlert:!1})}})})),this.repositionChildren(),n}definePMLinkOnClick(e){this.hideCurrentPMSession(),this.orderedPMSessionKeys.makeCurrent(e),this.showCurrentPMSession()}newPrivateMessage(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.chatConnection.isBroadcasting)return;this.appendMessageDiv((0,Je.j7)(e),e.fromUser.username,e.otherUsername,t);const i=(0,tt.bB)(e);void 0!==i&&this.appendMessageDiv(i,e.fromUser.username,e.otherUsername,t),this.maybeIncrementUnreadForPm(e,t)}maybeIncrementUnreadForPm(e){var t;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.fromUser.username===(null===(t=a.Bm.current.loggedInUser)||void 0===t?void 0:t.username)||i||!0===e.isPrivateShowMessage&&"chat"===ce.S.currentTab)return;const s=this.pmSessions.get(e.otherUsername);!s||this.orderedPMSessionKeys.currentElem===e.otherUsername&&s.isActive()||(s.numUnread+=1,this.incrementUnread())}incrementUnread(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;e<=0||(this.numUnread+=e,this.numUnreadChanged.fire(this.numUnread))}decrementUnread(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;e<=0||(this.numUnread-=e,this.numUnreadChanged.fire(this.numUnread))}resetNumUnread(){this.numUnread=0,this.numUnreadChanged.fire(this.numUnread)}markSessionRead(e){e.numUnread>0&&(this.decrementUnread(e.numUnread),e.numUnread=0),f.Zm.fire(e.user),Ne.Si.fire(e.user)}afterListItemRemoved(e){const t=this.pmSessions.get(e);void 0!==t&&(this.decrementUnread(t.numUnread),t.numUnread=0)}appendMessageDiv(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.orderedPMSessionKeys.addToTop(i);const n=this.initializePmSession(i,t!==this.chatConnection.username(),!1,s);s&&!1===n.isInitialHistoryLoaded&&(n.isInitialHistoryLoaded=!0),n.isInitialHistoryLoaded&&n.chatContents.appendMessageDiv(e)}possiblyAppendMessageDiv(e){const t=this.currentlyDisplayedPmSession();void 0!==t&&t.isActive()&&t.chatContents.appendMessageDiv(e)}getNumSessions(){return this.pmSessions.size}currentlyDisplayedPmSession(){if(void 0!==this.orderedPMSessionKeys.currentElem)return this.pmSessions.get(this.orderedPMSessionKeys.currentElem)}showNextPMSession(){return this.hideCurrentPMSession(),void 0!==this.orderedPMSessionKeys.nextElem()&&(this.showCurrentPMSession(),!0)}closePMSession(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.pmSessions.get(e);if(void 0===i)return;this.closePMSessionEvent.fire(i);const s=this.orderedPMSessionKeys.currentElem===e;this.orderedPMSessionKeys.remove(e),this.removeChild(i.chatContents),i.chatContents.dispose(),this.pmSessions.delete(e),s&&t&&(this.showNextPMSession()||this.leavePmWindow()),this.decrementUnread(i.numUnread),(0,w.Rj)()}showCurrentPMSession(){if(void 0===this.orderedPMSessionKeys.currentElem)return void error("no currentpmsession");const e=this.orderedPMSessionKeys.currentElem,t=this.pmSessions.get(e);void 0!==t?(t.isInitialHistoryLoaded||(this.loadHistoryMessages(t,!0),t.isInitialHistoryLoaded=!0),t.chatContents.showElement(),this.sendDmButton.textContent=P.R.sendDmToUser(t.user),this.repositionChildrenRecursive(),t.chatContents.scrollToBottom(),this.markSessionRead(t)):error("PmWindow.showCurrentPMSession - no pm session")}hideCurrentPMSession(){const e=this.currentlyDisplayedPmSession();void 0!==e&&(e.chatContents.element.style.display="none")}getSession(e){return this.pmSessions.get(e)}getOrCreateSession(e){var t;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return null!==(t=this.pmSessions.get(e))&&void 0!==t?t:this.initializePmSession(e,i,s,n)}clear(){for(const e of this.pmSessions.keys())this.closePMSession(e)}adjustBackButtonSize(e){this.backButtonContainer.style.fontSize=e}createBackButton(e){const t=document.createElement("div");(0,W.ZM)(t,{borderBottom:"1px solid #EFEFEF",padding:"12px",fontSize:"9pt",fontFamily:"Tahoma, Arial, Helvetica, sans-serif",boxSizing:"border-box",display:"flex",gap:"16px"});const i=document.createElement("span");return(0,W.ZM)(i,{display:"inline-block",color:"#0471a1",flex:1}),i.onclick=e.onBackClick,i.innerText=P.R.back,t.appendChild(i),this.sendDmButton=document.createElement("span"),(0,W.ZM)(this.sendDmButton,{display:"inline-block",color:"#DC5500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),this.sendDmButton.onclick=e.onSendDmClick,t.appendChild(this.sendDmButton),t}}var nt=i(8227);const ot=e=>{const t=new nt.b0;return(0,I.tT)("div",{colorClass:"PrivateContainer",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px"}},e.privateShowInfo.element,t.element)};var rt=i(34);class at extends b.u{constructor(){super();const e=new w.gt;f.X0.listen((t=>{const{allowPrivateShow:i,privatePrice:s,spyPrice:n,privateMinMinutes:o,allowShowRecordings:r,roomStatus:a,isAgeVerified:l,hasFanClub:h,activePassword:d}=t.dossier;this.updateData({allowPrivateShow:i,privatePrice:s,spyPrice:n,privateMinMinutes:o,allowShowRecordings:r,hasFanClub:h,activePassword:d},a,l),t.chatConnection.event.settingsUpdate.listen((e=>{"privaterequesting"===this.currentStatus&&this.privateShowSettingsChanged(e)&&(0,rt.yx)(t.chatConnection,!1),this.updateData(e,this.currentStatus,this.isAgeVerified)})).addTo(e),t.chatConnection.event.statusChange.listen((e=>{let{previousStatus:t,currentStatus:i}=e;t!==i&&("privatewatching"===t?this.privateContext=void 0:"privatespying"===t&&(this.spyContext=void 0)),this.updateData(this.roomSettings,i,this.isAgeVerified)})).addTo(e)})),f.Gr.listen((()=>{e.removeAll(),this.privateContext=void 0,this.spyContext=void 0}))}initData(){this.roomSettings={allowPrivateShow:!1,privateMinMinutes:0,privatePrice:0,spyPrice:0,allowShowRecordings:!1,hasFanClub:!1,activePassword:!1},this.currentStatus="offline",this.isAgeVerified=!1,this.privateContext=void 0,this.spyContext=void 0}initUI(){this.element=(0,I.tT)("div",{colorClass:"PrivateShowInfo",style:{fontSize:"12px",lineHeight:"16px"}}),this.render()}updateData(e,t,i){this.roomSettings=e,this.currentStatus=t,this.isAgeVerified=i,this.render()}privateShowSettingsChanged(e){return this.roomSettings.allowPrivateShow!==e.allowPrivateShow||this.roomSettings.allowShowRecordings!==e.allowShowRecordings||this.roomSettings.privateMinMinutes!==e.privateMinMinutes||this.roomSettings.privatePrice!==e.privatePrice}render(){const e="privatewatching"===this.currentStatus,t="privatespying"===this.currentStatus;if(!(e||t||this.roomSettings.allowPrivateShow&&this.isAgeVerified))return this.renderElementContents((0,I.tT)(ut,null)),this.element;if("privatenotwatching"===this.currentStatus)this.renderElementContents((0,I.tT)(pt,{spyPrice:this.roomSettings.spyPrice,roomStatus:this.currentStatus}));else if(e){const e=e=>{this.renderElementContents((0,I.tT)(ct,{privatePrice:e.privatePrice,privateMinMinutes:e.privateMinMinutes,allowShowRecordings:e.allowShowRecordings,roomStatus:this.currentStatus}))};void 0!==this.privateContext?e(this.privateContext):(0,rt.S1)(a.Aw.getState().room).then((t=>{this.privateContext=t,e(this.privateContext)})).catch((()=>{e(this.roomSettings)}))}else if(t){const e=e=>{this.renderElementContents((0,I.tT)(pt,{spyPrice:e.spyPrice,roomStatus:this.currentStatus}))};void 0!==this.spyContext?e(this.spyContext):(0,rt.DZ)(a.Aw.getState().room).then((t=>{this.spyContext=t,e(this.spyContext)})).catch((()=>{e(this.roomSettings)}))}else this.renderElementContents((0,I.tT)(ct,{privatePrice:this.roomSettings.privatePrice,privateMinMinutes:this.roomSettings.privateMinMinutes,allowShowRecordings:this.roomSettings.allowShowRecordings,roomStatus:this.currentStatus}));return this.element}renderElementContents(e){this.removeAllDOMChildren(),this.element.appendChild(e),this.didRepositionEvent.fire(void 0)}}const lt=e=>{const t={lineHeight:"24px",display:"block",...e.styles};return(0,I.tT)("span",{colorClass:"title",style:t},e.text)},ht=e=>{const t={display:"flex",alignItems:"center"},i={marginRight:"8px"},s="privaterequesting"===e.roomStatus,n="privatewatching"===e.roomStatus,o="privatespying"===e.roomStatus;return s?(0,I.tT)("div",{style:t},(0,I.tT)("img",{src:`${STATIC_URL_MOBILE}waiting-indicator.svg`,style:i}),(0,I.tT)("span",{colorClass:"waitingText"},`${P.R.waitingToConnect}...`)):n||o?(0,I.tT)("div",{style:t},(0,I.tT)("img",{src:`${STATIC_URL_MOBILE}connected-indicator.svg`,style:i}),(0,I.tT)("span",{colorClass:"connectedText"},n?P.R.started:P.R.spyingNow)):(0,I.tT)("div",{style:{display:"none"}})},dt=e=>(0,I.tT)("div",{style:{display:"flex",alignItems:"center",marginBottom:"4px"}},(0,I.tT)(lt,{text:e.titleText,styles:{marginRight:"8px"}}),(0,I.tT)(ht,{roomStatus:e.roomStatus})),ct=e=>(0,I.tT)("div",{style:{marginRight:"4px"}},(0,I.tT)(dt,{titleText:P.R.privateShowText,roomStatus:e.roomStatus}),(0,I.tT)("div",null,(0,I.tT)("span",null,`${P.R.priceTokensPerMinuteMessage(e.privatePrice,!0)}, `),(0,I.tT)("span",null,`${P.R.privateShowMinimumMinuteMessage(e.privateMinMinutes,!0)}.`)),e.allowShowRecordings?(0,I.tT)("span",null,P.R.youWillReceiveRecording):(0,I.tT)("span",null,P.R.broadcasterDisabledRecordings)),ut=()=>(0,I.tT)("div",null,(0,I.tT)(lt,{text:P.R.privateShowText}),(0,I.tT)("span",null,P.R.privatesNotAvailable)),pt=e=>(0,I.tT)("div",null,(0,I.tT)(dt,{titleText:P.R.privateShowSpyLabel,roomStatus:e.roomStatus}),e.spyPrice>0&&(0,I.tT)("span",null,`${P.R.spyShowCost}: ${P.R.priceTokensPerMinuteMessage(e.spyPrice,!0)}`),e.spyPrice<=0&&(0,I.tT)("span",null,P.R.privateShowSpyDisabled));class mt extends b.u{constructor(){super(),this.initNoticeDeclutterer();const e=new w.gt;if(f.X0.listen((t=>{this.chatConnection=t.chatConnection,this.chatContents.appendMessageDiv((0,Je.CM)(P.R.viewerWelcomeWarning)),this.chatContents.appendMessageDiv((0,Je.CM)(P.R.mobileWelcomeMessage)),(0,ze.LQ)(t.dossier.room,t.dossier.roomUid,t.dossier.appsRunning,"mobile").then((e=>{this.chatContents.appendMessageDiv(e)})).catch(Ge.yZ),t.chatConnection.event.roomShortcode.listen((e=>{const t=(0,Je.j8)(e);this.chatContents.appendMessageDiv(t)})).addTo(e),t.chatConnection.event.roomMessage.listen((e=>{Oe.k.getInstance().addRecentUser(e.fromUser),this.chatContents.appendMessageDiv((0,Je.j7)(e)),this.incrementUnread()})).addTo(e),t.chatConnection.event.roomNotice.listen((e=>{this.newRoomNotice(e)})).addTo(e),t.chatConnection.event.removeMessages.listen((e=>{this.chatContents.handleRemoveMessages(e.username)})).addTo(e),t.chatConnection.event.appDebugLog.listen((e=>{t.chatConnection.isAppDebuggingEnabled()&&this.chatContents.appendMessageDiv((0,Je.CM)(`DEBUG: ${e}`))})).addTo(e),this.togglePrivateOverlay(),this.togglePrivateContainer(),t.chatConnection.event.statusChange.listen((()=>{this.togglePrivateOverlay(),this.togglePrivateContainer()})).addTo(e),t.chatConnection.event.onBanSilence.listen((e=>{this.handleBanSilence(e,t)})).addTo(e),this.conversationNotifier=new $e.e(this.chatConnection),a.Bm.current.mergePmDm&&Ne.H4.listen((e=>{var t;if(!0===(null===(t=this.conversationNotifier)||void 0===t?void 0:t.shouldNotify(e.fromUser.username))){const t=this.conversationNotifier.createChatLinkMessage(e.fromUser.username);this.chatContents.appendMessageDiv(t),this.conversationNotifier.preventNotifications(e.otherUsername)}})).addTo(e)})),this.privateShowInfo.didRepositionEvent.listen((()=>{this.repositionChildren()})),new He._({appendMessageDiv:e=>this.chatContents.appendMessageDiv(e),removeMessageDiv:e=>{this.chatContents.removeMessageDiv(e)},getLastMessageId:()=>this.chatContents.getLastMessageId(),messagesSinceId:e=>this.chatContents.messagesSinceId(e),getMessagesScrollTop:()=>this.chatContents.messageListWrapper.scrollTop,getMessagesOffsetHeight:()=>this.chatContents.element.offsetHeight}),Ke.Ch.listen((e=>{this.chatContents.customInputField.appendText(` @${e} `),"chat"!==ce.S.currentTab&&ue.qb.fire("chat")})),Ke.q_.listen((e=>{e?this.chatContents.appendMessageDiv((0,Je.CM)("Debug mode enabled. Type /debug again to disable.")):this.chatContents.appendMessageDiv((0,Je.CM)("Debug mode disabled."))})),!a.Bm.current.mergePmDm){const e=new Ve.k;(0,Fe.SU)()&&Ne.H4.listen((t=>{if(e.shouldNotify(t.fromUser.username)){const i=P.R.newDirectMessageNotice(t.otherUsername),s=new _e.Ni({onClick:()=>{ue.bW.fire(!0),fe.$o.fire(t.otherUsername)}}),n=(0,Je.r_)(i,s.openConversationElement);this.chatContents.appendMessageDiv(n),e.preventNotifications(t.otherUsername)}}))}a.Bm.current.mergePmDm||it.listen((e=>{var t;!0===(null===(t=this.conversationNotifier)||void 0===t?void 0:t.shouldNotify(e.username))&&(this.newPmChatLink(e),this.conversationNotifier.preventNotifications(e.username))})),ue.qb.listen((e=>{"chat"===e&&(this.resetNumUnread(),this.maybeMarkPrivateShowPmsRead(e))})),de.R.listen((e=>{e&&(this.resetNumUnread(),this.maybeMarkPrivateShowPmsRead(void 0,e))})),f.Gr.listen((()=>{var t;this.chatContents.clear(),this.resetNumUnread(),e.removeAll(),null===(t=this.conversationNotifier)||void 0===t||t.dispose(),this.roomNoticeDeclutterer.onRoomCleanup()}))}initData(){this.numUnreadChanged=new w.c_("numUnreadChanged"),this.numUnread=0}initUI(){this.privateShowInfo=new at,this.privateContainer=(0,I.tT)(ot,{privateShowInfo:this.privateShowInfo}),this.element.appendChild(this.privateContainer);const e={onTipRequest:e=>{ue.f6.fire(e)},onToggleDebugMode:()=>{this.chatConnection.toggleAppDebugging()},onChatMessage:e=>{if(this.chatConnection.inPrivateRoom()){const t={message:e,username:this.chatConnection.isBroadcasting?this.chatConnection.getPrivateShowUser():this.chatConnection.room(),media:void 0,source:"roomviewPM",roomName:this.chatConnection.room()};(0,Fe.F_)(t).catch((e=>{this.chatContents.appendMessageDiv((0,Je.CM)(e.errorMessage))}))}else this.chatConnection.sendRoomMessage(e)},onShortcode:e=>{this.chatConnection.sendShortcode(e)}};this.chatContents=this.addChild(new R.Z_(e))}initNoticeDeclutterer(){this.roomNoticeDeclutterer=new je.z({appendNotice:e=>this.chatContents.appendNoticeMessage(e),appendSentinelDiv:e=>this.chatContents.element.appendChild(e)})}newPmChatLink(e){const t=P.R.mobileNewPrivateMessageNotice(e.username),i=(0,Je.r_)(t,e.PMChatLink.openConversationElement);this.chatContents.appendMessageDiv(i)}newRoomNotice(e){const t=new qe._y({roomNoticeData:e,isChatScrolledToBottom:()=>!this.chatContents.isScrolledUp(),scrollChatToBottom:()=>this.chatContents.scrollToBottom(),getChatScrollTop:()=>this.chatContents.getScrollTop(),setChatScrollTop:e=>this.chatContents.setScrollTop(e)});this.roomNoticeDeclutterer.addRoomNotice(t)}incrementUnread(){"chat"!==ce.S.currentTab&&""===a.Aw.getState().privateShowId&&(this.numUnread+=1,this.numUnreadChanged.fire(this.numUnread))}resetNumUnread(){this.numUnread=0,this.numUnreadChanged.fire(this.numUnread)}maybeMarkPrivateShowPmsRead(){("chat"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce.S.currentTab)||arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this.chatConnection.inPrivateRoom()&&Ne.Si.fire((0,Ze.b5)()?this.chatConnection.getPrivateShowUser():this.chatConnection.room())}togglePrivateOverlay(){if(this.chatConnection.inPrivateRoom()){const e=()=>{Ke.E3.fire({username:this.chatConnection.getPrivateShowUser(),focus:!0,showSupporterAlert:!1})};this.chatConnection.isBroadcasting&&e(),this.chatContents.showPrivateOverlay(this.chatConnection.getPrivateShowUser(),(()=>{this.chatConnection.isBroadcasting?e():ue.qb.fire("private")}))}else this.chatContents.hidePrivateOverlay()}togglePrivateContainer(){["privatenotwatching","privatespying"].includes(this.chatConnection.status)?this.privateContainer.style.display="flex":this.privateContainer.style.display="none",this.repositionChildren()}async handleBanSilence(e,t){if(t.dossier.userName===t.dossier.room||e.silencer===t.dossier.userName){const i=await(0,Ue.t)({bannedUser:e.silenced,createdBy:e.silencer,isSilence:!e.isBan,roomUser:t.dossier.room}),s=e=>{this.showLogMsg(e)},n=(0,We.d)(this.chatContents,e,i,t,s);this.chatContents.appendMessageDiv(n)}}showLogMsg(e){this.chatContents.appendMessageDiv((0,Je.CM)(e))}repositionChildren(){const e=this.element.offsetHeight-(0,R.$h)()-this.privateContainer.offsetHeight;this.chatContents.messageListWrapper.style.height=`${e}px`}getPrivateContainerHeight(){return this.privateContainer.offsetHeight}}class gt extends ve{constructor(){super({tabName:"chat",tabLabel:P.R.chatCapitalized,pageActionName:"ChatOpened"})}initUI(){super.initUI(),this.chatWindow=new mt,this.addChild(this.chatWindow)}getChatContents(){return this.chatWindow.chatContents}getChatWindow(){return this.chatWindow}}var vt,ft=i(82),yt=i(6009),bt=i(7321),wt=i(5088);class Ct extends ft.b{constructor(e){super(e),this.roomIterator=new yt.t(10),this.visible=!1,this.disableRemovalOnScroll=e.disableRemovalOnScroll,this.loadingDiv=this.createLoadingDiv(),wt.M2&&(0,h.wu)("pageshow",window,(e=>{e.persisted&&bt.HA.getInstance().safariReloadAllImages()}))}initData(e){if(super.initData(e),this.selectedGenders=[],(0,n.Pf)()){const e=window.localStorage.getItem(Ct.localStorageGenderKey);null!==e&&(this.selectedGenders=JSON.parse(e))}this.genderCheckboxes=[],this.isLoadingRooms=!1}createElement(e){return(0,I.tT)("div",{style:{fontSize:"12px",overflowY:"scroll"}})}appendRoomsToDiv(e){this.handleLoadingDivRemoval(),this.moreRoomsList.appendRooms(e)}handleLoadingDivRemoval(){this.moreRoomsList.element.contains(this.loadingDiv)&&this.moreRoomsList.element.removeChild(this.loadingDiv)}appendLoadingDiv(){this.isLoadingRooms=!0,this.moreRoomsList.element.appendChild(this.loadingDiv)}handleGenderChange(){this.updateSelectedGendersFromCheckboxes(),(0,C.bT)("ChangeRoomListGender",{selectedGenders:this.selectedGenders.toString()}),(0,n.Pf)()&&(0===this.selectedGenders.length?window.localStorage.removeItem(Ct.localStorageGenderKey):window.localStorage.setItem(Ct.localStorageGenderKey,JSON.stringify(this.selectedGenders))),this.resetAndLoad()}children(){return this.moreRoomsList.rooms}resetAndLoad(){for(const e of this.children())e.stopStreaming();this.appendLoadingDiv(),this.repositionChildren(),this.loadFromNewIterator()}loadFromNewIterator(){this.roomIterator.setGenders(this.selectedGenders),this.appendLoadingDiv(),this.moreRoomsList.setState({roomInfoList:[]}),this.roomIterator.next().then((e=>{this.moreRoomsList.setState({roomInfoList:e}),this.repositionChildrenRecursive(),this.handleLoadingDivRemoval(),this.isLoadingRooms=!1})).catch((e=>{this.isLoadingRooms=!1,error("getNewIterator",e)}))}loadFromCurrentIterator(){this.isLoadingRooms||(this.appendLoadingDiv(),this.roomIterator.next().then((e=>{this.insertLoadedRooms(e)})).catch((e=>{this.isLoadingRooms=!1,error("loadMoreRooms",e)})))}insertLoadedRooms(e){e.length>0?(this.finishInsertLoadedRooms(e),this.isLoadingRooms=!1,this.repositionChildrenRecursive(),this.loadMoreRoomsIfNearBottom(),this.latestEmptyFetch=void 0):(this.isLoadingRooms=!1,this.handleLoadingDivRemoval(),this.latestEmptyFetch=performance.now())}finishInsertLoadedRooms(e){this.removeRoomsScrolledPastTop(),this.appendRoomsToDiv(e)}removeRoomsScrolledPastTop(){if(void 0!==this.getScrolledElement()&&!this.disableRemovalOnScroll){const e=[];if(this.getScrolledElement().scrollTop>this.calculateScrollRemovalThreshold(15))for(const t of this.moreRoomsList.rooms){if(!(t.element.offsetTop!e.includes(t.username))),i=this.moreRoomsList.getRoomInfoList().length-t.length;if(i>0){const e=this.moreRoomsList.element.scrollTop;this.moreRoomsList.spliceRooms(0,i),this.moreRoomsList.element.scrollTop=e-this.calculateScrollRemovalThreshold(i,!1),this.visible&&this.loadMoreRoomsIfNearBottom()}}}loadMoreRoomsIfNearBottom(){if(void 0!==this.latestEmptyFetch){if(performance.now()-this.latestEmptyFetch<3e3)return;this.latestEmptyFetch=void 0}this.getScrolledElement().scrollTop+this.getScrolledElement().offsetHeight+this.calculateScrollRemovalThreshold(5)>=this.getScrolledElement().scrollHeight&&this.loadFromCurrentIterator()}}(vt=Ct).genderOptions=[["Female",P.R.womenText],["Male",P.R.menText],["Couple",P.R.couplesText],["Trans",P.R.transText]],vt.localStorageGenderKey="genders";var St=i(8374);class xt extends St.y{constructor(){super({roomListSource:"mr",animate:!0,showLocation:!0,rooms:()=>this.state.roomInfoList}),this.roomIndex=0}createElement(){return(0,I.tT)("ul",{className:"list",style:xt.ulStyle})}updateState(){super.updateState(),this.roomIndex=this.rooms.length}getRoomInfoList(){return this.state.roomInfoList}appendRooms(e){this.state.roomInfoList.push(...e);for(const t of e)super.appendRoomCard(this.roomIndex+=1,t)}spliceRooms(e,t){this.state.roomInfoList.splice(e,t);const i=this.rooms.splice(e,t);for(const e of i)this.removeChild(e)}}xt.ulStyle={overflowY:"visible",fontSize:"12px",height:"auto",listStyle:"none",margin:0,padding:0};var Tt=i(7882),At=i(7596),Pt=i(4801),kt=i(836),Mt=i(5079);class Rt extends Mt.kb{constructor(e){super(e)}initData(e){super.initData(e),this.roomName=e.roomInfo.room}afterRemovedFromParent(){this.stopStreaming(),super.afterRemovedFromParent()}stopStreaming(){(0,bt.Hy)(this.roomName,!0)}startStreaming(){(0,bt.DL)(this.roomName,this.img,!0,!0)}}class It extends Rt{initData(e){super.initData(e),this.roomInfo=e.roomInfo,this.roomIndex=e.roomIndex}createElement(e){return this.img=(0,I.tT)(Lt,{showLocation:void 0!==e.roomInfo.location,imgUrl:e.roomInfo.img}),(0,I.tT)("li",{style:{position:"relative",width:"auto",height:"auto",overflow:"hidden",display:"block",marginBottom:"4px",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid"},colorClass:"MobileMoreRoomsCard","data-testid":"room-card",onClick:e=>this.fireRoomClick(e)})}initUI(e){super.initUI(e),this.followStar=new At.d({slug:e.roomInfo.room,isFollowing:e.roomInfo.isFollowing}),(0,W.ZM)(this.followStar.element,{width:"",height:""}),this.element.appendChild((0,I.tT)(Et,{roomInfo:this.roomInfo,roomIndex:this.roomIndex,roomImage:this.img,followStar:this.followStar}))}setImageStreamer(){}stopStreaming(){(0,bt.Hy)(this.roomName,!1)}startStreaming(){(0,bt.DL)(this.roomName,this.img,!0,!1)}getLocation(){return this.roomInfo.location}}const Et=e=>{const{room:t,label:i,sourceInfo:s}=e.roomInfo,n=(0,kt.p5)(s),o=n?(0,kt.$F)(s,i):i,r=(0,I.tT)(Ut,{roomLabel:o});return(0,I.tT)("a",{href:(0,c._Y)(`/${t}/`),"data-testid":"room-card","data-room-nav":"true",onClick:e=>e.preventDefault()},e.roomImage,(0,I.tT)(Bt,{roomInfo:e.roomInfo}),e.followStar.element,n&&r)},Lt=e=>(0,I.tT)("img",{src:e.imgUrl,colorClass:"roomImage",className:"moreRooms",style:{width:"100%",height:"calc(100% - 33px)",cursor:"pointer",display:"block",objectFit:"fill"},"data-room-nav":"true"}),Dt=e=>(0,I.tT)("div",{style:void 0!==e.style?e.style:{position:"absolute",width:"100%",textAlign:"center",bottom:"12px",fontSize:"15px"},"data-testid":"room-card-username"},e.roomName),Bt=e=>{const{room:t,displayAge:i,gender:s,countryCode:n,countryName:o}=e.roomInfo,r={display:"flex",alignItems:"center",justifyContent:void 0!==i?"space-between":"flex-end",width:""};return(0,I.tT)("div",{style:{display:"flex",justifyContent:"space-between",padding:"7px 8px",position:"absolute",bottom:0,boxSizing:"border-box",width:"100%",fontSize:"16px",fontFamily:"'UbuntuBold', Arial, Helvetica, sans-serif",maxHeight:"33px"},colorClass:"roomInfo"},(0,I.tT)(Dt,{style:{maxWidth:"calc(100% - 45px)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},roomName:t}),(0,I.tT)("div",{style:r},void 0!==i&&(0,I.tT)("span",{colorClass:"age","data-testid":"room-card-age"},i),(0,I.tT)("img",{style:{verticalAlign:"middle",cursor:"pointer",width:"16px",height:"16px"},"data-testid":"room-card-gender",src:(0,Ze.e0)(s)}),n&&(0,I.tT)("span",{"data-testid":"room-card-thumbnail-flag"},(0,I.tT)(Pt.T,{component:"FlagIcon",componentProps:{countryCode:n,countryName:o,style:{cursor:"pointer",borderRadius:"4px",paddingLeft:"4px"},"data-testid":"mobile-room-card-country"}}))))},Ut=e=>(0,I.tT)("div",{style:{position:"absolute",width:"100%",textAlign:"center",top:"12px",color:"#FFF",fontSize:"12px",textShadow:"1px 1px 1px #000, -1px -1px 1px #000, 1px -1px 1px #000, -1px 1px 1px #000"},className:"thumbnail_label_recommender"},(0,kt.Iq)(e.roomLabel));class Ft extends xt{createRoomCard(e){return new It(e)}createElement(){return(0,I.tT)("ul",{className:"MobileMoreRoomsList"})}}class _t extends Ct{constructor(e){super(e),this.streamVisibleRoomsDebouncer=new y.a((()=>{this.streamVisibleRooms()}),{bounceLimitMS:200}),this.hasInitialLoaded=!1,E.im.listen((e=>{const t=this.children().find((t=>t.getRoomName()===e.roomName));void 0!==t&&t.updateFollowStar(e.following)}))}updateSelectedGendersFromCheckboxes(){this.selectedGenders=[];for(const e of this.genderCheckboxes)e.checked&&this.selectedGenders.push((0,Tt.jM)(e.name))}initUI(){super.initUI(),this.element.appendChild(this.moreRoomsList.element),(0,be.H)(this.moreRoomsList.element)}initData(e){super.initData(e),this.moreRoomsList=new Ft}createElement(e){return(0,I.tT)("div",{style:{height:"100%",overflow:"hidden"}})}getScrolledElement(){return this.moreRoomsList.element}createLoadingDiv(){return(0,I.tT)(Nt,null)}roomWidth(){return((0,ie.DK)()-4-12)/2}roomHeight(){return this.roomWidth()*(111/180)+33}repositionChildren(){super.repositionChildren();const e=this.roomWidth();for(const t of this.children())t.element.style.width=`${e}px`,t.element.style.height=`${this.roomHeight()}px`;this.visible&&this.loadMoreRoomsIfNearBottom()}handleScroll(){this.removeRoomsScrolledPastTop(),this.loadMoreRoomsIfNearBottom(),this.streamVisibleRoomsDebouncer.callFunc()}listVisible(){this.visible=!0,this.hasInitialLoaded||(this.resetAndLoad(),this.hasInitialLoaded=!0)}listHidden(){this.visible=!1;for(const e of this.children())e.stopStreaming()}streamVisibleRooms(){if(this.visible){this.repositionChildren();for(const e of this.children()){const t=e.element.offsetTop-this.moreRoomsList.element.scrollTop,i=Math.min(0,t),s=this.moreRoomsList.element.scrollTop+this.moreRoomsList.element.offsetHeight-(e.element.offsetTop+e.element.offsetHeight),n=Math.min(0,s),o=Math.max(0,e.element.offsetHeight+n+i)/e.element.offsetHeight;e.stopStreaming(),o>=.6&&e.startStreaming()}}}buildGenderCheckbox(e){const t=()=>{i.blur()},i=(0,I.tT)("input",{type:"checkbox",style:{height:"34px",verticalAlign:"middle"},name:e.toLowerCase(),"data-testid":`${e.toLocaleLowerCase()}-checkbox`,onMouseUp:t,onTouchEnd:t,onChange:()=>{this.handleGenderChange()}});i.checked=this.selectedGenders.indexOf((0,Tt.jM)(e.toLowerCase()))>-1;const s=(0,I.tT)("span",{style:{display:"inline-block",width:"44px",height:"37px",margin:"0 16px 0 8px",textAlign:"center"}},i,(0,I.tT)("img",{src:(0,Ze.e0)(e),style:{verticalAlign:"middle",cursor:"pointer",width:"16px",height:"16px"},onClick:()=>{i.checked=!i.checked,this.handleGenderChange()}}));return this.genderCheckboxes.push(i),s}calculateScrollRemovalThreshold(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e*(this.roomHeight()+4+2)+(t?2:0)}}const Nt=()=>{const e={background:`url("${STATIC_URL_ROOT}images/loading_spinner.svg")`,backgroundSize:"cover",width:"30px",height:"31px",animationName:"spin",animationDuration:"2s",animationTimingFunction:"linear",animationIterationCount:"infinite",animationDelay:"0.01s"};return(0,I.tT)("div",{style:{display:"flex",flex:1,width:"100%",justifyContent:"center",alignItems:"center"}},(0,I.tT)("div",{style:e}))};var Ot=i(76);class Ht extends Ot.Z{constructor(e){super(270,void 0),this.player=e,this.scrollTopReference=0,this.roomList=new _t({disableRemovalOnScroll:!0}),this.genderSelection=document.createElement("div"),this.genderSelection.className="genderSelectionDiv",this.roomList.getScrolledElement().appendChild(this.genderSelection);for(const e of["Female","Male","Couple","Trans"])this.genderSelection.appendChild(this.roomList.buildGenderCheckbox(e));this.addChild(this.roomList),this.roomList.getScrolledElement().onscroll=()=>{this.roomList.handleScroll(),this.lastScrollTop=this.roomList.getScrolledElement().scrollTop,this.showHideGenderSelection()},ue.VZ.listen((()=>{this.lastScrollTop=this.roomList.getScrolledElement().scrollTop}))}show(){this.roomList.listVisible()}hide(){this.roomList.listHidden()}repositionChildren(){this.lastScrollTop===this.roomList.getScrolledElement().scrollTop&&(this.roomList.getScrolledElement().scrollTop=this.roomList.getScrolledElement().scrollTop-this.lastTopPanelHeight+this.roomList.getScrolledElement().offsetTop),this.lastPlayerHeightthis.player.element.offsetHeight&&(this.roomList.getScrolledElement().scrollTop-=this.lastPlayerHeight-this.player.element.offsetHeight),this.lastPlayerHeight=this.player.element.offsetHeight,this.lastTopPanelHeight=this.roomList.getScrolledElement().offsetTop;let e=0;const t=document.getElementById("tab-room-header");null!==t&&(e=t.offsetHeight);const i=document.getElementById("static-header"),s=null!==i?i.offsetHeight:0;this.roomList.element.style.height=(0,ie.mJ)()-this.player.element.offsetHeight-e-s+"px"}showHideGenderSelection(){this.lastScrollTop<=120?this.showGenderSelection():this.lastScrollTop-this.scrollTopReference>=120?(this.scrollTopReference=this.lastScrollTop,this.hideGenderSelection()):this.scrollTopReference-this.lastScrollTop>=120&&(this.scrollTopReference=this.lastScrollTop,this.showGenderSelection())}showGenderSelection(){this.genderSelection.classList.remove("collapsed")}hideGenderSelection(){this.genderSelection.classList.add("collapsed")}}class Wt extends ve{constructor(e){super({tabName:"moreRooms",tabLabel:P.R.moreRoomsText,pageActionName:"MoreRoomsOpened",player:e})}initData(e){super.initData(e),this.player=e.player}initUI(){super.initUI(),this.moreRooms=new Ht(this.player),this.addChild(this.moreRooms),ue.qb.listen((e=>{e===this.getTabName()?this.moreRooms.show():this.moreRooms.hide()}))}}var $t=i(6471);class Vt extends b.u{constructor(){super(),f.X0.listen((()=>{this.showPmList()})),Ne.BM.listen((e=>{this.showPmWindow(),this.pmWindow.definePMLinkOnClick(e)})),Ke.E3.listen((e=>{e.focus&&this.showPmWindow()})),ue.qb.listen((()=>{this.showPmList()}))}initUI(){this.element.classList.add("data-hj-suppress"),this.pmWindow=new st({leavePmWindow:()=>{this.showPmList()}}),this.pmList=new $t.E({onItemRemoved:e=>{this.pmWindow.afterListItemRemoved(e)},isDropdown:!1,openConversationEvent:Ne.BM}),this.addChild(this.pmList),this.addChild(this.pmWindow),this.showPmList()}showPmList(){this.pmList.showElement(),this.pmWindow.hideCurrentPMSession(),this.pmWindow.element.style.visibility="hidden"}showPmWindow(){this.pmList.hideElement(),this.pmWindow.element.style.visibility="visible"}getPmWindow(){return this.pmWindow}}class zt extends ve{constructor(){var e,t;super({tabName:"private",tabLabel:P.R.privateText,pageActionName:"PrivateOpened"}),this.mediaDockHeight=0;const i=new w.gt,s=null!==(e=null===(t=a.Bm.current.loggedInUser)||void 0===t?void 0:t.isAgeVerified)&&void 0!==e&&e;f.X0.listen((e=>{this.chatConnection=e.chatConnection,this.room=e.chatConnection.room();const t=e.chatConnection.isBroadcasting;this.toggleBroadcasterContents(t),t||(this.mobileMediaDock.setRoom(this.room),this.chatHeading.innerText=P.R.privateConversationWithText(this.room),this.chatContents.appendNoticeDiv(this.chatHeading),(0,W.ZM)(this.chatHeading,{fontSize:"14px"}),this.chatContents.appendNoticeDiv(this.loadHistoryMessagesDOM.getElement()),this.chatContents.appendMessageDiv((0,Je.CM)(P.R.conversationCautionMessage(l.m.siteName))),e.dossier.needsSupporterToPm&&this.chatContents.appendMessageDiv((0,Je.YC)(this.room,s)),this.loadHistoryMessages(!0),e.chatConnection.event.roomNotice.listen((e=>{e.showInPrivateMessage&&this.chatContents.appendMessageDiv(new qe._y({roomNoticeData:e,neverCollapse:!0}).element)})).addTo(i))})),Qe.TL.listen((e=>{this.mediaDockHeight=e?(0,Qe.$x)()+10:0,this.repositionChildren(),this.chatContents.scrollToBottom()})),Ne.J9.listen((e=>{this.onConversationMessage(e)})),Ye.yT.conversationDataChanged.listen((()=>{this.updateUnreadCount()})),Ye.yT.unreadConversationsCountUpdate.listen((()=>this.updateUnreadCount())),this.pmManager.getPmWindow().numUnreadChanged.listen((e=>{var t;!0===(null===(t=this.chatConnection)||void 0===t?void 0:t.isBroadcasting)&&this.numUnreadChanged.fire(e)})),ue.qb.listen((e=>{e===this.getTabName()&&this.maybeMarkRead(e)})),this.chatContents.scrolledToBottom.listen((()=>{this.maybeMarkRead()})),this.privateShowInfo.didRepositionEvent.listen((()=>{this.repositionChildren()})),f.Gr.listen((()=>{this.chatContents.clear(),this.resetHistoryData(),i.removeAll()}))}initData(e){super.initData(e),this.resetHistoryData(),this.room="",this.loadHistoryMessagesDOM=new Xe.b3,this.numUnreadChanged=new w.c_("numUnreadChanged");const t={onTipRequest:e=>{ue.f6.fire(e)},onToggleDebugMode:()=>{var e;null===(e=this.chatConnection)||void 0===e||e.toggleAppDebugging()},onChatMessage:e=>{const t={message:e,username:this.room,source:"mobilePM",roomName:this.room};t.media=this.mobileMediaDock.mobileMediaList(),(0,Fe.F_)(t).catch((e=>{this.chatContents.appendMessageDiv((0,Je.CM)(e.errorMessage))})),this.mobileMediaDock.isEmpty()||(this.mobileMediaDock.clear(),this.mediaDockHeight=0,this.repositionChildren())}};this.chatContents=new R.Z_(t,!0),this.mobileMediaDock=new Qe.Xt(this.chatContents),this.chatContents.initMediaDock(this.mobileMediaDock)}initUI(){super.initUI(),(0,O.fZ)(this.element,"PrivateTab"),(0,W.ZM)(this.element,{display:"flex",flexDirection:"column",position:"relative"}),(0,W.ZM)(this.chatContents.element,{flex:1}),this.chatHeading=(0,I.tT)("div",{colorClass:"chatHeading",style:{fontSize:"14px",padding:"4px 5px 0 5px",display:"block",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif"}}),this.privateShowInfo=new at,this.privateContainer=(0,I.tT)(ot,{privateShowInfo:this.privateShowInfo}),this.element.appendChild(this.privateContainer),this.addChild(this.chatContents),this.pmManager=new Vt,this.pmManager.hideElement(),this.addChild(this.pmManager)}toggleBroadcasterContents(){arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?(this.privateContainer.style.display="flex",this.chatContents.showElement(),this.pmManager.hideElement()):(this.privateContainer.style.display="none",this.chatContents.hideElement(),this.pmManager.showElement())}onConversationMessage(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=e.fromUser.username;(e.otherUsername===this.room||i===this.room)&&(this.appendBroadcasterMessageDiv(e),this.firePMChatLink(t),this.maybeMarkRead())}appendBroadcasterMessageDiv(e){if(!this.isInitialHistoryLoaded)return void this.loadHistoryMessages(!0);this.chatContents.appendMessageDiv((0,Je.j7)(e));const t=(0,tt.bB)(e);void 0!==t&&this.chatContents.appendPhotoMessage(t,e)}firePMChatLink(e){e||it.fire({username:this.room,PMChatLink:new _e.Ni({onClick:()=>{ue.qb.fire("private")}})})}updateUnreadCount(){var e,t,i;if(!0===(null===(e=this.chatConnection)||void 0===e?void 0:e.isBroadcasting))return;const s=null!==(t=null===(i=Ye.yT.getInstance().getConversation(this.room))||void 0===i?void 0:i.numUnread)&&void 0!==t?t:0;this.numUnreadChanged.fire(s)}maybeMarkRead(){var e;(arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce.S.currentTab)!==this.getTabName()||this.chatContents.isScrolledUp()||!0===(null===(e=this.chatConnection)||void 0===e?void 0:e.isBroadcasting)||(f.Zm.fire(this.room),Ne.Si.fire(this.room))}loadHistoryMessages(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isAllHistoryLoaded||this.isLoadingHistory)return;const t=this.chatContents.messageList.clientHeight,i=e?"0":this.chatContents.getEarliestMessageId();this.setIsLoadingHistory(!0),(0,Fe.O2)(this.room,this.room,i).then((i=>{const s=i.messages;e&&!this.isInitialHistoryLoaded&&(this.isInitialHistoryLoaded=!0),s.length{this.onConversationMessage(e,!0)})),s.length>0&&this.chatContents.setEarliestMessageId(s[0].messageID);const n=this.chatContents.messageList.clientHeight;this.chatContents.messageListWrapper.scrollTop=n-t})).catch((e=>{error(e)})).finally((()=>{this.setIsLoadingHistory(!1)}))}setIsLoadingHistory(e){this.isLoadingHistory=e,e?this.loadHistoryMessagesDOM.showLoading():this.loadHistoryMessagesDOM.hideLoading()}resetHistoryData(){this.isLoadingHistory=!1,this.isInitialHistoryLoaded=!1,this.isAllHistoryLoaded=!1}repositionChildren(){const e=this.element.offsetHeight-(0,R.$h)()-this.privateContainer.offsetHeight-this.mediaDockHeight;this.chatContents.messageListWrapper.style.height=`${e}px`}getChatContents(){var e;if(!0===(null===(e=this.chatConnection)||void 0===e?void 0:e.isBroadcasting)){var t,i,s;const e=this.chatConnection.getPrivateShowUser(),n=null===(t=this.pmManager.getPmWindow().getSession(e))||void 0===t?void 0:t.chatContents,o=null===(i=this.pmManager.getPmWindow().currentlyDisplayedPmSession())||void 0===i?void 0:i.chatContents;return null!==(s=null!=n?n:o)&&void 0!==s?s:this.chatContents}return this.chatContents}getPrivateShowChatContents(){var e;if(!0===(null===(e=this.chatConnection)||void 0===e?void 0:e.isBroadcasting)){const e=this.chatConnection.getPrivateShowUser();return this.pmManager.getPmWindow().getOrCreateSession(e).chatContents}return this.chatContents}getPrivateContainerHeight(){return this.privateContainer.offsetHeight}}var Gt=i(9757),qt=i(7347);const jt="rgb(239, 239, 239)",Zt="rgb(255, 255, 255)";class Kt extends qt.U{styleContainer(e){e.style.fontSize="16px"}styleHeader(e,t){super.styleHeader(e,t),e.style.fontSize="16px",e.style.padding="12px",e.style.margin="0",e.style.borderBottom=`1px solid ${jt}`,e.style.backgroundColor="rgb(250, 250, 250)",e.style.boxSizing="border-box"}styleRowWrapper(e){super.styleRowWrapper(e),e.style.fontSize="16px",e.style.backgroundColor=`${Zt}`,e.style.padding="12px 18px",e.style.margin="0",e.style.borderBottom=`1px solid ${jt}`,e.style.overflow="hidden",e.style.boxSizing="border-box"}styleLabel(e,t){super.styleLabel(e,t),e.style.color="rgb(51, 51, 51)",e.style.fontSize="16px",e.style.padding="12px 18px",e.style.padding="0",e.style.margin="0"}styleInput(e){super.styleInput(e),e.style.color="rgb(115, 115, 115)",e.style.fontSize="16px",e.style.display="in-block",e.style.cssFloat="right",e.style.webkitAppearance="none",e.style.border="none",e.style.maxWidth="45%",e.style.padding="0",e.style.margin="0",e instanceof HTMLSelectElement&&(e.style.fontSize="16px",e.style.height="",e.style.backgroundColor=`${Zt}`,e.style.backgroundImage=`url(${STATIC_URL_MOBILE}chevron_right_light.svg)`,e.style.backgroundRepeat="no-repeat",e.style.backgroundPosition="right bottom",e.style.backgroundSize="18px 18px",e.style.padding="0 20px 0 0",e.style.textAlign="right",e.style.textAlignLast="right")}}var Jt=i(2382),Yt=i(4660);class Qt extends Yt.J{constructor(e,t,i){super(e,t,i),this.hue=180,this.saturation=1,this.value=1,this.parentHasTouchScrolling=!1,this.element.style.position="fixed",this.element.style.top="15%",this.element.style.boxShadow="0 20px 30px -3px rgba(0, 0, 0, 0.4), 0 8px 12px -2px rgba(0, 0, 0, 0.2)",this.element.style.backgroundColor="white",this.element.style.padding="12px",this.element.style.borderRadius="8px",this.element.style.left="10%",this.element.style.right="10%",this.hexInput.style.fontSize="16px",this.hexInput.style.backgroundColor="#f1f3f4",this.hexInput.style.color="rgb(88, 91, 94)",this.hexInput.style.padding="6px 4px",this.hexInput.style.border="none",this.hexInput.style.width="calc(100% - 33px)",this.hexInput.style.boxSizing="border-box",(0,h.wu)("input",this.hexInput,(()=>{const e=this.hexInput.value;(0,Jt.qv)(e)&&this.updateColorSelectors(e,!1)})),this.createSaveAndCancel()}createColorCanvas(){this.palette=document.createElement("div"),this.paletteSelector=document.createElement("div");const e=document.createElement("div");this.bar=document.createElement("div"),this.barSelector=document.createElement("div"),this.preview=document.createElement("div"),this.element.appendChild(this.palette),this.palette.appendChild(this.paletteSelector),this.element.appendChild(e),e.appendChild(this.bar),this.element.appendChild(this.preview),this.bar.appendChild(this.barSelector),this.preview.style.height="25px",this.preview.style.width="25px",this.preview.style.borderRadius="100%",this.preview.style.border="1px solid black",this.preview.style.cssFloat="left",this.preview.style.marginRight="6px",this.palette.style.width="100%",this.palette.style.height="200px",this.palette.style.position="relative",this.bar.style.background="linear-gradient(90deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red)",e.style.padding="2px 0",this.bar.style.position="relative",this.bar.style.width="100%",this.bar.style.height="16px",this.bar.style.borderRadius="6px",this.bar.style.margin="24px 0",this.bar.style.padding="0 4px",this.bar.style.boxSizing="border-box",this.styleSelector(this.paletteSelector),this.styleSelector(this.barSelector),this.barSelector.style.boxShadow="0 0 4px rgba(0, 0, 0, 0.8)";const t=e=>{e.stopPropagation(),e.preventDefault();const t=e.touches[0].clientX-this.bar.getBoundingClientRect().left;this.setBarSelectorPosition(t)};e.ontouchstart=e=>{t(e)},e.ontouchmove=e=>{t(e)};const i=e=>{e.stopPropagation(),e.preventDefault();const t=e.touches[0].clientX-this.palette.getBoundingClientRect().left,i=e.touches[0].clientY-this.palette.getBoundingClientRect().top;this.setPaletteSelectorPosition(t,i)};this.palette.ontouchstart=e=>{i(e)},this.palette.ontouchmove=e=>{i(e)}}styleSelector(e){e.style.position="absolute",e.style.height="16px",e.style.width="16px",e.style.border="2px solid #fff",e.style.borderRadius="100%",e.style["-webkit-user-select"]="none",e.style.top="-2px"}setBarSelectorPosition(e){let t=Math.min(e,this.bar.offsetWidth);t=Math.max(0,t),this.hue=t/this.bar.offsetWidth*360,this.barSelector.style.left=t-this.barSelector.offsetWidth/2+"px",this.updateColors(!0)}setBarSelectorPercentage(e){let t=Math.min(1,e);t=Math.max(0,t),this.barSelector.style.left=t*this.bar.offsetWidth-this.barSelector.offsetWidth/2+"px"}setPaletteSelectorPosition(e,t){let i=Math.min(e,this.palette.offsetWidth);i=Math.max(0,i),this.saturation=i/this.palette.offsetWidth;let s=Math.min(t,this.palette.offsetHeight);s=Math.max(0,s),this.value=1-s/this.palette.offsetHeight,this.paletteSelector.style.left=i-this.paletteSelector.offsetWidth/2+"px",this.paletteSelector.style.top=s-this.paletteSelector.offsetWidth/2+"px",this.updateColors(!0)}setPaletteSelectorPercentage(e,t){this.paletteSelector.style.left=e*this.palette.offsetWidth-this.paletteSelector.offsetWidth/2+"px",this.paletteSelector.style.top=t*this.palette.offsetHeight-this.paletteSelector.offsetHeight/2+"px"}repositionChildren(){this.palette.style.height=(0,ie.mJ)()/3+"px",this.setPaletteSelectorPercentage(this.saturation,1-this.value),(0,se.K$)()||this.hide()}colorPicked(e){super.colorPicked(e),this.preview.style.backgroundColor=`${e}`}createSaveAndCancel(){const e=this.createButton(P.R.saveCAPS),t=this.createButton(P.R.cancelCAPS);e.style.backgroundColor="rgb(255, 112, 2)",t.style.backgroundColor="transparent",t.style.color="#1C6B92",t.style.marginRight="4px",e.onclick=()=>{this.colorPicked(this.hexInput.value),this.hide()},t.onclick=()=>{this.hide()},this.element.appendChild(e),this.element.appendChild(t)}updateColors(e){const t=(0,Jt.ko)(this.hue,1,1);this.palette.style.background=`linear-gradient(to top, rgb(0, 0, 0), transparent), linear-gradient(to left, rgb(${t.red}, ${t.green}, ${t.blue}), rgb(255, 255, 255))`,this.barSelector.style.backgroundColor=`rgb(${t.red}, ${t.green}, ${t.blue})`;const i=(0,Jt.ko)(this.hue,this.saturation,this.value);this.preview.style.backgroundColor=`rgb(${i.red}, ${i.green}, ${i.blue})`,this.paletteSelector.style.backgroundColor=`rgb(${i.red}, ${i.green}, ${i.blue})`,e&&(this.hexInput.value=`#${(0,Jt.Ob)(i).toLocaleUpperCase()}`)}createButton(e){const t=document.createElement("button");return t.textContent=e,t.style.borderRadius="4px",t.style.fontSize="16px",t.style.color="white",t.style.textAlign="center",t.style.cursor="pointer",t.style.border="none",t.style.padding="6px 16px",t.style.margin="12px 0 4px 0",t.style.display="inline-block",t.style.cssFloat="right",t}updateColorSelectors(e,t){const i=(0,Jt.oH)(e);this.hue=i.hue,this.saturation=i.saturation,this.value=i.value,this.setBarSelectorPercentage(this.hue/360),this.setPaletteSelectorPercentage(this.saturation,1-this.value),this.updateColors(t)}show(e){this.initialColor=e,this.styleForShow(),this.updateColorSelectors(e,!0),void 0!==this.parent&&"touch"===this.parent.element.style["-webkit-overflow-scrolling"]&&(this.parent.element.style["-webkit-overflow-scrolling"]="",this.parentHasTouchScrolling=!0)}hide(){super.hide(),void 0!==this.parent&&this.parentHasTouchScrolling&&(this.parent.element.style["-webkit-overflow-scrolling"]="touch",this.parentHasTouchScrolling=!1)}}class Xt extends v.m{initData(){super.initData(),this.showManageIgnoredUsers=new w.c_("ShowManageIgnoredUsers"),this.isAgeVerified=!1}initUI(){var e;super.initUI(),this.element.style.padding="0px",this.element.style.margin="0px",this.element.style.fontSize="16px",null===(e=this.chatSettingsStyles)||void 0===e||e.styleLabel(this.manageIgnoredUsersLink,P.R.viewEditIgnoredUsers),(0,W.ZM)(this.form,{maxWidth:"100%"}),this.manageIgnoredUsersLink.onclick=()=>{(0,p.rC)('You must be logged in to edit ignored users. Click "OK" to login.')||this.showManageIgnoredUsers.fire(void 0)}}handleRoomLoaded(e){super.handleRoomLoaded(e),this.isAgeVerified=e.dossier.isAgeVerified}getStyles(){return void 0===this.chatSettingsStyles&&(this.chatSettingsStyles=new Kt),this.chatSettingsStyles}getEmoticonAutocompleteDelayOptions(){return[{label:"Turn Off",value:"-1"},{label:"0s",value:"0"},{label:"0.5s",value:"500"},{label:"1s",value:"1000"},{label:"1.5s",value:"1500"}]}getHighestTokenColorOptions(){return[{label:"Dark Purple",value:"darkpurple"},{label:"Light Purple",value:"lightpurple"},{label:"Dark Blue",value:"darkblue"},{label:"Light Blue",value:"lightblue"}]}getSaveEndpoint(){return this.isBroadcaster()?"api/broadcasterchatsettings/":super.getSaveEndpoint()}getSaveColorEndpoint(){return this.isBroadcaster()?"choose_broadcaster_chat_color/":super.getSaveColorEndpoint()}getFormData(){return super.getFormData()}isBroadcaster(){var e;return(null===(e=a.Bm.current.loggedInUser)||void 0===e?void 0:e.username)===this.roomName&&this.isAgeVerified}styleWrapperCustom(e){super.styleWrapperCustom(e),e.style.padding="0"}styleLabelCustom(e){super.styleLabelCustom(e),e.style.padding="12px 18px"}styleCheckbox(e){super.styleCheckbox(e),e.style.margin="6px 18px 6px 0",e.style.cssFloat="right"}styleSlider(e){super.styleSlider(e),e.element.style.marginTop="2px"}styleColorSwatch(e){super.styleColorSwatch(e),e.style.margin="11px 21px 11px 0px"}createColorPickerModal(){return new Qt(this.chatColorSwatch,(e=>this.onColorPicked(e)),(e=>this.onColorHovered(e)))}updateSelectWidth(e){const t=document.createElement("span");t.style.fontSize="16",t.style.padding="0",t.style.margin="0",t.style.cssFloat="left",t.style.whiteSpace="nowrap",t.style.fontFamily=getComputedStyle(e).getPropertyValue("font-family"),t.innerText=e.options[e.selectedIndex].text,document.body.appendChild(t);const i=t.getBoundingClientRect().width;document.body.removeChild(t),e.style.width=`${i+18+2}px`}}class ei extends Ot.Z{constructor(){super(Math.min((0,ie.DK)()-50,400),void 0,!0),this.chatSettings=new Xt,(0,W.ZM)(this.chatSettings.element,{height:"calc(100% - 45px)"}),(0,be.H)(this.chatSettings.element),this.addChild(this.chatSettings),this.element.style.backgroundColor="rgb(250, 250, 250)";const e=document.createElement("div");let t;e.innerText=P.R.chatSettingsSavedText,e.style.position="absolute",e.style.top="2px",e.style.right="2px",e.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",e.style.color="#000000",e.style.backgroundColor="#d8deea",e.style.border="1px solid #acacac",e.style.borderRadius="4px",e.style.padding="4px 6px",e.style.visibility="hidden",this.element.appendChild(e),this.chatSettings.chatSettingsSavedRequest.listen((()=>{clearTimeout(t),(0,T.Ve)(e,"250ms"),e.style.visibility="visible",t=window.setTimeout((()=>{(0,T.Ve)(e,"1000ms"),e.style.visibility="hidden"}),2500)}))}show(){super.show(),this.chatSettings.getTipVolumeSlider().handleResize()}repositionChildren(){this.width=Math.min((0,ie.DK)()-50,400)}}var ti=i(3417),ii=i(90);class si extends Ot.Z{constructor(){super(Math.min((0,ie.DK)()-50,400),void 0,!0,P.R.backToChatSettings),this.styles=new Kt,this.ignoredUsersContainer=document.createElement("div"),this.ignoredUsersList=document.createElement("div"),this.element.appendChild(this.ignoredUsersContainer),this.ignoredUsersContainer.appendChild(this.ignoredUsersList),(0,W.ZM)(this.ignoredUsersContainer,{height:"calc(100% - 45px)"}),(0,be.H)(this.ignoredUsersContainer),this.styles.styleContainer(this.ignoredUsersContainer),f.X0.listen((e=>{this.chatConnection=e.chatConnection,this.createIgnoredUsersList()}))}show(){super.show(),this.createIgnoredUsersList()}createIgnoredUsersList(){if(this.clearIgnoredUsersList(),void 0!==a.Bm.current.loggedInUser)if(void 0===this.chatConnection)this.ignoredUsersList.appendChild(this.createSpecialMessage(P.R.loadingText));else{const e=(0,ti.V6)(!0);if(0===e.size)this.ignoredUsersList.appendChild(this.createSpecialMessage(P.R.noOneIgnored));else for(const t of e)this.createIgnoredUserRow(t)}}createSpecialMessage(e){const t=document.createElement("div");return this.styles.styleRowWrapper(t),t.innerText=e,t.style.borderBottom="none",t}clearIgnoredUsersList(){for(;null!==this.ignoredUsersList.firstChild;)this.ignoredUsersList.removeChild(this.ignoredUsersList.firstChild)}createIgnoredUserRow(e){const t=document.createElement("div"),i=document.createElement("label"),s=document.createElement("img");this.ignoredUsersList.appendChild(t),t.appendChild(i),t.appendChild(s),this.styles.styleRowWrapper(t),this.styles.styleLabel(i,e),this.styles.styleInput(s),s.src=`${STATIC_URL_MOBILE}remove.svg`,s.style.height="18px";let n=!1;const o=new ii.P(!1,((e,i)=>{if(i)t.style.opacity="0.4";else if(e){const e=100;(0,T.Ve)(t,`opacity ${e}ms`),t.style.opacity="0",window.setTimeout((()=>{this.ignoredUsersList.removeChild(t)}),e)}}),(()=>{t.style.opacity="1.0",n=!1}));s.onclick=()=>{void 0!==this.chatConnection&&(n||(n=!0,o.dispatch(!0,this.chatConnection.unignore(e))))}}}b.u;const ni={underage:P.R.reportAbuseCatUnderage,advertising:P.R.reportAbuseCatAdvertising,abusive:P.R.reportAbuseCatAbusive,intoxicated:P.R.reportAbuseCatIntoxicated,"large toy":P.R.reportAbuseCatLarge,"offline payments":P.R.reportAbuseCatOffline,"public broadcast":P.R.reportAbuseCatPublic,"service uniform":P.R.reportAbuseCatUniform,sleeping:P.R.reportAbuseCatSleeping,gender:P.R.reportAbuseCatGender,other:P.R.reportAbuseCatOther};class oi extends b.u{constructor(){super(),this.closeEvent=new w.c_("reset"),this.formContainer=document.createElement("div"),this.blankOption=document.createElement("option"),this.submittedMsg=document.createElement("div"),this.categoryRequiredMsg=document.createElement("div"),this.commentsRequiredMsg=document.createElement("div"),this.categorySelect=document.createElement("select"),this.textBox=document.createElement("textarea"),this.reportAbuseForm=document.createElement("form"),this.hideTimeout=0,(0,W.ZM)(this.element,{display:"block",color:"#6C6C78",fontSize:"14px",height:"calc(100% - 45px)",boxSizing:"border-box",position:"absolute",padding:"19px"}),(0,be.H)(this.element,!0),this.element.appendChild(this.formContainer),this.reportAbuseForm.method="post",this.reportAbuseForm.dataset.testid="report-abuse-form",this.formContainer.appendChild(this.reportAbuseForm);const e=document.createElement("div");e.style.paddingBottom="10px",e.style.width="100%",e.style.display="inline-block",e.style.maxWidth="100%",this.reportAbuseForm.appendChild(e),this.categorySelect.style.border="1px solid #A4A4A4",this.categorySelect.style.fontSize="16px",this.categorySelect.style.width="99%",this.categorySelect.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",this.categorySelect.dataset.testid="report-abuse-category",e.appendChild(this.categorySelect),this.blankOption.value="",this.blankOption.disabled=!0,this.blankOption.selected=!0,this.blankOption.textContent=P.R.chooseCategoryText,this.categorySelect.appendChild(this.blankOption);for(const e in ni){const t=document.createElement("option");t.value=e,t.innerText=ni[e],this.categorySelect.appendChild(t)}this.categoryRequiredMsg.style.display="none",this.categoryRequiredMsg.style.color="#EA3323";const t=document.createElement("span");t.textContent=P.R.reportAbuseCategoryRequired,t.style.fontSize="14px",this.categoryRequiredMsg.appendChild(t),e.appendChild(this.categoryRequiredMsg);const i=document.createElement("p");i.style.fontWeight="bold",i.style.margin="0.5em 0px 0.2em",i.innerText=P.R.reportAbuseAdditionalComments,e.appendChild(i),this.textBox.draggable=!1,this.textBox.maxLength=2048,this.textBox.style.boxSizing="border-box",this.textBox.style.width="100%",this.textBox.style.fontSize="16px",this.textBox.style.padding="3px",this.textBox.style.border="1px solid #A4A4A4",this.textBox.style.height="55px",this.textBox.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",this.textBox.dataset.testid="report-abuse-comments",(0,be.H)(this.textBox,!0),e.appendChild(this.textBox),this.commentsRequiredMsg.style.color="#EA3323",this.commentsRequiredMsg.style.display="none";const s=document.createElement("span");s.textContent=P.R.reportAbuseDescriptionRequired,s.style.fontSize="14px",this.commentsRequiredMsg.appendChild(s),e.appendChild(this.commentsRequiredMsg);const n=document.createElement("div");n.style.paddingTop="10px";const o=document.createElement("a");o.textContent=P.R.reportCAPS,o.style.cssFloat="right",o.style.display="block",o.style.width="auto",o.style.padding="6px 16px",o.style.fontSize="16px",o.style.color="#FFF",o.style.backgroundColor="#EA3323",o.dataset.testid="report-abuse-submit",n.appendChild(o),o.onclick=e=>{this.sendReport()};const r=document.createElement("a");r.textContent=P.R.cancelText,r.style.cssFloat="right",r.style.display="block",r.style.width="auto",r.style.padding="6px 16px",r.style.fontSize="16px",r.style.color="#1C6B92",r.style.marginRight="8px",r.dataset.testid="report-abuse-cancel",n.appendChild(r),r.onclick=e=>{this.closeEvent.fire(!0)},e.appendChild(n);const a=document.createElement("div");a.style.clear="both",e.appendChild(a);const l=document.createElement("div");l.style.fontSize="12px",l.style.marginTop="20px",l.innerText=`${P.R.reportAbuseTextTerms} `;const h=document.createElement("a");h.href=(0,c._Y)("/terms/#room-reports"),h.innerText="Terms",h.dataset.testid="report-abuse-terms-link",l.appendChild(h),e.appendChild(l),this.submittedMsg.style.display="none",this.submittedMsg.style.height="80px",this.submittedMsg.style.lineHeight="80px",this.submittedMsg.style.textAlign="center",this.submittedMsg.style.fontWeight="bold",this.submittedMsg.innerText=P.R.commentSubmittedMessage,this.element.appendChild(this.submittedMsg),f.X0.listen((e=>{this.room=e.dossier.room})),this.categorySelect.onchange=()=>{this.categoryRequiredMsg.style.display="none",this.commentsRequiredMsg.style.display="none"},this.textBox.onchange=()=>{""!==this.textBox.value&&(this.commentsRequiredMsg.style.display="none")},this.element.onclick=e=>{e.stopPropagation()}}sendReport(){""!==this.categorySelect.value?"other"!==this.categorySelect.value||!1!==/[a-z]{2}/i.test(this.textBox.value)?(0,c.KF)(`abuse/report/${this.room}/`,{category:this.categorySelect.value,additional_comments:this.textBox.value}).then((e=>{this.formContainer.style.display="none",this.commentsRequiredMsg.style.display="none",this.showSubmitted(P.R.commentSubmittedMessage),this.reportAbuseForm.reset(),this.delayClose(1e4)})).catch((e=>{this.formContainer.style.display="none",this.showSubmitted(e.xhr.responseText),this.delayClose(1e4)})):this.commentsRequiredMsg.style.display="block":this.categoryRequiredMsg.style.display="block"}reset(){this.formContainer.style.display="block",this.commentsRequiredMsg.style.display="none",this.submittedMsg.style.display="none",this.categorySelect.value="",this.blankOption.setAttribute("selected","selected"),this.reportAbuseForm.reset()}showSubmitted(e){this.submittedMsg.innerText=e,this.submittedMsg.style.display="block"}delayClose(e){clearTimeout(this.hideTimeout),this.hideTimeout=window.setTimeout((()=>{clearTimeout(this.hideTimeout),this.closeEvent.fire(!0)}),e)}}var ri=i(369),ai=i(8006);class li extends ai.v{constructor(){super(),this.enabled=!1,this.commentTriggerEvent=new w.c_("satisfactionCommentShow"),this.hideCommentEvent=new w.c_("satisfactionCommentHide"),this.label=document.createElement("span"),this.satisfiedText=P.R.satisfiedText,this.hideSatisfiedText=!1,this.element.style.height="",this.element.style.width="",this.element.style.position="static",this.element.style.display="block",this.element.style.cursor="pointer",this.innerDiv.style.backgroundColor="",this.innerDiv.style.textShadow="",this.innerDiv.style.color="#6C6C78",this.innerDiv.style.textDecoration="none",this.element.onclick=()=>{this.divClicked()},this.percent.style.fontWeight="bold",(0,O.fZ)(this.label,"satisfactionLabel"),this.label.textContent=this.satisfiedText,this.label.style.margin="0",this.label.style.verticalAlign="top",this.label.style.display="none",this.innerDiv.prepend(this.label),(0,ri.BL)(620).listen((e=>{this.hideSatisfiedText=e,this.label.textContent=this.getSatisfiedLabelText()})),this.thumbsUp.style.marginRight="20px",this.thumbsUpActive.style.marginRight="20px",this.thumbsDown.style.marginLeft="20px",this.thumbsDownActive.style.marginLeft="20px",this.disableVoting()}onVoteError(){super.onVoteError(),this.hideCommentEvent.fire(void 0),(0,d.Q$)(P.R.errorVotingForUser(this.roomName))}styleThumb(e,t){super.styleThumb(e,t),e.height=18,e.width=18,e.style.height="18px",e.style.width="18px"}enableVoteMsg(){return P.R.afterTipVoteSatMobileText(this.roomName,ai.U)}triggerComment(e){this.commentTriggerEvent.fire(e)}stopProp(e){this.enabled&&e.stopPropagation()}enableVoting(){this.element.style.color="#333333",this.label.style.color="#0471A1",this.enabled=!0,super.enableVoting()}disableVoting(){this.element.style.color="#6C6C78",this.label.style.color="",this.enabled=!1,super.disableVoting()}divClicked(){this.enabled||(0,d.Q$)(P.R.allowToVoteMessage(this.roomName,ai.U))}setVoteState(e,t){super.setVoteState(e,t),t?(this.element.style.pointerEvents="none",this.element.style.opacity="0.7"):(this.element.style.pointerEvents="",this.element.style.opacity="1")}getSatisfiedLabelText(e){return void 0!==e&&e.dossier.hideSatisfactionScore&&void 0!==e.dossier.staffInfo?this.hideSatisfiedText?"":P.R.hiddenStaffOnlyTextCAPS:this.hideSatisfiedText?"":P.R.satisfiedText}}class hi extends b.u{constructor(){super(),this.hideEvent=new w.c_("satisfactionCommentHide"),this.message=document.createElement("div"),this.commentSection=document.createElement("div"),this.label=document.createElement("p"),this.textBox=document.createElement("textarea"),this.textLimit=document.createElement("span"),this.buttonBar=document.createElement("div"),this.submittedMsg=document.createElement("p"),this.roomName="",this.submitted=!1,(0,W.ZM)(this.element,{display:"none",position:"static",color:"#6C6C78",fontSize:"14px",height:"calc(100% - 45px)",padding:"19px",boxSizing:"border-box"}),this.element.onclick=e=>{e.stopPropagation()},(0,be.H)(this.element),this.message.style.fontSize="14px",this.element.appendChild(this.message),this.label.style.fontWeight="bold",this.label.style.margin="0.5em 0px 0.2em",this.label.style.display="none",this.label.innerText=P.R.optionalCommentNote,this.textBox.maxLength=155,this.textBox.style.boxSizing="border-box",this.textBox.style.width="100%",this.textBox.style.fontSize="16px",this.textBox.style.padding="3px",this.textBox.style.border="1px solid #A4A4A4",this.textBox.style.height="55px",this.textBox.style.display="none",this.textBox.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",this.textBox.value="",this.textLimit.style.display="none",this.textLimit.style.float="right",this.updateTextLimit(),this.textBox.oninput=()=>{this.updateTextLimit()},this.buttonBar.style.paddingTop="25px",this.buttonBar.style.display="none";const e=document.createElement("a");e.textContent=P.R.submitCAPS,e.style.cssFloat="right",e.style.display="block",e.style.width="auto",e.style.padding="6px 16px",e.style.fontSize="16px",e.style.color="#FFF",e.style.backgroundColor="#FF7002",e.onclick=()=>{this.submitComment(this.textBox.value)},this.buttonBar.appendChild(e);const t=document.createElement("a");t.textContent=P.R.cancelText,t.style.cssFloat="right",t.style.display="block",t.style.width="auto",t.style.padding="6px 12px",t.style.fontSize="16px",t.style.color="#1C6B92",t.style.marginRight="8px",t.onclick=()=>{this.reset(),this.hide()},this.buttonBar.appendChild(t),this.submittedMsg.textContent=P.R.commentSubmittedMessage,this.submittedMsg.style.display="none",this.submittedMsg.style.height="80px",this.submittedMsg.style.lineHeight="80px",this.submittedMsg.style.textAlign="center",this.submittedMsg.style.fontWeight="bold",this.commentSection.appendChild(this.label),this.commentSection.appendChild(this.textBox),this.commentSection.appendChild(this.textLimit),this.commentSection.appendChild(this.buttonBar),this.commentSection.appendChild(this.submittedMsg),this.element.appendChild(this.commentSection),f.X0.listen((e=>{this.setRoom(e.dossier.room)}))}setRoom(e){this.roomName=e,this.message.innerText=P.R.confidentalVoteMessage(e)}show(){this.element.style.display="block",null!==this.textBox.parentNode&&this.textBox.focus(),this.submitted&&this.delayHide(5e3)}reset(){this.submitted=!1,this.textBox.value="",this.updateTextLimit(),this.submittedMsg.style.display="none",this.label.style.display="block",this.textBox.style.display="block",this.textLimit.style.display="block",this.buttonBar.style.display="block"}updateTextLimit(){this.textLimit.innerText=`${this.textBox.value.length}/${this.textBox.maxLength}`}submitComment(e){this.label.style.display="none",this.textBox.style.display="none",this.textLimit.style.display="none",this.buttonBar.style.display="none",this.submittedMsg.textContent=P.R.submittingText,this.submittedMsg.style.display="block",this.submitted=!0,(0,c.KF)(`tipping/add_comment/${this.roomName}/`,{comment:e}).then((()=>{this.submittedMsg.textContent=P.R.commentSubmittedMessage,this.delayHide(5e3)})).catch((e=>{error("Error rating model",e),this.submittedMsg.textContent=P.R.errorSubmitting,this.delayHide(5e3)}))}delayHide(e){clearTimeout(this.hideTimeout),this.hideTimeout=window.setTimeout((()=>{this.hide()}),e)}hide(){clearTimeout(this.hideTimeout),this.element.style.display="none",this.hideEvent.fire(void 0),this.reset()}}class di extends ve{constructor(e){super({tabName:"roomMenu",tabLabel:"•••",pageActionName:"RoomTabOpened",player:e})}initUI(e){super.initUI(e),(0,W.ZM)(this.element,{position:"relative"}),this.roomMenu=this.addChild(new ci({player:e.player}))}getRoomMenu(){return this.roomMenu}}class ci extends b.u{constructor(e){super("div",e)}initData(e){this.room="",this.userList=new F.w,this.satisfactionComment=new hi,this.satisfactionCommentMenuComponent=new Ot.Z((0,ie.DK)(),this.satisfactionComment,!0),this.reportAbuse=new oi,this.reportAbuseMenuComponent=new Ot.Z((0,ie.DK)(),this.reportAbuse,!0),this.chatSettingsComponent=new ei,this.manageIgnoredUsers=new si}initUI(){this.element=(0,I.tT)("div",{style:{width:"100%",height:"100%"}},this.createSendDmMenuItem(),this.createUserListMenuItem(),this.createSatisfactionScoreMenuItem(),this.createReportAbuseMenuItem(),this.createChatSettingsMenuItem(),this.createManageIgnoredUsersMenuItem()),(0,be.H)(this.element),this.element.style["-webkit-overflow-scrolling"]="",this.element.dataset.testid="additional-options-container",this.chatSettingsComponent.chatSettings.showManageIgnoredUsers.listen((()=>{this.manageIgnoredUsers.show()})),f.X0.listen((e=>{this.room=e.dossier.room,this.sendDmLabel.update({text:P.R.sendDmToUser(this.room)})})),f.Gr.listen((()=>{var e;null===(e=this.activeMenuComponent)||void 0===e||e.hide(),this.satisfactionComment.hideElement(),this.satisfactionComment.reset(),this.reportAbuse.reset()})),ue.qb.listen((e=>{"roomMenu"!==e&&this.closeActiveComponent()}))}getUserList(){return this.userList}getReportAbuseForm(){return this.reportAbuse}getReportAbuse(){return this.reportAbuseMenuComponent}getChatSettings(){return this.chatSettingsComponent}openMenuComponent(e){this.closeActiveComponent(),this.activeMenuComponent=e,e.show()}openMenuComponentByName(e){0===e?this.openMenuComponent(this.userList):3===e?this.openMenuComponent(this.chatSettingsComponent):2===e?this.openMenuComponent(this.reportAbuseMenuComponent):1===e&&this.openMenuComponent(this.satisfactionCommentMenuComponent)}closeMenuComponent(e){e===this.chatSettingsComponent&&this.manageIgnoredUsers.hide(),this.activeMenuComponent=void 0,e.hide()}closeActiveComponent(){void 0!==this.activeMenuComponent&&this.closeMenuComponent(this.activeMenuComponent)}createSendDmMenuItem(){const e=document.createElement("div"),t=Gt.c.get("MenuLabel");return this.sendDmLabel=new t({text:P.R.sendDmToUser(this.room),style:{whiteSpace:"nowrap"},onClick:()=>{(0,p.rC)(P.R.loggedInToDm)||(ue.bW.fire(!0),fe.$o.fire(this.room))}},e),e}createUserListMenuItem(){const e=document.createElement("div"),t=new(Gt.c.get("MenuLabel"))({text:P.R.usersText,onClick:()=>{(0,C.bT)("UserlistOpened"),this.openMenuComponent(this.userList)},showChevron:!0},e);return F.K.listen((e=>{t.update({text:`${P.R.usersText} (${e})`})})),(0,I.tT)("div",null,e,this.userList.element)}createSatisfactionScoreMenuItem(){const e=document.createElement("div");(0,O.fZ)(e,"MenuLabel-container");const t=document.createElement("div");new(Gt.c.get("MenuLabel"))({text:P.R.satisfiedText,style:{borderBottom:"none",paddingLeft:"0"}},t);const i=new li;return i.commentTriggerEvent.listen((e=>{e&&this.satisfactionComment.reset(),this.satisfactionComment.showElement(),this.openMenuComponent(this.satisfactionCommentMenuComponent)})),i.hideCommentEvent.listen((()=>{this.closeMenuComponent(this.satisfactionCommentMenuComponent)})),this.satisfactionComment.hideEvent.listen((()=>{this.closeMenuComponent(this.satisfactionCommentMenuComponent)})),e.appendChild(t),e.appendChild(i.element),(0,I.tT)("div",null,e,this.satisfactionCommentMenuComponent.element)}createReportAbuseMenuItem(){const e=document.createElement("div");return new(Gt.c.get("MenuLabel"))({text:P.R.reportAbuseText,style:{color:"#C41721"},onClick:()=>{this.openMenuComponent(this.reportAbuseMenuComponent)},showChevron:!0},e),this.reportAbuse.closeEvent.listen((e=>{e&&this.reportAbuse.reset(),this.closeMenuComponent(this.reportAbuseMenuComponent)})),(0,I.tT)("div",null,e,this.reportAbuseMenuComponent.element)}createChatSettingsMenuItem(){const e=document.createElement("div");return new(Gt.c.get("MenuLabel"))({text:P.R.chatSettings,onClick:()=>{(0,C.bT)("SettingsOpened"),this.openMenuComponent(this.chatSettingsComponent)},showChevron:!0},e),(0,I.tT)("div",null,e,this.chatSettingsComponent.element)}createManageIgnoredUsersMenuItem(){return(0,I.tT)("div",null,this.manageIgnoredUsers.element)}}var ui=i(1679),pi=i(7322);class mi extends ve{constructor(){super({tabName:"tokens",tabLabel:P.R.tokensCC,pageActionName:"TipTabOpened"})}initUI(){super.initUI(),(0,O.fZ)(this.element,"TokensTab"),(0,W.ZM)(this.element,{position:"relative",display:"flex",flexDirection:"column"}),this.appPanel=new pi.Y6,this.privateShowButton=new nt.bR,this.fanclubButton=new nt.uj,this.supporterButton=new nt.hP,this.tokenBalanceText=(0,I.tT)("span",{colorClass:"tokenBalance"}),this.tipButtonText=(0,I.tT)("span",null,P.R.tipUser("")),this.element.appendChild((0,I.tT)(I.FK,null,(0,I.tT)(gi,{appPanel:this.appPanel,privateShowButton:this.privateShowButton,fanclubButton:this.fanclubButton,supporterButton:this.supporterButton}),(0,I.tT)(fi,{tokenBalanceText:this.tokenBalanceText,tipButtonText:this.tipButtonText}))),f.X0.listen((e=>{this.updateTokenBalance(e.dossier.tokenBalance),this.tipButtonText.innerText=P.R.tipUser(e.dossier.room),e.chatConnection.event.statusChange.listen((e=>{const t=a.Bm.current.PurchaseEventSources.TOKEN_SOURCE_MOBILE_TOKENS_TAB_TOKEN_BAR,i=this.element.querySelector("#tokenPurchaseLink");"privatewatching"===e.currentStatus?i.onclick=()=>(0,ui.di)({source:t,roomType:"private"}):i.onclick=()=>(0,ui.di)({source:t,roomType:"public"})})),this.repositionChildren()})),this.appPanel.panelUpdated.listen((()=>{this.appPanel.hasContent?this.appPanel.showElement():this.appPanel.hideElement()})),o.D.listen((e=>{this.updateTokenBalance(e.tokens)}))}updateTokenBalance(e){this.tokenBalanceText.innerText=`${e.toLocaleString()} ${P.R.tokenOrTokensText(e,!1)}`}repositionChildren(){(0,W.ZM)(this.fanclubButton.element,{marginRight:this.supporterButton.isShown()?"10px":""})}}const gi=e=>{(0,W.ZM)(e.appPanel.element,{padding:"16px 0 0"});const t=(0,I.tT)("div",{style:{flex:1,overflowY:"scroll"}},(0,I.tT)("div",{style:{width:"100%",display:"flex",justifyContent:"center",position:"relative"}},e.appPanel.element),(0,I.tT)(vi,{privateShowButton:e.privateShowButton,fanclubButton:e.fanclubButton,supporterButton:e.supporterButton}));return(0,be.H)(t),t},vi=e=>(0,I.tT)("div",{style:{padding:"16px",fontSize:"14px",width:"100%",boxSizing:"border-box"}},e.privateShowButton.element,(0,I.tT)("div",{style:{display:"flex"}},e.fanclubButton.element,e.supporterButton.element)),fi=e=>{const t=a.Bm.current.PurchaseEventSources.TOKEN_SOURCE_MOBILE_TOKENS_TAB_TOKEN_BAR;return(0,I.tT)("div",{style:{width:"100%",borderTop:"1px solid #EFEFEF",padding:"16px 18px 12px 18px",display:"flex",flexDirection:"column",boxSizing:"border-box",fontSize:"14px"}},(0,I.tT)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"12px"}},(0,I.tT)("div",{style:{fontFamily:"UbuntuBold, Helvetica, Arial, sans-serif"}},(0,I.tT)("span",{colorClass:"youHave"},`${P.R.tokensLabel} `),e.tokenBalanceText),(0,I.tT)("a",{id:"tokenPurchaseLink",onClick:()=>()=>(0,ui.di)({source:t,roomType:"public"})},P.R.buyMoreTokens)),new nt.iI({tipButtonText:e.tipButtonText}).element)};class yi{constructor(e){this.player=e,this.chatTab=new gt,this.privateTab=new zt,this.tokensTab=new mi,this.bioTab=new Be,this.moreRoomsTab=new Wt(this.player),this.roomMenuTab=new di(this.player),this.tabList=[this.chatTab,this.privateTab,this.tokensTab,this.bioTab,this.moreRoomsTab,this.roomMenuTab]}getList(){return this.tabList}length(){return this.tabList.length}getTabByIndex(e){if(!(e<0||e>=this.length()))return this.tabList[e]}getIndexByTabName(e){const t=this.tabList.findIndex((t=>t.getTabName()===e));return t>-1?t:void 0}getChatTab(){return this.chatTab}getPrivateTab(){return this.privateTab}getTokensTab(){return this.tokensTab}getBioTab(){return this.bioTab}getMoreRoomsTab(){return this.moreRoomsTab}getRoomMenuTab(){return this.roomMenuTab}}var bi=i(7789);class wi extends b.u{constructor(e){super("div",e),this.closeUcmClickHandler=e=>{e.target instanceof Node&&void 0!==this.userPanel.element&&!this.userPanel.element.contains(e.target)&&this.closeUserPanel()}}initData(e){this.player=e.player,this.mobileDismissibleMessages=e.mobileDismissibleMessages,this.tabList=new yi(this.player),this.userPanel=new bi.o}initUI(){const e={width:"100%",height:"100%",top:(0,ie.DK)()*Q.Bu+"px",position:"absolute",boxSizing:"border-box"};this.element=(0,I.tT)("div",{style:e}),this.header=new pe({tabList:this.tabList}),this.addChild(this.header),this.roomTabs=new ce.S({tabList:this.tabList}),this.addChild(this.roomTabs),this.player.didRepositionEvent.listen((()=>{this.repositionChildrenRecursive()})),this.initListenersForUserPanel()}initListenersForUserPanel(){ue.vT.listen((e=>{this.closeUserPanel(),this.openUserPanel(e)})),ue.Gt.listen((()=>{this.closeUserPanel()})),ue.qb.listen((()=>{this.closeUserPanel()}))}openUserPanel(e){this.userPanel.updateContents(e.username,e.message);const t=e.attachTo;null!==t.parentElement?t.parentElement.insertBefore(this.userPanel.element,t.nextSibling):error("Error inserting userPanel.div: panelRequest.attachTo.parentElement is null"),this.scrollMessageList(e),this.scrollUserList(e),document.addEventListener("click",this.closeUcmClickHandler)}closeUserPanel(){this.userPanel.hideOverlay(),null!==this.userPanel.element.parentElement&&this.userPanel.element.parentElement.removeChild(this.userPanel.element),document.removeEventListener("click",this.closeUcmClickHandler)}scrollMessageList(e){if(!["chat","private"].includes(ce.S.currentTab))return;const t=this.tabList.getChatTab().getChatWindow().chatContents.messageListWrapper,i=this.tabList.getPrivateTab().getChatContents().messageListWrapper,s="chat"===ce.S.currentTab?t:i,n=e.attachTo.parentElement;if(null!==n&&void 0!==s){const e="private"===ce.S.currentTab?this.tabList.getPrivateTab().getPrivateContainerHeight():this.tabList.getChatTab().getChatWindow().getPrivateContainerHeight(),t=n.offsetTop+n.offsetHeight-(s.offsetHeight+s.scrollTop)-(e+(0,W.Lx)(this.userPanel.element.style.marginBottom));t>0&&(s.scrollTop+=t)}}scrollUserList(e){const t=this.userPanel.element.offsetParent,i=e.attachTo;if(null===this.userPanel||!(t instanceof HTMLElement)||"roomMenu"!==ce.S.currentTab)return;const s=i.offsetHeight+(0,W.Lx)(i.style.marginBottom),n=this.userPanel.element.offsetHeight+(0,W.Lx)(this.userPanel.element.style.marginBottom),o=i.offsetTop-(t.offsetHeight+t.scrollTop)+s+n;o>0&&(t.scrollTop+=o)}getChatContents(){return this.tabList.getChatTab().getChatContents()}getPrivateTabChatContents(){return this.tabList.getPrivateTab().getChatContents()}getPrivateShowChatContents(){return this.tabList.getPrivateTab().getPrivateShowChatContents()}repositionChildren(){var e;!(0,se.K$)()||this.player.isFullscreen?this.hideElement():(this.player.isFullscreen||(this.showElement(),null===(e=this.player.videoControls.mobilePureChat)||void 0===e||e.setVisible(!1)),this.repositionContainer(),this.repositionRoomTabs())}repositionContainer(){var e,t;const i=null!==(e=null===(t=document.getElementById("static-header"))||void 0===t?void 0:t.offsetHeight)&&void 0!==e?e:40,s=this.player.element.offsetHeight,n=this.mobileDismissibleMessages.element.offsetHeight,o=(0,ie.$B)().height-i-s-n;this.element.style.height=`${o}px`,this.element.style.top=`${s}px`}repositionRoomTabs(){const e=this.header.element.offsetHeight;this.roomTabs.element.style.height=`calc(100% - ${e}px)`}}var Ci=i(6283);class Si extends Ci.q{constructor(){super(),this.chatResizeCount=0,this.videoResize={videoResizeCount:0,videoRepositionCount:0},this.actionName="SessionMetricsMobile",this.onChatResize=()=>{this.chatResizeCount+=1,this.saveToStorage()},this.onPlayerResize=e=>{let{changeType:t}=e;"landscapeFullscreen"!==this.currentMode&&(0===t?(this.videoResize.videoResizeCount+=1,this.recordResize()):1===t&&(this.videoResize.videoRepositionCount+=1),this.saveToStorage())},this.loadFromStorage(),this.currentMode=this.getMode(),N.Ys.listen(this.onChatResize),N.BG.listen(this.onPlayerResize)}setupModeChangeListener(){var e;se.DQ.listen(this.onModeChange),null===(e=this.player)||void 0===e||e.toggleFullscreen.listen(this.onModeChange)}bindPlayer(e){this.player=e}playerDimensions(){void 0!==this.player&&(this.playerHeight=this.player.element.offsetHeight,this.playerWidth=this.player.element.offsetWidth,this.oldChat=screen.availHeight-this.playerHeight)}getCurrentMode(){return this.currentMode}resetMetrics(){super.resetMetrics(),this.chatResizeCount=0,this.videoResize={videoResizeCount:0,videoRepositionCount:0},Boolean(window.sessionStorage)&&window.sessionStorage.removeItem(this.actionName)}getPageActionAttributes(){return{...super.getPageActionAttributes(),videoResizeCount:this.videoResize.videoResizeCount,videoRepositionCount:this.videoResize.videoRepositionCount,chatResizeCount:this.chatResizeCount}}getMode(){return(0,se.K$)()?void 0!==this.player?this.player.isFullscreen?"portraitFullscreen":"portraitClassic":(0,Z.aS)()?"portraitFullscreen":"portraitClassic":"landscapeFullscreen"}loadFromStorage(){if(!Boolean(window.sessionStorage))return;const e=window.sessionStorage.getItem(this.actionName);if(null===e)return;const t=JSON.parse(e);this.videoResize.videoResizeCount=t.videoResizeCount,this.videoResize.videoRepositionCount=t.videoRepositionCount,this.chatResizeCount=t.chatResizeCount}saveToStorage(){Boolean(window.sessionStorage)&&window.sessionStorage.setItem(this.actionName,JSON.stringify({videoResizeCount:this.videoResize.videoResizeCount,videoRepositionCount:this.videoResize.videoRepositionCount,chatResizeCount:this.chatResizeCount}))}recordResize(){if(void 0!==this.player){const e=screen.availHeight-this.player.element.offsetHeight;(0,C.bT)("VideoResized",{video_height_old:this.playerHeight,video_height_new:this.player.element.offsetHeight,video_width_old:this.playerWidth,video_width_new:this.player.element.offsetWidth,chat_height_old:this.oldChat,chat_height_new:e,chat_width_old:screen.availWidth,chat_width_new:screen.availWidth}),this.playerHeight=this.player.element.offsetHeight,this.playerWidth=this.player.element.offsetWidth,this.oldChat=e}}}class xi extends ui.p5{styleButtonMenuItem(e){e.dt.style.fontWeight="bold"}createCommonButton(){const e=super.createCommonButton();return(0,O.fZ)(e,"mobile"),e.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",e.style.verticalAlign="text-top",e.style.lineHeight="16px",e}}class Ti extends b.u{constructor(e,t){var i,s,n;super(),this.tipSource=e,this.player=t,this.tokenBalance=0,this.isHighTipAmountWarningActive=!1,this.visibleViewportHeight=null!==(i=null===(s=window.visualViewport)||void 0===s?void 0:s.height)&&void 0!==i?i:window.innerHeight,this.roomType="public",this.tipSent=f.Ps,this.closed=new w.c_("tipClosed"),this.isSamsungBrowser=navigator.userAgent.indexOf("SamsungBrowser")>-1,this.element.style.display="none",this.element.style.overflow="visible",this.element.style.zIndex="1003",this.element.style.backgroundColor="rgba(0, 0, 0, 0.7)",this.element.style.height=this.isSamsungBrowser?"100%":`calc(100% - ${this.player.element.offsetHeight}px)`,this.element.style.bottom="0",this.element.style.alignItems="center",this.element.style.justifyContent="center",this.element.dataset.testid="send-tip-callout",this.overlay=document.createElement("div"),this.overlay.style.position="fixed",this.overlay.style.top="0",this.overlay.style.left="0",this.overlay.style.right="0",this.overlay.style.bottom="0",this.overlay.onclick=()=>{this.tipSent.fire({})},this.element.appendChild(this.overlay);const r=document.createElement("div");this.element.appendChild(r),this.closeWindowDiv=document.createElement("div"),this.closeWindowDiv.innerText=`${P.R.closeWindow} (${P.R.cancelLower})`,this.closeWindowDiv.style.color="#ffffff",this.closeWindowDiv.style.fontSize="14px",this.closeWindowDiv.style.fontWeight="bold",this.closeWindowDiv.style.textDecoration="underline",this.closeWindowDiv.style.position="relative",this.closeWindowDiv.style.paddingBottom="6px",this.closeWindowDiv.style.cursor="pointer",this.closeWindowDiv.style.width="100%",this.closeWindowDiv.style.textAlign="right",this.closeWindowDiv.style.cursor="pointer",this.closeWindowDiv.dataset.testid="close-tip",this.closeWindowDiv.onclick=()=>{this.tipSent.fire({})},r.appendChild(this.closeWindowDiv),this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.overflow="visible",this.content.style.backgroundColor="#ffffff",this.content.style.height="auto",this.content.style.borderRadius="6px",this.content.style.border="1px solid #000000",(0,h.wu)("click",this.content,(e=>{e.stopPropagation()}));const l=document.createElement("div"),c=document.createElement("span");c.innerText=P.R.currentBalanceText,c.style.display="inline-block",c.style.fontSize="13px",c.style.padding="6px",l.appendChild(c),this.tokenBalanceSpan=document.createElement("span"),this.tokenBalanceSpan.style.display="inline-block",this.tokenBalanceSpan.style.color="#53843a",this.tokenBalanceSpan.style.fontSize="13px",this.tokenBalanceSpan.style.padding="6px 6px 6px 0",this.tokenBalanceSpan.dataset.testid="token-balance",l.appendChild(this.tokenBalanceSpan);const u=document.createElement("a");u.innerText=P.R.purchaseTokensText,u.style.display="inline-block",u.style.color="#f47321",u.style.fontSize="13px",u.style.marginLeft="12px",u.style.padding="6px",u.dataset.testid="purchase-tokens",u.onclick=()=>{const e=a.Bm.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,ui.di)({source:e,roomType:this.roomType}),this.tipSent.fire({})},l.appendChild(u),this.content.appendChild(l),this.lowScoreWarning=document.createElement("div"),this.lowScoreWarning.style.display="none",this.lowScoreWarning.style.color="#ff0000",this.lowScoreWarning.style.fontSize="13px",this.lowScoreWarning.style.fontWeight="bold",this.lowScoreWarning.style.padding="6px",this.lowScoreWarning.style.textAlign="center";const p=document.createElement("div");p.innerText=P.R.satisfactionWarningText,this.lowScoreWarning.appendChild(p);const m=document.createElement("div");m.innerText=P.R.tipWarningText,this.lowScoreWarning.appendChild(m),this.content.appendChild(this.lowScoreWarning),this.sendTipForm=document.createElement("form");const g=document.createElement("div");(0,W.ZM)(g,{display:"flex",alignItems:"center",marginTop:"12px",marginBottom:"6px"});const v=document.createElement("span");v.innerText=P.R.tipAmountText,v.style.display="inline-block",v.style.fontSize="13px",v.style.padding="6px",g.appendChild(v),this.tipAmountInput=(0,ui.Gz)(),(0,O.fZ)(this.tipAmountInput,"inputAmt"),this.tipAmountInput.onclick=()=>{this.tipAmountInput.setSelectionRange(0,this.tipAmountInput.value.length)},this.tipAmountInput.onmouseup=e=>{e.preventDefault()},this.tipAmountInput.onfocus=()=>{this.tipAmountInput.setSelectionRange(0,this.tipAmountInput.value.length)},this.tipAmountInput.onblur=()=>{""===this.tipAmountInput.value&&(this.tipAmountInput.value="0")},(0,h.wu)("input",this.tipAmountInput,(()=>{this.tipAmountChange()})),g.appendChild(this.tipAmountInput),this.invalidTipAmountSpan=document.createElement("span"),this.invalidTipAmountSpan.innerText=P.R.tipAmountInvalid,this.invalidTipAmountSpan.style.fontSize="12px",this.invalidTipAmountSpan.style.color="#ff0000",this.invalidTipAmountSpan.style.display="none",this.invalidTipAmountSpan.style.marginLeft="5px",this.invalidTipAmountSpan.style.marginRight="5px",this.invalidTipAmountSpan.dataset.testid="invalid-tip",g.appendChild(this.invalidTipAmountSpan),this.sendTipForm.appendChild(g),this.tipMessageLabel=document.createElement("div"),this.tipMessageLabel.innerText=P.R.defaultTipMessageLabel,this.tipMessageLabel.style.fontSize="13px",this.tipMessageLabel.style.padding="6px 6px 0 6px",this.sendTipForm.appendChild(this.tipMessageLabel),this.tipMessageDiv=document.createElement("div"),this.tipMessageTextarea=document.createElement("textarea"),this.tipMessageTextarea.maxLength=255,this.tipMessageTextarea.style.width="100%",this.tipMessageTextarea.style.resize="none",this.tipMessageTextarea.style.fontSize="1em",this.tipMessageTextarea.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",this.tipMessageTextarea.style.margin=`${o.xj}px`,this.tipMessageTextarea.style.padding="4px",this.tipMessageTextarea.style.border="1px solid #4b4c4b",this.tipMessageTextarea.style.borderRadius="4px",this.tipMessageTextarea.style.boxSizing="border-box",this.tipMessageTextarea.classList.add("tipMessageTextarea"),this.tipMessageTextarea.dataset.testid="tip-message-textarea",this.tipMessageDiv.appendChild(this.tipMessageTextarea),this.sendTipForm.appendChild(this.tipMessageDiv);const y=document.createElement("div");y.style.textAlign="right",y.style.position="relative",this.sendTipButton=new xi,this.sendTipButton.element.style.cssFloat="",this.addChild(this.sendTipButton,y),this.sendTipForm.appendChild(y),this.content.appendChild(this.sendTipForm),r.appendChild(this.content),this.closed.listen((()=>{this.sendTipButton.hideMenu()})),null===(n=window.visualViewport)||void 0===n||n.addEventListener("resize",(()=>{var e,t;this.visibleViewportHeight=null!==(e=null===(t=window.visualViewport)||void 0===t?void 0:t.height)&&void 0!==e?e:window.innerHeight,this.repositionChildren()})),f.X0.listen((e=>{this.hasLowSatisfactionScore=e.dossier.hasLowSatisfactionScore,this.roomName=e.chatConnection.room(),e.chatConnection.event.statusChange.listen((e=>{"privatewatching"===e.currentStatus?(this.roomType="private",u.onclick=()=>{const e=a.Bm.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,ui.di)({source:e,roomType:"private"}),this.tipSent.fire({})}):(this.roomType="public",u.onclick=()=>{const e=a.Bm.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,ui.di)({source:e,roomType:"public"}),this.tipSent.fire({})})}))})),this.repositionChildren(),(0,h.wu)("submit",this.sendTipForm,(e=>{if(e.preventDefault(),!(0,ui.sI)(this.tipAmountInput.value))return void(0,d.Q$)(P.R.tipAmountInvalid);if(!this.sendTipButton.isEnabled())return;const t=parseInt(this.tipAmountInput.value);if(t>this.tokenBalance)return void(0,ui.qr)(P.R.notEnoughTokensMessage,!1,a.Bm.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE,this.roomType);if((0,C.bT)("SendTipClicked",{amount:t}),t>100&&!this.isHighTipAmountWarningActive)return this.sendTipButton.promptUser(P.R.tipConfirmationMessage(t)),this.isHighTipAmountWarningActive=!0,void this.repositionChildren();let i=this.tipMessageTextarea.value;void 0!==this.tipOptionsSelect&&(i=""===this.tipMessageTextarea.value?this.tipOptionsSelect.value:`${this.tipOptionsSelect.value} | ${this.tipMessageTextarea.value}`);const s=this.sendTipButton.getTipType();(0,o.ae)({roomName:this.roomName,tipAmount:this.tipAmountInput.value,message:i,source:this.tipSource,tipRoomType:this.roomType,tipType:s,videoMode:"mobile"}).then((e=>{e.success?(0,C.bT)("SendTipSuccess",{amount:t}):void 0!==e.error?(0,ui.qr)(`${e.error}`,!1,a.Bm.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE,this.roomType):error("unknown send tip error"),this.removeHighTipAmountWarning(),this.tipMessageTextarea.value="",void 0!==e.tipsInPast24Hours&&o.ew.fire({tokens:e.tipsInPast24Hours,roomName:this.roomName}),this.tipSent.fire({amount:t,success:e.success})})).catch((e=>{this.tipSent.fire({amount:t,success:!1}),error(`Error sending tip (${e})`)})),this.hide()}))}repositionChildren(){(0,se.K$)()?((0,n.OF)()?this.element.style.height=`calc(100% - ${this.player.element.offsetHeight}px)`:this.isSamsungBrowser?this.element.style.height="100%":(this.element.style.height=this.visibleViewportHeight-40+"px",this.element.style.top="0",this.element.style.bottom=""),this.content.style.width=`${Math.min(.9*(0,ie.DK)(),500)}px`,this.tipMessageDiv.style.width=this.content.clientWidth-2*o.xj+"px"):this.hide()}removeHighTipAmountWarning(){this.sendTipButton.cancelPrompt(),this.isHighTipAmountWarningActive=!1}tipAmountChange(){(0,ui.Pt)(this.tipAmountInput),(0,ui.sI)(this.tipAmountInput.value)?(this.sendTipButton.enable(),this.invalidTipAmountSpan.style.display="none"):(this.sendTipButton.disable(),this.invalidTipAmountSpan.style.display="inline-block"),this.isHighTipAmountWarningActive&&this.removeHighTipAmountWarning()}show(e){void 0!==e.amount&&(this.tipAmountInput.value=e.amount.toString(),this.tipAmountChange()),void 0!==e.message?this.tipMessageTextarea.value=e.message:this.tipMessageTextarea.value="",this.hasLowSatisfactionScore?this.lowScoreWarning.style.display="block":this.lowScoreWarning.style.display="none",this.tokenBalanceSpan.innerText=`${P.R.loadingTextLower}...`,this.showElement(),this.tipAmountInput.focus(),(0,ui.lc)(this.tipSource,this.sendTipButton),(0,o.kb)(this.roomName).then((e=>{if(this.updateTokenBalance(e.tokenBalance),this.tipAmountInput.max=e.tokenBalance.toString(),void 0!==e.tipOptions){this.tipMessageLabel.innerText=e.tipOptions.label,void 0!==this.tipOptionsSelect&&this.tipMessageDiv.removeChild(this.tipOptionsSelect),this.tipOptionsSelect=document.createElement("select"),this.tipOptionsSelect.style.width="100%",this.tipOptionsSelect.style.fontSize="1em",this.tipOptionsSelect.style.margin=`${o.xj}px`,this.tipOptionsSelect.style.border="1px solid #4b4c4b",this.tipOptionsSelect.style.boxSizing="border-box",this.tipMessageDiv.insertBefore(this.tipOptionsSelect,this.tipMessageTextarea);let t=document.createElement("option");t.innerText=`-- ${P.R.selectOneLabel} --`,t.value="",this.tipOptionsSelect.appendChild(t);for(const i of e.tipOptions.options)t=document.createElement("option"),t.innerText=i.label,t.value=i.label,this.tipOptionsSelect.appendChild(t)}else void 0!==this.tipOptionsSelect&&(this.tipMessageLabel.innerText=P.R.defaultTipMessageLabel,this.tipMessageTextarea.value="",this.tipMessageDiv.removeChild(this.tipOptionsSelect),this.tipOptionsSelect=void 0);this.repositionChildren()})).catch((e=>{error(`Error getting token balance (${e})`),this.tokenBalanceSpan.innerText=P.R.unknownText}))}showElement(){super.showElement("flex")}hide(){this.element.style.display="none",this.closed.fire(void 0)}updateTokenBalance(e){this.tokenBalance=e,this.tokenBalanceSpan.innerText=`${e} ${P.R.tokenOrTokensText(e,!1)}`}}function Ai(e,t){document.title=P.R.mobileDocumentTitle(e,l.m.siteName,t)}function Pi(){const e=(0,n.ru)();return 15===(null==e?void 0:e.major)&&0===e.minor&&(0,n.nr)()}function ki(){const e=document.querySelector(".push-overlay");return null!==e&&"none"!==e.style.display&&""!==e.style.display}let Mi=!1;class Ri extends b.u{constructor(e,t){super(),this.audioHolder=new u.T,this.sessionMetrics=new Si,this.listenerGroup=new w.gt,this.siteHeaderHeight=0,this.isFullscreen=!1,this.loading=Date.now(),this.currentRoom=e,void 0!==window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.repositionChildrenRecursive()))),document.body.style.overflow="hidden",this.mainContainer=document.getElementById("main"),this.initDismissibleMessages(),this.mainContainer.appendChild(this.element),(0,n.OF)()&&(this.hideAddressBarInLandscape(1),document.body.style.overflow="auto"),(0,C.NP)(this.sessionMetrics.getCurrentMode()),this.siteHeader=document.querySelector("#static-header");const i=document.querySelector("#static-header .right-nav");this.pushMenuOverlay=document.querySelector(".push-overlay"),this.pushMenu=document.querySelector(".pushmenu"),this.siteHeaderHeight=this.siteHeader.offsetHeight,this.headerRoomInfo=new _,i.appendChild(this.headerRoomInfo.element),this.pushMenuContainer=document.querySelector("#pushmenu-container"),ue.nD.listen((e=>{e&&(0,C.bT)("SiteMenuOpened")})),o.D.listen((e=>{const t=document.getElementById("token-balance");null!=t&&(t.innerText=`${e.tokens} Tokens`)})),this.element.style.height="100%",this.element.style.width="100%",this.element.style.minHeight="100%",this.element.style.minWidth="100%",this.element.style.position="fixed",(0,T.PF)(this.element,"none"),(0,C.RN)(e),this.player=new he(t,this,this.mobileDismissibleMessages),this.player.playerComponent instanceof S.vS&&this.player.playerComponent.setPageLoaded(this.loading),this.prependChild(this.player),this.sessionMetrics.bindPlayer(this.player),this.portraitContents=this.addChild(new wi({player:this.player,mobileDismissibleMessages:this.mobileDismissibleMessages})),this.player.videoControls.executeInitialFullscreenState(),this.chatTabPureChat=new de.X(this.portraitContents.getChatContents()),this.privateTabPureChat=new de.X(this.portraitContents.getPrivateTabChatContents()),this.player.toggleFullscreen.listen((e=>{this.isFullscreen=e,this.repositionChildrenRecursive(),this.sessionMetrics.recordResize()}));const s=this.addChild(new Ti("mobile",this.player));ue.f6.listen((e=>{a.Bm.current.isNoninteractiveUser?(0,d.Q$)(P.R.internalStaffTip):this.player.isFullscreen||(0,se.Y$)()?this.player.videoControls.showTipForm(e):(this.player.limitPortraitHeight(280),this.repositionChildrenRecursive(),s.show(e))})),s.tipSent.listen((e=>{s.hide(),!0===e.success&&"tokens"===ce.S.currentTab&&ue.qb.fire("chat")})),s.closed.listen((()=>{this.player.limitPortraitHeight(0)})),this.sessionMetrics.bindTipCallout(s),this.loadRoom(e,!0),this.repositionChildrenRecursive(),this.afterDOMConstructedIncludingChildren();const r=new y.a((()=>{this.repositionChildrenRecursive()}),{bounceLimitMS:20,debounceType:2});se.DQ.listen((()=>{(0,n.OF)()&&((0,se.K$)()&&this.hideAddressBarInLandscape(1.1),window.scrollTo(0,this.mainContainer.scrollHeight)),r.callFunc(),this.player.centerPlayer(),window.setTimeout((()=>{r.callFunc()}),500)}));let l=window.innerWidth;if(window.onresize=()=>{document.documentElement.scrollTop<0&&(document.documentElement.scrollTop=0);const e=window.innerWidth!==l;!e&&(0,n.OF)()&&!e||(l=window.innerWidth,this.player.centerPlayer())},ue.Gt.listen((()=>{this.player.setMessageInputFieldHasFocus(!0)})),ue.P4.listen((()=>{this.player.setMessageInputFieldHasFocus(!1)})),this.initPlayerMovementOnInputFocus(),document.documentElement.clientHeight>=window.outerHeight){const e=()=>{const t=document.createElement("input");t.style.fontSize="16px",document.body.appendChild(t),t.focus(),t.blur(),document.body.removeChild(t),(0,h.Pf)("mousedown",this.element,e),(0,h.Pf)("touchmove",this.element,e)};(0,h.wu)("mousedown",this.element,e),(0,h.wu)("touchmove",this.element,e)}this.preventCertainTouchActions(),(0,h.wu)("popstate",window,(e=>{void 0!==e.state&&null!==e.state?this.loadRoom(e.state,!1):Mi&&!(0,n.H9)()&&history.back()})),(0,h.wu)("pageshow",window,(e=>{e.persisted&&this.currentChatConnection.room()!==this.currentRoom&&this.loadRoom(this.currentRoom,!1)})),ue.VZ.listen((e=>{this.loadRoom(e,!0)})),f.X0.listen((e=>{Ai(e.dossier.room,e.dossier.roomTitle),this.repositionChildrenRecursive(),Mi||(Mi=!0),this.headerRoomInfo.updateContext(e.dossier.room,e.dossier.following,e.dossier.roomStatus),this.headerRoomInfo.updateViewerCount(e.dossier.numViewers),"offline"===e.dossier.roomStatus?ue.qb.fire("bio"):ue.qb.fire("chat"),this.sessionMetrics.playerDimensions()})),this.player.playerComponent.showControls(),v.s.fire("mobile")}initDismissibleMessages(){var e;this.mobileDismissibleMessages=new z,this.mainContainer.appendChild(this.mobileDismissibleMessages.element),null===(e=this.resizeObserver)||void 0===e||e.observe(this.mobileDismissibleMessages.element)}initPlayerMovementOnInputFocus(){var e;null===(e=visualViewport)||void 0===e||e.addEventListener("resize",(()=>{var e,t;const i=this.player.sendMessageInputFieldHasFocus,s=Math.round(null!==(e=null===(t=visualViewport)||void 0===t?void 0:t.height)&&void 0!==e?e:(0,ie.mJ)())<(0,ie.mJ)();if(i&&s){const e=(0,R.$h)()-R.CC,t=Pi(),i=t?e+50:e,s=t?-50:0;this.player.element.style.position="fixed",this.player.element.style.top="",this.player.element.style.bottom=`${i}px`,this.player.element.style.zIndex="1",this.player.videoControls.hideElement(),this.portraitContents.element.style.top=`${s}px`,this.portraitContents.element.style.height="100%",N.GF.fire({isInputFocused:!0,playerTop:i+this.player.element.clientHeight}),this.player.roomStatusNotifier.toggleInputFocusPosition(!0)}else this.player.element.style.position="absolute",this.player.element.style.top="0",this.player.element.style.bottom="",this.player.element.style.zIndex="",this.portraitContents.element.style.top="",this.player.videoControls.showElement(),N.GF.fire({isInputFocused:!1}),this.repositionChildrenRecursive(),this.player.roomStatusNotifier.toggleInputFocusPosition(!1)}))}hideAddressBarInLandscape(e){var t,i;const s=e*(null!==(t=null===(i=window.visualViewport)||void 0===i?void 0:i.height)&&void 0!==t?t:window.innerHeight);this.mainContainer.style.height=`${s}px`}passwordPrompt(e){if((0,p.rC)(P.R.loginForPasswordPrompt((0,s.VE)(e)),!1,(()=>{window.location.href=(0,c._Y)("/")})))return;const t=prompt(P.R.passwordRequiredForRoom(e));null!==t?(0,c.KF)(`roomlogin/${e}/`,{password:t}).then((t=>{"success"===new s.N6(t.responseText).getStringOrUndefined("result")?this.loadRoom(e,!1):(0,d.Q$)(P.R.incorrectPassword,(()=>{this.passwordPrompt(e)}))})).catch((t=>{error("Unable to login to room",{room:e,error:t}),window.location.reload()})):window.location.reload()}loadRoom(e,t){let i;i=Mi||!0===a.Bm.current.isLoadedFromCache?(0,x.Bc)(e):(0,x.sH)(e,window.initialRoomDossier),i.then((i=>{let s,o;g.V.fire(i),void 0!==this.cleanupLastRoomCallback&&this.cleanupLastRoomCallback(),this.currentRoom=e,(0,C.RN)(e),a.Aw.setState(i),this.currentChatConnection=new m.Z(i,!0),this.sessionMetrics.bindChatConnection(this.currentChatConnection),Ai(i.room,i.roomTitle),this.currentChatConnection.event.titleChange.listen((e=>{Ai(i.room,e)})).addTo(this.listenerGroup),A.EZ.listen((e=>{this.currentChatConnection.updateEnterLeaveSettings(e.roomEntryFor,e.roomLeaveFor)})).addTo(this.listenerGroup),this.audioHolder.loadTipSounds(),this.currentChatConnection.event.playSound.listen((e=>{if(!(0,M.gA)())return;let t=this.player.playerComponent.getVolume();this.player.playerComponent instanceof S.vS&&(t=this.player.playerComponent.getMuted()?0:this.player.playerComponent.getVolume()),isNaN(t)?error("playerComponent.getVolume() is NaN.",{},"VIDEO_"):this.audioHolder.playSound(e,i.userChatSettings.tipVolume*t/100)})).addTo(this.listenerGroup),this.player.setIsWidescreen(i.isWidescreen),this.cleanupLastRoomCallback=()=>{clearInterval(s),window.clearTimeout(o),this.currentChatConnection.disconnect(),this.player.playerComponent.stop(),this.listenerGroup.removeAll(),f.Gr.fire(void 0)};const l={dossier:i,chatConnection:this.currentChatConnection};this.player.playerComponent.handleRoomLoaded(l),this.player.playerComponent.playbackStart.listen((()=>{(0,r.r)(i,this.player.playerComponent)})).addTo(this.listenerGroup),t&&function(e){if((0,n.lj)())if("mobile"===window.location.pathname.replace(/\//g,"")){const t=(0,k.JO)(window.location.search);t.b=e.room;const i=(0,k.Go)(t);window.history.pushState(e.room,e.roomTitle,(0,c._Y)(`./?${i}`))}else{const t=(0,k.JO)(window.location.search),i=(0,k.Go)(t);let s="";""!==i&&(s=`?${i}`),window.history.pushState(e.room,e.roomTitle,(0,c._Y)(`/${e.room}/${s}`))}}(i),f.X0.fire(l),this.currentChatConnection.event.statusChange.listen((e=>{const t="offline"===e.currentStatus,i=["privatewatching","privatespying"],n=i.includes(e.currentStatus),r=i.includes(e.previousStatus);switch(t||"notconnected"!==e.previousStatus&&!n&&!r||(clearInterval(s),s=window.setInterval((()=>{this.currentChatConnection.updateRoomCount(n)}),1e3*(n?5:90)),o=window.setTimeout((()=>{this.currentChatConnection.updateRoomCount(n||r)}),2e3)),e.currentStatus){case"passwordprotected":this.passwordPrompt(this.currentChatConnection.room()),this.player.playerComponent.stop();break;case"offline":this.player.playerComponent.stop()}if(this.currentChatConnection.inPrivateRoom()){const e=this.portraitContents.getPrivateShowChatContents();if(void 0===e)return;var a;this.privateTabPureChat.isMirroringComponent(e)||(null===(a=this.privateTabPureChat)||void 0===a||a.dispose(),this.privateTabPureChat=new de.X(e)),this.player.videoControls.setPureChat(this.privateTabPureChat)}else this.player.videoControls.setPureChat(this.chatTabPureChat)})).addTo(this.listenerGroup)})).catch((t=>{let i="",n="",o="";if("string"==typeof t){const e=t.match(/(?:[^\s,":{}]+|"[^"]*")+/g);if(null!==e){const t=e.map((e=>e.replace(/"/g,"")));let s=t.indexOf("code");-1!==s&&(i=t[s+1]),s=t.indexOf("detail"),-1!==s&&(n=t[s+1])}o=t}else if(void 0!==t.xhr&&void 0!==t.xhr.responseText&&""!==t.xhr.responseText){if("application/json"!==t.xhr.getResponseHeader("Content-Type"))return void error("Error reading room dossier error",{room:e,error:t.xhr.responseText});const r=new s.N6(t.xhr.responseText);i=r.getStringOrUndefined("code",!1),n=r.getString("detail",!1),o=t.xhr.responseText}else t instanceof TypeError&&(i="access-denied");switch(i){case"access-denied":(0,d.Q$)(`Access Denied for room: ${e}\n\n${n}`,(()=>{Mi||(window.location.href=(0,c._Y)("/"))}));break;case"unauthorized":window.location.href=(0,c._Y)(`/auth/login/?next=${window.location.pathname}${window.location.search}`);break;case"password-required":this.passwordPrompt(e);break;default:error("Error parsing room dossier error",{room:e,error:o})}}))}preventCertainTouchActions(){const e=()=>{const e=document.getElementById("entrance_terms");return null!==e&&"none"!==e.style.display};let t,i=!1;(0,h.wu)("touchstart",window,(s=>{if(e())return;const n=s.touches.length>1;n&&!i&&((0,C.bT)("PinchZoomStarted"),i=!0),n&&(0,be.u)()&&s.cancelable&&s.preventDefault(),t=s})),(0,h.wu)("touchmove",window,(i=>{var s,n;if(e()||ki())return;const o=i.touches[0].pageY;o!==(null!==(s=null===(n=t)||void 0===n?void 0:n.touches[0].pageY)&&void 0!==s?s:o)&&(0,be.u)()&&i.cancelable&&i.preventDefault()})),(0,h.wu)("touchend",window,(s=>{e()||(t=void 0,i=!1)}))}adjustDimensions(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||!(0,se.K$)())this.element.style.top="0px",this.element.style.height="100%",this.element.style.minHeight="100%",this.hidePushMenu(),this.mobileDismissibleMessages.hideElement();else{this.mobileDismissibleMessages.showElement();const e=this.mobileDismissibleMessages.element.offsetHeight,t=this.siteHeaderHeight+e;this.element.style.top=`${t}px`,this.element.style.height=`calc(100% - ${t}px)`,this.element.style.minHeight=`calc(100% - ${t}px)`}}repositionChildren(){super.repositionChildren(),this.adjustDimensions(this.isFullscreen)}hidePushMenu(){ue.nD.fire(!1),this.pushMenuOverlay.style.display="none",this.pushMenu.classList.remove("pushmenu-animate"),this.siteHeader.classList.remove("push-page-content"),this.pushMenuContainer.style.display="none"}}},5431:(e,t,i)=>{"use strict";i.d(t,{i:()=>z});var s=i(7623),n=i(20),o=i(1474),r=i(9447),a=i(7964),l=i(9461),h=i(1679),d=i(6784),c=i(213),u=i(6844),p=i(9332),m=i(1413),g=i(2939),v=i(6669),f=i(2709),y=i(3955),b=i(8423),w=i(9060),C=i(1779),S=i(7407),x=i(9321),T=i(1282),A=i(34),P=i(8255),k=i(2146),M=i(7569),R=i(2091),I=i(4947),E=i(2945),L=i(4110),D=i(5256),B=i(7925),U=i(9818);function F(){if((0,s.OF)())return!1;if(/UCBrowser|Firefox|SamsungBrowser/.test(navigator.userAgent))return!1;if(/Chrome\//.test(navigator.userAgent)){const e=navigator.userAgent.split("Chrome/")[1].split(".")[0];if(parseInt(e)<72)return!1}return!0}var _=i(4580),N=i(3939),O=i(8936),H=i(3124);const W=I.R.mobileTipMessageLabelLandscape,$=I.R.mobileTipMessageLabelPortrait,V="videoControls";class z extends f.u{constructor(e,t,i){var n;super(),this.mobileDismissibleMessages=i,this.setPlayerVisibilityEvent=new b.c_("setPlayerVisibilityEvent"),this.centerPlayerEvent=new b.c_("centerPlayerEvent"),this.requestFullscreenEvent=new b.c_("requestFullscreenEvent"),this.setPlayerComponentVolumeMutedEvents=new b.c_("setPlayerComponentVolumeMutedEvents"),this.forceHlsPlayerEvent=new b.c_("forceHlsPlayerEvent"),this.playerComponentReadjustForceHlsOverlayOrderEvent=new b.c_("playerComponentReadjustForceHlsOverlayOrderEvent"),this.showJpegPlayerComponentImage=new b.c_("showJpegPlayerComponentImage"),this.toggleFullscreen=new b.c_("toggleFullscreen"),this.requestHlsPlayerPlayIfPaused=new b.c_("requestHlsPlayerPlayIfPaused"),this.state={volume:100,isMuted:!0},this.showingRules=!1,this.tokenBalance=0,this.isVisible=!0,this.isTipFormActive=!1,this.isClickingAButton=!1,this.roomType="public",this.layoutHandler=new D.z,this.layoutConstraints=new D.f(this.constructor.name),this.airPlayIconConstraint=0,this.autofillAccessoryConstraint=0,this.forceHlsTriggered=!1,this.forceHlsPlayButtonCreated=!1,this.hlsWaitingForInteraction=!1,this.userUnmuted=!1,this.wasInPortrait=(0,H.K$)(),this.headerHeight=0,this.initialFullscreen=!1,this.mobileRoot=t,this.playerIsFullscreen=e.isFullscreen,this.playerUsingAirPlay=e.usingAirPlay,this.playerUsingChromecast=e.usingChromecast,e.playerComponent instanceof x.O?(this.playerIsJPEG=!0,this.playerIsHlsPlaceholder=e.playerComponent.getIsHlsPlaceholder()):(this.playerIsJPEG=!1,this.playerIsHlsPlaceholder=!1),this.playerElement=e.element;const u=(0,E.JO)(window.location.search).disable_sound;(void 0!==u&&"true"===u.toLowerCase()||"1"===u)&&(this.state.isMuted=!0);const p=document.querySelector("#static-header");null!==p&&(this.headerHeight=p.offsetHeight),(0,r.fZ)(this.element,"MobileVideoControls"),this.element.style.position="fixed",this.element.style.width="inherit",this.element.style.top="0px",this.element.style.display="flex",this.element.style.flexDirection="column",this.element.style.alignItems="center",this.element.style.justifyContent="space-between",this.playerOverlay=document.createElement("div"),this.playerOverlay.style.position="absolute",this.playerOverlay.style.width="100%",this.playerOverlay.style.height="100%",this.playerOverlay.dataset.testid="player-overlay",this.element.appendChild(this.playerOverlay),this.initControls(),this.constructUI(),this.touchControls=new N.G(this.playerOverlay,this.playerElement),this.bindTouchControlsEvent(),m.V.listen((e=>{this.rulesModal=(0,a.oG)(this,e),void 0!==this.rulesModal&&(this.addChild(this.rulesModal),this.rulesModal.visibilityChanged.listen((e=>{this.showingRules=e})))})),g.X0.listen((e=>{this.currentRoomContext=e,this.chatConnection=e.chatConnection,this.roomName=e.chatConnection.room(),e.chatConnection.event.statusChange.listen((e=>{this.updatePlayerHiddenStatus(e.currentStatus),this.showHideHlsPlayButton(e.currentStatus),"privatewatching"===e.currentStatus?(this.roomType="private",this.tokenBalanceLink.onclick=()=>{const e=l.Bm.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,h.di)({source:e,roomType:"private"})}):(this.roomType="public",this.tokenBalanceLink.onclick=()=>{const e=l.Bm.current.PurchaseEventSources.TOKEN_SOURCE_TIP_CALLOUT;(0,h.di)({source:e,roomType:"public"})})})),this.playerIsJPEG&&this.playerIsHlsPlaceholder&&!this.forceHlsPlayButtonCreated&&(this.forceHlsPlayButtonCreated=!0,this.createForceHlsPlayButton(),this.showHideHlsPlayButton(e.dossier.roomStatus)),this.updatePlayerHiddenStatus(e.dossier.roomStatus),this.userUnmuted||this.state.isMuted||(this.userUnmuted=!0),this.updateVolumeImage(),this.playerIsJPEG||this.updatePlayerVolume(),this.updateTokenBalance(isNaN(e.dossier.tokenBalance)?0:e.dossier.tokenBalance)})),L.nw.listen((()=>{this.setFullscreen(!1)})),L.kw.listen((()=>{this.mute()})),o.D.listen((e=>{isNaN(e.tokens)||this.updateTokenBalance(e.tokens)})),B.Ko.listen((e=>{if(this.isAnyInputFocused())this.closeActiveInput(),this.showControls(),this.isTipFormActive&&this.hideTipForm();else{if(e===this.isVisible)return void this.showControls();this.isVisible?this.isTipFormActive?this.hideTipForm():this.hideControls():this.showControls()}})),B.Dd.listen((()=>{this.isVisible&&this.showControls()})),B.r_.listen((()=>{this.setFullscreen(!1),(0,H.K$)()||(0,c.J)("Rotate device to view PMs")})),A.Lz.listen((()=>{this.forceHlsOverlayFunc()}),!1),_.nD.listen((e=>{e?this.hideControls():this.repositionChildren()})),(0,d.wu)("scroll",window,(()=>{this.updateTokenBalancePosition()})),H.DQ.listen((()=>{this.wasInPortrait===(0,H.K$)()?window.setTimeout((()=>{this.onOrientationChange()}),0):this.onOrientationChange()})),(0,d.wu)("resize",window,(()=>{void 0!==this.mobilePureChat&&this.mobilePureChat.scrollToBottom()})),null===(n=window.visualViewport)||void 0===n||n.addEventListener("resize",(()=>{var e,t;window.visualViewport&&(0,s.m0)()&&((0,H.K$)()?this.smallestPortraitHeight=Math.min(null!==(e=this.smallestPortraitHeight)&&void 0!==e?e:window.visualViewport.height,window.visualViewport.height):this.smallestLandscapeWidth=Math.min(null!==(t=this.smallestLandscapeWidth)&&void 0!==t?t:window.visualViewport.width,window.visualViewport.width))})),C._c.listen((()=>{(0,C.aS)()!==this.playerIsFullscreen&&(this.setFullscreen(this.playerIsFullscreen,!0),(this.playerUsingAirPlay||this.playerUsingChromecast)&&this.canResizePlayerInFullscreen()&&void 0!==this.mobilePureChat&&this.mobilePureChat.setPortraitHeight((0,O.mJ)()-100))})),this.showControls(),this.repositionChildren();const v=document.createElement("style");if(v.innerHTML="\n .mobileFullscreenInput::-webkit-input-placeholder {\n color: black;\n opacity: 0.65;\n }\n .mobileFullscreenInput:-ms-input-placeholder {\n color: black;\n opacity: 0.65;\n }\n .mobileFullscreenInput:-moz-placeholder {\n color: black;\n opacity: 0.65;\n }\n .mobileFullscreenInput::-moz-placeholder {\n color: black;\n opacity: 0.65;\n }\n ",document.head.appendChild(v),this.layoutHandler.addListener(e.roomStatusNotifier.layoutConstraints),this.layoutHandler.addListener(this.layoutConstraints),(0,s.Pf)()){const t=window.localStorage.getItem(V);if(null!==t){const i=JSON.parse(t);this.state.isMuted=!e.playerComponent.supportsAutoplayWithAudio||i.isMuted,this.initialFullscreen=i.isFullscreen}else this.state.isMuted=!e.playerComponent.supportsAutoplayWithAudio}}initControls(){this.createVolumeImg(),this.createCenterControlsDiv(),this.createChatForm(),this.createTipForm(),this.createSendButton(),this.createTokenBalance(),this.createFullscreenImg(),this.createResizeDragLabel(),this.airPlayImg=this.createCastingImage("airplay.svg"),this.chromecastImg=this.createCastingImage("chromecast.svg"),this.createTopBar(),this.createBottomBar()}constructUI(){this.element.appendChild(this.topBar),this.element.appendChild(this.bottomBar),this.centerControlsDiv.appendChild(this.chatForm),this.centerControlsDiv.appendChild(this.tipForm),this.centerControlsDiv.appendChild(this.sendButton)}createTopBar(){this.topBar=document.createElement("div"),this.topBar.style.width="100%",this.topBar.style.display="flex",this.topBar.style.alignItems="center",this.topBar.style.padding="6px",this.topBar.style.boxSizing="border-box",this.topBar.appendChild(this.airPlayImg),this.topBar.appendChild(this.chromecastImg),this.topBar.appendChild(this.tokenBalanceWrapper)}createBottomBar(){this.bottomBar=document.createElement("div"),this.bottomBar.classList.add("bottomBar"),this.bottomBar.style.width="100%",this.bottomBar.style.display="flex",this.bottomBar.style.alignItems="center",this.bottomBar.style.justifyContent="center",this.bottomBar.style.boxSizing="border-box",this.bottomBar.appendChild(this.volumeImgWrapper),this.bottomBar.appendChild(this.resizeDragLabel),this.bottomBar.appendChild(this.centerControlsDiv),this.bottomBar.appendChild(this.fullscreenImgWrapper)}onOrientationChange(){this.show(),(0,H.K$)()?this.setPlaceholder(this.tipMessageInput,$):this.setPlaceholder(this.tipMessageInput,W),!this.playerIsFullscreen&&this.isTipFormActive&&this.hideTipForm(),void 0!==this.rulesModal&&this.showingRules&&((0,H.K$)()?this.playerIsFullscreen||this.rulesModal.hide(!0):this.rulesModal.show(!0)),this.closeActiveInput(),void 0!==this.mobilePureChat&&(this.mobilePureChat.setVisible(this.playerIsFullscreen||!(0,H.K$)()),this.mobilePureChat.scrollToBottom()),this.wasInPortrait=(0,H.K$)()}updatePlayerHiddenStatus(e){switch(e){case"offline":case"notconnected":case"away":case"privatenotwatching":case"hidden":case"passwordprotected":this.setPlayerVisibilityEvent.fire(!0);break;default:this.setPlayerVisibilityEvent.fire(!1)}}createVolumeImg(){this.volumeImgWrapper=document.createElement("div"),this.volumeImgWrapper.style.position="relative",this.volumeImgWrapper.style.display="inline-block",this.volumeImg=document.createElement("img"),this.volumeImg.style.height="42px",this.volumeImg.style.width="42px",this.volumeImg.style.boxSizing="border-box",this.volumeImg.style.padding="0",this.volumeImg.style.cursor="pointer",this.volumeImg.style.border="none",this.volumeImg.style.background="none",this.volumeImg.style.zIndex="1",this.volumeImg.style.marginRight="10px",this.volumeImgWrapper.appendChild(this.volumeImg);let e=this.volumeImg;if((0,w.P7)()){e=this.volumeImgWrapper;const t=document.createElement("div");(0,y.ZM)(t,{position:"absolute",top:"-6px",bottom:"-6px",left:"-6px",right:"0"}),this.volumeImgWrapper.appendChild(t)}(0,d.wu)("click",e,(()=>{this.isVisible?(this.showControls(),this.playerIsJPEG?this.hlsWaitingForInteraction?this.forceHlsOverlayFunc(!0):this.forceHLS():((0,S.bT)("ToggleMute",{newState:!this.state.isMuted}),this.state.isMuted?this.unmute():this.mute())):this.showControls()}))}createCenterControlsDiv(){this.centerControlsDiv=document.createElement("div"),this.centerControlsDiv.style.opacity="0",this.centerControlsDiv.style.display="none",this.centerControlsDiv.style.zIndex="1",this.centerControlsDiv.style.height="42px",this.centerControlsDiv.style.gridTemplateColumns="1fr auto",this.centerControlsDiv.style.columnGap="10px",this.centerControlsDiv.style.flex="1",(0,k.Ve)(this.centerControlsDiv,"opacity 250ms")}createChatForm(){this.chatForm=document.createElement("form"),this.chatInput=new v.wi((()=>this.safeSubmit()),R.hk),this.chatExitButton=document.createElement("button"),this.chatExitImg=document.createElement("img"),this.chatExitButton.appendChild(this.chatExitImg),this.styleForm(this.chatForm),this.chatInput.element.classList.add("mobileFullscreenInput"),this.chatInput.element.style.textOverflow="",this.chatInput.element.style.verticalAlign="bottom",this.chatInput.element.style.webkitUserSelect="text",this.chatInput.setPlaceholder(I.R.mobileChatLabel,"placeholder"),this.chatInput.element.dataset.testid="chat-input",this.styleInput(this.chatForm),this.chatForm.style.overflow="hidden",this.chatForm.style.alignItems="center",this.showChatForm(),this.chatInput.element.style.flex="1",this.chatInput.element.style.height="",this.chatInput.element.style.textOverflow="ellipsis",this.chatInput.element.style.overflow="hidden",this.chatInput.element.style.lineHeight="26px",this.chatInput.element.style.fontSize="16px",this.chatInput.element.style.fontWeight="bold",this.chatInput.element.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",this.chatForm.appendChild(this.chatInput.element),this.chatForm.appendChild(this.chatExitButton),this.chatExitButton.type="button",this.chatExitButton.style.width="36px",this.chatExitButton.style.height="36px",this.chatExitButton.style.padding="0",this.chatExitButton.style.margin="0",this.chatExitButton.style.border="none",this.chatExitButton.style.borderRadius="18px",this.chatExitButton.style.outline="none",this.chatExitButton.style.backgroundColor="transparent",this.chatExitButton.style.opacity="1",this.chatExitButton.style.display="none",this.chatExitImg.src=`${STATIC_URL_MOBILE}exit-chat.svg`,this.chatExitImg.style.width="50%",this.chatExitImg.style.height=200/7+"%",this.chatExitImg.style.opacity="1",this.chatExitImg.style.display="none",this.chatExitButton.onmousedown=e=>{e.preventDefault(),this.isClickingAButton=!0},this.chatExitButton.onmouseup=e=>{e.preventDefault(),this.isClickingAButton=!1},this.chatExitButton.onclick=e=>{e.preventDefault(),this.chatInput.blur(),this.hlsWaitingForInteraction&&this.forceHlsOverlayFunc(!1)},(0,d.wu)("mousedown",this.chatInput.element,(()=>{this.isVisible&&((0,k.Ve)(this.centerControlsDiv,"none"),this.centerControlsDiv.style.opacity="1")})),(0,d.wu)("focus",this.chatInput.element,(()=>{this.showControls(),this.inputScrollIntoViewFix(),this.inputFix(!0),this.repositionChildren()})),(0,d.wu)("blur",this.chatInput.element,(()=>{(0,k.Ve)(this.centerControlsDiv,"opacity 250ms"),this.isClickingAButton||(this.showControls(),this.closeKeyboardFix(),this.inputFix(!1),this.repositionChildren())})),this.chatForm.onsubmit=e=>{e.preventDefault(),this.chatInput.submit()}}inputFix(e){(0,U.Jo)()&&(0,H.K$)()&&(e?((0,y.ZM)(this.centerControlsDiv,{bottom:"50px"}),void 0!==this.mobilePureChat&&(this.mobilePureChat.inputFocusOffset=50,(0,y.ZM)(this.mobilePureChat.element,{bottom:`${65+this.centerControlsDiv.offsetHeight}px`}))):((0,y.ZM)(this.centerControlsDiv,{bottom:"0"}),void 0!==this.mobilePureChat&&(this.mobilePureChat.inputFocusOffset=0),this.repositionChildrenRecursive()))}inputScrollIntoViewFix(){(0,s.OF)()&&!(0,H.K$)()&&(document.documentElement.scrollTop=(0,O.mJ)()),G()&&(this.autofillAccessoryConstraint=50,this.updateConstraints())}closeKeyboardFix(){G()&&(this.autofillAccessoryConstraint=0,this.updateConstraints())}safeSubmit(){return!(0,u.rC)('You must be logged in to send a message. Click "OK" to login.')&&this.cleanAndSendMessage(this.chatInput.getText())}cleanAndSendMessage(e){if(""===e.trim())return!1;const t=(0,M.PR)(e);switch(t.messageType){case M.gW.TipRequest:this.chatInput.clearText();const i=t;this.showTipForm(i.messageData);break;case M.gW.ToggleDebugMode:if(void 0===this.chatConnection)return(0,c.Q$)("Unable to enable debug mode"),!1;this.chatConnection.toggleAppDebugging();break;case M.gW.Shortcode:if(void 0===this.chatConnection)return(0,c.Q$)("Unable to send shortcode"),!1;const s=t,o=this.shortcodeErrorMsg(s,e);if(void 0!==o)return this.chatConnection.event.roomNotice.fire({messages:[[(0,p.H5)(o)]],showInPrivateMessage:!0}),!1;this.chatConnection.sendShortcode(s);break;default:if(void 0===this.chatConnection)return(0,c.Q$)("Unable to send message"),!1;if(this.chatConnection.inPrivateRoom()){const t={message:e,username:this.chatConnection.isBroadcasting?this.chatConnection.getPrivateShowUser():this.chatConnection.room(),source:"mobilePM",roomName:this.chatConnection.room()};(0,n.F_)(t).catch((e=>{(0,c.Q$)(e.errorMessage)}))}else this.chatConnection.sendRoomMessage(e);B.Wr.fire(void 0)}return!0}shortcodeErrorMsg(e,t){var i;return!0===(null===(i=this.chatConnection)||void 0===i?void 0:i.inPrivateRoom())?I.R.shortcodeNotSupportedInPrivates:0===e.shortcodes.length?M.fM.errorBehindShortcode(t):void 0}createSendButton(){this.sendButton=document.createElement("button"),this.sendButton.classList.add("sendButton"),this.sendButton.innerText=I.R.sendTipButtonCAPS,this.sendButton.dataset.testid="send-tip-button",this.sendButton.style.outline="none",this.sendButton.style.border="none",this.sendButton.style.height="42px",this.sendButton.style.fontSize="16px",this.sendButton.style.fontFamily="UbuntuBold, Arial, Helvetica, sans-serif",this.sendButton.style.color="rgb(240,240,240)",this.sendButton.style.background="rgba(21, 107, 149, 0.75)",this.sendButton.style.padding="5px 8px",this.sendButton.style.borderRadius="6px",this.sendButton.style.boxSizing="border-box",this.sendButton.style.cursor="pointer",this.sendButton.style.display="inline-block",this.sendButton.style.textAlign="center",this.sendButton.onmousedown=e=>{e.preventDefault(),this.isClickingAButton=!0},this.sendButton.onmouseup=e=>{e.preventDefault(),this.isClickingAButton=!1},this.sendButton.onclick=()=>{const e=this.isChatInputFocused()?"message":"tip";(0,u.rC)(`You must be logged in to send a ${e}. Click "OK" to login.`)?this.closeActiveInput():(this.isTipFormActive?this.submitTipForm():this.isChatInputFocused()?this.chatInput.submit():this.showTipForm(),this.hlsWaitingForInteraction&&this.forceHlsOverlayFunc(!1))}}createTipForm(){this.tipForm=document.createElement("form"),this.tipMessageInput=document.createElement("input"),this.tipMessageInput.dataset.testid="tip-message-textarea",this.tipAmountContainer=document.createElement("div");const e=document.createElement("label"),t=document.createElement("div");this.tipAmountInput=(0,h.Gz)("");const i=document.createElement("button");this.tipForm.appendChild(this.tipMessageInput),this.tipForm.appendChild(this.tipAmountContainer),this.tipForm.appendChild(i),this.tipAmountContainer.appendChild(e),this.tipAmountContainer.appendChild(t),t.appendChild(this.tipAmountInput),this.styleForm(this.tipForm),this.styleInput(this.tipMessageInput),this.styleInput(this.tipAmountContainer),this.styleInput(this.tipAmountInput),(0,H.K$)()?this.setPlaceholder(this.tipMessageInput,$):this.setPlaceholder(this.tipMessageInput,W),this.tipForm.classList.add("tipForm"),this.tipForm.style.columnGap="10px",this.tipForm.style.display="none",this.tipMessageInput.classList.add("mobileFullscreenInput"),this.tipAmountContainer.style.display="flex",this.tipAmountContainer.style.padding="4px 5px",e.innerText=`${I.R.amountText} `,e.style.opacity="0.7",e.style.lineHeight="34px",t.style.overflow="hidden",t.style.padding="0",t.style.flex="1",this.tipAmountInput.style.background="white",this.tipAmountInput.style.height="34px",this.tipAmountInput.style.lineHeight="34px",this.tipAmountInput.style.textAlign="center",this.tipAmountInput.style.margin="0",this.tipAmountInput.style.padding="0 6px",this.tipAmountInput.style.opacity="0.9",this.tipAmountInput.style.width="100%",this.tipAmountInput.style.color="black",(0,d.wu)("input",this.tipAmountInput,(()=>{(0,h.Pt)(this.tipAmountInput),this.hlsWaitingForInteraction&&this.forceHlsOverlayFunc(!1)})),i.style.visibility="hidden",i.style.width="0",i.style.height="0",i.style.position="absolute",i.type="submit",this.tipMessageInput.onfocus=()=>{this.inputScrollIntoViewFix(),this.inputFix(!0)},this.tipAmountInput.onfocus=()=>{this.inputScrollIntoViewFix(),this.inputFix(!0),(0,s.OF)()?(0,U.Jo)()?window.setTimeout((()=>{this.tipAmountInput.setSelectionRange(0,this.tipAmountInput.value.length)}),0):this.tipAmountInput.setSelectionRange(0,this.tipAmountInput.value.length):this.tipAmountInput.select()},this.tipAmountInput.onblur=()=>{""===this.tipAmountInput.value&&(this.tipAmountInput.value="0"),this.closeKeyboardFix(),this.inputFix(!1)},this.tipAmountInput.onkeydown=e=>{e.metaKey||"Unidentified"===e.key||"Backspace"===e.key||"Enter"===e.key||"0123456789".includes(e.key)||e.preventDefault()},this.tipMessageInput.onblur=()=>{this.closeKeyboardFix(),this.inputFix(!1)},this.tipForm.onsubmit=e=>{e.preventDefault(),this.submitTipForm()}}notifyPlayerChangeSize(){const e=Math.abs(this.playerScroll-this.playerElement.scrollLeft),t=Math.abs(this.playerHeight-this.playerElement.offsetHeight);if(e<10&&t<10)return;let i=T.Bu;void 0!==this.currentRoomContext&&!0===this.currentRoomContext.dossier.isWidescreen&&(i=T.qL),e*i>t?B.BG.fire({changeType:1}):B.BG.fire({changeType:0})}submitTipForm(){if(this.closeActiveInput(),!(0,h.sI)(this.tipAmountInput.value))return void(0,c.Q$)(I.R.tipAmountInvalid);const e=parseInt(this.tipAmountInput.value);e>this.tokenBalance?(0,h.qr)(I.R.notEnoughTokensMessage,!1,l.Bm.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE,this.roomType):((0,S.bT)("SendTipClicked",{amount:e,source:"mobile_fullscreen"}),e>100?(0,c.mf)(I.R.tipConfirmationMessage(e),(()=>this.mySendTip(e))):this.mySendTip(e))}mySendTip(e){this.sendButton.disabled=!0,(0,o.ae)({roomName:this.roomName,tipAmount:this.tipAmountInput.value,message:`${this.tipMessageInput.value}`,source:"mobile",tipRoomType:this.roomType,tipType:"public",videoMode:"mobile"}).then((t=>{this.sendButton.disabled=!1,t.success?(0,S.bT)("SendTipSuccess",{amount:e,source:"mobile_fullscreen"}):void 0!==t.error?(0,c.Q$)(t.error):error("unknown send tip error"),this.tipMessageInput.value="",this.hideTipForm(),g.Ps.fire({amount:e,success:t.success}),void 0!==t.tipsInPast24Hours&&o.ew.fire({tokens:t.tipsInPast24Hours,roomName:this.roomName})})).catch((t=>{g.Ps.fire({amount:e,success:!1}),this.sendButton.disabled=!1,(0,c.Q$)("Unable to send tip"),error(`Error sending tip (${t})`)}))}styleForm(e){e.style.height="100%",e.style.boxSizing="border-box"}styleInput(e){e.style.textOverflow="ellipsis",e.style.whiteSpace="nowrap",e.style.overflow="hidden",e.style.height="42px",e.style.lineHeight="26px",e.style.fontSize="16px",e.style.fontWeight="bold",e.style.fontFamily="UbuntuRegular, Arial, Helvetica, sans-serif",e.style.border="none",e.style.outline="none",e instanceof HTMLInputElement&&(e.autocomplete="off"),e.style.color="rgb(15,15,15)",e.style.background="rgba(255, 255, 255, 0.5)",e.style.padding="8px 10px",e.style.borderRadius="6px",e.style.boxSizing="border-box",e.style.cursor="pointer",e.style.display="inline-block",e.style.textAlign="left"}createTokenBalance(){this.tokenBalanceWrapper=document.createElement("div"),this.tokenBalanceLink=document.createElement("a");const e=document.createElement("span");this.tokenBalanceAmount=document.createElement("span"),this.tokenBalanceWrapper.appendChild(this.tokenBalanceLink),this.tokenBalanceLink.appendChild(e),this.tokenBalanceLink.appendChild(this.tokenBalanceAmount),this.tokenBalanceWrapper.style.zIndex="2",this.tokenBalanceLink.target="_blank",this.tokenBalanceLink.style.display="none",this.tokenBalanceLink.style.textDecoration="none",this.tokenBalanceLink.style.fontWeight="bold",this.tokenBalanceLink.style.borderRadius="8px",this.tokenBalanceLink.style.padding="6px 12px",this.tokenBalanceLink.style.background="rgba(255, 255, 255, 0.6)",this.tokenBalanceLink.onclick=()=>{const e=l.Bm.current.PurchaseEventSources.TOKEN_SOURCE_MOBILE_VIDEO_CONTROLS;(0,h.di)({source:e,roomType:this.roomType})},e.textContent=`${I.R.balanceText} `,e.style.color="rgb(50, 50, 50)",this.tokenBalanceAmount.textContent="0 Tokens",this.tokenBalanceAmount.style.color="rgb(15, 15, 15)",this.tokenBalanceAmount.dataset.testid="mobile-token-balance"}createFullscreenImg(){this.fullscreenImgWrapper=document.createElement("div"),this.fullscreenImgWrapper.style.position="relative",this.fullscreenImgWrapper.style.display="inline-block",this.fullscreenImg=document.createElement("img"),this.fullscreenImg.dataset.testid="mobile-fullscreen-button",this.fullscreenImg.src=`${STATIC_URL_MOBILE}expand-1.svg`,this.fullscreenImg.style.height="42px",this.fullscreenImg.style.width="42px",this.fullscreenImg.style.boxSizing="border-box",this.fullscreenImg.style.padding="0",this.fullscreenImg.style.cursor="pointer",this.fullscreenImg.style.border="none",this.fullscreenImg.style.background="none",this.fullscreenImg.style.zIndex="1",this.fullscreenImg.style.borderRadius="21px",this.fullscreenImg.style.marginLeft="10px",this.fullscreenImgWrapper.appendChild(this.fullscreenImg);let e=this.fullscreenImg;if((0,w.P7)()){e=this.fullscreenImgWrapper;const t=document.createElement("div");(0,y.ZM)(t,{position:"absolute",top:"-6px",bottom:"-6px",left:"0",right:"-6px"}),this.fullscreenImgWrapper.appendChild(t)}(0,d.wu)("click",e,(()=>{this.hlsWaitingForInteraction&&this.forceHlsOverlayFunc(!1),this.isVisible?(this.showControls(),this.setFullscreen(!this.playerIsFullscreen)):this.showControls()}))}createResizeDragLabel(){this.resizeDragLabel=document.createElement("div"),this.resizeDragLabel.innerText=I.R.dragToResize,this.resizeDragLabel.style.backgroundColor="rgba(0,0,0,0.3)",this.resizeDragLabel.style.color="rgba(255,255,255,0.6)",this.resizeDragLabel.style.borderRadius="6px",this.resizeDragLabel.style.padding="5px",this.resizeDragLabel.style.textAlign="center",this.resizeDragLabel.style.pointerEvents="none",this.resizeDragLabel.style.textOverflow="ellipsis",this.resizeDragLabel.style.whiteSpace="nowrap",this.resizeDragLabel.style.overflow="hidden",this.resizeDragLabel.style.flex="1"}repositionChildren(){!(0,H.K$)()||this.playerIsFullscreen||this.playerUsingAirPlay||this.playerUsingChromecast?this.resizeDragLabel.style.display="none":this.resizeDragLabel.style.display="",this.updateIcons(),this.updateCenterControls(),this.updateSendButton(),this.updateChatExitButton(),window.setTimeout((()=>{this.updateChatInput()}),0),this.updateTokenBalancePosition(),this.adjustDimensions()}adjustDimensions(){const e=this.playerElement.getBoundingClientRect();if(this.element.style.width="inherit",this.isFullVideo())(0,C.aS)()?(this.element.style.height="calc(var(--vh, 1vh) * 100)",(0,s.m0)()&&window.visualViewport&&((0,H.K$)()?Math.floor(window.visualViewport.height)!==Math.floor(window.innerHeight)&&(this.element.style.height=`${this.smallestPortraitHeight}px`):Math.floor(window.visualViewport.height)!==Math.floor(window.innerHeight)?this.element.style.width=`${this.smallestLandscapeWidth}px`:this.element.style.width=`${window.visualViewport.width}px`)):this.element.style.height="100%",this.element.style.top="0";else{this.element.style.height=`${e.height}px`;const t=this.mobileDismissibleMessages.element.offsetHeight;this.element.style.top=`${this.headerHeight+t}px`}}updateIcons(){this.shouldHideIcons()?(this.fullscreenImgWrapper.style.display="none",this.volumeImgWrapper.style.display="none"):(this.fullscreenImgWrapper.style.display="inline",this.volumeImgWrapper.style.display="inline"),F()||(0,H.K$)()||(this.fullscreenImgWrapper.style.display="none")}updateCenterControls(){this.isFullVideo()?this.showCenterControls():this.hideCenterControls()}showCenterControls(){this.isVisible&&(this.centerControlsDiv.style.opacity="1",this.centerControlsDiv.style.pointerEvents="auto",this.centerControlsDiv.style.display="grid")}hideCenterControls(){this.centerControlsDiv.style.opacity="0",this.centerControlsDiv.style.pointerEvents="none",this.isFullVideo()||(this.centerControlsDiv.style.display="none")}updateChatExitButton(){this.isChatInputFocused()?(this.chatExitImg.style.display="inline-block",this.chatExitButton.style.display="block"):(this.chatExitImg.style.display="none",this.chatExitButton.style.display="none")}updateChatInput(){this.isChatInputFocused()?(this.chatInput.element.style.textOverflow="",this.chatInput.element.scrollLeft=this.chatInput.element.scrollWidth,this.chatInput.setCaretToEnd()):(this.chatInput.element.style.textOverflow="ellipsis",this.chatInput.element.scrollLeft=0)}isAnyInputFocused(){return this.isChatInputFocused()||this.isTipInputFocused()}closeActiveInput(){this.chatInput.element===document.activeElement?this.chatInput.blur():this.tipAmountInput===document.activeElement?this.tipAmountInput.blur():this.tipMessageInput===document.activeElement&&this.tipMessageInput.blur()}isChatInputFocused(){return this.chatInput.element===document.activeElement}isTipInputFocused(){return this.tipAmountInput===document.activeElement||this.tipMessageInput===document.activeElement}shouldHideIcons(){return this.isChatInputFocused()||this.isTipFormActive}showTipForm(e){this.isVisible||((0,k.Ve)(this.centerControlsDiv,"none"),this.showControls()),this.isTipFormActive=!0,this.tokenBalanceLink.style.display="block",this.chatForm.style.display="none",this.tipForm.style.display="grid",void 0!==e&&(void 0!==e.amount&&(this.tipAmountInput.value=e.amount.toString(),(0,h.Pt)(this.tipAmountInput)),void 0!==e.message&&(this.tipMessageInput.value=e.message)),this.tipAmountInput.focus(),this.repositionChildren()}hideTipForm(){this.isTipFormActive=!1,this.tokenBalanceLink.style.display="none",this.tipForm.style.display="none",this.showChatForm(),this.repositionChildren()}showChatForm(){this.chatForm.style.display="flex"}setFullscreen(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.playerIsFullscreen!==e&&(this.playerIsFullscreen=e,this.toggleFullscreen.fire(e),e?this.fullscreenImg.src=`${STATIC_URL_MOBILE}contract-1.svg`:(this.fullscreenImg.src=`${STATIC_URL_MOBILE}expand-1.svg`,this.isTipFormActive&&this.hideTipForm()),void 0!==this.rulesModal&&this.showingRules&&(e?this.rulesModal.show(!0):this.rulesModal.hide(!0)),void 0!==this.mobilePureChat&&((0,H.K$)()?this.mobilePureChat.setVisible(e):this.mobilePureChat.setVisible(!0)),this.centerPlayerEvent.fire(void 0),this.updateCenterControls(),this.repositionChildren(),this.saveSettings(),t||this.maybeUseFullscreenAPI(e))}maybeUseFullscreenAPI(e){F()&&(e?this.requestFullscreenEvent.fire(void 0):(0,C.Eh)())}updateSendButton(){this.isChatInputFocused()?(this.sendButton.innerText=I.R.sendCAPS,this.sendButton.dataset.testid="send-button"):(this.sendButton.innerText=I.R.sendTipButtonCAPS,this.sendButton.dataset.testid="send-tip-button")}updateVolumeImage(){this.state.isMuted||0===this.state.volume?this.volumeImg.src=`${STATIC_URL_MOBILE}muted.svg`:this.volumeImg.src=`${STATIC_URL_MOBILE}unmuted.svg`,(0,S.yC)(100,this.state.isMuted)}updatePlayerVolume(){this.userUnmuted||this.state.isMuted||(this.userUnmuted=!0,(0,S.bT)("UserUnmuted",{chatMode:"mobile"})),this.setPlayerComponentVolumeMutedEvents.fire({...this.state})}saveSettings(){if((0,s.Pf)()){const e={isMuted:this.state.isMuted,isFullscreen:this.playerIsFullscreen,volume:this.state.volume};window.localStorage.setItem(V,JSON.stringify(e))}}update(){this.updatePlayerVolume()}mute(){this.updateIsMuted(!0),this.update()}unmute(){this.updateIsMuted(!1),this.update()}updateTokenBalance(e){this.tokenBalance=e,this.tokenBalanceAmount.innerText=`${e} Tokens`}updateTokenBalancePosition(){const e=(0,y.YG)(this.airPlayImg)||(0,y.YG)(this.chromecastImg),t=this.airPlayImg.offsetWidth||this.chromecastImg.offsetWidth,i=t&&e?t:0;this.tokenBalanceWrapper.style.left=`${15+i}px`,this.isTipInputFocused()?(this.tokenBalanceWrapper.style.position="absolute",this.updateTokenBalanceTopProperty()):this.tokenBalanceWrapper.style.position="static"}updateTokenBalanceTopProperty(){const e=this.centerControlsDiv.offsetHeight,t=this.tokenBalanceLink.offsetHeight,i=(0,O.mJ)()-e-t-15;this.tokenBalanceWrapper.style.top=`${Math.min((0,O.d9)()+15,i)}px`}setPlaceholder(e,t){e.setAttribute("placeholder",t)}isFullVideo(){return this.playerIsFullscreen||!(0,H.K$)()}updateCastingStyling(e){"AirPlay"===e?this.airPlayImg.src=`${STATIC_URL_MOBILE}airplay-active.svg`:"Chromecast"===e?this.chromecastImg.src=`${STATIC_URL_MOBILE}chromecast-active.svg`:(this.airPlayImg.src=`${STATIC_URL_MOBILE}airplay.svg`,this.chromecastImg.src=`${STATIC_URL_MOBILE}chromecast.svg`),this.showControls()}createCastingImage(e){const t=document.createElement("img");return t.style.display="none",t.src=`${STATIC_URL_MOBILE+e}`,t.style.height="42px",t.style.width="42px",t.style.cursor="pointer",t.style.marginRight="6px",t.style.zIndex="1",(0,d.wu)("click",t,(()=>{this.showControls()})),t}showAirPlay(){this.airPlayImg.style.display="",this.airPlayIconConstraint=48,this.updateConstraints()}hideAirPlay(){this.airPlayImg.style.display="none",this.airPlayIconConstraint=0,this.updateConstraints()}showChromecast(){this.chromecastImg.style.display="",this.airPlayIconConstraint=48,this.updateConstraints()}hideChromecast(){this.chromecastImg.style.display="none",this.airPlayIconConstraint=0,this.updateConstraints()}updateConstraints(){this.layoutConstraints.setConstraints({top:this.airPlayIconConstraint,bottom:this.autofillAccessoryConstraint,left:this.airPlayIconConstraint,right:0,transitionTime:0})}showElement(){super.showElement("flex")}show(){this.showElement(),this.showControls()}hide(){this.hideElement()}showControls(){this.isVisible||(this.isFullVideo()||this.playerUsingAirPlay||this.playerUsingChromecast?this.resizeDragLabel.style.display="none":this.resizeDragLabel.style.display="",(0,k.Ve)(this.airPlayImg,"opacity none"),(0,k.Ve)(this.chromecastImg,"opacity none"),(0,k.Ve)(this.volumeImgWrapper,"opacity none"),(0,k.Ve)(this.fullscreenImgWrapper,"opacity none"),(0,k.Ve)(this.resizeDragLabel,"opacity none"),this.airPlayImg.style.opacity="1",this.chromecastImg.style.opacity="1",this.volumeImgWrapper.style.opacity="1",this.fullscreenImgWrapper.style.opacity="1",this.resizeDragLabel.style.opacity="1",this.isVisible=!0),this.updateCenterControls(),clearTimeout(this.opacityTimer),this.opacityTimer=window.setTimeout((()=>{this.hideControls()}),3500)}hideControls(){!this.isVisible||this.isChatInputFocused()||this.isTipFormActive||this.playerUsingAirPlay||this.playerUsingChromecast||((0,k.Ve)(this.airPlayImg,"opacity 250ms"),(0,k.Ve)(this.chromecastImg,"opacity 250ms"),(0,k.Ve)(this.volumeImgWrapper,"opacity 250ms"),(0,k.Ve)(this.fullscreenImgWrapper,"opacity 250ms"),(0,k.Ve)(this.resizeDragLabel,"opacity 250ms"),this.airPlayImg.style.opacity="0",this.chromecastImg.style.opacity="0",this.volumeImgWrapper.style.opacity="0",this.fullscreenImgWrapper.style.opacity="0",this.resizeDragLabel.style.opacity="0",this.hideCenterControls(),this.isVisible=!1)}updateVolume(e){this.state.volume=e,this.updateVolumeImage()}updateIsMuted(e){this.state.isMuted=e,this.updateVolumeImage()}updateAndSaveVolume(e){this.updateVolume(e),this.saveSettings()}updateAndSaveIsMuted(e){this.updateIsMuted(e),this.saveSettings()}getControlBarHeight(){return 0}setPureChat(e){e!==this.mobilePureChat&&(void 0!==this.mobilePureChat&&(this.layoutHandler.removeListener(this.mobilePureChat.layoutConstraints),this.removeChild(this.mobilePureChat)),this.mobilePureChat=e,this.addChild(this.mobilePureChat),this.mobilePureChat.setVisible(this.playerIsFullscreen||!(0,H.K$)()),this.layoutHandler.addListener(this.mobilePureChat.layoutConstraints))}forceHLS(){void 0!==this.currentRoomContext?((0,S.bT)("ForceHLS"),this.forceHlsPlayerEvent.fire({roomContext:this.currentRoomContext}),this.unmute(),_.Io.fire(void 0)):error("unexpected switch to hls",{},"VIDEO_")}showHideHlsPlayButton(e){void 0!==this.playButtonContainer&&void 0!==this.forceHlsOverlay&&((0,P.x_)(e)?(this.playButtonContainer.style.display="flex",this.forceHlsOverlay.style.display=""):(this.playButtonContainer.style.display="none",this.forceHlsOverlay.style.display="none"))}forceHlsOverlayFunc(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.hlsWaitingForInteraction&&void 0!==this.currentRoomContext&&!this.forceHlsTriggered&&(void 0!==this.forceHlsOverlay&&null!==this.forceHlsOverlay.parentElement&&(this.forceHlsOverlay.parentElement.removeChild(this.forceHlsOverlay),this.forceHlsOverlay=void 0),void 0!==this.playButtonContainer&&null!==this.playButtonContainer.parentElement&&(this.playButtonContainer.parentElement.removeChild(this.playButtonContainer),this.playButtonContainer=void 0),this.forceHlsTriggered=!0,this.hlsWaitingForInteraction=!1,(0,S.bT)("ForceHLS"),this.forceHlsPlayerEvent.fire({roomContext:this.currentRoomContext,unmute:e}),this.element.style.zIndex="")}createHlsPlayOverlay(){this.forceHlsOverlay=document.createElement("div"),this.element.style.zIndex="100",this.forceHlsOverlay.style.width="100%",this.forceHlsOverlay.style.height="100%",this.forceHlsOverlay.style.position="absolute",this.forceHlsOverlay.style.top="0",this.forceHlsOverlay.style.left="0",this.forceHlsOverlay.style.zIndex="99",(0,d.wu)("click",this.forceHlsOverlay,(()=>{this.forceHlsOverlayFunc()})),(0,d.wu)("click",this.element,(()=>{this.forceHlsOverlayFunc()})),this.playerComponentReadjustForceHlsOverlayOrderEvent.fire(this.forceHlsOverlay)}createForceHlsPlayButton(){if(this.playerIsJPEG){this.hlsWaitingForInteraction=!0,this.playButtonContainer=document.createElement("div");const e=document.createElement("img");e.src=`${STATIC_URL}play-inactive.svg`,e.style.width="30px",e.style.height="30px",e.style.cursor="pointer",this.playButtonContainer.style.cursor="pointer",this.playButtonContainer.style.width="70px",this.playButtonContainer.style.height="70px",this.playButtonContainer.style.borderRadius="50%",this.playButtonContainer.style.backgroundColor="rgba(0,0,0,0.25)",this.playButtonContainer.style.display="flex",this.playButtonContainer.style.alignItems="center",this.playButtonContainer.style.justifyContent="center",this.playButtonContainer.appendChild(e),this.element.insertBefore(this.playButtonContainer,this.bottomBar),this.showJpegPlayerComponentImage.fire(void 0),this.createHlsPlayOverlay(),this.repositionChildren()}}notifyPlayerIsJPEG(e){this.playerIsJPEG=e}notifyPlayerIsHlsPlaceholder(e){this.playerIsHlsPlaceholder=e}getPlayerIsHlsPlaceholder(){return this.playerIsHlsPlaceholder}notifyUsingAirPlayChange(e){this.playerUsingAirPlay=e}notifyUsingChromecastChange(e){this.playerUsingChromecast=e}canResizePlayerInFullscreen(){return!this.isAnyInputFocused()&&(0,H.K$)()&&this.isFullVideo()}bindTouchControlsEvent(){this.touchControls.touchMoveEvent.listen((e=>{switch(e.state){case 0:this.playerScroll=this.playerElement.scrollLeft,this.playerHeight=this.playerElement.offsetHeight;break;case 1:this.showControls();break;case 3:const t=this.isVisible;t||e.event.preventDefault(),t?this.isTipFormActive?this.hideTipForm():this.hideControls():this.showControls(),B.lG.fire(void 0),this.closeActiveInput(),this.requestHlsPlayerPlayIfPaused.fire(void 0);break;case 2:this.notifyPlayerChangeSize()}}))}executeInitialFullscreenState(){this.initialFullscreen&&this.setFullscreen(!0,!0)}getMobileRoot(){return this.mobileRoot}}const G=()=>{if((0,s.J0)()&&/CriOS\//.test(navigator.userAgent)){const e=navigator.userAgent.split("CriOS/")[1].split(".")[0];if(parseInt(e)>=75)return!0}return!1}},5169:(e,t,i)=>{"use strict";i.d(t,{S:()=>m});var s=i(6784),n=i(3333),o=i(2709),r=i(7407),a=i(2146),l=i(1372),h=i(4110),d=i(9586),c=i(5257),u=i(4580),p=i(8936);class m extends o.u{constructor(e){super("div",e)}initData(e){this.tabList=e.tabList,this.isTouching=!1,this.isSwipingTabs=!1,this.isScrollingVertically=!1,this.isPinching=!1,this.prevTranslate=0,this.currTranslate=0,this.startX=0,this.startY=0,this.tabWidth=(0,p.$B)().width,this.currIndex=0,m.currentTab="chat"}initUI(){this.element=(0,l.tT)("div",{style:{width:"100%",height:"100%",backgroundColor:"#FFFFFF",display:"flex",position:"absolute"}}),this.tabList.getList().forEach((e=>{this.addChild(e)})),this.initSwipeListeners(),u.qb.listen((e=>{this.setActiveTab(e)})),h.nw.listen((()=>{u.qb.fire("moreRooms")})),n.eF.listen((()=>{u.qb.fire("roomMenu"),this.tabList.getRoomMenuTab().getRoomMenu().openMenuComponentByName(3)}))}initSwipeListeners(){this.tabList.getList().forEach((e=>{(0,s.wu)("touchstart",e.element,(e=>{this.handleTouchStart(e)})),(0,s.wu)("touchmove",e.element,(e=>{this.handleTouchMove(e)})),(0,s.wu)("touchend",e.element,(e=>{this.handleTouchEnd(e)}))}))}handleTouchStart(e){const t=e.touches[0].pageX<20||e.touches[0].pageX>this.tabWidth-20;this.isPinching=e.touches.length>=2,t||(0,d.u)()||this.isPinching||((0,a.Ve)(this.element,"left 0.1s ease-out"),this.isTouching=!0,this.startX=e.touches[0].pageX,this.startY=e.touches[0].pageY)}handleTouchMove(e){const t=e.touches[0].pageX-this.startX,i=t<0,s=0===this.currIndex,n=this.currIndex===this.tabList.length()-1,o=s&&!i||n&&i;if(!this.isTouching||o||this.isPinching)return;const r=e.touches[0].pageX,a=e.touches[0].pageY;(0,c.UK)(this.startX,this.startY,r,a)&&!this.isSwipingTabs&&(this.isScrollingVertically=!0),this.isScrollingVertically||(e.preventDefault(),this.isSwipingTabs=!0,this.currTranslate=this.prevTranslate+t,this.element.style.left=`${this.currTranslate}px`)}handleTouchEnd(e){if(!this.isTouching)return;window.setTimeout((()=>{(0,a.dI)(this.element)}),100),this.isTouching=!1,this.isSwipingTabs=!1,this.isScrollingVertically=!1,this.isPinching=!1;const t=this.currTranslate-this.prevTranslate,i=this.tabWidth/4,s=t<=-i,n=t>=i,o=this.currIndex+10;if(s&&o){var l;const e=null===(l=this.tabList.getTabByIndex(this.currIndex+1))||void 0===l?void 0:l.getTabName();u.qb.fire(null!=e?e:m.currentTab)}else if(n&&r){var h;const e=null===(h=this.tabList.getTabByIndex(this.currIndex-1))||void 0===h?void 0:h.getTabName();u.qb.fire(null!=e?e:m.currentTab)}else this.currTranslate-=t,this.element.style.left=`${this.currTranslate}px`,this.prevTranslate=this.currTranslate}setActiveTab(e){const t=this.tabList.getIndexByTabName(e);if(void 0!==t){var i;m.currentTab=e,this.currIndex=t;const s=null===(i=this.tabList.getTabByIndex(t))||void 0===i?void 0:i.getPageActionName();void 0!==s&&(0,r.bT)(s)}this.repositionTabs()}repositionTabs(){this.tabWidth=(0,p.DK)(),this.currTranslate=this.currIndex*-this.tabWidth,this.element.style.left=`${this.currTranslate}px`,this.prevTranslate=this.currTranslate}repositionChildren(){this.repositionTabs()}}},9586:(e,t,i)=>{"use strict";i.d(t,{H:()=>o,u:()=>n});var s=i(6784);function n(){return document.activeElement instanceof HTMLInputElement||document.activeElement instanceof HTMLTextAreaElement||document.activeElement instanceof HTMLElement&&"true"===document.activeElement.contentEditable}const o=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.style.overflowY="scroll",t&&((0,s.wu)("touchstart",e,(t=>{0===e.scrollTop&&(e.scrollTop=1)})),(0,s.wu)("touchmove",e,(t=>{n()&&(t.stopPropagation(),!(e.scrollHeight>e.clientHeight)&&t.cancelable&&t.preventDefault())})),(0,s.wu)("scroll",e,(()=>{if(0===e.scrollTop)e.scrollTop=1;else if(e.scrollTop===e.scrollHeight-e.offsetHeight){const t=e.scrollHeight-e.offsetHeight-1;e.scrollTop=Math.max(t,1)}})))}},5257:(e,t,i)=>{"use strict";i.d(t,{UK:()=>r,lg:()=>l,xj:()=>a});var s=i(6784),n=i(8423),o=i(8936);const r=(e,t,i,s)=>{const n=Math.abs(e-i);return Math.abs(t-s)>n};class a extends n.c_{constructor(e,t){super("TouchEvent",t),this.element=e;const i={x:0,y:0},n={x:0,y:0};let o,r;const a={x:0,y:0};let l,h,d,c;(0,s.wu)("touchstart",this.element,(e=>{i.x=e.touches[0].clientX,i.y=e.touches[0].clientY,a.x=e.touches[0].clientX,a.y=e.touches[0].clientY,o=Date.now(),l=0,h=1!==e.touches.length,d=!0,c=!1})),(0,s.wu)("touchmove",this.element,(e=>{if(1===e.touches.length&&!h){n.x=e.touches[0].clientX,n.y=e.touches[0].clientY;const h=i.x-n.x,u=n.y-i.y;let p=1;l+=Math.abs(h)+Math.abs(u),t=l,s=Math.abs(n.y-a.y),r=s>=.7*t||s>110?1:0,d=l<=10,d||(c||(c=!0,p=0),this.fire({direction:r,distance:{x:h,y:u},state:p,elapsedTime:Date.now()-o,totalDistance:{x:a.x-n.x,y:n.y-a.y},startingPoint:a,event:e})),i.x=n.x,i.y=n.y}var t,s})),(0,s.wu)("touchend",this.element,(e=>{if(1===e.changedTouches.length&&!h){n.x=e.changedTouches[0].clientX,n.y=e.changedTouches[0].clientY;const t=d?3:2;this.fire({direction:r,distance:{x:i.x-n.x,y:n.y-i.y},state:t,elapsedTime:Date.now()-o,totalDistance:{x:a.x-n.x,y:n.y-a.y},startingPoint:a,event:e})}}))}}class l extends n.c_{constructor(e,t){let i;super("PinchEvent",t),this.element=e;let n,r=0;const a={x:0,y:0},l=(e,t,s,r)=>{const l=Math.sqrt((e-s)*(e-s)+(t-r)*(t-r));n=a,a.x=(e+s)/2,a.y=(t+r)/2;let h=0;return 0!==i&&(h=(l-i)/(0,o.DK)()),i=l,h};(0,s.wu)("touchstart",this.element,(e=>{i=0,r=0,2===e.touches.length&&(a.x=(e.touches[0].clientX+e.touches[1].clientX)/2,a.y=(e.touches[0].clientY+e.touches[1].clientY)/2,this.fire({state:0,previousCenterPoint:a,centerPoint:a,zoomPercentage:r}))})),(0,s.wu)("touchmove",this.element,(e=>{if(2===e.touches.length){const t=e.touches[0].clientX,i=e.touches[0].clientY,s=e.touches[1].clientX,o=e.touches[1].clientY;r=l(t,i,s,o),this.fire({state:1,previousCenterPoint:n,centerPoint:a,zoomPercentage:r})}})),(0,s.wu)("touchend",this.element,(e=>{if(2===e.changedTouches.length){const t=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY,s=e.changedTouches[1].clientX,o=e.changedTouches[1].clientY;r=l(t,i,s,o),this.fire({state:2,previousCenterPoint:n,centerPoint:a,zoomPercentage:r})}}))}}},4580:(e,t,i)=>{"use strict";i.d(t,{Gt:()=>l,Io:()=>n,P4:()=>h,VZ:()=>r,bW:()=>u,f6:()=>o,nD:()=>d,qb:()=>c,vT:()=>a});var s=i(8423);const n=new s.c_("switchedToHLS"),o=new s.c_("openTipCalloutRequest"),r=new s.c_("loadRoomRequest"),a=new s.c_("userPanelRequest"),l=new s.c_("sendMessageInputFocus"),h=new s.c_("sendMessageInputBlur"),d=new s.c_("siteHeaderMenuOpened"),c=new s.c_("userSwitchedTab"),u=new s.c_("toggleDms")},2835:(e,t,i)=>{"use strict";i.d(t,{K:()=>u,w:()=>p});var s=i(8039),n=i(2939),o=i(3955),r=i(8423),a=i(4947),l=i(76),h=i(9586),d=i(2944),c=i(8936);const u=new r.c_("userCountUpdate");class p extends l.Z{constructor(){super((0,c.DK)()-50,void 0,!0),this.userCount=0,this.isUserListOpen=!1,this.userList=[],this.wrapper=this.createBaseElement("div"),this.element.appendChild(this.wrapper),this.createLoadingDiv(),(0,o.ZM)(this.wrapper,{backgroundColor:"#ffffff",padding:"19px",boxSizing:"border-box",fontFamily:"UbuntuRegular, Arial, Helvetica, sans-serif",height:"calc(100% - 45px)",fontSize:"14px"}),(0,h.H)(this.wrapper),n.X0.listen((e=>{this.chatConn=e.chatConnection,this.chatConn.event.statusChange.listen((e=>{const t="privatewatching"===e.previousStatus||"privatewatching"===e.currentStatus;("notconnected"===e.previousStatus||t)&&window.setTimeout((()=>{this.refreshUsers()}),2e3)})),this.chatConn.event.roomCountUpdate.listen((e=>{this.userCount=e,u.fire(this.userCount)})),u.listen((e=>{if(this.userCount=e,void 0!==this.header){const e=this.header;this.header=this.createHeadingDiv(),this.wrapper.replaceChild(this.header,e)}}))}))}removeUserListChildren(){for(this.header=void 0;null!==this.wrapper.firstChild;)this.wrapper.removeChild(this.wrapper.firstChild)}createLoadingDiv(){const e=document.createElement("div");e.innerText="Loading...",e.style.margin="6px",this.wrapper.appendChild(e)}createHeadingDiv(){const e=document.createElement("div"),t=document.createElement("div");return(0,o.ZM)(e,{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"15px"}),(0,o.ZM)(t,{fontSize:"16px"}),e.appendChild(t),e.appendChild(this.createRefreshUsersLink()),t.innerText=`${a.R.usersText} (${this.userCount})`,e}createRefreshUsersLink(){const e=document.createElement("div");return e.innerText=a.R.refreshUserListSentenceCase,(0,o.ZM)(e,{cursor:"pointer",color:"#306A91"}),e.onmouseenter=()=>{e.style.color="#000000"},e.onmouseleave=()=>{e.style.color="#999999"},e.onclick=e=>{this.removeUserListChildren(),this.createLoadingDiv(),this.refreshUsers()},e}refreshUsers(){void 0!==this.chatConn&&s.SJ.getInstance().fetchRoomUsers().then((e=>{u.fire(e.totalCount),this.userCount=e.totalCount,this.removeUserListChildren(),this.wrapper.appendChild(this.createHeadingDiv()),this.userList=e.roomUsers;for(const e of this.userList){const t=document.createElement("div");t.style.margin="0 0 10px",t.style.cursor="pointer",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.style.maxWidth="100%",t.style.textOverflow="ellipsis",t.appendChild((0,d.t)(e,void 0,!0)),this.wrapper.appendChild(t)}const t=document.createElement("div");t.innerText=`+${e.anonCount} anonymous user${1===e.anonCount?"":"s"}`,(0,o.ZM)(t,{width:"100%",whiteSpace:"nowrap",color:"#A7A7A7",margin:"0 0 10px"}),this.wrapper.appendChild(t),this.repositionChildren()})).catch((e=>{error("Error retrieving mobile user list",e)}))}getUserCount(){return this.userCount}isOpen(){return this.isUserListOpen}show(){super.show(),this.isUserListOpen=!0,this.refreshUsers()}hide(){super.hide(),this.isUserListOpen=!1}repositionChildren(){this.width=(0,c.DK)()-50}}},7789:(e,t,i)=>{"use strict";i.d(t,{T:()=>I,o:()=>R});var s=i(3417),n=i(20),o=i(9447),r=i(3910),a=i(9461),l=i(213),h=i(5216),d=i(6844),c=i(2939),u=i(2396),p=i(2690),m=i(7407),g=i(90),v=i(5173),f=i(8785),y=i(4947),b=i(4110),w=i(8160),C=i(8936),S=i(3124);class x extends w.n{constructor(e,t,i){super(e,t,i),this.element.style.height="auto",this.element.style.width="auto",this.element.style.maxWidth="90%",this.element.style.background="white",this.element.style.borderRadius="4px",this.element.style.margin="auto",this.element.style.position="absolute",this.element.style.boxShadow="0 10px 20px rgba(0, 0, 0, 0.2), 0 6px 6px rgba(0, 0, 0, 0.25)",this.commentInput.style.fontSize="16px"}repositionChildren(){if(super.repositionChildren(),(0,S.K$)()&&(0,C.DK)()<768)this.element.style.width="90%";else{const e=Math.min(screen.width,screen.height);this.element.style.width=.9*e+"px"}this.element.style.top=((0,C.mJ)()-this.element.offsetHeight)/2+"px",this.element.style.left=((0,C.DK)()-this.element.offsetWidth)/2+"px"}onIgnoreUser(){}}var T=i(4580);let A,P,k;c.X0.listen((e=>{A=e.dossier.room,P=e.dossier.userName,k=e.chatConnection}));const M="#156b95";class R extends v.Q{constructor(){var e;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];super(),this.isChatReportShowing=!1,this.reportModal=new p.z({onShow:()=>{this.onReportModalShown()},onHide:()=>{this.onReportModalHidden()},easyExit:!0}),this.isIgnored=!1,P=null===(e=a.Bm.current.loggedInUser)||void 0===e?void 0:e.username,this.userPanelContent=document.createElement("div"),this.element.appendChild(this.userPanelContent),this.element.style.position="relative",this.element.style.width="auto",this.element.style.height="auto",this.element.style.minHeight="40px",this.element.style.padding="4px",this.element.style.border="1px solid #cccccc",this.element.style.borderRadius="6px",this.element.style.marginBottom="16px",this.element.style.fontWeight="normal",(0,o.fZ)(this.element,"userPanel"),(0,o.fZ)(this.element,o.aG.bgColor),this.roomImage=document.createElement("img"),this.roomImage.style.width="47px",this.roomImage.style.height="40px",this.roomImage.style.marginRight="16px",this.roomImage.style.verticalAlign="middle",this.roomImage.style.borderRadius="4px",this.roomImage.style.display="none",this.userPanelContent.appendChild(this.roomImage),this.genderIcon=document.createElement("img"),this.genderIcon.style.position="relative",this.genderIcon.style.top="3px",this.genderIcon.style.height="16px",this.genderIcon.style.padding="6px 16px 0 0",this.genderIcon.style.display="none",this.userPanelContent.appendChild(this.genderIcon),this.displayAge=document.createElement("span"),this.displayAge.innerText="--",this.displayAge.style.verticalAlign="middle",this.displayAge.style.marginRight="16px",this.displayAge.style.display="none",this.userPanelContent.appendChild(this.displayAge),this.profileLink=E(y.R.viewProfile),this.profileLink.onclick=()=>{T.VZ.fire(this.username)},t&&this.userPanelContent.appendChild(this.profileLink),this.sendPMLink=E(y.R.pmMenuTitle),this.sendPMLink.onclick=()=>{(0,d.rC)(y.R.loggedInToPm)||b.E3.fire({username:this.username,focus:!0,showSupporterAlert:this.needsSupporterToPm})},this.userPanelContent.appendChild(this.sendPMLink),(0,n.SU)()&&(this.sendDMLink=E(y.R.dmMenuTitle),this.sendDMLink.onclick=()=>{(0,d.rC)(y.R.loggedInToDm)||(T.bW.fire(!0),r.$o.fire(this.username))},this.userPanelContent.appendChild(this.sendDMLink)),this.mentionLink=E(y.R.mention),this.mentionLink.style.display="inline-block",this.mentionLink.onclick=()=>{b.Ch.fire(this.username)},this.userPanelContent.appendChild(this.mentionLink),this.ignoreLink=E(y.R.ignore),this.ignoreUpdate=new g.P(!1,((e,t)=>this.setIsIgnored(e,t)),(()=>{const e=this.isIgnored?y.R.errorUnignoringUser(this.username):y.R.errorIgnoringUser(this.username);(0,l.Q$)(e)})),this.ignoreLink.onclick=()=>{this.onIgnoreUnignoreClick()},this.userPanelContent.appendChild(this.ignoreLink),this.reportModal.element.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.reportModal.element.style.position="fixed",this.reportLink=E(y.R.report),this.reportLink.onclick=()=>{this.isChatReportShowing?this.reportModal.hide():((0,m.bT)("ReportChatUser",{username:this.username}),this.reportModal.show())},this.reportModal.overlayClick.listen((()=>{this.reportModal.hide()})),this.userPanelContent.appendChild(this.reportLink)}onIgnoreUnignoreClick(){(0,d.rC)(`${y.R.loginForIgnore} ${y.R.clickOkToLogin}`)||this.ignoreUpdate.dispatch(!this.isIgnored,(e=>this.isIgnored?k.unignore(e):k.ignore(e))(this.username))}setIsIgnored(e,t){this.isIgnored=e,this.ignoreLink.innerText=e?y.R.unignore:y.R.ignore,t?(this.ignoreLink.style.pointerEvents="none",this.ignoreLink.style.color="#6c757d"):(this.ignoreLink.style.pointerEvents="",this.ignoreLink.style.color=M),void 0!==this.chatReport&&this.chatReport.updateIgnoreText(this.isIgnored)}updateContents(e,t){this.username=e,this.profileLink.style.display=e===A?"none":"inline-block",k.username()===A?this.ignoreLink.style.display="none":(this.ignoreLink.style.display="inline-block",this.sendPMLink.style.display="none"),P===this.username?(this.ignoreLink.style.display="none",this.reportLink.style.display="none",this.mentionLink.style.display="none",this.sendPMLink.style.display="none",void 0!==this.sendDMLink&&(this.sendDMLink.style.display="none")):(void 0===t?this.reportLink.style.display="none":(this.reportLink.style.display="inline-block",this.createChatReport(t)),this.mentionLink.style.display="inline-block",A===P&&(this.sendPMLink.style.display="inline-block"),void 0!==this.sendDMLink&&(this.sendDMLink.style.display="inline-block")),this.roomImage.style.display="none",this.genderIcon.style.display="none",this.displayAge.style.display="none",void 0!==this.silenceLink&&(this.userPanelContent.removeChild(this.silenceLink),this.silenceLink=void 0),(0,u.b)(this.username).then((e=>{this.needsSupporterToPm=e.needsSupporterToPm,e.canAccess&&(this.genderIcon.src=(0,f.e0)(e.gender),this.displayAge.innerText=isNaN(e.displayAge)?"":`${e.displayAge}`,this.roomImage.src=e.imageUrl,e.online&&(this.roomImage.style.display="inline"),this.genderIcon.style.display="inline",this.displayAge.style.display="inline"),this.ignoreUpdate.dispatch(k.isIgnored(this.username),Promise.resolve(!0)),this.setSilenceLink(e)})).catch((e=>{error("Could not process user menu request",e)}))}createChatReport(e){void 0!==this.chatReport&&this.reportModal.removeChild(this.chatReport),this.chatReport=new x(this.username,e,k),this.reportModal.addChild(this.chatReport),this.chatReport.element.style.display="none",this.chatReport.closeChatReportRequest.listen((e=>{this.reportModal.hide(),e&&(this.overlayClick.fire(void 0),void 0!==this.chatReport&&this.chatReport.tearDown())})),this.chatReport.ignoreReportedUser.listen((()=>{this.ignoreUpdate.dispatch(!0,k.ignore(this.username))}))}setSilenceLink(e){e.canSilence&&(void 0!==e.silenceId?(this.silenceLink=E(y.R.removeSilenceMessage),this.silenceLink.onclick=()=>{(0,h.KF)("edit_room_ban/",{banid:String(e.silenceId),action:"remove_silence",room_username:A}).catch((t=>{error(t),(0,l.Q$)(`Error removing silence from user ${e.username}`)})),this.closeUserPanel()}):(this.silenceLink=E(y.R.silenceText),this.silenceLink.onclick=()=>{(0,l.mf)(`Silence ${e.username}?`,(()=>{(0,m.bT)("SilenceUser",{username:e.username}),(0,h.KF)(`roomsilence/${e.username}/${A}/`,{}).then((()=>{})).catch((t=>{error(`Unable to silence user (${t})`,{room:A,username:e.username}),(0,l.Q$)(`Error silencing user ${e.username}`)}))})),this.closeUserPanel()}),this.silenceLink.style.display="inline-block",this.userPanelContent.appendChild(this.silenceLink))}onReportModalShown(){this.reportLink.style.textDecoration="underline",this.reportModal.element.style.top="0",void 0!==this.chatReport&&(this.chatReport.element.style.display="",this.chatReport.repositionChildren()),this.isChatReportShowing=!0}onReportModalHidden(){this.isChatReportShowing=!1,this.reportLink.style.textDecoration="none",this.reportModal.element.style.top="",void 0!==this.chatReport&&(this.chatReport.element.style.display="none",this.chatReport.resetForm())}closeUserPanel(){this.hideOverlay(),null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}class I extends R{constructor(){super(!0),this.profileLink.onclick=()=>{void 0!==k?T.VZ.fire(this.username):window.location.pathname=`/${this.username}/`,T.bW.fire(!1)}}onIgnoreUnignoreClick(){(0,d.rC)(`${y.R.loginForIgnore} ${y.R.clickOkToLogin}`)||this.ignoreUpdate.dispatch(!this.isIgnored,(()=>this.isIgnored?(0,s.Kw)(this.username).then((()=>!0)):(0,s.Bq)(this.username).then((()=>!0)))())}updateContents(e,t){this.username=e,this.element.style.top="",this.profileLink.style.display="inline-block",this.mentionLink.style.display="none",void 0!==this.sendPMLink&&(this.sendPMLink.style.display="none"),void 0!==this.sendDMLink&&(this.sendDMLink.style.display="none"),P===this.username?(this.ignoreLink.style.display="none",this.reportLink.style.display="none"):(this.ignoreLink.style.display="inline-block",void 0===t?this.reportLink.style.display="none":(this.reportLink.style.display="inline-block",this.createChatReport(t))),this.roomImage.style.display="none",this.genderIcon.style.display="none",this.displayAge.style.display="none",(0,u.b)(this.username).then((e=>{this.needsSupporterToPm=e.needsSupporterToPm,e.canAccess&&(this.genderIcon.src=(0,f.e0)(e.gender),this.displayAge.innerText=isNaN(e.displayAge)?"":`${e.displayAge}`,this.roomImage.src=e.imageUrl,e.online&&(this.roomImage.style.display="inline"),this.genderIcon.style.display="inline",this.displayAge.style.display="inline"),this.ignoreUpdate.dispatch((0,s.pi)(this.username),Promise.resolve(!0))})).catch((e=>{error("Could not process user menu request",e)}))}createChatReport(e){void 0!==this.chatReport&&this.reportModal.removeChild(this.chatReport),this.chatReport=new x(this.username,e,void 0),this.reportModal.addChild(this.chatReport),this.chatReport.element.style.display="none",this.chatReport.closeChatReportRequest.listen((e=>{this.reportModal.hide(),e&&(this.overlayClick.fire(void 0),void 0!==this.chatReport&&this.chatReport.tearDown())}))}}function E(e){const t=document.createElement("span");return t.innerText=e,t.style.verticalAlign="middle",t.style.textDecoration="none",t.style.cursor="pointer",t.style.color=M,t.style.padding="0 16px 6px 0",t}},2944:(e,t,i)=>{"use strict";i.d(t,{t:()=>h});var s=i(9447),n=i(6784),o=i(3955),r=i(7407),a=i(8785),l=i(4580);function h(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const d=document.createElement("span");if((0,s.fZ)(d,(0,a.Kb)(e)),d.style.fontWeight="bold",d.classList.add("username"),d.innerText=h?`@${e.username}`:e.username,d.style.maxWidth="100%",d.style.whiteSpace="nowrap",d.style.overflowX="hidden",d.style.textOverflow="ellipsis",i){const t=document.createElement("img");t.src=(0,a.e0)(e.gender),(0,o.ZM)(t,{height:"16px",verticalAlign:"middle",margin:"0 10px 0 0"}),(0,o.ZM)(d,{fontWeight:"normal"}),d.insertBefore(t,d.firstChild)}return d.onmouseenter=()=>{d.style.textDecoration="underline",d.style.cursor="pointer"},d.onmouseleave=()=>{d.style.textDecoration="none",d.style.cursor="default"},(0,n.wu)("click",d,(i=>{let s=d.parentElement;for(;null!==s&&"DIV"!==s.tagName;)s=s.parentElement;null===s?error("Username span has no parent"):((0,r.bT)("OpenUserPanel",{username:e.username}),i.stopPropagation(),l.vT.fire({username:e.username,message:t,attachTo:s}))})),d}},5271:(e,t,i)=>{"use strict";var s;i.d(t,{d:()=>s}),function(e){e[e.Cancelled=4]="Cancelled"}(s||(s={}))},3939:(e,t,i)=>{"use strict";i.d(t,{G:()=>h,L:()=>l});var s=i(8423),n=i(5257),o=i(5271),r=i(8936);const a=1/3,l=1.6;class h{constructor(e,t){this.overlayElement=e,this.playerElement=t,this.touchMoveEvent=new n.xj(this.overlayElement),this.pinchEvent=new n.lg(this.overlayElement),this.scalePlayerEvent=new s.c_("scalePlayerEvent"),this.scrollPlayerEvent=new s.c_("scrollPlayerEvent"),this.swipePlayerEvent=new s.c_("swipePlayerEvent"),this.changeVideoHeightEvent=new s.c_("changeVideoHeightEvent"),this.horizontalSwipeInProgress=!0,this.isSwipingEnabled=!1,this.pinchEvent.listen((e=>{const t=e.previousCenterPoint.x-e.centerPoint.x;this.scalePlayerEvent.fire({factor:1+1.25*e.zoomPercentage,pointX:e.centerPoint.x}),this.scrollPlayerEvent.fire(t)})),this.touchMoveEvent.listen((e=>{if(0===e.state&&(this.initialSwipeCheckDone=!1,this.horizontalSwipeInProgress=!1,this.swipeCheck(e)),this.horizontalSwipeInProgress){const t=2!==e.state||this.isCompletedSwipe(e.totalDistance.x,e.elapsedTime)?e.state:o.d.Cancelled;this.swipePlayerEvent.fire({state:t,totalDistance:e.totalDistance.x,elapsedTime:e.elapsedTime})}else{const t=e.distance.x;this.handlePlayerResize(e),this.scrollPlayerEvent.fire(t)}}))}isSwipeAllowed(e){const t=this.playerElement.scrollLeft<=0,i=e<=0,s=Math.ceil(this.playerElement.scrollLeft)+this.playerElement.offsetWidth>=this.playerElement.scrollWidth,n=e>=0;return this.isSwipingEnabled&&(t&&i||s&&n)}isCompletedSwipe(e,t){return Math.abs(e)>=(0,r.DK)()*a||(t=>t<=200&&Math.abs(e)>=.2*(0,r.DK)())(t)}handlePlayerResize(e){this.changeVideoHeightEvent.fire({startingPoint:e.startingPoint,distance:e.distance})}swipeCheck(e){this.initialSwipeCheckDone||(this.horizontalSwipeInProgress=this.isSwipeAllowed(e.totalDistance.x)&&0===e.direction,this.initialSwipeCheckDone=!0)}}},8936:(e,t,i)=>{"use strict";i.d(t,{$B:()=>l,DK:()=>a,d9:()=>h,mJ:()=>r,z1:()=>c});var s,n=i(7623),o=i(3124);const r=()=>document.documentElement.clientHeight!==window.outerHeight||(0,n.OF)()?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight,a=()=>document.documentElement.clientWidth,l=()=>(e=>{const t=a(),i=r();return e?{width:t,height:i}:{width:i,height:t}})((0,o.K$)()),h=()=>window.pageYOffset,d=null===(s=window.visualViewport)||void 0===s?void 0:s.scale,c=()=>!(0,n.OF)()&&null!=d&&window.visualViewport?Math.round(10*d)!==Math.round(10*window.visualViewport.scale):document.documentElement.clientWidth!==window.innerWidth},3124:(e,t,i)=>{"use strict";i.d(t,{DQ:()=>u,FW:()=>h,K$:()=>r,Vk:()=>d,Y$:()=>a,pu:()=>c});var s=i(7623),n=i(8423);function o(){const e=void 0!==screen.orientation?screen.orientation.type:void 0;if(void 0!==e){if(e.startsWith("portrait"))return!0;if(e.startsWith("landscape"))return!1}}function r(){if(!h())return!0;const e=o();if(void 0!==e)return e;switch(window.orientation){case 0:case 180:case-180:return!0;case 90:case-90:case 270:return!1}return window.innerWidth===Math.min(screen.width,screen.height)||window.innerWidth<=window.innerHeight}function a(e){if(!h())return!0;if(!(0,s.OF)()){const e=o();if(void 0!==e)return!e}switch(window.orientation){case 0:case 180:case 270:case-180:return!1;case 90:return void 0!==e&&"user"!==e||!(0,s.OF)();case-90:return"environment"!==e||!(0,s.OF)()}return!0}const l=Object.prototype.hasOwnProperty.call(window,"onorientationchange");function h(){return l}function d(){return"orientation"in screen&&"onchange"in screen.orientation}function c(){return h()||d()}const u=new n.c_("screenOrientationChanged")},2690:(e,t,i)=>{"use strict";i.d(t,{$:()=>d,z:()=>c});var s=i(6784),n=i(2709),o=i(8423),r=i(1779);const a=new o.c_("modalReposition");(0,s.wu)("resize",window,(()=>{a.fire(void 0)})),(0,s.wu)("orientationchange",window,(()=>{a.fire(void 0)}));const l=new o.c_("modalEscape");(0,s.wu)("keydown",document,(e=>{27===e.keyCode&&l.fire(e)}));const h=new o.c_("modalExit");(0,s.wu)("popstate",window,(e=>{h.fire(void 0)}));const d=new o.c_("modalOpened");class c extends n.u{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{easyExit:!0};super(),this.options=e,this.overlayClick=new o.c_("overlayClick"),this.listenerGroup=new o.gt,this.isListeningForChange=!1,this.hideOverlay=!1,this.overlayClickStayOpen=!1,this.preventChatFocus=!1,this.addHidePageAction=function(){},this.overlay=document.createElement("div"),this.overlay.style.position="fixed",this.overlay.style.display="none",this.overlay.style.left="0",this.overlay.style.top="0",this.overlay.style.right="0",this.overlay.style.bottom="0",this.overlay.style.zIndex="1100",this.overlay.style.background="rgb(0,0,0,0)",this.overlay.onclick=e=>{e.stopPropagation(),this.overlayClick.fire(void 0),this.overlayClickStayOpen||this.hide()},this.element.style.zIndex="1101",this.element.onclick=e=>{e.stopPropagation()},this.repositionCallback=()=>{this.isListeningForChange&&this.repositionChildrenRecursive()},this.fullscreenChangeCallback=()=>{this.isListeningForChange&&this.show()}}show(){const e=(0,r.Gy)();(0,r.aS)()&&void 0!==e?(e.appendChild(this.overlay),e.appendChild(this.element)):(document.body.appendChild(this.overlay),document.body.appendChild(this.element)),this.isListeningForChange||(a.listen(this.repositionCallback,!1).addTo(this.listenerGroup),r._c.listen(this.fullscreenChangeCallback,!1).addTo(this.listenerGroup),h.listen((()=>{this.hide()}),!1).addTo(this.listenerGroup),this.options.easyExit&&l.listen((e=>{e.preventDefault(),this.hide()}),!1).addTo(this.listenerGroup),this.preventChatFocus&&d.fire(!0),void 0!==this.options.onShow&&this.options.onShow(),this.isListeningForChange=!0),this.hideOverlay||(this.overlay.style.display="block")}hide(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.overlay.style.display="none",document.activeElement&&document.activeElement instanceof HTMLElement&&document.activeElement.blur(),null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element),null!==this.overlay.parentElement&&this.overlay.parentElement.removeChild(this.overlay),this.isListeningForChange&&(this.listenerGroup.removeAll(),this.preventChatFocus&&d.fire(!1),void 0!==this.options.onHide&&this.options.onHide(),this.isListeningForChange=!1,this.addHidePageAction(e))}}},6009:(e,t,i)=>{"use strict";i.d(t,{t:()=>h});var s=i(7063),n=i(5079),o=i(5216),r=i(2939),a=i(7882),l=i(1452);class h{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this.limit=e,this.seenItems=new Set,this.offset=0,this.next=(0,l.FM)((async()=>{const e=await this.getMoreRooms(),t=new s.N6(e.responseText),i=JSON.parse(t.getObjectString("rooms")).map((e=>(0,n.ak)(new s.N6(e))));return this.offset+=i.length,i.filter((e=>!this.seenItems.has(e.room))).filter((e=>(this.seenItems.add(e.room),!0)))}),[]),this.offset=0,this.listener=r.X0.listen((e=>{this.currentRoomGender=(0,a.jM)(e.dossier.roomGender),this.currentRoomName=e.chatConnection.room(),this.seenItems.add(this.currentRoomName)}),!1,!0)}setGenders(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.genders=e,this.offset=0,this.seenItems=new Set}getMoreRooms(){const e=new URLSearchParams(window.location.search);return e.set("genders",this.gendersParam().join(",")),e.set("room",this.currentRoomName),e.set("limit",`${this.limit}`),e.set("offset",`${this.offset}`),(0,o.Aw)(`api/ts/roomlist/more-rooms/?${e.toString()}`)}gendersParam(){return this.genders.length>0?this.genders:void 0===this.currentRoomGender?window.default_gender.split(""):[this.currentRoomGender]}dispose(){this.listener.removeListener()}}},7407:(e,t,i)=>{"use strict";i.d(t,{Ht:()=>d,NP:()=>T,OY:()=>f,PF:()=>c,PN:()=>v,RN:()=>g,Rs:()=>u,S_:()=>m,U4:()=>S,bT:()=>p,iA:()=>C,yC:()=>x});var s=i(7063),n=i(7623),o=i(6784),r=i(5216);let a,l,h;function d(e,t){var i;const s={};s["attributes.room_user"]=null!==(i=a)&&void 0!==i?i:"",void 0!==h&&(s["attributes.currentMode"]=h);for(const t in e)s[`attributes.${t}`]=e[t];if(void 0!==t&&t&&(0,n.vM)()){const e=window.performance.now();s["attributes.timeSinceLoad"]=e/1e3,s["attributes.timeSinceLoadMS"]=e}return void 0!==l&&(s["attributes.player"]=l),void 0!==window.history.length&&(s.history_length=window.history.length),s}function c(){return s.a.newRelicEnabled()}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};-1!==C()&&(e.PlayerVol=C()),-1!==w()&&(e.TipVol=w())}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;u(t);const n=d(t,i);s.a.addPageAction(e,n)}function m(e,t){s.a.setCustomAttribute(e,t)}function g(e){a=e}function v(e){l=e}function f(e,t){return s.a.createTracer(e,t)}let y=-1,b=-1;function w(){return 0===b?0:y}function C(){return b}function S(e){y=e}function x(e,t){b=t?0:e}function T(e){"videoonly"!==e&&(h=e)}(0,o.wu)("load",window,(function e(){(0,o.Pf)("load",window,e);for(const e of document.getElementsByTagName("script"))null!==e.src.match(/https:\/\/js-agent\.newrelic\.com\/.*/)&&(0,o.wu)("error",e,(()=>{error("Ad blocker stopped analytics collection"),(0,r.KF)("api/adblocker/",{})}))}))},3587:(e,t,i)=>{"use strict";i.d(t,{T:()=>c});var s=i(7063),n=i(9461),o=i(6784),r=i(5216),a=i(6844),l=i(1134),h=i(7176),d=i(4947);class c{constructor(){this.usersWithNotes=new Set,(0,a.ok)()||n.Bm.current.isMobile||(this.getUsernames(!1),(0,o.wu)("focus",window,(()=>{this.getUsernames()})),l.T.registerGenerator("notesBadge",(e=>this.createChatBadge(e))))}getUsernames(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,r.Aw)("api/notes/usernames/").then((t=>{const i=new s.N6(t.responseText),n=JSON.parse(i.getObjectString("usernames"));e?(this.usersWithNotes.forEach((e=>n.includes(e)||this.removeUser(e))),n.forEach((e=>this.usersWithNotes.has(e)||this.addUser(e)))):(this.usersWithNotes.clear(),n.forEach((e=>{this.usersWithNotes.add(e)})))})).catch((e=>{error("Could not retrieve list of users for which currentUser has notes on")}))}static getOrCreateInstance(){return void 0===c.singletonInstance&&(c.singletonInstance=new c),c.singletonInstance}addUser(e){this.usersWithNotes.add(e),this.updateChatBadges(e)}removeUser(e){this.usersWithNotes.has(e)&&(this.usersWithNotes.delete(e),this.updateChatBadges(e))}createChatBadge(e){const t=document.createElement("span");t.style.display=this.usersWithNotes.has(e)?"":"none",t.style.marginRight=".1em",t.title=d.R.notes;const i=(0,h.Am)();return t.appendChild(i),t}updateChatBadges(e){const t=this.usersWithNotes.has(e);l.T.getBadgeElements("notesBadge",e).forEach((e=>{e.style.display=t?"inline-block":"none"}))}}},90:(e,t,i)=>{"use strict";i.d(t,{P:()=>s});class s{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};this.ID=0,this.lastValidID=0,this.initialState=e,this.currentState=e,this.lastValidState=e,this.onUpdate=t,this.onRevert=i}setInitialState(e){this.initialState=e,0===this.ID&&(this.currentState=e,this.onUpdate(this.currentState,!1))}dispatch(e,t){this.ID+=1,this.currentState=e,this.onUpdate(this.currentState,!0),t.then((e=>{e?this.commit(this.ID):this.revert(this.ID)})).catch((()=>{this.revert(this.ID)}))}commit(e){e>this.lastValidID&&(this.lastValidID=e,this.lastValidState=this.currentState,this.onUpdate(this.currentState,ethis.lastValidID&&(this.currentState=this.lastValidState,this.onUpdate(this.currentState,e{"use strict";i.d(t,{C:()=>s});class s{constructor(){this.backingArray=[]}addToTop(e){this.remove(e),this.backingArray.unshift(e)}addToBottom(e){this.remove(e),this.backingArray.push(e)}toArray(){return[].concat(this.backingArray)}remove(e){const t=this.backingArray.indexOf(e);-1!==t&&this.backingArray.splice(t,1)}popFromTop(){return this.backingArray.shift()}popFromBottom(){return this.backingArray.pop()}}},5173:(e,t,i)=>{"use strict";i.d(t,{Q:()=>o});var s=i(2709),n=i(8423);class o extends s.u{constructor(e){super("div",e),this.overlayClick=new n.c_("overlayClick")}initUI(e){super.initUI(e),this.overlay=document.createElement("div"),this.overlay.style.position="fixed",this.overlay.style.display="none",this.overlay.style.left="0",this.overlay.style.top="0",this.overlay.style.right="0",this.overlay.style.bottom="0",this.overlay.style.zIndex="1000",this.overlay.style.cursor="auto",this.overlay.onclick=e=>{e.stopPropagation(),this.hideOverlay(),this.overlayClick.fire(void 0)},this.element.style.zIndex="1001",this.element.onclick=e=>{e.stopPropagation()}}lazyInitUI(){super.lazyInitUI(),window.setTimeout((()=>{this.afterDOMConstructedIncludingChildren()}),0)}afterDOMConstructedIncludingChildren(){super.afterDOMConstructedIncludingChildren(),null!==this.element.parentElement&&this.element.parentElement.insertBefore(this.overlay,this.element)}showOverlay(){this.overlay.style.display="block"}hideOverlay(){this.overlay.style.display="none"}afterRemovedFromParent(){super.afterRemovedFromParent(),null!==this.overlay.parentElement&&this.overlay.parentElement.removeChild(this.overlay)}}},7537:(e,t,i)=>{"use strict";i.d(t,{o:()=>r});var s=i(82),n=i(2690),o=i(1372);class r extends s.b{constructor(e){super(e),this.easyExit=!0,this.tabbableElements=[],this.keyboardNav=this.keyboardNav.bind(this)}initUI(){this.overlay=(0,o.tT)("div",{className:"overlayModalOverlay",onClick:e=>{e.stopPropagation(),this.easyExit&&this.hide()}}),this.element.classList.add("overlayModalElement"),this.element.onclick=e=>{e.stopPropagation()}}show(){document.body.appendChild(this.overlay),this.overlay.appendChild(this.element),n.$.fire(!0),document.addEventListener("keydown",this.keyboardNav)}hide(){var e;null===(e=this.overlay.parentElement)||void 0===e||e.removeChild(this.overlay),n.$.fire(!1),document.removeEventListener("keydown",this.keyboardNav)}defineTabbableElements(e){this.tabbableElements=e,this.tabbableElements.forEach((e=>{e.tabIndex=0,e.onkeydown=t=>{t.preventDefault(),"Enter"!==t.key&&" "!==t.key||e.click()}}))}keyboardNav(e){if("Escape"===e.key&&this.easyExit)this.hide();else if("Tab"===e.key&&null!==document.activeElement&&this.tabbableElements.length>0){e.preventDefault();const t=this.tabbableElements.indexOf(document.activeElement)+(e.shiftKey?-1:1),i=t<0?this.tabbableElements.length-1:t;this.tabbableElements[i%this.tabbableElements.length].focus()}}}},3118:(e,t,i)=>{"use strict";i.d(t,{j:()=>n});const s={height:0,name:"",imgUrl:"",width:0,abuseUrl:""};class n{constructor(e){this._parseResult=function(e){const t="%%%[emoticon ",i="]%%%";let n=[];const r=[],a=[];if(e.indexOf(t)<0)return{stringParts:[e],emoticons:[]};for(let l=0;l{"use strict";i.d(t,{N:()=>C,S:()=>S});var s=i(7623),n=i(9461),o=i(1224),r=i(2416),a=i(6784),l=i(213),h=i(2709),d=i(3955),c=i(8423),u=i(7407),p=i(2945),m=i(3860),g=i(3131),v=i(580),f=i(9321),y=i(1282),b=i(3933),w=i(1021);class C extends h.u{constructor(e,t,i){super(),this.roomStatusNotifier=t,this.videoOfflineChange=new c.c_("videoOfflineChange");const s=this.choosePlayer(e);this.createPlayer(s,i),this.watermark=document.createElement("img"),this.watermark.src=(0,r.f)(),this.watermark.className="cbLogo",this.adjustWatermarkStyle({position:"absolute",width:"90px",height:"27px",top:"8px",right:"8px",userSelect:"none",msUserSelect:"none",pointerEvents:"none",visibility:o.m.shouldHideWaterMark?"hidden":"initial"}),this.watermark.setAttribute("draggable","false"),this.element.appendChild(this.watermark),m.L.changeVideoMode.listen((e=>{this.playerComponent.showControls()})),this.qualityMessage=document.createElement("div"),this.qualityMessage.innerText="Broadcaster's stream is experiencing network issues",(0,d.ZM)(this.qualityMessage,{display:"none",color:"#0000ff",position:"absolute",fontSize:"1.0em",fontWeight:"bold",top:"8px",left:"8px",userSelect:"none",pointerEvents:"none",msUserSelect:"none"}),this.qualityMessage.setAttribute("draggable","false"),this.element.appendChild(this.qualityMessage)}bindVideoEvents(){var e,t;null===(e=this.playerComponent.requestJPEG)||void 0===e||e.listen((e=>{this.forceJPEGPushPlayer(e)})),this.playerComponent.videoOfflineChange.listen((e=>{this.videoOfflineChange.fire(e),this.roomStatusNotifier.setVideoOffline(e)})),!0===(null===(t=n.Bm.current.loggedInUser)||void 0===t?void 0:t.isStaff)&&!0===n.Bm.current.qualityMessage&&n.Aw.onUpdate.listen((()=>{const{quality:e}=n.Aw.getState();this.qualityMessage.style.display="okay"===(null==e?void 0:e.quality)||"bad"===(null==e?void 0:e.quality)||"stop"===(null==e?void 0:e.quality)?"":"none",this.qualityMessage.style.color="bad"===(null==e?void 0:e.quality)?"#ff0000":"0000ff",this.qualityMessage.innerText="stop"===(null==e?void 0:e.quality)?"Broadcaster's stream has stopped.":"Broadcaster's stream is experiencing network issues"}))}adjustWatermarkStyle(e){(0,d.ZM)(this.watermark,e)}stylePlayerComponent(){}chooseHLSPlayer(){return(0,s.OF)()?"hlsnative":"videojs"}chooseNoAutoplayHlsSubstitute(){return"jpegToHls"}choosePlayer(e){let t=(0,p.JO)(window.location.search).player;return void 0!==t?("hls"===t&&(t=this.chooseHLSPlayer()),t):(0,s.Ap)()?e?this.chooseHLSPlayer():this.chooseNoAutoplayHlsSubstitute():(w.nH.jpegFallback(),"jpeg")}createVideoJsPlayer(){return new b.y(this.roomStatusNotifier)}createPlayer(e,t){var i;let s;switch(e){case"videojs":s=this.createVideoJsPlayer();break;case"hlsnative":s=new g.S(this.roomStatusNotifier);break;case"jpeg":s=new f.O(this.roomStatusNotifier);break;case"jpegToHls":s=new f.O(this.roomStatusNotifier,!0);break;default:return error(`received unexpected player name: ${e}`),void(0,l.Q$)(`unknown player: ${e}`)}const n=!(null!==(i=null==t?void 0:t.noHook)&&void 0!==i&&i);this.playerComponent=this.prependChild(s),s.setContainerElement(this.element),n&&this.afterPlayerCreated()}afterPlayerCreated(){let e;e=this.playerComponent instanceof b.y?"videojs":this.playerComponent instanceof g.S?"hlsnative":this.playerComponent instanceof f.O?this.playerComponent.isHlsPlaceholder?"jpegToHls":"jpeg":"unknown player type",(0,u.PN)(e),this.bindVideoEvents(),this.stylePlayerComponent()}removePlayer(){this.playerComponent.stop(),this.playerComponent.onForceRemoved(),this.removeChild(this.playerComponent)}forceHlsPlayer(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.vC.RandomEdge;const s=this.playerComponent.getSource();let n;this.removePlayer(),n="hlsnative"===this.chooseHLSPlayer()?new g.S(this.roomStatusNotifier):this.createVideoJsPlayer();const o=e=>{n.setMuted(!t),(0,a.Pf)("loadeddata",n.videoElement,o)};switch((0,a.wu)("loadeddata",n.videoElement,o),n.handleRoomLoaded(e),i){case v.vC.NewEdge:n.setSource(s),n.refreshStreamOnNewEdge(e);break;case v.vC.SameEdge:n.setSource(s),n.refreshStreamOnSameEdge(e);break;case v.vC.RandomEdge:default:n.refreshStream(e)}t?(n.setVolume(100),n.setMuted(!1)):n.setMuted(!0),this.playerComponent=this.prependChild(n),this.afterPlayerCreated(),this.repositionChildren()}forceJPEGPushPlayer(e){this.removePlayer(),this.createPlayer("jpeg"),this.playerComponent.handleRoomLoaded(e)}}function S(e,t,i){let s=t/(i?y.qL:y.Bu),n=t;return s>e&&(s=e,n=s*(i?y.qL:y.Bu)),[s,n]}},3131:(e,t,i)=>{"use strict";i.d(t,{S:()=>y,T:()=>f});var s=i(7507),n=i.n(s),o=i(1246),r=i.n(o),a=i(7623),l=i(6784),h=i(1516),d=i(8423),c=i(1779),u=i(7407),p=i(4947),m=i(3860),g=i(5389),v=i(580);const f=new d.c_("HlsNativePlayer:AirPlayChange");class y extends v.vS{constructor(e){super(e,"HlsNativePlayer"),this.lastTimeUpdate=0,this.userUnmuted=!1,this.prevIsMuted=!0,this.showingNativeControls=!1,this.playerType="Native",this.playableHlsPlayer=this.videoElement,this.element.appendChild(this.videoElement),this.videoMetrics.bindAllHTMLMedia(this.videoElement,this.element),f.listen((e=>{this.isCasting=e})),h.s.listen((e=>{this.chatMode=e})),this.videoElement.onclick=e=>{this.play(),debug(["click",e])},this.videoElement.onpause=e=>{debug(["pause",e])},this.videoElement.onplay=e=>{(0,u.bT)("VideoOnloadMuteStatus",{muted:this.videoElement.muted,chatMode:this.chatMode}),this.videoElement.muted?this.prevIsMuted=!0:this.userUnmuted=!0,debug(["play",e])},this.videoElement.oncanplay=e=>{debug(["canplay",e]),this.isStreamReconnecting&&this.removeReconnecting()},this.videoElement.oncanplaythrough=e=>{debug(["canplaythrough",e]);const t=(0,a.yb)();(void 0===t||t<15)&&this.play()},this.videoElement.onseeking=e=>{debug(["seeking",e])},this.videoElement.onerror=e=>{if(void 0!==this.videoAnalytics){let t="HlsNative Error";"string"==typeof e&&(t=e),this.videoAnalytics.reportPlaybackError(t,n().Constants.ErrorSeverity.FATAL)}null===this.videoElement.error||2!==this.videoElement.error.code&&4!==this.videoElement.error.code||(clearTimeout(this.refreshTimeout),this.refreshTimeout=window.setTimeout((()=>{this.refreshStreamOnSameEdge(this.context)}),2e3)),error(e,{},"VIDEO_")},this.videoElement.onvolumechange=e=>{const t=this.videoElement.volume;let i=this.videoElement.muted;0===t&&(i=!0),i||this.userUnmuted||0!==(0,u.iA)()||(this.userUnmuted=!0,(0,u.bT)("UserUnmuted",{chatMode:this.chatMode})),this.prevIsMuted!==i&&this.showingNativeControls&&(0,u.bT)("ToggleMute",{newState:i}),this.setControlIsMuted.fire({isMuted:i,save:!0}),this.setControlVolume.fire({volume:100*t,save:!0}),void 0===this.unmuteContainer||i||(this.element.removeChild(this.unmuteContainer),this.unmuteContainer=void 0),this.prevIsMuted=i},this.videoElement.onstalled=e=>{(0,g.gA)()&&!this.isInPictureInPicture&&(this.videoElement.pause(),window.setTimeout((()=>{this.play()}),10))},(0,l.wu)("enterpictureinpicture",this.videoElement,(()=>{debug("enterpictureinpicture"),v.CY.fire({active:!0})})),(0,l.wu)("leavepictureinpicture",this.videoElement,(()=>{debug("leavepictureinpicture"),v.CY.fire({active:!1,videoPaused:this.videoElement.paused})}));let t=this.videoElement.webkitPresentationMode;(0,l.wu)("webkitpresentationmodechanged",this.videoElement,(()=>{const e=this.videoElement.webkitPresentationMode;-1!==["inline","fullscreen"].indexOf(t)&&"picture-in-picture"===e?(debug("enterpictureinpicture"),v.CY.fire({active:!0})):"picture-in-picture"===t&&-1!==["inline","fullscreen"].indexOf(e)&&(debug("leavepictureinpicture"),v.CY.fire({active:!1,videoPaused:this.videoElement.paused})),"fullscreen"===e&&m.L.setFireVideoMode("noninteractive-fullscreen"),"fullscreen"===t&&m.L.setFireVideoMode(m.L.getPreviousNonFullscreenVideoMode()),t=e})),10===(0,a.yb)()&&this.createiOSUnmute()}loadHlsStream(e,t){this.setTooMuchWaitingTimeout(e),null===this.videoElement.onplaying&&(this.videoElement.onplaying=t=>{this.setTooMuchWaitingTimeout(e)}),null===this.videoElement.ontimeupdate&&(this.videoElement.ontimeupdate=t=>{const i=this.videoElement.currentTime;i-this.lastTimeUpdate>5&&(this.lastTimeUpdate=i,this.setTooMuchWaitingTimeout(e,(()=>{this.lastTimeUpdate=0})),this.tryingTimeoutRefresh=!1)}),""!==t?(this.videoElement.src=t,this.roomStatusNotifier.hide()):this.videoElement.removeAttribute("src"),this.videoElement.load(),this.videoElement.style.display="inline";const i=(0,a.yb)();(!("oncanplaythrough"in window)||void 0!==i&&i>=15)&&this.play(),""===t&&(this.stop(),this.stopTooMuchWaitingTimeout())}setVolume(e){this.videoElement.volume=e/100}getVolume(){return this.videoElement.muted||!this.isStreamReconnecting&&this.videoElement.paused?0:100*this.videoElement.volume}setMuted(e){this.videoElement.muted=e,this.setControlIsMuted.fire({isMuted:e,save:!0}),e?this.videoElement.setAttribute("muted",""):this.videoElement.removeAttribute("muted")}stop(){this.lastTimeUpdate=0,this.videoElement.style.display="none",this.videoElement.pause(),this.videoElement.removeAttribute("src"),this.videoElement.load(),super.stop()}showNativeControls(){super.showNativeControls(),this.showingNativeControls||(this.showingNativeControls=!0,this.videoElement.setAttribute("controls",""),void 0!==this.unmuteContainer&&(this.unmuteContainer.style.display="block"))}hideNativeControls(){this.showingNativeControls&&(this.showingNativeControls=!1,this.videoElement.removeAttribute("controls"),void 0!==this.unmuteContainer&&(this.unmuteContainer.style.display="none"))}showCustomControls(){super.showCustomControls(),this.hideNativeControls()}setQualityLevel(e){}setVolumeMuted(e,t){this.videoElement.volume=e/100,0===e||t?(this.videoElement.muted=!0,this.videoElement.setAttribute("muted","")):(this.videoElement.muted=!1,this.videoElement.removeAttribute("muted"))}getControlBarHeight(){return 0}enterFullScreenMode(){(0,c.lh)(this.videoElement),this.showNativeControls()}toggleFullscreen(){this.enterFullScreenMode()}getVideoElement(){return this.videoElement}createiOSUnmute(){this.unmuteContainer=document.createElement("span"),this.unmuteContainer.style.position="absolute",this.unmuteContainer.style.top="6px",this.unmuteContainer.style.right="6px",this.unmuteContainer.style.opacity="0.8",this.unmuteContainer.style.float="right",this.unmuteContainer.style.backgroundColor="rgba(255, 255, 255, 0.8)",this.unmuteContainer.style.borderRadius="6px",this.unmuteContainer.style.height="36px",this.unmuteContainer.style.padding="3px",this.unmuteContainer.style.cursor="pointer";const e=document.createElement("span");e.textContent=p.R.tapToUnmute,e.style.color="#0c6a93",e.style.fontSize="14px",e.style.padding="6px",e.style.position="relative",e.style.top="2px",e.style.textShadow="0 0 1px #0c6a93";const t=document.createElement("img");t.src=`${STATIC_URL_ROOT}images/volume-mute.svg`,t.style.width="36px",t.style.height="36px",t.style.display="inline",t.style.verticalAlign="middle",this.unmuteContainer.appendChild(e),this.unmuteContainer.appendChild(t),this.element.appendChild(this.unmuteContainer),this.unmuteContainer.onclick=()=>{this.setMuted(!1),void 0!==this.unmuteContainer&&(this.element.removeChild(this.unmuteContainer),this.unmuteContainer=void 0)},window.setTimeout((()=>{e.style.display="none"}),5e3)}setupConvivaPlayer(){void 0!==this.videoAnalytics&&this.videoAnalytics.setPlayer(this.videoElement,{[n().Constants.CONVIVA_MODULE]:r()})}}},580:(e,t,i)=>{"use strict";i.d(t,{CY:()=>P,Mc:()=>A,vC:()=>k,vS:()=>M});var s=i(352),n=i(7507),o=i.n(n),r=i(7623),a=i(9461),l=i(5914),h=i(1224),d=i(6784),c=i(5216),u=i(2709),p=i(8423),m=i(6716),g=i(7407),v=i(1452),f=i(8255),y=i(2945),b=i(4110),w=i(3860),C=i(5389),S=i(1282),x=i(3049),T=i(1021);const A=20,P=new p.c_("pictureInPictureChange");var k;!function(e){e[e.RandomEdge=0]="RandomEdge",e[e.NewEdge=1]="NewEdge",e[e.SameEdge=2]="SameEdge"}(k||(k={}));class M extends u.u{constructor(e,t){super(),this.roomStatusNotifier=e,this.newRelicName=t,this.requestJPEG=new p.c_("requestJPEG"),this.requestControlVisibility=new p.c_("requestControlVisibility"),this.setControlVolume=new p.c_("setControlVolume"),this.setControlIsMuted=new p.c_("setControlIsMuted"),this.supportsAutoplayWithAudio=!0,this.videoElement=document.createElement("video"),this.isStreamReconnecting=!1,this.connectingOverlay=document.createElement("div"),this.connectingTimeouts=[],this.possibleQualityLevelsChanged=new p.c_("possibleQualityLevelsChanged"),this.videoOfflineChange=new p.c_("videoOfflineChange"),this.playbackStart=new p.c_("playbackStart"),this.showJpeg=!0,this.videoOffline=!1,this.isInPictureInPicture=!1,this.tryingTimeoutRefresh=!1,this.startTime=0,this.loading=0,this.pageLoaded=0,this.metaLoaded=0,this.dataLoaded=0,this.loadStart=0,this.minutesSincePlay=0,this.startTimesSent=!1,this.lastDropped=0,this.lastFrames=0,this.sessionFrames=0,this.sessionDropped=0,this.roomCount=0,this.hiddenTotal=0,this.hiddenDropped=0,this.isDisabled=!1,this.enableLLHLS=!1,this.listeners=new p.gt,this.allowLLHLS=!1,this.waitingCounter=0,this.unloadSent=!1,this.updateLLHLSButton=new p.c_("updateLLHLSButton"),this.firstLoad=!0,this.isCasting=!1,this.visibilityChange=e=>{if(e){if(void 0!==this.leaveFrames){const e=this.videoElement.getVideoPlaybackQuality();this.hiddenTotal+=e.totalVideoFrames-this.leaveFrames.totalVideoFrames,this.hiddenDropped+=e.droppedVideoFrames-this.leaveFrames.droppedVideoFrames}void 0!==this.videoAnalytics&&o().Analytics.reportAppForegrounded()}else this.leaveFrames=this.videoElement.getVideoPlaybackQuality(),void 0!==this.videoAnalytics&&o().Analytics.reportAppBackgrounded();(0,r.Xb)()&&!this.isCasting&&(this.setAutoplay(e),e?this.refreshStream(this.context):this.videoElement.pause())},this.element.style.position="static",this.element.style.background=`#333333 url(${STATIC_URL}cam_notice_background.jpg) center center / cover`,this.element.className="videoPlayerDiv",this.element.dataset.testid="video-container",this.videoElement.setAttribute("webkit-playsinline",""),this.videoElement.setAttribute("playsinline",""),this.videoElement.style.margin="0",this.videoElement.style.padding="0",this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.objectFit="contain",this.videoElement.style.backgroundColor="rgba(0, 0, 0, 0.0)",this.videoElement.dataset.testid="video",this.videoElement.id="chat-player",this.setAutoplay(!0),this.element.appendChild(this.videoElement),window.videoElement=this.videoElement,this.connectingOverlay.style.backgroundColor="#000000",this.connectingOverlay.style.opacity="0.6",this.connectingOverlay.style.position="absolute",this.connectingOverlay.style.width="inherit",this.connectingOverlay.style.height="inherit",this.videoMetrics=new T._9(t),this.videoMetrics.bindAll(),P.listen((e=>{this.isInPictureInPicture=e.active})).addTo(this.listeners),m.VZ.listen((()=>{this.endSession()})).addTo(this.listeners),this.videoElement.onloadstart=()=>{0!==this.loading&&(this.loadStart=Date.now()-this.loading),this.startConviva()},this.videoElement.onloadeddata=()=>{0!==this.loading&&(this.dataLoaded=Date.now()-this.loading)},this.videoElement.onloadedmetadata=()=>{0!==this.loading&&(this.metaLoaded=Date.now()-this.loading)},this.videoElement.onplaying=e=>{if(!1===this.startTimesSent){this.roomCount+=1;let e=0,t=0;0!==this.loading&&(e=Date.now()-this.loading),0!==this.pageLoaded&&(t=Date.now()-this.pageLoaded),this.videoMetrics.sendStartTimes(e,t,this.dataLoaded,this.metaLoaded,this.loadStart,this.roomStatus,this.roomCount,this.videoElement.height),this.startQualityTracking(),this.startTimesSent=!0,void 0!==this.waitingStart&&(this.waitingCounter+=Date.now()-this.waitingStart,this.waitingStart=void 0)}(0,r.nr)()&&(this.videoElement.style.objectFit="contain"),this.updateStreamToggle()},void 0===(0,y.JO)(window.location.search)["disable-player-fallback"]&&(this.videoElement.onwaiting=()=>{var e;if(this.enableLLHLS&&!(0,S.zb)()&&"bad"!==(null===(e=a.Aw.getState().quality)||void 0===e?void 0:e.quality)){if(this.waitingCounter>15e3)return void this.forceHlsFallback();this.waitingStart=Date.now()}},window.setInterval((()=>{this.waitingCounter=0}),6e4));const i=()=>{this.showControls(),this.play();const e=()=>{this.play()};(0,d.wu)("pause",this.videoElement,e),window.setTimeout((()=>{(0,d.Pf)("pause",this.videoElement,e)}),600)};(0,d.wu)("webkitendfullscreen",this.videoElement,i),(0,d.wu)("leavepictureinpicture",this.videoElement,i),(0,d.wu)("beforeunload",window,this.stopConviva.bind(this)),C.g$.listen(this.visibilityChange).addTo(this.listeners),(0,d.wu)("pagehide",window,this.sendUnloadEvent.bind(this)),(0,d.wu)("beforeunload",window,this.sendUnloadEvent.bind(this)),(0,d.wu)("unload",window,this.sendUnloadEvent.bind(this))}async getHlsUrlAndRoomStatus(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.dossier.hlsSource===this.lastSeenHlsUrl||""===e.dossier.hlsSource||i||t){let s="";if(void 0!==this.currentSrc&&""!==this.currentSrc)try{s=new URL(this.currentSrc).hostname}catch(e){error("Unable to parse current edge",{error:e,url:this.currentSrc})}const n=await(0,c.KF)("get_edge_hls_url_ajax/",{room_slug:e.dossier.room,bandwidth:"high",current_edge:i?s:"",exclude_edge:t?s:""}),o=JSON.parse(n.responseText);if(o.success)return this.lastSeenHlsUrl=o.url,{url:this.fullyParseURL(o.url),status:(0,f.PZ)(o.room_status)};throw n.responseText}{this.lastSeenHlsUrl=e.dossier.hlsSource;let t=e.chatConnection.status;return this.videoOffline&&(t="offline"),{url:this.fullyParseURL(e.dossier.hlsSource),status:t}}}parseHlsUrl(e){const t=(0,y.JO)(window.location.search)["init-edgemm"];if(void 0!==t&&void 0===window._hasUsedEdgeQueryParam&&""!==e)return window._hasUsedEdgeQueryParam=!0,e.replace(/(^https:\/\/)(.+?)(\/.+)/,`https://${t}.live.mmcdn.com$3`);const i=(0,y.JO)(window.location.search);return void 0!==i.edgemm?e.replace(/(^https:\/\/)(.+?)(\/.+)/,`https://${i.edgemm}.live.mmcdn.com$3`):void 0!==i.edge?e.replace(/(^https:\/\/)(.+?)(\/.+)/,`https://edge${i.edge}.stream.highwebmedia.com$3`):e}refreshStream(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.stop(),this.isDisabled?this.stopQuality():(async()=>{if(this.stopQuality(),this.waitingCounter=0,this.waitingStart=void 0,this.pageLoaded=Date.now(),e.dossier.room!==this.room)return void debug("Trying to refresh old room context");let s,n;this.sessionFrames+=this.lastFrames,this.sessionDropped+=this.lastDropped,this.lastFrames=0,this.lastDropped=0,this.hiddenTotal=0,this.hiddenDropped=0,this.leaveFrames=void 0;try{const o=await this.getHlsUrlAndRoomStatus(e,t,i);s=o.url,n=o.status}catch(e){return void error("Unable to refresh HLS stream",{error:e})}"offline"===this.roomStatus&&n!==this.roomStatus&&(this.isStreamReconnecting=!0),this.videoOffline="offline"===n,this.videoOfflineChange.fire(this.videoOffline),"notconnected"===this.roomStatus||"offline"!==n?"privatenotwatching"===this.roomStatus&&this.roomStatus===n&&l.U.isEnabledForUI()||(this.roomStatus=n,this.updateConviva(s,e.dossier.room),this.loadHlsStream(e,s)):this.setOfflinePollingTimeout(e)})().catch(v.yZ)}refreshStreamOnNewEdge(e){this.refreshStream(e,!0,!1)}refreshStreamOnSameEdge(e){this.refreshStream(e,!1,!0)}async tryVideoStart(){const e=this.playableHlsPlayer.play();if(void 0===e)return{api:"old",success:!this.videoElement.paused};try{return await e,{api:"new",success:!0}}catch(e){return{api:"new",success:!1,error:e}}}async playInternal(){const e=await this.tryVideoStart();if(e.success)return void this.playbackStart.fire(void 0);"old"===e.api&&(0,g.bT)("NoPromiseAutoplayPolicy"),b.kw.fire(void 0),this.setMuted(!0);const t=await this.tryVideoStart();t.success?this.playbackStart.fire(void 0):"new"===t.api&&(this.isStreamReconnecting||(warn("Unable to play twice in a row",{err:t.error},"VIDEO_"),(0,r.Pb)()&&(error("Attempting to fallback to JPEG player."),void 0!==this.videoAnalytics&&((0,s.trackCustomEvent)({name:"JpegFallback",data:{roomName:this.room,broadcasterID:this.roomUid}}),this.videoAnalytics.reportPlaybackError("JpegFallback",o().Constants.ErrorSeverity.FATAL)),this.stopQuality(),this.stopConviva(),this.setControlIsMuted.fire({isMuted:!0,save:!1}),this.requestJPEG.fire(this.context))),this.handleNeverPlayed())}play(){this.shouldPreventPlay()?this.stopTooMuchWaitingTimeout():this.playInternal().catch(v.yZ)}stop(){this.roomStatusNotifier.displaysForStatus(this.roomStatus)&&(this.removeReconnecting(),this.clearPlayerTimeouts()),this.isStreamReconnecting&&this.clearPlayerTimeouts(),this.stopTooMuchWaitingTimeout()}clearPlayerTimeouts(){for(const e of this.connectingTimeouts)clearTimeout(e);clearTimeout(this.offlinePollingTimeout),this.offlinePollingTimeout=void 0,clearTimeout(this.onlinePollingTimeout),this.onlinePollingTimeout=void 0}setVolume(e){this.videoElement.volume=e/100}getVolume(){return this.videoElement.muted||!this.isStreamReconnecting&&this.videoElement.paused?0:100*this.videoElement.volume}getMuted(){return 0===this.videoElement.volume||this.videoElement.muted}showNativeControls(){this.requestControlVisibility.fire(!1)}showCustomControls(){this.requestControlVisibility.fire(!0)}showControls(){(0,x.cX)()?this.showCustomControls():this.showNativeControls()}hideControls(){this.requestControlVisibility.fire(!1),this.hideNativeControls()}setVolumeMuted(e,t){}enterFullScreenMode(){}getControlBarHeight(){return 0}handleNeverPlayed(){this.stopTooMuchWaitingTimeout()}handleRoomLoaded(e){this.videoOffline=!1,this.showJpeg=!a.Bm.current.isTestbed,this.videoElement.poster=this.showJpeg?`${h.m.jpegStreamUrl}stream?room=${e.dossier.room}&f=${Math.random()}`:"",this.context=e,this.room=e.dossier.room,this.roomUid=e.dossier.roomUid,this.userlistColor=e.dossier.userlistColor,this.roomStatusNotifier.displaysForStatus(e.dossier.roomStatus)||this.videoOffline||!(0,x.kt)()||this.handleConviva(),void 0===this.currentSrc&&(this.currentSrc=e.dossier.hlsSource),this.loading=Date.now(),e.chatConnection.event.statusChange.listen((t=>{if(this.roomStatus=t.currentStatus,this.updateStreamToggle(),this.videoMetrics.setStatus(this.roomStatus),this.roomStatusNotifier.displaysForStatus(t.currentStatus)||this.videoOffline)this.endSession(),this.videoMetrics.endSession(),this.firstLoad=!1,this.stop(),this.stopTooMuchWaitingTimeout(),this.stopConviva(),this.videoOffline?this.setOfflinePollingTimeout(e):this.setOnlinePollingTimeout(e);else{switch(clearTimeout(this.onlinePollingTimeout),this.onlinePollingTimeout=void 0,t.previousStatus){case"notconnected":case"privaterequesting":break;default:"notconnected"===t.currentStatus?(this.setReconnecting(e.dossier.room),window.setTimeout((()=>{this.firstLoad?(this.firstLoad=!1,this.refreshStream(e)):this.refreshStreamOnSameEdge(e)}),0)):(this.connectingTimeouts.push(window.setTimeout((()=>{this.setReconnecting(e.dossier.room)}),0)),this.connectingTimeouts.push(window.setTimeout((()=>{this.refreshStreamOnSameEdge(e)}),3e3)))}(0,x.kt)()&&void 0===this.videoAnalytics&&this.handleConviva()}})).addTo(this.listeners)}setReconnecting(e){const t=this.showJpeg?`${h.m.jpegStreamUrl}stream?room=${e}&f=${Math.random()}`:"";this.element.style.background=`#333333 url(${t}) center center / cover`,this.roomStatusNotifier.showConnectingStatus(),this.element.insertBefore(this.connectingOverlay,this.element.firstChild),this.isStreamReconnecting=!0}removeReconnecting(){this.isStreamReconnecting=!1,this.roomStatusNotifier.hideConnectingStatus(),this.connectingOverlay.parentElement===this.element&&this.element.removeChild(this.connectingOverlay),this.element.style.background=`#333333 url(${STATIC_URL}cam_notice_background.jpg) center center / cover`}setOnlinePollingTimeout(e){void 0===this.onlinePollingTimeout&&(this.onlinePollingTimeout=window.setTimeout((async()=>{"offline"===(await this.getHlsUrlAndRoomStatus(e,!1,!0)).status?(this.videoOffline=!0,this.onlinePollingTimeout=void 0,this.setOfflinePollingTimeout(e),this.videoOfflineChange.fire(this.videoOffline)):(this.onlinePollingTimeout=void 0,this.setOnlinePollingTimeout(e))}),1e4))}setOfflinePollingTimeout(e){void 0===this.offlinePollingTimeout&&(this.offlinePollingTimeout=window.setTimeout((()=>{this.offlinePollingTimeout=void 0,this.refreshStreamOnSameEdge(e)}),1e4))}setTooMuchWaitingTimeout(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};this.stopTooMuchWaitingTimeout(),void 0===(0,y.JO)(window.location.search)["disable-player-fallback"]&&(this.tooMuchWaitingTimeout=window.setTimeout((()=>{if(this.tryingTimeoutRefresh){if(this.removeReconnecting(),this.stopQuality(),void 0!==this.videoAnalytics){const e=this.enableLLHLS?"LLHLS Fallback":"HLS Fallback";this.videoAnalytics.reportPlaybackError(e,o().Constants.ErrorSeverity.FATAL),(0,s.trackCustomEvent)({name:e,data:{roomName:this.room,broadcasterID:this.roomUid}})}this.stopConviva(),this.enableLLHLS&&this.allowLLHLS?this.forceHlsFallback():(error("Attempting to fallback to JPEG player."),this.setControlIsMuted.fire({isMuted:!0,save:!1}),this.requestJPEG.fire(this.context))}else!(0,C.gA)()||this.isInPictureInPicture?this.setTooMuchWaitingTimeout(e,t):(info("Video seems to be stuck, refreshing"),this.tryingTimeoutRefresh=!0,this.refreshStreamOnSameEdge(e),t())}),1e3*A/2))}stopTooMuchWaitingTimeout(){void 0!==this.tooMuchWaitingTimeout&&(clearTimeout(this.tooMuchWaitingTimeout),this.tooMuchWaitingTimeout=void 0)}getVideoElement(){return this.videoElement}onForceRemoved(){this.endSession(),this.listeners.removeAll(),this.cleanupEventListeners(),this.videoMetrics.playerForceRemoved(),this.videoElement.remove()}setPageLoaded(e){this.pageLoaded=e}stopQuality(){clearInterval(this.updateQuality)}startQualityTracking(){this.stopQuality(),window.setTimeout((()=>{this.sendQuality(!1),this.updateQuality=window.setInterval((()=>{this.sendQuality(!1)}),6e4)}),15e3)}sendQuality(e){if(e||!document.hidden&&!["away","privatenotwatching","hidden","offline"].includes(this.roomStatus)){let t=0,i=0,s=0,n=0,o=0,a=0;if(!(0,r.OF)()){const e=this.videoElement.getVideoPlaybackQuality();i=e.droppedVideoFrames-this.hiddenDropped,t=e.totalVideoFrames-this.hiddenTotal,o=i-this.lastDropped,a=t-this.lastFrames,n=-1,a>0&&(n=o/a*100),t=this.sessionFrames+t,i=this.sessionDropped+i,s=-1,t>0&&(s=i/t*100),this.lastFrames=t,this.lastDropped=i}let l=this.minutesSincePlay;e&&(l=-1);const h=this.videoElement.videoHeight*this.videoElement.videoWidth;this.videoMetrics.sendQuality(s,n,t,a,h,this.videoElement.videoHeight,l,this.roomStatus)}this.minutesSincePlay+=1}initConviva(){let e="11bbd19872403a8c17a3c4a24fe2b5501f6831b9";a.Bm.current.isInternal&&(e="224075d7f3c1654ccd30d05396d7b47e49dd6da3"),o().Analytics.init(e,null,{});const t={};t[o().Constants.DeviceMetadata.CATEGORY]=o().Constants.DeviceCategory.WEB,t[o().Constants.DeviceMetadata.TYPE]=(0,r.Xb)()?o().Constants.DeviceType.MOBILE:o().Constants.DeviceType.DESKTOP,o().Analytics.setDeviceMetadata(t),this.videoAnalytics=o().Analytics.buildVideoAnalytics()}startConviva(){let e="anon",t="false";if(void 0!==a.Bm.current.loggedInUser?(e=a.Bm.current.loggedInUser.userUid,t="true"):e=`${e}_${this.videoMetrics.getSessionID()}`,void 0!==this.videoAnalytics){const i={[o().Constants.ASSET_NAME]:this.room,[o().Constants.IS_LIVE]:o().Constants.StreamType.LIVE,[o().Constants.VIEWER_ID]:e,[o().Constants.PLAYER_NAME]:this.playerType,"c3.app.version":"v24.6.14.0.post1",userColor:this.userlistColor,loggedIn:t},s=document.location.href.match(/^https?:\/\/([^/]+).*$/);i.domain=null!==s?s[1]:"",this.videoAnalytics.reportPlaybackRequested(i)}}handleConviva(){this.stopConviva(),this.initConviva(),this.setupConvivaPlayer()}updateConviva(e,t){const i=e.match(/^https:\/\/edge(.+)\.live/),s=e.match(/(live-.+)\/amlst/);this.host=new URL(e).hostname,this.edge=null!==i?i[1]:"",this.playlistResource=null!==s?s[1]:"",void 0!==this.videoAnalytics&&this.videoAnalytics.setContentInfo({[o().Constants.ASSET_NAME]:t,[o().Constants.STREAM_URL]:e,[o().Constants.DEFAULT_RESOURCE]:this.host,broadcasterID:this.roomUid,edgeName:this.edge,playlistResource:this.playlistResource,streamType:this.enableLLHLS?"llhls":"hls",videoMode:w.L.getVideoMode()}),this.videoMetrics.updateResourceInfo(this.host,this.edge,this.playlistResource)}stopConviva(){if(void 0!==this.videoAnalytics)try{this.videoAnalytics.reportPlaybackEnded(),this.videoAnalytics.release(),o().Analytics.release(),this.videoAnalytics=void 0}catch(e){error("Error stopping conviva",{error:e})}}disable(e){this.isDisabled=e}forceHlsFallback(){(0,S.Vk)(!0),this.enableLLHLS=!1,error("Attempting to fallback to HLS stream.");const e=this.currentSrc.match(/^https:\/\/edge(.+)\.live/);(0,g.bT)("LLHLSFallback",{source:this.currentSrc,edge:null!==e?e[1]:"",playerType:this.playerType}),this.handleConviva(),this.endSession(),this.videoMetrics.endSession(),this.refreshStreamOnNewEdge(this.context),(0,r.nr)()&&(this.videoElement.style.objectFit="fill")}forceStream(e){if(e!==this.enableLLHLS){if(this.disableToggle())return;(0,S.rC)(e);const t=this.currentSrc.match(/^https:\/\/edge(.+)\.live/);(0,g.bT)("StreamTypeChange",{source:this.currentSrc,streamType:e?"llhls":"hls",edge:null!==t?t[1]:"",playerType:this.playerType}),(0,x.kt)()&&(0,s.trackCustomEvent)({name:"StreamTypeChange",data:{roomName:this.room,source:this.currentSrc,streamType:e?"llhls":"hls",edge:null!==t?t[1]:"",playerType:this.playerType}});const i=(0,y.JO)(window.location.search)["force-llhls"];this.enableLLHLS=e||void 0!==i,this.enableLLHLS&&(0,S.Vk)(!1),this.handleConviva(),this.endSession(),this.videoMetrics.endSession(),this.refreshStreamOnSameEdge(this.context),(0,r.nr)()&&(this.videoElement.style.objectFit="fill")}}getTrueURL(e){if(e=this.replaceSuffix(e),this.allowLLHLS){const t=/live-.+amlst/;let i="";this.shouldDisallowLLHLS()||"hls"===(0,S.uq)()||(0,S.zb)()?(this.enableLLHLS=!1,i=void 0!==a.Bm.current.loggedInUser?"live-fhls":"live-c-fhls"):(this.enableLLHLS=!0,i=void 0!==a.Bm.current.loggedInUser?"live-llhls":"live-c-llhls"),e=e.replace(t,`${i}/amlst`)}return e}replaceSuffix(e){return this.allowLLHLS&&e.includes("playlist.m3u8")?e=e.replace("playlist.m3u8","playlist_sfm4s.m3u8"):e.includes("playlist_sfm4s.m3u8")&&(e=e.replace("playlist_sfm4s.m3u8","playlist.m3u8")),e}setEdgeLLHLS(e){if(e.includes("mmcdn")&&void 0===(0,y.JO)(window.location.search)["force-llhls"]){const t=/^https:\/\/edge(.+)\.live/,i=e.match(t),s=(0,y.JO)(window.location.search)["llhls-capable-edge"];if(void 0!==s&&null!==i&&i[0].includes(s))return void(this.allowLLHLS=!0);if(null!==i&&void 0!==i[1]){const e=i[1].split("-")[0];if(20===Number(e))return void(this.allowLLHLS=!0)}this.allowLLHLS=!1,this.enableLLHLS=!1}else this.allowLLHLS=!0}fullyParseURL(e){let t=this.parseHlsUrl(e);return this.isLLHLSForced(),(0,x.Ce)()&&(this.setEdgeLLHLS(t),t=this.getTrueURL(t)),this.updateStreamToggle(),t&&(this.currentSrc=t),this.videoMetrics.sendStreamType(this.enableLLHLS?"llhls":"hls",this.currentSrc),t}shouldDisallowLLHLS(){return void 0===(0,y.JO)(window.location.search)["force-llhls"]&&("Native"===this.playerType||"videoonly"===w.L.getVideoMode()||(0,r.Xb)())}isLLHLSForced(){void 0!==(0,y.JO)(window.location.search)["force-llhls"]&&(this.allowLLHLS=!0,this.enableLLHLS=!0)}disableToggle(){return["hidden","privatenotwatching","notconnected","offline","away"].includes(this.roomStatus)}getSource(){return this.currentSrc}setSource(e){this.currentSrc=e}sendUnloadEvent(){!this.unloadSent&&this.startTimesSent&&(this.sendQuality(!0),this.unloadSent=!0)}cleanupEventListeners(){(0,d.Pf)("beforeunload",window,this.stopConviva.bind(this)),(0,d.Pf)("pagehide",window,this.sendUnloadEvent.bind(this)),(0,d.Pf)("beforeunload",window,this.sendUnloadEvent.bind(this)),(0,d.Pf)("unload",window,this.sendUnloadEvent.bind(this))}updateStreamToggle(){this.updateLLHLSButton.fire({allowed:this.allowLLHLS&&!this.shouldDisallowLLHLS()&&!this.disableToggle(),enabled:this.enableLLHLS})}resetRetryCounter(){}endSession(){this.stopQuality(),this.sendUnloadEvent(),this.videoMetrics.endSession(),this.resetRetryCounter(),this.sessionDropped=0,this.sessionFrames=0,this.minutesSincePlay=0,this.startTimesSent=!1,this.unloadSent=!1,this.lastFrames=0,this.lastDropped=0,this.hiddenDropped=0,this.hiddenTotal=0,this.loading=Date.now()}shouldPreventPlay(){return(0,r.Xb)()&&document.hidden&&!this.isCasting}setContainerElement(e){}setAutoplay(e){e?this.videoElement.setAttribute("autoplay","autoplay"):this.videoElement.removeAttribute("autoplay")}}},9321:(e,t,i)=>{"use strict";i.d(t,{O:()=>g});var s=i(7063),n=i(7623),o=i(9461),r=i(1224),a=i(5216),l=i(2709),h=i(8423),d=i(1779),c=i(1452),u=i(8255),p=i(3860),m=i(1021);class g extends l.u{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.roomStatusNotifier=e,this.isHlsPlaceholder=t,this.requestControlVisibility=new h.c_("requestControlVisibility"),this.supportsAutoplayWithAudio=!1,this.possibleQualityLevelsChanged=new h.c_("possibleQualityLevelsChanged"),this.updateLLHLSButton=new h.c_("updateLLHLSButton"),this.videoOfflineChange=new h.c_("videoOfflineChange"),this.playbackStart=new h.c_("playbackStart"),this.lastFrameTime=0,this.loading=!1,this.muted=!0,this.stopped=!0,this.url="",this.lastTime=0,this.listenerGroup=new h.gt,this.isDisabled=!1,this.videoMetrics=new m.nH(this.isHlsPlaceholder?"JpegToHlsPlayer":"JpegPushPlayer"),this.videoMetrics.bindAll(),this.element.style.background=`#333333 url(${STATIC_URL}cam_notice_background.jpg) center center / cover`,this.element.className="videoPlayerDiv",this.element.style.position="static",this.element.dataset.testid="video-container",this.playerImage=document.createElement("img"),this.playerImage.style.width="100%",this.playerImage.style.height="100%",this.playerImage.style.objectFit="contain",this.playerImage.style.backgroundColor="black",this.playerImage.dataset.testid="video",this.playerImage.id="chat-player",this.playerImage.onload=()=>{this.playerImage.style.display="inline",this.loading=!1},this.playerImage.onerror=()=>{this.playerImage.style.display="none",this.lastTime-=100,this.loading=!1},this.element.appendChild(this.playerImage),(0,n.H9)()||(this.requestAnimationFrame=(0,n.xv)(),this.requestAnimationCallback(0))}updateAjaxUrl(){if(this.lastTime=Date.now(),void 0!==this.roomName)return(0,a.KF)("get_edge_hls_url_ajax/",{room_slug:this.roomName,jpeg:"1"}).then((e=>{const t=new s.N6(e.responseText),i=t.getBoolean("success");if("offline"===(0,u.JG)(t))return this.videoOfflineChange.fire(!0),void this.stop();this.videoOfflineChange.fire(!1),t.ignore("url"),t.ignore("hidden_message"),i?(this.url=t.getString("cbjpeg_url",!1),t.logUnusedDebugging("parseJpegStream")):error("Unable to refresh JPEG stream",{error:e.responseText},"VIDEO_")})).catch((e=>{error("Unable to refresh JPEG stream",{error:e},"VIDEO_")}))}requestAnimationCallback(e){this.isHlsPlaceholder||(Date.now()-this.lastTime>5e3&&this.updateAjaxUrl(),this.stopped||""===this.url||(0,n.H9)()?this.playerImage.style.visibility="hidden":(0===this.lastFrameTime||e-this.lastFrameTime>140)&&!this.loading&&(this.loading=!0,this.lastFrameTime=e,this.playerImage.src=`${this.url}&f=${Math.random()}`,"visible"!==this.playerImage.style.visibility&&(this.playbackStart.fire(void 0),this.playerImage.style.visibility="visible")),this.requestAnimationFrame.call(window,(e=>{this.requestAnimationCallback(e)})))}handleRoomLoaded(e){var t;this.stopped=!1,this.listenerGroup.removeAll(),e.chatConnection.event.statusChange.listen((e=>{this.roomStatusNotifier.displaysForStatus(e.currentStatus)||this.videoOffline?this.stop():(e.currentStatus,this.stopped=!1)})).addTo(this.listenerGroup),this.roomName=e.dossier.room,this.url=o.Bm.current.isTestbed?"":`${r.m.jpegStreamUrl}stream?room=${this.roomName}`,o.Aw.getState().activePassword?null===(t=this.updateAjaxUrl())||void 0===t||t.then((()=>{this.updateImage()})).catch(c.yZ):this.updateImage()}updateImage(){this.requestControlVisibility.fire(!0),this.isHlsPlaceholder&&(this.playerImage.src=`${this.url}&f=${Math.random()}`,this.showPlayerImage())}setVolume(e){this.volume=e}getVolume(){return this.muted?0:this.volume}setMuted(e){this.muted=e}stop(){this.playerImage.style.visibility="hidden",this.stopped=!0}showPlayerImage(){this.playerImage.style.visibility="visible"}setQualityLevel(){}showControls(){this.requestControlVisibility.fire(!0)}hideControls(){this.requestControlVisibility.fire(!1)}getControlBarHeight(){return 0}enterFullScreenMode(){p.L.setFireVideoMode("noninteractive-fullscreen");let e=this.element;void 0!==this.containerElement&&(e=this.containerElement),(0,d.lh)(e)}setVolumeMuted(e,t){}afterRemovedFromParent(){this.stop(),this.listenerGroup.removeAll()}getVideoElement(){}getIsHlsPlaceholder(){return this.isHlsPlaceholder}onForceRemoved(){this.videoMetrics.playerForceRemoved()}disable(e){this.isDisabled=e}forceHlsFallback(){}forceStream(){}getSource(){return this.url}setSource(e){}setContainerElement(e){this.containerElement=e}}},1282:(e,t,i)=>{"use strict";i.d(t,{Bu:()=>o,C6:()=>w,Ln:()=>u,Vk:()=>v,Y9:()=>p,dv:()=>y,nQ:()=>C,pD:()=>b,qL:()=>r,rC:()=>m,uq:()=>g,zb:()=>f});var s=i(7623),n=i(2758);const o=.75,r=.5625,a="defaultVideoQuality",l="defaultLLHLSSetting",h="llhlsFallback",d="convivaSession";function c(e){return`privateShow_${e}`}function u(e,t){if((0,s.Pf)())for(const i of e)i.value===t&&window.localStorage.setItem(a,i.label)}function p(){let e="auto";if((0,s.Pf)()){const t=window.localStorage.getItem(a);null!==t&&(e=t)}return e}function m(e){(0,n.aR)(l,e?"llhls":"hls",{days:60})}function g(){var e;let t=(0,n.y1)(l);return void 0===t&&(t=(0,n.fc)(l,{days:60})),null!==(e=t)&&void 0!==e?e:""}function v(e){(0,n.nw)(h,e?"true":"false",{hours:1})}function f(){return"true"===(0,n.TS)(h)}function y(){var e;return null!==(e=window.sessionStorage.getItem(d))&&void 0!==e?e:""}function b(e){window.sessionStorage.setItem(d,e)}function w(e,t,i){const s=c(e),n={price:t,end:i};window.localStorage.setItem(s,JSON.stringify(n))}function C(e){const t=c(e),i=window.localStorage.getItem(t);return null!==i?i:""}},3049:(e,t,i)=>{"use strict";i.d(t,{Ce:()=>c,cX:()=>h,kt:()=>d});var s=i(9461),n=i(6440),o=i(9060),r=i(2945),a=i(3860),l=i(1282);function h(){if(!0===s.Bm.current.isMobile)return!0;const e=a.L.getVideoMode();return((0,o.c5)()||"split"!==e)&&"videoonly"!==e&&"noninteractive-fullscreen"!==e}function d(){if(void 0!==(0,r.JO)(window.location.search).conviva)return!0;let e=(0,l.dv)();return""===e&&(e=s.Bm.current.contextID,(0,l.pD)(e)),"0"===e.charAt(e.length-1)&&!s.Bm.current.noAnalytics&&(0,n.f)("VDPEnblConviva")}function c(){return(0,n.f)("VDPLLHLS")||void 0!==(0,r.JO)(window.location.search)["force-llhls"]}},3933:(e,t,i)=>{"use strict";i.d(t,{y:()=>k});var s=i(352),n=i(7507),o=i.n(n),r=i(6461),a=i.n(r),l=i(7623),h=i(9461),d=i(213),c=i(1516),u=i(3955),p=i(6440),m=i(9060),g=i(1779),v=i(7407),f=i(3306),y=i(4947),b=i(2945),w=i(3860),C=i(5389),S=i(580),x=i(1282),T=i(3049);const A=window.videojs,P=window.Hls;class k extends S.vS{createPlayerOption(){return{techOrder:["html5"],autoplay:!0,html5:{hlsjsConfig:{capLevelToPlayerSize:void 0===h.Bm.current.loggedInUser,debug:!1,liveSyncDuration:3,liveSyncDurationCount:void 0,liveDurationInfinity:1/0,liveMaxLatencyDuration:7,liveMaxLatencyDurationCount:void 0,liveBackBufferLength:30,autoStartLoad:!1},nativeAudioTracks:!1},controlBar:{playToggle:!1,progressControl:!1,remainingTimeDisplay:!1,durationDisplay:!1,currentTimeDisplay:!1,timeDivider:!1,pictureInPictureToggle:!1},errorDisplay:!1}}constructor(e){super(e,"VideoJsPlayer"),this.lastTimeUpdate=0,this.isMuted=!0,this.neverPlayed=!1,this.userUnmuted=!1,this.chromecastOverlay=document.createElement("div"),this.currentBitrate=0,this.shouldExitToIFS=!0,this.isFullWindow=!1,this.handledEmptyChunklistsCnt=0,this.videoElement.className="video-js vjs-default-skin",A.log.level("error"),this.playerType="VideoJS",this.setupLLHLSButton(),this.chromecastOverlay.style.position="absolute",this.chromecastOverlay.style.backgroundColor="#000000",this.chromecastOverlay.style.width="inherit",this.chromecastOverlay.style.height="inherit";const t=this.createPlayerOption();this.element.onclick=()=>{this.neverPlayed&&((0,T.cX)()?this.showCustomControls():this.showNativeControls(),this.neverPlayed=!1)},(0,p.f)("VDPEnblTabSwitch")&&C.g$.listen((e=>{e&&this.enableLLHLS&&(this.videoElement.currentTime+=60)}));const i=A(this.videoElement,t);if(i.qualityPickerPlugin(),this.videoJs=i,this.playerId=this.videoElement.id,void 0!==i){this.videoMetrics.bindAllHTMLMedia(i,this.element),void 0!==A.Html5Hlsjs&&A.Html5Hlsjs.addHook("beforeinitialize",((e,t)=>{e===i&&this.videoMetrics.bindAllHlsJs(t),t.on(P.Events.MANIFEST_LOADED,((e,i)=>{const s=(0,x.Y9)(),n=Number((0,b.JO)(window.location.search).quality);if(void 0!==n&&!isNaN(n)&&void 0!==i.levels&&n<=i.levels.length-1&&n>=0)t.startLevel=n,t.loadLevel=n;else if(void 0!==i.levels&&"auto"!==s){let e=-1,n=i.levels[0];for(const t of i.levels)void 0!==t.height&&t.height<=parseInt(s,10)&&(e=i.levels.indexOf(t)),n=t;void 0!==this.videoAnalytics&&void 0!==n.height&&this.videoAnalytics.setContentInfo({maxQuality:n.height.toString()}),t.startLevel=e}})),t.on(P.Events.MANIFEST_LOADED,(()=>{t.startLoad()})),t.on(P.Events.LEVEL_SWITCHED,(()=>{if(void 0!==this.setLevels&&this.setLevels[this.setLevels.length-1].toggled&&(0,x.Ln)(this.setLevels,t.currentLevel),-1!==t.currentLevel){const e=t.levels[t.currentLevel];this.currentBitrate=e.bitrate/1e3,(0,T.kt)()&&(0,s.trackCustomEvent)({name:"qualitySwitched",data:{roomName:this.room,height:e.height,bitrate:this.currentBitrate,level:t.currentLevel,broadcasterID:this.roomUid}})}})),this.hls=t,this.setLLHLSConfig(),this.listenForEmptyChunklist(t)})),this.playableHlsPlayer=i,this.setupChromecastStateChange(),i.on("volumechange",(()=>{this.setVolume(this.getVolume(!1))})),i.on("canplay",(()=>{this.play(),this.isStreamReconnecting&&this.removeReconnecting()})),i.on("canplaythrough",(()=>{this.play()}));const e=this.possibleQualityLevelsChanged;i.on("updateVideoControlQuality",((t,i)=>{const s=[];for(const e of i)s.push({label:e.label,toggled:e.selected,value:e.id});e.fire(s),this.extractLevelSelectionForMetrics(s)})),i.on("enterpictureinpicture",(()=>{debug("enterpictureinpicture"),S.CY.fire({active:!0})})),i.on("leavepictureinpicture",(()=>{debug("leavepictureinpicture"),window.setTimeout((()=>{S.CY.fire({active:!1,videoPaused:i.paused()})}),0)})),i.on("touchstart",(e=>{var t;document.getElementsByClassName("vjs-volume-panel")[0].classList.add("vjs-hover"),(0,m.c5)()&&((i.controlBar.el().contains(e.target)||i.isFullscreen())&&!0!==(null===(t=this.fullscreenDropdownBtn)||void 0===t?void 0:t.contains(e.target))||e.target.click())})),this.addFullscreenListeners()}(0,T.cX)()?this.showCustomControls():this.showNativeControls(),window.videoJsPlayer=i,c.s.listen((e=>{this.chatMode=e})).addTo(this.listeners),void 0!==i.controlBar&&(i.controlBar.setAttribute("data-paction","VideoJSControls"),this.addFullscreenDropdown())}listenForEmptyChunklist(e){const t=XMLHttpRequest,i=t=>{const i=t.target;if(i.responseURL.includes("chunklist")&&200===i.status&&0===i.responseText.length&&void 0!==e){if(void 0!==this.currentEmptyChunklistsTimeout)return;this.handledEmptyChunklistsCnt<5&&(this.handledEmptyChunklistsCnt+=1,this.currentEmptyChunklistsTimeout=window.setTimeout((()=>{this.refreshStreamOnSameEdge(this.context),this.currentEmptyChunklistsTimeout=void 0}),500))}};window.XMLHttpRequest=function(){const e=new t;return e.addEventListener("loadend",i),e}}setupChromecastStateChange(){let e=0;const t=window.setInterval((()=>{e>=10&&clearInterval(t),void 0!==this.videoJs&&void 0!==this.videoJs.chromecastSessionManager&&(this.videoJs.chromecastSessionManager.getCastContext().addEventListener("sessionstatechanged",(e=>{if(void 0!==e.sessionState)switch(e.sessionState){case"SESSION_STARTED":case"SESSION_RESUMED":(0,l.Xb)()&&this.stopConviva(),this.removeTech(),this.removeEventListeners(),this.stop(),window.setTimeout((()=>{this.isCasting=!0,this.refreshStream(this.context),this.setVolume(this.getVolume(!1)),this.addChromecastMsgListener(),void 0!==this.videoJs&&void 0!==this.videoJs.tech_._ui&&(this.videoJs.tech_._ui._findTitleEl().style.visibility="hidden")}),1e3),this.roomStatusNotifier.hide(),this.addChromecastOverlay();break;case"SESSION_ENDED":const e=window.setInterval((()=>{null!==document.getElementById(this.playerId)&&void 0!==this.videoJs&&(this.videoJs.muted(this.isMuted),this.videoJs.volume(this.getVolume(!1)),window.clearInterval(e))}),100);window.setTimeout((()=>{window.clearInterval(e),(0,T.kt)()&&(0,l.Xb)()&&this.handleConviva(),void 0!==this.videoJs&&(this.videoJs.muted(this.isMuted),this.videoJs.volume(this.getVolume(!1))),this.isCasting=!1,this.refreshStream(this.context),this.addTech(),this.addEventListeners()}),2500),this.removeChromecastOverlay(),this.roomStatusNotifier.show()}})),clearInterval(t)),e+=1}),1e3)}resetRetryCounter(){void 0!==this.currentEmptyChunklistsTimeout&&(clearTimeout(this.currentEmptyChunklistsTimeout),this.currentEmptyChunklistsTimeout=void 0),this.handledEmptyChunklistsCnt=0}loadHlsStream(e,t){""!==t?(this.roomStatusNotifier.hide(),this.isCasting?(this.addChromecastOverlay(),this.roomStatusNotifier.hide(),this.stopTooMuchWaitingTimeout()):this.setTooMuchWaitingTimeout(e),void 0!==this.videoJs?(this.addLLHLSButton(),this.isCasting?this.videoJs.tech_.setSource({src:t,type:"application/x-mpegURL"}):this.isCasting||(this.videoJs.on("playing",(()=>{this.setTooMuchWaitingTimeout(e)})),this.videoJs.on("waiting",(()=>{this.setTooMuchWaitingTimeout(e)})),this.videoJs.on("timeupdate",(t=>{if(void 0!==this.videoJs){const t=this.videoJs.currentTime();t-this.lastTimeUpdate>5&&(this.lastTimeUpdate=t,this.setTooMuchWaitingTimeout(e,(()=>{this.lastTimeUpdate=0})),this.tryingTimeoutRefresh=!1)}})),this.videoJs.off("error"),this.videoJs.on("error",(t=>{if(void 0!==this.videoJs){const i=this.videoJs.error();if(null!==i&&(2===i.code||4===i.code)){if(this.isStreamReconnecting||this.refreshStreamOnSameEdge(e),void 0!==this.videoAnalytics){let e="";const t=i.message.split("-").at(-1);void 0!==t&&(e=t.trim()),this.videoAnalytics.reportPlaybackError(e,o().Constants.ErrorSeverity.FATAL)}error(i.message,t,"VIDEO_")}}else error("Videojs error type undefined",t,"VIDEO_")})),this.videoJs.src({src:t,type:"application/x-mpegURL"}),this.videoJs.qualityPickerPlugin(),this.videoJs.show(),this.videoJs.muted(this.isMuted),this.videoElement.style.display="inline"),this.playableHlsPlayer=this.videoJs,this.addTech()):(0,d.Q$)("something went wrong")):this.stop()}addFullscreenListeners(){(0,m.c5)()&&void 0!==this.videoJs&&(this.videoJs.on("enterFullWindow",(()=>{this.showNativeControls(),this.showElement(),this.isFullWindow=!0,w.L.setFireVideoMode("noninteractive-fullscreen")})),this.videoJs.on("exitFullWindow",(()=>{this.isFullWindow=!1,this.shouldExitToIFS||(0,g.Eh)(),g._c.fire(),this.shouldExitToIFS=!0})),g._c.listen((()=>{void 0!==this.videoJs&&!(0,g.aS)()&&this.isFullWindow&&this.videoJs.exitFullWindow()})))}addFullscreenDropdown(){if(!(0,m.c5)()||void 0===this.videoJs)return;const e=this.videoJs.controlBar.addChild("button",{controlText:"Toggle Interactive Fullscreen",className:"vjs-fullscreen-dropdown"});this.fullscreenDropdownBtn=e.el();const t=document.createElement("img"),i=(0,m.ng)()?`${STATIC_URL}theaterVideoControlsIcons/`:STATIC_URL;t.src=`${i}ellipsis-vertical.svg`,t.title=y.R.switchFullscreenModeLabel,(0,m.ng)()?((0,u.ZM)(t,{height:"16px",userSelect:"none"}),(0,u.ZM)(this.fullscreenDropdownBtn,{cursor:"pointer"})):(0,u.ZM)(t,{padding:"8px 18px",cursor:"pointer"}),this.fullscreenDropdownBtn.appendChild(t);const s=new f.n({toggleElement:this.fullscreenDropdownBtn,enterNativeFn:()=>{},enterInteractiveFn:()=>this.exitFullScreenMode()});(0,u.ZM)(s.element,{right:"20px"}),s.nativeOption.classList.add("active"),this.fullscreenDropdownBtn.appendChild(s.element);const n=this.videoJs.controlBar.getChild("fullscreenToggle");void 0!==n&&(n.handleClick=()=>{this.shouldExitToIFS=!1,this.exitFullScreenMode()})}removeFullscreenDropdown(){var e;(0,m.c5)()&&void 0!==this.fullscreenDropdownBtn&&(null===(e=this.fullscreenDropdownBtn.parentNode)||void 0===e||e.removeChild(this.fullscreenDropdownBtn),this.fullscreenDropdownBtn=void 0)}addChromecastMsgListener(){if(this.isCasting&&void 0!==this.videoJs&&void 0!==this.videoJs.chromecastSessionManager){const e=this.videoJs.chromecastSessionManager.getCastContext().getCurrentSession();if(void 0!==e){let t=0;e.addMessageListener("urn:x-cast:com.highwebmedia.cast.media",((e,i)=>{this.isCasting&&i.includes("PAUSED")?(clearTimeout(t),t=window.setTimeout((()=>{this.refreshStream(this.context)}),2500)):this.isCasting&&i.includes("BUFFERING")?(clearTimeout(t),t=window.setTimeout((()=>{this.refreshStream(this.context)}),7500)):!this.isCasting||i.includes("PLAYING")?clearTimeout(t):this.isCasting&&i.includes("MEDIA_ERROR")&&this.refreshStreamOnNewEdge(this.context)}))}}}setVolume(e){if(void 0!==this.videoJs){const t=this.isMuted;this.isMuted=0===e||this.videoJs.muted(),!t||this.isMuted||this.userUnmuted||(this.userUnmuted=!0,(0,v.bT)("UserUnmuted",{chatMode:this.chatMode})),t!==this.isMuted&&(0,v.bT)("ToggleMute",{newState:this.isMuted}),this.setControlVolume.fire({volume:e,save:!0}),this.setControlIsMuted.fire({isMuted:this.isMuted,save:!0})}}setMuted(e){!this.isMuted||e||this.userUnmuted||(this.userUnmuted=!0,(0,v.bT)("UserUnmuted",{chatMode:this.chatMode})),e!==this.isMuted&&(0,v.bT)("ToggleMute",{newState:e}),this.isMuted=e,this.setControlIsMuted.fire({isMuted:e,save:!0}),void 0!==this.videoJs&&this.videoJs.muted(e)}setVolumeMuted(e,t){this.isMuted=t,void 0!==this.videoJs&&(this.videoJs.volume(e/100),this.videoJs.muted(t))}getVolume(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return void 0!==this.videoJs?e&&this.videoJs.muted()?0:100*this.videoJs.volume():0}getMuted(){return void 0===this.videoJs||this.videoJs.muted()}stop(){if(this.lastTimeUpdate=0,this.isCasting||void 0===this.videoJs){if(this.isCasting&&void 0!==this.videoJs)return this.videoJs.pause(),this.videoJs.src(),void this.videoJs.hide()}else this.videoJs.off("timeupdate"),this.videoJs.off("waiting"),this.videoJs.off("playing"),this.videoJs.pause(),this.removeTech(),this.videoJs.src(),this.videoJs.hide(),this.videoJs.muted(this.isMuted);super.stop()}addChromecastOverlay(){this.chromecastOverlay!==this.element.firstChild&&this.element.insertBefore(this.chromecastOverlay,this.element.firstChild)}removeChromecastOverlay(){this.chromecastOverlay.parentElement===this.element&&this.element.removeChild(this.chromecastOverlay)}addTech(){this.isCasting||void 0!==this.tech||void 0===this.videoJs||(this.tech=this.videoJs.tech(),this.tech.on("loadedqualitydataTS",((e,t)=>{(0,v.bT)("VideoOnloadMuteStatus",{muted:this.isMuted,chatMode:this.chatMode}),this.isMuted||(this.userUnmuted=!0);const i=t.qualityData.video,s=[];let n="auto";for(const e of i)s.push({label:e.label,toggled:e.selected,value:e.id}),!0===e.selected&&(n=e.label);const o=document.getElementsByClassName("vjs-menu-item vjs-selected");for(const e of o)e.getElementsByClassName("vjs-menu-item-text")[0].innerHTML!==n&&(e.classList.remove("vjs-selected"),e.ariaChecked="false",e.getElementsByClassName("vjs-control-text")[0].innerHTML="");this.setLevels=s,this.possibleQualityLevelsChanged.fire(s),this.extractLevelSelectionForMetrics(s),void 0===t.qualitySwitchCallback&&(0,v.bT)(`clickMenuLink:QualitySelect-${s.filter((e=>e.toggled))[0].label}`)})))}removeEventListeners(){this.isCasting||void 0===this.videoJs||(this.videoJs.off("canplay"),this.videoJs.off("canplaythrough"))}addEventListeners(){this.isCasting||void 0===this.videoJs||(this.videoJs.on("canplay",(()=>{this.play(),this.isStreamReconnecting&&this.removeReconnecting()})),this.videoJs.on("canplaythrough",(()=>{this.play()})))}removeTech(){this.isCasting||void 0===this.tech||(this.tech.off("loadedqualitydataTS"),void 0!==this.tech.hlsProvider&&this.tech.hlsProvider.dispose(),this.tech.reset(),this.tech=void 0)}setQualityLevel(e){void 0!==this.videoJs&&this.videoJs.selectQualityButton(e)}handleNeverPlayed(){super.handleNeverPlayed(),this.requestControlVisibility.fire(!0),this.neverPlayed=!0}showNativeControls(){super.showNativeControls(),void 0!==this.videoJs&&this.videoJs.controls(!0)}lockShowingControls(){void 0!==this.videoJs&&(this.showNativeControls(),this.videoJs.controlBar.lockShowing())}unlockShowingControls(){void 0!==this.videoJs&&this.videoJs.controlBar.unlockShowing()}showCustomControls(){super.showCustomControls(),this.hideNativeControls()}hideNativeControls(){void 0!==this.videoJs&&this.videoJs.controls(!1)}repositionFullscreenDropdown(){var e;(0,m.c5)()&&void 0!==this.fullscreenDropdownBtn&&(null===(e=this.fullscreenDropdownBtn.parentNode)||void 0===e||e.appendChild(this.fullscreenDropdownBtn))}enterFullScreenMode(){void 0!==this.videoJs&&((0,m.c5)()&&(0,g.aS)()?this.videoJs.enterFullWindow():this.videoJs.requestFullscreen(),this.showNativeControls(),this.repositionFullscreenDropdown())}exitFullScreenMode(){void 0!==this.videoJs&&(this.isFullWindow?this.videoJs.exitFullWindow():this.videoJs.exitFullscreen())}getControlBarHeight(){return 0}getVideoElement(){return this.videoElement}getVideoJs(){return this.videoJs}extractLevelSelectionForMetrics(e){for(const t of e)t.toggled&&this.videoMetrics.setQualityLevel(t.label)}setupConvivaPlayer(){void 0!==this.videoAnalytics&&void 0!==this.videoJs&&(this.videoAnalytics.setPlayer(this.videoJs,{[o().Constants.CONVIVA_MODULE]:a()}),this.videoAnalytics.setCallback((()=>{void 0!==this.videoAnalytics&&this.videoAnalytics.reportPlaybackMetric(o().Constants.Playback.BITRATE,this.currentBitrate)})))}setupLLHLSButton(){const e=A.getComponent("Button"),t=e=>{this.forceStream(e)};A.registerComponent("ModeButton",class extends e{constructor(e,t){super(e,t),this.controlText("Toggle Low Latency Mode"),!0===t.llhls?(this.addClass("vjs-llhls-enabled"),this.contentEl().textContent="LL-HLS"):this.contentEl().textContent="HLS"}buildCSSClass(){return`vjs-mode-button ${super.buildCSSClass()}`}handleClick(){this.hasClass("vjs-llhls-enabled")?(this.removeClass("vjs-llhls-enabled"),this.contentEl().textContent="HLS",t(!1)):(this.addClass("vjs-llhls-enabled"),this.contentEl().textContent="LL-HLS",t(!0))}})}addLLHLSButton(){var e;null===(e=this.videoJs)||void 0===e||null===(e=e.controlBar.getChild("modeButton"))||void 0===e||e.dispose(),void 0===this.videoJs||!this.allowLLHLS||this.shouldDisallowLLHLS()||this.disableToggle()||this.videoJs.controlBar.addChild("modeButton",{llhls:this.enableLLHLS},this.videoJs.controlBar.children().length-3)}setLLHLSConfig(){void 0!==this.hls&&(this.enableLLHLS&&this.allowLLHLS?(0,p.f)("VDPLargeBuffer")?(this.hls.config.liveSyncDuration=.8,this.hls.config.liveMaxLatencyDuration=7):(this.hls.config.liveSyncDuration=1,this.hls.config.liveMaxLatencyDuration=2):(this.hls.config.liveSyncDuration=3,this.hls.config.liveMaxLatencyDuration=7))}updateStreamToggle(){this.addLLHLSButton(),super.updateStreamToggle()}setAutoplay(e){super.setAutoplay(e),void 0!==this.videoJs&&this.videoJs.autoplay(e)}}},1021:(e,t,i)=>{"use strict";i.d(t,{GE:()=>T,_9:()=>P,nH:()=>A,YW:()=>b});var s=i(352),n=i(7063),o=i(7623),r=i(9757),a=i(9461),l=i(6784),h=i(5216),d=i(2939),c=i(8423),u=i(6440),p=i(7407),m=i(5424),g=i(2945);class v{constructor(){this.pendingMessages=[],this.qualityUpdatesKey="qualityUpdates",this.saveTimeSecondsKey="saveTimeSeconds",this.messagesKey="messages","undefined"!=typeof sessionStorage&&this.loadFromSessionStorage(),this.intervalId=window.setInterval((()=>this.sendMessages()),5e3)}addMessage(e){this.pendingMessages.push(e)}stop(){clearInterval(this.intervalId),"undefined"==typeof sessionStorage?this.sendMessages():this.saveToSessionStorage()}sendMessages(){if(this.pendingMessages.length>0){const e={[this.qualityUpdatesKey]:JSON.stringify(this.pendingMessages)};this.pendingMessages=[],(0,h.KF)("api/ts/chat/send-player-quality/",e)}}saveToSessionStorage(){this.pendingMessages.length>0&&(sessionStorage.setItem(this.qualityUpdatesKey,JSON.stringify({[this.saveTimeSecondsKey]:(new Date).getTime()/1e3,[this.messagesKey]:this.pendingMessages})),this.pendingMessages=[])}loadFromSessionStorage(){const e=sessionStorage.getItem(this.qualityUpdatesKey);if(sessionStorage.removeItem(this.qualityUpdatesKey),null==e)this.pendingMessages=[];else{const t=JSON.parse(e);(new Date).getTime()/1e3-t[this.saveTimeSecondsKey]<=60&&(this.pendingMessages=t[this.messagesKey])}}sendImmediate(e){this.pendingMessages.push(e),this.sendMessages()}}var f=i(3049);const y=window.Hls;function b(){w(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=x.getInstance().browserId;if(void 0!==t){if("a"!==t.charAt(t.length-1)&&!1===a.Bm.current.sample_metrics_off)return;if("playerError"===e.eventName&&!0===e.stopped)return;if(!0===e.badFrames){const t={};for(const i in e)t[`attributes.${i}`]=e[i];(0,h.KF)("api/ts/chat/send-quality/",t)}else(0,p.bT)("VideoMetric",e,!0)}}function C(){return(new Date).getTime()}function S(){return(0,o.vM)()?window.performance.now():C()}class x{constructor(){const e=window.browserId;if(void 0!==e)return void(this.browserId=e);let t=a.Aw.getState();""===t.room&&window.initialRoomDossier&&(t=(0,m.Ec)(new n.N6(window.initialRoomDossier))),this.browserId=t.browserId,(0,p.RN)(t.room)}get value(){return void 0===this.__value&&(this.__value=this.generate()),this.__value}clear(){this.__value=void 0}generate(){return`${this.browserId}:${C()}`}static getInstance(){return void 0===x.instance&&(x.instance=new x),x.instance}}class T{constructor(){(0,o.vM)()&&(this.start=S())}send(e,t,i){if((0,o.vM)()&&void 0!==this.start){const s=S()-this.start-t,n=this.start=S(),o={eventName:"autoPlayDuration",autoPlayDuration:n/1e3,autoPlayDurationMS:n,autoPlayDurationNoDelay:s/1e3,autoPlayDurationNoDelayMS:s,autoPlayable:e};0!==t&&(o.autoPlayHiddenDelay=t/1e3,o.autoPlayHiddenDelayMS=t),null!=i&&(o.autoPlayError=JSON.stringify(i)),w(o)}}}class A{constructor(e){var t=this;this.windowUnloadSent=!1,this.roomListening=!1,this.roomDuration=0,this.roomsVisited=0,this.listeners=new c.gt,this.nonPlayingTime=0,this.timeBetweenUpdates=0,this.hiddenTime=0,this.qualityTracker=0,this.viewerRegion="",this.sendMetric=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e={playerType:t.playerName,roomDuration:t.roomDuration,roomsVisited:t.roomsVisited,roomStatus:t.roomStatus,videoSessionID:x.getInstance().value,region:t.viewerRegion,isiPad:(0,o.J0)(),hidden:document.hidden,...e},void 0!==t.quality&&(e={fpsquality:t.quality.quality,rate:t.quality.rate,stopped:t.quality.stopped,...e}),delete e.tid,1===e.unload&&t.sendBackendMetric(e),w(e)},this.sendPlayerCreatedMetric=()=>{const e={eventName:"playerCreated"},t=(0,g.JO)(window.location.search).player;void 0!==t&&(e.playerOverride=t),this.sendMetric(e),this.createdTime=S(),this.playbackStopped()},this.onRoomLoaded=e=>{this.roomLoadedTime=S(),x.getInstance().browserId=e.dossier.browserId,this.roomName=e.dossier.room},this.onRoomUnloaded=()=>{this.windowUnloadSent||(this.sendUnloadMetrics(),x.getInstance().clear())},this.onWindowUnloaded=()=>{this.windowUnloadSent||(this.sendUnloadMetrics(),void 0!==this.qualityNotifier&&this.qualityNotifier.stop(),this.windowUnloadSent=!0,this.removeListeners())},this.playbackStopped=()=>{void 0!==this.playingStoppedTime||document.hidden||(this.playingStoppedTime=S())},this.playbackStarted=()=>{void 0!==this.playingStoppedTime&&(this.nonPlayingTime+=S()-this.playingStoppedTime,this.playingStoppedTime=void 0)},this.parseQualityUpdate=()=>{const e=a.Aw.getState();if(this.viewerRegion=e.edgeRegion,void 0!==e.quality){if(void 0!==this.quality&&e.quality.quality!==this.quality.quality){const t=S();switch(void 0!==this.qualityChange&&void 0!==this.broadcastQuality&&(this.qualityTracker+=this.broadcastQuality*(t-this.qualityChange)),e.quality.quality){case"bad":this.broadcastQuality=-1;break;case"okay":this.broadcastQuality=0;break;default:this.broadcastQuality=1}this.qualityChange=t}this.quality=e.quality}},((0,u.f)("VDPEnblBEQualNR")||void 0!==(0,g.JO)(window.location.search).quality)&&(this.qualityNotifier=new v),this.playerName=e,this.sendPlayerCreatedMetric()}bindAll(){this.removeListeners(),d.X0.listen(this.onRoomLoaded).addTo(this.listeners),d.Gr.listen(this.onRoomUnloaded).addTo(this.listeners),a.Aw.onUpdate.listen(this.parseQualityUpdate).addTo(this.listeners),(0,l.wu)("pagehide",window,this.onWindowUnloaded),(0,l.wu)("beforeunload",window,this.onWindowUnloaded),(0,l.wu)("unload",window,this.onWindowUnloaded),this.roomListening=!0}static jpegFallback(){w({eventName:"jpegFallback",hlsNativeSupported:(0,o.rm)(),hlsJsSupported:y.isSupported()})}sendBackendMetric(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0!==this.qualityNotifier){(0,p.Rs)(e);const t=(0,p.Ht)(e,!0);this.qualityNotifier.sendImmediate(t)}}sendUnloadMetrics(){if(void 0===this.roomLoadedTime||!(0,o.vM)())return;this.roomUnloadedTime=S();const e=this.roomUnloadedTime-this.roomLoadedTime;return this.sendMetric({room_user:this.roomName,eventName:"viewerDuration",viewerDuration:e/1e3,viewerDurationMS:e}),e}removeListeners(){this.roomListening&&((0,l.Pf)("pagehide",window,this.onWindowUnloaded),(0,l.Pf)("beforeunload",window,this.onWindowUnloaded),(0,l.Pf)("unload",window,this.onWindowUnloaded),this.listeners.removeAll(),this.roomListening=!1)}playerForceRemoved(){this.onWindowUnloaded()}getSessionID(){return x.getInstance().value}}class P extends A{constructor(e){var t;super(e),t=this,this.htmlMediaListening=!1,this.htmlMediaPlayingSent=!1,this.htmlMediaPlayingIsAjax=!1,this.hlsJsListening=!1,this.lastError={},this.averagePDTLatencyTotal=0,this.averagePDTLatencySamplesCount=0,this.averageE2ELatencyTotal=0,this.averageE2ELatencySamplesCount=0,this.avShiftSamplesCount=0,this.avShiftTotal=0,this.overlayValues={fps:"unknown",bitrate:0,latency:"unknown ",framesLost:"0.00",resolution:"unknown",streamType:"unknown",avShift:"unknown",startTime:0},this.initialTypeSent=!1,this.resolutionTracker=0,this.host="",this.edge="",this.playlistResource="",this.startTime=0,this.visibilityChange=()=>{document.hidden?(this.tabHidden=S(),this.parseTimeUpdate()):void 0!==this.tabHidden&&(this.hiddenTime+=S()-this.tabHidden,this.tabHidden=void 0)},this.sendHTMLMediaPlayingMetric=()=>{if(this.htmlMediaPlayingSent)return;const e={eventName:"videoPlaying",isAjax:!1,bitrate:this.hlsCurrentBitrate},t=this.currentProgramDateTime();void 0!==t&&this.sendHLSMetric({eventName:"broadcastDelay",broadcastDelayMS:t,broadcastDelay:t/1e3});const i=S();if(void 0===this.htmlMediaLoadStartTime)warn("Playing metric has triggered but htmlMediaLoadStartTime is undefined...skipping");else{const t=i-this.htmlMediaLoadStartTime;e.timeSinceMediaLoadStart=t/1e3,e.timeSinceMediaLoadStartMS=t}if(void 0!==this.hlsMediaAttachingTime){const t=i-this.hlsMediaAttachingTime;e.timeSinceMediaAttaching=t/1e3,e.timeSinceMediaAttachingMS=t}if(this.htmlMediaPlayingIsAjax){if(void 0===this.roomLoadedTime)return void warn("Playing metric is for AJAX reload but roomLoadedTime is undefined...skipping");let t=i-this.roomLoadedTime;e.timeSinceLoadAjax=t/1e3,e.timeSinceLoadAjaxMS=t,e.isAjax=!0,void 0===this.roomUnloadedTime?warn("Playing metric is for AJAX reload but roomUnloadedTime is undefined"):(t=i-this.roomUnloadedTime,e.timeSinceUnloadAjax=t/1e3,e.timeSinceUnloadAjaxMS=t)}else{const t=i-this.createdTime;e.timeSincePlayerCreated=t/1e3,e.timeSincePlayerCreatedMS=t}this.sendHLSMetric(e),this.htmlMediaPlayingSent=!0,this.htmlMediaPlayingIsAjax=!0},this.sendHTMLMediaErrorMetric=()=>{let e,t;this.playerElement instanceof HTMLMediaElement?(e=this.playerElement.error,t=this.playerElement):(e=this.playerElement.error_,t=this.playerElement.tech().el()),null!=e&&this.sendHLSMetric({eventName:"playerError",errorCode:e.code,errorMessage:e.message,errorSource:"HTMLMediaElement",errorReadyState:t.readyState,errorNetworkState:t.networkState,bitrate:this.hlsCurrentBitrate})},this.onHTMLMediaEvent=e=>{if(this.htmlMediaListening){if("playing"===e.type)return this.playbackStarted(),this.sendHTMLMediaPlayingMetric(),void this.setResolution(void 0);if("loadstart"!==e.type)if("error"!==e.type)if("stalled"!==e.type)warn("Received unknown HTMLMediaElement event: ",e);else{this.playbackStopped();const t=e.target;if(null!=t){const e={eventName:"playerStalled",stalledReadyState:t.readyState,stalledNetworkState:t.networkState,bitrate:this.hlsCurrentBitrate};this.sendHLSMetric(e)}}else this.sendHTMLMediaErrorMetric();else this.htmlMediaLoadStartTime=S()}},this.bindAllHlsJs=e=>{this.removeHLSListeners(),this.hls=e,this.hls.on(y.Events.ERROR,this.onHlsJsEvent),this.hls.on(y.Events.FRAG_CHANGED,this.onHlsJsEvent),this.hls.on(y.Events.FRAG_PARSED,this.onHlsJsEvent),(0,o.vM)()&&(this.hls.on(y.Events.LEVEL_SWITCHING,this.onHlsJsEvent),this.hls.on(y.Events.LEVEL_SWITCHED,this.onHlsJsEvent),this.hls.on(y.Events.MEDIA_ATTACHING,this.onHlsJsEvent)),this.hlsJsListening=!0},this.addHlsJsLevel=e=>{const t=e.level;if(void 0!==t){for(const t of["bitrate","height","width"]){var i;if(isNaN(e[t]))return void warn(`Level ${t} is not a number: ${null===(i=e[t])||void 0===i?void 0:i.toString()}...skipping`)}this.hlsJsLevels.set(t,e),this.hlsJsSwitchingTimes.unshift({level:t,ts:S()})}else warn("Received HlsObj.Events.LEVEL_SWITCHING without a level: ",e)},this.setMaxHlsLevel=e=>{if(void 0===e.level)return void warn("Received Hls.Events.LEVEL_SWITCHED without a level: ",e);const t=this.hlsJsLevels.get(e.level);if(void 0!==t){for(const t of this.hlsJsSwitchingTimes)if(t.level===e.level){const e=(i=t.ts,S()-i);this.hlsJsSwitchedTimes.push(e);break}var i;this.adjustAverageHeight(t.height),(void 0===this.hlsJsMaxLevel||t.bitrate>this.hlsJsMaxLevel.bitrate)&&(this.hlsJsMaxLevel=t),this.hlsCurrentBitrate=t.bitrate,this.overlayValues={...this.overlayValues,bitrate:t.bitrate/1e3,resolution:`${t.height}x${t.width}`}}else warn("Received unknown Hls.Events.LEVEL_SWITCHED level: ",e)},this.adjustAverageHeight=e=>{const t=S();if(void 0!==this.currentHeight&&void 0!==this.resolutionSwitched){const e=t-this.resolutionSwitched;this.resolutionTracker+=e*this.currentHeight}this.resolutionSwitched=t,this.currentHeight=e},this.getCurrentPlayerTime=()=>this.playerElement instanceof HTMLMediaElement?this.playerElement.currentTime:this.playerElement.currentTime(),this.getPlayerOffsetFromSegmentStart=()=>{if(void 0===this.hlsLastFrag)return;const e=this.getCurrentPlayerTime();if(void 0===e)return;const t=e-this.hlsLastFrag.start;return t<0?void 0:1e3*t},this.getLastFragmentTimecode=()=>{if(void 0===this.hlsLastFrag)return;const e=this.hlsLastFrag.sn;return this.hlsFragIndexToFirstTimecode.has(e)?this.hlsFragIndexToFirstTimecode.get(e):void 0},this.getStreamingMode=()=>{if(void 0!==this.extXPartInChunklist){if(this.extXPartInChunklist){if(void 0===this.chunkDownloaded)return;return this.chunkDownloaded?"ll-hls":"fallback hls"}return"hls"}},this.getEndToEndLatency=()=>{var e,t;const i=this.getPlayerOffsetFromSegmentStart();if(void 0===i)return;const s=this.getLastFragmentTimecode();if(void 0===s)return;let n;if(void 0!==(null===(e=a.Aw.getState().latency)||void 0===e?void 0:e.localTimeTranscoderInput)&&void 0!==(null===(t=a.Aw.getState().latency)||void 0===t?void 0:t.streamTimeTranscoderInput)){var o,r,l,h;const e=(null!==(o=null===(r=a.Aw.getState().latency)||void 0===r?void 0:r.localTimeTranscoderInput)&&void 0!==o?o:0)-(null!==(l=null===(h=a.Aw.getState().latency)||void 0===h?void 0:h.streamTimeTranscoderInput)&&void 0!==l?l:0);if(n=C()-e-i-s,n<0||n>3e4)return}return n},this.currentProgramDateTime=()=>{if(void 0===this.hlsLastFrag)return;let e;if(e=this.playerElement instanceof HTMLMediaElement?this.playerElement.currentTime:this.playerElement.currentTime(),void 0===e)return;let t=e-this.hlsLastFrag.start;if(t<0)return;if(t*=1e3,null===this.hlsLastFrag.programDateTime)return;const i=C()-this.hlsLastFrag.programDateTime-t;return i<0||i>3e5?void 0:i},this.updateLatencyMetrics=()=>{const e=this.currentProgramDateTime();void 0!==e&&((void 0===this.maxPDTLatency||e>this.maxPDTLatency)&&(this.maxPDTLatency=e),this.averagePDTLatencyTotal+=e,this.averagePDTLatencySamplesCount+=1,this.averagePDTLatency=this.averagePDTLatencyTotal/this.averagePDTLatencySamplesCount);const t=this.getEndToEndLatency();void 0!==t&&((void 0===this.maxE2ELatency||t>this.maxE2ELatency)&&(this.maxE2ELatency=t),this.averageE2ELatencyTotal+=t,this.averageE2ELatencySamplesCount+=1,this.averageE2ELatency=this.averageE2ELatencyTotal/this.averageE2ELatencySamplesCount)},this.calculateAvShift=(e,t,i)=>{let s;if(i){const i=this.videoSegmentsPlaytime.find((t=>t.segmentIndex===e));void 0!==i?(s=t-i.playTime,this.videoSegmentsPlaytime=this.videoSegmentsPlaytime.filter((t=>t.segmentIndex<=e)),this.audioSegmentsPlaytime=this.audioSegmentsPlaytime.filter((t=>t.segmentIndex<=e))):this.audioSegmentsPlaytime.push({segmentIndex:e,playTime:t})}else{const i=this.audioSegmentsPlaytime.find((t=>t.segmentIndex===e));void 0!==i?(s=i.playTime-t,this.videoSegmentsPlaytime=this.videoSegmentsPlaytime.filter((t=>t.SegmentIndex<=e)),this.audioSegmentsPlaytime=this.audioSegmentsPlaytime.filter((t=>t.SegmentIndex<=e))):this.videoSegmentsPlaytime.push({segmentIndex:e,playTime:t})}void 0!==s&&(this.avShift=s,(void 0===this.maxAbsAvShift||Math.abs(s)>this.maxAbsAvShift)&&(this.maxAbsAvShift=Math.abs(s)),this.avShiftTotal+=Math.abs(s),this.avShiftSamplesCount+=1,this.averageAvShift=this.avShiftTotal/this.avShiftSamplesCount)},this.handleParsedFragment=e=>{if(void 0!==e.part&&null!==e.part){const t=String(e.part.relurl);t.endsWith(".0_m3u8.cmfa")?this.calculateAvShift(e.frag.sn,e.frag.start,!0):t.endsWith(".0_m3u8.cmfv")&&this.calculateAvShift(e.frag.sn,e.frag.start,!1)}},this.handleErrorEvent=e=>{const t=this.playerElement instanceof HTMLMediaElement?this.playerElement:this.playerElement.tech().el(),i={eventName:"playerError",errorCode:e.type,errorMessage:e.details,errorSource:"hls.js",errorReadyState:t.readyState,errorNetworkState:t.networkState,bitrate:this.hlsCurrentBitrate,quality:this.hlsCurrentQualityLevel};(this.lastError!==i||void 0!==this.lastTime&&Date.now()-this.lastTime>1e3)&&(this.sendHLSMetric(i),this.lastError=i,this.lastTime=Date.now())},this.onHlsJsEvent=(e,t)=>{this.hlsJsListening&&(e!==y.Events.LEVEL_SWITCHING?e!==y.Events.LEVEL_SWITCHED?e!==y.Events.FRAG_CHANGED?e!==y.Events.FRAG_PARSED?e!==y.Events.MEDIA_ATTACHING?e!==y.Events.ERROR?warn("Received unknown Hls.Event: ",e):this.handleErrorEvent(t):this.hlsMediaAttachingTime=S():this.handleParsedFragment(t):this.hlsLastFrag=t.frag:this.setMaxHlsLevel(t):this.addHlsJsLevel(t))},this.parseTimeUpdate=()=>{const e=S();if(void 0!==this.lastTimeUpdate&&!document.hidden){const t=e-this.lastTimeUpdate;t>500&&(this.timeBetweenUpdates+=t)}document.hidden?this.lastTimeUpdate=void 0:this.lastTimeUpdate=e},this.removeHLSListeners=()=>{this.hlsJsListening&&void 0!==this.hls&&(this.hls.off(y.Events.ERROR,this.onHlsJsEvent),this.hls.off(y.Events.FRAG_CHANGED,this.onHlsJsEvent),(0,o.vM)()&&(this.hls.off(y.Events.LEVEL_SWITCHING,this.onHlsJsEvent),this.hls.off(y.Events.LEVEL_SWITCHED,this.onHlsJsEvent)),this.hlsJsListening=!1)},this.removeHTMLMediaListeners=()=>{if(!this.htmlMediaListening)return;let e;e=this.playerElement instanceof HTMLMediaElement?this.playerElement:this.playerElement.tech().el(),(0,o.vM)()&&((0,l.Pf)("playing",e,this.onHTMLMediaEvent),(0,l.Pf)("loadstart",e,this.onHTMLMediaEvent)),(0,l.Pf)("error",e,this.onHTMLMediaEvent),(0,l.Pf)("stalled",e,this.onHTMLMediaEvent),(0,l.Pf)("abort",e,this.playbackStopped),(0,l.Pf)("pause",e,this.playbackStopped),(0,l.Pf)("ended",e,this.playbackStopped),(0,l.Pf)("waiting",e,this.playbackStopped),(0,l.Pf)("seeking",e,this.playbackStopped),(0,l.Pf)("suspend",e,this.playbackStopped),(0,l.Pf)("seeked",e,this.playbackStarted),(0,l.Pf)("timeupdate",e,this.parseTimeUpdate),(0,l.Pf)("visibilitychange",document,this.visibilityChange),this.htmlMediaListening=!1},this.reset=()=>{this.htmlMediaPlayingSent=!1,this.hlsJsLevels=new Map,this.hlsFragIndexToFirstTimecode=new Map,this.audioSegmentsPlaytime=new Array,this.videoSegmentsPlaytime=new Array,this.hlsCurrentBitrate=void 0,this.hlsJsSwitchingTimes=[],this.hlsJsSwitchedTimes=[],this.hlsJsMaxLevel=void 0,this.hlsLastFrag=void 0,this.htmlMediaLoadStartTime=void 0,this.hlsMediaAttachingTime=void 0,this.roomDuration=0,this.roomsVisited=0,this.extXPartInChunklist=void 0,this.chunkDownloaded=void 0,this.avShiftSamplesCount=0,this.avShiftTotal=0,this.lastTimeUpdate=void 0,this.nonPlayingTime=0,this.timeBetweenUpdates=0,this.playingStoppedTime=void 0,this.hiddenTime=0,this.resolutionSwitched=void 0,this.resolutionTracker=0,document.hidden?this.tabHidden=S():this.tabHidden=void 0,this.createdTime=S(),this.qualityTracker=0,this.qualityChange=void 0,this.quality=void 0,this.broadcastQuality=0,this.viewerRegion="",this.averagePDTLatencyTotal=0,this.averagePDTLatencySamplesCount=0,this.startLatencySampling(),this.startTime=0},this.sendHLSMetric=function(){let e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==t.hls&&(e=t.hls.latency),t.sendMetric({averagePDTLatency:t.averagePDTLatency,maxPDTLatency:t.maxPDTLatency,hlsLatency:e,averageEndToEndLatency:t.averageE2ELatency,maxEndToEndLatency:t.maxE2ELatency,streamingMode:t.getStreamingMode(),selectedMode:t.selectedStreamType,averageAvShift:t.averageAvShift,maxAbsAvShift:t.maxAbsAvShift,host:t.host,edge:t.edge,playlistResource:t.playlistResource,...i})},this.reset(),this.listenForChunklist(),this.lastTimeUpdate=S()}startLatencySampling(){this.stopLatencySampling(),this.sampleLatency=window.setInterval((()=>{this.updateLatencyMetrics()}),2e3)}stopLatencySampling(){clearInterval(this.sampleLatency)}bindAllHTMLMedia(e,t){let i;if(this.removeHTMLMediaListeners(),this.playerElement=e,this.lastTime=Date.now(),i=this.playerElement instanceof HTMLMediaElement?this.playerElement:this.playerElement.tech().el(),(0,o.vM)()&&((0,l.wu)("playing",i,this.onHTMLMediaEvent),(0,l.wu)("loadstart",i,this.onHTMLMediaEvent)),(0,l.wu)("error",i,this.onHTMLMediaEvent),(0,l.wu)("stalled",i,this.onHTMLMediaEvent),(0,l.wu)("abort",i,this.playbackStopped),(0,l.wu)("pause",i,this.playbackStopped),(0,l.wu)("ended",i,this.playbackStopped),(0,l.wu)("waiting",i,this.playbackStopped),(0,l.wu)("seeking",i,this.playbackStopped),(0,l.wu)("suspend",i,this.playbackStopped),(0,l.wu)("seeked",i,this.playbackStarted),(0,l.wu)("timeupdate",i,this.parseTimeUpdate),(0,l.wu)("visibilitychange",document,this.visibilityChange),this.htmlMediaListening=!0,void 0!==(0,g.JO)(window.location.search).details){const e=document.createElement("div"),i=r.c.get("VideoOverlay");this.videoOverlay=new i(this.overlayValues,e),t.appendChild(e),this.setQuality(),a.Aw.onUpdate.listen((()=>{this.setQuality()})).addTo(this.listeners),window.setInterval((()=>{if(void 0!==this.videoOverlay){var e;let t=this.getEndToEndLatency();void 0===t&&(t=0);let i=this.avShift;void 0===i&&(i=0),this.overlayValues.startTime=this.startTime,this.overlayValues.streamType=null!==(e=this.getStreamingMode())&&void 0!==e?e:"unknown",this.overlayValues.latency=(t/1e3).toFixed(2),this.overlayValues.avShift=i.toFixed(2),this.videoOverlay.update(this.overlayValues)}}),2e3)}}sendStreamType(e,t){if(this.selectedStreamType=e,!this.initialTypeSent){const i={eventName:"initialStreamType",streamType:e};this.sendHLSMetric(i),this.initialTypeSent=!0,(0,f.kt)()&&(0,s.trackCustomEvent)({name:"InitialStreamType",data:{streamType:e,roomName:this.roomName,broadcasterID:a.Aw.getState().roomUid,currentSorce:t}})}}setQualityLevel(e){this.hlsCurrentQualityLevel=e}sendUnloadMetrics(){const e=super.sendUnloadMetrics();if(void 0!==e&&e>5e3){void 0!==this.hlsJsMaxLevel&&this.sendHLSMetric({room_user:this.roomName,eventName:"levelMax",levelMaxName:this.hlsJsMaxLevel.name,levelMaxBitrate:this.hlsJsMaxLevel.bitrate,levelMaxAudioCodec:this.hlsJsMaxLevel.audioCodec,levelMaxVideoCodec:this.hlsJsMaxLevel.videoCodec,levelMaxHeight:this.hlsJsMaxLevel.height,levelMaxWidth:this.hlsJsMaxLevel.width,bitrate:this.hlsCurrentBitrate});const e=this.hlsJsSwitchedTimes.reduce(((e,t)=>e+t),0)/this.hlsJsSwitchedTimes.length;isNaN(e)||this.sendHLSMetric({room_user:this.roomName,eventName:"levelSwitchAvg",levelSwitchAvg:e/1e3,levelSwitchAvgMS:e,levelSwitchCount:this.hlsJsSwitchedTimes.length})}return e}removeListeners(){super.removeListeners(),this.listeners.removeAll(),this.removeHLSListeners(),this.removeHTMLMediaListeners()}sendStartTimes(e,t,i,s,n,o,r,a){this.roomStatus=o,this.roomsVisited=r,this.roomDuration=0,this.startTime=e,void 0===this.currentHeight&&this.adjustAverageHeight(a);const l={eventName:"playerTimes",room_user:this.roomName,startTime:e/1e3,pageStartTime:t/1e3,dataLoadTime:i/1e3,metaLoadTime:s/1e3,startLoadTime:n/1e3};this.sendHLSMetric(l)}sendQuality(e,t,i,s,n,r,a,l){this.roomDuration=-1!==a?a:this.roomDuration;const h=S();let d=this.nonPlayingTime;void 0!==this.playingStoppedTime&&(d+=h-this.playingStoppedTime,this.playingStoppedTime=h),void 0!==this.tabHidden&&(this.hiddenTime+=h-this.tabHidden,this.tabHidden=h);const c=h-this.createdTime,u=c-this.hiddenTime;this.adjustAverageHeight(r),this.parseTimeUpdate(),this.parseQualityUpdate();let p={};p={eventName:"playerQuality",room_user:this.roomName,resolution:n,videoHeight:r,playingRatio:1-d/u,timeUpdateRatio:1-this.timeBetweenUpdates/u,averageHeight:Math.round(this.resolutionTracker/c),averageQuality:this.qualityTracker/c,unload:-1===a,totalTime:c/1e3,unhiddenTime:u/1e3,hiddenTime:this.hiddenTime/1e3,nonPlayingTime:this.nonPlayingTime/1e3},(0,o.OF)()||(p={...p,droppedFrames:e,totalFrames:i,segmentDropped:t,segmentFrames:s,badFrames:t>30}),this.overlayValues.framesLost=e>0?(100*e).toFixed(2):"0.00",this.sendHLSMetric(p)}setStatus(e){this.roomStatus=e}listenForChunklist(){let e=-1;const t=(e,t)=>{this.hlsFragIndexToFirstTimecode.set(e,t),this.hlsFragIndexToFirstTimecode.forEach(((t,i)=>{i{if(0!==e[t]||0!==e[t+1]||1!==e[t+2])return;const i=e[t+3],s=!!(128&e[t+7]);return i<224||i>239||!s?void 0:(((e[t+9]>>>1&7)<<30)+((e[t+10]<<7)+(e[t+11]>>>1)<<15)+((e[t+12]<<7)+(e[t+13]>>>1)))/90},s=i=>{const s=-1===e?9e4:e,n=i.responseURL.split("_");this.chunkDownloaded=n[n.length-2].includes(".");const o=n[n.length-2].split(".");if(1===o.length||2===o.length&&"0"===o[1]){let e;try{e=new Uint8Array(i.response).slice(0,2e3)}catch(e){return}let n=(e=>{for(let t=0;t{this.extXPartInChunklist=e.includes("#EXT-X-PART")},o=n=>{n.responseURL.includes("media")&&n.responseURL.endsWith("_m3u8.cmfv")?s(n):n.responseURL.includes("header")&&n.responseURL.endsWith("_m3u8.cmfv")?(t=>{const i=new Uint8Array(t.response).slice(0,2e3);for(let t=0;-1===e&&t{const s=e.responseURL.lastIndexOf("_"),n=e.responseURL.lastIndexOf("."),o=Number(e.responseURL.substring(s+1,n));let r,a;try{r=new Uint8Array(e.response).slice(0,2e3)}catch(e){}if(void 0!==r)for(let e=0;void 0===a&&188*(e+1)8186||!d||(s+=4,h&&(s+=r[s]+1),a=i(r,s),void 0!==a&&t(o,a))}})(n)},r=e=>{const t=e.target;if(t.responseURL.includes("chunklist")&&!t.responseURL.includes("_ao_")){const e=t.responseText;n(e)}else null===t.response||Boolean(t.response.detached)||o(t)},a=e=>{const t=e.target;null===t.response||Boolean(t.response.detached)||o(t)},l=XMLHttpRequest;window.XMLHttpRequest=function(){const e=new l;return e.addEventListener("load",r),e.addEventListener("progress",a),e}}setQuality(){const e=a.Aw.getState().quality;void 0!==e&&(this.overlayValues.fps=e.quality)}setResolution(e){void 0!==e?this.overlayValues.resolution=e:this.playerElement instanceof HTMLVideoElement&&(this.overlayValues.resolution=`${this.playerElement.videoHeight}x${this.playerElement.videoWidth}`)}endSession(){this.sendUnloadMetrics(),this.reset()}updateResourceInfo(e,t,i){this.host=e,this.edge=t,this.playlistResource=i}}},9815:(e,t,i)=>{"use strict";i.d(t,{q:()=>r});var s=i(9461),n=i(2939),o=i(8423);class r{constructor(){this.dontNotify=new Set,this.listenerGroup=new o.gt,this.initListeners()}initListeners(){n.Zm.listen((e=>{this.dontNotify.add(e)})).addTo(this.listenerGroup),n.Gr.listen((()=>{this.dontNotify.clear()})).addTo(this.listenerGroup)}shouldNotify(e){var t;return!this.dontNotify.has(e)&&e!==(null===(t=s.Bm.current.loggedInUser)||void 0===t?void 0:t.username)}preventNotifications(e){this.dontNotify.add(e)}dispose(){this.listenerGroup.removeAll()}}},34:(e,t,i)=>{"use strict";i.d(t,{BO:()=>k,DZ:()=>R,Lz:()=>w,S1:()=>M,UK:()=>x,lh:()=>T,sT:()=>P,vZ:()=>I,yx:()=>A});var s=i(352),n=i(7063),o=i(4801),r=i(9461),a=i(1679),l=i(213),h=i(5216),d=i(6844),c=i(8423),u=i(2690),p=i(7407),m=i(3049),g=i(1452),v=i(3456),f=i(74),y=i(4947),b=i(3860);const w=new c.c_("privateJoinInitiated");let C=!1;function S(e){null!=e&&e.onError&&(null==e||e.onError()),null!=e&&e.onFinally&&e.onFinally()}function x(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;if(r.Bm.current.isNoninteractiveUser)return(0,l.Q$)(y.R.internalStaffPrivate),void S(i);w.fire(void 0),(0,d.rC)(y.R.loginForPrivateShow)?S(i):((0,p.bT)("RequestPrivateShow"),function(e){const t=`tipping/private_show_tokens_per_minute/${e}/`;return new Promise(((e,i)=>{(0,h.Aw)(t).then((t=>{const i=new n.N6(t.responseText);e({minimumMinutes:i.getStringWithNumbers("private_show_minimum_minutes"),price:i.getNumber("price"),recordingsAllowed:i.getBoolean("recordings_allowed"),allowed:i.getBoolean("allowed",!0,!1)}),i.logUnusedDebugging("parseTokensPerMinute")})).catch((e=>{i(e)}))}))}(e.room()).then((n=>{if(C||"public"!==e.status)return;if(C=!0,!n.allowed)return(0,l.Q$)(y.R.featureNotEnabled),void(C=!1);const o=()=>{(0,m.kt)()&&(0,s.trackCustomEvent)({name:"PrivateShowRequest",data:{roomName:e.room()}}),e.requestPrivateShow(n.price,n.minimumMinutes,n.recordingsAllowed).then(null==i?void 0:i.onResolve).catch((t=>{void 0!==(null==i?void 0:i.onError)&&i.onError(),"string"==typeof t?((0,v.Sz)()&&f.ef.fire(void 0),(0,a.qr)(t,!1,r.Bm.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE)):"privatewatching"!==e.status&&((0,l.Q$)(y.R.errorRequestingPrivateShow),error("Error entering private show",t),(0,v.Sz)()&&f.ef.fire(void 0))})).finally((()=>{null!=i&&i.onFinally&&(null==i||i.onFinally()),C=!1})),(0,p.bT)("StartPrivateShow")};if((0,v.Sz)()&&"split"===b.L.getVideoMode()&&!r.Bm.current.isMobile)f.Ne.fire({requirements:n,makeRequest:o,stopRequest:()=>{C=!1},showConfirmation:t,chatConnection:e});else if(t){const t=y.R.privateShowConfirmMessage(e.room(),n.price,n.minimumMinutes,n.recordingsAllowed);(0,l.mf)(t,o,(()=>{C=!1}))}else o()})).catch(g.yZ))}function T(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;if(r.Bm.current.isNoninteractiveUser)return(0,l.Q$)(y.R.internalStaffPrivate),void S(i);w.fire(void 0),(0,d.rC)(y.R.loginForPrivateShowSpy)?S(i):((0,p.bT)("RequestSpyShow"),function(e){const t=`tipping/spy_on_private_show_tokens_per_minute/${e}/`;return new Promise(((e,i)=>{(0,h.Aw)(t).then((t=>{const s=Number(t.responseText);isNaN(s)?i(`isNaN on ${s}`):e({price:s})})).catch((e=>{i(e)}))}))}(e.room()).then((s=>{let{price:n}=s;if(0===n)return void(0,l.Q$)(y.R.privateShowSpyDisabled);if(C)return;C=!0;const o=()=>{(0,p.bT)("StartSpyShow"),e.requestSpyShow().then(null==i?void 0:i.onResolve).catch((t=>{void 0!==(null==i?void 0:i.onError)&&i.onError(),"string"==typeof t?(0,a.qr)(t,!1,r.Bm.current.PurchaseEventSources.TOKEN_SOURCE_LOW_TOKEN_BALANCE):"privatespying"!==e.status&&((0,l.Q$)(y.R.errorRequestingSpyShow),error("Error entering spy show",t))})).finally((()=>{null!=i&&i.onFinally&&(null==i||i.onFinally()),C=!1}))};t?(0,l.mf)(y.R.privateShowSpyConfirmMessage(n),o,(()=>{C=!1})):o()})).catch((e=>{"string"==typeof e&&error(e)})))}function A(e){let t=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const s=()=>{(0,p.bT)("LeavePrivateShowEarly"),e.leavePrivateOrSpyShow(!0).then(null==t?void 0:t.onResolve).catch((e=>{(0,l.Q$)(e.message)})).finally(null==t?void 0:t.onFinally)},n=()=>{(0,p.bT)("LeavePrivateOrSpyShow"),e.leavePrivateOrSpyShow(!1).then(null==t?void 0:t.onResolve).catch((e=>{void 0!==(null==t?void 0:t.onError)&&t.onError(),e.allowCancel&&void 0!==e.earlyDetails?function(e,t){const i=new o.T({component:"PrivateCancelEarlyOverlay",componentProps:{...e.earlyDetails,leaveCallback:t,closeCallback:()=>{i.element.remove(),u.$.fire(!1)}}});document.body.appendChild(i.element),u.$.fire(!0)}(e,s):(0,l.Q$)(e.message)})).finally(null==t?void 0:t.onFinally),f.ef.fire(void 0)};arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?n():(0,l.mf)(y.R.privateShowLeaveWarning,n,i)}function P(){(0,h.KF)("tipping/private_show_approve/",{foo:"bar"}).then((()=>{debug("Approved private show")})).catch(g.yZ)}function k(){(0,h.KF)("tipping/private_show_decline/",{foo:"bar"}).then((()=>{debug("Declined private show")})).catch(g.yZ)}function M(e){return new Promise(((t,i)=>{(0,h.Aw)(`tipping/private_show_context/${e}/`).then((e=>{const i=new n.N6(e.responseText);t({allowPrivateShow:!0,privatePrice:i.getNumber("tokens_per_minute"),spyPrice:i.getNumber("spy_tokens_per_minute"),privateMinMinutes:i.getNumber("private_show_minimum_minutes"),allowShowRecordings:i.getBoolean("allow_recording")})})).catch((e=>i(e)))}))}function R(e){return new Promise(((t,i)=>{(0,h.Aw)(`tipping/spy_show_context/${e}/`).then((e=>{const i=new n.N6(e.responseText);t({spyPrice:i.getNumber("spy_tokens_per_minute")})})).catch((e=>i(e)))}))}function I(){(0,h.KF)("tipping/return_from_away/",{foo:"bar"}).then((()=>{debug("Return from away")})).catch(g.yZ)}},1452:(e,t,i)=>{"use strict";function s(e){return e.map((e=>Promise.resolve(e).then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))}i.d(t,{FM:()=>r,h5:()=>o,rO:()=>s,yZ:()=>n});const n=()=>{},o=e=>{error(e)};function r(e,t){let i=!1;return()=>new Promise(((s,n)=>{if(!i)return i=!0,e().finally((()=>{i=!1})).then((e=>{s(e)})).catch((e=>{n(e)}));s(t)}))}},3004:(e,t,i)=>{"use strict";i.d(t,{De:()=>f,G6:()=>m,TI:()=>u,bP:()=>p,fT:()=>v,ii:()=>d,k6:()=>h,uy:()=>g});var s=i(6784),n=i(5216),o=i(2939),r=i(3955);const a="room",l="next",h="/accounts/register/",d="/auth/login/",c="account-redirect";function u(e){const t=new URLSearchParams(window.location.search),i=t.get(l);if(null!==i)return{nextParam:i};const s=void 0!==e.room?e.room:!0===e.ignoreExistingRoom?void 0:t.get(a);return null!=s?{roomParam:s}:[h,d].includes(window.location.pathname)||CHATURBATE_URL_PREFIX===window.location.pathname&&""===window.location.search?{}:{nextParam:p()}}function p(){return`${window.location.pathname}${window.location.search}`}function m(e,t){const i=new URL(e,window.location.origin);return i.searchParams.delete(a),i.searchParams.delete(l),void 0!==t.nextParam?i.searchParams.set(l,t.nextParam):void 0!==t.roomParam&&i.searchParams.set(a,t.roomParam),`${i.pathname}${i.search}`}function g(){let e;o.X0.listen((t=>{e=t.dossier.room})),(0,s.Xq)(["mousedown","touchstart"],window.document,(t=>{const i=(0,r.ss)(t.target);if(void 0!==i&&i.hasAttribute(c)){let t={};new URL(i.href,window.location.origin).pathname===(0,n._Y)(h)&&(t={room:e});const s=u(t);i.href=(0,n._Y)(m(i.href,s))}}))}function v(e){e.setAttribute(c,"")}function f(e,t){void 0===t&&(t=`${window.location.pathname}${window.location.search}`);const i=e.querySelector(`input[name=${l}]`);null!==i&&(i.value=t)}},2359:(e,t,i)=>{"use strict";i.d(t,{BP:()=>k,If:()=>C,P7:()=>D,e4:()=>A});var s=i(7063),n=i(9447),o=i(9461),r=i(7254),a=i(213),l=i(5216),h=i(6844),d=i(2939),c=i(1244),u=i(7463),p=i(9739),m=i(7407),g=i(1452),v=i(7569),f=i(74),y=i(4947);const b={partType:1,height:0,name:"",imgUrl:"",width:0,abuseUrl:""};let w;function C(){d.X0.listen((e=>{w={showEmoticons:e.dossier.userChatSettings.showEmoticons,ignoredEmoticons:e.dossier.ignoredEmoticons}})),(void 0===o.Bm.current.loggedInUser?(w={showEmoticons:!0,ignoredEmoticons:[]},Promise.resolve()):new Promise(((e,t)=>{(0,l.Aw)("api/ts/chat/message-render-options/").then((t=>{w=function(e){const t=new s.N6(e);return{showEmoticons:t.getBoolean("show_emoticons"),ignoredEmoticons:t.getStringList("ignored_emoticons")}}(t.responseText),e()})).catch((e=>{error(e),t(e)}))}))).finally((()=>{f.EZ.listen((e=>{void 0!==w&&(w.showEmoticons=e.showEmoticons)}))})).catch(g.yZ)}const S="%%%[",x="]%%%",T=/((^|\s)@\w+)/;function A(e){const t=document.createElement("span");return t.className="emoticonImage",M(e).forEach((e=>{switch(e.partType){case 2:case 0:const i=e.s;""!==i&&t.appendChild(E(i));break;case 1:""!==e.name?t.appendChild(I(e)):t.appendChild(E(""))}})),t}function P(e,t,i){const s=document.createElement("span");return s.className="emoticonImage",M(e.message,e.shortcodes).forEach((n=>{switch(n.partType){case 0:const d=n.s;""!==d&&s.appendChild(E(d));break;case 1:""!==n.name?s.appendChild(I(n)):s.appendChild(E(""));break;case 2:const c=n;void 0!==c.code?s.appendChild(function(e,t,i,s){const{userName:n,room:d,hasFanClub:c}=o.Aw.getState();let f,b,w;switch(e.code){case r.AJ.Fanclub:f=c?()=>{}:()=>{(0,a.Q$)(y.R.noFanClub)},b=y.R.shortcodeFanclubMessage(d),w=e.signupLink;break;case r.AJ.Supporter:f=()=>{},b=y.R.becomeSupporter,w="/supporter/upgrade/";break;case r.AJ.Follow:f=()=>{(0,u.j4)(d),void 0!==o.Bm.current.loggedInUser&&(0,l.Aw)(`follow/is_following/${d}/`).then((e=>{const t=JSON.parse(e.responseText).following,i=new p.W;!t&&o.Bm.current.isMobile&&i.showBrowserNotification()})).catch(g.yZ)},b=y.R.shortcodeFollowMessage(d),w=void 0;break;case r.AJ.Signup:f=()=>{},b=y.R.joinCB,w=e.signupLink;break;case r.AJ.Tip:f=()=>{(0,h.rC)(y.R.loginToTip)||s.fire({message:e.msg,amount:e.amt})},b=void 0!==e.msg&&null!==e.msg?e.msg:"",w=void 0;break;default:return error(`Unknown shortcode: ${e.code}`),document.createElement("div")}const C=i(b,w,f);C.title=v.fM.getShortcodeTitle(e),C.dataset.testid="shortcode-link";const S="fromUser"in t&&void 0!==t.fromUser,x={shortcode:e.code,from_user:S?t.fromUser.username:"",room:d,user_clicked:n,tip:void 0!==e.amt&&e.code===r.AJ.Tip?e.amt:0,message:t.message,from_notice:!S};return C.addEventListener("click",(()=>{(0,m.bT)("ShortcodeLinkClicked",x)})),C}(c,e,t,i)):s.appendChild(E(""))}})),s}function k(e,t,i){const s=P(e,t,i);return s.dataset.testid="shortcodeMessage",s}function M(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=[];const s=[];if(e.indexOf(S)<0&&!v.fM.hasShortcodes(e))return[L(e)];for(let o=0;o{const t={slug:e.name,url:e.imgUrl};c.pp.fire(t)},o.Bm.current.isMobile&&(e.width=.5*e.width,e.height=.5*e.height),t.height=e.height,t.width=e.width,t.style.verticalAlign="top",t}{const t=document.createElement("span");return t.dataset.testid="emoticonText",(0,n.fZ)(t,n.aG.hrefColor),(0,n.fZ)(t,"msg-link"),t.innerText=`:${e.name}`,t.style.cursor="pointer",t.onclick=()=>{const t={slug:e.name,url:e.imgUrl};c.pp.fire(t)},t}}function E(e){const t=document.createElement("span");return T.test(e)?e.split(T).forEach((e=>{const i=/^\s/.test(e);if("@"===e.trim().charAt(0)){const s=document.createElement("span");s.innerText=e.trimStart(),s.className="username-mention",i&&t.appendChild(document.createTextNode(" ")),t.appendChild(s)}else e.trim().length>0&&t.appendChild(document.createTextNode(e))})):t.innerText=e,t}function L(e){return{partType:0,s:e}}function D(e,t,i,s){return function(e,t,i){const s=P(e,t,i);return s.dataset.testid="shortcode-notice",s}({message:e.message||"",shortcodes:t},i,s)}function B(e){return null!==e.match(/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/g)||(error("Invalid emoticon URL"),!1)}function U(e){return!isNaN(parseInt(e,10))||(error("Invalid dimension argument"),!1)}},5424:(e,t,i)=>{"use strict";i.d(t,{Bc:()=>y,Ec:()=>v,OC:()=>d,QZ:()=>h,XL:()=>s,_b:()=>w,fs:()=>b,sH:()=>f,sp:()=>c});var s,n=i(7063),o=i(7321),r=i(213),a=i(5216),l=i(8255);function h(e){switch(e){case"all":return"all";case"none":return"none";default:return"smart"}}function d(e){switch(e){case"orga":return s.AllUsers;case"orgb":default:return s.ModsFansAndTokens;case"org":return s.ModsAndFans;case"none":return s.None}}function c(e){const t=e;return[0,300,-1].includes(t)?t:(error("roomDossier - invalid C2C notification limit"),300)}let u;function p(e){const t=[],i=e;if(""!==i)try{JSON.parse(i).forEach((e=>{t.push({app_name:e[0],app_location:e[1]})}))}catch(e){error(`Error parsing apps ${e.toString()}`)}return t}function m(e){const t=[];for(const i of e)t.push({idOrName:i.id,messageHtml:i.message_html});return t}function g(e){if(void 0!==e)return{quality:e.getString("quality"),rate:e.getNumber("rate"),stopped:e.getBoolean("stopped")}}function v(e){const t=e.getMap("chat_settings"),i=e.getMap("satisfaction_score"),s={host:e.getString("wschat_host"),room:e.getString("broadcaster_username"),roomUid:e.getString("room_uid"),viewerUid:e.getStringOrUndefined("viewer_uid"),roomPassword:e.getString("room_pass"),chatRules:e.getString("chat_rules"),roomTitle:e.getString("room_title"),roomStatus:(0,l.JG)(e),isSupporter:e.getBoolean("is_supporter"),needsSupporterToPm:e.getBoolean("needs_supporter_to_pm"),roomGender:e.getString("broadcaster_gender"),userName:e.getString("viewer_username"),chatUserName:e.getString("chat_username"),edgeAuth:encodeURI(e.getString("edge_auth")),viewerPassword:e.getString("chat_password"),viewerGender:e.getString("viewer_gender"),exploringHashTag:e.getString("exploring_hashtag"),sourceName:(0,o.Ys)(e.getString("source_name",!1)),hlsSource:e.getString("hls_source"),isWidescreen:e.getBoolean("is_widescreen"),appsRunning:p(e.getString("apps_running")),allowPrivateShow:e.getBoolean("allow_private_shows"),privatePrice:e.getNumber("private_show_price"),privateMinMinutes:e.getNumber("private_min_minutes"),allowShowRecordings:e.getBoolean("allow_show_recordings"),allowAnonymousTipping:e.getBoolean("allow_anonymous_tipping"),spyPrice:e.getNumber("spy_private_show_price"),privateShowId:e.getStringWithNumbers("private_show_id"),hasLowSatisfactionScore:e.getBoolean("low_satisfaction_score"),isAgeVerified:e.getBoolean("is_age_verified"),age:e.getNumberOrUndefined("age"),hiddenMessage:e.getString("hidden_message"),following:e.getBoolean("following"),followNotificationFrequency:h(e.getString("follow_notification_frequency",!1)),isModerator:e.getBoolean("is_moderator"),broadcasterIsOnNewChat:e.getBoolean("broadcaster_on_new_chat"),tokenBalance:e.getNumber("token_balance"),serverName:e.getString("server_name"),numFollowed:e.getNumber("num_followed"),numFollowedOnline:e.getNumber("num_followed_online"),hasStudio:e.getBoolean("has_studio"),isMobile:e.getBoolean("is_mobile"),ignoredEmoticons:e.getObject("ignored_emoticons"),hideSatisfactionScore:e.getBoolean("hide_satisfaction_score"),tipsInPast24Hours:e.getNumber("tips_in_past_24_hours"),lastVoteInPast24Hours:e.getNumberOrUndefined("last_vote_in_past_24_hours"),lastVoteInPast90DaysDown:e.getBoolean("last_vote_in_past_90_days_down"),dismissibleMessages:m(e.getObject("dismissible_messages")),showMobileSiteBannerLink:e.getBoolean("show_mobile_site_banner_link"),numViewers:e.getNumber("num_viewers"),isInFanClub:e.getBoolean("fan_club_is_member"),hasFanClub:e.getBoolean("performer_has_fanclub"),paidTokensFanClub:e.getBoolean("fan_club_paid_with_tokens"),satisfactionScore:{upVotes:i.getNumber("up_votes",!1),downVotes:i.getNumber("down_votes",!1),percent:i.getNumber("percent",!1)},tfaEnabled:e.getBoolean("tfa_enabled"),userChatSettings:{fontColor:t.getString("font_color"),fontFamily:t.getString("font_family"),fontSize:t.getString("font_size"),showEmoticons:t.getBoolean("show_emoticons"),emoticonAutocompleteDelay:t.getNumber("emoticon_autocomplete_delay"),highestTokenColor:t.getString("highest_token_color"),sortUsersKey:t.getString("sort_users_key"),modExpiration:t.getNumber("mod_expire"),roomEntryFor:d(t.getString("room_entry_for")),roomLeaveFor:d(t.getString("room_leave_for")),c2cNotificationLimit:c(t.getNumber("c2c_notify_limit")),silenceBroadcasters:t.getString("silence_broadcasters"),ignoredUsers:t.getString("ignored_users"),allowedChat:t.getString("allowed_chat"),tipVolume:t.getNumber("tip_volume"),collapseNotices:t.getBoolean("collapse_notices")},aspAuthUrl:e.getString("asp_auth_url"),browserId:e.getString("browser_id"),quality:g(e.getParsedSubMapOrUndefined("quality",!0)),latency:{localTimeTranscoderInput:void 0,streamTimeTranscoderInput:void 0,localTimeSegmentStart:void 0,streamTimeSegmentStart:void 0},edgeRegion:e.getString("edge_region"),userlistColor:e.getString("userlist_color"),activePassword:e.getBoolean("active_password")},n=e.getStringOrUndefined("staff_links");void 0!==n&&(s.staffInfo={staffLinks:JSON.parse(n),autoLoadAdminInfo:e.getBoolean("auto_load_admin_info"),previousUsernames:e.getStringOrUndefined("previous_usernames"),deletionAdminNotice:e.getStringOrUndefined("deletion_admin_notice")});const r=e.getParsedSubMapOrUndefined("user_colors",!0);return void 0!==r&&(s.userColors=function(e){if(void 0!==e)return{hasTokens:e.getBoolean("has_tokens"),tippedRecently:e.getBoolean("tipped_recently"),tippedAlotRecently:e.getBoolean("tipped_alot_recently"),tippedTonsRecently:e.getBoolean("tipped_tons_recently")}}(r)),e.logUnusedDebugging("getRoomDossier"),s}function f(e,t){const i=new n.N6(t);return new Promise(((e,s)=>{i.getNumber("status",!1)>=400?s(`Bad response from server: ${t}`):e(v(i))}))}function y(e){return void 0!==u&&(u.abort(),u=void 0),new Promise(((t,i)=>{const s=(0,a.vU)(`api/chatvideocontext/${e}/`);u=s[0],s[1].then((e=>{t(f(0,e.responseText))})).catch((e=>{if(404===e.xhr.status)return(0,r.Q$)("HTTP 404 - Page Not Found\n\nIt's probably just a broken link, or perhaps a cancelled broadcaster."),void e.xhr.abort();i(e)}))}))}function b(e,t){let i=!0;return"public"!==t.previousStatus&&"privaterequesting"===e.chatConnection.status&&"privaterequesting"===t.currentStatus&&(i=!1),i}function w(e,t){return y(e.chatConnection.room()).then((i=>{e.dossier=i,e.chatConnection.status=i.roomStatus,t.currentStatus=i.roomStatus}))}!function(e){e[e.AllUsers=0]="AllUsers",e[e.ModsFansAndTokens=1]="ModsFansAndTokens",e[e.ModsAndFans=2]="ModsAndFans",e[e.None=3]="None"}(s||(s={}))},5088:(e,t,i)=>{"use strict";i.d(t,{M2:()=>l,QR:()=>c});var s=i(6624),n=i(7623),o=i(1224),r=i(6784),a=i(8423);const l=(0,n.nr)()&&!(0,n.Xb)(),h=new a.c_("roomStartStreaming");let d;l&&(d=new a.c_("safariPageShow",{listenersWarningThreshold:800}),(0,r.wu)("pageshow",window,(e=>{e.persisted&&void 0!==d&&d.fire()})));class c{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.roomName=e,this.img=t,this._streaming=!1,this._imgLoaded=!1,this.lastFrameTime=0,this.fadeOutStopTime=0,this.forceNoAnimate=(0,s.isPremium)(),this.options={startStreaming:!1,loadInitialImage:!0,fadeOutTimeoutMs:2e3,streamingFadeoutTimeoutMs:0,useWideImages:!0,...i},this.STATIC_BASE_URL=`${o.m.jpegStreamUrl}${this.options.useWideImages?"riw":"ri"}/${this.roomName}.jpg`,this.ANIMATING_BASE_URL=`${o.m.jpegStreamUrl}${this.options.useWideImages?"minifwap":"minifap"}/${this.roomName}.jpg`,this.setStreamRate(),this.options.startStreaming?this.startStreaming():this.options.loadInitialImage&&this.loadImage(0).catch((e=>{warn("Error loading image",{imageSrc:e})})),void 0!==d&&d.addListener((()=>{this.safariReloadImage()}),this.img)}safariReloadImage(){this._imgLoaded||(this._stopAnimating(),this.loadImage(0).catch((e=>{warn("Error loading image",{imageSrc:e})})))}_stopAnimating(){this.stopStreaming(),this.fadeOutStopTime=0}getStreaming(){return this._streaming}getFadingOut(){return!this._streaming&&(new Date).getTime()<=this.fadeOutStopTime}getAnimating(){return!this.forceNoAnimate&&(this.getStreaming()||this.getFadingOut())}setStreaming(e){const t=0===this.options.streamingFadeoutTimeoutMs;e?this.fadeOutStopTime=t?0:(new Date).getTime()+this.options.streamingFadeoutTimeoutMs:0===this.fadeOutStopTime&&(this.fadeOutStopTime=(new Date).getTime()+this.options.fadeOutTimeoutMs),this._streaming=t&&e}setStreamRate(){const e=navigator.userAgent.match(/Puffin\/(\d)/);null!==e&&parseInt(e[1])<8?this.streamRate=1500:this.streamRate=140}loadImage(e){if(0===this.lastFrameTime&&(this.lastFrameTime=e),!(0===e||e-this.lastFrameTime>this.streamRate))return Promise.resolve();let t;return this.lastFrameTime=e,t=this.getAnimating()?`${this.ANIMATING_BASE_URL}?f=${Math.random()}`:`${this.STATIC_BASE_URL}?${Math.floor((new Date).getTime()/3e4)}`,new Promise(((e,i)=>{const s=new Image;s.onload=()=>{this.img.onload=()=>{this._imgLoaded=!0},this._imgLoaded=!1,this.img.src=s.src,e()},s.onerror=()=>{i(t)},s.src=t}))}startStreaming(){if((0,n.H9)()||this.forceNoAnimate)return;h.fire(this.roomName);const e=this.getAnimating();if(this.setStreaming(!0),e)return;const t=e=>{this.getAnimating()&&this.loadImage(e).then((()=>{requestAnimationFrame((e=>{t(e)}))})).catch((()=>{t(0)}))};t(0)}stopStreaming(){this.setStreaming(!1)}stopAnimating(){this.setStreaming(!1),this.fadeOutStopTime=0}}},9898:(e,t,i)=>{"use strict";i.d(t,{_y:()=>x,CU:()=>S,Q5:()=>C});var s=i(7623),n=i(9447),o=i(9461),r=i(1372),a=i(6784),l=i(8122),h=i(1519),d=i(2709),c=i(3955),u=i(3654),p=i(4140),m=i(1284),g=i(4926),v=i(7407),f=i(1452),y=i(1448),b=i(3860);class w extends d.u{constructor(e){super("div",e),this.userExpandedNotice=!1,this.element=this.createBaseMessageDiv(this.roomNoticeData.dataNick),void 0!==this.roomNoticeData.ts&&(this.element.dataset.ts=this.roomNoticeData.ts.toString()),this.element.style.display="flex",this.combinedNotice=this.buildCombinedNotice(),this.contentsDiv=(0,r.tT)("div",{"data-testid":"room-notice"},(0,r.tT)("div",{ref:e=>this.combinedNoticeViewport=e,style:{overflow:"hidden",flexBasis:"0",flexShrink:0,flexGrow:1},"data-testid":"room-notice-viewport"},this.combinedNotice),this.buildAdditionalContents()),this.styleContentsDiv(),this.element.appendChild(this.contentsDiv),this.postConstruction(),this.collapseEnabled()&&(this.collapseHeight().catch(f.yZ),this.element.querySelectorAll("img").forEach((e=>{(0,a.wu)("load",e,(()=>this.recalculateCollapse()))})))}initData(e){this.roomNoticeData=e.roomNoticeData,this.isChatScrolledToBottom=e.isChatScrolledToBottom,this.scrollChatToBottom=e.scrollChatToBottom,this.getChatScrollTop=e.getChatScrollTop,this.setChatScrollTop=e.setChatScrollTop,this.neverCollapse=e.neverCollapse,this.maxCollapsedHeightEm=7.1,this.maxCollapsedHeightLeewayEm=1.5,this.scrollSpeed=20,this.fullNoticeHasDisplayed=!1,this.scrollStartDebouncer=new h.a((()=>this.startAnimatedScroll()),{bounceLimitMS:1e3,debounceType:1})}recalculateCollapse(){var e;const t=!0===(null===(e=this.isChatScrolledToBottom)||void 0===e?void 0:e.call(this)),i=this.collapseEnabled()&&!this.userExpandedNotice&&this.needsCollapsing();var s;this.setCollapseStyles(i),this.updateCollapseTogglingStyles(),this.updateCollapsedScrolling(),t&&(null===(s=this.scrollChatToBottom)||void 0===s||s.call(this),window.setTimeout((()=>{var e;null===(e=this.scrollChatToBottom)||void 0===e||e.call(this)}),0))}mayCollapse(){return!0===this.roomNoticeData.isAppNotice&&!0!==this.neverCollapse}collapseEnabled(){return this.mayCollapse()&&o.Aw.getState().userChatSettings.collapseNotices}isRoomSubjectNotice(){var e,t;return null!==(e=null===(t=this.roomNoticeData.colorClass)||void 0===t?void 0:t.includes("titleChange"))&&void 0!==e&&e}styleContentsDiv(){this.contentsDiv.style.display="flex",this.contentsDiv.style.width="100%",void 0!==this.roomNoticeData.background&&(this.contentsDiv.style.background=this.roomNoticeData.background,this.contentsDiv.style.textShadow="none"),this.contentsDiv.style.fontWeight=void 0!==this.roomNoticeData.weight?this.roomNoticeData.weight:"normal",(0,n.fZ)(this.contentsDiv,"roomNotice"),"#ff3"===this.roomNoticeData.background&&(0,n.fZ)(this.contentsDiv,"isTip"),void 0!==this.roomNoticeData.colorClass&&(0,n.fZ)(this.contentsDiv,this.roomNoticeData.colorClass),this.contentsDiv.style.borderRadius="4px"}buildAdditionalContents(){if(!this.mayCollapse())return;const e={display:"none",padding:"0 0 4px 4px",cursor:"pointer"},t=(0,r.tT)("svg",{width:"1.2em",height:"1.2em",viewBox:"0 -1 14 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{backgroundColor:"rgba(201, 201, 201, 0.4)",padding:"3px",borderRadius:"50%"}},(0,r.tT)("path",{d:"M1.74355 1.29511C2.11737 0.939948 2.70361 0.938914 3.07868 1.29276L6.31378 4.34474C6.69906 4.70821 7.30094 4.70821 7.68622 4.34474L10.9213 1.29276C11.2964 0.938915 11.8826 0.939948 12.2565 1.29511V1.29511C12.6604 1.67886 12.6592 2.32304 12.254 2.70536L7.68622 7.01455C7.30094 7.37802 6.69906 7.37802 6.31378 7.01455L1.74604 2.70536C1.34078 2.32304 1.33965 1.67886 1.74355 1.29511V1.29511Z",fill:"#033E58"}),(0,r.tT)("path",{d:"M6.65689 3.98104L3.42179 0.92906C2.85358 0.393012 1.96547 0.394579 1.39916 0.932628C0.787271 1.51397 0.788992 2.48987 1.40293 3.06905L5.97067 7.37825C6.54859 7.92346 7.45141 7.92346 8.02933 7.37825L12.5971 3.06905C13.211 2.48987 13.2127 1.51397 12.6008 0.932628C12.0345 0.394579 11.1464 0.393013 10.5782 0.92906L7.34311 3.98104C7.15047 4.16278 6.84953 4.16278 6.65689 3.98104Z",stroke:"#EFEFEF","stroke-opacity":"0.25"}));t.style.cssFloat="right";const i=(0,r.tT)("svg",{width:"1.2em",height:"1.2em",viewBox:"0 1 14 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{backgroundColor:"rgba(201, 201, 201, 0.4)",padding:"3px",borderRadius:"50%"}},(0,r.tT)("path",{d:"M12.2565 7.36681C11.8826 7.72198 11.2964 7.72301 10.9213 7.36917L7.68622 4.31719C7.30094 3.95371 6.69906 3.95371 6.31378 4.31719L3.07868 7.36917C2.70361 7.72301 2.11737 7.72198 1.74355 7.36681V7.36681C1.33965 6.98307 1.34078 6.33889 1.74604 5.95657L6.31378 1.64738C6.69906 1.2839 7.30094 1.2839 7.68622 1.64738L12.254 5.95657C12.6592 6.33889 12.6604 6.98307 12.2565 7.36681V7.36681Z",fill:"#033E58"}),(0,r.tT)("path",{d:"M7.34311 4.68089L10.5782 7.73287C11.1464 8.26891 12.0345 8.26735 12.6008 7.7293C13.2127 7.14795 13.211 6.17206 12.5971 5.59287L8.02933 1.28368C7.45141 0.738468 6.54859 0.738468 5.97067 1.28368L1.40293 5.59287C0.788992 6.17206 0.787271 7.14795 1.39916 7.7293C1.96547 8.26735 2.85358 8.26891 3.42179 7.73287L6.65689 4.68089C6.84953 4.49915 7.15047 4.49915 7.34311 4.68089Z",stroke:"#EFEFEF","stroke-opacity":"0.25"}));return i.style.cssFloat="right",this.expandArrowDiv=(0,r.tT)("div",{style:e,onClick:()=>this.userToggleCollapse()},(0,r.tT)("div",{style:{overflow:"hidden"}},t)),this.collapseArrowDiv=(0,r.tT)("div",{style:e,onClick:()=>this.userToggleCollapse()},(0,r.tT)("div",{style:{overflow:"hidden"}},i)),this.emHeightDummyDiv=(0,r.tT)("div",{style:{position:"absolute",opacity:"0",height:"1em"}}),(0,r.tT)("div",{style:{WebkitAlignSelf:"flex-end",flexGrow:0,flexShrink:1,overflow:"hidden"}},this.expandArrowDiv,this.collapseArrowDiv,this.emHeightDummyDiv)}postConstruction(){(0,s.AD)()||twemoji.parse(this.element,{className:"emojiChat"}),(0,a.wu)("click",this.contentsDiv,(e=>{this.isClickableSubcomponent(e.target)||this.isCollapseTogglable()&&this.isCollapsed()&&this.userToggleCollapse()})),(0,a.wu)("animationend",this.combinedNotice,(e=>{"slide"===e.animationName&&this.inActiveVideoMode()&&(this.fullNoticeHasDisplayed=!0)}))}userToggleCollapse(){(0,v.bT)("NoticeToggled",{action:this.isCollapsed()?"expanding":"collapsing"}),this.isCollapsed()?(this.userExpandedNotice=!0,this.expandHeight()):(this.userExpandedNotice=!1,this.collapseHeight(!0).catch(f.yZ))}getEmPx(){if(void 0===this.emHeightDummyDiv)return error("SplitRoomNotice getting emHeight with no em div"),w.fallbackEmHeight;const e=this.emHeightDummyDiv.getBoundingClientRect().height;return 0===e?w.fallbackEmHeight:(w.fallbackEmHeight=e,e)}getCollapsedHeightPx(){return this.maxCollapsedHeightEm*this.getEmPx()+4}needsCollapsing(){return this.combinedNotice.scrollHeight>(this.maxCollapsedHeightEm+this.maxCollapsedHeightLeewayEm)*this.getEmPx()}isCollapseTogglable(){return this.collapseEnabled()&&this.needsCollapsing()}isCollapsed(){return this.combinedNoticeViewport.classList.contains("collapsed")}async collapseHeight(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.collapseEnabled())return;const t=!0===this.isChatScrolledToBottom();if(e){const e=this.getChatScrollTop(),t=this.contentsDiv.getBoundingClientRect().height-this.getCollapsedHeightPx();this.setChatScrollTop(e-t)}this.setCollapseStyles(!0),this.updateCollapsedScrolling(),await this.confirmCollapse(),this.updateCollapseTogglingStyles(),this.updateCollapsedScrolling(),t&&this.scrollChatToBottom()}confirmCollapse(){return new Promise((e=>{window.setTimeout((()=>{this.needsCollapsing()||this.setCollapseStyles(!1),e()}),0)}))}expandHeight(){var e,t,i;const s=!0===(null===(e=this.isChatScrolledToBottom)||void 0===e?void 0:e.call(this)),n=null!==(t=null===(i=this.getChatScrollTop)||void 0===i?void 0:i.call(this))&&void 0!==t?t:0;if(this.setCollapseStyles(!1),this.updateCollapseTogglingStyles(),this.updateCollapsedScrolling(),s){var o;null===(o=this.scrollChatToBottom)||void 0===o||o.call(this),window.setTimeout((()=>{var e;null===(e=this.scrollChatToBottom)||void 0===e||e.call(this)}),0)}else{var r;const e=this.contentsDiv.getBoundingClientRect().height-this.getCollapsedHeightPx();null===(r=this.setChatScrollTop)||void 0===r||r.call(this,n+e)}}updateCollapseTogglingStyles(){void 0!==this.collapseArrowDiv&&void 0!==this.expandArrowDiv?(this.collapseArrowDiv.style.display="none",this.expandArrowDiv.style.display="none",this.contentsDiv.style.cursor="",this.isCollapseTogglable()&&(this.isCollapsed()?(this.expandArrowDiv.style.display="",this.contentsDiv.style.cursor="pointer"):this.collapseArrowDiv.style.display="")):error("SplitRoomNotice setting toggling styles with no arrows")}setCollapseStyles(e){e?(this.combinedNoticeViewport.style.maxHeight=`${this.maxCollapsedHeightEm}em`,this.combinedNoticeViewport.classList.add("collapsed")):(this.combinedNoticeViewport.style.maxHeight="999999999px",this.combinedNoticeViewport.classList.remove("collapsed"),this.inActiveVideoMode()&&(this.fullNoticeHasDisplayed=!0))}updateCollapsedScrolling(){this.isCollapsed()?this.fullNoticeHasDisplayed?this.setScrollToEnd():(this.removeAnimatedScroll(),this.scrollStartDebouncer.callFunc()):this.removeAnimatedScroll()}startAnimatedScroll(){if(!this.isCollapsed())return;const e=this.combinedNoticeViewport.getBoundingClientRect().height,t=(this.combinedNotice.getBoundingClientRect().height-e)/this.scrollSpeed;this.combinedNotice.style.setProperty("--scroll-time-s",`${t}`),this.combinedNotice.style.setProperty("--notice-viewport-height-px",`${e}`),this.removeAnimatedScroll(),(0,c.aN)(),this.combinedNotice.classList.add("animated-scroll")}removeAnimatedScroll(){this.combinedNotice.classList.remove("animated-scroll")}setScrollToEnd(){this.removeAnimatedScroll();const e=this.combinedNoticeViewport.getBoundingClientRect().height;this.combinedNotice.style.setProperty("--notice-viewport-height-px",`${e}`),this.combinedNotice.classList.add("scroll-to-end")}isClickableSubcomponent(e){if(e instanceof Element){const t=(e instanceof HTMLElement||e instanceof SVGElement)&&null!==e.onclick,i=e.closest("*[data-listener-count-click]")!==this.contentsDiv,s=null!==e.closest("a");if(t||i||s)return!0}return!1}}w.fallbackEmHeight=12;class C extends w{createBaseMessageDiv(e){const t=(0,y.mh)(e);return t.style.width=`calc(100% + ${y.QT}px)`,t}styleContentsDiv(){super.styleContentsDiv(),void 0!==this.roomNoticeData.background&&(this.contentsDiv.style.marginTop="1px","#ff8b45"===this.roomNoticeData.background&&(0,n.fZ)(this.contentsDiv,"bright-background")),this.contentsDiv.style.position="relative",this.contentsDiv.style.left=`-${y.QT}px`,this.contentsDiv.style.color=void 0!==this.roomNoticeData.foreground?this.roomNoticeData.foreground:"",this.contentsDiv.style.padding=`2px ${y.QT}px`}buildCombinedNotice(){const e=document.createElement("div");return(0,y.U$)(e,this.roomNoticeData.messages,this.roomNoticeData.shortcodes),e}postConstruction(){super.postConstruction(),(0,y.F1)(this.element,this.contentsDiv,l.sY.parseNotice(this.roomNoticeData)),(0,u.Qp)(this.element),(0,l.at)(this.element,document.body.classList.contains("darkmode"))}inActiveVideoMode(){return"split"===b.L.getVideoMode()}}class S extends w{createBaseMessageDiv(e){const t=(0,u.mh)(e);return t.style.padding="1px 5px",t}styleContentsDiv(){super.styleContentsDiv(),void 0!==this.roomNoticeData.background&&(this.contentsDiv.style.color="#000000"),void 0!==this.roomNoticeData.foreground&&(this.contentsDiv.style.color=this.roomNoticeData.foreground),this.contentsDiv.style.padding=`2px ${u.xm}px`}buildCombinedNotice(){const e=document.createElement("div");return(0,u.U$)(e,this.roomNoticeData.messages,this.roomNoticeData.shortcodes),e}postConstruction(){super.postConstruction(),(0,l.hd)(this.element,this.roomNoticeData.foreground,this.roomNoticeData.background),(0,u.Qp)(this.element)}inActiveVideoMode(){return"split"!==b.L.getVideoMode()}}class x extends w{createBaseMessageDiv(e){return(0,m.mh)(e)}styleContentsDiv(){if(super.styleContentsDiv(),void 0===this.roomNoticeData.background){const e=(0,m.Uq)(void 0!==this.roomNoticeData.foreground?this.roomNoticeData.foreground:"#aaaaaa");(0,p.yX)(this.contentsDiv,e)}this.contentsDiv.style.padding=`2px ${g.Fr}px`,this.contentsDiv.style.color=void 0!==this.roomNoticeData.foreground?this.roomNoticeData.foreground:"#000000"}buildCombinedNotice(){const e=document.createElement("div");return(0,g.U$)(e,this.roomNoticeData.messages,this.roomNoticeData.shortcodes),e}postConstruction(){super.postConstruction(),(0,g.St)(this.element)}inActiveVideoMode(){return!0}}},2434:(e,t,i)=>{"use strict";i.d(t,{z:()=>l});var s=i(1519),n=i(8423),o=i(74),r=i(1372),a=i(3860);class l{constructor(e){this.props=e,this.heightRestrictedNotices=[],this.listenerGroup=new n.gt,this.onNoticeResizeObserved=()=>{document.body.contains(this.resizeSentinel)&&this.recalculateHeightRestrictionsDebouncer.callFunc()},this.recalculateNoticeHeightRestrictions=()=>{this.heightRestrictedNotices=this.heightRestrictedNotices.filter((e=>document.body.contains(e.element)));for(const e of this.heightRestrictedNotices)e.recalculateCollapse()},this.resizeSentinel=(0,r.tT)("div",{className:"notice_resize_sentinel",style:{height:"0",overflow:"hidden",opacity:"0"}},"my long string".repeat(100)),e.appendSentinelDiv(this.resizeSentinel),this.recalculateHeightRestrictionsDebouncer=new s.a(this.recalculateNoticeHeightRestrictions,{debounceType:1,bounceLimitMS:20}),void 0!==window.ResizeObserver&&(this.noticeResizeObserver=new ResizeObserver(this.onNoticeResizeObserved),this.noticeResizeObserver.observe(this.resizeSentinel)),this.subjectChangeDebouncer=new s.a((()=>{void 0!==this.latestSubjectChangeNotice&&(this.appendNotice(this.latestSubjectChangeNotice),this.latestSubjectChangeNotice=void 0)}),{debounceType:2,bounceLimitMS:1e4}),o.EZ.listen(this.recalculateNoticeHeightRestrictions).addTo(this.listenerGroup),a.L.changeVideoMode.listen((()=>this.recalculateHeightRestrictionsDebouncer.callFunc())).addTo(this.listenerGroup)}addRoomNotice(e){e.isRoomSubjectNotice()?this.addRoomSubjectNotice(e):this.appendNotice(e)}onRoomCleanup(){this.heightRestrictedNotices=[]}dispose(){var e;this.listenerGroup.removeAll(),null===(e=this.noticeResizeObserver)||void 0===e||e.disconnect(),this.resizeSentinel.remove()}addRoomSubjectNotice(e){this.latestSubjectChangeNotice=e,this.subjectChangeDebouncer.callFunc()}appendNotice(e){this.props.appendNotice(e),e.mayCollapse()&&this.heightRestrictedNotices.unshift(e)}}},8255:(e,t,i)=>{"use strict";function s(e){return n(e.getString("room_status"))}function n(e){switch(e){case"away":return"away";case"private":return"privatenotwatching";case"private_watching":return"privatewatching";case"private_spying":return"privatespying";case"private_requesting":return"privaterequesting";case"public":return"public";case"hidden":return"hidden";case"hidden_watching":return"hiddenwatching";case"offline":return"offline";case"password protected":return"passwordprotected";default:return error(`unknown room status -- ${e}`),"unknown"}}function o(e){return["public","privaterequesting","privatewatching","privatespying","hiddenwatching"].includes(e)}i.d(t,{JG:()=>s,PZ:()=>n,x_:()=>o})},2609:(e,t,i)=>{"use strict";i.d(t,{k:()=>p});var s=i(9461),n=i(2939),o=i(2709),r=i(8423),a=i(1779),l=i(4580),h=i(34),d=i(4947),c=i(4110);function u(e,t){const i=document.createElement("div");return i.innerText=e,i.style.color="#72C0FF",i.style.cursor="pointer",i.style.paddingTop="5px",i.onmouseenter=()=>{i.style.textDecoration="underline"},i.onmouseleave=()=>{i.style.textDecoration="none"},i.style.pointerEvents="auto",i.onclick=e=>{t(e)},i}class p extends o.u{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];super(),this.positionFixed=e,this.moreRoomsLink=u(d.R.moreRoomsText,(e=>{c.nw.fire(void 0),e.stopPropagation()})),this.showTextHandlers=new Map,this.joinShowLink=u("",(()=>{})),this.shouldShowMoreRoomsLink=!0,this.hiddenMessage="",this.connectingStatusText=d.R.connecting,this.isConnecting=!1,this.displayChanged=new r.c_("displayChanged"),this.userInRoom=!1,this.element.style.display="none",this.element.style.position=this.positionFixed?"fixed":"absolute",this.element.style.height="auto",this.element.style.width="auto",this.element.style.boxSizing="border-box",this.element.style.padding="0 50px",this.element.style.left="0",this.element.style.textAlign="center",this.element.style.pointerEvents="none",this.element.style.zIndex="1",this.header=document.createElement("div"),this.header.style.fontSize="32px",this.header.style.lineHeight="32px",this.header.style.color="#72c0ff",this.header.style.marginBottom="20px",this.element.appendChild(this.header),this.body=document.createElement("div"),this.body.style.fontSize="16px",this.body.style.color="#ffffff",this.text=document.createElement("span"),this.body.appendChild(this.text),this.moreRoomsLink.style.display="none",this.body.appendChild(this.moreRoomsLink),this.joinShowLink.style.display="none",this.body.appendChild(this.joinShowLink),this.spyDisabledText=document.createElement("span"),this.spyDisabledText.innerText=d.R.privateShowSpyDisabled,this.spyDisabledText.style.display="none",this.spyDisabledText.style.paddingTop="5px",this.body.appendChild(this.spyDisabledText),this.element.appendChild(this.body),this.showTextHandlers.set("away",(e=>{this.header.innerText=d.R.performerIsAway,this.text.innerText=d.R.roomAwayMessage,this.joinShowLink.style.display="none",this.spyDisabledText.style.display="none",this.updateMoreRoomsLinkDisplay(!0)})),this.showTextHandlers.set("privatenotwatching",(e=>{this.header.innerText=d.R.privateShowInProgressText,this.text.innerText=d.R.roomPrivateNotWatchingMessage,this.joinShowLink.innerText=d.R.spyOnThisPrivateShowCAPS,this.joinShowLink.style.display=this.isSpyEnabled&&this.userInRoom&&"notconnected"!==e.status?"block":"none",this.spyDisabledText.style.display=this.isSpyEnabled?"none":"block",this.joinShowLink.onclick=()=>{(0,h.lh)(e,void 0,{onResolve:()=>{s.Bm.current.isMobile&&l.qb.fire("private")}})},this.updateMoreRoomsLinkDisplay(!0)})),this.showTextHandlers.set("hidden",(e=>{this.header.innerText=d.R.camIsHidden,this.text.innerText=this.hiddenMessage,this.joinShowLink.style.display="none",this.spyDisabledText.style.display="none",this.updateMoreRoomsLinkDisplay(!1)})),this.showTextHandlers.set("offline",(e=>{this.header.innerText=d.R.offline,this.text.innerText=d.R.roomOfflineSubheader,this.joinShowLink.style.display="none",this.spyDisabledText.style.display="none",this.updateMoreRoomsLinkDisplay(!0)})),this.showTextHandlers.set("passwordprotected",(e=>{this.header.innerText=d.R.passwordRequired,this.text.innerText=d.R.roomPasswordProtectedMessage,this.joinShowLink.style.display="none",this.spyDisabledText.style.display="none",this.updateMoreRoomsLinkDisplay(!0),(0,a.aS)()&&(0,a.Eh)()}));const t=new r.gt;n.X0.listen((e=>{this.currentChatConnection=e.chatConnection,this.isSpyEnabled=e.dossier.spyPrice>0,e.chatConnection.event.statusChange.listen((t=>{this.handleStatusChange(e.chatConnection,t.currentStatus)})).addTo(t),e.chatConnection.event.hiddenMessageChange.listen((e=>{this.hiddenMessage=e})).addTo(t),e.chatConnection.event.settingsUpdate.listen((t=>{this.isSpyEnabled=t.spyPrice>0&&t.allowPrivateShow,this.joinShowLink.style.display=this.isSpyEnabled&&this.userInRoom&&"privatenotwatching"===e.chatConnection.status?"block":"none",this.spyDisabledText.style.display=this.isSpyEnabled?"none":"block"})).addTo(t),e.chatConnection.event.roomCountUpdate.listen((()=>{this.userInRoom=!0,this.joinShowLink.style.display=this.isSpyEnabled&&this.userInRoom&&"privatenotwatching"===e.chatConnection.status?"block":"none"})).addTo(t),l.Io.listen((()=>{this.handleStatusChange(e.chatConnection,e.dossier.roomStatus)})).addTo(t),this.hiddenMessage=e.dossier.hiddenMessage,this.handleStatusChange(e.chatConnection,e.dossier.roomStatus)})),n.Gr.listen((()=>{t.removeAll(),this.hiddenMessage="",this.videoOffline=!1,this.userInRoom=!1}))}hide(){this.hideElement(),this.displayChanged.fire()}show(){this.showElement(),this.displayChanged.fire()}setVideoOffline(e){this.videoOffline=e,void 0!==this.currentChatConnection&&this.handleStatusChange(this.currentChatConnection,this.currentChatConnection.status)}displaysForStatus(e){return void 0!==this.showTextHandlers.get(e)}repositionChildren(){if(void 0!==this.parent){const e=this.parent.element.getBoundingClientRect(),t=document.documentElement.clientWidth,i=document.documentElement.clientHeight;e.width<=t?(this.element.style.width=`${e.width}px`,this.positionFixed&&(this.element.style.left=`${e.left}px`)):(this.element.style.width=`${t}px`,this.element.style.left="0"),e.height<=i?"fixed"===this.parent.element.style.position?this.element.style.top=e.top+.5*e.height-.5*this.element.offsetHeight+"px":this.element.style.top=.5*e.height-.5*this.element.offsetHeight+"px":this.element.style.top=.5*i-.5*this.element.offsetHeight+"px",this.element.style.maxHeight=`${e.height}px`}}handleStatusChange(e,t){this.videoOffline&&(t="offline");const i=this.showTextHandlers.get(t);if(void 0!==i)return i(e),this.show(),void this.repositionChildrenRecursive();switch(this.isConnecting||(this.moreRoomsLink.style.display="none",this.hide()),t){case"public":case"privaterequesting":case"privatewatching":case"privatespying":case"notconnected":case"hiddenwatching":break;default:warn(`unexpected status: ${t}`)}}updateMoreRoomsLinkDisplay(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.isConnecting&&!this.videoOffline;e&&!t&&this.shouldShowMoreRoomsLink?this.moreRoomsLink.style.display="block":this.moreRoomsLink.style.display="none"}setShowMoreRoomsLink(e){this.shouldShowMoreRoomsLink=e,this.updateMoreRoomsLinkDisplay()}showConnectingStatus(){this.header.innerText=this.connectingStatusText,this.text.innerText=d.R.connectingToBroadcastMessage,this.show(),this.joinShowLink.style.display="none",this.spyDisabledText.style.display="none",this.moreRoomsLink.style.display="none",this.isConnecting=!0}isConnectingStatusShowing(){return this.header.innerText===this.connectingStatusText}hideConnectingStatus(){this.isConnecting&&(this.isConnectingStatusShowing()&&(this.header.innerText="",this.text.innerText="",this.hide()),this.isConnecting=!1)}}},8785:(e,t,i)=>{"use strict";i.d(t,{DG:()=>a,Kb:()=>o,LD:()=>l,P8:()=>c,W1:()=>r,b5:()=>d,e0:()=>h});var s=i(9461),n=i(4947);function o(e){return e.isBroadcaster?"broadcaster":e.isMod?"mod":e.inFanclub?"inFanclub":e.tippedTonsRecently?"tippedTonsRecently":e.tippedALotRecently?"tippedALotRecently":e.tippedRecently?"tippedRecently":e.hasTokens?"hasTokens":"defaultUser"}function r(e){return e.isBroadcaster?"#ff6200":e.isMod?"#DC0000":e.inFanclub?"#00ff00":e.tippedTonsRecently?"#ad62e1":e.tippedALotRecently?"#d4a0ff":e.tippedRecently?"#8a98ff":e.hasTokens?"#84c6dc":"#b3b3b3"}function a(e){return e.isBroadcaster?n.R.isBroadcaster:e.isMod?n.R.isMod:e.inFanclub?n.R.inFanClub:e.tippedTonsRecently?n.R.tippedTonsRecently:e.tippedALotRecently?n.R.tippedALotRecently:e.tippedRecently?n.R.tippedRecently:e.hasTokens?n.R.hasTokens:void 0}function l(e){if(!e.isMod&&!e.isBroadcaster&&!e.inFanclub)return e.tippedTonsRecently?n.R.tippedTonsRecentlyDef:e.tippedALotRecently?n.R.tippedALotRecentlyDef:e.tippedRecently?n.R.tippedRecentlyDef:e.hasTokens?n.R.hasTokensDef:void 0}function h(e){e=e.toLowerCase();const t=`${STATIC_URL}gendericons/`;return["m","male"].indexOf(e)>-1?`${t}male.svg`:["f","female"].indexOf(e)>-1?`${t}female.svg`:["t","s","trans"].indexOf(e)>-1?`${t}trans.svg`:["c","couple"].indexOf(e)>-1?`${t}couple.svg`:(error("Could not set menu gender icon. Defaulting to male."),`${t}male.svg`)}function d(){var e;return(null===(e=s.Bm.current.loggedInUser)||void 0===e?void 0:e.username)===s.Aw.getState().room}function c(){return s.Aw.getState().room}},2146:(e,t,i)=>{"use strict";function s(e,t){e.style.webkitTransition=t,e.style.transition=t,void 0!==e.style.setProperty&&e.style.setProperty("moz-transition",t)}function n(e){e.style.webkitTransition="",e.style.transition="",void 0!==e.style.removeProperty&&e.style.removeProperty("moz-transition")}function o(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t,e.style.msUserSelect=t,void 0!==e.style.setProperty&&e.style.setProperty("moz-user-select",t)}i.d(t,{PF:()=>o,Ve:()=>s,dI:()=>n})},8006:(e,t,i)=>{"use strict";i.d(t,{U:()=>m,v:()=>g});var s=i(7063),n=i(1474),o=i(9447),r=i(213),a=i(5216),l=i(9332),h=i(2939),d=i(2709),c=i(7407),u=i(90),p=i(4947);const m=25;class g extends d.u{constructor(){super(),this.innerDiv=document.createElement("div"),this.votesSection=document.createElement("div"),this.upContainer=document.createElement("div"),this.downContainer=document.createElement("div"),this.upVotes=document.createElement("span"),this.downVotes=document.createElement("span"),this.thumbsUp=document.createElement("img"),this.thumbsDown=document.createElement("img"),this.thumbsUpActive=document.createElement("img"),this.thumbsDownActive=document.createElement("img"),this.percent=document.createElement("span"),this.roomName="",this.tipsInPast24Hours=0,this.voteInLast90DaysDown=!1,this.voteUpdate=new u.P({hasVoted:!1,voteDirection:void 0},((e,t)=>this.setVoteState(e,t)),(()=>this.onVoteError())),this.listeningForTipUpdates=!1,this.votesSection.style.display="inline-block",this.votesSection.style.verticalAlign="top",this.upContainer.style.display="inline-block",this.upContainer.style.cursor="pointer",this.upContainer.style.verticalAlign="top",this.upVotes.style.margin="0 3px",this.upVotes.style.verticalAlign="top",this.upContainer.appendChild(this.upVotes),this.createThumbsUp(),this.upContainer.appendChild(this.thumbsUp),this.upContainer.appendChild(this.thumbsUpActive),this.votesSection.appendChild(this.upContainer),this.percent.style.margin="0 3px",this.percent.style.verticalAlign="top",this.percent.onclick=()=>(0,c.bT)("SatisfiedClicked"),this.votesSection.appendChild(this.percent),this.downContainer.style.display="inline-block",this.downContainer.style.cursor="pointer",this.downContainer.style.verticalAlign="top",this.createThumbsDown(),this.downContainer.appendChild(this.thumbsDown),this.downContainer.appendChild(this.thumbsDownActive),this.downVotes.style.margin="0 3px",this.downVotes.style.verticalAlign="top",this.downContainer.appendChild(this.downVotes),this.votesSection.appendChild(this.downContainer),this.innerDiv.appendChild(this.votesSection),this.element.appendChild(this.innerDiv),this.voteUpdate.setInitialState({hasVoted:!1,voteDirection:void 0}),h.X0.listen((e=>{this.chatConn=e.chatConnection,this.roomName=e.dossier.room,this.tipsInPast24Hours=e.dossier.tipsInPast24Hours,e.dossier.hideSatisfactionScore&&void 0===e.dossier.staffInfo?(this.upVotes.style.display="none",this.percent.style.display="none",this.downVotes.style.display="none"):(this.upVotes.innerText=`${e.dossier.satisfactionScore.upVotes}`,this.percent.innerText=`${e.dossier.satisfactionScore.percent}%`,this.downVotes.innerText=`${e.dossier.satisfactionScore.downVotes}`,this.upVotes.style.display="inline",this.percent.style.display="inline",this.downVotes.style.display="inline",this.percent.className="",e.dossier.satisfactionScore.percent>85?(0,o.fZ)(this.percent,"highPercent"):e.dossier.satisfactionScore.percent>65?(0,o.fZ)(this.percent,"mediumPercent"):(0,o.fZ)(this.percent,"lowPercent")),0===e.dossier.lastVoteInPast24Hours?this.voteUpdate.dispatch({hasVoted:!0,voteDirection:"down"},Promise.resolve(!0)):10===e.dossier.lastVoteInPast24Hours?this.voteUpdate.dispatch({hasVoted:!0,voteDirection:"up"},Promise.resolve(!0)):this.voteUpdate.dispatch({hasVoted:!1,voteDirection:void 0},Promise.resolve(!0)),this.voteInLast90DaysDown=e.dossier.lastVoteInPast90DaysDown,this.tipsInPast24Hours>=m?this.enableVoting():this.disableVoting(),this.listeningForTipUpdates||this.listenForTipUpdates()}))}onVoteError(){}enableVoteMsg(){return p.R.afterTipVoteSatisfactionText(this.roomName,m)}styleThumb(e,t){e.src=t,e.height=15,e.width=15,e.style.height="15px",e.style.width="15px",e.style.verticalAlign="top",e.style.margin="0 3px",e.style.opacity="0.8"}createThumbsUp(){this.styleThumb(this.thumbsUp,`${STATIC_URL}thumbs-up-inactive.svg`),this.styleThumb(this.thumbsUpActive,`${STATIC_URL}thumbs-up-active.svg`),this.upContainer.onclick=e=>{if((0,c.bT)("SatisfiedClicked"),this.stopProp(e),this.tipsInPast24Hours>=m&&(!1===this.hasVoted||"down"===this.voteDirection)){this.triggerComment(!0);const e=(0,a.KF)(`tipping/rate_model/${this.roomName}/`,{rating:"10"}).then((()=>(this.chatConn.event.roomNotice.fire({messages:[[(0,l.H5)(p.R.votedUpText(this.roomName))]],showInPrivateMessage:!0}),!0))).catch((e=>(error("Error rating model",e),!1)));this.voteUpdate.dispatch({hasVoted:!0,voteDirection:"up"},e)}else"up"===this.voteDirection&&this.triggerComment(!1)}}createThumbsDown(){this.styleThumb(this.thumbsDown,`${STATIC_URL}thumbs-down-inactive.svg`),this.styleThumb(this.thumbsDownActive,`${STATIC_URL}thumbs-down-active.svg`),this.downContainer.onclick=e=>{(0,c.bT)("SatisfiedClicked"),this.stopProp(e),this.tipsInPast24Hours>=m&&(!1===this.hasVoted||"up"===this.voteDirection)?(0,r.mf)(p.R.sureVoteDownText(this.roomName),(()=>{this.triggerComment(!0);const e=(0,a.KF)(`tipping/rate_model/${this.roomName}/`,{rating:"0"}).then((()=>{let e=p.R.votedDownText(this.roomName);return this.voteInLast90DaysDown&&(e=p.R.votedDownTextRepeat(this.roomName)),this.chatConn.event.roomNotice.fire({messages:[[(0,l.H5)(e)]],showInPrivateMessage:!0}),!0})).catch((e=>(error("Error rating model",e),!1)));this.voteUpdate.dispatch({hasVoted:!0,voteDirection:"down"},e)})):"down"===this.voteDirection&&this.triggerComment(!1)}}stopProp(e){e.stopPropagation()}enableVoting(){this.thumbsUp.style.opacity="1",this.thumbsDown.style.opacity="1",this.thumbsUp.style.cursor="pointer",this.thumbsDown.style.cursor="pointer"}disableVoting(){this.thumbsUp.style.opacity="0.65",this.thumbsDown.style.opacity="0.65",this.thumbsUp.style.cursor="",this.thumbsDown.style.cursor=""}setUpvoted(){this.hasVoted=!0,this.voteDirection="up",this.thumbsDownActive.style.display="none",this.thumbsDown.style.display="",this.thumbsUpActive.style.display="",this.thumbsUp.style.display="none"}setDownvoted(){this.hasVoted=!0,this.voteDirection="down",this.thumbsDownActive.style.display="",this.thumbsDown.style.display="none",this.thumbsUpActive.style.display="none",this.thumbsUp.style.display=""}setNotvoted(){this.hasVoted=!1,this.voteDirection=void 0,this.thumbsDownActive.style.display="none",this.thumbsDown.style.display="",this.thumbsUpActive.style.display="none",this.thumbsUp.style.display=""}setVoteState(e,t){void 0===e.voteDirection||!1===e.hasVoted?this.setNotvoted():"up"===e.voteDirection?this.setUpvoted():"down"===e.voteDirection&&this.setDownvoted()}listenForTipUpdates(){this.listeningForTipUpdates=!0,n.ew.listen((e=>{this.chatConn.room()===e.roomName&&(e.tokens>=m&&(this.enableVoting(),this.tipsInPast24Hours{-1!==["privatewatching","privatespying"].indexOf(this.chatConn.status)&&(0,a.Aw)(`tipping/tips_in_last_24/${this.roomName}/`).then((e=>{const t=new s.N6(e.responseText).getNumber("tipped_performer_last_24hrs");n.ew.fire({tokens:t,roomName:this.chatConn.room()})})).catch((()=>{}))}))}}},3957:(e,t,i)=>{"use strict";i.d(t,{Nt:()=>L,PL:()=>s,TR:()=>B,aw:()=>R,eN:()=>k});var s,n=i(7063),o=i(7623),r=i(8861),a=i(1673),l=i(9757),h=i(5411),d=i(1280),c=i(9461),u=i(664),p=i(6784),m=i(5216),g=i(2939),v=i(2709),f=i(5169),y=i(4580),b=i(3124),w=i(7407),C=i(1452),S=i(4947),x=i(1372),T=i(2945);!function(e){e.InTrouble="0",e.Unhappy="1",e.Indifferent="2",e.Smirk="3",e.InLove="4"}(s||(s={}));const A="feedback/sentiment/nps_group/submit/",P="feedback/sentiment/smc/submit/",k="feedback/sentiment/broadcaster/submit/",M=10;var R;!function(e){e[e.SMC=0]="SMC",e[e.Broadcaster=1]="Broadcaster",e[e.NPS_GROUP=2]="NPS_GROUP"}(R||(R={}));const I=new Map([[R.NPS_GROUP,{forceParam:"force_npsSentimentGroup",contextParam:"show_nps_sentiment_survey_group",endpoint:A,delay:15e3}],[R.SMC,{forceParam:"force_smcSurvey",contextParam:"show_smc_sentiment_survey",endpoint:P,delay:3e5}],[R.Broadcaster,{forceParam:"force_bcastSurvey",contextParam:"show_broadcaster_sentiment_survey",endpoint:k,delay:5e3}]]);function E(e,t,i){let s;switch(t){case R.NPS_GROUP:s=new F(i,e);break;case R.SMC:s=new U(i);break;case R.Broadcaster:const{endpoint:n}=I.get(t);return(0,m.KF)(n,{}).catch(C.yZ),void d.f.show()}document.body.appendChild(s.element),s.show()}function L(e,t){var i,s;const o=null!==(i=null===(s=window.location.pathname.match(/\/([^\/]+)\/?$/))||void 0===s?void 0:s[1])&&void 0!==i?i:"",{forceParam:r,contextParam:a,endpoint:l,delay:h}=I.get(t),d=(0,T.JO)(window.location.search)[r];if("1"===d)return void E(e,t,o);const u=["unknown","offline","notconnected","passwordprotected","hidden"];let p;g.X0.listen((e=>{p=e.chatConnection})),window.setTimeout((()=>{if(void 0===p||-1!==u.indexOf(p.status)&&t!==R.Broadcaster)return;const i=p.room();if("2"===d)return void E(e,t,i);let s=l;t===R.NPS_GROUP&&(s=`${A}?source=${c.Bm.current.showNpsSentimentSurveyGroup}`),(0,m.Aw)(s).then((s=>{new n.N6(s.responseText).getBoolean(a)&&E(e,t,i)})).catch(C.yZ)}),h)}let D;function B(){const{forceParam:e}=I.get(R.Broadcaster);"1"===(0,T.JO)(window.location.search)[e]&&L(!1,R.Broadcaster),a.WK.listen((e=>{e?D=Date.now():void 0!==D&&(Date.now()-D)/6e4>=M&&L(!1,R.Broadcaster)}))}class U extends v.u{constructor(e){super(),this.room=e,this.element=this.createWrapperElement({position:"fixed",width:"288px",bottom:"8px",right:"20px",borderRadius:"4px",overflow:"hidden",zIndex:1004},{borderRadius:"4px",borderStyle:"solid",borderWidth:"4px 1px 1px 1px",paddingLeft:"16px",height:"110px"},{position:"absolute",width:"14px",height:"14px",top:"14px",right:"14px",padding:"2px",cursor:"pointer",zIndex:1},{margin:"-4px -17px"},{position:"relative",width:"288px",height:"4px"}),this.survey=this.createSurvey(),this.closedAction="FeedbackSMCSentimentClosed",this.popupAction="FeedbackSMCSentimentPopup",this.describedAction="FeedbackSMCSentimentDescribed",this.source="smc_sentiment_survey",this.submitEndpoint=P,this.cancelEndpoint="feedback/sentiment/smc/cancel/",this.initialDuration=25,this.confirmationDuration=15}createWrapperElement(e,t,i,s,n){return(0,x.tT)("div",{style:e,colorClass:"cornerSurveyWrapper"},(0,x.tT)("div",{style:t,colorClass:"cornerSurveyContainer",ref:e=>{this.contentContainer=e}},(0,x.tT)("img",{style:i,src:`${STATIC_URL}popup_survey/close.svg`,onClick:()=>{this.close(),(0,w.bT)(this.closedAction)}}),(0,x.tT)("div",{style:s,colorClass:"timerContainer",ref:e=>{this.timerParent=e}},(0,x.tT)("div",{style:n,colorClass:"timer",ref:e=>{this.timer=e}}))))}show(){this.contentContainer.appendChild(this.survey),this.setTimer(this.initialDuration,!0),(0,w.bT)(this.popupAction)}close(){this.contentContainer.contains(this.survey)&&(0,m.KF)(this.cancelEndpoint,{}).catch(C.yZ),null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element)}submit(e){this.selectedSentiment=e;const t={rating:e,room_user:this.room,url:window.location.href};(0,m.KF)(this.submitEndpoint,t).catch(C.yZ),this.contentContainer.removeChild(this.survey),this.contentContainer.appendChild(this.createConfirmation()),this.setTimer(this.confirmationDuration,!1)}createSurvey(){return this.createSurveyElement({position:"relative",paddingTop:"16px",fontSize:"14px",width:"245px"},{position:"relative",padding:"16px 0px 11px 0px"})}createSurveyElement(e,t){return(0,x.tT)("div",{colorClass:"survey"},(0,x.tT)("div",{style:e,colorClass:"title"},S.R.howIsSmcDoingToday),(0,x.tT)("div",{style:t},this.createEmoteDiv(s.InTrouble),this.createEmoteDiv(s.Unhappy),this.createEmoteDiv(s.Indifferent),this.createEmoteDiv(s.Smirk),this.createEmoteDiv(s.InLove)))}createEmoteDiv(e){return this.createEmoteDivElement({position:"relative",display:"inline-block",width:"40px",height:"40px",boxSizing:"border-box",marginRight:"8px",borderRadius:"4px",borderStyle:"solid",borderWidth:"1px",cursor:"pointer"},{position:"relative",width:"24px",height:"24px",top:"7px",left:"7px"},e)}createEmoteDivElement(e,t,i){return(0,x.tT)("div",{style:e,colorClass:"emoteContainer",onClick:()=>{this.submit(i)}},(0,x.tT)("div",{style:t},(0,u.S)(i)))}createConfirmation(){return this.createConfirmationElement({position:"relative",paddingTop:"16px",fontSize:"12px"},{display:"block",paddingBottom:"12px",fontSize:"12px"})}createConfirmationElement(e,t){return(0,x.tT)("div",{colorClass:"confirmation"},(0,x.tT)("div",{style:e,colorClass:"title"},S.R.yourFeedbackHasBeenSent),(0,x.tT)("a",{href:"#",style:t,colorClass:"feedbackLink",onClick:()=>{this.close(),h.E.fire({source:this.source,sentiment:this.selectedSentiment}),(0,w.bT)(this.describedAction)}},S.R.describeYourIssues))}setTimer(e,t){this.timer.classList.remove("timerBar25s"),this.timer.classList.remove("timerBar15s"),this.timer.classList.remove("timerBar7s"),this.timer.classList.add(`timerBar${e}s`),t?this.element.classList.add("pauseOnHover"):this.element.classList.remove("pauseOnHover"),this.timerParent.removeChild(this.timer),this.timer=this.timer.cloneNode(),this.timerParent.appendChild(this.timer),(0,o.lT)()||(0,o._6)()?window.setTimeout((()=>{this.close()}),1e3*e+200):(0,p.wu)("animationend",this.timer,(()=>{window.setTimeout((()=>{this.close()}),200)}))}}class F extends v.u{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.room=e,this.closedAction="FeedbackNPSClosed",this.popupAction="FeedbackNPSPopup",this.source=c.Bm.current.showNpsSentimentSurveyGroup,this.cancelEndpoint="feedback/sentiment/nps_group/cancel/",this.submitEndpoint=A;const i=e=>t&&["bio","moreRooms","roomMenu"].includes(e);this.element=this.createWrapperElement(t),i(f.S.currentTab)&&(this.element.style.bottom="5px"),this.survey=document.createElement("div"),new(l.c.get("NPSSentimentSurvey"))({onSubmit:(e,t)=>this.submit(e,t),closeModal:()=>this.close()},this.survey),t&&(b.DQ.listen((()=>{(0,b.K$)()?this.showElement():this.hideElement()})),y.qb.listen((e=>{i(e)?this.element.style.bottom="5px":this.element.style.bottom="74px"})),y.f6.listen((()=>{if(this.isOpen){const e=document.querySelector(".inputAmt.tipAmountInput");e&&window.setTimeout((()=>e.blur()),50)}})))}createWrapperElement(e){return(0,x.tT)("div",{colorClass:"npsSurveyWrapper",className:e?"npsMobile":"",ref:e=>{this.contentContainer=e}})}show(){if(this.isOpen=!0,this.contentContainer.appendChild(this.survey),(0,w.bT)(this.popupAction,{source:this.source}),this.contentContainer.contains(this.survey)){const e={source:this.source};(0,m.KF)(this.cancelEndpoint,e).catch(C.yZ)}}close(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isOpen=!1,e||(0,w.bT)(this.closedAction,{source:this.source}),null!==this.element.parentElement&&this.element.parentElement.removeChild(this.element)}submit(e,t){const i=new FormData;i.append("rating",e[0]),e.forEach((e=>{i.append("responses",e)})),t.forEach((e=>{i.append("prompts",e)})),i.append("source",this.source),i.append("url",document.location.href),i.append("csrfmiddlewaretoken",(0,r.I7)("csrftoken"));const s=new FormData;s.append("rating",e[0]),s.append("room_user",this.room),s.append("url",document.location.href),s.append("source",this.source),(0,m.KF)(this.submitEndpoint,s).catch(C.yZ),(0,m.KF)("/feedback/submit/",i).catch(C.yZ),this.close(!0)}}},7258:(e,t,i)=>{"use strict";i.d(t,{J:()=>m,V:()=>p});var s=i(7063),n=i(7623),o=i(9461),r=i(7254),a=i(6784),l=i(6657),h=i(6066),d=i(2939),c=i(4693),u=i(9586);class p extends l.c{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(e),this.config=e,this.isPM=t,this.cacheTTL=3e5,this.maxSearchSlugLength=100,this.filterAfterSize=1,this.maxOptionLength=50,this.element.dataset.testid="shortcodeAutocompleteModal",this.list.dataset.testid="shortcodeAutocompleteList",this.listenerGroup.add(d.X0.listen((e=>{this.room=e.dossier.room})))}handleKeydown(e){if(this.isPM)error("Shortcodes are not implemented for PMs"),e.preventDefault(),e.stopPropagation();else if(this.visible){var t,i;"ArrowUp"===e.code&&(e.preventDefault(),this.scrollList(!0)),"ArrowDown"===e.code&&(e.preventDefault(),this.scrollList(!1));const s=null!==(t=null===(i=window.getSelection())||void 0===i?void 0:i.toString())&&void 0!==t?t:"",n="Space"===e.code&&this.items.some((e=>e.slug.includes(`${this.searchSlug} `)));(""===s||n?["ArrowRight","Enter","Tab"]:["ArrowRight","Enter","Space","Tab"]).includes(e.code)&&(e.preventDefault(),e.stopPropagation(),this.hide(),o.Bm.current.isMobile&&"Enter"===e.code||this.finalizeSelection()),"Escape"!==e.code&&"ArrowLeft"!==e.code||(e.preventDefault(),this.hide(),this.deleteHighlightedSuffix()),"Space"===e.code&&s.includes(" ")&&(e.preventDefault(),e.stopPropagation(),this.finalizeSelection(),this.hide())}}initData(){super.initData()}initUI(){super.initUI(),this.list.style.width=""}promptRegex(){return"\\[cb"}searchSlugRegex(){return'[:][\\w\\s\\d="!]*]?'}getDataEndpoint(){return`chatmessages/shortcode_autocomplete/?slug=${this.searchSlug}`}show(){super.show()}getCache(){return void 0===this.cache&&(this.cache=new c.zt(this.filterAfterSize,this.cacheTTL)),this.cache}normalizedSearchSlug(){return this.searchSlug.toLowerCase()}parseResponse(e){var t;const i=new s.N6(e),n=null!==(t=i.getList("shortcodes"))&&void 0!==t?t:[],a=[];for(const e of n){var l;const t=e.getString("slug"),i=e.getString("sc");if(""===t)continue;const s=(null===(l=o.Bm.current.loggedInUser)||void 0===l?void 0:l.username)===this.room;(i!==r.AJ.Tip||s)&&a.push({slug:t,element:g})}return i.logUnusedDebugging("parseShortcodegAutocompleteResponse"),a}updateListDOM(){super.updateListDOM(),this.repositionChildren()}isSpecialFunctionKey(e){return["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Enter","Escape","Tab"].includes(e.code)}}class m extends p{constructor(e){super({inputElement:e,leftOffset:0,rightOffset:0},arguments.length>1&&void 0!==arguments[1]&&arguments[1]),this.mobileMixin=new h.v({autocompleteConfig:this.config,element:this.element,list:this.list,overlayClick:this.overlayClick,listenerGroup:this.listenerGroup,isVisible:()=>this.visible,hide:()=>this.hide(),pickItem:(e,t)=>this.pickItem(e,t),hideOnSpace:!1}),(0,n.OF)()||(0,a.wu)("keydown",this.config.inputElement.element,(e=>{this.visible&&this.config.inputElement.setCaretToEndOfSelection()}))}initUI(){super.initUI(),this.element.style.border="",this.element.style.fontSize="14px",this.element.style.lineHeight="26px",this.element.style.boxShadow="0px 0px 8px rgba(0, 0, 0, 0.32)",this.element.style.marginLeft="7px",this.element.style.boxSizing="content-box",this.list.style.width="",(0,u.H)(this.list,!0)}repositionChildren(){}appendItem(e,t){const i=super.appendItem(e,t);return this.mobileMixin.customizeItem(i,t),i}show(){this.mobileMixin.onShow(),super.show()}}const g=document.createElement("div")},3320:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var s=i(9447),n=i(6784),o=i(1519),r=i(2709),a=i(8423);class l extends r.u{constructor(e){super(),this.config=e,this.value=0,this.valueChanged=new a.c_("valueChanged"),this.valueChangeStart=new a.c_("valueChangeStart"),this.valueChangeEnd=new a.c_("valueChangeEnd"),(0,s.fZ)(this.element,"slider"),this.element.style.position="relative",this.element.style.overflow="visible",this.element.style.cursor="pointer",void 0!==e.barWidth?this.element.style.width=`${e.barWidth+e.handleDiameter}px`:this.element.style.width="90%",this.element.style.height=`${e.handleDiameter}px`,this.barHeight=void 0!==e.barHeight?e.barHeight:2*Math.round(.25*e.handleDiameter/2),void 0!==e.barImage?(this.emptyBar=document.createElement("img"),this.emptyBar.src=e.barImage,this.emptyBar.style.width="100%",this.emptyBar.style.height="100%",this.element.appendChild(this.emptyBar)):(this.emptyBar=document.createElement("div"),this.emptyBar.style.position="absolute",this.emptyBar.style.boxSizing="border-box",void 0!==e.emptyBarColor?this.emptyBar.style.backgroundColor=e.emptyBarColor:(this.emptyBar.style.backgroundColor="#333333",this.emptyBar.style.backgroundColor="rgba(255, 255, 255, 0.2)"),this.emptyBar.style.top=.5*(e.handleDiameter-this.barHeight)+"px",this.emptyBar.style.height=`${this.barHeight}px`,this.emptyBar.style.width="100%",this.element.appendChild(this.emptyBar)),void 0!==e.barImage?(this.filledBar=document.createElement("div"),this.filledBar.style.visibility="none"):(this.filledBar=document.createElement("div"),this.filledBar.style.position="absolute",this.filledBar.style.boxSizing="border-box",this.filledBar.style.backgroundColor=void 0!==e.filledBarColor?e.filledBarColor:"#ffffff",this.filledBar.style.top=.5*(e.handleDiameter-this.barHeight)+"px",this.filledBar.style.height=`${this.barHeight}px`,this.element.appendChild(this.filledBar)),void 0!==e.handleImage?(this.handle=document.createElement("img"),this.handle.style.position="absolute",this.handle.style.top="0",this.handle.src=e.handleImage,this.handle.style.height=`${e.handleDiameter}px`,this.handle.style.width=`${e.handleDiameter}px`,this.handle.style.cursor="grab",this.handle.style.left="0px",this.element.appendChild(this.handle)):(this.handle=document.createElement("div"),this.handle.style.position="absolute",this.handle.style.top="0",this.handle.style.backgroundColor=void 0!==e.handleColor?e.handleColor:"#ffffff",this.handle.style.borderRadius="50%",this.handle.style.height=`${e.handleDiameter}px`,this.handle.style.height=`${e.handleDiameter}px`,this.handle.style.width=`${e.handleDiameter}px`,this.handle.style.cursor="grab",this.element.appendChild(this.handle)),this.valueUpdater=new o.a((()=>{this.valueChanged.fire(this.value)}),{bounceLimitMS:100,debounceType:2}),this.setupListeners((e=>{this.handleMoveEvent(e,e.clientX)}),"mousedown","mousemove","mouseup"),this.setupListeners((e=>{if(1===e.touches.length){const t=e.touches.item(0);null!==t&&this.handleMoveEvent(e,t.clientX)}}),"touchstart","touchmove","touchend"),(0,n.wu)("mousedown",this.element,(e=>{this.handleMoveEvent(e,e.clientX),this.handle.dispatchEvent(function(e,t){try{return new MouseEvent(e,t)}catch{const i=document.createEvent("MouseEvent");return i.initMouseEvent(e,void 0!==t.bubbles&&t.bubbles,void 0!==t.cancelable&&t.cancelable,window,0,void 0!==t.screenX?t.screenX:0,void 0!==t.screenY?t.screenY:0,void 0!==t.clientX?t.clientX:0,void 0!==t.clientY?t.clientY:0,void 0!==t.ctrlKey&&t.ctrlKey,void 0!==t.altKey&&t.altKey,void 0!==t.shiftKey&&t.shiftKey,void 0!==t.metaKey&&t.metaKey,void 0!==t.button?t.button:0,void 0!==t.relatedTarget?t.relatedTarget:null),i}}(e.type,e))}))}setupListeners(e,t,i,s){(0,n.wu)(t,this.handle,(t=>{this.valueChangeStart.fire(this.value),this.handle.style.cursor="",document.body.style.cursor="grabbing",t.preventDefault(),t.stopPropagation(),(0,n.wu)(i,document,e,!0);const o=t=>{this.valueChangeEnd.fire(this.value),this.handle.style.cursor="grab",document.body.style.cursor="",t.preventDefault(),(0,n.Pf)(i,document,e,!0),(0,n.Pf)(s,document,o,!0)};(0,n.wu)(s,document,o,!0)}))}handleMoveEvent(e,t){const i=this.element.getBoundingClientRect().left;if(void 0!==this.config.barWidth){const e=Math.max(.5*this.config.handleDiameter,Math.min(this.config.barWidth+.5*this.config.handleDiameter,t-i));this.setValue((e-.5*this.config.handleDiameter)*(100/this.config.barWidth))}else{const e=Math.max(.5*this.config.handleDiameter,Math.min(this.element.offsetWidth+.5*this.config.handleDiameter,t-i));this.setValue((e-.5*this.config.handleDiameter)*(100/this.element.offsetWidth))}this.valueUpdater.callFunc(),e.stopPropagation()}getValue(){return this.value}setValue(e){void 0!==this.config.barWidth?(this.handle.style.left=e*this.config.barWidth/100+"px",this.filledBar.style.width=e*this.config.barWidth/100+"px"):(this.handle.style.left=`calc(${e}% - ${this.config.handleDiameter*e/100}px)`,this.filledBar.style.width=`${e}%`),this.value=e}hideHandle(){this.handle.style.display="none"}showHandle(){this.handle.style.display="block"}handleResize(){void 0===this.config.barWidth&&(this.handle.style.left=`calc(${this.value}% - ${this.config.handleDiameter*this.value/100}px)`,this.filledBar.style.width=`${this.value}%`)}}},7569:(e,t,i)=>{"use strict";i.d(t,{PR:()=>d,fM:()=>u,gW:()=>n});var s,n,o=i(20),r=i(9461),a=i(7254),l=i(4947);!function(e){e[e.ChatMessage=0]="ChatMessage",e[e.TipRequest=1]="TipRequest",e[e.ToggleDebugMode=2]="ToggleDebugMode",e[e.Shortcode=3]="Shortcode",e[e.Invalid=0]="Invalid"}(n||(n={}));const h={"/tip":function(e){const t={};if(e.length>0){const i=Number(e[0]);isNaN(i)?t.message=e.join(" "):(e.shift(),t.amount=i,e.length>0&&(t.message=e.join(" ")))}return{messageData:t,messageType:n.TipRequest}},"/debug":function(){return{messageType:n.ToggleDebugMode}}};function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("/"===e.trim().charAt(0)){const t=function(e){const t=e.match(/(\S+)/g);if(null!==t){const e=t.shift();if(Boolean(Object.prototype.hasOwnProperty.call(h,e)))return h[e](t)}return{messageType:n.Invalid}}(e);if(t.messageType!==n.Invalid)return t}else if(u.isShortcodeSyntax(e,t))return u.parseShortcodeMessage(e);return{messageType:n.ChatMessage,messageData:e}}function c(e){const t=new RegExp(/^(\d{1,4})$/),i=new RegExp(/^(\d{1}[\.,]\d{3})$/),s=new RegExp(/^[\.,]\d{1,2}$/),n=t.test(e)||i.test(e);return!s.test(e)&&n}class u{static getCode(e){const t=e.match(u.codeRegex);if(null!==t)switch(t[1].toLowerCase()){case a.AJ.Signup:return a.AJ.Signup;case a.AJ.Follow:return a.AJ.Follow;case a.AJ.Fanclub:return a.AJ.Fanclub;case a.AJ.Supporter:return a.AJ.Supporter;case a.AJ.Tip:return a.AJ.Tip;case a.AJ.Help:return a.AJ.Help;default:return}}static getShortcodeTitle(e){var t,i;const s=e.code,n=null===(t=e.msg)||void 0===t?void 0:t.trim(),o=null===(i=e.amt)||void 0===i?void 0:i.toString();return s===a.AJ.Tip&&void 0!==o&&void 0!==n?`[cb:${s} amount=${o} message="${n}"]`:`[cb:${s}]`}static isShortcodePrefix(e){return e.toLowerCase()===u.shortcodePrefix}static hasShortcodes(e){return null!==e.match(u.shortcodeRegex)}static isShortcodeSyntax(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return!o.Xw.includes(t)&&null!==e.match(this.shortcodeRegex)}static isValidTipShortcodeSyntax(e){const t=new RegExp(/\[cb:tip amount=([\d,.]*) message=(("[^\]"“”]+")|(""|“”)|(“[^\]"“”]+”))\]/i),i=new RegExp(/\[cb:tip message=(("[^\]"“”]+")|(""|“”)|(“[^\]"“”]+”)) amount=([\d,.]*)\]/i);return t.test(e)||i.test(e)}static pullRoomMetadata(){const e=r.Aw.getState(),{hasFanClub:t,room:i,userName:s}=e;return{hasFanClub:t,isBroadcaster:s===i}}static isValidShortcode(e){return null!==e.match(u.shortcodeStrictRegexA)||null!==e.match(u.shortcodeStrictRegexB)}static isValidTipShortcode(e){if(!u.isValidTipShortcodeSyntax(e))return!1;const t=e.match(u.amountRegex);if(null!==t&&!c(t[0].split("=")[1]))return!1;const i=e.match(u.messageStrictRegex);return null===i||!i[0].split("=")[1].match(u.urlRegex)}static isValidShortcodeForRoom(e){const{hasFanClub:t,isBroadcaster:i}=u.pullRoomMetadata();if(!u.isValidShortcode(e))return!1;const s=u.getCode(e);switch(s){case a.AJ.Tip:return u.isValidTipShortcode(e)&&i;case a.AJ.Fanclub:return/(\[cb:fanclub\])/i.test(e)&&t;case a.AJ.Follow:case a.AJ.Supporter:case a.AJ.Signup:case a.AJ.Help:return new RegExp(`\\[cb:${s}\\]`,"i").test(e);default:return!1}}static isValidShortcodeMessage(e){var t;const i=e.match(u.shortcodeRegex);return null!==(t=null==i?void 0:i.every((e=>u.isValidShortcodeForRoom(e))))&&void 0!==t&&t}static getShortcodeForPart(e,t){const i=u.getCode(e);if(void 0!==i)switch(i){case a.AJ.Tip:if(!u.isValidTipShortcodeSyntax(e))break;return t.find((t=>{if(t.code!==a.AJ.Tip)return!1;const i=t.amt===u.getAmountWithoutSeparators(e),s=t.msg===u.getMessageContents(e);return i&&s}));default:return t.find((e=>e.code===i))}}static getAmountWithoutSeparators(e){const t=e.match(u.amountRegex);if(null!==t){const e=t[0].split("=")[1];if(c(e))return Number(e.replace(/\./gi,"").replace(/,/gi,""))}return 0}static getMessageContents(e){var t;const i=e.match(u.messageStrictRegex);return null!==i&&void 0!==(null===(t=i.groups)||void 0===t?void 0:t.message)?i.groups.message.trim():""}static parseShortcodeMessage(e){const t=[];if(!u.isValidShortcodeMessage(e))return{messageType:n.Shortcode,shortcodes:[],message:e};const i=e.match(u.shortcodeRegex);if(null!==i)for(const e of i){const i=u.getCode(e);if(void 0!==i)if(i===a.AJ.Tip){const i=e.match(u.amountRegex),s=e.match(u.messageStrictRegex);let n="";if(s&&s.groups&&(n=s.groups.message),null!==i&&null!==s){const e=i[0].split("=")[1].replace(/\./gi,"").replace(/,/gi,"");t.push({code:a.AJ.Tip,amt:Number(e),msg:n})}}else t.push({code:i})}return t.length>5?{messageType:n.Shortcode,shortcodes:[],message:e}:(e=e.replace(this.shortcodeNormalizeRegex,(e=>e.toLowerCase())),{messageType:n.Shortcode,shortcodes:t,message:e.trim()})}static errorBehindShortcode(e){const{hasFanClub:t,isBroadcaster:i}=u.pullRoomMetadata(),s=e.match(u.shortcodeRegex);if(null!==s){if(s.length>5)return l.R.tooManyShortcodes;for(const n of s){if(!t&&new RegExp(/\[cb:fanclub\]/i).test(e))return l.R.noFanClub;if(u.getCode(n)===a.AJ.Tip){const e=u.errorBehindTipShortcode(n,i);if(void 0!==e)return e}}}return l.R.shortcodeEnteredError(e)}static hasTipArguments(e){let t="",i=!1;for(const s of e)"'"!==s&&"‘"!==s&&"’"!==s&&'"'!==s&&"“"!==s&&"”"!==s?i||(t+=s):i=!i;return new RegExp(/amount=/).test(t)&&new RegExp(/message=/).test(t)}static hasErrorInMessageArg(e){return!u.messageStrictRegex.test(e)||u.messageRegexSingleQuote.test(e)||u.messageInvalidQuotesRegex.test(e)}static errorBehindTipShortcode(e,t){if(!t)return l.R.tipNotBroadcaster;if(!u.hasTipArguments(e)||!u.amountAnyRegex.test(e)||!u.messageAnyRegex.test(e))return l.R.tipShortcodeArgsMissing;const i=e.match(u.amountAnyRegex);return null===i||c(i[0].split("=")[1])?u.hasErrorInMessageArg(e)?l.R.tipShortcodeMessageInDoubleQuotes:null!==e.match(u.urlRegex)?l.R.shortcodeURLNotAllowedInTip:void 0:l.R.inValidTipAmount}}(s=u).shortcodePrefix="[cb:",s.shortcodeSuffix="]",s.shortcodeRegex=/(\[cb:(?:[^\]]){0,100}\])/gi,s.nonGlobalShortcodeRegex=/(\[cb:(?:[^\]]){0,100}\])/i,s.shortcodeStrictRegexA=/\[cb:([a-z]+)((\s[a-z]+?=[\d,\.]*){0,1})((\s[a-z]+?=("|“)([^\]"“”]*?)("|”))){0,1}\]/gi,s.shortcodeStrictRegexB=/\[cb:([a-z]+)((\s[a-z]+?=("|“)([^\]"“”]*?)("|”))){0,1}((\s[a-z]+?=[\d,\.]*){0,1})\]/gi,s.shortcodeNormalizeRegex=/\[cb:(follow|signup|fanclub|supporter|help)\]/gi,s.amountAnyRegex=/amount=[^\s\]]+/i,s.messageAnyRegex=/message=[^\s\]]+/i,s.urlRegex=/\b(?:https?:\/\/)?(?:www\.)?[^\/\s]+\.[a-zA-Z]{2,}\b/gi,s.messageRegexSingleQuote=/(message=)(?:['|‘|’](?:[^\]"“”]+)['|‘|’]|['|‘|’](?:[^\]"“”]+)["|“|”]|["|“|”](?:[^\]"“”]+)['|‘|’])/i,s.messageInvalidQuotesRegex=/(message=)(?:"[^\]"“”]*[“”])|(?:“[^\]"“”]*["“])/i,s.amountRegex=/amount=([,.\d]*)/i,s.messageStrictRegex=/(message=)("|“)(?[^\]"“”]*)("|”)/i,s.codeRegex=/\[cb:([^\s\]]+)(?:[^\]]*)\]/i},7176:(e,t,i)=>{"use strict";i.d(t,{Am:()=>n,DU:()=>r,Kj:()=>a,fh:()=>o,sx:()=>l});var s=i(1372);function n(){return(0,s.tT)("div",{style:{display:"inline-block"},colorClass:["noteIconSvg"]},(0,s.tT)("svg",{style:{height:"1.2em",width:"1.2em"},viewBox:"0 0 12 12",xmlns:"https://www.w3.org/2000/svg"},(0,s.tT)("path",{d:"M5.5 2.00002H2C1.73478 2.00002 1.48043 2.10537 1.29289 2.29291C1.10536 2.48044 1 2.7348 1 3.00002V10C1 10.2652 1.10536 10.5196 1.29289 10.7071C1.48043 10.8947 1.73478 11 2 11H9C9.26522 11 9.51957 10.8947 9.70711 10.7071C9.89464 10.5196 10 10.2652 10 10V6.50002","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),(0,s.tT)("path",{d:"M9.25 1.24985C9.44891 1.05094 9.7187 0.939194 10 0.939194C10.2813 0.939194 10.5511 1.05094 10.75 1.24985C10.9489 1.44877 11.0607 1.71855 11.0607 1.99985C11.0607 2.28116 10.9489 2.55094 10.75 2.74985L6 7.49985L4 7.99985L4.5 5.99985L9.25 1.24985Z","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})))}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"16px";return(0,s.tT)("a",{className:"closeBtnContainer",style:{height:e,borderRadius:"5px",color:"inherit",display:"inline-block",cursor:"pointer"}},(0,s.tT)("svg",{style:{width:e,height:e},width:"12",height:"12",viewBox:"0 0 12 12"},(0,s.tT)("path",{d:"M7.15006 6.08867C7.13842 6.07705 7.12919 6.06326 7.12288 6.04807C7.11658 6.03289 7.11334 6.01661 7.11334 6.00017C7.11334 5.98372 7.11658 5.96744 7.12288 5.95226C7.12919 5.93707 7.13842 5.92328 7.15006 5.91167L11.7816 1.28067C11.9222 1.13984 12.0011 0.94891 12.001 0.749887C12.0008 0.550864 11.9216 0.360048 11.7808 0.219417C11.64 0.0787862 11.4491 -0.000140462 11.25 1.87661e-07C11.051 0.000140838 10.8602 0.0793373 10.7196 0.220167L6.08856 4.84917C6.07695 4.86081 6.06316 4.87004 6.04797 4.87634C6.03278 4.88265 6.0165 4.88589 6.00006 4.88589C5.98362 4.88589 5.96734 4.88265 5.95215 4.87634C5.93697 4.87004 5.92317 4.86081 5.91156 4.84917L1.28056 0.220167C1.21093 0.150501 1.12826 0.0952322 1.03726 0.0575166C0.946271 0.0198009 0.84874 0.000376944 0.75024 0.00035373C0.551311 0.000306846 0.360511 0.0792862 0.219814 0.219917C0.0791162 0.360548 4.6905e-05 0.551311 2.08617e-08 0.75024C-4.68632e-05 0.94917 0.0789325 1.13997 0.219564 1.28067L4.85006 5.91167C4.8617 5.92328 4.87094 5.93707 4.87724 5.95226C4.88354 5.96744 4.88679 5.98372 4.88679 6.00017C4.88679 6.01661 4.88354 6.03289 4.87724 6.04807C4.87094 6.06326 4.8617 6.07705 4.85006 6.08867L0.219564 10.7202C0.14993 10.7898 0.0947003 10.8725 0.0570276 10.9635C0.0193548 11.0546 -2.31938e-05 11.1521 2.08617e-08 11.2506C4.6905e-05 11.4495 0.0791162 11.6403 0.219814 11.7809C0.28948 11.8505 0.372179 11.9058 0.46319 11.9435C0.554201 11.9811 0.651741 12.0005 0.75024 12.0005C0.94917 12.0004 1.13993 11.9214 1.28056 11.7807L5.91156 7.14917C5.92317 7.13753 5.93697 7.12829 5.95215 7.12199C5.96734 7.11569 5.98362 7.11244 6.00006 7.11244C6.0165 7.11244 6.03278 7.11569 6.04797 7.12199C6.06316 7.12829 6.07695 7.13753 6.08856 7.14917L10.7196 11.7807C10.8602 11.9214 11.051 12.0004 11.2499 12.0005C11.4488 12.0005 11.6396 11.9215 11.7803 11.7809C11.921 11.6403 12.0001 11.4495 12.0001 11.2506C12.0002 11.0517 11.9212 10.8609 11.7806 10.7202L7.15006 6.08867Z"})))}function r(){return(0,s.tT)("div",{style:{display:"inline-block"}},(0,s.tT)("svg",{style:{height:"1em"},width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},(0,s.tT)("path",{d:"M3.482 7.91071C3.45013 7.89982 3.4223 7.87953 3.40219 7.85252C3.38208 7.8255 3.37062 7.79303 3.36933 7.75937C3.36827 7.72563 3.37736 7.69233 3.39542 7.66381C3.41349 7.63528 3.4397 7.61284 3.47067 7.59937C3.92472 7.40632 4.29812 7.06231 4.52765 6.62556C4.75718 6.18882 4.82875 5.68617 4.73025 5.20272C4.63174 4.71927 4.3692 4.2847 3.98708 3.97259C3.60495 3.66048 3.12672 3.48999 2.63333 3.48999C2.13995 3.48999 1.66171 3.66048 1.27959 3.97259C0.897467 4.2847 0.63493 4.71927 0.536421 5.20272C0.437912 5.68617 0.509482 6.18882 0.739017 6.62556C0.968551 7.06231 1.34195 7.40632 1.796 7.59937C1.82712 7.61253 1.85351 7.63484 1.87166 7.66334C1.88982 7.69184 1.89888 7.72518 1.89765 7.75895C1.89642 7.79271 1.88496 7.82531 1.86478 7.85241C1.8446 7.87952 1.81666 7.89985 1.78467 7.91071C1.26465 8.08858 0.813146 8.4244 0.4932 8.87127C0.173253 9.31815 0.000829249 9.85377 0 10.4034L0 12.3787C0 12.4661 0.0346975 12.5498 0.0964595 12.6116C0.158221 12.6733 0.241989 12.708 0.329333 12.708H0.916667C0.95808 12.7081 0.997978 12.7236 1.02847 12.7516C1.05896 12.7797 1.07783 12.8181 1.08133 12.8594L1.318 15.6987C1.32486 15.7809 1.36241 15.8576 1.42317 15.9134C1.48394 15.9692 1.56348 16.0002 1.646 16H3.62133C3.70374 16 3.78311 15.969 3.84374 15.9132C3.90436 15.8574 3.94181 15.7808 3.94867 15.6987L4.186 12.8594C4.18935 12.8182 4.20807 12.7797 4.23846 12.7517C4.26884 12.7237 4.30866 12.7081 4.35 12.708H4.938C4.98122 12.708 5.02401 12.6995 5.06393 12.683C5.10385 12.6664 5.14011 12.6421 5.17064 12.6115C5.20117 12.5809 5.22536 12.5446 5.24184 12.5047C5.25832 12.4647 5.26675 12.4219 5.26667 12.3787V10.4034C5.26604 9.85372 5.09369 9.31801 4.77372 8.8711C4.45374 8.42418 4.00213 8.08841 3.482 7.91071Z"}),(0,s.tT)("path",{d:"M14.2154 7.91071C14.1834 7.89985 14.1555 7.87952 14.1353 7.85241C14.1151 7.82531 14.1036 7.79271 14.1024 7.75895C14.1012 7.72518 14.1102 7.69184 14.1284 7.66334C14.1466 7.63484 14.1729 7.61253 14.2041 7.59937C14.6581 7.40632 15.0315 7.06231 15.261 6.62556C15.4906 6.18882 15.5622 5.68617 15.4636 5.20272C15.3651 4.71927 15.1026 4.2847 14.7205 3.97259C14.3384 3.66048 13.8601 3.48999 13.3667 3.48999C12.8733 3.48999 12.3951 3.66048 12.013 3.97259C11.6309 4.2847 11.3683 4.71927 11.2698 5.20272C11.1713 5.68617 11.2429 6.18882 11.4724 6.62556C11.7019 7.06231 12.0753 7.40632 12.5294 7.59937C12.5605 7.61259 12.5868 7.63496 12.6049 7.6635C12.623 7.69204 12.632 7.72541 12.6307 7.75918C12.6294 7.79295 12.6179 7.82553 12.5977 7.85259C12.5774 7.87965 12.5494 7.89992 12.5174 7.91071C11.9974 8.08861 11.546 8.42445 11.2262 8.87134C10.9064 9.31822 10.7341 9.85383 10.7334 10.4034V12.3787C10.7333 12.4219 10.7417 12.4647 10.7582 12.5047C10.7747 12.5446 10.7989 12.5809 10.8294 12.6115C10.86 12.6421 10.8962 12.6664 10.9361 12.683C10.9761 12.6995 11.0188 12.708 11.0621 12.708H11.6501C11.6914 12.7081 11.7312 12.7237 11.7616 12.7517C11.792 12.7797 11.8107 12.8182 11.8141 12.8594L12.0514 15.6987C12.0583 15.7808 12.0957 15.8574 12.1563 15.9132C12.217 15.969 12.2963 16 12.3787 16H14.3541C14.4366 16.0002 14.5161 15.9692 14.5769 15.9134C14.6377 15.8576 14.6752 15.7809 14.6821 15.6987L14.9187 12.8594C14.9222 12.8181 14.9411 12.7797 14.9716 12.7516C15.0021 12.7236 15.042 12.7081 15.0834 12.708H15.6707C15.7581 12.708 15.8418 12.6733 15.9036 12.6116C15.9654 12.5498 16.0001 12.4661 16.0001 12.3787V10.4034C15.9992 9.85377 15.8268 9.31815 15.5069 8.87127C15.1869 8.4244 14.7354 8.08858 14.2154 7.91071Z"}),(0,s.tT)("path",{d:"M8.78198 3.75737C8.75083 3.74636 8.72367 3.7263 8.70399 3.69976C8.68431 3.67323 8.67299 3.64142 8.67148 3.60842C8.66998 3.57541 8.67836 3.54271 8.69555 3.51449C8.71274 3.48628 8.73796 3.46384 8.76798 3.45004C9.14122 3.27559 9.4438 2.97908 9.62578 2.60945C9.80775 2.23983 9.85823 1.8192 9.76889 1.41701C9.67954 1.01482 9.4557 0.655134 9.13434 0.39733C8.81298 0.139525 8.4133 -0.000976562 8.00131 -0.000976562C7.58932 -0.000976562 7.18965 0.139525 6.86828 0.39733C6.54692 0.655134 6.32309 1.01482 6.23374 1.41701C6.14439 1.8192 6.19487 2.23983 6.37685 2.60945C6.55882 2.97908 6.86141 3.27559 7.23465 3.45004C7.26467 3.46384 7.28988 3.48628 7.30707 3.51449C7.32426 3.54271 7.33264 3.57541 7.33114 3.60842C7.32964 3.64142 7.31832 3.67323 7.29863 3.69976C7.27895 3.7263 7.2518 3.74636 7.22065 3.75737C6.7746 3.91826 6.38891 4.21259 6.116 4.60036C5.8431 4.98813 5.69621 5.45053 5.69531 5.9247V6.91337C5.69635 7.00039 5.73138 7.08356 5.79292 7.1451C5.85446 7.20663 5.93762 7.24166 6.02465 7.2427H6.57065C6.61112 7.24247 6.65024 7.25728 6.68042 7.28426C6.7106 7.31123 6.72968 7.34845 6.73398 7.3887L7.01398 9.91337C7.023 9.99387 7.06137 10.0682 7.12176 10.1222C7.18214 10.1762 7.26031 10.206 7.34131 10.206H8.65865C8.73958 10.206 8.81766 10.1762 8.87794 10.1222C8.93821 10.0682 8.97645 9.99381 8.98531 9.91337L9.26598 7.3887C9.27057 7.34846 9.28984 7.31131 9.32009 7.28438C9.35035 7.25744 9.38947 7.24261 9.42998 7.2427H9.97531C10.0627 7.2427 10.1464 7.208 10.2082 7.14624C10.2699 7.08448 10.3046 7.00071 10.3046 6.91337V5.92404C10.304 5.45025 10.1575 4.98815 9.8851 4.60051C9.61268 4.21287 9.22753 3.91849 8.78198 3.75737Z"})))}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,s.tT)("div",{style:{display:"inline-block",paddingTop:`${e}px`,fill:"currentColor"}},(0,s.tT)("svg",{style:{height:"1.2em"},width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},(0,s.tT)("path",{d:"M14.9474 6.50932L14.1034 6.20998C13.9826 6.16702 13.8721 6.09916 13.7791 6.01078C13.6862 5.92241 13.6128 5.8155 13.5638 5.69697C13.5148 5.57845 13.4912 5.45094 13.4946 5.32272C13.498 5.19451 13.5282 5.06843 13.5834 4.95265L13.9674 4.14398C14.1075 3.84868 14.1528 3.51727 14.0971 3.19521C14.0414 2.87315 13.8874 2.57621 13.6563 2.3451C13.4252 2.11398 13.1283 1.96002 12.8062 1.90432C12.4842 1.84862 12.1528 1.89391 11.8574 2.03398L11.0488 2.41865C10.9329 2.47361 10.8069 2.50365 10.6787 2.50683C10.5505 2.51002 10.4231 2.48628 10.3046 2.43715C10.1862 2.38802 10.0794 2.31458 9.99111 2.2216C9.90283 2.12861 9.83504 2.01814 9.79211 1.89732L9.49211 1.05398C9.38235 0.746123 9.18003 0.479756 8.91292 0.291408C8.6458 0.103059 8.32696 0.00195313 8.00011 0.00195312C7.67327 0.00195312 7.35443 0.103059 7.08731 0.291408C6.82019 0.479756 6.61788 0.746123 6.50811 1.05398L6.20811 1.89798C6.16512 2.01875 6.09728 2.12915 6.00897 2.22206C5.92066 2.31498 5.81384 2.38834 5.69541 2.4374C5.57699 2.48647 5.44959 2.51015 5.32144 2.50692C5.19329 2.50369 5.06725 2.47362 4.95145 2.41865L4.14278 2.03398C3.84747 1.89391 3.51607 1.84862 3.19401 1.90432C2.87195 1.96002 2.575 2.11398 2.34389 2.3451C2.11278 2.57621 1.95882 2.87315 1.90312 3.19521C1.84742 3.51727 1.89271 3.84868 2.03278 4.14398L2.41678 4.95265C2.47188 5.06844 2.50207 5.19451 2.5054 5.3227C2.50873 5.45089 2.48513 5.57835 2.43613 5.69685C2.38712 5.81535 2.31379 5.92224 2.22089 6.01063C2.12799 6.09902 2.01757 6.16693 1.89678 6.20998L1.05278 6.50998C0.744848 6.61958 0.478381 6.8218 0.289952 7.08887C0.101523 7.35595 0.000366211 7.6748 0.000366211 8.00165C0.000366211 8.32851 0.101523 8.64735 0.289952 8.91443C0.478381 9.1815 0.744848 9.38372 1.05278 9.49332L1.89678 9.79332C2.01755 9.83629 2.12795 9.90414 2.22085 9.99246C2.31375 10.0808 2.38708 10.1876 2.43609 10.3061C2.4851 10.4245 2.50871 10.5519 2.50538 10.6801C2.50206 10.8082 2.47187 10.9342 2.41678 11.05L2.03278 11.8587C1.89271 12.154 1.84742 12.4854 1.90312 12.8074C1.95882 13.1295 2.11278 13.4264 2.34389 13.6575C2.575 13.8887 2.87195 14.0426 3.19401 14.0983C3.51607 14.154 3.84747 14.1087 4.14278 13.9687L4.95145 13.5847C5.06722 13.5295 5.19329 13.4992 5.3215 13.4959C5.44971 13.4926 5.57718 13.5162 5.69566 13.5653C5.81415 13.6144 5.92099 13.6878 6.00927 13.7809C6.09755 13.8739 6.1653 13.9844 6.20811 14.1053L6.50811 14.9487C6.61788 15.2565 6.82019 15.5229 7.08731 15.7112C7.35443 15.8996 7.67327 16.0007 8.00011 16.0007C8.32696 16.0007 8.6458 15.8996 8.91292 15.7112C9.18003 15.5229 9.38235 15.2565 9.49211 14.9487L9.79211 14.1047C9.83509 13.9839 9.90293 13.8735 9.99126 13.7806C10.0796 13.6877 10.1864 13.6144 10.3049 13.5653C10.4233 13.5163 10.5507 13.4927 10.6789 13.496C10.807 13.4994 10.933 13.5296 11.0488 13.5847L11.8574 13.9687C12.1528 14.1087 12.4842 14.154 12.8062 14.0983C13.1283 14.0426 13.4252 13.8887 13.6563 13.6575C13.8874 13.4264 14.0414 13.1295 14.0971 12.8074C14.1528 12.4854 14.1075 12.154 13.9674 11.8587L13.5834 11.05C13.5284 10.9342 13.4982 10.8082 13.4948 10.6801C13.4915 10.5519 13.5151 10.4245 13.5641 10.3061C13.6131 10.1876 13.6865 10.0808 13.7794 9.99246C13.8723 9.90414 13.9827 9.83629 14.1034 9.79332L14.9474 9.49265C15.2554 9.38305 15.5218 9.18084 15.7103 8.91376C15.8987 8.64669 15.9999 8.32784 15.9999 8.00098C15.9999 7.67413 15.8987 7.35528 15.7103 7.08821C15.5218 6.82113 15.2554 6.61892 14.9474 6.50932ZM8.00011 11.1907C7.37045 11.1815 6.75667 10.9917 6.2318 10.6437C5.70693 10.2958 5.29306 9.80438 5.03945 9.22798C4.71516 8.44275 4.71553 7.56095 5.04046 6.77598C5.3654 5.99102 5.98838 5.36695 6.77278 5.04065C7.55892 4.72626 8.43681 4.73154 9.21911 5.05537C10.0014 5.3792 10.6262 5.99594 10.9601 6.77398C11.2844 7.55922 11.284 8.44102 10.9591 9.22598C10.6342 10.011 10.0112 10.635 9.22678 10.9613C8.83799 11.1212 8.42042 11.1993 8.00011 11.1907Z"})))}function l(e,t){const i=(0,s.tT)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"reply-icon"},(0,s.tT)("path",{d:"M9.41624 6.5001C8.36101 5.49058 6.91921 5.42139 6.31151 5.44408C6.2877 5.44511 6.26454 5.43559 6.2474 5.41774C6.23026 5.39989 6.22063 5.37525 6.22074 5.34955V4.37708C6.22037 4.2304 6.1414 4.09718 6.01813 4.0353C5.89485 3.97341 5.74953 3.99404 5.64528 4.08821L3.01893 6.49519C2.93812 6.56704 2.89133 6.67411 2.89136 6.78708C2.89077 6.89782 2.93585 7.00312 3.01437 7.07444L5.64739 9.58388C5.75212 9.677 5.89728 9.69652 6.02 9.63396C6.14272 9.57141 6.22092 9.43803 6.22074 9.29161V8.14408C6.22076 8.09924 6.25009 8.06064 6.29083 8.05182C6.95951 7.90058 9.14183 7.61398 10.2721 9.90072C10.3101 9.97676 10.3911 10.0153 10.4688 9.99434C10.5465 9.97338 10.6011 9.89827 10.6015 9.81187C10.6015 8.36716 10.2027 7.25328 9.41624 6.5001Z"}));return(0,s.tT)("div",{colorClass:e,style:t},i)}},2091:(e,t,i)=>{"use strict";i.d(t,{$h:()=>F,Pm:()=>N,Zw:()=>V,__:()=>z,gI:()=>$,hk:()=>O,mU:()=>H,wR:()=>_,zh:()=>W});var s=i(7623),n=i(9447),o=i(5728),r=i(9757),a=i(9419),l=i(6428),h=i(7964),d=i(9505),c=i(369),u=i(442),p=i(6784),m=i(6844),g=i(9453),v=i(1413),f=i(2939),y=i(6669),b=i(1519),w=i(2709),C=i(3955),S=i(481),x=i(8423),T=i(9060),A=i(3654),P=i(1284),k=i(7407),M=i(2146),R=i(7258),I=i(7569),E=i(4947),L=i(4110),D=i(3860),B=i(1448),U=i(74);const F=28,_=1e3,N=6,O=1024,H=4096;function W(){const e=document.createElement("form");return(0,n.fZ)(e,"chat-input-form"),e.style.display="inline-block",e.style.boxSizing="border-box",e.style.display="flex",e.style.alignItems="center",e}function $(){const e=document.createElement("div");return(0,n.fZ)(e,"inputDiv"),e.style.height=`${F}px`,e.style.boxSizing="border-box",e.style.margin="0 5px 5px 5px",e.style.position="relative",e.style.borderWidth="1px",e.style.borderStyle="solid",e.style.fontSize="12px",e.style.display="grid",e.style.gridTemplateColumns="minmax(25px, 1fr) auto",e.style.columnGap=`${N}px`,e.style.padding=`0 ${N}px`,e.style.borderRadius="4px 4px 0 0",e}function V(e,t,i){const s=new y.wi(e,t);return(0,n.fZ)(s.element,"chat-input-field"),(0,C.ZM)(s.element,{height:F-2*N+"px",fontFamily:"Helvetica, Arial, sans-serif",lineHeight:"15px"}),s.element.classList.add("inputFieldChatPlaceholder"),s.element.dataset.testid="chat-input",void 0!==i&&s.element.classList.add(i),s.element.setAttribute("data-placeholder",E.R.sendAMessageDesktop),(0,p.Xq)(["focus","touchstart"],s.element,(()=>(0,g.Ye)())),(0,p.wu)("blur",s.element,g.TL),s}class z extends w.u{constructor(e,t,i){super(),this.outgoingHandlers=e,this.inPrivateRoom=t,this.pmOtherUser=i,this.addMessageHTMLEvent=new x.c_("addMessageHtml",{reportIfNoListeners:!1}),this.removeMessagesForUserEvent=new x.c_("removeMessageHtml",{reportIfNoListeners:!1}),this.scrolledToBottom=new x.c_("scrolledToBottom"),this.messageList=function(){const e=document.createElement("div");return e.className="msg-list-fvm",(0,n.fZ)(e,"message-list"),e.style.width="100%",(0,M.PF)(e,"text"),e.style.cursor="text",e.style.paddingBottom="4px",e}(),this.noticeList=function(){const e=document.createElement("div");return e.style.width="100%",e.className="notice-list-fvm",(0,M.PF)(e,"text"),e.style.cursor="text",e}(),this.messageListWrapper=function(){const e=document.createElement("div");return e.className="msg-list-wrapper-split",e.style.boxSizing="border-box",e.style.overflow="auto",e.style.margin="0 auto 0",e.style.width="100%",e.style.padding="5px",e.style.flex="1",e}(),this.messageCounter=0,this.listenerGroup=new x.gt,this.isPmChatContents=void 0!==this.pmOtherUser,this.toBottom=()=>{this.scrollToBottom()},this.element.classList.add("ChatTabContents"),this.element.style.position="static",this.element.style.boxSizing="border-box",this.element.style.fontSize="12px",this.element.style.overflow="",this.element.style.display="flex",this.element.style.flexDirection="column",this.element.classList.add(this.isPmChatContents?"TheatermodeChatDivPm":"TheatermodeChatDivChat"),this.messageListWrapper.appendChild(this.noticeList),this.messageListWrapper.appendChild(this.messageList),this.isPmChatContents&&(this.pmControlBar=new o.sV(!1,i),this.element.appendChild(this.pmControlBar.element)),this.element.appendChild(this.messageListWrapper),(0,T.QC)()&&(this.newMessageNotice=(0,B.rc)(),D.L.changeVideoMode.listen((()=>{this.newMessageNotice.remove(),this.scrollToBottom()})),this.scrollDownButton=new u.w({scrollToBottom:()=>this.scrollToBottom(),bottomStyle:`${F+9}px`}),this.addChild(this.scrollDownButton)),this.buildChatInput(),this.wasScrolledUp=!1;const s=new b.a((()=>{const e=this.messageListWrapper.scrollTop;this.isPmChatContents&&0===e&&this.isScrolledUp()&&L.ME.fire(),c.x0||(!this.isScrolledUp()&&this.wasScrolledUp&&this.scrolledToBottom.fire(),this.wasScrolledUp=this.isScrolledUp())}),{bounceLimitMS:50,debounceType:1});(0,p.wu)("scroll",this.messageListWrapper,(()=>{s.callFunc(),this.undebouncedOnScrollChange()})),this.listenerGroup.add(v.V.listen((e=>{this.rulesModal=(0,h.oG)(this,e),void 0!==this.rulesModal&&this.addChild(this.rulesModal)}))),this.listenerGroup.add(f.X0.listen((e=>{this.currentRoomContext=e,this.element.style.fontSize=e.dossier.userChatSettings.fontSize,this.setLineHeight()}))),U.EZ.listen((e=>{this.element.style.fontSize=e.fontSize,this.setLineHeight()})).addTo(this.listenerGroup),this.emoticonAutocompleteModal=new S.s({inputElement:this.customInputField,leftOffset:8,rightOffset:207}),this.inputDiv.appendChild(this.emoticonAutocompleteModal.element),this.emoticonAutocompleteModal.afterDOMConstructedIncludingChildren(),this.isPmChatContents||(this.userMentionAutocompleteModal=new l.ti({inputElement:this.customInputField,leftOffset:8,rightOffset:207}),this.inputDiv.appendChild(this.userMentionAutocompleteModal.element),this.userMentionAutocompleteModal.afterDOMConstructedIncludingChildren(),l.$u.listen((()=>{(0,A.Qp)(this.messageList)})).addTo(this.listenerGroup),this.shortcodeAutocompleteModal=new R.V({inputElement:this.customInputField,leftOffset:8,rightOffset:207},this.isPmChatContents),this.inputDiv.appendChild(this.shortcodeAutocompleteModal.element),this.shortcodeAutocompleteModal.afterDOMConstructedIncludingChildren()),this.emoticonAutocompleteModal.element.classList.add(this.isPmChatContents?"theatermodeEmoticonAutocompleteModalPm":"theatermodeEmoticonAutocompleteModalChat"),this.emoticonAutocompleteModal.element.dataset.testid="emoticon-autocomplete-modal"}buildChatInput(){const e=this.isPmChatContents?H:O;this.inputDiv=$(),this.inputForm=W(),this.customInputField=V((()=>this.sendMessageFromInput()),e,this.isPmChatContents?"theatermodeInputFieldPm":"theatermodeInputFieldChat"),this.buildButtonHolder(),this.inputForm.appendChild(this.customInputField.element),this.inputDiv.appendChild(this.inputForm),this.inputDiv.appendChild(this.buttonHolder.element),this.element.appendChild(this.inputDiv),this.addInputListeners()}buildButtonHolder(){this.buttonHolder=new d.J({columnGap:`${N}px`}),this.isPmChatContents&&(this.mediaDockButton=function(e){const t=document.createElement("span");t.style.cursor="pointer",t.style.height="1.2em",t.style.minWidth="1.2em",t.dataset.paction="Chat",t.dataset.pactionName="UploadPhoto",t.dataset.testid="send-image-button",t.onclick=e;const i=document.createElement("img");return i.src=`${STATIC_URL}mediaDock/uploadBackground.svg`,i.style.width="100%",i.style.height="100%",t.appendChild(i),t}((()=>{this.onMediaDockButtonClick()})),this.buttonHolder.addButton(this.mediaDockButton,d.z.Icon)),this.emojiButton=function(e){const t=document.createElement("span");return t.textContent="😁",t.style.cursor="pointer",t.style.fontSize="1em",t.style.lineHeight="1em",t.classList.add(e?"theatermodeEmojiButtonPm":"theatermodeEmojiButtonChat"),(0,s.AD)()||(twemoji.parse(t,{className:"emojiButton"}),t.style.fontSize="15px",t.style.lineHeight="15px"),t.dataset.paction="Chat",t.dataset.pactionName="EmojiClick",t.dataset.testid="emoji-button",t}(this.isPmChatContents),this.buttonHolder.addButton(this.emojiButton,d.z.Icon);const e=document.createElement("span");new(r.c.get("SendButton"))({onClick:()=>{this.customInputField.submit()},isPm:this.isPmChatContents,variant:"SplitMode"},e),this.buttonHolder.addButton(e,d.z.Text)}onMediaDockButtonClick(){if((0,k.bT)("PMPhotoButtonClicked"),!(0,m.rC)()){var e;if(void 0!==this.rulesModal)return void this.rulesModal.show();null===(e=this.libraryMediaDock)||void 0===e||e.toggle(),this.scrollToBottom()}}addInputListeners(){(0,p.wu)("mousedown",this.inputDiv,(e=>{e.target!==this.inputDiv&&e.target!==this.inputForm||(this.customInputField.focus(),e.preventDefault())})),(0,p.wu)("click",this.emojiButton,(e=>{this.rulesModal?this.rulesModal.show():((0,g.Ye)(),L.n2.fire(this.emojiButton))})),(0,p.wu)("submit",this.inputForm,(e=>{e.preventDefault(),this.customInputField.submit()}))}setLineHeight(){this.messageListWrapper.style.lineHeight=`${Number(this.element.style.fontSize.slice(0,-2))+7}pt`}dispose(){var e,t,i,s,n;this.listenerGroup.removeAll(),this.emoticonAutocompleteModal.dispose(),null===(e=this.userMentionAutocompleteModal)||void 0===e||e.dispose(),null===(t=this.libraryMediaDock)||void 0===t||t.dispose(),null===(i=this.rulesModal)||void 0===i||i.dispose(),this.customInputField.dispose(),null===(s=this.pmControlBar)||void 0===s||s.dispose(),null===(n=this.shortcodeAutocompleteModal)||void 0===n||n.dispose()}shouldSendMessageFromInput(){var e,t;return!((0,m.rC)('You must be logged in to send a message. Click "OK" to login.')||this.emoticonAutocompleteModal.isVisible()||!0===(null===(e=this.userMentionAutocompleteModal)||void 0===e?void 0:e.isVisible())||!0===(null===(t=this.shortcodeAutocompleteModal)||void 0===t?void 0:t.isVisible())||this.rulesModal&&(this.rulesModal.show(),1))}sendMessageFromInput(){if(!this.shouldSendMessageFromInput())return!1;const e=this.customInputField.getText(),t=void 0!==this.selectedMediaDock&&!this.selectedMediaDock.isEmpty();return this.scrollToBottom(),(""!==e.trim()||t)&&this.processMessage(e),this.recordUserAction(e),!0}shortcodeErrorMsg(e,t){return this.isPmChatContents?E.R.shortcodeNotSupportedInPMs:this.inPrivateRoom()?E.R.shortcodeNotSupportedInPrivates:0===e.shortcodes.length?I.fM.errorBehindShortcode(t):void 0}processMessage(e){const t=(0,I.PR)(e);switch(t.messageType){case I.gW.Shortcode:const i=t,s=this.shortcodeErrorMsg(i,e);void 0!==s?this.appendMessageDiv((0,B.CM)(s)):this.outgoingHandlers.onShortcode&&this.outgoingHandlers.onShortcode(i);break;case I.gW.ToggleDebugMode:this.outgoingHandlers.onToggleDebugMode();break;case I.gW.TipRequest:this.customInputField.clearText();const n=t;this.outgoingHandlers.onTipRequest(n.messageData);break;default:this.outgoingHandlers.onChatMessage(e)}}recordUserAction(e){const t=e.match(/@[a-zA-Z0-9_]+/gm),i=a.k.getInstance();if(null!==t)for(const e of t)i.userInList(e.replace("@",""))&&(0,k.bT)("UserMentionMessage");this.customInputField.blur()}repositionChildren(){var e,t;null!==(e=null===(t=this.selectedMediaDock)||void 0===t?void 0:t.isShown())&&void 0!==e&&e?this.inputDiv.style.borderRadius="0":this.inputDiv.style.borderRadius="4px 4px 0 0",this.emoticonAutocompleteModal.element.style.bottom=this.inputDiv.offsetHeight-2+"px",void 0!==this.shortcodeAutocompleteModal&&(this.shortcodeAutocompleteModal.element.style.bottom=this.inputDiv.offsetHeight-2+"px"),void 0!==this.userMentionAutocompleteModal&&(this.userMentionAutocompleteModal.element.style.bottom=this.inputDiv.offsetHeight-2+"px"),this.wasScrolledUp||this.scrollToBottom()}initMediaDocks(e){this.libraryMediaDock=e,this.selectedMediaDock=e.sibling,this.addMediaDocksToDOM()}addMediaDocksToDOM(){void 0!==this.libraryMediaDock&&this.addChild(this.libraryMediaDock),void 0!==this.selectedMediaDock&&((0,C.ZM)(this.selectedMediaDock,{margin:"0 5px"}),this.element.insertBefore(this.selectedMediaDock.element,this.inputDiv))}isScrolledUp(){return this.messageListWrapper.scrollTop<=this.messageListWrapper.scrollHeight-(this.messageListWrapper.offsetHeight+20)}scrollToBottom(){this.isScrolledUp()&&this.scrolledToBottom.fire(),this.messageListWrapper.scrollTop=this.messageListWrapper.scrollHeight-this.messageListWrapper.offsetHeight}getScrollTop(){return this.messageListWrapper.scrollTop}setScrollTop(e){this.messageListWrapper.scrollTo({top:e})}undebouncedOnScrollChange(){var e,t,i;this.isScrolledUp()?null===(e=this.scrollDownButton)||void 0===e||e.showElement():(null===(t=this.scrollDownButton)||void 0===t||t.hideElement(),null===(i=this.scrollDownButton)||void 0===i||i.clearUnread())}appendNoticeDiv(e){return this.noticeList.appendChild(e),e}appendMessageDiv(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.isScrolledUp();if(i){if("photo"!==e.getAttribute("type")){var s;null===(s=this.scrollDownButton)||void 0===s||s.incUnread()}}else e.querySelectorAll("img").forEach((e=>{const t=e.src;e.src="",e.onload=this.toBottom,e.src=t}));let n=this.messageList.childElementCount-_;for(this.maybeAppendNewMessageNotice(),(0,P.NZ)(e,this.messageList);n>0;n-=1){const e=this.messageList.firstElementChild;null!==e&&this.messageList.removeChild(e)}return i||this.scrollToBottom(),this.addMessageHTMLEvent.fire({makeByCloning:()=>e.cloneNode(!0)}),t&&(this.messageCounter+=1),e}maybeAppendNewMessageNotice(){var e;(0,T.QC)()&&this.isScrolledUp()&&1===(null===(e=this.scrollDownButton)||void 0===e?void 0:e.getUnreadCount())&&((0,C.Mo)(this.newMessageNotice,this.messageListWrapper)||(0,P.NZ)(this.newMessageNotice,this.messageList))}showElement(){super.showElement("flex")}removeMessageDiv(e){this.messageList.removeChild(e)}getLastMessageId(){return this.messageCounter}messagesSinceId(e){return this.messageCounter-e}getEarliestMessageId(){return this.earliestMessageId}setEarliestMessageId(e){this.earliestMessageId=e}handleRemoveMessages(e){const t=[];for(const i of this.messageList.childNodes){const s=i;s.getAttribute("data-nick")===e&&t.push(s)}for(const e of t)this.messageList.removeChild(e)}clear(){for(this.messageCounter=0;null!==this.messageList.firstChild;)this.messageList.removeChild(this.messageList.firstChild)}focusCurrentChatInput(){this.customInputField.focus()}blurCurrentChatInput(){this.customInputField.blur()}removeMessagesForUser(e){this.removeMessagesForUserEvent.fire(e)}isInputFocused(){return document.activeElement===this.customInputField.element}getInputText(){return this.customInputField.getText()}setInputText(e){this.customInputField.setText(e)}appendInputText(e){this.customInputField.appendText(e)}}},4660:(e,t,i)=>{"use strict";i.d(t,{J:()=>l});var s=i(6784),n=i(2382),o=i(8423),r=i(5173),a=i(2146);class l extends r.Q{constructor(e,t,i){super(),this.onColorPicked=t,this.onColorHovered=i,this.hexInput=document.createElement("input"),this.pickerImgLoaded=!1,this.pickerImgLoadedEvent=new o.c_("pickerImgLoaded"),this.swatchElement=e,this.element.dataset.testid="color-picker-modal",this.element.style.visibility="hidden",this.element.style.width="auto",this.element.style.height="auto",this.element.style.opacity="0",(0,a.Ve)(this.element,"opacity 250ms"),(0,s.wu)("keydown",this.element,(e=>{27===e.keyCode&&this.hide()})),this.overlayClick.listen((()=>{this.hide()})),this.createColorCanvas(),this.createHexInput()}createColorCanvas(){const e=document.createElement("canvas");e.style.cursor="crosshair",e.style.border="1px solid #000001",this.element.appendChild(e);const t=document.createElement("img");var i;i=t,`${STATIC_URL}colorPicker.png?v=1`.startsWith("/")||i.setAttribute("crossorigin","anonymous"),t.src=`${STATIC_URL}colorPicker.png?v=1`,t.onload=()=>{e.width=t.width,e.height=t.height,e.onclick=()=>{this.initialColor=this.hexInput.value,this.colorPicked(this.hexInput.value),this.hide()},e.onmousemove=t=>{const i=e.getContext("2d");if(null!==i&&t.offsetX>0&&t.offsetY>0&&t.offsetX{this.hexInput.value=this.initialColor,this.onColorHovered(this.hexInput.value)};const i=e.getContext("2d");null!==i&&i.drawImage(t,0,0,t.width,t.height),this.hexInput.style.width=e.width-8+"px",this.pickerImgLoaded=!0,this.pickerImgLoadedEvent.fire(void 0)}}createHexInput(){this.hexInput.dataset.testid="color-hex-input",this.hexInput.type="text",this.hexInput.style.display="block",this.hexInput.style.border="1px solid #000000",this.hexInput.style.padding="2px 4px",this.hexInput.style.position="relative",this.hexInput.style.top="-3px",this.hexInput.style.fontSize="12px",this.hexInput.oninput=()=>{this.onColorHovered(this.hexInput.value)},(0,s.wu)("keydown",this.hexInput,(e=>{13===e.keyCode&&(this.colorPicked(this.hexInput.value),this.hide())})),this.element.appendChild(this.hexInput)}colorPicked(e){this.onColorPicked(e)}repositionChildren(){this.element.style.left=`${this.swatchElement.offsetLeft}px`,this.element.style.top=`${this.swatchElement.offsetTop+this.swatchElement.offsetHeight+2}px`}show(e){this.initialColor=e,this.pickerImgLoaded?this.styleForShow():this.pickerImgLoadedEvent.once((()=>this.styleForShow()))}styleForShow(){this.hexInput.value=this.initialColor,this.element.style.opacity="1",this.element.style.visibility="",this.showOverlay(),this.repositionChildrenRecursive()}hide(){this.hideOverlay(),this.element.style.opacity="0",window.setTimeout((()=>{this.element.style.visibility="hidden"}),250)}}},8269:(e,t,i)=>{"use strict";i.d(t,{M$:()=>h,Or:()=>a,rS:()=>r,rW:()=>l});var s=i(8423),n=i(2945),o=i(9268);const r="discover-join-overlay";class a extends o.fS{constructor(){super({onHide:()=>h.fire(void 0)})}}function l(e){for(const t of e.querySelectorAll("a:not(.nooverlay):not([href='#'])"))null!==t.getAttribute("data-room-nav")&&void 0!==(0,n.JO)(window.location.search).join_overlay&&t.setAttribute(r,""),new o.QC(t)}const h=new s.c_("removeDiscoverJoinOverlayAnchors")},2196:(e,t,i)=>{"use strict";i.d(t,{N:()=>c});var s=i(2758),n=i(9447),o=i(6784),r=i(3333),a=i(2939),l=i(2709),h=i(4947);const d=e=>`dism_msg${e}`;class c extends l.u{constructor(){super(),this.messagesDisplaying=[],this.element.style.position="static",this.element.style.overflow="",a.X0.listen((e=>{for(const t of e.dossier.dismissibleMessages)this.messagesDisplaying.indexOf(t.idOrName)<0&&!this.getDismissedCache(t)&&(this.messagesDisplaying.push(t.idOrName),this.render(t))}))}render(e){const t=document.createElement("div");(0,n.fZ)(t,"dismissibleMessage"),(0,n.fZ)(t,n.aG.dismissibleMessageColor),t.innerHTML=e.messageHtml,t.style.fontSize="12px",t.style.padding="3px",t.style.margin="5px 0",t.style.borderRadius="2px",t.style.lineHeight="16px",t.dataset.testid="dismissible-message-text";const i=document.createElement("a");(0,n.fZ)(i,n.aG.hrefColor),i.textContent=h.R.dismissMessage,i.style.cursor="pointer",i.dataset.testid="dismissible-message-dismiss";const s=document.createElement("span");s.textContent=" (";const a=document.createElement("span");a.textContent=")",t.appendChild(s),t.appendChild(i),t.appendChild(a),this.element.appendChild(t);const l=t.getElementsByTagName("a");for(const e of l)(0,n.fZ)(e,n.aG.hrefColor),e.onmouseenter=()=>{e.style.textDecoration="underline"},e.onmouseleave=()=>{e.style.textDecoration=""},e.classList.contains(r.uJ)&&(0,r.NX)(e);(0,o.wu)("click",i,(()=>{this.dismissMessage(t,e)}))}getDismissedCache(e){let t=(0,s.y1)(d(e.idOrName));return void 0===t&&(t=(0,s.fc)(d(e.idOrName),{days:60})),"1"===t}dismissMessage(e,t){this.element.removeChild(e),this.messagesDisplaying.splice(this.messagesDisplaying.indexOf(t.idOrName),1),(0,s.aR)(d(t.idOrName),"1",{days:60})}}},9439:(e,t,i)=>{"use strict";i.d(t,{AU:()=>w,LE:()=>b,RB:()=>S,Vx:()=>C,jb:()=>y});var s=i(7623),n=i(7964),o=i(6064),r=i(6784),a=i(6844),l=i(6669),h=i(6716),d=i(5412),c=i(1191),u=i(2690),p=i(3860),m=i(74);let g,v,f=!0;function y(e){f=e}function b(){return f}function w(e){return Boolean(e.form)||null!==e.closest("form")}function C(){return void 0!==document.activeElement&&null!==document.activeElement&&["input","textarea"].includes(document.activeElement.tagName.toLowerCase())&&!(0,o.QZ)()}function S(e,t){p.L.changeVideoMode.listen((e=>{g=void 0}));const i=new c.t,f=()=>e.chatWindow.chatTabContainer.getCurrentTab().isInputFocused()||t.getCurrentTab().isInputFocused();let y=0;u.$.listen((e=>{e?y+=1:y-=1})),i.addHandler({keyCode:9,requiresCtrlOrMeta:!1,handle:i=>{if(!(!f()&&C()&&e.focusedWindow!==e.tipWindow||(0,o.QZ)()||(0,n.tI)()||(0,o.QZ)())){e.setFocusedWindow(e.chatWindow);const s=e=>{i.shiftKey?e.cycleToPrevWindow():e.cycleToNextWindow()};"split"===p.L.getVideoMode()?(s(e.chatWindow.chatTabContainer),s(t)):(s(t),s(e.chatWindow.chatTabContainer)),i.preventDefault(),i.stopPropagation()}}}),i.addHandler({keyCode:13,requiresCtrlOrMeta:!1,handle:t=>{if(f())return(0,a.rC)()?void t.preventDefault():void((0,s.J8)().scrollTop===v&&void 0!==g&&((0,s.J8)().scrollTop=g,g=void 0));e.setFocusedWindow(e.chatWindow)}}),i.addHandler({keyCode:27,requiresCtrlOrMeta:!1,handle:i=>{(0,o.QZ)()?((0,o.SJ)(),e.setFocusedWindow(void 0),g=void 0):(i.preventDefault(),void 0!==e.focusedWindow&&e.focusedWindow.closable&&e.removeChild(e.focusedWindow),e.setFocusedWindow(void 0),(0,s.J8)().scrollTop===v&&void 0!==g&&(t.getCurrentTab().blurCurrentChatInput(),(0,s.J8)().scrollTop=g,g=void 0))}}),i.addHandler({keyCode:76,requiresCtrlOrMeta:!0,handle:i=>{"split"!==p.L.getVideoMode()&&e.focusedWindow!==e.chatWindow||("split"!==p.L.getVideoMode()||t.pmTab.tabHasFocus())&&(i.stopPropagation(),i.preventDefault(),e.chatWindow.chatTabContainer.closeCurrentPMSession(),t.closeCurrentPMSession())}}),i.addHandler({keyCode:83,requiresCtrlOrMeta:!0,handle:t=>{t.stopPropagation(),t.preventDefault(),"split"===p.L.getVideoMode()||"hidden"===e.element.style.visibility?m.i5.fire({usedCtrlS:!0}):h.f6.fire({usedCtrlS:!0})}});const S=[32,34,33];(0,r.wu)("keydown",document,(n=>{(e=>!b()||27!==e.keyCode&&!e.ctrlKey&&!e.metaKey&&(!(null===e.target||!w(e.target)||f())||!(!(0,o.QZ)()&&-1===S.indexOf(e.keyCode)&&0===y)||!f()&&C()))(n)||void 0!==e.focusedWindow&&e.focusedWindow.handleKeyEvent(n)||i.execute(n)||n.ctrlKey||n.metaKey||!(0,d.x)(n.which)||(g=(0,s.J8)().scrollTop,"split"!==p.L.getVideoMode()&&e.setFocusedWindow(e.chatWindow),l.Z2.fire(n),("split"===p.L.getVideoMode()?t:e.chatWindow.chatTabContainer).getCurrentTab().focusCurrentChatInput(),window.setTimeout((()=>{v=(0,s.J8)().scrollTop}),0))}),!0)}},3306:(e,t,i)=>{"use strict";i.d(t,{n:()=>h});var s=i(3955),n=i(6144),o=i(2997),r=i(2146),a=i(4947),l=i(1372);class h extends n.v{constructor(e){super(e.toggleElement,!0,e)}initUI(e){const t={padding:"8px 16px",cursor:"pointer"},i=()=>{this.hideElement(),e.enterNativeFn()},n=()=>{this.hideElement(),e.enterInteractiveFn()};(0,s.ZM)(this.element,{display:"block",visibility:"hidden",opacity:"0",inset:"",height:"max-content",width:"max-content",padding:"8px 0px",borderRadius:"8px",bottom:"100%",right:"10px",textShadow:"none",textAlign:"left",color:"#ffffff",backgroundColor:"rgba(0, 0, 0, 0.75)",fontFamily:'"UbuntuRegular", sans-serif',fontSize:"13px",fontStyle:"normal",lineHeight:"16px"}),this.element.classList.add("fullscreen-dropdown"),this.nativeOption=(0,l.tT)("div",{style:t,onClick:()=>i()},a.R.nativeFullscreenLabel),this.interactiveOption=(0,l.tT)("div",{style:t,onClick:()=>n()},a.R.interactiveFullscreenLabel),this.element.appendChild(this.nativeOption),this.element.appendChild(this.interactiveOption)}toggleOverlay(e){var t;return!1===(null===(t=this.toggleElement)||void 0===t?void 0:t.classList.contains("disabled"))&&(void 0!==e&&e.composedPath().some((e=>e instanceof Element&&this.element.contains(e)))?this.isShown():this.isShown()?!this.hideElement(e):this.showElement(void 0,e))}isShown(){return"hidden"!==this.element.style.visibility}showElement(){let e=arguments.length>1?arguments[1]:void 0;return!this.isShown()&&((0,r.Ve)(this.element,"100ms"),void 0!==this.toggleElement&&(this.element.style.bottom=`${this.toggleElement.offsetHeight}px`),this.element.style.visibility="visible",this.element.style.opacity="1",this.toggleEvent.fire(new o.XY(!0,e)),this.isShown())}hideElement(e){return!(void 0!==e&&e.composedPath().some((e=>e instanceof Element&&this.element.contains(e)))||(this.element.style.opacity="0",this.element.style.visibility="hidden",this.toggleEvent.fire(new o.XY(!1,e)),this.isShown()))}}},9268:(e,t,i)=>{"use strict";i.d(t,{CG:()=>p,Nb:()=>w,QC:()=>b,Vz:()=>C,WG:()=>v,fS:()=>m,zG:()=>g});var s=i(6064),n=i(6784),o=i(5216),r=i(8423),a=i(2690),l=i(7407),h=i(3004),d=i(4947),c=i(2945),u=i(5389);const p=new r.c_("showJoinOverlay");class m extends a.z{constructor(e){super({easyExit:!0,...e}),this.element.style.display="none",this.element.style.position="absolute",this.element.style.width="560px",this.element.style.height="auto",this.element.style.backgroundColor="#ffffff",this.element.style.border="2px solid #cccccc",this.element.style.borderRadius="20px",this.element.style.padding="10px",this.element.style.top="45px",this.element.style.fontSize="12px",this.element.style.fontFamily="UbuntuRegular', Arial, Helvetica, sans-serif",this.overlay.style.background="",this.overlay.classList.add("blurred-login-overlay"),this.element.appendChild(this.createLoadingSpinner()),this.iframe=document.createElement("iframe"),this.iframe.id="join_iframe",this.iframe.frameBorder="0",this.iframe.marginWidth="0",this.iframe.scrolling="no",this.iframe.marginHeight="0",this.iframe.style.width="560px",this.iframe.style.height="650px",this.iframe.src=`/accounts/register_iframe/?next=${encodeURIComponent(window.location.pathname)}`,this.element.appendChild(this.iframe);const t=document.createElement("hr");t.style.margin="15px 0 10px 0",t.style.border="0",t.style.color="#e4e4e4",t.style.backgroundColor="#e4e4e4",t.style.height="1px",this.element.appendChild(t);const i=document.createElement("span"),r=document.createElement("img");r.src=`${STATIC_URL}arrow_back.gif`,r.style.marginRight="4px",r.style.verticalAlign="bottom",i.appendChild(r),this.registerLaterLink=document.createElement("a"),this.registerLaterLink.innerText=d.R.registerLaterText,this.registerLaterLink.className="nooverlay",i.appendChild(this.registerLaterLink),this.element.appendChild(i);const a=document.createElement("span");a.style.cssFloat="right";const l=document.createElement("img");l.src=`${STATIC_URL}key.gif`,l.style.marginRight="4px",l.style.verticalAlign="bottom",a.appendChild(l);const c=document.createElement("span");c.innerText=d.R.alreadyRegisteredText,c.style.color="#7f7f7f",c.style.position="relative",c.style.top="-1px",c.style.marginRight="2px",a.appendChild(c);const u=document.createElement("a");u.href=(0,o._Y)(h.ii),u.innerText=d.R.loginHereText,u.className="nooverlay",u.style.color="#0a5a83",u.style.position="relative",u.style.top="-1px",u.onmouseenter=()=>{u.style.textDecoration="underline"},u.onmouseleave=()=>{u.style.textDecoration="none"},a.appendChild(u),this.element.appendChild(a),this.overlayClick.listen((()=>{this.hide(),document.body.style.overflow="",document.body.classList.remove("blurred-login-overlay-shown")})),s.Fd.listen((()=>{this.hide(),document.body.style.overflow="",document.body.classList.remove("blurred-login-overlay-shown")})),(0,n.wu)("focus",window,(()=>{(0,o.Aw)("accounts/ajax_check_session_authenticated").then((e=>{JSON.parse(e.responseText).authenticated&&(this.hide(),f.fire(void 0))})).catch((()=>{}))}))}initAndShow(e){this.registerLaterLink.href=(0,o._Y)(e.initialHref),this.registerLaterLink.onclick=e.initialOnClick,(0,n.wu)("click",this.registerLaterLink,(()=>{this.hide(),document.body.style.overflow="",g.fire(void 0)})),super.show(),this.element.style.display="block",this.overlay.style.display="flex",this.overlay.style.alignItems="center",this.overlay.style.justifyContent="center",document.body.style.overflow="hidden",document.body.classList.add("blurred-login-overlay-shown"),this.overlay.appendChild(this.element),this.overlay.style.overflow="auto",this.iframe.onload=()=>{const t=this.iframe.contentDocument;if(this.iframe.contentDocument&&(0,n.wu)("keydown",this.iframe.contentDocument.body,(e=>{"Escape"===e.key&&(this.hide(),document.body.style.overflow="")})),null!==t){const i=t.getElementById("husername");null!==i&&i.focus();const s=t.querySelector("a.next");s.href=(0,o._Y)(e.initialHref),s.onclick=e.initialOnClick,t.querySelectorAll("a.medium_popup_link").forEach((e=>{e.onclick=t=>{t.preventDefault(),(0,u.gr)(e.href,"_blank",u.NL)}}))}},(0,l.bT)("RegisterIframe_Shown")}createLoadingSpinner(){const e=document.createElement("div");return e.style.animationName="spin",e.style.position="absolute",e.style.top="50%",e.style.left="50%",e.style.width="30px",e.style.height="31px",e.style.margin="-15px 0 0 -15px",e.style.background=`url("${STATIC_URL}images/loading_spinner.svg")`,e.style.backgroundSize="cover",e.style.animationName="spin",e.style.webkitAnimationName="spin",e.style.animationDuration="2s",e.style.webkitAnimationDuration="2s",e.style.animationTimingFunction="linear",e.style.webkitAnimationTimingFunction="linear",e.style.animationIterationCount="infinite",e.style.webkitAnimationIterationCount="infinite",e.style.zIndex="-1",e}}const g=new r.c_("registerLaterLinkClicked"),v=new r.c_("commandeerJoinOverlayAnchors",{listenersWarningThreshold:-1,maxHistorySize:1}),f=new r.c_("restoreJoinOverlayAnchors",{listenersWarningThreshold:-1,maxHistorySize:1});let y=!1;class b{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.createElement("a");if(this.anchor=e,void 0!==(0,c.JO)(window.location.search).join_overlay){const e=()=>{y=!0,this.commandeer()};y?window.setTimeout((()=>{this.commandeer()}),0):v.addListener(e,this.anchor);const t=()=>{y=!1,this.restore(),v.removeListener(e),window.setTimeout((()=>{f.removeListener(t)}),0)};f.addListener(t,this.anchor)}}commandeer(){this.initialOnClick=this.anchor.onclick,this.initialHref=(0,o._Y)(this.anchor.href),this.anchor.href=(0,o._Y)(h.k6),this.anchor.onclick=e=>{e.preventDefault(),p.fire(this),f.fire(void 0)}}restore(){this.anchor.onclick=this.initialOnClick,this.anchor.href=(0,o._Y)(this.initialHref),this.initialOnClick=null}}function w(e){for(const t of e.querySelectorAll("a:not(.nooverlay):not([href='#'])"))new b(t)}function C(){const e=document.getElementById("header");null!==e&&w(e);const t=document.getElementById("footer-holder");null!==t&&w(t);const i=document.getElementById("room_list");null!==i&&w(i);const s=document.getElementById("hashtag_ticker");null!==s&&w(s);const n=document.getElementsByClassName("sub-nav");0!==n.length&&w(n[0])}},1448:(e,t,i)=>{"use strict";i.d(t,{CM:()=>B,F1:()=>M,QT:()=>x,U$:()=>R,YC:()=>U,bB:()=>k,dD:()=>H,j7:()=>P,j8:()=>I,mh:()=>F,r_:()=>O,rc:()=>_});var s=i(7623),n=i(9447),o=i(3910),r=i(7660),a=i(9461),l=i(5216),h=i(8122),d=i(2939),c=i(3955),u=i(3654),p=i(4140),m=i(1284),g=i(4580),v=i(7407),f=i(34),y=i(2359),b=i(7569),w=i(4947),C=i(9681),S=i(74);const x=4;let T;function A(e,t){return new C.L(e,t)}function P(e){const t=F(e.fromUser.username),i=(0,m.Sy)();i.style.padding=`0px ${x}px`,i.style.left=`-${x}px`,i.style.width=`calc(100% + ${x}px)`,void 0!==e.backgroundColor&&(i.style.background=e.backgroundColor),M(t,i,h.sY.parseMessage(e)),t.appendChild(i);const o=A(e.fromUser,e);o.element.dataset.paction="Chat",o.element.dataset.pactionName="Username",o.element.style.paddingRight="4px",o.element.dataset.testid="chat-message-username",i.appendChild(o.element);const r=(0,y.e4)(e.message);return(0,n.fZ)(r,"msg-text"),r.classList.add("split-mode"),r.dataset.testid="chat-message-text",void 0!==e.textColor&&(r.style.color=e.textColor),void 0!==e.font&&(o.element.style.fontFamily=e.font,r.style.fontFamily=e.font),i.appendChild(r),(0,s.lT)()?window.setTimeout((()=>{twemoji.parse(t,{className:"emojiChat"})}),0):(0,s.AD)()||twemoji.parse(t,{className:"emojiChat"}),(0,u.Qp)(t),(0,m.V_)(e,t),t}function k(e){if(0===e.mediaList.length)return;const t=F(e.fromUser.username),i=(0,m.Sy)();t.appendChild(i);const s=new r._({messageId:e.messageID,outgoing:e.fromUser.username!==e.otherUsername,mediaList:e.mediaList});return s.element.style.marginTop="6px",i.appendChild(s.element),t.setAttribute("type","photo"),t.dataset.testid="chat-image",(0,m.V_)(e,t),t}function M(e,t,i){const s=void 0!==i.bgDark,n=void 0!==i.fgDark;var o,r;return!(!s&&!n)&&(e.classList.add("dm-adjust"),s&&(t.setAttribute("dm-adjust-bg",i.bgDark),t.setAttribute("dm-init-bg",null!==(o=i.background)&&void 0!==o?o:"")),n&&(t.setAttribute("dm-adjust-fg",i.fgDark),t.setAttribute("dm-init-fg",null!==(r=i.foreground)&&void 0!==r?r:"")),!0)}function R(e,t,i){for(const s of t){const t=document.createElement("div");for(const e of s)switch(e.partType){case 1:t.appendChild(N(e,i));break;case 0:t.appendChild(A(e.user).element);break;case 2:t.appendChild(D(e.message));break;case 3:t.appendChild(L("spy private show",(()=>{"privatespying"!==T.status&&(0,f.lh)(T)})));break;case 4:t.appendChild(L("start private show",(()=>{"privaterequesting"===T.status&&(0,f.sT)()})));break;default:error(`Unknown roomNotice type for: ${JSON.stringify(e)}`)}e.appendChild(t)}return e}function I(e){const t=F(),i=(0,m.Sy)();i.classList.add("msg-text"),i.style.padding=`0px ${x}px`,i.style.left=`-${x}px`,i.style.width=`calc(100% + ${x}px)`,void 0!==e.backgroundColor&&(i.style.background=e.backgroundColor),M(t,i,h.sY.parseMessage(e));const s=A(e.fromUser,e);s.element.dataset.paction="Chat",s.element.dataset.pactionName="Username",s.element.dataset.testid="chat-message-username",s.element.style.paddingRight="4px",i.appendChild(s.element);const n=(0,y.BP)(e,E,S.i5);return n.dataset.testid="chat-message-text",void 0!==e.font&&(s.element.style.fontFamily=e.font,n.style.fontFamily=e.font),i.appendChild(n),t.appendChild(i),(0,h.at)(t,document.body.classList.contains("darkmode")),(0,u.Qp)(t),(0,m.V_)(e,t),t}function E(e,t,i){const s=L(e,i);return s.dataset.testid="shortcode-link",void 0!==t&&""!==t&&(s.href=(0,l._Y)(t),s.target="_blank"),s}function L(e,t){const i=document.createElement("a");return(0,n.fZ)(i,"msg-link"),i.style.textDecoration="underline",i.innerText=e,i.onclick=t,i.style.cursor="pointer",i}function D(e){var t;const i=document.createElement("a");return i.href=(0,l._Y)(`/tag/${e}/${null!==(t=a.Aw.getState().roomGender)&&void 0!==t?t:""}`),(0,n.fZ)(i,n.aG.camSubjectTagColor),i.style.textDecoration="none",i.innerText=`#${e}`,i}function B(e){const t=F();return t.innerText=e,t}function U(e,t){function i(e){const t=document.createElement("span");return t.innerText=e,t}const s=F(),o=t?w.R.pmSupporterNoticeAgeVerified:w.R.pmSupporterNotice;s.appendChild(i(o)),s.appendChild(document.createElement("br")),s.appendChild(i(`${w.R.pmSupporterSignUp} `));const r=L(w.R.pmSupporterMembership,(()=>{}));return r.href=(0,l._Y)(`/supporter/upgrade/?source=${a.Bm.current.PurchaseEventSources.SUPPORTER_SOURCE_PM_UPSELL}`),r.target="_blank",r.dataset.testid="supporter-upsell-link",(0,n.fZ)(r,"msg-link"),r.onclick=()=>{(0,v.bT)("SupporterPageOpened",{source:"chat"})},s.appendChild(r),s.appendChild(i(` ${w.R.pmSupporterSendPm(e)}.`)),s}function F(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=document.createElement("div");return t.dataset.testid="chat-message",t.classList.add("msg-text"),t.style.fontFamily="Tahoma,Arial,Helvetica,sans-serif",t.style.boxSizing="border-box",t.style.paddingTop="2px",t.style.paddingBottom="3px",t.style.paddingLeft="5px",t.style.paddingRight="5px",t.style.overflowWrap="break-word",t.style.wordWrap="break-word",t.style.wordBreak="break-word",e.length>0&&t.setAttribute("data-nick",e),t}function _(){const e=F();(0,c.ZM)(e,{display:"flex",whiteSpace:"nowrap"});const t=document.createElement("div");(0,c.ZM)(t,{display:"inline-block",borderBottom:"1px solid",marginBottom:"10px",width:"100%"}),(0,n.fZ)(t,n.aG.brandColor),e.appendChild(t);const i=document.createElement("div");return i.textContent=w.R.newCapitalized,(0,c.ZM)(i,{display:"inline-block",marginLeft:"12px"}),(0,n.fZ)(i,n.aG.brandColor),e.appendChild(i),e}function N(e,t){return void 0!==e.message&&t&&b.fM.isShortcodeSyntax(e.message)?(0,y.P7)(e,t,E,S.i5):function(e){let t=document.createElement("span");return!1!==e.parseEmoticon?t=(0,y.e4)(e.message):t.innerText=e.message,t.style.color=void 0!==e.foreground?e.foreground:"",t.style.backgroundColor=void 0!==e.background?e.background:"",t.style.fontWeight=void 0!==e.weight?e.weight:"",t}(e)}function O(e,t){const i=F();return i.innerText=e,i.appendChild(t),(0,p.yX)(i,(0,m.Uq)("#aaaaaa")),i.classList.add("roomNotice"),i}function H(e,t){const i=F(t);i.textContent=`${e} `;const s=document.createElement("span");return(0,n.fZ)(s,n.aG.hrefColor),s.textContent=w.R.sendDirectMessageNew,s.style.cursor="pointer",s.onclick=()=>{g.bW.fire(!0),o.$o.fire(t)},s.dataset.testid="send-dm-link",i.appendChild(s),i}d.X0.listen((e=>{T=e.chatConnection}))},3456:(e,t,i)=>{"use strict";i.d(t,{Sz:()=>m,nE:()=>g});var s=i(7063),n=i(7623),o=i(1224),r=i(6784),a=i(3955),l=i(6440),h=i(3124),d=i(5173),c=i(34),u=i(4947),p=i(1372);const m=()=>(0,l.f)("SplitModePrivateShowUX");class g extends d.Q{constructor(){super(),this.requestPending=!1,this.element.dataset.testid="private-show-request-modal",this.element.style.position="absolute",this.element.style.display="none",this.element.style.top="0",this.element.style.left="0",this.overlayClick.listen((()=>{this.hide()})),(0,r.wu)("keydown",document,(e=>{if("Escape"===e.key){if(this.requestPending)return;this.hide()}}))}initUI(e){super.initUI(e),this.privateShowDescription=this.setupPrivateShowBody(),this.confirmationButtonText=(0,p.tT)("p",null,u.R.request),this.confirmationButton=(0,p.tT)("div",{className:"actionButton","data-testid":"private-show-request-action-btn"},this.confirmationButtonText),this.closeIcon=(0,p.tT)("div",{"data-testid":"private-show-request-close-btn",height:"16",width:"16",onClick:()=>this.hide(),className:"closeIcon"});const t=(0,p.tT)("div",{className:"tooltip"},(0,p.tT)("h1",{className:"header","data-testid":"private-show-header",style:o.m.isWhiteLabel?{color:o.m.h1Color}:{}},u.R.privateShowText),this.setUpPrivateShowRateUI(),this.privateShowDescription,this.confirmationButton);this.subwrapper=(0,p.tT)("div",{className:"subwrapper"},(0,p.tT)("div",{className:"privateShowRequestInner"},this.closeIcon,t)),this.wrapper=(0,p.tT)("div",{className:"wrapper"},this.subwrapper),this.element=(0,p.tT)("div",{style:{fontFamily:"Ubuntu, Helvetica, Arial, sans-serif"}},this.wrapper)}setUpPrivateShowRateUI(){return this.showRate=(0,p.tT)("span",null),this.minimumShowTime=(0,p.tT)("span",null),(0,p.tT)("div",{className:"rateContainer"},(0,p.tT)("div",{className:"bluePill"},(0,p.tT)("div",{className:"clockIcon","data-testid":"private-show-rate"}),this.showRate),(0,p.tT)("div",{className:"bluePill","data-testid":"min-show-time"},this.minimumShowTime))}setupPrivateShowBody(){return this.videoRecordingAllowed=(0,p.tT)("div",{className:"itemDescription","data-testid":"video-recording-allowed"},(0,p.tT)("img",{src:`${STATIC_URL_ROOT}tsdefaultassets/ic_videocollection.svg`,height:"12",width:"12"}),(0,p.tT)("p",{style:o.m.isWhiteLabel?{color:o.m.textColor}:{}},u.R.recordedVideo)),(0,p.tT)("div",{className:"privateShowBodyDescriptionWrapper"},(0,p.tT)("hr",{className:"separator"}),(0,p.tT)("div",{className:"privateShowBodyDescription"},(0,p.tT)("div",{className:"itemDescription","data-testid":"private-time-broadcaster"},(0,p.tT)("img",{src:`${STATIC_URL_ROOT}tsdefaultassets/ic_privatetime.svg`,height:"12",width:"12"}),(0,p.tT)("p",{style:o.m.isWhiteLabel?{color:o.m.textColor}:{}},u.R.privateTimeWithBroadcaster)),this.videoRecordingAllowed))}showPending(e){this.requestPending=!0,this.privateShowDescription.style.display="none",this.closeIcon.style.display="none",this.showElement(),this.repositionChildren(),this.hideOverlay(),this.requestPending=!0,this.confirmationButtonText.textContent=u.R.cancelRequest,this.confirmationButton.style.marginTop="10px",this.confirmationButton.onclick=()=>{(0,c.yx)(e,!1),this.hide(),this.requestPending=!1}}show(e){const{chatConnection:t,requirements:i}=e;this.requestPending=!1,this.showRate.textContent=u.R.priceTokensPerMinuteMessage(i.price,!0),this.minimumShowTime.textContent=(0,s.VE)(u.R.privateShowMinimumMinuteMessageV2(parseInt(i.minimumMinutes))),this.privateShowDescription.style.display="block",this.closeIcon.style.display="block",this.videoRecordingAllowed.style.display=i.recordingsAllowed?"flex":"none",this.confirmationButton.style.marginTop="0px",this.confirmationButtonText.textContent=u.R.request,this.stopRequestCallback=e.stopRequest;const n=()=>{this.privateShowDescription.style.display="none",this.closeIcon.style.display="none",e.makeRequest(),this.hideOverlay(),this.requestPending=!0,this.confirmationButtonText.textContent=u.R.cancelRequest,this.confirmationButton.style.marginTop="10px",this.confirmationButton.onclick=()=>{(0,c.yx)(t,!1),this.hide(),this.requestPending=!1}};e.showConfirmation?this.confirmationButton.onclick=()=>{n()}:n(),this.showElement(),this.showOverlay(),this.repositionChildren(),this.wrapper.style.height=`${this.subwrapper.clientHeight}px`}hide(){this.hideElement(),this.hideOverlay(),void 0!==this.stopRequestCallback&&this.stopRequestCallback()}repositionChildren(){const e=document.getElementById("sendTipButton"),t=document.getElementById("ChatTabContainer");if(e&&t){const i=(0,a.$R)(e);if(this.element.style.top=i.top-90+"px",this.element.style.left=`${i.right+15}px`,this.element.style.zIndex="1001",this.isShown()){const e=this.subwrapper.getBoundingClientRect(),s=100;(0,h.K$)()&&((0,n.hj)()||(0,n.J0)())?i.x+e.width>t.getBoundingClientRect().x&&(this.element.style.top=`${i.top+i.height+10}px`,this.element.style.left=i.left-2.2*s+"px"):(i.x+e.width+s>window.innerWidth||i.x<0)&&(this.element.style.left=i.left-s/2+"px")}}}}},9311:(e,t,i)=>{"use strict";i.d(t,{i:()=>n});var s=i(1679);class n extends s.p5{createCommonButton(){const e=super.createCommonButton();return e.dataset.testid="send-tip-button",e.style.fontFamily="UbuntuMedium, Helvetica, Arial, sans-serif",e}}},6283:(e,t,i)=>{"use strict";i.d(t,{q:()=>h});var s=i(1885),n=i(6784),o=i(2939),r=i(1519),a=i(7407),l=i(3860);class h{constructor(){this.messageCount=0,this.messageSuccessCount=0,this.tipSuccessCount=0,this.tipSuccessTotal=0,this.tipFailCount=0,this.tipFailTotal=0,this.chatConnection=void 0,this.tipCallout=void 0,this.actionName="SessionMetrics",this.sendMetrics=()=>{this.careAboutMetrics()&&((0,a.bT)(this.actionName,this.getPageActionAttributes()),this.resetMetrics())},this.onModeChange=()=>{(0,a.NP)(this.getMode()),(0,a.bT)("ChangeVideoMode",{videoMode:this.getMode()}),this.careAboutMetrics()&&this.modeChangeDebounce.callFunc()},this.onTipSent=e=>{void 0!==e.amount&&(!0===e.success?(this.tipSuccessCount+=1,this.tipSuccessTotal+=e.amount):(this.tipFailCount+=1,e.amount>0&&(this.tipFailTotal+=e.amount)))},this.onMessageSent=()=>{this.messageCount+=1},this.onMessageReceived=e=>{void 0!==this.chatConnection&&e.fromUser.username===this.chatConnection.username()&&this.messageSuccessCount{if(this.careAboutMetrics()){const e={href:window.location.href,unloadTimestamp:(new Date).getTime()};try{window.sessionStorage.setItem("refreshMeta",JSON.stringify(e))}catch{return}}},this.resetMetrics(),this.loadTimestamp=(new Date).getTime(),this.pageRefreshed=this.wasRefresh(),this.currentMode=l.L.getVideoMode(),(0,a.NP)(this.currentMode),this.modeChangeDebounce=new r.a((()=>{const e=this.getMode();this.currentMode!==e&&(this.newMode=e,this.sendMetrics(),this.currentMode=e)}),{bounceLimitMS:100,debounceType:1}),o.X0.once((()=>{this.setupModeChangeListener()})),o.Gr.listen(this.sendMetrics),(0,n.wu)("beforeunload",window,this.sendMetrics),(0,n.wu)("beforeunload",window,this.saveRefreshMeta)}setupModeChangeListener(){l.L.changeVideoMode.listen(this.onModeChange)}bindChatConnection(e){e!==this.chatConnection&&(void 0!==this.chatConnection&&(this.chatConnection.event.messageSent.removeListener(this.onMessageSent),this.chatConnection.event.roomMessage.removeListener(this.onMessageReceived),s.J9.removeListener(this.onMessageReceived)),this.chatConnection=e,this.chatConnection.event.messageSent.listen(this.onMessageSent),this.chatConnection.event.roomMessage.listen(this.onMessageReceived),s.J9.listen(this.onMessageReceived))}bindTipCallout(e){return e!==this.tipCallout&&(void 0!==this.tipCallout&&this.tipCallout.tipSent.removeListener(this.onTipSent),this.tipCallout=e,this.tipCallout.tipSent.listen(this.onTipSent,!1),!0)}careAboutMetrics(){return void 0!==this.chatConnection&&!this.chatConnection.viewerIsAnonymous()}resetMetrics(){this.messageCount=0,this.messageSuccessCount=0,this.tipSuccessCount=0,this.tipSuccessTotal=0,this.tipFailCount=0,this.tipFailTotal=0,this.newMode=void 0,this.pageRefreshed=!1}getPageActionAttributes(){return{messageSuccessCount:this.messageSuccessCount,messageFailCount:this.messageCount-this.messageSuccessCount,tipSuccessCount:this.tipSuccessCount,tipSuccessTotal:this.tipSuccessTotal,tipFailCount:this.tipFailCount,tipFailTotal:this.tipFailTotal,refreshCount:void 0===this.pageRefreshed?void 0:Number(this.pageRefreshed),modeChange:Boolean(this.newMode),newMode:this.newMode,currentMode:this.currentMode}}getMode(){return l.L.getVideoMode()}getNavigationType(){if(void 0!==window.performance){let e=[];if(void 0!==window.performance.getEntriesByType&&(e=window.performance.getEntriesByType("navigation")),!(e.length>0))return window.performance.navigation.type;switch(e[0].type){case"navigate":return 0;case"reload":return 1;case"back_forward":return 2;case"prerender":return 3;default:return 255}}}getRefreshMeta(){try{var e;const t=null===(e=window.sessionStorage)||void 0===e?void 0:e.getItem("refreshMeta");return null!==t?JSON.parse(t):void 0}catch{return}}wasRefresh(){const e=this.getNavigationType();if(1===e)return!0;if(0===e||void 0===e){const e=this.getRefreshMeta();if(void 0===e)return;return e.href===window.location.href&&e.unloadTimestamp>this.loadTimestamp-1e4}return!1}}},8331:(e,t,i)=>{"use strict";i.d(t,{M0:()=>F,RH:()=>O,fM:()=>V,Ls:()=>N,h4:()=>H});var s=i(7623),n=i(9447),o=i(3956),r=i(369),a=i(1848),l=i(6784),h=i(213),d=i(2939),c=i(2709),u=i(3955),p=i(8423),m=i(9060),g=i(1779),v=i(6716),f=i(8936),y=i(7407),b=i(9321),w=i(34),C=i(8255),S=i(2146),x=i(3320),T=i(4947),A=i(2945),P=i(4110),k=i(3860),M=i(3306),R=i(1372);const I=new p.c_("hideAllTheaterControlsTooltips");class E extends c.u{constructor(e){super("div",e),this.disabled=!1,this.tooltipDisabled=!1}initUI(e){var t;const i={display:"inline-flex",position:"relative",alignItems:"center",justifyContent:"center",padding:(0,m.ng)()?"":"0px 6px",minWidth:(0,m.ng)()?"32px":"20px",userSelect:"none"};this.element=(0,R.tT)("div",{style:i,className:"hover-btn drop-shadow-container","aria-label":e.tooltipText},(0,R.tT)("img",{ref:e=>this.icon=e,src:e.iconPath,draggable:!1,alt:e.tooltipText})),this.initHoverListeners(),this.hideElement(),this.showElement(),null!==(t=e.noTooltip)&&void 0!==t&&t||this.addTooltip()}initData(e){this.hideCallback=e.hideCallback,this.disableCallback=e.disableCallback,this.tooltipText=e.tooltipText}initHoverListeners(){(0,u.JR)(this.element,{ignoreTouch:!0}).listen((e=>{e?(0,n.fZ)(this.element,"hovering"):(0,n.SA)(this.element,"hovering")}))}isHovering(){return this.element.classList.contains("hovering")}getTooltipText(){return this.tooltipText}setTooltipText(e){var t;void 0===this.tooltip&&this.addTooltip(),this.tooltipText=e,null===(t=this.tooltip)||void 0===t||t.refreshTooltip.fire()}clearTooltipText(){var e;this.tooltipText=void 0,null===(e=this.tooltip)||void 0===e||e.refreshTooltip.fire()}getTooltipTextOverride(){return this.tooltipTextOverride}setTooltipTextOverride(e){var t;void 0===this.tooltip&&this.addTooltip(),this.tooltipTextOverride=e,null===(t=this.tooltip)||void 0===t||t.refreshTooltip.fire()}clearTooltipTextOverride(){var e;this.tooltipTextOverride=void 0,null===(e=this.tooltip)||void 0===e||e.refreshTooltip.fire()}updateIcon(e){this.icon.src=e}changeIconAnimation(e){void 0!==this.animationClass&&this.icon.classList.remove(this.animationClass),this.animationClass=e,this.icon.classList.add("animated-icon"),this.icon.classList.add(e)}addTooltip(){void 0===this.tooltip&&(this.tooltip=new D({triggerElement:this}),this.addChild(this.tooltip))}removeTooltip(){void 0!==this.tooltip&&(this.removeChild(this.tooltip),this.tooltip=void 0,this.clearTooltipTextOverride())}disable(){var e;this.disabled=!0,(0,n.fZ)(this.element,"disabled"),this.element.ariaDisabled="true",null===(e=this.disableCallback)||void 0===e||e.call(this)}enable(){this.disabled=!1,(0,n.SA)(this.element,"disabled"),this.element.removeAttribute("aria-disabled")}isDisabled(){return this.disabled}disableTooltip(){this.tooltipDisabled=!0}enableTooltip(){this.tooltipDisabled=!1}isTooltipDisabled(){return this.tooltipDisabled}hideElement(){var e;super.hideElement(),null===(e=this.hideCallback)||void 0===e||e.call(this)}hideVisibility(){var e;this.element.style.visibility="hidden",null===(e=this.hideCallback)||void 0===e||e.call(this)}showVisibility(){this.element.style.visibility=""}}class L extends E{constructor(e){super(e)}initUI(e){var t;this.element=(0,R.tT)("div",{style:{display:"inline-flex",position:"relative",alignItems:"center",userSelect:"none",justifyContent:"center"},className:"hover-btn drop-shadow-container","aria-label":e.labelText},(0,R.tT)("img",{ref:e=>this.icon=e,src:e.iconPath,draggable:!1,alt:e.labelText}),(0,R.tT)("span",{ref:e=>this.textSpan=e,style:{color:"#ffffff",fontSize:"13px",padding:"5px",display:"inline-block",textAlign:"right"}},(0,R.tT)("p",{ref:e=>this.textP=e,style:{display:"inline"}},e.labelText))),this.initHoverListeners(),this.hideElement(),this.showElement(),null!==(t=e.noTooltip)&&void 0!==t&&t||this.addTooltip()}getLabelText(){var e;return null!==(e=this.textP.textContent)&&void 0!==e?e:""}setTooltipTextFromLabel(){this.setTooltipText(this.getLabelText())}updateTextLabel(e){this.textP.textContent=e,this.repositionChildren()}hideTextLabel(){this.element.style.width="32px",this.textSpan.style.display="none"}showTextLabel(){this.element.style.width="",this.textSpan.style.display="inline-block"}repositionChildren(){if(null===this.textP.textContent)return;let e;H?(this.textSpan.style.textAlign="right",e=N-this.icon.offsetWidth-10-1):(this.textSpan.style.textAlign="left",this.textSpan.style.width="",e=this.textSpan.offsetWidth-10+1);const t=(0,u.q_)(this.textP.textContent,this.textP);this.textSpan.style.width=t>2*e?Math.ceil(t)/2+10+1+"px":t>e?`${e}px`:"",this.textSpan.style.width=`${this.textP.offsetWidth+1}px`}}class D extends c.u{constructor(e){super("div",e)}initData(e){super.initData(e),this.triggerElement=e.triggerElement,this.refreshTooltip=new p.c_("refreshTooltip")}initUI(e){(0,u.JR)(e.triggerElement,{ignoreTouch:!0}).listen((t=>{if(!e.triggerElement.isTooltipDisabled())if(t){const e=this.getTooltipText();if(void 0===e)return;this.showTooltip(e)}else this.hideTooltip()})),I.listen((()=>{this.hideTooltip()}),!1),this.refreshTooltip.listen((()=>this.refreshTooltipFn()),!1),this.element=(0,R.tT)("div",{style:{position:"absolute",display:"block",visibility:"hidden",opacity:"0",bottom:"calc(100% + 5px)",left:"50%",transform:"translateX(-50%)",borderRadius:"4px",backgroundColor:"rgba(0, 0, 0, .92)",padding:"8px 16px",textAlign:"center",fontSize:"13px",color:"#ffffff",width:"max-content",maxWidth:"150px",transition:"inherit",pointerEvents:"none"},className:"no-drop-shadow video-controls-tooltip"},(0,R.tT)("p",{ref:e=>this.textP=e,style:{display:"inline"}})),this.recalculateWidth()}getTooltipText(){let e;return"tooltipTextOverride"in this.triggerElement&&(e=this.triggerElement.getTooltipTextOverride()),void 0===e&&(e=this.triggerElement.getTooltipText()),e}showTooltip(e){this.textP.textContent=e,this.recalculateWidth(),this.repositionTooltipX(),this.element.style.visibility="",this.element.style.opacity="1"}hideTooltip(){this.element.style.opacity="0",this.element.style.visibility="hidden"}refreshTooltipFn(){if("hidden"===this.element.style.visibility&&!this.triggerElement.isHovering())return;const e=this.getTooltipText();void 0!==e?this.showTooltip(e):this.hideTooltip()}repositionTooltipX(){var e;this.element.style.left="50%",this.element.style.transform="translateX(-50%)";const t=this.element.getBoundingClientRect(),i=null===(e=document.getElementById("TheaterModePlayer"))||void 0===e?void 0:e.getBoundingClientRect();void 0!==i&&i.rightt.left-5&&(this.element.style.left=`${this.element.offsetLeft+(i.left-t.left+5)}px`)}showElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block";super.showElement(e),this.repositionTooltipX()}recalculateWidth(){null!==this.textP.textContent&&(0,u.q_)(this.textP.textContent,this.textP)>149?(this.element.style.width="150px",this.element.style.width=`${this.textP.offsetWidth+1}px`):this.element.style.width="max-content"}}var B=i(74),U=i(3058);const F=(0,m.c5)()?40:32,_=(0,m.c5)()?40:26,N=(0,m.c5)()?150:100,O=(0,m.c5)()?940:750;let H=!1;const W="videoControls",$=(0,m.ng)()?`${STATIC_URL}theaterVideoControlsIcons/`:STATIC_URL;class V extends c.u{updatePlayerData(e){var t,i;this.playerElement=e.element,this.playerSupportsAutoplayWithAudio=e.playerComponent.supportsAutoplayWithAudio,e.playerComponent instanceof b.O?(this.playerIsJPEG=!0,this.playerIsHlsPlaceholder=e.playerComponent.getIsHlsPlaceholder()):(this.playerIsJPEG=!1,this.playerIsHlsPlaceholder=!1),this.isEmbed=e.isEmbed(),(0,m.c5)()&&this.isEmbed&&(null===(t=(i=e.playerComponent).removeFullscreenDropdown)||void 0===t||t.call(i))}constructor(e,t){super(),this.player=e,this.forceHlsPlayerEvent=new p.c_("forceHlsPlayerEvent"),this.setPlayerComponentMutedEvents=new p.c_("setPlayerComponentMutedEvents"),this.setPlayerComponentVolumeMutedEvents=new p.c_("setPlayerComponentVolumeMutedEvents"),this.playerComponentEnterFullScreenModeEvent=new p.c_("playerComponentEnterFullScreenModeEvent"),this.playerComponentReadjustForceHlsOverlayOrderEvent=new p.c_("playerComponentReadjustForceHlsOverlayOrderEvent"),this.playerComponentReadjustPlayButtonContainerEvent=new p.c_("playerComponentReadjustPlayButtonContainerEvent"),this.showJpegPlayerComponentImage=new p.c_("showJpegPlayerComponentImage"),this.requestQualityModalVisibilityChange=new p.c_("requestVideoQualityButtonVisibilityChange"),this.videoOfflineChange=new p.c_("videoOfflineChange"),this.state={volume:60,isMuted:!0},this.isOffline=!1,this.isAgeVerified=!1,this.isFullscreenAvailable=!1,this.hideControlsCalled=!1,this.visible=!1,this.locked=!1,this.subMenusShown={videoQualityMenu:!1,switchFullscreenMenu:!1},this.isHoveringButton=!1,this.forceHlsTriggered=!1,this.forceHlsPlayButtonCreated=!1,this.hlsWaitingForInteraction=!1,this.privateAllowed=!1,this.updatePlayerData(e);const i=(0,A.JO)(window.location.search).disable_sound;if(void 0!==i&&"true"===i.toLowerCase()||"1"===i)this.state.volume=0,this.state.isMuted=!0;else if((0,s.Pf)()){const e=window.localStorage.getItem(W);if(null!==e){const t=JSON.parse(e);this.state={volume:t.volume,isMuted:!this.playerSupportsAutoplayWithAudio||t.isMuted}}else this.state.isMuted=!this.playerSupportsAutoplayWithAudio}(0,y.yC)(this.state.volume,this.state.isMuted),this.browserUserAgent=window.navigator.userAgent,this.element.classList.add("theater-video-controls"),this.element.style.overflow="",this.element.style.bottom="0",this.element.style.left="0",(0,m.c5)()?((0,n.fZ)(this.element,"dark-gradient-bg"),(0,u.ZM)(this.element,{zIndex:14,display:"flex",alignItems:"stretch",justifyContent:"space-between"}),this.hideElement()):(0,n.fZ)(this.element,"light-gradient-bg"),this.element.style.height=`${_}px`,(0,m.c5)()?this.initButtonsNewVideoControls(t):this.initButtons(t),d.X0.listen((e=>{e.dossier.isAgeVerified?(this.privateAllowed=e.dossier.allowPrivateShow,this.showHidePrivateButton(e.chatConnection.status),e.chatConnection.event.statusChange.listen((e=>{this.showHidePrivateButton(e.currentStatus),"privatespying"===e.currentStatus&&v.F_.fire(void 0),this.showHideHlsPlayButton(e.currentStatus),(0,m.c5)()&&!(0,C.x_)(e.currentStatus)&&("noninteractive-fullscreen"===k.L.getVideoMode()&&(this.updateFullScreenButton(),(0,g.Eh)()),this.videoQualityIconButton.icon.src="",this.maybeHideVideoQualityIconVisibility()),(0,m.ng)()&&(this.isOffline="offline"===e.currentStatus,this.updateIconsOnOfflineChange())})),e.chatConnection.event.settingsUpdate.listen((t=>{this.privateAllowed=t.allowPrivateShow&&e.dossier.isAgeVerified,this.showHidePrivateButton(e.chatConnection.status)}))):(this.privateAllowed=!1,this.showHidePrivateButton(e.chatConnection.status)),this.currentRoomContext=e,this.playerIsHlsPlaceholder&&!this.forceHlsPlayButtonCreated&&(this.forceHlsPlayButtonCreated=!0,this.createForceHlsPlayButton(),this.showHideHlsPlayButton(e.dossier.roomStatus)),this.isAgeVerified=e.dossier.isAgeVerified,this.isOffline="offline"===e.dossier.roomStatus,this.updateVolumeImage(),this.playerIsJPEG||this.updateVolumeInternal(),this.updateIcons(),this.showControls()})),(0,m.ng)()||this.player.videoOfflineChange.listen((e=>{this.isOffline=e})),this.player.roomStatusNotifier.displayChanged.listen((()=>{this.updateFullScreenButton()})),k.L.changeVideoMode.listen((()=>{(0,m.c5)()&&"noninteractive-fullscreen"===k.L.getVideoMode()?this.hide():(this.updateControlButtonSpacing(),this.show(),this.updateIcons()),(0,m.c5)()&&I.fire()})),r.oO.listen((e=>{this.visible&&e||this.showControls()})),P.kw.listen((()=>{this.mute()})),w.Lz.listen((()=>{this.forceHlsOverlayFunc()}),!1),g._c.listen((()=>{(0,g.aS)()&&(0,g.Gy)()===this.fullscreenDiv&&k.L.setFireVideoMode("fullscreen")})),(0,m.c5)()||(this.element.onmousemove=()=>{this.showControls()}),(0,l.wu)("touchstart",this.playerElement,(()=>{(0,m.c5)()?"split"===k.L.getVideoMode()&&this.showControls():this.showControls()})),(0,m.c5)()&&(0,l.wu)("touchstart",this.element,(()=>{this.showControls()})),this.hide()}initButtons(e){this.createVolumeIcon(),this.element.appendChild(this.volumeIconDOM),this.createVolumeSlider(),this.element.appendChild(this.volumeSlider.element),this.createVideoQualityButton(e),this.element.appendChild(this.videoQualityButtonDOM),this.middleControls=new a.m,this.middleControls.element.dataset.paction="TheaterOverlayTabs",this.middleControls.element.style.position="absolute",this.middleControls.element.style.bottom="0",this.middleControls.element.style.right="0",this.middleControls.element.style.textAlign="right",this.addChild(this.middleControls),this.createPrivateButton(),this.middleControls.element.appendChild(this.privateButtonDOM),this.createShowMyCamButton(),(0,o.Md)(this.showMyCamButtonDOM,this.videoOfflineChange)&&this.middleControls.element.appendChild(this.showMyCamButtonDOM),this.createSendTipButton(),this.middleControls.element.appendChild(this.sendTipButtonDOM),this.createChatButton(),this.middleControls.element.appendChild(this.chatButtonDOM),this.createUserListButton(),this.middleControls.element.appendChild(this.userListButtonDOM),this.createMoreRoomsButton(),this.middleControls.element.appendChild(this.moreRoomsButtonDOM),this.createTheaterModeButton(),this.createFullScreenButton(),this.middleControls.element.appendChild(this.theaterModeButtonDOM),this.middleControls.element.appendChild(this.fullscreenButtonDOM)}initButtonsNewVideoControls(e){if(!(0,m.c5)())return this.initButtons(e);this.leftControls=new a.m,(0,u.ZM)(this.leftControls,{position:"relative",display:"flex",flexGrow:0,flexShrink:0,alignItems:"stretch",justifyContent:"flex-start",minHeight:"100%",overflow:"visible",paddingLeft:(0,m.ng)()?"14px":"15px",paddingRight:"11px"}),this.addChild(this.leftControls),this.createVolumeIconNewVideoControls(),this.leftControls.addChild(this.volumeIconButton),this.createVolumeSlider(),this.leftControls.addChild(this.volumeSlider),this.createVideoQualityButton(e),this.createVideoQualityIconButton(e),this.leftControls.addChild(this.videoQualityIconButton),this.middleControls=new a.m,this.middleControls.element.dataset.paction="TheaterOverlayTabs",this.middleControls.element.classList.add("theater-overlay"),(0,u.ZM)(this.middleControls,{position:"relative",display:"flex",flexGrow:1,flexShrink:0,alignItems:"stretch",justifyContent:"center",minHeight:"100%",overflow:"visible"}),this.addChild(this.middleControls),this.createPrivateButton(),this.middleControls.addChild(this.privateIconTextButton),this.createShowMyCamButton(),this.showMyCamIconTextButton&&(0,o.n8)(this.showMyCamIconTextButton,this.videoOfflineChange)&&this.middleControls.addChild(this.showMyCamIconTextButton),this.createSendTipButton(),this.middleControls.addChild(this.sendTipIconTextButton),this.createChatButton(),this.middleControls.addChild(this.chatIconTextButton),this.createUserListButton(),this.middleControls.addChild(this.userListIconTextButton),this.createMoreRoomsButton(),this.middleControls.addChild(this.moreRoomsIconTextButton),this.rightControls=new a.m,(0,u.ZM)(this.rightControls,{position:"relative",display:"flex",flexGrow:0,columnGap:(0,m.ng)()?"0px":"",paddingRight:(0,m.ng)()?"14px":"",flexShrink:(0,m.ng)()?1:0,alignItems:"stretch",justifyContent:"flex-end",minHeight:"100%",overflow:"visible"}),this.addChild(this.rightControls),this.createTheaterModeButton(),this.createFullScreenButton(),this.createTheaterModeIconButton(),this.rightControls.addChild(this.theaterModeIconButton),this.createFullscreenIconButton(),this.rightControls.addChild(this.fullscreenIconButton),this.createSwitchFSModeIconButton(),this.rightControls.element.appendChild(this.switchFSModeIconButton.element),this.rightControls.element.appendChild(this.switchFSModeDropdown.element),this.initButtonHoverListeners()}createVideoQualityButton(e){if(this.videoQualityButtonDOM=z(""),this.videoQualityButtonDOM.title=T.R.videoQualityLabel,this.videoQualityButtonDOM.style.position="absolute",this.videoQualityButtonDOM.style.left="103px",this.videoQualityButtonDOM.style.bottom="0",this.videoQualityButtonDOM.dataset.testid="video-quality-btn",!(0,m.c5)()){const t=t=>{const i=t.target;this.videoQualityButtonDOM.contains(i)||e.element.contains(i)||this.requestQualityModalVisibilityChange.fire(!1)};(0,l.wu)("touchend",document,t)}this.videoQualityButtonDOM.ontouchstart=()=>{this.requestQualityModalVisibilityChange.fire(!0)},this.videoQualityButtonDOM.onmouseover=()=>{this.requestQualityModalVisibilityChange.fire(!0)},this.videoQualityButtonDOM.onmouseout=t=>{if(null===t.relatedTarget)return;const i=t.relatedTarget.parentNode;null===i||i.isEqualNode(e.element)||this.requestQualityModalVisibilityChange.fire(!1)}}createVideoQualityIconButton(e){this.videoQualityIconButton=new E({iconPath:"",tooltipText:T.R.videoQualityLabel,hideCallback:()=>{this.requestQualityModalVisibilityChange.fire(!1)}}),this.videoQualityIconButton.element.dataset.testid="video-quality-btn",(0,m.ng)()?(0,u.ZM)(this.videoQualityIconButton,{margin:"0 6px"}):(0,u.ZM)(this.videoQualityIconButton,{marginLeft:"16px",padding:"6px 0px"}),(0,u.ZM)(this.videoQualityIconButton.icon,{width:"32px"}),this.isAutoQuality=!0,(0,l.wu)("click",this.videoQualityIconButton.element,(()=>{"hidden"===e.element.style.visibility?this.requestQualityModalVisibilityChange.fire(!0):this.requestQualityModalVisibilityChange.fire(!1)})),e.notifyVisibilityChanged.listen((e=>{var t,i;e?(null===(t=this.videoQualityIconButton.tooltip)||void 0===t||t.hideElement(),this.videoQualityIconButton.element.style.opacity="1",this.subMenusShown.videoQualityMenu=!0,this.lockShowingControls()):(null===(i=this.videoQualityIconButton.tooltip)||void 0===i||i.showElement(),this.videoQualityIconButton.element.style.opacity="",this.subMenusShown.videoQualityMenu=!1,this.shouldUnlockControls()&&this.unlockShowingControls())}))}createVolumeSlider(){if(this.volumeSlider=new G({handleDiameter:12,barWidth:50}),(0,m.c5)()){(0,u.ZM)(this.volumeSlider,{position:"relative",display:"inline-flex",marginBlock:"auto",marginLeft:(0,m.ng)()?"6px":"11px",marginRight:(0,m.ng)()?"6px":""}),this.volumeSlider.tooltipText=T.R.volumeLabel;const e=new D({triggerElement:this.volumeSlider});(0,u.ZM)(e,{bottom:`calc(100% + ${(F-12)/2+5}px)`}),this.volumeSlider.addChild(e),this.volumeSlider.element.ariaLabel=T.R.volumeSliderLabel,this.volumeSlider.element.classList.add("hover-btn"),this.volumeSlider.element.classList.add("drop-shadow-container")}else this.volumeSlider.element.title=T.R.volumeSliderLabel,this.volumeSlider.element.style.margin="6px 5px 0 0",this.volumeSlider.element.style.position="absolute",this.volumeSlider.element.style.bottom="7px",this.volumeSlider.element.style.left="36px";this.volumeSlider.element.dataset.testid="volume-slider";const e=e=>{e!==this.state.volume&&(this.state.volume=e,this.state.isMuted=0===this.state.volume,this.updatePlayerVolume(),this.updateVolumeImage(),this.saveSettings())};this.volumeSlider.valueChangeStart.listen((t=>{this.playerIsJPEG&&void 0!==this.currentRoomContext&&this.requestHLS(this.currentRoomContext),this.setPlayerComponentMutedEvents.fire(!1),e(t)})),this.volumeSlider.valueChanged.listen(e),this.volumeSlider.valueChangeEnd.listen((t=>{e(t),0===this.state.volume&&this.setPlayerComponentMutedEvents.fire(!0),(0,y.bT)("ChangeVolume",{volume:t}),this.saveSettings()})),(0,s.J0)()&&this.volumeSlider.hideElement()}createVolumeIconNewVideoControls(){(0,m.c5)()&&(this.volumeIconButton=new E({iconPath:"",tooltipText:T.R.volumeLabel}),this.volumeIconDOM=this.volumeIconButton.element,(0,m.ng)()||(this.volumeIconButton.icon.style.width="22px",this.volumeIconDOM.style.padding="0px 5px"),this.volumeIconDOM.dataset.testid="volume-button",(0,l.wu)("click",this.volumeIconDOM,(()=>{if(!this.playerIsJPEG||this.browserUserAgent.indexOf("MSIE 10.0")>-1||this.browserUserAgent.indexOf("MSIE 9.0")>-1)(0,y.bT)("ToggleMute",{newState:!this.state.isMuted}),(0,y.bT)("ChangeVolume",{volume:this.state.volume}),this.state.isMuted?this.unmute():this.mute(),this.showControls();else{if(void 0===this.currentRoomContext)return void error("unexpected switch to hls",{},"VIDEO_");this.requestHLS(this.currentRoomContext)}})))}createVolumeIcon(){this.volumeIconDOM=document.createElement("img"),this.volumeIconDOM.title=T.R.volumeLabel,this.volumeIconDOM.style.height="24px",this.volumeIconDOM.style.width="24px",this.volumeIconDOM.style.margin="0 6px 2px",this.volumeIconDOM.style.cursor="pointer",this.volumeIconDOM.style.position="absolute",this.volumeIconDOM.style.bottom="0",this.volumeIconDOM.dataset.testid="volume-button",this.volumeIconDOM.onclick=()=>{if(!this.playerIsJPEG||this.browserUserAgent.indexOf("MSIE 10.0")>-1||this.browserUserAgent.indexOf("MSIE 9.0")>-1)(0,y.bT)("ToggleMute",{newState:!this.state.isMuted}),(0,y.bT)("ChangeVolume",{volume:this.state.volume}),this.state.isMuted?this.unmute():this.mute(),this.showControls();else{if(void 0===this.currentRoomContext)return void error("unexpected switch to hls",{},"VIDEO_");this.requestHLS(this.currentRoomContext)}}}createPrivateButton(){(0,m.c5)()?(this.privateIconTextButton=new L({iconPath:`${$}private-show.svg`,labelText:T.R.privateText}),this.privateIconTextButton.element.dataset.testid="private-show-btn",this.privateIconTextButton.setTooltipTextOverride(T.R.waitingToConnect),this.privateIconTextButton.disable(),(0,m.ng)()||(this.privateIconTextButton.icon.style.paddingBottom="4px"),this.privateButtonDOM=this.privateIconTextButton.element):this.privateButtonDOM=z(T.R.privateText),(0,l.wu)("click",this.privateButtonDOM,(()=>{(0,m.c5)()&&this.privateIconTextButton.isDisabled()||v.F_.fire(void 0)}))}createShowMyCamButton(){(0,m.c5)()?(this.showMyCamIconTextButton=new L({iconPath:`${$}cam-to-cam.svg`,labelText:T.R.showMyCamShow,noTooltip:!0}),this.showMyCamButtonDOM=this.showMyCamIconTextButton.element):this.showMyCamButtonDOM=z(T.R.showMyCamShow),this.showMyCamButtonDOM.dataset.testid="cam-to-cam-button"}createSendTipButton(){if((0,m.c5)()){let e;e=(0,m.ng)()?`${$}tip-icon.svg`:`${STATIC_URL_MOBILE}tipicons/tip-icon-white.svg`,this.sendTipIconTextButton=new L({iconPath:e,labelText:T.R.sendTipButtonText,noTooltip:!0}),(0,m.ng)()||(this.sendTipIconTextButton.icon.style.height="20px"),this.sendTipButtonDOM=this.sendTipIconTextButton.element}else this.sendTipButtonDOM=z(T.R.sendTipButtonText);this.sendTipButtonDOM.id="send-tip",(0,l.wu)("click",this.sendTipButtonDOM,(()=>{v.f6.fire({})}))}createChatButton(){(0,m.c5)()?(this.chatIconTextButton=new L({iconPath:`${$}chat.svg`,labelText:T.R.chatCapitalized,noTooltip:!0}),this.chatButtonDOM=this.chatIconTextButton.element):this.chatButtonDOM=z(T.R.chatCapitalized),this.chatButtonDOM.id="chat-btn",this.chatButtonDOM.style.display="none",(0,l.wu)("click",this.chatButtonDOM,(()=>{v.y6.fire(void 0)}))}createUserListButton(){(0,m.c5)()?(this.userListIconTextButton=new L({iconPath:`${$}users.svg`,labelText:T.R.usersText,noTooltip:!0}),this.userListButtonDOM=this.userListIconTextButton.element,U.K.listen((e=>{var t,i;null===(t=this.userListIconTextButton)||void 0===t||t.updateTextLabel(`${T.R.usersText} (${e})`),(0,m.ng)()&&H&&(null===(i=this.userListIconTextButton)||void 0===i||i.setTooltipTextFromLabel())}))):(this.userListButtonDOM=z(`${T.R.usersText} (0)`),U.K.listen((e=>{this.userListButtonDOM.innerText=`${T.R.usersText} (${e})`}))),this.userListButtonDOM.id="user-list",this.userListButtonDOM.dataset.pactionName="Users",(0,l.wu)("click",this.userListButtonDOM,(()=>{v.p3.fire(void 0)}))}createMoreRoomsButton(){(0,m.c5)()?(this.moreRoomsIconTextButton=new L({iconPath:`${$}more-rooms.svg`,labelText:T.R.moreRoomsText,noTooltip:!0}),this.moreRoomsButtonDOM=this.moreRoomsIconTextButton.element):this.moreRoomsButtonDOM=z(T.R.moreRoomsText),this.moreRoomsButtonDOM.id="more-rooms",(0,l.wu)("click",this.moreRoomsButtonDOM,(()=>{(0,m.ng)()&&this.moreRoomsIconTextButton.isDisabled()||P.nw.fire(void 0)}))}createTheaterModeIconButton(){this.theaterModeIconButton=new E({iconPath:`${$}theater-mode.svg`,tooltipText:T.R.theaterModeLabel}),this.theaterModeIconButton.changeIconAnimation("scale-wide"),this.theaterModeIconButton.element.id="theater-mode-icon",(0,l.wu)("click",this.theaterModeIconButton.element,(()=>{I.fire();let e="split";"split"===k.L.getVideoMode()&&(e="theater"),k.L.setFireVideoMode(e),this.updateIcons()}))}createTheaterModeButton(){this.theaterModeButtonDOM=z(T.R.theaterModeLabel),this.theaterModeButtonDOM.onclick=()=>{let e="split";"split"===k.L.getVideoMode()&&(e="theater"),k.L.setFireVideoMode(e),this.updateIcons()}}createFullscreenIconButton(){this.isFullscreenAvailable=(0,g.T1)()||(0,s.OF)(),(0,l.wu)((0,g.bR)(),document,(()=>{(0,g.aS)()||(this.isFullscreenAvailable=!1,this.updateFullScreenButton(),(0,h.Q$)("Full screen is unavailable."))}));const e=(0,m.ng)()?`${$}fullscreen.svg`:`${$}full-screen.svg`;this.fullscreenIconButton=new E({iconPath:e,tooltipText:T.R.fullScreenLabel}),this.fullscreenIconButton.changeIconAnimation("scale-big"),this.fullscreenIconButton.element.id="full-screen-icon",this.updateFullScreenButton(),(0,l.wu)("click",this.fullscreenIconButton.element,(()=>{I.fire(),this.toggleFullscreen()})),(0,l.wu)("dblclick",this.player.playerComponent.element,(()=>{this.isFullscreenAvailable&&["split","theater","fullscreen"].includes(k.L.getVideoMode())&&(I.fire(),this.toggleFullscreen())}))}createFullScreenButton(){this.isFullscreenAvailable=(0,g.T1)()||(0,s.OF)(),(0,l.wu)((0,g.bR)(),document,(()=>{(0,g.aS)()||(this.isFullscreenAvailable=!1,this.updateFullScreenButton(),(0,h.Q$)("Full screen is unavailable."))})),this.fullscreenButtonDOM=z(T.R.fullScreenLabel),this.fullscreenButtonDOM.style.display="none",this.fullscreenButtonDOM.id="full-screen",this.updateFullScreenButton(),this.fullscreenButtonDOM.onclick=()=>{this.toggleFullscreen()}}createSwitchFSModeIconButton(){const e=()=>{var e,t;null!==(e=this.switchFSModeDropdown)&&void 0!==e&&e.isShown()&&(null===(t=this.switchFSModeDropdown)||void 0===t||t.hideElement())};this.switchFSModeIconButton=new E({iconPath:`${$}ellipsis-vertical.svg`,tooltipText:T.R.switchFullscreenModeLabel,hideCallback:e,disableCallback:e}),(0,m.ng)()||(this.switchFSModeIconButton.icon.style.height="18px",(0,u.ZM)(this.switchFSModeIconButton,{padding:"10px 0px"})),this.switchFSModeIconButton.element.id="fullscreen-dropdown",this.createSwitchFSModeDropdown(),this.switchFSModeDropdown.toggleEvent.listen((e=>{var t,i;void 0!==this.switchFSModeIconButton&&(e.isShowing?(null===(t=this.switchFSModeIconButton.tooltip)||void 0===t||t.hideElement(),this.switchFSModeIconButton.element.style.opacity="1",this.subMenusShown.switchFullscreenMenu=!0,this.lockShowingControls()):(null===(i=this.switchFSModeIconButton.tooltip)||void 0===i||i.showElement(),this.switchFSModeIconButton.element.style.opacity="",this.subMenusShown.switchFullscreenMenu=!1,this.shouldUnlockControls()&&this.unlockShowingControls()))}))}createSwitchFSModeDropdown(){this.switchFSModeDropdown=new M.n({toggleElement:this.switchFSModeIconButton.element,enterNativeFn:()=>this.requestNativeFullscreen(),enterInteractiveFn:()=>{}})}shouldUnlockControls(){return!(0,m.c5)()||!this.isHoveringButton&&Object.values(this.subMenusShown).every((e=>!e))}initButtonHoverListeners(){if(!(0,m.c5)())return;const e=e=>{e?(this.isHoveringButton=!0,this.lockShowingControls()):(this.isHoveringButton=!1,this.shouldUnlockControls()&&this.unlockShowingControls())};(0,u.JR)(this.volumeIconDOM,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.volumeSlider,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.videoQualityIconButton,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.privateButtonDOM,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.showMyCamButtonDOM,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.sendTipButtonDOM,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.chatButtonDOM,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.userListButtonDOM,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.moreRoomsButtonDOM,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.theaterModeIconButton,{ignoreTouch:!0}).listen(e),(0,u.JR)(this.fullscreenIconButton,{ignoreTouch:!0}).listen(e),void 0!==this.switchFSModeIconButton&&(0,u.JR)(this.switchFSModeIconButton).listen(e)}showHidePrivateButton(e){if((0,m.c5)())return this.showHidePrivateButtonNewVideoControls(e);if(this.privateAllowed||-1!==["privaterequesting","privatespying","privatewatching"].indexOf(e))switch(e){case"unknown":case"offline":case"notconnected":case"away":case"hidden":case"hiddenwatching":case"passwordprotected":case"privatenotwatching":this.privateButtonDOM.style.display="none";break;default:"split"===k.L.getVideoMode()?this.privateButtonDOM.style.display="none":this.privateButtonDOM.style.display=(0,m.c5)()?"inline-flex":"inline-block"}else this.privateButtonDOM.style.display="none"}showHidePrivateButtonNewVideoControls(e){if((0,m.c5)()&&void 0!==this.privateIconTextButton)if(this.privateAllowed||["privaterequesting","privatespying","privatewatching"].includes(e))if("split"!==k.L.getVideoMode())switch(this.privateIconTextButton.showElement(),e){case"notconnected":if(this.player.roomStatusNotifier.isShown()&&!this.player.roomStatusNotifier.isConnectingStatusShowing())return void this.privateIconTextButton.clearTooltipTextOverride();this.privateIconTextButton.disable(),this.privateIconTextButton.setTooltipTextOverride(T.R.waitingToConnect);break;case"unknown":case"offline":case"away":case"hidden":case"hiddenwatching":case"passwordprotected":case"privatenotwatching":this.privateIconTextButton.showElement(),this.privateIconTextButton.disable(),this.privateIconTextButton.clearTooltipTextOverride();break;default:this.privateIconTextButton.showElement(),this.privateIconTextButton.enable(),this.privateIconTextButton.clearTooltipTextOverride()}else this.privateIconTextButton.hideElement();else this.privateIconTextButton.hideElement()}updateIcons(){(0,m.c5)()?this.updateIconsNewVideoControls():(this.sendTipButtonDOM.style.display=this.isAgeVerified?"inline-block":"none",this.moreRoomsButtonDOM.style.display="none",this.userListButtonDOM.style.display="inline-block",this.theaterModeButtonDOM.innerText=T.R.theaterModeLabel,this.theaterModeButtonDOM.style.display="inline-block",this.fullscreenButtonDOM.innerText=T.R.fullScreenLabel,this.chatButtonDOM.style.display="inline",this.showMyCamButtonDOM.style.display="block",void 0!==this.currentRoomContext&&this.showHidePrivateButton(this.currentRoomContext.chatConnection.status),this.updateIconsByMode(),this.updateFullScreenButton(),this.isOffline&&(this.showMyCamButtonDOM.style.display="none",this.userListButtonDOM.style.display="none"),this.showControls())}updateIconsByMode(){switch(k.L.getVideoMode()){case"split":this.sendTipButtonDOM.style.display="none",this.userListButtonDOM.style.display="none",this.chatButtonDOM.style.display="none",this.privateButtonDOM.style.display="none",this.showMyCamButtonDOM.style.display="none",this.isEmbed&&(this.theaterModeButtonDOM.style.display="none");break;case"videoonly":this.sendTipButtonDOM.style.display="none",this.userListButtonDOM.style.display="none",this.chatButtonDOM.style.display="none",this.privateButtonDOM.style.display="none",this.showMyCamButtonDOM.style.display="none",this.theaterModeButtonDOM.style.display="none";break;case"theater":this.theaterModeButtonDOM.innerText=T.R.splitModeLabel,this.theaterModeButtonDOM.id="default-view",this.moreRoomsButtonDOM.style.display="inline-block";break;case"fullscreen":this.moreRoomsButtonDOM.style.display="inline-block",this.theaterModeButtonDOM.style.display="none",this.fullscreenButtonDOM.innerText=T.R.exitFullScreenLabel;break;case"noninteractive-fullscreen":break;default:error(`Unexpected VideoMode: ${k.L.getVideoMode()}`,{},"VIDEO_")}}updateIconsNewVideoControls(){var e,t,i,s,n,o,r,a,l;this.isAgeVerified?null===(o=this.sendTipIconTextButton)||void 0===o||o.showElement():null===(r=this.sendTipIconTextButton)||void 0===r||r.hideElement(),null===(e=this.moreRoomsIconTextButton)||void 0===e||e.showElement(),null===(t=this.userListIconTextButton)||void 0===t||t.showElement(),this.theaterModeIconButton.showElement(),null===(i=this.switchFSModeIconButton)||void 0===i||i.showElement(),this.videoQualityIconButton.showVisibility(),null===(s=this.chatIconTextButton)||void 0===s||s.showElement(),null===(n=this.showMyCamIconTextButton)||void 0===n||n.showElement(),void 0!==this.currentRoomContext&&this.showHidePrivateButtonNewVideoControls(this.currentRoomContext.chatConnection.status),this.updateIconsByModeNewVideoControls(),this.maybeHideVideoQualityIconVisibility(),this.updateFullScreenButton(),!(0,m.ng)()&&this.isOffline&&(null===(a=this.showMyCamIconTextButton)||void 0===a||a.hideElement(),null===(l=this.userListIconTextButton)||void 0===l||l.hideElement()),this.showControls()}updateIconsByModeNewVideoControls(){var e,t,i,s,o,r,a,l,h,d,c,u,p,m,g;switch(this.updateVideoModeButtonAppearance(),k.L.getVideoMode()){case"split":null===(e=this.sendTipIconTextButton)||void 0===e||e.hideElement(),null===(t=this.userListIconTextButton)||void 0===t||t.hideElement(),null===(i=this.chatIconTextButton)||void 0===i||i.hideElement(),null===(s=this.privateIconTextButton)||void 0===s||s.hideElement(),null===(o=this.showMyCamIconTextButton)||void 0===o||o.hideElement(),null===(r=this.moreRoomsIconTextButton)||void 0===r||r.hideElement(),null===(a=this.switchFSModeIconButton)||void 0===a||a.hideElement(),this.isEmbed&&this.theaterModeIconButton.hideElement();break;case"videoonly":this.videoQualityIconButton.hideVisibility(),null===(l=this.sendTipIconTextButton)||void 0===l||l.hideElement(),null===(h=this.userListIconTextButton)||void 0===h||h.hideElement(),null===(d=this.chatIconTextButton)||void 0===d||d.hideElement(),null===(c=this.privateIconTextButton)||void 0===c||c.hideElement(),null===(u=this.showMyCamIconTextButton)||void 0===u||u.hideElement(),null===(p=this.moreRoomsIconTextButton)||void 0===p||p.hideElement(),this.theaterModeIconButton.hideElement(),null===(m=this.switchFSModeIconButton)||void 0===m||m.hideElement();break;case"theater":this.theaterModeButtonDOM.id="default-view",null===(g=this.switchFSModeIconButton)||void 0===g||g.hideElement();break;case"fullscreen":this.theaterModeIconButton.hideElement(),(0,n.fZ)(this.switchFSModeDropdown.interactiveOption,"active");break;case"noninteractive-fullscreen":(0,n.fZ)(this.switchFSModeDropdown.nativeOption,"active");break;default:error(`Unexpected VideoMode: ${k.L.getVideoMode()}`,{},"VIDEO_")}}updateIconsOnOfflineChange(){var e,t,i,s;(0,m.c5)()&&(0,m.ng)()&&(this.isOffline?(null===(e=this.showMyCamIconTextButton)||void 0===e||e.disable(),null===(t=this.moreRoomsIconTextButton)||void 0===t||t.disable()):(null===(i=this.showMyCamIconTextButton)||void 0===i||i.enable(),null===(s=this.moreRoomsIconTextButton)||void 0===s||s.enable()))}updateControlButtonSpacing(){if((0,m.c5)())if((0,m.ng)())this.recalculateRightControlsFlexBasis();else switch(k.L.getVideoMode()){case"split":(0,u.ZM)(this.rightControls,{columnGap:"0px",paddingRight:"14px",flexBasis:(0,m.ng)()?this.leftControls.element.offsetWidth-14+"px":""});break;case"theater":(0,u.ZM)(this.rightControls,{columnGap:"0px",paddingRight:"14px",flexBasis:(0,m.ng)()?this.leftControls.element.offsetWidth-14+"px":""}),(0,u.ZM)(this.middleControls,{columnGap:"24px"});break;case"fullscreen":(0,u.ZM)(this.rightControls,{columnGap:(0,m.ng)()?"0px":"10px",paddingRight:(0,m.ng)()?"14px":"20px",flexBasis:(0,m.ng)()?this.leftControls.element.offsetWidth-14+"px":""}),(0,u.ZM)(this.middleControls,{columnGap:"24px"})}}recalculateRightControlsFlexBasis(){if((0,m.ng)())switch(k.L.getVideoMode()){case"split":case"theater":case"fullscreen":(0,u.ZM)(this.rightControls,{flexBasis:this.leftControls.element.offsetWidth-14+"px"})}}updateVolumeImage(){if((0,m.c5)())return void this.updateVolumeIconNewVideoControls();if(!(this.volumeIconDOM instanceof HTMLImageElement))return void error("volumeIconDOM is not an HTMLImageElement");const e=this.volumeSlider.getValue();0===e||this.state.isMuted?(this.volumeIconDOM.src=`${STATIC_URL}volume-mute.svg`,this.volumeIconDOM.id="volume-mute",this.volumeIconDOM.title=T.R.unmuteCapitalized):e<33?(this.volumeIconDOM.src=`${STATIC_URL}volume-low.svg`,this.volumeIconDOM.id="volume-low",this.volumeIconDOM.title=T.R.muteLabel):e<66?(this.volumeIconDOM.src=`${STATIC_URL}volume-medium.svg`,this.volumeIconDOM.id="volume-medium",this.volumeIconDOM.title=T.R.muteLabel):(this.volumeIconDOM.src=`${STATIC_URL}volume-high.svg`,this.volumeIconDOM.id="volume-high",this.volumeIconDOM.title=T.R.muteLabel)}updateVolumeIconNewVideoControls(){if(!(0,m.c5)()||void 0===this.volumeIconButton)return;const e=this.volumeSlider.getValue();0===e||this.state.isMuted?(this.volumeIconButton.updateIcon(`${$}volume-mute.svg`),this.volumeIconButton.setTooltipText(T.R.unmuteCapitalized),this.volumeIconDOM.id="volume-mute"):e<33?(this.volumeIconButton.updateIcon(`${$}volume-low.svg`),this.volumeIconButton.setTooltipText(T.R.muteLabel),this.volumeIconDOM.id="volume-low"):e<66?(this.volumeIconButton.updateIcon(`${$}volume-medium.svg`),this.volumeIconButton.setTooltipText(T.R.muteLabel),this.volumeIconDOM.id="volume-medium"):(this.volumeIconButton.updateIcon(`${$}volume-high.svg`),this.volumeIconButton.setTooltipText(T.R.muteLabel),this.volumeIconDOM.id="volume-high")}updatePlayerVolume(){this.setPlayerComponentVolumeMutedEvents.fire({...this.state})}saveSettings(){if((0,s.Pf)()){const e={volume:this.state.volume,isMuted:this.state.isMuted};window.localStorage.setItem(W,JSON.stringify(e))}(0,y.yC)(this.state.volume,this.state.isMuted)}update(){this.updateVolumeInternal(),this.saveSettings()}updateVolumeInternal(){this.volumeSlider.setValue(this.state.isMuted?0:this.state.volume),this.updatePlayerVolume(),this.updateVolumeImage()}mute(){this.updateIsMuted(!0),this.update()}unmute(){this.updateIsMuted(!1),0===this.state.volume&&(this.state.volume=60),this.update()}toggleMuted(){this.state.isMuted?this.unmute():this.mute()}toggle(){this.visible?this.hideControls():this.showControls()}showControls(){if((0,m.c5)()){if(!(0,m.ng)()&&this.isOffline&&"fullscreen"!==k.L.getVideoMode())return void this.hideControls()}else if(this.isOffline)return void this.hideControls();this.visible=!0,this.fixVerticalOrHorizontalPositioning(),(0,S.Ve)(this.element,"100ms"),(0,m.c5)()?(this.element.style.opacity="1",this.element.style.visibility=""):this.showElement(),void 0!==this.hideDebounceTimer&&clearTimeout(this.hideDebounceTimer),void 0!==this.opacityTimer&&clearTimeout(this.opacityTimer),this.locked||this.startHideTimeout()}startHideTimeout(){let e;e=(0,m.c5)()?3e3:this.hideControlsCalled?2e3:5e3,this.hideDebounceTimer=window.setTimeout((()=>{this.hideDebounceTimer=void 0,this.opacityTimer=window.setTimeout((()=>{this.opacityTimer=void 0,this.hideControls()}),e-100)}),100)}lockShowingControls(){this.locked=!0,this.showControls()}unlockShowingControls(){const e=this.locked;this.locked=!1,e&&this.startHideTimeout()}shouldShowVertical(){if((0,m.c5)()){const e=k.L.getVideoMode();return"theater"===e&&(0,f.DK)(){this.playerComponentEnterFullScreenModeEvent.fire(void 0)}),250):this.playerComponentEnterFullScreenModeEvent.fire(void 0)):this.toggleInteractiveFullScreen(),this.updateIcons()}requestNativeFullscreen(){this.hlsWaitingForInteraction&&this.forceHlsOverlayFunc(),this.isFullscreenAvailable&&((0,s.OF)()?window.setTimeout((()=>{this.playerComponentEnterFullScreenModeEvent.fire(void 0)}),250):(this.hide(),this.playerComponentEnterFullScreenModeEvent.fire(void 0))),(0,m.c5)()||this.updateIcons()}toggleInteractiveFullScreen(){"fullscreen"===k.L.getVideoMode()?(0,g.Eh)():(0,g.lh)(this.fullscreenDiv)}updateFullScreenButton(){var e;if((0,m.c5)())return void this.updateFullScreenButtonNewVideoControls();const t=k.L.getVideoMode(),i="videoonly"===t,s="fullscreen"===t,n=this.player.roomStatusNotifier.isShown(),o=this.isFullscreenAvailable&&(!i&&!n||s),r="chat-player"===(null===(e=(0,g.Gy)())||void 0===e?void 0:e.id);o?this.fullscreenButtonDOM.style.display="inline-block":(this.fullscreenButtonDOM.style.display="none",(0,g.aS)()&&r&&(0,g.Eh)())}updateFullScreenButtonNewVideoControls(){var e;const t=k.L.getVideoMode(),i="videoonly"===t,s="fullscreen"===t,n=this.player.roomStatusNotifier.isShown(),o=this.isFullscreenAvailable&&(!i||s),r=o&&!n,a=this.isEmbed?r:o,l="chat-player"===(null===(e=(0,g.Gy)())||void 0===e?void 0:e.id);var h,d,c;a?(null===(h=this.fullscreenIconButton)||void 0===h||h.showElement(),void 0!==this.switchFSModeIconButton&&s?(this.switchFSModeIconButton.showElement(),n?(this.switchFSModeIconButton.disable(),this.switchFSModeIconButton.disableTooltip()):(this.switchFSModeIconButton.enable(),this.switchFSModeIconButton.enableTooltip())):null===(d=this.switchFSModeIconButton)||void 0===d||d.hideElement()):(null===(c=this.fullscreenIconButton)||void 0===c||c.hideElement(),(0,g.aS)()&&l&&(0,g.Eh)())}updateVideoModeButtonAppearance(){if(!(0,m.c5)())return;const e=k.L.getVideoMode();if("split"===e||"theater"===e){const t=(0,m.ng)()?`${$}fullscreen.svg`:`${$}full-screen.svg`;this.fullscreenIconButton.updateIcon(t),this.fullscreenIconButton.setTooltipText(T.R.fullScreenLabel),this.fullscreenIconButton.changeIconAnimation("scale-big"),"split"===e?(this.theaterModeIconButton.setTooltipText(T.R.theaterModeLabel),this.theaterModeIconButton.changeIconAnimation("scale-wide")):(this.theaterModeIconButton.setTooltipText(T.R.defaultViewLabel),this.theaterModeIconButton.changeIconAnimation("scale-thin"))}else this.fullscreenIconButton.updateIcon(`${$}exit-fullscreen.svg`),this.fullscreenIconButton.setTooltipText(T.R.exitFullScreenLabel),this.fullscreenIconButton.changeIconAnimation("scale-small")}forceHlsOverlayFunc(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.hlsWaitingForInteraction&&void 0!==this.currentRoomContext&&(void 0!==this.forceHlsOverlay&&null!==this.forceHlsOverlay.parentElement&&(this.forceHlsOverlay.parentElement.removeChild(this.forceHlsOverlay),this.forceHlsOverlay=void 0),void 0!==this.playButtonContainer&&null!==this.playButtonContainer.parentElement&&(this.playButtonContainer.parentElement.removeChild(this.playButtonContainer),this.playButtonContainer=void 0),this.hlsWaitingForInteraction=!1,this.hideControls(),this.hide(),this.videoQualityButtonDOM.innerText="",this.videoQualityButtonDOM.style.display="none",(0,m.c5)()&&this.videoQualityIconButton.hideVisibility(),!this.forceHlsTriggered&&e&&(this.forceHlsTriggered=!0,(0,y.bT)("ForceHLS"),this.forceHlsPlayerEvent.fire({roomContext:this.currentRoomContext,unmute:!1}),B.Io.fire(void 0)),(0,m.c5)()?this.element.style.zIndex="14":this.element.style.zIndex="2")}maybeForceHls(){this.playerIsJPEG&&this.hlsWaitingForInteraction&&this.forceHlsOverlayFunc()}createHlsPlayOverlay(){this.forceHlsOverlay=document.createElement("div"),this.forceHlsOverlay.style.width="100%",this.forceHlsOverlay.style.height="100%",this.forceHlsOverlay.style.position="absolute",this.forceHlsOverlay.style.top="0",this.forceHlsOverlay.style.left="0",this.forceHlsOverlay.style.cursor="pointer",(0,l.wu)("click",this.forceHlsOverlay,(()=>{this.forceHlsOverlayFunc()})),(0,l.wu)("click",this.element,(()=>{this.forceHlsOverlayFunc()})),this.playerComponentReadjustForceHlsOverlayOrderEvent.fire(this.forceHlsOverlay)}showHideHlsPlayButton(e){void 0!==this.playButtonContainer&&void 0!==this.forceHlsOverlay&&((0,C.x_)(e)?(this.playButtonContainer.style.display="",this.forceHlsOverlay.style.display=""):(this.playButtonContainer.style.display="none",this.forceHlsOverlay.style.display="none"))}createForceHlsPlayButton(){if(this.playerIsJPEG){this.hlsWaitingForInteraction=!0,this.playButtonContainer=document.createElement("div");const e=this.playerElement.getBoundingClientRect(),t=document.createElement("img");t.src=`${STATIC_URL}play-inactive.svg`,t.style.width="60px",t.style.height="60px",t.style.position="relative",t.style.top="40px",t.style.left="45px",t.style.cursor="pointer",(0,l.wu)("click",t,(()=>{this.forceHlsOverlayFunc()})),this.playButtonContainer.style.position="absolute",this.playButtonContainer.style.top=e.height/2-70+"px",this.playButtonContainer.style.left=e.width/2-70+"px",this.playButtonContainer.style.cursor="pointer",this.playButtonContainer.style.width="140px",this.playButtonContainer.style.height="140px",this.playButtonContainer.style.borderRadius="50%",this.playButtonContainer.style.backgroundColor="rgba(0,0,0,0.25)",this.playButtonContainer.appendChild(t),this.playerComponentReadjustPlayButtonContainerEvent.fire(this.playButtonContainer),this.showJpegPlayerComponentImage.fire(void 0),this.createHlsPlayOverlay(),this.repositionChildren()}}onForceJPEG(){(0,m.c5)()&&(this.videoQualityIconButton.hideVisibility(),"noninteractive-fullscreen"===k.L.getVideoMode()&&(0,g.aS)()&&((0,g.Eh)(),g._c.fire())),this.showElement(),this.updateIcons(),this.show()}repositionChildren(){if(void 0!==this.playButtonContainer){const e=this.playerElement.getBoundingClientRect();this.playButtonContainer.style.top=e.height/2-70+"px",this.playButtonContainer.style.left=e.width/2-70+"px"}}notifySupportsAutoplayWithAudio(e){this.playerSupportsAutoplayWithAudio=e}notifyIsJPEG(e){this.playerIsJPEG=e,(0,m.c5)()&&e&&this.videoQualityIconButton.hideVisibility()}notifyIsHlsPlaceholder(e){this.playerIsHlsPlaceholder=e}notifyVideoOfflineChange(e){this.videoOfflineChange.fire(e)}notifyQualityLevelChanged(e){this.videoQualityButtonDOM.innerText=e,(0,m.c5)()&&this.updateVideoQualityIcon(e)}updateVideoQualityIcon(e){var t;this.isAutoQuality="auto"===e;const i=`${STATIC_URL}theaterVideoControlsIcons/`;if(this.isAutoQuality)this.videoQualityIconButton.updateIcon(`${i}quality-gear-auto.svg`);else switch((null!==(t=e.match(/\d+p/))&&void 0!==t?t:[""])[0]){case"240p":this.videoQualityIconButton.updateIcon(`${i}quality-gear-240p.svg`);break;case"360p":this.videoQualityIconButton.updateIcon(`${i}quality-gear-360p.svg`);break;case"480p":this.videoQualityIconButton.updateIcon(`${i}quality-gear-480p.svg`);break;case"540p":this.videoQualityIconButton.updateIcon(`${i}quality-gear-540p.svg`);break;case"720p":this.videoQualityIconButton.updateIcon(`${i}quality-gear-720p.svg`);break;case"1080p":this.videoQualityIconButton.updateIcon(`${i}quality-gear-hd.svg`);break;case"1440p":this.videoQualityIconButton.updateIcon(`${i}quality-gear-1440p.svg`);break;case"2160p":this.videoQualityIconButton.updateIcon(`${i}quality-gear-4k.svg`)}}maybeHideVideoQualityIconVisibility(){(0,m.c5)()&&((0,s.J0)()||this.playerIsJPEG||""===this.videoQualityIconButton.icon.getAttribute("src"))&&(this.videoQualityIconButton.hideVisibility(),this.videoQualityButtonDOM.style.display="none")}setVideoQualityButtonVisibility(e){this.videoQualityButtonDOM.style.display=e?"":"none",(0,m.c5)()&&(this.videoQualityButtonDOM.style.display="none",e?this.videoQualityIconButton.showVisibility():this.videoQualityIconButton.hideVisibility())}getQualityButtonLeft(){return(0,m.c5)()&&this.videoQualityIconButton.isShown()?this.videoQualityIconButton.element.offsetLeft:this.videoQualityButtonDOM.offsetLeft}checkIfElementIsInVolumeControls(e){for(const t of this.volumeSlider.element.children)if(e===t)return!0;return e===this.volumeIconDOM||e===this.volumeSlider.element||e===this.volumeSlider.handle}getRoomContext(){return this.currentRoomContext}requestHLS(e){this.hlsWaitingForInteraction&&this.forceHlsOverlayFunc(!1),(0,y.bT)("ForceHLS"),this.forceHlsPlayerEvent.fire({roomContext:e}),this.unmute(),B.Io.fire(void 0)}}function z(e){const t=document.createElement("span");return t.innerText=e,t.style.color="#ffffff",t.style.fontSize="13px",t.style.padding="5px",t.style.marginRight="4px",t.style.cursor="pointer",t.style.display="inline-block",t}class G extends x.A{constructor(){super(...arguments),this.tooltipDisabled=!1}initUI(e){super.initUI(e),(0,u.JR)(this.element,{ignoreTouch:!0}).listen((e=>{e?(0,n.fZ)(this.element,"hovering"):(0,n.SA)(this.element,"hovering")}))}getTooltipText(){return this.tooltipText}getTooltipTextOverride(){return this.tooltipTextOverride}isTooltipDisabled(){return this.tooltipDisabled}isHovering(){return this.element.classList.contains("hovering")}}},74:(e,t,i)=>{"use strict";i.d(t,{EZ:()=>a,Io:()=>n,Ne:()=>h,Sj:()=>c,ef:()=>d,i5:()=>o,mf:()=>l,pL:()=>r});var s=i(8423);const n=new s.c_("switchedToHLS"),o=new s.c_("openDefaultTipCalloutRequest"),r=new s.c_("loginOverlayRequest"),a=new s.c_("userChatSettingsUpdate",{listenersWarningThreshold:()=>50+2*s.hI}),l=new s.c_("openPhotoVideoTabRequest"),h=new s.c_("privateShowSplitModeRequest"),d=new s.c_("privateShowRequestOverlayDismiss"),c=new s.c_("resetPrivateShowLink")},3058:(e,t,i)=>{"use strict";i.d(t,{K:()=>w,R:()=>C});var s=i(9447),n=i(9757),o=i(8039),r=i(9505),a=i(2331),l=i(6784),h=i(213),d=i(2939),c=i(3955),u=i(8423),p=i(6440),m=i(7407),g=i(1452),v=i(7176),f=i(4947),y=i(9681),b=i(2091);const w=new u.c_("userCountUpdate");class C extends a.YI{constructor(){super(),this.userCount=0,this.userList=[],this.settingInput=!1,this.handleSpan=document.createElement("span"),this.baseTabHandleText=`${f.R.usersCAPS} `,this.element.id="UserListTab",this.element.style.overflow="visible",this.element.style.fontFamily="Tahoma, Helvetica, Arial, sans-serif",this.element.style.boxSizing="border-box",this.element.style.position="relative",this.element.dataset.pactionName="Users";const e=document.createElement("div");(0,c.ZM)(e,{display:"flex",flexDirection:"column",width:"100%",height:"100%"}),this.element.appendChild(e),this.wrapper=document.createElement("div"),this.wrapper.style.width="100%",this.wrapper.style.overflow="auto",this.wrapper.style.padding="6px",this.wrapper.style.boxSizing="border-box",this.wrapper.style.flex="1",e.appendChild(this.wrapper),this.anonUsersDiv=this.createAnonUsersDiv(),this.inputDiv=(0,b.gI)();const t=(0,b.zh)();this.inputField=(0,b.Zw)((()=>!1),Math.max(b.hk,b.mU));const i=()=>{void 0===this.parent||this.settingInput||this.parent.changeToFirstTab()};(0,l.wu)("click",this.inputField.element,i),(0,l.wu)("focus",this.inputField.element,i),this.buttonHolder=new r.J;const s=document.createElement("span");new(n.c.get("SendButton"))({onClick:i,isPm:!1,variant:"SplitMode"},s),this.buttonHolder.addButton(s,r.z.Text),t.appendChild(this.inputField.element),this.inputDiv.appendChild(t),this.inputDiv.appendChild(this.buttonHolder.element),e.appendChild(this.inputDiv),this.createLoadingDiv(),d.X0.listen((e=>{this.chatConn=e.chatConnection,this.chatConn.event.statusChange.listen((e=>{("privatewatching"===e.previousStatus||"privatewatching"===e.currentStatus)&&window.setTimeout((()=>{this.refresh()}),2e3)})),this.chatConn.event.roomCountUpdate.listen((e=>{this.userCount=e,w.fire(this.userCount)})),this.clear(e.dossier.numViewers)})),(0,o.It)()&&o.tb.listen((e=>{this.isCurrentTab()||this.displayList(e),this.updateUserCount(e.anonCount,e.totalCount)}))}initSplitTestHandle(){void 0===this.tabHandleIcon&&(this.tabHandleIcon=(0,v.DU)(),this.tabHandleIcon.style.height="1em",this.tabHandleIcon.style.paddingTop="1px"),this.handle.element.textContent="",this.handle.element.style.fill="currentColor",this.handleSpan.appendChild(this.tabHandleIcon),this.handleSpan.appendChild(document.createTextNode(" ")),this.handleSpan.style.verticalAlign="top",this.handle.element.appendChild(this.handleSpan),this.baseTabHandleText=""}hideUserList(){this.listDiv.style.display="none",this.refreshDiv.style.display="none",this.anonUsersDiv.style.display="none"}removeUserListChildren(){for(;null!==this.wrapper.firstChild;)this.wrapper.removeChild(this.wrapper.firstChild)}createAnonUsersDiv(){const e=document.createElement("div");return(0,s.fZ)(e,s.aG.defaultTooltipColor),(0,c.ZM)(e,{width:"100%",margin:"2px 0",whiteSpace:"nowrap",cssFloat:"left",padding:"4px 0"}),e}createLoadingDiv(){this.loadingDiv=document.createElement("div"),(0,s.fZ)(this.loadingDiv,s.aG.defaultColor),this.loadingDiv.innerText=`${f.R.loadingUserListText}...`,this.loadingDiv.style.margin="8px 0",this.wrapper.style.fontSize="12px",this.wrapper.appendChild(this.loadingDiv)}showLoadingDiv(){this.loadingDiv.style.display="block"}createRefreshUsersLink(){this.refreshDiv=document.createElement("div"),this.refreshDiv.style.margin="6px",this.refreshDiv.style.cssFloat="right";const e=document.createElement("span");e.innerText=f.R.refreshUserListText,e.style.cursor="pointer",(0,s.fZ)(e,"refreshUsersLink"),e.onmouseenter=()=>{e.style.textDecoration="underline"},e.onmouseleave=()=>{e.style.textDecoration="none"},(0,l.wu)("click",e,(e=>{this.refreshUserList(),e.preventDefault()})),this.refreshDiv.appendChild(e),this.wrapper.appendChild(this.refreshDiv)}refreshUserList(){(0,p.f)("ReactUserList2")?(this.hideUserList(),this.showLoadingDiv()):(this.removeUserListChildren(),this.createLoadingDiv()),this.refresh()}clear(e){this.userCount=e,w.fire(this.userCount),(0,p.f)("ReactUserList2")?(this.hideUserList(),this.showLoadingDiv()):(this.removeUserListChildren(),this.createLoadingDiv()),this.repositionChildren()}refresh(){if(void 0===this.chatConn)return;const e=o.SJ.getInstance();(0,o.It)()?(e.refetch().catch(g.yZ),this.displayList(e.getRoomUsersInfo())):e.fetchRoomUsers().then((e=>{this.latestRoomUsersInfo=e,this.displayList(e)})).catch((e=>{error("Error retrieving user list",e),(0,h.Q$)(f.R.errorRefreshingUserList),void 0!==this.latestRoomUsersInfo&&this.displayList(this.latestRoomUsersInfo)}))}displayList(e){if((0,p.f)("ReactUserList2"))if(this.loadingDiv.style.display="none",this.userList=e.roomUsers,void 0===this.userListComponent){this.createRefreshUsersLink(),this.listDiv=document.createElement("div"),this.listDiv.style.display="inline-block",this.wrapper.appendChild(this.listDiv);const e=n.c.get("UserList");this.userListComponent=new e({roomUsers:this.userList,createContextMenu:(e,t)=>{(0,m.bT)("OpenUserContextMenu",{username:e.username}),y.L.createUserContextMenu(e,t)}},this.listDiv),this.wrapper.appendChild(this.anonUsersDiv)}else this.listDiv.style.display="inline-block",this.refreshDiv.style.display="unset",this.anonUsersDiv.style.display="unset",this.userListComponent.update({roomUsers:this.userList});else{this.removeUserListChildren(),this.createRefreshUsersLink(),this.userList=e.roomUsers;for(const e of this.userList){const t=document.createElement("div");(0,c.ZM)(t,{width:"auto",maxWidth:"100%",margin:"2px 0"}),t.appendChild(this.createUsernameLabel(e).element),this.wrapper.appendChild(t)}this.wrapper.appendChild(this.anonUsersDiv)}this.updateUserCount(e.anonCount,e.totalCount),this.repositionChildren()}updateUserCount(e,t){this.userCount=t,w.fire(t),this.anonUsersDiv.innerText=f.R.anonUsersCount(e)}createUsernameLabel(e){return new y.L(e,void 0,!0)}getTabHandleContent(){void 0===this.tabHandleIcon&&(this.tabHandleIcon=(0,v.DU)(),this.tabHandleIcon.style.height="1em",this.tabHandleIcon.style.paddingTop="1px");const e=document.createTextNode(`${this.baseTabHandleText}(${this.userCount})`),t=document.createElement("span");return t.dataset.pactionName="USERS",t.style.verticalAlign="top",t.appendChild(e),[t]}getTabId(){return"users-tab-default"}focusCurrentChatInput(){this.inputField.focus()}blurCurrentChatInput(){this.inputField.blur()}isInputFocused(){return document.activeElement===this.inputField.element}scrollToBottom(){this.wrapper.scrollTop=this.wrapper.scrollHeight-this.wrapper.offsetHeight}getInputText(){return this.inputField.getText()}setInputText(e){this.settingInput=!0,this.inputField.setText(e),this.inputField.blur(),window.setTimeout((()=>{this.settingInput=!1}),100)}getChatInputField(){}tabHandleClicked(e){super.tabHandleClicked(e),(0,m.bT)("FocusTab",{location:"userlist"}),this.refresh()}}},4947:(e,t,i)=>{"use strict";i.d(t,{R:()=>r});var s=i(7063),n=i(5216),o=i(7882);const r={numberOfRoomsMatchesYourFilters:(e,t)=>(0,s.GW)((0,s.WI)("%(matched)s of the %(total)s live room matched your filters","%(matched)s of the %(total)s live rooms matched your filters",e),{total:e,matched:t},!0),noRoomsMatchesYourFilters:e=>(0,s.GW)((0,s.WI)("None of the %(total)s live rooms matched your filters","None of the %(total)s live rooms matched your filters",e),{total:e},!0),mobileDocumentTitle:(e,t,i)=>(0,s.GW)((0,s.AP)("%(username)s at %(sitename)s: %(subject)s"),{username:(0,s.VE)(e),sitename:t,subject:i},!0),documentTitle:(e,t)=>(0,s.GW)((0,s.AP)("%(username)s's Room @ %(sitename)s - Chat in a Live Adult Video Chat Room Now"),{username:(0,s.VE)(e),sitename:t},!0),tokenOrTokensText:(e,t)=>t?(0,s.WI)("Token","Tokens",e):(0,s.WI)("token","tokens",e),tokenOrTokensTextCAPS:e=>(0,s.WI)("TOKEN","TOKENS",e),tipConfirmationMessage:e=>(0,s.GW)((0,s.AP)("Confirm tip of %(tokens)s tokens"),{tokens:e.toLocaleString()},!0),subjectChangeMessage:e=>(0,s.GW)((0,s.AP)('room subject changed to "%(subject)s"'),{subject:e},!0),roomTitleMessage:e=>(0,s.GW)((0,s.AP)("%(username_title)s's Cam"),{username_title:(0,s.VE)(e)},!0),moderatorPromoteMessage:(e,t)=>(0,s.GW)((0,s.AP)("%(from)s has granted moderator privileges to %(to)s."),{from:e,to:t},!0),moderatorRevokeMessage:(e,t)=>(0,s.GW)((0,s.AP)("%(from)s has revoked moderator privileges from %(to)s."),{from:e,to:t},!0),moderatorPromoteError:e=>(0,s.GW)((0,s.AP)("Error granting moderator privileges to %(user)s."),{user:e},!0),moderatorRevokeError:e=>(0,s.GW)((0,s.AP)("Error revoking moderator privileges for %(user)s."),{user:e},!0),joinFanClubText:e=>(0,s.GW)((0,s.AP)("Join %(modelname)s's Fan Club"),{modelname:(0,s.nx)(e)},!0),joinFanClubWithTokensText:(e,t,i)=>{const n=r.joinFanClubText(e),o=(0,s.GW)((0,s.AP)("with %(tokens)s tokens for %(months)s months"),{tokens:t,months:i},!0);return n.concat(" ").concat(o)},joinFanClubTextCAPS:e=>(0,s.GW)((0,s.AP)("JOIN %(modelname)s's FAN CLUB"),{modelname:e},!0),joinFanClubPage:e=>(0,s.GW)((0,s.AP)('You will be taken to Join Fan Club Page for %(modelname)s. Click "OK" to proceed.'),{modelname:(0,s.nx)(e)},!0),loggedInToJoinFanClubText:e=>(0,s.GW)((0,s.AP)('You must be logged in to join %(modelname)s\'s fan club. Click "OK" to login.'),{modelname:(0,s.nx)(e)},!0),roomPicsVideoText:e=>(0,s.GW)((0,s.AP)("%(modelname)s's Pics & Videos"),{modelname:(0,s.nx)(e)},!0),roomPicsText:e=>(0,s.GW)((0,s.AP)("%(modelname)s's Pics"),{modelname:(0,s.nx)(e)},!0),roomVidsText:e=>(0,s.GW)((0,s.AP)("%(modelname)s's Videos"),{modelname:(0,s.nx)(e)},!0),purchaseVideoText:e=>(0,s.GW)((0,s.WI)("You are about to purchase this video for %(tokens)s token","You are about to purchase this video for %(tokens)s tokens",e),{tokens:e},!0),purchasePhotosText:(e,t)=>(0,s.GW)((0,s.AP)("You are about to purchase this photo set (%(numphotos)s %(imagestext)s) for %(tokens)s %(tokenstext)s"),{numphotos:e,imagestext:(0,s.WI)("image","images",e),tokens:t,tokenstext:(0,s.WI)("token","tokens",t)},!0),unlockPhotosText:e=>(0,s.GW)((0,s.WI)("Unlock this photo set (%(numphotos)s image)","Unlock this photo set (%(numphotos)s images)",e),{numphotos:e},!0),unlockVideoText:e=>(0,s.GW)((0,s.AP)("Unlock this video (%(duration)s)"),{duration:e},!0),fanClubDisabledText:e=>(0,s.GW)((0,s.AP)("%(modelname)s has disabled their fan club."),{modelname:(0,s.nx)(e)},!0),silenceMessage:(e,t)=>(0,s.GW)((0,s.AP)("User %(username)s was silenced by %(silencer)s and their messages have been removed"),{username:e,silencer:t},!0),userKickedAndMessagesRemovedMessage:e=>(0,s.GW)((0,s.AP)("User %(username)s was kicked out of the room and their messages have been removed"),{username:e},!0),privateShowPriceChangeMessage:(e,t)=>(0,s.GW)((0,s.AP)("%(username)s changed Private Show price to %(price)s tokens per minute"),{username:e,price:t},!0),spyShowPriceChangeMessage:(e,t)=>(0,s.GW)((0,s.AP)("%(username)s changed Spy on Private Show price to %(price)s tokens per minute"),{username:e,price:t},!0),priceTokensPerMinuteMessage:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(0,s.GW)((0,s.AP)("%(price)s tokens/min"),{price:e},!0):(0,s.GW)((0,s.AP)("%(price)s tokens per minute"),{price:e},!0)},privateShowMinimumMinuteMessage:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(0,s.GW)((0,s.AP)("minimum %(minMinutes)s min(s)"),{minMinutes:e},!0):(0,s.GW)((0,s.AP)("minimum %(minMinutes)s minute(s)"),{minMinutes:e},!0)},privateShowMinimumMinuteMessageV2:e=>(0,s.GW)((0,s.AP)("Minimum %(minMinutes)s minute(s)"),{minMinutes:e},!0),privateShowConfirmMessage:(e,t,i,n)=>{let o=(0,s.GW)((0,s.AP)("Enter private chat with %(username)s?\n%(price)s tokens per minute, minimum %(minMinutes)s minute(s)\n\n"),{username:e,price:t,minMinutes:i},!0);return o+=n?(0,s.AP)("This broadcaster allows private show recordings, so you will receive a recorded video of this show in your collection."):(0,s.AP)("This broadcaster does not allow private show recordings, so you will not receive a recorded video of this show in your collection."),o},privateShowSpyConfirmMessage:e=>(0,s.GW)((0,s.AP)("Spy on private show for (%(price)s tokens per minute)"),{price:e},!0),appsRunningMessage:e=>(0,s.GW)((0,s.AP)("Broadcaster %(username)s is running these apps: "),{username:e},!0),usersRunningAppMessage:e=>(0,s.GW)((0,s.AP)("Showing users running %(appName)s"),{appName:e},!0),devportalMessage:e=>(0,s.GW)((0,s.AP)('Create or update v2 Apps in the new Developer Portal.'),{link:(0,n._Y)(e)},!0),integerMinError:e=>(0,s.GW)((0,s.AP)("This field is less than the minimum of %(minimum)s"),{minimum:e},!0),integerMaxError:e=>(0,s.GW)((0,s.AP)("This field is greater than the maximum of %(maximum)s"),{maximum:e},!0),allowToVoteMessage:(e,t)=>(0,s.GW)((0,s.AP)("After tipping %(min_tokens_to_vote)s tokens in a day, you'll be able to vote regarding your satisfaction with %(room)s."),{min_tokens_to_vote:t,room:(0,s.nx)(e)},!0),confidentalVoteMessage:e=>(0,s.GW)((0,s.AP)("Your confidential vote regarding %(room)s has been recorded. You may change your vote at any time today. Thank you for your feedback."),{room:(0,s.nx)(e)},!0),shareCamText:e=>(0,s.GW)((0,s.AP)("Share %(username)s's Cam"),{username:e},!0),embedCamText:e=>(0,s.GW)((0,s.AP)("Embed %(username)s's Cam on Your Webpage"),{username:e},!0),conversationCautionMessage:e=>(0,s.GW)((0,s.AP)("Caution: The %(siteName)s Team will NEVER contact you via chat or ask for your password."),{siteName:e},!0),afterTipVoteSatisfactionText:(e,t)=>(0,s.GW)((0,s.AP)("Note: For tipping at least %(tokens)s tokens today, you can now vote what you think about %(room)s. Your vote is confidential. See below for the satisfaction feedback controls."),{tokens:t,room:(0,s.nx)(e)},!0),afterTipVoteSatMobileText:(e,t)=>(0,s.GW)((0,s.AP)("Note: For tipping at least %(tokens)s tokens today, you can now vote what you think about %(room)s. Your vote is confidential. Open the menu for the satisfaction feedback controls."),{tokens:t,room:(0,s.nx)(e)},!0),votedUpText:e=>(0,s.GW)((0,s.AP)("Note: Your confidential vote of thumbs up for %(room)s has been recorded. You may change your vote at any time today. Thank you for your feedback."),{room:(0,s.nx)(e)},!0),votedDownText:e=>(0,s.GW)((0,s.AP)("Note: Your confidential vote of thumbs down for %(room)s has been recorded. You may vote once every 90 days, and you may change your vote at any time today. Thank you for your feedback."),{room:(0,s.nx)(e)},!0),votedDownTextRepeat:e=>(0,s.GW)((0,s.AP)("Note: Your confidential vote of thumbs down for %(room)s has been refreshed and will expire in 90 days. You may change your vote at any time today. Thank you for your feedback."),{room:(0,s.nx)(e)},!0),sureVoteDownText:e=>(0,s.GW)((0,s.AP)("Are you sure you want to rate %(room)s thumbs down?"),{room:(0,s.nx)(e)},!0),noSimilarRooms:e=>(0,s.GW)((0,s.AP)("Sorry, we don't have any rooms similar to %(room)s yet."),{room:e},!0),pmSupporterSendPm:e=>(0,s.GW)((0,s.AP)("to send a pm to %(pmUser)s"),{pmUser:e},!0),userPromotionCurrentPriceText:e=>{const t=r.userPromotionCurrentPriceLabel,i=r.tokenOrTokensText(e,!1);return"".concat(t).concat(": ").concat(String(e)).concat(" ").concat(i)},userIsIgnored:e=>(0,s.GW)((0,s.AP)("%(username)s is ignored"),{username:e},!0),ignoreUser:e=>(0,s.GW)((0,s.AP)("Ignore %(username)s"),{username:e},!0),ignoringUser:e=>(0,s.GW)((0,s.AP)("Ignoring %(username)s"),{username:e},!0),noLongerIgnoring:e=>(0,s.GW)((0,s.AP)("No longer ignoring %(username)s"),{username:e},!0),removedOldestIgnore:e=>(0,s.GW)((0,s.AP)("Ignore limit reached. Removed oldest user from list: %(username)s"),{username:e},!0),userHasBeenReported:e=>(0,s.GW)((0,s.AP)("%(username)s has been reported"),{username:e},!0),createdByUsername:e=>(0,s.GW)((0,s.AP)("by %(username)s"),{username:e},!0),errorIgnoringUser:e=>(0,s.GW)((0,s.AP)("Error ignoring user %(username)s. Please try again in a few seconds."),{username:e},!0),errorUnignoringUser:e=>(0,s.GW)((0,s.AP)("Error unignoring user %(username)s. Please try again in a few seconds."),{username:e},!0),errorFollowingUser:e=>(0,s.GW)((0,s.AP)("Error following user %(username)s. Please try again."),{username:e},!0),errorUnfollowingUser:e=>(0,s.GW)((0,s.AP)("Error unfollowing user %(username)s. Please try again."),{username:e},!0),errorVotingForUser:e=>(0,s.GW)((0,s.AP)("Error voting for user %(username)s. Please try again."),{username:e},!0),transferTokensToCashWithValue:e=>(0,s.GW)((0,s.AP)("Transfer tokens to %(cashAmount)s cash."),{cashAmount:e},!0),transferTokensToAdvertisingWithValue:e=>(0,s.GW)((0,s.AP)("Transfer tokens to %(cashAmount)s advertising credit."),{cashAmount:e},!0),overSpendingLimitResolved:e=>(0,s.GW)((0,s.AP)("Attempted to purchase %(tokens)s tokens but spending limit exceeded. This has been resolved by an administrator."),{tokens:e},!0),overSpendingLimitUnresolved:(e,t)=>(0,s.GW)((0,s.AP)("Attempted to purchase %(tokens)s tokens but spending limit exceeded. Email %(supportEmail)s ASAP to resolve."),{tokens:e,supportEmail:t},!0),purchasePhotoSet:(e,t)=>(0,s.GW)((0,s.AP)("Purchase Photo/Video (%(setName)s) from %(username)s"),{setName:e,username:t,link:(0,n._Y)(`/${t}`)},!0),sellPhotoSet:(e,t)=>(0,s.GW)((0,s.AP)("Sell Photo/Video (%(setName)s) to %(username)s"),{setName:e,username:t,link:(0,n._Y)(`/${t}`)},!0),purchaseSocialMediaFrom:(e,t)=>(0,s.GW)((0,s.AP)("Purchase social media (%(name)s) from %(username)s"),{name:e,username:t,link:(0,n._Y)(`/${t}`)},!0),sellSocialMediaTo:(e,t)=>(0,s.GW)((0,s.AP)("Sell Social media (%(name)s) to %(username)s"),{name:e,username:t,link:(0,n._Y)(`/${t}`)},!0),broadcasterWelcomeMessage:e=>(0,s.GW)((0,s.AP)("Your cam is visible to %(listVisibleTo)s. Edit this in settings & privacy."),{listVisibleTo:e},!0),privateShowRequestNotice:e=>(0,s.GW)((0,s.AP)("%(username)s wants to start a private show."),{username:e},!0),privateShowEarningsMessage:e=>(0,s.GW)((0,s.AP)("This private show will earn you %(tokens)s tokens per minute, based on your settings."),{tokens:e},!0),tokensPerMinute:e=>(0,s.GW)((0,s.AP)("%(tokens)s Per Minute"),{tokens:e},!0),banUserConfirm:e=>(0,s.GW)((0,s.AP)("Ban %(username)s?"),{username:e},!0),banUserError:e=>(0,s.GW)((0,s.AP)("Error banning user %(username)s"),{username:e},!0),banUserSuccess:e=>(0,s.GW)((0,s.AP)("User %(username)s banned from your room"),{username:e},!0),userHasTippedMe:e=>(0,s.GW)((0,s.AP)("%(username)s has tipped me"),{username:e},!0),tokensInPastHour:e=>(0,s.GW)((0,s.AP)("%(tokens)s in the past hour"),{tokens:e},!0),tokensInPastDay:e=>(0,s.GW)((0,s.AP)("%(tokens)s in the past day"),{tokens:e},!0),tokensInPastTwoWeeks:e=>(0,s.GW)((0,s.AP)("%(tokens)s in the past 2 weeks"),{tokens:e},!0),activeMembershipsMessage:e=>(0,s.GW)((0,s.WI)("You have %(numMemberships)s Active Membership","You have %(numMemberships)s Active Memberships",e),{numMemberships:e},!0),monthlyCost:e=>(0,s.GW)((0,s.AP)("$%(cost)s monthly"),{cost:e},!0),automaticallySilencedUsersMessage:e=>(0,s.GW)((0,s.WI)("We have automatically silenced %(numSilenced)s user possibly linked to a user you have previously silenced;","We have automatically silenced %(numSilenced)s users possibly linked to a user you have previously silenced;",e),{numSilenced:e},!0),automaticallyBannedUsersMessage:e=>(0,s.GW)((0,s.WI)("We have automatically banned %(numSilenced)s user possibly linked to a user you have previously banned;","We have automatically banned %(numSilenced)s users possibly linked to a user you have previously banned;",e),{numSilenced:e},!0),currentFanClubMembersTitle:e=>(0,s.GW)((0,s.WI)("%(numMembers)s Current Fan Club Member","%(numMembers)s Current Fan Club Members",e),{numMembers:e},!0),broadcastNotificationTopBarFollowerTextPluralOld:e=>(0,s.GW)((0,s.AP)("You have %(numFollowers)s followers"),{numFollowers:e},!0),userPromotionToolbarInProgressText:e=>(0,s.GW)((0,s.AP)("Promoted for %(relativeTime)s"),{relativeTime:e},!0),idAboutToExpire:e=>(0,s.GW)((0,s.AP)("An ID on your account is set to expire on %(expire)s. Please submit new ID for verification in order to continue earning tokens on uploaded content or while broadcasting with minimal disruption."),{expire:e},!0),guestIdAboutToExpire:e=>(0,s.GW)((0,s.AP)("Your Guest %(username)s has an ID expiring soon on their account. Please let your Guest know they'll need to submit an updated ID on their personal account to keep the ability to be a Guest on your account."),{username:e},!0),paxumTempNotice:()=>(0,s.GW)((0,s.AP)('Due to new requirements necessary for Paxum payouts, we need some additional information for you to continue to receive payments. Please visit this page to update your info.'),{link:(0,n._Y)("/affiliates/payoutinfo_paxum_temp/")},!0),userPromotionReportText:e=>(0,s.GW)((0,s.AP)("Your promotion is complete - %(viewCount)s people saw your room on the homepage and Discover page."),{viewCount:e},!0),showMyCamStart:e=>(0,s.GW)((0,s.AP)("Start Cam To Cam with %(username)s"),{username:e},!0),showMyCamPreviewInfo1:e=>(0,s.GW)((0,s.AP)("Your cam will only be visible to %(username)s."),{username:e},!0),showMyCamCurrentlySharing:e=>(0,s.GW)((0,s.AP)("You are currently showing your cam to %(room)s. If your cam has ended, please wait up to 1 minute to be able to broadcast again."),{room:e},!0),showMyCamCooldownAlert:e=>(0,s.GW)((0,s.AP)("Please allow up to %(sec)s seconds before sharing your cam again."),{sec:e},!0),privateConversationWithText:e=>(0,s.GW)((0,s.AP)("Private conversation with %(username)s"),{username:e},!0),fanclubCancelConfirmMessage:e=>(0,s.GW)((0,s.AP)("Are you sure you wish to leave %(username)s's Fan Club? You will remain a member until your currently paid month expires."),{username:e},!0),loginForPasswordPrompt:e=>(0,s.GW)((0,s.AP)("%(room)s's room now requires a password. Please log in for a password prompt."),{room:e},!0),passwordRequiredForRoom:e=>(0,s.GW)((0,s.AP)("Password required for room %(room)s"),{room:e},!0),authSectionInfo:e=>(0,s.GW)((0,s.AP)("Use the Events API JSON feed to see your room's chat messages and events. For more information, see the documentation."),{eventsUrl:(0,n._Y)(e),documentationUrl:(0,n._Y)("/apps/api/docs/index.html")},!0),gamesText:(e,t)=>(0,s.GW)((0,s.AP)("Approved games can now be live streamed on %(siteName)s. Let us know which approved game you are playing below. If a game you would like to broadcast on %(siteName)s is not on the approved list, encourage the game developer to submit their game to the Multimedia Games site."),{siteName:e,gamesUrl:(0,n._Y)(t)},!0),usedByText:e=>(0,s.GW)((0,s.AP)("Currently used by: %(app)s"),{app:e},!0),replaceAppConfirm:e=>(0,s.GW)((0,s.AP)("This slot is currently used by %(app)s.\nDo you want to replace it?"),{app:e},!0),noSearchResults:e=>(0,s.GW)((0,s.AP)("No search results for '%(text)s'"),{text:e},!0),noSearchResultsMatch:e=>(0,s.GW)((0,s.AP)("No search results for '%(keyword)s' match your preferences, please update your search/filter options."),{keyword:e},!0),searchResultsFor:e=>(0,s.GW)((0,s.AP)('Search results for "%(keyword)s"'),{keyword:e},!0),feedbackSentimentLabel:e=>(0,s.GW)((0,s.AP)("Overall, how was your %(siteName)s experience today?"),{siteName:e},!0),feedbackSmcLabel:e=>(0,s.GW)((0,s.AP)("How was your %(siteName)s Cam To Cam experience today?"),{siteName:e},!0),feedbackBroadcasterLabel:e=>(0,s.GW)((0,s.AP)("How was your %(siteName)s broadcast experience today?"),{siteName:e},!0),howSmootherExperience:e=>(0,s.GW)((0,s.AP)("Can we do anything to make your %(siteName)s experience smoother?"),{siteName:e},!0),upgradeToSupporter:e=>(0,s.GW)((0,s.AP)('Upgrade to supporter for no ads, private messaging, and more!'),{link:(0,n._Y)(e)},!0),supporterToUseFeature:e=>(0,s.GW)((0,s.AP)('Upgrade to supporter to use this feature.'),{link:(0,n._Y)("/supporter/upgrade/?source=".concat(e))},!0),sorryToSeeYouGo:e=>(0,s.GW)((0,s.AP)("We're sorry to see you go. Your subscription has been canceled successfully. You will keep all of your supporter features until %(expireAt)s, after which your membership will expire. You will not be charged after this date."),{expireAt:e},!0),startDateNotice:e=>(0,s.GW)((0,s.AP)("Your new subscription will begin %(startAt)s."),{startAt:e},!0),obsBroadcastWarning:e=>(0,s.GW)((0,s.AP)("WARNING: Your broadcast is live on %(siteName)s when you are streaming from RTMP/OBS, regardless of if you are in your room."),{siteName:e},!0),selectGameSectionText:(e,t)=>(0,s.GW)((0,s.AP)('If a game you would like to broadcast on %(siteName)s is not on the approved list, encourage the game developer to submit their game to the Multimedia Games Site .'),{siteName:e,gamesUrl:(0,n._Y)(t)},!0),downloadOBSSectionText:e=>(0,s.GW)((0,s.AP)('You can use Open Broadcaster Software (OBS) to stream games and overlay with it your webcam feed. You\'ll need your %(siteName)s stream key to connect OBS to your stream. See a quick tutorial if you need help.'),{siteName:e,obsLink:(0,n._Y)("https://obsproject.com/"),supportLink:(0,n._Y)("https://support.chaturbate.com/hc/en-us/articles/360037971952-How-do-I-set-up-OBS-/")},!0),authorizeGameSectionText:e=>(0,s.GW)((0,s.AP)('After you go live, click here to add the gaming tag to your stream. This step is required to stream licensed games on %(siteName)s.'),{siteName:e},!0),mobileNewPrivateMessageNotice:e=>(0,s.GW)((0,s.AP)("New private message from %(username)s"),{username:e},!0),newPrivateMessageNotice:e=>(0,s.GW)((0,s.AP)("New private message from %(username)s"),{username:e},!0),newDirectMessageNotice:e=>(0,s.GW)((0,s.AP)("New direct message from %(username)s"),{username:e},!0),newConversationMessageNotice:e=>(0,s.GW)((0,s.AP)("New message from %(username)s"),{username:e},!0),sendDmToUser:e=>(0,s.GW)((0,s.AP)("Send DM to %(username)s"),{username:e},!0),tipUser:e=>(0,s.GW)((0,s.AP)("Tip %(user)s"),{user:e},!0),sendTipToUser:e=>(0,s.GW)((0,s.AP)("Send Tip to %(user)s"),{user:(0,s.VE)(e)},!0),numViewerOrViewers:e=>(0,s.GW)((0,s.WI)("%(viewerCount)s viewer","%(viewerCount)s viewers",e),{viewerCount:e},!0),shortenedNumViewerOrViewers:(e,t)=>(0,s.GW)((0,s.WI)("%(shortenedViewCount)s viewer","%(shortenedViewCount)s viewers",e),{shortenedViewCount:t},!0),obsStreamClass:e=>(0,s.GW)((0,s.AP)("Your stream is classed as %(resolutionTitle)s"),{resolutionTitle:e},!0),obsConnectionDescription:(e,t,i)=>(0,s.GW)((0,s.AP)("Connected to %(host)s in region %(region)s - Using %(streamType)s"),{host:e,region:t,streamType:i},!0),obsFPS:e=>(0,s.GW)((0,s.AP)("%(fps)s fps"),{fps:e},!0),obsBitrate:e=>(0,s.GW)((0,s.AP)("%(bitrate)s bitrate"),{bitrate:e},!0),obsAlternativeStreamType:e=>(0,s.GW)((0,s.AP)("Currently broadcasting with %(streamType)s from another browser."),{streamType:e},!0),obsSupport:e=>(0,s.GW)((0,s.AP)("Visit our support page to get started with OBS on %(siteName)s"),{siteName:e},!0),signInWithSocialAuth:e=>(0,s.GW)((0,s.AP)("Sign In with %(name)s"),{name:e},!0),createdAt:e=>(0,s.GW)((0,s.AP)("Created at %(date)s"),{date:e},!0),expiresOn:e=>(0,s.GW)((0,s.AP)("Expires on %(date)s"),{date:e},!0),followingUser:e=>(0,s.GW)((0,s.AP)("Following %(username)s"),{username:e},!0),followCountLong:(e,t)=>(0,s.GW)((0,s.AP)("%(online)s Online / %(total)s Following"),{online:e,total:t},!0),cannotCancelPrivate:(e,t,i)=>{let n;return n=t>0?(0,s.AP)("You have started a private show with a %(minimumMinutes)s minute minimum. You cannot cancel your private show yet. It still has %(minutesRemaining)s minutes and %(secondsRemaining)s seconds remaining."):(0,s.AP)("You have started a private show with a %(minimumMinutes)s minute minimum. You cannot cancel your private show yet. It still has %(secondsRemaining)s seconds remaining."),(0,s.GW)(n,{minimumMinutes:e,minutesRemaining:t,secondsRemaining:i},!0)},minimumNotMet:(e,t)=>(0,s.GW)("This show has a %(minimumMinutes)s minute minimum. Ending the show now will cost the remaining %(minimumTokens)s tokens.",{minimumMinutes:t,minimumTokens:e},!0),minimumNotMetNoStamp:(e,t)=>(0,s.GW)("This show has a %(minimumMinutes)s minute minimum. Ending the show now will cost the minimum %(minimumTokens)s tokens.",{minimumMinutes:t,minimumTokens:e},!0),timeRemaining:(e,t)=>{let i="Time remaining: %(minutesRemaining)s mins and %(secondsRemaining)s secs.";return e<1&&(i="Time remaining: %(secondsRemaining)s secs."),(0,s.GW)(i,{minutesRemaining:e,secondsRemaining:t},!0)},unableToLeavePrivateShow:e=>(0,s.GW)((0,s.AP)("Unable to leave private show from status: %(prevStatus)s"),{prevStatus:e},!0),sentTipDmNotice:e=>(0,s.GW)((0,s.WI)("You tipped %(num)s token.","You tipped %(num)s tokens.",e),{num:e},!0),receivedTipDmNotice:(e,t)=>(0,s.GW)((0,s.WI)("%(otherUser)s tipped you %(num)s token.","%(otherUser)s tipped you %(num)s tokens.",t),{otherUser:e,num:t},!0),receivedTipDmNoticeWithMessage:(e,t,i)=>(0,s.GW)((0,s.WI)("%(otherUser)s tipped you %(num)s token. -- %(message)s","%(otherUser)s tipped you %(num)s tokens. -- %(message)s",t),{otherUser:e,num:t,message:i},!0),privacyLabel_InCntntSUp:e=>(0,s.GW)((0,s.AP)('I have read and agree to the privacy policy.'),{link:(0,n._Y)(e)},!0),anonUsersCount:e=>(0,s.GW)((0,s.WI)("+%(anonCount)s anonymous user","+%(anonCount)s anonymous users",e),{anonCount:e},!0),directMessagesPageTitle:(e,t)=>(0,s.GW)((0,s.AP)("Direct Messages (%(currentUsername)s) - %(otherUsername)s"),{currentUsername:e,otherUsername:t},!0),todayAtTime:e=>(0,s.GW)((0,s.AP)("Today at %(time)s"),{time:e},!0),yesterdayAtTime:e=>(0,s.GW)((0,s.AP)("Yesterday at %(time)s"),{time:e},!0),shortcodeEnteredError:e=>(0,s.GW)((0,s.AP)("Invalid shortcode message entered: %(message)s"),{message:e},!0),shortcodeFollowMessage:e=>(0,s.GW)((0,s.AP)("Follow %(username)s"),{username:e},!0),shortcodeFanclubMessage:e=>(0,s.GW)((0,s.AP)("Join %(username)s's Fan Club"),{username:e},!0),shortcodeHelpSignup:()=>(0,s.GW)((0,s.AP)("Generates a clickable link with the text \"%(signupMsg)s\". Upon clicking the link, it opens the signup page using the broadcaster user's affiliate tracking tags. The shortcode is designed to always return the signup link with the broadcaster's campaign/affiliate code, regardless of who in the broadcaster's room types in that shortcode."),{signupMsg:r.joinCB},!0),shortcodeHelpSupporter:()=>(0,s.GW)((0,s.AP)('Generates a clickable link with the text "%(supporterMsg)s". Upon clicking this link, the user is directed to the supporter page to upgrade their membership.'),{supporterMsg:r.becomeSupporter},!0),shortcodeHelpFanclub:e=>(0,s.GW)((0,s.AP)("Generates a clickable link with the text \"%(fanclubMsg)s\". When the link is clicked, it opens the broadcaster's Fan Club page. If the user doesn't have a Fan Club set up, an error dialog will be displayed to explain this."),{fanclubMsg:r.shortcodeFanclubMessage(e)},!0),shortcodeHelpFollow:e=>(0,s.GW)((0,s.AP)('Generates a clickable link with the text "%(followMsg)s". When a user clicks on this link, it triggers the user to follow the room. If the user is already following the room, the shortcode is designed to do nothing.'),{followMsg:r.shortcodeFollowMessage(e)},!0),shortcodeHelpTip:()=>(0,s.GW)((0,s.AP)('Generates a clickable link with the text representing the specified amount, such as "50 tokens." Upon clicking the link, it opens a tipping dialog with the given amount and message (in this case, "%(tipExample)s") prepopulated in the dialog. This shortcode is allowed only for broadcasters and apps.'),{tipExample:r.shortcodeHelpTipExample},!0),roomlistPageTitleHashtag:(e,t)=>(0,s.GW)((0,s.AP)("%(tagName)s Cams @ %(siteName)s - Free Adult Webcams & Live Sex"),{tagName:e,siteName:t},!0),roomlistPageTitleFemale:e=>(0,s.GW)((0,s.AP)("Free Chat with Girls - Live Cam Girls, Free Webcam Girls at %(siteName)s"),{siteName:e},!0),roomlistPageTitleMale:e=>(0,s.GW)((0,s.AP)("Free Chat with Men - Live Gay Cams, Free Gay Webcams at %(siteName)s"),{siteName:e},!0),roomlistPageTitleCouple:e=>(0,s.GW)((0,s.AP)("Free Chat with Couples - Live Cam Couples, Free Webcam Couples at %(siteName)s"),{siteName:e},!0),roomlistPageTitleTrans:e=>(0,s.GW)((0,s.AP)("Free Chat with Trans - Live Cam Trans, Free Webcam Trans at %(siteName)s"),{siteName:e},!0),roomlistPageTitleDefault:e=>(0,s.GW)((0,s.AP)("%(siteName)s - Free Adult Webcams, Live Sex, Free Sex Chat, Exhibitionist & Pornstar Free Cams"),{siteName:e},!0),roomlistPageTitlePremium:e=>(0,s.GW)((0,s.AP)("Private & Spy Cams @ %(siteName)s - Adult Webcams & Live Sex"),{siteName:e},!0),metaTitlePremium:e=>(0,s.GW)((0,s.AP)("Premium Private Cam Shows at %(siteName)s"),{siteName:e},!0),metaTitleFemale:e=>(0,s.GW)((0,s.AP)("Free Chat with Cam Girls at %(siteName)s!"),{siteName:e},!0),metaTitleMale:e=>(0,s.GW)((0,s.AP)("Free Chat with Cam Guys at %(siteName)s!"),{siteName:e},!0),metaTitleCouples:e=>(0,s.GW)((0,s.AP)("Free Chat with Cam Couples at %(siteName)s!"),{siteName:e},!0),metaTitleTrans:e=>(0,s.GW)((0,s.AP)("Free Trans Cams and Chat at %(siteName)s!"),{siteName:e},!0),metaTitleHashtag:(e,t)=>(0,s.GW)((0,s.AP)("%(siteName)s - %(hashtag)s Live Webcams"),{siteName:e,hashtag:t},!0),metaTitleDefault:e=>(0,s.GW)((0,s.AP)("%(siteName)s - Free Adult Live Webcams!"),{siteName:e},!0),metaContentCardDescriptionHashtag:e=>(0,s.GW)((0,s.AP)("Enjoy free %(hashtag)s webcams and live chat broadcasts from amateurs. No registration required!"),{hashtag:e},!0),roomMetaContentCardDescription:e=>(0,s.GW)((0,s.AP)("Watch %(username)s live on Chaturbate!"),{username:e},!0),metaDescriptionFemale:e=>(0,s.GW)((0,s.AP)("Chat with live cams girls on %(domain)s! NSFW - Uncensored chat & adult webcams"),{domain:e},!0),metaDescriptionMale:e=>(0,s.GW)((0,s.AP)("Talk with gay guys and men instantly on %(domain)s! NSFW - Uncensored chat & gay webcams"),{domain:e},!0),metaDescriptionCouples:e=>(0,s.GW)((0,s.AP)("Watch live couples chatting on %(domain)s! NSFW - Uncensored chat & adult webcams"),{domain:e},!0),metaDescriptionTrans:e=>(0,s.GW)((0,s.AP)("Enjoy wild live trans webcams on %(domain)s! NSFW - Uncensored chat & trans webcams"),{domain:e},!0),metaKeywordsHashtag:e=>(0,s.GW)((0,s.AP)("%(hashtag)s cams, %(hashtag)s sex, %(hashtag)s xxx, %(hashtag)s porn, %(hashtag)s webcams"),{hashtag:e},!0),rssLinkTitle:(e,t)=>(0,s.GW)((0,s.AP)("%(camCategory)s Cams RSS Feed for %(siteName)s"),{camCategory:e,siteName:t},!0),genderSymbolToIconTitle:e=>{var t;const i=new Map([[o.YT.All,""],[o.YT.Male,r.maleText],[o.YT.Female,r.femaleText],[o.YT.Couple,r.coupleText],[o.YT.Trans,r.transText],[o.YT.OldTrans,r.transText]]),s=(0,o.P_)(e);return null!==(t=i.get(s))&&void 0!==t?t:""},errorLoadingDms:e=>(0,s.GW)((0,s.AP)("Error loading DM conversation with %(username)s"),{username:e},!0),v1AppsAndBotsFooterText:()=>(0,s.GW)((0,s.AP)("Create or update v1 Apps & Bots on the v1 Apps & Bots page."),{link:(0,n._Y)("/apps/")},!0),ieSupportNotification:()=>(0,s.GW)((0,s.AP)('We noticed you\'re using a web browser that we don\'t support. Upgrade to a recent version of
Chrome, Firefox, or Safari'),{chromeLink:(0,n._Y)("https://www.google.com/chrome/"),firefoxLink:(0,n._Y)("https://www.mozilla.org/firefox/"),safariLink:(0,n._Y)("https://support.apple.com/downloads/safari/")},!0),addTFANotification:()=>(0,s.GW)((0,s.AP)('Add an extra layer of protection to your account by setting up 2-Step Verification at the Security Center'),{link:(0,n._Y)("/security/")},!0),camAndMicPermissionSupportInfo:()=>(0,s.GW)((0,s.AP)("Visit our support page for help enabling your devices."),{link:(0,n._Y)("https://support.chaturbate.com/hc/en-us/articles/360040862791/")},!0),signUpToUseFeature:()=>(0,s.GW)((0,s.AP)('Sign up to use this feature.'),{link:(0,n._Y)("/accounts/register/")},!0),enableAgeVerificationToReceiveTokens:()=>(0,s.GW)((0,s.AP)('You must submit age verification to enable the ability to receive tokens while broadcasting.'),{link:(0,n._Y)("/accounts/age_verification/")},!0),mustBeAgeVerifiedToAddSocialMedia:()=>(0,s.GW)((0,s.AP)('You must be age verified to add new social media'),{link:(0,n._Y)("/accounts/age_verification/")},!0),mustBeAgeVerifiedToUploadContent:()=>(0,s.GW)((0,s.AP)('You must purchase tokens or be age verified to add new photos and videos'),{link:(0,n._Y)("/accounts/age_verification/")},!0),errorUploadMediaLimit:e=>(0,s.GW)((0,s.WI)("Too many files selected. Only %(limit)s file may be uploaded at a time.","Too many files selected. Only %(limit)s files may be uploaded at a time.",e),{limit:e},!0),inactiveGuestNotice:()=>(0,s.GW)((0,s.AP)('One of your linked Guests has become inactive. Review your Guests now.'),{link:(0,n._Y)("/accounts/age_verification/")},!0),visitMobileSiteOrFeedback:()=>(0,s.GW)((0,s.AP)('Visit the mobile site again, or give us some feedback on why you left'),{link:(0,n._Y)("https://m.chaturbate.com")},!0),ageVerifiedBody2:()=>(0,s.GW)((0,s.AP)('To age verify another person on your account, submit their ID at the Independent Broadcaster Verification page'),{link:(0,n._Y)("/identity/")},!0),roomFilteredByHashtag:e=>(0,s.GW)((0,s.AP)("Rooms filtered by #%(hashtag)s "),{hashtag:e},!0),categoryDescriptionPrivate:e=>(0,s.GW)((0,s.AP)("Spy on private shows to experience the most exclusive shows on %(siteName)s. You won't get to interact, but it's much cheaper than buying a private show yourself."),{siteName:e},!0),seconds:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(0,s.GW)((0,s.AP)("%(seconds)s sec"),{seconds:e},!0):(0,s.GW)((0,s.WI)("%(seconds)s second","%(seconds)s seconds",e),{seconds:e},!0)},secondsAgo:e=>(0,s.GW)((0,s.WI)("%(seconds)s second ago","%(seconds)s seconds ago",e),{seconds:e},!0),secondsFromNow:e=>(0,s.GW)((0,s.WI)("%(seconds)s second from now","%(seconds)s seconds from now",e),{seconds:e},!0),minutes:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(0,s.GW)((0,s.WI)("%(minutes)s min","%(minutes)s mins",e),{minutes:e},!0):(0,s.GW)((0,s.WI)("%(minutes)s minute","%(minutes)s minutes",e),{minutes:e},!0)},minutesAgo:e=>(0,s.GW)((0,s.WI)("%(minutes)s minute ago","%(minutes)s minutes ago",e),{minutes:e},!0),minutesFromNow:e=>(0,s.GW)((0,s.WI)("%(minutes)s minute from now","%(minutes)s minutes from now",e),{minutes:e},!0),hours:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){const t=e.toFixed(1);return(0,s.GW)((0,s.WI)("%(hours)s hr","%(hours)s hrs",e),{hours:t},!0)}return(0,s.GW)((0,s.WI)("%(hours)s hour ago","%(hours)s hours ago",e),{hours:e},!0)},hoursAgo:e=>(0,s.GW)((0,s.WI)("%(hours)s hour ago","%(hours)s hours ago",e),{hours:e},!0),hoursFromNow:e=>(0,s.GW)((0,s.WI)("%(hours)s hour from now","%(hours)s hours from now",e),{hours:e},!0),days:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(0,s.GW)((0,s.WI)("%(days)s d","%(days)s d",e),{days:e},!0):(0,s.GW)((0,s.WI)("%(days)s day","%(days)s days",e),{days:e},!0)},daysAgo:e=>(0,s.GW)((0,s.WI)("%(days)s day ago","%(days)s days ago",e),{days:e},!0),daysFromNow:e=>(0,s.GW)((0,s.WI)("%(days)s day from now","%(days)s days from now",e),{days:e},!0),weeks:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(0,s.GW)((0,s.WI)("%(weeks)s wk","%(weeks)s wks",e),{weeks:e},!0):(0,s.GW)((0,s.WI)("%(weeks)s week","%(weeks)s weeks",e),{weeks:e},!0)},weeksAgo:e=>(0,s.GW)((0,s.WI)("%(weeks)s week ago","%(weeks)s weeks ago",e),{weeks:e},!0),weeksFromNow:e=>(0,s.GW)((0,s.WI)("%(weeks)s week from now","%(weeks)s weeks from now",e),{weeks:e},!0),months:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(0,s.GW)((0,s.WI)("%(months)s mo","%(months)s mos",e),{months:e},!0):(0,s.GW)((0,s.WI)("%(months)s month","%(months)s months",e),{months:e},!0)},monthsAgo:e=>(0,s.GW)((0,s.WI)("%(months)s month ago","%(months)s months ago",e),{months:e},!0),monthsFromNow:e=>(0,s.GW)((0,s.WI)("%(months)s month from now","%(months)s months from now",e),{months:e},!0),years:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(0,s.GW)((0,s.WI)("%(years)s yr","%(years)s yrs",e),{years:e},!0):(0,s.GW)((0,s.WI)("%(years)s year","%(years)s years",e),{years:e},!0)},yearsAgo:e=>(0,s.GW)((0,s.WI)("%(years)s year ago","%(years)s years ago",e),{years:e},!0),yearsFromNow:e=>(0,s.GW)((0,s.WI)("%(years)s year from now","%(years)s years from now",e),{years:e},!0),ageRangeTo:(e,t)=>{const i=String(null!=e?e:""),n=String(null!=t?t:"");return(0,s.GW)((0,s.AP)("%(fromAge)s to %(toAge)s"),{fromAge:i,toAge:n},!0)},roomCount:e=>(0,s.GW)((0,s.WI)("%(numRooms)s room","%(numRooms)s rooms",e),{numRooms:e},!0),tipSentAction:e=>(0,s.GW)((0,s.AP)("Outbound Tip: %(username)s"),{username:e,link:(0,n._Y)(`/${e}`)},!0),tipReceivedAction:e=>(0,s.GW)((0,s.AP)("Tip From: %(username)s"),{username:e,link:(0,n._Y)(`/${e}`)},!0),promotedRoomAction:e=>(0,s.GW)((0,s.AP)("Promoted Room: %(username)s"),{username:e,link:(0,n._Y)(`/${e}`)},!0),groupShowAction:e=>(0,s.GW)((0,s.AP)("Group Show: %(username)s"),{username:e,link:(0,n._Y)(`/${e}`)},!0),spyShowAction:e=>(0,s.GW)((0,s.AP)("Spy Show: %(username)s"),{username:e,link:(0,n._Y)(`/${e}`)},!0),fanClubShowAction:e=>(0,s.GW)((0,s.AP)("Fan Club Membership: %(username)s"),{username:e,link:(0,n._Y)(`/${e}`)},!0),privateShowAction:e=>(0,s.GW)((0,s.AP)("Private Show: %(username)s"),{username:e,link:(0,n._Y)(`/${e}`)},!0),adminAdjustmentAction:e=>(0,s.GW)((0,s.AP)("Admin Adjustment: %(note)s"),{note:e},!0),bioAndFreeWebCamText:e=>(0,s.GW)((0,s.AP)("%(username)s's Bio and Free Webcam"),{username:e},!0),bitrateMuchLowerThanHigh:e=>(0,s.GW)((0,s.AP)("Your bitrate is much lower than the recommended minimum of %(lowBitrate)skbps for this resolution at a high frame rate. You may need to switch to a standard frame rate."),{lowBitrate:e},!0),bitrateMuchLower:e=>(0,s.GW)((0,s.AP)("Your bitrate is much lower than the recommended minimum of %(lowBitrate)skbps for this resolution."),{lowBitrate:e},!0),bitrateLowerThanHigh:e=>(0,s.GW)((0,s.AP)("Your bitrate is lower than the recommended minimum of %(lowBitrate)skbps for this resolution at a high frame rate. You may need to switch to a standard frame rate."),{lowBitrate:e},!0),bitrateLower:e=>(0,s.GW)((0,s.AP)("Your bitrate is lower than the recommended minimum of %(lowBitrate)skbps for this resolution."),{lowBitrate:e},!0),promotionConfirmPriceText:e=>(0,s.GW)((0,s.WI)("Current Price: %(tokens)s token","Current Price: %(tokens)s tokens",e),{tokens:e},!0),tapToChatWithUser:e=>(0,s.GW)((0,s.AP)("Tap here to chat with %(username)s."),{username:e},!0),privateShowEarlyCancelMessage:(e,t)=>(0,s.GW)((0,s.AP)(" %(username)s has paid %(tokens)s tokens to end the private show early."),{username:e,tokens:t},!0),nNewMessages:e=>(0,s.GW)((0,s.WI)("%(count)s new message","%(count)s new messages",e),{count:e},!0),PmCAPS:(0,s.AP)("PM"),sendPmCAPS:(0,s.AP)("SEND PM"),sendDmCAPS:(0,s.AP)("SEND DM"),pmMenuTitle:(0,s.AP)("Send PM"),dmMenuTitle:(0,s.AP)("Send DM"),pmSupporterNotice:(0,s.AP)("You must be a supporter, fan club member, or moderator to send this private message."),pmSupporterNoticeAgeVerified:(0,s.AP)("You must be a supporter, fan club member, moderator, or have received a tip today from this user to send this private message."),dmSupporterNotice:(0,s.AP)("You must be a supporter, fan club member, or moderator to send this direct message."),dmSupporterNoticeAgeVerified:(0,s.AP)("You must be a supporter, fan club member, moderator, or have received a tip in the past week from this user to send this direct message."),pmSupporterSignUp:(0,s.AP)("Sign up for a"),pmSupporterMembership:(0,s.AP)("Supporter Membership"),newPrivateMessageClickPrompt:(0,s.AP)(" (open conversation or press TAB to cycle through)"),newConversationPmClickHTML:(0,s.AP)("open in PMs or press TAB to cycle through"),newConversationPmClickMobile:(0,s.AP)("open in PMs"),newConversationDmClick:(0,s.AP)("open in DMs"),openConversationLower:(0,s.AP)("open conversation"),joinChaturbateCommunity:(0,s.AP)("Join Chaturbate's community."),roomSignupPopupText:(0,s.AP)("Chat live, follow broadcasters, access private shows, or earn money!"),roomSignupPopupSignupText:(0,s.AP)("Sign Up Free"),chatColor:(0,s.AP)("Chat Color"),font:(0,s.AP)("Font"),fontSize:(0,s.AP)("Font Size"),showEmoticons:(0,s.AP)("Show Emoticons"),emoticonAutoCompleteDelay:(0,s.AP)("Autocomplete Delay"),sortUsers:(0,s.AP)("Sort Users"),highestTokenColor:(0,s.AP)("Highest Token Color"),chatAllowedBy:(0,s.AP)("Chat Allowed By"),moderatorsExpireAfter:(0,s.AP)("Moderators Expire After"),silenceOtherBroadcasters:(0,s.AP)("Silence Other Age-Verified Broadcasters"),yesAlways:(0,s.AP)("Yes, Always"),preventC2CRedisplay:(0,s.AP)("Cam to Cam Notification Rate Limit"),noLimit:(0,s.AP)("No Limit"),fiveMinutes:(0,s.AP)("Once per User Every 5 Minutes"),forever:(0,s.AP)("Once per User Until You View Their Cam"),tipVolume:(0,s.AP)("Tip Volume"),collapseNotices:(0,s.AP)("Collapse Notices"),viewEditIgnoredUsers:(0,s.AP)("View/Edit Ignored Users"),tagLine:(0,s.AP)("THE ACT OF MASTURBATING WHILE CHATTING ONLINE"),chatRoomsCAPS:(0,s.AP)("CHAT ROOMS"),broadcastYourselfCAPS:"BROADCAST YOURSELF",betaCAPS:(0,s.AP)("BETA"),tagsCAPS:(0,s.AP)("TAGS"),myCollectionCAPS:(0,s.AP)("MY COLLECTION"),myCollectionText:(0,s.AP)("My Collection"),loginVerbText:(0,s.AP)("Log in"),loginVerbCapitalized:(0,s.AP)("Log In"),signUpText:(0,s.AP)("Sign Up"),signUpLower:(0,s.AP)("Sign up"),defaultTipMessageLabel:(0,s.AP)("Include an optional message:"),TipOptionalMessageLabel:(0,s.AP)("Optional message:"),sendTipButtonText:(0,s.AP)("Send Tip"),sendTipButtonCAPS:(0,s.AP)("SEND TIP"),sendTipText:(0,s.AP)("Send a tip"),sendTipToBroadcasterText:(0,s.AP)("Send tip to broadcaster"),publicTippingText:(0,s.AP)("Public Tipping"),publicTippingDesc:(0,s.AP)("Username is visible to all users."),anonTippingText:(0,s.AP)("Anonymous Tipping"),anonTippingDesc:(0,s.AP)("Username only visible to broadcaster."),anonButtonText:(0,s.AP)("Send Anonymous Tip"),sending:(0,s.AP)("Sending..."),anonTipDisabledModalCont:(0,s.AP)("Click OK to continue to supporter signup."),mobileTipMessageLabelLandscape:(0,s.AP)("Include optional message"),mobileTipMessageLabelPortrait:(0,s.AP)("Tip note..."),mobileChatLabel:(0,s.AP)("Tap to chat..."),broadcasterDoesNotAcceptTips:(0,s.AP)("This broadcaster doesn't accept tips."),purchaseTokensText:(0,s.AP)("Purchase Tokens"),myProfileTextLc:(0,s.AP)("My Profile"),viewProfile:(0,s.AP)("View Profile"),liveChatSupportTextLc:(0,s.AP)("Live Chat Support"),logOutTextLc:(0,s.AP)("Log Out"),groupShowText:(0,s.AP)("Group Show"),logoutModalText:(0,s.AP)("Are you sure you want to log out?"),switchAccountModalText:(0,s.AP)("Are you sure you want to switch accounts?"),sendFeedbackTextLc:(0,s.AP)("Send Feedback"),statusText:(0,s.AP)("Status"),tokensLabel:(0,s.AP)("You have:"),getMoreTokensLabel:(0,s.AP)("Get more tokens"),getMoreTokensTitled:(0,s.AP)("Get More Tokens"),chatDisconnectedMessage:(0,s.AP)("Chat disconnected. The broadcaster has set a new password on this room."),privateText:(0,s.AP)("Private"),privateShowStartLabel:(0,s.AP)("Start Private Show"),privateShowSpyLabel:(0,s.AP)("Spy on Private Show"),privateShowStartedMessage:(0,s.AP)("Private show has started."),privateShowFinishedMessage:(0,s.AP)("Private show has finished."),privateShowDeclinedMessage:(0,s.AP)("Private show has been declined."),privateShowRequestLabel:(0,s.AP)("Request Private Show"),privateShowCancelRequestLabel:(0,s.AP)("Cancel Private Show Request"),privateShowRequestCancelMessage:(0,s.AP)("Cancel Private Request"),privateShowRequestCancelErrorMessage:(0,s.AP)("Cannot cancel private show. Please try again in a few seconds."),privateShowLeaveLabel:(0,s.AP)("Leave Private Show"),privateShowLeaveWarning:(0,s.AP)("Are you sure you want to leave the private show?"),privateShowRequestMessage:(0,s.AP)("Private show request has been sent. Waiting on broadcaster to approve."),privateShowRecordingSavedMessage:(0,s.AP)("A recording of this private show has been saved in the buyer's collection!"),requestPrivate:(0,s.AP)("Request Private"),cancelRequest:(0,s.AP)("Cancel Request"),leavePrivate:(0,s.AP)("Leave Private"),spyOnPrivate:(0,s.AP)("Spy on Private"),returnFromAwayModeMessage:(0,s.AP)("Broadcaster has returned from away mode."),rejoinedRoomKickedMessage:(0,s.AP)("You were disconnected because you have joined this room again."),kickedFromRoomMessage:(0,s.AP)("The broadcaster has kicked you from the room."),kickedMessage:(0,s.AP)("You were kicked from the room."),signUpToChatText:(0,s.AP)("signup to chat"),aboutMeText:(0,s.AP)("About Me"),wishListText:(0,s.AP)("Wish List"),purchasedCAPS:(0,s.AP)("PURCHASED"),orCAPS:(0,s.AP)("OR"),photosAndVideosText:(0,s.AP)("Photos and Videos"),realNameText:(0,s.AP)("Real Name"),followersText:(0,s.AP)("Followers"),sexText:(0,s.AP)("I Am"),sexTextCouple:(0,s.AP)("We are"),birthdayText:(0,s.AP)("Birthday"),birthdateText:(0,s.AP)("Birth Date"),ageText:(0,s.AP)("Age"),dateText:(0,s.AP)("Date"),actionText:(0,s.AP)("Action"),bodyTypeText:(0,s.AP)("Body Type"),bodyDecorationsText:(0,s.AP)("Body Decorations"),interstedInText:(0,s.AP)("Interested In"),locationText:(0,s.AP)("Location"),languagesText:(0,s.AP)("Language(s)"),lastBroadcastText:(0,s.AP)("Last Broadcast"),langaugesSpokenText:(0,s.AP)("Languages"),smokeDrinkText:(0,s.AP)("Smoke Drink"),smokeOrDrinkText:(0,s.AP)("Smoke / Drink"),bioUnavailableText:(0,s.AP)("User has no available BIO"),errorSubmitting:(0,s.AP)("Unable to submit"),submittingText:(0,s.AP)("Submitting..."),loadingText:(0,s.AP)("Loading"),loadingTextLower:(0,s.AP)("loading"),chatSettings:(0,s.AP)("Chat Settings"),chatSettingsTabHandleText:(0,s.AP)("SETTINGS"),chatSettingsTabHandleTextCapitalized:(0,s.AP)("Settings"),chatSettingsSavedText:(0,s.AP)("Chat settings saved"),chatCAPS:(0,s.AP)("CHAT"),sendCAPS:(0,s.AP)("SEND"),sendText:(0,s.AP)("Send"),tipCAPS:(0,s.AP)("TIP"),tipText:(0,s.AP)("Tip"),usersText:(0,s.AP)("Users"),usersCAPS:(0,s.AP)("USERS"),aUser:(0,s.AP)("a user"),reportAbuseText:(0,s.AP)("Report Room"),reportAbuseCAPS:(0,s.AP)("REPORT ROOM"),reportAbuseTextTerms:(0,s.AP)("Your room report will be reviewed as soon as practicable."),roomText:(0,s.AP)("Room"),moreRoomsText:(0,s.AP)("More Rooms"),spyPrivateShowLower:(0,s.AP)("spy private show"),unfollowText:(0,s.AP)("Unfollow"),unfollowLower:(0,s.AP)("unfollow"),followText:(0,s.AP)("Follow"),notifyMe:(0,s.AP)("Notify me"),notifyOptionAlways:(0,s.AP)("Always"),notifyOptionAuto:(0,s.AP)("Auto"),never:(0,s.AP)("Never"),refreshRoomsText:(0,s.AP)("Refresh Rooms"),womenText:(0,s.AP)("Women"),womenCAPS:(0,s.AP)("WOMEN"),womenLower:(0,s.AP)("women"),femaleText:(0,s.AP)("Female"),menText:(0,s.AP)("Men"),menCAPS:(0,s.AP)("MEN"),menLower:(0,s.AP)("men"),maleText:(0,s.AP)("Male"),transText:(0,s.AP)("Trans"),transCAPS:(0,s.AP)("TRANS"),couplesText:(0,s.AP)("Couples"),couplesCAPS:(0,s.AP)("COUPLES"),couplesLower:(0,s.AP)("couples"),coupleText:(0,s.AP)("Couple"),saveCAPS:(0,s.AP)("SAVE"),saveText:(0,s.AP)("Save"),recentlyUsedEmojis:(0,s.AP)("Recently used"),smileysPeopleEmojis:(0,s.AP)("Smileys & People"),animalsNatureEmojis:(0,s.AP)("Animals & Nature"),foodDrinkEmojis:(0,s.AP)("Food & Drink"),activitiesEmojis:(0,s.AP)("Activities"),travelPlacesEmojis:(0,s.AP)("Travel & Places"),objectsEmojis:(0,s.AP)("Objects"),symbolsEmojis:(0,s.AP)("Symbols"),flagsEmojis:(0,s.AP)("Flags"),uploadEmoticonsText:(0,s.AP)("Upload"),tone:(0,s.AP)("Tone"),currentBalanceText:(0,s.AP)("Your current balance:"),balanceText:(0,s.AP)("Balance:"),tokenBalanceText:(0,s.AP)("Token Balance"),currentHaveText:(0,s.AP)("You currently have: "),satisfactionWarningText:(0,s.AP)("WARNING: This room has a low satisfaction rating."),tipWarningText:(0,s.AP)("TIP AT YOUR OWN RISK!"),tipAmountText:(0,s.AP)("Enter tip amount:"),tipAmountInvalid:(0,s.AP)("Invalid tip amount!"),amountText:(0,s.AP)("Amount:"),toggleWindowMessage:(0,s.AP)("Toggle this window with Ctrl+S"),leaveOpenCheckBoxLabel:(0,s.AP)("Leave open after tipping"),selectOneLabel:(0,s.AP)("Select One"),selectReason:(0,s.AP)("Please select a reason"),loadingUserListText:(0,s.AP)("Loading user list"),refreshUserListText:(0,s.AP)("refresh userlist"),refreshUserListSentenceCase:(0,s.AP)("Refresh userlist"),errorRefreshingUserList:(0,s.AP)("Error refreshing user list. Please try again later."),sendAMessage:(0,s.AP)("Send a message"),sendAMessageDesktop:(0,s.AP)("Send a message..."),sendPrivateMessageText:(0,s.AP)("Send private message"),sendDirectMessageText:(0,s.AP)("Send direct message"),loggedInToPm:(0,s.AP)('You must be logged in to send a private message. Click "OK" to login.'),loggedInToDm:(0,s.AP)('You must be logged in to send a direct message. Click "OK" to login.'),mentionUserText:(0,s.AP)("Mention this user"),mention:(0,s.AP)("Mention"),hideAdsText:(0,s.AP)("HIDE ALL ADS NOW"),exoticAdsText:(0,s.AP)("Powered by ExoticAds
Buy/Sell Traffic"),showMoreText:(0,s.AP)("Show More"),picsAndVideosText:(0,s.AP)("Pics & Videos"),picsText:(0,s.AP)("Pictures"),vidsText:(0,s.AP)("Videos"),socialMediaText:(0,s.AP)("Social Media"),appsAndBots:(0,s.AP)("Apps & Bots"),appsTabDescription:(0,s.AP)("Add features like Tip Menus, Ticket Shows, and Top Tippers to your room with apps!"),v2AppsDescription:(0,s.AP)("v2 Apps can keep track of your top visitors and tippers across multiple broadcasts."),aspText:(0,s.AP)("New in v2 Apps: support for permanent storage, high traffic rooms and more to come soon."),newCapitalized:(0,s.AP)("New"),apps:(0,s.AP)("Apps"),games:(0,s.AP)("Games"),dismissMessage:(0,s.AP)("dismiss this message"),hashtagWarning:(0,s.AP)("Only 5 #hashtags will be applied"),dismissLower:(0,s.AP)("dismiss"),registerLaterText:(0,s.AP)("Register later"),alreadyRegisteredText:(0,s.AP)("Already have an account?"),loginHereText:(0,s.AP)("Login here"),signInText:(0,s.AP)("Please sign in using the form below"),usernameText:(0,s.AP)("Username"),passwordText:(0,s.AP)("Password"),captchaText:(0,s.AP)("Prove you are human"),keepLoggedInText:(0,s.AP)("Keep me logged in"),forgotPassword:(0,s.AP)("Forgot password?"),incorrectPassword:(0,s.AP)("Incorrect password"),incorrectCaptcha:(0,s.AP)("Incorrect captcha"),createFreeAccount:(0,s.AP)("Create Free Account"),improvedMobileSite:(0,s.AP)("We've improved Chaturbate's mobile site by adding these feature(s):"),satisfactionVoting:(0,s.AP)("Satisfaction Voting"),orText:(0,s.AP)("Or "),orLower:(0,s.AP)("or"),theMobileSiteText:(0,s.AP)("the mobile site"),followerBrowserNotifications:(0,s.AP)("Follower browser notifications"),allowBrowserNotificationsMessage:(0,s.AP)("Would you like to receive browser notifications when a broadcaster you follow comes online?"),followSubscribeFailedMessage:(0,s.AP)("Subscription failure. Please try again from the Settings & Privacy page on your profile."),yesText:(0,s.AP)("Yes"),notNowText:(0,s.AP)("Not now"),roomRequiresPasswordText:(0,s.AP)("This room requires a password."),loginToRoom:(0,s.AP)("Login to room"),moderators:(0,s.AP)("Moderators"),removeModerators:(0,s.AP)("Remove Moderators"),nonModerators:(0,s.AP)("Non-Moderators"),removeIgnoredUsers:(0,s.AP)("Remove Ignored Users"),unignoreThisUserText:(0,s.AP)("Unignore this user"),unignoredUsers:(0,s.AP)("Unignored Users"),unignore:(0,s.AP)("Unignore"),ignore:(0,s.AP)("Ignore"),ignoreThisUserText:(0,s.AP)("Ignore this user"),reportThisMessageText:(0,s.AP)("Report this message"),ignoredUsers:(0,s.AP)("Ignored Users"),clickToUnignoreText:(0,s.AP)("Click on a user to unignore them."),clickToUnignoreMobileText:(0,s.AP)("Select a user from the list to unignore them."),clickToUnmodText:(0,s.AP)("Click on a user to revoke their moderator status."),clickOkToLogin:(0,s.AP)('Click "OK" to login.'),loginForIgnore:(0,s.AP)("You must be logged in to ignore a user"),reachedMaxIgnore:(0,s.AP)("You have reached the maximum number of ignored users. Ignoring a new user when at the limit will remove your oldest ignore. Click OK to continue"),roomOfflineMessage:(0,s.AP)("Room is currently offline"),instantNotificationMessage:(0,s.AP)("Follow broadcasters to receive instant notifications when they come online."),unfollow:(0,s.AP)("UNFOLLOW"),follow:(0,s.AP)("FOLLOW"),shareText:(0,s.AP)("Share"),bioText:(0,s.AP)("Bio"),contestStatsText:(0,s.AP)("Contest Stats"),settingsAndPrivacy:(0,s.AP)("Settings & Privacy"),settingsSaved:(0,s.AP)("Settings saved"),settingsNotSaved:(0,s.AP)("Please fix the errors to save the unsaved settings."),tokenStats:(0,s.AP)("Token Stats"),broadcasterStats:(0,s.AP)("Broadcaster Stats"),memberships:(0,s.AP)("Memberships"),submitYourFeedbackText:(0,s.AP)("Submit feedback to broadcaster"),optionalCommentNote:(0,s.AP)("Optional comment for broadcaster:"),commentSubmittedMessage:(0,s.AP)("Submitted"),satisfiedTextCAPS:(0,s.AP)("SATISFIED?"),satisfiedText:(0,s.AP)("Satisfied?"),scanCamsText:(0,s.AP)("SCAN CAMS"),nextCamText:(0,s.AP)("NEXT CAM"),scanNextText:(0,s.AP)("SCAN / NEXT"),scanText:(0,s.AP)("SCAN"),skipCamText:(0,s.AP)("SKIP CAM"),exitScanningText:(0,s.AP)("EXIT SCANNING"),tokenLinkCodesText:(0,s.AP)("Token Link codes"),earnTokensForRegisteredUsers:(0,s.AP)("Earn up to 10 tokens for every registered user and 500 tokens for users who broadcast (broadcasters must earn $20.00 before they qualify)."),linkCodeMessage:(0,s.AP)("Please send to chaturbate using one of the link codes below."),embedCBTopCamText:(0,s.AP)("Embed Chaturbate's Top Cam on Your Webpage"),affiliateProgramStatsText:(0,s.AP)("the affiliate program stats"),affiliateStatsDetails:(0,s.AP)("See details about tokens earned in "),silenceText:(0,s.AP)("Silence"),silenceDurationMessage:(0,s.AP)("Silence for 6 hours"),removeSilenceMessage:(0,s.AP)("Remove Silence"),videoQualityLabel:(0,s.AP)("Video Quality"),volumeLabel:(0,s.AP)("Volume"),volumeSliderLabel:(0,s.AP)("Volume Slider"),theaterModeLabel:(0,s.AP)("Theater Mode"),fullScreenLabel:(0,s.AP)("Fullscreen"),interactiveFullscreenLabel:(0,s.AP)("Interactive Fullscreen"),nativeFullscreenLabel:(0,s.AP)("Native Fullscreen"),switchFullscreenModeLabel:(0,s.AP)("Switch Fullscreen Mode"),exitFullScreenLabel:(0,s.AP)("Exit Fullscreen"),exitLabel:(0,s.AP)("Exit"),splitModeLabel:(0,s.AP)("Split Mode"),defaultViewLabel:(0,s.AP)("Default View"),unknownText:(0,s.AP)("unknown"),showAllText:(0,s.AP)("Show All"),anonFollowMore:(0,s.AP)(" to follow your favorite broadcasters and see when they are live."),userFollowMore:(0,s.AP)("Follow your favorite broadcasters to see when they are live."),userPromotionToolbarOpenBodyButton:(0,s.AP)("Promote your room"),userPromotionNotEnoughTokensText:(0,s.AP)("Not enough tokens."),userPromotionPurchaseTokensText:(0,s.AP)("Purchase more tokens"),userPromotionIneligibleText:(0,s.AP)("User promotion currently unavailable."),userPromotionPurchaserIneligibleText:(0,s.AP)("You are ineligible to promote the room."),userPromotionBadSettingsText:(0,s.AP)("User promotion currently unavailable - please check your settings."),userPromotionMustBeLoggedInAlert:(0,s.AP)("You must be logged in to promote the room."),userPromotionMustBeOnlineAlert:(0,s.AP)("User promotion currently unavailable - user must be broadcasting."),userPromotionBodyHeadline:(0,s.AP)("Get More Viewers"),userPromotionBodyDescription:(0,s.AP)("Add your room to a rotating promoted spot on the homepage for 5 minutes."),userPromotionDetails:(0,s.AP)("details"),userPromotionSubmit:(0,s.AP)("Promote now"),userPromotionSubmitInProgress:(0,s.AP)("In Progress"),userPromotionTokensLink:(0,s.AP)("Get more tokens"),userPromotionCurrentPriceLabel:(0,s.AP)("Current price"),userPromotionSettingUp:(0,s.AP)("Setting up user promotion..."),userPromotionEnding:(0,s.AP)("Promotion ending..."),userPromotionPriceUnknownException:(0,s.AP)("Unknown error occurred while retrieving promotion purchase price. Please try again."),userPromotionSubmitUnknownException:(0,s.AP)("Unknown error occurred while purchasing user promotion. Please try again."),userPromotionLoadingNewPriceText:(0,s.AP)("Loading new pricing..."),broadcastNotificationTopBarOpenBodyButton:(0,s.AP)("Announce you're online"),broadcastNotificationTopBarCooldownText:(0,s.AP)("Announce again in "),broadcastNotificationTopBarFollowerTextSingularOld:(0,s.AP)("You have 1 follower"),broadcastNotificationImageContainerHeadline:(0,s.AP)("Send email and browser notifications to your followers."),broadcastNotificationUploadLink:(0,s.AP)("Add a photo"),broadcastNotificationUploadLinkReplace:(0,s.AP)("Update photo"),broadcastNotificationImageHint1:(0,s.AP)("Must be non-nude"),broadcastNotificationImageHint2:(0,s.AP)("Recommended size: 1280 x 720 px"),broadcastNotificationImageHint3:(0,s.AP)("Shown in notification and featured emails"),broadcastNotificationButtonSendNotification:(0,s.AP)("Send notifications"),broadcastNotificationButtonSendNotificationInProgress:(0,s.AP)("In Progress"),broadcastNotificationTooltip:(0,s.AP)("New photos must be approved. If not approved in 15 minutes, email notifications will be sent without a photo."),broadcastNotificationTopBarOpenBodyLinkTooltip:(0,s.AP)("You have no followers to notify."),broadcastNotificationConfirmSendWithoutImage:(0,s.AP)("Are you sure you want to notify your followers without an image?"),broadcastNotificationUseApprovedFormat:(0,s.AP)("Please use a jpeg or png image."),broadcastNotificationImageTooLarge:(0,s.AP)("Image must not be larger than 10 megabytes."),broadcastNotificationAlreadySent:(0,s.AP)("A notification has already been sent."),broadcastNotificationErrorProcessing:(0,s.AP)("Something went wrong processing your image. Please try again."),broadcastNotificationErrorAfterSubmit:(0,s.AP)("Something went wrong after submit. Please try again."),broadcastNotificationErrorDuringSubmit:(0,s.AP)("Something went wrong during submit. Please try again."),broadcastNotificationTooSmallDimensions:(0,s.AP)("Image must be at least 200px wide and 200px tall."),broadcastNotificationTooWide:(0,s.AP)("Image is too wide."),broadcastNotificationTooTall:(0,s.AP)("Image is too tall."),broadcastNotificationRemoveWhileInProgress:(0,s.AP)("Please wait until all pending notifications have been sent."),broadcastNotificationRemoveApprovedPhoto:(0,s.AP)("Remove approved photo?"),broadcastNotificationBadBrowserNotice:(0,s.AP)("Sorry, this feature is not supported in your browser. Please upgrade to a modern browser like Chrome or Firefox."),close:(0,s.AP)("Close"),closeWindow:(0,s.AP)("Close Window"),cancelText:(0,s.AP)("Cancel"),cancelLower:(0,s.AP)("cancel"),cancelCAPS:(0,s.AP)("CANCEL"),submitCAPS:(0,s.AP)("SUBMIT"),submitText:(0,s.AP)("Submit"),leave:(0,s.AP)("Leave"),request:(0,s.AP)("Request"),ending:(0,s.AP)("Ending"),started:(0,s.AP)("Started"),warnOnClosingDirty:(0,s.AP)("You have unsaved changes, are you sure you want to leave this page?"),chooseCategoryText:(0,s.AP)("Choose a category"),reportAbuse:(0,s.AP)("Report Room"),reportAbuseCatUnderage:(0,s.AP)("Broadcaster is underage"),reportAbuseCatAdvertising:(0,s.AP)("Broadcaster is advertising"),reportAbuseCatAbusive:(0,s.AP)("Broadcaster is abusive"),reportAbuseCatIntoxicated:(0,s.AP)("Broadcaster is intoxicated"),reportAbuseCatLarge:(0,s.AP)("Using a toy that is too large"),reportAbuseCatOffline:(0,s.AP)("Asking for offline payments"),reportAbuseCatPublic:(0,s.AP)("Broadcasting in public"),reportAbuseCatUniform:(0,s.AP)("Broadcasting in service uniform"),reportAbuseCatSleeping:(0,s.AP)("Broadcaster is sleeping"),reportAbuseCatGender:(0,s.AP)("Broadcaster is wrong gender"),reportAbuseCatOther:(0,s.AP)("Other"),reportAbuseCategoryRequired:(0,s.AP)("Please choose a category"),reportAbuseAdditionalComments:(0,s.AP)("Additional comments:"),reportAbuseDescriptionRequired:(0,s.AP)("Please add a description"),reportMessageInappropriate:(0,s.AP)("Message is inappropriate"),reportMessageRudeToBcaster:(0,s.AP)("Message is rude towards the broadcaster"),reportMessageRude:(0,s.AP)("Message is rude"),reportMessageSpam:(0,s.AP)("Message is spam"),reportMessageOffensiveMedia:(0,s.AP)("Media is offensive"),reportMessageOther:(0,s.AP)("Other (please describe):"),report:(0,s.AP)("Report"),reportCAPS:(0,s.AP)("REPORT"),unableToReport:(0,s.AP)("Unable to send report."),tooManyReports:(0,s.AP)("Too many reports sent. Try slowing down."),errorRequestingPrivateShow:(0,s.AP)("There was an error requesting your private show. Please try again."),errorRequestingSpyShow:(0,s.AP)("There was an error requesting your spy show. Please try again."),unableToCancelSpyShow:(0,s.AP)("Unable to cancel spy show"),unableToCancelPrivateRequest:(0,s.AP)("Unable to cancel private request"),privateShows:(0,s.AP)("Private Shows"),areYouSure:(0,s.AP)("Are you sure?"),broadcasterAllowsRecordingsText:(0,s.AP)("This broadcaster allows private show recordings, so you will receive a recorded video of this show in your collection."),broadcasterAwayDescription:(0,s.AP)("You may continue chatting while you wait for the broadcaster to return."),performerIsAwayText:(0,s.AP)("Performer Is Away"),privateShowLeaveLabelCAPS:(0,s.AP)("LEAVE PRIVATE SHOW"),privateShowRequestCancelMessageCAPS:(0,s.AP)("CANCEL PRIVATE REQUEST"),privateShowStartLabelCAPS:(0,s.AP)("START PRIVATE SHOW"),privateShowSpyLabelCAPS:(0,s.AP)("SPY PRIVATE SHOW"),privateShowSpyLeaveLabelCaps:(0,s.AP)("LEAVE SPY SHOW"),privateShowText:(0,s.AP)("Private Show"),privateShowsCAPS:(0,s.AP)("PRIVATE SHOWS"),privateShowInProgressText:(0,s.AP)("Private Show in Progress"),featureNotEnabled:(0,s.AP)("This feature is not currently enabled on your device."),loginForPrivateShow:(0,s.AP)('You must be logged in to enter a private show. Click "OK" to login.'),loginForPrivateShowSpy:(0,s.AP)('You must be logged in to spy on a private show. Click "OK" to login.'),privateShowSpyDisabled:(0,s.AP)("Spy has been disabled by the broadcaster."),youWillReceiveRecording:(0,s.AP)("You will receive a recorded video of this show in your collection."),broadcasterDisabledRecordings:(0,s.AP)("This broadcaster has disabled private show recordings."),privatesNotAvailable:(0,s.AP)("Private shows are not available for this broadcaster."),privateShowChatActive:(0,s.AP)("Private Show chat is active."),tapToChatWithBroadcaster:(0,s.AP)("Tap here to chat with the broadcaster."),goToPrivateTabToChat:(0,s.AP)("Go to the Private Tab to chat with the broadcaster."),moreRoomsLikeThisText:(0,s.AP)("More Rooms Like This"),trendingRoomsInstead:(0,s.AP)("Here are some trending rooms instead:"),promotedCAPS:(0,s.AP)("PROMOTED"),recommendedCAPS:(0,s.AP)("RECOMMENDED"),recommendedPopularCAPS:(0,s.AP)("RECOMMENDED POPULAR"),offlineCAPS:(0,s.AP)("OFFLINE"),exhibitionistCAPS:(0,s.AP)("EXHIBITIONIST"),newCAPS:(0,s.AP)("NEW"),hdCAPS:(0,s.AP)("HD"),hdPlusCAPS:(0,s.AP)("HD+"),inPrivateCAPS:(0,s.AP)("IN PRIVATE"),gamingCAPS:(0,s.AP)("GAMING"),chaturbatingCAPS:(0,s.AP)("CHATURBATING"),broadcastingCAPS:(0,s.AP)("BROADCASTING"),hiddenStaffOnlyTextCAPS:(0,s.AP)("HIDDEN - STAFF ONLY"),viewOnTwitterText:(0,s.AP)("View on Twitter"),showTipsAndMessages:(0,s.AP)("Show tips and messages"),viewPhotosVideos:(0,s.AP)("View Pics and Videos"),seeMore:(0,s.AP)("See more"),howCanWeImproveText:(0,s.AP)("How Can We Improve?"),updatesText:(0,s.AP)("Updates"),photoVideoUpdatesText:(0,s.AP)("Pics & Vids"),noPicsVideos:(0,s.AP)("This user has not added any photos or videos yet."),noPics:(0,s.AP)("This user has not added any photos yet."),noVideos:(0,s.AP)("This user has not added any videos yet."),morePics:(0,s.AP)("More Pics"),moreVideos:(0,s.AP)("More Videos"),morePicsVideos:(0,s.AP)("More Pics & Videos"),fanTextCAPS:(0,s.AP)("FAN"),clubTextCAPS:(0,s.AP)("CLUB"),tokensCC:(0,s.AP)("Tokens"),uploadedText:(0,s.AP)("Uploaded"),purchasedPhotoSet:(0,s.AP)("If you already purchased this photo set, try reloading the page to view it."),purchasedVideo:(0,s.AP)("If you already purchased this video, try reloading the page to view it."),orSimple:(0,s.AP)("or"),hiResImage:(0,s.AP)("View Hi-Res Image"),loggedInToPurchasePhoto:(0,s.AP)('You must be logged in to purchase this photo set. Click "OK" to login.'),loggedInToViewHiRes:(0,s.AP)('You must be logged in to view hi-res images. Click "OK" to login.'),loggedInToPurchaseVideo:(0,s.AP)('You must be logged in to purchase this video. Click "OK" to login.'),okToGetTokens:(0,s.AP)('Click "OK" to get more tokens.'),pressPurchaseTokens:(0,s.AP)('Press "Purchase Tokens" to get more.'),uploadMorePhotosText:(0,s.AP)("Upload more Photos"),reOrderItemsText:(0,s.AP)("Re-Order Items"),changeVideoThumbnailText:(0,s.AP)("Change video thumbnail image"),editDetailsText:(0,s.AP)("Edit Details"),complianceText:(0,s.AP)("Compliance"),deactivateText:(0,s.AP)("Deactivate"),staffCAPS:(0,s.AP)("STAFF"),audioDisabledText:(0,s.AP)("Audio is disabled."),audioRemovedText:(0,s.AP)("Audio muted to remove music"),failedCAPS:(0,s.AP)("FAILED"),pendingCAPS:(0,s.AP)("PENDING"),approvalCAPS:(0,s.AP)("APPROVAL"),videoCAPS:(0,s.AP)("VIDEO"),processingCAPS:(0,s.AP)("PROCESSING"),errorCAPS:(0,s.AP)("ERROR"),failedApprovalText:(0,s.AP)("Failed Approval"),removeOffendingItemsText:(0,s.AP)("Please delete or edit offending items."),openInNewWindowText:(0,s.AP)("Open in new window"),ipadFailedToSetup:(0,s.AP)("iPad has failed to setup the broadcast. Please try again."),poorBroadcast:(0,s.AP)("Please check your internet connection or close other applications"),noCameraFound:(0,s.AP)("No camera found."),camAndMicPermissionPrompt:(0,s.AP)('We need permission to use your camera and microphone in order to proceed. When prompted by the browser, please click "Allow."'),camAndMicPermissionPromptFF:(0,s.AP)('We need permission to use your camera and microphone in order to proceed. When prompted by the browser, please check "Remember this decision" and click "Allow."'),camAndMicPermissionDenied:(0,s.AP)("Permissions to use your camera and microphone are currently denied."),needCamAndMicPermission:(0,s.AP)("We need permission to use your camera and microphone in order to proceed."),permanentPermsMessage:(0,s.AP)('We need permanent permission to use your camera and microphone. Remember to check "Remember this decision" when granting permission.'),requestDevicePermissions:(0,s.AP)("Request Device Permissions"),resolutionNotSupported:(0,s.AP)("The resolution is not supported by your device."),minResolutionNotSupported:(0,s.AP)("Your device does not support the minimum resolution."),unknownDeviceError:(0,s.AP)("Your device does not support the minimum resolution."),supportPage:(0,s.AP)("support page"),noOtherTabsOpen:(0,s.AP)("Make sure there are no other broadcast tabs open."),lowFPS:(0,s.AP)("Low FPS"),wantToLeaveConfirmation:(0,s.AP)("Are you sure you want to leave?"),wentToAway:(0,s.AP)('This private show has ended. To give you\ntime to prepare, you are now shown as "Away" to\nthose in your room. To return and be visible on\ncam, click "Exit Away Mode" below.'),exitAwayMode:(0,s.AP)("Exit Away Mode"),couldNotGetDevices:(0,s.AP)("Could not get devices"),turnDevice180:(0,s.AP)("Turn your device 180 degrees."),turnDeviceLandscape:(0,s.AP)("Turn your device into landscape mode."),cameraLabel:(0,s.AP)("Camera"),resolutionLabel:(0,s.AP)("Resolution"),microphoneLabel:(0,s.AP)("Microphone"),inputLevelLabel:(0,s.AP)("Input Level"),muteLabel:(0,s.AP)("Mute"),noMicrophone:(0,s.AP)("None (Silent)"),startBroadcasting:(0,s.AP)("Start Broadcasting"),stopBroadcasting:(0,s.AP)("Stop Broadcasting"),youAreAway:(0,s.AP)("You Are Away"),highQualityStream:(0,s.AP)("For high quality streams we strongly recommend"),useOBS:(0,s.AP)("Use external software (OBS)"),pleaseWaitConnecting:(0,s.AP)("Please wait. Connecting in"),couldNotStartBroadcast:(0,s.AP)("Could not start broadcast"),welcomeBack:(0,s.AP)("Welcome back"),couldNotSetupPreview:(0,s.AP)("Could not setup preview. Please make any possible adjustments and reload the page"),couldNotSetupBroadcast:(0,s.AP)("Could not setup broadcast"),showMyCamPreviewTitle:(0,s.AP)("My Cam Preview"),showMyCamShow:(0,s.AP)("Cam To Cam"),showMyCamStop:(0,s.AP)("Stop Cam To Cam"),showMyCamAlreadyBroadcasting:(0,s.AP)("Unable to share cam: You are already broadcasting from another window or tab"),showMyCamPreviewInfo2:(0,s.AP)("The cam icon will turn orange when the broadcaster is viewing you."),showMyCamBroadcastError:(0,s.AP)("Error sharing cam"),showMyCamBroadcastTimeoutError:(0,s.AP)("Error sharing cam: Timed out trying to connect"),showMyCamCouldNotView:(0,s.AP)("Error viewing cam"),showMyCamMustBeConnected:(0,s.AP)("Unable to share cam: Make sure you are connected to chat and the broadcast is playing"),showMyCamMayNotShareIsPrivate:(0,s.AP)("Unable to share cam: Broadcaster is in a private show"),showMyCamMayNotShare:(0,s.AP)("You are not allowed to share your cam with this user"),showMyCamMayNotShareUpsell:(0,s.AP)("Sharing your cam is only available to users who have purchased tokens. Click OK to purchase tokens now."),showMyCamWillRemovePassword:(0,s.AP)("Sharing your cam will remove your room password"),showMyCamSharingPrefix:(0,s.AP)("Viewer "),showMyCamStartedSharing:(0,s.AP)(" started sharing their cam"),showMyCamStoppedSharing:(0,s.AP)(" stopped sharing their cam"),showMyCamStartedViewing:(0,s.AP)(" started viewing your cam"),showMyCamStoppedViewing:(0,s.AP)(" stopped viewing your cam"),showMyCamIsViewing:(0,s.AP)("is currently viewing your cam"),showMyCamNotViewing:(0,s.AP)("is not currently viewing your cam"),showMyCamMuted:(0,s.AP)("Muted"),showMyCamCloseCam:(0,s.AP)("Close Cam"),showMyCamBlockCam:(0,s.AP)("Block Cam"),showMyCamPopoutCam:(0,s.AP)("Pop Out Cam"),showMyCamReportCam:(0,s.AP)("Report Cam"),showMyCamReportPublic:(0,s.AP)("User is broadcasting in public"),showMyCamReportRude:(0,s.AP)("User is rude/abusive"),showMyCamReportIntoxicated:(0,s.AP)("User is intoxicated"),showMyCamReportSleeping:(0,s.AP)("User is sleeping"),showMyCamReportSpamming:(0,s.AP)("User is spamming"),showMyCamReportUnderage:(0,s.AP)("User is underage"),showMyCamMyCam:(0,s.AP)("My Cam"),showMyCamView:(0,s.AP)("View Cam"),showMyCamStopView:(0,s.AP)("Stop Viewing Cam"),showMyCamTooManyCams:(0,s.AP)("Unable to view cam: A maximum of five cams can be viewed at once"),showMyCamCamOffline:(0,s.AP)("Unable to view cam: This viewer is no longer sharing their cam"),showMyCamNavigationPrompt:(0,s.AP)("Leaving this page will end your cam. Click OK to proceed."),showMyCamConnectionClosed:(0,s.AP)("(connection closed)"),broadcaster:(0,s.AP)("Broadcaster"),moderator:(0,s.AP)("Moderator"),fanclubMember:(0,s.AP)("Fan club member"),user:(0,s.AP)("User"),roomJoinedMessage:(0,s.AP)("has joined the room"),roomLeftMessage:(0,s.AP)("has left the room."),roomFollowToGetNotified:(0,s.AP)("Follow to be notified when online."),feedbackCommentsLabel:(0,s.AP)("Describe your issue or share your ideas:"),feedbackNotice:(0,s.AP)("Some account and system information may be sent to %SITE_NAME%. We will use the information you give us to help address technical issues to improve our services, subject to our Privacy Policy and Terms of Service."),feedbackSubmit:(0,s.AP)("Send feedback"),feedbackAddScreenshot:(0,s.AP)("Add screenshot"),feedbackAddScreenshotInfoScrollDown:(0,s.AP)("Scroll down to capture lower on the page"),feedbackAddScreenshotInfoScrollUp:(0,s.AP)("Scroll up to capture higher on the page"),feedbackCanvasToggle:(0,s.AP)("Click to highlight or hide info"),feedbackHighlightInfo:(0,s.AP)("Highlight issues with orange or hide sensitive info with black. Hit the ESC key to finish."),feedbackHighlightControl:(0,s.AP)("Highlight issue"),feedbackHideControl:(0,s.AP)("Hide sensitive info"),feedbackPermissionDenied:(0,s.AP)("Permission to capture screen not granted"),feedbackUnknownCaptureError:(0,s.AP)("Could not capture screen"),feedbackResize:(0,s.AP)("Please take screenshot again after resizing"),feedbackSubmitted:(0,s.AP)("Your feedback has been sent! Thank you for your feedback."),feedbackUnknownError:(0,s.AP)("Something went wrong. Please try again later."),feedbackRateLimitError:(0,s.AP)("Please wait before submitting more feedback."),feedbackBannedUser:(0,s.AP)("Unable to submit feedback. Please contact support."),doneText:(0,s.AP)("Done"),watchingText:(0,s.AP)("Watching"),denyPrivate:(0,s.AP)("Deny Private"),acceptPrivate:(0,s.AP)("Accept Private"),returnToChat:(0,s.AP)("Return to Chat"),returnToPublicChat:(0,s.AP)("Return to Public Chat"),privateShowEnded:(0,s.AP)("Your private show has ended."),cameraRemainHidden:(0,s.AP)("Your camera will remain hidden until you re-enter public chat."),aboutToStopPrivateShow:(0,s.AP)("You're about to stop the private show. Do you want to continue?"),errorBroadcasting:(0,s.AP)("Error broadcasting"),fontSettings:(0,s.AP)("Font Settings"),emoticonsSettings:(0,s.AP)("Emoticons Settings"),usersSettings:(0,s.AP)("Users Settings"),notificationsSettings:(0,s.AP)("Notifications Settings"),otherSettings:(0,s.AP)("Other Settings"),noOneIgnored:(0,s.AP)("You have no users ignored."),backToSettings:(0,s.AP)("Back to Settings"),backToChatSettings:(0,s.AP)("Back to Chat Settings"),notifyEntryFor:(0,s.AP)("Notify on Entry For"),notifyLeaveFor:(0,s.AP)("Notify on Leave For"),noNewUpdates:(0,s.AP)("No new updates"),videoBeingProcessed:(0,s.AP)("The video is currently being processed. It may take several minutes depending on the size of the video."),videoProcessingError:(0,s.AP)("The video is damaged or its format is not supported."),videoReupload:(0,s.AP)("Please delete this video and reupload again."),mustBeSupporterFeature:(0,s.AP)("You must be a supporter to use this feature."),loginToFollow:(0,s.AP)('You must be logged in to Follow. Click "OK" to login.'),loginToUseFeature:(0,s.AP)("Log in or sign up to use this feature"),loginToTip:(0,s.AP)('You must be logged in to send a tip. Click "OK" to login.'),loginToContinue:(0,s.AP)("Log in to continue"),dontHaveAccount:(0,s.AP)("Don't have an account?"),dontHaveAccountYet:(0,s.AP)("Don't have an account yet?"),tippedTonsRecently:(0,s.AP)("Tipped Tons"),tippedTonsRecentlyDef:(0,s.AP)("1000+ tokens in the past 2 weeks"),tippedALotRecently:(0,s.AP)("Tipped Lots"),tippedALotRecentlyDef:(0,s.AP)("250+ tokens in the past 2 weeks"),tippedRecently:(0,s.AP)("Tipped Recently"),tippedRecentlyDef:(0,s.AP)("50+ tokens in the past 2 weeks"),tippingLabel:(0,s.AP)("Tipping"),hasTokens:(0,s.AP)("Purchased Tokens"),hasTokensDef:(0,s.AP)("Has bought tokens"),inFanClub:(0,s.AP)("Fan Club Member"),isMod:(0,s.AP)("Moderator"),isBroadcaster:(0,s.AP)("Broadcaster"),upgradeToSupporterLabel:(0,s.AP)("Upgrade to Supporter"),outboundTip:(0,s.AP)("Outbound Tip"),promotedRoom:(0,s.AP)("Promoted room"),tipFrom:(0,s.AP)("Tip From"),transferTokensToCash:(0,s.AP)("Transfer tokens to cash"),transferTokensToAdvertising:(0,s.AP)("Transfer tokens to advertising credit"),referredMember:(0,s.AP)("Referred Member"),email:(0,s.AP)("email"),emailLabel:(0,s.AP)("Email"),spyNow:(0,s.AP)("Spy Now"),spyShowCost:(0,s.AP)("Spy Show cost"),spyingNow:(0,s.AP)("Spying now"),fanClubMembership:(0,s.AP)("Fan Club Membership"),broadcasterWelcomeWarning:(0,s.AP)("Broadcaster Rules: Tokens are the only form of payment allowed. You may promote your personal website as long as it does not offer video chat. Do not ask users to chat with you elsewhere."),viewerWelcomeWarning:(0,s.AP)("Rules: No spamming. Do not insist the cam hosts to do as you please. Do not announce other rooms or websites that would conflict with this room. Avoid any argumentative and/or rude posts related to the cam viewing. Do not attempt to post your e-mail address in the public chat."),useExternalEncoder:(0,s.AP)("Use External Encoder to Broadcast"),broadcastWithOBS:(0,s.AP)("Broadcast yourself using Open Broadcaster Software (OBS)"),accept:(0,s.AP)("Accept"),decline:(0,s.AP)("Decline"),userTokenRate:(0,s.AP)("User(s) Token Rate"),privateShowStats:(0,s.AP)("Private Show Stats"),exitPrivateShow:(0,s.AP)("Exit Private Show"),useAppsAndBots:(0,s.AP)("Enhance your room with Apps & Bots in the tab below."),disabled:(0,s.AP)("Disabled"),allowed:(0,s.AP)("Allowed"),privates:(0,s.AP)("Privates"),broadcastGuideTitle:(0,s.AP)("Broadcaster's Guide"),myBroadcast:(0,s.AP)("My Broadcast"),passwordProtectedWarning:(0,s.AP)("Your room is password protected. Users may not enter your room unless they know your password. To remove your password, edit your settings & privacy."),kickBan:(0,s.AP)("Kick/Ban"),removeModeratorStatus:(0,s.AP)("Remove Moderator Status"),promoteToModerator:(0,s.AP)("Promote to Moderator"),removeModeratorLoginError:(0,s.AP)('You must be logged in to remove a moderator. Click "OK" to login.'),promoteModeratorLoginError:(0,s.AP)('You must be logged in to promote a user to moderator. Click "OK" to login.'),obsShareWarning:(0,s.AP)("WARNING: Never show or share your broadcast token with anyone!"),yourBroadcastToken:(0,s.AP)("Your broadcast token"),broadcastingInformation:(0,s.AP)("RTMP/OBS Broadcasting Information"),clickToViewOBSSetupGuide:(0,s.AP)("Click here to view our OBS Setup Guide"),importantInformation:(0,s.AP)("Important Information"),doNotUpscale:(0,s.AP)("Do not upscale your source input (e.g. using a 1080p camera to a 1440p stream)."),ensureMinimumBitrate:(0,s.AP)("Ensure you use the minimum video bitrate specified in this table for a given resolution"),copyrightContentWarning:(0,s.AP)("You may only have copyrighted content -- including music, movies, and video games -- in your stream if you are the rights holder or have the permission of all rights holders."),recommendedSettingsTable:(0,s.AP)("Recommended Settings Table"),generateNewOBSTokenConfirm:(0,s.AP)("Generate a new broadcast token? \n(This will invalidate your prior RTMP / OBS token and disconnect your current broadcast)"),thisIsSatisfactionScore:(0,s.AP)('This is your satisfaction score. You can hide this by setting "Show my satisfaction score" to "No" in the Settings & Privacy tab.'),dataUpdatedOncePerDay:(0,s.AP)("This data is updated once per day and is based on votes in the past 90 days."),clickScoreToSeeHistory:(0,s.AP)("Click on your score (%) to view your rating history."),fetchingHistory:(0,s.AP)("Fetching rating history"),noHistoryToShow:(0,s.AP)("No history to show"),activeApp:(0,s.AP)("Active App"),activeGame:(0,s.AP)("Active Game"),bot1:(0,s.AP)("Bot #1"),bot2:(0,s.AP)("Bot #2"),bot3:(0,s.AP)("Bot #3"),bot4:(0,s.AP)("Bot #4"),bot5:(0,s.AP)("Bot #5"),noneSelected:(0,s.AP)("None Selected"),chooseAnApp:(0,s.AP)("Choose an App"),chooseABot:(0,s.AP)("Choose a Bot"),chooseAGame:(0,s.AP)("Choose a Game"),endGame:(0,s.AP)("End Game"),stopStreamingGame:(0,s.AP)("Stop streaming game"),areYouAPublisher:(0,s.AP)("Are you a publisher?"),addYourGameLink:(0,s.AP)("Add your game."),restart:(0,s.AP)("Restart"),addNewSocialMedia:(0,s.AP)("Add new social media"),uploadNewPics:(0,s.AP)("Upload new pics"),uploadNewVideos:(0,s.AP)("Upload new videos"),editYourBio:(0,s.AP)("Edit Your Bio"),currentContestStatistics:(0,s.AP)("Current Contest Statistics for"),payoutInformation:(0,s.AP)("Payout Information"),refreshStats:(0,s.AP)("Refresh Stats"),seeContestDetails:(0,s.AP)("See contest details"),managePhotoSet:(0,s.AP)("Manage photo sets"),updateBio:(0,s.AP)("Update Bio"),january:(0,s.AP)("January"),february:(0,s.AP)("February"),march:(0,s.AP)("March"),april:(0,s.AP)("April"),may:(0,s.AP)("May"),june:(0,s.AP)("June"),july:(0,s.AP)("July"),august:(0,s.AP)("August"),september:(0,s.AP)("September"),october:(0,s.AP)("October"),november:(0,s.AP)("November"),december:(0,s.AP)("December"),expiredFanClubMemberships:(0,s.AP)("Expired Fan Club Memberships"),expiredSocialMediaSubscriptions:(0,s.AP)("Expired Social Media Subscriptions"),noActiveMemberships:(0,s.AP)("You Have No Active Memberships"),expires:(0,s.AP)("Expires"),expired:(0,s.AP)("Expired"),extendThreeMonths:(0,s.AP)("Extend by 3 months"),renews:(0,s.AP)("Renews"),renew:(0,s.AP)("renew"),cantRenew:(0,s.AP)("can't renew"),cantExtend:(0,s.AP)("can't extend"),noEmailOnFile:(0,s.AP)("No email address on file"),blockedCountries:(0,s.AP)("Blocked countries"),ableToView:(0,s.AP)("Able to view"),blockedRegions:(0,s.AP)("Blocked regions"),security:(0,s.AP)("Security"),statistics:(0,s.AP)("Statistics"),updateSettings:(0,s.AP)("Update Settings"),updateYourPassword:(0,s.AP)("Update your password"),viewSecurityCenter:(0,s.AP)("View the security center and adjust Two-Step Verification settings"),authorizeThirdPartyStats:(0,s.AP)("Authorize your 3rd party stats"),addEmailAddress:(0,s.AP)("Add an email address"),changeEmailAddress:(0,s.AP)("Change email address"),emailVerified:(0,s.AP)("E-mail Verified"),resendVerificationEmail:(0,s.AP)("Resend verification email"),verificationEmailSent:(0,s.AP)("Verification Email Sent"),emailIsUnverifiedForNotificationsAndNewsletter:(0,s.AP)("Email is Unverified. Verify to receive follower notifications and newsletters."),detailedIncomeStats:(0,s.AP)("Detailed Income Stats"),paymentInformationForm:(0,s.AP)("Payment Information Form"),requiredForPayments:(0,s.AP)("required for payments"),broadcasterVerificationForm:(0,s.AP)("Broadcaster Verification Form"),downloadTransactionHistory:(0,s.AP)("Download Transaction History"),pleaseWaitForFileToGenerate:(0,s.AP)("Please wait for the file to be generated"),download30Days:(0,s.AP)("Download your last 30 days of transactions?\nProcessing may take up to 20 seconds."),yourAccountsActivity:(0,s.AP)("Your Account's Activity"),latestCashOuts:(0,s.AP)("Latest cashouts"),tokensAutoCashedAtMidnight:(0,s.AP)("tokens are automatically cashed out at midnight"),verifyToEnableTokens:(0,s.AP)("Please verify your identity to enable tokens on your account"),transferTokens:(0,s.AP)("Transfer Tokens"),transferTokensDateInfo:(0,s.AP)("Tokens transferred on the 1st-15th of the month will be sent by the 22nd. Tokens transferred on the 16th-31st will be sent by the 7th."),silencedTableTitle:(0,s.AP)("Silenced Users"),silencedUsersInfo:(0,s.AP)("Listed are users currently silenced from your room. Silences expire after 6 hours by default. You can convert a silence to a ban."),bannedTableTitle:(0,s.AP)("Banned Users"),bannedUsersInfo:(0,s.AP)("Listed are users currently banned from your room. Bans expire after 1 month by default. You can convert a ban to a permanent ban."),usernameToBan:(0,s.AP)("Please enter a username to ban"),cannotBanSelf:(0,s.AP)("You cannot ban yourself"),errorOccurred:(0,s.AP)("An error occurred, please try again"),banned:(0,s.AP)("Banned"),silenced:(0,s.AP)("Silenced"),actions:(0,s.AP)("Actions"),remove:(0,s.AP)("Remove"),makePermanent:(0,s.AP)("Make Permanent"),convertToBan:(0,s.AP)("Convert to Ban"),clickToClearHiddenBansAndSilences:(0,s.AP)("Click here to clear hidden silences and bans"),addBan:(0,s.AP)("Add ban"),enterUsernameToBan:(0,s.AP)("Enter user to ban"),viewEditBansAndSilences:(0,s.AP)("View/Edit Bans and Silences"),viewEditModerators:(0,s.AP)("View/Edit Moderators"),viewFanClubMembers:(0,s.AP)("View Fan Club Members"),viewEditRegionBlockExemptions:(0,s.AP)("View/Edit Region Block Exemptions"),viewEditBannedTerms:(0,s.AP)("View/Edit Banned Terms"),alphabetically:(0,s.AP)("Alphabetically"),allUsers:(0,s.AP)("All Users"),usersWhoTippedToday:(0,s.AP)("Users who tipped me today"),usersWhoHaveTipped:(0,s.AP)("Users who have tipped me"),usersWhoHaveTokens:(0,s.AP)("Users who have tokens"),oneDay:(0,s.AP)("1 Day"),twoDays:(0,s.AP)("2 Days"),oneWeek:(0,s.AP)("1 Week"),twoWeeks:(0,s.AP)("2 Weeks"),oneMonth:(0,s.AP)("1 Month"),twoMonths:(0,s.AP)("2 Months"),sixMonths:(0,s.AP)("6 Months"),no:(0,s.AP)("No"),yes:(0,s.AP)("Yes"),yesIfBroadcasting:(0,s.AP)("Yes, only if they're broadcasting now"),ageVerificationRequired:(0,s.AP)("Age Verification Required"),onlyAgeVerifiedCanChangeSetting:(0,s.AP)("Only age verified broadcasters can change this setting"),currentFanClubMembersInfo:(0,s.AP)("Listed are your current fan club members, the date they last joined, and the total number of months they've been your fan (Expiring memberships have a short grace period to renew before removed from your fanclub.)"),allFanClubMembersInfo:(0,s.AP)("Listed are all of your fan club members past and present and how long they were a member for. Current members are highlighted."),addUsername:(0,s.AP)("Add user"),add:(0,s.AP)("Add"),regionBlockExemptions:(0,s.AP)("Region Block Exemptions"),regionBlockExemptionsInfo:(0,s.AP)("Users on this list will be exempt from region blocks"),enterUsernameToExemptRegionBlock:(0,s.AP)("Enter user to exempt"),uniqueRegisteredViewers:(0,s.AP)("Unique Registered Viewers"),yourPoints:(0,s.AP)("Your Points"),yourRank:(0,s.AP)("Your Rank"),aboutMeHelpText:(0,s.AP)("You may use some HTML tags (a p i strong b u ul ol li h1 h2 h3 img font br span)."),wishListHelpText:(0,s.AP)("You may post links to external wish lists (amazon wish list, for example) and use some HTML tags (a p i strong b u ul ol li h1 h2 h3 img font br)."),displayName:(0,s.AP)("Display Name"),displayBirthday:(0,s.AP)("Display Birthday"),interestedIn:(0,s.AP)("Interested in"),spokenLanguages:(0,s.AP)("Spoken languages"),wishLists:(0,s.AP)("Wish Lists"),joinFanClub:(0,s.AP)("Join Fan Club"),member:(0,s.AP)("Member"),fanClubMember:(0,s.AP)("Fan Club Member"),lastJoined:(0,s.AP)("Last Joined"),totalMonthsAMember:(0,s.AP)("Total Months a Member"),improveVideoQuality:(0,s.AP)("Improve Video Quality"),darkMode:(0,s.AP)("Dark Mode"),searchBarPlaceholder:(0,s.AP)("Search #tags or broadcasters"),broadcastingNow:(0,s.AP)("Broadcasting right now"),recentlyOnline:(0,s.AP)("Recently online"),previouslySearched:(0,s.AP)("Previously searched"),tapToUnmute:(0,s.AP)("TAP TO UNMUTE"),yesCancelSupporter:(0,s.AP)("Yes, cancel the membership"),noKeepSupporter:(0,s.AP)("No, keep the features"),cancellationSuccessful:(0,s.AP)("Cancellation Successful"),sendAndClose:(0,s.AP)("Send and close"),supporterPlan:(0,s.AP)("Supporter Plan"),renewSubscription:(0,s.AP)("Renew subscription"),whyDidYouCancel:(0,s.AP)("Why did you decide to cancel your membership plan? (Optional)"),wouldYouCancel:(0,s.AP)("Would you like to cancel your supporter membership and lose all your supporter features?"),renewNotice:(0,s.AP)("You are about to renew your subscription."),cancelFailed:(0,s.AP)("Cancellation Failed"),confirmOK:(0,s.AP)("OK"),pleaseRefreshRetry:(0,s.AP)("Error, please try and refresh your window."),homepageInBioViolation:(0,s.AP)("Please note that the 'Room subject' of your broadcast and the 'Location' field of your bio may not be used for promotion of social media or other websites. Thank you for your understanding."),noteText:(0,s.AP)("Note"),loadingPlaceholderText:(0,s.AP)("Loading..."),writeNotePlaceholderText:(0,s.AP)("Enter notes about this user (only seen by you)"),unsavedText:(0,s.AP)("(unsaved)"),back:(0,s.AP)("Back"),loadingMoreMessages:(0,s.AP)("Loading More Messages"),sendPrivateMessage:(0,s.AP)("Send a private message"),sendDirectMessage:(0,s.AP)("Send a direct message"),sendDirectMessageNew:(0,s.AP)("Send a direct message"),searchUsers:(0,s.AP)("Search users"),unopenedCAPS:(0,s.AP)("UNOPENED"),now:(0,s.AP)("now"),leavePrivateShowWarningText:(0,s.AP)("To avoid ending the private show, a new tab will open. Click OK to continue."),acceptRules:(0,s.AP)("Accept Rules"),chatCapitalized:(0,s.AP)("Chat"),unmuteCapitalized:(0,s.AP)("Unmute"),directMessageLabel:(0,s.AP)("Direct Messages"),fanclubCancelErrorMessage:(0,s.AP)("There was an error cancelling your Fan Club."),supporterCancelConfirmMessage:(0,s.AP)("Are you sure you wish to remove your supporter status? You will remain a supporter until your currently paid month expires."),supporterCancelErrorMessage:(0,s.AP)("There was an error cancelling your supporter membership."),eventsApiSettingsHeader:(0,s.AP)("Events API"),banRemovedMessage:(0,s.AP)("Ban removed"),silenceRemovedMessage:(0,s.AP)("Silence removed"),banRemoveErrorMessage:(0,s.AP)("Error removing ban, please try again"),banConvertErrorMessage:(0,s.AP)("Error converting to ban, please try again"),silenceRemoveErrorMessage:(0,s.AP)("Error removing silence –– it may have already been removed"),inlineUndoText:(0,s.AP)("Undo"),inlineBanText:(0,s.AP)("Ban"),showMyCamTip:(0,s.AP)("Cam To Cam is the best way to share your cam with broadcasters you are watching."),transViewers:(0,s.AP)("trans viewers"),and:(0,s.AP)("and"),howIsChaturbateDoingToday:(0,s.AP)("How is Chaturbate doing today?"),howIsSmcDoingToday:(0,s.AP)("How is Cam To Cam doing today?"),yourFeedbackHasBeenSent:(0,s.AP)("Your feedback has been sent!"),describeYourIssues:(0,s.AP)("Describe your issues or share your ideas."),unfollowInfo:(0,s.AP)("You will no longer receive notifications or see them in your following tab."),runningApps:(0,s.AP)("Running Apps"),allApps:(0,s.AP)("All Apps"),aspDescription:(0,s.AP)("Customize your chat room experience with Apps"),createAppsText:(0,s.AP)("Create your own app"),legacyAppsText:(0,s.AP)("Switch back to legacy apps"),confirmRemoveApp:(0,s.AP)("Do you want to remove this app?"),orderBy:(0,s.AP)("Order By:"),searchForApps:(0,s.AP)("Search for Apps"),search:(0,s.AP)("Search"),appsLoadingError:(0,s.AP)("Failed to load Apps"),appsLoadingErrorV2:(0,s.AP)("Failed to load v2 Apps"),topEarning:(0,s.AP)("Top Earning"),featuredApps:(0,s.AP)("Featured Apps"),recentlyUpdated:(0,s.AP)("Recently Updated"),recentlyUsed:(0,s.AP)("Recently Used"),version:(0,s.AP)("version"),installed:(0,s.AP)("Installed"),videoPanelLabel:(0,s.AP)("Broadcast panel"),updateAvailable:(0,s.AP)("Update available"),uninstall:(0,s.AP)("Uninstall"),transformMessagesLabel:(0,s.AP)("Transform messages"),restartApp:(0,s.AP)("Restart app"),tipOptionsLabel:(0,s.AP)("Tip options"),exclusiveAppPermissionText:(0,s.AP)("Only one app can have this permission."),addApp:(0,s.AP)("Add app"),upgradeAndApply:(0,s.AP)("Upgrade & Apply"),upgradeAndRestart:(0,s.AP)("Upgrade & Restart"),apply:(0,s.AP)("Apply"),applyLower:(0,s.AP)("apply"),running:(0,s.AP)("Running"),stopped:(0,s.AP)("Stopped"),crashed:(0,s.AP)("Crashed"),stop:(0,s.AP)("Stop"),upgrade:(0,s.AP)("Upgrade"),settings:(0,s.AP)("Settings"),sourceCode:(0,s.AP)("Source code"),noDescription:(0,s.AP)("No Description"),noAppSettingsText:(0,s.AP)("This app does not have any settings."),fieldRequiredText:(0,s.AP)("This field is required"),stringMinError:(0,s.AP)("This field is too short"),stringMaxError:(0,s.AP)("This field is too long"),invalidInputText:(0,s.AP)("Invalid input"),selectAnOption:(0,s.AP)("Select an option"),permissions:(0,s.AP)("Permissions"),allPermissionsText:(0,s.AP)("All permissions granted"),noPermissionsText:(0,s.AP)("No permissions granted"),somePermissionsText:(0,s.AP)("Some permissions granted"),permissionModalText:(0,s.AP)("The app you are adding is requesting the following permissions."),activeAppOverrideText:(0,s.AP)('⚠️ App running in "Active App" is overriding this permission.'),aspPermissionOverrideText:(0,s.AP)('⚠️ Apps running in "Active App" slot can override this permission.'),appLimitError:(0,s.AP)("You have reached the maximum number of apps."),appNotAgeVerified:(0,s.AP)("Only age verified broadcasters may install apps."),becomeAgeVerified:(0,s.AP)("Verify Age"),appNotAvailable:(0,s.AP)("App is not available."),refresh:(0,s.AP)("Refresh"),userAddedToExemptList:(0,s.AP)("User has been added to your exemption list."),userRemovedFromExemptList:(0,s.AP)("User has been removed from your exemption list."),anErrorOccurred:(0,s.AP)("An error occurred."),confirmPhotoDelete:(0,s.AP)("Do you really want to delete this image? This cannot be undone."),errorDeletingMedia:(0,s.AP)("There was an error deleting your media."),errorUploadingMedia:(0,s.AP)("There was an error uploading your media."),invalidFileErrorUploadingMedia:(0,s.AP)("This file type is not supported or the file is corrupted."),fileSizeErrorUploadingMedia:(0,s.AP)("This file is too large. Images must be at most 50MB"),errorLoadingMedia:(0,s.AP)("Could not load media. It may have been deleted."),switchToOBS:(0,s.AP)("Switch to OBS to stream games"),selectGameHeaderText:(0,s.AP)("Select your game from the list of approved games below."),installGameHeaderText:(0,s.AP)("Install and start the game"),installGameSectionText:(0,s.AP)("Download and and run the game."),downloadOBSHeaderText:(0,s.AP)("Download OBS and set it up"),authorizeGameHeaderText:(0,s.AP)("Authorize this game"),privateShowC2cTip:(0,s.AP)("Pro tip: Viewers who use Cam To Cam tip 50% more on average than viewers who don't. Encouraging your viewers to share their cam can build a more intimate connection and potentially earn you more tokens!"),notifyWhenBroadcastersOnlineMessage:(0,s.AP)("Notify me when broadcasters I follow come online with"),popularCAPS:(0,s.AP)("POPULAR"),browserNotificationLabel:(0,s.AP)("Browser notification"),browserNotificationEnabled:(0,s.AP)("Browser notification enabled"),saveNotificationSettings:(0,s.AP)("Save notification settings"),emailAddressText:(0,s.AP)("Email address"),preferencesSavedText:(0,s.AP)("Your preferences have been saved."),checkYourEmailToVerifyText:(0,s.AP)("Check your email inbox to verify your email!"),emailSavedAndVerifyText:(0,s.AP)('Your email address has been updated on your account. Check your email inbox to verify your email!'),emailSendErrorMessage:(0,s.AP)("Error sending verification email, please try again."),emailSubmitErrorMessage:(0,s.AP)("Error submitting email, please try again."),browserSubmitErrorMessage:(0,s.AP)("Error saving browser notification."),browserSubmitErrorMessagePt2:(0,s.AP)("Please try again from the Settings & Privacy page on your profile."),errorSendingMessage:(0,s.AP)("Unable to send message"),buyMoreTokens:(0,s.AP)("Buy more tokens"),removedForViolation:(0,s.AP)("Image removed for violating site rules"),imageAttached:(0,s.AP)("Image attached"),howPerfectScore:(0,s.AP)("If you didn't give a perfect rating, what can we do to earn one?"),subgenderSelectionConfirm:(0,s.AP)("Submit and Start Broadcasting"),subgenderSelectionHeader:(0,s.AP)("We launched new gender categories in order to allow the Chaturbate community to better identify their gender identity."),subgenderSelectionPrompt:(0,s.AP)("Please choose an option below, selecting which one expresses you best:"),broadcastSubgenderViolation:(0,s.AP)("A subgender is required before streaming. Please specify a subgender in your bio or profile."),biographyMale:(0,s.AP)("A Man"),biographyFemale:(0,s.AP)("A Woman"),biographyCouple:(0,s.AP)("A Couple"),subgenderFemme:(0,s.AP)("Trans Femme"),subgenderMasc:(0,s.AP)("Trans Masc"),subgenderNonbinary:(0,s.AP)("Non-Binary"),whatImprovementsNext:(0,s.AP)("What improvements would you be most excited to see implemented next?"),haveYouNoticedAnyBugs:(0,s.AP)("Did you notice any bugs today? Please describe them in as much detail as possible."),whatPainPoints:(0,s.AP)("What were the biggest pain points you experienced today?"),offline:(0,s.AP)("Offline"),live:(0,s.AP)("Live"),yourStreamIsCurrently:(0,s.AP)("Your stream is currently "),obsAwayMessage:(0,s.AP)('This private show has ended. To give you time to prepare, you are now shown as "Away" to those in your room. To return and be visible on cam, click "Exit Away Mode" below.'),streamRejected:(0,s.AP)("Stream Rejected"),waitingforStreamStats:(0,s.AP)("Waiting for stream stats"),streamStatusUnknown:(0,s.AP)("Stream Status Unknown"),streamTime:(0,s.AP)("Stream time"),codec:(0,s.AP)("Codec"),frameRate:(0,s.AP)("Frame Rate: "),bitrate:(0,s.AP)("Bitrate: "),alsoSupportOtherEncoders:(0,s.AP)("We also support other encoders such as XSplit, Wirecast, etc."),obsDescription:(0,s.AP)(" (OBS) is an open source streaming software which provides broadcasters control to configure stream settings and customizable plugins so they can enhance their stream."),tryAddingHashtags:(0,s.AP)("Try adding #hashtags to your room subject to attract more viewers."),viewRTMPInfo:(0,s.AP)("View RTMP/OBS broadcast information and stream key"),waitingForStream:(0,s.AP)("Waiting for stream to start"),startInBrowserBroadcaster:(0,s.AP)("Start the in-Browser Broadcaster"),outdatedBrowser:(0,s.AP)("Your browser is outdated and cannot use in browser broadcast. Please update to use the latest Chaturbate features. We recommend Chrome, Firefox, or Edge."),ctrlLToClose:(0,s.AP)("(Ctrl+L to close)"),welcomeMessage:(0,s.AP)("To go to next room, press Ctrl+/. To send a tip, press Ctrl+S or type \"/tip 25\". To disable emoticons or adjust autocomplete settings, click the 'Gear' tab above."),mobileWelcomeMessage:(0,s.AP)('To send a tip, click SEND TIP or type "/tip 25".'),backToRoomMenu:(0,s.AP)("Back to Room Menu"),bannedTerms:(0,s.AP)("Banned Terms"),bannedTermsInfo:(0,s.AP)("Viewers will not be able to send messages containing these terms. All characters are allowed, including spaces."),addTerm:(0,s.AP)("Add term"),term:(0,s.AP)("Term"),banAsSubstring:(0,s.AP)("Ban as Substring"),banAsSubstringExplanation:(0,s.AP)('Ban the term if it appears anywhere in a message, even as part of other words. For example, if the term is "hello" then this will also ban "xhellox". Otherwise, if disabled, only messages like "x hello x" will be banned.'),enterTermToBan:(0,s.AP)("Enter term to ban"),pleaseEnterTermToBan:(0,s.AP)("Please enter a term to ban"),errorBanningTerm:(0,s.AP)("There was an error banning this term. Please try again later"),errorUpdatingTerm:(0,s.AP)("There was an error updating this term. Please try again later"),errorRemovingTerm:(0,s.AP)("There was an error removing this term. Please try again later"),followsYou:(0,s.AP)("Follows you"),sharingCam:(0,s.AP)("Sharing their cam"),notes:(0,s.AP)("Notes"),broadcastDate:(0,s.AP)("Broadcast Date"),broadcastWeekday:(0,s.AP)("Broadcast Weekday"),broadcastLength:(0,s.AP)("Broadcast Length"),maxViewers:(0,s.AP)("Max Viewers"),tokensTotal:(0,s.AP)("Tokens Total"),avgTokensPerMin:(0,s.AP)("Average Tokens Per Minute"),avgTokensPerUser:(0,s.AP)("Average Tokens Per User"),chatMessagesTotal:(0,s.AP)("Chat Messages Total"),avgMessagesPerUser:(0,s.AP)("Average Messages Per User"),featuredCAPS:(0,s.AP)("FEATURED"),allGendersCAPS:(0,s.AP)("ALL GENDERS"),notShowingFromRegions:(0,s.AP)("Not showing broadcasters from"),noRoomsAvailableFiltered:(0,s.AP)("No rooms match your preferences, please update your search/filter options."),dragToResize:(0,s.AP)("Drag to resize"),userInRoom:(0,s.AP)("User is in the room"),userNotInRoom:(0,s.AP)("User has left the room"),userNotInPrivate:(0,s.AP)("User is not in the private show"),dmCloseTab:(0,s.AP)("Close tab"),dmCloseTabShortcut:(0,s.AP)("Ctrl+L to close window"),reportThisUserText:(0,s.AP)("Report this user"),inappropriateMessage:(0,s.AP)("Inappropriate message"),rudeMessage:(0,s.AP)("Rude message"),spamMessage:(0,s.AP)("Spam message"),getMoreLabel:(0,s.AP)("Get More"),invalidAmount:(0,s.AP)("Invalid amount"),hashtag:(0,s.AP)("Hashtag"),viewers:(0,s.AP)("Viewers"),rooms:(0,s.AP)("Rooms"),broadcastYourselfCapitalized:(0,s.AP)("Broadcast Yourself"),supporterCAPS:(0,s.AP)("SUPPORTER"),incorrectOrientation:(0,s.AP)("Your stream may appear upside down or sideways to viewers. Turn your device."),incorrectPortrait:(0,s.AP)("Your broadcast may appear upside down or sideways to viewers. Turn your device into landscape mode."),incorrectLandscape:(0,s.AP)("Your broadcast may appear upside down to viewers. Turn your device 180 degrees."),missingFullscreen:(0,s.AP)("Fullscreen is required for broadcasting. "),fullscreenStop:(0,s.AP)("Screen is no longer fullscreen so stream has been stopped."),androidBroadcast:(0,s.AP)("Starting a broadcast will enter fullscreen."),mobileBroadcastError:(0,s.AP)("Must be in proper landscape to broadcast, rotate 90 or 180 degrees and try again"),allTagsCAPS:(0,s.AP)("ALL TAGS"),dismissCapitalized:(0,s.AP)("Dismiss"),becomeSupporter:(0,s.AP)("Become a supporter"),joinCB:(0,s.AP)("Join Chaturbate"),popoutInNewWindow:(0,s.AP)("Popout in new window"),connecting:(0,s.AP)("Connecting"),waitingToConnect:(0,s.AP)("Waiting to connect"),connectingToBroadcastMessage:(0,s.AP)("Please wait while we connect you to this webcam broadcast."),performerIsAway:(0,s.AP)("Performer Is Away"),roomAwayMessage:(0,s.AP)("You may continue chatting while you wait for the broadcaster to return."),roomPrivateNotWatchingMessage:(0,s.AP)("You may continue chatting while you wait for the broadcaster to return from the private show."),spyOnThisPrivateShowCAPS:(0,s.AP)("SPY ON THIS PRIVATE SHOW"),camIsHidden:(0,s.AP)("Cam is Hidden"),roomOfflineSubheader:(0,s.AP)("The member you are trying to view is currently offline. Please wait or choose another member to view."),passwordRequired:(0,s.AP)("Password Required"),roomPasswordProtectedMessage:(0,s.AP)("The broadcaster has set a password which is required for viewing. If you know the password, refresh this page to enter it."),errorLoadingConversationHistory:(0,s.AP)("Error loading conversation history. Close and reopen this DM to reload"),ageVerifiedHeader:(0,s.AP)("Age Verified Broadcasters"),ageVerifiedBodyHeader:(0,s.AP)("Your account is age verified!"),ageVerifiedGuests:(0,s.AP)("Additionally the following guests are approved to appear on your account:"),ageVerifiedBody:(0,s.AP)("Only the age verified persons below can appear through your account. If you would like to broadcast with someone that is not displayed below, they must upload their government-issued identification prior to appearing on your account."),camCategoryNorthAmerica:(0,s.AP)("North American Cams"),camCategorySouthAmerica:(0,s.AP)("South American Cams"),camCategoryAsia:(0,s.AP)("Asian Cams"),camCategoryEuroRussia:(0,s.AP)("Euro Russian Cams"),camCategoryOtherRegion:(0,s.AP)("Other Region Cams"),camCategoryTeen:(0,s.AP)("Teen Cams (18+)"),camCategory18to20:(0,s.AP)("18 to 20 Cams"),camCategory18to21:(0,s.AP)("18 to 21 Cams"),camCategory20to30:(0,s.AP)("20 to 30 Cams"),camCategory30to50:(0,s.AP)("30 to 50 Cams"),camCategory21to35:(0,s.AP)("21 to 35 Cams"),camCategoryMature:(0,s.AP)("Mature Cams (50+)"),camCategoryExhib:(0,s.AP)("Exhibitionist Cams"),camCategoryPrivate:(0,s.AP)("Private Shows"),camCategoryHidden:(0,s.AP)("Community Controlled Shows"),camCategoryNewCams:(0,s.AP)("New Cams"),camCategoryGaming:(0,s.AP)("Gaming Cams"),camCategory6TkPerMin:(0,s.AP)("6 Tokens per Minute"),camCategory12TkPerMin:(0,s.AP)("12 Tokens per Minute"),camCategory18TkPerMin:(0,s.AP)("18 Tokens per Minute"),camCategory30TkPerMin:(0,s.AP)("30+ Tokens per Minute"),camCategory60TkPerMin:(0,s.AP)("60+ Tokens per Minute"),camCategory6to18TkPerMin:(0,s.AP)("6 to 18 Tokens per Minute"),camCategory12to18TkPerMin:(0,s.AP)("12 to 18 Tokens per Minute"),camCategory30to42TkPerMin:(0,s.AP)("30 to 42 Tokens per Minute"),camCategory60to72TkPerMin:(0,s.AP)("60 to 72 Tokens per Minute"),camCategory90TkPerMin:(0,s.AP)("90+ Tokens per Minute"),categoryDescriptionHidden:(0,s.AP)("Community controlled cams are using an app which has the ability to hide and show the cam based on viewers feedback."),firefoxWarning:(0,s.AP)("Firefox is not recommended for browser broadcasting. For a better experience, please use Chrome or an external encoder."),noFanClub:(0,s.AP)("Broadcaster does not currently have a fan club."),inValidTipAmount:(0,s.AP)("Please input a tip amount between 1 and 9999"),shortcodeNotSupportedInDMs:(0,s.AP)("Shortcodes are not supported in DMs."),shortcodeNotSupportedInPMs:(0,s.AP)("Shortcodes are not supported in PMs."),shortcodeNotSupportedInPrivates:(0,s.AP)("Shortcodes are not supported in private shows."),shortcodeGeneralError:(0,s.AP)("Error sending shortcode. Please try again."),tipNotBroadcaster:(0,s.AP)("Only broadcasters & apps can publish tip shortcodes"),tooManyShortcodes:(0,s.AP)("Max shortcodes allowed per message is 5"),shortcode:(0,s.AP)("Shortcode"),shortcodeHelp:(0,s.AP)("Shortcodes are specific codes that can be typed into a chat room to automatically create clickable links with predefined actions. These shortcodes can act as a shortcut for users to perform various functions like joining a specific page or becoming a supporter. Broadcasters can also use shortcodes to suggest a tip."),shortcodeHelpHelp:(0,s.AP)("Generates information about the shortcode system and each of the shortcodes."),shortcodeURLNotAllowedInTip:(0,s.AP)("URLs are not allowed in tip shortcodes"),shortcodeHelpTipExample:(0,s.AP)("Tip if you enjoyed!"),loggedInForFeature:(0,s.AP)("You must be logged in to use this feature"),errorSendingTip:(0,s.AP)("Error sending tip"),visibleRegionsTag:(0,s.AP)("Visible Regions"),northAmericaTitle:(0,s.AP)("North America"),southAmericaTitle:(0,s.AP)("South America"),asiaTitle:(0,s.AP)("Asia"),europeRussiaTitle:(0,s.AP)("Europe/Russia"),otherTitle:(0,s.AP)("Other"),refresh30Seconds:(0,s.AP)("30 Seconds"),refresh45Seconds:(0,s.AP)("45 Seconds"),refresh60Seconds:(0,s.AP)("60 Seconds"),refresh90Seconds:(0,s.AP)("90 Seconds"),refreshDisable:(0,s.AP)("Disable"),refreshThumbnailsEvery:(0,s.AP)("Refresh thumbnails every"),showLocations:(0,s.AP)("Show locations"),showRecommendedCams:(0,s.AP)("Show recommended cams"),previewRooms:(0,s.AP)("Preview rooms"),moreTags:(0,s.AP)("(more tags)"),removeFilter:(0,s.AP)("(remove filter)"),filters:(0,s.AP)("Filters"),options:(0,s.AP)("Options"),privateBrowsingMessage:(0,s.AP)("Broadcasting while private browsing is not supported for Firefox. Please disable private browsing and try again."),unableToReloadErrorMessage:(0,s.AP)("Something went wrong while loading the rooms. Please refresh the page to try again."),onlineRooms:(0,s.AP)("Online Rooms"),offlineRooms:(0,s.AP)("Offline Rooms"),metaContentCardDescriptionPremium:(0,s.AP)("Join a private or spy show for greater intimacy and voyeurism."),metaContentCardDescriptionFemale:(0,s.AP)("Enjoy uncensored adult chat & live webcams with amateur girls. No registration required!"),metaContentCardDescriptionMale:(0,s.AP)("Enjoy uncensored adult chat & live webcams with amateur guys. No registration required!"),metaContentCardDescriptionCouples:(0,s.AP)("Enjoy uncensored adult chat & live webcams with amateur couples. No registration required!"),metaContentCardDescriptionTrans:(0,s.AP)("Enjoy uncensored adult chat & live trans webcams with amateurs. No registration required!"),metaContentCardDescriptionDefault:(0,s.AP)("Enjoy free chat and live webcam broadcasts from amateurs around the world. No registration required!"),metaDescriptionDefault:(0,s.AP)("Watch Live Cams Now! No Registration Required - 100% Free Uncensored Adult Chat. Start chatting with amateurs, exhibitionists, pornstars w/ HD Video & Audio."),metaDescriptionPremium:(0,s.AP)("You can join a private show and for only a few tokens per minute. Chat in private shows and direct all the action!"),metaDescriptionSiteDefault:(0,s.AP)("Enjoy free webcams broadcasted live from amateurs around the world! - Join 100% Free"),metaKeywordsFemale:(0,s.AP)("free chat with girls, live cam girls, free webcam girls"),metaKeywordsMale:(0,s.AP)("free chat with men, live gay cams, free gay webcams"),metaKeywordsCouple:(0,s.AP)("free chat with couple, live cam couple, free webcam couple"),metaKeywordsTrans:(0,s.AP)("free chat with trans, live cam trans, free webcam trans"),metaKeywordsDefault:(0,s.AP)("free cams, free adult video chat, free sex webcams, live adult cams, adult webcams, free live porn"),metaKeywordsPremium:(0,s.AP)("private cams and spy cams"),metaKeywordsSiteDefault:(0,s.AP)("adult chat, adult cams, free chat, free cams, live cams"),premiumShowsCaps:(0,s.AP)("PREMIUM SHOWS"),featuredText:(0,s.AP)("Featured"),highestTokenColorTooltip:(0,s.AP)('If your "tipped recently" amount is higher than the selected value, your username will be displayed in the selected color.'),tipShortcodeMessageInDoubleQuotes:(0,s.AP)("The message content for tip shortcode must be enclosed in double quotes"),tipShortcodeArgsMissing:(0,s.AP)("Tip shortcode requires an amount and message"),loadingPreview:(0,s.AP)("Loading Preview"),obsGuideCodec:(0,s.AP)("Codec:"),obsGuideCodecBody:(0,s.AP)("H.264 Video, AAC Audio."),obsGuideAspect:(0,s.AP)("Aspect ratio:"),obsGuideAspectBody:(0,s.AP)("4:3 or 16:9 only."),obsGuideResolution:(0,s.AP)("Resolution:"),obsGuideResolutionBody:(0,s.AP)("From a height of 240 pixels up to 4k (2160 pixels)."),obsGuideFPS:(0,s.AP)("Frame Rate:"),obsGuideFPSBody:(0,s.AP)("24-30fps, or 48-60fps for high frame rate."),obsGuideBitrate:(0,s.AP)("Bitrate:"),obsGuideBitrateBody:(0,s.AP)("Up to 50 Mbps (50 000 Kbps) Video, 192 Kbps Audio - CBR Preferred."),obsGuideKeyFrame:(0,s.AP)("Key Frame Interval:"),obsGuideKeyFrameBody:(0,s.AP)("2 seconds."),obsGuideKeyProfile:(0,s.AP)("H.264 Profile:"),obsGuideKeyProfileBody:(0,s.AP)("Main or High preferred; baseline is acceptable."),obsGuideGenerate:(0,s.AP)("Generate New Token"),obsGuideGenerateFail:(0,s.AP)("Failed to reset token. Please try again."),internalStaffPrivate:(0,s.AP)("Cannot start or spy on private shows as staff while on internal site."),internalStaffMessage:(0,s.AP)("Cannot chat as staff while on internal site."),internalStaffFanClub:(0,s.AP)("Cannot join fanclubs as staff while on internal site."),internalStaffPurchase:(0,s.AP)("Cannot purchase as staff while on internal site."),internalStaffTip:(0,s.AP)("Cannot tip as staff while on internal site."),internalStaffC2C:(0,s.AP)("Cannot Cam to Cam as staff while on internal site."),internalStaffPromotion:(0,s.AP)("Cannot start promotion as staff while on internal site."),clear:(0,s.AP)("clear"),reset:(0,s.AP)("reset"),notFound:(0,s.AP)("Not found"),agesCAPS:(0,s.AP)("AGES"),hmpgFilterOpt6TksAbbrev:(0,s.AP)("6 tks"),hmpgFilterOpt6To18TksAbbrev:(0,s.AP)("6 - 18 tks"),hmpgFilterOpt12To18TksAbbrev:(0,s.AP)("12 - 18 tks"),hmpgFilterOpt30TksAbbrev:(0,s.AP)("30 - 42 tks"),hmpgFilterOpt60TksAbbrev:(0,s.AP)("60 - 72 tks"),hmpgFilterOpt90TksAbbrev:(0,s.AP)("90+ tks"),regionsCAPS:(0,s.AP)("REGIONS"),privateTksPerMinCAPS:(0,s.AP)("PRIVATE SHOW TOKENS PER MINUTE"),otherEncoderSupport:(0,s.AP)("See our support page for technical info."),hiddenCams:(0,s.AP)("Hidden Cams"),tagSearchPlaceholder:(0,s.AP)("Search #tags"),privateTimeWithBroadcaster:(0,s.AP)("Private time with broadcaster"),recordedVideo:(0,s.AP)("A recorded video of this show in your collection."),lowStreamResolution:(0,s.AP)("Your stream resolution is lower than the recommended minimum of 480 pixels, we suggest you increase your stream resolution."),streamNotHD:(0,s.AP)("Note: Your stream is not HD, a minimum height of 720 pixels is required."),streamNotWidescreen:(0,s.AP)("Your stream is not widescreen. We recommend all streams to be widescreen (16:9 ratio) with external encoders"),errorHandlingStream:(0,s.AP)("Error handling your stream, please restart it and contact support if this persists."),unstableBitrate:(0,s.AP)("Your bitrate is unstable which can indicate a poor connection."),veryGoodBitrate:(0,s.AP)("Your bitrate is very good!"),frameRateMuchLower:(0,s.AP)("Your frame rate is much lower than the recommended minimum of 24 fps"),frameRateLower:(0,s.AP)("Your frame rate is lower than the recommended minimum of 24 fps"),frameRateHigh:(0,s.AP)("You are broadcasting with a high frame rate. Please only use this if your camera is set to a high frame rate."),frameRateTooHigh:(0,s.AP)("Your frame rate is higher than the maximum of 60 fps. This will result in a poor stream output."),fpsVeryUnstable:(0,s.AP)("Your fps is very unstable. Your encoder may be overloaded."),fpsUnstable:(0,s.AP)("Your fps is unstable. Your encoder may be overloaded."),noQualityInformation:(0,s.AP)("Unable to get quality information, please contact support if this persists. Your stream is not affected."),alert:(0,s.AP)("Alert"),warning:(0,s.AP)("Warning"),yourStreamIsGood:(0,s.AP)("Your stream is good"),noIssues:(0,s.AP)("No issues to report"),enableLLHLS:(0,s.AP)("Enable LL-HLS"),promoteThisRoom:(0,s.AP)("Promote This Room"),notEnoughTokensMessage:(0,s.AP)("You do not have enough tokens."),promotionUnavailableOffline:(0,s.AP)("Broadcaster must be online and public in order to promote room."),promotionUnavailableTitle:(0,s.AP)("The promotion feature is currently unavailable"),promotionUnavailableDescription:(0,s.AP)("This room may already be enjoying high visibility or undergoing promotion. Check back later for a chance to add this room to the homepage."),promotionConfirmTitle:(0,s.AP)("Promote Room"),promotionConfirmDescription:(0,s.AP)("Boost this room's visibility by adding it to a rotating promoted spot on the homepage for 5 minutes."),promotionConfirmPromoteText:(0,s.AP)("Yes, promote room"),promotionIneligibleUserMessage:(0,s.AP)("Your account is unable to promote room. Please contact support."),roomSizeCAPS:(0,s.AP)("ROOM SIZE"),intimateRoomSizeCategory:(0,s.AP)("Intimate"),intimateRoomsLabel:(0,s.AP)("Intimate Rooms"),midSizeRoomSizeCategory:(0,s.AP)("Mid-Sized"),midSizeRoomsLabel:(0,s.AP)("Mid-Sized Rooms"),hiTrafficRoomSizeCategory:(0,s.AP)("High-Traffic"),hiTrafficRoomsLabel:(0,s.AP)("High-Traffic Rooms"),broadcasterWarningMessage:(0,s.AP)("A site administrator has sent you the following message:"),broadcasterWarningAknowledge:(0,s.AP)("I understand"),broadcasterWarningQuestion:(0,s.AP)("I have a question"),broadcastTermsHeader:(0,s.AP)("WARNING: THIS SITE HAS A ZERO TOLERANCE POLICY ON UNDERAGE BROADCASTING."),broadcastTerms1:(0,s.AP)("The Chaturbate service is for use by adults only. By clicking the link below, you are affirming your representation and warranty to us that:"),broadcastTerms2:(0,s.AP)('You are at least 18 years old or the age of majority in your jurisdiction, whichever is older (the "Age of Majority");'),broadcastTerms3:(0,s.AP)("Anyone appearing on camera with you has also reached the Age of Majority;"),broadcastTerms4:(0,s.AP)("At no time will anyone who has not reached the Age of Majority be present while you are using the Chaturbate service;"),broadcastTerms5:(0,s.AP)("You will not permit anyone who has not reached the Age of Majority to use the Chaturbate service; and"),broadcastTerms6:(0,s.AP)('You will immediately report by email to support@chaturbate.com any and all instances you become aware of wherein an individual has used the Chaturbate service without first reaching the Age of Majority.'),broadcastTerms7:(0,s.AP)("Obviously, you consent to and request your image being broadcast on the Chaturbate platform."),broadcastTerms8:(0,s.AP)("You agree that you will be governed by the Chaturbate Terms and by the Chaturbate Broadcaster Agreement."),broadcastTerms9:(0,s.AP)("You agree that only age verified broadcasters associated with this room may broadcast in this room."),broadcastTerms10:(0,s.AP)('If we suspect, in our sole discretion, that you are using the Chaturbate service without having complied in every respect with the foregoing statements, your account will be terminated immediately, and we will report your conduct to law enforcement.'),termsAgree:(0,s.AP)("I AGREE"),preferenceUpdateError:(0,s.AP)("An error occurred while updating your preferences. Please try again"),mustBeLoggedInForChatSettings:(0,s.AP)('You must be logged in to change chat settings. Click "OK" to login.'),mustBeSupporterForChatColor:(0,s.AP)("You must be a supporter to change chat color"),mustBeLoggedInForChatColor:(0,s.AP)('You must be logged in to change chat color. Click "OK" to login.'),mustBeSupporterForFontFamily:(0,s.AP)("You must be a supporter to change font family"),mustBeLoggedInForFontFamily:(0,s.AP)('You must be logged in to change font family. Click "OK" to login.'),mustBeLoggedInForIgnoredUsers:(0,s.AP)('You must be logged in to edit ignored users. Click "OK" to login.'),dropDownWhatsApp:(0,s.AP)("WhatsApp"),dropDownDiscord:(0,s.AP)("Discord"),whatsAppLabelText:(0,s.AP)("Your WhatsApp number with country code but without the + sign (e.g. 112345678900):"),whatsAppInvalidInput:(0,s.AP)("Please enter a valid WhatsApp number."),discordLabelText:(0,s.AP)("Your Discord Invite Link:"),discordInvalidInput:(0,s.AP)("Please enter a valid Discord link."),defaultInvalidInput:(0,s.AP)("Please enter valid social media username/channel."),defaultLabelText:(0,s.AP)("Your Social Media Username/Channel/Invite Link:"),scrollToBottom:(0,s.AP)("Scroll to bottom"),tenPlusNewMessages:(0,s.AP)("10+ new messages")}},1372:(e,t,i)=>{"use strict";i.d(t,{FK:()=>n,tT:()=>h,zN:()=>p});var s=i(6784);const n=()=>"FRAGMENT",o={style:(e,t)=>{Object.assign(e.style,t)},className:(e,t)=>{e.setAttribute("class",t)},class:(e,t)=>{e.setAttribute("class",t)},htmlFor:(e,t)=>{e.setAttribute("for",t)},colorClass:(e,t)=>{const i=t;Array.isArray(i)?i.forEach((t=>{""!==t&&e.classList.add(t)})):e.classList.add(i)},xlinkHref:(e,t)=>{e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t)},dangerouslySetInnerHTML:(e,t)=>{e.innerHTML=t.__html},bind:(e,t)=>{!function(e,t){c(e,(()=>{Object.keys(t).forEach((i=>{const s=t[i];if(!(s instanceof Function))return void warn(`Wrong binding for element ${e.outerHTML} key ${i} is not a function ${s}`);const n=t[i]();"display"===i?e.style.display=n:"text"===i?e.textContent=n:r(i,e,n)}))}))}(e,t)},ref:(e,t)=>{"function"==typeof t&&t(e)},display:(e,t)=>{e.style.display=t}};function r(e,t,i){const n=o[e];void 0!==n?n(t,i):0===e.indexOf("on")?function(e,t,i){let n=e.toLowerCase(),o=!1;e.indexOf("Capture",e.length-7)>-1&&(o=!0,n=n.slice(-7)),null===t[n]?(0,s.wu)(n.slice(2),t,i,o):warn(`Event declared for JSX element that does not exist on type ${t.tagName}: ${e}`)}(e,t,i):t.setAttribute(e,i)}function a(e,t){"function"==typeof e.ref&&e.ref(t,e)}function l(e){const t=document.createDocumentFragment();return e.forEach((function e(i){if(i instanceof HTMLElement||i instanceof SVGElement||i instanceof Comment||i instanceof DocumentFragment)t.appendChild(i),u(t,i);else if("string"==typeof i||"number"==typeof i){const e=document.createTextNode(`${i}`);t.appendChild(e)}else i instanceof Array?i.forEach(e):!1===i||null==i?debug(`Logic expression in Tsx fragment: ${i}`):warn(`Unexpected child in Tsx fragment: ${i}`)})),t}function h(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;nt.test(e)))}(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e),n=l(i);return s.appendChild(n),u(s,n),function(e,t){if(null!=t){const i=Object.keys(t),s=i.indexOf("colorClass");s>=0&&i.push(i.splice(s,1)[0]),i.forEach((i=>{r(i,e,t[i])}))}}(s,t),s}(e,t,s)}const d="__mm_bindings__";function c(e,t){d in e||(e[d]=[]),e[d].push(t)}function u(e,t){if(d in t)for(const i of t[d])c(e,i)}function p(e){var t;return null!==(t=e[d])&&void 0!==t?t:[]}},2945:(e,t,i)=>{"use strict";i.d(t,{Go:()=>l,JO:()=>h,KZ:()=>o,U1:()=>a,W2:()=>r});var s=i(7063),n=i(5216);function o(e){const t=a(e);if(t!==document.location.search&&"replaceState"in window.history){const e=null!==window.top?window.top:window,i=(0,s.zm)(t,e.location.pathname);window.history.replaceState("","",(0,n._Y)(i))}}function r(e,t){const i=a(e);i!==window.location.search&&"pushState"in window.history&&window.history.pushState(t,"",(0,n._Y)((0,s.zm)(i,window.location.pathname)))}function a(e){const t=new URLSearchParams(window.location.search);e.forEach(((e,i)=>{""===e?t.delete(i):t.set(i,e)}));const i=t.toString().replace(/%2C/g,",");return""===i?"":`?${i}`}function l(e){let t="";for(const i of Object.keys(e)){""!==t&&(t+="&");let s=e[i];void 0===s&&(s=""),t+=`${encodeURIComponent(i)}=${encodeURIComponent(s)}`}return t}function h(e){e.length>0&&"?"===e[0]&&(e=e.slice(1));const t={};for(const i of e.split("&"))if(i.includes("=")){const e=i.split("=");e[0].length>0&&(t[decodeURIComponent(e[0])]=e[1].length>0?decodeURIComponent(e[1]):void 0)}else i.length>0&&(t[decodeURIComponent(i)]=void 0);return t}},4110:(e,t,i)=>{"use strict";i.d(t,{Ch:()=>l,E3:()=>a,ME:()=>d,PV:()=>c,kw:()=>o,n2:()=>r,nw:()=>n,q_:()=>h,xw:()=>u});var s=i(8423);const n=new s.c_("roomListRequest"),o=new s.c_("playerForceMuted"),r=new s.c_("standardEmoticonRequest"),a=new s.c_("userInitiatedPm"),l=new s.c_("mentionUser"),h=new s.c_("appDebuggingToggled"),d=new s.c_("getMoreHistoryMessages"),c=new s.c_("repositionChatTabContent"),u=new s.c_("userModeratorStatusChanged")},3741:(e,t,i)=>{"use strict";i.d(t,{Zm:()=>E,h1:()=>L,qH:()=>D});var s=i(20),n=i(9447),o=i(3910),r=i(9757),a=i(9461),l=i(369),h=i(7013),d=i(9603),c=i(6784),u=i(213),p=i(5216),m=i(6844),g=i(8160),v=i(2939),f=i(5020),y=i(3955),b=i(8423),w=i(2396),C=i(2119),S=i(1779),x=i(6716),T=i(7407),A=i(3587),P=i(5173),k=i(8785),M=i(74),R=i(4947),I=i(4110);function E(){const e=D.state;return 0===e||1===e}function L(){D.setUserContextMenuState(3)}class D extends P.Q{static setUCMContainer(e){D.ucmContainer=e}constructor(e,t,i){var s;super(),this.user=e,this.message=i,this.ucmListenerGroup=new b.gt,this.tearDownListener=e=>{const t=e.ctrlKey||e.metaKey,i=9===e.keyCode,s=t&&83===e.keyCode,n=t&&191===e.keyCode,o=191===e.keyCode,r=t&&76===e.keyCode,a=27===e.keyCode;(i||s||n||r||a||o)&&this.hideOverlay()},this.hideOverlayListener=()=>{this.hideOverlay()},this.clickTargetEl=t,this.parentEl=null!==(s=D.ucmContainer)&&void 0!==s?s:t.offsetParent,this.createPlaceholder(),(0,c.wu)("keydown",document,this.tearDownListener),this.fullscreenChangeListener=S._c.listen(this.hideOverlayListener),(0,c.wu)("popstate",window,this.hideOverlayListener),M.pL.listen(this.hideOverlayListener,!1).addTo(this.ucmListenerGroup),x.VZ.listen(this.hideOverlayListener,!1).addTo(this.ucmListenerGroup);let n=window.innerWidth;l.oO.listen((()=>{window.innerWidth{this.hideOverlay()})),super.showOverlay(),this.loadData()}getUsername(){return this.user.username}static setUserContextMenuState(e){D.state=e}createPlaceholder(){this.initializeMenu(),this.addHeader(),this.addUserLabels(),this.addRestMenu(),this.addHeaderLeftData(),this.addLinksData()}loadData(){D.setUserContextMenuState(0),this.position(!0),(0,w.b)(this.user.username).then((e=>{2!==D.state&&(this.fillData(e),this.position())})).catch((e=>{error("Could not process user menu request",{username:this.user.username,reason:e.toString()})}))}fillData(e){void 0===this.data&&(this.data=e,this.showSupporterAlert=this.data.needsSupporterToPm,this.addHeaderRightData(),this.addSilenceIfAllowed(),D.setUserContextMenuState(1))}initializeMenu(){D.setUserContextMenuState(0),this.element=document.createElement("div"),this.element.id="user-context-menu",this.element.dataset.testid="user-context-menu",this.menuContents=document.createElement("div"),this.modSection=document.createElement("div"),this.menuContents.style.backgroundColor="",this.element.appendChild(this.menuContents),this.element.style.textShadow="none",this.element.style.position="absolute",this.element.style.borderRadius="4px",this.element.style.borderStyle="solid",this.element.style.borderWidth="1px",this.element.style.top="0",this.element.style.fontWeight="normal",this.element.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",this.element.style.fontSize="12px",this.element.style.width="188px",this.element.style.cursor="default",this.element.style.visibility="visible",this.element.style.zIndex="1010",this.overlay.style.zIndex="1010",v.X0.listen((e=>{this.roomName=e.dossier.room,this.currentUsername=e.dossier.userName,this.chatConn=e.chatConnection})).addTo(this.ucmListenerGroup)}addLoadingStyle(e){(0,n.fZ)(e,"ucmPlaceholder")}removeLoadingStyle(e){(0,n.SA)(e,"ucmPlaceholder")}addHeader(){const e=document.createElement("div");(0,n.fZ)(e,"ucmHeader"),e.style.padding="9px 10px",e.style.fontWeight="bold",e.style.borderTopLeftRadius="4px",e.style.borderTopRightRadius="4px",this.name=document.createElement("div"),this.name.style.display="inline-block",this.name.style.maxWidth="100px",this.name.style.height="12px",this.name.style.marginRight="4px",e.appendChild(this.name);const t=C.M.getOrCreateInstance().hasFollower(this.user.username);if(a.Bm.current.isBroadcast&&t&&this.user.username!==a.Aw.getState().room){const t=(0,h.H)(),i=(0,d.q)({content:R.R.followsYou,hasHTML:!1,divotPosition:f.Wi.Bottom,divotLeftOrTop:"8px"});i.style.padding="6px",i.style.fontFamily="UbuntuLight, Helvetica, Arial, sans-serif",i.style.lineHeight="normal",i.style.position="fixed",i.style.display="block",i.style.width="max-content",i.style.zIndex="1011",(0,y.JR)(t).listen((e=>{var s;e?document.body.appendChild(i):null===(s=i.parentElement)||void 0===s||s.removeChild(i);const n=t.getBoundingClientRect(),o=(0,y.Mx)();i.style.top=-o.top+n.top-i.offsetHeight-n.height/5-5+"px",i.style.left=-o.left+n.left+n.width/2-18+"px"})),e.appendChild(t)}const i=document.createElement("div");i.style.display="inline-block",i.style.width="38px",i.style.height="12px",i.style.position="absolute",i.style.right="8px",this.age=document.createElement("span"),(0,n.fZ)(this.age,"ucmAgespan"),this.age.style.display="inline-block",this.age.style.width="15px",this.age.style.minHeight="14px",this.age.style.fontSize="12px",this.age.style.fontWeight="bold",this.age.style.marginRight="6px",this.age.style.verticalAlign="top",i.appendChild(this.age),this.addLoadingStyle(this.age),this.genderSpan=document.createElement("span"),this.genderSpan.style.display="inline-block",this.genderSpan.style.width="15px",this.genderSpan.style.height="14px",this.genderSpan.style.verticalAlign="top",this.genderIcon=document.createElement("img"),void 0!==this.user.gender?(this.genderIcon.src=(0,k.e0)(this.user.gender),this.genderIcon.style.display="inline-block",this.genderIcon.title=R.R.genderSymbolToIconTitle(this.user.gender)):(this.addLoadingStyle(this.genderSpan),this.genderIcon.style.display="none"),this.genderIcon.height=14,this.genderIcon.width=14,this.genderSpan.appendChild(this.genderIcon),i.appendChild(this.genderSpan),e.appendChild(i),this.menuContents.appendChild(e)}addHeaderLeftData(){const e=document.createElement("a");e.innerText=this.user.username,(0,n.fZ)(e,(0,k.Kb)(this.user)),e.dataset.testid="username",e.style.fontWeight="bold",e.href=(0,p._Y)(`/${this.user.username}/`),e.target="_blank",e.style.textDecoration="none",e.style.overflow="hidden",e.style.textOverflow="ellipsis",e.style.maxWidth="100px",e.style.display="inline-block",e.style.cursor="pointer",e.onmouseenter=()=>{e.style.textDecoration="underline"},e.onmouseleave=()=>{e.style.textDecoration="none"},(0,c.wu)("click",this.name,(e=>{(0,T.bT)("ViewProfile",{username:this.user.username}),e.stopPropagation(),this.hideOverlay()})),this.name.appendChild(e),this.overlay.style.background="rgba(0, 0, 0, 0.01)",this.element.style.visibility="visible"}addHeaderRightData(){var e,t;const i=document.createElement("div");if(i.style.width="188px",i.style.height="75px",i.style.overflow="hidden",i.style.borderRadius="4px 4px 0px 0px",!0===(null===(e=this.data)||void 0===e?void 0:e.online)){const e=document.createElement("img");(0,c.wu)("load",e,(()=>{const t=i.getBoundingClientRect(),s=e.getBoundingClientRect();t.height=18&&(this.age.innerText=this.data.displayAge.toString()),this.removeLoadingStyle(this.age),this.genderIcon.src=(0,k.e0)(this.data.gender),this.genderIcon.style.display="inline-block")}addUserLabels(){const e=(0,k.DG)(this.user),t=(0,k.LD)(this.user);if(void 0!==e){const i=document.createElement("div");(0,n.fZ)(i,"ucmUserLabel"),i.style.padding="9px 10px",i.style.borderTopWidth="1px",i.style.borderTopStyle="solid",this.menuContents.appendChild(i);const s=document.createElement("div");if(s.dataset.testid="user-label",s.style.width="74px",s.style.height="12px",s.style.width="100%",s.innerText=e,(0,n.fZ)(s,(0,k.Kb)(this.user)),s.style.fontWeight="bold",i.appendChild(s),void 0!==t){const e=document.createElement("div");(0,n.fZ)(e,"ucmSublabel"),e.style.height="10px",e.style.fontSize="10px",e.style.marginTop="4px",e.style["-webkit-text-size-adjust"]="none",e.innerText=t,i.appendChild(e)}}}addRestMenu(){this.addLinks(this.user),this.addModSection(),this.addNotes(this.user.username)}addNotes(e){if(void 0===this.currentUsername||this.currentUsername===e)return;const t=document.createElement("div"),i=r.c.get("UserNote");this.reactUserNote=new i({username:e,badgeManager:A.T.getOrCreateInstance(),isNotLoggedIn:m.rC,removeMenu:()=>{this.hideOverlay()}},t),this.menuContents.appendChild(t)}addLinks(e){this.menuLinks=document.createElement("div"),(0,n.fZ)(this.menuLinks,"ucmLinks"),this.menuLinks.style.padding="5px 0",this.menuLinks.style.fontSize="12px",this.menuLinks.style.borderTopWidth="1px",this.menuLinks.style.borderTopStyle="solid",this.menuContents.appendChild(this.menuLinks)}addModSection(){this.menuContents.appendChild(this.modSection),(0,n.fZ)(this.modSection,"ucmModSection"),this.modSection.style.borderTopWidth="1px",this.modSection.style.borderTopStyle="solid",this.modSection.style.padding="5px 0",this.modSection.style.display="none"}addLinksData(){if(this.currentUsername!==this.user.username){if(void 0===this.chatConn)return void error("ignoreText: Chatconnection should be defined");const e=this.createSendLink(this.user.username,!0);if(this.menuLinks.appendChild(e),(0,s.SU)()){const e=this.createSendLink(this.user.username,!1);this.menuLinks.appendChild(e)}const t=this.createMentionLink(this.user.username);if(this.menuLinks.appendChild(t),this.roomName!==this.currentUsername){const e=this.createIgnoreLink(this.user.username,this.chatConn);this.menuLinks.appendChild(e)}if(void 0!==this.message){const e=this.createReportLink(this.user.username,this.message);this.menuLinks.appendChild(e)}}else this.menuLinks.style.display="none"}addSilenceIfAllowed(){if(void 0!==this.data&&this.data.canSilence){const e=document.createElement("div"),t=this.createLink(),i=this.createLinkSpan(),s=this.data.username;i.style.paddingLeft="20px",t.appendChild(i),t.dataset.testid="silence-toggle",e.appendChild(t),void 0!==this.data.silenceId?i.innerText=R.R.removeSilenceMessage:i.innerText=R.R.silenceDurationMessage,i.title=i.innerText,t.onclick=()=>{void 0!==this.data&&void 0!==this.data.silenceId&&void 0!==this.roomName?(0,p.KF)("edit_room_ban/",{banid:String(this.data.silenceId),action:"remove_silence",room_username:this.roomName}).catch((e=>{error("remove_silence_ error",e),(0,u.Q$)(`Error removing silence from user ${s}`)})):(0,u.mf)(`Silence ${this.user.username}?`,(()=>{(0,T.bT)("SilenceUser",{username:this.user.username,to_user:this.user.username}),(0,p.KF)(`roomsilence/${this.user.username}/${this.roomName}/`,{}).catch((e=>{error("silence_user_error",e),(0,u.Q$)(`Error silencing user ${this.user.username}`)}))})),this.hideOverlay()},this.modSection.appendChild(e),this.modSection.style.display=""}}findBoundary(){if((0,S.aS)())return{boundV:(0,S.Gy)(),boundH:(0,S.Gy)()};const e=(e,t,i)=>{const s=window.getComputedStyle(e);return void 0===t&&"hidden"===s.overflowY&&(t=e),void 0===i&&"hidden"===s.overflowX&&(i=e),[t,i]};let t,i;for(let s=this.parentEl;void 0!==s&&"body"!==s.tagName.toLowerCase()&&([t,i]=e(s,t,i),void 0===t||void 0===i);s=null===s.parentElement?void 0:s.parentElement);return{boundV:t,boundH:i}}trapInBoundary(e,t){const i=void 0===e?document.documentElement:e,s=void 0===t?document.documentElement:t,n=i.getBoundingClientRect(),o=s.getBoundingClientRect(),r=this.element.getBoundingClientRect(),a=n.bottom-r.height-38,l=o.right-r.width,h=n.top,d=o.left,c=r.top,u=r.left;if(h>c){const e=h-c;this.element.style.top=`${this.element.offsetTop+e+4}px`}if(d>u){const e=d-u;this.element.style.left=`${this.element.offsetLeft+e+4}px`}if(a0&&void 0!==arguments[0]&&arguments[0]&&this.repositionToMatch(this.clickTargetEl.getBoundingClientRect());const e=this.findBoundary();this.trapInBoundary(e.boundV,e.boundH)}hideOverlay(){var e,t;2!==D.state&&(super.hideOverlay(),void 0!==this.chatReport&&this.chatReport.tearDown(),(0,c.Pf)("keydown",document,this.tearDownListener),null===(e=this.fullscreenChangeListener)||void 0===e||e.removeListener(),this.fullscreenChangeListener=void 0,(0,c.Pf)("popstate",window,this.hideOverlayListener),this.ucmListenerGroup.removeAll(),this.parentEl.removeChild(this.element),this.afterRemovedFromParent(),D.setUserContextMenuState(2),null===(t=this.reactUserNote)||void 0===t||t.dispose())}createSendLink(e,t){const i=this.createLink(),s=document.createElement("div"),r=this.createLinkSpan();return(0,n.fZ)(i,"ucmPMLink"),i.dataset.testid=t?"send-pm":"send-dm",i.appendChild(s),i.appendChild(r),r.innerText=t?R.R.sendPrivateMessageText:R.R.sendDirectMessageText,r.title=r.innerText,(0,n.fZ)(s,t?"ucmSendPmIcon":"ucmSendDmIcon"),s.style.padding="0px 4px 0 0",s.style.verticalAlign="bottom",s.style.width="14px",s.style.height="14px",s.style.display="inline-block",s.style.marginRight="4px",(0,c.wu)("click",i,(i=>{this.hideOverlay(),(0,m.rC)(t?R.R.loggedInToPm:R.R.loggedInToDm)||(t?((0,T.bT)("StartPrivateMessage",{username:e,to_user:e,location:"PMTab"}),I.E3.fire({username:e,focus:!0,showSupporterAlert:this.showSupporterAlert})):((0,T.bT)("StartDirectMessage",{username:e,to_user:e}),o.$o.fire(e)),i.stopPropagation())})),i}createMentionLink(e){const t=this.createLink(),i=document.createElement("div"),s=this.createLinkSpan();return s.innerText=R.R.mentionUserText,s.title=s.innerText,(0,n.fZ)(i,"ucmMentionIcon"),i.style.width="14px",i.style.height="14px",i.style.padding="0px 4px 0 0px",i.style.verticalAlign="bottom",i.style.display="inline-block",i.style.marginRight="4px",t.id="ucm-mentionuser",t.dataset.testid="mention-user",t.appendChild(i),t.appendChild(s),(0,c.wu)("click",t,(()=>{I.Ch.fire(e),this.hideOverlay()})),t}createIgnoreLink(e,t){const i=this.createLink();i.dataset.testid="ignore-toggle";const s=document.createElement("div"),o=this.createLinkSpan();return(0,n.fZ)(i,"ucmIgnoreLink"),o.style.paddingLeft="0",o.innerText=t.isIgnored(e)?R.R.unignoreThisUserText:R.R.ignoreThisUserText,i.appendChild(s),o.title=o.innerText,i.appendChild(o),(0,n.fZ)(s,"ucmIgnoreIcon"),s.style.padding="0px 4px 0 0px",s.style.verticalAlign="bottom",s.style.width="14px",s.style.height="14px",s.style.display="inline-block",s.style.marginRight="4px",(0,c.wu)("click",i,(()=>{t.isIgnored(e)?t.unignore(e):t.ignore(e),this.hideOverlay()})),i}createReportLink(e,t){const i=this.createLink(),s=document.createElement("div"),o=this.createLinkSpan();return(0,n.fZ)(i,"ucmReportLink"),i.appendChild(s),i.appendChild(o),i.dataset.testid="report-room",(0,n.fZ)(s,"ucmReportIcon"),s.style.padding="0 4px 0 0",s.style.verticalAlign="middle",s.style.width="14px",s.style.height="14px",s.style.display="inline-block",s.style.marginRight="4px",o.innerText=R.R.reportThisMessageText,o.title=o.innerText,(0,c.wu)("click",i,(()=>{(0,T.bT)("ReportChatUser",{username:e,to_user:e}),this.element.removeChild(this.menuContents),this.chatReport=new g.n(e,t,this.chatConn),this.element.appendChild(this.chatReport.element),this.position(),this.chatReport.focusForm(),this.chatReport.closeChatReportRequest.listen((()=>{this.hideOverlay()}))})),i}createLink(){const e=document.createElement("div");return e.style.padding="3px 10px",e.style.whiteSpace="nowrap",e.style.overflow="hidden",e.style.textOverflow="ellipsis",e.style.fontWeight="normal",e.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",e.style.fontSize="12px",e.style["-webkit-text-size-adjust"]="none",(0,n.fZ)(e,"ucmLinkColor"),this.addLinkMouseover(e),e}createLinkSpan(){const e=document.createElement("span");return e.style.fontWeight="normal",e.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",e.style.fontSize="12px",e.style["-webkit-text-size-adjust"]="none",(0,n.fZ)(e,"ucmLinkColor"),e}addLinkMouseover(e){(0,n.fZ)(e,"ucmLinkHover"),e.onmouseenter=()=>{e.style.cursor="pointer"},e.onmouseleave=()=>{e.style.cursor="default"}}}D.state=2},9681:(e,t,i)=>{"use strict";i.d(t,{L:()=>b});var s=i(9447),n=i(6784),o=i(4054),r=i(213),a=i(5216),l=i(6844),h=i(2939),d=i(3955),c=i(7407),u=i(4947),p=i(4110),m=i(3741);class g extends m.qH{constructor(e,t,i){super(e,t,i)}addRestMenu(){if(super.addRestMenu(),this.currentUsername===this.user.username)return;this.modSection.style.display="",this.promoteModSection=document.createElement("div"),(0,s.fZ)(this.promoteModSection,"ucmPromoteModSection"),(0,d.ZM)(this.promoteModSection,{borderTopWidth:"1px",borderTopStyle:"solid",padding:"5px 0"}),this.hasTippedSection=document.createElement("div"),(0,s.fZ)(this.hasTippedSection,"ucmHasTippedSection"),(0,d.ZM)(this.hasTippedSection,{padding:"9px 10px",borderTopWidth:"1px",borderTopStyle:"solid"}),this.menuContents.insertBefore(this.promoteModSection,this.modSection.nextSibling),this.menuContents.appendChild(this.hasTippedSection);const e=this.createLink();e.dataset.testid="kick-ban-toggle";const t=this.createLinkSpan();t.style.paddingLeft="20px",this.modSection.appendChild(e),e.appendChild(t),t.innerText=u.R.kickBan,t.title=t.innerText,(0,n.wu)("click",e,(()=>{this.hideOverlay(),(0,l.rC)('You must be logged in to ban a user. Click "OK" to login.')||(0,r.mf)(u.R.banUserConfirm(this.user.username),(()=>{(0,c.bT)("BanUser",{username:this.user.username}),(0,a.KF)(`roomban/${this.user.username}/${this.roomName}/`,{}).catch((e=>{error("broadcast_ban_error",e),(0,r.Q$)(u.R.banUserError(this.user.username))}))}))}));const i=document.createElement("div"),o=document.createElement("img"),h=document.createElement("span");o.src=`${STATIC_URL}ico-tip.gif`,(0,d.ZM)(o,{width:"13px",height:"13px",padding:"2px 4px 0 1px"}),i.appendChild(o),i.appendChild(h),h.innerText=`${u.R.userHasTippedMe(this.user.username)}:`,(0,d.ZM)(h,{display:"inline-block",width:"100%",overflow:"hidden",textOverflow:"ellipsis"}),this.hasTippedSection.appendChild(i);const p=document.createElement("div"),m=document.createElement("div"),g=document.createElement("div");p.style.paddingLeft="20px",m.style.paddingLeft="20px",g.style.paddingLeft="20px";const v=document.createElement("span"),f=document.createElement("span"),y=document.createElement("span");p.appendChild(v),m.appendChild(f),g.appendChild(y),v.innerText=u.R.tokensInPastHour(0),v.dataset.testid="tipped-hour",f.innerText=u.R.tokensInPastDay(0),f.dataset.testid="tipped-day",y.innerText=u.R.tokensInPastTwoWeeks(0),y.dataset.testid="tipped-two-weeks",i.appendChild(p),i.appendChild(m),i.appendChild(g),void 0!==this.roomName&&void 0!==this.currentUsername&&(0,a.KF)("api/getchatusermenu/",{roomname:this.roomName,fromuser:this.currentUsername,touser:this.user.username}).then((e=>{this.promoteModSection.appendChild(this.createChangeModStatusLink(Boolean(e.getResponseHeader("X-Target_Is_Mod")),this.user)),v.innerText=u.R.tokensInPastHour(this.getTipHeaderValue(e.getResponseHeader("X-Tipped_Performer_Last_Hour"))),f.innerText=u.R.tokensInPastDay(this.getTipHeaderValue(e.getResponseHeader("X-Tipped_Performer_Last_24_Hours"))),y.innerText=u.R.tokensInPastTwoWeeks(this.getTipHeaderValue(e.getResponseHeader("X-Tipped_Performer_Last_Two_Weeks")))})).catch((e=>{error(e),(0,r.Q$)("Error fetching user menu")}))}addLinksData(){super.addLinksData();const e=this.createLink();e.style.display="none";const t=document.createElement("img");(0,d.ZM)(t,{padding:"0px 5px 0 2px",verticalAlign:"bottom"}),e.appendChild(t);const i=this.createLinkSpan();e.appendChild(i),h.X0.once((s=>{const r=o.p.getInstance();if(void 0!==r){const s=r.getContextMenuLinkInfo(this.user.username);""!==s.linkText&&(t.src=s.icon,i.textContent=s.linkText,(0,n.wu)("click",e,(()=>{s.action(),this.hideOverlay()})),e.style.display="")}})),e.dataset.testid="view-cam",this.menuLinks.prepend(e)}createChangeModStatusLink(e,t){const i=this.createLink(),s=this.createLinkSpan();let o,h,d;return s.style.paddingLeft="20px",i.dataset.testid="moderator-toggle",e?(s.innerText=u.R.removeModeratorStatus,o=u.R.removeModeratorLoginError,h=`removemoderator/${t.username}/${this.roomName}/`,d=u.R.moderatorRevokeError(t.username)):(s.innerText=u.R.promoteToModerator,o=u.R.promoteModeratorLoginError,h=`addmoderator/${t.username}/${this.roomName}/`,d=u.R.moderatorPromoteError(t.username)),s.title=s.innerText,(0,n.wu)("click",i,(()=>{this.hideOverlay(),(0,l.rC)(o)||(0,a.KF)(h,{}).then((()=>{p.xw.fire({isMod:!e,username:t.username})})).catch((e=>{error(e),(0,r.Q$)(d)}))})),i.appendChild(s),i}getTipHeaderValue(e){if(null===e)return 0;const t=Number(e);return t<0?0:t}}var v=i(1134),f=i(2709),y=i(8785);class b extends f.u{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(super(),this.user=e,(0,s.fZ)(this.element,(0,y.Kb)(e)),this.element.style.height="auto",this.element.style.width="auto",this.element.style.position="",this.element.style.display="inline-block",this.element.style.maxWidth="100%",this.element.style.textOverflow="ellipsis",this.element.style.whiteSpace="nowrap",this.element.style.fontWeight="bold",this.element.style.cursor="pointer",this.element.style.overflow="visible",this.element.dataset.testid="username-label",this.badgeSpan=v.T.createBadges(e.username),this.element.appendChild(this.badgeSpan),this.usernameText=document.createElement("span"),this.usernameText.dataset.testid="username",this.usernameText.textContent=e.username,this.usernameText.title=u.R.usernameText,this.element.appendChild(this.usernameText),i){const t=document.createElement("img");t.style.display="inline-block",t.style.height="16px",t.style.margin="0 5px",t.style.verticalAlign="middle",t.src=(0,y.e0)(e.gender),t.title=u.R.genderSymbolToIconTitle(e.gender),t.dataset.testid="gender-icon",this.element.insertBefore(t,this.element.firstChild),this.element.style.whiteSpace="nowrap"}this.element.onmouseenter=()=>{this.element.style.textDecoration="underline"},this.element.onmouseleave=()=>{this.element.style.textDecoration="none"};const o=i=>{i.preventDefault(),null!==this.element.parentElement?((0,c.bT)("OpenUserContextMenu",{username:e.username}),b.createUserContextMenu(e,this.usernameText,t)):error("Username span has no parent")};(0,n.wu)("click",this.element,o),(0,n.wu)("contextmenu",this.element,o)}static createUserContextMenu(e,t,i){2===m.qH.state&&((0,y.b5)()?new g(e,t,i):new m.qH(e,t,i))}createMentionLabel(e){return this.usernameText.textContent=`@${this.user.username}`,this.badgeSpan.style.display="none",e&&((0,s.fZ)(this.element,"mentionHl"),this.element.style.padding="2px 4px",this.element.style.borderRadius="4px"),this.element}}},3860:(e,t,i)=>{"use strict";i.d(t,{L:()=>p});var s=i(7623),n=i(8861),o=i(6844),r=i(1516),a=i(8423),l=i(3737),h=i(1779),d=i(7407);const c="AflThtrMd5",u=new l.a(c),p=new class{constructor(){this.storageKey="isTheaterMode",this.changeVideoMode=new a.c_("changeVideoMode",{listenersWarningThreshold:()=>20+a.hI}),this.hasFiredAflThtrMdEvents=!1;const e=this.getInitialVideoMode(),t="split"===e?"theater":"split";this.videoMode=e,this.lastVideoMode=t,this.lastNonFullscreenVideoMode=t,this.saveVideoModeStorage(),this.listenForFullscreen(),(0,d.NP)(this.videoMode),r.s.listen((e=>{this.isMobile="mobile"===e,this.isMobile&&((0,h.aS)()?(0,d.NP)("landscapeFullscreen"):(0,d.NP)("portraitClassic"))}))}listenForFullscreen(){h._c.listen((()=>{if((0,h.aS)()){var e;if("chat-player"!==(null===(e=(0,h.Gy)())||void 0===e?void 0:e.id))return;window.setTimeout((()=>{"fullscreen"!==this.videoMode&&p.setFireVideoMode("noninteractive-fullscreen")}),0)}else p.setFireVideoMode(this.lastNonFullscreenVideoMode)}))}setVideoModeInternal(e){return!!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]||e!==this.videoMode)&&(-1===["noninteractive-fullscreen","fullscreen","fullvideo"].indexOf(this.videoMode)&&(this.lastNonFullscreenVideoMode=this.videoMode),this.lastVideoMode=this.videoMode,this.videoMode=e,"noninteractive-fullscreen"===this.videoMode&&this.isMobile?(0,d.NP)("landscapeFullscreen"):(0,d.NP)(this.videoMode),this.saveVideoModeStorage(),!0)}setVideoMode(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.setVideoModeInternal(e,t)}setFireVideoMode(e,t){var i,s;(this.setVideoModeInternal(e,null!==(i=null==t?void 0:t.update)&&void 0!==i&&i)||null!==(s=null==t?void 0:t.fire)&&void 0!==s&&s)&&this.changeVideoMode.fire({currentMode:this.videoMode,previousMode:this.lastVideoMode})}saveVideoModeStorage(){["split","theater"].includes(this.videoMode)&&(0,s.Pf)()&&window.localStorage.setItem(this.storageKey,JSON.stringify({isTheaterMode:"theater"===this.videoMode}))}getInitialVideoMode(){let e=u.active?"theater":"split";if((0,s.Pf)()){const t=window.localStorage.getItem(this.storageKey);if(null!==t){const i=JSON.parse(t).isTheaterMode;e=Boolean(i)?"theater":"split"}}return e}getVideoMode(){return this.videoMode}getPreviousNonFullscreenVideoMode(){return this.lastNonFullscreenVideoMode}fireAfflThtrMdEvents(){if(this.hasFiredAflThtrMdEvents)return void error("refiring AfflThtrMd events");this.hasFiredAflThtrMdEvents=!0;const e=window.location.toString().includes("fullvideo")?"fullvideo":"non-fullvideo",t=`${c}_in`,i=void 0!==(0,n.oD)(t);if(u.eligible)if(i){(0,n.Yj)(t),(0,d.bT)("AfflThtrMd",{group:u.active?"active":"inactive",page:e});const i=!u.active&&"fullvideo"===this.videoMode,s=u.active&&"theater"===this.videoMode;(i||s)&&u.record()}else(0,d.bT)("AfflThtrMd_mystery",{group:u.active?"active":"inactive",page:e});else window.location.search.includes("gLDS")&&window.location.search.includes("gQZJO")&&(0,d.bT)("AfflThtrMd_missing",{page:e,is_anon:(0,o.ok)(),came_from_in:i}),i&&(0,d.bT)("AfflThtrMd_odd_cookie",{page:e,is_anon:(0,o.ok)()})}}},5389:(e,t,i)=>{"use strict";i.d(t,{GZ:()=>w,Iw:()=>S,NL:()=>u,T8:()=>p,aH:()=>h,fp:()=>d,g$:()=>v,gA:()=>b,gr:()=>l,rR:()=>c});var s,n=i(6784),o=i(5216),r=i(8423),a=i(1779);function l(e,t,i,s){h(e,t,i)}function h(e,t,i,s){return new Promise((s=>{var n;(0,a.aS)()?((0,a.Eh)(),window.setTimeout((()=>{const n=window.open((0,o._Y)(e),t,i);null!==n&&window.setTimeout((()=>{n.focus()}),200),s(null!=n?n:void 0)}),a.CK)):s(null!==(n=window.open((0,o._Y)(e),t,i))&&void 0!==n?n:void 0)}))}const d="status=0,toolbar=1,menubar=0,directories=0,resizable=1,scrollbars=1,height=768,width=850,top=50,left=50",c="status=0,toolbar=0,menubar=0,directories=0,resizable=1,scrollbars=1,height=768,width=850",u="status=0,toolbar=0,menubar=0,directories=0,resizable=1,scrollbars=1,height=700,width=715";function p(e){window.onbeforeunload=function(){};const t=window.location.href.split("?");!0===e&&t.length>1?window.location.href=(0,o._Y)(t[0]):window.location.reload()}let m="",g="";"hidden"in document?(m="hidden",g="visibilitychange"):"msHidden"in document?(m="msHidden",g="msvisibilitychange"):"webkitHidden"in document&&(m="webkitHidden",g="webkitvisibilitychange");const v=new r.c_("documentVisibilityChange",{maxHistorySize:1});let f=""===m||!(null!==(s=document[m])&&void 0!==s&&s);const y=e=>{f!==e&&(f=e,v.fire(f))};if(""!==m&&""!==g){const e=()=>{y(!document[m])};(0,n.wu)(g,document,e);const t=()=>{(0,n.Pf)(g,document,e),(0,n.Pf)("pagehide",window,t),y(!1),(0,n.wu)("pagehide",window,(()=>{y(!1)})),(0,n.wu)("pageshow",window,(()=>{y(!0)}))};(0,n.wu)("pagehide",window,t)}else(0,n.wu)("blur",window,(()=>{y(!1)})),(0,n.wu)("focus",window,(()=>{y(!0)}));function b(){return f}function w(){try{return window.self!==window.top}catch(e){return!0}}const C=(new Date).getTime();function S(){return((new Date).getTime()-C)/1e3}},9394:(e,t,i)=>{"use strict";i.d(t,{y:()=>ut,h:()=>ct});var s=i(352),n=i(3452),o=i(4476),r=i(4582),a=i(7623),l=i(8861),h=i(6262),d=i(20),c=i(1474),u=i(6784),p=i(2709),m=i(9060),g=i(7882),v=i(3004),f=i(369),y=i(6615),b=i(5216),w=i(82);class C extends w.b{constructor(e){super(e),e.gender!==g.YT.All?this.url=new URL("../",this.element.href):this.url=new URL(this.element.href)}createElement(e){return e.anchorElement}updateState(){super.updateState();let e=this.url.searchParams.toString();e=""===e?"":`?${e}`;const t=this.url.pathname===(0,b._Y)("/")?(0,g.tg)(this.state.gender):g.hf.get(this.state.gender),i=""===t?"":`${t}/`;this.element.href=(0,b._Y)(`${this.url.pathname}${i}${e}`)}}var S=i(9118),x=i(9930);class T extends p.u{constructor(e){super(e),this.genderedLinks=[];const t=e.querySelector(".nav");null!==t&&t instanceof HTMLElement&&(0,f.Rk)(t,500,800,[{name:"padding-left",min:10,max:65},{name:"padding-right",min:10,max:65}]);const i=document.querySelector(".footer-holder .footer-cb-address");null!==i&&i instanceof HTMLElement&&(0,f.Rk)(i,500,589,[{name:"margin-left",min:-55,max:0}],(e=>{0===e&&(i.style.marginLeft="")})),e.querySelectorAll(".footercon a").forEach((e=>{(0,u.wu)("click",e,(e=>{x.XS.fire(e)}))})),e.querySelectorAll("div[gendered-category] a").forEach((e=>{this.genderedLinks.push(new C({anchorElement:e,gender:(0,g.Bg)()}))})),(0,m.rT)()?y.T.current.listen(["genders"],(e=>{var t,i;const s=null!==(t=(null!==(i=e.genders)&&void 0!==i?i:[])[0])&&void 0!==t?t:"";this.genderedLinks.forEach((e=>{e.setState({gender:s})})),A()}),this.element):x.wd.addListener((e=>{this.genderedLinks.forEach((t=>{t.setState({gender:e})})),A()}),this.element),S.d.pageNumberChanged.listen(A)}}function A(){document.querySelectorAll("#footer-holder form").forEach((e=>{(0,v.De)(e)}))}var P=i(3955),k=i(8936),M=i(7407),R=i(9461),I=i(1224),E=i(4873);class L extends p.u{constructor(e){super(e),this.makeLogoResponsive(),this.addHeaderAdPageAction(),this.addMerchLinkPageAction(),this.makeTopNavResponsive(),this.makeUserInfoResponsive(),this.bindLinkUpdateHandling()}makeTopNavResponsive(){this.genderedLinks=[],this.initFirstTopSectionAnchor();const e=document.querySelector(".nav-bar");null!==e&&(0,f.Rk)(e,500,600,[{name:"padding-left",min:4,max:15}]);const t=document.getElementById("nav");if(null!==t){this.nav=new p.u(t);const e=(0,g.Bg)();Array.from(t.children).forEach((t=>{if(t instanceof HTMLLIElement){const i=new E.g2(t);this.nav.attachChild(i),i.element.style.display="block";const s=i.element.getElementsByTagName("a")[0];if(null!==s&&s instanceof HTMLAnchorElement){const t=getComputedStyle(s);s.style.color=t.color,s.style.font=t.font,s.style.fontFamily=t.fontFamily,s.style.fontWeight=t.fontWeight,s.style.fontSize=t.fontSize,s.hasAttribute("gendered-link")&&this.genderedLinks.push(new C({anchorElement:s,gender:e}))}s.onfocus=()=>{this.focusIntoDropdown(i)},s.onblur=e=>{this.blurOutOfDropdown(e)},i.onCollapseEvent.listen((e=>{i.element.style.padding=e?"8px 4px":""}))}}));const i=new E.Dw("li",!0);this.nav.addChild(i),(0,P._W)(i.element),(0,P.ZM)(i,{border:"1px solid transparent",borderRadius:"4px 4px 0 0",height:"30px",top:"6px",width:"39px",paddingTop:"3px",color:I.m.navigationFontColor}),i.dropDown.toggleEvent.listen((e=>{e.isShowing?i.element.style.border=`1px solid ${I.m.tabBorderColor}`:i.element.style.border="1px solid transparent"})),(0,P.ZM)(i.dropDown,{borderColor:`${I.m.tabBorderColor}`,padding:"8px 20px 8px 8px"}),i.dropDown.element.classList.add("header-dropdown"),this._headerCollapseDropDownTab=i,this.setCollapsibleDropdownSpacerWidth()}}focusIntoDropdown(e){(0,E.Dy)(e)&&(this._headerCollapseDropDownTab.dropDown.showElement(),this.setTabIndexForDropdown(200),window.setTimeout((()=>{e.element.getElementsByTagName("a")[0].focus()}),0))}blurOutOfDropdown(e){const t=e.target,i=e.relatedTarget;e.preventDefault(),t instanceof HTMLAnchorElement&&this._headerCollapseDropDownTab.isTargetOverflownAnchor(t)&&(i instanceof HTMLElement&&!this._headerCollapseDropDownTab.isTargetOverflownAnchor(i)||null===i)&&(this.setTabIndexForDropdown(0,!0),this._headerCollapseDropDownTab.dropDown.hideElement())}setTabIndexForDropdown(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this._headerCollapseDropDownTab.lastShownSibling();void 0!==i&&(i.element.getElementsByTagName("a")[0].tabIndex=t?0:e);for(const i of this._headerCollapseDropDownTab.dropDown.element.getElementsByTagName("a"))i.tabIndex=t?0:e+1;null!==this.firstTopSectionAnchor&&void 0!==this.firstTopSectionAnchor&&(this.firstTopSectionAnchor.tabIndex=t?0:e+2)}initFirstTopSectionAnchor(){const e=document.querySelector(".top-section");null!==e&&(this.firstTopSectionAnchor=e.getElementsByTagName("a")[0],void 0===this.firstTopSectionAnchor&&(this.firstTopSectionAnchor=e.getElementsByTagName("li")[0]))}setCollapsibleDropdownSpacerWidth(){if(void 0!==this.nav&&null!==this.nav.element.parentElement){let e=0;for(const t of this.nav.element.parentElement.children)t!==this.nav.element&&t instanceof HTMLElement&&(e+=t.offsetWidth);this._headerCollapseDropDownTab.setSpacerWidth(e)}}addHeaderAdPageAction(){const e=document.querySelector("#header .ad a");null!==e&&(e.dataset.testid="header-ad-anchor",e.onclick=()=>{var t;(0,M.bT)("BannerAdClicked",{content:"real_ads",ad_title:null!==(t=e.getAttribute("data-feature-show-title"))&&void 0!==t?t:void 0,location:R.Bm.current.pageLocation})})}addMerchLinkPageAction(){const e=document.querySelector("#merch");null!==e&&(e.onclick=()=>{(0,M.bT)("MerchLinkClicked")})}makeLogoResponsive(){const e=document.querySelector(".logo-zone");if(null!==e&&e instanceof HTMLElement){e.dataset.testid="header-logo";const t=document.querySelector(".logo-zone svg"),i=document.querySelector(".logo-zone strong:last-child");(0,f.Rk)(e,500,600,[{name:"padding-left",min:8,max:15},{name:"padding-top",min:12,max:6}]),null!==t&&t instanceof HTMLElement&&(0,f.Rk)(t,500,600,[{name:"width",min:145,max:198},{name:"height",min:45,max:61}]),null!==i&&i instanceof HTMLElement&&(i.dataset.testid="header-slogan-text",(0,f.Rk)(i,500,600,[{name:"font-size",min:8,max:10},{name:"padding-left",min:13,max:17}]));const s=document.querySelector(".logo-zone .logo");if(null!==s&&s instanceof HTMLElement){const e=s.clientWidth;e>500-(0,P.XJ)()&&f.oO.listen((()=>{e+s.offsetLeft>(0,k.DK)()?s.style.maxWidth=(0,k.DK)()-s.offsetLeft-1+"px":s.style.maxWidth=""}))}}}makeUserInfoResponsive(){const e=document.querySelector("#user_information");null!==e&&e instanceof HTMLElement&&(0,f.Rk)(e,500,600,[{name:"margin-right",min:4,max:15}])}bindLinkUpdateHandling(){(0,m.rT)()?y.T.current.listen(["genders"],(e=>{var t,i;const s=null!==(t=(null!==(i=e.genders)&&void 0!==i?i:[])[0])&&void 0!==t?t:"";this.genderedLinks.forEach((e=>{e.setState({gender:s})}))}),this.element):x.wd.addListener((e=>{this.genderedLinks.forEach((t=>{t.setState({gender:e})}))}),this.element)}}var D=i(3910),B=i(5411),U=i(1280),F=i(213),_=i(6844),N=i(6144),O=i(6716),H=i(4364),W=i(4564),$=i(6064),V=i(2146),z=i(4947),G=i(1372),q=i(6471),j=i(3417),Z=i(2120),K=i(1585),J=i(1885),Y=i(4035),Q=i(1519),X=i(106),ee=i(4580);class te extends p.u{constructor(e){super("div",e),(0,j.vu)()}initData(e){this.myUsername=e.myUsername,this.allDmWindowsMap=new Map,this.orderedDmSessionKeys=new X.J,this.isTouchingScreen=!1,this.onShow=e.onShow,this.onHide=e.onHide}initUI(e){this.element=(0,G.tT)("div",{style:{width:"320px",height:"calc(var(--vh, 1vh) * 100)",position:"absolute",top:0,bottom:0,left:0,backgroundColor:"#FFF",color:"#000",boxSizing:"border-box",display:"flex",flexDirection:"column"}},(0,G.tT)(se,{onClick:()=>{this.handleBackButtonClick()}})),(0,V.Ve)(this.element,"transform 150ms ease"),this.bindMenuChangeEvents(),this.bindListeners(),this.bindWindowListeners(),this.initVirtualKeyboardHandling(),this.hideElement()}showElement(){(0,P.ZM)(this.element,{transform:"translateX(0)"}),this.onShow()}hideElement(){(0,P.ZM)(this.element,{transform:"translateX(-100%)"}),this.onHide();const e=this.orderedDmSessionKeys.currentElem;void 0!==e&&this.hideWindow(e)}bindListeners(){D.$o.listen((e=>{this.showElement(),void 0===this.allDmWindowsMap.get(e)&&this.createWindow(e),this.showWindow(e)})),D.x7.listen((e=>{let{username:t,deleteWindow:i}=e;const s=this.getCurrentOpenWindow();(null==s?void 0:s.username)===t&&this.removeShownWindow(),!0===i&&this.allDmWindowsMap.delete(t)})),J.H4.listen((e=>{const t=this.allDmWindowsMap.get(e.otherUsername);void 0!==t&&t.handleNewMessage(e)})),(0,K.L)((e=>this.allDmWindowsMap.get(e)))}createWindow(e){if(!this.allDmWindowsMap.has(e)){const t=new Z.wV({username:e,myUsername:this.myUsername,open:!0,markAsRead:!0,raiseWindowZIndexToTop:()=>{}});this.allDmWindowsMap.set(e,t),this.orderedDmSessionKeys.addToTop(e),this.addChild(t)}}removeShownWindow(){const e=this.getCurrentOpenWindow();void 0!==e&&(e.removeFromDOM(),this.orderedDmSessionKeys.remove(e.username),this.handleBackButtonClick())}showWindow(e){const t=this.orderedDmSessionKeys.currentElem;void 0!==t&&this.hideWindow(t);const i=this.allDmWindowsMap.get(e);void 0!==i&&(this.orderedDmSessionKeys.makeCurrent(e),i.openOrCollapseWindow(!0))}getCurrentOpenWindow(){var e;const t=this.allDmWindowsMap.get(null!==(e=this.orderedDmSessionKeys.currentElem)&&void 0!==e?e:"");return!0===(null==t?void 0:t.isWindowOpen())?t:void 0}hideWindow(e){const t=this.allDmWindowsMap.get(e);void 0!==t&&t.openOrCollapseWindow(!1)}handleBackButtonClick(){this.hideElement()}bindMenuChangeEvents(){ee.nD.listen((e=>{e||this.hideElement()}))}blurInputIfFocused(){const e=this.getCurrentOpenWindow();!0===(null==e?void 0:e.isInputFocused())&&document.activeElement instanceof HTMLElement&&document.activeElement.blur()}bindWindowListeners(){var e;let t=window.innerWidth;const i=()=>{const e=this.getCurrentOpenWindow();window.innerWidth!==t&&(null==e||e.scrollToBottom(),t=window.innerWidth,window.setTimeout((()=>{null==e||e.scrollToBottom()}),300),this.blurInputIfFocused())};(0,u.wu)("resize",window,(()=>{if((0,a.OF)())(0,a.nr)()?i():window.setTimeout(i,125);else{const e=this.getCurrentOpenWindow();null==e||e.resizeTipCallout()}})),(0,u.wu)("touchstart",window,(()=>{this.isTouchingScreen=!0})),(0,u.wu)("touchend",window,(()=>{this.isTouchingScreen=!1})),null===(e=window.visualViewport)||void 0===e||e.addEventListener("scroll",(()=>{this.isTouchingScreen&&this.blurInputIfFocused()}))}initVirtualKeyboardHandling(){const e=new Q.a((()=>{var e;this.element.style.top=`${null===(e=window.visualViewport)||void 0===e?void 0:e.offsetTop}px`;const t=window.setInterval((()=>{var e;this.element.style.top=`${null===(e=window.visualViewport)||void 0===e?void 0:e.offsetTop}px`}),100);window.setTimeout((()=>{window.clearInterval(t)}),1e3)}),{bounceLimitMS:1e3,debounceType:2});Y.I.listen((()=>{e.callFunc()})),(0,u.wu)("scroll",document,(()=>{e.callFunc()}))}}class ie extends p.u{constructor(e){super("div",e)}initData(e){this.dmListIconRoot=e.dmListIconRoot,this.userUpdatesBellRoot=e.userUpdatesBellRoot,this.hamburgerIcon=e.hamburgerIcon}initUI(e){var t;const i={width:"320px",position:"fixed",top:0,bottom:0,left:0,backgroundColor:"#FFF",color:"#000",boxSizing:"border-box",display:"flex",flexDirection:"column"},s={width:"320px",display:"none",position:"fixed",top:0,bottom:0,left:0,backgroundColor:"#FFF"},n=null===(t=R.Bm.current.loggedInUser)||void 0===t?void 0:t.username;if(void 0!==n){const e=new W.I({isFullVideoMode:!1,room:""});this.dmList=new q.E({onItemRemoved:()=>{},openConversationEvent:D.$o,isDropdown:!0,searchBar:e}),this.contentMask=(0,G.tT)("div",{style:s});const t=new te({myUsername:n,onShow:()=>this.toggleMaskingContent(!0),onHide:()=>this.toggleMaskingContent(!1)});this.element=(0,G.tT)("div",{style:i},(0,G.tT)(se,{onClick:()=>{this.handleBackButtonClick()}}),e.element,this.dmList.element,this.contentMask,t.element)}else{const e={height:"45px",display:"flex",alignItems:"center",paddingLeft:"10px",borderBottom:"1px solid #EFEFEF"},t={display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",flex:1},s={color:"#0a5a83",textDecoration:"none"},n=()=>{-1!==`${window.location.pathname}${window.location.search}`.indexOf(v.ii)||(0,$.DC)({fromFeature:!0});const e=document.querySelector(".push-overlay");this.hideElement(),e instanceof HTMLElement&&e.click()};this.element=(0,G.tT)("div",{style:i},(0,G.tT)("div",{style:e},z.R.directMessageLabel),(0,G.tT)("div",{style:t},(0,G.tT)("img",{style:{display:"inline-block",width:"50px",height:"50px"},src:`${STATIC_URL}pms/empty-chat-state.svg`}),(0,G.tT)("span",{style:{margin:"25px 0",display:"inline-block"}},z.R.sendDirectMessage),(0,G.tT)("span",{style:{...s,marginBottom:"50px"},onClick:n},z.R.loginVerbText),(0,G.tT)("span",null,z.R.dontHaveAccount," ",(0,G.tT)("a",{href:v.k6,style:s,"account-redirect":!0},z.R.signUpText))))}(0,V.Ve)(this.element,"transform 150ms ease"),this.bindIconClickEvent(),this.bindMenuChangeEvents(),this.bindNumUnreadEvents(),this.bindResizeEvents(),this.hideElement()}handleBackButtonClick(){this.hideElement()}showElement(){(0,P.ZM)(this.element,{transform:"translateX(0)"}),this.dmListIconRoot.classList.add("active")}hideElement(){(0,P.ZM)(this.element,{transform:"translateX(-100%)"}),this.dmListIconRoot.classList.remove("active")}toggleMaskingContent(e){this.contentMask.style.display=e?"block":"none"}isShown(){return"translateX(-100%)"!==this.element.style.transform}bindIconClickEvent(){this.dmListIconRoot.onclick=()=>{this.isShown()||this.showElement()}}bindMenuChangeEvents(){ee.bW.listen((e=>{e&&!this.isShown()?this.showElement():!e&&this.isShown()&&this.hideElement()})),ee.nD.listen((e=>{e||this.hideElement()}))}bindNumUnreadEvents(){H.yT.unreadConversationsCountUpdate.listen((()=>{var e,t,i,s,n;void 0!==this.dmList&&((null===(e=this.dmList)||void 0===e?void 0:e.getNumUnread())>0?(this.dmListIconRoot.classList.add("has_unread"),null===(t=this.hamburgerIcon)||void 0===t||t.classList.add("has_unseen")):(this.dmListIconRoot.classList.remove("has_unread"),null!==(i=null===(s=this.userUpdatesBellRoot)||void 0===s?void 0:s.classList.contains("has_unseen"))&&void 0!==i&&i||null===(n=this.hamburgerIcon)||void 0===n||n.classList.remove("has_unseen")))}))}bindResizeEvents(){(0,a.OF)()||(0,u.wu)("resize",window,(()=>{const e=(0,k.mJ)();this.element.style.top=e<250?"":"0"}))}}const se=e=>(0,G.tT)("span",{style:{height:"45px",display:"flex",alignItems:"center",paddingLeft:"10px",color:"#306A91",borderBottom:"1px solid #EFEFEF"},onClick:e.onClick,"data-testid":"back-button"},z.R.back);var ne=i(9818),oe=i(5389),re=i(9447),ae=i(5412),le=i(1728),he=i(637);class de extends N.v{constructor(e){super(e.toggleElement,!0,e),this.convosOpenedWithoutClosingDropdown=0,(0,u.wu)("keydown",document,(e=>{var t;if(!this.isShown())return;const i=this.dmList.element.contains(document.activeElement),s=!0===(null===(t=D.qt.getInstance())||void 0===t?void 0:t.element.contains(document.activeElement));var n;"Tab"===e.key?(i||!this.element.contains(document.activeElement)?null===(n=this.popoutLink)||void 0===n||n.focus():this.dmList.focusSearchBar(),e.stopPropagation(),e.preventDefault()):"Escape"===e.key?this.hideElement():i||s||!["ArrowUp","ArrowDown"].includes(e.key)&&!(0,ae.x)(e.keyCode)||this.dmList.focusSearchBar()})),he.D.showingEvent.listen((()=>this.hideElement())),D.$o.listen((()=>{this.isShown()&&(this.convosOpenedWithoutClosingDropdown+=1,(0,M.bT)("OpenedDmFromDropdown",{seq_convos_opened:this.convosOpenedWithoutClosingDropdown}))})),H.yT.unreadConversationsCountUpdate.listen((e=>{let{dmsCount:t}=e;this.updateNumUnread(t)}))}initUI(e){const t=(0,_.ok)(),i={fontFamily:"UbuntuRegular, Tahoma, Arial, Helvetica, sans-serif",fontSize:"14px",borderWidth:"1px",borderStyle:"solid",borderRadius:"4px 0 4px 4px",boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.32)",height:t?"":"383px",maxHeight:`calc(var(--vh, 1vh) * 100 - ${Z.sG.expandedHeight} - 44px)`,minHeight:"280px",padding:"1px",position:"absolute",right:"0",width:"304px",display:"none",flexDirection:"column"};this.dmList=new le.U({isDms:!0,clearSearchOnSelect:(0,a.Xb)(),isFullVideoMode:!1,openConversationEvent:D.$o}),this.element=(0,G.tT)("div",{style:i,colorClass:"dmListDropdownRoot","data-testid":"dm-list-dropdown"},(0,G.tT)("div",{style:{padding:"10px 8px",borderBottomWidth:"1px",borderBottomStyle:"solid"},colorClass:"header"},(0,G.tT)("span",null,z.R.directMessageLabel),(0,G.tT)("span",{style:{marginLeft:"4px"},ref:e=>this.numUnreadContainer=e}),!t&&(0,G.tT)("button",{style:{display:"inline-block",position:"absolute",right:"8px",top:"12px",height:"13px",width:"13px",border:"none",cursor:"pointer"},title:z.R.popoutInNewWindow,colorClass:"popoutIcon","data-testid":"popout-dm-icon",ref:e=>this.popoutLink=e,onClick:()=>{this.hideElement();const e=this.dmList.getLastConversation();var t;void 0===e||""!==e.message||e.hasMedia?he.D.show():he.D.show(null==e||null===(t=e.otherUser)||void 0===t?void 0:t.username)}})),t?(0,G.tT)(ce,null):this.dmList.element)}showElement(){return(0,re.fZ)(this.toggleElement,"active"),this.convosOpenedWithoutClosingDropdown=0,super.showElement("flex")}hideElement(e){var t;if(!(0,a.Xb)()&&(null==e?void 0:e.target)instanceof HTMLElement&&(!0===(null===(t=D.qt.getInstance())||void 0===t?void 0:t.element.contains(e.target))||!document.body.contains(e.target)))return!1;const i=super.hideElement(e);return i&&(0,re.SA)(this.toggleElement,"active"),i}updateNumUnread(e){const t=e>0;this.numUnreadContainer.innerText=t?`(${e})`:"",t?this.toggleElement.classList.add("has_unread"):this.toggleElement.classList.remove("has_unread")}}const ce=()=>{const e={cursor:"pointer",fontSize:"12px"},t=`${STATIC_URL}pms/empty-chat-state.svg`;return(0,G.tT)("div",{style:{fontSize:"12px",marginTop:"0",padding:"44px 0 16px",position:"static",textAlign:"center",top:"50%",width:"100%"}},(0,G.tT)("img",{src:t,alt:"empty-chat-state"}),(0,G.tT)("div",{style:{fontSize:"14px",lineHeight:"18px",margin:"8px 0"},colorClass:"sendDmPrompt"},z.R.sendDirectMessage),(0,G.tT)("div",{style:{margin:"16px 0 44px"}},(0,G.tT)("a",{style:e,colorClass:"link",onClick:e=>{e.preventDefault(),(0,$.DC)({fromFeature:!0})},"account-redirect":!0},z.R.loginVerbText)),(0,G.tT)("div",{colorClass:"signupPrompt"},z.R.dontHaveAccount," ",(0,G.tT)("a",{href:v.k6,style:e,colorClass:"link",onClick:()=>{(0,M.bT)("PMSignupClicked")},"account-redirect":!0},z.R.signUpLower)))};var ue,pe=i(2331),me=i(8423);class ge{}(ue=ge).dropDownToggle=new me.c_("dropDownToggle"),ue.updatesAreRead=new me.c_("updatesAreRead"),ue.updatesAreUnread=new me.c_("updatesAreUnread"),ue.tabItemsLoaded=new me.c_("tabItemsLoaded");var ve=i(897),fe=i(7063);class ye{static getUserUpdates(e,t){if("/security/tfa/auth/"===window.location.pathname||"/security/tfa/auth/choose_device/"===window.location.pathname)return;const i=e.map((e=>`notification_type=${e}`)).join("&");(0,b.Aw)(`notifications/updates/?${i}`).then((e=>{const i=new fe.N6(e.responseText).getList("items");if(void 0!==i){const e=i.map((e=>({text:e.getString("text"),url:e.getString("url"),timestamp:e.getNumber("timestamp"),timeSince:e.getString("time_since"),seen:e.getBoolean("seen"),notificationType:e.getString("notification_type")})));t(e)}})).catch((()=>{}))}static recordLastSeen(e,t,i){(0,b.KF)(e,{timestamp:t.toString()}).then((()=>{i()})).catch((()=>{}))}static hasUnseen(e){(0,b.Aw)("notifications/has_unseen/").then((t=>{const i=JSON.parse(t.responseText);e(i.has_unseen)})).catch((()=>{}))}}var be=i(9586);class we extends p.u{constructor(){super(),this.element.style.overflow="",this.element.style.position="static",this.element.style.overflowX="hidden",this.element.style.overflowY="auto",this.enableMomentumScrollingForIPad()}enableMomentumScrollingForIPad(){if(/iPad|iPhone|iPod/.test(navigator.platform)){this.element.style["-webkit-overflow-scrolling"]="touch";const e=()=>{this.element.style.overflowY="scroll",(0,u.Pf)("scroll",this.element,e)};(0,u.wu)("scroll",this.element,e)}}}class Ce extends p.u{constructor(e){super(),(0,re.fZ)(this.element,"twitterUpdateRow"),this.element.style.fontFamily="UbuntuRegular, Helvetica, Arial, sans-serif",this.element.style.fontStyle="normal",this.element.style.fontWeight="normal",this.element.style.position="relative",this.element.style.height="",this.element.style.width="",this.element.style.margin="7px",this.element.style.padding="6px",this.setSeenColors(e.seen),this.element.style.borderWidth="1px",this.element.style.borderStyle="solid",this.element.style.borderRadius="4px",this.element.dataset.testid="notification-item",this.element.appendChild(this.createContentElement(e.text));const t="offline_tip"===e.notificationType&&R.Bm.current.isMobile;if(""!==e.timeSince){const t=function(e){const t=document.createElement("div");return(0,re.fZ)(t,"timeSince"),t.appendChild(document.createTextNode(e)),t.style.fontSize="9px",t.style.lineHeight="13px",t.style.cssFloat="left",t.dataset.testid="notification-time-since",t}(e.timeSince);this.element.appendChild(t)}if(""!==e.url&&!t){let t="twitter_feed";void 0!==e.notificationType&&(t=e.notificationType);const i=function(e,t){const i=document.createElement("a");i.href=(0,b._Y)(e),i.target="_blank";const s="twitter_feed"===t,n="offline_tip"===t,o=function(e){switch(e){case"twitter_feed":return z.R.viewOnTwitterText;case"offline_tip":return z.R.showTipsAndMessages}return z.R.seeMore}(t);return i.appendChild(document.createTextNode(o)),(0,re.fZ)(i,"twitterLink"),i.style.fontSize="9px",i.style.lineHeight="13px",i.style.textAlign="right",i.style.cssFloat="right",i.dataset.testid="notification-link",s?i.onclick=()=>{(0,M.bT)("NewsfeedItemViewOnTwitter")}:n&&(i.onclick=()=>{(0,M.bT)("OfflineTipItemLinkClick")}),i}(e.url,t);this.element.appendChild(i)}}setSeenColors(e){e?(0,re.fZ)(this.element,"seen"):(0,re.SA)(this.element,"seen")}createContentElement(e){const t=this.buildContentFromText(e);return(0,re.fZ)(t,"contentSection"),t.style.fontSize="12px",t.style.lineHeight="14px",t.style.whiteSpace="pre-wrap",t.style.marginBottom="6px",t.style.wordWrap=t.style.wordBreak="break-word",t.style.overflow="hidden",t.dataset.testid="notification-content",t}buildContentFromText(e){const t=document.createElement("div");return t.innerHTML=e,this.makeLinksShorterAndAddStyle(t),t}makeLinksShorterAndAddStyle(e){Array.from(e.querySelectorAll("a")).forEach((e=>{(0,re.fZ)(e,"tweetLink"),e.target="_blank",e.style.outline="none",e.style.fontSize="12px",e.style.lineHeight="14px",null!==e.firstChild&&e.firstChild instanceof Text&&null!==e.firstChild.textContent&&(e.firstChild.textContent=e.firstChild.textContent.replace(/^http(s)?:\/\//,"").replace(/^www\./,"")),e.onclick=()=>{(0,M.bT)("NewsfeedItemLinkClick")}}))}}class Se extends we{constructor(){super(),this.addChild(new Ce({text:`${z.R.loadingTextLower}...`,seen:!0,timestamp:0,timeSince:"",url:""}))}setUpdateItems(e){this.removeAllChildren(),0===e.length&&this.addChild(new Ce({text:`${z.R.noNewUpdates}`,seen:!0,timestamp:0,timeSince:"",url:""})),e.forEach((e=>{this.addChild(new Ce(e))}))}initUI(){this.element.style.maxHeight="307px",this.element.style["-webkit-transform"]="translateZ(0)"}}class xe extends Se{initUI(){super.initUI(),this.element.style.maxHeight="",(0,be.H)(this.element)}}class Te extends pe.ZZ{constructor(e){super(),this.numUnread=0,this.isLoaded=!1,this.isDropDownVisible=!1,this.items=[],this.markAllAsSeenTimeout=void 0,this.updateTabOpenTime=0,this.highestUnreadTs=0,this.tabTitle=z.R.updatesText,this.recordLastSeenUrl="notifications/record_last_seen/",this.notificationTypes=["twitter_feed","offline_tip"],this.openPageActionName="NewsfeedOpened",this.closePageActionName="NewsfeedClosed",this.contents=e?new xe:new Se,this.addChild(this.contents),ge.dropDownToggle.listen((e=>{this.isDropDownVisible=e,this.isShowing()||this.sendUpdatesClosedEvent()})),this.isAnonymous=void 0===R.Bm.current.loggedInUser,(0,u.wu)("beforeunload",window,(()=>this.sendUpdatesClosedEvent())),(0,u.wu)("unload",window,(()=>this.sendUpdatesClosedEvent()))}getNewsTopic(e){}getNewsSeenTopic(e){return new ve.HD(e)}getOfflineTipTopic(e){if(void 0!==e)return new ve.HJ(e)}getUpdateOfflineTipTopic(e){if(void 0!==e)return new ve.cu(e)}hasUnread(){return this.numUnread>0}recordLastSeenNotification(e,t){this.isAnonymous||ye.recordLastSeen(this.recordLastSeenUrl,e,(()=>{void 0!==t&&t()}))}sendUpdatesClosedEvent(){if(0!==this.updateTabOpenTime){const e={duration_seconds:((new Date).getTime()-this.updateTabOpenTime)/1e3};this.updateTabOpenTime=0,(0,M.bT)(this.closePageActionName,e)}}getTabHandleContent(){let e;return e=this.numUnread>99?`${this.tabTitle} (99+)`:this.numUnread>0?`${this.tabTitle} (${this.numUnread})`:this.tabTitle,[document.createTextNode(e)]}getTabId(){return"updates-tab"}showElement(){super.showElement(),this.repositionChildren()}setAsCurrentTab(){super.setAsCurrentTab(),(0,M.bT)(this.openPageActionName,{is_orange:this.hasUnread()}),this.updateTabOpenTime=(new Date).getTime(),this.loadFeed()}hideElement(){super.hideElement(),this.sendUpdatesClosedEvent()}isShowing(){return this.isDropDownVisible&&this.isCurrentTab()}get unreadItems(){return this.items.filter((e=>!e.seen))}loadFeed(){this.isLoaded?(this.contents.setUpdateItems(this.items),this.scheduleMarkAllAsSeen(),ge.tabItemsLoaded.fire()):ye.getUserUpdates(this.notificationTypes,(e=>{var t,i,s,n;this.items=e,this.contents.setUpdateItems(e);const o=this.unreadItems;this.numUnread=o.length,this.highestUnreadTs=0,o.length>0&&(this.highestUnreadTs=Math.max(...o.map((e=>e.timestamp)))),this.refreshTabs(),this.isLoaded=!0,ge.tabItemsLoaded.fire();const r=null===(t=R.Bm.current.loggedInUser)||void 0===t?void 0:t.userUid;void 0!==r&&this.getNewsSeenTopic(r).onMessage.listen((e=>{debug("news seen update",e),this.markAsSeen(e.timestamp),this.numUnread=this.unreadItems.length,ge.updatesAreRead.fire(),this.refreshTabs()})),null===(i=this.getNewsTopic(r))||void 0===i||i.onMessage.listen((e=>{debug("news item",e);let t=0;this.items.length>0&&(t=Math.max(...this.items.map((e=>e.timestamp)))),t{let t=0;this.items.length>0&&(t=Math.max(...this.items.map((e=>e.timestamp)))),t{const t=e.fromUsername;let i=0;if(this.items.length>0&&(i=Math.max(...this.items.map((e=>e.timestamp)))),i{t.timestamp<=e&&(t.seen=!0)}))}scheduleMarkAllAsSeen(){this.numUnread>0?(void 0!==this.markAllAsSeenTimeout&&clearTimeout(this.markAllAsSeenTimeout),this.isShowing()&&(this.markAsSeen(this.items[0].timestamp),this.markAllAsSeenTimeout=window.setTimeout((()=>{this.numUnread=0,this.highestUnreadTs=0,this.recordLastSeenNotification(this.items[0].timestamp,(()=>{ge.updatesAreRead.fire()}))}),500))):ge.updatesAreRead.fire()}}class Ae extends pe.Zz{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.isDropDownVisible=!1,this.tabsLoaded=0,this.element.id="UserUpdatesPanel",this.element.dataset.testid="user-updates-panel",(0,re.fZ)(this.element,"userUpdatesPanel"),this.tabHandlesRow.element.style.borderBottom="none",this.tabHandlesRow.element.style.padding="4px 0 0 6px",this.tabHandlesRow.element.style.marginBottom="4px",this.tabHandlesRow.element.style.boxSizing="border-box",this.window.style.position="static",this.tabHandleStyle={...this.tabHandleStyle,fontSize:"12px",padding:"5px 10px"},this.updatesTabs=[new Te(t)],this.updatesTabs.forEach((e=>{this.addTab(e)})),ge.dropDownToggle.listen((e=>{e?(this.tabsLoaded=0,this.updatesTabs.forEach((e=>e.loadFeed())),this.tabsLoaded===this.updatesTabs.length&&this.switchToMostRecentUnreadTab()):this.currentTab=void 0})),ge.tabItemsLoaded.listen((()=>{this.tabsLoaded+=1})),this.addFeedbackLink(),this.dropDownComponent=this.createDropDownComponent(e)}createDropDownComponent(e){return new Re(this,e)}initAdditionalToggleElement(e){ge.updatesAreUnread.listen((()=>{this.anyUpdatesTabUnread()&&(null==e||e.classList.add("has_unseen"))})),ge.updatesAreRead.listen((()=>{var t,i;this.anyUpdatesTabUnread()||(null!==(t=null===(i=document.querySelector("#dmListIconRoot"))||void 0===i?void 0:i.classList.contains("has_unread"))&&void 0!==t&&t||(e.className=e.className.replace("has_unseen","")))}))}switchToMostRecentUnreadTab(){this.changeToTab(this.updatesTabs.reduce(((e,t)=>t.highestUnreadTs>e.highestUnreadTs?t:e)))}anyUpdatesTabUnread(){return this.updatesTabs.some((e=>e.hasUnread()))}addFeedbackLink(){this.addFooter(ke(!1))}repositionChildren(){}initUI(){this.element.style.overflow="",this.element.style.position="static",this.element.style.borderWidth="1px",this.element.style.borderStyle="solid",this.element.style.borderTop="none",this.element.style.borderRadius="0 0 4px 4px"}}class Pe extends Ae{constructor(e){super(e,!0);for(let e=1;e{B.E.fire({source:"site_updates"})}),t}function Me(e,t,i){i.listen((i=>{e.isDropDownVisible!==i.isShowing&&(e.isDropDownVisible=i.isShowing,ge.dropDownToggle.fire(i.isShowing),t.classList.toggle("active",i.isShowing))})),ge.updatesAreUnread.listen((()=>{e.anyUpdatesTabUnread()&&t.classList.add("has_unseen")})),ge.updatesAreRead.listen((()=>{e.refreshTabs(),e.anyUpdatesTabUnread()||(t.className=t.className.replace("has_unseen",""))})),e.updatesTabs.forEach((e=>{e.loadFeed()}))}class Re extends N.v{constructor(e,t){super(t),this.element.appendChild(e.element),Me(e,t,this.toggleEvent)}initUI(){super.initUI(),(0,P.ZM)(this.element,{maxHeight:"368px",height:"",width:"100%",zIndex:1001,backgroundColor:"transparent",fontFamily:"UbuntuBold, Helvetica, Arial, sans-serif",left:"-1px",top:"24px",right:"auto"})}}class Ie extends N.G{constructor(e,t){super(t),this.element.appendChild(e.element),Me(e,t,this.toggleEvent)}initUI(){super.initUI(),this.element.style.maxHeight="",this.element.style.width="100%",this.element.style.zIndex="1001",this.element.style.backgroundColor="#FFFFFF",this.element.style.fontFamily="UbuntuBold, Helvetica, Arial, sans-serif",this.element.style.left="-1px",this.element.style.top="0",this.element.style.height="calc(100% - 46px)",this.element.style.top="46px",this.pushmenu=document.querySelector(".pushmenu.main-menu"),null!==this.pushmenu&&(0,u.wu)("touchmove",this.pushmenu,(()=>{this.isShown()&&this.hideElement()}))}showElement(){const e=super.showElement();return this.scrollTopPushmenu(),e}scrollTopPushmenu(){null!==this.pushmenu&&(this.pushmenu.scrollTop=0)}}class Ee extends N.v{constructor(e,t,i){if(super(e),this.username=t,this.darkModeEnabled=i,this.element.id="UserMenuDropDown",this.element.dataset.testid="user-menu-drop-down",(0,re.fZ)(this.element,"userMenuDropDown"),(0,re.fZ)(this.element,re.aG.userInfoDropdownBgColor),(0,P.ZM)(this.element,{display:"none",width:"100%",height:"auto",boxSizing:"border-box",top:"24px",left:"0px",zIndex:1001,borderRadius:"0 0 5px 5px",borderStyle:"solid",borderWidth:"1px",borderTop:"none",fontFamily:"UbuntuBold, Helvetica, Arial, sans-serif",padding:"5px 0",position:"absolute",right:"auto"}),I.m.isWhiteLabel||this.setupDarkmode(),""!==t){if(this.profileLink=this.createDropdownLink(z.R.myProfileTextLc),this.profileLink.dataset.testid="profile-link",this.element.appendChild(this.profileLink),this.myCollectionLink=this.createDropdownLink(z.R.myCollectionText),this.myCollectionLink.dataset.testid="my-collection-link",this.myCollectionLink.href=(0,b._Y)("/my_collection/"),this.element.appendChild(this.myCollectionLink),void 0!==window.live_chat_support){const e=this.createDropdownLink(z.R.liveChatSupportTextLc);e.dataset.testid="live-chat-link",e.href=(0,b._Y)("/accounts/support_chat/"),e.onclick=e=>{e.preventDefault(),(0,oe.gr)("/accounts/support_chat/","support_chat","height=630,width=375,resizable=0,location=0")},this.element.appendChild(e)}const e=document.createElement("form");e.method="post",e.action=(0,b._Y)("/auth/logout/"),e.target="_top",e.style.display="none";const i=document.createElement("input");i.type="hidden",i.name="csrfmiddlewaretoken",i.value=(0,l.I7)("csrftoken"),e.appendChild(i),this.element.appendChild(e);const s=this.createDropdownLink(z.R.sendFeedbackTextLc);s.dataset.testid="feedback-link",s.style.cursor="pointer",s.onclick=e=>{e.preventDefault(),this.hideElement(),B.E.fire({source:"user_menu"})},this.element.appendChild(s);const n=this.createDropdownLink(z.R.logOutTextLc);n.dataset.testid="logout-link",n.href=(0,b._Y)("/auth/logout/"),n.onclick=t=>{t.preventDefault(),this.hideElement(),(0,F.mf)(z.R.logoutModalText,(()=>{i.value=(0,l.I7)("csrftoken"),e.submit()}))},this.element.appendChild(n),void 0!==t&&this.setUsername(t)}else{const e=this.createDropdownLink(z.R.loginVerbText);e.dataset.testid="login-link",e.classList.add("login-link"),e.classList.add("nooverlay"),e.href=(0,b._Y)(v.ii),(0,v.fT)(e),this.element.appendChild(e);const t=this.createDropdownLink(z.R.signUpText);t.dataset.testid="signup-link",t.href=(0,b._Y)(`${v.k6}?src=header`),(0,v.fT)(t),this.element.appendChild(t);const i=this.createDropdownLink(z.R.sendFeedbackTextLc);i.dataset.testid="feedback-link",i.style.cursor="pointer",i.href="#",i.onclick=e=>{e.preventDefault(),this.hideElement(),B.E.fire({source:"user_menu"})},this.element.appendChild(i)}}setupDarkmode(){if(void 0!==this.darkModeEnabled){this.isDarkMode=document.body.classList.contains("darkmode");const e=this.createDarkModeSwitch();this.element.insertBefore(e,this.element.firstChild),!document.body.classList.contains("isIpad")&&(0,a.J0)()&&document.body.classList.add("isIpad")}}createDarkModeSwitch(){const e=document.createElement("div"),t=document.createElement("span");return this.dmSwitchCircle=document.createElement("span"),this.dmSwitchCircle.dataset.testid="dark-mode-switch",e.innerText=z.R.darkMode,t.appendChild(this.dmSwitchCircle),e.appendChild(t),(0,re.fZ)(this.dmSwitchCircle,"dmSwitchCircle"),(0,P.ZM)(this.dmSwitchCircle,{borderRadius:"50%",display:"inline-block",height:"16px",width:"16px",position:"relative",top:"2px",left:"3px"}),(0,P.ZM)(t,{borderRadius:"25px",display:"inline-block",height:"20px",marginLeft:"10px",position:"relative",verticalAlign:"bottom",width:"44px",cssFloat:"right",right:"6px",top:"-2px"}),(0,re.fZ)(t,"dmSwitch"),(0,V.PF)(e,"none"),(0,V.Ve)(this.dmSwitchCircle,"left 100ms"),(0,re.fZ)(e,re.aG.userInfoDropdownTextColor),(0,re.fZ)(e,re.aG.userInfoDropdownHighlightColor),e.style.fontSize="14px",e.style.fontWeight="normal",e.style.cursor="pointer",e.style.fontFamily="UbuntuMedium, Arial, Helvetica, sans-serif",e.style.padding="5px 0 5px 10px",e.onclick=()=>{this.setColorModeFn()},O.sb.listen((()=>{this.setColorModeFn()})),this.isDarkMode&&(this.dmSwitchCircle.style.left="25px"),e}setColorModeFn(){I.m.isWhiteLabel||(this.isDarkMode?(this.dmSwitchCircle.style.left="3px",this.isDarkMode=!1,(0,re.SA)(document.body,"darkmode"),(0,re.fZ)(document.body,"lightmode"),(0,l.uC)("theme_name","lightmode",{days:60})):(this.dmSwitchCircle.style.left="25px",this.isDarkMode=!0,(0,re.SA)(document.body,"lightmode"),(0,re.fZ)(document.body,"darkmode"),(0,l.uC)("theme_name","darkmode",{days:60})),this.updateMenuColors(),(0,M.bT)("colorModeChanged",{username:void 0===this.username?"__anon__":this.username,color_mode:this.isDarkMode?"darkmode":"lightmode"}),O.gh.fire(this.isDarkMode?"darkmode":"lightmode"),(0,_.ok)()||(0,b.KF)("api/ts/accounts/userpreferredtheme/",{theme:this.isDarkMode?"darkmode":"lightmode"}))}updateMenuColors(){I.m.isWhiteLabel&&(this.element.style.backgroundColor=I.m.userInfoDropdownBgColor,this.element.style.border=`1px solid ${I.m.tabBorderColor}`)}createDropdownLink(e){const t=document.createElement("a");return t.style.textDecoration="none",t.innerText=e,t.style.display="block",t.style.fontSize="14px",t.style.padding="5px 0 5px 10px",(0,re.fZ)(t,re.aG.userInfoDropdownTextColor),(0,re.fZ)(t,re.aG.userInfoDropdownHighlightColor),t.onclick=()=>{this.hideElement()},t}setUsername(e){void 0!==this.profileLink&&(this.profileLink.href=(0,b._Y)(`/p/${e}/?tab=bio`))}showElement(){return super.showElement()}hideElement(e){return super.hideElement()}}var Le=i(3737),De=i(9463),Be=i(2939),Ue=i(5088),Fe=i(7321),_e=i(520);const Ne={fontSize:"13px",fontFamily:"UbuntuMedium, Helvetica, Arial, sans-serif",width:"auto",height:"auto",position:"absolute",display:"none",overflow:"",cursor:"default",top:"0px",left:"0px",zIndex:5},Oe={width:"314px",maxHeight:"450px",overflowY:"auto",overflowX:"hidden",position:"relative",boxSizing:"border-box",padding:"8px",borderRadius:"4px 4px 4px 4px",WebkitBorderRadius:"4px 4px 4px 4px"},He={cssFloat:"right"},We={margin:"5px 0"};class $e extends _e.s{constructor(e,t,i){super(e,!1),this.isAnonymous=t,this.showFollowedCount=i,this.followedData=qe.getInstance(),this.topMargin=5}setDropDownStyleFromToggle(e){const t=getComputedStyle(this.element).borderBottomRightRadius;this.setBorderRadius(e,t)}createBaseElement(){return(0,G.tT)("div",{className:"followedDropdown","data-href":"skip"},(0,G.tT)("div",{className:"followedContainer",style:Oe,colorClass:[re.aG.tabActiveBgColor,"tabBorderNoHover"],ref:e=>{this.followedContainer=e}}))}initData(e){super.initData(null!=e?e:{}),(0,m.rT)()?y.T.current.listen(["genders"],(e=>{var t,i;const s=null!==(t=(null!==(i=e.genders)&&void 0!==i?i:[])[0])&&void 0!==t?t:"";void 0!==this.moreAnchor&&(this.moreAnchor.href=(0,b._Y)(Ve(s,this.followedData.getOnlineFollowed().online>0)))}),this.element):(this.gender=(0,g.Bg)(),x.wd.addListener((e=>{this.gender=e,void 0!==this.moreAnchor&&(this.moreAnchor.href=(0,b._Y)(Ve(this.gender,this.followedData.getOnlineFollowed().online>0)))}),this.element))}initUI(e){super.initUI(e),(0,P.ZM)(this.element,Ne)}updateFollowedCount(){if(void 0===this.followedCount)return;const e=this.followedData.getOnlineFollowed();this.followedCount.textContent=z.R.followCountLong(e.online,e.total)}navigateToFollowedPage(e){(0,M.bT)("FollowedDropdownSeeAll"),x.XS.fire(e)}replaceRooms(){if(this.isShown())return;for(;null!==this.followedContainer.firstChild;)this.followedContainer.removeChild(this.followedContainer.firstChild);if(!this.isAnonymous){var e,t;const i=this.followedData.getOnlineFollowed(),s=this.followedData.getCurrentShownRooms().length>1,n=(0,m.rT)()?null!==(e=(null!==(t=y.T.current.state.genders)&&void 0!==t?t:[])[0])&&void 0!==e?e:"":this.gender;this.followedContainer.appendChild(this.getRoomElement(n,i,s))}this.followedContainer.style.width="auto";const i=(0,G.tT)("div",{style:{display:"table"}});let s=(0,G.tT)("div",null),n=0;if(this.followedData.getCurrentShownRooms().forEach((e=>{n%2==0&&(s=(0,G.tT)("div",{style:{display:"table-row"}}),i.appendChild(s));const t=(0,G.tT)("div",{style:{display:"table-cell"}});t.appendChild(e.card),s.appendChild(t),n+=1})),this.followedContainer.appendChild(i),0===this.followedData.getCurrentShownRooms().length){const e=(0,G.tT)("div",{colorClass:re.aG.textColor,style:{margin:"5px 3px 5px 3px",fontSize:"12px",fontFamily:"UbuntuRegular"}});if(this.isAnonymous){const t=e=>{const t=(0,G.tT)("a",{href:e.href,style:{height:"auto",width:"auto",border:"none",borderRadius:"0px",textDecoration:"none",cursor:"pointer",cssFloat:"none",padding:"0px"},colorClass:[re.aG.tabActiveBgColor,re.aG.hrefColor],onMouseEnter:()=>{t.style.textDecoration="underline"},onMouseLeave:()=>{t.style.textDecoration="none"},onClick:void 0!==e.onClick?e.onClick:void 0,"account-redirect":!0,"data-testid":e.testid},e.children);return t};e.appendChild((0,G.tT)(G.FK,null,(0,G.tT)(t,{href:(0,b._Y)(`${v.k6}?src=followed_tab`),testid:"following-sign-up-link"},z.R.signUpText),(0,G.tT)("span",null,` ${z.R.orLower} `),(0,G.tT)(t,{href:(0,b._Y)(v.ii),onClick:e=>{e.metaKey||e.ctrlKey||(e.preventDefault(),this.hideElement(),(0,$.DC)({}))},testid:"following-login-link"},z.R.loginVerbText))),e.appendChild((0,G.tT)("span",null,z.R.anonFollowMore))}else e.appendChild((0,G.tT)("span",null,z.R.userFollowMore));this.followedContainer.appendChild(e),this.followedContainer.style.width="265px"}}getRoomElement(e,t,i){return(0,G.tT)("div",{style:{margin:"5px 3px"}},(0,G.tT)("a",{href:Ve(e,t.online>0),style:{height:"auto",width:"auto",border:"none",borderRadius:"0px",textDecoration:"none",cursor:"pointer",cssFloat:"none",padding:"0px"},"data-testid":"following-show-all",colorClass:[re.aG.tabActiveBgColor,re.aG.hrefColor],ref:e=>{this.moreAnchor=e},onMouseEnter:()=>{this.moreAnchor.style.textDecoration="underline",(0,re.fZ)(this.moreAnchor,re.aG.tabActiveColor),(0,re.SA)(this.moreAnchor,re.aG.hrefColor)},onMouseLeave:()=>{this.moreAnchor.style.textDecoration="none",(0,re.fZ)(this.moreAnchor,re.aG.hrefColor),(0,re.SA)(this.moreAnchor,re.aG.tabActiveColor)},onClick:e=>this.navigateToFollowedPage(e)},z.R.showAllText),this.showFollowedCount&&(0,G.tT)("div",{style:i?He:We,className:"followedCount",ref:e=>{this.followedCount=e}},z.R.followCountLong(t.online,t.total)))}updateThumbnails(){for(const e of this.followedData.getCurrentShownRooms())e.updateThumbnail()}showElement(){if(!super.showElement())return!1;this.updateThumbnails(),this.followedContainer.scrollTop=0,this.followedData.resetLastUnseen();const e=(0,P.$R)(this.element),t=Math.max((0,k.DK)(),(0,P.Lx)(document.body.style.minWidth));return e.right>t&&(this.element.style.width=this.element.offsetWidth-(e.right-t)-4+"px",this.followedContainer.style.overflowX="auto"),!0}hideElement(e){if(void 0!==e&&(e.metaKey||e.ctrlKey))return!1;if(!super.hideElement())return!1;for(const e of this.followedData.getCurrentShownRooms())e.unhighlight();return this.element.style.width="auto",this.followedContainer.style.overflowX="hidden",this.replaceRooms(),!0}reposition(){super.reposition(),this.connectedOverlay.element.style.display="none"}}function Ve(e,t){return t?"/followed-cams/online/"+(e!==g.YT.All?`${g.hf.get(e)}/`:""):"/followed-cams/offline/"}class ze{constructor(e,t,i){this.room=e,this.highlighted=t,this.username="",this.username=e.room;const s=""!==this.room.image?this.room.image:`${STATIC_URL_ROOT}images/no_thumbnail_1_wide.jpg`;this.a=(0,G.tT)("a",{className:"roomElementAnchor",colorClass:[re.aG.tabInactiveColor,this.highlighted?"isHighlighted":"notHighlighted"],style:{width:"180px",height:"126px",borderRadius:"4px",border:"none",padding:"0px",margin:"0px",display:"block",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",textDecoration:"none"},"data-room":this.room.room,href:(0,b._Y)(`/${this.room.room}/`),onClick:()=>{(0,M.bT)("FollowedDropdownVisit")}},(0,G.tT)("img",{alt:"",src:s,width:180,height:101,style:{borderRadius:"3px 3px 0px 0px"},className:"room_thumbnail","data-testid":"room-card-image",ref:e=>{this.img=e}}),(0,G.tT)("span",{style:{padding:"5px"},"data-testid":"room-card-username"},this.room.room)),this.card=(0,G.tT)("div",{className:"roomElement",style:{display:"inline-block",width:"180px",height:"126px",borderRadius:"4px",margin:"3px",cursor:"pointer"},"data-testid":"room-card"},this.a),(0,u.Xq)(["click","mousedown","touchstart"],this.a,(()=>{(0,Fe.sl)(this.username,"ft",i)}))}unhighlight(){this.highlighted=!1,(0,re.fZ)(this.a,"notHighlighted"),(0,re.SA)(this.a,"isHighlighted")}updateThumbnail(){var e;this.setImageStreamer(),""!==this.room.image&&(null===(e=this.imageStreamer)||void 0===e||e.loadImage(0).catch((e=>{warn("Error loading image",{imageSrc:e})})))}setImageStreamer(){""!==this.room.image&&void 0===this.imageStreamer&&(this.imageStreamer=new Ue.QR(this.username,this.img),(0,u.wu)("mouseenter",this.card,(()=>{var e;(0,Fe.$r)()&&(null===(e=this.imageStreamer)||void 0===e||e.startStreaming())})),(0,u.wu)("mouseleave",this.card,(()=>{var e;(0,Fe.$r)()&&(null===(e=this.imageStreamer)||void 0===e||e.stopStreaming())})))}}var Ge;class qe{constructor(){this.first=!0,this.currentShownRooms=[],this.lastUnseen=[],this.seenRooms={},this.forceSeen={},this.onlineFollowed={online:0,total:0}}static getInstance(){return qe._instance}init(e){if(this.currentOptions=e,O.VZ.listen((()=>{this.currentOptions.dropdown.hideElement()})),Be.X0.listen((e=>{this.currentOptions.dropdown.replaceRooms(),this.setSeen([e.dossier.room])})),f.oO.listen((()=>{this.currentOptions.dropdown.isShown()&&(this.disableResizeDebounce||this.currentOptions.dropdown.hideElement())})),this.currentOptions.dropdown.toggleEvent.listen((()=>{this.currentOptions.dropdown.isShown()&&this.disableResizeDebounceEvent()})),this.currentOptions.dropdown.replaceRooms(),this.currentOptions.isAnonymous)this.currentOptions.dropdown.replaceRooms();else{var t;(0,De.Y3)(),De.P$.listen((e=>{this.updateViaStorageCallback(e,!1,this.currentOptions.username,this.currentOptions.updateViaStorageCallback)})),De.Li.listen((e=>{this.updateViaStorageCallback(e,!1,void 0,this.currentOptions.followedDropdownClickedCallback)}));const e=0===window.location.pathname.indexOf("/followed-cams/",0)?void 0:(0,De.XP)();void 0!==e&&e.username===this.currentOptions.username&&Date.now()-e.timestamp<3e4?(this.notFirst(),this.updateViaStorageCallback(e,!0,this.currentOptions.username,this.currentOptions.updateViaStorageCallback),(0,De.V7)(),this.getUpdatesFromCB(!0,this.currentOptions.username,this.currentOptions.updateFromCBCallback)):this.getUpdatesFromCB(!1,this.currentOptions.username,this.currentOptions.updateFromCBCallback);const i=e=>{clearInterval(this.updateInterval),this.updateInterval=window.setInterval((()=>{this.currentOptions.dropdown.isShown()||this.getUpdatesFromCB(!1,this.currentOptions.username,this.currentOptions.updateFromCBCallback)}),e)};i(2e4),window.setTimeout((()=>{i(6e4)}),6e5),window.setTimeout((()=>{i(12e5)}),18e5),window.setTimeout((()=>{clearInterval(this.updateInterval)}),216e5),De.mD.listen((()=>{this.currentOptions.followedTab.flash()}));const s=R.Bm.current.loggedInUser,n=null!==(t=null==s?void 0:s.userUid)&&void 0!==t?t:"";new ve.Jf(n).onMessage.listen((e=>{e.followerUsername===(null==s?void 0:s.username)&&this.updateFollowedTab(e.followedUsername)}))}}getSeenRooms(){return this.seenRooms}getlastUnseen(){return this.lastUnseen}getforceSeen(){return this.forceSeen}getOnlineFollowed(){return this.onlineFollowed}setOnlineFollowed(e){this.onlineFollowed=e}setSeenRoom(e){this.seenRooms[e]=!0}setForceSeen(e){this.forceSeen[e]=!0}getCurrentShownRooms(){return this.currentShownRooms}notFirst(){this.first=!1}resetLastUnseen(){this.lastUnseen=[]}setSeen(e){for(const t of e)this.setSeenRoom(t),this.setForceSeen(t)}setDropdownViewed(){(0,De.M2)(),(0,De.mE)()}updateViaStorageCallback(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;e.timestamp<=this.lastUpdate||e.username!==i||(this.onlineFollowed=e.onlineFollowedList.onlineFollowed,this.seenRooms=e.seenRooms,this.lastUnseen=e.unseenRooms,this.update(e.onlineFollowedList,!0),void 0!==s&&s(e,t),this.lastUpdate=e.timestamp)}update(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i={},s=[],n=[];for(const t of e.roomList)void 0!==this.seenRooms[t.room]||this.first?n.push(t):s.push(t),this.seenRooms[t.room]=!0,i[t.room]=t;const o=s.length>0;this.lastUnseen=this.lastUnseen.reduce(((e,t)=>(void 0===i[t.room]||this.forceSeen[t.room]||e.push(i[t.room]),e)),[]);for(const e of s)this.lastUnseen.push(e);const r={};this.currentShownRooms=[];for(const e of this.lastUnseen)r[e.room]=!0,this.currentShownRooms.push(new ze(e,!0,this.currentShownRooms.length+1));for(const e of n)void 0===r[e.room]&&this.currentShownRooms.push(new ze(e,!1,this.currentShownRooms.length+1));this.currentOptions.dropdown.replaceRooms();const a=!this.first&&o;return a&&!t&&De.mD.fire(void 0),this.first=!1,{flash:a,rooms:this.lastUnseen}}getUpdatesFromCB(){let e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0;!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&Date.now()-this.lastUpdate<1e4||(0,De.Mr)().then((i=>{this.lastUpdate=Date.now(),this.onlineFollowed=i.onlineFollowed;const s=this.update(i);t(s),(0,De.Bq)(e,i,this.seenRooms,s.flash,s.rooms)})).catch((()=>{}))}updateFollowedTab(e){this.setSeen([e]),this.getUpdatesFromCB(!0,this.currentOptions.username,this.currentOptions.updateFromCBCallback)}disableResizeDebounceEvent(){this.disableResizeDebounce=!0,window.setTimeout((()=>{this.disableResizeDebounce=!1}),300)}}(Ge=qe)._instance=new Ge;class je{constructor(e,t,i){var s,n,o;this.toggleEl=e,this.orange=!1,this.followedData=qe.getInstance(),this.moveFollowCountTest=new Le.y(["MvFlw2","MvFlw2Ntf","MvFlw2Onl"],"mv_flw_ct"),this.ratioText=null!==(s=this.toggleEl.querySelector(".followed_counts"))&&void 0!==s?s:void 0,["MvFlw2","MvFlw2Ntf"].includes(null!==(n=this.moveFollowCountTest.activeSide)&&void 0!==n?n:"")&&void 0!==this.ratioText&&(this.ratioText.remove(),this.ratioText=void 0),this.followingLink=null!==(o=document.getElementById("followed_anchor"))&&void 0!==o?o:void 0;const r={username:i,isAnonymous:t,updateFromCBCallback:e=>{this.updateRatioText(!0),0===e.rooms.length&&(this.orange=!1,this.updateTabHighlight())},updateViaStorageCallback:(e,t)=>{this.updateRatioText(!1),this.orange=e.unseenRooms.length>0,this.updateTabHighlight(),e.flash&&!t&&this.flash()},followedDropdownClickedCallback:()=>{this.updateRatioText(!1),clearInterval(this.flashInterval),this.flashInterval=void 0,this.orange=!1,this.updateTabHighlight()},dropdown:new $e(this.toggleEl,t,this.moveFollowCountTest.active),followedTab:this};this.dropdown=r.dropdown,this.dropdown.toggleEvent.listen((e=>{if(e.isShowing){clearInterval(this.getFlashingInterval()),this.setFlashingInterval(void 0),this.setOrange(!1),this.updateTabHighlight();const e=this.followedData.getOnlineFollowed().online;(0,M.bT)("FollowedDropdownOpened",{onlineBroadcasters:e}),this.followedData.setDropdownViewed()}})),(0,m.rT)()?y.T.current.listen(["genders"],(e=>{var t,i;this.updateFollowingLink(null!==(t=(null!==(i=e.genders)&&void 0!==i?i:[])[0])&&void 0!==t?t:"",this.followedData.getOnlineFollowed().online>0)}),this.followingLink):x.wd.listen((e=>{this.updateFollowingLink(e,this.followedData.getOnlineFollowed().online>0)})),this.followedData.init(r),this.moveFollowCountTest.active||(this.followedData.setOnlineFollowed((0,De.hD)(this.toggleEl.innerText)),this.updateRatioText(!0))}setOrangeStyle(e){if(e){(0,re.fZ)(this.toggleEl,"orange");const e=this.followedData.getlastUnseen().length;var t;e>0&&"MvFlw2Ntf"===this.moveFollowCountTest.activeSide&&((0,re.fZ)(this.toggleEl,"text"),null===(t=document.getElementById("followed_anchor"))||void 0===t||null===(t=t.style)||void 0===t||t.setProperty("--unseen-follow-count",`"${e}"`))}else(0,re.SA)(this.toggleEl,"orange"),(0,re.SA)(this.toggleEl,"text")}setOrange(e){this.orange=e}setFlashingInterval(e){this.flashInterval=e}getFlashingInterval(){return this.flashInterval}flash(){if(void 0!==this.flashInterval)return;let e=3,t=!0;this.flashInterval=window.setInterval((()=>{if(t){if(this.setOrangeStyle(!0),e-=1,0===e)return clearInterval(this.flashInterval),void(this.flashInterval=void 0)}else this.setOrangeStyle(!1);t=!t}),500)}updateRatioText(e){if(this.moveFollowCountTest.active&&this.dropdown.updateFollowedCount(),void 0===this.ratioText)return;const t=this.followedData.getOnlineFollowed();this.toggleEl.style.width="auto";const i=void 0===R.Bm.current.loggedInUser?"":`(${t.online})`;this.ratioText.textContent="MvFlw2Onl"===this.moveFollowCountTest.activeSide?i:`(${t.online}/${t.total})`,null!==this.toggleEl.offsetParent&&window.setTimeout((()=>{e||(this.toggleEl.style.width=`${this.toggleEl.offsetWidth+1}px`),this.dropdown.isShown()&&this.dropdown.reposition()})),this.updateFollowingLink((0,g.Bg)(),t.online>0)}updateTabHighlight(){this.orange&&!this.dropdown.isShown()?this.setOrangeStyle(!0):this.setOrangeStyle(!1)}updateFollowingLink(e,t){void 0!==this.followingLink&&(this.followingLink.href=Ve(e,t))}}function Ze(e){if(void 0===e)return;const t=[];for(const i of JSON.parse(e))t.push({provider:i[0],name:i[1]});return t}function Ke(e){var t;if(null!==e&&"/security/tfa/auth/"!==window.location.pathname&&"/security/tfa/auth/choose_device/"!==window.location.pathname)return{username:e.username,gender:e.gender,subgender:null!==(t=e.subgender)&&void 0!==t?t:void 0,isSupporter:e.is_supporter,isStaff:e.is_staff,tokenBalance:e.token_balance,userUid:e.user_uid,signedUsername:e.signed_username,isAgeVerified:e.is_age_verified,isBroadcasting:e.is_broadcasting,totalFollowed:e.total_followed,onlineFollowed:e.online_followed,canWegOneClick:e.can_weg_oneclick,canEpochOneClick:e.can_epoch_oneclick}}var Je=i(5914),Ye=i(7537),Qe=i(9268);class Xe extends Ye.o{constructor(e){super(e),this.easyExit=!1,this.defineTabbableElements([this.signupLink,this.dismissLink])}createElement(e){return this.signupUrl=e.isMobile?(0,b._Y)(`${v.k6}?src=avsuccess`):"#",(0,G.tT)("div",{id:"age-gate-signup"},(0,G.tT)("img",{src:`${STATIC_URL_ROOT}images/circle-check-green.svg`,className:"verified-check"}),(0,G.tT)("h2",null,"You've been successfully verified"),(0,G.tT)("p",null,"Sign up or log in so you don't have to do this again."),(0,G.tT)("a",{href:this.signupUrl,className:"age-gate-signup-save nooverlay",onClick:t=>this.saveLinkClicked(t,e.isMobile),ref:e=>{this.signupLink=e}},"Save my verification status"),(0,G.tT)("a",{href:"#",className:"age-gate-signup-dismiss nooverlay",onClick:e=>this.dismissLinkClicked(e),ref:e=>{this.dismissLink=e}},"Skip for now"))}saveLinkClicked(e,t){e.preventDefault(),(0,M.bT)("AgeGate_Save"),t?window.location.href=this.signupUrl:(this.hide(),new tt(this.signupLink).initWithoutAnchor())}dismissLinkClicked(e){e.preventDefault(),(0,l.Yj)("AG_Key"),this.hide()}}const et="AV_ShowModal";class tt extends Qe.fS{constructor(e){super({}),this.initialLink=e,this.iframe.src+="&src=avsuccess"}initWithoutAnchor(){const e=new Qe.QC(this.initialLink);e.initialHref=this.initialLink.href,this.initAndShow(e)}hide(){(0,l.Yj)("AG_Key"),super.hide()}}var it=i(1679),st=i(1244),nt=i(5090),ot=i(3587),rt=i(2945),at=i(3124),lt=i(2359),ht=i(1779),dt=i(3049);function ct(e){window.TS=e}class ut{constructor(e){this.parseContext(e),R.Bm.current=this.context,this.init(),this.listenForOrientationChanges(),this.addErrorAttributes()}parseContext(e){var t,i,s,n,o,r,l,h,d;if(this.context={current_logo:e.current_logo,isMobile:e.is_mobile,sample_metrics_off:e.sample_metrics_off,qualityMessage:e.quality_message,loggedInUser:Ke(e.logged_in_user),isAgeGated:e.user_age_gated,animateThumbnails:e.animate_thumbnails,socialAuths:Ze(e.social_auths),isBroadcast:!1,darkModeEnabled:e.dark_mode_enabled,themeName:e.theme_name,maxPmAge:e.chat_settings.max_pm_age,dmsEnabled:null!==(t=e.sitewide_pms_enabled)&&void 0!==t&&t,contextID:e.entrypoint_context_id,csrftoken:e.csrftoken,isLoadedFromCache:void 0,showPaxumNotice:null!==(i=e.show_paxum_notice)&&void 0!==i&&i,realtimeUserlistEnabled:!0===e.realtime_userlist_enabled,isInternal:e.INTERNAL,pageLocation:null!==(s=e.pageLocation)&&void 0!==s?s:"homepage",PurchaseEventSources:e.PurchaseEventSources,languageCode:e.language_code,showLocation:null===(n=Boolean(e.showLocation))||void 0===n||n,showRecommendations:null!==(o=e.showRecommendations)&&void 0!==o&&o,showNpsSentimentSurveyGroup:null!==(r=e.show_nps_sentiment_survey_group)&&void 0!==r&&r,regions:null!==(l=e.regions)&&void 0!==l?l:"",isTestbed:null!==(h=e.isTestbed)&&void 0!==h&&h,noImage:null!==(d=e.noImage)&&void 0!==d&&d,throttleTopicPublish:!0===e.push_throttle_topic_publish,isNoninteractiveUser:!1,mergePmDm:e.merge_pm_dm,noAnalytics:e.no_analytics},Je.U.initialize(e),(0,Fe.Cx)(this.context.animateThumbnails),this.setUserInteractive(),(0,a.Pf)()){const e=window.localStorage.getItem("contextID");window.localStorage.setItem("contextID",this.context.contextID),this.context.isLoadedFromCache=e===this.context.contextID}}init(){window.setTimeout((()=>{(0,oe.gA)()||location.reload(),oe.g$.listen((()=>{location.reload()}))}),1728e5),this.roomReload=Fe.HA.exportToJS(),this.addPageAction=M.bT,this.context.isMobile?this.initMobile():this.initDesktop(),(0,M.S_)("history_length",history.length.toString()),(0,it.yL)(),(0,lt.If)(),(0,Y.w)(),(0,ht.et)(),this.setupConvivaEcoSensor(),function(){if(window.location.pathname.startsWith("/accounts/"))return;if(R.Bm.current.isAgeGated||void 0!==R.Bm.current.loggedInUser)return;const e=(0,l.pH)(et);(0,l.Yj)(et),void 0!==e&&[0,1].includes(e)?1===e&&new Xe({isMobile:R.Bm.current.isMobile}).show():(0,l.Yj)("AG_Key")}()}initMobile(){this.bindUserUpdatesPanel(!0),this.context.isAgeGated||this.bindDmListDropdown(!0),function(){const e=document.querySelector(".nav_list"),t=document.querySelector(".push-overlay");null!==t&&null!==e&&((0,u.wu)("click",e,(()=>{ee.nD.fire(!0)})),(0,u.wu)("click",t,(()=>{ee.nD.fire(!1)})),ee.bW.listen((i=>{i&&!(0,ne.Ic)()?e.click():!i&&(0,ne.Ic)()&&t.click()})))}(),this.bindAdvancedSearchOptions(!0),this.bindPurchaseTokenLinks(),this.bindTokenCountUpdater(),this.setupEmoticonPreviewModal(!0),(0,v.uy)(),this.updateFlashMessageDisplay(),this.showLoginOverlay=$.DC,void 0!==this.context.loggedInUser&&this.setupLogoutModal()}initDesktop(){this.bindUserInfoPanelDropdown(),this.bindUserUpdatesPanel(!1),this.bindPurchaseTokenLinks(),this.bindFollowingIcons(),this.context.isAgeGated||(this.bindDmListDropdown(!1),this.bindFollowedTab(),this.handlePmChatWindows()),this.setupEmoticonPreviewModal(!1),this.bindHeader(),this.bindFooter(),this.bindTokenCountUpdater(),(0,v.uy)(),void 0===this.context.loggedInUser&&(window.location.pathname!==v.ii&&this.setupLoginOverlay(),void 0!==(0,rt.JO)(window.location.search).join_overlay&&window.location.pathname!==v.k6&&this.setupJoinOverlay()),void 0!==this.context.loggedInUser&&this.setupLogoutModal(),this.setupUserFeedbackForm(),this.watchForAdIntervention(),this.displayLoginOverlay=$.DC,this.openFeedbackForm=e=>{B.E.fire({source:e})}}initRoom(){ot.T.getOrCreateInstance()}addErrorAttributes(){void 0!==this.context.loggedInUser?((0,M.S_)("username",this.context.loggedInUser.username),(0,M.S_)("enduser.id",this.context.loggedInUser.userUid)):((0,M.S_)("username","__anon__"),(0,M.S_)("enduser.id","0")),(0,M.S_)("enduser.session",this.context.contextID),(0,M.S_)("revision","26e1846abe7e"),(0,M.S_)("git_tag","v24.6.14.0.post1")}setupJoinOverlay(){(0,Qe.Vz)(),Qe.WG.fire(void 0),this.addJoinOverlayListener(new Qe.fS({}))}addJoinOverlayListener(e){let t;Qe.CG.listen((i=>{void 0===t&&(t=e),window.scrollTo(0,0),t.initAndShow(i)}))}setupUserFeedbackForm(){B.E.listen((e=>{U.I.show(e)}))}setupLoginOverlay(){for(const e of document.querySelectorAll("a.login-link"))e.onclick=e=>{(0,$.DC)({}),e.preventDefault()}}setupLogoutModal(){if(document.querySelectorAll("a.logout-link").length>0){const e=document.createElement("form");e.method="post",e.action=(0,b._Y)("/auth/logout/"),e.target="_top",e.style.display="none";const t=document.createElement("input");t.type="hidden",t.name="csrfmiddlewaretoken",t.value=(0,l.I7)("csrftoken"),e.appendChild(t),document.body.appendChild(e);for(const i of document.querySelectorAll("a.logout-link"))i.onclick=i=>{i.preventDefault();const s=this.context.isAgeGated?z.R.switchAccountModalText:z.R.logoutModalText;(0,F.mf)(s,(()=>{t.value=(0,l.I7)("csrftoken"),e.submit()}))}}}listenForOrientationChanges(){if(!(0,at.pu)())return;const e=()=>{at.DQ.fire()};(0,at.Vk)()?screen.orientation.addEventListener("change",e):(0,at.FW)()&&(0,u.wu)("orientationchange",window,e)}bindUserInfoPanelDropdown(){return function(e,t,i,s){let n;return null!==e&&null!==t&&(n=new Ee(t,i,s),e.appendChild(n.element),n.repositionChildrenRecursive()),n}(document.querySelector("#userInfoPanelMenuDropdownRoot"),document.getElementById("user_information_profile_container"),void 0!==this.context.loggedInUser?this.context.loggedInUser.username:"",this.context.darkModeEnabled)}bindUserUpdatesPanel(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(e,t){let i,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0;return I.m.isWhiteLabel||null===e||null===t||(s?(i=new Pe(e),null!=n&&i.initAdditionalToggleElement(n)):i=new Ae(e),t.appendChild(i.dropDownComponent.element),i.element.dataset.testid="user-updates-panel"),i}(document.querySelector("#userUpdatesBellRoot"),document.querySelector("#userUpdatesMenuDropdownRoot"),e,document.querySelector("#mmnav"))}bindDmListDropdown(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=document.querySelector("#userUpdatesBellRoot"),i=document.querySelector("#dmListDropdownRoot"),s=document.querySelector("#dmListIconRoot"),n=document.querySelector("#mmnav");if(!e)return function(e,t){let i;return null!==e&&null!==t&&(i=new de({toggleElement:e}),i.element.dataset.testid="dm-convo-list",t.appendChild(i.element)),i}(s,i);!function(e,t,i,s){null!==e&&null!==s&&s.appendChild(new ie({dmListIconRoot:e,userUpdatesBellRoot:t,hamburgerIcon:i}).element)}(s,t,n,i)}bindPurchaseTokenLinks(){for(const e of document.querySelectorAll(".purchase_tokens a, a.purchase_tokens, a#purchase_tokens"))void 0!==this.context.loggedInUser?(0,it.HH)(e):e.onclick=e=>{(0,$.DC)({}),e.preventDefault()}}watchForAdIntervention(){if(!window.hasOwnProperty("ReportingObserver"))return;const e=e=>{for(const t of e)"intervention"===t.type&&(0,M.bT)("AdIntervention",{report:JSON.stringify(t.body)})},t=new window.ReportingObserver(((t,i)=>{e(t)}),{buffered:!0});t.observe(),(0,u.wu)("beforeunload",window,(i=>{const s=t.takeRecords();e(s)}))}bindFollowedTab(){const e=document.getElementById("followed_anchor");null!==e&&e instanceof HTMLAnchorElement&&(e.onclick=e=>{e.ctrlKey||e.metaKey||e.preventDefault()},new je(e,void 0===this.context.loggedInUser,void 0!==this.context.loggedInUser?this.context.loggedInUser.username:""))}bindHeader(){const e=document.querySelector("#header");if(null!==e&&e instanceof HTMLElement)return new L(e)}bindFooter(){const e=document.querySelector(".footer-holder");if(null!==e&&e instanceof HTMLElement)return new T(e)}handlePmChatWindows(){const e=window.location.pathname.startsWith("/staff_tools"),t=document.getElementById("header");var i;null===t||null===t.offsetParent||e||(!0===(null===(i=this.context.loggedInUser)||void 0===i?void 0:i.isStaff)||void 0!==this.context.loggedInUser&&(0,d.SU)())&&(0,D.Z4)(this.context.loggedInUser.username)}setupEmoticonPreviewModal(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];st.pp.listen((i=>{void 0===e&&(e=t?new st.Gj:new st.Yn),e.initAndShow(i)}))}bindFollowingIcons(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=e?"broadcasters":"room_list",i=document.querySelector(`#${t}`),s=document.querySelector("div.icon_not_following"),n=document.querySelector("div.icon_following");null===i||null===s&&null===n||new nt.y(void 0===this.context.loggedInUser,t,e)}bindAdvancedSearchOptions(e){return new h.ZB(e)}bindTokenCountUpdater(){var e;const t=null===(e=R.Bm.current.loggedInUser)||void 0===e?void 0:e.userUid;void 0!==t&&new ve.nH(t).onMessage.listen((e=>{c.D.fire(e)})),c.D.listen((e=>{(0,it.hw)(e.tokens)}))}updateFlashMessageDisplay(){const e=document.querySelector(".flash-message-container");null!==e&&0===e.querySelectorAll(".message p").length&&(e.style.display="none")}setUserInteractive(){var e;this.context.isInternal&&!0===(null===(e=this.context.loggedInUser)||void 0===e?void 0:e.isStaff)&&(this.context.isNoninteractiveUser=!0)}setupConvivaEcoSensor(){if((0,dt.kt)()){let e="11bbd19872403a8c17a3c4a24fe2b5501f6831b9";R.Bm.current.isInternal&&(e="224075d7f3c1654ccd30d05396d7b47e49dd6da3"),(0,s.convivaAppTracker)({appId:"Multi Media Web",convivaCustomerKey:e,contexts:{performanceTiming:!0},plugins:[(0,r.PerformanceTimingPlugin)(),(0,o.ErrorTrackingPlugin)(),(0,n.LinkClickTrackingPlugin)()]}),R.Bm.current.loggedInUser?(0,s.setUserId)(R.Bm.current.loggedInUser.userUid):(0,s.setUserId)("anon"),(0,s.trackPageView)(),(0,n.enableLinkClickTracking)(),(0,n.enableButtonClickTracking)(),(0,o.enableErrorTracking)()}}}ct(ut)},5132:(e,t,i)=>{"use strict";(0,i(7269).n)()},4777:()=>{"use strict";window.PRODUCTION=!0,window.CHATURBATE_URL_PREFIX="/",window.STATIC_URL_ROOT="https://web.static.mmcdn.com/",window.STATIC_URL_MOBILE="https://web.static.mmcdn.com/mobileassets/",window.STATIC_URL="https://web.static.mmcdn.com/tsdefaultassets/"},2021:(e,t,i)=>{var s=i(9259);window.debug=s.debug,window.info=s.info,window.warn=s.warn,window.error=s.error},6624:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,s=new Array(t);i0&&(e.keywords=i),this.appendFilterPanelUrlParams(e,t),e}},{key:"appendFilterPanelUrlParams",value:function(e,t){var i,s=Q(t);void 0!==s&&(e.regions=(null!==(i=e.regions)&&void 0!==i?i:[]).concat(s.split(",")));var o,r=J(t);void 0!==r&&(o=n(r,2),e.ageMin=o[0],e.ageMax=o[1]);var a,l=ee(t);if(void 0!==l&&(e.privatePrices=(null!==(a=e.privatePrices)&&void 0!==a?a:[]).concat(l)),C()){var h=oe(t);void 0!==h&&(e.roomSize=h)}if(S()){var d=ae(t);void 0!==d&&(e.spokenLanguages=d)}}}])&&function(e,t){for(var i=0;i0&&(e.regions=Array.from(s).map((function(e){return e.value})).join(","))}var n=document.querySelector("#id_enable_recommendations");return null!==n&&(e.enable_recommendations=!n.disabled&&n.checked),e}function G(e){return s({},(t={},(i=(0,T.getCurrentGender)())!==T.Gender.All&&(t.genders=i),t),z(),function(e){var t,i={};return void 0===e&&(e=null!==(t=new URLSearchParams(window.location.search).get("keywords"))&&void 0!==t?t:""),e.length>0&&(i.keywords=e.slice(0,V)),i}(e),function(){if(!w())return{};var e={},t=J();void 0!==t&&(e.from_age=t[0],e.to_age=t[1]);var i=Q();void 0!==i&&(e.regions=i);var s=function(e){var t=window.location.search,i=new URLSearchParams(t).get(X);if(null!==i){var s=i.split(",").filter((function(e){return Object.values(fe).includes(e)})).map((function(e){return e}));if(s.length>0)return te(s)}}();if(void 0!==s&&(e.private_prices=s),C()){var n=oe();void 0!==n&&(e.room_size=n)}if(S()){var o=ae();void 0!==o&&(e.spoken_languages=o)}return e}());var t,i}var q=/^\d{2}-(\d{2}|100)$/g,j=18,Z=100,K="ages";function J(e){var t=void 0!==e?e.search:window.location.search,i=new URLSearchParams(t).get(K);if(null!==i){var s=i.match(q);if(null!==s){var n=function(e){return isNaN(e)||eZ},o=s[0].split("-"),r=parseInt(o[0]),a=parseInt(o[1]);if(n(r)||n(a))return;if(r===j&&a===Z)return;if(r<=a)return[r,a+1]}}}var Y="regions";function Q(e){var t=void 0!==e?e.search:window.location.search,i=new URLSearchParams(t).get(Y);if(null!==i){var s=i.split(","),n=[],o=!0,r=!1,a=void 0;try{for(var l,h=s[Symbol.iterator]();!(o=(l=h.next()).done);o=!0){var d=l.value;if(!ue.includes(d))return;n.push(d)}}catch(e){r=!0,a=e}finally{try{o||null==h.return||h.return()}finally{if(r)throw a}}if(n.length>0)return n.join(",")}}var X="private_prices";function ee(e){var t=void 0!==e?e.search:window.location.search,i=new URLSearchParams(t).get(X);if(null!==i){var s=i.split(","),n=[],o=x()?we:Ce,r=!0,a=!1,l=void 0;try{for(var h,d=s[Symbol.iterator]();!(r=(h=d.next()).done);r=!0){var c,u=h.value,p=null!==(c=o.get(u))&&void 0!==c?c:u;Object.values(fe).includes(p)&&n.push(p)}}catch(e){a=!0,l=e}finally{try{r||null==d.return||d.return()}finally{if(a)throw l}}if(n.length>0)return n}}function te(e){var t=[],i=!0,s=!1,n=void 0;try{for(var r,a=e[Symbol.iterator]();!(i=(r=a.next()).done);i=!0){var l,h=r.value,d=be.get(h);void 0!==d&&(l=t).push.apply(l,o(d))}}catch(e){s=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(s)throw n}}if(t.length>0)return t}var ie,se=((ie=se||{}).SMALL="sm",ie.MEDIUM="md",ie.LARGE="lg",ie),ne="room_size";function oe(e){var t=void 0!==e?e.search:window.location.search,i=new URLSearchParams(t).get(ne);if(null!==i&&Object.values(se).includes(i))return i}var re="spoken_languages";function ae(e){var t,i,s=null!==(i=null==e?void 0:e.search)&&void 0!==i?i:window.location.search,n=null===(t=new URLSearchParams(s).get(re))||void 0===t?void 0:t.split(",").filter((function(e){return A.has(e)}));return n&&n.length>0?n:void 0}var le,he=((le=he||{}).NorthAmerica="NA",le.SouthAmerica="SA",le.Asia="AS",le.EuropeRussia="ER",le.Other="O",le),de=new Map([["north-american-cams","NA"],["south-american-cams","SA"],["asian-cams","AS"],["euro-russian-cams","ER"],["other-region-cams","O"]]),ce=new Map;de.forEach((function(e,t){return ce.set(e,t)}));var ue=["NA","SA","AS","ER","O"];function pe(){var e=He();return de.get(e)}var me=new Map([["teen-cams",[18,20]],["18to21-cams",[18,22]],["20to30-cams",[20,31]],["30to50-cams",[30,51]],["mature-cams",[50,100]],["18to20-cams",[18,21]],["21to35-cams",[21,36]]]);function ge(){var e=He();return me.get(e)}var ve,fe=((ve=fe||{}).Value6="6",ve.Range6to18="6-18",ve.Range12to18="12-18",ve.Range30to42="30-42",ve.Range60to72="60-72",ve.Range90Plus="90",ve),ye=new Map([["6-tokens-per-minute-private-cams","6"],["6-18-tokens-per-minute-private-cams","6-18"],["12-18-tokens-per-minute-private-cams","12-18"],["30-42-tokens-per-minute-private-cams","30-42"],["60-72-tokens-per-minute-private-cams","60-72"],["90-tokens-per-minute-private-cams","90"]]),be=new Map([["6",[6]],["6-18",[6,12,18]],["12-18",[12,18]],["30-42",[30,42]],["60-72",[60,72]],["90",[90,120,150,180,240]]]),we=new Map([["6-18","12-18"]]),Ce=new Map([["6","6-18"],["12-18","6-18"]]);function Se(){var e=He();return ye.get(e)}var xe="tag";function Te(e){var t=new URLSearchParams(void 0===e?window.location.search:e.search).get(xe);return null===t?void 0:t}function Ae(e){void 0===e&&(e=new URL(window.location.href));var t=Te(e);if(void 0===t)return e;var i=ke(t,(0,T.getCurrentGender)(e)),s=new URLSearchParams(e.search);return s.delete(xe),s.sort(),e.search=s.toString(),e.pathname=i,e}function Pe(){var e=Oe().split("/");if("tag"===e[0])return e[1].toLowerCase()}function ke(e,t){return Boolean(e)?t===T.Gender.All?"/tag/".concat(e,"/"):"/tag/".concat(e,"/").concat(T.GendersSymbolToNameMap.get(t),"/"):""}var Me="hmpgFiltAllParams",Re={days:7};function Ie(){var e;if(void 0!==window.sessionStorage&&null!==window.sessionStorage.getItem(Me)?e=window.sessionStorage.getItem(Me):void 0!==window.localStorage&&null!==window.localStorage.getItem(Me)&&(e=function(e){var t,i=window.localStorage.getItem(e);if(null!==i)return null===(t=P(i,(function(){return window.localStorage.removeItem(e)})))||void 0===t?void 0:t.value}(Me)),""!==e&&null!=e)return e}function Ee(e){return void 0===e&&(e=(new M).state),{regions:e.regions,ageMin:e.ageMin,ageMax:e.ageMax,privatePrices:e.privatePrices,roomSize:e.roomSize,spokenLanguages:e.spokenLanguages,tags:e.tags}}function Le(e){return 0!==Object.values(Ee(e)).filter((function(e){return void 0!==e})).length}function De(){if(qe()&&!Le()){var e=Be().href;window.history.replaceState(void 0,"",e)}}function Be(e){void 0===e&&(e=new URL(window.location.href));var t=Ie();if(void 0===t)return e;var i=new URLSearchParams(e.search),s=new URLSearchParams(t),o=!0,r=!1,a=void 0;try{for(var l,h=s[Symbol.iterator]();!(o=(l=h.next()).done);o=!0){var d,c=n(l.value,2),u=c[0],p=c[1],m=u===X&&x()&&null!==(d=we.get(p))&&void 0!==d?d:p;i.set(u,m)}}catch(e){r=!0,a=e}finally{try{o||null==h.return||h.return()}finally{if(r)throw a}}return i.sort(),e.search=i.toString(),Ae(e)}var Ue=/[^a-zA-Z0-9_\-]+/g;function Fe(e){var t;void 0===e&&(e=null!==(t=new URLSearchParams(window.location.search).get("keywords"))&&void 0!==t?t:"");var i=Pe(),s=[],n=[];return e.split(" ").forEach((function(e){var t=e.startsWith("#");(e=e.replace(Ue,"")).length<=0||(t?e!==i&&n.push(e):s.push(e))})),[s,n]}function _e(e,t){e=null!=e?e:"page";var i=void 0!==t?t.search:window.location.search,s=new URLSearchParams(i).get(e);if(null!==s){var n=parseInt(s);if(!isNaN(n))return Math.min(Math.max(n,1),E)}return 1}function Ne(e,t){return{offset:((e=null!=e?e:_e())-1)*(t=null!=t?t:R),limit:t}}function Oe(e){var t=null!=e?e:window.location.pathname;return t.match(/^\/\w{2}\//)?t=t.slice(4):t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),t}function He(e){var t;return null!==(t=Oe(e).split("/")[0])&&void 0!==t?t:""}function We(e){return"followed-cams"===He(e)}function $e(){var e,t=null!==(e=Oe().split("/")[1])&&void 0!==e?e:"";return We()&&"offline"===t}function Ve(){var e;return[pe(),ge(),Se(),(e=He(),F.get(e))].some((function(e){return void 0!==e}))}function ze(){return"spy-on-cams"===He()}function Ge(e){var t=Oe(e);return["","top","female-cams","male-cams","trans-cams","couple-cams","accounts/welcome"].includes(t)}function qe(e){return w()&&(Ge(e)||"tag"===He(e))}function je(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0!==window["prefetch-type"]&&window.newrelic.addPageAction("RoomlistPrefetchStats",s({action:e,loadType:window["prefetch-type"]},t))}},9229:(e,t,i)=>{"use strict";function s(e){let t=0;return void 0!==e.days&&(t+=24*e.days*60*60),void 0!==e.hours&&(t+=60*e.hours*60),void 0!==e.minutes&&(t+=60*e.minutes),void 0!==e.seconds&&(t+=e.seconds),t}i.d(t,{X:()=>s})},7063:(e,t,i)=>{"use strict";i.d(t,{N6:()=>m,zm:()=>r,lI:()=>c,_O:()=>u,AP:()=>l,GW:()=>d,a:()=>s,WI:()=>h,gn:()=>p,nx:()=>o,VE:()=>n});var s={};function n(e){const t=e.toLowerCase().split("_");for(let e=0;ef,createTracer:()=>b,newRelicEnabled:()=>v,setCustomAttribute:()=>y});var a=i(7193);let l=window.gettext;void 0===l&&((0,a.R8)("gettext is undefined."),l=e=>e);let h=window.ngettext;void 0===h&&((0,a.R8)("ngettext is undefined."),h=(e,t,i)=>i>1?t:e);let d=window.interpolate;function c(e){const t=(Date.now()-e.getTime())/1e3;if(t<60)return l("now");if(t<3600){const e=Math.floor(t/60);return d(h("%(minutes)s minute ago","%(minutes)s minutes ago",e),{minutes:e},!0)}if(t<=86400){const e=Math.floor(t/3600);return d(h("%(hours)s hour ago","%(hours)s hours ago",e),{hours:e},!0)}if(t<604800){const e=Math.floor(t/86400);return d(h("%(days)s day ago","%(days)s days ago",e),{days:e},!0)}return e.toLocaleDateString()}function u(e,t=!0){if(e<=0)return"";const i=Math.floor(e/3600);e%=3600;const s=Math.floor(e/60);e%=60;let n="";(i>1||1===i)&&(n=`${i}h`);let o="";return s>=1?o=`${s}m`:0===s&&(o=t?"":"<1m"),i>0&&s>0&&(o=` ${o}`),`${n}${o}${t?`${e}s`:""}`}function p(e,t){return(e.getTime()-t.getTime())/1e3}void 0===d&&((0,a.R8)("interpolate is undefined."),d=(e,t,i)=>i?e.replace(/%\(\w+\)s/g,(e=>{const i=e.slice(2,-2);return String(t[i])})):e.replace(/%s/g,(()=>String(t.shift()))));class m{constructor(e){if(this.parsed={},this.usedFields={},"string"==typeof e){this.stringMessage=e;try{this.parsed=JSON.parse(e)}catch(t){this.parsed={},(0,a.z3)("Cannot JSON parse",{message:e})}}else"object"==typeof e?(this.parsed=e,this.stringMessage=JSON.stringify(e)):(this.parsed={},this.stringMessage=JSON.stringify(this.parsed),(0,a.z3)("Invalid input type",{message:e}))}keys(){return Object.keys(this.parsed)}unusedFields(){const e=[];for(const t in this.parsed)!0!==this.usedFields[t]&&e.push(t);return e}ignore(e){this.usedFields[e]=!0}getParsed(){return Object.assign({},this.parsed)}getAny(e){if(this.ignore(e),null!==this.parsed[e])return this.parsed[e]}getList(e,t=!0){if(this.ignore(e),Array.isArray(this.parsed[e]))return this.parsed[e].map((i=>(t&&"object"!=typeof i&&"string"!=typeof i&&(0,a.R8)(`getList(${e}): called on Array with invalid items`,{message:this.stringMessage,item:i}),new m(i))))}getStringList(e,t=!0){return this.ignore(e),Array.isArray(this.parsed[e])?this.parsed[e].map((i=>(t&&"string"!=typeof i&&(0,a.R8)(`getStringList(${e}): called on Array with invalid items`,{message:this.stringMessage,item:i}),i))):[]}getStringListOrUndefined(e,t=!0){if(this.ignore(e),Array.isArray(this.parsed[e]))return this.getStringList(e,t)}getAsString(e){return`${this.getAny(e)}`}getStringOrUndefined(e,t=!0){const i=this.getAny(e);if("string"==typeof i)return i;t&&void 0!==i&&(0,a.R8)(`getStringOrUndefined(${e}): is wrong type`,{message:this.stringMessage,item:i})}getString(e,t=!0){const i=this.getAny(e);return"string"!=typeof i?(t&&(0,a.R8)(`getString(${e}): is wrong type`,{message:this.stringMessage,item:i}),""):i}getStringWithNumbers(e,t=!0){const i=this.getAny(e);return"string"!=typeof i&&"number"!=typeof i?(t&&(0,a.R8)(`getStringWithNumbers(${e}): is wrong type`,{message:this.stringMessage,item:i}),""):`${i}`}getStringWithNumbersOrBoolean(e,t=!0){const i=this.getAny(e);return"string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i?(t&&(0,a.R8)(`getStringWithNumbersOrBoolean(${e}): is wrong type`,{message:this.stringMessage,item:i}),""):"boolean"==typeof i?i:`${i}`}getStrings(e){const t=new Map;for(const i of e)void 0!==this.getStringOrUndefined(i,!1)&&t.set(i,this.getStringOrUndefined(i,!1));return t}getBoolean(e,t=!1,i=!0){const s=this.getAny(e);return"boolean"!=typeof s?(i&&(0,a.R8)(`getBoolean(${e}): is wrong type`,{message:this.stringMessage,item:s}),t):s}getBooleanOrUndefined(e,t=!0){const i=this.getAny(e);if("boolean"==typeof i)return i;t&&void 0!==i&&(0,a.R8)(`getBoolean(${e}): is wrong type`,{message:this.stringMessage,item:i})}getNumber(e,t=!0){const i=this.getAny(e);return"number"!=typeof i?(t&&(0,a.R8)(`getNumber(${e}): is wrong type`,{message:this.stringMessage,item:i}),NaN):i}getNumberOrUndefined(e,t=!0){const i=this.getAny(e);if("number"==typeof i)return i;t&&void 0!==i&&(0,a.R8)(`getNumberOrUndefined(${e}): is wrong type`,{message:this.stringMessage,item:i})}getParsedSubMap(e){return new m(this.getObject(e))}getParsedSubMapOrUndefined(e,t=!0){const i=this.getObjectOrUndefined(e,t);if(void 0!==i)return new m(i)}getMap(e,t=!0){const i=this.getObjectString(e,t);return new m(""===i?"{}":i)}getObjectString(e,t=!0){const i=this.getAny(e);return"object"!=typeof i?(t&&(0,a.R8)(`getObjectString(${e}): is wrong type`,{message:this.stringMessage,item:i}),""):JSON.stringify(i)}getObjectStringOrUndefined(e,t=!0){const i=this.getAny(e);if("object"==typeof i)return JSON.stringify(i);t&&void 0!==i&&(0,a.R8)(`getObjectStringOrUndefined(${e}): is wrong type`,{message:this.stringMessage,item:i})}getObject(e,t=!0){const i=this.getAny(e);return"object"!=typeof i?(t&&(0,a.R8)(`getObject(${e}): is wrong type`,{message:this.stringMessage,item:i}),{}):i}getObjectOrUndefined(e,t=!0){const i=this.getAny(e);if("object"==typeof i)return i;t&&void 0!==i&&(0,a.R8)(`getObjectOrUndefined(${e}): is wrong type`,{message:this.stringMessage,item:i})}logUnusedDebugging(e){for(const t of this.unusedFields()){const i="object"==typeof this.parsed[t]?JSON.stringify(this.parsed[t]):this.parsed[t];(0,a.Yz)(`Unhandled message argument: . Key:${t} Value:${i} in ${e}`)}}}new Map([["en","English"],["id","Bahasa Indonesia"],["ca","Català (Catalan)"],["da","Dansk (Danish)"],["de","Deutsch (German)"],["es","Español (Spanish)"],["fr","Français (French)"],["it","Italiano (Italian)"],["hu","Magyar (Hungarian)"],["nl","Nederlands (Dutch)"],["no","Norsk (Norwegian)"],["pl","Polski (Polish)"],["pt","Português (Portuguese)"],["ro","Română (Romanian)"],["sk","Slovenčina (Slovak)"],["fi","Suomi (Finnish)"],["sv","Svenska (Swedish)"],["tl","Tagalog"],["vi","Tiếng Việt (Vietnamese)"],["tr","Türkçe (Turkish)"],["cs","Čeština (Czech)"],["el","Ελληνικά (Greek)"],["bg","Български (Bulgarian)"],["ru","Русский (Russian)"],["uk","Українська (Ukrainian)"],["ar","العربية (Arabic)"],["ms","بهاس ملايو (Malay)"],["hi","मानक हिन्दी (Hindi)"],["th","ภาษาไทย (Thai)"],["zh","中文 (Chinese)"],["ja","日本語 (Japanese)"],["ko","한국어 (Korean)"]]);const g=window.newrelic;function v(){return void 0!==g}function f(e,t={}){try{if(void 0===g)return void(0,a.Yz)(`New Relic is disabled, not sending metric: ${e}`);0===Object.keys(t).length?g.addPageAction(e):g.addPageAction(e,t)}catch(e){(0,a.z3)(`New Relic Error in addPageAction: ${e}`)}}function y(e,t){try{if(void 0===g)return;g.setCustomAttribute(e,t)}catch(e){(0,a.z3)(`New Relic Error in setCustomAttribute: ${e}`)}}function b(e,t){return v()?((0,a.Yz)(`Tracing ${e} with New Relic`),g.interaction().createTracer(e,t)):t}},7623:(e,t,i)=>{"use strict";i.d(t,{Ni:()=>K,xv:()=>w,J8:()=>A,AD:()=>Q,yb:()=>_,ru:()=>N,m0:()=>X,o:()=>v,Hg:()=>d,H8:()=>k,_6:()=>M,UQ:()=>J,gm:()=>R,lj:()=>h,Ap:()=>b,lT:()=>H,Cc:()=>W,Pf:()=>l,Xb:()=>O,xe:()=>f,rm:()=>y,sb:()=>C,vM:()=>P,H9:()=>z,nr:()=>I,Pb:()=>L,hj:()=>E,wP:()=>Y,hl:()=>V,mz:()=>S,BS:()=>j,YU:()=>q,OF:()=>F,J0:()=>D,aq:()=>B,tJ:()=>U,p0:()=>G});var s=i(7193);const n=window.Hls;let o;const r={chrome:79,firefox:78,edge:90,safari:13},a={chrome:79,crios:79,firefox:115,fxios:115,safari:13,samsungbrowser:15};function l(){if(void 0===o){const e="cbModernizr";let t=!0;try{window.localStorage.setItem(e,e),window.localStorage.removeItem(e)}catch(e){t=!1}(0,s.Yz)(`local storage support = ${t}`),o=t}return o}function h(){return void 0!==window.history&&void 0!==window.history.pushState}function d(){try{return!!document.createElement("audio").canPlayType}catch(e){return!1}}let c,u,p,m,g;function v(){if(void 0!==c)return c;let e;c=!1;try{if("webkitAudioContext"in window)e=new webkitAudioContext;else{if(!("AudioContext"in window))return c;e=new AudioContext}if(null===e)return c;c="function"==typeof e.createGain&&"function"==typeof e.decodeAudioData&&"function"==typeof e.createBufferSource&&"function"==typeof e.createBufferSource().start,"function"==typeof e.close&&e.close()}catch(e){(0,s.z3)("Error checking for audio context",{reason:e.toString()})}return c}function f(){if(void 0!==u)return u;const e=document.createElement("audio");return u="function"==typeof e.canPlayType&&""!==e.canPlayType("audio/mpeg;codecs=mp3"),u}function y(){const e=document.createElement("video").canPlayType("application/vnd.apple.mpegurl");return"probably"===e||"maybe"===e}function b(){return y()||n.isSupported()}function w(){return window.hasOwnProperty("requestAnimationFrame")?window.requestAnimationFrame:window.hasOwnProperty("webkitRequestAnimationFrame")?window.webkitRequestAnimationFrame:window.hasOwnProperty("mozRequestAnimationFrame")?window.mozRequestAnimationFrame:e=>(window.setTimeout((()=>{e(0)}),1e3/7),Date.now())}function C(){if(void 0!==p)return p;try{const e=Object.defineProperty({},"passive",{get:function(){p=!0}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e),void 0===p&&(p=!1)}catch(e){p=!1}return p}function S(){if(void 0!==m)return m;try{const e=document.createElement("audio");e.volume=.5,m=.5===e.volume}catch(e){m=!1}return m}let x,T=!1;function A(){if(null!==document.scrollingElement)return document.scrollingElement;if(void 0!==g&&!T)return g;const e=document.documentElement.scrollTop;return document.documentElement.style.height=`${window.innerHeight+1}px`,document.documentElement.scrollTop=e+1,g=document.documentElement.scrollTop!==e?document.documentElement:document.body,document.documentElement.style.height="",document.documentElement.scrollTop=e,T=!1,g}function P(){return void 0!==window.performance&&void 0!==window.performance.now}function k(){return void 0!==window.chrome&&(!!window.chrome.loadTimes||!!window.chrome.webstore||!!window.chrome.runtime)||/CriOS/i.test(navigator.userAgent)}function M(){return/Edge\//i.test(navigator.userAgent)}function R(){return null!==/Firefox/.exec(navigator.userAgent)||void 0!==window.InstallTrigger}function I(){const e=/CriOS|FxiOS/i.test(navigator.userAgent);if(F()&&/WebKit/i.test(navigator.userAgent)&&!e)return!0;let t=!1;return void 0!==window.safari&&void 0!==window.safari.pushNotification&&(t="[object SafariRemoteNotification]"===window.safari.pushNotification.toString()),/Safari/i.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&!e||t}function E(){return[/SM-T827R4/,/SM-T550/,/SM-T330/,/SM-T232/,/SM-T335/,/SM-T813/,/SM-T510/].some((e=>e.test(navigator.userAgent)))}function L(){return/SamsungBrowser/i.test(navigator.userAgent)}function D(){return(/iPad/i.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&void 0===window.MSStream}function B(){return/iPhone/i.test(navigator.userAgent)&&void 0===window.MSStream}function U(){return/iPod/i.test(navigator.userAgent)&&void 0===window.MSStream}function F(){return U()||B()||D()}function _(){if(F()){let e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/);if(null===e&&(e=navigator.userAgent.match(/Version\/(\d+)/),null===e))return;return parseInt(e[1])}}function N(){const e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/);if(F()&&null!==e)return{major:parseInt(e[1]),minor:parseInt(e[2]),patch:parseInt(e[3])}}function O(){return/Android|webOS|BlackBerry|IEMobile|Opera Mini|SamsungBrowser/i.test(navigator.userAgent)||F()}function H(){return!!document.documentMode}function W(){return H()&&void 0===window.atob}function $(e,t){const i=O()?a:r;return i.hasOwnProperty(e)&&t>=i[e]}function V(){const e=window.navigator.userAgent.toLowerCase(),t=e.match(/edg\/(\d+)/);if(t)return $("edge",parseFloat(t[1]));if(I()){const t=e.match(/version\/([\d.]+)/);if(t)return $("safari",parseFloat(t[1]))}const i=e.match(/(chrome|firefox|samsungbrowser|crios|fxios)/),s=e.match(/(chrome|firefox|samsungbrowser|crios|fxios)[\s\/](\d+)/);if(i&&s){const e=parseFloat(s[2]);return $(i[1],e)}return!1}function z(){return/Puffin/i.test(navigator.userAgent)}function G(){let e="unload";return F()&&I()&&(e="pagehide"),e}function q(){return"object"==typeof navigator&&"object"==typeof navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia}function j(){return Boolean(navigator.userAgent.match(/Puffin/i))}function Z(){const e=/Edg(|e|A|iOS)\/\d+/.exec(navigator.userAgent);return null!==e?parseInt(e[0].split("/")[1],10):0}function K(){const e=N();return{platform:navigator.platform,userAgent:navigator.userAgent,maxTouchPoints:void 0!==navigator.maxTouchPoints?navigator.maxTouchPoints:0,iosVersionMajor:void 0!==e?e.major:0,iosVersionMinor:void 0!==e?e.minor:0,iosVersionPatch:void 0!==e?e.patch:0,edgeVersionMajor:Z(),isDefinedMSStream:void 0!==window.MSStream,isDefinedInstallTrigger:void 0!==window.InstallTrigger,isPresentChromeLoadTimes:void 0!==window.chrome&&!!window.chrome.loadTimes,isPresentChromeWebStore:void 0!==window.chrome&&!!window.chrome.webstore,isPresentChromeRunTime:void 0!==window.chrome&&!!window.chrome.runtime,safariPushNotifications:void 0!==window.safari?window.safari.pushNotification.toString():""}}function J(){return!0===x}window.setTimeout((()=>{T=!0}),200),new Promise((e=>{if(void 0!==x)e(x);else{const t=new Image;t.onerror=()=>{e(!1)},t.onload=()=>{x=2!==t.width,e(x)},t.src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgAASUkqAAgAAAABABIBAwABAAAABgASAAAAAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAABAAIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iiiigD/2Q=="}})).then((e=>{x=e,(0,s.Yz)("exif: ",x)})).catch((()=>{}));const Y="scroll-behavior"in document.createElement("div").style;function Q(){return!!(/Android/i.test(navigator.userAgent)||F()||navigator.userAgent.indexOf("Mac"))}function X(){return/Android/i.test(navigator.userAgent)}},8861:(e,t,i)=>{"use strict";i.d(t,{$G:()=>a,I7:()=>o,Yj:()=>h,oD:()=>n,pH:()=>l,uC:()=>r});var s=i(9229);function n(e){const t=e.length+1;return document.cookie.split(";").map((e=>e.trim())).filter((i=>i.substring(0,t)===`${e}=`)).map((e=>decodeURIComponent(e.substring(t))))[0]}function o(e){var t;return null!==(t=n(e))&&void 0!==t?t:""}function r(e,t,i,n="/"){const o=new Date;o.setTime(o.getTime()+1e3*(0,s.X)(i)),document.cookie=`${e}=${t}; expires=${o.toUTCString()}; path=${n}`}function a(e,t){document.cookie=`${e}=${t}; path=/`}function l(e){const t=n(e);if(void 0===t)return t;const i=parseInt(t);return isNaN(i)?void 0:i}function h(e){r(e,"",{days:-1})}},2758:(e,t,i)=>{"use strict";i.d(t,{TS:()=>r,aR:()=>h,fc:()=>d,nw:()=>a,y1:()=>l});var s=i(9229),n=i(8861);const o=(e,t)=>{try{const s=JSON.parse(e);return"object"!=typeof(i=s)||void 0===i.expiration||"number"!=typeof i.expiration||s.expiration<(new Date).getTime()?void t():s}catch(e){return}var i};function r(e){var t;const i=window.sessionStorage.getItem(e);if(null!==i)return null===(t=o(i,(()=>window.sessionStorage.removeItem(e))))||void 0===t?void 0:t.value}function a(e,t,i){const n=new Date;n.setTime(n.getTime()+1e3*(0,s.X)(i));const o=JSON.stringify({value:t,expiration:n.getTime()});window.sessionStorage.setItem(e,o)}function l(e){var t;const i=window.localStorage.getItem(e);if(null!==i)return null===(t=o(i,(()=>window.localStorage.removeItem(e))))||void 0===t?void 0:t.value}function h(e,t,i){const n=new Date;n.setTime(n.getTime()+1e3*(0,s.X)(i));const o=JSON.stringify({value:t,expiration:n.getTime()});window.localStorage.setItem(e,o)}function d(e,t){const i=(0,n.oD)(e);return void 0!==i&&(h(e,i,t),(0,n.Yj)(e)),i}}}]); //# sourceMappingURL=319-prod-e1d4c58fb1a49d9e718e.js.map