import{V as H,r as i,M as V,aG as W,a0 as Z,aH as P,F as X,W as h,ak as Y,m as r,$ as L,ao as p,an as G,p as t,X as T,Y as I,o as n,Z as _,aj as y,af as S,at as q,N as k,ad as K}from"./common.modules-adc6b33e.js";import{d as Q,A as ee,aw as ae,_ as se}from"./page-activity-ActivityDetail-b9249b49.js";import{F as te,a as ne}from"./page-home-AllGames-46186fc1.js";import"./native/index-0b5e3b14.js";import"./en-8e350547.js";window.getBuildInfo=function(){return{buildTime:"4/17/2025, 12:09:57 PM",branch:" commitId:8bf9f27a915f5dcd9b9436e446b585b05218b863"}};const le={class:"onlineGames__container"},oe=["placeholder"],ie={class:"onlineGames__container-list"},ue=["onClick"],ce={key:1},re={class:"onlineGames__container-list miniGames"},me=["onClick"],ve=H({__name:"index",setup(O){const{onItemClick:N}=Q(),C=i(),m=i(0),f=i([]),v=i(0);V(m,e=>{const s=l.value[e];b.value=[],v.value=0,w(s.slotsTypeID)});const u=i(!1);V(u,e=>{e?setTimeout(()=>{x.value.focus()},0):g.value=""});const g=i("");W(g,e=>{if(d.value)if(d.value.key==="fish"||d.value.key==="flash")l.value=l.value.filter(s=>s.gameNameEn.toLowerCase().includes(e)),e.length===0&&(l.value=sessionStorage.getItem("slotGamesList")?JSON.parse(sessionStorage.getItem("slotGamesList")):null);else{const s=l.value[m.value];w(s.slotsTypeID,e)}},{debounce:300});const x=i(null),d=i(),l=i([]),b=i([]),F=Z(),R=P(b,e=>u.value?e.gameNameEn.toLowerCase().includes(g.value.toLowerCase()):e.customGameType===v.value);function J(e){return e?e.split(/(?=[A-Z])/).join(" "):""}function M(){F.go(-1)}function D(e){u.value=e}async function w(e,s=""){const c=await ee(ae({type:e,gameNameEn:s}));if(c){if(b.value=c.data.gameLists||[],f.value=c.data.gameCustomTypeLists||[],!f.value.length)return;v.value=f.value[0].customGameType}}return X(()=>{d.value=sessionStorage.getItem("gameType")?JSON.parse(sessionStorage.getItem("gameType")):null,l.value=sessionStorage.getItem("slotGamesList")?JSON.parse(sessionStorage.getItem("slotGamesList")):null;const e=JSON.parse(sessionStorage.getItem("clickedItem"));e&&(m.value=l.value.findIndex(c=>c.slotsTypeID===e.slotsTypeID)),C.value&&C.value.scrollTo(m.value);const s=l.value[m.value];w(s.slotsTypeID)}),(e,s)=>{var $,A;const c=h("svg-icon"),j=h("NavBar"),z=h("van-tab"),U=h("van-tabs"),B=Y("lazy");return n(),r("div",le,[L(j,{class:"white","left-arrow":"",onClickLeft:M},{center:p(()=>{var a;return[t("span",{class:y({active:u.value})},_((a=d.value)==null?void 0:a.title)+_(e.$t("game")),3),S(t("input",{type:"text",placeholder:e.$t("searchGame"),class:y({active:u.value}),"onUpdate:modelValue":s[0]||(s[0]=o=>g.value=o),ref_key:"searchBarRef",ref:x},null,10,oe),[[q,g.value]])]}),right:p(()=>[L(c,{name:"SearchTrx",onClick:s[1]||(s[1]=a=>D(!0)),class:y({active:u.value})},null,8,["class"]),t("span",{class:y({active:u.value}),onClick:s[2]||(s[2]=a=>D(!1))},_(e.$t("cancel")),3)]),_:1}),(($=d.value)==null?void 0:$.key)!=="fish"&&((A=d.value)==null?void 0:A.key)!=="flash"?(n(),G(U,{key:0,class:"onlineGames__container-tabBar",active:m.value,"onUpdate:active":s[4]||(s[4]=a=>m.value=a),type:"card",sticky:!0,"offset-top":46,ref_key:"tabsRef",ref:C},{default:p(()=>[(n(!0),r(T,null,I(l.value,(a,o)=>(n(),G(z,{key:o},{title:p(()=>[L(c,{name:a.slotsName,class:"gameIcon"},null,8,["name"]),t("span",null,_(a.slotsName.replace("G9","9G")),1)]),_:2},1024))),128)),!u.value||f.value.length===0?(n(),G(k(te),{key:0,modelValue:v.value,"onUpdate:modelValue":s[3]||(s[3]=a=>v.value=a),lineWidth:0},{default:p(()=>[(n(!0),r(T,null,I(f.value,(a,o)=>(n(),G(k(ne),{name:o,key:o,class:y([{activeClassName:v.value===a.customGameType}]),onClick:E=>v.value=a.customGameType},{default:p(()=>[t("span",null,_(a.customGameTypeName),1)]),_:2},1032,["name","class","onClick"]))),128))]),_:1},8,["modelValue"])):K("v-if",!0),t("div",ie,[(n(!0),r(T,null,I(k(R),(a,o)=>(n(),r("div",{class:"onlineGames__container-list__item",key:o,onClick:E=>k(N)(a)},[S(t("img",null,null,512),[[B,a.img]]),t("div",null,[t("span",null,_(J(a.gameNameEn)),1)])],8,ue))),128))])]),_:1},8,["active"])):(n(),r("div",ce,[t("div",re,[(n(!0),r(T,null,I(l.value,(a,o)=>(n(),r("div",{class:"onlineGames__container-list__item",key:o,onClick:E=>k(N)(a)},[S(t("img",null,null,512),[[B,a.img]]),t("div",null,[t("span",null,_(a.gameNameEn),1)])],8,me))),128))])]))])}}});const ye=se(ve,[["__scopeId","data-v-0ffc3892"],["__file","/usr/local/jenkins-prod/workspace/ar079-india-tashanwin/src/views/home/AllOnlineGames/index.vue"]]);export{ye as default};
//# sourceMappingURL=page-home-AllOnlineGames-3493d702.js.map
