PageSourceSearch

https://dashboard.transax.com/_nuxt/index-IsBun6YP.js

js transax.com collected 2026-09-24 12:18:10 UTC 28,029 bytes, 1 lines download raw bytes

1import{q as L,V as le,aw as tt,d as Oe,h as at,e as ye,f as Q,A as c,ba as me,g as i,av as st,k as g,E as S,Z as U,c as T,y as k,a as l,be as lt,bf as ot,Y as xe,t as ce,a1 as be,M as ke,x as Ce,am as rt,a7 as j,o as y,l as Ie,u as it,bW as nt,j as dt,ak as De,L as ct,aK as Re,au as ft,O as ut}from"./entry-BwZZnLSu.js";import{u as vt}from"./useLocalStorage-mJCuFUVa.js";import{V as _e,a as mt}from"./VTabs-CBNOLeZB.js";import{V as gt}from"./VTooltip-BIl8PzV7.js";import{V as Te,a as yt}from"./VWindowItem-Bib5xQ7g.js";import{V as pt,a as pe}from"./VRow-Cf9Zx5GU.js";import{V as ht}from"./VAlert-CREJlxpq.js";/* empty css              */const de={musicEnabled:"tetris:music-enabled",soundEnabled:"tetris:sound-enabled",theme:"tetris:theme"},Be={theme:"/sounds/tetris/main-theme.mp3",move:"/sounds/tetris/move-piece.wav",rotate:"/sounds/tetris/rotate.wav",hardDrop:"/sounds/tetris/hard-drop.wav",lineClear:"/sounds/tetris/line-complete.wav",tetris:"/sounds/tetris/tetris-4-lines.mp3",levelUp:"/sounds/tetris/level-up.wav",gameOver:"/sounds/tetris/game-over.wav",land:"/sounds/tetris/move-to-bottom.wav"},P={green:"#32ba8f",darkGreen:"#1d8565",veryDarkGreen:"#093735",deepGreen:"#0c3734",lightGreen:"#4cb050",white:"#ffffff"};function wt(A={}){const{getStoredValue:J,setStoredValue:ee}=vt(),W=L(J(de.theme,"light")),B=L(J(de.soundEnabled,!0)),V=L(J(de.musicEnabled,!0));le(W,t=>{ee(de.theme,t)}),le(B,t=>{ee(de.soundEnabled,t)}),le(V,t=>{ee(de.musicEnabled,t)});let w=null;const M=new Map;function E(){typeof window>"u"||(w=new Audio(Be.theme),w.loop=!0,w.volume=.6,Object.entries(Be).forEach(([t,s])=>{if(t!=="theme"){const m=new Audio(s);m.volume=.25,M.set(t,m)}}))}function C(t){if(!B.value)return;const s=M.get(t);s&&(s.currentTime=0,s.play().catch(()=>{}))}function I(){!V.value||!w||w.play().catch(()=>{})}
1function $(){w&&(w.pause(),w.currentTime=0)}function D(){w&&w.pause()}function K(){V.value&&w&&w.play().catch(()=>{})}function te(){B.value=!B.value}function N(){V.value=!V.value,V.value?K():D()}function H(t){V.value=t,t?K():D()}function R(t){B.value=t}const F=["transparent",P.green,P.darkGreen,P.lightGreen,P.veryDarkGreen,P.green,P.darkGreen,P.deepGreen];function oe(){return W.value==="dark"?{backgroundStart:"#0c3734",backgroundEnd:"#093735",gridLines:"rgba(255, 255, 255, 0.08)",sidebarBg:"rgba(0, 0, 0, 0.4)",textPrimary:"#ffffff",textScore:P.green,textLevel:P.lightGreen,textLines:P.white,overlayBg:"rgba(0, 0, 0, 0.8)",gameOverText:"#ff6b6b",pauseText:P.green,hintText:P.lightGreen}:{backgroundStart:"#f5f5f5",backgroundEnd:"#e8e8e8",gridLines:"rgba(0, 0, 0, 0.1)",sidebarBg:"rgba(255, 255, 255, 0.9)",textPrimary:P.veryDarkGreen,textScore:P.darkGreen,textLevel:P.green,textLines:P.deepGreen,overlayBg:"rgba(255, 255, 255, 0.9)",gameOverText:"#dc2626",pauseText:P.darkGreen,hintText:P.green}}const G=[{name:"L",color:1,schema:[[1,1,1],[1,0,0]]},{name:"J",color:2,schema:[[1,1,1],[0,0,1]]},{name:"O",color:3,schema:[[1,1],[1,1]]},{name:"I",color:4,schema:[[1,1,1,1]]},{name:"Z",color:5,schema:[[0,1,1],[1,1,0]]},{name:"S",color:6,schema:[[1,1,0],[0,1,1]]},{name:"T",color:7,schema:[[0,1,0],[1,1,1]]}],p=10,h=20,z=150,ie=3,ne=500;let n=28,r=null,e=null,ae=null,f=[],x=0,O=0,re=0,X=[],_=[],fe=0,ue=0,b=0,d=1,q=!1;const v=L({score:0,isGameOver:!1,isPaused:!1,isWaitingToStart:!0,isBlocked:!1,level:1,linesCleared:0});function Ne(){return Math.max(100,ne-(v.value.level-1)*50)}function Le(t,s){const m=[];for(let u=0;u<s;u++){m.push([]);for(let a=0;a<t;a++)m[u].push(0)}return m}function Fe(t){return JSON.parse(JSON.stringify(t))}function Ae(t){const s=t.length,m=t[0].length,u=[];for(let a=0;a<m;a++){u.push([]);for(let o=0;o<s;o++)u[a].push(0)}for(let a=0;a<s;a++)for(let o=0;o<m;o++)u[o][s-1-a]=t[a][o];return u}function Z(t,s,m){var u;for(let a=0;a<t.length;a++)for(let o=0;o<t[a].length;o++){const Y=a+O+m,se=o+x+s;if(t[a][o]!==0&&Y>0&&(Y>=h||se<0||se>=p||((u=f[Y])==null?void 0:u[se])!==0))return!0}return!1}function ze(t=!1){for(let s=0;s<_.length;s++)for(let m=0;m<_[s].length;m++)if(_[s][m]===1){const u=s+O-1,a=m+x;u>=0&&u<h&&a>=0&&a<p&&(f[u][a]=G[re].color)}t||C("land")}function he(){var t;if(X.length===0)for(let s=0;s<ie;s++)X.push(Math.floor(Math.random()*(G.length-.5)));re=X[0],_=Fe(G[re].schema),X.shift(),X.push(Math.floor(Math.random()*(G.length-.5)));for(let s=0;s<Math.random()*4;s++)_=Ae(_);O=-_.length+1,x=Math.floor(p/2-_[0].length/2),Z(_,0,1)&&(v.value.isGameOver=!0,C("gameOver"),$(),(t=A.onGameOver)==null||t.call(A,v.value.score,v.value.linesCleared))}function We(){var s,m;const t=[];for(let u=h-1;u>0;u--){let a=0;for(let o=0;o<p;o++)f[u][o]!==0&&a++;a===p&&t.push(u)}if(t.length>0){let u=0;switch(t.length){case 1:u=100;break;case 2:u=300;break;case 3:u=500;break;case 4:u=800;break;default:u=800+400*t.length;break}t.length>=4?C("tetris"):C("lineClear"),v.value.score+=u*v.value.level,v.value.linesCleared+=t.length;const a=Math.floor(v.value.linesCleared/10)+1;a>d&&(C("levelUp"),d=a),v.value.level=a,(s=A.onScoreChange)==null||s.call(A,v.value.score),(m=A.onLinesClear)==null||m.call(A,t.length);for(const o of t)$e(o)}}function $e(t){for(let s=t;s>0;s--)for(let m=0;m<p;m++)f[s][m]=f[s-1][m];for(let s=0;s<p;s++)f[0][s]=0}function we(t,s,m,u=!1){if(!e)return;const a=2,o=n-a*2;u?(e.strokeStyle=m,e.lineWidth=2,e.strokeRect(t+a,s+a,o,o)):(e.fillStyle=m,e.fillRect(t+a,s+a,o,o),e.fillStyle="rgba(255, 255, 255, 0.3)",e.fillRect(t+a,s+a,o,3),e.fillRect(t+a,s+a,3,o),e.fillStyle="rgba(0, 0, 0, 0.3)",e.fillRect(t+a,s+a+o-3,o,3),e.fillRect(t+a+o-3,s+a,3,o))}function Ke(){let t=O;for(;!Z(_,0,t-O+1);)t++;return t}function Ee(){if(!e||!r)return;const t=oe();e.clearRect(0,0,r.width,r.height);const s=e.createLinearGradient(0,0,0,r.height);s.addColorStop(0,t.backgroundStart),s.addColorStop(1,t.backgroundEnd),e.fillStyle=s,e.fillRect(0,0,r.width,r.height),e.strokeStyle=t.gridLines,e.lineWidth=1;for(let a=0;a<=h;a++)e.beginPath(),e.moveTo(0,a*n),e.lineTo(p*n,a*n),e.stroke();for(let a=0;a<=p;a++)e.beginPath(),e.moveTo(a*n,0),e.lineTo(a*n,h*n),e.stroke();for(let a=0;a<h;a++)for(let o=0;o<p;o++)f[a][o]!==0&&we(o*n,a*n,F[f[a][o]]);const m=Ke();for(let a=0;a<_.length;a++)for(let o=0;o<_[a].length;o++)if(_[a][o]===1){const Y=(a+m)*n;Y>=0&&we((o+x)*n,Y,F[G[re].color],!0)}for(let a=0;a<_.length;a++)for(let o=0;o<_[a].length;o++)if(_[a][o]===1){const Y=(a+O)*n;Y>=0&&we((o+x)*n,Y,F[G[re].color])}const u=p*n;e.fillStyle=t.sidebarBg,e.fillRect(u,0,z,r.height),e.font="bold 20px 'Segoe UI', sans-serif",e.fillStyle=t.textPrimary,e.fillText("SCORE",u+15,30),e.font="bold 28px 'Segoe UI', sans-serif",e.fillStyle=t.textScore,e.fillText(v.value.score.toString(),u+15,60),e.font="bold 16px 'Segoe UI', sans-serif",e.fillStyle=t.textPrimary,e.fillText("LEVEL",u+15,95),e.font="bold 24px 'Segoe UI', sans-serif",e.fillStyle=t.textLevel,e.fillText(v.value.level.toString(),u+15,120),e.font="bold 16px 'Segoe UI', sans-serif",e.fillStyle=t.textPrimary,e.fillText("LINES",u+15,155),e.font="bold 24px 'Segoe UI', sans-serif",e.fillStyle=t.textLines,e.fillText(v.value.linesCleared.toString(),u+15,180),e.font="bold 16px 'Segoe UI', sans-serif",e.fillStyle=t.textPrimary,e.fillText("NEXT",u+15,220);for(let a=0;a<X.length;a++){const o=G[X[a]],Y=240+a*70,se=18;for(let ve=0;
1ve<o.schema.length;ve++)for(let ge=0;ge<o.schema[ve].length;ge++)if(o.schema[ve][ge]===1){const Qe=u+20+ge*se,et=Y+ve*se;e.fillStyle=F[o.color],e.fillRect(Qe+1,et+1,se-2,se-2)}}v.value.isGameOver&&(e.fillStyle=t.overlayBg,e.fillRect(0,0,p*n,h*n),e.font="bold 32px 'Segoe UI', sans-serif",e.fillStyle=t.gameOverText,e.textAlign="center",e.fillText("GAME OVER",p*n/2,h*n/2-20),e.font="18px 'Segoe UI', sans-serif",e.fillStyle=t.textPrimary,e.fillText(`Final Score: ${v.value.score}`,p*n/2,h*n/2+20),e.font="14px 'Segoe UI', sans-serif",e.fillStyle=t.hintText,e.fillText("Press SPACE to restart",p*n/2,h*n/2+50),e.textAlign="left"),v.value.isPaused&&!v.value.isGameOver&&(e.fillStyle=t.overlayBg,e.fillRect(0,0,p*n,h*n),e.font="bold 32px 'Segoe UI', sans-serif",e.fillStyle=t.pauseText,e.textAlign="center",e.fillText("PAUSED",p*n/2,h*n/2),e.textAlign="left"),v.value.isWaitingToStart&&(e.fillStyle=t.overlayBg,e.fillRect(0,0,p*n,h*n),e.font="bold 36px 'Segoe UI', sans-serif",e.fillStyle=t.textScore,e.textAlign="center",e.fillText("Transax Tetris",p*n/2,h*n/2-40),e.font="18px 'Segoe UI', sans-serif",e.fillStyle=t.textPrimary,e.fillText("Press START to play",p*n/2,h*n/2+10),e.font="14px 'Segoe UI', sans-serif",e.fillStyle=t.hintText,e.fillText("or press SPACE",p*n/2,h*n/2+40),e.textAlign="left")}function Se(){if(v.value.isGameOver||v.value.isPaused||v.value.isWaitingToStart){Ee(),ae=requestAnimationFrame(Se);return}fe=performance.now(),b+=fe-ue,b>Ne()&&(O+=1,b=0),Z(_,0,0)&&(ze(q),q=!1,he()),We(),Ee(),ae=requestAnimationFrame(Se),ue=performance.now()}function Pe(t){if(v.value.isBlocked)return;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Space","KeyW","KeyA","KeyS","KeyD"].includes(t.code)&&(t.preventDefault(),Ye()),v.value.isWaitingToStart){t.code==="Space"&&Me();return}if(v.value.isGameOver){t.code==="Space"&&Ge();return}if(t.code==="Escape"||t.code==="KeyP"){v.value.isPaused=!v.value.isPaused;return}if(!v.value.isPaused)switch(t.code){case"ArrowUp":case"KeyW":const m=Ae(_);!Z(m,0,0)&&!Z(m,0,1)&&(_=m,C("rotate"));break;case"ArrowLeft":case"KeyA":Z(_,-1,0)||(x-=1,C("move"));break;case"ArrowRight":case"KeyD":Z(_,1,0)||(x+=1,C("move"));break;case"ArrowDown":case"KeyS":Z(_,0,1)||(O+=1,b=0);break;case"Space":for(;!Z(_,0,1);)O+=1;C("hardDrop"),q=!0,b=0;break}}let Ve=!1;function Ye(){!Ve&&V.value&&(I(),Ve=!0)}function He(t){r=t,e=r.getContext("2d");const s=window.innerHeight-185,m=window.innerWidth-z-40,u=Math.floor(s/h),a=Math.floor(m/p);n=Math.min(a,u),n=Math.max(24,Math.min(n,45)),r.width=p*n+z,r.height=h*n,E(),f=Le(p,h),he(),window.addEventListener("keydown",Pe),Se()}function Me(){v.value.isWaitingToStart=!1,I()}function Ge(){v.value={score:0,isGameOver:!1,isPaused:!1,isWaitingToStart:!1,isBlocked:v.value.isBlocked,level:1,linesCleared:0},d=1,f=Le(p,h),X=[],b=0,he(),I()}function Xe(){window.removeEventListener("keydown",Pe),ae&&cancelAnimationFrame(ae),$()}function qe(){v.value.isPaused=!0,D()}function Je(){v.value.isPaused=!1,K()}function Ze(t){W.value=t}function je(){W.value=W.value==="dark"?"light":"dark"}return{gameState:v,currentTheme:W,isSoundEnabled:B,isMusicEnabled:V,init:He,startGame:Me,restart:Ge,destroy:Xe,pause:qe,resume:Je,setTheme:Ze,toggleTheme:je,toggleSound:te,toggleMusic:N,setMusicEnabled:H,setSoundEnabled:R,BLOCK_SIZE:n,WIDTH:p,HEIGHT:h}}function Ue(){const A=tt();return{saveScore:async w=>(await A.post("/tetris/scores",w)).data,fetchLeaderboard:async(w=10)=>{var E;return((E=(await A.get("/tetris/leaderboard",{params:{limit:w}})).data)==null?void 0:E.data)??[]},fetchCustomerLeaderboard:async(w=10)=>{var E;return((E=(await A.get("/tetris/leaderboard/customer",{params:{limit:w}})).data)==null?void 0:E.data)??[]},fetchMyScores:async(w=10)=>{var E;return((E=(await A.get("/tetris/leaderboard/me",{params:{limit:w}})).data)==null?void 0:E.data)??[]},fetchMyStats:async()=>{var M;return((M=(await A.get("/tetris/stats/me")).data)==null?void 0:M.data)??null}}}const St={key:1},xt={key:0,class:"tw-text-center tw-py-8"},bt={key:1,class:"tw-text-center tw-py-8 tw-text-gray-500"},kt={key:2,class:"leaderboard-list"},_t={key:1,class:"rank-number"},Tt={class:"player-info"},Ct={class:"player-name"},Lt={class:"score-info"},At={class:"score-value"},Et={class:"score-details"},Pt={key:0,class:"tw-text-center tw-py-8"},Vt={key:1,class:"tw-text-center tw-py-8 tw-text-gray-500"},Mt={key:2,class:"leaderboard-list"},Gt={key:1,class:"rank-number"},Dt={class:"player-info"},Rt={class:"player-name"},Bt={class:"score-info"},Ot={class:"score-value"},It={class:"score-details"},Ut={key:0,class:"tw-text-center tw-py-8"}
1,Nt={class:"stats-section tw-mb-4"},Ft={class:"stat-card"},zt={class:"stat-value"},Wt={class:"stat-card"},$t={class:"stat-value"},Kt={class:"stat-card"},Yt={class:"stat-value"},Ht={class:"stat-card"},Xt={class:"stat-value"},qt={key:0,class:"tw-text-center tw-py-8 tw-text-gray-500"},Jt={key:1,class:"leaderboard-list"},Zt={key:1,class:"rank-number"},jt={class:"player-info"},Qt={class:"player-name"},ea={class:"score-info"},ta={class:"score-value"},aa={class:"score-details"},sa=Oe({__name:"TetrisLeaderboardModal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(A,{emit:J}){const ee=A,W=J,B=Ue(),{user:V}=at(),w=ye(()=>{var r,e;return((e=(r=V.value)==null?void 0:r.customer)==null?void 0:e.name)||"My Company"}),M=ye(()=>w.value.length>10),E=ye(()=>M.value?w.value.substring(0,10)+"…":w.value),C=ye({get:()=>ee.modelValue,set:r=>W("update:modelValue",r)}),I=L("global"),$=L([]),D=L([]),K=L([]),te={gamesPlayed:0,highScore:0,totalScore:0,totalLinesCleared:0,averageScore:0,averageLevel:0,bestLevel:0,totalPlayTime:0,gamesToday:0,dailyLimit:null,canPlay:!0},N=L(te),H=L(!1),R=L(!1),F=L(!1);function oe(){C.value=!1}function G(r){return(r==null?void 0:r.toLocaleString())??"0"}function p(r){return new Date(r).toLocaleDateString()}function h(r){return r===0?"mdi-trophy":r===1?"mdi-medal":r===2?"mdi-medal-outline":""}function z(r){return r===0?"#FFD700":r===1?"#C0C0C0":r===2?"#CD7F32":""}async function ie(){H.value=!0;try{$.value=await B.fetchLeaderboard(10)}catch(r){console.error("Failed to fetch global leaderboard:",r)}finally{H.value=!1}}async function ne(){R.value=!0;try{D.value=await B.fetchCustomerLeaderboard(10)}catch(r){console.error("Failed to fetch company leaderboard:",r)}finally{R.value=!1}}async function n(){F.value=!0;try{const[r,e]=await Promise.all([B.fetchMyScores(10),B.fetchMyStats()]);K.value=r,N.value=e??te}catch(r){console.error("Failed to fetch personal scores:",r)}finally{F.value=!1}}return le(C,r=>{r&&(ie(),ne(),n())}),le(I,r=>{r==="global"&&$.value.length===0?ie():r==="company"&&D.value.length===0?ne():r==="personal"&&K.value.length===0&&n()}),(r,e)=>{const ae=st;return y(),Q(ae,{modelValue:i(C),"onUpdate:modelValue":e[2]||(e[2]=f=>me(C)?C.value=f:null),"custom-title":"Leaderboard",width:"600",onClose:oe},{"header-title":c(()=>[g(U,{class:"tw-mr-2"},{default:c(()=>e[3]||(e[3]=[S("mdi-trophy")])),_:1}),e[4]||(e[4]=S(" Leaderboard "))]),footer:c(()=>[g(j,{color:"primary",variant:"flat",block:"",onClick:oe},{default:c(()=>
1e[20]||(e[20]=[S(" Close ")])),_:1})]),default:c(()=>[g(mt,{modelValue:i(I),"onUpdate:modelValue":e[0]||(e[0]=f=>me(I)?I.value=f:null),color:"primary",grow:"",class:"tw-mb-4"},{default:c(()=>[g(_e,{value:"global"},{default:c(()=>[g(U,{start:""},{default:c(()=>e[5]||(e[5]=[S("mdi-earth")])),_:1}),e[6]||(e[6]=S(" Global "))]),_:1}),g(_e,{value:"company"},{default:c(()=>[g(U,{start:""},{default:c(()=>e[7]||(e[7]=[S("mdi-office-building")])),_:1}),i(M)?(y(),Q(gt,{key:0,location:"top"},{activator:c(({props:f})=>[l("span",lt(ot(f)),k(i(E)),17)]),default:c(()=>[S(" "+k(i(w)),1)]),_:1})):(y(),T("span",St,k(i(E)),1))]),_:1}),g(_e,{value:"personal"},{default:c(()=>[g(U,{start:""},{default:c(()=>e[8]||(e[8]=[S("mdi-account")])),_:1}),e[9]||(e[9]=S(" My Scores "))]),_:1})]),_:1},8,["modelValue"]),g(yt,{modelValue:i(I),"onUpdate:modelValue":e[1]||(e[1]=f=>me(I)?I.value=f:null)},{default:c(()=>[g(Te,{value:"global"},{default:c(()=>[i(H)?(y(),T("div",xt,[g(xe,{indeterminate:"",color:"primary"})])):i($).length===0?(y(),T("div",bt,[g(U,{size:"48",class:"tw-mb-2"},{default:c(()=>e[10]||(e[10]=[S("mdi-gamepad-variant-outline")])),_:1}),e[11]||(e[11]=l("p",null,"No scores yet. Start playing!",-1))])):(y(),T("div",kt,[(y(!0),T(ce,null,be(i($),(f,x)=>(y(),T("div",{key:f.id,class:"leaderboard-item"},[l("div",{class:"rank-badge",style:ke({color:z(x)})},[h(x)?(y(),Q(U,{key:0,color:z(x)},{default:c(()=>[S(k(h(x)),1)]),_:2},1032,["color"])):(y(),T("span",_t,"#"+k(x+1),1))],4),l("div",Tt,[l("span",Ct,k(f.userName??"Unknown"),1),f.customerName?(y(),Q(rt,{key:0,size:"x-small",color:"primary",variant:"outlined",class:"tw-ml-2"},{default:c(()=>[S(k(f.customerName),1)]),_:2},1024)):Ce("",!0)]),l("div",Lt,[l("div",At,k(G(f.score)),1),l("div",Et,k(p(f.createdAt)),1)])]))),128))]))]),_:1}),g(Te,{value:"company"},{default:c(()=>[i(R)?(y(),T("div",Pt,[g(xe,{indeterminate:"",color:"primary"})])):i(D).length===0?(y(),T("div",Vt,[g(U,{size:"48",class:"tw-mb-2"},{default:c(()=>e[12]||(e[12]=[S("mdi-gamepad-variant-outline")])),_:1}),e[13]||(e[13]=l("p",null,"No scores yet. Start playing!",-1))])):(y(),T("div",Mt,[(y(!0),T(ce,null,be(i(D),(f,x)=>(y(),T("div",{key:f.id,class:"leaderboard-item"},[l("div",{class:"rank-badge",style:ke({color:z(x)})},[h(x)?(y(),Q(U,{key:0,color:z(x)},{default:c(()=>[S(k(h(x)),1)]),_:2},1032,["color"])):(y(),T("span",Gt,"#"+k(x+1),1))],4),l("div",Dt,[l("span",Rt,k(f.userName??"Unknown"),1)]),l("div",Bt,[l("div",Ot,k(G(f.score)),1),l("div",It,k(p(f.createdAt)),1)])]))),128))]))]),_:1}),g(Te,{value:"personal"},{default:c(()=>[i(F)?(y(),T("div",Ut,[g(xe,{indeterminate:"",color:"primary"})])):(y(),T(ce,{key:1},[l("div",Nt,[g(pt,{dense:""},{default:c(()=>[g(pe,{cols:"6",sm:"3"},{default:c(()=>[l("div",Ft,[l("div",zt,k(i(N).gamesPlayed??0),1),e[14]||(e[14]=l("div",{class:"stat-label"},"Games Played",-1))])]),_:1}),g(pe,{cols:"6",sm:"3"},{default:c(()=>[l("div",Wt,[l("div",$t,k(G(i(N).highScore??0)),1),e[15]||(e[15]=l("div",{class:"stat-label"},"High Score",-1))])]),_:1}),g(pe,{cols:"6",sm:"3"},{default:c(()=>[l("div",Kt,[l("div",Yt,k(i(N).bestLevel??0),1),e[16]||(e[16]=l("div",{class:"stat-label"},"Best Level",-1))])]),_:1}),g(pe,{cols:"6",sm:"3"},{default:c(()=>[l("div",Ht,[l("div",Xt,k(G(i(N).totalLinesCleared??0)),1),e[17]||(e[17]=l("div",{class:"stat-label"},"Total Lines",-1))])]),_:1})]),_:1})]),i(K).length===0?(y(),T("div",qt,[g(U,{size:"48",class:"tw-mb-2"},{default:c(()=>e[18]||(e[18]=[S("mdi-gamepad-variant-outline")])),_:1}),e[19]||(e[19]=l("p",null,"No scores yet. Start playing!",-1))])):(y(),T("div",Jt,[(y(!0),T(ce,null,be(i(K),(f,x)=>(y(),T("div",{key:f.id,class:"leaderboard-item"},[l("div",{class:"rank-badge",style:ke({color:z(x)})},[h(x)?(y(),Q(U,{key:0,color:z(x)},{default:c(()=>[S(k(h(x)),1)]),_:2},1032,["color"])):(y(),T("span",Zt,"#"+k(x+1),1))],4),l("div",jt,[l("span",Qt,k(G(f.score))+" pts",1)]),l("div",ea,[l("div",ta,"Lvl "+k(f.level),1),l("div",aa,k(p(f.createdAt)),1)])]))),128))]))],64))]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}}}),la=Ie(sa,[["__scopeId","data-v-985b52c6"]]),oa={key:0,class:"loading-container"},ra={class:"loading-message"},ia={class:"tetris-container"},na={class:"game-area"},da={class:"game-wrapper"},ca={class:"controls-section"},fa={class:"game-buttons"},ua={class:"settings-row"},va={class:"theme-toggle"},ma={class:"sound-controls"},ga={key:2,class:"feature-disabled"},ya=Oe({__name:"index",setup(A){const J=["Starting engine... whether it's wheels, tracks, or blocks.","Arranging units on the lot - trailers, ATVs, and tetrominoes alike.","Prepping your inventory: towable, rideable, and stackable.","Detailing your next piece - showroom shine guaranteed.","Delivering fresh stock... some roll in, some fall from the sky.","Clearing space on the lot - b
1ig haulers and fast toys welcome.","Performing a walk-around inspection on your next tetromino.","Fueling up... some need gas, some need gravity.","Staging units - whether they hitch or rip.","Backing up the next piece... use your mirrors!","Syncing inventory across trailers, ATVs, UTVs... and mysterious falling shapes.","Transport truck arriving... with a load of colorful blocks.","Polishing your tetromino - it's ready for the showroom.","Check your safety gear... block-drop adventure incoming."],ee=L(J[Math.floor(Math.random()*J.length)]),{featureFlagEnabled:W,isLoading:B}=it(),V=W(nt),w=Ue(),M=L(null),E=L(!1),C=L(!0),I=L(0),$=L(null),D=L(!0);let K=0,te=0,N=0,H=0;const{gameState:R,currentTheme:F,isSoundEnabled:oe,isMusicEnabled:G,init:p,startGame:h,restart:z,destroy:ie,pause:ne,resume:n,setTheme:r,toggleSound:e,toggleMusic:ae}=wt({onGameOver:async(b,d)=>{console.log(`Game Over! Score: ${b}, Lines: ${d}`);const q=Math.floor((Date.now()-K)/1e3);try{await w.saveScore({score:b,linesCleared:d,level:R.value.level,duration:q,tetrisCount:te,maxCombo:N,gameVersion:"1.0.0"}),console.log("Score saved successfully!"),await O()}catch(v){console.error("Failed to save score:",v)}},onScoreChange:b=>{},onLinesClear:b=>{b===4&&te++,H++,H>N&&(N=H)}}),f=L(F.value);le(f,b=>{r(b)}),le(F,b=>{f.value!==b&&(f.value=b)});function x(){K=Date.now(),te=0,N=0,H=0}async function O(){try{D.value=!0;const b=await w.fetchMyStats();b&&(C.value=b.canPlay,I.value=b.gamesToday,$.value=b.dailyLimit,R.value.isBlocked=!b.canPlay)}catch(b){console.error("Failed to fetch daily limit stats:",b),C.value=!0,R.value.isBlocked=!1}finally{D.value=!1}}async function re(){await O(),C.value&&(x(),h())}async function X(){await O(),C.value&&(x(),z())}function _(){R.value.isPaused?n():ne()}let fe=!1;function ue(){!fe&&M.value&&V.value&&(p(M.value),fe=!0)}return dt(()=>{De(()=>{ue(),O()})}),le(V,b=>{b&&De(()=>{ue()})}),ct(()=>{ie()}),(b,d)=>(y(),T("div",{class:ut(["tetris-page",{"light-mode":i(F)==="light"}])},[i(B)?(y(),T("div",oa,[d[3]||(d[3]=Re('<div class="trailer-animation-container" data-v-2d89a67f><svg class="animated-trailer" viewBox="0 0 200 80" xmlns="http://www.w3.org/2000/svg" data-v-2d89a67f><rect x="60" y="25" width="70" height="35" rx="3" fill="#32ba8f" stroke="#1d8565" stroke-width="2" data-v-2d89a67f></rect><rect x="68" y="32" width="12" height="10" rx="1" fill="#093735" data-v-2d89a67f></rect><rect x="85" y="32" width="12" height="10" rx="1" fill="#093735" data-v-2d89a67f></rect><rect x="102" y="32" width="12" height="10" rx="1" fill="#093735" data-v-2d89a67f></rect><rect x="130" y="48" width="15" height="6" rx="2" fill="#555" data-v-2d89a67f></rect><circle cx="148" cy="51" r="4" fill="#333" stroke="#555" stroke-width="1" data-v-2d89a67f></circle><rect x="145" y="30" width="40" height="30" rx="4" fill="#1d8565" stroke="#093735" stroke-width="2" data-v-2d89a67f></rect><rect x="165" y="35" width="15" height="12" rx="2" fill="#87CEEB" data-v-2d89a67f></rect><line x1="160" y1="35" x2="160" y2="55" stroke="#093735" stroke-width="1" data-v-2d89a67f></line><rect x="152" y="44" width="5" height="2" rx="1" fill="#093735" data-v-2d89a67f></rect><g class="wheel wheel-1" data-v-2d89a67f><circle cx="80" cy="60" r="10" fill="#333" data-v-2d89a67f></circle><circle cx="80" cy="60" r="6" fill="#666" data-v-2d89a67f></circle><circle cx="80" cy="60" r="2" fill="#999" data-v-2d89a67f></circle><line x1="80" y1="54" x2="80" y2="66" stroke="#444" stroke-width="2" data-v-2d89a67f></line><line x1="74" y1="60" x2="86" y2="60" stroke="#444" stroke-width="2" data-v-2d89a67f></line></g><g class="wheel wheel-2" data-v-2d89a67f><circle cx="115" cy="60" r="10" fill="#333" data-v-2d89a67f></circle><circle cx="115" cy="60" r="6" fill="#666" data-v-2d89a67f></circle><circle cx="115" cy="60" r="2" fill="#999" data-v-2d89a67f></circle><line x1="115" y1="54" x2="115" y2="66" stroke="#444" stroke-width="2" data-v-2d89a67f></line><line x1="109" y1="60" x2="121" y2="60" stroke="#444" stroke-width="2" data-v-2d89a67f></line></g><g class="wheel wheel-3" data-v-2d89a67f><circle cx="165" cy="60" r="10" fill="#333" data-v-2d89a67f></circle><circle cx="165" cy="60" r="6" fill="#666" data-v-2d89a67f></circle><circle cx="165" cy="60" r="2" fill="#999" data-v-2d89a67f></circle><line x1="165" y1="54" x2="165" y2="66" stroke="#444" stroke-width="2" data-v-2d89a67f></line><line x1="159" y1="60" x2="171" y2="60" stroke="#444" stroke-width="2" data-v-2d89a67f></line></g><rect x="70" y="46" width="8" height="8" fill="#FF6B6B" rx="1" data-v-2d89a67f></rect><rect x="80" y="46" width="8" height="8" fill="#4ECDC4" rx="1" data-v-2d89a67f></rect><rect x="90" y="46" width="8" height="8" fill="#FFE66D" rx="1" data-v-2d89a67f></rect><rect x="100" y="46" width="8" height="8" fill="#95E1D3" rx="1" data-v-2d89a67f></rect><rect x="110" y="46" width="8" height="8" fill="#DDA0DD" rx="1" data-v-2d89a67f></rect><line x1="0" y1="70" x2="200" y2="70" stroke="#1d8565" stroke-width="2" stroke-dasharray="10,5" data-v-2d89a67f></line></svg></div>',1)),l("p",ra,k(i(ee)),1),d[4]||(d[4]=l("div",{class:"loading-dots"},[l("span",{class:"dot"}),l("span",{class:"dot"}),l("span",{class:"dot"})],-1))])):i(V)?(y(),T(ce,{key:1},[g(j,{class:"leaderboard-btn",color:"primary",variant:"flat",onClick:d[0]||(d[0]=q=>E.value=!0),"prepend-icon":"mdi-trophy"},{default:c(()=>d[5]||(d[5]=[S(" Leaderboard ")])),_:1}),g(la,{modelValue:i(E),"onUpdate:modelValue":d[1]||(d[1]=q=>me(E)?E.value=q:null)},null,8,["modelValue"]),l("div",ia,[l("div",na,[l("div",da,[l("canvas",{ref_key:"canvasRef",ref:M,class:"game-canvas"},null,512)])]),l("div",ca,[!i(C)&&i($)!==null?(y(),Q(ht,{key:0,t
1ype:"warning",variant:"tonal",class:"daily-limit-alert",density:"compact"},{title:c(()=>d[6]||(d[6]=[S("Daily limit reached")])),default:c(()=>[S(" You've played "+k(i($))+" games today. Come back tomorrow for more! ",1)]),_:1})):Ce("",!0),l("div",fa,[i(R).isWaitingToStart?(y(),Q(j,{key:0,color:"success",size:"large",flat:"",disabled:!i(C)||i(D),loading:i(D),onClick:re,"prepend-icon":"mdi-play"},{default:c(()=>d[7]||(d[7]=[S(" Start Game ")])),_:1},8,["disabled","loading"])):(y(),T(ce,{key:1},[g(j,{color:"primary",size:"large",flat:"",disabled:!i(C)||i(D),loading:i(D),onClick:X,"prepend-icon":"mdi-restart"},{default:c(()=>d[8]||(d[8]=[S(" New Game ")])),_:1},8,["disabled","loading"]),i(R).isGameOver?Ce("",!0):(y(),Q(j,{key:0,color:i(R).isPaused?"success":"warning",size:"large",flat:"",onClick:_,"prepend-icon":i(R).isPaused?"mdi-play":"mdi-pause"},{default:c(()=>[S(k(i(R).isPaused?"Resume":"Pause"),1)]),_:1},8,["color","prepend-icon"]))],64))]),l("div",ua,[l("div",va,[g(ft,{modelValue:i(f),"onUpdate:modelValue":d[2]||(d[2]=q=>me(f)?f.value=q:null),mandatory:"",density:"compact",color:"primary"},{default:c(()=>[g(j,{value:"dark",size:"small"},{default:c(()=>[g(U,{start:""},{default:c(()=>d[9]||(d[9]=[S("mdi-weather-night")])),_:1}),d[10]||(d[10]=S(" Dark "))]),_:1}),g(j,{value:"light",size:"small"},{default:c(()=>[g(U,{start:""},{default:c(()=>d[11]||(d[11]=[S("mdi-white-balance-sunny")])),_:1}),d[12]||(d[12]=S(" Light "))]),_:1})]),_:1},8,["modelValue"])]),l("div",ma,[g(j,{color:i(G)?"primary":"grey",size:"small",variant:"tonal",onClick:i(ae),"prepend-icon":i(G)?"mdi-music":"mdi-music-off"},{default:c(()=>d[13]||(d[13]=[S(" Music ")])),_:1},8,["color","onClick","prepend-icon"]),g(j,{color:i(oe)?"primary":"grey",size:"small",variant:"tonal",onClick:i(e),"prepend-icon":i(oe)?"mdi-volume-high":"mdi-volume-off"},{default:c(()=>d[14]||(d[14]=[S(" SFX ")])),_:1},8,["color","onClick","prepend-icon"])])]),d[15]||(d[15]=Re('<div class="controls-info" data-v-2d89a67f><h3 data-v-2d89a67f>Controls</h3><div class="controls-grid" data-v-2d89a67f><div class="control-item" data-v-2d89a67f><span class="key" data-v-2d89a67f>Arrow Left / A</span><span class="action" data-v-2d89a67f>Move Left</span></div><div class="control-item" data-v-2d89a67f><span class="key" data-v-2d89a67f>Arrow Right / D</span><span class="action" data-v-2d89a67f>Move Right</span></div><div class="control-item" data-v-2d89a67f><span class="key" data-v-2d89a67f>Arrow Down / S</span><span class="action" data-v-2d89a67f>Soft Drop</span></div><div class="control-item" data-v-2d89a67f><span class="key" data-v-2d89a67f>Arrow Up / W</span><span class="action" data-v-2d89a67f>Rotate</span></div><div class="control-item" data-v-2d89a67f><span class="key" data-v-2d89a67f>Space</span><span class="action" data-v-2d89a67f>Hard Drop</span></div><div class="control-item" data-v-2d89a67f><span class="key" data-v-2d89a67f>P / Esc</span><span class="action" data-v-2d89a67f>Pause</span></div></div></div>',1))])])],64)):(y(),T("div",ga,[g(U,{size:"64",color:"grey"},{default:c(()=>d[16]||(d[16]=[S("mdi-gamepad-variant-outline")])),_:1}),d[17]||(d[17]=l("h2",null,"Tetris is not available",-1)),d[18]||(d[18]=l("p",null,"This feature is currently disabled for your account.",-1))]))],2))}}),Ta=Ie(ya,[["__scopeId","data-v-2d89a67f"]]);export{Ta as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.