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{ec as y,a8 as h,q as v,F as p,w}from"./common-utils-RDWuRZ1M.js";import{_ as b,c as j,b as G}from"./common-store-kFD1YPwN.js";import{T as _}from"./ThirdPartyGameHead-Fw97eE3g.js";import"./vendor-crypto-Vtl7-GZS.js";import"./vendor-mqtt-lYGapirz.js";import"./SvgIcon-a1Rg7hQY.js";const q=["src"],L=b({__name:"index",setup(b){let L=null;const W=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(),W.value.addEventListener("load",(()=>{k.clearGlobalLoading(),L=setTimeout((()=>{T.getWalletInfo()}),1500)}))})),o((()=>{L&&(clearTimeout(L),L=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(_,{title:E.value,landscape:B.value,onClose:z,onRefresh:R,weblobby:!0},null,8,["title","landscape"]),m(c("iframe",{ref_key:"iframeRef",ref:W,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,q),[[l,!d(k).loading]])],2))}},[["__scopeId","data-v-1e77fa58"],["__file","index.vue"]]);export{L as default};
