@vqh2602/mini-app-sdk 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -9,7 +9,7 @@ const program = new Command();
9
9
  program
10
10
  .name('miniapp')
11
11
  .description('SuperApp Mini App Developer CLI: Create, Dev, Build, and Upload')
12
- .version('1.0.2');
12
+ .version('1.0.3');
13
13
  program
14
14
  .command('create <project-name>')
15
15
  .description('Khởi tạo một dự án Mini App mới từ mẫu chuẩn SuperApp')
@@ -9,7 +9,7 @@ import { MediaModule } from './modules/media.js';
9
9
  import { LifecycleModule } from './modules/lifecycle.js';
10
10
  import { AuthLoginOptions, AuthLoginResult, ConfigAppViewOptions, KeepScreenOptions, MinimizeAppResult, NotificationResult, RequestSendNotificationOptions, SDKInitOptions, SetNavigationBarColorOptions, ToastOptions, UserProfile } from './types/index.js';
11
11
  export declare class SuperAppSDK {
12
- readonly version = "1.0.2";
12
+ readonly version = "1.0.3";
13
13
  readonly transport: ITransport;
14
14
  readonly mockEngine?: SDKMockEngine;
15
15
  readonly auth: AuthModule;
@@ -8,7 +8,7 @@ import { NavigationModule } from './modules/navigation.js';
8
8
  import { MediaModule } from './modules/media.js';
9
9
  import { LifecycleModule } from './modules/lifecycle.js';
10
10
  export class SuperAppSDK {
11
- version = '1.0.2';
11
+ version = '1.0.3';
12
12
  transport;
13
13
  mockEngine;
14
14
  // Domain modules
@@ -1 +1 @@
1
- {"version":3,"file":"mock-engine.d.ts","sourceRoot":"","sources":["../../src/mock/mock-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,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C,SAAgB,OAAO,EAAE,kBAAkB,CAAC;IAE5C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,IAAI,CAAsB;gBAEtB,OAAO,GAAE,iBAAsB;IAYpC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI5B,KAAK,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,IAAI;IAKxC,OAAO,IAAI,YAAY,EAAE;IAIzB,SAAS,IAAI,IAAI;IAIX,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IA6DtE,OAAO,CAAC,SAAS;YAcH,WAAW;CAwO1B"}
@@ -212,14 +212,20 @@ export class SDKMockEngine {
212
212
  case 'storage.getItem':
213
213
  case 'getStorage':
214
214
  case 'storage.getSecureItem':
215
+ case 'storage.getSecretData':
216
+ case 'getSecretData':
215
217
  return this.storage.getItem(appId, p);
216
218
  case 'storage.setItem':
217
219
  case 'setStorage':
218
220
  case 'storage.setSecureItem':
221
+ case 'storage.setSecretData':
222
+ case 'setSecretData':
219
223
  return this.storage.setItem(appId, p);
220
224
  case 'storage.removeItem':
221
225
  case 'removeStorage':
222
226
  case 'storage.removeSecureItem':
227
+ case 'storage.removeSecretData':
228
+ case 'removeSecretData':
223
229
  return this.storage.removeItem(appId, p);
224
230
  case 'storage.clear':
225
231
  case 'clearStorage':
@@ -1 +1 @@
1
- {"version":3,"file":"mock-engine.js","sourceRoot":"","sources":["../../src/mock/mock-engine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC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wCAAwC;gBACxC,OAAO,CAAC,IAAI,CAAC,2BAA2B,MAAM,wDAAwD,CAAC,CAAC;gBACxG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;QACjD,CAAC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vqh2602/mini-app-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Official Unified TypeScript SDK & CLI for SuperApp Mini Apps: Core API, Bridge Transport, Mock Engine, and Browser Simulator",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,7 +41,13 @@
41
41
  "build:sim": "vite build simulator",
42
42
  "build:ts": "tsc",
43
43
  "build": "npm run build:sim && npm run build:ts && chmod +x ./bin/*.js",
44
- "prepublishOnly": "npm run build",
44
+ "bump": "node ../scripts/bump-version.cjs patch",
45
+ "bump:minor": "node ../scripts/bump-version.cjs minor",
46
+ "bump:major": "node ../scripts/bump-version.cjs major",
47
+ "release": "node ../scripts/bump-version.cjs patch && npm publish --access public",
48
+ "release:minor": "node ../scripts/bump-version.cjs minor && npm publish --access public",
49
+ "release:major": "node ../scripts/bump-version.cjs major && npm publish --access public",
50
+ "prepublishOnly": "node ../scripts/bump-version.cjs check-publish && npm run build",
45
51
  "simulator": "node ./bin/simulator.js",
46
52
  "clean": "rm -rf dist simulator-dist"
47
53
  },
@@ -196,4 +196,4 @@ Error generating stack: `+o.message+`
196
196
 
197
197
  ${t.message}`),{confirmed:!0}}async showConfirm(t){let n=!0;return typeof window<"u"&&typeof window.confirm=="function"&&(n=window.confirm(`${t.title}
198
198
 
199
- ${t.message}`)),{confirmed:n}}async setNavigationBarTitle(t){return typeof document<"u"&&(document.title=t.title),{success:!0,title:t.title}}async setStatusBarColor(t){return{success:!0,color:t.color}}async setNavigationBarColor(t){return{success:!0,color:t.color,textColor:t.textColor||"black",statusBarColor:t.statusBarColor}}async configAppView(t={}){return{success:!0,actionBarHidden:!!t.actionBarHidden,statusBar:t.statusBar||"transparent",hideAndroidBottomNavigationBar:!!t.hideAndroidBottomNavigationBar,hasPadding:t.hasPadding!==!1,...t}}async requestSendNotification(t={}){return{success:!0,granted:!0,subscriptionId:`mock_sub_${Date.now()}`,token:`mock_notif_token_${Date.now()}`,templateId:t.templateId,reason:t.reason}}}class kp{async scanQRCode(t={}){return{content:"https://superapp.vn/pay?order=mock_qr_12345",format:"QR_CODE"}}async chooseImage(t={}){const n=t.count||1,r=["https://images.unsplash.com/photo-1546069901-ba9599a7e63c?w=500","https://images.unsplash.com/photo-1565299624946-b28f40a0ae38?w=500"];return{tempFilePaths:r.slice(0,n),count:Math.min(n,r.length)}}}class wp{constructor(t){J(this,"approvalHook");this.store=t}setApprovalHook(t){this.approvalHook=t}async requestPayment(t){const n=Number(t.amount)||0,r=t.orderId||`ORD_${Date.now()}_${Math.floor(1e3+Math.random()*9e3)}`,l={orderId:r,amount:n,description:t.description||"Thanh toán dịch vụ Mini App",extraData:{currency:t.currency||"VND"}};if(this.approvalHook&&!await this.approvalHook(l))throw{code:"USER_CANCELLED",message:"Người dùng đã huỷ giao dịch thanh toán"};const o=this.store.getUser();if(o.walletBalance<n)throw{code:"INSUFFICIENT_FUNDS",message:`Số dư ví SuperApp Pay (${o.walletBalance.toLocaleString("vi-VN")} đ) không đủ để thanh toán ${n.toLocaleString("vi-VN")} đ`};this.store.deductBalance(n);const s={status:"SUCCESS",transactionId:`TXN_${Date.now()}_${Math.random().toString(36).substring(2,8).toUpperCase()}`,orderId:r,amount:n,timestamp:Date.now(),paymentMethod:"SUPERAPP_WALLET",message:"Thanh toán thành công qua Ví SuperApp"};return this.store.addTransaction(s),s}async createOrder(t){return{orderId:`ORD_${Date.now()}_${Math.floor(1e3+Math.random()*9e3)}`,amount:Number(t.amount)||0,currency:t.currency||"VND",status:"PENDING"}}}class Sp{constructor(t={}){J(this,"store");J(this,"auth");J(this,"device");J(this,"storage");J(this,"ui");J(this,"media");J(this,"payment");J(this,"latencyMs");J(this,"logListeners",new Set);J(this,"logs",[]);this.store=new gp(t.storageKeyPrefix),this.latencyMs=t.simulatedLatencyMs??40,this.auth=new mp(this.store),this.device=new yp(this.store),this.storage=new vp(this.store),this.ui=new xp,this.media=new kp,this.payment=new wp(this.store)}setLatency(t){this.latencyMs=t}onLog(t){return this.logListeners.add(t),()=>this.logListeners.delete(t)}getLogs(){return[...this.logs]}clearLogs(){this.logs=[]}async dispatch(t){const n=Date.now();this.latencyMs>0&&await new Promise(r=>setTimeout(r,this.latencyMs));try{const r=await this.routeAction(t),l=Date.now()-n,o={id:t.id,action:t.action,success:!0,data:r,timestamp:Date.now()};return this.recordLog({id:t.id,action:t.action,payload:t.payload,response:r,durationMs:l,timestamp:n,success:!0}),o}catch(r){const l=Date.now()-n,o={code:(r==null?void 0:r.code)||"ACTION_FAILED",message:(r==null?void 0:r.message)||"Operation failed in mock engine",details:r==null?void 0:r.details},i={id:t.id,action:t.action,success:!1,error:o,timestamp:Date.now()};return this.recordLog({id:t.id,action:t.action,payload:t.payload,error:o,durationMs:l,timestamp:n,success:!1}),i}}recordLog(t){this.logs.unshift(t),this.logs.length>200&&this.logs.pop(),this.logListeners.forEach(n=>{try{n(t)}catch(r){console.error("[SDKMockEngine] Error in log listener:",r)}})}async routeAction(t){var i;const{action:n,payload:r,appId:l}=t,o=r||{};switch(n){case"auth.login":case"login":return this.auth.login(o);case"auth.requestCode":return this.auth.requestCode(o);case"auth.exchangeCode":return this.auth.exchangeCode(o);case"auth.getAccessToken":case"getAccessToken":return this.auth.getAccessToken();case"auth.getUserProfile":case"getUserProfile":case"user.getProfile":return this.auth.getUserProfile();case"user.getBasicInfo":return this.auth.getBasicInfo();case"auth.refreshToken":return this.auth.refreshToken(o);case"auth.logout":return this.auth.logout();case"payment.requestPayment":case"payment.openCheckout":case"requestPayment":return this.payment.requestPayment(o);case"payment.createOrder":return this.payment.createOrder(o);case"device.getBatteryInfo":case"getBatteryInfo":return this.device.getBatteryInfo();case"device.getNetworkInfo":case"getNetworkInfo":return this.device.getNetworkInfo();case"device.getDeviceInfo":case"getDeviceInfo":return this.device.getDeviceInfo();case"device.getSystemInfo":case"getSystemInfo":return this.device.getSystemInfo();case"getAppInfo":return{appId:l||"mini_app",version:"1.0.0",platformVersion:"2.0.0",appName:"SuperApp Mini App"};case"device.getLocation":case"getLocation":return{latitude:21.028511,longitude:105.854167,accuracy:10,altitude:12,speed:0,address:"Hà Nội, Việt Nam"};case"getDeviceLanguage":return{language:this.store.getDeviceState().language||"vi-VN"};case"getSuperAppSettings":return{theme:"dark",notificationsEnabled:!0,language:"vi-VN",appVersion:"1.0.0"};case"device.vibrate":case"vibrate":return this.device.vibrate(o);case"device.keepScreen":case"keepScreen":return this.device.keepScreen(o);case"copyToClipboard":return{success:!0,text:o.text};case"setBrightness":return{success:!0,brightness:o.brightness};case"getContacts":return{contacts:[{id:"c_01",name:"Nguyễn Văn An",phone:"0988123456",email:"an.nguyen@example.com"},{id:"c_02",name:"Trần Thị Mai",phone:"0912345678",email:"mai.tran@example.com"}]};case"permission.request":case"permission.check":case"permission.getPermissions":return{granted:!0,capability:o.capability,permissions:{camera:"granted",location:"granted",notification:"granted",photos:"granted"}};case"storage.getItem":case"getStorage":case"storage.getSecureItem":return this.storage.getItem(l,o);case"storage.setItem":case"setStorage":case"storage.setSecureItem":return this.storage.setItem(l,o);case"storage.removeItem":case"removeStorage":case"storage.removeSecureItem":return this.storage.removeItem(l,o);case"storage.clear":case"clearStorage":return this.storage.clear(l);case"storage.getAll":return this.storage.getAll(l);case"storage.getCredentials":return{username:this.store.getUser().email,token:(i=this.store.getSession())==null?void 0:i.accessToken,role:this.store.getUser().role};case"storage.setCredentials":case"storage.deleteCredentials":return{success:!0};case"ui.showToast":case"showToast":return this.ui.showToast(o);case"ui.showAlert":case"showAlert":return this.ui.showAlert(o);case"ui.showConfirm":case"showConfirm":return this.ui.showConfirm(o);case"ui.setNavigationBarTitle":case"setTitle":case"setNavigationBarTitle":return this.ui.setNavigationBarTitle(o);case"ui.setStatusBarColor":case"setStatusBarColor":return this.ui.setStatusBarColor(o);case"ui.setNavigationBarColor":case"setNavigationBarColor":return this.ui.setNavigationBarColor(o);case"ui.configAppView":case"configAppView":return this.ui.configAppView(o);case"ui.requestSendNotification":case"requestSendNotification":return this.ui.requestSendNotification(o);case"showMiniappMenu":case"ui.showMiniappMenu":return{success:!0,message:"Menu triggered"};case"media.scanQRCode":case"scanQr":case"device.scanQRCode":return this.media.scanQRCode(o);case"media.chooseImage":case"getPhoto":case"device.pickImage":case"pickImages":return this.media.chooseImage(o);case"saveImageToGallery":case"saveVideoToGallery":case"pickVideo":case"saveFile":case"pickFile":case"filePreview":return{success:!0,uri:o.uri||"mock_file_uri_"+Date.now(),name:o.fileName||"demo_file.png"};case"navigation.closeApp":case"closeApp":case"navigation.close":return{success:!0,message:"App closed"};case"navigation.minimizeApp":case"minimizeApp":return{success:!0,status:"minimized",appId:l};case"navigation.openMiniApp":return{success:!0,targetAppId:o.appId};case"navigation.openNativePage":return{success:!0,page:o.page,params:o.params};case"openPhone":case"openSMS":case"openExternalBrowser":case"openDeepLink":return{success:!0};case"speechToText":return{success:!0,text:"Nội dung nhận diện giọng nói thử nghiệm",lang:o.lang||"vi-VN"};case"hideKeyboard":return{success:!0};case"debug.echo":return o;case"debug.simulateFailure":throw{code:o.type||"SIMULATED_FAILURE",message:"Mô phỏng lỗi debug từ Simulator"};default:return console.warn(`[SDKMockEngine] Action "${n}" not specifically handled. Returning generic success.`),{success:!0,action:n,payload:o}}}}const gc=M.createContext(null),Cp=({children:e})=>{const[t]=M.useState(()=>new Sp({autoApprovePayment:!0})),[n,r]=M.useState(()=>typeof window<"u"&&new URLSearchParams(window.location.search).get("url")||"http://localhost:3000"),[l,o]=M.useState("iphone"),[i,s]=M.useState(1),[u,d]=M.useState([]),[g,m]=M.useState("bridge"),[h,k]=M.useState(!1),[w,S]=M.useState(1),[A,f]=M.useState(null),[c,p]=M.useState(()=>t.store.getUser()),[v,C]=M.useState(()=>t.store.getNetworkCondition()),[j,_]=M.useState(()=>t.store.getDeviceState()),z=M.useRef(null);M.useEffect(()=>{const F=t.onLog(y=>{d(P=>[y,...P.slice(0,150)])});return()=>{F()}},[t]),M.useEffect(()=>{h?t.payment.setApprovalHook(F=>new Promise(y=>{z.current=y,f({order:F,resolve:y})})):t.payment.setApprovalHook(void 0)},[t,h]),M.useEffect(()=>{const F=async y=>{const P=y.data;if(!P)return;if(P.type==="MINIAPP_CLOSE"||P.type==="MINIAPP_MINIMIZE"){t.onLog(Me=>d(nt=>[Me,...nt.slice(0,150)]));return}let I=null;if(P.type==="SUPERAPP_BRIDGE_REQUEST"&&P.request?I=P.request:P.id&&P.action&&(I=P),!I||!I.id||!I.action)return;const O=await t.dispatch(I);p(t.store.getUser()),_(t.store.getDeviceState());const Y={type:"SUPERAPP_BRIDGE_RESPONSE",response:O};y.source&&"postMessage"in y.source&&y.source.postMessage(Y,"*"),document.querySelectorAll("iframe").forEach(Me=>{var nt;(nt=Me.contentWindow)==null||nt.postMessage(Y,"*")})};return window.addEventListener("message",F),()=>window.removeEventListener("message",F)},[t]);const W=F=>{z.current&&(z.current(F),z.current=null),f(null)},N=F=>{const y=t.store.setUser(F);p(y),Te("session.changed",{user:y,status:"LOGGED_IN"}),Te("auth.userChanged",{user:y}),Te("auth.sessionChanged",{state:"logged_in",user:y,userId:y.id})},ve=F=>{const y=t.store.setUserPreset(F);p(y),Te("session.changed",{user:y,status:"LOGGED_IN"}),Te("auth.userChanged",{user:y}),Te("auth.sessionChanged",{state:"logged_in",user:y,userId:y.id})},Ct=F=>{t.store.setNetworkCondition(F);const y=t.store.getNetworkCondition();C(y),Te("miniapp.networkChanged",{isConnected:y.online,networkType:y.type})},Et=F=>{t.store.updateDeviceState(F);const y=t.store.getDeviceState();_(y),Te("miniapp.batteryChanged",{batteryLevel:y.batteryLevel,isCharging:y.isCharging})},sr=()=>{S(F=>F+1)},Te=(F,y)=>{document.querySelectorAll("iframe").forEach(I=>{var O;(O=I.contentWindow)==null||O.postMessage({type:"SUPERAPP_BRIDGE_EVENT",event:F,payload:y},"*")})},mn=()=>{t.clearLogs(),d([])};return a.jsx(gc.Provider,{value:{mockEngine:t,miniAppUrl:n,setMiniAppUrl:r,deviceType:l,setDeviceType:o,scale:i,setScale:s,logs:u,clearLogs:mn,activeTab:g,setActiveTab:m,user:c,setUser:N,setUserPreset:ve,network:v,setNetwork:Ct,deviceState:j,setDeviceState:Et,manualPaymentMode:h,setManualPaymentMode:k,pendingPayment:A,resolvePayment:W,reloadIframe:sr,iframeKey:w,sendEventToMiniApp:Te},children:e})},Qe=()=>{const e=M.useContext(gc);if(!e)throw new Error("useSimulator must be used inside SimulatorProvider");return e},Ep=()=>{const{deviceType:e,network:t,deviceState:n}=Qe(),[r,l]=M.useState("09:41");return M.useEffect(()=>{const o=()=>{const s=new Date;l(`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`)};o();const i=setInterval(o,1e4);return()=>clearInterval(i)},[]),a.jsxs("div",{style:{height:44,padding:"0 20px",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:"#ffffff",color:"#000000",fontSize:13,fontWeight:600,userSelect:"none",position:"relative",borderTopLeftRadius:e==="iphone"?44:28,borderTopRightRadius:e==="iphone"?44:28},children:[a.jsx("span",{children:r}),e==="iphone"?a.jsx("div",{style:{position:"absolute",top:10,left:"50%",transform:"translateX(-50%)",width:110,height:28,backgroundColor:"#000000",borderRadius:18,zIndex:10}}):a.jsx("div",{style:{position:"absolute",top:12,left:"50%",transform:"translateX(-50%)",width:14,height:14,backgroundColor:"#000000",borderRadius:"50%",zIndex:10}}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[t.online?a.jsx("span",{style:{fontSize:11,fontWeight:700},children:t.type.toUpperCase()}):a.jsx("span",{style:{fontSize:11,color:"#ef4444"},children:"OFFLINE"}),t.online?a.jsx(pc,{size:14}):a.jsx(pp,{size:14,color:"#ef4444"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[a.jsxs("span",{style:{fontSize:11},children:[n.batteryLevel,"%"]}),n.isCharging?a.jsx(ac,{size:16,color:"#10b981"}):a.jsx(qf,{size:16})]})]})]})},_p=({title:e="Mini App"})=>{const{reloadIframe:t,sendEventToMiniApp:n}=Qe();return a.jsxs("div",{style:{height:48,padding:"0 12px",backgroundColor:"#ffffff",borderBottom:"1px solid #e2e8f0",display:"flex",alignItems:"center",justifyContent:"space-between",color:"#0f172a"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.jsx("button",{onClick:()=>n("onNavigateBack",{}),title:"Back",style:{background:"none",border:"none",cursor:"pointer",padding:4,display:"flex",alignItems:"center"},children:a.jsx(Jf,{size:18,color:"#0f172a"})}),a.jsx("span",{style:{fontSize:15,fontWeight:600,maxWidth:160,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",backgroundColor:"#f1f5f9",border:"1px solid #cbd5e1",borderRadius:20,padding:"2px 6px",gap:6},children:[a.jsx("button",{onClick:t,title:"Tải lại Mini App",style:{background:"none",border:"none",cursor:"pointer",padding:2,display:"flex",alignItems:"center"},children:a.jsx(ap,{size:13,color:"#475569"})}),a.jsx("div",{style:{width:1,height:12,backgroundColor:"#cbd5e1"}}),a.jsx("button",{title:"Menu",style:{background:"none",border:"none",cursor:"pointer",padding:2,display:"flex",alignItems:"center"},children:a.jsx(rp,{size:14,color:"#475569"})}),a.jsx("div",{style:{width:1,height:12,backgroundColor:"#cbd5e1"}}),a.jsx("button",{onClick:()=>alert("Đóng Mini App - Trở về màn hình chính SuperApp"),title:"Đóng Mini App",style:{background:"none",border:"none",cursor:"pointer",padding:2,display:"flex",alignItems:"center"},children:a.jsx(hc,{size:14,color:"#475569"})})]})]})},jp=()=>{const{pendingPayment:e,resolvePayment:t,user:n}=Qe();if(!e)return null;const{order:r}=e,l=n.walletBalance>=r.amount;return a.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:100,animation:"fadeIn 0.2s ease"},children:a.jsxs("div",{style:{backgroundColor:"#ffffff",borderTopLeftRadius:24,borderTopRightRadius:24,padding:20,color:"#0f172a",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.15)"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(fc,{size:20,color:"#0068FF"}),a.jsx("span",{style:{fontWeight:700,fontSize:16},children:"SuperApp Pay"})]}),a.jsx("button",{onClick:()=>t(!1),style:{background:"none",border:"none",cursor:"pointer",padding:4},children:a.jsx(hc,{size:18,color:"#64748b"})})]}),a.jsxs("div",{style:{textAlign:"center",margin:"12px 0 20px"},children:[a.jsx("div",{style:{fontSize:13,color:"#64748b"},children:"Tổng tiền thanh toán"}),a.jsxs("div",{style:{fontSize:28,fontWeight:800,color:"#0068FF"},children:[r.amount.toLocaleString("vi-VN")," đ"]}),a.jsx("div",{style:{fontSize:13,fontWeight:500,color:"#334155",marginTop:4},children:r.description||"Thanh toán dịch vụ Mini App"})]}),a.jsx("div",{style:{backgroundColor:"#f8fafc",borderRadius:12,padding:12,marginBottom:20,border:"1px solid #e2e8f0"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[a.jsx("div",{style:{width:36,height:36,borderRadius:8,backgroundColor:"#dbeafe",display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsx(fp,{size:20,color:"#0068FF"})}),a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:600,fontSize:14},children:"Ví điện tử SuperApp"}),a.jsxs("div",{style:{fontSize:12,color:l?"#10b981":"#ef4444"},children:["Số dư: ",n.walletBalance.toLocaleString("vi-VN")," đ",!l&&" (Không đủ số dư)"]})]})]}),a.jsx(cc,{size:18,color:"#0068FF"})]})}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[a.jsx("button",{onClick:()=>t(!0),disabled:!l,style:{padding:"14px",backgroundColor:l?"#0068FF":"#94a3b8",color:"white",border:"none",borderRadius:12,fontWeight:700,fontSize:15,cursor:l?"pointer":"not-allowed"},children:"Xác nhận thanh toán"}),a.jsx("button",{onClick:()=>t(!1),style:{padding:"12px",backgroundColor:"transparent",color:"#64748b",border:"none",borderRadius:12,fontWeight:600,fontSize:14,cursor:"pointer"},children:"Huỷ giao dịch"})]})]})})},zp=()=>{const{deviceType:e,scale:t,miniAppUrl:n,iframeKey:r,sendEventToMiniApp:l,user:o}=Qe(),i=e==="iphone"?390:412,s=e==="iphone"?844:880;return a.jsx("div",{style:{transform:`scale(${t})`,transformOrigin:"top center",transition:"transform 0.2s ease"},children:a.jsx("div",{style:{width:i,height:s,backgroundColor:"#000000",borderRadius:e==="iphone"?52:36,padding:10,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.15)",position:"relative",display:"flex",flexDirection:"column"},children:a.jsxs("div",{style:{flex:1,backgroundColor:"#ffffff",borderRadius:e==="iphone"?44:28,overflow:"hidden",display:"flex",flexDirection:"column",position:"relative"},children:[a.jsx(Ep,{}),a.jsx(_p,{title:"SuperApp Mini App"}),a.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[a.jsx("iframe",{src:n,title:"Mini App Simulator View",style:{width:"100%",height:"100%",border:"none",backgroundColor:"#f8fafc"},allow:"geolocation; camera; microphone",onLoad:()=>{setTimeout(()=>{l("miniapp.ready",{appId:"mini_app",timestamp:Date.now()}),l("session.changed",{user:o,status:"LOGGED_IN"})},150)}},r),a.jsx(jp,{})]}),e==="iphone"&&a.jsx("div",{style:{height:20,backgroundColor:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsx("div",{style:{width:130,height:4,backgroundColor:"#0f172a",borderRadius:2}})})]})})})},Pp=()=>{const{logs:e,clearLogs:t}=Qe(),[n,r]=M.useState(null),[l,o]=M.useState(""),i=e.filter(s=>s.action.toLowerCase().includes(l.toLowerCase()));return a.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",gap:12},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[a.jsx("input",{type:"text",placeholder:"Lọc bridge action (vd: auth, payment)...",value:l,onChange:s=>o(s.target.value),style:{flex:1,padding:"6px 12px",borderRadius:6,border:"1px solid #334155",backgroundColor:"#0f172a",color:"#f8fafc",fontSize:13}}),a.jsxs("button",{onClick:t,title:"Xoá nhật ký",style:{padding:"6px 10px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#94a3b8",cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:12},children:[a.jsx(Qo,{size:14})," Xoá"]})]}),a.jsx("div",{style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:6},children:i.length===0?a.jsx("div",{style:{textAlign:"center",color:"#64748b",padding:"40px 10px",fontSize:13},children:"Chưa có cuộc gọi Bridge nào từ Mini App. Hãy thực hiện thao tác trong Mini App để theo dõi."}):i.map(s=>{const u=(n==null?void 0:n.id)===s.id;return a.jsxs("div",{onClick:()=>r(u?null:s),style:{padding:10,borderRadius:8,backgroundColor:u?"#1e293b":"#0f172a",border:`1px solid ${u?"#38bdf8":"#1e293b"}`,cursor:"pointer",fontSize:12,display:"flex",flexDirection:"column",gap:6},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[s.success?a.jsx(cc,{size:14,color:"#10b981"}):a.jsx(tp,{size:14,color:"#ef4444"}),a.jsx("span",{style:{fontWeight:600,color:"#f1f5f9"},children:s.action})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#94a3b8"},children:[a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:2,fontSize:11},children:[a.jsx(np,{size:11})," ",s.durationMs,"ms"]}),u?a.jsx(bf,{size:14}):a.jsx(ep,{size:14})]})]}),u&&a.jsxs("div",{style:{marginTop:6,paddingTop:8,borderTop:"1px solid #334155",display:"flex",flexDirection:"column",gap:8},children:[a.jsxs("div",{children:[a.jsx("div",{style:{color:"#94a3b8",fontSize:11,marginBottom:2},children:"Payload gửi đi:"}),a.jsx("pre",{style:{margin:0,padding:8,backgroundColor:"#020617",borderRadius:6,fontSize:11,color:"#e2e8f0",overflowX:"auto"},children:JSON.stringify(s.payload,null,2)})]}),a.jsxs("div",{children:[a.jsx("div",{style:{color:"#94a3b8",fontSize:11,marginBottom:2},children:"Kết quả phản hồi:"}),a.jsx("pre",{style:{margin:0,padding:8,backgroundColor:"#020617",borderRadius:6,fontSize:11,color:s.success?"#34d399":"#f87171",overflowX:"auto"},children:JSON.stringify(s.success?s.response:s.error,null,2)})]})]})]},s.id)})})]})},Ip=()=>{const{user:e,setUser:t,setUserPreset:n,mockEngine:r,sendEventToMiniApp:l}=Qe(),o=r.store.getSession();return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,fontSize:13,color:"#f1f5f9"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:600,marginBottom:8,color:"#94a3b8"},children:"Chọn tài khoản mẫu (Persona):"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[a.jsx("button",{onClick:()=>n("standard"),style:{padding:8,backgroundColor:e.id==="user_std_001"?"#0284c7":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#ffffff",cursor:"pointer",fontWeight:500,fontSize:12},children:"👤 Khách hàng chuẩn"}),a.jsx("button",{onClick:()=>n("vip"),style:{padding:8,backgroundColor:e.id==="user_vip_888"?"#7c3aed":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#ffffff",cursor:"pointer",fontWeight:500,fontSize:12},children:"💎 VIP Diamond (50tr)"}),a.jsx("button",{onClick:()=>n("lowBalance"),style:{padding:8,backgroundColor:e.id==="user_low_002"?"#d97706":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#ffffff",cursor:"pointer",fontWeight:500,fontSize:12},children:"⚠️ Số dư thấp (15k)"}),a.jsx("button",{onClick:()=>n("unverified"),style:{padding:8,backgroundColor:e.id==="user_guest_999"?"#dc2626":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#ffffff",cursor:"pointer",fontWeight:500,fontSize:12},children:"❓ Khách vãng lai"})]})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:10},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[a.jsx("img",{src:e.avatarUrl,alt:"Avatar",style:{width:44,height:44,borderRadius:"50%",objectFit:"cover"}}),a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{style:{fontWeight:700,fontSize:14},children:e.name}),a.jsx("div",{style:{color:"#94a3b8",fontSize:12},children:e.phone||"Chưa cung cấp SĐT"})]}),e.isVerified&&a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,backgroundColor:"#064e3b",color:"#34d399",padding:"2px 8px",borderRadius:12,fontSize:11,fontWeight:600},children:[a.jsx(fc,{size:12})," Đã xác thực"]})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,fontSize:12,marginTop:4},children:[a.jsxs("div",{children:[a.jsx("span",{style:{color:"#94a3b8"},children:"Vai trò:"})," ",a.jsx("span",{style:{fontWeight:600,color:"#38bdf8"},children:e.role})]}),a.jsxs("div",{children:[a.jsx("span",{style:{color:"#94a3b8"},children:"Số dư ví:"})," ",a.jsxs("span",{style:{fontWeight:600,color:"#10b981"},children:[e.walletBalance.toLocaleString("vi-VN")," đ"]})]})]})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:8},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:600,color:"#38bdf8"},children:[a.jsx(lp,{size:16})," Phiên Access Token"]}),o?a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:11,color:"#94a3b8",marginBottom:2},children:"Mã Token:"}),a.jsx("div",{style:{fontFamily:"monospace",fontSize:11,backgroundColor:"#020617",padding:6,borderRadius:4,color:"#facc15",wordBreak:"break-all"},children:o.accessToken}),a.jsxs("div",{style:{fontSize:11,color:"#94a3b8",marginTop:4},children:["Hết hạn sau: ",o.expiresIn,"s (",o.tokenType,")"]})]}):a.jsx("div",{style:{color:"#ef4444",fontSize:12},children:"Phiên đã hết hạn hoặc chưa đăng nhập"}),a.jsxs("div",{style:{display:"flex",gap:8,marginTop:4},children:[a.jsx("button",{onClick:()=>{r.store.createSession(),l("onAuthStatusChange",{loggedIn:!0})},style:{flex:1,padding:"6px 10px",backgroundColor:"#0369a1",color:"white",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,fontSize:12},children:"Làm mới Token"}),a.jsxs("button",{onClick:()=>{r.store.clearSession(),l("onAuthStatusChange",{loggedIn:!1})},style:{padding:"6px 10px",backgroundColor:"#334155",color:"#f87171",border:"none",borderRadius:6,cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:12},children:[a.jsx(op,{size:13})," Đăng xuất"]})]})]})]})},Np=()=>{const{deviceState:e,setDeviceState:t,network:n,setNetwork:r,mockEngine:l,sendEventToMiniApp:o}=Qe();return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,fontSize:13,color:"#f1f5f9"},children:[a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:10},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:6},children:[a.jsx(ac,{size:16,color:"#38bdf8"})," Giả lập Pin thiết bị"]}),a.jsxs("span",{style:{fontWeight:700,color:"#38bdf8"},children:[e.batteryLevel,"%"]})]}),a.jsx("input",{type:"range",min:"0",max:"100",value:e.batteryLevel,onChange:i=>t({batteryLevel:parseInt(i.target.value,10)}),style:{width:"100%",accentColor:"#0284c7"}}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsx("span",{style:{color:"#94a3b8",fontSize:12},children:"Đang cắm sạc (Charging):"}),a.jsx("input",{type:"checkbox",checked:e.isCharging,onChange:i=>t({isCharging:i.target.checked}),style:{width:16,height:16,accentColor:"#0284c7"}})]})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:10},children:[a.jsxs("div",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:6},children:[a.jsx(pc,{size:16,color:"#38bdf8"})," Mạng kết nối (Network Profile)"]}),a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:6},children:["wifi","5g","4g","2g","none"].map(i=>a.jsx("button",{onClick:()=>r({type:i,online:i!=="none"}),style:{padding:"6px 4px",backgroundColor:n.type===i?"#0284c7":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"white",fontSize:11,fontWeight:600,cursor:"pointer",textTransform:"uppercase"},children:i},i))})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:10},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:6},children:[a.jsx(sp,{size:16,color:"#38bdf8"})," Độ trễ Bridge (Latency Injection)"]}),a.jsxs("span",{style:{fontWeight:700,color:"#38bdf8"},children:[n.latencyMs," ms"]})]}),a.jsx("input",{type:"range",min:"0",max:"1500",step:"50",value:n.latencyMs,onChange:i=>{const s=parseInt(i.target.value,10);r({latencyMs:s}),l.setLatency(s)},style:{width:"100%",accentColor:"#0284c7"}})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:8},children:[a.jsx("div",{style:{fontWeight:600,color:"#94a3b8"},children:"Giả lập sự kiện vòng đời (Lifecycle Events):"}),a.jsxs("div",{style:{display:"flex",gap:8},children:[a.jsxs("button",{onClick:()=>o("appShow",{timestamp:Date.now()}),style:{flex:1,padding:"8px 10px",backgroundColor:"#065f46",color:"#34d399",border:"1px solid #047857",borderRadius:6,fontWeight:600,fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:4},children:[a.jsx(Gs,{size:14})," appShow"]}),a.jsxs("button",{onClick:()=>o("appHide",{timestamp:Date.now()}),style:{flex:1,padding:"8px 10px",backgroundColor:"#374151",color:"#d1d5db",border:"1px solid #4b5563",borderRadius:6,fontWeight:600,fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:4},children:[a.jsx(Gs,{size:14})," appHide"]})]})]})]})},Tp=()=>{const{mockEngine:e}=Qe(),[t,n]=M.useState(""),[r,l]=M.useState(""),[o,i]=M.useState(0),s=e.store.getStorage("mini_app_simulator"),u=Array.from(s.entries()),d=()=>{t.trim()&&(e.store.setStorageItem("mini_app_simulator",t.trim(),r),n(""),l(""),i(h=>h+1))},g=h=>{e.store.removeStorageItem("mini_app_simulator",h),i(k=>k+1)},m=()=>{e.store.clearStorage("mini_app_simulator"),i(h=>h+1)};return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,fontSize:13,color:"#f1f5f9"},children:[a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:8},children:[a.jsxs("div",{style:{fontWeight:600,color:"#38bdf8",display:"flex",alignItems:"center",gap:6},children:[a.jsx(dc,{size:16})," Thêm Key vào bộ nhớ Mini App"]}),a.jsxs("div",{style:{display:"flex",gap:6},children:[a.jsx("input",{type:"text",placeholder:"Key (vd: cart_id)",value:t,onChange:h=>n(h.target.value),style:{flex:1,padding:"6px 10px",backgroundColor:"#020617",border:"1px solid #334155",borderRadius:6,color:"white",fontSize:12}}),a.jsx("input",{type:"text",placeholder:"Value",value:r,onChange:h=>l(h.target.value),style:{flex:2,padding:"6px 10px",backgroundColor:"#020617",border:"1px solid #334155",borderRadius:6,color:"white",fontSize:12}}),a.jsxs("button",{onClick:d,style:{padding:"6px 12px",backgroundColor:"#0284c7",color:"white",border:"none",borderRadius:6,cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:12,fontWeight:600},children:[a.jsx(ip,{size:14})," Thêm"]})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{fontWeight:600,color:"#94a3b8"},children:["Dữ liệu đã lưu (",u.length,"):"]}),u.length>0&&a.jsxs("button",{onClick:m,style:{background:"none",border:"none",color:"#ef4444",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:4},children:[a.jsx(Qo,{size:13})," Xoá toàn bộ"]})]}),a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6,maxHeight:300,overflowY:"auto"},children:u.length===0?a.jsx("div",{style:{textAlign:"center",color:"#64748b",padding:"30px 0",fontSize:12},children:"Kho lưu trữ đang trống. Mini App có thể lưu qua `superApp.storage.setItem()`."}):u.map(([h,k])=>a.jsxs("div",{style:{backgroundColor:"#0f172a",border:"1px solid #1e293b",borderRadius:6,padding:"8px 10px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[a.jsxs("div",{style:{flex:1,overflow:"hidden"},children:[a.jsx("span",{style:{fontWeight:700,color:"#38bdf8",fontSize:12},children:h}),a.jsx("div",{style:{color:"#e2e8f0",fontSize:12,fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:k})]}),a.jsx("button",{onClick:()=>g(h),style:{background:"none",border:"none",cursor:"pointer",padding:4,color:"#94a3b8"},children:a.jsx(Qo,{size:14})})]},h))})]},o)},Mp=()=>{const{activeTab:e,setActiveTab:t,logs:n,user:r}=Qe(),l=[{id:"bridge",label:"Bridge Inspector",icon:Zf,count:n.length},{id:"auth",label:"Auth & Persona",icon:dp,note:r.name.split(" ")[0]},{id:"device",label:"Device & Hardware",icon:cp},{id:"storage",label:"Storage",icon:dc}];return a.jsxs("div",{style:{flex:1,backgroundColor:"#0b1120",borderRadius:16,border:"1px solid #1e293b",display:"flex",flexDirection:"column",overflow:"hidden",minWidth:420,maxWidth:600,height:"100%",boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.4)"},children:[a.jsx("div",{style:{display:"flex",backgroundColor:"#0f172a",borderBottom:"1px solid #1e293b",overflowX:"auto",padding:"4px 6px",gap:4},children:l.map(o=>{const i=e===o.id,s=o.icon;return a.jsxs("button",{onClick:()=>t(o.id),style:{display:"flex",alignItems:"center",gap:6,padding:"8px 12px",borderRadius:8,backgroundColor:i?"#1e293b":"transparent",color:i?"#38bdf8":"#94a3b8",border:"none",cursor:"pointer",fontWeight:i?600:500,fontSize:12,whiteSpace:"nowrap",transition:"all 0.15s ease"},children:[a.jsx(s,{size:15}),a.jsx("span",{children:o.label}),"count"in o&&o.count>0&&a.jsx("span",{style:{backgroundColor:i?"#0284c7":"#334155",color:"white",fontSize:10,fontWeight:700,padding:"1px 6px",borderRadius:10},children:o.count})]},o.id)})}),a.jsxs("div",{style:{flex:1,padding:16,overflowY:"auto"},children:[e==="bridge"&&a.jsx(Pp,{}),e==="auth"&&a.jsx(Ip,{}),e==="device"&&a.jsx(Np,{}),e==="storage"&&a.jsx(Tp,{})]})]})},Lp=()=>{const{miniAppUrl:e,setMiniAppUrl:t,reloadIframe:n,deviceType:r,setDeviceType:l,scale:o,setScale:i}=Qe(),[s,u]=M.useState(e),d=g=>{g.preventDefault(),s.trim()&&(t(s.trim()),n())};return a.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh",width:"100vw",overflow:"hidden",backgroundColor:"#030712"},children:[a.jsxs("header",{style:{height:56,backgroundColor:"#0f172a",borderBottom:"1px solid #1e293b",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 20px",gap:16,zIndex:20},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[a.jsx("div",{style:{width:32,height:32,borderRadius:8,backgroundColor:"#0068FF",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontWeight:800,fontSize:16},children:"S"}),a.jsxs("div",{children:[a.jsxs("div",{style:{fontWeight:700,fontSize:14,color:"#f8fafc",display:"flex",alignItems:"center",gap:6},children:["SuperApp Browser Simulator",a.jsx("span",{style:{fontSize:10,backgroundColor:"#0284c7",color:"white",padding:"1px 6px",borderRadius:10},children:"v1.0"})]}),a.jsx("div",{style:{fontSize:11,color:"#64748b"},children:"Mini App Developer Workbench"})]})]}),a.jsxs("form",{onSubmit:d,style:{display:"flex",alignItems:"center",flex:1,maxWidth:520,gap:6},children:[a.jsx("input",{type:"text",value:s,onChange:g=>u(g.target.value),placeholder:"http://localhost:3000",style:{flex:1,padding:"7px 12px",backgroundColor:"#020617",border:"1px solid #334155",borderRadius:8,color:"#38bdf8",fontSize:13,fontFamily:"monospace"}}),a.jsxs("button",{type:"submit",style:{padding:"7px 14px",backgroundColor:"#0284c7",color:"white",border:"none",borderRadius:8,fontSize:12,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[a.jsx(up,{size:13})," Nạp URL"]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.jsxs("div",{style:{display:"flex",backgroundColor:"#020617",padding:2,borderRadius:8,border:"1px solid #334155"},children:[a.jsx("button",{onClick:()=>l("iphone"),style:{padding:"4px 10px",borderRadius:6,backgroundColor:r==="iphone"?"#1e293b":"transparent",color:r==="iphone"?"#38bdf8":"#94a3b8",border:"none",cursor:"pointer",fontSize:12,fontWeight:600},children:"iPhone 15"}),a.jsx("button",{onClick:()=>l("android"),style:{padding:"4px 10px",borderRadius:6,backgroundColor:r==="android"?"#1e293b":"transparent",color:r==="android"?"#38bdf8":"#94a3b8",border:"none",cursor:"pointer",fontSize:12,fontWeight:600},children:"Android"})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,color:"#94a3b8",fontSize:12},children:[a.jsx(hp,{size:14}),a.jsxs("select",{value:o,onChange:g=>i(parseFloat(g.target.value)),style:{backgroundColor:"#020617",color:"#f8fafc",border:"1px solid #334155",borderRadius:6,padding:"4px 8px",fontSize:12,cursor:"pointer"},children:[a.jsx("option",{value:"0.75",children:"75%"}),a.jsx("option",{value:"0.85",children:"85%"}),a.jsx("option",{value:"0.9",children:"90%"}),a.jsx("option",{value:"1",children:"100%"})]})]})]})]}),a.jsxs("main",{style:{flex:1,display:"flex",gap:24,padding:20,overflow:"hidden",justifyContent:"center",alignItems:"flex-start"},children:[a.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"flex-start",overflowY:"auto",maxHeight:"calc(100vh - 96px)",padding:"10px 20px"},children:a.jsx(zp,{})}),a.jsx(Mp,{})]})]})};Jl.createRoot(document.getElementById("root")).render(a.jsx(Rc.StrictMode,{children:a.jsx(Cp,{children:a.jsx(Lp,{})})}));
199
+ ${t.message}`)),{confirmed:n}}async setNavigationBarTitle(t){return typeof document<"u"&&(document.title=t.title),{success:!0,title:t.title}}async setStatusBarColor(t){return{success:!0,color:t.color}}async setNavigationBarColor(t){return{success:!0,color:t.color,textColor:t.textColor||"black",statusBarColor:t.statusBarColor}}async configAppView(t={}){return{success:!0,actionBarHidden:!!t.actionBarHidden,statusBar:t.statusBar||"transparent",hideAndroidBottomNavigationBar:!!t.hideAndroidBottomNavigationBar,hasPadding:t.hasPadding!==!1,...t}}async requestSendNotification(t={}){return{success:!0,granted:!0,subscriptionId:`mock_sub_${Date.now()}`,token:`mock_notif_token_${Date.now()}`,templateId:t.templateId,reason:t.reason}}}class kp{async scanQRCode(t={}){return{content:"https://superapp.vn/pay?order=mock_qr_12345",format:"QR_CODE"}}async chooseImage(t={}){const n=t.count||1,r=["https://images.unsplash.com/photo-1546069901-ba9599a7e63c?w=500","https://images.unsplash.com/photo-1565299624946-b28f40a0ae38?w=500"];return{tempFilePaths:r.slice(0,n),count:Math.min(n,r.length)}}}class wp{constructor(t){J(this,"approvalHook");this.store=t}setApprovalHook(t){this.approvalHook=t}async requestPayment(t){const n=Number(t.amount)||0,r=t.orderId||`ORD_${Date.now()}_${Math.floor(1e3+Math.random()*9e3)}`,l={orderId:r,amount:n,description:t.description||"Thanh toán dịch vụ Mini App",extraData:{currency:t.currency||"VND"}};if(this.approvalHook&&!await this.approvalHook(l))throw{code:"USER_CANCELLED",message:"Người dùng đã huỷ giao dịch thanh toán"};const o=this.store.getUser();if(o.walletBalance<n)throw{code:"INSUFFICIENT_FUNDS",message:`Số dư ví SuperApp Pay (${o.walletBalance.toLocaleString("vi-VN")} đ) không đủ để thanh toán ${n.toLocaleString("vi-VN")} đ`};this.store.deductBalance(n);const s={status:"SUCCESS",transactionId:`TXN_${Date.now()}_${Math.random().toString(36).substring(2,8).toUpperCase()}`,orderId:r,amount:n,timestamp:Date.now(),paymentMethod:"SUPERAPP_WALLET",message:"Thanh toán thành công qua Ví SuperApp"};return this.store.addTransaction(s),s}async createOrder(t){return{orderId:`ORD_${Date.now()}_${Math.floor(1e3+Math.random()*9e3)}`,amount:Number(t.amount)||0,currency:t.currency||"VND",status:"PENDING"}}}class Sp{constructor(t={}){J(this,"store");J(this,"auth");J(this,"device");J(this,"storage");J(this,"ui");J(this,"media");J(this,"payment");J(this,"latencyMs");J(this,"logListeners",new Set);J(this,"logs",[]);this.store=new gp(t.storageKeyPrefix),this.latencyMs=t.simulatedLatencyMs??40,this.auth=new mp(this.store),this.device=new yp(this.store),this.storage=new vp(this.store),this.ui=new xp,this.media=new kp,this.payment=new wp(this.store)}setLatency(t){this.latencyMs=t}onLog(t){return this.logListeners.add(t),()=>this.logListeners.delete(t)}getLogs(){return[...this.logs]}clearLogs(){this.logs=[]}async dispatch(t){const n=Date.now();this.latencyMs>0&&await new Promise(r=>setTimeout(r,this.latencyMs));try{const r=await this.routeAction(t),l=Date.now()-n,o={id:t.id,action:t.action,success:!0,data:r,timestamp:Date.now()};return this.recordLog({id:t.id,action:t.action,payload:t.payload,response:r,durationMs:l,timestamp:n,success:!0}),o}catch(r){const l=Date.now()-n,o={code:(r==null?void 0:r.code)||"ACTION_FAILED",message:(r==null?void 0:r.message)||"Operation failed in mock engine",details:r==null?void 0:r.details},i={id:t.id,action:t.action,success:!1,error:o,timestamp:Date.now()};return this.recordLog({id:t.id,action:t.action,payload:t.payload,error:o,durationMs:l,timestamp:n,success:!1}),i}}recordLog(t){this.logs.unshift(t),this.logs.length>200&&this.logs.pop(),this.logListeners.forEach(n=>{try{n(t)}catch(r){console.error("[SDKMockEngine] Error in log listener:",r)}})}async routeAction(t){var i;const{action:n,payload:r,appId:l}=t,o=r||{};switch(n){case"auth.login":case"login":return this.auth.login(o);case"auth.requestCode":return this.auth.requestCode(o);case"auth.exchangeCode":return this.auth.exchangeCode(o);case"auth.getAccessToken":case"getAccessToken":return this.auth.getAccessToken();case"auth.getUserProfile":case"getUserProfile":case"user.getProfile":return this.auth.getUserProfile();case"user.getBasicInfo":return this.auth.getBasicInfo();case"auth.refreshToken":return this.auth.refreshToken(o);case"auth.logout":return this.auth.logout();case"payment.requestPayment":case"payment.openCheckout":case"requestPayment":return this.payment.requestPayment(o);case"payment.createOrder":return this.payment.createOrder(o);case"device.getBatteryInfo":case"getBatteryInfo":return this.device.getBatteryInfo();case"device.getNetworkInfo":case"getNetworkInfo":return this.device.getNetworkInfo();case"device.getDeviceInfo":case"getDeviceInfo":return this.device.getDeviceInfo();case"device.getSystemInfo":case"getSystemInfo":return this.device.getSystemInfo();case"getAppInfo":return{appId:l||"mini_app",version:"1.0.0",platformVersion:"2.0.0",appName:"SuperApp Mini App"};case"device.getLocation":case"getLocation":return{latitude:21.028511,longitude:105.854167,accuracy:10,altitude:12,speed:0,address:"Hà Nội, Việt Nam"};case"getDeviceLanguage":return{language:this.store.getDeviceState().language||"vi-VN"};case"getSuperAppSettings":return{theme:"dark",notificationsEnabled:!0,language:"vi-VN",appVersion:"1.0.0"};case"device.vibrate":case"vibrate":return this.device.vibrate(o);case"device.keepScreen":case"keepScreen":return this.device.keepScreen(o);case"copyToClipboard":return{success:!0,text:o.text};case"setBrightness":return{success:!0,brightness:o.brightness};case"getContacts":return{contacts:[{id:"c_01",name:"Nguyễn Văn An",phone:"0988123456",email:"an.nguyen@example.com"},{id:"c_02",name:"Trần Thị Mai",phone:"0912345678",email:"mai.tran@example.com"}]};case"permission.request":case"permission.check":case"permission.getPermissions":return{granted:!0,capability:o.capability,permissions:{camera:"granted",location:"granted",notification:"granted",photos:"granted"}};case"storage.getItem":case"getStorage":case"storage.getSecureItem":case"storage.getSecretData":case"getSecretData":return this.storage.getItem(l,o);case"storage.setItem":case"setStorage":case"storage.setSecureItem":case"storage.setSecretData":case"setSecretData":return this.storage.setItem(l,o);case"storage.removeItem":case"removeStorage":case"storage.removeSecureItem":case"storage.removeSecretData":case"removeSecretData":return this.storage.removeItem(l,o);case"storage.clear":case"clearStorage":return this.storage.clear(l);case"storage.getAll":return this.storage.getAll(l);case"storage.getCredentials":return{username:this.store.getUser().email,token:(i=this.store.getSession())==null?void 0:i.accessToken,role:this.store.getUser().role};case"storage.setCredentials":case"storage.deleteCredentials":return{success:!0};case"ui.showToast":case"showToast":return this.ui.showToast(o);case"ui.showAlert":case"showAlert":return this.ui.showAlert(o);case"ui.showConfirm":case"showConfirm":return this.ui.showConfirm(o);case"ui.setNavigationBarTitle":case"setTitle":case"setNavigationBarTitle":return this.ui.setNavigationBarTitle(o);case"ui.setStatusBarColor":case"setStatusBarColor":return this.ui.setStatusBarColor(o);case"ui.setNavigationBarColor":case"setNavigationBarColor":return this.ui.setNavigationBarColor(o);case"ui.configAppView":case"configAppView":return this.ui.configAppView(o);case"ui.requestSendNotification":case"requestSendNotification":return this.ui.requestSendNotification(o);case"showMiniappMenu":case"ui.showMiniappMenu":return{success:!0,message:"Menu triggered"};case"media.scanQRCode":case"scanQr":case"device.scanQRCode":return this.media.scanQRCode(o);case"media.chooseImage":case"getPhoto":case"device.pickImage":case"pickImages":return this.media.chooseImage(o);case"saveImageToGallery":case"saveVideoToGallery":case"pickVideo":case"saveFile":case"pickFile":case"filePreview":return{success:!0,uri:o.uri||"mock_file_uri_"+Date.now(),name:o.fileName||"demo_file.png"};case"navigation.closeApp":case"closeApp":case"navigation.close":return{success:!0,message:"App closed"};case"navigation.minimizeApp":case"minimizeApp":return{success:!0,status:"minimized",appId:l};case"navigation.openMiniApp":return{success:!0,targetAppId:o.appId};case"navigation.openNativePage":return{success:!0,page:o.page,params:o.params};case"openPhone":case"openSMS":case"openExternalBrowser":case"openDeepLink":return{success:!0};case"speechToText":return{success:!0,text:"Nội dung nhận diện giọng nói thử nghiệm",lang:o.lang||"vi-VN"};case"hideKeyboard":return{success:!0};case"debug.echo":return o;case"debug.simulateFailure":throw{code:o.type||"SIMULATED_FAILURE",message:"Mô phỏng lỗi debug từ Simulator"};default:return console.warn(`[SDKMockEngine] Action "${n}" not specifically handled. Returning generic success.`),{success:!0,action:n,payload:o}}}}const gc=M.createContext(null),Cp=({children:e})=>{const[t]=M.useState(()=>new Sp({autoApprovePayment:!0})),[n,r]=M.useState(()=>typeof window<"u"&&new URLSearchParams(window.location.search).get("url")||"http://localhost:3000"),[l,o]=M.useState("iphone"),[i,s]=M.useState(1),[u,d]=M.useState([]),[g,m]=M.useState("bridge"),[h,k]=M.useState(!1),[w,S]=M.useState(1),[A,f]=M.useState(null),[c,p]=M.useState(()=>t.store.getUser()),[v,C]=M.useState(()=>t.store.getNetworkCondition()),[j,_]=M.useState(()=>t.store.getDeviceState()),z=M.useRef(null);M.useEffect(()=>{const F=t.onLog(y=>{d(P=>[y,...P.slice(0,150)])});return()=>{F()}},[t]),M.useEffect(()=>{h?t.payment.setApprovalHook(F=>new Promise(y=>{z.current=y,f({order:F,resolve:y})})):t.payment.setApprovalHook(void 0)},[t,h]),M.useEffect(()=>{const F=async y=>{const P=y.data;if(!P)return;if(P.type==="MINIAPP_CLOSE"||P.type==="MINIAPP_MINIMIZE"){t.onLog(Me=>d(nt=>[Me,...nt.slice(0,150)]));return}let I=null;if(P.type==="SUPERAPP_BRIDGE_REQUEST"&&P.request?I=P.request:P.id&&P.action&&(I=P),!I||!I.id||!I.action)return;const O=await t.dispatch(I);p(t.store.getUser()),_(t.store.getDeviceState());const Y={type:"SUPERAPP_BRIDGE_RESPONSE",response:O};y.source&&"postMessage"in y.source&&y.source.postMessage(Y,"*"),document.querySelectorAll("iframe").forEach(Me=>{var nt;(nt=Me.contentWindow)==null||nt.postMessage(Y,"*")})};return window.addEventListener("message",F),()=>window.removeEventListener("message",F)},[t]);const W=F=>{z.current&&(z.current(F),z.current=null),f(null)},N=F=>{const y=t.store.setUser(F);p(y),Te("session.changed",{user:y,status:"LOGGED_IN"}),Te("auth.userChanged",{user:y}),Te("auth.sessionChanged",{state:"logged_in",user:y,userId:y.id})},ve=F=>{const y=t.store.setUserPreset(F);p(y),Te("session.changed",{user:y,status:"LOGGED_IN"}),Te("auth.userChanged",{user:y}),Te("auth.sessionChanged",{state:"logged_in",user:y,userId:y.id})},Ct=F=>{t.store.setNetworkCondition(F);const y=t.store.getNetworkCondition();C(y),Te("miniapp.networkChanged",{isConnected:y.online,networkType:y.type})},Et=F=>{t.store.updateDeviceState(F);const y=t.store.getDeviceState();_(y),Te("miniapp.batteryChanged",{batteryLevel:y.batteryLevel,isCharging:y.isCharging})},sr=()=>{S(F=>F+1)},Te=(F,y)=>{document.querySelectorAll("iframe").forEach(I=>{var O;(O=I.contentWindow)==null||O.postMessage({type:"SUPERAPP_BRIDGE_EVENT",event:F,payload:y},"*")})},mn=()=>{t.clearLogs(),d([])};return a.jsx(gc.Provider,{value:{mockEngine:t,miniAppUrl:n,setMiniAppUrl:r,deviceType:l,setDeviceType:o,scale:i,setScale:s,logs:u,clearLogs:mn,activeTab:g,setActiveTab:m,user:c,setUser:N,setUserPreset:ve,network:v,setNetwork:Ct,deviceState:j,setDeviceState:Et,manualPaymentMode:h,setManualPaymentMode:k,pendingPayment:A,resolvePayment:W,reloadIframe:sr,iframeKey:w,sendEventToMiniApp:Te},children:e})},Qe=()=>{const e=M.useContext(gc);if(!e)throw new Error("useSimulator must be used inside SimulatorProvider");return e},Ep=()=>{const{deviceType:e,network:t,deviceState:n}=Qe(),[r,l]=M.useState("09:41");return M.useEffect(()=>{const o=()=>{const s=new Date;l(`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`)};o();const i=setInterval(o,1e4);return()=>clearInterval(i)},[]),a.jsxs("div",{style:{height:44,padding:"0 20px",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:"#ffffff",color:"#000000",fontSize:13,fontWeight:600,userSelect:"none",position:"relative",borderTopLeftRadius:e==="iphone"?44:28,borderTopRightRadius:e==="iphone"?44:28},children:[a.jsx("span",{children:r}),e==="iphone"?a.jsx("div",{style:{position:"absolute",top:10,left:"50%",transform:"translateX(-50%)",width:110,height:28,backgroundColor:"#000000",borderRadius:18,zIndex:10}}):a.jsx("div",{style:{position:"absolute",top:12,left:"50%",transform:"translateX(-50%)",width:14,height:14,backgroundColor:"#000000",borderRadius:"50%",zIndex:10}}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[t.online?a.jsx("span",{style:{fontSize:11,fontWeight:700},children:t.type.toUpperCase()}):a.jsx("span",{style:{fontSize:11,color:"#ef4444"},children:"OFFLINE"}),t.online?a.jsx(pc,{size:14}):a.jsx(pp,{size:14,color:"#ef4444"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[a.jsxs("span",{style:{fontSize:11},children:[n.batteryLevel,"%"]}),n.isCharging?a.jsx(ac,{size:16,color:"#10b981"}):a.jsx(qf,{size:16})]})]})]})},_p=({title:e="Mini App"})=>{const{reloadIframe:t,sendEventToMiniApp:n}=Qe();return a.jsxs("div",{style:{height:48,padding:"0 12px",backgroundColor:"#ffffff",borderBottom:"1px solid #e2e8f0",display:"flex",alignItems:"center",justifyContent:"space-between",color:"#0f172a"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.jsx("button",{onClick:()=>n("onNavigateBack",{}),title:"Back",style:{background:"none",border:"none",cursor:"pointer",padding:4,display:"flex",alignItems:"center"},children:a.jsx(Jf,{size:18,color:"#0f172a"})}),a.jsx("span",{style:{fontSize:15,fontWeight:600,maxWidth:160,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",backgroundColor:"#f1f5f9",border:"1px solid #cbd5e1",borderRadius:20,padding:"2px 6px",gap:6},children:[a.jsx("button",{onClick:t,title:"Tải lại Mini App",style:{background:"none",border:"none",cursor:"pointer",padding:2,display:"flex",alignItems:"center"},children:a.jsx(ap,{size:13,color:"#475569"})}),a.jsx("div",{style:{width:1,height:12,backgroundColor:"#cbd5e1"}}),a.jsx("button",{title:"Menu",style:{background:"none",border:"none",cursor:"pointer",padding:2,display:"flex",alignItems:"center"},children:a.jsx(rp,{size:14,color:"#475569"})}),a.jsx("div",{style:{width:1,height:12,backgroundColor:"#cbd5e1"}}),a.jsx("button",{onClick:()=>alert("Đóng Mini App - Trở về màn hình chính SuperApp"),title:"Đóng Mini App",style:{background:"none",border:"none",cursor:"pointer",padding:2,display:"flex",alignItems:"center"},children:a.jsx(hc,{size:14,color:"#475569"})})]})]})},jp=()=>{const{pendingPayment:e,resolvePayment:t,user:n}=Qe();if(!e)return null;const{order:r}=e,l=n.walletBalance>=r.amount;return a.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:100,animation:"fadeIn 0.2s ease"},children:a.jsxs("div",{style:{backgroundColor:"#ffffff",borderTopLeftRadius:24,borderTopRightRadius:24,padding:20,color:"#0f172a",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.15)"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(fc,{size:20,color:"#0068FF"}),a.jsx("span",{style:{fontWeight:700,fontSize:16},children:"SuperApp Pay"})]}),a.jsx("button",{onClick:()=>t(!1),style:{background:"none",border:"none",cursor:"pointer",padding:4},children:a.jsx(hc,{size:18,color:"#64748b"})})]}),a.jsxs("div",{style:{textAlign:"center",margin:"12px 0 20px"},children:[a.jsx("div",{style:{fontSize:13,color:"#64748b"},children:"Tổng tiền thanh toán"}),a.jsxs("div",{style:{fontSize:28,fontWeight:800,color:"#0068FF"},children:[r.amount.toLocaleString("vi-VN")," đ"]}),a.jsx("div",{style:{fontSize:13,fontWeight:500,color:"#334155",marginTop:4},children:r.description||"Thanh toán dịch vụ Mini App"})]}),a.jsx("div",{style:{backgroundColor:"#f8fafc",borderRadius:12,padding:12,marginBottom:20,border:"1px solid #e2e8f0"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[a.jsx("div",{style:{width:36,height:36,borderRadius:8,backgroundColor:"#dbeafe",display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsx(fp,{size:20,color:"#0068FF"})}),a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:600,fontSize:14},children:"Ví điện tử SuperApp"}),a.jsxs("div",{style:{fontSize:12,color:l?"#10b981":"#ef4444"},children:["Số dư: ",n.walletBalance.toLocaleString("vi-VN")," đ",!l&&" (Không đủ số dư)"]})]})]}),a.jsx(cc,{size:18,color:"#0068FF"})]})}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[a.jsx("button",{onClick:()=>t(!0),disabled:!l,style:{padding:"14px",backgroundColor:l?"#0068FF":"#94a3b8",color:"white",border:"none",borderRadius:12,fontWeight:700,fontSize:15,cursor:l?"pointer":"not-allowed"},children:"Xác nhận thanh toán"}),a.jsx("button",{onClick:()=>t(!1),style:{padding:"12px",backgroundColor:"transparent",color:"#64748b",border:"none",borderRadius:12,fontWeight:600,fontSize:14,cursor:"pointer"},children:"Huỷ giao dịch"})]})]})})},zp=()=>{const{deviceType:e,scale:t,miniAppUrl:n,iframeKey:r,sendEventToMiniApp:l,user:o}=Qe(),i=e==="iphone"?390:412,s=e==="iphone"?844:880;return a.jsx("div",{style:{transform:`scale(${t})`,transformOrigin:"top center",transition:"transform 0.2s ease"},children:a.jsx("div",{style:{width:i,height:s,backgroundColor:"#000000",borderRadius:e==="iphone"?52:36,padding:10,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.15)",position:"relative",display:"flex",flexDirection:"column"},children:a.jsxs("div",{style:{flex:1,backgroundColor:"#ffffff",borderRadius:e==="iphone"?44:28,overflow:"hidden",display:"flex",flexDirection:"column",position:"relative"},children:[a.jsx(Ep,{}),a.jsx(_p,{title:"SuperApp Mini App"}),a.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[a.jsx("iframe",{src:n,title:"Mini App Simulator View",style:{width:"100%",height:"100%",border:"none",backgroundColor:"#f8fafc"},allow:"geolocation; camera; microphone",onLoad:()=>{setTimeout(()=>{l("miniapp.ready",{appId:"mini_app",timestamp:Date.now()}),l("session.changed",{user:o,status:"LOGGED_IN"})},150)}},r),a.jsx(jp,{})]}),e==="iphone"&&a.jsx("div",{style:{height:20,backgroundColor:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsx("div",{style:{width:130,height:4,backgroundColor:"#0f172a",borderRadius:2}})})]})})})},Pp=()=>{const{logs:e,clearLogs:t}=Qe(),[n,r]=M.useState(null),[l,o]=M.useState(""),i=e.filter(s=>s.action.toLowerCase().includes(l.toLowerCase()));return a.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",gap:12},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[a.jsx("input",{type:"text",placeholder:"Lọc bridge action (vd: auth, payment)...",value:l,onChange:s=>o(s.target.value),style:{flex:1,padding:"6px 12px",borderRadius:6,border:"1px solid #334155",backgroundColor:"#0f172a",color:"#f8fafc",fontSize:13}}),a.jsxs("button",{onClick:t,title:"Xoá nhật ký",style:{padding:"6px 10px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#94a3b8",cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:12},children:[a.jsx(Qo,{size:14})," Xoá"]})]}),a.jsx("div",{style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:6},children:i.length===0?a.jsx("div",{style:{textAlign:"center",color:"#64748b",padding:"40px 10px",fontSize:13},children:"Chưa có cuộc gọi Bridge nào từ Mini App. Hãy thực hiện thao tác trong Mini App để theo dõi."}):i.map(s=>{const u=(n==null?void 0:n.id)===s.id;return a.jsxs("div",{onClick:()=>r(u?null:s),style:{padding:10,borderRadius:8,backgroundColor:u?"#1e293b":"#0f172a",border:`1px solid ${u?"#38bdf8":"#1e293b"}`,cursor:"pointer",fontSize:12,display:"flex",flexDirection:"column",gap:6},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[s.success?a.jsx(cc,{size:14,color:"#10b981"}):a.jsx(tp,{size:14,color:"#ef4444"}),a.jsx("span",{style:{fontWeight:600,color:"#f1f5f9"},children:s.action})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#94a3b8"},children:[a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:2,fontSize:11},children:[a.jsx(np,{size:11})," ",s.durationMs,"ms"]}),u?a.jsx(bf,{size:14}):a.jsx(ep,{size:14})]})]}),u&&a.jsxs("div",{style:{marginTop:6,paddingTop:8,borderTop:"1px solid #334155",display:"flex",flexDirection:"column",gap:8},children:[a.jsxs("div",{children:[a.jsx("div",{style:{color:"#94a3b8",fontSize:11,marginBottom:2},children:"Payload gửi đi:"}),a.jsx("pre",{style:{margin:0,padding:8,backgroundColor:"#020617",borderRadius:6,fontSize:11,color:"#e2e8f0",overflowX:"auto"},children:JSON.stringify(s.payload,null,2)})]}),a.jsxs("div",{children:[a.jsx("div",{style:{color:"#94a3b8",fontSize:11,marginBottom:2},children:"Kết quả phản hồi:"}),a.jsx("pre",{style:{margin:0,padding:8,backgroundColor:"#020617",borderRadius:6,fontSize:11,color:s.success?"#34d399":"#f87171",overflowX:"auto"},children:JSON.stringify(s.success?s.response:s.error,null,2)})]})]})]},s.id)})})]})},Ip=()=>{const{user:e,setUser:t,setUserPreset:n,mockEngine:r,sendEventToMiniApp:l}=Qe(),o=r.store.getSession();return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,fontSize:13,color:"#f1f5f9"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:600,marginBottom:8,color:"#94a3b8"},children:"Chọn tài khoản mẫu (Persona):"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[a.jsx("button",{onClick:()=>n("standard"),style:{padding:8,backgroundColor:e.id==="user_std_001"?"#0284c7":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#ffffff",cursor:"pointer",fontWeight:500,fontSize:12},children:"👤 Khách hàng chuẩn"}),a.jsx("button",{onClick:()=>n("vip"),style:{padding:8,backgroundColor:e.id==="user_vip_888"?"#7c3aed":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#ffffff",cursor:"pointer",fontWeight:500,fontSize:12},children:"💎 VIP Diamond (50tr)"}),a.jsx("button",{onClick:()=>n("lowBalance"),style:{padding:8,backgroundColor:e.id==="user_low_002"?"#d97706":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#ffffff",cursor:"pointer",fontWeight:500,fontSize:12},children:"⚠️ Số dư thấp (15k)"}),a.jsx("button",{onClick:()=>n("unverified"),style:{padding:8,backgroundColor:e.id==="user_guest_999"?"#dc2626":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"#ffffff",cursor:"pointer",fontWeight:500,fontSize:12},children:"❓ Khách vãng lai"})]})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:10},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[a.jsx("img",{src:e.avatarUrl,alt:"Avatar",style:{width:44,height:44,borderRadius:"50%",objectFit:"cover"}}),a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{style:{fontWeight:700,fontSize:14},children:e.name}),a.jsx("div",{style:{color:"#94a3b8",fontSize:12},children:e.phone||"Chưa cung cấp SĐT"})]}),e.isVerified&&a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,backgroundColor:"#064e3b",color:"#34d399",padding:"2px 8px",borderRadius:12,fontSize:11,fontWeight:600},children:[a.jsx(fc,{size:12})," Đã xác thực"]})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,fontSize:12,marginTop:4},children:[a.jsxs("div",{children:[a.jsx("span",{style:{color:"#94a3b8"},children:"Vai trò:"})," ",a.jsx("span",{style:{fontWeight:600,color:"#38bdf8"},children:e.role})]}),a.jsxs("div",{children:[a.jsx("span",{style:{color:"#94a3b8"},children:"Số dư ví:"})," ",a.jsxs("span",{style:{fontWeight:600,color:"#10b981"},children:[e.walletBalance.toLocaleString("vi-VN")," đ"]})]})]})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:8},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:600,color:"#38bdf8"},children:[a.jsx(lp,{size:16})," Phiên Access Token"]}),o?a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:11,color:"#94a3b8",marginBottom:2},children:"Mã Token:"}),a.jsx("div",{style:{fontFamily:"monospace",fontSize:11,backgroundColor:"#020617",padding:6,borderRadius:4,color:"#facc15",wordBreak:"break-all"},children:o.accessToken}),a.jsxs("div",{style:{fontSize:11,color:"#94a3b8",marginTop:4},children:["Hết hạn sau: ",o.expiresIn,"s (",o.tokenType,")"]})]}):a.jsx("div",{style:{color:"#ef4444",fontSize:12},children:"Phiên đã hết hạn hoặc chưa đăng nhập"}),a.jsxs("div",{style:{display:"flex",gap:8,marginTop:4},children:[a.jsx("button",{onClick:()=>{r.store.createSession(),l("onAuthStatusChange",{loggedIn:!0})},style:{flex:1,padding:"6px 10px",backgroundColor:"#0369a1",color:"white",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,fontSize:12},children:"Làm mới Token"}),a.jsxs("button",{onClick:()=>{r.store.clearSession(),l("onAuthStatusChange",{loggedIn:!1})},style:{padding:"6px 10px",backgroundColor:"#334155",color:"#f87171",border:"none",borderRadius:6,cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:12},children:[a.jsx(op,{size:13})," Đăng xuất"]})]})]})]})},Np=()=>{const{deviceState:e,setDeviceState:t,network:n,setNetwork:r,mockEngine:l,sendEventToMiniApp:o}=Qe();return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,fontSize:13,color:"#f1f5f9"},children:[a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:10},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:6},children:[a.jsx(ac,{size:16,color:"#38bdf8"})," Giả lập Pin thiết bị"]}),a.jsxs("span",{style:{fontWeight:700,color:"#38bdf8"},children:[e.batteryLevel,"%"]})]}),a.jsx("input",{type:"range",min:"0",max:"100",value:e.batteryLevel,onChange:i=>t({batteryLevel:parseInt(i.target.value,10)}),style:{width:"100%",accentColor:"#0284c7"}}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsx("span",{style:{color:"#94a3b8",fontSize:12},children:"Đang cắm sạc (Charging):"}),a.jsx("input",{type:"checkbox",checked:e.isCharging,onChange:i=>t({isCharging:i.target.checked}),style:{width:16,height:16,accentColor:"#0284c7"}})]})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:10},children:[a.jsxs("div",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:6},children:[a.jsx(pc,{size:16,color:"#38bdf8"})," Mạng kết nối (Network Profile)"]}),a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:6},children:["wifi","5g","4g","2g","none"].map(i=>a.jsx("button",{onClick:()=>r({type:i,online:i!=="none"}),style:{padding:"6px 4px",backgroundColor:n.type===i?"#0284c7":"#1e293b",border:"1px solid #334155",borderRadius:6,color:"white",fontSize:11,fontWeight:600,cursor:"pointer",textTransform:"uppercase"},children:i},i))})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:10},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:6},children:[a.jsx(sp,{size:16,color:"#38bdf8"})," Độ trễ Bridge (Latency Injection)"]}),a.jsxs("span",{style:{fontWeight:700,color:"#38bdf8"},children:[n.latencyMs," ms"]})]}),a.jsx("input",{type:"range",min:"0",max:"1500",step:"50",value:n.latencyMs,onChange:i=>{const s=parseInt(i.target.value,10);r({latencyMs:s}),l.setLatency(s)},style:{width:"100%",accentColor:"#0284c7"}})]}),a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:8},children:[a.jsx("div",{style:{fontWeight:600,color:"#94a3b8"},children:"Giả lập sự kiện vòng đời (Lifecycle Events):"}),a.jsxs("div",{style:{display:"flex",gap:8},children:[a.jsxs("button",{onClick:()=>o("appShow",{timestamp:Date.now()}),style:{flex:1,padding:"8px 10px",backgroundColor:"#065f46",color:"#34d399",border:"1px solid #047857",borderRadius:6,fontWeight:600,fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:4},children:[a.jsx(Gs,{size:14})," appShow"]}),a.jsxs("button",{onClick:()=>o("appHide",{timestamp:Date.now()}),style:{flex:1,padding:"8px 10px",backgroundColor:"#374151",color:"#d1d5db",border:"1px solid #4b5563",borderRadius:6,fontWeight:600,fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:4},children:[a.jsx(Gs,{size:14})," appHide"]})]})]})]})},Tp=()=>{const{mockEngine:e}=Qe(),[t,n]=M.useState(""),[r,l]=M.useState(""),[o,i]=M.useState(0),s=e.store.getStorage("mini_app_simulator"),u=Array.from(s.entries()),d=()=>{t.trim()&&(e.store.setStorageItem("mini_app_simulator",t.trim(),r),n(""),l(""),i(h=>h+1))},g=h=>{e.store.removeStorageItem("mini_app_simulator",h),i(k=>k+1)},m=()=>{e.store.clearStorage("mini_app_simulator"),i(h=>h+1)};return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,fontSize:13,color:"#f1f5f9"},children:[a.jsxs("div",{style:{backgroundColor:"#0f172a",borderRadius:8,padding:12,border:"1px solid #1e293b",display:"flex",flexDirection:"column",gap:8},children:[a.jsxs("div",{style:{fontWeight:600,color:"#38bdf8",display:"flex",alignItems:"center",gap:6},children:[a.jsx(dc,{size:16})," Thêm Key vào bộ nhớ Mini App"]}),a.jsxs("div",{style:{display:"flex",gap:6},children:[a.jsx("input",{type:"text",placeholder:"Key (vd: cart_id)",value:t,onChange:h=>n(h.target.value),style:{flex:1,padding:"6px 10px",backgroundColor:"#020617",border:"1px solid #334155",borderRadius:6,color:"white",fontSize:12}}),a.jsx("input",{type:"text",placeholder:"Value",value:r,onChange:h=>l(h.target.value),style:{flex:2,padding:"6px 10px",backgroundColor:"#020617",border:"1px solid #334155",borderRadius:6,color:"white",fontSize:12}}),a.jsxs("button",{onClick:d,style:{padding:"6px 12px",backgroundColor:"#0284c7",color:"white",border:"none",borderRadius:6,cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:12,fontWeight:600},children:[a.jsx(ip,{size:14})," Thêm"]})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{fontWeight:600,color:"#94a3b8"},children:["Dữ liệu đã lưu (",u.length,"):"]}),u.length>0&&a.jsxs("button",{onClick:m,style:{background:"none",border:"none",color:"#ef4444",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:4},children:[a.jsx(Qo,{size:13})," Xoá toàn bộ"]})]}),a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6,maxHeight:300,overflowY:"auto"},children:u.length===0?a.jsx("div",{style:{textAlign:"center",color:"#64748b",padding:"30px 0",fontSize:12},children:"Kho lưu trữ đang trống. Mini App có thể lưu qua `superApp.storage.setItem()`."}):u.map(([h,k])=>a.jsxs("div",{style:{backgroundColor:"#0f172a",border:"1px solid #1e293b",borderRadius:6,padding:"8px 10px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[a.jsxs("div",{style:{flex:1,overflow:"hidden"},children:[a.jsx("span",{style:{fontWeight:700,color:"#38bdf8",fontSize:12},children:h}),a.jsx("div",{style:{color:"#e2e8f0",fontSize:12,fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:k})]}),a.jsx("button",{onClick:()=>g(h),style:{background:"none",border:"none",cursor:"pointer",padding:4,color:"#94a3b8"},children:a.jsx(Qo,{size:14})})]},h))})]},o)},Mp=()=>{const{activeTab:e,setActiveTab:t,logs:n,user:r}=Qe(),l=[{id:"bridge",label:"Bridge Inspector",icon:Zf,count:n.length},{id:"auth",label:"Auth & Persona",icon:dp,note:r.name.split(" ")[0]},{id:"device",label:"Device & Hardware",icon:cp},{id:"storage",label:"Storage",icon:dc}];return a.jsxs("div",{style:{flex:1,backgroundColor:"#0b1120",borderRadius:16,border:"1px solid #1e293b",display:"flex",flexDirection:"column",overflow:"hidden",minWidth:420,maxWidth:600,height:"100%",boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.4)"},children:[a.jsx("div",{style:{display:"flex",backgroundColor:"#0f172a",borderBottom:"1px solid #1e293b",overflowX:"auto",padding:"4px 6px",gap:4},children:l.map(o=>{const i=e===o.id,s=o.icon;return a.jsxs("button",{onClick:()=>t(o.id),style:{display:"flex",alignItems:"center",gap:6,padding:"8px 12px",borderRadius:8,backgroundColor:i?"#1e293b":"transparent",color:i?"#38bdf8":"#94a3b8",border:"none",cursor:"pointer",fontWeight:i?600:500,fontSize:12,whiteSpace:"nowrap",transition:"all 0.15s ease"},children:[a.jsx(s,{size:15}),a.jsx("span",{children:o.label}),"count"in o&&o.count>0&&a.jsx("span",{style:{backgroundColor:i?"#0284c7":"#334155",color:"white",fontSize:10,fontWeight:700,padding:"1px 6px",borderRadius:10},children:o.count})]},o.id)})}),a.jsxs("div",{style:{flex:1,padding:16,overflowY:"auto"},children:[e==="bridge"&&a.jsx(Pp,{}),e==="auth"&&a.jsx(Ip,{}),e==="device"&&a.jsx(Np,{}),e==="storage"&&a.jsx(Tp,{})]})]})},Lp=()=>{const{miniAppUrl:e,setMiniAppUrl:t,reloadIframe:n,deviceType:r,setDeviceType:l,scale:o,setScale:i}=Qe(),[s,u]=M.useState(e),d=g=>{g.preventDefault(),s.trim()&&(t(s.trim()),n())};return a.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh",width:"100vw",overflow:"hidden",backgroundColor:"#030712"},children:[a.jsxs("header",{style:{height:56,backgroundColor:"#0f172a",borderBottom:"1px solid #1e293b",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 20px",gap:16,zIndex:20},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[a.jsx("div",{style:{width:32,height:32,borderRadius:8,backgroundColor:"#0068FF",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontWeight:800,fontSize:16},children:"S"}),a.jsxs("div",{children:[a.jsxs("div",{style:{fontWeight:700,fontSize:14,color:"#f8fafc",display:"flex",alignItems:"center",gap:6},children:["SuperApp Browser Simulator",a.jsx("span",{style:{fontSize:10,backgroundColor:"#0284c7",color:"white",padding:"1px 6px",borderRadius:10},children:"v1.0"})]}),a.jsx("div",{style:{fontSize:11,color:"#64748b"},children:"Mini App Developer Workbench"})]})]}),a.jsxs("form",{onSubmit:d,style:{display:"flex",alignItems:"center",flex:1,maxWidth:520,gap:6},children:[a.jsx("input",{type:"text",value:s,onChange:g=>u(g.target.value),placeholder:"http://localhost:3000",style:{flex:1,padding:"7px 12px",backgroundColor:"#020617",border:"1px solid #334155",borderRadius:8,color:"#38bdf8",fontSize:13,fontFamily:"monospace"}}),a.jsxs("button",{type:"submit",style:{padding:"7px 14px",backgroundColor:"#0284c7",color:"white",border:"none",borderRadius:8,fontSize:12,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[a.jsx(up,{size:13})," Nạp URL"]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.jsxs("div",{style:{display:"flex",backgroundColor:"#020617",padding:2,borderRadius:8,border:"1px solid #334155"},children:[a.jsx("button",{onClick:()=>l("iphone"),style:{padding:"4px 10px",borderRadius:6,backgroundColor:r==="iphone"?"#1e293b":"transparent",color:r==="iphone"?"#38bdf8":"#94a3b8",border:"none",cursor:"pointer",fontSize:12,fontWeight:600},children:"iPhone 15"}),a.jsx("button",{onClick:()=>l("android"),style:{padding:"4px 10px",borderRadius:6,backgroundColor:r==="android"?"#1e293b":"transparent",color:r==="android"?"#38bdf8":"#94a3b8",border:"none",cursor:"pointer",fontSize:12,fontWeight:600},children:"Android"})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,color:"#94a3b8",fontSize:12},children:[a.jsx(hp,{size:14}),a.jsxs("select",{value:o,onChange:g=>i(parseFloat(g.target.value)),style:{backgroundColor:"#020617",color:"#f8fafc",border:"1px solid #334155",borderRadius:6,padding:"4px 8px",fontSize:12,cursor:"pointer"},children:[a.jsx("option",{value:"0.75",children:"75%"}),a.jsx("option",{value:"0.85",children:"85%"}),a.jsx("option",{value:"0.9",children:"90%"}),a.jsx("option",{value:"1",children:"100%"})]})]})]})]}),a.jsxs("main",{style:{flex:1,display:"flex",gap:24,padding:20,overflow:"hidden",justifyContent:"center",alignItems:"flex-start"},children:[a.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"flex-start",overflowY:"auto",maxHeight:"calc(100vh - 96px)",padding:"10px 20px"},children:a.jsx(zp,{})}),a.jsx(Mp,{})]})]})};Jl.createRoot(document.getElementById("root")).render(a.jsx(Rc.StrictMode,{children:a.jsx(Cp,{children:a.jsx(Lp,{})})}));
@@ -7,7 +7,7 @@
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
10
- <script type="module" crossorigin src="/assets/index-kRVYB6or.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-DpHZwm7N.js"></script>
11
11
  </head>
12
12
  <body style="margin: 0; padding: 0; background-color: #0b0f19; font-family: 'Inter', sans-serif; color: #f1f5f9;">
13
13
  <div id="root"></div>