import{b7 as N,as as R,t as q,cJ as M,cc as i,O as T,c0 as D,r as s,h as H,c as r,aY as d,aT as u,N as h,b9 as y,cK as I,bc as E,bq as V,bd as $,cL as A,cM as F,cN as O,aX as P}from"./index-xnhGKCfe.js";const S=["src"],U={key:1,class:"loading"},J=N({__name:"index",setup(K){const c=R(),{onAnalyticsTrigger:m}=H(),b=s(null),a=s(!1),f=Date.now(),x=q(),{css:v,load:L,unload:C}=M(""),k=r(()=>{if(!F)return{};if(!a)return{height:`${window.innerHeight}px`}}),p=r(()=>{const e=c.query.url;if(!e)return"";const o=O(e||"");return o.startsWith("http")?o:`data:text/html;charset=utf-8,${encodeURIComponent(o)}`}),g=s(!0),_=r(()=>{const e=c.query.vendorCode;return e||""}),w=r(()=>{const e=c.query.gameCode;return e||""});function l(){A()||setTimeout(()=>{window.matchMedia("(orientation: landscape)").matches?(v.value=`
            	    body #app { width: 100%!important; }
            	`,a.value=!0,document.documentElement.classList.add("landscape")):(v.value="",a.value=!1,document.documentElement.classList.remove("landscape"))},10)}i(window,"resize",l),i(window,"orientationchange",l),i(window,"message",e=>{e.data==="game"&&x.push({name:"game"})});const t=s(null),z=()=>{n(),g.value=!1,m("game_loaded",{game_type:_.value,game_code:w.value,duration:Date.now()-f})},n=()=>{document.documentElement.style.setProperty("--vh",`${window.innerHeight*.01}px`)};return T(async()=>{l(),L(),n(),window.addEventListener("resize",n)}),D(()=>{C(),window.removeEventListener("resize",n),document.documentElement.classList.remove("landscape"),t.value&&(t.value.src="about:blank",t.value.remove(),t.value=null),m("game_exit",{game_type:_.value,game_code:w.value,duration:Date.now()-f})}),(e,o)=>{const B=V;return u(),d("div",{class:E(["game-iframe",{landscape:a.value}]),ref_key:"fullscreenElement",ref:b,style:$({height:k.value})},[h(I),p.value?(u(),d("iframe",{key:0,class:E({landscape:a.value}),sandbox:"allow-forms allow-orientation-lock allow-scripts allow-same-origin  allow-popups",ref_key:"iframeRef",ref:t,src:p.value,onLoad:z},null,42,S)):y("",!0),g.value?(u(),d("div",U,[h(B)])):y("",!0)],6)}}}),X=P(J,[["__scopeId","data-v-6a86e0fd"]]);export{X as default};
