import{r as e,a4 as a,R as t,j as s,k as r,ab as o,b as i,q as n,w as m,v as l,u as d,h as c,n as u,s as f,o as g}from"./vendor-jA_NIjzi.js";import{eM as y,a8 as h,q as v,F as p,w}from"./common-utils-8H8K2JPG.js";import{_ as b,c as j,b as G}from"./common-store-e_1WBubm.js";import{T as W}from"./ThirdPartyGameHead-0VyV5ckr.js";import"./vendor-crypto-Vtl7-GZS.js";import"./vendor-mqtt-lYGapirz.js";import"./SvgIcon-unOD6nfS.js";const _=["src"],q=b({__name:"index",setup(b){let q=null;const L=e(),x=a(),I=t(),T=j(),C=e(""),E=e(""),k=G(),B=e(!1),H=e(""),R=()=>{document.getElementById("three-party-games-iframe-id").src="about:blank";const e=setTimeout((()=>{x.go(-1),clearTimeout(e)}),300)},z=()=>{if(v())p("messageCenterBack");else if(I.query.from){const e=window.location.href.split("#")[0];window.location.href=e+"#"+I.query.from}else x.go(-1)},D=()=>{B.value=window.innerWidth>window.innerHeight};return s((()=>{H.value=document.body.style.maxWidth,document.body.style.maxWidth="100%",D(),window.addEventListener("resize",D)})),r((()=>{document.body.style.maxWidth=H.value,window.removeEventListener("resize",D)})),s((async()=>{(async()=>{if(I.query.thirdGameCode){const e=I.query.thirdGameCode,a=await y({thirdGameCode:e});if(!a.success||!a.data)return a.message&&f(a.message);const{thirdGameLoginHtml:t,thirdGameLoginUrl:s}=a.data,r=s?{src:s,title:E}:{url:t,title:E};if(r.src)return void(C.value=r.src);const o=document.getElementById("three-party-games-iframe-id"),i=o.contentDocument||o.contentWindow.document;i.open(),i.write(r.url),i.close()}})(),k.showGlobalLoading(),L.value.addEventListener("load",(()=>{k.clearGlobalLoading(),q=setTimeout((()=>{T.getWalletInfo()}),1500)}))})),o((()=>{q&&(clearTimeout(q),q=null),(async()=>{const e=await h();if(!e.success)return e.message&&f(e.message);await T.getWalletInfo()})()})),(e,a)=>(g(),i("div",{class:u(["three-party-games",{"three-party-games-9d":"玖鼎真人"===E.value}])},[n(W,{title:E.value,landscape:B.value,onClose:z,onRefresh:R,weblobby:!0},null,8,["title","landscape"]),m(c("iframe",{ref_key:"iframeRef",ref:L,id:"three-party-games-iframe-id",class:u({"three-part-games-iframe":B.value,"three-party-games-iframe-in-telegram":d(w)()}),src:C.value},null,10,_),[[l,!d(k).loading]])],2))}},[["__scopeId","data-v-1e77fa58"],["__file","index.vue"]]);export{q as default};
