1(function(){function $e(){var e=document.getElementById("chatMsgPopover"),t=document.getElementById("chatMsgInput");e&&e.classList.remove("show"),t&&(t.value="");var n=document.getElementById("chatMessages");n&&(n.innerHTML="")}function Je(e,t){var n=document.getElementById("chatMessages");if(n){var o=document.createElement("div");for(o.className="chat-msg-bubble "+(t?"chat-msg-mine":"chat-msg-theirs"),o.textContent=e,n.appendChild(o);n.children.length>6;)n.removeChild(n.firstChild);setTimeout(function(){o.style.opacity="0",setTimeout(function(){o.parentNode&&o.parentNode.removeChild(o)},500)},8e3)}}let r=null,m=null,Ie=null,s=null,A=!1,L=null,Xe=null,we=null,Ne=null,Se=null,Tn=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.ip?ANONCAM_DATA.ip:null,Dt=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.isUserLoggedIn&&ANONCAM_DATA.wpUsername?ANONCAM_DATA.wpUsername:"",j=null,D=null,R=null,Ce=!1,ke=!1,V=0,Me=0,X=!1,Z=null,G=null,y=null,H=null;window.socket=r,window.currentRemoteUserId=L,window.currentRemoteUsername=D;let Et=!1;const It="2.8.0";let ue=[],Ze=null;const St=3e3;function kt(){R=Date.now(),Ce=!1,ke=!1}function Q(e){!R||ke||(ke=!0,Ce=!1,R=null)}function Bt(e){e&&(ue.includes(e)||ue.push(e),clearTimeout(Ze),Ze=setTimeout(Qe,St))}function Qe(){if(ue.length===0)return;const e=[...ue];ue=[];const t=new URLSearchParams({action:"meetgle_save_matches_batch",matched_usernames:JSON.stringify(e)});fetch(ANONCAM_DATA.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t,keepalive:!0}).catch(n=>{})}window.addEventListener("beforeunload",()=>{Qe()});function _e(){if(!ANONCAM_DATA||!ANONCAM_DATA.isUserLoggedIn||!R)return;const e=Math.floor((Date.now()-R)/1e3);R=null,e>=10&&typeof window.meetgleApplyLiveChatTime=="function"&&window.meetgleApplyLiveChatTime(e)}let N=!1,fe=null;const Ft=5e3,Te={FACING_MODE:"meetgle_camera_facing_mode",MIC_ENABLED:"meetgle_mic_enabled"};let W="user",v=!0,q="",ee="",te="";window.addEventListener("genderUpdated",function(e){e.detail&&e.detail.gender&&(q=e.detail.gender)});function Be(){return window.loadGenderPreference?window.loadGenderPreference():""}function et(e){window.saveGenderPreference&&window.saveGenderPreference(e)}function Lt(){return window.loadGenderFilterPreference?window.loadGenderFilterPreference():""}function Pt(e){window.saveGenderFilterPreference&&window.saveGenderFilterPreference(e)}function bt(){return window.loadCountryFilterPreference?window.loadCountryFilterPreference():""}function xt(e){window.saveCountryFilterPreference&&window.saveCountryFilterPreference(e)}function tt(){return window.loadBlurPreference?window.loadBlurPreference():!1}function nt(e){window.saveBlurPreference&&window.saveBlurPreference(e)}function ot(){try{return localStorage.getItem(Te.FACING_MODE)==="environment"?"environment":"user"}catch(e){return"user"}}function Ut(e){try{localStorage.setItem(Te.FACING_MODE,e==="environment"?"environment":"user")}catch(t){}}function it(){try{const e=localStorage.getItem(Te.MIC_ENABLED);return e===null?!0:e!=="false"}catch(e){return!0}}function jt(e){try{localStorage.setItem(Te.MIC_ENABLED,e?"true":"false")}catch(t){}}function Fe(e,t=!1){I&&(e?(Pe&&(I.innerHTML=`<img src="${Pe}" alt="Mic Off" width="20" height="20" style="margin-bottom: -4px;" />`),I.classList.add("muted"),t&&c(ANONCAM_DATA.lang.js_mic_muted||"Your microphone is muted")):(ge&&(I.innerHTML=`<img src="${ge}" alt="Mic On" width="20" height="20" style="margin-bottom: -4px;" />`),I.classList.remove("muted"),t&&c(ANONCAM_DATA.lang.js_mic_unmuted||"Your microphone is unmuted")))}function Rt(){const e=DOM.remoteVideoWrapper;e&&e.classList.add("blurred")}function Vt(){const e=DOM.remoteVideoWrapper;e&&e.classList.remove("blurred")}function Gt(){fe&&(clearTimeout(fe),fe=null)}let ve=null,z=null,Y=0;const rt=3,Ht=15e3,Wt=1e4;function K(){ve&&(clearTimeout(ve),ve=null),z&&(clearTimeout(z),z=null)}function Ae(e){K(),Y++,Y>=rt?(c(ANONCAM_DATA.lang.js_connection_failed||"Connection failed. Finding a new partner..."),Y=0,S(),A&&setTimeout(()=>{r.emit("stopChat"),setTimeout(()=>{r.emit("startChat",b())},500)},1e3)):c((ANONCAM_DATA.lang.js_connection_issue||"Connection issue (attempt {current}/{max}). Retrying...").replace("{current}",Y).replace("{max}",rt))}const E=document.getElementById("startChatBtn"),me=document.getElementById("nextChatBtn"),ne=document.getElementById("stopChatBtn"),I=document.getElementById("muteBtn"),oe=document.getElementById("switchCameraBtn"),P=document.getElementById("localVideo"),g=document.getElementById("remoteVideo"),$=document.getElementById("statusOutput"),at=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA?ANONCAM_DATA.stunUrl:"",st=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA&&ANONCAM_DATA.turnUrls?ANONCAM_DATA.turnUrls.split(",").map(e=>
1e.trim()).filter(Boolean):[],Le=[];at&&Le.push({urls:at}),st.length&&typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA&&Le.push({urls:st,username:ANONCAM_DATA.turnUsername||"",credential:ANONCAM_DATA.turnPassword||""});const qt={iceServers:Le};let ge=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA&&ANONCAM_DATA.pluginUrl?ANONCAM_DATA.pluginUrl+"public/img/microphone-black-shape.png":"",Pe=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA&&ANONCAM_DATA.pluginUrl?ANONCAM_DATA.pluginUrl+"public/img/mute-microphone.png":"",be=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA&&ANONCAM_DATA.pluginUrl?ANONCAM_DATA.pluginUrl+"public/img/flip.png":"";const lt="meetgle_anon_match_count",ct="meetgle_anon_ad_last_shown_count";function dt(e){if(e===!0||e===1)return!0;if(typeof e=="string"){const t=e.trim().toLowerCase();return t==="1"||t==="true"||t==="yes"||t==="on"}return!1}xe()&&(V=ut(lt,0),Me=ut(ct,0));function ut(e,t=0){try{const n=localStorage.getItem(e),o=parseInt(n,10);return Number.isFinite(o)?o:t}catch(n){return t}}function ft(e,t){try{localStorage.setItem(e,String(t))}catch(n){}}function xe(){if(!ANONCAM_DATA)return!1;const e=dt(ANONCAM_DATA.isUserLoggedIn),t=dt(ANONCAM_DATA.anonInstreamAdsEnabled);return!e&&t}function zt(){if(!ANONCAM_DATA)return 0;const e=parseInt(ANONCAM_DATA.anonInstreamAdsEveryMatches,10);return!Number.isFinite(e)||e<=0?0:e}function Yt(){return ANONCAM_DATA?Array.isArray(ANONCAM_DATA.anonInstreamAdVideos)&&ANONCAM_DATA.anonInstreamAdVideos.length>0?ANONCAM_DATA.anonInstreamAdVideos.map(e=>String(e||"").trim()).filter(Boolean):[]:[]}function At(e){const t=document.querySelector(".meetgle-extra-btn-wrap");t&&(t.style.display=e?"block":"none")}function Kt(){xe()&&(V+=1,ft(lt,V))}function $t(){if(!xe()||X)return!1;const e=zt();return!(!e||V<=0||V%e!==0||V===Me)}function Jt(){const e=DOM.remoteVideoWrapper;if(!e)return!1;if(G&&y)return!0;const t=document.createElement("div");return t.className="anon-instream-ad",t.innerHTML=` 2 <video id="anonInstreamAdVideo" class="anon-instream-ad__video" autoplay playsinline muted loop preload="metadata"></video> 3 <div class="anon-instream-ad__overlay"> 4 <span class="anon-instream-ad__label">Sponsored</span> 5 <p class="anon-instream-ad__message" id="anonInstreamAdMessage"></p> 6 <a class="anon-instream-ad__cta" id="anonInstreamAdCta" target="_blank" rel="noopener noreferrer"></a> 7 </div> 8 `,e.appendChild(t),G=t,y=t.querySelector("#anonInstreamAdVideo"),y&&(y.muted=!0,y.defaultMuted=!0,y.loop=!0,y.playsInline=!0),!!y}function Xt(e){const t=e.slice();for(let n=t.length-1;n>0;n--){const o=Math.floor(Math.random()*(n+1)),i=t[n];t[n]=t[o],t[o]=i}return t}function Zt(e){if(!y)return;const t=Xt(Array.isArray(e)?e.filter(Boolean):[]);if(t.length===0){y.removeAttribute("src"),y.load();return}const n=o=>{if(o>=t.length){console.warn("[Ad] Failed loading all ad videos."),y.removeAttribute("src"),y.load();return}const i=t[o];y.onloadeddata=null,y.onerror=null,y.onloadeddata=()=>{const l=y.play();l&&typeof l.catch=="function"&&l.catch(()=>{n(o+1)})},y.onerror=()=>{n(o+1)},y.src=i,y.load()};n(0)}function mt(){if(G&&(G.classList.remove("is-visible"),X=!1,At(!0),y))try{y.pause()}catch(e){}}function Qt(){if(!X)return!1;mt(),S(),re(),ae(),se(),typeof $e=="function"&&$e();const e=document.getElementById("chatMessages");e&&Array.from(e.children).forEach(n=>{n.id!=="statusOutput"&&n.remove()});const t=Z;return Z=null,typeof t=="function"&&t(),!0}function Oe(){mt(),Z=null}function gt(e){if(!$t()||!Jt())return!1;const t=DOM.remoteVideoWrapper;Z=typeof e=="function"?e:null,X=!0,Me=V,ft(ct,Me);const n=G.querySelector("#anonInstreamAdMessage"),o=G.querySelector("#anonInstreamAdCta"),i=ANONCAM_DATA&&ANONCAM_DATA.anonInstreamAdsMessage?String(ANONCAM_DATA.anonInstreamAdsMessage):"Looking for women? Try gender filters to connect with more women.",l=ANONCAM_DATA&&ANONCAM_DATA.anonInstreamAdsCtaText?String(ANONCAM_DATA.anonInstreamAdsCtaText):"Connect with Women",h=ANONCAM_DATA&&ANONCAM_DATA.anonInstreamAdsCtaUrl?String(ANONCAM_DATA.anonInstreamAdsCtaUrl):"#";n&&(n.textContent=i),o&&(o.textContent=l,o.href=h||"#");const u=Yt();return g&&(g.classList.remove("video-ready"),g.srcObject=null),t&&t.classList.remove("video-loaded"),Zt(u),G.classList.add("is-visible"),At(!1),t&&t.classList.add("has-video"),c(ANONCAM_DATA.lang.js_sponsored_ad||"Sponsored video. Tap Next to continue chatting."),!0}function en(){const e=document.getElementById("meetgleSkeleton");e&&(e.classList.add("hidden"),setTimeout(()=>{e.remove()},300))}window.addEventListener("DOMContentLoaded",()=>{typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.icons&&(ge=ANONCAM_DATA.icons.micOn,Pe=ANONCAM_DATA.icons.micOff,be=ANONCAM_DATA.icons.switchCam),I&&ge&&(I.innerHTML=`<img src="${ge}" alt="Mic On" width="20" height="20" style="margin-bottom: -4px;" />`),oe&&be&&(oe.innerHTML=`<img src="${be}" alt="Switch Camera" width="20" height="20" style="margin-bottom: -4px;" />`),W=ot(),v=it(),P&&(P.dataset.facingMode=W),Fe(!v);const e=document.getElementById("statusOutput");e&&(e.textContent=ANONCAM_DATA.lang.js_connecting||"Connecting...");const t=document.getElementById("settingsBtn"),n=document.getElementById("settingsPopover"),o=document.getElementById("sparkPopup"),i=document.getElementById("blurToggleMenu"),l=document.getElementById("muteBtnMenu"),h=document.getElementById("blurToggleRow"),u=document.getElementById("micToggleRow"),M=document.getElementById("switchCameraRow"),w=document.getElementById("settingsIndicator");function p(){if(!w)return;N||!v?w.classList.add("show"):w.classList.remove("show")}t&&n&&(t.addEventListener("click",a=>{a.stopPropagation(),o&&o.classList.remove("show");var T=document.getElementById("chatMsgPopover");T&&T.classList.remove("show"),n.classList.toggle("show")}),document.addEventListener("click",a=>{n&&!n.contains(a.target)&&!t.contains(a.target)&&n.classList.remove("show");const T=document.getElementById("sparkBtn");o&&!o.contains(a.target)&&(!T||!T.contains(a.target))&&o.classList.remove("show");const de=document.getElementById("chatMsgPopover"),U=document.getElementById("chatMsgBtn");de&&!de.contains(a.target)&&(!U||!U.contains(a.target))&&de.classList.remove("show")}));const d=document.getElementById("chatMsgBtn"),O=document.getElementById("chatMsgPopover"),f=document.getElementById("chatMsgInput"),k=document.getElementById("chatMsgForm");var C=document.getElementById("chatMsgNewPill");
8C&&!localStorage.getItem("meetgle_chatmsg_seen")&&(C.style.display="block"),d&&O&&d.addEventListener("click",a=>{if(a.stopPropagation(),n&&n.classList.remove("show"),o&&o.classList.remove("show"),O.classList.toggle("show"),O.classList.contains("show")&&f&&setTimeout(()=>f.focus(),50),C&&C.style.display!=="none"){C.style.display="none";try{localStorage.setItem("meetgle_chatmsg_seen","1")}catch(T){}}}),k&&k.addEventListener("submit",a=>{a.preventDefault(),_()}),f&&f.addEventListener("keydown",a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),_())});function _(){if(!(!f||!r||!A)){var a=f.value.trim();a&&(f.value="",r.emit("sendMessage",a),Je(a,!0))}}h&&i&&(N=tt(),N&&i.classList.add("checked"),h.addEventListener("click",a=>{a.stopPropagation(),N=!N,nt(N),N?i.classList.add("checked"):i.classList.remove("checked");const T=document.getElementById("blurToggle");T&&(T.checked=N),p()})),u&&l&&u.addEventListener("click",a=>{a.stopPropagation(),pt(),je()}),M&&M.addEventListener("click",a=>{a.stopPropagation(),yt(),n&&n.classList.remove("show")});const le=document.getElementById("blurToggle");le&&(N=tt(),le.checked=N,le.addEventListener("change",a=>{N=a.target.checked,nt(N),i&&(N?i.classList.add("checked"):i.classList.remove("checked"))}));const B=document.getElementById("genderMale"),F=document.getElementById("genderFemale"),x=document.getElementById("genderPickerContainer"),he=document.getElementById("genderPrefEveryone"),Fn=document.getElementById("genderStep1"),Ln=document.getElementById("genderStep2"),ce=document.getElementById("preStartControls");let Ee="";if(B&&F&&x){let a=function(U){Ee=U,_n(U),setTimeout(()=>{x.classList.add("gp-step2")},250)};var Pn=a;q=Be(),!q&&typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.isPremium&&(q="female",et("female")),window.closeGenderDrawer?closeGenderDrawer():x.style.display="none",q&&ce&&(ce.style.display="flex"),B.addEventListener("click",()=>a("male")),F.addEventListener("click",()=>a("female"));const T=document.getElementById("genderPickerBack");T&&T.addEventListener("click",ze),he&&he.addEventListener("click",()=>{he.classList.add("is-selected"),q=Ee,et(Ee),setTimeout(()=>{window.closeGenderDrawer?closeGenderDrawer():x.style.display="none",ze();var U=document.getElementById("startChatBtn");U?U.click():ce&&(ce.style.display="flex")},200)});const de=document.getElementById("genderPickerClose");de&&de.addEventListener("click",()=>{window.closeGenderDrawer?closeGenderDrawer():x.style.display="none",ze(),ce&&(ce.style.display="flex")})}function ze(){Ee="";var a=document.getElementById("genderPickerContainer");a&&a.classList.remove("gp-step2"),B&&B.classList.remove("is-selected"),F&&F.classList.remove("is-selected"),he&&he.classList.remove("is-selected")}function _n(a){!B||!F||(B.classList.toggle("is-selected",a==="male"),F.classList.toggle("is-selected",a==="female"))}const Ye=document.getElementById("genderFilter"),Ot=ANONCAM_DATA.isAdmin||window.canUseFilters===!0;Ye&&(Ot&&(ee=Lt(),Ye.value=ee),Ye.addEventListener("change",a=>{ee=a.target.value,Pt(ee)}));const Ke=document.getElementById("countryFilter");if(Ke&&(Ot&&(te=bt(),Ke.value=te),Ke.addEventListener("change",a=>{te=a.target.value,xt(te)})),setTimeout(()=>{window.dispatchEvent(new CustomEvent("filtersInitialized",{detail:{gender:ee,country:te}}))},0),m){try{m.getTracks().forEach(a=>a.stop())}catch(a){}m=null}ht(),We(),en()}),window.addEventListener("DOMContentLoaded",async()=>{const e=document.getElementById("startChatBtn");e&&(e.disabled=!0,e.style.opacity="0.5",e.style.cursor="not-allowed");let t=!0;if(window.checkBrowserStatus&&(t=window.checkBrowserStatus()),!t)return;const n=await pn();Xe=n.countryCode||"",window.checkVpnStatus&&(t=await window.checkVpnStatus(!1,n)),e&&t&&(e.disabled=!1,e.style.opacity="1",e.style.cursor="pointer")});function tn(e){const t=document.getElementById("meetgleSrAnnounce");t&&(t.textContent="",t.textContent=e)}function c(e){$&&($.textContent=e,$.style.display="block")}function Ue(){$&&($.style.display="none")}function nn(){$&&($.style.display="block")}function pe(e){e||(e=ANONCAM_DATA.lang.js_finding_partner||"Finding a new partner...");const t=DOM.remoteVideoWrapper;t&&(t.classList.remove("video-loaded"),t.classList.add("has-video")),g&&g.classList.remove("video-ready"),c(e)}function S(){K(),s&&(s.close(),s=null),g&&(g.srcObject=null),Ie=null,Se=null,j=null}
8function on(){m&&(m.getTracks().forEach(e=>e.stop()),P.srcObject=null,m=null)}function pt(){v=!v,jt(v),m&&m.getAudioTracks().forEach(t=>{t.enabled=v}),g&&(g.muted=!1),Fe(!v,!0),je()}function je(){const e=DOM.muteBtnMenu,t=DOM.micStatusLabel;if(!e)return;let n=!v;if(m){const i=m.getAudioTracks();i.length>0&&(n=!i[0].enabled)}n?(e.classList.remove("on"),t&&(t.textContent=ANONCAM_DATA.lang.js_muted||"Muted")):(e.classList.add("on"),t&&(t.textContent=ANONCAM_DATA.lang.js_on||"On"));const o=DOM.settingsIndicator;o&&(n||N?o.classList.add("show"):o.classList.remove("show"))}async function yt(){if(!m)return;m.getVideoTracks().forEach(n=>{n.stop(),m.removeTrack(n)});let t=(P.dataset.facingMode||"user")==="user"?"environment":"user";P.dataset.facingMode=t;try{const o=(await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:t}},audio:!1})).getVideoTracks()[0];m.addTrack(o),P.srcObject=m,s&&s.getSenders().forEach(l=>{l.track&&l.track.kind==="video"&&l.replaceTrack(o)}),W=t,Ut(W),c(ANONCAM_DATA.lang.js_camera_switched||"Switched camera.")}catch(n){c(ANONCAM_DATA.lang.js_camera_switch_failed||"Could not switch camera.")}}I&&I.addEventListener("click",pt),oe&&oe.addEventListener("click",yt);async function vn(){try{const t=(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput"),n=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;t.length>1||n?oe.style.display="inline-block":oe.style.display="none"}catch(e){}}function ht(){if(!r){if(typeof ANONCAM_DATA=="undefined"||!ANONCAM_DATA||!ANONCAM_DATA.socketServer){c(ANONCAM_DATA.lang.js_config_error||"Configuration error. Please refresh the page.");return}r=io(ANONCAM_DATA.socketServer,{transports:["websocket"],reconnection:!0}),window.socket=r,c(ANONCAM_DATA.lang.js_connecting||"Connecting..."),r.on("receiveHeart",e=>{An(),e&&e.isFirstHeart&&(ANONCAM_DATA.isUserLoggedIn?fetch(ANONCAM_DATA.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"meetgle_earn_sparks",nonce:ANONCAM_DATA.spark_earn_nonce,action_type:"received_heart",amount:2})}).then(t=>t.json()).then(t=>{t.success&&(vt(2,ANONCAM_DATA.lang.js_heart_reward||"First heart received this chat!"),wt(t.data.balance))}).catch(t=>{console.error("[Heart Reward] Error:",t)}):Tt(2,ANONCAM_DATA.lang.js_heart_reward||"First heart received this chat!"))}),r.on("connect",()=>{const e=typeof window.getRandomReadyMessage=="function"?window.getRandomReadyMessage():ANONCAM_DATA.lang.js_ready_1||"Ready to go! Start Chat to meet someone.";c(e),A&&(r.emit("startChat",b()),setTimeout(()=>c(ANONCAM_DATA.lang.js_reconnected_looking||"Reconnected. Looking for a new partner..."),100))}),r.on("disconnect",()=>{Q("disconnect"),c(ANONCAM_DATA.lang.js_disconnected_reconnecting||"You have been disconnected. Reconnecting..."),S()}),r.on("status",e=>{A&&c(e)}),r.on("receiveMessage",e=>{Je(e,!1)}),r.on("matched",async e=>{e._debug&&console.warn("[Match Debug]",JSON.stringify(e._debug)),A&&(Oe(),L=e.partnerSocketId,window.currentRemoteUserId=L,D=e.partnerUsername||null,window.currentRemoteUsername=D,j=e.partnerIP||null,window.partnerIPFromMatched=j,Ne=e.partnerGender||null,we=e.partnerCountryCode||null,kt(),Kt(),tn(ANONCAM_DATA.lang.js_a11y_matched||"Connected to a new partner"),ANONCAM_DATA.isUserLoggedIn&&D&&Bt(D),Nt(),g.muted=!1,e.role==="offerer"&&rn().catch(()=>{}),yn(e.partnerUsername,e.partnerGender,e.partnerCountryCode,e.partnerVerificationType,e.partnerStreakCount),c(ANONCAM_DATA.lang.js_matched||"You have matched with a partner."))}),r.on("offer",async e=>{if(A){c(ANONCAM_DATA.lang.js_connecting_partner||"Connecting to partner..."),s||Nt();try{await s.setRemoteDescription(e);const t=await s.createAnswer();await s.setLocalDescription(t),r.emit("answer",t)}catch(t){c(ANONCAM_DATA.lang.js_connection_error||"Something went wrong connecting.")}}}),r.on("answer",async e=>{if(A&&(c(ANONCAM_DATA.lang.js_finalizing||"Finalizing connection..."),!!s&&s.signalingState==="have-local-offer"))try{await s.setRemoteDescription(e)}catch(t){c(ANONCAM_DATA.lang.js_connection_error||"Something went wrong connecting.")}}),r.on("candidate",async e=>{if(A&&s)try{await s.addIceCandidate(e)}catch(t){}}),r.on("partnerLeft",()=>{if(Q("partner_left"),_e(),L=null,window.currentRemoteUserId=null,D=null,j=null,!A)return;c(ANONCAM_DATA.lang.js_partner_left||"Your partner left. Finding a new partner..."),S(),re(),ae(),se();const e=document.getElementById("chatMessages");
8e&&Array.from(e.children).forEach(n=>{n.id!=="statusOutput"&&n.remove()}),!(X||typeof Z=="function"||gt(()=>{A&&(pe(ANONCAM_DATA.lang.js_reconnecting||"Reconnecting..."),r.emit("startChat",b()))}))&&setTimeout(async()=>{A&&(pe(ANONCAM_DATA.lang.js_reconnecting||"Reconnecting..."),r.emit("startChat",b()))},1e3)}),r.on("requeue",()=>{Q("requeue"),L=null,window.currentRemoteUserId=null,D=null,j=null,A&&(X||typeof Z=="function"||(pe(ANONCAM_DATA.lang.js_finding_partner||"Finding a new partner..."),S(),re(),ae(),se(),setTimeout(async()=>{A&&r.emit("startChat",b())},1e3)))}),r.on("forceRefresh",e=>{window.location.reload()}),r.on("accessDenied",e=>{if(console.warn("[Access Token] Access denied:",e.reason),Q("access_denied"),A=!1,ie(),e.reason==="gender_required"){const n=document.getElementById("preStartControls");if(window.openGenderDrawer)openGenderDrawer();else{var t=document.getElementById("genderPickerContainer");t&&(t.style.display="flex")}typeof resetGenderPicker=="function"&&resetGenderPicker(),n&&(n.style.display="none"),c(ANONCAM_DATA.lang.js_select_gender||"Please select your gender to start chatting.");return}else e.reason==="country_required"?c(ANONCAM_DATA.lang.js_location_detect_failed||"Could not detect your location. Refreshing..."):e.reason==="expired"?c(ANONCAM_DATA.lang.js_session_expired||"Session expired. Please refresh the page to continue."):e.reason==="ip_mismatch"?c(ANONCAM_DATA.lang.js_security_failed||"Security check failed. Please refresh the page."):c(ANONCAM_DATA.lang.js_access_failed||"Access verification failed. Please refresh the page.");setTimeout(()=>{window.location.reload()},3e3)}),r.on("idleWarning",e=>{typeof MeetgleModals!="undefined"&&MeetgleModals.showIdleWarning(e,()=>{r&&r.connected&&r.emit("stillHere")})}),r.on("idleDisconnect",e=>{typeof MeetgleModals!="undefined"&&MeetgleModals.showIdleDisconnect(e,()=>{window.location.reload()})}),r.on("sparksEarned",e=>{const{amount:t,reason:n}=e;ANONCAM_DATA.isUserLoggedIn?fetch(ANONCAM_DATA.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"meetgle_earn_sparks",nonce:ANONCAM_DATA.spark_earn_nonce,action_type:"chat_"+(e.duration>=300?"5min":"2min"),amount:t})}).then(o=>o.json()).then(o=>{o.success&&(vt(t,n),wt(o.data.balance),document.dispatchEvent(new CustomEvent("meetgleSparksEarned",{detail:{amount:parseInt(t),balance:o.data.balance}})))}):Tt(t,n)})}}function wt(e){window.updateSparkBalanceDisplay&&window.updateSparkBalanceDisplay(e)}function Nt(){s=new RTCPeerConnection(qt),window.peerConnection=s,K(),ve=setTimeout(()=>{s&&s.connectionState!=="connected"&&Ae("Connection timeout")},Ht),z=setTimeout(()=>{s&&s.iceGatheringState},Wt),m&&m.getTracks().forEach(e=>{s.addTrack(e,m)}),s.ontrack=e=>{Ie=e.streams[0],g.srcObject=Ie,g.classList.remove("video-ready");const t=DOM.remoteVideoWrapper;t&&t.classList.remove("video-loaded");const n=()=>{setTimeout(()=>{g.classList.add("video-ready"),t&&t.classList.add("video-loaded")},300)};g.addEventListener("playing",n,{once:!0}),Ue();const o=()=>{Ue(),g.removeEventListener("playing",o),g.removeEventListener("loadeddata",o)};g.addEventListener("playing",o,{once:!0}),g.addEventListener("loadeddata",o,{once:!0}),N&&setTimeout(()=>{Rt(),Gt(),fe=setTimeout(()=>{Vt(),fe=null},Ft)},100),K(),Y=0,s&&setTimeout(async()=>{try{const i=await s.getStats();i.forEach(l=>{if(l.type==="candidate-pair"&&l.state==="succeeded"&&l.remoteCandidateId){const h=i.get(l.remoteCandidateId);h&&h.ip&&(Se=h.ip)}})}catch(i){}},500)},s.oniceconnectionstatechange=()=>{s&&(s.iceConnectionState==="connected"||s.iceConnectionState==="completed"?(K(),Y=0):s.iceConnectionState==="failed"?Ae("ICE connection failed"):s.iceConnectionState==="disconnected"&&setTimeout(()=>{s&&s.iceConnectionState==="disconnected"&&Ae("ICE connection disconnected")},5e3))},s.onicecandidate=e=>{e.candidate?r.emit("candidate",e.candidate):z&&(clearTimeout(z),z=null)},s.onconnectionstatechange=()=>{s&&(s.connectionState==="connected"?(K(),Y=0,!Ce&&R&&(Ce=!0)):s.connectionState==="connecting"||(s.connectionState==="disconnected"?(c(ANONCAM_DATA.lang.js_connection_unstable||"Connection unstable. Attempting recovery..."),setTimeout(()=>{s&&s.connectionState==="disconnected"&&Ae("Connection remained disconnected")}
8,5e3)):s.connectionState==="failed"?Ae("Connection state failed"):s.connectionState==="closed"&&K()))}}async function rn(){if(s)try{const e=await s.createOffer();await s.setLocalDescription(e),r.emit("offer",e)}catch(e){c(ANONCAM_DATA.lang.js_connection_error||"Something went wrong connecting.")}}async function Ct(){A=!0,window.meetgleMaybeRefreshNonces&&window.meetgleMaybeRefreshNonces(),Oe(),Et=!1,ie();var e=document.getElementById("filterTryMePill");e&&(e.style.display="none"),ne.disabled=!1,window.startPeriodicVpnCheck&&!ANONCAM_DATA.isUserLoggedIn&&(H=window.startPeriodicVpnCheck());const t=DOM.remoteVideoWrapper;t&&(t.classList.remove("video-loaded"),t.classList.add("has-video")),g&&g.classList.remove("video-ready");const n=document.querySelector(".local-video");if(n&&n.classList.add("has-stream"),c(ANONCAM_DATA.lang.js_looking_match||"Looking for a match..."),ht(),m){try{m.getTracks().forEach(i=>i.stop())}catch(i){}m=null}try{W=ot(),v=it();let i={video:{facingMode:{ideal:W}},audio:!0};try{m=await navigator.mediaDevices.getUserMedia(i)}catch(l){m=await navigator.mediaDevices.getUserMedia({video:!0,audio:!0})}m.getAudioTracks().forEach(l=>{l.enabled=v}),P.srcObject=m,P.dataset.facingMode=W,g.muted=!1,Fe(!v),je()}catch(i){c(ANONCAM_DATA.lang.js_camera_access_failed||"Could not access camera/mic."),ie();return}await wn();const o=b();r.emit("startChat",o)}function On(){A=!1,ie(),ne.disabled=!0,E&&(E.disabled=!0),me&&(me.disabled=!0)}function Re(){if(Q("next"),_e(),Qt())return;Ue(),c(ANONCAM_DATA.lang.js_skipping||"Skipping partner..."),S(),re(),ae(),se();const e=document.getElementById("chatMessages");if(e&&Array.from(e.children).forEach(t=>{t.id!=="statusOutput"&&t.remove()}),r&&A){if(r.emit("stopChat"),gt(()=>{A&&(pe(ANONCAM_DATA.lang.js_finding_partner||"Finding a new partner..."),r.emit("startChat",b()))}))return;setTimeout(async()=>{A&&(pe(ANONCAM_DATA.lang.js_finding_partner||"Finding a new partner..."),r.emit("startChat",b()))},500)}}function an(){Q("stop"),_e(),Oe();const e=typeof window.getRandomChatEndedMessage=="function"?window.getRandomChatEndedMessage():ANONCAM_DATA.lang.js_status_10||"That chat's done! Ready for the next one?";A=!1,ne.disabled=!0,H&&(window.stopPeriodicVpnCheck(H),H=null);const t=DOM.remoteVideoWrapper;t&&t.classList.remove("has-video"),g&&(g.srcObject=null),re(),ae(),se(),j=null;const n=document.getElementById("chatMessages");n&&Array.from(n.children).forEach(o=>{o.id!=="statusOutput"&&o.remove()}),r&&r.connected?(r.emit("stopChat"),setTimeout(()=>{S()},500)):S(),ie(),setTimeout(()=>{c(e),nn()},50)}function sn(){if(!A)return;_e(),Oe(),A=!1,H&&(window.stopPeriodicVpnCheck(H),H=null),r&&r.connected&&(r.emit("stopChat"),r.disconnect()),S(),on();const e=DOM.remoteVideoWrapper;e&&e.classList.remove("has-video"),re(),ae(),se(),ie();const t=document.getElementById("chatMessages");t&&Array.from(t.children).forEach(n=>{n.id!=="statusOutput"&&n.remove()})}window.forceStopChat=sn;function ie(){const e=DOM.helpBtn,t=DOM.matchPreferencesBtn,n=DOM.bottomControls,o=DOM.genderPickerContainer,i=DOM.heartBtnContainer,l=DOM.reportBtn,h=DOM.settingsPopover,u=DOM.sparkPopup;var M=document.getElementById("bottomNavBar"),w=document.getElementById("premiumBottomNav"),p=document.getElementById("premiumIdleView"),d=document.getElementById("videoSectionPanel"),O=document.getElementById("controlsChatPanel"),f=document.getElementById("meetgle-video-container"),k=!!(f&&f.classList&&f.classList.contains("meetgle-stage-shell")),C=typeof ANONCAM_DATA!="undefined"&&(ANONCAM_DATA.isPremium===!0||ANONCAM_DATA.isPremium===1||ANONCAM_DATA.isPremium==="1"),_=!!(k&&C);if(f&&f.classList&&(f.classList.toggle("is-chatting",!!A),f.classList.toggle("is-idle",!A),f.classList.toggle("is-premium",C)),A){if(E&&(E.style.display="none"),e&&(e.style.display="none"),t&&(t.style.display="none"),n&&(n.style.display="flex"),M&&(M.style.display="none"),w&&(w.style.display="none"),p){p.style.display="none",d&&(d.style.display=""),O&&(O.style.display="");var le=document.getElementById("premiumSessionBar");le&&(le.style.display="block"),typeof window.premiumSessionStart=="function"&&window.premiumSessionStart()}if(_){var B=document.getElementById("premiumSessionBar");B&&(B.style.display="block"),f.getAttribute("data-stage-session-state")!=="active"&&(f.setAttribute("data-stage-session-state","active"),typeof window.premiumSessionStart=="function"&&window.premiumSessionStart())}window.closeGenderDrawer?closeGenderDrawer():o&&(o.style.display="none"),i&&(i.style.display="flex"),l&&(l.style.display="block")}else{if(E&&(E.style.display="flex"),e&&(e.style.display="flex"),t&&(t.style.display="flex"),n&&(n.style.display="none"),M&&(M.style.display=k?"none":"flex"),w&&(w.style.display=k?"none":"flex"),h&&h.classList.remove("show"),u&&u.classList.remove("show"),p){p.style.display="flex",d&&(d.style.display="none"),O&&(O.style.display="none");var F=document.getElementById("premiumSessionBar");F&&(F.style.display="none"),typeof window.premiumSessionEnd=="function"&&window.premiumSessionEnd(),typeof loadPremiumDashboard=="function"&&loadPremiumDashboard()}if(_){var x=document.getElementById("premiumSessionBar");x&&(x.style.display="none"),f.getAttribute("data-stage-session-state")!=="idle"&&(f.setAttribute("data-stage-session-state","idle"),typeof window.premiumSessionEnd=="function"&&window.premiumSessionEnd()),typeof loadPremiumDashboard=="function"&&loadPremiumDashboard()}o&&Be()&&(window.closeGenderDrawer?closeGenderDrawer():o.style.display="none"),i&&(i.style.display="none"),l&&(l.style.display="none")}}let ln=!!(typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA&&ANONCAM_DATA.isUserLoggedIn);function cn(){if(!Be()){const n=document.getElementById("preStartControls");if(typeof resetGenderPicker=="function"&&resetGenderPicker(),window.openGenderDrawer)openGenderDrawer();else{var t=document.getElementById("genderPickerContainer");t&&(t.style.display="flex")}n&&(n.style.display="none");return}ln?Ct():un()}function dn(){Re()}E==null||E.addEventListener("click",cn),me==null||me.addEventListener("click",dn),ne==null||ne.addEventListener("click",an),window.nextChat=Re;function un(){typeof MeetgleModals!="undefined"&&MeetgleModals.showAgeVerification(Ct)}const Ve=document.getElementById("reportBtn"),fn=document.getElementById("remoteVideo");function Dn(e){return window.captureScreenshot?window.captureScreenshot(e):""}async function En(e=150){return window.getRemoteIPWithFallback?await window.getRemoteIPWithFallback(e):"Unknown"}function In(e,t=!1){window.showReportMessage&&window.showReportMessage(e,t)}async function Mt(){window.currentRemoteIP=Se,window.partnerIPFromMatched=j,window.currentRemoteUserId=L,window.currentRemoteUsername=D,window.reportUser&&await window.reportUser(Re,A)}Ve&&fn&&(Ve.addEventListener("click",function(e){e.preventDefault(),Mt()}),Ve.addEventListener("touchstart",function(e){e.preventDefault(),Mt()}));const De=document.getElementById("heartBtn"),Sn=document.getElementById("heartAnimOverlay");function An(){typeof window.animateHeart=="function"&&window.animateHeart()}function mn(){typeof window.animateHeartButton=="function"&&window.animateHeartButton()}De&&De.addEventListener("click",function(e){e.preventDefault(),mn(),r&&A&&L&&(r.emit("sendHeart",{to:L}),De.style.transform="scale(1.3)",setTimeout(()=>{De.style.transform="scale(1)"},150))});function gn(e){return window.countryCodeToFlagEmoji?window.countryCodeToFlagEmoji(e):""}async function pn(e=null){return window.fetchCountryCodeFromIPAPI?await window.fetchCountryCodeFromIPAPI(e):""}function re(){const e=DOM.remoteFlag;e&&(e.textContent="",e.style.display="none"),we=null}function ae(){const e=DOM.remoteGender;e&&(e.textContent="",e.style.display="none"),Ne=null}function yn(e,t,n,o,i){const l=DOM.remoteUserInfoPill,h=DOM.remoteUserName,u=document.getElementById("remoteUserNameText"),M=document.getElementById("remoteUserBadges"),w=document.getElementById("remoteUserAvatar"),p=DOM.remoteUserGender,d=DOM.remoteUserFlag;if(!l)return;if(l.style.display="flex",w&&(n&&n.length===2?w.textContent=gn(n):w.textContent="\u{1F30D}"),h){let f=e||ANONCAM_DATA.lang.js_stranger||"Stranger";const k=10;f!==(ANONCAM_DATA.lang.js_stranger||"Stranger")&&f.length>k&&(f=f.substring(0,k)+"...");let C="";
8if(o&&(o==="gold"?C+='<span style="display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;background:linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);border-radius:50%;font-size:9px;color:white;font-weight:bold;margin-left:4px;position:relative;top:-2px;">\u2713</span>':o==="blue"&&(C+='<span style="display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;background:linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);border-radius:50%;font-size:9px;color:white;font-weight:bold;margin-left:4px;position:relative;top:-2px;">\u2713</span>')),i&&i>=3){let _="";i>=100?_="\u{1F451}":i>=30?_="\u{1F31F}":i>=14?_="\u{1F525}\u{1F525}":(i>=7||i>=3)&&(_="\u{1F525}"),_&&(C+='<span class="meetgle-remote-streak" style="display:inline-flex;align-items:center;gap:2px;margin-left:4px;font-size:12px;position:relative;top:-1px;"><span>'+_+'</span><span style="color:white;font-weight:600;">'+i+"</span></span>")}u&&M?(u.textContent=f,M.innerHTML=C):C?h.innerHTML=f+C:h.textContent=f}const O=ANONCAM_DATA.isAdmin||window.canSeeGender===!0;if(p&&O&&t?(t==="male"?(p.textContent=ANONCAM_DATA.lang.js_gender_male||"Male",p.style.color="#3B82F6"):t==="female"&&(p.textContent=ANONCAM_DATA.lang.js_gender_female||"Female",p.style.color="#EC4899"),p.style.display="inline"):p&&(p.style.display="none"),d)if(n&&n.length===2){const f=typeof window.countryCodeToName=="function"?window.countryCodeToName(n):n.toUpperCase();d.textContent=f,d.style.display="inline",d.style.marginLeft=p&&p.style.display==="inline"?"6px":"0"}else d.textContent="",d.style.display="none",d.style.marginLeft="0";typeof window.updateRemoteUserPillState=="function"&&window.updateRemoteUserPillState(e)}function se(){const e=DOM.remoteUserInfoPill,t=DOM.remoteUserName,n=document.getElementById("remoteUserAvatar"),o=DOM.remoteUserGender,i=DOM.remoteUserFlag;if(e&&(e.style.display="none"),n&&(n.textContent="\u{1F30D}"),t){const l=document.getElementById("remoteUserNameText"),h=document.getElementById("remoteUserBadges");l&&h?(l.textContent=ANONCAM_DATA.lang.js_stranger||"Stranger",h.innerHTML=""):t.textContent=ANONCAM_DATA.lang.js_stranger||"Stranger"}o&&(o.textContent="",o.style.display="none"),i&&(i.textContent="",i.style.display="none"),we=null,Ne=null,D=null}let Ge=!1;async function hn(){if(Ge)return!0;if(typeof window.openMeetgleProfileModal=="function")return Ge=!0,!0;try{const e=document.createElement("link");e.rel="stylesheet",e.href=ANONCAM_DATA.pluginUrl+"profile/css/profile-modal.css?ver="+(ANONCAM_DATA.version||"1.0"),document.head.appendChild(e);const t=document.createElement("script");return t.src=ANONCAM_DATA.pluginUrl+"profile/js/profile-modal.js?ver="+(ANONCAM_DATA.version||"1.0"),await new Promise((n,o)=>{t.onload=n,t.onerror=o,document.body.appendChild(t)}),await new Promise(n=>setTimeout(n,50)),typeof ANONCAM_DATA!="undefined"&&typeof window.MEETGLE_PROFILE_DATA=="undefined"&&(window.MEETGLE_PROFILE_DATA={ajax_url:ANONCAM_DATA.ajax_url,nonce:ANONCAM_DATA.nonce||"",plugin_url:ANONCAM_DATA.pluginUrl}),Ge=!0,!0}catch(e){return!1}}window.openRemoteUserProfile=async function(){if(!await hn()){alert(ANONCAM_DATA.lang.js_profile_failed||"Failed to load profile viewer. Please refresh the page.");return}if(!window.currentRemoteUsername){typeof window.openMeetgleProfileModal=="function"?window.showAnonymousUserModal():alert(ANONCAM_DATA.lang.js_anonymous_short||"This person is chatting anonymously.");return}const t={gender:Ne,country:we};typeof window.openMeetgleProfileModal=="function"&&window.openMeetgleProfileModal(window.currentRemoteUsername,t)},window.showAnonymousUserModal=function(){const e=document.getElementById("meetgleProfileModal");if(!e)return;e.style.display="flex";const t=document.getElementById("profileLoading"),n=document.getElementById("profileError"),o=document.getElementById("profileContent");if(t&&(t.style.display="none"),n&&(n.style.display="none"),o&&(o.style.display="none"),n){n.style.display="block";const i=document.getElementById("profileErrorMessage");i&&(i.innerHTML='<div style="text-align:center;padding:20px;"><div style="font-size:48px;margin-bottom:16px;">\u{1F464}</div><h3 style="margin:0 0 12px 0;color:#111827;">'+(ANONCAM_DATA.lang.js_anonymous_user||"Anonymous User")+'</h3><p style="color:#6b7280;margin:0;">'+(ANONCAM_DATA.lang.js_anonymous_desc||"This person is chatting anonymously and doesn't have a registered account.")+"</p></div>",i.style.color="#111827")}};let J=null,He=0,ye=null;const _t=240*1e3;function We(){if(ye)return ye;if(typeof ANONCAM_DATA=="undefined"||!ANONCAM_DATA.ajax_url)return Promise.resolve(null);const e=new FormData;return e.append("action","meetgle_get_access_token"),ye=fetch(ANONCAM_DATA.ajax_url,{method:"POST",body:e}).then(t=>t.json()).then(t=>(t&&t.success&&t.data&&t.data.token&&(J=t.data.token,He=Date.now()),J)).catch(()=>J).finally(()=>{ye=null}),ye}
8async function wn(){return J&&Date.now()-He<_t?J:We()}function b(){let e=null;typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.verificationType&&(e=ANONCAM_DATA.verificationType);let t="";typeof MeetgleFingerprint!="undefined"&&(t=MeetgleFingerprint.get());let n=!1;typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.isPremium===!0&&(n=!0);const o=J;(!J||Date.now()-He>=_t)&&We();let i=0;return typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.streakCount&&(i=parseInt(ANONCAM_DATA.streakCount)||0),{gender:q,genderPreference:ee,countryPreference:te,countryExclusions:typeof window.getCountryExclusions=="function"&&typeof window.getCountryMode=="function"&&window.getCountryMode()==="exclude"?window.getCountryExclusions():[],countryCode:Xe||"",username:Dt||"",siteKey:typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.siteKey?String(ANONCAM_DATA.siteKey):"",siteUserId:typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.wpUserId?parseInt(ANONCAM_DATA.wpUserId,10):null,identityVersion:typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.identityVersion?parseInt(ANONCAM_DATA.identityVersion,10):1,verificationType:e,ocrText:"",clientVersion:It,fingerprint:t,isPremium:n,accessToken:o,streakCount:i,blockedUsers:typeof window.MeetgleBlocks!="undefined"&&window.MeetgleBlocks?window.MeetgleBlocks.list():typeof ANONCAM_DATA!="undefined"&&Array.isArray(ANONCAM_DATA.blockedUsers)?ANONCAM_DATA.blockedUsers:[]}}function kn(){return window.getAnonymousSparks?window.getAnonymousSparks():0}function Tt(e,t){return window.addAnonymousSparks?window.addAnonymousSparks(e,t):0}function vt(e,t){window.showSparkNotification&&window.showSparkNotification(e,t)}function Bn(){window.showSparkCapReachedPopup&&window.showSparkCapReachedPopup()}function Nn(){window.checkAndShowDailyBonus&&window.checkAndShowDailyBonus()}window.addEventListener("DOMContentLoaded",()=>{typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.isUserLoggedIn&&(typeof MeetgleSparks!="undefined"&&MeetgleSparks.autoTransferAnonymousSparks(),Nn())});function qe(){if(typeof ANONCAM_DATA=="undefined"||!ANONCAM_DATA||!ANONCAM_DATA.socketServer||document.hidden||A)return;let e=ANONCAM_DATA.socketServer.replace("wss://","https://").replace("ws://","http://");e=e.replace(/:\d+$/,"");const t=e+":3001/api/stats";fetch(t,{method:"GET",mode:"cors",headers:{Accept:"application/json"}}).then(n=>n.json()).then(n=>{n.success&&n.stats&&n.stats.totalConnected!==void 0&&Cn(n.stats.totalConnected)}).catch(n=>{})}function Cn(e){const t=document.getElementById("liveCountNumber");t&&(t.textContent=e.toLocaleString());const n=document.getElementById("acctModalOnlineCount");n&&(n.textContent=e.toLocaleString())}function Mn(){const e=document.querySelectorAll(".floating-avatar");if(e.length===0||typeof ANONCAM_DATA=="undefined"||!ANONCAM_DATA||!ANONCAM_DATA.pluginUrl)return;const t=Array.from({length:15},(o,i)=>i+1);for(let o=t.length-1;o>0;o--){const i=Math.floor(Math.random()*(o+1));[t[o],t[i]]=[t[i],t[o]]}const n=t.slice(0,7);e.forEach((o,i)=>{if(i<n.length){const l=n[i],h=ANONCAM_DATA.pluginUrl+"public/img/ava"+l+".webp";o.style.backgroundImage='url("'+h+'")',o.style.backgroundSize="cover",o.style.backgroundPosition="center";const u=o.querySelector(".live-pulse");u&&(u.style.position="absolute",u.style.zIndex="10")}})}window.addEventListener("DOMContentLoaded",()=>{if(qe(),Mn(),(function(){var u=document.querySelectorAll(".start-btn-ava");if(u.length){for(var M=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.pluginUrl?ANONCAM_DATA.pluginUrl:"",w=[];w.length<u.length;){var p=Math.floor(Math.random()*15)+1;w.indexOf(p)===-1&&w.push(p)}for(var d=0;d<u.length;d++)u[d].src=M+"public/img/ava"+w[d]+".webp",u[d].alt="",u[d].decoding="async",u[d].onerror=function(){this.onerror=null,this.src=this.src.replace(".webp",".jpg")}}})(),(function(){var u=document.querySelectorAll(".extra-btn-ava");if(u.length){for(var M=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.pluginUrl?ANONCAM_DATA.pluginUrl:"",w=[];w.length<u.length;){var p=Math.floor(Math.random()*15)+1;w.indexOf(p)===-1&&w.push(p)}for(var d=0;d<u.length;d++)u[d].src=M+"public/img/ava"+w[d]+".webp",u[d].alt="",u[d].decoding="async",u[d].onerror=function(){this.onerror=null,this.src=this.src.replace(".webp",".jpg")}}}
8)(),typeof initSwirlBackground=="function"&&initSwirlBackground("bg-swirl"),typeof initProfileColumns=="function"&&!document.querySelector(".meetgle-stage-shell")){for(var e=typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.pluginUrl?ANONCAM_DATA.pluginUrl:"",t=["Sofia","Emma","Isabella","Olivia","Ava","Mia","Charlotte","Amelia","Grace","Ella","Luna","Chloe","Aria","Lily","Zoe","Nora","Riley","Layla","Harper","Violet","Stella","Maya","Camila","Penelope","James","Liam","Noah","Ethan"],n=["\u{1F1FA}\u{1F1F8}","\u{1F1EC}\u{1F1E7}","\u{1F1EA}\u{1F1F8}","\u{1F1E7}\u{1F1F7}","\u{1F1E8}\u{1F1E6}","\u{1F1E6}\u{1F1FA}","\u{1F1EB}\u{1F1F7}","\u{1F1F3}\u{1F1F1}","\u{1F1E9}\u{1F1EA}","\u{1F1F0}\u{1F1F7}","\u{1F1EE}\u{1F1F9}","\u{1F1F8}\u{1F1EA}","\u{1F1F5}\u{1F1F1}","\u{1F1F7}\u{1F1FA}","\u{1F1E8}\u{1F1ED}","\u{1F1F3}\u{1F1F4}","\u{1F1E6}\u{1F1F7}","\u{1F1F5}\u{1F1F9}","\u{1F1E8}\u{1F1F4}","\u{1F1EC}\u{1F1F7}","\u{1F1EF}\u{1F1F5}","\u{1F1F2}\u{1F1FD}","\u{1F1E8}\u{1F1F1}","\u{1F1F5}\u{1F1EA}","\u{1F1E8}\u{1F1FF}","\u{1F1EE}\u{1F1EA}","\u{1F1F3}\u{1F1FF}","\u{1F1E9}\u{1F1F0}"],o=[],i=0;i<28;i++)o.push({name:t[i],age:20+Math.floor(Math.random()*10),flag:n[i],online:Math.random()>.3,img:e+"public/img/profiles/"+(typeof ANONCAM_DATA!="undefined"&&ANONCAM_DATA.profileSet?ANONCAM_DATA.profileSet:"sfw")+"/profile"+(i+1)+".webp"});for(var i=o.length-1;i>0;i--){var l=Math.floor(Math.random()*(i+1)),h=o[i];o[i]=o[l],o[l]=h}initProfileColumns("#profile-showcase",o)}setInterval(qe,1e4),document.addEventListener("visibilitychange",()=>{document.hidden||qe()})})})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.