import{G as M,T as q,r as l,R as D,aZ as F,B as o,a_ as m,C as O,E as U,H as b,I as x,au as W,av as j,ap as C,ao as v,az as J,N as p,J as i,Q as f,aB as Q,P as Z,O as L,a$ as B}from"./common.modules-f9fa5dc7.js";import{G as K,a1 as X,a$ as _,b0 as Y,b1 as ee,b2 as ae,c as te,_ as ne}from"./page-activity-ActivityDetail-0d51a056.js";import"./page-turntable-assets-d6267459.js";import"./native/index-eb46cb93.js";import"./en-0806f032.js";const oe={class:"game-right"},se={class:"game-text"},re=["src"],le=M({__name:"index",setup(ie){const w=q(),R=K(),E=l(null),t=l(!1),c=D(),{css:g,load:S,unload:A}=F(""),{getSelfCustomerServiceLink:G}=X({ServerType:2}),h=l(0),N=o(()=>{if(!_)return{};if(!t)return{height:`${window.innerHeight}px`}}),y=o(()=>{const e=w.query.url;if(!e)return"";const a=Y(e||"");return a.startsWith("https:")?a:`data:text/html;charset=utf-8,${encodeURIComponent(a)}`}),s=o(()=>{const e=w.query.vendorCode;return e||""}),$=o(()=>!_&&!["PG"].includes(s.value));o(()=>t.value?!1:!["ARLottery"].includes(s.value));function u(){_&&setTimeout(()=>{window.matchMedia("(orientation: landscape)").matches?(g.value=`
            	    body #app { width: 100%; }
            	`,t.value=!0,document.documentElement.classList.add("landscape")):(g.value="",t.value=!1,document.documentElement.classList.remove("landscape"))},10)}m(window,"resize",u),m(window,"orientationchange",u),m(window,"message",e=>{e.data==="game"&&c.go(-1)});const n=l(null),z=()=>{r()},r=()=>{document.documentElement.style.setProperty("--vh",`${window.innerHeight*.01}px`)},P=()=>{const e=c.resolve({name:"wallet"});window.open(e.href,"_blank")};async function k(){try{const e=await ae();e.code===0&&(h.value=e.data.balance)}catch(e){console.log(e)}}const T=async()=>{R.notifyARGame(!0),c.push({name:"home"})},{pause:I}=ee(()=>{k()},1e3*12,{immediate:!0});return O(async()=>{u(),S(),r(),window.addEventListener("resize",r),setTimeout(()=>{k()},2e3)}),U(()=>{A(),I(),window.removeEventListener("resize",r),document.documentElement.classList.remove("landscape"),n.value&&(n.value.src="about:blank",n.value.remove(),n.value=null)}),(e,a)=>{const d=b("svg-icon"),V=b("NavBar");return $.value?v("v-if",!0):(p(),x("div",{key:0,class:"game-iframe",ref_key:"fullscreenElement",ref:E,style:J({height:N.value})},[["ARLottery"].includes(s.value)?v("v-if",!0):(p(),W(V,{key:0,class:C({"landscape-nav":t.value}),"left-arrow":"",onClickLeft:T},{right:j(()=>[i("div",oe,[i("span",se,[f(d,{name:"game_moneyb"}),Q(" "+Z(L(te)(h.value)),1)]),i("span",{class:"game-icon",onClick:a[0]||(a[0]=B(H=>P(),["stop"]))},[f(d,{name:"icon_addwallet"})]),i("span",{class:"game-icon",onClick:a[1]||(a[1]=B(H=>L(G)(),["stop"]))},[f(d,{name:"icon_customer3"})])])]),_:1},8,["class"])),y.value?(p(),x("iframe",{key:1,class:C({lotteryfull:["ARLottery"].includes(s.value),landscape:t.value}),sandbox:"allow-forms allow-orientation-lock allow-scripts allow-same-origin allow-top-navigation allow-popups",allowfullscreen:"true",ref_key:"iframeRef",ref:n,src:y.value,onLoad:z},null,42,re)):v("v-if",!0)],4))}}});const pe=ne(le,[["__scopeId","data-v-bc67dde2"],["__file","/usr/local/jenkins-prod/workspace/AR079-Pages-india-tashanwin/src/views/home/game/index.vue"]]);export{pe as default};