PageSourceSearch

https://bacctrack-7ha7hyw7.manus.space/assets/PlayPage-WN4-blkY.js

js bacctrack-7ha7hyw7.manus.space collected 2026-10-03 05:00:44 UTC 162,199 bytes, 19 lines download raw bytes

1import{f as ms,av as Gs,r as u,t as H,j as e,b as F,ax as Ks,a3 as Qs,u as Js,S as wa,A as rt,y as ht,C as ja,H as _t,e as Ys}from"./index-C3Qps0S4.js";import{D as He,a as Na,b as Ge,c as lt,d as ct}from"./dialog-BY1FISUw.js";import{A as va,a as Ca,b as Sa,c as ka,d as Ea,e as Aa,f as Ta,g as Ra}from"./alert-dialog-BzKLv-3y.js";import{i as fs,a as Xs,b as Zs,c as en,d as tn,S as an,L as sn,t as nn,p as rn}from"./sounds-DX0lF6iN.js";import{A as ln}from"./arrow-left-AxGNO8ZF.js";import{H as Ft}from"./history-B2QWoLNH.js";import{W as cn}from"./wallet-BgwNklK4.js";import{T as on}from"./timer-BUYRTa4S.js";import{P as dn}from"./plus-BLlLQSZn.js";import{B as Lt}from"./brain-B6nwQ_cR.js";import{F as Ma}from"./folder-open-BFhfsFp9.js";import{Z as gn}from"./zap-Dg3Ucl6s.js";import{L as $t}from"./lock-BImxJe9g.js";import{S as xn}from"./star-B909tHoY.js";import{F as Dt}from"./flame-ClgW77Uq.js";import{B as Ba}from"./ban-CxViRXpU.js";import{T as un}from"./target-FUBQRvNw.js";import{C as Ia}from"./calculator-BESwuf8w.js";import{U as _a}from"./undo-2-BQMFSJ40.js";import{S as pn}from"./settings-2-BrupEw02.js";import{T as mn}from"./trending-up-Dq4_iocl.js";import{S as fn}from"./snowflake-BXGYS1DI.js";import{T as hn}from"./trophy-C56YBVkm.js";import{R as yn}from"./refresh-cw-DwgqC19c.js";import{C as Pn}from"./chevron-up-F-ZIdiqt.js";import{P as bn}from"./play-NZNEVHTw.js";import{C as wn}from"./clock-CHw5d3NP.js";import{V as jn}from"./volume-2-B2de-iZy.js";import{V as Nn}from"./volume-x-x5MV5uu0.js";import"./index-BKUanX19.js";import"./index-Dr02_Kwf.js";import"./button-xdpkFraK.js";import"./index-Jol-UBUv.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const yt=ms("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}
vendor: 18,739 bytes, lines 6-14
6],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
7 * @license lucide-react v0.453.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const vn=ms("Thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);var Ke={},Wt,Fa;function Cn(){return Fa||(Fa=1,Wt=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Wt}var Ut={},Se={},La;function _e(){if(La)return Se;La=1;let n;const s=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Se.getSymbolSize=function(a){if(!a)throw new Error('"version" cannot be null or undefined');if(a<1||a>40)throw new Error('"version" should be in range from 1 to 40');return a*4+17},Se.getSymbolTotalCodewords=function(a){return s[a]},Se.getBCHDigit=function(l){let a=0;for(;l!==0;)a++,l>>>=1;return a},Se.setToSJISFunction=function(a){if(typeof a!="function")throw new Error('"toSJISFunc" is not a valid function.');n=a},Se.isKanjiModeEnabled=function(){return typeof n<"u"},Se.toSJIS=function(a){return n(a)},Se}var qt={},$a;function ga(){return $a||($a=1,(function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function s(l){if(typeof l!="string")throw new Error("Param is not a string");switch(l.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+l)}}n.isValid=function(a){return a&&typeof a.bit<"u"&&a.bit>=0&&a.bit<4},n.from=function(a,t){if(n.isValid(a))return a;try{return s(a)}catch{return t}}})(qt)),qt}var Vt,Da;function Sn(){if(Da)return Vt;Da=1;function n(){this.buffer=[],this.length=0}return n.prototype={get:function(s){const l=Math.floor(s/8);return(this.buffer[l]>>>7-s%8&1)===1},put:function(s,l){for(let a=0;a<l;a++)this.putBit((s>>>l-a-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(s){const l=Math.floor(this.length/8);this.buffer.length<=l&&this.buffer.push(0),s&&(this.buffer[l]|=128>>>this.length%8),this.length++}},Vt=n,Vt}var zt,Wa;function kn(){if(Wa)return zt;Wa=1;function n(s){if(!s||s<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=s,this.data=new Uint8Array(s*s),this.reservedBit=new Uint8Array(s*s)}return n.prototype.set=function(s,l,a,t){const r=s*this.size+l;this.data[r]=a,t&&(this.reservedBit[r]=!0)},n.prototype.get=function(s,l){return this.data[s*this.size+l]},n.prototype.xor=function(s,l,a){this.data[s*this.size+l]^=a},n.prototype.isReserved=function(s,l){return this.reservedBit[s*this.size+l]},zt=n,zt}var Ot={},Ua;function En(){return Ua||(Ua=1,(function(n){const s=_e().getSymbolSize;n.getRowColCoords=function(a){if(a===1)return[];const t=Math.floor(a/7)+2,r=s(a),o=r===145?26:Math.ceil((r-13)/(2*t-2))*2,i=[r-7];for(let d=1;d<t-1;d++)i[d]=i[d-1]-o;return i.push(6),i.reverse()},n.getPositions=function(a){const t=[],r=n.getRowColCoords(a),o=r.length;for(let i=0;i<o;i++)for(let d=0;d<o;d++)i===0&&d===0||i===0&&d===o-1||i===o-1&&d===0||t.push([r[i],r[d]]);return t}})(Ot)),Ot}var Ht={},qa;function An(){if(qa)return Ht;qa=1;const n=_e().getSymbolSize,s=7;return Ht.getPositions=function(a){const t=n(a);return[[0,0],[t-s,0],[0,t-s]]},Ht}var Gt={},Va;function Tn(){return Va||(Va=1,(function(n){n.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const s={N1:3,N2:3,N3:40,N4:10};n.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},n.from=function(t){return n.isValid(t)?parseInt(t,10):void 0},n.getPenaltyN1=function(t){const r=t.size;let o=0,i=0,d=0,h=null,w=null;for(let j=0;j<r;j++){i=d=0,h=w=null;for(let x=0;x<r;x++){let f=t.get(j,x);f===h?i++:(i>=5&&(o+=s.N1+(i-5)),h=f,i=1),f=t.get(x,j),f===w?d++:(d>=5&&(o+=s.N1+(d-5)),w=f,d=1)}i>=5&&(o+=s.N1+(i-5)),d>=5&&(o+=s.N1+(d-5))}return o},n.getPenaltyN2=function(t){const r=t.size;let o=0;for(let i=0;i<r-1;i++)for(let d=0;d<r-1;d++){const h=t.get(i,d)+t.get(i,d+1)+t.get(i+1,d)+t.get(i+1,d+1);(h===4||h===0)&&o++}return o*s.N2},n.getPenaltyN3=function(t){const r=t.size;let o=0,i=0,d=0;for(let h=0;h<r;h++){i=d=0;for(let w=0;w<r;w++)i=i<<1&2047|t.get(h,w),w>=10&&(i===1488||i===93)&&o++,d=d<<1&2047|t.get(w,h),w>=10&&(d===1488||d===93)&&o++}return o*s.N3},n.getPenaltyN4=function(t){let r=0;const o=t.data.length;for(let d=0;d<o;d++)r+=t.data[d];return Math.abs(Math.ceil(r*100/o/5)-10)*s.N4};function l(a,t,r){switch(a){case n.Patterns.PATTERN000:return(t+r)%2===0;case n.Patterns.PATTERN001:return t%2===0;case n.Patterns.PATTERN010:return r%3===0;case n.Patterns.PATTERN011:return(t+r)%3===0;case n.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case n.Patterns.PATTERN101:return t*r%2+t*r%3===0;case n.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case n.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+a)}}n.applyMask=function(t,r){const o=r.size;for(let i=0;i<o;i++)for(let d=0;d<o;d++)r.isReserved(d,i)||r.xor(d,i,l(t,d,i))},n.getBestMask=function(t,r){const o=Object.keys(n.Patterns).length;let i=0,d=1/0;for(let h=0;h<o;h++){r(h),n.applyMask(h,t);const w=n.getPenaltyN1(t)+n.getPenaltyN2(t)+n.getPenaltyN3(t)+n.getPenaltyN4(t);n.applyMask(h,t),w<d&&(d=w,i=h)}return i}})(Gt)),Gt}var Pt={},za;function hs(){if(za)return Pt;za=1;const n=ga(),s=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],l=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Pt.getBlocksCount=function(t,r){switch(r){case n.L:return s[(t-1)*4+0];case n.M:return s[(t-1)*4+1];case n.Q:return s[(t-1)*4+2];case n.H:return s[(t-1)*4+3];default:return}},Pt.getTotalCodewordsCount=function(t,r){switch(r){case n.L:return l[(t-1)*4+0];case n.M:return l[(t-1)*4+1];case n.Q:return l[(t-1)*4+2];case n.H:return l[(t-1)*4+3];default:return}},Pt}var Kt={},ot={},Oa;function Rn(){if(Oa)return ot;Oa=1;const n=new Uint8Array(512),s=new Uint8Array(256);return(function(){let a=1;for(let t=0;t<255;t++)n[t]=a,s[a]=t,a<<=1,a&256&&(a^=285);for(let t=255;t<512;t++)n[t]=n[t-255]})(),ot.log=function(a){if(a<1)throw new Error("log("+a+")");return s[a]},ot.exp=function(a){return n[a]},ot.mul=function(a,t){return a===0||t===0?0:n[s[a]+s[t]]},ot}var Ha;function Mn(){return Ha||(Ha=1,(function(n){const s=Rn();n.mul=function(a,t){const r=new Uint8Array(a.length+t.length-1);for(let o=0;o<a.length;o++)for(let i=0;i<t.length;i++)r[o+i]^=s.mul(a[o],t[i]);return r},n.mod=function(a,t){let r=new Uint8Array(a);for(;r.length-t.length>=0;){const o=r[0];for(let d=0;d<t.length;d++)r[d]^=s.mul(t[d],o);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},n.generateECPolynomial=function(a){let t=new Uint8Array([1]);for(let r=0;r<a;r++)t=n.mul(t,new Uint8Array([1,s.exp(r)]));return t}})(Kt)),Kt}var Qt,Ga;function Bn(){if(Ga)return Qt;Ga=1;const n=Mn();function s(l){this.genPoly=void 0,this.degree=l,this.degree&&this.initialize(this.degree)}return s.prototype.initialize=function(a){this.degree=a,this.genPoly=n.generateECPolynomial(this.degree)},s.prototype.encode=function(a){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(a.length+this.degree);t.set(a);const r=n.mod(t,this.genPoly),o=this.degree-r.length;if(o>0){const i=new Uint8Array(this.degree);return i.set(r,o),i}return r},Qt=s,Qt}var Jt={},Yt={},Xt={},Ka;function ys(){return Ka||(Ka=1,Xt.isValid=function(s){return!isNaN(s)&&s>=1&&s<=40}),Xt}var fe={},Qa;function Ps(){if(Qa)return fe;Qa=1;const n="[0-9]+",s="[A-Z $%*+\\-./:]+";let l="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";l=l.replace(/u/g,"\\u");const a="(?:(?![A-Z0-9 $%*+\\-./:]|"+l+`)(?:.|[\r
12]))+`;fe.KANJI=new RegExp(l,"g"),fe.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),fe.BYTE=new RegExp(a,"g"),fe.NUMERIC=new RegExp(n,"g"),fe.ALPHANUMERIC=new RegExp(s,"g");const t=new RegExp("^"+l+"$"),r=new RegExp("^"+n+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return fe.testKanji=function(d){return t.test(d)},fe.testNumeric=function(d){return r.test(d)},fe.testAlphanumeric=function(d){return o.test(d)},fe}var Ja;function Fe(){return Ja||(Ja=1,(function(n){const s=ys(),l=Ps();n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(r,o){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!s.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?r.ccBits[0]:o<27?r.ccBits[1]:r.ccBits[2]},n.getBestModeForData=function(r){return l.testNumeric(r)?n.NUMERIC:l.testAlphanumeric(r)?n.ALPHANUMERIC:l.testKanji(r)?n.KANJI:n.BYTE},n.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},n.isValid=function(r){return r&&r.bit&&r.ccBits};function a(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+t)}}n.from=function(r,o){if(n.isValid(r))return r;try{return a(r)}catch{return o}}})(Yt)),Yt}var Ya;function In(){return Ya||(Ya=1,(function(n){const s=_e(),l=hs(),a=ga(),t=Fe(),r=ys(),o=7973,i=s.getBCHDigit(o);function d(x,f,E){for(let L=1;L<=40;L++)if(f<=n.getCapacity(L,E,x))return L}function h(x,f){return t.getCharCountIndicator(x,f)+4}function w(x,f){let E=0;return x.forEach(function(L){const q=h(L.mode,f);E+=q+L.getBitsLength()}),E}function j(x,f){for(let E=1;E<=40;E++)if(w(x,E)<=n.getCapacity(E,f,t.MIXED))return E}n.from=function(f,E){return r.isValid(f)?parseInt(f,10):E},n.getCapacity=function(f,E,L){if(!r.isValid(f))throw new Error("Invalid QR Code version");typeof L>"u"&&(L=t.BYTE);const q=s.getSymbolTotalCodewords(f),R=l.getTotalCodewordsCount(f,E),U=(q-R)*8;if(L===t.MIXED)return U;const I=U-h(L,f);switch(L){case t.NUMERIC:return Math.floor(I/10*3);case t.ALPHANUMERIC:return Math.floor(I/11*2);case t.KANJI:return Math.floor(I/13);case t.BYTE:default:return Math.floor(I/8)}},n.getBestVersionForData=function(f,E){let L;const q=a.from(E,a.M);if(Array.isArray(f)){if(f.length>1)return j(f,q);if(f.length===0)return 1;L=f[0]}else L=f;return d(L.mode,L.getLength(),q)},n.getEncodedBits=function(f){if(!r.isValid(f)||f<7)throw new Error("Invalid QR Code version");let E=f<<12;for(;s.getBCHDigit(E)-i>=0;)E^=o<<s.getBCHDigit(E)-i;return f<<12|E}})(Jt)),Jt}var Zt={},Xa;function _n(){if(Xa)return Zt;Xa=1;const n=_e(),s=1335,l=21522,a=n.getBCHDigit(s);return Zt.getEncodedBits=function(r,o){const i=r.bit<<3|o;let d=i<<10;for(;n.getBCHDigit(d)-a>=0;)d^=s<<n.getBCHDigit(d)-a;return(i<<10|d)^l},Zt}var ea={},ta,Za;function Fn(){if(Za)return ta;Za=1;const n=Fe();function s(l){this.mode=n.NUMERIC,this.data=l.toString()}return s.getBitsLength=function(a){return 10*Math.floor(a/3)+(a%3?a%3*3+1:0)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(a){let t,r,o;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),o=parseInt(r,10),a.put(o,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),o=parseInt(r,10),a.put(o,i*3+1))},ta=s,ta}var aa,es;function Ln(){if(es)return aa;es=1;const n=Fe(),s=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function l(a){this.mode=n.ALPHANUMERIC,this.data=a}return l.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},l.prototype.getLength=function(){return this.data.length},l.prototype.getBitsLength=function(){return l.getBitsLength(this.data.length)},l.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let o=s.indexOf(this.data[r])*45;o+=s.indexOf(this.data[r+1]),t.put(o,11)}this.data.length%2&&t.put(s.indexOf(this.data[r]),6)},aa=l,aa}var sa,ts;function $n(){if(ts)return sa;ts=1;const n=Fe();function s(l){this.mode=n.BYTE,typeof l=="string"?this.data=new TextEncoder().encode(l):this.data=new Uint8Array(l)}return s.getBitsLength=function(a){return a*8},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(l){for(let a=0,t=this.data.length;a<t;a++)l.put(this.data[a],8)},sa=s,sa}var na,as;function Dn(){if(as)return na;as=1;const n=Fe(),s=_e();function l(a){this.mode=n.KANJI,this.data=a}return l.getBitsLength=function(t){return t*13},l.prototype.getLength=function(){return this.data.length},l.prototype.getBitsLength=function(){return l.getBitsLength(this.data.length)},l.prototype.write=function(a){let t;for(t=0;t<this.data.length;t++){let r=s.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
13Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),a.put(r,13)}},na=l,na}var ra={exports:{}},ss;function Wn(){return ss||(ss=1,(function(n){var s={single_source_shortest_paths:function(l,a,t){var r={},o={};o[a]=0;var i=s.PriorityQueue.make();i.push(a,0);for(var d,h,w,j,x,f,E,L,q;!i.empty();){d=i.pop(),h=d.value,j=d.cost,x=l[h]||{};for(w in x)x.hasOwnProperty(w)&&(f=x[w],E=j+f,L=o[w],q=typeof o[w]>"u",(q||L>E)&&(o[w]=E,i.push(w,E),r[w]=h))}if(typeof t<"u"&&typeof o[t]>"u"){var R=["Could not find a path from ",a," to ",t,"."].join("");throw new Error(R)}return r},extract_shortest_path_from_predecessor_list:function(l,a){for(var t=[],r=a;r;)t.push(r),l[r],r=l[r];return t.reverse(),t},find_path:function(l,a,t){var r=s.single_source_shortest_paths(l,a,t);return s.extract_shortest_path_from_predecessor_list(r,t)},PriorityQueue:{make:function(l){var a=s.PriorityQueue,t={},r;l=l||{};for(r in a)a.hasOwnProperty(r)&&(t[r]=a[r]);return t.queue=[],t.sorter=l.sorter||a.default_sorter,t},default_sorter:function(l,a){return l.cost-a.cost},push:function(l,a){var t={value:l,cost:a};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};n.exports=s})(ra)),ra.exports}var ns;function Un(){return ns||(ns=1,(function(n){const s=Fe(),l=Fn(),a=Ln(),t=$n(),r=Dn(),o=Ps(),i=_e(),d=Wn();function h(R){return unescape(encodeURIComponent(R)).length}function w(R,U,I){const k=[];let A;for(;(A=R.exec(I))!==null;)k.push({data:A[0],index:A.index,mode:U,length:A[0].length});return k}function j(R){const U=w(o.NUMERIC,s.NUMERIC,R),I=w(o.ALPHANUMERIC,s.ALPHANUMERIC,R);let k,A;return i.isKanjiModeEnabled()?(k=w(o.BYTE,s.BYTE,R),A=w(o.KANJI,s.KANJI,R)):(k=w(o.BYTE_KANJI,s.BYTE,R),A=[]),U.concat(I,k,A).sort(function(p,P){return p.index-P.index}).map(function(p){return{data:p.data,mode:p.mode,length:p.length}})}function x(R,U){switch(U){case s.NUMERIC:return l.getBitsLength(R);case s.ALPHANUMERIC:return a.getBitsLength(R);case s.KANJI:return r.getBitsLength(R);case s.BYTE:return t.getBitsLength(R)}}function f(R){return R.reduce(function(U,I){const k=U.length-1>=0?U[U.length-1]:null;return k&&k.mode===I.mode?(U[U.length-1].data+=I.data,U):(U.push(I),U)},[])}function E(R){const U=[];for(let I=0;I<R.length;I++){const k=R[I];switch(k.mode){case s.NUMERIC:U.push([k,{data:k.data,mode:s.ALPHANUMERIC,length:k.length},{data:k.data,mode:s.BYTE,length:k.length}]);break;case s.ALPHANUMERIC:U.push([k,{data:k.data,mode:s.BYTE,length:k.length}]);break;case s.KANJI:U.push([k,{data:k.data,mode:s.BYTE,length:h(k.data)}]);break;case s.BYTE:U.push([{data:k.data,mode:s.BYTE,length:h(k.data)}])}}return U}function L(R,U){const I={},k={start:{}};let A=["start"];for(let m=0;m<R.length;m++){const p=R[m],P=[];for(let b=0;b<p.length;b++){const M=p[b],N=""+m+b;P.push(N),I[N]={node:M,lastCount:0},k[N]={};for(let B=0;B<A.length;B++){const T=A[B];I[T]&&I[T].node.mode===M.mode?(k[T][N]=x(I[T].lastCount+M.length,M.mode)-x(I[T].lastCount,M.mode),I[T].lastCount+=M.length):(I[T]&&(I[T].lastCount=M.length),k[T][N]=x(M.length,M.mode)+4+s.getCharCountIndicator(M.mode,U))}}A=P}for(let m=0;m<A.length;m++)k[A[m]].end=0;return{map:k,table:I}}function q(R,U){let I;const k=s.getBestModeForData(R);if(I=s.from(U,k),I!==s.BYTE&&I.bit<k.bit)throw new Error('"'+R+'" cannot be encoded with mode '+s.toString(I)+`.
14 Suggested mode is: `+s.toString(k));switch(I===s.KANJI&&!i.isKanjiModeEnabled()&&(I=s.BYTE),I){case s.NUMERIC:return new l(R);case s.ALPHANUMERIC:return new a(R);case s.KANJI:return new r(R);case s.BYTE:return new t(R)}}n.fromArray=function(U){return U.reduce(function(I,k){return typeof k=="string"?I.push(q(k,null)):k.data&&I.push(q(k.data,k.mode)),I},[])},n.fromString=function(U,I){const k=j(U,i.isKanjiModeEnabled()),A=E(k),m=L(A,I),p=d.find_path(m.map,"start","end"),P=[];for(let b=1;b<p.length-1;b++)P.push(m.table[p[b]].node);return n.fromArray(f(P))},n.rawSplit=function(U){return n.fromArray(j(U,i.isKanjiModeEnabled()))}})(ea)),ea}var rs;function qn(){if(rs)return Ut;rs=1;const n=_e(),s=ga(),l=Sn(),a=kn(),t=En(),r=An(),o=Tn(),i=hs(),d=Bn(),h=In(),w=_n(),j=Fe(),x=Un();function f(m,p){const P=m.size,b=r.getPositions(p);for(let M=0;M<b.length;M++){const N=b[M][0],B=b[M][1];for(let T=-1;T<=7;T++)if(!(N+T<=-1||P<=N+T))for(let D=-1;D<=7;D++)B+D<=-1||P<=B+D||(T>=0&&T<=6&&(D===0||D===6)||D>=0&&D<=6&&(T===0||T===6)||T>=2&&T<=4&&D>=2&&D<=4?m.set(N+T,B+D,!0,!0):m.set(N+T,B+D,!1,!0))}}function E(m){const p=m.size;
vendor: 1,107 bytes, line 14
14for(let P=8;P<p-8;P++){const b=P%2===0;m.set(P,6,b,!0),m.set(6,P,b,!0)}}function L(m,p){const P=t.getPositions(p);for(let b=0;b<P.length;b++){const M=P[b][0],N=P[b][1];for(let B=-2;B<=2;B++)for(let T=-2;T<=2;T++)B===-2||B===2||T===-2||T===2||B===0&&T===0?m.set(M+B,N+T,!0,!0):m.set(M+B,N+T,!1,!0)}}function q(m,p){const P=m.size,b=h.getEncodedBits(p);let M,N,B;for(let T=0;T<18;T++)M=Math.floor(T/3),N=T%3+P-8-3,B=(b>>T&1)===1,m.set(M,N,B,!0),m.set(N,M,B,!0)}function R(m,p,P){const b=m.size,M=w.getEncodedBits(p,P);let N,B;for(N=0;N<15;N++)B=(M>>N&1)===1,N<6?m.set(N,8,B,!0):N<8?m.set(N+1,8,B,!0):m.set(b-15+N,8,B,!0),N<8?m.set(8,b-N-1,B,!0):N<9?m.set(8,15-N-1+1,B,!0):m.set(8,15-N-1,B,!0);m.set(b-8,8,1,!0)}function U(m,p){const P=m.size;let b=-1,M=P-1,N=7,B=0;for(let T=P-1;T>0;T-=2)for(T===6&&T--;;){for(let D=0;D<2;D++)if(!m.isReserved(M,T-D)){let X=!1;B<p.length&&(X=(p[B]>>>N&1)===1),m.set(M,T-D,X),N--,N===-1&&(B++,N=7)}if(M+=b,M<0||P<=M){M-=b,b=-b;break}}}function I(m,p,P){const b=new l;P.forEach(function(D){b.put(D.mode.bit,4),b.put(D.getLength(),j.getCharCountIndicator(D.mode,m)),D.write(b)});
vendor: 4,873 bytes, lines 14-17
14const M=n.getSymbolTotalCodewords(m),N=i.getTotalCodewordsCount(m,p),B=(M-N)*8;for(b.getLengthInBits()+4<=B&&b.put(0,4);b.getLengthInBits()%8!==0;)b.putBit(0);const T=(B-b.getLengthInBits())/8;for(let D=0;D<T;D++)b.put(D%2?17:236,8);return k(b,m,p)}function k(m,p,P){const b=n.getSymbolTotalCodewords(p),M=i.getTotalCodewordsCount(p,P),N=b-M,B=i.getBlocksCount(p,P),T=b%B,D=B-T,X=Math.floor(b/B),xe=Math.floor(N/B),xa=xe+1,bt=X-xe,gt=new d(bt);let ue=0;const pe=new Array(B),Je=new Array(B);let Le=0;const wt=new Uint8Array(m.buffer);for(let we=0;we<B;we++){const $e=we<D?xe:xa;pe[we]=wt.slice(ue,ue+$e),Je[we]=gt.encode(pe[we]),ue+=$e,Le=Math.max(Le,$e)}const se=new Uint8Array(b);let he=0,ne,re;for(ne=0;ne<Le;ne++)for(re=0;re<B;re++)ne<pe[re].length&&(se[he++]=pe[re][ne]);for(ne=0;ne<bt;ne++)for(re=0;re<B;re++)se[he++]=Je[re][ne];return se}function A(m,p,P,b){let M;if(Array.isArray(m))M=x.fromArray(m);else if(typeof m=="string"){let X=p;if(!X){const xe=x.rawSplit(m);X=h.getBestVersionForData(xe,P)}M=x.fromString(m,X||40)}else throw new Error("Invalid data");const N=h.getBestVersionForData(M,P);if(!N)throw new Error("The amount of data is too big to be stored in a QR Code");if(!p)p=N;else if(p<N)throw new Error(`
15The chosen QR Code version cannot contain this amount of data.
16Minimum version required to store current data is: `+N+`.
17`);const B=I(p,P,M),T=n.getSymbolSize(p),D=new a(T);return f(D,p),E(D),L(D,p),R(D,P,0),p>=7&&q(D,p),U(D,B),isNaN(b)&&(b=o.getBestMask(D,R.bind(null,D,P))),o.applyMask(b,D),R(D,P,b),{modules:D,version:p,errorCorrectionLevel:P,maskPattern:b,segments:M}}return Ut.create=function(p,P){if(typeof p>"u"||p==="")throw new Error("No input text");let b=s.M,M,N;return typeof P<"u"&&(b=s.from(P.errorCorrectionLevel,s.M),M=h.from(P.version),N=o.from(P.maskPattern),P.toSJISFunc&&n.setToSJISFunction(P.toSJISFunc)),A(p,M,b,N)},Ut}var la={},ca={},ls;function bs(){return ls||(ls=1,(function(n){function s(l){if(typeof l=="number"&&(l=l.toString()),typeof l!="string")throw new Error("Color should be defined as hex string");let a=l.slice().replace("#","").split("");if(a.length<3||a.length===5||a.length>8)throw new Error("Invalid hex color: "+l);(a.length===3||a.length===4)&&(a=Array.prototype.concat.apply([],a.map(function(r){return[r,r]}))),a.length===6&&a.push("F","F");const t=parseInt(a.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+a.slice(0,6).join("")}}n.getOptions=function(a){a||(a={}),a.color||(a.color={});const t=typeof a.margin>"u"||a.margin===null||a.margin<0?4:a.margin,r=a.width&&a.width>=21?a.width:void 0,o=a.scale||4;return{width:r,scale:r?4:o,margin:t,color:{dark:s(a.color.dark||"#000000ff"),light:s(a.color.light||"#ffffffff")},type:a.type,rendererOpts:a.rendererOpts||{}}},n.getScale=function(a,t){return t.width&&t.width>=a+t.margin*2?t.width/(a+t.margin*2):t.scale},n.getImageWidth=function(a,t){const r=n.getScale(a,t);return Math.floor((a+t.margin*2)*r)},n.qrToImageData=function(a,t,r){const o=t.modules.size,i=t.modules.data,d=n.getScale(o,r),h=Math.floor((o+r.margin*2)*d),w=r.margin*d,j=[r.color.light,r.color.dark];for(let x=0;x<h;x++)for(let f=0;f<h;f++){let E=(x*h+f)*4,L=r.color.light;if(x>=w&&f>=w&&x<h-w&&f<h-w){const q=Math.floor((x-w)/d),R=Math.floor((f-w)/d);L=j[i[q*o+R]?1:0]}a[E++]=L.r,a[E++]=L.g,a[E++]=L.b,a[E]=L.a}}})(ca)),ca}var cs;function Vn(){return cs||(cs=1,(function(n){const s=bs();function l(t,r,o){t.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=o,r.width=o,r.style.height=o+"px",r.style.width=o+"px"}function a(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}n.render=function(r,o,i){let d=i,h=o;typeof d>"u"&&(!o||!o.getContext)&&(d=o,o=void 0),o||(h=a()),d=s.getOptions(d);const w=s.getImageWidth(r.modules.size,d),j=h.getContext("2d"),x=j.createImageData(w,w);return s.qrToImageData(x.data,r,d),l(j,h,w),j.putImageData(x,0,0),h},n.renderToDataURL=function(r,o,i){let d=i;typeof d>"u"&&(!o||!o.getContext)&&(d=o,o=void 0),d||(d={});const h=n.render(r,o,d),w=d.type||"image/png",j=d.rendererOpts||{};return h.toDataURL(w,j.quality)}})(la)),la}var oa={},os;function zn(){if(os)return oa;os=1;const n=bs();function s(t,r){const o=t.a/255,i=r+'="'+t.hex+'"';return o<1?i+" "+r+'-opacity="'+o.toFixed(2).slice(1)+'"':i}function l(t,r,o){let i=t+r;return typeof o<"u"&&(i+=" "+o),i}function a(t,r,o){let i="",d=0,h=!1,w=0;for(let j=0;j<t.length;j++){const x=Math.floor(j%r),f=Math.floor(j/r);!x&&!h&&(h=!0),t[j]?(w++,j>0&&x>0&&t[j-1]||(i+=h?l("M",x+o,.5+f+o):l("m",d,0),d=0,h=!1),x+1<r&&t[j+1]||(i+=l("h",w),w=0)):d++}return i}return oa.render=function(r,o,i){const d=n.getOptions(o),h=r.modules.size,w=r.modules.data,j=h+d.margin*2,x=d.color.light.a?"<path "+s(d.color.light,"fill")+' d="M0 0h'+j+"v"+j+'H0z"/>':"",f="<path "+s(d.color.dark,"stroke")+' d="'+a(w,h,d.margin)+'"/>
17',E='viewBox="0 0 '+j+" "+j+'"',q='<svg xmlns="http://www.w3.org/2000/svg" '+(d.width?'width="'+d.width+'" height="'+d.width+'" ':"")+E+' shape-rendering="crispEdges">'+x+f+`</svg>
18`;return typeof i=="function"&&i(null,q),q},oa}var is;function On(){if(is)return Ke;is=1;const n=Cn(),s=qn(),l=Vn(),a=zn();function t(r,o,i,d,h){const w=[].slice.call(arguments,1),j=w.length,x=typeof w[j-1]=="function";if(!x&&!n())throw new Error("Callback required as last argument");if(x){if(j<2)throw new Error("Too few arguments provided");j===2?(h=i,i=o,o=d=void 0):j===3&&(o.getContext&&typeof h>"u"?(h=d,d=void 0):(h=d,d=i,i=o,o=void 0))}else{if(j<1)throw new Error("Too few arguments provided");return j===1?(i=o,o=d=void 0):j===2&&!o.getContext&&(d=i,i=o,o=void 0),new Promise(function(f,E){try{const L=s.create(i,d);f(r(L,o,d))}catch(L){E(L)}})}try{const f=s.create(i,d);h(null,r(f,o,d))}catch(f){h(f)}}return Ke.create=s.create,Ke.toCanvas=t.bind(null,l.render),Ke.toDataURL=t.bind(null,l.renderToDataURL),Ke.toString=t.bind(null,function(r,o,i){return a.render(r,i)}),Ke}var Hn=On();const Gn=Gs(Hn),da={gold:{name:"ทอง",bg:"linear-gradient(135deg, #1A1500 0%, #2D2200 30%, #1A1500 60%, #0D0A00 100%)",accent:"#F59E0B",border:"#F59E0B40",textPrimary:"#FDE68A",textSecondary:"#A16207",profitColor:"#22C55E",lossColor:"#EF4444"},dark:{name:"ดำ",bg:"linear-gradient(135deg, #0A0F1A 0%, #1A1F3A 50%, #0A0F1A 100%)",accent:"#06B6D4",border:"#06B6D440",textPrimary:"#E2E8F0",textSecondary:"#64748B",profitColor:"#22C55E",lossColor:"#EF4444"},blue:{name:"น้ำเงิน",bg:"linear-gradient(135deg, #001B3D 0%, #002B5C 50%, #001B3D 100%)",accent:"#3B82F6",border:"#3B82F640",textPrimary:"#BFDBFE",textSecondary:"#1D4ED8",profitColor:"#4ADE80",lossColor:"#F87171"}};function ws(n){const s=Math.floor(n/3600),l=Math.floor(n%3600/60),a=n%60;return s>0?`${s}:${String(l).padStart(2,"0")}:${String(a).padStart(2,"0")}`:`${String(l).padStart(2,"0")}:${String(a).padStart(2,"0")}`}function Kn({stats:n,theme:s,title:l,qrDataUrl:a}){const t=da[s];return e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:75",className:"rounded-2xl p-5 w-full",style:{background:t.bg,border:`1px solid ${t.border}`},children:[e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:80",className:"text-center mb-3",children:[e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:81",className:"text-4xl mb-2",children:n.isProfit?"🏆":"📊"}),e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:82",className:"text-lg font-bold",style:{color:t.textPrimary},children:l}),n.tableName&&n.tableName!=="เซสชัน"&&e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:86",className:"text-xs mt-0.5",style:{color:t.textSecondary},children:["ห้อง: ",n.tableName]})]}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:93",className:"text-center mb-3 py-2 rounded-xl",style:{background:`${n.isProfit?t.profitColor:t.lossColor}15`},children:[e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:94",className:"text-3xl font-black",style:{color:n.isProfit?t.profitColor:t.lossColor,textShadow:`0 0 15px ${n.isProfit?t.profitColor:t.lossColor}50`},children:[n.isProfit?"+":"",n.profitAmount.toLocaleString()," ฿"]}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:100",className:"text-xs mt-0.5",style:{color:n.isProfit?t.profitColor:t.lossColor,opacity:.8},children:["(",n.isProfit?"+":"",n.plPercent.toFixed(1),"%)"]})]}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:106",className:"grid grid-cols-3 gap-2 mb-3",children:[e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:107",className:"text-center p-2 rounded-lg",style:{background:"rgba(255,255,255,0.05)"},children:[e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:108",className:"text-[10px]",style:{color:t.textSecondary},children:"Win Rate"}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:109",className:"text-sm font-bold",style:{color:t.textPrimary},children:[n.winRate.toFixed(1),"%"]})]}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:111",className:"text-center p-2 rounded-lg",style:{background:"rgba(255,255,255,0.05)"},children:[e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:112",className:"text-[10px]",style:{color:t.textSecondary}
18,children:"จำนวนตา"}),e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:113",className:"text-sm font-bold",style:{color:t.textPrimary},children:n.totalRounds})]}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:115",className:"text-center p-2 rounded-lg",style:{background:"rgba(255,255,255,0.05)"},children:[e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:116",className:"text-[10px]",style:{color:t.textSecondary},children:"เวลาเล่น"}),e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:117",className:"text-sm font-bold",style:{color:t.textPrimary},children:ws(n.playTimeSeconds)})]})]}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:122",className:"flex items-center gap-2 mb-3",children:[e.jsxs("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:123",className:"text-[10px] font-medium",style:{color:t.profitColor},children:["W:",n.wins]}),e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:124",className:"flex-1 h-2 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.1)"},children:e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:125",className:"h-full rounded-full",style:{width:n.totalRounds>0?`${n.wins/n.totalRounds*100}%`:"0%",background:`linear-gradient(90deg, ${t.profitColor}, ${t.profitColor}80)`}})}),e.jsxs("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:133",className:"text-[10px] font-medium",style:{color:t.lossColor},children:["L:",n.losses]})]}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:137",className:"flex items-center justify-between pt-2 border-t",style:{borderColor:`${t.accent}30`},children:[e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:138",className:"flex items-center gap-1",children:[e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:139",className:"text-[10px]",style:{color:`${t.accent}90`},children:"Powered by"}),e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:140",className:"text-xs font-bold",style:{color:t.accent},children:"MAWIN SIAM"})]}),a&&e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:143",className:"flex items-center gap-1.5",children:[e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:144",className:"text-[8px]",style:{color:t.textSecondary},children:"สแกนเพื่อใช้งาน"}),e.jsx("img",{"data-loc":"client/src/components/ShareCardPanel.tsx:145",src:a,alt:"QR",className:"w-10 h-10 rounded"})]})]})]})}function js({stats:n,title:s="สรุปเซสชัน",onClose:l}){const[a,t]=u.useState("dark"),[r,o]=u.useState(!1),[i,d]=u.useState(""),h=u.useRef(null),w=H.share.uploadImage.useMutation();u.useEffect(()=>{const A=`${window.location.origin}?ref=share`;Gn.toDataURL(A,{width:80,margin:1,color:{dark:"#ffffff",light:"#00000000"}}).then(d).catch(()=>{})},[]);const j=async()=>{if(!h.current)return null;o(!0);try{const A=(await Ks(async()=>{const{default:p}=await import("./html2canvas.esm-B0tyYwQk.js");return{default:p}},[])).default,m=await A(h.current,{backgroundColor:null,scale:2,useCORS:!0,logging:!1});return new Promise(p=>{m.toBlob(P=>p(P),"image/png")})}catch{return F.error("ไม่สามารถสร้างรูปได้"),null}finally{o(!1)}},x=A=>new Promise((m,p)=>{const P=new FileReader;P.onloadend=()=>m(P.result),P.onerror=p,P.readAsDataURL(A)}),f=async()=>{const A=await j();if(!A)return null;try{o(!0);const m=await x(A),p=await w.mutateAsync({imageBase64:m});return`${window.location.origin}${p.imageUrl}`}catch(m){return console.error("Upload failed:",m),F.error("อัปโหลดรูปไม่สำเร็จ"),null}finally{o(!1)}},E=A=>{const m=[];return m.push(`🎰 MAWIN SIAM - ${s}`),n.tableName&&n.tableName!=="เซสชัน"&&m.push(`🎯 ห้อง: ${n.tableName}`),m.push(`💰 ผลลัพธ์: ${n.isProfit?"+":""}${n.profitAmount.toLocaleString()} บาท (${n.isProfit?"+":""}${n.plPercent.toFixed(1)}%)`),m.push(`🎯 จำนวนตา: ${n.totalRounds} (ชนะ ${n.wins} / แพ้ ${n.losses})`),m.push(`📈 Win Rate: ${n.winRate.toFixed(1)}%`),n.startingCapital&&n.endingCapital&&m.push(`💵 ทุนเริ่ม: ${n.startingCapital.toLocaleStr
18ing()} → ทุนสุดท้าย: ${n.endingCapital.toLocaleString()}`),n.playTimeSeconds>0&&m.push(`⏱️ เวลาเล่น: ${ws(n.playTimeSeconds)}`),m.push("🤖 วิเคราะห์โดย AI ที่ batrackai.pro"),A&&(m.push(""),m.push(`🖼️ ดูรูปสรุป: ${A}`)),m.join(`
19`)},L=`${n.isProfit?"🏆":"📊"} ${s} | ${n.isProfit?"+":""}${n.profitAmount.toLocaleString()} บาท | Win Rate ${n.winRate.toFixed(1)}% | MAWIN SIAM`,q=async()=>{const A=await j();if(!A)return;const m=new File([A],"mawin-siam-session.png",{type:"image/png"}),p=E();if(navigator.share)try{navigator.canShare&&navigator.canShare({files:[m]})?await navigator.share({title:`MAWIN SIAM - ${s}`,text:p,files:[m]}):(await navigator.share({title:`MAWIN SIAM - ${s}`,text:p,url:window.location.origin}),F.info("เบราว์เซอร์ไม่รองรับการส่งไฟล์ แชร์เป็นข้อความแทน"))}catch{}else{F.info("กำลังสร้างลิงก์รูป...");const P=await f();P&&(await navigator.clipboard.writeText(P),F.success("คัดลอกลิงก์รูปแล้ว!"))}},R=async()=>{F.info("กำลังสร้างรูป...");const A=await f();A&&(window.open(A,"_blank"),F.success("เปิดรูปในแท็บใหม่แล้ว กดค้างเพื่อบันทึกลง Photos"))},U=async()=>{if(await j()){F.info("กำลังสร้างรูป...");const m=await f();if(m){const p=m+(m.includes("?")?"&":"?")+"dl=1",P=document.createElement("a");P.href=p,P.download=`mawin-siam-${Date.now()}.png`,document.body.appendChild(P),P.click(),document.body.removeChild(P),F.success("กำลังดาวน์โหลด...")}}},I=async()=>{F.info("กำลังสร้างลิงก์...");const A=await f();A&&(await navigator.clipboard.writeText(A),F.success("คัดลอกลิงก์รูปแล้ว!"))},k=async A=>{if(A==="instagram"){F.info("กำลังสร้างรูป...");const P=await f();P&&(window.open(P,"_blank"),await navigator.clipboard.writeText(L),F.success("เปิดรูปแล้ว กดค้างบันทึก + คัดลอก caption แล้ว"),setTimeout(()=>window.open("https://www.instagram.com/","_blank"),1e3));return}F.info("กำลังสร้างรูปแชร์...");const m=await f(),p=E(m||void 0);switch(A){case"line":window.open(`https://social-plugins.line.me/lineit/share?url=${encodeURIComponent(m||window.location.origin)}&text=${encodeURIComponent(p)}`,"_blank","width=600,height=400");break;case"facebook":window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(m||window.location.origin)}&quote=${encodeURIComponent(p)}`,"_blank","width=600,height=400");break;case"telegram":window.open(`https://t.me/share/url?url=${encodeURIComponent(m||window.location.origin)}&text=${encodeURIComponent(p)}`,"_blank","width=600,height=400");break}};return e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:369",className:"space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:371",className:"flex items-center justify-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:372",className:"text-[10px] text-gray-400",children:"ธีม:"}),Object.keys(da).map(A=>e.jsx("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:374",onClick:()=>t(A),className:`px-3 py-1 rounded-full text-[10px] font-medium transition-all ${a===A?"bg-cyan-500/20 border-cyan-500/50 text-cyan-300 border":"bg-white/5 border-white/10 text-gray-400 border hover:bg-white/10"}`,children:da[A].name},A))]}),e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:389",ref:h,children:e.jsx(Kn,{"data-loc":"client/src/components/ShareCardPanel.tsx:390",stats:n,theme:a,title:s,qrDataUrl:i})}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:394",className:"grid grid-cols-2 gap-2",children:[e.jsxs("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:395",onClick:q,disabled:r,className:"flex items-center justify-center gap-2 py-2.5 rounded-xl bg-cyan-500/15 border border-cyan-500/30 text-cyan-400 hover:bg-cyan-500/25 transition-all active:scale-[0.97] disabled:opacity-50",children:[e.jsx("svg",{"data-loc":"client/src/components/ShareCardPanel.tsx:400",className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/ShareCardPanel.tsx:400",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})}),e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:401",className:"text-xs font-medium",children:"📤 Share Image"})]}),e.jsxs("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:403",onClick:R,disabled:r,className:"flex items-center justify-center gap-2 py-2.5 rounded-xl bg-green-500/15 border border-green-500/30 text-green-400 hover:bg-green-500/25 transition-all active:scale-[0.97] disabled:opacity-50",children:[e.jsx("svg",{"data-loc":"client/src/components/ShareCardPanel.tsx:408",className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/ShareCardPanel.tsx:408",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})}),e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:409",className:"text-xs font-medium",children:"💾 Save Image"})]}),e.jsxs("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:411",onClick:U,disabled:r,className:"flex items-center justify-center gap-2 py-2.5 rounded-xl bg-purple-500/15 border border-purple-500/30 text-purple-400 hover:bg-purple-500/25 transition-all active:scale-[0.97] disabled:opacity-50",children:[e.jsx("svg",{"data-loc":"client/src/components/ShareCardPanel.tsx:416",className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/ShareCardPanel.tsx:416",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:417",className:"text-xs font-medium",children:"📥 Download PNG"})]}),e.jsxs("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:419",onClick:I,disabled:r,className:"flex items-center justify-center gap-2 py-2.5 rounded-xl bg-amber-500/15 border border-amber-500/30 text-amber-400 hover:bg-amber-500/25 transition-all active:scale-[0.97] disabled:opacity-50",children:[e.jsx("svg",{"data-loc":"client/src/components/ShareCardPanel.tsx:424",className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/ShareCardPanel.tsx:424",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:425",className:"text-xs font-medium",children:"🔗 Copy Link"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:430",className:"grid grid-cols-2 gap-2",children:[e.jsxs("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:431",onClick:()=>k("line"),disabled:r,className:"flex items-center justify-center gap-2 py-2.5 rounded-xl bg-[#06C755]/15 border border-[#06C755]/30 text-[#06C755] hover:bg-[#06C755]/25 transition-all active:scale-[0.97] disabled:opacity-50",children:[e.jsx("svg",{"data-loc":"client/src/components/ShareCardPanel.tsx:436",className:"w-4 h-4",fill:"
19currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/ShareCardPanel.tsx:436",d:"M19.365 9.863c.349 0 .63.285.63.631 0 .345-.281.63-.63.63H17.61v1.125h1.755c.349 0 .63.283.63.63 0 .344-.281.629-.63.629h-2.386c-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63h2.386c.346 0 .627.285.627.63 0 .349-.281.63-.63.63H17.61v1.125h1.755zm-3.855 3.016c0 .27-.174.51-.432.596-.064.021-.133.031-.199.031-.211 0-.391-.09-.51-.25l-2.443-3.317v2.94c0 .344-.279.629-.631.629-.346 0-.626-.285-.626-.629V8.108c0-.27.173-.51.43-.595.06-.023.136-.033.194-.033.195 0 .375.104.495.254l2.462 3.33V8.108c0-.345.282-.63.63-.63.345 0 .63.285.63.63v4.771zm-5.741 0c0 .344-.282.629-.631.629-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63.346 0 .628.285.628.63v4.771zm-2.466.629H4.917c-.345 0-.63-.285-.63-.629V8.108c0-.345.285-.63.63-.63.348 0 .63.285.63.63v4.141h1.756c.348 0 .629.283.629.63 0 .344-.282.629-.629.629M24 10.314C24 4.943 18.615.572 12 .572S0 4.943 0 10.314c0 4.811 4.27 8.842 10.035 9.608.391.082.923.258 1.058.59.12.301.079.766.038 1.08l-.164 1.02c-.045.301-.24 1.186 1.049.645 1.291-.539 6.916-4.078 9.436-6.975C23.176 14.393 24 12.458 24 10.314"})}),e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:437",className:"text-xs font-medium",children:"LINE"})]}),e.jsxs("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:439",onClick:()=>k("facebook"),disabled:r,className:"flex items-center justify-center gap-2 py-2.5 rounded-xl bg-[#1877F2]/15 border border-[#1877F2]/30 text-[#1877F2] hover:bg-[#1877F2]/25 transition-all active:scale-[0.97] disabled:opacity-50",children:[e.jsx("svg",{"data-loc":"client/src/components/ShareCardPanel.tsx:444",className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/ShareCardPanel.tsx:444",d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:445",className:"text-xs font-medium",children:"Facebook"})]}),e.jsxs("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:447",onClick:()=>k("telegram"),disabled:r,className:"flex items-center justify-center gap-2 py-2.5 rounded-xl bg-[#26A5E4]/15 border border-[#26A5E4]/30 text-[#26A5E4] hover:bg-[#26A5E4]/25 transition-all active:scale-[0.97] disabled:opacity-50",children:[e.jsx("svg",{"data-loc":"client/src/components/ShareCardPanel.tsx:452",className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/ShareCardPanel.tsx:452",d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:453",className:"text-xs font-medium",children:"Telegram"})]}),e.jsxs("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:455",onClick:()=>k("instagram"),disabled:r,className:"flex items-center justify-center gap-2 py-2.5 rounded-xl bg-[#E4405F]/15 border border-[#E4405F]/30 text-[#E4405F] hover:bg-[#E4405F]/25 transition-all active:scale-[0.97] disabled:opacity-50",children:[e.jsx("svg",{"data-loc":"client/src/components/ShareCardPanel.tsx:460",className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/ShareCardPanel.tsx:460",d:"M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 
1912 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 1 0 0-12.324zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405a1.441 1.441 0 1 1-2.882 0 1.441 1.441 0 0 1 2.882 0z"})}),e.jsx("span",{"data-loc":"client/src/components/ShareCardPanel.tsx:461",className:"text-xs font-medium",children:"Instagram"})]})]}),r&&e.jsx("div",{"data-loc":"client/src/components/ShareCardPanel.tsx:467",className:"text-center text-xs text-cyan-400 animate-pulse",children:"กำลังสร้างรูปและอัปโหลด..."}),l&&e.jsx("button",{"data-loc":"client/src/components/ShareCardPanel.tsx:474",onClick:l,className:"w-full py-2 rounded-xl border border-gray-600 text-gray-300 text-sm hover:bg-gray-800 transition-all active:scale-[0.97]",children:"กลับ"})]})}class Qn{constructor(){this.audioContext=null}getContext(){return fs()?(this.audioContext||(this.audioContext=new AudioContext),this.audioContext.state==="suspended"&&this.audioContext.resume(),this.audioContext):null}playWinSound(){const s=this.getContext();if(!s)return;const l=s.createOscillator(),a=s.createGain();l.connect(a),a.connect(s.destination),l.type="sine",l.frequency.setValueAtTime(523,s.currentTime),l.frequency.setValueAtTime(659,s.currentTime+.08),l.frequency.setValueAtTime(784,s.currentTime+.16),l.frequency.setValueAtTime(1047,s.currentTime+.24),a.gain.setValueAtTime(.15,s.currentTime),a.gain.exponentialRampToValueAtTime(.01,s.currentTime+.5),l.start(s.currentTime),l.stop(s.currentTime+.5)}playStreakSound(s){const l=this.getContext();if(l)for(let a=0;a<Math.min(s,4);a++){const t=l.createOscillator(),r=l.createGain();t.connect(r),r.connect(l.destination),t.type=a%2===0?"sine":"triangle";const o=440*Math.pow(2,a*4/12);t.frequency.setValueAtTime(o,l.currentTime+a*.1),t.frequency.setValueAtTime(o*1.5,l.currentTime+a*.1+.1),r.gain.setValueAtTime(.12,l.currentTime+a*.1),r.gain.exponentialRampToValueAtTime(.01,l.currentTime+a*.1+.4),t.start(l.currentTime+a*.1),t.stop(l.currentTime+a*.1+.4)}}playTargetSound(){const s=this.getContext();if(!s)return;[523,659,784,1047,784,1047,1319].forEach((a,t)=>{const r=s.createOscillator(),o=s.createGain();r.connect(o),o.connect(s.destination),r.type="sine",r.frequency.setValueAtTime(a,s.currentTime+t*.12),o.gain.setValueAtTime(.15,s.currentTime+t*.12),o.gain.exponentialRampToValueAtTime(.01,s.currentTime+t*.12+.3),r.start(s.currentTime+t*.12),r.stop(s.currentTime+t*.12+.3)})}playAISignalSound(){const s=this.getContext();if(!s)return;const l=s.createOscillator(),a=s.createGain();l.connect(a),a.connect(s.destination),l.type="sawtooth",l.frequency.setValueAtTime(200,s.currentTime),l.frequency.exponentialRampToValueAtTime(800,s.currentTime+.3),l.frequency.exponentialRampToValueAtTime(400,s.currentTime+.5),a.gain.setValueAtTime(.06,s.currentTime),a.gain.exponentialRampToValueAtTime(.01,s.currentTime+.5),l.start(s.currentTime),l.stop(s.currentTime+.5)}playResetSound(){const s=this.getContext();if(!s)return;const l=s.createOscillator(),a=s.createGain();l.connect(a),a.connect(s.destination),l.type="square",l.frequency.setValueAtTime(600,s.currentTime),l.frequency.exponentialRampToValueAtTime(200,s.currentTime+.3),a.gain.setValueAtTime(.08,s.currentTime),a.gain.exponentialRampToValueAtTime(.01,s.currentTime+.4),l.start(s.currentTime),l.stop(s.currentTime+.4)}playLoseSound(){const s=this.getContext();if(!s)return;const l=s.createOscillator(),a=s.createGain();l.connect(a),a.connect(s.destination),l.type="sine",l.frequency.setValueAtTime(400,s.currentTime),l.frequency.setValueAtTime(350,s.currentTime+.15),a.gain.setValueAtTime(.08,s.currentTime),a.gain.exponentialRampToValueAtTime(.01,s.currentTime+.3),l.start(s.currentTime),l.stop(s.currentTime+.3)}}const Qe=new Qn;function it(n){"vibrate"in navigator&&navigator.vibrate(n)}function Jn({count:n=20,duration:s=2e3}){const[l,a]=u.useState([]);return u.useEffect(()=>{const t=Array.from({length:n},(o,i)=>({id:i,x:50+(Math.random()-.5)*60,y:50+(Math.random()-.5)*40,vx:(Math.random()-.5)*3,vy:-Math.random()*3-1,size:Math.random()*8+4,color:["#FFD700","#FFA500","#FFEC8B","#F59E0B","#EAB308"][Math.floor(Math.random()*5)],opacity:1,life:Math.random()*.5+.5,type:["circle","star","coin"][Math.floor(Math.random()*3)]}));a(t);const r=setTimeout(()=>a([]),s);return()=>clearTimeout(r)},[n,s]),e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:201",className:"absolute inset-0 pointer-events-none overflow-hidden z-50",children:l.map(t=>e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:203",className:"absolute animate-particle-float",style:{left:`${t.x}%`,top:`${t.y}%`,width:t.size,height:t.size,backgroundColor:t.color,borderRadius:t.type==="star"?"2px":"50%",opacity:t.opacity,transform:t.type==="star"?"rotate(45deg)":void 0,boxShadow:`0 0 ${t.size}px ${t.color}`,animationDuration:`${t.life+1}s`,animationDelay:`${Math.random()*.3}s`}},t.id))})}function Ns({duration:n=4e3}){const[s,l]=u.useState([]);return u.useEffect(()=>{const a=Array.from({length:60},(r,o)=>({id:o,x:Math.random()*100,delay:Math.random()*1.5,color:["#FFD700","#FF6B35","#22C55E","#3B82F6","#EF4444","#A855F7"][Math.floor(Math.random()*6)],size:Math.random()*10+5,rotation:Math.random()*360}));l(a);const t=setTimeout(()=>l([]),n);return()=>clearTimeout(t)},[n]),e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:245",className:"fixed inset-0 pointer-events-none z-[100] overflow-hidden",children:s.map(a=>e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:247",className:"absolute animate-confetti-fall",style:{left:`${a.x}%`,top:"-5%",width:a.size,height:a.size*.6,backgroundColor:a.color,borderRadius:"2px",transform:`rotate(${a.rotation}deg)`,animationDelay:`${a.delay}s`,animationDuration:`${2+Math.random()*2}s`}},a.id))})}function Yn({message:n,subMessage:s,icon:l,onClose:a,color:t="#FFD700"}){return u.useEffect(()=>{const r=setTimeout(a,3e3);return()=>clearTimeout(r)},[a]),e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:281",className:"fixed inset-0 z-[90] flex items-center justify-center pointer-events-none",onClick:a,children:e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:285",className:"animate-win-popup text-center pointer-events-auto",children:[e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:286",className:"text-5xl mb-2 animate-bounce-slow",style:{filter:`drop-shadow(0 0 20px ${t})`},children:l}),e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:292",className:"text-xl font-bold px-6 py-2 rounded-full animate-glow-pulse",style:{color:t,textShadow:`0 0 20px ${t}, 0 0 40px ${t}40`,background:`linear-gradient(135deg, ${t}15, ${t}05)`,border:`1px solid ${t}40`},children:n}),s&&e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:304",className:"text-sm text-gray-300 mt-2 opacity-80",children:s})]})})}function Xn({profitAmount:n,shareStats:s,onClose:l}){const a=["🎉 ถึงเป้าหมายแล้ว!","💰 กำไรตามแผนสำเร็จ","🏆 ภารกิจสำเร็จ","⭐ แนะนำให้พักรับกำไร"],[t,r]=u.useState(0),[o,i]=u.useState(!1);u.useEffect(()=>{const h=setInterval(()=>{r(w=>(w+1)%a.length)},2e3);return()=>clearInterval(h)},[]);const d=s?{profitAmount:n??0,isProfit:s.isProfit,plPercent:s.plPercent,winRate:s.winRate,totalRounds:s.totalRounds,wins:s.wins,losses:s.losses,playTimeSeconds:s.playTimeSeconds,tableName:s.tableName,startingCapital:s.startingCapital,endingCapital:s.endingCapital}:{profitAmount:n??0,isProfit:(n??0)>=0,plPercent:0,winRate:0,totalRounds:0,wins:0,losses:0,playTimeSeconds:0};return Qs.createPortal(e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:353",className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/80 backdrop-blur-sm overflow-y-auto py-8",children:[e.jsx(Ns,{"data-loc":"client/src/components/WinEffects.tsx:354",duration:5e3}),e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:355",className:"text-center animate-win-popup relative z-10 w-full max-w-sm mx-4",children:[e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:357",className:"text-lg font-bold text-amber-400 mb-3 animate-glow-pulse",children:a[t]}),o?e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:384",className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:[e.jsx(js,{"data-loc":"client/src/components/WinEffects.tsx:385",stats:d,title:"ถึงเป้าหมายแล้ว!"}),e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:386",className:"flex gap-2 mt-3",children:[e.jsx("button",{"data-loc":"client/src/components/WinEffects.tsx:387",onClick:()=>i(!1),className:"flex-1 py-2.5 rounded-xl border border-gray-600 text-gray-300 text-sm hover:bg-gray-800 transition-all active:scale-[0.97]",children:"กลับ"}),e.jsx("button",{"data-loc":"client/src/components/WinEffects.tsx:393",onClick:l,className:"flex-1 py-2.5 rounded-xl bg-gradient-to-r from-amber-500 to-orange-500 text-white text-sm font-bold shadow-lg shadow-amber-500/20 transition-all active:scale-95",children:"เริ่มเซสชั่นใหม่"})]})]}):e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:363",className:"flex flex-col gap-3",children:[e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:365",className:"text-3xl font-black text-green-400 my-2",style:{textShadow:"0 0 20px #22C55E"}
19,children:["+",(n??0).toLocaleString()," บาท"]}),e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:368",className:"text-sm text-gray-400 mb-2",children:"ทำตามแผนอย่างมีวินัย"}),e.jsxs("button",{"data-loc":"client/src/components/WinEffects.tsx:369",onClick:()=>i(!0),className:"px-6 py-3 bg-gradient-to-r from-cyan-500 to-blue-600 text-white font-bold rounded-full text-base shadow-lg shadow-cyan-500/30 hover:shadow-cyan-500/50 transition-all active:scale-95 flex items-center justify-center gap-2",children:[e.jsx("svg",{"data-loc":"client/src/components/WinEffects.tsx:373",className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/WinEffects.tsx:373",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),"แชร์ผลสำเร็จ"]}),e.jsx("button",{"data-loc":"client/src/components/WinEffects.tsx:376",onClick:l,className:"px-8 py-3 bg-gradient-to-r from-amber-500 to-orange-500 text-white font-bold rounded-full text-base shadow-lg shadow-amber-500/30 hover:shadow-amber-500/50 transition-all active:scale-95",children:"เริ่มเซสชั่นใหม่"})]})]})]}),document.body)}function Zn({onComplete:n}){const[s,l]=u.useState(0),a=[{icon:"🤖",text:"AI กำลังวิเคราะห์…"},{icon:"📊",text:"ประมวลผลสถิติ…"},{icon:"🔍",text:"ค้นหารูปแบบล่าสุด…"},{icon:"✨",text:"พบสัญญาณใหม่"}];return u.useEffect(()=>{const t=[];return a.forEach((r,o)=>{o>0&&t.push(setTimeout(()=>l(o),o*600))}),t.push(setTimeout(n,a.length*600+400)),()=>t.forEach(clearTimeout)},[]),e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:430",className:"absolute inset-0 z-40 flex items-center justify-center bg-black/60 backdrop-blur-sm rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:432",className:"absolute inset-0 animate-radar-sweep opacity-20",children:e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:433",className:"absolute inset-0 bg-gradient-conic from-blue-500/50 via-transparent to-transparent rounded-full"})}),e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:436",className:"text-center relative z-10",children:[e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:437",className:"text-3xl mb-2 animate-pulse",children:a[s].icon}),e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:438",className:"text-sm font-medium text-blue-300 animate-glow-pulse",children:a[s].text}),e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:442",className:"flex justify-center gap-1.5 mt-3",children:a.map((t,r)=>e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:444",className:`w-2 h-2 rounded-full transition-all duration-300 ${r<=s?"bg-blue-400 shadow-[0_0_6px_#3B82F6]":"bg-gray-600"}`},r))})]})]})}function er({onComplete:n}){return u.useEffect(()=>{const s=setTimeout(n,2e3);return()=>clearTimeout(s)},[]),e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:465",className:"absolute inset-0 z-40 flex items-center justify-center bg-black/50 backdrop-blur-sm rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:467",className:"absolute inset-0 animate-warning-pulse bg-orange-500/10"}),e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:468",className:"text-center relative z-10",children:[e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:469",className:"text-3xl mb-2 animate-spin-slow",children:"🔄"}),e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:470",className:"text-sm font-medium text-orange-300",children:"คำนวณสูตรใหม่"}),e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:471",className:"text-xs text-gray-400 mt-1",children:"กำลังวิเคราะห์รูปแบบล่าสุด"})]})]})}function tr({count:n}){const s=vs(n);return s?e.jsxs("div",{"data-loc":"client/src/components/WinEffects.tsx:483",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-bold animate-streak-appear",style:{background:`linear-gradient(135deg, ${s.color}20, ${s.color}05)`,border:`1px solid ${s.color}60`,color:s.color,boxShadow:`0 0 15px ${s.color}30, inset 0 0 15px ${s.color}10`},children:[e.jsx("span",{"data-loc":"client/src/components/WinEffects.tsx:492",className:"animate-bounce-slow",children:s.icon}),e.jsx("span",{"data-loc":"client/src/components/WinEffects.tsx:493",children:s.text})]}):null}function vs(n){return n>=5?{icon:"👑",text:"สตรีคระดับตำนาน",color:"#A855F7"}:n===4?{icon:"🚀",text:"ติดลมบน",color:"#3B82F6"}:n===3?{icon:"⚡",text:"ฟอร์มกำลังมา",color:"#F59E0B"}:n===2?{icon:"🔥",text:"กำลังร้อนแรง",color:"#EF4444"}:null}const ar=["สูตรเข้าแล้ว!","วิเคราะห์แม่นยำ","เก็บกำไรต่อเนื่อง","ไม้นี้ชนะ","สถิติเข้าทาง"],sr=["วิเคราะห์ต่อเนื่อง","บริหารทุนได้ดี","ทำตามแผนอย่างมีวินัย","กำลังอยู่ในเป้าหมาย","เดินเกมอย่างมีระบบ"];function ds(n){return n[Math.floor(Math.random()*n.length)]}function nr(){const[n,s]=u.useState(null),[l,a]=u.useState(!1),[t,r]=u.useState(!1),[o,i]=u.useState(!1),[d,h]=u.useState(!1),[w,j]=u.useState(!1),[x,f]=u.useState(!1),[E,L]=u.useState(""),[q,R]=u.useState(0),[U,I]=u.useState(0),[k,A]=u.useState(void 0),m=u.useCallback(b=>{switch(s(b),b.type){case"win":Qe.playWinSound(),it(50),L(ds(ar)),i(!0),a(!0),setTimeout(()=>{i(!1),a(!1)},2500);break;case"streak":const M=b.streakCount??2;R(M),Qe.playStreakSound(M),it([50,30,50,30,100]),a(!0),i(!0);const N=vs(M);L(N?.text??""),setTimeout(()=>{i(!1),a(!1)},3e3);break;case"target":Qe.playTargetSound(),it([100,50,100,50,200]),I(b.profitAmount??0),A(b.shareStats),h(!0),r(!0);break;case"ai_signal":Qe.playAISignalSound(),j(!0);break;case"reset":Qe.playResetSound(),it(100),f(!0);break;case"lose":Qe.playLoseSound(),it(30);break}},[]),p=u.useCallback(()=>{h(!1),r(!1)},[]),P=u.useCallback(()=>e.jsxs(e.Fragment,{children:[l&&e.jsx(Jn,{"data-loc":"client/src/components/WinEffects.tsx:606",count:25,duration:2500}),t&&e.jsx(Ns,{"data-loc":"client/src/components/WinEffects.tsx:607",duration:5e3}),o&&e.jsx(Yn,{"data-loc":"client/src/components/WinEffects.tsx:609",message:E,subMessage:q>=2?ds(sr):void 0,icon:q>=5?"👑":q>=4?"🚀":q>=3?"⚡":q>=2?"🔥":"✨",color:q>=5?"#A855F7":q>=4?"#3B82F6":q>=3?"#F59E0B":"#FFD700",onClose:()=>i(!1)}),d&&e.jsx(Xn,{"data-loc":"client/src/components/WinEffects.tsx:618",profitAmount:U,shareStats:k,onClose:p}),w&&e.jsx(Zn,{"data-loc":"client/src/components/WinEffects.tsx:625",onComplete:()=>j(!1)}),x&&e.jsx(er,{"data-loc":"client/src/components/WinEffects.tsx:628",onComplete:()=>f(!1)})]}),[l,t,o,d,w,x,E,q,U,k,p]);return{triggerWinEffect:m,EffectsRenderer:P,StreakBadge:q>=2?e.jsx(tr,{"data-loc":"client/src/components/WinEffects.tsx:636",count:q}
19):null,closeTargetCelebration:p,isShowingEffect:o||d||w||x}}function rr({children:n,active:s=!1,color:l="#FFD700",className:a=""}){return e.jsx("div",{"data-loc":"client/src/components/WinEffects.tsx:650",className:`relative rounded-xl transition-all duration-300 ${a} ${s?"animate-glow-border":""}`,style:s?{boxShadow:`0 0 15px ${l}30, 0 0 30px ${l}15, inset 0 0 15px ${l}05`,borderColor:`${l}40`}:void 0,children:n})}const lr=35,gs=120,xs=["0, 200, 255","100, 150, 255","0, 255, 200","150, 100, 255","0, 220, 180"];function cr(){const n=u.useRef(null),s=u.useRef(0),l=u.useRef([]);return u.useEffect(()=>{const a=n.current;if(!a)return;const t=a.getContext("2d");if(!t)return;let r=0,o=0;function i(){a&&(r=a.offsetWidth,o=a.offsetHeight,a.width=r*window.devicePixelRatio,a.height=o*window.devicePixelRatio,t.scale(window.devicePixelRatio,window.devicePixelRatio))}function d(){l.current=Array.from({length:lr},()=>({x:Math.random()*r,y:Math.random()*o,vx:(Math.random()-.5)*.4,vy:(Math.random()-.5)*.4,size:Math.random()*2+1,opacity:Math.random()*.5+.2,color:xs[Math.floor(Math.random()*xs.length)],pulse:Math.random()*Math.PI*2,pulseSpeed:Math.random()*.02+.01}))}function h(){if(!t)return;t.clearRect(0,0,r,o);const j=l.current;for(const x of j)x.x+=x.vx,x.y+=x.vy,x.pulse+=x.pulseSpeed,x.x<0&&(x.x=r),x.x>r&&(x.x=0),x.y<0&&(x.y=o),x.y>o&&(x.y=0);for(let x=0;x<j.length;x++)for(let f=x+1;f<j.length;f++){const E=j[x].x-j[f].x,L=j[x].y-j[f].y,q=Math.sqrt(E*E+L*L);if(q<gs){const R=(1-q/gs)*.15;t.beginPath(),t.moveTo(j[x].x,j[x].y),t.lineTo(j[f].x,j[f].y),t.strokeStyle=`rgba(0, 200, 255, ${R})`,t.lineWidth=.5,t.stroke()}}for(const x of j){const f=x.opacity+Math.sin(x.pulse)*.15,E=x.size+Math.sin(x.pulse)*.5;t.beginPath(),t.arc(x.x,x.y,E*3,0,Math.PI*2),t.fillStyle=`rgba(${x.color}, ${f*.1})`,t.fill(),t.beginPath(),t.arc(x.x,x.y,E,0,Math.PI*2),t.fillStyle=`rgba(${x.color}, ${f})`,t.fill()}s.current=requestAnimationFrame(h)}i(),d(),h();const w=new ResizeObserver(i);return w.observe(a),()=>{cancelAnimationFrame(s.current),w.disconnect()}},[]),e.jsx("canvas",{"data-loc":"client/src/components/AIParticleBackground.tsx:143",ref:n,className:"absolute inset-0 w-full h-full pointer-events-none",style:{opacity:.6}})}function us(n,s,l=Date.now()){const a=Math.max(0,Math.floor(n));if(s===null||!Number.isFinite(s)||!Number.isFinite(l))return a;const t=Math.max(0,Math.floor((l-s)/1e3));return a+t}function ps(n){const s=Math.max(0,Math.floor(n)),l=Math.floor(s/3600),a=Math.floor(s%3600/60),t=s%60;return[l,a,t].map(r=>String(r).padStart(2,"0")).join(":")}const Ie=6,ia=12,or=4,ir=[10,20,30,30],dt=3;function Vr(){const[n,s]=u.useState(null),[l,a]=u.useState(""),[t,r]=u.useState(!1),[o,i]=u.useState(!1),[d,h]=u.useState(!1),[w,j]=u.useState(!1),x=u.useRef(null),[f,E]=u.useState("10000"),[L,q]=u.useState(100),[R,U]=u.useState("50"),[I,k]=u.useState("10"),[A,m]=u.useState(""),[p,P]=u.useState(null),[b,M]=u.useState(null),[N,B]=u.useState(null),[T,D]=u.useState(!1),[X,xe]=u.useState(0),[xa,bt]=u.useState(0),[gt,ue]=u.useState(null),[pe,Je]=u.useState(0),[Le,wt]=u.useState(()=>fs()),[se,he]=u.useState(null),[ne,re]=u.useState(null),[we,$e]=u.useState(!1),[Cs,Ye]=u.useState(!1),[Ss,jt]=u.useState(!1),[ks,xt]=u.useState(!1),[ua,pa]=u.useState(!1),[Nt,Es]=u.useState(!0),[De,ut]=u.useState(0),We=u.useRef(0),ke=u.useRef(null),pt=u.useRef(!1),[,Ue]=Js(),{triggerWinEffect:je,EffectsRenderer:As,StreakBadge:ma}=nr(),Z=H.useUtils(),{data:Ee}=H.credits.balance.useQuery(void 0,{refetchInterval:1e4}),{data:ye}=H.sessions.list.useQuery(),{data:le}=H.formulas.list.useQuery(),{data:vt}=H.leaderboard.formulaPerformance.useQuery(),{data:ce}=H.predictions.history.useQuery({limit:20,offset:0},{refetchInterval:5e3}),{data:Ct}=H.sessions.get.useQuery({id:n},{enabled:!!n}),{data:St}=H.bankroll.getByGameSession.useQuery({gameSessionId:n},{enabled:!!n&&!p});u.useEffect(()=>{P(null),M(null),Je(0)},[n]),u.useEffect(()=>{St&&!p&&P(St.id)},[St]),u.useEffect(()=>{if(!n){We.current=0,ke.current=null,pt.current=!1,ut(0);return}We.current=0,ke.current=document.visibilityState==="visible"?Date.now():null,pt.current=!1,ut(0);const c=()=>{const v=us(We.current,ke.current);ut(v),v>=3600&&!pt.current&&(pt.current=!0,F.warning("คุณเล่นมาแล้ว 1 ชั่วโมง พักผ่อนบ้างนะครับ",{duration:8e3}),"vibrate"in navigator&&navigator.vibrate([200,100,200]))},y=()=>
19{if(document.visibilityState==="visible"){ke.current??=Date.now(),c();return}We.current=us(We.current,ke.current),ke.current=null,ut(We.current)};c();const g=window.setInterval(c,1e3);return document.addEventListener("visibilitychange",y),()=>{window.clearInterval(g),document.removeEventListener("visibilitychange",y),ke.current=null}},[n]);const{data:C}=H.bankroll.get.useQuery({id:p},{enabled:!!p,refetchInterval:3e3}),{data:Pe}=H.bankroll.getRounds.useQuery({sessionId:p},{enabled:!!p,refetchInterval:3e3}),fa=H.sessions.create.useMutation({onSuccess:c=>{s(c.id),r(!1),a(""),Z.sessions.list.invalidate(),F.success("สร้างเซสชันใหม่แล้ว")}}),qe=H.rounds.add.useMutation({onSuccess:()=>{Z.sessions.get.invalidate({id:n}),Z.sessions.list.invalidate()}}),Ts=H.rounds.undo.useMutation({onSuccess:()=>{Z.sessions.get.invalidate({id:n}),Z.sessions.list.invalidate(),Je(c=>c+1),F.success(`ลบตัวล่าสุดแล้ว (เหลือ ${dt-pe-1} ครั้ง)`)}}),Rs=H.formulas.use.useMutation({onSuccess:(c,y)=>{B(y.id),D(!1),Z.formulas.list.invalidate(),Z.credits.balance.invalidate();const g=le?.find(v=>v.id===y.id);F.success(`เริ่มใช้สูตร: ${g?.name||"สูตร"}`)},onError:c=>{c.message.includes("Point ไม่เพียงพอ")?F.error("Point ไม่เพียงพอ",{description:"ต้องมีอย่างน้อย 5 Points เพื่อใช้งานสูตร",action:{label:"เติม Point",onClick:()=>Ue("/credits")}}):F.error(c.message)}}),kt=H.bankroll.create.useMutation(),Ms=H.bankroll.recordResult.useMutation(),Bs=H.bankroll.continueSession.useMutation(),Is=H.bankroll.resetFormula.useMutation(),_s=H.bankroll.endSession.useMutation(),[Et,At]=u.useState(null),[be,Xe]=u.useState("none"),[ha,Tt]=u.useState(!1),[G,Rt]=u.useState(0),[oe,Ze]=u.useState(!1),[Fs,Ve]=u.useState(!1),[Mt,ze]=u.useState(!1),Ls=H.predictions.create.useMutation({onError:c=>{c.message.includes("Point ไม่เพียงพอ")&&(Ze(!0),F.error("Point ไม่เพียงพอ",{description:"ต้องมีอย่างน้อย 5 Points เพื่อใช้งานสูตรต่อ",action:{label:"เติม Point",onClick:()=>Ue("/credits")}}))}}),$s=H.predictions.settle.useMutation({onSuccess:()=>{Z.credits.balance.invalidate()}}),V=Ct?.rounds??[],{gridData:Ds,gridCols:Bt}=u.useMemo(()=>{const y=Math.max(ia,Math.ceil(V.length/Ie)),g=Array.from({length:Ie},()=>Array(y).fill(null));return V.forEach((v,S)=>{const W=Math.floor(S/Ie),z=S%Ie;W<y&&(g[z][W]=v.result)}),{gridData:g,gridCols:y}},[V]),Ae=u.useMemo(()=>{const c=V.length;if(c===0)return null;const y=V.filter(W=>W.result==="player").length,g=V.filter(W=>W.result==="banker").length,v=V.filter(W=>W.result==="tie").length;let S="";if(c>0){const W=V[c-1].result;let z=0;for(let de=c-1;de>=0&&V[de].result===W;de--)z++;S=`${W==="player"?"P":W==="banker"?"B":"T"}×${z}`}return{playerPct:Math.round(y/c*100),bankerPct:Math.round(g/c*100),tiePct:Math.round(v/c*100),total:c,streak:S}},[V]),Te=u.useMemo(()=>{if(!ce||ce.length===0)return null;const c=ce.filter(W=>W.status!=="pending"&&W.status!=="skipped");if(c.length===0)return null;const y=c.filter(W=>W.isCorrect===1).length,g=c.length,v=Math.round(y/g*100),S=c.slice(0,5).map(W=>W.isCorrect===1);return{correct:y,total:g,pct:v,recent5:S}},[ce]),Ne=u.useMemo(()=>{if(!ce||ce.length<3)return null;const c=ce.filter(S=>S.status!=="pending"&&S.status!=="skipped");if(c.length<3)return null;const y=c.slice(0,5),v=y.filter(S=>S.isCorrect===1).length/y.length;return v>=.8?{status:"hot",label:"ร้อนแรง!",color:"text-orange-400",bg:"bg-orange-500/10 border-orange-500/30"}:v>=.6?{status:"warm",label:"อุ่น",color:"text-yellow-400",bg:"bg-yellow-500/10 border-yellow-500/30"}:v<=.2?{status:"cold",label:"เย็นจัด",color:"text-blue-400",bg:"bg-blue-500/10 border-blue-500/30"}:v<=.4?{status:"cool",label:"เย็นลง",color:"text-cyan-400",bg:"bg-cyan-500/10 border-cyan-500/30"}:{status:"neutral",label:"ปกติ",color:"text-gray-400",bg:"bg-gray-500/10 border-gray-500/30"}},[ce]),Re=u.useMemo(()=>
19{if(!ce||ce.length<3)return null;const c=ce.filter(S=>S.status!=="pending"&&S.status!=="skipped");let y=0;for(const S of c)if(S.isCorrect===0)y++;else break;let g=!1,v=0;if(C){const S=parseFloat(C.startingBankroll),W=parseFloat(C.currentBankroll);v=S>0?(W-S)/S*100:0,g=v<-30}if(y>=3||g){const S=[];return y>=3&&S.push(`แพ้ติด ${y} ตา`),g&&S.push(`ทุนลด ${Math.abs(Math.round(v))}%`),{show:!0,reasons:S,severity:y>=5||v<-50?"critical":"warning"}}return null},[ce,C]);u.useEffect(()=>{x.current&&V.length>Ie*ia&&(x.current.scrollLeft=x.current.scrollWidth)},[V.length]);const $=u.useMemo(()=>{const c=V.length,y=or,g=Math.min(c,y),v=c>=y,S=g/y*100;let W=null,z=0,O="กำลังวิเคราะห์...",de=0,ve=0,et=0,mt=!1;if(v&&c>0){const ft=V.map(Q=>Q.result),K=ft.filter(Q=>Q!=="tie"),ae=K.length,Os=ft.filter(Q=>Q==="tie").length;et=c>0?Math.round(Os/c*100):0;const ba=le?.find(Q=>Q.id===N),Hs=ba?.name?.includes("AI Part 5.1")||ba?.algorithm==="ai_part_51";if(ae>=3)if(Hs){let Q=0,me=0,ge=0,ee=0,Y=1;for(let J=ae-2;J>=0&&K[J]===K[ae-1];J--)Y++;Y>=4?(Q=35,O=`AI มังกร ${K[ae-1]==="banker"?"แดง":"น้ำเงิน"} (${Y} ตา)`):Y>=3?(Q=25,O=`AI Streak ${Y} ตา`):Y>=2&&(Q=12);const Ce=K.slice(-8);let tt=0;for(let J=1;J<Ce.length;J++)Ce[J]!==Ce[J-1]&&tt++;const Oe=Ce.length>1?tt/(Ce.length-1):0;Oe>.75?(me=30,O="AI ปิงปอง (สลับถี่)"):Oe>.6&&(me=18,O="AI ปิงปอง");const Me=K.slice(-6);let Be=0;for(let J=0;J<Me.length-1;J+=2)Me[J]===Me[J+1]&&Be++;Be>=2?(ge=22,O="AI ตัวติด (คู่ซ้ำ)"):Be>=1&&Y===2&&(ge=12);const at=(c*7+13)%100;ee=at<30?8:at<60?-5:3;const te=K.slice(-12),st=te.filter(J=>J==="player").length,nt=te.filter(J=>J==="banker").length,It=Math.max(Q,me,ge);It===Q&&Q>=25?(W=K[ae-1],z=52+Y*4+ee):It===me&&me>=18?(W=K[ae-1]==="banker"?"player":"banker",z=52+Math.round(Oe*20)+ee):It===ge&&ge>=12?(W=K[ae-1],z=50+ge+ee):at<40?(W=nt>=st?"player":"banker",z=45+Math.abs(st-nt)*2+ee,O="AI สุ่มสลับ"):(W=nt>st?"banker":st>nt||K[ae-1]==="banker"?"player":"banker",z=48+Math.abs(st-nt)*3+ee,O="AI Mixed Analysis"),z=Math.max(30,Math.min(z,92)),z<60&&(mt=!0,W=null,O=`AI ข้ามตานี้ (มั่นใจ ${Math.round(z)}% < 60%)`),de=Math.min(Y,5),ve=Math.max(0,3-Y)}else{let Q=0,me=0,ge=0,ee=1;for(let te=ae-2;te>=0&&K[te]===K[ae-1];te--)ee++;ee>=3?(Q=30,O=`มังกร ${K[ae-1]==="banker"?"แดง":"น้ำเงิน"} (${ee} ตา)`):ee>=2&&(Q=15,O=`Streak ${ee} ตา`);const Y=K.slice(-6);let Ce=0;for(let te=1;te<Y.length;te++)Y[te]!==Y[te-1]&&Ce++;const tt=Y.length>1?Ce/(Y.length-1):0;tt>.7?(me=25,O="ปิงปอง (สลับ)"):tt>.5&&(me=10);const Oe=K.slice(-10),Me=Oe.filter(te=>te==="player").length,Be=Oe.filter(te=>te==="banker").length,at=Math.abs(Me-Be);ge=Math.min(at*5,25),Q>=30?(W=K[ae-1],z=55+ee*5+ge):me>=25?(W=K[ae-1]==="banker"?"player":"banker",z=55+me):(Be>Me?(W="banker",z=50+ge):Me>Be?(W="player",z=50+ge):(W=K[ae-1]==="banker"?"player":"banker",z=50),!O.includes("มังกร")&&!O.includes("ปิงปอง")&&(O="Mixed Pattern")),z=Math.min(z,95),de=Math.min(ee,5),ve=Math.max(0,3-ee)}}return{currentCount:g,roundsNeeded:y,isReady:v,progress:S,prediction:W,confidence:Math.round(z),pattern:O,winStreak:de,loseStreak:ve,tiePercentage:et,skipPrediction:mt}},[V,N,le]);u.useEffect(()=>{if($.isReady&&$.prediction&&$.prediction!=="tie"&&n&&!Et&&!oe){const c=V.length+1,y=le?.find(g=>g.id===N);Ls.mutate({sessionId:n,formulaName:y?.name||"Default",formulaId:N??void 0,roundNumber:c,recommendedSide:$.prediction,confidence:$.confidence},{onSuccess:g=>{g.predictionId&&(At(g.predictionId),Xe("pending"))}})}},[$.prediction,$.isReady,n,V.length,oe]),u.useEffect(()=>{At(null),Xe("none"),Tt(!1),Rt(0),Ze(!1)},[n]),u.useEffect(()=>{Ee&&(parseFloat(Ee.balance??String(Ee))>=5?Ze(!1):Ze(!0))},[Ee]);const ya=u.useRef(0);u.useEffect(()=>{if($.isReady&&$.prediction&&V.length!==ya.current&&(ya.current=V.length,Xs($.confidence),$.confidence>70)){const c=$.prediction==="banker"?"เจ้ามือ (B)":"ผู้เล่น (P)";F.success(`🚨 AI มั่นใจสูง! ${$.confidence}% → ${c}`,{duration:4e3,icon:"🧠"})}},[$.prediction,$.confidence,$.isReady,V.length]);const Ws=async c=>{if(!n){F.error("กรุณาสร้างหรือเลือกเซสชันก่อน");return}re(V.length);const y=le?.find(g=>g.id===N);if(qe.mutate({sessionId:n,result:c,formulaAlgorithm:y?.algorithm??void 0,formulaName:y?.name??void 0,formulaId:N??void 0,betStep:C?.currentStep??1}),Et&&be==="pending")try{const g=await $s.mutateAsync({predictionId:Et,actualResult:c});if(c==="tie")Xe("skipped"),F.info("เสมอ - ไม่นับผลสูตร",{duration:2e3});else if(g.isCorrect){const v=G+1;Rt(v),Tt(!0),Xe("correct"),v===1?F.success(`✅ สูตรเข้า! 💳 หัก ${g.creditDeducted} Points | คงเหลือ ${g.newBalance}`,{duration:2e3}):(rn(v),v===3?F.success(`🔥🔥🔥 Streak x3! สูตรเข้า 3 ตาติด! | 💳 หัก ${g.creditDeducted} | เหลือ ${g.newBalance}`,{duration:3e3,icon:"🎯"}):v===5?F.success(`⚡⚡⚡⚡⚡ Streak x5! AI อัจฉริยะ! | 💳 หัก ${g.creditDeducted} | เหลือ ${g.newBalance}`,{duration:4e3,icon:"🧠"}):v>=7?F.success(`👑 LEGENDARY Streak x${v}! AI ไร้พ่าย! | 💳 หัก ${g.creditDeducted} | เหลือ ${g.newBalance}`,{duration:5e3,icon:"👑"}):F.success(`✅ สูตรเข้าต่อเนื่อง! 🔥 ไม้ที่ ${v} | 💳 หักอีก ${g.creditDeducted} | เหลือ ${g.newBalance}`,{duration:2e3})),parseFloat(g.newBalance)<5&&(Ze(!0),F.warning("Point ไม่เพียงพอ ต้องมีอย่างน้อย 5 Points เพื่อใช้งานสูตรต่อ",{duration:2500}))}else Xe("incorrect"),Tt(!1),Rt(0),F.error("❌ สูตรไม่เข้า 💳 ไม่หัก Point | รีเซ็ตสูตร",{duration:2e3});At(null)}catch(g){console.error("Settle prediction error:",g)}if(p&&C&&C.status==="active"&&C.formulaStatus!=="reset_required"){let g="tie";c==="tie"?g="tie":$.prediction?g=c===$.prediction?"win":"lose":g="tie";try{const v=await Ms.mutateAsync({sessionId:p,result:g,formulaSuggestion:$.prediction==="tie"?"none":$.prediction??"none"});if(Z.bankroll.get.invalidate({id:p}),Z.bankroll.getRounds.invalidate({sessionId:p}),g==="win"){const S=X+1;xe(S),ue(!0),S>=2?je({type:"streak",streakCount:S}):je({type:"win"})}else g==="lose"?(xe(0),ue(!1),je({type:"lose"})):ue(null);if(v.message)if(v.sessionStatus==="target_reached"){const S=_?_.currentPL+(_.recommendedBet||0):0;je({type:"target",profitAmount:S,shareStats:C&&_?{isProfit:!0,plPercent:_.plPercent,winRate:C.totalRounds>0?C.totalWins/C.totalRounds*100:0,totalRounds:C.totalRounds,wins:C.totalWins,losses:C.totalLosses,playTimeSeconds:De,tableName:C.tableName,startingCapital:_.starting,endingCapital:_.current}:void 0})}else v.sessionStatus==="stop_loss_hit"?F.error(v.message,{duration:5e3}):v.message==="คำนวณสูตรใหม่"&&je({type:"reset"})}catch(v){console.error("Bankroll record error:",v)}}else if($.prediction&&c!=="tie"&&c===$.prediction){const g=X+1;xe(g),ue(!0),g>=2?je({type:"streak",streakCount:g}):je({type:"win"})}else $.prediction&&c!=="tie"&&c!==$.prediction?(xe(0),ue(!1)):ue(null)},Us=async()=>{const c=parseFloat(f);if(!c||c<=0){F.error("กรุณาใส่ทุนเริ่มต้น");return}const y=parseFloat(R);if(!y||y<=0||y>100){F.error("จุดตัดขาดทุนไม่ถูกต้อง");return}const g=parseFloat(I);if(!g||g<=0||g>50){F.error("% เดิมพันไม่ถูกต้อง");return}try{const v=A.trim()||Ct?.session?.name||"เซสชัน",S=await kt.mutateAsync({tableName:v,startingBankroll:c,profitTargetPercent:L,stopLossPercent:y,startingBetPercent:g,gameSessionId:n??void 0});
19P(S.id),h(!1),Z.bankroll.list.invalidate(),F.success("เริ่มคำนวณเงินทุนแล้ว")}catch(v){F.error(v.message||"เกิดข้อผิดพลาด")}},qs=async()=>{if(p){je({type:"ai_signal"});try{const c=await Is.mutateAsync({sessionId:p});if(Z.bankroll.get.invalidate({id:p}),c.suggestion){M(c.suggestion);const y=c.suggestion.side==="player"?"ผู้เล่น":"เจ้ามือ";F.success(`รีเซ็ตสูตรแล้ว แนะนำ: ${y} (${c.suggestion.confidence}%)`)}else F.success("รีเซ็ตสูตรแล้ว เริ่มใหม่ Step 1")}catch(c){F.error(c.message||"เกิดข้อผิดพลาด")}}},Pa=async()=>{if(p)try{await Bs.mutateAsync({sessionId:p}),Z.bankroll.get.invalidate({id:p}),F.success("ดำเนินการต่อ")}catch(c){F.error(c.message||"เกิดข้อผิดพลาด")}},Vs=async()=>{p&&Ye(!0)},zs=async()=>{if(p)try{await _s.mutateAsync({sessionId:p}),Z.bankroll.get.invalidate({id:p}),Z.bankroll.list.invalidate(),Ye(!1),P(null),F.success("จบเซสชันเงินทุน")}catch(c){F.error(c.message||"เกิดข้อผิดพลาด")}},_=u.useMemo(()=>{if(!C)return null;const c=parseFloat(C.startingBankroll),y=parseFloat(C.currentBankroll),g=parseFloat(C.profitTargetPercent),v=parseFloat(C.stopLossPercent),S=c*(g/100),W=c+S,z=y-c,O=c>0?z/c*100:0,de=S-z,ve=z>=0,et=ir[C.currentStep-1],mt=Math.round(y*(et/100)*100)/100,ft=c*(1-v/100);return{starting:c,current:y,profitTargetPercent:g,stopLossPercent:v,targetAmount:S,targetBalance:W,stopLossBalance:ft,currentPL:z,plPercent:O,remainingToTarget:de,isProfit:ve,betPercentage:et,recommendedBet:mt}},[C]),ie=u.useMemo(()=>{if(!C||!_)return null;const c=C.currentStep,y=_.plPercent;let g=0;return g+=c*20,y<-40?g+=30:y<-20?g+=20:y<0?g+=10:g-=10,g=Math.max(0,Math.min(100,g)),g>=75?{level:"critical",label:"วิกฤติ",color:"text-red-400",bg:"bg-red-500/15 border-red-500/40",barColor:"bg-red-500",pct:g}:g>=50?{level:"high",label:"สูง",color:"text-orange-400",bg:"bg-orange-500/10 border-orange-500/30",barColor:"bg-orange-500",pct:g}:g>=25?{level:"medium",label:"ปานกลาง",color:"text-yellow-400",bg:"bg-yellow-500/10 border-yellow-500/30",barColor:"bg-yellow-500",pct:g}:{level:"low",label:"ต่ำ",color:"text-green-400",bg:"bg-green-500/10 border-green-500/30",barColor:"bg-green-500",pct:g}},[C,_]);return u.useEffect(()=>{C?.status==="stop_loss_hit"&&!ua&&xt(!0)},[C?.status,ua]),w&&Pe?e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1000",className:"space-y-4",children:[e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1001",onClick:()=>j(!1),className:"flex items-center gap-1 text-gray-400 text-sm hover:text-white transition-colors",children:[e.jsx(ln,{"data-loc":"client/src/pages/PlayPage.tsx:1002",className:"w-4 h-4"})," กลับ"]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1004",className:"flex items-center gap-2",children:[e.jsx(Ft,{"data-loc":"client/src/pages/PlayPage.tsx:1005",className:"w-5 h-5 text-amber-400"}),e.jsx("h1",{"data-loc":"client/src/pages/PlayPage.tsx:1006",className:"text-lg font-bold text-white",children:"ประวัติการเดิมพัน"})]}),Pe.length===0?e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1009",className:"text-center py-12",children:[e.jsx(Ft,{"data-loc":"client/src/pages/PlayPage.tsx:1010",className:"w-10 h-10 text-gray-600 mx-auto mb-2"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1011",className:"text-gray-400 text-sm",children:"ยังไม่มีประวัติ"})]}):e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1014",className:"space-y-2",children:Pe.map(c=>{const y=parseFloat(c.profitLoss),g=c.result==="win",v=c.result==="tie";return e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1020",className:"p-3 rounded-xl bg-black/40 border border-white/5",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1021",className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1022",className:"flex items-center gap-2",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1023",className:"text-xs text-gray-500",children:["#",c.roun
19dNumber]}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1024",className:`text-xs px-1.5 py-0.5 rounded font-medium ${g?"bg-green-500/20 text-green-400":v?"bg-gray-500/20 text-gray-400":"bg-red-500/20 text-red-400"}`,children:g?"ชนะ":v?"เสมอ":"แพ้"}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1027",className:"text-[10px] text-gray-600",children:["Step ",c.step]})]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1029",className:`text-sm font-bold ${g?"text-green-400":v?"text-gray-400":"text-red-400"}`,children:[y>0?"+":"",y.toLocaleString()," ฿"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1033",className:"flex items-center justify-between text-[10px] text-gray-500",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1034",children:["เดิมพัน: ",parseFloat(c.betAmount).toLocaleString()," ฿ (",c.betPercentage,"%)"]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1035",children:["ทุนหลัง: ",parseFloat(c.bankrollAfter).toLocaleString()," ฿"]})]})]},c.id)})})]}):e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1047",className:"space-y-3 relative ai-circuit-bg",children:[e.jsx(cr,{"data-loc":"client/src/pages/PlayPage.tsx:1049"}),e.jsx(As,{"data-loc":"client/src/pages/PlayPage.tsx:1052"}),ma&&e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1056",className:"flex justify-center",children:ma}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1060",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1061",className:"flex items-center gap-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1062",className:"flex items-center gap-1.5",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1063",className:"ai-status-dot"}),e.jsx("h1",{"data-loc":"client/src/pages/PlayPage.tsx:1064",className:"text-lg font-bold text-ai-gradient",children:"เล่นบาคาร่า"})]}),Ee!==void 0&&e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1067",className:"flex items-center gap-0.5 px-2 py-0.5 rounded-full bg-cyan-500/10 border border-cyan-500/30 text-[10px] text-cyan-400 font-medium",children:[e.jsx(cn,{"data-loc":"client/src/pages/PlayPage.tsx:1068",className:"w-2.5 h-2.5"}),Ee.balance]}),n&&e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1074",className:`flex items-center gap-0.5 px-2 py-0.5 rounded-full border text-[10px] font-medium transition-colors ${De>=3600?"bg-red-500/10 border-red-500/30 text-red-400 animate-pulse":De>=2700?"bg-yellow-500/10 border-yellow-500/30 text-yellow-400":"bg-gray-500/10 border-gray-500/30 text-gray-400"}`,"aria-label":`เวลาเล่นรอบปัจจุบัน ${ps(De)}`,title:"เวลาเล่นรอบปัจจุบัน — พักอัตโนมัติเมื่อสลับแอปหรือล็อกหน้าจอ",children:[e.jsx(on,{"data-loc":"client/src/pages/PlayPage.tsx:1079",className:"w-2.5 h-2.5"}),ps(De)]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1084",className:"flex gap-1.5",children:[e.jsxs(He,{"data-loc":"client/src/pages/PlayPage.tsx:1085",open:t,onOpenChange:r,children:[e.jsx(Na,{"data-loc":"client/src/pages/PlayPage.tsx:1086",asChild:!0,children:e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1087",className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-cyan-500/5 border border-cyan-500/20 text-xs text-cyan-300 hover:bg-cyan-500/10 hover:border-cyan-500/40 transition-all",children:[e.jsx(dn,{"data-loc":"client/src/pages/PlayPage.tsx:1088",className:"h-3 w-3"}),"ใหม่"]})}),e.jsxs(Ge,{"data-loc":"client/src/pages/PlayPage.tsx:1092",className:"bg-[#0A0F1A] border-cyan-500/20",children:[e.jsx(lt,{"data-loc":"client/src/pages/PlayPage.tsx:1093",children:e.jsxs(ct,{"data-loc":"client/src/pages/PlayPage.tsx:1094",className:"text-white flex items-center gap-2",children:[e.jsx(Lt,{"data-loc":"client/src/pages/PlayPage.tsx:1095",className:"w-5 h-5 text-cyan-400"}),"สร้างเซสชันใหม่"]})}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1099",className:"space-y-4 pt-4",children:[e.jsx("input",{"data-loc":"client/src/pages/PlayPage.tsx:1100",placeholder:"ชื่อเซสชัน เช่น โต๊ะ 1 รอบเช้า",value:l,onCh
19ange:c=>a(c.target.value),className:"w-full px-3 py-2.5 rounded-lg bg-black/60 border border-cyan-500/20 text-white text-sm placeholder:text-gray-600 focus:border-cyan-500/50 focus:outline-none"}),e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1106",onClick:()=>fa.mutate({name:l||"เซสชันใหม่"}),className:"w-full py-2.5 rounded-lg bg-gradient-to-r from-cyan-500 to-blue-600 text-white font-medium text-sm border-0 shadow-[0_0_20px_rgba(0,200,255,0.2)] hover:shadow-[0_0_30px_rgba(0,200,255,0.3)] transition-all",disabled:fa.isPending,children:[e.jsx(wa,{"data-loc":"client/src/pages/PlayPage.tsx:1111",className:"w-4 h-4 inline mr-1"}),"สร้าง"]})]})]})]}),e.jsxs(He,{"data-loc":"client/src/pages/PlayPage.tsx:1118",open:o,onOpenChange:i,children:[e.jsx(Na,{"data-loc":"client/src/pages/PlayPage.tsx:1119",asChild:!0,children:e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1120",className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-cyan-500/5 border border-cyan-500/15 text-xs text-gray-300 hover:border-cyan-500/30 transition-all",children:[e.jsx(Ma,{"data-loc":"client/src/pages/PlayPage.tsx:1121",className:"h-3 w-3"}),"โหลด"]})}),e.jsxs(Ge,{"data-loc":"client/src/pages/PlayPage.tsx:1125",className:"bg-[#0A0F1A] border-cyan-500/20",children:[e.jsx(lt,{"data-loc":"client/src/pages/PlayPage.tsx:1126",children:e.jsxs(ct,{"data-loc":"client/src/pages/PlayPage.tsx:1127",className:"text-white flex items-center gap-2",children:[e.jsx(yt,{"data-loc":"client/src/pages/PlayPage.tsx:1128",className:"w-5 h-5 text-cyan-400"}),"เลือกเซสชัน"]})}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1132",className:"space-y-2 pt-4 max-h-60 overflow-y-auto",children:[ye?.map(c=>e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1134",className:"flex items-center justify-between p-3 rounded-lg bg-black/40 border border-cyan-500/10 hover:border-cyan-500/30 hover:bg-cyan-500/5 cursor-pointer transition-all",onClick:()=>{s(c.id),i(!1)},children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1139",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1140",className:"font-medium text-sm text-white",children:c.name}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1141",className:"text-xs text-gray-500",children:[c.totalRounds," ตา | ",new Date(c.updatedAt||c.createdAt).toLocaleDateString("th-TH",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})]})]}),e.jsx(rt,{"data-loc":"client/src/pages/PlayPage.tsx:1143",className:"w-3.5 h-3.5 text-cyan-500/40"})]},c.id)),(!ye||ye.length===0)&&e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1147",className:"text-center text-gray-500 text-sm py-4",children:"ยังไม่มีเซสชัน"})]})]})]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1156",className:"ai-glass-card rounded-xl p-2.5 relative overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1157",className:"absolute inset-0 ai-data-flow-bg opacity-30 pointer-events-none"}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1158",className:"relative flex items-center justify-between mb-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1159",className:"flex items-center gap-1.5 ai-section-header",children:[e.jsx(Lt,{"data-loc":"client/src/pages/PlayPage.tsx:1160",className:"w-3.5 h-3.5 text-cyan-400"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1161",className:"text-xs font-medium text-gray-300",children:"สูตรที่ใช้"})]}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1163",onClick:()=>D(!T),className:"text-[10px] text-cyan-400 hover:text-cyan-300 transition-colors",children:T?"ปิด":"เลือกสูตร"})]}),N&&le?e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1173",className:"relative flex items-center gap-2 p-2 rounded-lg bg-gradient-to-r from-cyan-500/10 to-blue-500/10 border border-cyan-500/25 animate-ai-neural-pulse",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1174",className:"w-7 h-7 rounded-full bg-gradient-to-br from-cyan-400 to-blue-600 flex items-center justify-center shrink-0 shadow-[0_0_10px_rgba(0,200,255,0.3)]",children:e.jsx(gn,{"data-loc":"client/src/pages/PlayPage.tsx:1175",className:"w-3.5 h-3.5 text-white"})}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1177",className:"flex-1 min-w-0",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1178",className:"text-xs font-medium text-white truncate",children:le.find(c=>c.id===N)?.name||"สูตร"}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1181",className:"text-[9px] text-cyan-400/70",children:["Win Rate ",le.find(c=>c.id===N)?.winRate,"%"]})]}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1185",onClick:()=>{B(null),F.info("ยกเลิกสูตรแล้ว")},className:"text-[10px] text-gray-500 hover:text-red-400 transition-colors px-1.5 py-0.5 rounded bg-black/40",children:"ยกเลิก"})]}):e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1193",className:"relative flex items-center gap-2 p-2 rounded-lg bg-black/30 border border-cyan-500/10",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1194",className:"w-7 h-7 rounded-full bg-cyan-500/10 flex items-center justify-center shrink-0",children:e.jsx(Lt,{"data-loc":"client/src/pages/PlayPage.tsx:1195",className:"w-3.5 h-3.5 text-cyan-500/50"})}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1197",className:"text-[11px] text-gray-500 flex-1",children:"ยังไม่ได้เลือกสูตร (ใช้สูตรพื้นฐาน)"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1198",onClick:()=>D(!0),className:"text-[10px] text-cyan-400 bg-cyan-500/10 border border-cyan-500/30 rounded-full px-2 py-0.5 hover:bg-cyan-500/20 transition-all",children:"เลือก"})]}),T&&e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1209",className:"relative mt-2 space-y-1.5 max-h-48 overflow-y-auto",children:!le||le.length===0?e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1211",className:"text-center py-4",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1212",className:"text-xs text-gray-500",children:"ยังไม่มีสูตร"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1213",onClick:()=>Ue("/marketplace"),className:"mt-2 text-[10px] text-cyan-400 underline",children:"ไปตลาดสูตร"})]}):e.jsxs(e.Fragment,{children:[le.map(c=>e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1223",onClick:()=>{c.isFree===1?(B(c.id),D(!1),F.success(`เลือกสูตร: ${c.name}`)):Rs.mutate({id:c.id})},className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-all active:scale-[0.98] ${N===c.id?"bg-cyan-500/15 border border-cyan-500/40 shadow-[0_0_8px_rgba(0,200,255,0.1)]":"bg-black/30 border border-cyan-500/10 hover:border-cyan-500/25 hover:bg-cyan-500/5"}`,children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1240",className:"flex-1 min-w-0",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1241",className:"flex items-center gap-1.5",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1242",className:"text-xs font-medium text-white truncate",children:c.name}),c.isFree===1?e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1244",className:"px-1 py-0.5 rounded bg-green-500/20 text-[8px] text-green-400 shrink-0",children:"ฟรี"}):e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1246",className:"flex items-center gap-0.5 shrink-0",children:[e.jsx($t,{"data-loc":"client/src/pages/PlayPage.tsx:1247",className:"w-2.5 h-2.5 text-cyan-400"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1248",className:"text-[8px] text-cyan-400",children:c.cost})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1252",className:"flex items-center gap-2 mt-0.5",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1253",className:"text-[9px] text-green-400",children:["WR ",c.winRate,"%"]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1254",className:"flex items-center gap-0.5",children:[e.jsx(xn,{"data-loc":"client/src/pages/PlayPage.tsx:1255",className:"w-2.5 h-2.5 text-cyan-400 fill-cyan-400"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1256",className:"text-[9px] text-gray-500",children:c.avgRating})]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1258",className:"text-[9px] text-gray-600",children:[(c.totalUses??0).toLocaleStr
19ing()," ครั้ง"]})]})]}),e.jsx(ht,{"data-loc":"client/src/pages/PlayPage.tsx:1261",className:"w-3.5 h-3.5 text-cyan-500/40 shrink-0"})]},c.id)),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1264",onClick:()=>Ue("/marketplace"),className:"w-full text-center py-2 text-[10px] text-cyan-400 hover:text-cyan-300 transition-colors",children:"ดูทั้งหมดในตลาดสูตร →"})]})})]}),Ae&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1278",className:"flex items-center gap-1.5 px-1",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1279",className:"flex-1 flex items-center justify-center gap-1 py-1.5 rounded-lg bg-blue-500/10 border border-blue-500/20",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1280",className:"text-[9px] text-blue-400 font-bold",children:"P"}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1281",className:"text-[10px] text-blue-300 font-medium",children:[Ae.playerPct,"%"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1283",className:"flex-1 flex items-center justify-center gap-1 py-1.5 rounded-lg bg-green-500/10 border border-green-500/20",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1284",className:"text-[9px] text-green-400 font-bold",children:"T"}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1285",className:"text-[10px] text-green-300 font-medium",children:[Ae.tiePct,"%"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1287",className:"flex-1 flex items-center justify-center gap-1 py-1.5 rounded-lg bg-red-500/10 border border-red-500/20",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1288",className:"text-[9px] text-red-400 font-bold",children:"B"}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1289",className:"text-[10px] text-red-300 font-medium",children:[Ae.bankerPct,"%"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1291",className:"flex-1 flex items-center justify-center gap-1 py-1.5 rounded-lg bg-cyan-500/10 border border-cyan-500/20",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1292",className:"text-[9px] text-gray-400",children:"ตา"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1293",className:"text-[10px] text-cyan-300 font-medium",children:Ae.total})]}),Ae.streak&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1296",className:"flex items-center justify-center gap-0.5 py-1.5 px-2 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[e.jsx(Dt,{"data-loc":"client/src/pages/PlayPage.tsx:1297",className:"w-2.5 h-2.5 text-amber-400"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1298",className:"text-[10px] text-amber-300 font-bold",children:Ae.streak})]})]}),V.length>12&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1306",className:"flex items-center gap-0.5 px-1 overflow-x-auto",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1307",className:"text-[8px] text-gray-600 shrink-0 mr-1",children:"ล่าสุด:"}),V.slice(-12).map((c,y)=>e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1309",className:`w-4 h-4 rounded-full flex items-center justify-center text-[7px] font-bold text-white shrink-0 ${c.result==="banker"?"bg-red-500/80":c.result==="player"?"bg-blue-500/80":"bg-green-500/80"}`,children:c.result==="banker"?"B":c.result==="player"?"P":"T"},y))]}),e.jsxs(rr,{"data-loc":"client/src/pages/PlayPage.tsx:1326",active:X>=2,color:X>=5?"#A855F7":X>=4?"#3B82F6":(X>=3,"#00C8FF"),className:"ai-glass-card overflow-hidden relative",children:[V.length>0&&e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1327",className:"ai-scan-line"}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1328",className:"p-2 min-h-[120px]",children:V.length===0?e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1330",className:"flex flex-col items-center justify-center h-[100px] text-gray-500",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1331",className:"relative",children:[e.jsx(yt,{"data-loc":"client/src/pages/PlayPage.tsx:1332",className:"w-8 h-8 mb-1.5 text-cyan-500/30"}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1333",className:"absolute inset-0 animate-ping opacity-20",children:e.jsx(yt,{"data-loc":"client/src/pages/PlayPage.tsx:1334",className:"w-8 h-8 text-cyan-400"})})]}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1337",className:"text-xs text-cyan-300/60",children:"ป้อนสถิติล่าสุดของห้องที่เล่น"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1338",className:"text-[10px] mt-0.5 text-gray-600",children:"กดปุ่มด้านล่างเพื่อบันทึกผล"})]}):e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1341",ref:x,className:"overflow-x-auto",style:{scrollBehavior:"smooth"},children:e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1342",className:"grid gap-[3px]",style:{gridTemplateColumns:`repeat(${Bt}, minmax(22px, 1fr))`,gridTemplateRows:`repeat(${Ie}, 1fr)`,minWidth:Bt>ia?`${Bt*26}px`:void 0},children:Ds.map((c,y)=>c.map((g,v)=>e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1352",className:"aspect-square flex items-center justify-center",style:{gridRow:y+1,gridColumn:v+1},children:g?e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1358",className:`w-full h-full max-w-[22px] max-h-[22px] rounded-full flex items-center justify-center text-[8px] font-bold text-white ai-token-enter ${ne!==null&&v*Ie+y===ne?"ring-2 ring-white/80 ring-offset-1 ring-offset-transparent animate-pulse":""} ${g==="banker"?"bg-gradient-to-br from-red-500 to-red-700 shadow-[0_0_8px_rgba(239,68,68,0.5)]":g==="player"?"bg-gradient-to-br from-blue-400 to-blue-700 shadow-[0_0_8px_rgba(59,130,246,0.5)]":"bg-gradient-to-br from-green-400 to-green-700 shadow-[0_0_8px_rgba(34,197,94,0.5)]"}`,children:g==="banker"?"B":g==="player"?"P":"T"}):e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1370",className:"w-full h-full max-w-[22px] max-h-[22px] rounded-full border border-cyan-500/[0.06]"})},`${y}-${v}`)))})})}),V.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1380",className:"px-2 pb-1.5 flex justify-between items-center",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1381",className:"text-[9px] text-gray-600",children:["ทั้งหมด ",V.length," ตา"]}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1382",className:"text-[9px] text-gray-600",children:Ct?.session?.name||""})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1388",className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1390",className:`ai-glass-card rounded-xl p-3 text-center transition-all duration-300 ${gt===!0?"animate-result-glow ring-1 ring-green-500/40":gt===!1?"ring-1 ring-red-500/30":""}`,children:[e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1391",className:"text-[10px] text-cyan-400/70 mb
19-1 flex items-center justify-center gap-1",children:[e.jsx(rt,{"data-loc":"client/src/pages/PlayPage.tsx:1392",className:"w-2.5 h-2.5"}),"ตาถัดไป"]}),oe?e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1396",className:"flex flex-col items-center justify-center h-[44px]",children:[e.jsx($t,{"data-loc":"client/src/pages/PlayPage.tsx:1397",className:"w-6 h-6 text-gray-500 mb-1"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1398",className:"text-[9px] text-gray-500",children:"เติม Point เพื่อดูสูตร"})]}):$.isReady?$.skipPrediction?e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1407",className:"flex flex-col items-center justify-center h-[44px]",children:e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1408",className:"w-11 h-11 rounded-full flex items-center justify-center text-sm font-bold bg-gradient-to-br from-yellow-500/30 to-orange-500/30 border border-yellow-500/40 text-yellow-400 animate-pulse",children:e.jsx(Ba,{"data-loc":"client/src/pages/PlayPage.tsx:1409",className:"w-5 h-5"})})}):$.prediction?e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1413",className:"flex items-center justify-center h-[44px]",children:e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1414",className:`w-11 h-11 rounded-full flex items-center justify-center text-sm font-bold text-white ai-orb-pulse ${$.prediction==="banker"?"bg-gradient-to-br from-red-500 to-red-700 text-red-100":"bg-gradient-to-br from-blue-400 to-blue-700 text-blue-100"}`,style:{color:$.prediction==="banker"?"#FCA5A5":"#93C5FD"},children:$.prediction==="banker"?"B":"P"})}):e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1426",className:"text-lg font-bold text-gray-500",children:"-"}):e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1401",className:"flex flex-col items-center justify-center h-[44px]",children:e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1402",className:"text-xs font-bold text-cyan-400/60 bg-cyan-500/10 rounded-full px-3 py-1 border border-cyan-500/20",children:["รอสูตร (",$.currentCount,"/",$.roundsNeeded,")"]})}),$.isReady&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1429",className:"flex flex-col items-center",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1430",className:`text-[10px] mt-1 font-medium transition-all duration-300 ${$.skipPrediction?"text-orange-400/80":$.confidence>70?"text-green-400 animate-pulse":$.confidence>=60?"text-yellow-400/90":"text-cyan-300/60"}`,children:$.skipPrediction?"หยุดแทง":`มั่นใจ ${$.confidence}%`}),$.tiePercentage>0&&e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1442",className:"text-[9px] text-green-400/60",children:["Tie ",$.tiePercentage,"%"]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1449",className:"ai-glass-card rounded-xl p-3 text-center",children:[e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1450",className:"text-[10px] text-cyan-400/70 mb-1 flex items-center justify-center gap-1",children:[e.jsx(un,{"data-loc":"client/src/pages/PlayPage.tsx:1451",className:"w-2.5 h-2.5"}),"เดิมพันแนะนำ"]}),_?e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1455",className:"flex flex-col items-center justify-center h-[44px]",children:[e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1456",className:"text-xl font-black text-amber-400",children:[_.recommendedBet.toLocaleString(),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1457",className:"text-xs",children:" ฿"})]}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1459",className:"text-[10px] text-gray-500",children:["Step ",C.currentStep," (",_.betPercentage,"%)"]})]}):e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1462",className:"flex flex-col items-center justify-center h-[44px]",children:e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1463",onClick:()=>n?h(!0):F.error("สร้างเซสชันก่อน"),className:"text-xs text-cyan-400 bg-cyan-500/10 border border-cyan-500/30 rounded-full px-3 py-1 hover:bg-cyan-500/20 transition-all",children:[e.jsx(Ia,{"data-loc":"client/src/pages/PlayPage.tsx:1467",className:"w-3 h-3 inline mr-1"}),"ตั้งค่าทุน"]})})]})]}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1476",className:"mt-2",children:e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1477",className:"relative",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1478",className:"grid grid-cols-3 gap-2.5",children:[e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1479",onClick:()=>
19{if(oe){ze(!0),setTimeout(()=>ze(!1),500),Ve(!0);return}"vibrate"in navigator&&navigator.vibrate(10),Zs(),he("player")},disabled:!n||qe.isPending,className:`h-[72px] text-lg font-bold text-white rounded-xl disabled:opacity-40 ai-btn-player active:scale-[0.93] transition-transform ${oe?"grayscale opacity-50":""} ${Mt?"animate-shake":""}`,children:"Player"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1486",onClick:()=>{if(oe){ze(!0),setTimeout(()=>ze(!1),500),Ve(!0);return}"vibrate"in navigator&&navigator.vibrate(10),en(),he("tie")},disabled:!n||qe.isPending,className:`h-[72px] text-lg font-bold text-white rounded-xl disabled:opacity-40 ai-btn-tie active:scale-[0.93] transition-transform ${oe?"grayscale opacity-50":""} ${Mt?"animate-shake":""}`,children:"Tie"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1493",onClick:()=>{if(oe){ze(!0),setTimeout(()=>ze(!1),500),Ve(!0);return}"vibrate"in navigator&&navigator.vibrate(10),tn(),he("banker")},disabled:!n||qe.isPending,className:`h-[72px] text-lg font-bold text-white rounded-xl disabled:opacity-40 ai-btn-banker active:scale-[0.93] transition-transform ${oe?"grayscale opacity-50":""} ${Mt?"animate-shake":""}`,children:"Banker"})]}),n&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1504",className:"grid grid-cols-3 gap-1.5 mt-1.5",children:[e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1505",onClick:()=>{if(pe>=dt){F.error("ย้อนหลังครบ 3 ครั้งแล้ว");return}$e(!0)},disabled:V.length===0||pe>=dt,className:"h-7 text-[10px] font-medium rounded-lg border border-red-500/20 bg-red-500/5 text-red-300 disabled:opacity-30 transition-all active:scale-[0.95] flex items-center justify-center gap-1",children:[e.jsx(_a,{"data-loc":"client/src/pages/PlayPage.tsx:1516",className:"h-3 w-3"}),"ลบ (",dt-pe,")"]}),e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1519",onClick:()=>{qe.mutate({sessionId:n,result:"tie"}),re(V.length),F.info("ข้ามตา",{duration:1500})},disabled:qe.isPending,className:"h-7 text-[10px] font-medium rounded-lg border border-yellow-500/20 bg-yellow-500/5 text-yellow-300 disabled:opacity-30 transition-all active:scale-[0.95] flex items-center justify-center gap-1",children:[e.jsx(an,{"data-loc":"client/src/pages/PlayPage.tsx:1528",className:"h-3 w-3"}),"ข้ามตา"]}),e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1531",onClick:()=>h(!0),className:"h-7 text-[10px] font-medium rounded-lg border border-cyan-500/20 bg-cyan-500/5 text-cyan-300 transition-all active:scale-[0.95] flex items-center justify-center gap-1",children:[p?e.jsx(pn,{"data-loc":"client/src/pages/PlayPage.tsx:1535",className:"h-3 w-3"}):e.jsx(Ia,{"data-loc":"client/src/pages/PlayPage.tsx:1535",className:"h-3 w-3"}),p?"ตั้งค่า":"เงินทุน"]})]})]})}),oe&&$.isReady&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1545",className:"rounded-xl p-2.5 text-center bg-red-500/10 border border-red-500/25",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1546",className:"text-xs font-medium text-red-400",children:"Point ไม่เพียงพอ ต้องมีอย่างน้อย 5 Points เพื่อใช้งานสูตรต่อ"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1547",onClick:()=>Ue("/credits"),className:"mt-1 text-[10px] text-cyan-400 underline",children:"เติม Point"})]}),ha&&G>0&&!oe&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1559",className:`rounded-xl p-3 text-center transition-all duration-500 ${G>=7?"bg-gradient-to-r from-yellow-500/20 via-amber-500/20 to-yellow-500/20 border border-yellow-500/50 shadow-[0_0_20px_rgba(245,158,11,0.3)] animate-pulse":G>=5?"bg-gradient-to-r from-purple-500/15 via-pink-500/15 to-purple-500/15 border border-purple-500/40 shadow-[0_0_15px_rgba(168,85,247,0.25)]":G>=3?"bg-gradient-to-r from-cyan-500/15 via-blue-500/15 to-cyan-500/15 border border-cyan-500/35 shadow-[0_0_12px_rgba(0,200,255,0.2)]":"bg-green-500/10 border border-green-500/30"}`,children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1565",className:"flex items-center justify-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1567",className:"flex items-center gap-0.5",children:Array.from({length:Math.min(G,7)}).map((c,y)=>e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1569",className:`text-sm ${G>=7?"animate-bounce":G>=5?"animate-pulse":""}`,style:{animationDelay:`${y*.1}s`},children:G>=7?"👑":G>=5?"⚡":"🔥"},y))}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1578",className:"flex items-center gap-2",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1579",className:`text-lg font-black ${G>=7?"text-yellow-400":G>=5?"text-purple-400":G>=3?"text-cyan-400":"text-green-400"}`,children:["x",G]}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1587",className:`text-xs font-medium ${G>=7?"text-yellow-300":G>=5?"text-purple-300":G>=3?"text-cyan-300":"text-green-300"}`,children:G>=7?"LEGENDARY!":G>=5?"AI อัจฉริยะ!":G>=3?"Streak!":"สูตรกำลังทำงาน"})]})]}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1600",className:"text-[10px] text-gray-400 mt-1",children:["เข้าต่อเนื่อง ",G," ไม้ | หัก 5 Points ทุกไม้ที่สูตรเข้า"]})]}),be!=="none"&&!ha&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1608",className:`rounded-xl p-2 text-center text-xs font-medium transition-all duration-300 ${be==="pending"?"bg-cyan-500/10 border border-cyan-500/25 text-cyan-300":be==="correct"?"bg-green-500/10 border border-green-500/30 text-green-400":be==="incorrect"?"bg-red-500/10 border border-red-500/20 text-red-400":"bg-gray-500/10 border border-gray-500/20 text-gray-400"}`,children:[be==="pending"&&"รอผลลัพธ์… (หัก 5 Points ทุกไม้ที่สูตรเข้า)",be==="correct"&&"✅ สูตรเข้า! 💳 หัก 5 Points",be==="incorrect"&&"❌ สูตรไม่เข้า 💳 ไม่หัก Point | รีเซ็ตสูตร",be==="skipped"&&"เสมอ - ไม่นับผลสูตร"]}),$.isReady&&($.prediction||$.skipPrediction)&&e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1623",className:"ai-glass-card rounded-xl p-2.5",children:e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1624",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1625",className:"flex items-center gap-2",children:[e.jsx(rt,{"data-loc":"client/src/pages/PlayPage.tsx:1626",className:"w-3.5 h-3.5 text-cyan-400"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1627",className:"text-xs text-gray-300",children:$.pattern})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1629",className:"flex items-center gap-2",children:[$.tiePercentage>0&&e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1631",className:"text-[9px] text-green-400 bg-green-500/10 rounded px-1.5 py-0.5",children:["T:",$.tiePercentage,"%"]}),e.jsx(Dt,{"data-loc":"client/src/pages/PlayPage.tsx:1633",className:"w-3 h-3 text-green-400"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1634",className:"text-[10px] text-green-400",children:$.
19winStreak}),e.jsx(Dt,{"data-loc":"client/src/pages/PlayPage.tsx:1635",className:"w-3 h-3 text-red-400"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1636",className:"text-[10px] text-red-400",children:$.loseStreak})]})]})}),N&&vt&&vt.length>0&&(()=>{const c=le?.find(g=>g.id===N),y=vt.find(g=>g.formulaName===c?.name);return y?e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1648",className:"ai-glass-card rounded-xl p-2.5",children:e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1649",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1650",className:"flex items-center gap-2",children:[e.jsx(mn,{"data-loc":"client/src/pages/PlayPage.tsx:1651",className:"w-3.5 h-3.5 text-purple-400"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1652",className:"text-[10px] text-gray-300",children:"สถิติจริงจากผู้ใช้ทั้งหมด"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1654",className:"flex items-center gap-3",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1655",className:"text-[10px] text-cyan-300",children:["Win ",y.winRate,"%"]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1656",className:"text-[10px] text-gray-400",children:["ใช้ ",y.totalUses," ครั้ง"]})]})]})}):null})(),Te&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1665",className:"ai-glass-card rounded-xl p-2.5",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1666",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1667",className:"flex items-center gap-2",children:[e.jsx(ja,{"data-loc":"client/src/pages/PlayPage.tsx:1668",className:"w-3.5 h-3.5 text-cyan-400"}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1669",className:"text-[10px] text-gray-300",children:["สูตรถูก ",e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1670",className:"text-cyan-300 font-bold",children:[Te.correct,"/",Te.total]})," ตาล่าสุด (",Te.pct,"%)"]})]}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1673",className:"flex items-center gap-1.5",children:Ne&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1676",className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded-full border text-[9px] font-medium ${Ne.bg} ${Ne.color}`,children:[Ne.status==="hot"||Ne.status==="warm"?e.jsx(vn,{"data-loc":"client/src/pages/PlayPage.tsx:1678",className:"w-2.5 h-2.5"}):Ne.status==="cold"||Ne.status==="cool"?e.jsx(fn,{"data-loc":"client/src/pages/PlayPage.tsx:1680",className:"w-2.5 h-2.5"}):e.jsx(rt,{"data-loc":"client/src/pages/PlayPage.tsx:1682",className:"w-2.5 h-2.5"}),Ne.label]})})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1690",className:"flex items-center gap-1 mt-1.5",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1691",className:"text-[8px] text-gray-600",children:"ล่าสุด:"}),Te.recent5.map((c,y)=>e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1693",className:`w-3 h-3 rounded-full ${c?"bg-green-500/80":"bg-red-500/80"}`},y)),Te.recent5.length<5&&Array.from({length:5-Te.recent5.length}).map((c,y)=>e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1699",className:"w-3 h-3 rounded-full bg-gray-700/50"},`empty-${y}`))]})]}),Re&&e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1707",className:`rounded-xl p-3 border transition-all duration-500 ${Re.severity==="critical"?"bg-red-500/15 border-red-500/40 animate-pulse":"bg-amber-500/10 border-amber-500/30"}`,children:e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1712",className:"flex items-center gap-2",children:[e.jsx(_t,{"data-loc":"client/src/pages/PlayPage.tsx:1713",className:`w-5 h-5 shrink-0 ${Re.severity==="critical"?"text-red-400":"text-amber-400"}`}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1716",className:"flex-1",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1717",className:`text-xs font-bold ${Re.severity==="critical"?"text-red-400":"text-amber-400"}`,children:Re.severity==="critical"?"⚠️ ควรหยุดทันที!":"⚠️ สัญญาณเตือน"}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1722",className:"text-[10px] text-gray-400 mt-0.5",children:[Re.reasons.join(" | "),Re.severity==="critical"?" — แนะนำหยุดพักแล้วกลับมาใหม่":" — พิจารณาหยุดพักก่อน"]})]})]})}),C&&_&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1733",className:"rounded-xl ai-glass-card overflow-hidden",children:[C.status==="target_reached"&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1736",className:"p-2 bg-green-500/10 border-b border-green-500/30 flex items-center gap-2",children:[e.jsx(hn,{"data-loc":"client/src/pages/PlayPage.tsx:1737",className:"w-4 h-4 text-green-400 shrink-0"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1738",className:"text-xs font-bold text-green-400 flex-1",children:"ถึงเป้าหมายแล้ว!"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1739",onClick:Pa,className:"text-[10px] text-green-300/70 underline",children:"เล่นต่อ"})]}),C.status==="stop_loss_hit"&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1743",className:"p-2 bg-red-500/10 border-b border-red-500/30 flex items-center gap-2",children:[e.jsx(Ba,{"data-loc":"client/src/pages/PlayPage.tsx:1744",className:"w-4 h-4 text-red-400 shrink-0"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1745",className:"text-xs font-bold text-red-400 flex-1",children:"ถึงจุดตัดขาดทุน"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1746",onClick:Pa,className:"text-[10px] text-red-300/70 underline",children:"เล่นต่อ"})]}),C.formulaStatus==="reset_required"&&C.status==="active"&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1750",className:"p-2 bg-orange-500/10 border-b border-orange-500/30 flex items-center gap-2",children:[e.jsx(yn,{"data-loc":"client/src/pages/PlayPage.tsx:1751",className:"w-4 h-4 text-orange-400 shrink-0"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1752",className:"text-xs font-bold text-orange-400 flex-1",children:"แพ้ครบ 4 Step"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1753",onClick:qs,className:"px-2 py-1 rounded bg-orange-500 text-black text-[10px] font-bold",children:"รีเซ็ต"})]}),e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1758",onClick:()=>Es(!Nt),className:"w-full p-2.5 flex items-center gap-2 hover:bg-white/[0.02] transition-colors",children:[C.tableName&&C.tableName!=="เซสชัน"&&e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1764",className:"text-[9px] px-1.5 py-0.5 rounded bg-cyan-500/10 text-cyan-400 border border-cyan-500/20 truncate max-w-[80px]",children:C.tableName}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1769",className:`text-sm font-bold ${_.isProfit?"text-green-400":"text-red-400"}
19`,children:[_.current.toLocaleString()," ฿"]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1773",className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${_.isProfit?"bg-green-500/15 text-green-400":"bg-red-500/15 text-red-400"}`,children:[_.isProfit?"+":"",_.plPercent.toFixed(1),"%"]}),ie&&e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1780",className:`text-[9px] px-1.5 py-0.5 rounded-full font-medium ${ie.bg} ${ie.color}`,children:ie.label}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1785",className:"text-[9px] text-gray-500 ml-auto",children:["Step ",C.currentStep,"/4"]}),Nt?e.jsx(Pn,{"data-loc":"client/src/pages/PlayPage.tsx:1788",className:"w-3.5 h-3.5 text-gray-500"}):e.jsx(Ys,{"data-loc":"client/src/pages/PlayPage.tsx:1790",className:"w-3.5 h-3.5 text-gray-500"})]}),Nt&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1796",className:"px-2.5 pb-2.5 space-y-2 border-t border-white/5 pt-2",children:[b&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1799",className:`p-2 rounded-lg border flex items-center gap-2 ${b.side==="player"?"bg-blue-500/10 border-blue-500/30":"bg-red-500/10 border-red-500/30"}`,children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1802",className:`w-6 h-6 rounded-full flex items-center justify-center text-white font-bold text-[10px] ${b.side==="player"?"bg-blue-500":"bg-red-500"}`,children:b.side==="player"?"P":"B"}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1807",className:"flex-1",children:e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:1808",className:"text-[10px] text-gray-400",children:["สูตรแนะนำ: ",b.side==="player"?"ผู้เล่น":"เจ้ามือ"," (",b.confidence,"%)"]})})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1814",className:"space-y-1.5",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1815",className:"flex items-center justify-between",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1816",className:"text-[9px] text-red-400",children:["ตัดขาดทุน ",_.stopLossBalance.toLocaleString()]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1817",className:"text-[9px] text-green-400",children:["เป้าหมาย ",_.targetBalance.toLocaleString()]})]}),(()=>{const c=_.stopLossBalance,g=_.targetBalance-c,v=g>0?Math.max(0,Math.min(100,(_.current-c)/g*100)):50,S=g>0?Math.max(0,Math.min(100,(_.starting-c)/g*100)):50;return e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1826",className:"relative",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1827",className:"h-2.5 rounded-full bg-gray-800/80 border border-gray-700/50 overflow-hidden relative",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1828",className:"absolute inset-y-0 left-0 bg-gradient-to-r from-red-600/40 to-red-500/20",style:{width:`${S}%`}}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1829",className:"absolute inset-y-0 right-0 bg-gradient-to-l from-green-600/40 to-green-500/20",style:{width:`${100-S}%`}}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1830",className:`absolute top-0 h-full w-1 transition-all duration-500 ${_.isProfit?"bg-green-400 shadow-[0_0_6px_rgba(74,222,128,0.6)]":"bg-red-400 shadow-[0_0_6px_rgba(248,113,113,0.6)]"}`,style:{left:`${v}%`,transform:"translateX(-50%)"}})]}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1832",className:"absolute -top-0.5 w-0.5 h-3.5 bg-gray-400/60",style:{left:`${S}%`,transform:"translateX(-50%)"}})]})})(),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1836",className:"flex items-center justify-between",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1837",className:`text-[10px] font-medium ${_.isProfit?"text-green-400":"text-red-400"}`,children:[_.isProfit?"+":"",_.currentPL.toLocaleString()," ฿"]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1840",className:"text-[9px] text-gray-500",children:["เหลืออีก ",_.remainingToTarget>
190?_.remainingToTarget.toLocaleString():"0"," ถึงเป้า"]})]})]}),ie&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1846",className:`flex items-center gap-2 p-1.5 rounded-lg border ${ie.bg}`,children:[e.jsx(_t,{"data-loc":"client/src/pages/PlayPage.tsx:1847",className:`w-3 h-3 shrink-0 ${ie.color}`}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1848",className:"flex-1",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1849",className:"flex items-center justify-between",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1850",className:`text-[9px] font-bold ${ie.color}`,children:["ความเสี่ยง: ",ie.label]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1851",className:"text-[8px] text-gray-500",children:["Step ",C.currentStep,"/4"]})]}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1853",className:"h-1 rounded-full bg-gray-800 overflow-hidden mt-0.5",children:e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1854",className:`h-full rounded-full transition-all duration-500 ${ie.barColor}`,style:{width:`${ie.pct}%`}})})]})]}),C.totalRounds>0&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1862",className:"flex items-center gap-2 text-[9px] text-gray-500",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1863",children:["W:",C.totalWins]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1864",className:"flex-1 h-1.5 rounded-full bg-white/5 overflow-hidden flex",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1865",className:"h-full bg-green-500",style:{width:`${C.totalWins/C.totalRounds*100}%`}}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1866",className:"h-full bg-red-500",style:{width:`${C.totalLosses/C.totalRounds*100}%`}})]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1868",children:["L:",C.totalLosses]})]}),Pe&&Pe.length>1&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1874",className:"flex items-center gap-1.5",children:[e.jsx(rt,{"data-loc":"client/src/pages/PlayPage.tsx:1875",className:"w-3 h-3 text-gray-500 shrink-0"}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1876",className:"flex-1 h-5 flex items-end gap-[1px]",children:(()=>{const c=Pe.slice(-20).map(S=>parseFloat(S.bankrollAfter)),y=Math.min(...c),v=Math.max(...c)-y||1;return c.map((S,W)=>{const z=(S-y)/v*100,O=W>0?c[W-1]:S;return e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1886",className:`flex-1 rounded-t-[1px] ${S>=O?"bg-green-500/50":"bg-red-500/50"}`,style:{height:`${Math.max(8,z)}%`}},W)})})()})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1895",className:"flex items-center gap-2",children:[e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1896",onClick:()=>j(!0),className:"flex-1 py-1.5 rounded-lg bg-cyan-500/5 border border-cyan-500/15 text-[10px] text-cyan-300/70 hover:bg-cyan-500/10 hover:border-cyan-500/25 transition-all flex items-center justify-center gap-1",children:[e.jsx(Ft,{"data-loc":"client/src/pages/PlayPage.tsx:1897",className:"w-3 h-3"})," ประวัติ"]}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1899",onClick:Vs,className:"flex-1 py-1.5 rounded-lg bg-cyan-500/5 border border-cyan-500/15 text-[10px] text-cyan-300/70 hover:bg-cyan-500/10 hover:border-cyan-500/25 transition-all",children:"จบเซสชันทุน"})]})]})]}),e.jsx(He,{"data-loc":"client/src/pages/PlayPage.tsx:1911",open:!!se,onOpenChange:c=>{c||he(null)},children:e.jsxs(Ge,{"data-loc":"client/src/pages/PlayPage.tsx:1912",className:"bg-[#0A0F1A] border-cyan-500/20 max-w-[280px]",children:[e.jsx(lt,{"data-loc":"client/src/pages/PlayPage.tsx:1913",children:e.jsx(ct,{"data-loc":"client/src/pages/PlayPage.tsx:1914",className:"text-white text-center text-sm",children:"ยืนยันบันทึกผล"})}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1916",className:"flex flex-col items-center gap-4 pt-2",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1917",className:`w-16 h-16 rounded-full flex items-center justify-center text-2xl font-black text-white ${se==="banker"?"bg-gradient-to-br from-red-500 to-red-700 shadow-[0_0_20px_rgba(239,68,68,0.5)]":se==="player"?"bg-gradient-to-br from-blue-400 to-blue-700 shadow-[0_0_20px_rgba(59,130,246,0.5)]":"bg-gradient-to-br from-green-400 to-green-700 shadow-[0_0_20px_rgba(34,197,94,0.5)]"}`,children:se==="banker"?"B":se==="player"?"P":"T"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1924",className:"text-sm text-gray-300",children:se==="banker"?"เจ้ามือ (Banker)":se==="player"?"ผู้เล่น (Player)":"เสมอ (Tie)"}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1927",className:"grid grid-cols-2 gap-2 w-full",children:[e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1928",onClick:()=>he(null),className:"py-2.5 rounded-lg border border-gray-600 text-gray-300 text-sm hover:bg-gray-800 transition-colors",children:"ยกเลิก"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:1934",onClick:()=>{Ws(se),he(null)},className:"py-2.5 rounded-lg bg-gradient-to-r from-cyan-500 to-blue-600 text-white text-sm font-medium shadow-[0_0_15px_rgba(0,200,255,0.2)] hover:shadow-[0_0_25px_rgba(0,200,255,0.3)] transition-all",children:"ยืนยัน"})]})]})]})}),!n&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1949",className:"session-welcome-container",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1951",className:"text-center mb-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1952",className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-cyan-500/10 border border-cyan-500/20 mb-3",children:[e.jsx(wa,{"data-loc":"client/src/pages/PlayPage.tsx:1953",className:"w-3 h-3 text-cyan-400"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1954",className:"text-[11px] text-cyan-300 font-medium",children:"พร้อมเริ่มเล่น"})]}),e.jsx("h3",{"data-loc":"client/src/pages/PlayPage.tsx:1956",className:"text-base font-bold text-white mb-1",children:"เลือกวิธีเริ่มต้น"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:1957",className:"text-[11px] text-gray-500",children:"สร้างเซสชันใหม่หรือเล่นต่อจากเดิม"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1961",className:"grid grid-cols-2 gap-3 mb-3",children:[e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1963",onClick:()=>r(!0),className:"session-action-card session-action-card--primary group",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1967",className:"session-action-card__icon session-action-card__icon--primary",children:e.jsx(bn,{"data-loc":"client/src/pages/PlayPage.tsx:1968",className:"w-5 h-5 text-cyan-300"})}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1970",className:"text-sm font-bold text-white mt-2",children:"เริ่มใหม่"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1971",className:"text-[10px] text-cyan-300/60 mt-0.5",children:"สร้างห้องเล่นใหม่"}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1972",className:"session-action-card__arrow",children:e.jsx(ht,{"data-loc":"client/src/pages/PlayPage.tsx:1973",className:"w-3.5 h-3.5 text-cyan-400/50 group-hover:text-cyan-300 transition-colors"})})]}),e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:1978",onClick:()=>i(!0),className:"session-action-card session-action-card--secondary group",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1982",className:"session-action-card__icon session-action-card__icon--secondary",children:e.jsx(Ma,{"data-loc":"client/src/pages/PlayPage.tsx:1983",className:"w-5 h-5 text-amber-300"})}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1985",className:"text-sm font-bold text-white mt-2",children:"เล่นต่อ"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:1986",className:"text-[10px] text-amber-300/60 mt-0.5",children:"โหลดเซสชันเดิม"}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:1987",className:"session-action-card__arrow",children:e.jsx(ht,{"data-loc":"client/src/pages/PlayPage.tsx:1988",className:"w-3.5 h-3.5 text-amber-400/50 group-hover:text-amber-300 transition-colors"})})]})]}),ye&&ye.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1995",className:"session-recent-list",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:1996",className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:1997",className:"text-[11px] text-gray-400 font-medium flex items-center gap-1.5",children:[e.jsx(wn,{"data-loc":"client/src/pages/PlayPage.tsx:1998",className:"w-3 h-3"}),"เซสชันล่าสุด"]}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:2001",className:"text-[10px] text-cyan-400/60",children:[ye.length," รายการ"]})]}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2003",className:"space-y-1.5",children:ye.slice(0,3).map(c=>e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:2005",onClick:()=>{s(c.id)},className:"session-recent-item group",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2010",className:"flex items-center gap-2.5 flex-1 min-w-0",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2011",className:"w-7 h-7 rounded-lg bg-gradient-to-br from-cyan-500/20 to-blue-500/20 border border-cyan-500/20 flex items-center justify-center shrink-0",children:e.jsx(sn,{"data-loc":"client/src/pages/PlayPage.tsx:2012",className:"w-3.5 h-3.5 text-cyan-400"})}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2014",className:"flex-1 min-w-0 text-left",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2015",className:"text-xs font-medium text-white truncate",children:c.name}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:2016",className:"text-[10px] text-gray-500",children:[c.totalRounds," ตา"]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2019",className:"flex items-center gap-1",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2020",className:"text-[9px] text-gray-600",children:new Date(c.updatedAt||c.createdAt).toLocaleDateString("th-TH",{day:"numeric",month:"short"})}),e.jsx(ht,{"data-loc":"client/src/pages/PlayPage.tsx:2023",className:"w-3 h-3 text-gray-600 group-hover:text-cyan-400 transition-colors"})]})]},c.id))}),ye.length>3&&e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:2029",onClick:()=>i(!0),className:"w-full mt-2 py-1.5 text-[10px] text-cyan-400/70 hover:text-cyan-300 transition-colors",children:["ดูทั้งหมด (",ye.length,")"]})]})]}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2042",className:"flex justify-end",children:e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:2043",onClick:()=>{const c=nn();wt(c),F.info(c?"เปิดเสียง":"ปิดเสียง",{duration:1e3})},className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-black/40 border border-cyan-500/10 text-[10px] text-gray-400 hover:text-cyan-300 hover:border-cyan-500/25 transition-all",children:[Le?e.jsx(jn,{"data-loc":"client/src/pages/PlayPage.tsx:2047",className:"w-3 h-3"}):e.jsx(Nn,{"data-loc":"client/src/pages/PlayPage.tsx:2047",className:"w-3 h-3"}),Le?"เสียงเปิด":"เสียงปิด"]})}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2053",className:"rounded-lg border border-cyan-500/10 bg-cyan-500/5 p-2",children:e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2054",className:"text-[10px] text-cyan-400/40 text-center",children:"สูตรนี้เป็นเพียงการวิเคราะห์ทางสถิติเพื่อความบันเทิงเท่านั้น ไม่ใช่คำแนะนำทางการเงิน ไม่สามารถรับประกันผลลัพธ์ได้"})}),e.jsx(He,{"data-loc":"client/src/pages/PlayPage.tsx:2060",open:Fs,onOpenChange:Ve,children:e.jsx(Ge,{"data-loc":"client/src/pages/PlayPage.tsx:2061",className:"bg-[#0A0F1A] border-red-500/30 max-w-[300px]",children:e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2062",className:"flex flex-col items-center gap-4 py-4",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2063",className:"w-16 h-16 rounded-full bg-red-500/10 border border-red-500/30 flex items-center justify-center",children:e.jsx($t,{"data-loc":"client/src/pages/PlayPage.tsx:2064",className:"w-8 h-8 text-red-400"})}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2066",className:"text-center space-y-1",children:[e.jsx("h3",{"data-loc":"client/src/pages/PlayPage.tsx:2067",className:"text-lg font-bold text-white",children:"Point ไม่เพียงพอ"}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:2068",className:"text-sm text-gray-400",children:["เหลือ ",e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2068",className:"text-red-400 font-bold",children:Ee?.balance??"0"})," / ต้องการ ",e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2068",className:"text-cyan-400 font-bold",children:"5.00"})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2070",className:"flex flex-col gap-2 w-full",children:[e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:2071",onClick:()=>{Ve(!1),Ue("/credits")},className:"w-full py-3 rounded-xl bg-gradient-to-r from-orange-500 to-amber-500 text-white font-bold text-sm shadow-[0_0_20px_rgba(245,158,11,0.3)] hover:shadow-[0_0_30px_rgba(245,158,11,0.4)] transition-all active:scale-[0.97]",children:"เติม Point"}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:2077",onClick:()=>Ve(!1),className:"w-full py-2.5 rounded-xl border border-gray-600 text-gray-400 text-sm hover:bg-gray-800 transition-colors",children:"ปิด"})]})]})})}),e.jsx(va,{"data-loc":"client/src/pages/PlayPage.tsx:2089",open:we,onOpenChange:$e,children:e.jsxs(Ca,{"data-loc":"client/src/pages/PlayPage.tsx:2090",className:"bg-[#0A0F1A] border-red-500/20 max-w-[300px]",children:[e.jsxs(Sa,{"data-loc":"client/src/pages/PlayPage.tsx:2091",children:[e.jsxs(ka,{"data-loc":"client/src/pages/PlayPage.tsx:2092",className:"text-white text-center text-sm flex items-center justify-center gap-2",children:[e.jsx(_a,{"data-loc":"client/src/pages/PlayPage.tsx:2093",className:"w-4 h-4 text-red-400"}),"ยืนยันลบตาล่าสุด"]}),e.jsx(Ea,{"data-loc":"client/src/pages/PlayPage.tsx:2096",className:"text-center text-gray-400 text-xs",children:V.length>0&&e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:2098",className:"flex items-center justify-center gap-2 mt-2",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2099",children:"ตาล่าสุดคือ:"}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2100",className:`inline-flex items-center justify-center w-6 h-6 rounded-full text-[10px] font-bold text-white ${V[V.length-1]?.result==="banker"?"bg-red-500":V[V.length-1]?.result==="player"?"bg-blue-500":"bg-green-500"}`,children:V[V.length-1]?.result==="banker"?"B":V[V.length-1]?.result==="player"?"P":"T"}),e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:2106",children:["(เหลือ ",dt-pe-1," ครั้ง)"]})]})})]}),e.jsxs(Aa,{"data-loc":"client/src/pages/PlayPage.tsx:2111",className:"flex gap-2 sm:justify-center",children:[e.jsx(Ta,{"data-loc":"client/src/pages/PlayPage.tsx:2112",className:"flex-1 border-gray-600 text-gray-300 hover:bg-gray-800 bg-transparent",children:"ยกเลิก"}),e.jsx(Ra,{"data-loc":"client/src/pages/PlayPage.tsx:2115",onClick:()=>{n&&Ts.mutate({sessionId:n})},className:"flex-1 bg-red-500 hover:bg-red-600 text-white border-0",children:"ลบเลย"})]})]})}),e.jsx(He,{"data-loc":"client/src/pages/PlayPage.tsx:2130",open:Cs,onOpenChange:c=>{Ye(c),c||jt(!1)},children:e.jsxs(Ge,{"data-loc":"client/src/pages/PlayPage.tsx:2131",className:"bg-[#
190A0F1A] border-cyan-500/20 max-w-[340px]",children:[e.jsx(lt,{"data-loc":"client/src/pages/PlayPage.tsx:2132",children:e.jsxs(ct,{"data-loc":"client/src/pages/PlayPage.tsx:2133",className:"text-white text-center flex items-center justify-center gap-2",children:[e.jsx(ja,{"data-loc":"client/src/pages/PlayPage.tsx:2134",className:"w-5 h-5 text-cyan-400"}),"สรุปเซสชัน"]})}),C&&_&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2139",className:"space-y-3 pt-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2141",className:`text-center p-4 rounded-xl border ${_.isProfit?"bg-green-500/10 border-green-500/30":"bg-red-500/10 border-red-500/30"}`,children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2144",className:"text-[10px] text-gray-400 mb-1",children:"กำไร/ขาดทุน"}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:2145",className:`text-2xl font-black ${_.isProfit?"text-green-400":"text-red-400"}`,children:[_.isProfit?"+":"",_.currentPL.toLocaleString()," ฿"]}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:2148",className:`text-xs ${_.isProfit?"text-green-400/70":"text-red-400/70"}`,children:["(",_.isProfit?"+":"",_.plPercent.toFixed(1),"%)"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2153",className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2154",className:"p-2.5 rounded-lg bg-black/40 border border-white/5 text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2155",className:"text-[9px] text-gray-500",children:"ทุนเริ่ม"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2156",className:"text-sm font-bold text-white",children:_.starting.toLocaleString()})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2158",className:"p-2.5 rounded-lg bg-black/40 border border-white/5 text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2159",className:"text-[9px] text-gray-500",children:"ทุนสุดท้าย"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2160",className:"text-sm font-bold text-white",children:_.current.toLocaleString()})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2162",className:"p-2.5 rounded-lg bg-black/40 border border-white/5 text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2163",className:"text-[9px] text-gray-500",children:"จำนวนตา"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2164",className:"text-sm font-bold text-white",children:C.totalRounds})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2166",className:"p-2.5 rounded-lg bg-black/40 border border-white/5 text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2167",className:"text-[9px] text-gray-500",children:"Win Rate"}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:2168",className:"text-sm font-bold text-white",children:[C.totalRounds>0?(C.totalWins/C.totalRounds*100).toFixed(1):0,"%"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2172",className:"p-2.5 rounded-lg bg-black/40 border border-white/5 text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2173",className:"text-[9px] text-gray-500",children:"ชนะ"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2174",className:"text-sm font-bold text-green-400",children:C.totalWins})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2176",className:"p-2.5 rounded-lg bg-black/40 border border-white/5 text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2177",className:"text-[9px] text-gray-500",children:"แพ้"}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2178",className:"text-sm font-bold text-red-400",children:C.totalLosses})]})]}),Pe&&Pe.length>1&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2183",className:"p-2 rounded-lg bg-black/40 border border-white/5",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2184",className:"text-[9px] text-gray-500 mb-1",children:"กราฟทุน"}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2185",className:"h-16 flex items-end gap-[2px]",children:(()=>{const c=Pe.map(S=>parseFloat(S.bankrollAfter)),y=Math.min(...c),v=Math.max(...c)-y||1;return c.map((S,W)=>{const z=(S-y)/v*100,O=W===c.length-1,de=W>0?c[W-1]:S,ve=S>=de;return e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2197",className:`flex-1 rounded-t-sm transition-all ${O?ve?"bg-green-400":"bg-red-400":ve?"bg-green-500/40":"bg-red-500/40"}`,style:{height:`${Math.max(4,z)}%`}},W)})})()})]}),Ss?e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2234",className:"pt-1 space-y-2",children:e.jsx(js,{"data-loc":"client/src/pages/PlayPage.tsx:2235",stats:{profitAmount:_.currentPL,isProfit:_.isProfit,plPercent:_.plPercent,winRate:C.totalRounds>0?C.totalWins/C.totalRounds*100:0,totalRounds:C.totalRounds,wins:C.totalWins,losses:C.totalLosses,playTimeSeconds:De,tableName:C.tableName,startingCapital:_.starting,endingCapital:_.current},title:"สรุปเซสชัน",onClose:()=>jt(!1)})}):e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2212",className:"flex gap-2 pt-1",children:[e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:2213",onClick:()=>Ye(!1),className:"flex-1 py-2.5 rounded-xl border border-gray-600 text-gray-300 text-sm hover:bg-gray-800 transition-colors",children:"เล่นต่อ"}),e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:2219",onClick:()=>
19jt(!0),className:"py-2.5 px-4 rounded-xl bg-gradient-to-r from-purple-500 to-pink-500 text-white text-sm font-bold hover:opacity-90 transition-all flex items-center gap-1",children:[e.jsx("svg",{"data-loc":"client/src/pages/PlayPage.tsx:2223",className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/pages/PlayPage.tsx:2223",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),"แชร์"]}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:2226",onClick:zs,className:"flex-1 py-2.5 rounded-xl bg-red-500 text-white text-sm font-bold hover:bg-red-600 transition-colors",children:"จบเซสชัน"})]})]})]})}),e.jsx(va,{"data-loc":"client/src/pages/PlayPage.tsx:2260",open:ks,onOpenChange:xt,children:e.jsxs(Ca,{"data-loc":"client/src/pages/PlayPage.tsx:2261",className:"bg-[#0A0F1A] border-red-500/30 max-w-[320px]",children:[e.jsxs(Sa,{"data-loc":"client/src/pages/PlayPage.tsx:2262",children:[e.jsx(ka,{"data-loc":"client/src/pages/PlayPage.tsx:2263",className:"text-center",children:e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2264",className:"flex flex-col items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2265",className:"w-16 h-16 rounded-full bg-red-500/10 border-2 border-red-500/50 flex items-center justify-center animate-pulse",children:e.jsx(_t,{"data-loc":"client/src/pages/PlayPage.tsx:2266",className:"w-8 h-8 text-red-400"})}),e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2268",className:"text-red-400 text-lg font-black",children:"ถึงจุดตัดขาดทุน!"})]})}),e.jsxs(Ea,{"data-loc":"client/src/pages/PlayPage.tsx:2271",className:"text-center space-y-2",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2272",className:"text-gray-400 text-sm",children:"ทุนลดลงถึงจุดตัดขาดทุนที่ตั้งไว้แล้ว"}),_&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2276",className:"p-3 rounded-lg bg-red-500/10 border border-red-500/20",children:[e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:2277",className:"text-red-400 text-lg font-black",children:[_.currentPL.toLocaleString()," ฿"]}),e.jsxs("p",{"data-loc":"client/src/pages/PlayPage.tsx:2280",className:"text-[10px] text-gray-500",children:["เหลือ ",_.current.toLocaleString()," จาก ",_.starting.toLocaleString()]})]}),e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2285",className:"text-yellow-400/80 text-xs font-medium",children:"แนะนำ: หยุดพักแล้วกลับมาใหม่วันหน้า"})]})]}),e.jsxs(Aa,{"data-loc":"client/src/pages/PlayPage.tsx:2290",className:"flex gap-2 sm:justify-center pt-2",children:[e.jsx(Ta,{"data-loc":"client/src/pages/PlayPage.tsx:2291",onClick:()=>{pa(!0),xt(!1)},className:"flex-1 border-gray-600 text-gray-300 hover:bg-gray-800 bg-transparent text-sm",children:"เล่นต่อ"}),e.jsx(Ra,{"data-loc":"client/src/pages/PlayPage.tsx:2300",onClick:()=>{pa(!0),xt(!1),Ye(!0)},className:"flex-1 bg-red-500 hover:bg-red-600 text-white border-0 text-sm font-bold",children:"จบเซสชัน"})]})]})}),e.jsx(He,{"data-loc":"client/src/pages/PlayPage.tsx:2315",open:d,onOpenChange:h,children:e.jsxs(Ge,{"data-loc":"client/src/pages/PlayPage.tsx:2316",className:"bg-[#0A0F1A] border-cyan-500/20 max-h-[80vh] overflow-y-auto",children:[e.jsx(lt,{"data-loc":"client/src/pages/PlayPage.tsx:2317",children:e.jsxs(ct,{"data-loc":"client/src/pages/PlayPage.tsx:2318",className:"text-white flex items-center gap-2",children:[e.jsx(yt,{"data-loc":"client/src/pages/PlayPage.tsx:2319",className:"w-5 h-5 text-cyan-400"}),"ตั้งค่าเงินทุน"]})}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2323",className:"space-y-4 pt-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2324",children:[e.jsx("label",{"data-loc":"client/src/pages/PlayPage.tsx:2325",className:"text-xs text-gray-400 mb-1 block",children:"ชื่อห้อง/
19โต๊ะ"}),e.jsx("input",{"data-loc":"client/src/pages/PlayPage.tsx:2326",type:"text",value:A,onChange:c=>m(c.target.value),placeholder:"เช่น SA Gaming A1, โต๊ะ VIP 3",className:"w-full px-3 py-2.5 rounded-lg bg-black/60 border border-cyan-500/15 text-white text-sm placeholder:text-gray-600 focus:border-cyan-500/50 focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2334",children:[e.jsx("label",{"data-loc":"client/src/pages/PlayPage.tsx:2335",className:"text-xs text-gray-400 mb-1 block",children:"ทุนเริ่มต้น (บาท)"}),e.jsx("input",{"data-loc":"client/src/pages/PlayPage.tsx:2336",type:"number",value:f,onChange:c=>E(c.target.value),placeholder:"เช่น 10000",className:"w-full px-3 py-2.5 rounded-lg bg-black/60 border border-cyan-500/15 text-white text-sm placeholder:text-gray-600 focus:border-cyan-500/50 focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2344",children:[e.jsx("label",{"data-loc":"client/src/pages/PlayPage.tsx:2345",className:"text-xs text-gray-400 mb-1 block",children:"เป้าหมายกำไร (%)"}),e.jsx("div",{"data-loc":"client/src/pages/PlayPage.tsx:2346",className:"grid grid-cols-4 gap-1.5",children:[20,50,100,200].map(c=>e.jsxs("button",{"data-loc":"client/src/pages/PlayPage.tsx:2348",onClick:()=>q(c),className:`px-2 py-1.5 rounded-lg text-xs font-medium transition-all ${L===c?"bg-cyan-500 text-black shadow-[0_0_10px_rgba(0,200,255,0.3)]":"bg-black/40 border border-cyan-500/15 text-gray-300 hover:border-cyan-500/30"}`,children:[c,"%"]},c))})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2360",children:[e.jsx("label",{"data-loc":"client/src/pages/PlayPage.tsx:2361",className:"text-xs text-gray-400 mb-1 block",children:"จุดตัดขาดทุน (%)"}),e.jsx("input",{"data-loc":"client/src/pages/PlayPage.tsx:2362",type:"number",value:R,onChange:c=>U(c.target.value),placeholder:"เช่น 50",className:"w-full px-3 py-2.5 rounded-lg bg-black/60 border border-cyan-500/15 text-white text-sm placeholder:text-gray-600 focus:border-cyan-500/50 focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2370",children:[e.jsx("label",{"data-loc":"client/src/pages/PlayPage.tsx:2371",className:"text-xs text-gray-400 mb-1 block",children:"% เดิมพันเริ่มต้น (Step 1)"}),e.jsx("input",{"data-loc":"client/src/pages/PlayPage.tsx:2372",type:"number",value:I,onChange:c=>k(c.target.value),placeholder:"10",className:"w-full px-3 py-2.5 rounded-lg bg-black/60 border border-cyan-500/15 text-white text-sm placeholder:text-gray-600 focus:border-cyan-500/50 focus:outline-none"})]}),parseFloat(f)>0&&e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2383",className:"p-3 rounded-xl bg-black/60 border border-cyan-500/20 space-y-1.5",children:[e.jsx("p",{"data-loc":"client/src/pages/PlayPage.tsx:2384",className:"text-xs text-cyan-400 font-medium",children:"สรุป"}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2385",className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2386",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2386",className:"text-gray-500",children:"ทุน:"})," ",e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:2386",className:"text-white",children:[parseFloat(f).toLocaleString()," ฿"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2387",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2387",className:"text-gray-500",children:"เป้า:"})," ",e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:2387",className:"text-green-400",children:["+",(parseFloat(f)*L/100).toLocaleString()," ฿"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2388",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2388",className:"text-gray-500",children:"ตัดขาดทุน:"})," ",e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:2388",className:"text-red-400",children:["-",(parseFloat(f)*(parseFloat(R)||0)/100).toLocaleStr
19ing()," ฿"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PlayPage.tsx:2389",children:[e.jsx("span",{"data-loc":"client/src/pages/PlayPage.tsx:2389",className:"text-gray-500",children:"เดิมพัน Step 1:"})," ",e.jsxs("span",{"data-loc":"client/src/pages/PlayPage.tsx:2389",className:"text-amber-400",children:[(parseFloat(f)*(parseFloat(I)||10)/100).toLocaleString()," ฿"]})]})]})]}),e.jsx("button",{"data-loc":"client/src/pages/PlayPage.tsx:2394",onClick:Us,disabled:kt.isPending,className:"w-full py-3 rounded-xl bg-gradient-to-r from-cyan-500 to-blue-600 text-white font-bold text-sm shadow-[0_0_20px_rgba(0,200,255,0.2)] hover:shadow-[0_0_30px_rgba(0,200,255,0.3)] transition-all disabled:opacity-50",children:kt.isPending?"กำลังสร้าง...":"เริ่มคำนวณเงินทุน"})]})]})})]})}export{Vr 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.